[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: issue COMPILE-ENVIRONMENT-CONSISTENCY



> Are there any implementations out there that actually *do* block
> compilation?  

Yes: KCL.  As you know, KCL compiles into C.  So a Lisp procedure P
becomes a C procedure Ln that looks more or less like this:

     static L2()
     {
             ... <C initialization> ...

     TTL:;   /* self-tail label */

             ... <C code for the body of P> ...
     }

With the default optimize settings, the following optimizations are
done:

  1. Calls from P to itself are compiled as transfers to TTL rather
     than as procedure calls.

  2. Calls to P from other procedures in the same file are compiled
     as direct calls to the C procedure rather than as

        symlispcall(<ref to the symbol F>, <base>, <nargs>);

     Omitting the symlispcall is faster (one C call rather than two)
     and avoids saving any "invokation history" for backtrace.

> Does it happen by default?

Yes.

Note, however, that AKCL works differently.  It uses calls through a
link table (like translink in Franz) instead of direct calls to the
C procedure.

Jeff Dalton,                      JANET: J.Dalton@uk.ac.ed             
AI Applications Institute,        ARPA:  J.Dalton%uk.ac.ed@nss.cs.ucl.ac.uk
Edinburgh University.             UUCP:  ...!ukc!ed.ac.uk!J.Dalton