< prev index next >

src/hotspot/share/oops/cpCache.cpp

Print this page
@@ -47,10 +47,11 @@
  #include "oops/constantPool.inline.hpp"
  #include "oops/cpCache.inline.hpp"
  #include "oops/method.inline.hpp"
  #include "oops/objArrayOop.inline.hpp"
  #include "oops/oop.inline.hpp"
+ #include "oops/method.inline.hpp"
  #include "oops/resolvedFieldEntry.hpp"
  #include "oops/resolvedIndyEntry.hpp"
  #include "oops/resolvedMethodEntry.hpp"
  #include "prims/methodHandles.hpp"
  #include "runtime/arguments.hpp"

@@ -174,11 +175,12 @@
          method->name() != vmSymbols::object_initializer_name()) {
        do_resolve = false;
      }
      if (invoke_code == Bytecodes::_invokestatic) {
        assert(method->method_holder()->is_initialized() ||
-              method->method_holder()->is_reentrant_initialization(JavaThread::current()),
+              method->method_holder()->is_reentrant_initialization(JavaThread::current()) ||
+              (CDSConfig::is_dumping_archive() && VM_Version::supports_fast_class_init_checks()),
               "invalid class initialization state for invoke_static");
  
        if (!VM_Version::supports_fast_class_init_checks() && method->needs_clinit_barrier()) {
          // Don't mark invokestatic to method as resolved if the holder class has not yet completed
          // initialization. An invokestatic must only proceed if the class is initialized, but if

@@ -416,11 +418,13 @@
    ConstantPool* src_cp =  ArchiveBuilder::current()->get_source_addr(cp);
    for (int i = 0; i < _resolved_field_entries->length(); i++) {
      ResolvedFieldEntry* rfi = _resolved_field_entries->adr_at(i);
      int cp_index = rfi->constant_pool_index();
      bool archived = false;
-     bool resolved = rfi->is_resolved(Bytecodes::_getfield)  ||
+     bool resolved = rfi->is_resolved(Bytecodes::_getstatic) ||
+                     rfi->is_resolved(Bytecodes::_putstatic) ||
+                     rfi->is_resolved(Bytecodes::_getfield)  ||
                      rfi->is_resolved(Bytecodes::_putfield);
      if (resolved && AOTConstantPoolResolver::is_resolution_deterministic(src_cp, cp_index)) {
        rfi->mark_and_relocate();
        archived = true;
      } else {

@@ -452,16 +456,13 @@
      ResolvedMethodEntry* rme = _resolved_method_entries->adr_at(i);
      int cp_index = rme->constant_pool_index();
      bool archived = false;
      bool resolved = rme->is_resolved(Bytecodes::_invokevirtual)   ||
                      rme->is_resolved(Bytecodes::_invokespecial)   ||
+                   //rme->is_resolved(Bytecodes::_invokestatic)    || // FIXME -- leyden+JEP483 merge
                      rme->is_resolved(Bytecodes::_invokeinterface) ||
                      rme->is_resolved(Bytecodes::_invokehandle);
- 
-     // Just for safety -- this should not happen, but do not archive if we ever see this.
-     resolved &= !(rme->is_resolved(Bytecodes::_invokestatic));
- 
      if (resolved && can_archive_resolved_method(src_cp, rme)) {
        rme->mark_and_relocate(src_cp);
        archived = true;
      } else {
        rme->remove_unshareable_info();

@@ -555,11 +556,12 @@
  
    if (!AOTConstantPoolResolver::is_resolution_deterministic(src_cp, cp_index)) {
      return false;
    }
  
-   if (method_entry->is_resolved(Bytecodes::_invokeinterface) ||
+   if (method_entry->is_resolved(Bytecodes::_invokestatic) ||
+       method_entry->is_resolved(Bytecodes::_invokeinterface) ||
        method_entry->is_resolved(Bytecodes::_invokevirtual) ||
        method_entry->is_resolved(Bytecodes::_invokespecial)) {
      return true;
    } else if (method_entry->is_resolved(Bytecodes::_invokehandle)) {
      if (CDSConfig::is_dumping_invokedynamic()) {
< prev index next >