Mercurial > hg > truffle
diff agent/src/share/classes/sun/jvm/hotspot/oops/Method.java @ 3945:8ed53447f690
Merge
author | iveresov |
---|---|
date | Thu, 15 Sep 2011 12:44:09 -0700 |
parents | f6f3bb0ee072 |
children | 2fe087c3e814 |
line wrap: on
line diff
--- a/agent/src/share/classes/sun/jvm/hotspot/oops/Method.java Tue Sep 13 20:28:00 2011 -0700 +++ b/agent/src/share/classes/sun/jvm/hotspot/oops/Method.java Thu Sep 15 12:44:09 2011 -0700 @@ -49,6 +49,7 @@ Type type = db.lookupType("methodOopDesc"); constMethod = new OopField(type.getOopField("_constMethod"), 0); constants = new OopField(type.getOopField("_constants"), 0); + methodData = new OopField(type.getOopField("_method_data"), 0); methodSize = new CIntField(type.getCIntegerField("_method_size"), 0); maxStack = new CIntField(type.getCIntegerField("_max_stack"), 0); maxLocals = new CIntField(type.getCIntegerField("_max_locals"), 0); @@ -58,9 +59,13 @@ vtableIndex = new CIntField(type.getCIntegerField("_vtable_index"), 0); if (!VM.getVM().isCore()) { invocationCounter = new CIntField(type.getCIntegerField("_invocation_counter"), 0); + backedgeCounter = new CIntField(type.getCIntegerField("_backedge_counter"), 0); } bytecodeOffset = type.getSize(); + interpreterThrowoutCountField = new CIntField(type.getCIntegerField("_interpreter_throwout_count"), 0); + interpreterInvocationCountField = new CIntField(type.getCIntegerField("_interpreter_invocation_count"), 0); + /* interpreterEntry = type.getAddressField("_interpreter_entry"); fromCompiledCodeEntryPoint = type.getAddressField("_from_compiled_code_entry_point"); @@ -79,6 +84,7 @@ // Fields private static OopField constMethod; private static OopField constants; + private static OopField methodData; private static CIntField methodSize; private static CIntField maxStack; private static CIntField maxLocals; @@ -86,10 +92,14 @@ private static CIntField accessFlags; private static CIntField vtableIndex; private static CIntField invocationCounter; + private static CIntField backedgeCounter; private static long bytecodeOffset; private static AddressField code; + private static CIntField interpreterThrowoutCountField; + private static CIntField interpreterInvocationCountField; + // constant method names - <init>, <clinit> // Initialized lazily to avoid initialization ordering dependencies between Method and SymbolTable private static Symbol objectInitializerName; @@ -116,6 +126,7 @@ // Accessors for declared fields public ConstMethod getConstMethod() { return (ConstMethod) constMethod.getValue(this); } public ConstantPool getConstants() { return (ConstantPool) constants.getValue(this); } + public MethodData getMethodData() { return (MethodData) methodData.getValue(this); } public TypeArray getExceptionTable() { return getConstMethod().getExceptionTable(); } /** WARNING: this is in words, not useful in this system; use getObjectSize() instead */ public long getMethodSize() { return methodSize.getValue(this); } @@ -134,6 +145,12 @@ } return invocationCounter.getValue(this); } + public long getBackedgeCounter() { + if (Assert.ASSERTS_ENABLED) { + Assert.that(!VM.getVM().isCore(), "must not be used in core build"); + } + return backedgeCounter.getValue(this); + } // get associated compiled native method, if available, else return null. public NMethod getNativeMethod() { @@ -333,4 +350,11 @@ buf.append(")"); return buf.toString().replace('/', '.'); } + public int interpreterThrowoutCount() { + return (int) interpreterThrowoutCountField.getValue(getHandle()); + } + + public int interpreterInvocationCount() { + return (int) interpreterInvocationCountField.getValue(getHandle()); + } }