src/hotspot/share/oops/constantPool.cpp
changeset 54927 1512d88b24c6
parent 54786 ebf733a324d4
child 57511 00ae3b739184
child 58678 9cf78a70fa4f
equal deleted inserted replaced
54926:d4e7ccaf1445 54927:1512d88b24c6
   369     resolved_references() != NULL ? resolved_references()->length() : 0);
   369     resolved_references() != NULL ? resolved_references()->length() : 0);
   370 
   370 
   371   // If archiving heap objects is not allowed, clear the resolved references.
   371   // If archiving heap objects is not allowed, clear the resolved references.
   372   // Otherwise, it is cleared after the resolved references array is cached
   372   // Otherwise, it is cleared after the resolved references array is cached
   373   // (see archive_resolved_references()).
   373   // (see archive_resolved_references()).
   374   if (!HeapShared::is_heap_object_archiving_allowed()) {
   374   // If DynamicDumpSharedSpaces is enabled, clear the resolved references also
       
   375   // as java objects are not archived in the top layer.
       
   376   if (!HeapShared::is_heap_object_archiving_allowed() || DynamicDumpSharedSpaces) {
   375     set_resolved_references(NULL);
   377     set_resolved_references(NULL);
   376   }
   378   }
   377 
   379 
   378   // Shared ConstantPools are in the RO region, so the _flags cannot be modified.
   380   // Shared ConstantPools are in the RO region, so the _flags cannot be modified.
   379   // The _on_stack flag is used to prevent ConstantPools from deallocation during
   381   // The _on_stack flag is used to prevent ConstantPools from deallocation during
   380   // class redefinition. Since shared ConstantPools cannot be deallocated anyway,
   382   // class redefinition. Since shared ConstantPools cannot be deallocated anyway,
   381   // we always set _on_stack to true to avoid having to change _flags during runtime.
   383   // we always set _on_stack to true to avoid having to change _flags during runtime.
   382   _flags |= (_on_stack | _is_shared);
   384   _flags |= (_on_stack | _is_shared);
   383   int num_klasses = 0;
   385   int num_klasses = 0;
   384   for (int index = 1; index < length(); index++) { // Index 0 is unused
   386   for (int index = 1; index < length(); index++) { // Index 0 is unused
   385     assert(!tag_at(index).is_unresolved_klass_in_error(), "This must not happen during dump time");
   387     if (!DynamicDumpSharedSpaces) {
       
   388       assert(!tag_at(index).is_unresolved_klass_in_error(), "This must not happen during static dump time");
       
   389     } else {
       
   390       if (tag_at(index).is_unresolved_klass_in_error() ||
       
   391           tag_at(index).is_method_handle_in_error()    ||
       
   392           tag_at(index).is_method_type_in_error()      ||
       
   393           tag_at(index).is_dynamic_constant_in_error()) {
       
   394         tag_at_put(index, JVM_CONSTANT_UnresolvedClass);
       
   395       }
       
   396     }
   386     if (tag_at(index).is_klass()) {
   397     if (tag_at(index).is_klass()) {
   387       // This class was resolved as a side effect of executing Java code
   398       // This class was resolved as a side effect of executing Java code
   388       // during dump time. We need to restore it back to an UnresolvedClass,
   399       // during dump time. We need to restore it back to an UnresolvedClass,
   389       // so that the proper class loading and initialization can happen
   400       // so that the proper class loading and initialization can happen
   390       // at runtime.
   401       // at runtime.