public class AstEnv
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
BasicBlock |
getAppendBlock()
Returns the block where ordinary new nodes or blocks should be to added.
|
int |
getBaseRegister()
Returns the register of the base object for variable lookups.
|
BasicBlock |
getDeclarationBlock()
Returns the block where variable declarations should be added.
|
IfNode |
getEnclosingIfNode(com.google.javascript.jscomp.parsing.parser.trees.ParseTree expressionTree) |
Function |
getFunction()
Returns the nearest enclosing function.
|
AstEnv |
getFunctionEnv()
Returns the environment at the nearest enclosing function.
|
java.util.List<JumpThroughBlocks> |
getJumpThroughBlocks(AstEnv other)
Collects all
jumpThroughBlocks in the chain of environments up until (and not including) the given environment. |
BasicBlock |
getLabelledBreak(java.lang.String labelName)
Finds the 'break' basic block associated with the given label.
|
AstEnv |
getLabelledBreakEnv(java.lang.String labelName)
Returns the environment at the given 'break' label.
|
BasicBlock |
getLabelledContinue(java.lang.String labelName)
Finds the 'continue' basic block associated with the given label.
|
AstEnv |
getLabelledContinueEnv(java.lang.String labelName)
Returns the environment at the given 'continue' label.
|
java.lang.String |
getLoopLabelName(com.google.javascript.jscomp.parsing.parser.trees.ParseTree loopStatement) |
RegisterManager |
getRegisterManager()
Returns the register manager.
|
int |
getResultRegister()
Returns the result register.
|
java.lang.Integer |
getThisRegister()
Returns the 'this' register'.
|
UnevalExpressionResult |
getUnevalExpressionResult()
Returns the UnevalExpressionResult.
|
BasicBlock |
getUnlabelledBreak()
Returns the 'break' basic block with no label.
|
AstEnv |
getUnlabelledBreakEnv()
Returns the environment at the 'break' with no label.
|
BasicBlock |
getUnlabelledContinue()
Returns the 'continue' basic block with no label.
|
AstEnv |
getUnlabelledContinueEnv()
Returns the environment at the 'continue' with no label.
|
boolean |
hasLoopLabel(com.google.javascript.jscomp.parsing.parser.trees.ParseTree loopStatement) |
boolean |
isStatementLevel()
Returns true if currently at statement level (not at a nested expression).
|
AstEnv |
makeAppendBlock(BasicBlock b)
Creates a new environment with the given append block.
|
AstEnv |
makeBaseRegister(int r)
Creates a new environment with the given base register.
|
AstEnv |
makeDeclarationBlock(BasicBlock r)
Creates a new environment with the given declaration block.
|
AstEnv |
makeEnclosingFunction(Function enclosingFunction)
Creates a new environment with the given enclosing function.
|
AstEnv |
makeEnclosingIfNode(com.google.javascript.jscomp.parsing.parser.trees.ParseTree condition,
IfNode ifNode) |
static AstEnv |
makeInitial()
Constructs the initial environment.
|
AstEnv |
makeJumpThroughBlock(JumpThroughBlocks j)
Creates a new environment with the given JumpThroughBlocks.
|
AstEnv |
makeLabelledBreak(java.lang.String labelName,
BasicBlock breakBlock)
Creates a new environment with the given labeled 'break' block.
|
AstEnv |
makeLabelledContinue(java.lang.String labelName,
BasicBlock continueBlock)
Creates a new environment with the given labeled 'continue' block.
|
AstEnv |
makeLoopLabelName(com.google.javascript.jscomp.parsing.parser.trees.ParseTree loopStatement,
java.lang.String name) |
AstEnv |
makeRegisterManager(RegisterManager rm)
Creates a new environment with the given register manager.
|
AstEnv |
makeResultRegister(int r)
Creates a new environment with the given result register.
|
AstEnv |
makeStatementLevel(boolean statement)
Creates a new environment and selects the statement level flag.
|
AstEnv |
makeThisRegister(int r)
Creates a new environment with the given 'this' register.
|
AstEnv |
makeUnevalExpressionResult(UnevalExpressionResult u)
Creates a new environment with the given UnevalExpressionResult.
|
AstEnv |
makeUnlabelledBreak(BasicBlock defaultBreak)
Creates a new environment with the given unlabeled 'break' block.
|
AstEnv |
makeUnlabelledContinueAndBreak(BasicBlock defaultContinue,
BasicBlock defaultBreak)
Creates a new environment with the given unlabeled 'continue' and 'break' blocks.
|
public BasicBlock getAppendBlock()
public int getBaseRegister()
public BasicBlock getDeclarationBlock()
public IfNode getEnclosingIfNode(com.google.javascript.jscomp.parsing.parser.trees.ParseTree expressionTree)
public Function getFunction()
public AstEnv getFunctionEnv()
public java.util.List<JumpThroughBlocks> getJumpThroughBlocks(AstEnv other)
jumpThroughBlocks
in the chain of environments up until (and not including) the given environment.jumpThroughBlocks
public BasicBlock getLabelledBreak(java.lang.String labelName)
public AstEnv getLabelledBreakEnv(java.lang.String labelName)
public BasicBlock getLabelledContinue(java.lang.String labelName)
public AstEnv getLabelledContinueEnv(java.lang.String labelName)
public java.lang.String getLoopLabelName(com.google.javascript.jscomp.parsing.parser.trees.ParseTree loopStatement)
public RegisterManager getRegisterManager()
public int getResultRegister()
public java.lang.Integer getThisRegister()
public UnevalExpressionResult getUnevalExpressionResult()
public BasicBlock getUnlabelledBreak()
public AstEnv getUnlabelledBreakEnv()
public BasicBlock getUnlabelledContinue()
public AstEnv getUnlabelledContinueEnv()
public boolean hasLoopLabel(com.google.javascript.jscomp.parsing.parser.trees.ParseTree loopStatement)
public boolean isStatementLevel()
public AstEnv makeAppendBlock(BasicBlock b)
public AstEnv makeBaseRegister(int r)
public AstEnv makeDeclarationBlock(BasicBlock r)
public AstEnv makeEnclosingFunction(Function enclosingFunction)
public AstEnv makeEnclosingIfNode(com.google.javascript.jscomp.parsing.parser.trees.ParseTree condition, IfNode ifNode)
public static AstEnv makeInitial()
public AstEnv makeJumpThroughBlock(JumpThroughBlocks j)
public AstEnv makeLabelledBreak(java.lang.String labelName, BasicBlock breakBlock)
public AstEnv makeLabelledContinue(java.lang.String labelName, BasicBlock continueBlock)
public AstEnv makeLoopLabelName(com.google.javascript.jscomp.parsing.parser.trees.ParseTree loopStatement, java.lang.String name)
public AstEnv makeRegisterManager(RegisterManager rm)
public AstEnv makeResultRegister(int r)
public AstEnv makeStatementLevel(boolean statement)
public AstEnv makeThisRegister(int r)
public AstEnv makeUnevalExpressionResult(UnevalExpressionResult u)
public AstEnv makeUnlabelledBreak(BasicBlock defaultBreak)
public AstEnv makeUnlabelledContinueAndBreak(BasicBlock defaultContinue, BasicBlock defaultBreak)
Copyright © 2009-2019 Aarhus University