diff -r 0794cd144834 -r 71b8938a2821 hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstMethod.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstMethod.java Wed Jul 20 18:04:17 2011 -0700 +++ b/hotspot/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++ )