src/hotspot/share/oops/constantPool.cpp
changeset 52062 8dbf1a13af49
parent 51486 67b55f3c45eb
child 52067 2e72562697bf
equal deleted inserted replaced
52061:070186461dbb 52062:8dbf1a13af49
    31 #include "classfile/systemDictionary.hpp"
    31 #include "classfile/systemDictionary.hpp"
    32 #include "classfile/vmSymbols.hpp"
    32 #include "classfile/vmSymbols.hpp"
    33 #include "interpreter/linkResolver.hpp"
    33 #include "interpreter/linkResolver.hpp"
    34 #include "memory/allocation.inline.hpp"
    34 #include "memory/allocation.inline.hpp"
    35 #include "memory/heapInspection.hpp"
    35 #include "memory/heapInspection.hpp"
       
    36 #include "memory/heapShared.hpp"
    36 #include "memory/metadataFactory.hpp"
    37 #include "memory/metadataFactory.hpp"
    37 #include "memory/metaspaceClosure.hpp"
    38 #include "memory/metaspaceClosure.hpp"
    38 #include "memory/metaspaceShared.hpp"
    39 #include "memory/metaspaceShared.hpp"
    39 #include "memory/oopFactory.hpp"
    40 #include "memory/oopFactory.hpp"
    40 #include "memory/resourceArea.hpp"
    41 #include "memory/resourceArea.hpp"
   293           rr->obj_at_put(i, op);
   294           rr->obj_at_put(i, op);
   294         }
   295         }
   295       }
   296       }
   296     }
   297     }
   297 
   298 
   298     oop archived = MetaspaceShared::archive_heap_object(rr, THREAD);
   299     oop archived = HeapShared::archive_heap_object(rr, THREAD);
   299     // If the resolved references array is not archived (too large),
   300     // If the resolved references array is not archived (too large),
   300     // the 'archived' object is NULL. No need to explicitly check
   301     // the 'archived' object is NULL. No need to explicitly check
   301     // the return value of archive_heap_object here. At runtime, the
   302     // the return value of archive_heap_object here. At runtime, the
   302     // resolved references will be created using the normal process
   303     // resolved references will be created using the normal process
   303     // when there is no archived value.
   304     // when there is no archived value.
   338   restore_vtable();
   339   restore_vtable();
   339 
   340 
   340   if (SystemDictionary::Object_klass_loaded()) {
   341   if (SystemDictionary::Object_klass_loaded()) {
   341     ClassLoaderData* loader_data = pool_holder()->class_loader_data();
   342     ClassLoaderData* loader_data = pool_holder()->class_loader_data();
   342 #if INCLUDE_CDS_JAVA_HEAP
   343 #if INCLUDE_CDS_JAVA_HEAP
   343     if (MetaspaceShared::open_archive_heap_region_mapped() &&
   344     if (HeapShared::open_archive_heap_region_mapped() &&
   344         _cache->archived_references() != NULL) {
   345         _cache->archived_references() != NULL) {
   345       oop archived = _cache->archived_references();
   346       oop archived = _cache->archived_references();
   346       // Create handle for the archived resolved reference array object
   347       // Create handle for the archived resolved reference array object
   347       Handle refs_handle(THREAD, archived);
   348       Handle refs_handle(THREAD, archived);
   348       set_resolved_references(loader_data->add_handle(refs_handle));
   349       set_resolved_references(loader_data->add_handle(refs_handle));
   371     resolved_references() != NULL ? resolved_references()->length() : 0);
   372     resolved_references() != NULL ? resolved_references()->length() : 0);
   372 
   373 
   373   // If archiving heap objects is not allowed, clear the resolved references.
   374   // If archiving heap objects is not allowed, clear the resolved references.
   374   // Otherwise, it is cleared after the resolved references array is cached
   375   // Otherwise, it is cleared after the resolved references array is cached
   375   // (see archive_resolved_references()).
   376   // (see archive_resolved_references()).
   376   if (!MetaspaceShared::is_heap_object_archiving_allowed()) {
   377   if (!HeapShared::is_heap_object_archiving_allowed()) {
   377     set_resolved_references(NULL);
   378     set_resolved_references(NULL);
   378   }
   379   }
   379 
   380 
   380   // Shared ConstantPools are in the RO region, so the _flags cannot be modified.
   381   // Shared ConstantPools are in the RO region, so the _flags cannot be modified.
   381   // The _on_stack flag is used to prevent ConstantPools from deallocation during
   382   // The _on_stack flag is used to prevent ConstantPools from deallocation during