src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPool.java
--- a/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPool.java Thu Aug 16 09:09:18 2018 +0200
+++ b/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPool.java Thu Aug 16 09:46:09 2018 +0200
@@ -647,20 +647,22 @@
}
/*
- * Converts a raw index from the bytecodes to a constant pool index
- * (not a cache index).
+ * Converts a raw index from the bytecodes to a constant pool index (not a cache index).
*
* @param rawIndex index from the bytecode
+ *
* @param opcode bytecode to convert the index for
+ *
* @return constant pool index
*/
- public int rawIndexToConstantPoolIndex(int index, int opcode) {
- if (isInvokedynamicIndex(index)) {
+ public int rawIndexToConstantPoolIndex(int rawIndex, int opcode) {
+ int index;
+ if (isInvokedynamicIndex(rawIndex)) {
assert opcode == Bytecodes.INVOKEDYNAMIC;
- index = decodeInvokedynamicIndex(index) + config().constantPoolCpCacheIndexTag;
+ index = decodeInvokedynamicIndex(rawIndex) + config().constantPoolCpCacheIndexTag;
} else {
assert opcode != Bytecodes.INVOKEDYNAMIC;
- index = rawIndexToConstantPoolCacheIndex(index, opcode);
+ index = rawIndexToConstantPoolCacheIndex(rawIndex, opcode);
}
return compilerToVM().constantPoolRemapInstructionOperandFromCache(this, index);
}
@@ -772,19 +774,20 @@
}
/**
- * Check for a resolved dynamic adapter method at the specified index,
- * resulting from either a resolved invokedynamic or invokevirtual on a signature polymorphic
- * MethodHandle method (HotSpot invokehandle).
+ * Check for a resolved dynamic adapter method at the specified index, resulting from either a
+ * resolved invokedynamic or invokevirtual on a signature polymorphic MethodHandle method
+ * (HotSpot invokehandle).
*
* @param cpi the constant pool index
* @param opcode the opcode of the instruction for which the lookup is being performed
- * @return {@code true} if a signature polymorphic method reference was found, otherwise {@code false}
+ * @return {@code true} if a signature polymorphic method reference was found, otherwise
+ * {@code false}
*/
public boolean isResolvedDynamicInvoke(int cpi, int opcode) {
if (Bytecodes.isInvokeHandleAlias(opcode)) {
final int methodRefCacheIndex = rawIndexToConstantPoolCacheIndex(cpi, opcode);
assert checkTag(compilerToVM().constantPoolRemapInstructionOperandFromCache(this, methodRefCacheIndex), JVM_CONSTANT.MethodRef);
- int op = compilerToVM().isResolvedInvokeHandleInPool(this, methodRefCacheIndex);
+ int op = compilerToVM().isResolvedInvokeHandleInPool(this, methodRefCacheIndex);
return op == opcode;
}
return false;