Package org.jruby.compiler.ir.operands

Examples of org.jruby.compiler.ir.operands.Operand


                       retAddrMap.put(v, addrs);
                   }
                   addrs.add(tgtLbl);
                }
            } else if (i instanceof CallInstr) { // Build CFG for the closure if there exists one
                Operand closureArg = ((CallInstr)i).getClosureArg();
                if (closureArg instanceof MetaObject) {
                    ((IRClosure)((MetaObject)closureArg).scope).buildCFG();
                }
            }
        }
View Full Code Here


        //    after inlining the callee.  Merge them with their successor/predecessors respectively
        //    Merge only after fixing up the rescuer map above
        mergeStraightlineBBs(callBB, splitBB);

        // 8. Inline any closure argument passed into the call.
        Operand closureArg = call.getClosureArg();
        List    yieldSites = ii.getYieldSites();
        if (closureArg != null && !yieldSites.isEmpty()) {
            // Detect unlikely but contrived scenarios where there are far too many yield sites that could lead to code blowup
            // if we inline the closure at all those yield sites!
            if (yieldSites.size() > 1)
View Full Code Here

            if (i instanceof ClosureReturnInstr) {
                // Replace the closure return receive with a simple copy
                it.set(new CopyInstr(yieldResult, ((ClosureReturnInstr)i).getArg()));
            }
            else if (i instanceof ReceiveClosureArgInstr) {
                Operand closureArg;
                ReceiveClosureArgInstr rcai = (ReceiveClosureArgInstr)i;
                int argIndex = rcai.argIndex;
                boolean restOfArgs = rcai.restOfArgArray;
                if (argIndex < yieldArgs.length) {
                    closureArg = yieldArgs[argIndex].cloneForInlining(ii);
View Full Code Here

        return super.toString() + "(" + argIndex + (restOfArgArray ? ", ALL" : "") + ")";
    }

    @Override
    public Label interpret(InterpreterContext interp, IRubyObject self) {
        Operand destination = getResult(); // result is a confusing name

        if (restOfArgArray) {
            interpretAsRestArg(destination, interp);
        } else {
            destination.store(interp, interp.getParameter(argIndex));
        }
        return null;
    }
View Full Code Here

        return super.toString();
    }

    @Override
    public Label interpret(InterpreterContext interp, IRubyObject self) {
        Operand destination = getResult(); // result is a confusing name
        // SSS FIXME: Anything else to do here??
        destination.store(interp, self);
        return null;
    }
View Full Code Here

    }

    @Override
    public void simplifyOperands(Map<Operand, Operand> valueMap) {
      super.simplifyOperands(valueMap);
        Operand o = method.getContainer();
        Operand v = valueMap.get(o);
        // SSS FIXME: Dumb design leaking operand into IRScopeImpl -- hence this setting going on here.  Fix it!
        if (v != null)
            method.setContainer(v);
    }
View Full Code Here

TOP

Related Classes of org.jruby.compiler.ir.operands.Operand

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.