Package org.jruby.compiler.ir.instructions

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


            // SSS: FIXME: Somewhere here, we need to record information the type of this operand as String
        return build(node.getBody(), s);
    }

    public Operand buildFalse(Node node, IRScope s) {
        s.addInstr(new ThreadPollInstr());
        return BooleanLiteral.FALSE;
    }
View Full Code Here


    }

    public Operand buildNext(final NextNode nextNode, IRExecutionScope s) {
        Operand rv = (nextNode.getValueNode() == null) ? Nil.NIL : build(nextNode.getValueNode(), s);
        // SSS FIXME: 1. Is the ordering correct? (poll before next)
        s.addInstr(new ThreadPollInstr());
        // If a closure, the next is simply a return from the closure!
        // If a regular loop, the next is simply a jump to the end of the iteration
        s.addInstr((s instanceof IRClosure) ? new ClosureReturnInstr(rv) : new JumpInstr(s.getCurrentLoop().iterEndLabel));
        return rv;
    }
View Full Code Here

    public Operand buildNthRef(NthRefNode nthRefNode, IRScope m) {
        return new NthRef(nthRefNode.getMatchNumber());
    }

    public Operand buildNil(Node node, IRScope m) {
        m.addInstr(new ThreadPollInstr());
        return Nil.NIL;
    }
View Full Code Here

        Variable f  = s.getNewTemporaryVariable();
        s.addInstr(new IsTrueInstr(f, v1));
        s.addInstr(new BEQInstr(f, BooleanLiteral.FALSE, l));
        build(andNode.getSecondNode(), s)// This does the assignment!
        s.addInstr(new LABEL_Instr(l));
        s.addInstr(new ThreadPollInstr());
        return v1;
    }
View Full Code Here

        if (needsDefnCheck) {
            s.addInstr(new LABEL_Instr(l2));
        }
        build(orNode.getSecondNode(), s); // This is an AST node that sets x = y, so nothing special to do here.
        s.addInstr(new LABEL_Instr(l1));
        s.addInstr(new ThreadPollInstr());

        // Return value of x ||= y is always 'x'
        return v1;
    }
View Full Code Here

    }

    public Operand buildRetry(Node node, IRScope s) {
        // JRuby only supports retry when present in rescue blocks!
        // 1.9 doesn't support retry anywhere else.
        s.addInstr(new ThreadPollInstr());

        // Jump back to the innermost rescue block
        // We either find it, or we add code to throw a runtime exception
        if (_rescueBlockLabelStack.empty()) {
            StringLiteral exc = new StringLiteral("retry found outside of rescue clause!");
View Full Code Here

        Operand  array = build(node.getValue(), s);
        return generateJRubyUtilityCall(s, MethAddr.TO_ARY, array, NO_ARGS);
    }

    public Operand buildTrue(Node node, IRScope m) {
        m.addInstr(new ThreadPollInstr());
        return BooleanLiteral.TRUE;
    }
View Full Code Here

                    // So, we dont need to set it to anything.  We can leave it undefined!
                }
            }

                // SSS FIXME: Is this correctly placed ... at the end of the loop iteration?
            s.addInstr(new ThreadPollInstr());

            s.addInstr(new LABEL_Instr(loop.iterEndLabel));
            if (isLoopHeadCondition) {
                // Issue a jump back to the head of the while loop
                s.addInstr(new JumpInstr(loop.loopStartLabel));
View Full Code Here

TOP

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

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.