RFR: 8229839: Break circular dependency between oop.inline.hpp and markWord.inline.hpp

Stefan Karlsson stefan.karlsson at oracle.com
Mon Aug 19 14:11:31 UTC 2019

Hi all,

Please review this patch to break the circular dependency between 
oop.inline.hpp and markWord.inline.hpp.


The patch removes the call to oopDesc::klass() from markWord.inline.hpp. 
This is done by passing in the klass from callers to the different 
markWord::must_be_preserved functions.

Some of the paths inside markWord::must_be:preserved don't need the 
klass, and calling oopDesc::klass() in those cases would be wasteful. To 
prevent this, I changed the code to allow the callers to provide a 
KlassProxy that can resolve to a const Klass* when and if a Klass is 
needed. I'm not sure if this is needed or not, but I didn't want to 
pessimise the code by introducing new calls to oopDesc::klass().

I also took the opportunity to consolidate and remove some code 
duplication in must_be_preserved functions. This could of course be 
split into a separate patch if that's requested.

Testing done locally. Will run tier123.


More information about the hotspot-gc-dev mailing list