private void receiveBreakException(Operand block, final CallInstr callInstr) { receiveBreakException(block, new CodeBlock() { public Operand run() { addInstr(callInstr); return callInstr.getResult(); } }); }
private void receiveBreakException(Operand block, final CallInstr callInstr) { receiveBreakException(block, new CodeBlock() { public Operand run() { addInstr(callInstr); return callInstr.getResult(); } }); }
return receiveBreakException(block, zsuperBuilder);
return receiveBreakException(block, zsuperBuilder);
public Operand buildFCall(FCallNode fcallNode, IRScope s) { Node callArgsNode = fcallNode.getArgsNode(); List<Operand> args = setupCallArgs(callArgsNode, s); Operand block = setupCallClosure(fcallNode.getIterNode(), s); Variable callResult = s.getNewTemporaryVariable(); CallInstr callInstr = CallInstr.create(CallType.FUNCTIONAL, callResult, new MethAddr(fcallNode.getName()), getSelf(s), args.toArray(new Operand[args.size()]), block); receiveBreakException(s, block, callInstr); return callResult; }
public Operand buildFCall(FCallNode fcallNode, IRScope s) { Node callArgsNode = fcallNode.getArgsNode(); List<Operand> args = setupCallArgs(callArgsNode, s); Operand block = setupCallClosure(fcallNode.getIterNode(), s); Variable callResult = s.getNewTemporaryVariable(); CallInstr callInstr = CallInstr.create(CallType.FUNCTIONAL, callResult, new MethAddr(fcallNode.getName()), getSelf(s), args.toArray(new Operand[args.size()]), block); receiveBreakException(s, block, callInstr); return callResult; }
public Operand buildCall(CallNode callNode, IRScope s) { Node callArgsNode = callNode.getArgsNode(); Node receiverNode = callNode.getReceiverNode(); // Though you might be tempted to move this build into the CallInstr as: // new Callinstr( ... , build(receiverNode, s), ...) // that is incorrect IR because the receiver has to be built *before* call arguments are built // to preserve expected code execution order Operand receiver = build(receiverNode, s); List<Operand> args = setupCallArgs(callArgsNode, s); Operand block = setupCallClosure(callNode.getIterNode(), s); Variable callResult = s.getNewTemporaryVariable(); CallInstr callInstr = CallInstr.create(callResult, new MethAddr(callNode.getName()), receiver, args.toArray(new Operand[args.size()]), block); receiveBreakException(s, block, callInstr); return callResult; }
public Operand buildCall(CallNode callNode, IRScope s) { Node callArgsNode = callNode.getArgsNode(); Node receiverNode = callNode.getReceiverNode(); // Though you might be tempted to move this build into the CallInstr as: // new Callinstr( ... , build(receiverNode, s), ...) // that is incorrect IR because the receiver has to be built *before* call arguments are built // to preserve expected code execution order Operand receiver = build(receiverNode, s); List<Operand> args = setupCallArgs(callArgsNode, s); Operand block = setupCallClosure(callNode.getIterNode(), s); Variable callResult = s.getNewTemporaryVariable(); CallInstr callInstr = CallInstr.create(callResult, new MethAddr(callNode.getName()), receiver, args.toArray(new Operand[args.size()]), block); receiveBreakException(s, block, callInstr); return callResult; }
public Operand buildFor(ForNode forNode) { Variable result = createTemporaryVariable(); Operand receiver = build(forNode.getIterNode()); Operand forBlock = buildForIter(forNode); CallInstr callInstr = new CallInstr(scope, CallType.NORMAL, result, manager.runtime.newSymbol(CommonByteLists.EACH), receiver, NO_ARGS, forBlock, scope.maybeUsingRefinements()); receiveBreakException(forBlock, callInstr); return result; }
public Operand buildFor(ForNode forNode) { Variable result = createTemporaryVariable(); Operand receiver = build(forNode.getIterNode()); Operand forBlock = buildForIter(forNode); CallInstr callInstr = new CallInstr(scope, CallType.NORMAL, result, manager.runtime.newSymbol(CommonByteLists.EACH), receiver, NO_ARGS, forBlock, scope.maybeUsingRefinements()); receiveBreakException(forBlock, callInstr); return result; }
public Operand buildFor(ForNode forNode, IRScope s) { Variable result = s.getNewTemporaryVariable(); Operand receiver = build(forNode.getIterNode(), s); Operand forBlock = buildForIter(forNode, s); CallInstr callInstr = new CallInstr(CallType.NORMAL, result, new MethAddr("each"), receiver, NO_ARGS, forBlock); receiveBreakException(s, forBlock, callInstr); return result; }
public Operand buildFor(ForNode forNode, IRScope s) { Variable result = s.getNewTemporaryVariable(); Operand receiver = build(forNode.getIterNode(), s); Operand forBlock = buildForIter(forNode, s); CallInstr callInstr = new CallInstr(CallType.NORMAL, result, new MethAddr("each"), receiver, NO_ARGS, forBlock); receiveBreakException(s, forBlock, callInstr); return result; }
receiveBreakException(s, block, new ZSuperInstr(ret, getSelf(s), block)); return ret;
private Operand buildSuperInstr(Operand block, Operand[] args) { CallInstr superInstr; Variable ret = createTemporaryVariable(); if (scope instanceof IRMethod && scope.getLexicalParent() instanceof IRClassBody) { if (((IRMethod) scope).isInstanceMethod) { superInstr = new InstanceSuperInstr(scope, ret, scope.getCurrentModuleVariable(), getName(), args, block, scope.maybeUsingRefinements()); } else { superInstr = new ClassSuperInstr(scope, ret, scope.getCurrentModuleVariable(), getName(), args, block, scope.maybeUsingRefinements()); } } else { // We dont always know the method name we are going to be invoking if the super occurs in a closure. // This is because the super can be part of a block that will be used by 'define_method' to define // a new method. In that case, the method called by super will be determined by the 'name' argument // to 'define_method'. superInstr = new UnresolvedSuperInstr(scope, ret, buildSelf(), args, block, scope.maybeUsingRefinements()); } receiveBreakException(block, superInstr); return ret; }
receiveBreakException(s, block, new ZSuperInstr(ret, getSelf(s), block)); return ret;
private Operand buildSuperInstr(Operand block, Operand[] args) { CallInstr superInstr; Variable ret = createTemporaryVariable(); if (scope instanceof IRMethod && scope.getLexicalParent() instanceof IRClassBody) { if (((IRMethod) scope).isInstanceMethod) { superInstr = new InstanceSuperInstr(scope, ret, scope.getCurrentModuleVariable(), getName(), args, block, scope.maybeUsingRefinements()); } else { superInstr = new ClassSuperInstr(scope, ret, scope.getCurrentModuleVariable(), getName(), args, block, scope.maybeUsingRefinements()); } } else { // We dont always know the method name we are going to be invoking if the super occurs in a closure. // This is because the super can be part of a block that will be used by 'define_method' to define // a new method. In that case, the method called by super will be determined by the 'name' argument // to 'define_method'. superInstr = new UnresolvedSuperInstr(scope, ret, buildSelf(), args, block, scope.maybeUsingRefinements()); } receiveBreakException(block, superInstr); return ret; }
private Operand buildSuperInstr(IRScope s, Operand block, Operand[] args) { CallInstr superInstr; Variable ret = s.getNewTemporaryVariable(); if ((s instanceof IRMethod) && (s.getLexicalParent() instanceof IRClassBody)) { IRMethod m = (IRMethod)s; if (m.isInstanceMethod) { superInstr = new InstanceSuperInstr(ret, s.getCurrentModuleVariable(), new MethAddr(s.getName()), args, block); } else { superInstr = new ClassSuperInstr(ret, s.getCurrentModuleVariable(), new MethAddr(s.getName()), args, block); } } else { // We dont always know the method name we are going to be invoking if the super occurs in a closure. // This is because the super can be part of a block that will be used by 'define_method' to define // a new method. In that case, the method called by super will be determined by the 'name' argument // to 'define_method'. superInstr = new UnresolvedSuperInstr(ret, getSelf(s), args, block); } receiveBreakException(s, block, superInstr); return ret; }
private Operand buildSuperInstr(IRScope s, Operand block, Operand[] args) { CallInstr superInstr; Variable ret = s.getNewTemporaryVariable(); if ((s instanceof IRMethod) && (s.getLexicalParent() instanceof IRClassBody)) { IRMethod m = (IRMethod)s; if (m.isInstanceMethod) { superInstr = new InstanceSuperInstr(ret, s.getCurrentModuleVariable(), new MethAddr(s.getName()), args, block); } else { superInstr = new ClassSuperInstr(ret, s.getCurrentModuleVariable(), new MethAddr(s.getName()), args, block); } } else { // We dont always know the method name we are going to be invoking if the super occurs in a closure. // This is because the super can be part of a block that will be used by 'define_method' to define // a new method. In that case, the method called by super will be determined by the 'name' argument // to 'define_method'. superInstr = new UnresolvedSuperInstr(ret, getSelf(s), args, block); } receiveBreakException(s, block, superInstr); return ret; }
receiveBreakException(block, callInstr);
receiveBreakException(block, callInstr);