public abstract class IRScope extends java.lang.Object implements ParseResult
Modifier and Type | Field and Description |
---|---|
Compilable |
compilable |
protected FullInterpreterContext |
fullInterpreterContext
-X-C full interpretation OR JIT depends on this
|
protected InterpreterContext |
interpreterContext
Startup interpretation depends on this
|
static Logger |
LOG |
protected FullInterpreterContext |
optimizedInterpreterContext
Speculatively optimized code
|
Modifier | Constructor and Description |
---|---|
|
IRScope(IRManager manager,
IRScope lexicalParent,
ByteList name,
int lineNumber,
StaticScope staticScope) |
protected |
IRScope(IRScope s,
IRScope lexicalParent) |
Modifier and Type | Method and Description |
---|---|
boolean |
accessesParentsLocalVariables() |
protected void |
addChildScope(IRScope scope) |
void |
addClosure(IRClosure closure) |
static java.util.EnumSet<IRFlags> |
allocateInitialFlags(IRScope scope) |
InterpreterContext |
allocateInterpreterContext(java.util.List<Instr> instructions,
int tempVariableCount,
java.util.EnumSet<IRFlags> flags)
Make version specific to scope which needs it (e.g.
|
InterpreterContext |
allocateInterpreterContext(java.util.function.Supplier<java.util.List<Instr>> instructions,
int tempVariableCount,
java.util.EnumSet<IRFlags> flags)
Make version specific to scope which needs it (e.g.
|
java.util.Map<BasicBlock,Label> |
buildJVMExceptionTable(FullInterpreterContext fic) |
boolean |
canCaptureCallersBinding() |
boolean |
canReceiveBreaks() |
boolean |
canReceiveNonlocalReturns() |
void |
captureParentRefinements(ThreadContext context)
Duplicate the parent scope's refinements overlay to get a moment-in-time snapshot.
|
void |
cleanupAfterExecution()
We are done with execution of this scope and we can cleanup some amount of things
in this scope which will no longer be used.
|
java.lang.String |
debugOutput() |
protected void |
depends(java.lang.Object obj) |
IGVDumper |
dumpToIGV() |
boolean |
equals(java.lang.Object other) |
boolean |
executesOnce() |
protected LocalVariable |
findExistingLocalVariable(RubySymbol name,
int depth) |
ByteList |
getByteName() |
java.util.Collection<IRClosure> |
getClosures() |
java.util.List<CompilerPass> |
getExecutedPasses() |
FullInterpreterContext |
getExecutionContext() |
java.lang.String |
getFile() |
java.lang.String |
getFileName()
Deprecated.
|
FullInterpreterContext |
getFullInterpreterContext() |
java.lang.String |
getFullyQualifiedName() |
java.lang.String |
getId() |
InterpreterContext |
getInterpreterContext() |
IRScope |
getLexicalParent()
Returns the lexical scope that contains this scope definition
|
java.util.List<IRScope> |
getLexicalScopes() |
int |
getLine() |
int |
getLineNumber()
Deprecated.
|
LocalVariable |
getLocalVariable(RubySymbol name,
int scopeDepth)
Find or create a local variable.
|
java.util.Map<RubySymbol,LocalVariable> |
getLocalVariables()
Get the local variables for this scope.
|
IRManager |
getManager() |
RubySymbol |
getName() |
IRMethod |
getNearestMethod() |
int |
getNearestModuleReferencingScopeDepth()
Returns the nearest scope which we can extract a live module from.
|
IRScope |
getNearestTopLocalVariableScope() |
Label |
getNewLabel() |
Label |
getNewLabel(java.lang.String prefix) |
LocalVariable |
getNewLocalVariable(RubySymbol name,
int scopeDepth) |
int |
getNextClosureId() |
int |
getNextLabelIndex() |
FullInterpreterContext |
getOptimizedInterpreterContext() |
IRScope |
getRootLexicalScope()
Returns the top level scope
|
int |
getScopeId() |
abstract IRScopeType |
getScopeType() |
Variable |
getSelf() |
StaticScope |
getStaticScope() |
boolean |
hasBeenBuilt()
For lazy scopes which IRBuild on demand we can ask this method whether it has been built yet...
|
boolean |
hasBreakInstructions() |
int |
hashCode() |
boolean |
hasLoops() |
boolean |
hasNonLocalReturns() |
void |
inlineMethod(IRMethod methodToInline,
RubyModule metaclass,
long callsiteId,
int classToken,
boolean cloneHost) |
void |
inlineMethodCompiled(IRMethod methodToInline,
RubyModule implClass,
long callsiteId,
int classToken,
boolean cloneHost) |
void |
inlineMethodJIT(IRMethod methodToInline,
RubyModule implClass,
long callsiteId,
int classToken,
boolean cloneHost) |
boolean |
inliningAllowed() |
boolean |
isModuleBody()
Does this scope represent a module body?
|
boolean |
isNestedInClosure(IRClosure closure) |
boolean |
isNonSingletonClassBody()
Is this IRClassBody but not IRMetaClassBody?
|
boolean |
isScopeContainedBy(IRScope parentScope)
returns whether this scope is contained by the parentScope parameter.
|
boolean |
isScriptScope()
Is this an eval script or a regular file script?
|
boolean |
isTopLocalVariableScope() |
boolean |
isWithinEND() |
LocalVariable |
lookupExistingLVar(RubySymbol name) |
boolean |
maybeUsingRefinements() |
boolean |
needsCodeCoverage() |
boolean |
parentMaybeUsingRefinements() |
void |
persistScopeFlags(IRWriterEncoder file) |
void |
persistScopeHeader(IRWriterEncoder file) |
BasicBlock[] |
prepareForCompilation()
Run any necessary passes to get the IR ready for compilation (AOT and/or JIT)
|
FullInterpreterContext |
prepareFullBuild()
This initializes a more complete(full) InterpreterContext which if used in mixed mode will be
used by the JIT and if used in pure-interpreted mode it will be used by an interpreter engine.
|
boolean |
receivesClosureArg() |
boolean |
receivesKeywordArgs() |
void |
removeClosure(IRClosure closure) |
void |
setAccessesParentsLocalVariables() |
void |
setByteName(ByteList name) |
void |
setCanCaptureCallersBinding() |
void |
setCanReceiveBreaks() |
void |
setCanReceiveNonlocalReturns() |
void |
setFileName(java.lang.String filename) |
void |
setHasBreakInstructions() |
void |
setHasLoops() |
void |
setHasNonLocalReturns() |
void |
setIsMaybeUsingRefinements() |
void |
setNeedsCodeCoverage() |
void |
setNextLabelIndex(int index) |
void |
setReceivesClosureArg() |
void |
setReceivesKeywordArgs() |
void |
setUsesEval() |
void |
setUsesZSuper() |
java.lang.String |
toString() |
java.lang.String |
toStringCompileForm() |
java.lang.String |
toStringInstrs() |
boolean |
usesEval() |
boolean |
usesZSuper() |
public static final Logger LOG
protected InterpreterContext interpreterContext
protected FullInterpreterContext fullInterpreterContext
protected FullInterpreterContext optimizedInterpreterContext
public Compilable compilable
public IRScope(IRManager manager, IRScope lexicalParent, ByteList name, 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 closure)
public void removeClosure(IRClosure closure)
public Label getNewLabel(java.lang.String prefix)
public Label getNewLabel()
public java.util.Collection<IRClosure> getClosures()
public IRManager getManager()
public void setIsMaybeUsingRefinements()
public boolean parentMaybeUsingRefinements()
public boolean maybeUsingRefinements()
public IRScope getLexicalParent()
public StaticScope getStaticScope()
getStaticScope
in interface ParseResult
public boolean isWithinEND()
public IRMethod getNearestMethod()
public IRScope getNearestTopLocalVariableScope()
public boolean isScopeContainedBy(IRScope parentScope)
parentScope
- we want to see if it contains this scopepublic int getNearestModuleReferencingScopeDepth()
public java.lang.String getId()
public RubySymbol getName()
public ByteList getByteName()
public void setByteName(ByteList name)
public void setFileName(java.lang.String filename)
@Deprecated public java.lang.String getFileName()
public java.lang.String getFile()
getFile
in interface ParseResult
@Deprecated public int getLineNumber()
public int getLine()
getLine
in interface ParseResult
public IRScope getRootLexicalScope()
public boolean isNestedInClosure(IRClosure closure)
public void setHasBreakInstructions()
public boolean hasBreakInstructions()
public void setReceivesKeywordArgs()
public boolean receivesKeywordArgs()
public void setReceivesClosureArg()
public boolean receivesClosureArg()
public void setAccessesParentsLocalVariables()
public boolean accessesParentsLocalVariables()
public void setHasLoops()
public boolean hasLoops()
public void setHasNonLocalReturns()
public boolean hasNonLocalReturns()
public void setCanCaptureCallersBinding()
public boolean canCaptureCallersBinding()
public void setCanReceiveBreaks()
public boolean canReceiveBreaks()
public void setCanReceiveNonlocalReturns()
public boolean canReceiveNonlocalReturns()
public void setUsesEval()
public boolean usesEval()
public void setUsesZSuper()
public boolean usesZSuper()
public void setNeedsCodeCoverage()
public boolean needsCodeCoverage()
public java.util.List<CompilerPass> getExecutedPasses()
public InterpreterContext allocateInterpreterContext(java.util.List<Instr> instructions, int tempVariableCount, java.util.EnumSet<IRFlags> flags)
public InterpreterContext allocateInterpreterContext(java.util.function.Supplier<java.util.List<Instr>> instructions, int tempVariableCount, java.util.EnumSet<IRFlags> flags)
public FullInterpreterContext prepareFullBuild()
public java.lang.String getFullyQualifiedName()
public IGVDumper dumpToIGV()
public BasicBlock[] prepareForCompilation()
public java.util.Map<BasicBlock,Label> buildJVMExceptionTable(FullInterpreterContext fic)
public abstract IRScopeType getScopeType()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toStringCompileForm()
public java.lang.String debugOutput()
public java.lang.String toStringInstrs()
public Variable getSelf()
public java.util.Map<RubySymbol,LocalVariable> getLocalVariables()
public void setNextLabelIndex(int index)
public int getNextLabelIndex()
public LocalVariable lookupExistingLVar(RubySymbol name)
protected LocalVariable findExistingLocalVariable(RubySymbol name, int depth)
public LocalVariable getLocalVariable(RubySymbol name, int scopeDepth)
public LocalVariable getNewLocalVariable(RubySymbol name, int scopeDepth)
public boolean hasBeenBuilt()
public FullInterpreterContext getExecutionContext()
public InterpreterContext getInterpreterContext()
public FullInterpreterContext getFullInterpreterContext()
public FullInterpreterContext getOptimizedInterpreterContext()
protected void depends(java.lang.Object obj)
public void inlineMethod(IRMethod methodToInline, RubyModule metaclass, long callsiteId, int classToken, boolean cloneHost)
public void inlineMethodJIT(IRMethod methodToInline, RubyModule implClass, long callsiteId, int classToken, boolean cloneHost)
public void inlineMethodCompiled(IRMethod methodToInline, RubyModule implClass, long callsiteId, int classToken, boolean cloneHost)
public int getNextClosureId()
public boolean isModuleBody()
public boolean isNonSingletonClassBody()
public boolean isTopLocalVariableScope()
public boolean isScriptScope()
public boolean inliningAllowed()
public void captureParentRefinements(ThreadContext context)
context
- public void cleanupAfterExecution()
public boolean executesOnce()
public void persistScopeHeader(IRWriterEncoder file)
public void persistScopeFlags(IRWriterEncoder file)
Copyright © 2001-2020 JRuby. All Rights Reserved.