public abstract class CompiledMethod extends Object
Modifier and Type | Field and Description |
---|---|
private static byte |
ACTIVE_ON_STACK |
static int |
BASELINE |
private static byte |
BRIDGE_FROM_NATIVE
Has bridge from native annotation, NB this makes the flags byte negative
|
protected int |
cmid
The compiled method id of this compiled method (index into CompiledMethods)
|
protected float |
compilationTime
The time in milliseconds taken to compile the method.
|
private static byte |
COMPILED |
private byte |
flags
Flags bit field
|
protected CodeArray |
instructions
The compiled machine code for said method.
|
private static byte |
INVALID |
static int |
JNI |
RVMMethod |
method
The RVMMethod that was compiled
|
static int |
NATIVE_METHOD_LINE_NUMBER
Line number for native methods defined by the constructor of java.lang.StackTraceElement
|
static int |
NUM_COMPILER_TYPES |
private static byte |
OBSOLETE |
static int |
OPT |
protected int |
osrJTOCoffset
the offset of instructions in JTOC, for osr-special compiled
method only. all osr-ed method is treated like static.
|
private static byte |
OUTDATED
flags the compiled method as outdated, needs OSR
|
private static byte |
SAMPLES_RESET
Has the method sample data for this compiled method been reset?
|
private static byte |
SPECIAL_FOR_OSR |
static int |
TRAP |
Constructor and Description |
---|
CompiledMethod(int id,
RVMMethod m) |
Modifier and Type | Method and Description |
---|---|
void |
clearActiveOnStack() |
CodeArray |
codeArrayForOffset(Offset offset)
Return the code array for this method that contains the given offset.
|
void |
compileComplete(CodeArray code)
Records that the compilation is complete.
|
static String |
compilerTypeToString(int compilerType) |
boolean |
containsReturnAddress(Address ip)
Does the code for the compiled method contain the given return address?
|
abstract int |
findCatchBlockForInstruction(Offset instructionOffset,
RVMType exceptionType)
Find "catch" block for a machine instruction of
this method that might be guarded
against specified class of exceptions by a "try" block.
|
int |
findLineNumberForInstruction(Offset instructionOffset)
Find source line number corresponding to one of this method's
machine instructions.
|
double |
getCompilationTime() |
abstract String |
getCompilerName() |
abstract int |
getCompilerType()
Identify the compiler that produced this compiled method.
|
abstract void |
getDynamicLink(DynamicLink dynamicLink,
Offset instructionOffset)
Fetch symbolic reference to a method that's called by one of
this method's instructions.
|
CodeArray |
getEntryCodeArray() |
abstract ExceptionDeliverer |
getExceptionDeliverer() |
int |
getId() |
Address |
getInstructionAddress(Offset offset)
Return the address of the instruction at offset offset in the method's instruction stream.
|
Offset |
getInstructionOffset(Address ip)
Return the offset in bytes of the given Address from the start
of the machine code array.
|
Offset |
getInstructionOffset(Address ip,
boolean dieOnFailure)
Return the offset in bytes of the given Address from the start
of the machine code array.
|
RVMMethod |
getMethod() |
Offset |
getOsrJTOCoffset() |
boolean |
getSamplesReset() |
boolean |
hasBridgeFromNativeAnnotation() |
boolean |
isActiveOnStack() |
boolean |
isCompiled() |
boolean |
isInvalid() |
boolean |
isObsolete() |
boolean |
isOutdated() |
boolean |
isSpecialForOSR() |
abstract boolean |
isWithinUninterruptibleCode(Offset instructionOffset)
Return whether or not the given address (which is purported to be inside
of the compiled method's code array) corresponds to an uninterruptible context.
|
int |
numberOfInstructions() |
abstract void |
printStackTrace(Offset instructionOffset,
PrintLN out)
Print this compiled method's portion of a stack trace
|
abstract void |
set(StackBrowser browser,
Offset instr)
Set the stack browser to the innermost logical stack frame of this method.
|
void |
setActiveOnStack() |
void |
setCompilationTime(double ct) |
void |
setInvalid()
Mark the compiled method as invalid
|
void |
setObsolete()
Mark the compiled method as obsolete (ie a candidate for eventual GC)
|
void |
setOutdated()
Mark the compiled method as outdated (i.e. requires OSR),
the flag is set in AnalyticModel
|
void |
setSamplesReset() |
void |
setSpecialForOSR() |
int |
size() |
boolean |
up(StackBrowser browser)
Advance the StackBrowser up one internal stack frame, if possible
|
public static final int TRAP
public static final int BASELINE
public static final int OPT
public static final int JNI
public static final int NUM_COMPILER_TYPES
public static final int NATIVE_METHOD_LINE_NUMBER
private static final byte COMPILED
private static final byte INVALID
private static final byte OBSOLETE
private static final byte ACTIVE_ON_STACK
private static final byte OUTDATED
private static final byte SAMPLES_RESET
private static final byte SPECIAL_FOR_OSR
private static final byte BRIDGE_FROM_NATIVE
private byte flags
protected final int cmid
protected CodeArray instructions
protected int osrJTOCoffset
protected float compilationTime
public CompiledMethod(int id, RVMMethod m)
id
- the compiled method idm
- the method that this compiled method belongs topublic void setSamplesReset()
public boolean getSamplesReset()
public void setSpecialForOSR()
public boolean isSpecialForOSR()
public final Offset getOsrJTOCoffset()
public final int getId()
public final RVMMethod getMethod()
public final boolean hasBridgeFromNativeAnnotation()
public final CodeArray getEntryCodeArray()
public final int numberOfInstructions()
public final Offset getInstructionOffset(Address ip)
ip
- a Address (should be an interior pointer to instructions)public final Offset getInstructionOffset(Address ip, boolean dieOnFailure)
ip
- a Address (should be an interior pointer to instructions)dieOnFailure
- if ip is invalid should we kill the VM (we don't want
to if already in the process of killing the VM)public final Address getInstructionAddress(Offset offset)
offset
- the offset of the desired instruction (as returned by getInstructionOffset)public final CodeArray codeArrayForOffset(Offset offset)
offset
- the offset of the desired instruction (as returned by getInstructionOffset)public final boolean containsReturnAddress(Address ip)
ip
- a return addresstrue
if it belongs to this method's code, false
otherwise.public final void compileComplete(CodeArray code)
code
- the method's codepublic final void setInvalid()
public final void setObsolete()
public final void setActiveOnStack()
public final void clearActiveOnStack()
public final void setOutdated()
public final boolean isOutdated()
true
if the compiled method is marked as outdatedpublic final boolean isCompiled()
true
if compilation has completedpublic final boolean isInvalid()
true
if the compiled code is invalidpublic final boolean isObsolete()
true
if the compiled code is obsoletepublic final boolean isActiveOnStack()
public final double getCompilationTime()
public final void setCompilationTime(double ct)
public abstract int getCompilerType()
public static String compilerTypeToString(int compilerType)
public abstract String getCompilerName()
public abstract ExceptionDeliverer getExceptionDeliverer()
public abstract int findCatchBlockForInstruction(Offset instructionOffset, RVMType exceptionType)
Notes:
null
pointer dereference, array bounds check,
or divide by zero) on a machine architecture with variable length
instructions.
In such situations we'd have no idea how far to back up the
instruction pointer
to point to the "call site" or "exception site".
instructionOffset
- offset of machine instruction from start of this method, in bytesexceptionType
- type of exception being thrown - something like "NullPointerException"public abstract void getDynamicLink(DynamicLink dynamicLink, Offset instructionOffset)
Notes:
dynamicLink
- place to put return informationinstructionOffset
- offset of machine instruction from start of
this method, in bytespublic int findLineNumberForInstruction(Offset instructionOffset)
Usage note: "instructionOffset" must point to the instruction following the actual instruction whose line number is sought. This allows us to properly handle the case where the only address we have to work with is a return address (ie. from a stackframe) or an exception address (ie. from a null pointer dereference, array bounds check, or divide by zero) on a machine architecture with variable length instructions. In such situations we'd have no idea how far to back up the instruction pointer to point to the "call site" or "exception site".
instructionOffset
- of machine instruction from start of this method, in bytespublic abstract boolean isWithinUninterruptibleCode(Offset instructionOffset)
instructionOffset
- of addr from start of instructions in bytestrue
if the IP is within an Uninterruptible method, false
otherwise.public abstract void printStackTrace(Offset instructionOffset, PrintLN out)
instructionOffset
- offset of machine instruction from start of methodout
- the PrintLN to print the stack trace to.public abstract void set(StackBrowser browser, Offset instr)
browser
- the browserinstr
- the offset of the instructionpublic boolean up(StackBrowser browser)
browser
- the browser to advancepublic int size()