private Operand buildSuperInScriptBody(IRScope s) { Variable ret = s.getNewTemporaryVariable(); s.addInstr(new UnresolvedSuperInstr(ret, getSelf(s), NO_ARGS, null)); return ret; }
private Operand buildSuperInScriptBody(IRScope s) { Variable ret = s.getNewTemporaryVariable(); s.addInstr(new UnresolvedSuperInstr(ret, getSelf(s), NO_ARGS, null)); return ret; }
private Operand buildSuperInScriptBody() { return addResultInstr(new UnresolvedSuperInstr(scope, createTemporaryVariable(), buildSelf(), NO_ARGS, null, scope.maybeUsingRefinements())); }
private Operand buildSuperInScriptBody() { return addResultInstr(new UnresolvedSuperInstr(scope, createTemporaryVariable(), buildSelf(), NO_ARGS, null, scope.maybeUsingRefinements())); }
public static UnresolvedSuperInstr decode(IRReaderDecoder d) { if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decoding call"); int callTypeOrdinal = d.decodeInt(); CallType callType = CallType.fromOrdinal(callTypeOrdinal); if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decoding call, calltype(ord): " + callType); RubySymbol methAddr = d.decodeSymbol(); if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decoding call, methaddr: " + methAddr); Operand receiver = d.decodeOperand(); int argsCount = d.decodeInt(); boolean hasClosureArg = argsCount < 0; int argsLength = hasClosureArg ? (-1 * (argsCount + 1)) : argsCount; if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("ARGS: " + argsLength + ", CLOSURE: " + hasClosureArg); Operand[] args = new Operand[argsLength]; for (int i = 0; i < argsLength; i++) { args[i] = d.decodeOperand(); } Operand closure = hasClosureArg ? d.decodeOperand() : null; if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("before result"); return new UnresolvedSuperInstr(d.getCurrentScope(), d.decodeVariable(), receiver, args, closure, d.getCurrentScope().maybeUsingRefinements()); }
public static UnresolvedSuperInstr decode(IRReaderDecoder d) { if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decoding call"); int callTypeOrdinal = d.decodeInt(); CallType callType = CallType.fromOrdinal(callTypeOrdinal); if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decoding call, calltype(ord): " + callType); RubySymbol methAddr = d.decodeSymbol(); if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("decoding call, methaddr: " + methAddr); Operand receiver = d.decodeOperand(); int argsCount = d.decodeInt(); boolean hasClosureArg = argsCount < 0; int argsLength = hasClosureArg ? (-1 * (argsCount + 1)) : argsCount; if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("ARGS: " + argsLength + ", CLOSURE: " + hasClosureArg); Operand[] args = new Operand[argsLength]; for (int i = 0; i < argsLength; i++) { args[i] = d.decodeOperand(); } Operand closure = hasClosureArg ? d.decodeOperand() : null; if (RubyInstanceConfig.IR_READING_DEBUG) System.out.println("before result"); return new UnresolvedSuperInstr(d.getCurrentScope(), d.decodeVariable(), receiver, args, closure, d.getCurrentScope().maybeUsingRefinements()); }
@Override public Instr cloneForInlining(InlinerInfo ii) { return new UnresolvedSuperInstr(ii.getRenamedVariable(getResult()), getReceiver().cloneForInlining(ii), cloneCallArgs(ii), closure == null ? null : closure.cloneForInlining(ii)); }
@Override public Instr cloneForInlining(InlinerInfo ii) { return new UnresolvedSuperInstr(ii.getRenamedVariable(getResult()), getReceiver().cloneForInlining(ii), cloneCallArgs(ii), closure == null ? null : closure.cloneForInlining(ii)); }
@Override public Instr clone(CloneInfo ii) { return new UnresolvedSuperInstr(ii.getScope(), Operation.UNRESOLVED_SUPER, ii.getRenamedVariable(getResult()), getReceiver().cloneForInlining(ii), cloneCallArgs(ii), getClosureArg() == null ? null : getClosureArg().cloneForInlining(ii), isPotentiallyRefined(), getCallSite(), getCallSiteId()); }
@Override public Instr clone(CloneInfo ii) { return new UnresolvedSuperInstr(ii.getScope(), Operation.UNRESOLVED_SUPER, ii.getRenamedVariable(getResult()), getReceiver().cloneForInlining(ii), cloneCallArgs(ii), getClosureArg() == null ? null : getClosureArg().cloneForInlining(ii), isPotentiallyRefined(), getCallSite(), getCallSiteId()); }
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(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; }