cakeml
cakeml copied to clipboard
Use return addresses to index bitmaps
Currently stackLang programs write a number onto the stack at each function call. The number is an index into the bitmaps (used by the GC if it is called).
An alternative approach is to use the return address as a means to find the right bitmap entry. One could e.g. look up the relevant bitmap index from a hash table that maps return addresses to bitmap indexes.
The advantage with the alternative approach is that each function call only needs to put the return address into a specific location in the stack frame. The index is no longer required. Very neat!