Garbage collection is a pretty critical decision when building a virtual machine. It determines a bunch of other decisions such as object layout in memory. For a good overview of different garbage collection techniques checkout wikipedia. To see some of the other issues that you face when actually building a GC, there is a really good FAQ on the I.E.C.C GC List FAQ.
Normal binary would be:
SquirrelFish internal representation:
There are other tags in SquirrelFish as well. The implementation details as well as the other comments are in JSImmediate.h..
* Tip from Aaron. Pointers are guaranteed to point to aligned word boundaries.
[ high 30 bits: pointer address ] [ low 2 bits -- always 0 ]
[ high 31 bits: signed integer ] [ lowest bit -- always 1 ]
000000000000000000000000000 01 10
[ boolean value ] [ bool ] [ tag 'other' ]
000000000000000000000000000 10 10
[ zero ] [ undefined ] [ tag 'other' ]
000000000000000000000000000 00 10
[ zero ] [ zero ] [ tag 'other' ]