public abstract class IRScope
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected static class |
IRScope.LocalVariableAllocator |
Modifier and Type | Field and Description |
---|---|
protected boolean |
canReceiveBreaks
Can this scope receive breaks
|
boolean |
canReceiveNonlocalReturns
Can this scope receive a non-local return?
|
protected boolean |
hasBreakInstrs
Does this scope have a break instr?
|
protected boolean |
hasNonlocalReturns
Does this scope have a non-local return instr?
|
protected int |
temporaryVariableIndex |
Modifier | Constructor and Description |
---|---|
|
IRScope(IRManager manager,
IRScope lexicalParent,
java.lang.String name,
java.lang.String fileName,
int lineNumber,
StaticScope staticScope) |
protected |
IRScope(IRScope s,
IRScope lexicalParent) |
Modifier and Type | Method and Description |
---|---|
protected void |
addChildScope(IRScope scope) |
void |
addClosure(IRClosure c) |
void |
addInstr(Instr i) |
void |
addInstrAtBeginning(Instr i) |
protected int |
allocateNextPrefixedName(java.lang.String prefix) |
boolean |
bindingHasEscaped() |
CFG |
buildCFG() |
void |
buildCFG(java.util.List<Instr> instrList) |
java.util.List<BasicBlock> |
buildLinearization() |
boolean |
canCaptureCallersBinding() |
boolean |
canReceiveNonlocalReturns() |
CFG |
cfg() |
void |
checkRelinearization() |
void |
computeScopeFlags() |
boolean |
definesLocalVariable(Variable v) |
protected void |
depends(java.lang.Object obj) |
boolean |
equals(java.lang.Object other) |
LocalVariable |
findExistingLocalVariable(java.lang.String name,
int depth) |
CFG |
getCFG() |
java.util.List<IRClosure> |
getClosures() |
RubyModule |
getContainerModule() |
Variable |
getCurrentModuleVariable() |
Variable |
getCurrentScopeVariable() |
DataFlowProblem |
getDataFlowSolution(java.lang.String name) |
int |
getEnsurerPC(Instr excInstr) |
java.lang.String |
getFileName() |
abstract LocalVariable |
getImplicitBlockArg() |
java.util.List<Instr> |
getInstrs() |
Instr[] |
getInstrsForInterpretation() |
Instr |
getLastInstr() |
IRScope |
getLexicalParent()
Returns the lexical scope that contains this scope definition
|
java.util.List<IRScope> |
getLexicalScopes() |
int |
getLineNumber() |
LocalVariable |
getLocalVariable(java.lang.String name,
int scopeDepth)
Find or create a local variable.
|
int |
getLocalVariablesCount() |
IRManager |
getManager() |
java.lang.String |
getName() |
IRScope |
getNearestFlipVariableScope() |
IRMethod |
getNearestMethod() |
IRScope |
getNearestModuleReferencingScope()
Returns the nearest scope which we can extract a live module from.
|
IRScope |
getNearestTopLocalVariableScope() |
LocalVariable |
getNewFlipStateVariable() |
Variable |
getNewInlineVariable(java.lang.String inlinePrefix,
Variable v) |
Label |
getNewLabel() |
Label |
getNewLabel(java.lang.String prefix) |
LocalVariable |
getNewLocalVariable(java.lang.String name,
int depth) |
TemporaryVariable |
getNewTemporaryVariable() |
TemporaryVariable |
getNewTemporaryVariable(java.lang.String name) |
int |
getNextClosureId() |
protected int |
getPrefixCountSize(java.lang.String prefix) |
int |
getRescuerPC(Instr excInstr) |
int |
getScopeId() |
abstract java.lang.String |
getScopeName() |
LocalVariable |
getSelf()
---------------------------------------
SSS FIXME: What is this method for?
|
StaticScope |
getStaticScope() |
int |
getTemporaryVariableSize() |
int |
getThreadPollInstrsCount() |
IRScope |
getTopLevelScope()
Returns the top level scope
|
int |
getUsedVariablesCount() |
boolean |
hasExplicitCallProtocol() |
int |
hashCode() |
boolean |
hasLoops() |
protected void |
initEvalScopeVariableAllocator(boolean reset) |
void |
initFlipStateVariable(Variable v,
Operand initState) |
void |
inlineMethod(IRScope method,
RubyModule implClass,
int classToken,
BasicBlock basicBlock,
CallBase call) |
boolean |
isFlipScope() |
boolean |
isForLoopBody() |
boolean |
isModuleBody()
Does this scope represent a module body? (SSS FIXME: what about script or eval script bodies?)
|
boolean |
isNestedInClosure(IRClosure closure) |
boolean |
isNonSingletonClassBody()
Is this IRClassBody but not IRMetaClassBody?
|
boolean |
isScriptScope()
Is this an eval script or a regular file script?
|
boolean |
isTopLocalVariableScope() |
java.util.List<BasicBlock> |
linearization() |
void |
markUnusedImplicitBlockArg() |
boolean |
modifiesCode() |
Tuple<Instr[],java.util.Map<java.lang.Integer,Label[]>> |
prepareForCompilation()
Run any necessary passes to get the IR ready for compilation
|
Instr[] |
prepareForInterpretation(boolean isLambda)
Run any necessary passes to get the IR ready for interpretation
|
boolean |
receivesKeywordArgs() |
void |
recordBeginBlock(IRClosure beginBlockClosure) |
void |
recordEndBlock(IRClosure endBlockClosure) |
void |
resetCFG() |
void |
resetDFProblemsState() |
void |
resetLinearizationData() |
void |
resetState() |
void |
resetTemporaryVariables() |
protected void |
resetVariableCounter(java.lang.String prefix) |
protected void |
setCFG(CFG cfg) |
void |
setCodeModificationFlag(boolean f) |
void |
setDataFlowSolution(java.lang.String name,
DataFlowProblem p) |
void |
setExplicitCallProtocolFlag(boolean flag) |
void |
setHasLoopsFlag(boolean f) |
void |
setName(java.lang.String name) |
void |
setUpUseDefLocalVarMaps() |
void |
splitCalls() |
java.lang.String |
toPersistableString() |
java.lang.String |
toString() |
java.lang.String |
toStringInstrs() |
java.lang.String |
toStringVariables() |
boolean |
usesBackrefOrLastline() |
boolean |
usesEval() |
boolean |
usesLocalVariable(Variable v) |
boolean |
usesZSuper() |
protected int temporaryVariableIndex
protected boolean hasBreakInstrs
protected boolean canReceiveBreaks
protected boolean hasNonlocalReturns
public boolean canReceiveNonlocalReturns
public IRScope(IRManager manager, IRScope lexicalParent, java.lang.String name, java.lang.String fileName, int lineNumber, StaticScope staticScope)
public int getScopeId()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
protected void addChildScope(IRScope scope)
public java.util.List<IRScope> getLexicalScopes()
public void addClosure(IRClosure c)
public Instr getLastInstr()
public void addInstrAtBeginning(Instr i)
public void addInstr(Instr i)
public LocalVariable getNewFlipStateVariable()
public boolean isForLoopBody()
public Label getNewLabel(java.lang.String prefix)
public Label getNewLabel()
public java.util.List<IRClosure> getClosures()
public IRManager getManager()
public IRScope getLexicalParent()
public StaticScope getStaticScope()
public IRMethod getNearestMethod()
public IRScope getNearestFlipVariableScope()
public IRScope getNearestTopLocalVariableScope()
public IRScope getNearestModuleReferencingScope()
public java.lang.String getName()
public void setName(java.lang.String name)
public java.lang.String getFileName()
public int getLineNumber()
public IRScope getTopLevelScope()
public boolean isNestedInClosure(IRClosure closure)
public void setHasLoopsFlag(boolean f)
public boolean hasLoops()
public boolean hasExplicitCallProtocol()
public void setExplicitCallProtocolFlag(boolean flag)
public void setCodeModificationFlag(boolean f)
public boolean receivesKeywordArgs()
public boolean modifiesCode()
public boolean bindingHasEscaped()
public boolean usesBackrefOrLastline()
public boolean usesEval()
public boolean usesZSuper()
public boolean canCaptureCallersBinding()
public boolean canReceiveNonlocalReturns()
public CFG buildCFG()
protected void setCFG(CFG cfg)
public CFG getCFG()
public Instr[] prepareForInterpretation(boolean isLambda)
public Tuple<Instr[],java.util.Map<java.lang.Integer,Label[]>> prepareForCompilation()
public void computeScopeFlags()
public abstract java.lang.String getScopeName()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toStringInstrs()
public java.lang.String toPersistableString()
public java.lang.String toStringVariables()
public LocalVariable getSelf()
public Variable getCurrentModuleVariable()
public Variable getCurrentScopeVariable()
public abstract LocalVariable getImplicitBlockArg()
public void markUnusedImplicitBlockArg()
public LocalVariable findExistingLocalVariable(java.lang.String name, int depth)
public LocalVariable getLocalVariable(java.lang.String name, int scopeDepth)
public LocalVariable getNewLocalVariable(java.lang.String name, int depth)
protected void initEvalScopeVariableAllocator(boolean reset)
public TemporaryVariable getNewTemporaryVariable()
public TemporaryVariable getNewTemporaryVariable(java.lang.String name)
public void resetTemporaryVariables()
public int getTemporaryVariableSize()
public Variable getNewInlineVariable(java.lang.String inlinePrefix, Variable v)
public int getThreadPollInstrsCount()
public int getLocalVariablesCount()
public int getUsedVariablesCount()
public void setUpUseDefLocalVarMaps()
public boolean usesLocalVariable(Variable v)
public boolean definesLocalVariable(Variable v)
public void setDataFlowSolution(java.lang.String name, DataFlowProblem p)
public DataFlowProblem getDataFlowSolution(java.lang.String name)
public java.util.List<Instr> getInstrs()
public Instr[] getInstrsForInterpretation()
public void resetLinearizationData()
public void checkRelinearization()
public java.util.List<BasicBlock> buildLinearization()
public int getRescuerPC(Instr excInstr)
public int getEnsurerPC(Instr excInstr)
public java.util.List<BasicBlock> linearization()
protected void depends(java.lang.Object obj)
public CFG cfg()
public void splitCalls()
public void resetDFProblemsState()
public void resetState()
public void inlineMethod(IRScope method, RubyModule implClass, int classToken, BasicBlock basicBlock, CallBase call)
public void buildCFG(java.util.List<Instr> instrList)
public void resetCFG()
public void recordBeginBlock(IRClosure beginBlockClosure)
public void recordEndBlock(IRClosure endBlockClosure)
protected int allocateNextPrefixedName(java.lang.String prefix)
protected void resetVariableCounter(java.lang.String prefix)
protected int getPrefixCountSize(java.lang.String prefix)
public RubyModule getContainerModule()
public int getNextClosureId()
public boolean isModuleBody()
public boolean isNonSingletonClassBody()
public boolean isFlipScope()
public boolean isTopLocalVariableScope()
public boolean isScriptScope()
Copyright © 2002-2009 JRuby Team. All Rights Reserved.