[Openmcl-devel] CCL LAP info...
Jon S. Anthony
j-anthony at comcast.net
Mon Feb 15 02:21:19 UTC 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  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)
> >>  (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.
> >> ;; pass last two parameters in registers
> >>  (movl ($ 8) (% arg_y))
> >>  (movl ($ 12) (% arg_z))
> >> ;; number of arguments, as a fixnum
> >> ;; on x8632, temp1 doubles as nargs
> >>  (movl ($ 12) (% temp1))
> >>  (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)?
More information about the Openmcl-devel