Search in sources :

Example 1 with JVMStack

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;
}
Also used : Frame(st.gravel.support.compiler.jvm.Frame) JVMLocalDeclaration(st.gravel.support.compiler.jvm.JVMLocalDeclaration) PushString(st.gravel.support.compiler.jvm.PushString) JVMStack(st.gravel.support.compiler.jvm.JVMStack) JVMInstruction(st.gravel.support.compiler.jvm.JVMInstruction)

Example 2 with JVMStack

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);
}
Also used : JVMStack(st.gravel.support.compiler.jvm.JVMStack)

Example 3 with JVMStack

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;
}
Also used : Frame(st.gravel.support.compiler.jvm.Frame) JVMLocalDeclaration(st.gravel.support.compiler.jvm.JVMLocalDeclaration) PushString(st.gravel.support.compiler.jvm.PushString) JVMStack(st.gravel.support.compiler.jvm.JVMStack) JVMInstruction(st.gravel.support.compiler.jvm.JVMInstruction) ArrayList(java.util.ArrayList)

Aggregations

JVMStack (st.gravel.support.compiler.jvm.JVMStack)3 Frame (st.gravel.support.compiler.jvm.Frame)2 JVMInstruction (st.gravel.support.compiler.jvm.JVMInstruction)2 JVMLocalDeclaration (st.gravel.support.compiler.jvm.JVMLocalDeclaration)2 PushString (st.gravel.support.compiler.jvm.PushString)2 ArrayList (java.util.ArrayList)1