/** * Check if an int or reference equals to zero. If the comparison is true, * execution jumps to {@code trueLabel}. If it is false, execution continues to * the next instruction. */ public <T> void compareZ(Comparison comparison, Label trueLabel, Local<?> a) { adopt(trueLabel); Rop rop = comparison.rop(StdTypeList.make(a.type.ropType)); addInstruction(new PlainInsn(rop, sourcePosition, null, RegisterSpecList.make(a.spec())), trueLabel); }
/** * Compare ints or references. If the comparison is true, execution jumps to * {@code trueLabel}. If it is false, execution continues to the next * instruction. */ public <T> void compare(Comparison comparison, Label trueLabel, Local<T> a, Local<T> b) { adopt(trueLabel); Rop rop = comparison.rop(StdTypeList.make(a.type.ropType, b.type.ropType)); addInstruction(new PlainInsn(rop, sourcePosition, null, RegisterSpecList.make(a.spec(), b.spec())), trueLabel); }
/** * Executes {@code op} and sets {@code target} to the result. For most * binary operations, the types of {@code a} and {@code b} must be the same. * Shift operations (like {@link BinaryOp#SHIFT_LEFT}) require {@code b} to * be an {@code int}, even when {@code a} is a {@code long}. */ public <T1, T2> void op(BinaryOp op, Local<T1> target, Local<T1> a, Local<T2> b) { Rop rop = op.rop(StdTypeList.make(a.type.ropType, b.type.ropType)); RegisterSpecList sources = RegisterSpecList.make(a.spec(), b.spec()); if (rop.getBranchingness() == BRANCH_NONE) { addInstruction(new PlainInsn(rop, sourcePosition, target.spec(), sources)); } else { addInstruction(new ThrowingInsn(rop, sourcePosition, sources, catches)); moveResult(target, true); } }
/** * Compare ints. If the comparison is true, execution jumps to {@code * trueLabel}. If it is false, execution continues to the next instruction. */ public <T> void compare(Comparison comparison, Local<T> a, Local<T> b, Label trueLabel) { if (trueLabel == null) { throw new IllegalArgumentException(); } Rop rop = comparison.rop(StdTypeList.make(a.type.ropType, b.type.ropType)); addInstruction(new PlainInsn(rop, sourcePosition, null, RegisterSpecList.make(a.spec(), b.spec())), trueLabel); }
/** * Check if an int or reference equals to zero. If the comparison is true, * execution jumps to {@code trueLabel}. If it is false, execution continues to * the next instruction. */ public <T> void compareZ(Comparison comparison, Label trueLabel, Local<?> a) { adopt(trueLabel); Rop rop = comparison.rop(StdTypeList.make(a.type.ropType)); addInstruction(new PlainInsn(rop, sourcePosition, null, RegisterSpecList.make(a.spec())), trueLabel); }
/** * Compare ints or references. If the comparison is true, execution jumps to * {@code trueLabel}. If it is false, execution continues to the next * instruction. */ public <T> void compare(Comparison comparison, Label trueLabel, Local<T> a, Local<T> b) { adopt(trueLabel); Rop rop = comparison.rop(StdTypeList.make(a.type.ropType, b.type.ropType)); addInstruction(new PlainInsn(rop, sourcePosition, null, RegisterSpecList.make(a.spec(), b.spec())), trueLabel); }
/** * Compare ints or references. If the comparison is true, execution jumps to {@code trueLabel}. If it is false, execution continues to the next instruction. */ public <T> void compare(Comparison comparison, Label trueLabel, Local<T> a, Local<T> b) { adopt(trueLabel); // TODO: ops to compare with zero/null: just omit the 2nd local in StdTypeList.make() Rop rop = comparison.rop(StdTypeList.make(a.type.ropType, b.type.ropType)); addInstruction(new PlainInsn(rop, sourcePosition, null, RegisterSpecList.make(a.spec(), b.spec())), trueLabel); }
return throwBadTypes(StdTypeList.make(dest.getType(), source.getType()));
return throwBadTypes(StdTypeList.make(dest.getType(), source.getType()));
return throwBadTypes(StdTypeList.make(dest.getType(), source.getType()));
return throwBadTypes(StdTypeList.make(dest.getType(), source.getType()));
return throwBadTypes(StdTypeList.make(dest.getType(), source.getType()));
return throwBadTypes(StdTypeList.make(dest.getType(), source.getType()));
return throwBadTypes(StdTypeList.make(dest.getType(), source.getType()));
return throwBadTypes(StdTypeList.make(dest.getType(), source.getType()));
public <T> void op(BinaryOp op, Local<T> target, Local<T> a, Local<T> b) { Rop rop = op.rop(StdTypeList.make(a.type.ropType, b.type.ropType)); RegisterSpecList sources = RegisterSpecList.make(a.spec(), b.spec()); if (rop.getBranchingness() == BRANCH_NONE) { addInstruction(new PlainInsn(rop, sourcePosition, target.spec(), sources)); } else { addInstruction(new ThrowingInsn(rop, sourcePosition, sources, catches)); moveResult(target, true); } }
/** * Executes {@code op} and sets {@code target} to the result. For most binary operations, the types of {@code a} and {@code b} must be the same. Shift operations (like {@link BinaryOp#SHIFT_LEFT}) require {@code b} to be an {@code int}, even when {@code a} is a {@code long}. */ public <T1, T2> void op(BinaryOp op, Local<T1> target, Local<T1> a, Local<T2> b) { Rop rop = op.rop(StdTypeList.make(a.type.ropType, b.type.ropType)); RegisterSpecList sources = RegisterSpecList.make(a.spec(), b.spec()); if (rop.getBranchingness() == BRANCH_NONE) { addInstruction(new PlainInsn(rop, sourcePosition, target.spec(), sources)); } else { addInstruction(new ThrowingInsn(rop, sourcePosition, sources, catches)); moveResult(target, true); } }
/** * Executes {@code op} and sets {@code target} to the result. For most * binary operations, the types of {@code a} and {@code b} must be the same. * Shift operations (like {@link BinaryOp#SHIFT_LEFT}) require {@code b} to * be an {@code int}, even when {@code a} is a {@code long}. */ public <T1, T2> void op(BinaryOp op, Local<T1> target, Local<T1> a, Local<T2> b) { Rop rop = op.rop(StdTypeList.make(a.type.ropType, b.type.ropType)); RegisterSpecList sources = RegisterSpecList.make(a.spec(), b.spec()); if (rop.getBranchingness() == BRANCH_NONE) { addInstruction(new PlainInsn(rop, sourcePosition, target.spec(), sources)); } else { addInstruction(new ThrowingInsn(rop, sourcePosition, sources, catches)); moveResult(target, true); } }