aboutsummaryrefslogtreecommitdiff
path: root/agent
diff options
context:
space:
mode:
authorjrose <none@none>2010-06-09 18:50:45 -0700
committerjrose <none@none>2010-06-09 18:50:45 -0700
commit6bcb37224d4a8c578b20469960f5c80b7f3a883a (patch)
treefd9ea532b76f7e96927ff9f716332d53c4768d52 /agent
parent8c42c4d1debbeae155eb1ccf1886e7c159278faf (diff)
6939203: JSR 292 needs method handle constants
Summary: Add new CP types CONSTANT_MethodHandle, CONSTANT_MethodType; extend 'ldc' bytecode. Reviewed-by: twisti, never
Diffstat (limited to 'agent')
-rw-r--r--agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeDisassembler.java1
-rw-r--r--agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeInvoke.java22
-rw-r--r--agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoadConstant.java62
-rw-r--r--agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithCPIndex.java7
-rw-r--r--agent/src/share/classes/sun/jvm/hotspot/interpreter/Bytecodes.java91
-rw-r--r--agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java76
-rw-r--r--agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java25
-rw-r--r--agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCacheEntry.java15
-rw-r--r--agent/src/share/classes/sun/jvm/hotspot/oops/GenerateOopMap.java6
-rw-r--r--agent/src/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java13
-rw-r--r--agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java53
-rw-r--r--agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java24
-rw-r--r--agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java10
-rw-r--r--agent/src/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java18
-rw-r--r--agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js2
15 files changed, 362 insertions, 63 deletions
diff --git a/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeDisassembler.java b/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeDisassembler.java
index 2a9b4df99..2afc92d3b 100644
--- a/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeDisassembler.java
+++ b/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeDisassembler.java
@@ -72,6 +72,7 @@ public class BytecodeDisassembler {
addBytecodeClass(Bytecodes._invokestatic, BytecodeInvoke.class);
addBytecodeClass(Bytecodes._invokespecial, BytecodeInvoke.class);
addBytecodeClass(Bytecodes._invokeinterface, BytecodeInvoke.class);
+ addBytecodeClass(Bytecodes._invokedynamic, BytecodeInvoke.class);
addBytecodeClass(Bytecodes._jsr, BytecodeJsr.class);
addBytecodeClass(Bytecodes._jsr_w, BytecodeJsrW.class);
addBytecodeClass(Bytecodes._iload, BytecodeLoad.class);
diff --git a/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeInvoke.java b/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeInvoke.java
index 840567864..aaf216676 100644
--- a/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeInvoke.java
+++ b/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeInvoke.java
@@ -54,15 +54,31 @@ public class BytecodeInvoke extends BytecodeWithCPIndex {
// returns the name of the invoked method
public Symbol name() {
ConstantPool cp = method().getConstants();
+ if (isInvokedynamic()) {
+ int[] nt = cp.getNameAndTypeAt(indexForFieldOrMethod());
+ return cp.getSymbolAt(nt[0]);
+ }
return cp.getNameRefAt(index());
}
// returns the signature of the invoked method
public Symbol signature() {
ConstantPool cp = method().getConstants();
+ if (isInvokedynamic()) {
+ int[] nt = cp.getNameAndTypeAt(indexForFieldOrMethod());
+ return cp.getSymbolAt(nt[1]);
+ }
return cp.getSignatureRefAt(index());
}
+ public int getSecondaryIndex() {
+ if (isInvokedynamic()) {
+ // change byte-ordering of 4-byte integer
+ return VM.getVM().getBytes().swapInt(javaSignedWordAt(1));
+ }
+ return super.getSecondaryIndex(); // throw an error
+ }
+
public Method getInvokedMethod() {
return method().getConstants().getMethodRefAt(index());
}
@@ -87,6 +103,7 @@ public class BytecodeInvoke extends BytecodeWithCPIndex {
public boolean isInvokevirtual() { return adjustedInvokeCode() == Bytecodes._invokevirtual; }
public boolean isInvokestatic() { return adjustedInvokeCode() == Bytecodes._invokestatic; }
public boolean isInvokespecial() { return adjustedInvokeCode() == Bytecodes._invokespecial; }
+ public boolean isInvokedynamic() { return adjustedInvokeCode() == Bytecodes._invokedynamic; }
public boolean isValid() { return isInvokeinterface() ||
isInvokevirtual() ||
@@ -104,6 +121,11 @@ public class BytecodeInvoke extends BytecodeWithCPIndex {
buf.append(spaces);
buf.append('#');
buf.append(Integer.toString(indexForFieldOrMethod()));
+ if (isInvokedynamic()) {
+ buf.append('(');
+ buf.append(Integer.toString(getSecondaryIndex()));
+ buf.append(')');
+ }
buf.append(" [Method ");
StringBuffer sigBuf = new StringBuffer();
new SignatureConverter(signature(), sigBuf).iterateReturntype();
diff --git a/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoadConstant.java b/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoadConstant.java
index c7109bca9..f08c03128 100644
--- a/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoadConstant.java
+++ b/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoadConstant.java
@@ -25,6 +25,7 @@
package sun.jvm.hotspot.interpreter;
import sun.jvm.hotspot.oops.*;
+import sun.jvm.hotspot.runtime.*;
import sun.jvm.hotspot.utilities.*;
public class BytecodeLoadConstant extends BytecodeWithCPIndex {
@@ -32,10 +33,47 @@ public class BytecodeLoadConstant extends BytecodeWithCPIndex {
super(method, bci);
}
+ public boolean hasCacheIndex() {
+ // normal ldc uses CP index, but fast_aldc uses swapped CP cache index
+ return javaCode() != code();
+ }
+
public int index() {
- return javaCode() == Bytecodes._ldc ?
+ int i = javaCode() == Bytecodes._ldc ?
(int) (0xFF & javaByteAt(1))
: (int) (0xFFFF & javaShortAt(1));
+ if (hasCacheIndex()) {
+ return (0xFFFF & VM.getVM().getBytes().swapShort((short) i));
+ } else {
+ return i;
+ }
+ }
+
+ public int poolIndex() {
+ int i = index();
+ if (hasCacheIndex()) {
+ ConstantPoolCache cpCache = method().getConstants().getCache();
+ return cpCache.getEntryAt(i).getConstantPoolIndex();
+ } else {
+ return i;
+ }
+ }
+
+ public int cacheIndex() {
+ if (hasCacheIndex()) {
+ return index();
+ } else {
+ return -1; // no cache index
+ }
+ }
+
+ private Oop getCachedConstant() {
+ int i = cacheIndex();
+ if (i >= 0) {
+ ConstantPoolCache cpCache = method().getConstants().getCache();
+ return cpCache.getEntryAt(i).getF1();
+ }
+ return null;
}
public void verify() {
@@ -58,6 +96,7 @@ public class BytecodeLoadConstant extends BytecodeWithCPIndex {
// has to be int or float or String or Klass
return (ctag.isUnresolvedString() || ctag.isString()
|| ctag.isUnresolvedKlass() || ctag.isKlass()
+ || ctag.isMethodHandle() || ctag.isMethodType()
|| ctag.isInt() || ctag.isFloat())? true: false;
}
}
@@ -112,7 +151,7 @@ public class BytecodeLoadConstant extends BytecodeWithCPIndex {
public String getConstantValue() {
ConstantPool cpool = method().getConstants();
- int cpIndex = index();
+ int cpIndex = poolIndex();
ConstantTag ctag = cpool.getTagAt(cpIndex);
if (ctag.isInt()) {
return "<int " + Integer.toString(cpool.getIntAt(cpIndex)) +">";
@@ -149,6 +188,18 @@ public class BytecodeLoadConstant extends BytecodeWithCPIndex {
} else {
throw new RuntimeException("should not reach here");
}
+ } else if (ctag.isMethodHandle() || ctag.isMethodType()) {
+ Oop x = getCachedConstant();
+ int refidx = cpool.getMethodHandleIndexAt(cpIndex);
+ int refkind = cpool.getMethodHandleRefKindAt(cpIndex);
+ return "<MethodHandle kind=" + Integer.toString(refkind) +
+ " ref=" + Integer.toString(refidx)
+ + (x == null ? "" : " @" + x.getHandle()) + ">";
+ } else if (ctag.isMethodType()) {
+ Oop x = getCachedConstant();
+ int refidx = cpool.getMethodTypeIndexAt(cpIndex);
+ return "<MethodType " + cpool.getSymbolAt(refidx).asString()
+ + (x == null ? "" : " @" + x.getHandle()) + ">";
} else {
if (Assert.ASSERTS_ENABLED) {
Assert.that(false, "invalid load constant type");
@@ -162,7 +213,12 @@ public class BytecodeLoadConstant extends BytecodeWithCPIndex {
buf.append(getJavaBytecodeName());
buf.append(spaces);
buf.append('#');
- buf.append(Integer.toString(index()));
+ buf.append(Integer.toString(poolIndex()));
+ if (hasCacheIndex()) {
+ buf.append('(');
+ buf.append(Integer.toString(cacheIndex()));
+ buf.append(')');
+ }
buf.append(spaces);
buf.append(getConstantValue());
if (code() != javaCode()) {
diff --git a/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithCPIndex.java b/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithCPIndex.java
index 3124c8c29..55aba1770 100644
--- a/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithCPIndex.java
+++ b/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithCPIndex.java
@@ -37,12 +37,19 @@ public abstract class BytecodeWithCPIndex extends Bytecode {
// the constant pool index for this bytecode
public int index() { return 0xFFFF & javaShortAt(1); }
+ public int getSecondaryIndex() {
+ throw new IllegalArgumentException("must be invokedynamic");
+ }
+
protected int indexForFieldOrMethod() {
ConstantPoolCache cpCache = method().getConstants().getCache();
// get ConstantPool index from ConstantPoolCacheIndex at given bci
int cpCacheIndex = index();
if (cpCache == null) {
return cpCacheIndex;
+ } else if (code() == Bytecodes._invokedynamic) {
+ int secondaryIndex = getSecondaryIndex();
+ return cpCache.getMainEntryAt(secondaryIndex).getConstantPoolIndex();
} else {
// change byte-ordering and go via cache
return cpCache.getEntryAt((int) (0xFFFF & VM.getVM().getBytes().swapShort((short) cpCacheIndex))).getConstantPoolIndex();
diff --git a/agent/src/share/classes/sun/jvm/hotspot/interpreter/Bytecodes.java b/agent/src/share/classes/sun/jvm/hotspot/interpreter/Bytecodes.java
index ce9e24152..16e35562f 100644
--- a/agent/src/share/classes/sun/jvm/hotspot/interpreter/Bytecodes.java
+++ b/agent/src/share/classes/sun/jvm/hotspot/interpreter/Bytecodes.java
@@ -222,7 +222,7 @@ public class Bytecodes {
public static final int _invokespecial = 183; // 0xb7
public static final int _invokestatic = 184; // 0xb8
public static final int _invokeinterface = 185; // 0xb9
- public static final int _xxxunusedxxx = 186; // 0xba
+ public static final int _invokedynamic = 186; // 0xba
public static final int _new = 187; // 0xbb
public static final int _newarray = 188; // 0xbc
public static final int _anewarray = 189; // 0xbd
@@ -269,9 +269,12 @@ public class Bytecodes {
public static final int _fast_invokevfinal = 226;
public static final int _fast_linearswitch = 227;
public static final int _fast_binaryswitch = 228;
- public static final int _shouldnotreachhere = 229; // For debugging
+ public static final int _fast_aldc = 229;
+ public static final int _fast_aldc_w = 230;
+ public static final int _return_register_finalizer = 231;
+ public static final int _shouldnotreachhere = 232; // For debugging
- public static final int number_of_codes = 230;
+ public static final int number_of_codes = 233;
public static int specialLengthAt(Method method, int bci) {
int code = codeAt(method, bci);
@@ -458,9 +461,9 @@ public class Bytecodes {
def(_dconst_1 , "dconst_1" , "b" , null , BasicType.getTDouble() , 2, false);
def(_bipush , "bipush" , "bc" , null , BasicType.getTInt() , 1, false);
def(_sipush , "sipush" , "bcc" , null , BasicType.getTInt() , 1, false);
- def(_ldc , "ldc" , "bi" , null , BasicType.getTIllegal(), 1, true );
- def(_ldc_w , "ldc_w" , "bii" , null , BasicType.getTIllegal(), 1, true );
- def(_ldc2_w , "ldc2_w" , "bii" , null , BasicType.getTIllegal(), 2, true );
+ def(_ldc , "ldc" , "bk" , null , BasicType.getTIllegal(), 1, true );
+ def(_ldc_w , "ldc_w" , "bkk" , null , BasicType.getTIllegal(), 1, true );
+ def(_ldc2_w , "ldc2_w" , "bkk" , null , BasicType.getTIllegal(), 2, true );
def(_iload , "iload" , "bi" , "wbii" , BasicType.getTInt() , 1, false);
def(_lload , "lload" , "bi" , "wbii" , BasicType.getTLong() , 2, false);
def(_fload , "fload" , "bi" , "wbii" , BasicType.getTFloat() , 1, false);
@@ -618,26 +621,26 @@ public class Bytecodes {
def(_dreturn , "dreturn" , "b" , null , BasicType.getTDouble() , -2, true );
def(_areturn , "areturn" , "b" , null , BasicType.getTObject() , -1, true );
def(_return , "return" , "b" , null , BasicType.getTVoid() , 0, true );
- def(_getstatic , "getstatic" , "bjj" , null , BasicType.getTIllegal(), 1, true );
- def(_putstatic , "putstatic" , "bjj" , null , BasicType.getTIllegal(), -1, true );
- def(_getfield , "getfield" , "bjj" , null , BasicType.getTIllegal(), 0, true );
- def(_putfield , "putfield" , "bjj" , null , BasicType.getTIllegal(), -2, true );
- def(_invokevirtual , "invokevirtual" , "bjj" , null , BasicType.getTIllegal(), -1, true );
- def(_invokespecial , "invokespecial" , "bjj" , null , BasicType.getTIllegal(), -1, true );
- def(_invokestatic , "invokestatic" , "bjj" , null , BasicType.getTIllegal(), 0, true );
- def(_invokeinterface , "invokeinterface" , "bjj__", null , BasicType.getTIllegal(), -1, true );
- def(_xxxunusedxxx , "xxxunusedxxx" , null , null , BasicType.getTVoid() , 0, false);
- def(_new , "new" , "bii" , null , BasicType.getTObject() , 1, true );
+ def(_getstatic , "getstatic" , "bJJ" , null , BasicType.getTIllegal(), 1, true );
+ def(_putstatic , "putstatic" , "bJJ" , null , BasicType.getTIllegal(), -1, true );
+ def(_getfield , "getfield" , "bJJ" , null , BasicType.getTIllegal(), 0, true );
+ def(_putfield , "putfield" , "bJJ" , null , BasicType.getTIllegal(), -2, true );
+ def(_invokevirtual , "invokevirtual" , "bJJ" , null , BasicType.getTIllegal(), -1, true );
+ def(_invokespecial , "invokespecial" , "bJJ" , null , BasicType.getTIllegal(), -1, true );
+ def(_invokestatic , "invokestatic" , "bJJ" , null , BasicType.getTIllegal(), 0, true );
+ def(_invokeinterface , "invokeinterface" , "bJJ__", null , BasicType.getTIllegal(), -1, true );
+ def(_invokedynamic , "invokedynamic" , "bJJJJ", null , BasicType.getTIllegal(), -1, true );
+ def(_new , "new" , "bkk" , null , BasicType.getTObject() , 1, true );
def(_newarray , "newarray" , "bc" , null , BasicType.getTObject() , 0, true );
- def(_anewarray , "anewarray" , "bii" , null , BasicType.getTObject() , 0, true );
+ def(_anewarray , "anewarray" , "bkk" , null , BasicType.getTObject() , 0, true );
def(_arraylength , "arraylength" , "b" , null , BasicType.getTVoid() , 0, true );
def(_athrow , "athrow" , "b" , null , BasicType.getTVoid() , -1, true );
- def(_checkcast , "checkcast" , "bii" , null , BasicType.getTObject() , 0, true );
- def(_instanceof , "instanceof" , "bii" , null , BasicType.getTInt() , 0, true );
+ def(_checkcast , "checkcast" , "bkk" , null , BasicType.getTObject() , 0, true );
+ def(_instanceof , "instanceof" , "bkk" , null , BasicType.getTInt() , 0, true );
def(_monitorenter , "monitorenter" , "b" , null , BasicType.getTVoid() , -1, true );
def(_monitorexit , "monitorexit" , "b" , null , BasicType.getTVoid() , -1, true );
def(_wide , "wide" , "" , null , BasicType.getTVoid() , 0, false);
- def(_multianewarray , "multianewarray" , "biic" , null , BasicType.getTObject() , 1, true );
+ def(_multianewarray , "multianewarray" , "bkkc" , null , BasicType.getTObject() , 1, true );
def(_ifnull , "ifnull" , "boo" , null , BasicType.getTVoid() , -1, false);
def(_ifnonnull , "ifnonnull" , "boo" , null , BasicType.getTVoid() , -1, false);
def(_goto_w , "goto_w" , "boooo", null , BasicType.getTVoid() , 0, false);
@@ -646,38 +649,44 @@ public class Bytecodes {
// JVM bytecodes
// bytecode bytecode name format wide f. result tp stk traps std code
- def(_fast_agetfield , "fast_agetfield" , "bjj" , null , BasicType.getTObject() , 0, true , _getfield );
- def(_fast_bgetfield , "fast_bgetfield" , "bjj" , null , BasicType.getTInt() , 0, true , _getfield );
- def(_fast_cgetfield , "fast_cgetfield" , "bjj" , null , BasicType.getTChar() , 0, true , _getfield );
- def(_fast_dgetfield , "fast_dgetfield" , "bjj" , null , BasicType.getTDouble() , 0, true , _getfield );
- def(_fast_fgetfield , "fast_fgetfield" , "bjj" , null , BasicType.getTFloat() , 0, true , _getfield );
- def(_fast_igetfield , "fast_igetfield" , "bjj" , null , BasicType.getTInt() , 0, true , _getfield );
- def(_fast_lgetfield , "fast_lgetfield" , "bjj" , null , BasicType.getTLong() , 0, true , _getfield );
- def(_fast_sgetfield , "fast_sgetfield" , "bjj" , null , BasicType.getTShort() , 0, true , _getfield );
-
- def(_fast_aputfield , "fast_aputfield" , "bjj" , null , BasicType.getTObject() , 0, true , _putfield );
- def(_fast_bputfield , "fast_bputfield" , "bjj" , null , BasicType.getTInt() , 0, true , _putfield );
- def(_fast_cputfield , "fast_cputfield" , "bjj" , null , BasicType.getTChar() , 0, true , _putfield );
- def(_fast_dputfield , "fast_dputfield" , "bjj" , null , BasicType.getTDouble() , 0, true , _putfield );
- def(_fast_fputfield , "fast_fputfield" , "bjj" , null , BasicType.getTFloat() , 0, true , _putfield );
- def(_fast_iputfield , "fast_iputfield" , "bjj" , null , BasicType.getTInt() , 0, true , _putfield );
- def(_fast_lputfield , "fast_lputfield" , "bjj" , null , BasicType.getTLong() , 0, true , _putfield );
- def(_fast_sputfield , "fast_sputfield" , "bjj" , null , BasicType.getTShort() , 0, true , _putfield );
+ def(_fast_agetfield , "fast_agetfield" , "bJJ" , null , BasicType.getTObject() , 0, true , _getfield );
+ def(_fast_bgetfield , "fast_bgetfield" , "bJJ" , null , BasicType.getTInt() , 0, true , _getfield );
+ def(_fast_cgetfield , "fast_cgetfield" , "bJJ" , null , BasicType.getTChar() , 0, true , _getfield );
+ def(_fast_dgetfield , "fast_dgetfield" , "bJJ" , null , BasicType.getTDouble() , 0, true , _getfield );
+ def(_fast_fgetfield , "fast_fgetfield" , "bJJ" , null , BasicType.getTFloat() , 0, true , _getfield );
+ def(_fast_igetfield , "fast_igetfield" , "bJJ" , null , BasicType.getTInt() , 0, true , _getfield );
+ def(_fast_lgetfield , "fast_lgetfield" , "bJJ" , null , BasicType.getTLong() , 0, true , _getfield );
+ def(_fast_sgetfield , "fast_sgetfield" , "bJJ" , null , BasicType.getTShort() , 0, true , _getfield );
+
+ def(_fast_aputfield , "fast_aputfield" , "bJJ" , null , BasicType.getTObject() , 0, true , _putfield );
+ def(_fast_bputfield , "fast_bputfield" , "bJJ" , null , BasicType.getTInt() , 0, true , _putfield );
+ def(_fast_cputfield , "fast_cputfield" , "bJJ" , null , BasicType.getTChar() , 0, true , _putfield );
+ def(_fast_dputfield , "fast_dputfield" , "bJJ" , null , BasicType.getTDouble() , 0, true , _putfield );
+ def(_fast_fputfield , "fast_fputfield" , "bJJ" , null , BasicType.getTFloat() , 0, true , _putfield );
+ def(_fast_iputfield , "fast_iputfield" , "bJJ" , null , BasicType.getTInt() , 0, true , _putfield );
+ def(_fast_lputfield , "fast_lputfield" , "bJJ" , null , BasicType.getTLong() , 0, true , _putfield );
+ def(_fast_sputfield , "fast_sputfield" , "bJJ" , null , BasicType.getTShort() , 0, true , _putfield );
def(_fast_aload_0 , "fast_aload_0" , "b" , null , BasicType.getTObject() , 1, true , _aload_0 );
- def(_fast_iaccess_0 , "fast_iaccess_0" , "b_jj" , null , BasicType.getTInt() , 1, true , _aload_0 );
- def(_fast_aaccess_0 , "fast_aaccess_0" , "b_jj" , null , BasicType.getTObject() , 1, true , _aload_0 );
- def(_fast_faccess_0 , "fast_faccess_0" , "b_jj" , null , BasicType.getTObject() , 1, true , _aload_0 );
+ def(_fast_iaccess_0 , "fast_iaccess_0" , "b_JJ" , null , BasicType.getTInt() , 1, true , _aload_0 );
+ def(_fast_aaccess_0 , "fast_aaccess_0" , "b_JJ" , null , BasicType.getTObject() , 1, true , _aload_0 );
+ def(_fast_faccess_0 , "fast_faccess_0" , "b_JJ" , null , BasicType.getTObject() , 1, true , _aload_0 );
def(_fast_iload , "fast_iload" , "bi" , null , BasicType.getTInt() , 1, false, _iload);
def(_fast_iload2 , "fast_iload2" , "bi_i" , null , BasicType.getTInt() , 2, false, _iload);
def(_fast_icaload , "fast_icaload" , "bi_" , null , BasicType.getTInt() , 0, false, _iload);
// Faster method invocation.
- def(_fast_invokevfinal , "fast_invokevfinal" , "bjj" , null , BasicType.getTIllegal(), -1, true, _invokevirtual);
+ def(_fast_invokevfinal , "fast_invokevfinal" , "bJJ" , null , BasicType.getTIllegal(), -1, true, _invokevirtual);
def(_fast_linearswitch , "fast_linearswitch" , "" , null , BasicType.getTVoid() , -1, false, _lookupswitch );
def(_fast_binaryswitch , "fast_binaryswitch" , "" , null , BasicType.getTVoid() , -1, false, _lookupswitch );
+
+ def(_return_register_finalizer, "return_register_finalizer", "b" , null , BasicType.getTVoid() , 0, true, _return );
+
+ def(_fast_aldc , "fast_aldc" , "bj" , null , BasicType.getTObject(), 1, true, _ldc );
+ def(_fast_aldc_w , "fast_aldc_w" , "bJJ" , null , BasicType.getTObject(), 1, true, _ldc_w );
+
def(_shouldnotreachhere , "_shouldnotreachhere" , "b" , null , BasicType.getTVoid() , 0, false);
if (Assert.ASSERTS_ENABLED) {
diff --git a/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java b/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java
index 6a88ecb26..58e199089 100644
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java
@@ -152,7 +152,7 @@ public class ConstantPool extends Oop implements ClassConstants {
return res;
}
- public int getNameAndTypeAt(int which) {
+ public int[] getNameAndTypeAt(int which) {
if (Assert.ASSERTS_ENABLED) {
Assert.that(getTagAt(which).isNameAndType(), "Corrupted constant pool");
}
@@ -160,18 +160,16 @@ public class ConstantPool extends Oop implements ClassConstants {
if (DEBUG) {
System.err.println("ConstantPool.getNameAndTypeAt(" + which + "): result = " + i);
}
- return i;
+ return new int[] { extractLowShortFromInt(i), extractHighShortFromInt(i) };
}
public Symbol getNameRefAt(int which) {
- int refIndex = getNameAndTypeAt(getNameAndTypeRefIndexAt(which));
- int nameIndex = extractLowShortFromInt(refIndex);
+ int nameIndex = getNameAndTypeAt(getNameAndTypeRefIndexAt(which))[0];
return getSymbolAt(nameIndex);
}
public Symbol getSignatureRefAt(int which) {
- int refIndex = getNameAndTypeAt(getNameAndTypeRefIndexAt(which));
- int sigIndex = extractHighShortFromInt(refIndex);
+ int sigIndex = getNameAndTypeAt(getNameAndTypeRefIndexAt(which))[1];
return getSymbolAt(sigIndex);
}
@@ -220,11 +218,11 @@ public class ConstantPool extends Oop implements ClassConstants {
/** Lookup for entries consisting of (name_index, signature_index) */
public int getNameRefIndexAt(int index) {
- int refIndex = getNameAndTypeAt(index);
+ int[] refIndex = getNameAndTypeAt(index);
if (DEBUG) {
- System.err.println("ConstantPool.getNameRefIndexAt(" + index + "): refIndex = " + refIndex);
+ System.err.println("ConstantPool.getNameRefIndexAt(" + index + "): refIndex = " + refIndex[0]+"/"+refIndex[1]);
}
- int i = extractLowShortFromInt(refIndex);
+ int i = refIndex[0];
if (DEBUG) {
System.err.println("ConstantPool.getNameRefIndexAt(" + index + "): result = " + i);
}
@@ -233,17 +231,53 @@ public class ConstantPool extends Oop implements ClassConstants {
/** Lookup for entries consisting of (name_index, signature_index) */
public int getSignatureRefIndexAt(int index) {
- int refIndex = getNameAndTypeAt(index);
+ int[] refIndex = getNameAndTypeAt(index);
if (DEBUG) {
- System.err.println("ConstantPool.getSignatureRefIndexAt(" + index + "): refIndex = " + refIndex);
+ System.err.println("ConstantPool.getSignatureRefIndexAt(" + index + "): refIndex = " + refIndex[0]+"/"+refIndex[1]);
}
- int i = extractHighShortFromInt(refIndex);
+ int i = refIndex[1];
if (DEBUG) {
System.err.println("ConstantPool.getSignatureRefIndexAt(" + index + "): result = " + i);
}
return i;
}
+ /** Lookup for MethodHandle entries. */
+ public int getMethodHandleIndexAt(int i) {
+ if (Assert.ASSERTS_ENABLED) {
+ Assert.that(getTagAt(i).isMethodHandle(), "Corrupted constant pool");
+ }
+ int res = extractHighShortFromInt(getIntAt(i));
+ if (DEBUG) {
+ System.err.println("ConstantPool.getMethodHandleIndexAt(" + i + "): result = " + res);
+ }
+ return res;
+ }
+
+ /** Lookup for MethodHandle entries. */
+ public int getMethodHandleRefKindAt(int i) {
+ if (Assert.ASSERTS_ENABLED) {
+ Assert.that(getTagAt(i).isMethodHandle(), "Corrupted constant pool");
+ }
+ int res = extractLowShortFromInt(getIntAt(i));
+ if (DEBUG) {
+ System.err.println("ConstantPool.getMethodHandleRefKindAt(" + i + "): result = " + res);
+ }
+ return res;
+ }
+
+ /** Lookup for MethodType entries. */
+ public int getMethodTypeIndexAt(int i) {
+ if (Assert.ASSERTS_ENABLED) {
+ Assert.that(getTagAt(i).isMethodType(), "Corrupted constant pool");
+ }
+ int res = getIntAt(i);
+ if (DEBUG) {
+ System.err.println("ConstantPool.getMethodHandleTypeAt(" + i + "): result = " + res);
+ }
+ return res;
+ }
+
final private static String[] nameForTag = new String[] {
};
@@ -261,6 +295,8 @@ public class ConstantPool extends Oop implements ClassConstants {
case JVM_CONSTANT_Methodref: return "JVM_CONSTANT_Methodref";
case JVM_CONSTANT_InterfaceMethodref: return "JVM_CONSTANT_InterfaceMethodref";
case JVM_CONSTANT_NameAndType: return "JVM_CONSTANT_NameAndType";
+ case JVM_CONSTANT_MethodHandle: return "JVM_CONSTANT_MethodHandle";
+ case JVM_CONSTANT_MethodType: return "JVM_CONSTANT_MethodType";
case JVM_CONSTANT_Invalid: return "JVM_CONSTANT_Invalid";
case JVM_CONSTANT_UnresolvedClass: return "JVM_CONSTANT_UnresolvedClass";
case JVM_CONSTANT_UnresolvedClassInError: return "JVM_CONSTANT_UnresolvedClassInError";
@@ -317,6 +353,8 @@ public class ConstantPool extends Oop implements ClassConstants {
case JVM_CONSTANT_Methodref:
case JVM_CONSTANT_InterfaceMethodref:
case JVM_CONSTANT_NameAndType:
+ case JVM_CONSTANT_MethodHandle:
+ case JVM_CONSTANT_MethodType:
visitor.doInt(new IntField(new NamedFieldIdentifier(nameForTag(ctag)), indexOffset(index), true), true);
break;
}
@@ -467,6 +505,18 @@ public class ConstantPool extends Oop implements ClassConstants {
+ ", type = " + signatureIndex);
break;
}
+
+ case JVM_CONSTANT_MethodHandle: {
+ dos.writeByte(cpConstType);
+ int value = getIntAt(ci);
+ short nameIndex = (short) extractLowShortFromInt(value);
+ short signatureIndex = (short) extractHighShortFromInt(value);
+ dos.writeShort(nameIndex);
+ dos.writeShort(signatureIndex);
+ if (DEBUG) debugMessage("CP[" + ci + "] = N&T name = " + nameIndex
+ + ", type = " + signatureIndex);
+ break;
+ }
default:
throw new InternalError("unknown tag: " + cpConstType);
} // switch
@@ -488,10 +538,12 @@ public class ConstantPool extends Oop implements ClassConstants {
//
private static int extractHighShortFromInt(int val) {
+ // must stay in sync with constantPoolOopDesc::name_and_type_at_put, method_at_put, etc.
return (val >> 16) & 0xFFFF;
}
private static int extractLowShortFromInt(int val) {
+ // must stay in sync with constantPoolOopDesc::name_and_type_at_put, method_at_put, etc.
return val & 0xFFFF;
}
}
diff --git a/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java b/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java
index abf66e208..0b162a438 100644
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java
@@ -78,6 +78,31 @@ public class ConstantPoolCache extends Oop {
return new ConstantPoolCacheEntry(this, i);
}
+ public static boolean isSecondaryIndex(int i) { return (i < 0); }
+ public static int decodeSecondaryIndex(int i) { return isSecondaryIndex(i) ? ~i : i; }
+ public static int encodeSecondaryIndex(int i) { return !isSecondaryIndex(i) ? ~i : i; }
+
+ // secondary entries hold invokedynamic call site bindings
+ public ConstantPoolCacheEntry getSecondaryEntryAt(int i) {
+ ConstantPoolCacheEntry e = new ConstantPoolCacheEntry(this, decodeSecondaryIndex(i));
+ if (Assert.ASSERTS_ENABLED) {
+ Assert.that(e.isSecondaryEntry(), "must be a secondary entry");
+ }
+ return e;
+ }
+
+ public ConstantPoolCacheEntry getMainEntryAt(int i) {
+ if (isSecondaryIndex(i)) {
+ // run through an extra level of indirection:
+ i = getSecondaryEntryAt(i).getMainEntryIndex();
+ }
+ ConstantPoolCacheEntry e = new ConstantPoolCacheEntry(this, i);
+ if (Assert.ASSERTS_ENABLED) {
+ Assert.that(!e.isSecondaryEntry(), "must not be a secondary entry");
+ }
+ return e;
+ }
+
public int getIntAt(int entry, int fld) {
//alignObjectSize ?
long offset = baseOffset + /*alignObjectSize*/entry * elementSize + fld* getHeap().getIntSize();
diff --git a/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCacheEntry.java b/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCacheEntry.java
index 92821110e..c3982615c 100644
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCacheEntry.java
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCacheEntry.java
@@ -28,6 +28,7 @@ import java.util.*;
import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.runtime.*;
import sun.jvm.hotspot.types.*;
+import sun.jvm.hotspot.utilities.*;
public class ConstantPoolCacheEntry {
private static long size;
@@ -67,9 +68,23 @@ public class ConstantPoolCacheEntry {
}
public int getConstantPoolIndex() {
+ if (Assert.ASSERTS_ENABLED) {
+ Assert.that(!isSecondaryEntry(), "must not be a secondary CP entry");
+ }
return (int) (getIndices() & 0xFFFF);
}
+ public boolean isSecondaryEntry() {
+ return (getIndices() & 0xFFFF) == 0;
+ }
+
+ public int getMainEntryIndex() {
+ if (Assert.ASSERTS_ENABLED) {
+ Assert.that(isSecondaryEntry(), "must be a secondary CP entry");
+ }
+ return (int) (getIndices() >>> 16);
+ }
+
private long getIndices() {
return cp.getHandle().getCIntegerAt(indices.getOffset() + offset, indices.getSize(), indices.isUnsigned());
}
diff --git a/agent/src/share/classes/sun/jvm/hotspot/oops/GenerateOopMap.java b/agent/src/share/classes/sun/jvm/hotspot/oops/GenerateOopMap.java
index 47e765b8e..82a20a5c9 100644
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/GenerateOopMap.java
+++ b/agent/src/share/classes/sun/jvm/hotspot/oops/GenerateOopMap.java
@@ -566,6 +566,7 @@ public class GenerateOopMap {
case Bytecodes._invokespecial:
case Bytecodes._invokestatic:
case Bytecodes._invokeinterface:
+ case Bytecodes._invokedynamic:
// FIXME: print signature of referenced method (need more
// accessors in ConstantPool and ConstantPoolCache)
int idx = currentBC.getIndexBig();
@@ -605,6 +606,7 @@ public class GenerateOopMap {
case Bytecodes._invokespecial:
case Bytecodes._invokestatic:
case Bytecodes._invokeinterface:
+ case Bytecodes._invokedynamic:
// FIXME: print signature of referenced method (need more
// accessors in ConstantPool and ConstantPoolCache)
int idx = currentBC.getIndexBig();
@@ -1134,6 +1136,7 @@ public class GenerateOopMap {
case Bytecodes._invokespecial:
case Bytecodes._invokestatic:
case Bytecodes._invokeinterface:
+ case Bytecodes._invokedynamic:
_itr_send = itr;
_report_result_for_send = true;
break;
@@ -1379,6 +1382,7 @@ public class GenerateOopMap {
case Bytecodes._invokevirtual:
case Bytecodes._invokespecial: doMethod(false, false, itr.getIndexBig(), itr.bci()); break;
case Bytecodes._invokestatic: doMethod(true, false, itr.getIndexBig(), itr.bci()); break;
+ case Bytecodes._invokedynamic: doMethod(false, true, itr.getIndexBig(), itr.bci()); break;
case Bytecodes._invokeinterface: doMethod(false, true, itr.getIndexBig(), itr.bci()); break;
case Bytecodes._newarray:
case Bytecodes._anewarray: ppNewRef(vCTS, itr.bci()); break;
@@ -1725,7 +1729,7 @@ public class GenerateOopMap {
void doMethod (boolean is_static, boolean is_interface, int idx, int bci) {
// Dig up signature for field in constant pool
ConstantPool cp = _method.getConstants();
- int nameAndTypeIdx = cp.getNameAndTypeRefIndexAt(idx);
+ int nameAndTypeIdx = cp.getTagAt(idx).isNameAndType() ? idx : cp.getNameAndTypeRefIndexAt(idx);
int signatureIdx = cp.getSignatureRefIndexAt(nameAndTypeIdx);
Symbol signature = cp.getSymbolAt(signatureIdx);
diff --git a/agent/src/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java b/agent/src/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java
index f2bb541f8..889e9dc08 100644
--- a/agent/src/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java
+++ b/agent/src/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java
@@ -40,6 +40,19 @@ public interface ClassConstants
public static final int JVM_CONSTANT_Methodref = 10;
public static final int JVM_CONSTANT_InterfaceMethodref = 11;
public static final int JVM_CONSTANT_NameAndType = 12;
+ public static final int JVM_CONSTANT_MethodHandle = 15;
+ public static final int JVM_CONSTANT_MethodType = 16;
+
+ // JVM_CONSTANT_MethodHandle subtypes
+ public static final int JVM_REF_getField = 1;
+ public static final int JVM_REF_getStatic = 2;
+ public static final int JVM_REF_putField = 3;
+ public static final int JVM_REF_putStatic = 4;
+ public static final int JVM_REF_invokeVirtual = 5;
+ public static final int JVM_REF_invokeStatic = 6;
+ public static final int JVM_REF_invokeSpecial = 7;
+ public static final int JVM_REF_newInvokeSpecial = 8;
+ public static final int JVM_REF_invokeInterface = 9;
// HotSpot specific constant pool constant types.
diff --git a/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java b/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java
index d8da62475..508357f82 100644
--- a/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java
+++ b/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java
@@ -54,14 +54,34 @@ public class ByteCodeRewriter
}
- protected short getConstantPoolIndex(int bci) {
+ protected short getConstantPoolIndex(int rawcode, int bci) {
// get ConstantPool index from ConstantPoolCacheIndex at given bci
- short cpCacheIndex = method.getBytecodeShortArg(bci);
+ String fmt = Bytecodes.format(rawcode);
+ int cpCacheIndex;
+ switch (fmt.length()) {
+ case 2: cpCacheIndex = method.getBytecodeByteArg(bci); break;
+ case 3: cpCacheIndex = method.getBytecodeShortArg(bci); break;
+ case 5:
+ if (fmt.indexOf("__") >= 0)
+ cpCacheIndex = method.getBytecodeShortArg(bci);
+ else
+ cpCacheIndex = method.getBytecodeIntArg(bci);
+ break;
+ default: throw new IllegalArgumentException();
+ }
if (cpCache == null) {
- return cpCacheIndex;
- } else {
+ return (short) cpCacheIndex;
+ } else if (fmt.indexOf("JJJJ") >= 0) {
+ // change byte-ordering and go via secondary cache entry
+ return (short) cpCache.getMainEntryAt(bytes.swapInt(cpCacheIndex)).getConstantPoolIndex();
+ } else if (fmt.indexOf("JJ") >= 0) {
// change byte-ordering and go via cache
- return (short) cpCache.getEntryAt((int) (0xFFFF & bytes.swapShort(cpCacheIndex))).getConstantPoolIndex();
+ return (short) cpCache.getEntryAt((int) (0xFFFF & bytes.swapShort((short)cpCacheIndex))).getConstantPoolIndex();
+ } else if (fmt.indexOf("j") >= 0) {
+ // go via cache
+ return (short) cpCache.getEntryAt((int) (0xFF & cpCacheIndex)).getConstantPoolIndex();
+ } else {
+ return (short) cpCacheIndex;
}
}
@@ -100,10 +120,31 @@ public class ByteCodeRewriter
case Bytecodes._invokespecial:
case Bytecodes._invokestatic:
case Bytecodes._invokeinterface: {
- cpoolIndex = getConstantPoolIndex(bci + 1);
+ cpoolIndex = getConstantPoolIndex(hotspotcode, bci + 1);
writeShort(code, bci + 1, cpoolIndex);
break;
}
+
+ case Bytecodes._invokedynamic:
+ cpoolIndex = getConstantPoolIndex(hotspotcode, bci + 1);
+ writeShort(code, bci + 1, cpoolIndex);
+ writeShort(code, bci + 3, (short)0); // clear out trailing bytes
+ break;
+
+ case Bytecodes._ldc_w:
+ if (hotspotcode != bytecode) {
+ // fast_aldc_w puts constant in CP cache
+ cpoolIndex = getConstantPoolIndex(hotspotcode, bci + 1);
+ writeShort(code, bci + 1, cpoolIndex);
+ }
+ break;
+ case Bytecodes._ldc:
+ if (hotspotcode != bytecode) {
+ // fast_aldc puts constant in CP cache
+ cpoolIndex = getConstantPoolIndex(hotspotcode, bci + 1);
+ code[bci + 1] = (byte)(cpoolIndex);
+ }
+ break;
}
len = Bytecodes.lengthFor(bytecode);
diff --git a/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java b/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java
index 3b6f24786..99ffaedc8 100644
--- a/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java
+++ b/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java
@@ -61,10 +61,12 @@ public class ClassWriter implements /* imports */ ClassConstants
protected short _signatureIndex;
protected static int extractHighShortFromInt(int val) {
+ // must stay in sync with constantPoolOopDesc::name_and_type_at_put, method_at_put, etc.
return (val >> 16) & 0xFFFF;
}
protected static int extractLowShortFromInt(int val) {
+ // must stay in sync with constantPoolOopDesc::name_and_type_at_put, method_at_put, etc.
return val & 0xFFFF;
}
@@ -297,6 +299,28 @@ public class ClassWriter implements /* imports */ ClassConstants
+ ", type = " + signatureIndex);
break;
}
+
+ case JVM_CONSTANT_MethodHandle: {
+ dos.writeByte(cpConstType);
+ int value = cpool.getIntAt(ci);
+ short refIndex = (short) extractHighShortFromInt(value);
+ byte refKind = (byte) extractLowShortFromInt(value);
+ dos.writeByte(refKind);
+ dos.writeShort(refIndex);
+ if (DEBUG) debugMessage("CP[" + ci + "] = MH index = " + refIndex
+ + ", kind = " + refKind);
+ break;
+ }
+
+ case JVM_CONSTANT_MethodType: {
+ dos.writeByte(cpConstType);
+ int value = cpool.getIntAt(ci);
+ short refIndex = (short) value;
+ dos.writeShort(refIndex);
+ if (DEBUG) debugMessage("CP[" + ci + "] = MT index = " + refIndex);
+ break;
+ }
+
default:
throw new InternalError("Unknown tag: " + cpConstType);
} // switch
diff --git a/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java b/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java
index c7a951729..8ef0d8c4d 100644
--- a/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java
+++ b/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java
@@ -572,6 +572,16 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
buf.cell(Integer.toString(cpool.getIntAt(index)));
break;
+ case JVM_CONSTANT_MethodHandle:
+ buf.cell("JVM_CONSTANT_MethodHandle");
+ buf.cell(genLowHighShort(cpool.getIntAt(index)));
+ break;
+
+ case JVM_CONSTANT_MethodType:
+ buf.cell("JVM_CONSTANT_MethodType");
+ buf.cell(Integer.toString(cpool.getIntAt(index)));
+ break;
+
default:
throw new InternalError("unknown tag: " + ctag);
}
diff --git a/agent/src/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java b/agent/src/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java
index 681dd23e1..2a710c2a0 100644
--- a/agent/src/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java
+++ b/agent/src/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java
@@ -38,12 +38,26 @@ public class ConstantTag {
private static int JVM_CONSTANT_Methodref = 10;
private static int JVM_CONSTANT_InterfaceMethodref = 11;
private static int JVM_CONSTANT_NameAndType = 12;
+ private static int JVM_CONSTANT_MethodHandle = 15; // JSR 292
+ private static int JVM_CONSTANT_MethodType = 16; // JSR 292
private static int JVM_CONSTANT_Invalid = 0; // For bad value initialization
private static int JVM_CONSTANT_UnresolvedClass = 100; // Temporary tag until actual use
private static int JVM_CONSTANT_ClassIndex = 101; // Temporary tag while constructing constant pool
private static int JVM_CONSTANT_UnresolvedString = 102; // Temporary tag until actual use
private static int JVM_CONSTANT_StringIndex = 103; // Temporary tag while constructing constant pool
private static int JVM_CONSTANT_UnresolvedClassInError = 104; // Resolution failed
+ private static int JVM_CONSTANT_Object = 105; // Required for BoundMethodHandle arguments.
+
+ // JVM_CONSTANT_MethodHandle subtypes //FIXME: connect these to data structure
+ private static int JVM_REF_getField = 1;
+ private static int JVM_REF_getStatic = 2;
+ private static int JVM_REF_putField = 3;
+ private static int JVM_REF_putStatic = 4;
+ private static int JVM_REF_invokeVirtual = 5;
+ private static int JVM_REF_invokeStatic = 6;
+ private static int JVM_REF_invokeSpecial = 7;
+ private static int JVM_REF_newInvokeSpecial = 8;
+ private static int JVM_REF_invokeInterface = 9;
private byte tag;
@@ -62,6 +76,8 @@ public class ConstantTag {
public boolean isDouble() { return tag == JVM_CONSTANT_Double; }
public boolean isNameAndType() { return tag == JVM_CONSTANT_NameAndType; }
public boolean isUtf8() { return tag == JVM_CONSTANT_Utf8; }
+ public boolean isMethodHandle() { return tag == JVM_CONSTANT_MethodHandle; }
+ public boolean isMethodType() { return tag == JVM_CONSTANT_MethodType; }
public boolean isInvalid() { return tag == JVM_CONSTANT_Invalid; }
@@ -73,6 +89,8 @@ public class ConstantTag {
public boolean isUnresolvedString() { return tag == JVM_CONSTANT_UnresolvedString; }
public boolean isStringIndex() { return tag == JVM_CONSTANT_StringIndex; }
+ public boolean isObject() { return tag == JVM_CONSTANT_Object; }
+
public boolean isKlassReference() { return isKlassIndex() || isUnresolvedKlass(); }
public boolean isFieldOrMethod() { return isField() || isMethod() || isInterfaceMethod(); }
public boolean isSymbol() { return isUtf8(); }
diff --git a/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js b/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js
index fb1b7a890..f181bd626 100644
--- a/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js
+++ b/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js
@@ -825,6 +825,8 @@ function jdis(method) {
}
writeln("");
disAsm.decode(new sapkg.interpreter.BytecodeVisitor() {
+ prologue: function(method) { },
+ epilogue: function() { },
visit: function(bytecode) {
if (hasLines) {
var line = method.getLineNumberFromBCI(bci);