changeset 23689:d814713e3b02 jvmci-0.13

backport of changes from JDK-8157181
author Doug Simon <doug.simon@oracle.com>
date Thu, 16 Jun 2016 00:25:39 +0200
parents 8e2954d78161
children 477a69ca9d76
files jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPool.java jvmci/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantPool.java
diffstat 2 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPool.java	Thu Jun 16 00:25:11 2016 +0200
+++ b/jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPool.java	Thu Jun 16 00:25:39 2016 +0200
@@ -589,7 +589,7 @@
     }
 
     @Override
-    public JavaField lookupField(int cpi, int opcode) {
+    public JavaField lookupField(int cpi, ResolvedJavaMethod method, int opcode) {
         final int index = rawIndexToConstantPoolIndex(cpi, opcode);
         final int nameAndTypeIndex = getNameAndTypeRefIndexAt(index);
         final int nameIndex = getNameRefIndexAt(nameAndTypeIndex);
--- a/jvmci/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantPool.java	Thu Jun 16 00:25:11 2016 +0200
+++ b/jvmci/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantPool.java	Thu Jun 16 00:25:39 2016 +0200
@@ -48,16 +48,18 @@
 
     /**
      * Looks up a reference to a field. If {@code opcode} is non-negative, then resolution checks
-     * specific to the bytecode it denotes are performed if the field is already resolved. Should
-     * any of these checks fail, an unresolved field reference is returned.
+     * specific to the bytecode it denotes are performed if the field is already resolved. Checks
+     * for some bytecodes require the method that contains the bytecode to be specified. Should any
+     * of these checks fail, an unresolved field reference is returned.
      *
      * @param cpi the constant pool index
      * @param opcode the opcode of the instruction for which the lookup is being performed or
      *            {@code -1}
+     * @param method the method for which the lookup is being performed
      * @return a reference to the field at {@code cpi} in this pool
      * @throws ClassFormatError if the entry at {@code cpi} is not a field
      */
-    JavaField lookupField(int cpi, int opcode);
+    JavaField lookupField(int cpi, ResolvedJavaMethod method, int opcode);
 
     /**
      * Looks up a reference to a method. If {@code opcode} is non-negative, then resolution checks