|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.compilers.opt.inlining.InlineTools
public abstract class InlineTools
This class provides some utilities that are useful for inlining.
Field Summary |
---|
Fields inherited from interface org.jikesrvm.compilers.opt.driver.OptConstants |
---|
EPILOGUE_BCI, EPILOGUE_BLOCK_BCI, EXTANT_ANALYSIS_BCI, INSTRUMENTATION_BCI, MAYBE, METHOD_COUNTER_BCI, NO, OSR_PROLOGUE, PROLOGUE_BCI, PROLOGUE_BLOCK_BCI, RECTIFY_BCI, RUNTIME_SERVICES_BCI, SSA_SYNTH_BCI, SYNCHRONIZED_MONITORENTER_BCI, SYNCHRONIZED_MONITOREXIT_BCI, SYNTH_CATCH_BCI, SYNTH_LOOP_VERSIONING_BCI, UNKNOWN_BCI, YES |
Constructor Summary | |
---|---|
InlineTools()
|
Method Summary | |
---|---|
static boolean |
hasBody(RVMMethod callee)
Does the callee method have a body? |
static boolean |
hasInlinePragma(RVMMethod callee,
CompilationState state)
Should the callee method always be inlined? |
static boolean |
hasNoInlinePragma(RVMMethod callee,
CompilationState state)
Should the callee method be barred from ever being considered for inlining? |
static boolean |
implementsInterface(Class<?> A,
Class<?> B)
Does class A directly implement the interface B ? |
static int |
inlinedSizeEstimate(NormalMethod callee,
CompilationState state)
Given the currently available information at the call site, what's our best guess on the inlined size of the callee? |
static boolean |
isCurrentlyFinal(RVMMethod callee,
boolean searchSubclasses)
Is the method CURRENTLY final (not overridden by any subclass)? |
static boolean |
isForbiddenSpeculation(RVMMethod caller,
RVMMethod callee)
Is it safe to speculatively inline the callee into the caller? |
static boolean |
needsGuard(RVMMethod callee)
Does an inlined call to callee need a guard, to protect against a mispredicted dynamic dispatch? |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InlineTools()
Method Detail |
---|
public static boolean implementsInterface(Class<?> A, Class<?> B)
A
directly implement the interface B
?
public static boolean hasBody(RVMMethod callee)
callee
- The callee method
true
if it has bytecodes, false otherwise.public static boolean needsGuard(RVMMethod callee)
callee
- the callee methodpublic static boolean isCurrentlyFinal(RVMMethod callee, boolean searchSubclasses)
public static int inlinedSizeEstimate(NormalMethod callee, CompilationState state)
callee
- the method to be inlinedstate
- the compilation state decribing the call site where it
is to be inlined
public static boolean hasInlinePragma(RVMMethod callee, CompilationState state)
callee
- the method being considered for inliningstate
- the compilation state of the caller.
public static boolean hasNoInlinePragma(RVMMethod callee, CompilationState state)
callee
- the method being considered for inliningstate
- the compilation state of the caller.
public static boolean isForbiddenSpeculation(RVMMethod caller, RVMMethod callee)
Some forms of speculative inlining are unsafe to apply to methods of the core virtual machine because if we are forced to invalidate the methods, we will be unable to compile their replacement method.
TODO The current test is overly conservative, but past attempts at defining a more precise set of "third rail" classes have always resulted in missing some (only to discover them later when Jikes RVM hangs or crashes.)
caller
- the caller methodcallee
- the callee method
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |