[MLton] gc question

Jake Donham jdonham at cs.cmu.edu
Thu Jan 18 14:45:15 PST 2007


Hi,

I am looking into implementing the Cheng-Blelloch garbage collector for
MLton (as part of my grad school work). At the moment I'm trying to
understand how the existing system works and I have a couple questions:

I am confused about how register allocation and spilling in a codegen
work with the stack frame layouts used by the gc, and with stack limit
checking. The frame layouts don't include space for spilled registers,
but this is OK since nothing in a register is live at gc calls, so the
spilled registers don't need to be traced--is that right? How do the
stack limit checks account for the stack space used for spilled
registers?

The Cheng-Blelloch collector is incremental and uses a write barrier on
heap writes. I'm trying to see in what MLton pass it would be best to
add the write barrier; it seems like the Machine IL has all the writes
explicitly, and perhaps the heap writes could be determined from the
operands here (or perhaps more information is needed from earlier
passes). Any thoughts on this?

References on the collector if you are interested:

  http://www.cs.cmu.edu/afs/cs.cmu.edu/project/scandal/public/papers/pldi99.pdf
  http://www.cs.cmu.edu/~guyb/papers/gc2001.pdf

Thanks,

Jake



More information about the MLton mailing list