From 008bb6b86e8e8a7706224448042ab1dd881d2ae9 Mon Sep 17 00:00:00 2001 From: Joshua Warner Date: Sat, 3 May 2014 20:41:54 -0600 Subject: [PATCH] remove redundant Compiler::unaryOp type parameter --- include/avian/codegen/compiler.h | 1 - src/codegen/compiler.cpp | 4 +--- src/compile.cpp | 19 ++++++++----------- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/include/avian/codegen/compiler.h b/include/avian/codegen/compiler.h index 07e7376e8c..acf58f7029 100644 --- a/include/avian/codegen/compiler.h +++ b/include/avian/codegen/compiler.h @@ -130,7 +130,6 @@ class Compiler { ir::Value* a, ir::Value* b) = 0; virtual ir::Value* unaryOp(lir::BinaryOperation op, - ir::Type type, ir::Value* a) = 0; virtual void nullaryOp(lir::Operation op) = 0; diff --git a/src/codegen/compiler.cpp b/src/codegen/compiler.cpp index e0fde700bb..401a6f965d 100644 --- a/src/codegen/compiler.cpp +++ b/src/codegen/compiler.cpp @@ -2678,16 +2678,14 @@ class MyCompiler: public Compiler { } virtual ir::Value* unaryOp(lir::BinaryOperation op, - ir::Type type, ir::Value* a) { - assert(&c, a->type == type); assert(&c, (isGeneralUnaryOp(op) and isGeneralValue(a))or(isFloatUnaryOp(op) and isFloatValue(a))); Value* result = value(&c, a->type); appendTranslate( - &c, op, type.size(), static_cast(a), type.size(), result); + &c, op, a->type.size(), static_cast(a), a->type.size(), result); return result; } diff --git a/src/compile.cpp b/src/compile.cpp index 0047bacd39..c30954549c 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -3754,19 +3754,17 @@ intrinsic(MyThread* t, Frame* frame, object target) if (MATCH(methodName(t, target), "sqrt") and MATCH(methodSpec(t, target), "(D)D")) { - frame->pushDouble( - c->unaryOp(lir::FloatSquareRoot, types.f8, frame->popLong())); + frame->pushDouble(c->unaryOp(lir::FloatSquareRoot, frame->popLong())); return true; } else if (MATCH(methodName(t, target), "abs")) { if (MATCH(methodSpec(t, target), "(I)I")) { - frame->pushInt(c->unaryOp(lir::Absolute, types.i4, frame->popInt())); + frame->pushInt(c->unaryOp(lir::Absolute, frame->popInt())); return true; } else if (MATCH(methodSpec(t, target), "(J)J")) { - frame->pushLong(c->unaryOp(lir::Absolute, types.i8, frame->popLong())); + frame->pushLong(c->unaryOp(lir::Absolute, frame->popLong())); return true; } else if (MATCH(methodSpec(t, target), "(F)F")) { - frame->pushFloat( - c->unaryOp(lir::FloatAbsolute, types.f4, frame->popInt())); + frame->pushFloat(c->unaryOp(lir::FloatAbsolute, frame->popInt())); return true; } } @@ -4484,8 +4482,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp, break; case dneg: { - frame->pushDouble( - c->unaryOp(lir::FloatNegate, types.f8, frame->popLong())); + frame->pushDouble(c->unaryOp(lir::FloatNegate, frame->popLong())); } break; case dup: @@ -4585,7 +4582,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp, break; case fneg: { - frame->pushFloat(c->unaryOp(lir::FloatNegate, types.f4, frame->popInt())); + frame->pushFloat(c->unaryOp(lir::FloatNegate, frame->popInt())); } break; case getfield: @@ -4999,7 +4996,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp, break; case ineg: { - frame->pushInt(c->unaryOp(lir::Negate, types.i4, frame->popInt())); + frame->pushInt(c->unaryOp(lir::Negate, frame->popInt())); } break; case instanceof: { @@ -5475,7 +5472,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp, break; case lneg: - frame->pushLong(c->unaryOp(lir::Negate, types.i8, frame->popLong())); + frame->pushLong(c->unaryOp(lir::Negate, frame->popLong())); break; case lookupswitch: {