Class StackOperationSupport
java.lang.Object
org.ek9lang.compiler.backend.jvm.support.StackOperationSupport
Support for stack-oriented code generation.
Handles the decision of whether to re-generate an operation onto the stack or load from a stored variable slot.
-
Constructor Summary
ConstructorsConstructorDescriptionStackOperationSupport(MethodContext methodContext, VariableAccessGenerator variableAccess, LiteralBytecodeGenerator literalGenerator) -
Method Summary
Modifier and TypeMethodDescriptionvoidgenerateStackOperation(org.objectweb.asm.MethodVisitor mv, String variableName) Generate stack operation for a variable - either load from slot or re-generate the operation.booleanshouldRemainOnStack(String variableName) Determine if a temp variable should remain on stack instead of being stored.
-
Constructor Details
-
StackOperationSupport
public StackOperationSupport(MethodContext methodContext, VariableAccessGenerator variableAccess, LiteralBytecodeGenerator literalGenerator)
-
-
Method Details
-
generateStackOperation
Generate stack operation for a variable - either load from slot or re-generate the operation. -
shouldRemainOnStack
Determine if a temp variable should remain on stack instead of being stored.
-