For example:
https://github.com/openjdk/jdk/blob/8f1c134848437d7e37fb3b4bd603b91798e19724/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/meta/ConstantPool.java#L110-L125
/**
* @param cpi the constant pool index
*/
JavaMethod lookupMethod(int cpi, int opcode, ResolvedJavaMethod caller);
The name "cpi" is incorrect. It cannot be used to access the cpi-th entry of a ConstantPool.
It should be rawIndex, as the index is constructed by the JVMCI compiler from the two bytes that follow an invokexxxx opcode in the bytecode stream of a HotSpot Method that has already been linked.