|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.compilers.common.CompiledMethod
public abstract class CompiledMethod
A method that has been compiled into machine code by one of our compilers.
Field Summary | |
---|---|
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 ArchitectureSpecific.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 |
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 Summary | |
---|---|
CompiledMethod(int id,
RVMMethod m)
Set the cmid and method fields |
Method Summary | |
---|---|
void |
clearActiveOnStack()
|
ArchitectureSpecific.CodeArray |
codeArrayForOffset(Offset offset)
Return the code array for this method that contains the given offset. |
void |
compileComplete(ArchitectureSpecific.CodeArray code)
Record 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. |
ArchitectureSpecific.CodeArray |
getEntryCodeArray()
|
abstract ExceptionDeliverer |
getExceptionDeliverer()
Get handler to deal with stack unwinding and exception delivery for this compiled method's stackframes. |
int |
getId()
Return the compiled method id for this compiled method |
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()
Return the RVMMethod associated with this compiled method |
Offset |
getOsrJTOCoffset()
|
boolean |
getSamplesReset()
|
boolean |
hasBridgeFromNativeAnnotation()
Does this method have a bridge from native annotation, important when walking the stack |
boolean |
isActiveOnStack()
|
boolean |
isCompiled()
Has compilation completed? |
boolean |
isInvalid()
Is the compiled code invalid? |
boolean |
isObsolete()
Is the compiled code obsolete? |
boolean |
isOutdated()
Check if the compiled method is marked as outdated, called by Thread |
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()
Return the number of bytes used to encode the compiler-specific mapping information for this compiled method. |
boolean |
up(StackBrowser browser)
Advance the StackBrowser up one internal stack frame, if possible |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
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
public final RVMMethod method
protected ArchitectureSpecific.CodeArray instructions
protected int osrJTOCoffset
protected float compilationTime
Constructor Detail |
---|
public CompiledMethod(int id, RVMMethod m)
Method Detail |
---|
public 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 ArchitectureSpecific.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 ArchitectureSpecific.CodeArray codeArrayForOffset(Offset offset)
offset
- the offset of the desired instruction (as returned by getInstructionOffset)
public final boolean containsReturnAddress(Address ip)
ip
- a return address
true
if it belongs to this method's code, false
otherwise.public final void compileComplete(ArchitectureSpecific.CodeArray code)
public final void setInvalid()
public final void setObsolete()
public final void setActiveOnStack()
public final void clearActiveOnStack()
public final void setOutdated()
public final boolean isOutdated()
public final boolean isCompiled()
public final boolean isInvalid()
public final boolean isObsolete()
public 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 bytes
public abstract boolean isWithinUninterruptibleCode(Offset instructionOffset)
instructionOffset
- of addr from start of instructions in bytes
true
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)
public boolean up(StackBrowser browser)
public int size()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |