@Override public TypedValue virtualMethodCallValue(MethodCallValue.VirtualMethodCallValue val, I in) { // TODO: This changes the semantics of things a little bit MethodSignature sig = val.getSignature(); if (comparisonMethods.containsKey(sig)) { return new TypedValue.ComparisonValue(comparisonMethods.get(sig), val.base, val.args.get(0)); } if (additionalComparisonMethods.containsKey(sig)) { return new TypedValue.ComparisonValue(additionalComparisonMethods.get(sig), val.base, val.args.get(0)); } if (mathMethods.containsKey(sig)) { if (mathMethodsType.containsKey(sig)) return new TypedValue.MathOpValue(mathMethods.get(sig), mathMethodsType.get(sig), val.base, val.args.get(0)); else return new TypedValue.MathOpValue(mathMethods.get(sig), val.base, val.args.get(0)); } if (convertAllEquals && "equals".equals(sig.name) && "(Ljava/lang/Object;)Z".equals(sig.desc)) { return new TypedValue.ComparisonValue(ComparisonOp.eq, val.base, val.args.get(0)); } return methodCallValue(val, in); }
case FSUB: case DSUB: return new TypedValue.MathOpValue(TypedValue.MathOpValue.Op.minus, (TypedValue)value1, (TypedValue)value2); case IADD: case LADD: case FADD: case DADD: return new TypedValue.MathOpValue(TypedValue.MathOpValue.Op.plus, (TypedValue)value1, (TypedValue)value2); case IMUL: case LMUL: case FMUL: case DMUL: return new TypedValue.MathOpValue(TypedValue.MathOpValue.Op.mul, (TypedValue)value1, (TypedValue)value2); case IDIV: case LDIV: case FDIV: case DDIV: return new TypedValue.MathOpValue(TypedValue.MathOpValue.Op.div, (TypedValue)value1, (TypedValue)value2); case LCMP: case FCMPL: case DCMPL: case DCMPG: return new TypedValue.MathOpValue(TypedValue.MathOpValue.Op.cmp, Type.INT_TYPE, (TypedValue)value1, (TypedValue)value2); case IREM: case LREM: return new TypedValue.MathOpValue(TypedValue.MathOpValue.Op.mod, Type.INT_TYPE, (TypedValue)value1, (TypedValue)value2); case IALOAD: case LALOAD:
@Override public MathOpValue withNewChildren(TypedValue newLeft, TypedValue newRight) { return new MathOpValue(op, newLeft, newRight); } @Override