Package org.jruby.compiler.ir

Examples of org.jruby.compiler.ir.IRClosure


                Operand o = call.getClosureArg();
                if ((o != null) && (o instanceof MetaObject)) {
                    // At this call site, a binding will get allocated if it has not been already!
                    bindingAllocated = true;

                    IRClosure cl = (IRClosure) ((MetaObject) o).scope;
                    CFG cl_cfg = cl.getCFG();
                    BindingStorePlacementProblem cl_bsp = new BindingStorePlacementProblem();
                    cl_bsp.setup(cl_cfg);
                    cl_bsp.compute_MOP_Solution();
                    cl_cfg.setDataFlowSolution(cl_bsp.getName(), cl_bsp);
View Full Code Here


                // so that the built closure from the previous instr. is propagated to the call site here.
                // Formalize this dependency somewhere?
                Operand o = c.getClosureArg();
//                   System.out.println("Processing closure: " + o + "-------");
                if ((o != null) && (o instanceof MetaObject)) {
                    IRClosure cl = (IRClosure)((MetaObject)o).scope;
                    if (c.isLVADataflowBarrier()) {
                        processClosure(cl, lvp.getAllVars());

                        // Mark all variables live if 'c' is a dataflow barrier!
//                        System.out.println(".. call is a data flow barrier ..");
View Full Code Here

                }
                else {
                    Operand o = c.getClosureArg();
                    if ((o != null) && (o instanceof MetaObject)) {
                        // 2. Run LVA on the closure
                        IRClosure cl = (IRClosure)((MetaObject)o).scope;
                        CFG x = cl.getCFG();
                        LiveVariablesProblem xlvp = (LiveVariablesProblem)x.getDataFlowSolution(lvp.getName());
                        // 3. Collect variables live on entry and merge that info into the current problem.
                        for (Variable y: xlvp.getVarsLiveOnEntry()) {
                            DataFlowVar dv = lvp.getDFVar(y);
                            // This can be null for vars used, but not defined!  Yes, the source program is buggy ..
View Full Code Here

            // Process calls specially -- these are the sites of binding loads!
            if (i instanceof CallInstr) {
                CallInstr call = (CallInstr) i;
                Operand o = call.getClosureArg();
                if ((o != null) && (o instanceof MetaObject)) {
                    IRClosure cl = (IRClosure) ((MetaObject) o).scope;
                    CFG cl_cfg = cl.getCFG();
                    BindingLoadPlacementProblem cl_blp = new BindingLoadPlacementProblem();
                    cl_blp.initLoadsOnScopeExit(reqdLoads);
                    cl_blp.setup(cl_cfg);
                    cl_blp.compute_MOP_Solution();
                    cl_cfg.setDataFlowSolution(cl_blp.getName(), cl_blp);
View Full Code Here

        if (closure != null) {
            // Can be a symbol .. ex: [1,2,3,4].map(&:foo)
            // SSS FIXME: Is it true that if the closure operand is a symbol, it couldn't access the caller's binding?
            if (!(closure instanceof MetaObject)) return false;

            IRClosure cl = (IRClosure) ((MetaObject) closure).scope;
            if (cl.requiresBinding() /*|| cl.canCaptureCallersBinding()*/) return true;
        }

        // Check if we are calling Proc.new or lambda
        String mname = getMethodAddr().getName();
       
View Full Code Here

TOP

Related Classes of org.jruby.compiler.ir.IRClosure

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.