Examples of requiresBinding()


Examples of org.jruby.compiler.ir.IRClosure.requiresBinding()

            // 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

Examples of org.jruby.compiler.ir.instructions.CallInstr.requiresBinding()

                    it.previous();
                    reqdLoads = newReqdLoads;

                    // add loads in the closure
                    ((BindingLoadPlacementProblem) cl_cfg.getDataFlowSolution(blp.getName())).addLoads();
                } else if (call.requiresBinding()) {
                    it.next();
                    for (Variable v : reqdLoads) {
                        it.add(new LoadFromBindingInstr(v, s, v.getName()));
                        it.previous();
                    }
View Full Code Here

Examples of org.jruby.compiler.ir.instructions.CallInstr.requiresBinding()

                            newDirtyVars.remove(v);
                        }
                    }
                    dirtyVars = newDirtyVars;
                } // Call has no closure && it requires stores
                else if (call.requiresBinding()) {
                    dirtyVars.clear();
                    bindingAllocated = true;
                }
            }
View Full Code Here

Examples of org.jruby.compiler.ir.instructions.CallInstr.requiresBinding()

                    instrs.next();

                    // add stores in the closure
                    ((BindingStorePlacementProblem) cl_cfg.getDataFlowSolution(bsp.getName())).addStoreAndBindingAllocInstructions();
                } // Call has no closure && it requires stores
                else if (call.requiresBinding()) {
                    instrs.previous();
                    if (!bindingAllocated) {
                        instrs.add(new AllocateBindingInstr(s));
                        bindingAllocated = true;
                    }
View Full Code Here

Examples of org.jruby.compiler.ir.instructions.CallInstr.requiresBinding()

                    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);
                    if (call.requiresBinding()) {
                        reqdLoads.clear();
                    }

                    // Variables defined in the closure do not need to be loaded anymore at
                    // program points before the call.
View Full Code Here

Examples of org.jruby.compiler.ir.instructions.CallInstr.requiresBinding()

                        if (cl_blp.scopeDefinesVariable(v)) newReqdLoads.remove(v);
                    }
                    reqdLoads = newReqdLoads;
                }
                // In this case, we are going to blindly load everything -- so, at the call site, pending loads dont carry over!
                else if (call.requiresBinding()) {
                    reqdLoads.clear();
                }
            }

            // The variables used as arguments will need to be loaded
View Full Code Here

Examples of org.jruby.compiler.ir.instructions.CallInstr.requiresBinding()

            if ((i instanceof RubyInternalCallInstr) && (((CallInstr) i).getMethodAddr() == MethAddr.ZSUPER))
                canCaptureCallersBinding = true;

            if (i instanceof CallInstr) {
                CallInstr call = (CallInstr) i;
                if (call.requiresBinding())
                    requiresBinding = true;

                // If this method receives a closure arg, and this call is an eval that has more than 1 argument,
                // it could be using the closure as a binding -- which means it could be using pretty much any
                // variable from the caller's binding!
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.