Escape analysis for objects with injected fields

Doug Simon @ Oracle doug.simon at
Thu Nov 8 00:25:38 PST 2012

While debugging a deoptimization issue in Graal[1], I (painfully) learnt of the importance of field ordering in the relationship between escape analyzed (EA) objects and deoptimization. In particular, the values in the DebugInfo for an EA'ed object must correspond with the field order returned by Klass::do_nonstatic_fields(). However, that latter function does not include internal/injected fields such as the 'loader_data' and 'dependencies' fields injected into java.lang.ClassLoader instances. So, my question is what happens when such an object is EA'ed and rematerialized during deoptimization? As far as I can tell, these fields will be left uninitialized. At least, I cannot see any code in c1 or c2 (e.g., line 704 of [2]) that omits such objects from EA.

Am I missing something or is HotSpot just getting lucky by never determining that such objects are worthy of EA?



More information about the hotspot-dev mailing list