darcs patch: Immediately tag initialization code to prevent untagge...
Edward Z. Yang
ezyang at MIT.EDU
Wed Mar 23 14:45:24 CET 2011
1 patch for repository http://darcs.haskell.org/ghc:
Wed Mar 23 13:43:30 GMT 2011 Edward Z. Yang <ezyang at mit.edu>
* Immediately tag initialization code to prevent untagged spills.
When allocating new objects on the heap, we previously returned
a CmmExpr containing the heap pointer as well as the tag expression,
which would be added to the code graph upon first usage. Unfortunately,
this meant that untagged heap pointers living in registers might
be spilled to the stack, where they interacted poorly with garbage
collection (we saw this bug specifically with the compacting garbage
This fix immediately tags the register containing the heap pointer,
so that unless we have extremely unfriendly spill code, the new pointer
will never be spilled to the stack untagged.
An alternate solution might have been to modify allocDynClosure to
tag the pointer upon the initial register allocation, but not all
invocations of allocDynClosure tag the resulting pointer, and
threading the consequent CgIdInfo for the cases that did would have
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 310501 bytes
Desc: A darcs patch for your repository!
More information about the Cvs-ghc