All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jruby.ir.instructions.ThreadPollInstr Maven / Gradle / Ivy

There is a newer version: 9.4.9.0
Show newest version
package org.jruby.ir.instructions;

import org.jruby.ir.IRVisitor;
import org.jruby.ir.Operation;
import org.jruby.ir.operands.Operand;
import org.jruby.ir.transformations.inlining.InlinerInfo;

public class ThreadPollInstr extends Instr {
    public final boolean onBackEdge;

    public ThreadPollInstr(boolean onBackEdge) {
        super(Operation.THREAD_POLL);
        this.onBackEdge = onBackEdge;
    }

    public ThreadPollInstr() {
        this(false);
    }

    @Override
    public Operand[] getOperands() {
        return EMPTY_OPERANDS;
    }

    @Override
    public Instr cloneForInlining(InlinerInfo ii) {
        return this;
    }

    @Override
    public Instr cloneForInlinedScope(InlinerInfo ii) {
        // Get rid of non-back-edge thread-poll instructions when scopes are inlined
        return onBackEdge ? this : null;
    }

    @Override
    public void visit(IRVisitor visitor) {
        visitor.ThreadPollInstr(this);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy