public final class DefaultInlineOracle extends InlineTools implements InlineOracle
| Constructor and Description |
|---|
DefaultInlineOracle() |
| Modifier and Type | Method and Description |
|---|---|
private byte |
chooseGuard(RVMMethod caller,
RVMMethod singleImpl,
RVMMethod callee,
CompilationState state,
boolean codePatchSupported)
Logic to select the appropriate guarding mechanism for the edge
from caller to callee according to the controlling
OptOptions. |
private int |
inliningActionCost(int inlinedBodyEstimate,
boolean needsGuard,
boolean preEx,
OptOptions opts)
Estimate the expected cost of the inlining action
(includes both the inline body and the guard/off-branch code).
|
InlineDecision |
shouldInline(CompilationState state)
Should we inline a particular call site?
|
hasBody, hasInlinePragma, hasNoInlinePragma, implementsInterface, inlinedSizeEstimate, isCurrentlyFinal, isForbiddenSpeculation, needsGuardpublic DefaultInlineOracle()
public InlineDecision shouldInline(CompilationState state)
InlineOracleshouldInline in interface InlineOraclestate - information needed to make the inlining decisionprivate byte chooseGuard(RVMMethod caller, RVMMethod singleImpl, RVMMethod callee, CompilationState state, boolean codePatchSupported)
OptOptions.
If we are using IG_CODE_PATCH, then this method also records
the required dependency.
Precondition: lock on RVMClass.classLoadListener is held.caller - The caller methodsingleImpl - the method implementation that will be protected by the guardcallee - The callee methodstate - compilation state at this pointcodePatchSupported - Can we use code patching at this call site?private int inliningActionCost(int inlinedBodyEstimate, boolean needsGuard, boolean preEx, OptOptions opts)
inlinedBodyEstimate - size estimate for inlined bodyneedsGuard - is it going to be a guarded inline?preEx - can preEx inlining be used to avoid the guard?opts - controlling options object