Package org.jruby.compiler.ir.operands

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


        while (it.hasPrevious()) {
            Instr i = it.previous();
//            System.out.println("TF: Processing: " + i);

            // v is defined => It is no longer live before 'i'
            Variable v = i.getResult();
            if (v != null) {
                DataFlowVar dv = lvp.getDFVar(v);
                _tmp.clear(dv._id);
//                System.out.println("cleared live flag for: " + v);
            }
View Full Code Here


        List<Instr> instrs = _bb.getInstrs();
        ListIterator<Instr> it = instrs.listIterator(instrs.size());
        while (it.hasPrevious()) {
            Instr i = it.previous();
//            System.out.println("DEAD?? " + i);
            Variable v = i.getResult();
            if (v != null) {
                DataFlowVar dv = lvp.getDFVar(v);
                    // If 'v' is not live at the instruction site, and it has no side effects, mark it dead!
                if ((_tmp.get(dv._id) == false) && !i.hasSideEffects()) {
//                    System.out.println("YES!");
View Full Code Here

            Instr i = it.previous();

            if (i.operation == Operation.BINDING_STORE) continue;

            // Right away, clear the variable defined by this instruction -- it doesn't have to be loaded!
            Variable r = i.getResult();

            if (r != null) reqdLoads.remove(r);

            // Process calls specially -- these are the sites of binding loads!
            if (i instanceof CallInstr) {
View Full Code Here

            Instr i = it.previous();

            if (i.operation == Operation.BINDING_STORE) continue;

            // Right away, clear the variable defined by this instruction -- it doesn't have to be loaded!
            Variable r = i.getResult();

            if (r != null) reqdLoads.remove(r);

            if (i instanceof CallInstr) {
                CallInstr call = (CallInstr) i;
View Full Code Here

                    dirtyVars.clear();
                    bindingAllocated = true;
                }
            }

            Variable v = i.getResult();

            if ((v != null) && (v instanceof LocalVariable)) dirtyVars.add(v);
            if (i.operation.isReturn()) dirtyVars.clear();
        }
View Full Code Here

                // Nothing is dirty anymore -- everything that needs spilling has been spilt
                dirtyVars.clear();
            }

            Variable v = i.getResult();
            if ((v != null) && (v instanceof LocalVariable)) dirtyVars.add(v);
        }

        // If this is the exit BB, add binding stores for all vars that are still dirty
        if (amExitBB) {
            for (Variable v : dirtyVars) {
                instrs.add(new StoreToBindingInstr(s, v.getName(), v));
            }
        }
    }
View Full Code Here

    {
        List<Variable> liveVars = new ArrayList<Variable>();
        BitSet liveIn = ((LiveVariableNode)getFlowGraphNode(_cfg.getEntryBB())).getLiveInBitSet();
        for (int i = 0; i < liveIn.size(); i++) {
            if (liveIn.get(i) == true) {
                Variable v = getVariable(i);
                liveVars.add(v);
//                System.out.println("variable " + v + " is live on entry!");
            }
        }
        return liveVars;
View Full Code Here

        }
        return newLbl;
    }

    public Variable getRenamedVariable(Variable v) {
        Variable newVar = this.varRenameMap.get(v);
        if (newVar == null) {
        IRExecutionScope m = this.callerCFG.getScope();
            newVar = m.getNewInlineVariable();
            if (v instanceof LocalVariable) {
                // Frame load/store placement dataflow pass (and possible other passes later on) exploit
                // information whether a variable is a temporary or a local/self variable.
                // So, variable renaming for inlining has to preserve this information.
                newVar = m.getLocalVariable(newVar.getName());
            }
            this.varRenameMap.put(v, newVar);
        }
        return newVar;
    }
View Full Code Here

        // If 'res' has simplified to a variable, then record this reverse mapping
        // so, we can respect Read-After-Write scenarios for 'val' and purge this
        // simplification when 'val' gets modified
        if (val instanceof Variable) {
           Variable v = (Variable)val;
           List<Variable> x = simplificationMap.get(val);
           if (x == null) {
              x = new java.util.ArrayList<Variable>();
              simplificationMap.put(v, x);
           }
View Full Code Here

            }

            // Simplify instruction and record mapping between target variable and simplified value
//            System.out.println("BEFORE: " + i);
            Operand  val = i.simplifyAndGetResult(valueMap);
            Variable res = i.getResult();
//            System.out.println("For " + i + "; dst = " + res + "; val = " + val);
//            System.out.println("AFTER: " + i);
            if (val != null && res != null && res != val) {
                recordSimplification(res, val, valueMap, simplificationMap);
View Full Code Here

TOP

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

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.