if (geb == null) { Variable exc = cfgScope.createTemporaryVariable(); geb = new BasicBlock(cfg, Label.getGlobalEnsureBlockLabel()); geb.addInstr(new ReceiveJRubyExceptionInstr(exc)); // JRuby implementation exception handling geb.addInstr(new ThrowExceptionInstr(exc));
if (geb == null) { Variable exc = cfgScope.createTemporaryVariable(); geb = new BasicBlock(cfg, Label.getGlobalEnsureBlockLabel()); geb.addInstr(new ReceiveJRubyExceptionInstr(exc)); // JRuby implementation exception handling geb.addInstr(new ThrowExceptionInstr(exc));
private void handleBreakAndReturnsInLambdas() { Label rEndLabel = getNewLabel(); Label rescueLabel = Label.getGlobalEnsureBlockLabel(); // Protect the entire body as it exists now with the global ensure block addInstrAtBeginning(new ExceptionRegionStartMarkerInstr(rescueLabel)); addInstr(new ExceptionRegionEndMarkerInstr()); // Receive exceptions (could be anything, but the handler only processes IRBreakJumps) addInstr(new LabelInstr(rescueLabel)); Variable exc = createTemporaryVariable(); addInstr(new ReceiveJRubyExceptionInstr(exc)); // Handle break using runtime helper // --> IRRuntimeHelpers.handleBreakAndReturnsInLambdas(context, scope, bj, blockType) Variable ret = createTemporaryVariable(); addInstr(new RuntimeHelperCall(ret, RuntimeHelperCall.Methods.HANDLE_BREAK_AND_RETURNS_IN_LAMBDA, new Operand[]{exc} )); addInstr(new ReturnOrRethrowSavedExcInstr(ret)); // End addInstr(new LabelInstr(rEndLabel)); }
private void handleBreakAndReturnsInLambdas() { Label rEndLabel = getNewLabel(); Label rescueLabel = Label.getGlobalEnsureBlockLabel(); // Protect the entire body as it exists now with the global ensure block addInstrAtBeginning(new ExceptionRegionStartMarkerInstr(rescueLabel)); addInstr(new ExceptionRegionEndMarkerInstr()); // Receive exceptions (could be anything, but the handler only processes IRBreakJumps) addInstr(new LabelInstr(rescueLabel)); Variable exc = createTemporaryVariable(); addInstr(new ReceiveJRubyExceptionInstr(exc)); // Handle break using runtime helper // --> IRRuntimeHelpers.handleBreakAndReturnsInLambdas(context, scope, bj, blockType) Variable ret = createTemporaryVariable(); addInstr(new RuntimeHelperCall(ret, RuntimeHelperCall.Methods.HANDLE_BREAK_AND_RETURNS_IN_LAMBDA, new Operand[]{exc} )); addInstr(new ReturnOrRethrowSavedExcInstr(ret)); // End addInstr(new LabelInstr(rEndLabel)); }
if (geb == null) { Variable exc = scope.createTemporaryVariable(); geb = new BasicBlock(cfg, Label.getGlobalEnsureBlockLabel()); geb.addInstr(new ReceiveJRubyExceptionInstr(exc)); // JRuby Implementation exception handling geb.addInstr(new ThrowExceptionInstr(exc));
if (geb == null) { Variable exc = scope.createTemporaryVariable(); geb = new BasicBlock(cfg, Label.getGlobalEnsureBlockLabel()); geb.addInstr(new ReceiveJRubyExceptionInstr(exc)); // JRuby Implementation exception handling geb.addInstr(new ThrowExceptionInstr(exc));