public class CompiledMethods extends Object
Original extracted from RVMClassLoader.
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
CompiledMethods() |
Modifier and Type | Method and Description |
---|---|
static CompiledMethod |
createCompiledMethod(RVMMethod m,
int compilerType) |
static CompiledMethod |
createHardwareTrapCompiledMethod() |
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) |
static CompiledMethod |
getCompiledMethodUnchecked(int cmid) |
static int |
numCompiledMethods() |
private static void |
setCompiledMethod(int cmid,
CompiledMethod cm) |
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
|
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()
public CompiledMethods()
private static void ensureCapacity(int id)
id
- the id we need to ensure capacity forpublic static CompiledMethod getCompiledMethodUnchecked(int cmid)
cmid
- id of the methodprivate static void setCompiledMethod(int cmid, CompiledMethod cm)
public static CompiledMethod getCompiledMethod(int compiledMethodId)
compiledMethodId
- the id of the compiled methodpublic 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()