public void emitVariable(Variable variable) { // System.out.println("variable: " + variable); int index = getJVMLocalVarIndex(variable); // System.out.println("index: " + index); jvm.method().loadLocal(index); }
@Override public void run() { m.loadContext(); for (int i = 0; i < operands.length; i++) { Operand operand = operands[i]; visit(operand); } } };
public void pushmethod(String name, IRScope scope, Signature signature, boolean specificArity) { clsData().pushmethod(name, scope, signature, specificArity); method().startMethod(); }
@Override public void SearchConstInstr(SearchConstInstr searchconstinstr) { // TODO: private consts jvm.method().loadLocal(0); visit(searchconstinstr.getStartingScope()); jvm.method().searchConst(searchconstinstr.getConstName()); jvmStoreLocal(searchconstinstr.getResult()); }
@Override public void InheritanceSearchConstInstr(InheritanceSearchConstInstr inheritancesearchconstinstr) { jvm.method().loadLocal(0); visit(inheritancesearchconstinstr.getCurrentModule()); // TODO: private consts jvm.method().inheritanceSearchConst(inheritancesearchconstinstr.getConstName()); jvmStoreLocal(inheritancesearchconstinstr.getResult()); }
@Override public void ReturnInstr(ReturnInstr returninstr) { visit(returninstr.getReturnValue()); jvm.method().returnValue(); }
@Override public void UndefinedValue(UndefinedValue undefinedvalue) { jvm.method().pushUndefined(); }
@Override public void CheckArityInstr(CheckArityInstr checkarityinstr) { if (jvm.methodData().specificArity >= 0) { // no arity check in specific arity path } else { checkArity(checkarityinstr.required, checkarityinstr.opt, checkarityinstr.rest, checkarityinstr.receivesKeywords, checkarityinstr.restKey); } }
@Override public void CurrentScope(CurrentScope currentscope) { jvmMethod().loadStaticScope(); }
@Override public void ThreadPollInstr(ThreadPollInstr threadpollinstr) { jvmMethod().checkpoint(); }
@Override public void Bignum(Bignum bignum) { jvmMethod().pushBignum(bignum.value); }
public void emitVariable(Variable variable) { // System.out.println("variable: " + variable); int index = getJVMLocalVarIndex(variable); // System.out.println("index: " + index); jvm.method().loadLocal(index); }
@Override public void run() { m.loadContext(); for (int i = 0; i < operands.length; i++) { Operand operand = operands[i]; visit(operand); } } };
@Override public void CheckArityInstr(CheckArityInstr checkarityinstr) { if (jvm.methodData().specificArity >= 0) { // no arity check in specific arity path } else { checkArity(checkarityinstr.required, checkarityinstr.opt, checkarityinstr.rest, checkarityinstr.receivesKeywords, checkarityinstr.restKey); } }