|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.compilers.common.CompiledMethods
public class CompiledMethods
Manage pool of compiled methods.
Original extracted from RVMClassLoader.
Field Summary | |
---|---|
private static CompiledMethod[][] |
compiledMethods
Java methods that have been compiled into machine code. |
private static int |
currentCompiledMethodId
Index of most recently allocated slot in compiledMethods[]. |
private static int |
LOG_ROW_SIZE
2^LOG_ROW_SIZE is the number of elements per row |
private static int |
ROW_MASK
Mask to ascertain row from id number |
private static boolean |
scanForObsoleteMethods
Used to communicate between setCompiledMethodObsolete(org.jikesrvm.compilers.common.CompiledMethod)
and snipObsoleteCompiledMethods() |
Constructor Summary | |
---|---|
CompiledMethods()
|
Method Summary | |
---|---|
static CompiledMethod |
createCompiledMethod(RVMMethod m,
int compilerType)
Create a CompiledMethod appropriate for the given compilerType |
static CompiledMethod |
createHardwareTrapCompiledMethod()
Create a CompiledMethod for the synthetic hardware trap frame |
private static void |
ensureCapacity(int id)
Ensure space in backing array for id |
static CompiledMethod |
findMethodForInstruction(Address ip)
Find the method whose machine code contains the specified instruction. |
static CompiledMethod |
getCompiledMethod(int compiledMethodId)
Fetch a previously compiled method. |
static CompiledMethod |
getCompiledMethodUnchecked(int cmid)
Fetch a previously compiled method without checking |
static int |
numCompiledMethods()
Get number of methods compiled so far. |
private static void |
setCompiledMethod(int cmid,
CompiledMethod cm)
Set entry in compiled method lookup |
static void |
setCompiledMethodObsolete(CompiledMethod compiledMethod)
|
static void |
snipObsoleteCompiledMethods()
Snip reference to CompiledMethod so that we can reclaim code space. |
static void |
spaceReport()
Report on the space used by compiled code and associated mapping information |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int LOG_ROW_SIZE
private static final int ROW_MASK
private static CompiledMethod[][] compiledMethods
private static int currentCompiledMethodId
private static boolean scanForObsoleteMethods
setCompiledMethodObsolete(org.jikesrvm.compilers.common.CompiledMethod)
and snipObsoleteCompiledMethods()
Constructor Detail |
---|
public CompiledMethods()
Method Detail |
---|
private static void ensureCapacity(int id)
public static CompiledMethod getCompiledMethodUnchecked(int cmid)
private static void setCompiledMethod(int cmid, CompiledMethod cm)
public static CompiledMethod getCompiledMethod(int compiledMethodId)
public static CompiledMethod createCompiledMethod(RVMMethod m, int compilerType)
public static CompiledMethod createHardwareTrapCompiledMethod()
public static int numCompiledMethods()
public static CompiledMethod findMethodForInstruction(Address ip)
Assumption: caller has disabled gc (otherwise collector could move
objects without fixing up the raw ip
pointer)
Note: this method is highly inefficient. Normally you should use the
following instead:
RVMClassLoader.getCompiledMethod(Magic.getCompiledMethodID(fp))
ip
- instruction address. Usage note: ip
must point
to the instruction *following* the
actual instruction whose method is sought. This allows us to properly
handle the case where the only address we have to work with is a return
address (i.e. from a stackframe) or an exception address (i.e. 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".
null
--> not found)public static void setCompiledMethodObsolete(CompiledMethod compiledMethod)
public static void snipObsoleteCompiledMethods()
NOTE: It's expected that this is processed during GC, after scanning stacks to determine which methods are currently executing.
public static void spaceReport()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |