RFR (S) JDK-8178712: ResourceMark may be missing inside initialize_[vi]table

Calvin Cheung calvin.cheung at oracle.com
Tue Jul 10 19:10:24 UTC 2018

Hi Lois,

I'm wondering if the ResourceMark in the following function in 
universe.cpp could be removed?
If I understand the code correctly, the ResourceMark is necessary for 
Universe::reinitialize_itables() which calls into 
klassItable::initialize_itable() where you've added ResourceMark with 
your change.

bool universe_post_init() {
   assert(!is_init_completed(), "Error: initialization not yet completed!");
   Universe::_fully_initialized = true;
   { ResourceMark rm;
     Interpreter::initialize();      // needed for interpreter entry points
     if (!UseSharedSpaces) {
       HandleMark hm(THREAD);
       Klass* ok = SystemDictionary::Object_klass();
       Universe::reinitialize_vtable_of(ok, CHECK_false);

It looks good otherwise.


On 7/10/18, 10:19 AM, Lois Foltan wrote:
> Please review this clean up change to correctly set ResourceMark from 
> within klassVtable::initialize_vtable() and 
> klassItable::initialize_itable() when applicable, instead of having 
> all instances of calls to these two methods establish a ResourceMark 
> unnecessarily prior to.
> open webrev at http://cr.openjdk.java.net/~lfoltan/bug_jdk8178712/
> bug link at https://bugs.openjdk.java.net/browse/JDK-8178712
> Testing: hs-tier1-3, jdk-tier1-3 (complete)
>                hs-tier4-5 (in progress)
> Thanks,
> Lois

More information about the hotspot-runtime-dev mailing list