@Override public Instr cloneForBlockCloning(InlinerInfo ii) { return new BFalseInstr(getArg1().cloneForInlining(ii), getJumpTarget()); }
@Override public Instr cloneForBlockCloning(InlinerInfo ii) { return new BFalseInstr(getArg1().cloneForInlining(ii), getJumpTarget()); }
@Override public int interpretAndGetNewIPC(ThreadContext context, DynamicScope currDynScope, IRubyObject self, Object[] temp, int ipc) { Object value1 = getArg1().retrieve(context, self, currDynScope, temp); return !((IRubyObject)value1).isTrue() ? getJumpTarget().getTargetPC() : ipc; } }
@Override public int interpretAndGetNewIPC(ThreadContext context, DynamicScope currDynScope, IRubyObject self, Object[] temp, int ipc) { Object value1 = getArg1().retrieve(context, self, currDynScope, temp); return !((IRubyObject)value1).isTrue() ? getJumpTarget().getTargetPC() : ipc; } }
@Override public int interpretAndGetNewIPC(ThreadContext context, DynamicScope currDynScope, StaticScope currScope, IRubyObject self, Object[] temp, int ipc) { Object value1 = getArg1().retrieve(context, self, currScope, currDynScope, temp); return !((IRubyObject)value1).isTrue() ? getJumpTarget().getTargetPC() : ipc; } }
@Override public int interpretAndGetNewIPC(ThreadContext context, DynamicScope currDynScope, StaticScope currScope, IRubyObject self, Object[] temp, int ipc) { Object value1 = getArg1().retrieve(context, self, currScope, currDynScope, temp); return !((IRubyObject)value1).isTrue() ? getJumpTarget().getTargetPC() : ipc; } }
@Override public Instr cloneForInlinedScope(InlinerInfo ii) { return new BFalseInstr(getArg1().cloneForInlining(ii), ii.getRenamedLabel(getJumpTarget())); }
@Override public Instr clone(CloneInfo ii) { return new BFalseInstr(ii.getRenamedLabel(getJumpTarget()), getArg1().cloneForInlining(ii)); }
@Override public Instr clone(CloneInfo ii) { return new BFalseInstr(ii.getRenamedLabel(getJumpTarget()), getArg1().cloneForInlining(ii)); }
@Override public Instr cloneForInlinedScope(InlinerInfo ii) { return new BFalseInstr(getArg1().cloneForInlining(ii), ii.getRenamedLabel(getJumpTarget())); }
@Override public void BFalseInstr(BFalseInstr bFalseInstr) { visit(bFalseInstr.getArg1()); jvm.method().isTrue(); jvm.method().bfalse(getJVMLabel(bFalseInstr.getJumpTarget())); }
@Override public void BFalseInstr(BFalseInstr bFalseInstr) { visit(bFalseInstr.getArg1()); jvm.method().isTrue(); jvm.method().bfalse(getJVMLabel(bFalseInstr.getJumpTarget())); }
@Override public void BFalseInstr(BFalseInstr bFalseInstr) { Operand arg1 = bFalseInstr.getArg1(); // this is a gross hack because we don't have distinction in boolean instrs between boxed and unboxed if (arg1 instanceof TemporaryBooleanVariable || arg1 instanceof UnboxedBoolean) { // no need to unbox visit(arg1); jvmMethod().bfalse(getJVMLabel(bFalseInstr.getJumpTarget())); } else if ((arg1 instanceof Boolean && ((Boolean) arg1).isTrue()) || arg1 instanceof UnboxedFixnum || arg1 instanceof UnboxedFloat) { // always true, don't branch } else if ((arg1 instanceof Boolean && ((Boolean) arg1).isFalse()) || arg1 instanceof UnboxedFixnum || arg1 instanceof UnboxedFloat) { // always false, always branch jvmAdapter().go_to(getJVMLabel(bFalseInstr.getJumpTarget())); } else { // unbox visit(arg1); jvmAdapter().invokeinterface(p(IRubyObject.class), "isTrue", sig(boolean.class)); jvmMethod().bfalse(getJVMLabel(bFalseInstr.getJumpTarget())); } }
@Override public void BFalseInstr(BFalseInstr bFalseInstr) { Operand arg1 = bFalseInstr.getArg1(); // this is a gross hack because we don't have distinction in boolean instrs between boxed and unboxed if (arg1 instanceof TemporaryBooleanVariable || arg1 instanceof UnboxedBoolean) { // no need to unbox visit(arg1); jvmMethod().bfalse(getJVMLabel(bFalseInstr.getJumpTarget())); } else if ((arg1 instanceof Boolean && ((Boolean) arg1).isTrue()) || arg1 instanceof UnboxedFixnum || arg1 instanceof UnboxedFloat) { // always true, don't branch } else if ((arg1 instanceof Boolean && ((Boolean) arg1).isFalse()) || arg1 instanceof UnboxedFixnum || arg1 instanceof UnboxedFloat) { // always false, always branch jvmAdapter().go_to(getJVMLabel(bFalseInstr.getJumpTarget())); } else { // unbox visit(arg1); jvmAdapter().invokeinterface(p(IRubyObject.class), "isTrue", sig(boolean.class)); jvmMethod().bfalse(getJVMLabel(bFalseInstr.getJumpTarget())); } }