Package org.jruby.compiler.ir.instructions

Examples of org.jruby.compiler.ir.instructions.ReturnInstr


        if (defNode.getBodyNode() != null) {
            Node bodyNode = defNode.getBodyNode();

            // if root of method is rescue, build as a light rescue
            Operand rv = (bodyNode instanceof RescueNode) ?  buildRescueInternal(bodyNode, method, null) : build(bodyNode, method);
            if (rv != null) method.addInstr(new ReturnInstr(rv));
        } else {
            method.addInstr(new ReturnInstr(Nil.NIL));
        }

        return method;
    }
View Full Code Here


    public Operand buildReturn(ReturnNode returnNode, IRScope m) {
        Operand retVal = (returnNode.getValueNode() == null) ? Nil.NIL : build(returnNode.getValueNode(), m);
        // Before we return, have to go execute all the ensure blocks
        if (!_ensureBlockStack.empty())
            EnsureBlockInfo.emitJumpChain(m, _ensureBlockStack);
        m.addInstr(new ReturnInstr(retVal));

        // The value of the return itself in the containing expression can never be used because of control-flow reasons.
        // The expression that uses this result can never be executed beyond this point and hence the value itself is just
        // a placeholder operand.
        return UnexecutableNil.U_NIL;
View Full Code Here

                }

                if (curr == _exitBB) {
                    // Add a dummy ret
//                    System.out.println("Exit bb is not the last bb in the layout!  Adding a dummy return!");
                    curr.addInstr(new ReturnInstr(Nil.NIL));
                }
            }
            else if (curr != _exitBB) {
                Set<CFG_Edge> succs = _cfg.outgoingEdgesOf(curr);
                assert succs.size() == 1;
View Full Code Here

TOP

Related Classes of org.jruby.compiler.ir.instructions.ReturnInstr

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.