-
Notifications
You must be signed in to change notification settings - Fork 32
IAssassinLarceny
Felix S. Klock II edited this page Jul 28, 2013
·
2 revisions
One of the LarcenyVariants; this one uses the SassyAssembler as a backend for generating IntelArchitecture (IA32, aka x86, Pentium, etc) machine code. The name is sometimes abbreviated IasnLarceny, or just Iasn.
A PetitLarcenyDerivative, derived from PetitLarceny-Nasm, by taking the Nasm backend and porting it almost directly to emit Sassy code rather than Nasm code.
- Since it now keeps its code in bytevectors, and the code is position independent (to survive forced-migration by the garbage collector), PnkFelix thinks of IAssassinLarceny as a NativeCodeLarceny variant.
- Making it use PositionIndependentCode required changes to the
setrtn
,invoke
, andjump
instructions.- (There may be others as well that PnkFelix isn't thinking of at the moment...)
Unfortunately, SassyIsDogSlow. :( Using Sassy can be much slower than invoking Nasm, it seems. But its not clear whether this is an inherent problem with Sassy itself or some problem with the code we are constructing to pass to Sassy. (PnkFelix suspects the former is hurting us more than the latter.)
See also:
Random notes:
- The C stack on Mac OS X needs to be kept 16-byte aligned. We currently break this invariant in our C calling protocol defined in
i386-millicode.asm
. - Mac OS X's version of nasm might still have bugs.
- In particular, PnkFelix believes that it is not honoring the
align
directive in the text segment. (However, it seems that it might be consistently off by 1 byte, which means that we can work around it, but it would be nice to have that fixed...)- It took PnkFelix way too long to track down this particular problem, which manifested itself in the garbage collector when it encountered a vector whose first element looked like a tagged pointer into space that we knew nothing about. The reality was that this "tagged pointer" was an unaligned address of a millicode runtime function,
i386_stack_underflow
. (See StackCacheAndGc for more info on the idea behind this.) - We may want to add some sanity checking code at some point, where we first check that the address we're storing looks like it has a fixnum tag before we stash it in there!
- It took PnkFelix way too long to track down this particular problem, which manifested itself in the garbage collector when it encountered a vector whose first element looked like a tagged pointer into space that we knew nothing about. The reality was that this "tagged pointer" was an unaligned address of a millicode runtime function,