Stmt
::= Resource:ResourceDeclaration
Block
;- Type Hierarchy:
java.lang.Object
beaver.Symbol
AST.ASTNode<ASTNode>
AST.Stmt
AST.BasicTWR
- All Implemented Interfaces:
- VariableScope, java.lang.Cloneable, java.lang.Iterable<ASTNode>
|
|||||||
FRAMES NO FRAMES |
Stmt
::= Resource:ResourceDeclaration
Block
;java.lang.Objectbeaver.Symbol
AST.ASTNode<ASTNode>
AST.Stmt
AST.BasicTWR
Java7Backend/BasicTWR.ast
at line 1
public BasicTWR()
public BasicTWR(ResourceDeclaration p0, Block p1)
syn SimpleSet localLookup(java.lang.String name)
Java7Backend/MultiCatch.jrag
at line 78
syn VariableDeclaration localVariableDeclaration(java.lang.String name)
Java7Backend/MultiCatch.jrag
at line 83
syn boolean modifiedInScope(Variable var)
modifiedInScope
in class Stmt
Java7Frontend/PreciseRethrow.jrag
at line 55
inh SimpleSet lookupVariable(java.lang.String name)
lookupVariable
in interface VariableScope
Overrides:lookupVariable
in class Stmt
Java7Backend/MultiCatch.jrag
at line 87
public void flushCache()
flushCache
in class Stmt
public void flushCollectionCache()
flushCollectionCache
in class Stmt
public void createBCode(CodeGeneration gen)
RESOURCE
BLOCK
Primary Exception Handler
Automatic Closing of Resource
Suppressed Exception Handler
re-throw primary exception
Automatic Closing of Resource
Pseudocode for basic try-with-resources:
0 .resourceBegin
1 emit RESOURCE
0 store resource
0 .resourceEnd
0 .blockBegin
0 emit BLOCK
0 .blockEnd
0 goto outerFinally
1 .resourceException
1 throw
#if BLOCK is not empty:
1 .catchPrimary
0 store primary
0 .tryCloseBegin
1 load resource
0 ifnull innerFinally
1 load resource
0 invoke java.lang.AutoCloseable.close()
0 .tryCloseEnd
0 goto innerFinally
1 .catchSuppressed
0 store suppressed
1 load primary
2 load suppressed
0 invoke java.lang.Throwable.addSuppressed(Throwable)
0 .innerFinally
1 load primary
1 throw
#endif BLOCK is not empty
0 .outerFinally
1 load resource
0 ifnull tryEnd
1 load resource
0 invoke java.lang.AutoCloseable.close()
0 .tryEnd
Exception Table:
resourceBegin .. resourceEnd : resourceException
blockBegin .. blockEnd : catchPrimary
tryCloseBegin .. tryCloseEnd : catchSuppressed
createBCode
in class Stmt
Java7Backend/TryWithResources.jrag
at line 136
public void init$Children()
init$Children
in class Stmt
protected int numChildren()
numChildren
in class Stmt
public boolean mayHaveRewrite()
mayHaveRewrite
in class Stmt
public void setResource(ResourceDeclaration node)
node
- The new node to replace the Resource child.public ResourceDeclaration getResource()
This method does not invoke AST transformations.
node
- The new node to replace the Block child.public Block getBlockNoTransform()
This method does not invoke AST transformations.
public SimpleSet Define_SimpleSet_lookupVariable(ASTNode caller, ASTNode child, java.lang.String name)
Define_SimpleSet_lookupVariable
in class ASTNode<ASTNode>
Java7Backend/MultiCatch.jrag
at line 76
public int Define_int_localNum(ASTNode caller, ASTNode child)
Define_int_localNum
in class ASTNode<ASTNode>
Java7Backend/TryWithResources.jrag
at line 292
protected java.util.Map localLookup_String_values
protected java.util.Map localVariableDeclaration_String_values
protected java.util.Map lookupVariable_String_values
|
|||||||
FRAMES NO FRAMES |