use of st.gravel.support.compiler.jvm.JVMStack in project gravel by gravel-st.
the class JVMMethodCompiler method newFrame_.
public Frame newFrame_(final st.gravel.support.jvm.Block0<Object> _aBlock) {
final JVMStack _oldStack;
final List<JVMInstruction> _oldInstructions;
final Frame _frame;
final Map<String, JVMLocalDeclaration> _oldLocals;
_oldStack = _stack;
_oldInstructions = _instructions;
_oldLocals = _locals;
this.reset();
_locals = st.gravel.support.jvm.DictionaryExtensions.copy(_oldLocals);
_aBlock.value();
_frame = Frame.factory.instructions_endStack_(_instructions.toArray(new JVMInstruction[_instructions.size()]), _stack);
_stack = _oldStack;
_instructions = _oldInstructions;
_locals = _oldLocals;
return _frame;
}
use of st.gravel.support.compiler.jvm.JVMStack in project gravel by gravel-st.
the class Frame method withInstruction_.
public Frame withInstruction_(final JVMInstruction _anInstruction) {
final JVMStack _stackCopy;
_stackCopy = _endStack.copy();
return Frame.factory.instructions_endStack_(st.gravel.support.jvm.ArrayExtensions.copyWith_(_instructions, _anInstruction.effectStack_(_stackCopy)), _stackCopy);
}
use of st.gravel.support.compiler.jvm.JVMStack in project gravel by gravel-st.
the class JVMMethodCompiler method newSubFrame_.
public Frame newSubFrame_(final st.gravel.support.jvm.Block0<Object> _aBlock) {
final JVMStack _oldStack;
final List<JVMInstruction> _oldInstructions;
final Frame _frame;
final Map<String, JVMLocalDeclaration> _oldLocals;
_oldStack = _stack;
_oldInstructions = _instructions;
_oldLocals = _locals;
_locals = st.gravel.support.jvm.DictionaryExtensions.copy(_oldLocals);
_instructions = new java.util.ArrayList();
_stack = _oldStack.copy();
_aBlock.value();
_frame = Frame.factory.instructions_endStack_(_instructions.toArray(new JVMInstruction[_instructions.size()]), _stack);
_stack = _oldStack;
_instructions = _oldInstructions;
_locals = _oldLocals;
return _frame;
}
Aggregations