@Override public void ReturnInstr(ReturnInstr returninstr) { visit(returninstr.getReturnValue()); jvmMethod().returnValue(); }
@Override public void ReturnInstr(ReturnInstr returninstr) { visit(returninstr.getReturnValue()); jvm.method().returnValue(); }
@Override public void ReturnInstr(ReturnInstr returninstr) { visit(returninstr.getReturnValue()); jvmMethod().returnValue(); }
@Override public void ReturnInstr(ReturnInstr returninstr) { visit(returninstr.getReturnValue()); jvm.method().returnValue(); }
@Override public void ReturnOrRethrowSavedExcInstr(ReturnOrRethrowSavedExcInstr instr) { jvmMethod().loadContext(); visit(instr.getReturnValue()); jvmMethod().invokeIRHelper("returnOrRethrowSavedException", sig(IRubyObject.class, ThreadContext.class, IRubyObject.class)); jvmMethod().returnValue(); }
@Override public void ReturnOrRethrowSavedExcInstr(ReturnOrRethrowSavedExcInstr instr) { jvmMethod().loadContext(); visit(instr.getReturnValue()); jvmMethod().invokeIRHelper("returnOrRethrowSavedException", sig(IRubyObject.class, ThreadContext.class, IRubyObject.class)); jvmMethod().returnValue(); }
@Override public void NonlocalReturnInstr(NonlocalReturnInstr returninstr) { jvmMethod().loadContext(); jvmLoadLocal(DYNAMIC_SCOPE); jvmMethod().loadSelfBlock(); visit(returninstr.getReturnValue()); jvmMethod().invokeIRHelper("initiateNonLocalReturn", sig(IRubyObject.class, ThreadContext.class, DynamicScope.class, Block.class, IRubyObject.class)); jvmMethod().returnValue(); }
@Override public void NonlocalReturnInstr(NonlocalReturnInstr returninstr) { if (this.currentScope instanceof IRClosure) { /* generate run-time call to check non-local-return, errors, etc */ SkinnyMethodAdapter a = jvm.method().adapter; a.aload(0); // 1. ThreadContext a.aload(1); // 2. current scope // 3. ref. to returnInstr.methodToReturnFrom visit(returninstr.getReturnValue()); // 4. return value // boolean about whether we are in a closure or not // call to handle non-local return } else if (returninstr.methodToReturnFrom != null) { // methodtoReturnFrom will not be null for explicit returns from class/module/sclass bodies /* throw IR-return-jump */ } else { visit(returninstr.getReturnValue()); jvm.method().returnValue(); } }
@Override public void NonlocalReturnInstr(NonlocalReturnInstr returninstr) { if (this.currentScope instanceof IRClosure) { /* generate run-time call to check non-local-return, errors, etc */ SkinnyMethodAdapter a = jvm.method().adapter; a.aload(0); // 1. ThreadContext a.aload(1); // 2. current scope // 3. ref. to returnInstr.methodToReturnFrom visit(returninstr.getReturnValue()); // 4. return value // boolean about whether we are in a closure or not // call to handle non-local return } else if (returninstr.methodToReturnFrom != null) { // methodtoReturnFrom will not be null for explicit returns from class/module/sclass bodies /* throw IR-return-jump */ } else { visit(returninstr.getReturnValue()); jvm.method().returnValue(); } }
@Override public void NonlocalReturnInstr(NonlocalReturnInstr returninstr) { jvmMethod().loadContext(); jvmLoadLocal(DYNAMIC_SCOPE); jvmMethod().loadSelfBlock(); visit(returninstr.getReturnValue()); jvmMethod().invokeIRHelper("initiateNonLocalReturn", sig(IRubyObject.class, ThreadContext.class, DynamicScope.class, Block.class, IRubyObject.class)); jvmMethod().returnValue(); }
@Override public void BreakInstr(BreakInstr breakInstr) { jvmMethod().loadContext(); jvmLoadLocal(DYNAMIC_SCOPE); visit(breakInstr.getReturnValue()); jvmMethod().loadSelfBlock(); jvmAdapter().invokestatic(p(IRRuntimeHelpers.class), "initiateBreak", sig(IRubyObject.class, ThreadContext.class, DynamicScope.class, IRubyObject.class, Block.class)); jvmMethod().returnValue(); }
@Override public void BreakInstr(BreakInstr breakInstr) { jvmMethod().loadContext(); jvmLoadLocal(DYNAMIC_SCOPE); visit(breakInstr.getReturnValue()); jvmMethod().loadSelfBlock(); jvmAdapter().invokestatic(p(IRRuntimeHelpers.class), "initiateBreak", sig(IRubyObject.class, ThreadContext.class, DynamicScope.class, IRubyObject.class, Block.class)); jvmMethod().returnValue(); }