|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.compilers.opt.bc2ir.GenerationContext
public final class GenerationContext
Defines the context in which BC2IR will abstractly interpret a method's bytecodes and populate targetIR with instructions.
Field Summary | |
---|---|
private HashMap<Register,RegisterOperand> |
_ncGuards
|
private Register[] |
addressLocals
|
boolean |
allocFrame
Did BC2IR encounter a magic that requires us to allocate a stack frame? |
(package private) Operand[] |
arguments
The parameters which BC2IR should use to seed the local state for the entry basic block. |
(package private) BranchProfiles |
branchProfiles
The BranchProfile data for method, if available |
ControlFlowGraph |
cfg
The CFG object into which instructions should be generated. |
(package private) boolean |
doesCheckStore
Do we do check stores? |
private Register[] |
doubleLocals
|
(package private) ExceptionHandlerBasicBlockBag |
enclosingHandlers
The enclosing exception handlers (null if there are none). |
BasicBlock |
epilogue
The basic block into which BC2IR's caller will generate an epilogue. |
BasicBlock |
exit
The exit node of the outermost CFG (used by BC2IR for not-definitely caught athrows and by OSR_Yieldpoints) |
private Register[] |
floatLocals
|
boolean |
generatedExceptionHandlers
Did BC2IR generate a reachable exception handler while generating the IR for this method |
(package private) InlineOracle |
inlinePlan
The InlineOracle to be consulted for all inlining decisions during the generation of this IR. |
InlineSequence |
inlineSequence
Inlining context of the method to be generated |
private Register[] |
intLocals
|
private Register[] |
longLocals
|
NormalMethod |
method
The method to be generated |
OptOptions |
options
The options to control the generation |
(package private) CompiledMethod |
original_cm
The compiled method assigned for this compilation of original_method |
(package private) NormalMethod |
original_method
The original method (root of the calling context tree) |
BasicBlock |
prologue
The basic block into which BC2IR's caller will generate a "prologue." |
Operand |
result
Used to communicate the meet of the return values back to the caller Mainly useful when BC2IR is doing inlining....allows the caller BC2IR object to exploit knowledge the callee BC2IR object had about the result. |
(package private) Register |
resultReg
The Register to which BC2IR should assign the return value(s) of the method. |
ArchitectureSpecificOpt.RegisterPool |
temps
The register pool to be used during generation |
(package private) BasicBlock |
unlockAndRethrow
A catch, unlock, and rethrow exception handler used for synchronized methods. |
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 | |
---|---|
private |
GenerationContext()
for internal use only (in createInlinedContext) |
(package private) |
GenerationContext(NormalMethod meth,
TypeReference[] params,
CompiledMethod cm,
OptOptions opts,
InlineOracle ip)
Use this constructor to create an outermost (non-inlined) GenerationContext. |
Method Summary | |
---|---|
private void |
appendInstruction(BasicBlock b,
Instruction s,
int bcIndex)
|
void |
close()
Kill ncGuards, so we do not use outdated mappings unintendedly later on |
private void |
completeEpilogue(boolean isOutermost)
Fill in the rest of the method epilogue. |
private void |
completeExceptionHandlers(boolean isOutermost)
If the method is synchronized then we wrap it in a synthetic exception handler that unlocks & rethrows PRECONDITION: cfg, arguments & temps have been setup/initialized. |
private void |
completePrologue(boolean isOutermost)
Fill in the rest of the method prologue. |
static GenerationContext |
createChildContext(GenerationContext parent,
ExceptionHandlerBasicBlockBag ebag,
NormalMethod callee,
Instruction callSite)
Create a child generation context from parent & callerBB to generate IR for callsite. |
static GenerationContext |
createSynthetic(GenerationContext parent,
ExceptionHandlerBasicBlockBag ebag)
Only for internal use by Inliner (when inlining multiple targets) This is probably not the prettiest way to handle this, but it requires no changes to BC2IR's & Inliner's high level control logic. |
BranchProfileOperand |
getConditionalBranchProfileOperand(int bcIndex,
boolean backwards)
|
int |
getLocalNumberFor(Register reg,
TypeReference type)
Get the local number for a given register |
private Operand |
getLockObject()
Get the object for locking for synchronized methods. |
private Register[] |
getPool(TypeReference type)
|
SwitchBranchProfile |
getSwitchProfile(int bcIndex)
|
private void |
initLocalPool()
|
boolean |
isLocal(Operand op,
int i,
TypeReference type)
Is the operand a particular bytecode local? |
Register |
localReg(int i,
TypeReference type)
Return the Register used to for local i of TypeReference type |
(package private) RegisterOperand |
makeLocal(int i,
RegisterOperand props)
Make a register operand that refers to the given local variable number, and inherits its properties (type, flags) from props |
RegisterOperand |
makeLocal(int i,
TypeReference type)
Make a register operand that refers to the given local variable number and has the given type. |
(package private) RegisterOperand |
makeNullCheckGuard(Register ref)
Make a register operand to use as a null check guard for the given register. |
(package private) boolean |
noBoundsChecks()
Should bounds checks be generated? |
(package private) boolean |
noNullChecks()
Should null checks be generated? |
private boolean |
requiresUnintMarker()
|
private void |
resync_ncGuards()
This method makes sure that _ncGuard only maps to registers that are actually in the IRs register pool. |
void |
resync()
Make sure, the generation context is still in sync with the IR, even if we applied some optimizations. |
static void |
transferState(GenerationContext parent,
GenerationContext child)
Use this to transfer state back from a child context back to its parent. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
NormalMethod original_method
CompiledMethod original_cm
public NormalMethod method
BranchProfiles branchProfiles
public OptOptions options
public ControlFlowGraph cfg
public ArchitectureSpecificOpt.RegisterPool temps
Operand[] arguments
public BasicBlock prologue
public BasicBlock epilogue
public BasicBlock exit
BasicBlock unlockAndRethrow
Register resultReg
ExceptionHandlerBasicBlockBag enclosingHandlers
public InlineSequence inlineSequence
InlineOracle inlinePlan
public boolean generatedExceptionHandlers
public boolean allocFrame
public Operand result
boolean doesCheckStore
private Register[] intLocals
private Register[] addressLocals
private Register[] floatLocals
private Register[] longLocals
private Register[] doubleLocals
private HashMap<Register,RegisterOperand> _ncGuards
Constructor Detail |
---|
GenerationContext(NormalMethod meth, TypeReference[] params, CompiledMethod cm, OptOptions opts, InlineOracle ip)
meth
- The NormalMethod whose IR will be generatedparams
- The known types of the parameters to the method. For method specialization.cm
- The compiled method id to be used for this compilationopts
- The Options to be used for the generationip
- The InlineOracle to be used for the generationprivate GenerationContext()
Method Detail |
---|
public static GenerationContext createChildContext(GenerationContext parent, ExceptionHandlerBasicBlockBag ebag, NormalMethod callee, Instruction callSite)
parent
- the parent gcebag
- the enclosing exception handlers (null if none)callee
- the callee method to be inlined
(may _not_ be equal to Call.getMethod(callSite).method)callSite
- the Call instruction to be inlined.
public static GenerationContext createSynthetic(GenerationContext parent, ExceptionHandlerBasicBlockBag ebag)
parent
- the parent GCebag
- the enclosing exception handlers (null if none)
public static void transferState(GenerationContext parent, GenerationContext child)
parent
- the parent context that will receive the statechild
- the child context from which the state will be takenprivate void initLocalPool()
private Register[] getPool(TypeReference type)
public Register localReg(int i, TypeReference type)
boolean noNullChecks()
boolean noBoundsChecks()
public RegisterOperand makeLocal(int i, TypeReference type)
i
- local variable numbertype
- desired data typeRegisterOperand makeLocal(int i, RegisterOperand props)
i
- local variable numberprops
- RegisterOperand to inherit flags frompublic int getLocalNumberFor(Register reg, TypeReference type)
public boolean isLocal(Operand op, int i, TypeReference type)
RegisterOperand makeNullCheckGuard(Register ref)
public BranchProfileOperand getConditionalBranchProfileOperand(int bcIndex, boolean backwards)
public SwitchBranchProfile getSwitchProfile(int bcIndex)
private void completePrologue(boolean isOutermost)
private void completeEpilogue(boolean isOutermost)
private void completeExceptionHandlers(boolean isOutermost)
private Operand getLockObject()
private void appendInstruction(BasicBlock b, Instruction s, int bcIndex)
private boolean requiresUnintMarker()
public void resync()
private void resync_ncGuards()
public void close()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |