--- old/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPool.java 2017-09-23 21:08:33.066500343 +0900 +++ new/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPool.java 2017-09-23 21:08:32.788501395 +0900 @@ -269,13 +269,12 @@ public static int decodeInvokedynamicIndex(int i) { Assert.that(isInvokedynamicIndex(i), ""); return ~i; } - // The invokedynamic points at the object index. The object map points at - // the cpCache index and the cpCache entry points at the original constant - // pool index. + // The invokedynamic points at a CP cache entry. This entry points back + // at the original CP entry (CONSTANT_InvokeDynamic) and also (via f2) at an entry + // in the resolved_references array (which provides the appendix argument). public int invokedynamicCPCacheIndex(int index) { Assert.that(isInvokedynamicIndex(index), "should be a invokedynamic index"); - int rawIndex = decodeInvokedynamicIndex(index); - return referenceMap().at(rawIndex); + return decodeInvokedynamicIndex(index); } ConstantPoolCacheEntry invokedynamicCPCacheEntryAt(int index) {