diff agent/src/share/classes/sun/jvm/hotspot/oops/ConstMethod.java @ 3838:6a991dcb52bb

7012081: JSR 292: SA-JDI can't read MH/MT/Indy ConstantPool entries Reviewed-by: kvn, twisti, jrose
author never
date Thu, 21 Jul 2011 08:38:25 -0700
parents c18cbe5936b8
children 2fe087c3e814
line wrap: on
line diff
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/ConstMethod.java	Wed Jul 20 18:04:17 2011 -0700
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/ConstMethod.java	Thu Jul 21 08:38:25 2011 -0700
@@ -164,6 +164,18 @@
     return (short) ((hi << 8) | lo);
   }
 
+  /** Fetches a 16-bit native ordered value from the
+      bytecode stream */
+  public short getNativeShortArg(int bci) {
+    int hi = getBytecodeOrBPAt(bci);
+    int lo = getBytecodeOrBPAt(bci + 1);
+    if (VM.getVM().isBigEndian()) {
+        return (short) ((hi << 8) | lo);
+    } else {
+        return (short) ((lo << 8) | hi);
+    }
+  }
+
   /** Fetches a 32-bit big-endian ("Java ordered") value from the
       bytecode stream */
   public int getBytecodeIntArg(int bci) {
@@ -175,6 +187,21 @@
     return (b4 << 24) | (b3 << 16) | (b2 << 8) | b1;
   }
 
+  /** Fetches a 32-bit native ordered value from the
+      bytecode stream */
+  public int getNativeIntArg(int bci) {
+    int b4 = getBytecodeOrBPAt(bci);
+    int b3 = getBytecodeOrBPAt(bci + 1);
+    int b2 = getBytecodeOrBPAt(bci + 2);
+    int b1 = getBytecodeOrBPAt(bci + 3);
+
+    if (VM.getVM().isBigEndian()) {
+        return (b4 << 24) | (b3 << 16) | (b2 << 8) | b1;
+    } else {
+        return (b1 << 24) | (b2 << 16) | (b3 << 8) | b4;
+    }
+  }
+
   public byte[] getByteCode() {
      byte[] bc = new byte[ (int) getCodeSize() ];
      for( int i=0; i < bc.length; i++ )