Class StaticTypesStatementWriter
java.lang.Object
org.codehaus.groovy.classgen.asm.StatementWriter
org.codehaus.groovy.classgen.asm.sc.StaticTypesStatementWriter
A class to write out the optimized statements.
-
Field Summary
Fields inherited from class org.codehaus.groovy.classgen.asm.StatementWriter
controller -
Constructor Summary
ConstructorsConstructorDescriptionCreates a statement writer that favors statically typed loop and block generation. -
Method Summary
Modifier and TypeMethodDescriptionvoidwriteBlockStatement(BlockStatement statement) Generates bytecode for a block statement by visiting each contained statement.protected voidwriteForInLoop(ForStatement loop) Generates bytecode for a for-in loop by callingiterator()on the collection expression and delegating loop control toStatementWriter.writeForInLoopControlAndBlock(org.codehaus.groovy.ast.stmt.ForStatement).Methods inherited from class org.codehaus.groovy.classgen.asm.StatementWriter
defineLoopIndexVariable, writeAssert, writeBreak, writeContinue, writeDoWhileLoop, writeExpressionStatement, writeForInLoopControlAndBlock, writeForLoopWithClosureList, writeForStatement, writeIfElse, writeIteratorHasNext, writeIteratorNext, writeLoopBackEdge, writeReturn, writeStatementLabel, writeSwitch, writeSynchronized, writeThrow, writeTryCatchFinally, writeWhileLoop
-
Constructor Details
-
StaticTypesStatementWriter
Creates a statement writer that favors statically typed loop and block generation.
-
-
Method Details
-
writeBlockStatement
Generates bytecode for a block statement by visiting each contained statement. Pushes the block's variable scope, emits the statements, and pops afterward. Named labels on the block create a breakable region so thatbreak labelwithin the block jumps to the end of it.- Overrides:
writeBlockStatementin classStatementWriter- Parameters:
statement- the block statement to compile
-
writeForInLoop
Generates bytecode for a for-in loop by callingiterator()on the collection expression and delegating loop control toStatementWriter.writeForInLoopControlAndBlock(org.codehaus.groovy.ast.stmt.ForStatement).- Overrides:
writeForInLoopin classStatementWriter- Parameters:
loop- the for-in statement to compile
-