hotspot/src/share/vm/c1/c1_Runtime1.cpp
changeset 35543 0961315f4016
parent 35542 9dccb7f9f656
child 35546 b75e269c0922
--- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp	Fri Dec 18 20:23:26 2015 +0300
+++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp	Fri Dec 18 20:23:27 2015 +0300
@@ -954,20 +954,25 @@
     constantPoolHandle pool(thread, caller_method->constants());
     int index = bytecode.index();
     LinkResolver::resolve_invoke(info, Handle(), pool, index, bc, CHECK);
-    appendix = info.resolved_appendix();
     switch (bc) {
       case Bytecodes::_invokehandle: {
         int cache_index = ConstantPool::decode_cpcache_index(index, true);
         assert(cache_index >= 0 && cache_index < pool->cache()->length(), "unexpected cache index");
-        pool->cache()->entry_at(cache_index)->set_method_handle(pool, info);
+        ConstantPoolCacheEntry* cpce = pool->cache()->entry_at(cache_index);
+        cpce->set_method_handle(pool, info);
+        appendix = info.resolved_appendix();  // just in case somebody already resolved the entry
         break;
       }
       case Bytecodes::_invokedynamic: {
-        pool->invokedynamic_cp_cache_entry_at(index)->set_dynamic_call(pool, info);
+        ConstantPoolCacheEntry* cpce = pool->invokedynamic_cp_cache_entry_at(index);
+        cpce->set_dynamic_call(pool, info);
+        appendix = cpce->appendix_if_resolved(pool); // just in case somebody already resolved the entry
         break;
       }
       default: fatal("unexpected bytecode for load_appendix_patching_id");
     }
+    assert(appendix.not_null(), "%s @ %d (%s)",
+           caller_method->name_and_sig_as_C_string(), bci, Bytecodes::name(bc));
   } else {
     ShouldNotReachHere();
   }