src/hotspot/share/interpreter/rewriter.cpp
changeset 53746 bdccafc038a2
parent 51592 1ddd1ec04431
child 53838 c8c9bd65c198
--- a/src/hotspot/share/interpreter/rewriter.cpp	Wed Feb 13 14:20:40 2019 -0500
+++ b/src/hotspot/share/interpreter/rewriter.cpp	Wed Feb 13 15:50:08 2019 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -221,13 +221,13 @@
             MethodHandles::is_signature_polymorphic_name(SystemDictionary::MethodHandle_klass(),
                                                          _pool->name_ref_at(cp_index))) {
           // we may need a resolved_refs entry for the appendix
-          add_invokedynamic_resolved_references_entries(cp_index, cache_index);
+          add_invokedynamic_resolved_references_entry(cp_index, cache_index);
           status = +1;
         } else if (_pool->klass_ref_at_noresolve(cp_index) == vmSymbols::java_lang_invoke_VarHandle() &&
                    MethodHandles::is_signature_polymorphic_name(SystemDictionary::VarHandle_klass(),
                                                                 _pool->name_ref_at(cp_index))) {
           // we may need a resolved_refs entry for the appendix
-          add_invokedynamic_resolved_references_entries(cp_index, cache_index);
+          add_invokedynamic_resolved_references_entry(cp_index, cache_index);
           status = +1;
         } else {
           status = -1;
@@ -259,7 +259,7 @@
   if (!reverse) {
     int cp_index = Bytes::get_Java_u2(p);
     int cache_index = add_invokedynamic_cp_cache_entry(cp_index);
-    int resolved_index = add_invokedynamic_resolved_references_entries(cp_index, cache_index);
+    int resolved_index = add_invokedynamic_resolved_references_entry(cp_index, cache_index);
     // Replace the trailing four bytes with a CPC index for the dynamic
     // call site.  Unlike other CPC entries, there is one per bytecode,
     // not just one per distinct CP entry.  In other words, the
@@ -307,12 +307,9 @@
       // invokedynamic resolved references map also points to cp cache and must
       // add delta to each.
       int resolved_index = _patch_invokedynamic_refs->at(i);
-      for (int entry = 0; entry < ConstantPoolCacheEntry::_indy_resolved_references_entries; entry++) {
-        assert(_invokedynamic_references_map.at(resolved_index + entry) == cache_index,
+        assert(_invokedynamic_references_map.at(resolved_index) == cache_index,
              "should be the same index");
-        _invokedynamic_references_map.at_put(resolved_index+entry,
-                                             cache_index + delta);
-      }
+        _invokedynamic_references_map.at_put(resolved_index, cache_index + delta);
     }
   }
 }