Package org.jruby.ir.transformations.inlining

Examples of org.jruby.ir.transformations.inlining.SimpleCloneInfo


                b.addInstr(s, i);
            }
        }

        public void cloneIntoHostScope(IRBuilder b, IRScope s) {
            SimpleCloneInfo ii = new SimpleCloneInfo(s, true);

            // Clone required labels.
            // During normal cloning below, labels not found in the rename map
            // are not cloned.
            ii.renameLabel(start);
            for (Instr i: instrs) {
                if (i instanceof LabelInstr) {
                    ii.renameLabel(((LabelInstr)i).label);
                }
            }

            // Clone instructions now
            b.addInstr(s, new LabelInstr(ii.getRenamedLabel(start)));
            b.addInstr(s, new ExceptionRegionStartMarkerInstr(bodyRescuer));
            for (Instr i: instrs) {
                Instr clonedInstr = i.clone(ii);
                if (clonedInstr instanceof CallBase) {
                    CallBase call = (CallBase)clonedInstr;
View Full Code Here


    @Interp
    protected Instr[] prepareInstructions() {
        setupLinearization();

        SimpleCloneInfo cloneInfo = new SimpleCloneInfo(this, false);

        // FIXME: If CFG (or linearizedBBList) knew number of instrs we could end up allocing better
        // FIXME: Clone CFG in debug mode so interpreter can get matching info to instrs it is interp'ing

        // Pass 1. Set up IPCs for labels and instructions and build linear instr list
        List<Instr> newInstrs = new ArrayList<>();
        int ipc = 0;
        for (BasicBlock b: linearizedBBList) {
            // All same-named labels must be same Java instance for this to work or we would need
            // to examine all Label operands and update this as well which would be expensive.
            b.getLabel().setTargetPC(ipc);
            // Set all renamed labels (simple clone makes a new copy) to their proper ipc
            cloneInfo.getRenamedLabel(b.getLabel()).setTargetPC(ipc);

            List<Instr> bbInstrs = b.getInstrs();
            int bbInstrsLength = bbInstrs.size();
            for (int i = 0; i < bbInstrsLength; i++) {
                Instr instr = bbInstrs.get(i);
View Full Code Here

        // SSS FIXME: This is fragile. Untangle this state.
        // Why is this being copied over to InterpretedIRBlockBody?
        clone.setParameterList(this.parameterList);
        clone.isBeginEndBlock = this.isBeginEndBlock;

        SimpleCloneInfo clonedII = ii.cloneForCloningClosure(clone);

        if (getCFG() != null) {
            clone.setCFG(getCFG().clone(clonedII, clone));
        } else {
            for (Instr i: getInstrs()) {
View Full Code Here

TOP

Related Classes of org.jruby.ir.transformations.inlining.SimpleCloneInfo

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.