@Override public void caseDup1_x2Inst(Dup1_x2Inst i) { int toSkip = sizeOfType(i.getUnder1Type()) + sizeOfType(i.getUnder2Type()); if (sizeOfType(i.getOp1Type()) == 2) { if (toSkip == 2) { mv.visitInsn(Opcodes.DUP2_X2); } else { throw new RuntimeException("magic not implemented yet"); } } else { if (toSkip == 2) { mv.visitInsn(Opcodes.DUP_X2); } else { throw new RuntimeException("magic not implemented yet"); } } }
public void caseDup1_x2Inst(Dup1_x2Inst i) { Type u1 = i.getUnder1Type(); if (u1 instanceof DoubleType || u1 instanceof LongType) { remove_types = new Type[] { u1, i.getOp1Type() }; add_types = new Type[] { i.getOp1Type(), u1, i.getOp1Type() }; } else { remove_types = new Type[] { i.getUnder2Type(), u1, i.getOp1Type() }; add_types = new Type[] { i.getOp1Type(), i.getUnder2Type(), u1, i.getOp1Type() }; } }
@Override public void caseDup1_x2Inst(Dup1_x2Inst i) { Type opType = i.getOp1Type(); Type under1Type = i.getUnder1Type(); Type under2Type = i.getUnder2Type(); // 07-20-2006 Michael Batchelder // NOW handling all types of dup1_x2 /* * From VM Spec: cat1 = category 1 (word type) cat2 = category 2 (doubleword) * * Form 1: [..., cat1_value3, cat1_value2, cat1_value1]->[..., cat1_value2, cat1_value1, cat1_value3, cat1_value2, * cat1_value1] Form 2: [..., cat1_value2, cat2_value1]->[..., cat2_value1, cat1_value2, cat2_value1] */ if (isDwordType(opType)) { if (!isDwordType(under1Type) && !isDwordType(under2Type)) { emit("dup2_x2"); // (form 2) } else { throw new RuntimeException("magic not implemented yet"); } } else { if (isDwordType(under1Type) || isDwordType(under2Type)) { throw new RuntimeException("magic not implemented yet"); } } emit("dup_x2"); // (form 1) }