[MLton] MLton.Finalizable.touch

Stephen Weeks sweeks@sweeks.com
Thu, 25 Aug 2005 14:25:54 -0700


For those interested in the fix to Florian's bug, the underlying
primitive used to implement MLton.Finalizable.touch is called
MLton_touch.  While in the end MLton_touch is implemented as a no-op,
this must be delayed long enough so that the optimizer thinks that the
value touched by MLton_touch is live.  The problem was that
MLton_touch was eliminated during SSA to RSSA translation, but that
liveness is computed at the the end of RSSA optimization.  So, in
Florian's code, the liveness pass missed the fact that the touched
value was live because the no-op had already been simplified away.  To
fix the problem, I moved the implementation of touch as a no-op to
just after the liveness pass, where it should have been all along.