Examples of BreakResult


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

        }
        else {
            // If this is not a closure, the break is equivalent to jumping to the loop end label
            // But, since break can return a result even in loops, we need to pass back both
            // the return value as well as the jump target -- so, create a special-purpose operand just for that purpose!
            return new BreakResult(rv, s.getCurrentLoop().loopEndLabel);
        }
    }
View Full Code Here

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

            if (bodyValue != null) {
               // Local optimization of break results (followed by a copy & jump) to short-circuit the jump right away
               // rather than wait to do it during an optimization pass when a dead jump needs to be removed.
               Label tgt = endLabel;
               if (bodyValue instanceof BreakResult) {
                   BreakResult br = (BreakResult)bodyValue;
                   bodyValue = br._result;
                   tgt = br._jumpTarget;
               }
               m.addInstr(new CopyInstr(result, bodyValue));
               m.addInstr(new JumpInstr(tgt));
View Full Code Here

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

            if (thenResult != U_NIL) { // thenResult can be U_NIL if then-body ended with a return!
                // Local optimization of break results to short-circuit the jump right away
                // rather than wait to do it during an optimization pass.
                Label tgt = doneLabel;
                if (thenResult instanceof BreakResult) {
                    BreakResult br = (BreakResult)thenResult;
                    thenResult = br._result;
                    tgt = br._jumpTarget;
                }
                s.addInstr(new CopyInstr(result, thenResult));
                s.addInstr(new JumpInstr(tgt));
View Full Code Here

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

//            System.out.println("AFTER: " + i);
            if (val != null && res != null && res != val) {
                recordSimplification(res, val, valueMap, simplificationMap);

                if (val instanceof BreakResult) {
                    BreakResult br = (BreakResult)val;
                    i.markDead();
                    instrs.add(new CopyInstr(res, br._result));
                    instrs.add(new JumpInstr(br._jumpTarget));
                }
            }
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.