[Openmcl-devel] CCL LAP info...

Jon S. Anthony j-anthony at comcast.net
Sun Feb 14 18:21:19 PST 2010


On Sun, 2010-02-14 at 19:36 -0500, R. Matthew Emerson wrote:
> On Feb 14, 2010, at 1:48 PM, Jon S. Anthony wrote:
> 
> > Thanks, that is some valuable info!  BTW, I've seen TCR and this fn
> > being "established" and such, and have wondered what they are being used
> > for/as.  Couple sentence description?
> 
> Chapter 16 of the manual talks about this stuff a little bit.  It should be basically accurate, too.

Criminey.  Somehow missed this.  Sorry...


> %fn contains the address of the current function.  It's used to reference the function's "constants"  and also to enable the GC to identify what function the program counter (er, "instruction pointer") is in.  (See [33] in the disassembly below;  we're loading the symbol 3-ARG-TAKER from the function's constants.)

Ah, that's a bit more detail and useful!


> >> Example:
> >> 
> >> (defx8632lapfunction 3-arg-taker ((stack-arg1 4) #|(ra 0)|#
> > 
...
> > 
> >>          ;; pass the first parameter on the stack
> >>          ;; (the number 4 represents fixnum 1)
> >>  [16]    (pushl ($ 4))
> > 
> > This is very interesting - this seems to indicate that CCL uses the
> > _low_ order bits as the tag bits?  That would explain some things...
> 
> Right.  Chapter 16 of the manual talks about tagging, too.

Sorry again...


> >> 	  ;; pass last two parameters in registers
> >>  [18]    (movl ($ 8) (% arg_y))
> >>  [23]    (movl ($ 12) (% arg_z))
> >>          ;; number of arguments, as a fixnum
> >>          ;; on x8632, temp1 doubles as nargs
> >>  [28]    (movl ($ 12) (% temp1))
> >>  [33]    (movl (@ '3-ARG-TAKER (% fn)) (% temp0))
> > 
> > Out of curiosity, what's in fn here?
> 
> The address of the function 3-ARG-CALLER.

So, as you pointed out earlier (and Gary went over this a bit too) fn
provides the "context" of the current function.  In this code (from the
original example) does temp0 also have this address and is used to make
the actual call (in that example generated code)?

/Jon





More information about the Openmcl-devel mailing list