[ Home ]
SBCL Internals

The pages on this CLiki-driven site can be edited by anybody at any time. No warranty of any kind can therefore be made; any implied warranties of merchantability or fitness for a particular purpose are expressly disclaimed
[ Home ] [ Recent Changes ] [ About CLiki ] [ Text Formatting ]

On non-x86 ports, the Number Stack is the stack for FFI call frames and non-descriptor? values - raw system pointers, storage for non-descriptor? register contents, parts of bignum computations etc. It's also used by the OS when a signal happens, so the NSP register contents have to be valid at all times.

The NFP on the other hand is not always used - CMUCL docs say "if any representation is chosen which could involve packing into the non-descriptor-stack? SB, then we allocate the NFP register throughout the component"

A function that uses the number stack must clean up before returning or making a tail call.

x86 doesn't have quite the same thing: it has an alien stack, but FFI calls actually push their stuff on the Control Stack instead. This is (aiui) one of the reasons that the x86 needs a conservative GC GENCGC - because we can't scavenge the control stack accurately.

WHN: I think that there's another, more fundamental reason we can't scavenge the control stack on the x86. My impression is that because the CPU has so few registers, the x86 port decided not to try to segregate them into tagged and untagged. Then, since there's no way to tell the taggedness of register values at runtime, there's of course no way to tell the taggedness of values saved from registers onto the control stack. Thus, we have to scavenge the control stack conservatively. Then since we have to scavenge it conservatively anyway, why not push numbers on there too? (particularly since we're so short of registers that we don't want to keep extra stack pointers around)


Page in this topic: NFP  


Also linked from: Calling Convention   control stack   GENCGC   Registers   SB   VOP   x86  

CLiki pages can be edited by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively