public void caseDup2_x1Inst(Dup2_x1Inst i) { Type ot = i.getOp1Type(); if (ot instanceof DoubleType || ot instanceof LongType) { remove_types = new Type[] { i.getUnder1Type(), ot }; add_types = new Type[] { ot, i.getUnder1Type(), ot }; } else { remove_types = new Type[] { i.getUnder1Type(), i.getOp2Type(), ot }; add_types = new Type[] { i.getOp2Type(), ot, i.getUnder1Type(), i.getOp2Type(), ot }; } }
@Override public void caseDup2_x1Inst(Dup2_x1Inst i) { int toDup = sizeOfType(i.getOp1Type()) + sizeOfType(i.getOp2Type()); if (toDup == 2) { if (sizeOfType(i.getUnder1Type()) == 2) { mv.visitInsn(Opcodes.DUP2_X2); } else { mv.visitInsn(Opcodes.DUP2_X1); } } else { throw new RuntimeException("magic not implemented yet"); } }
@Override public void caseDup2_x1Inst(Dup2_x1Inst i) { Type op1Type = i.getOp1Type(); Type op2Type = i.getOp2Type(); Type under1Type = i.getUnder1Type(); // 07-20-2006 Michael Batchelder // NOW handling all types of dup2_x1 /* * 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(under1Type)) { if (!isDwordType(op1Type) && !isDwordType(op2Type)) { throw new RuntimeException("magic not implemented yet"); } else { emit("dup2_x2"); // (form 3) } } else { if ((isDwordType(op1Type) && op2Type != null) || isDwordType(op2Type)) { throw new RuntimeException("magic not implemented yet"); } } emit("dup2_x1"); // (form 1) }