The mechanism used to successfully debug and integrate primitive write barriers into trunk was a write protected heap. This mechanism was never included in trunk and is made available here in the research archive.
The MMTk side of the write barriers (primitive and reference) was modified to make the update into the heap via a mmaped page alias. Code that directly attempted to write to the heap caused a SIGSEGV and the resulting stack trace allowed for the correct barrier to be inserted. For more details of this approach see: http://www.cs.kent.ac.uk/people/rpg/lh243/conferences/index.html#MM-NET09
The major drawback of this approach is that it is an "all or nothing" approach protecting all fields within the heap. This means that the attached patches also includes barriers on TIB, lock, hash status and alignment gap writes - this is why the code was never included back into trunk.
The compiler and MMTk support in these patches is not exactly the same as that in trunk but does demonstrate the principles used.
These patches are based on r15761
If you have any questions or comments please feel free to ask
Log in to post a comment.