From e3d01746e8be64910df4f005398bf18213945472 Mon Sep 17 00:00:00 2001 From: Joshua Warner Date: Sat, 3 May 2014 20:04:43 -0600 Subject: [PATCH] remove redundant Compiler::truncate srcType parameter --- include/avian/codegen/compiler.h | 3 +-- src/codegen/compiler.cpp | 7 +++---- src/compile.cpp | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/include/avian/codegen/compiler.h b/include/avian/codegen/compiler.h index fb34919a03..fb10b3a680 100644 --- a/include/avian/codegen/compiler.h +++ b/include/avian/codegen/compiler.h @@ -110,8 +110,7 @@ class Compiler { ir::Type truncateType, ir::Value* src) = 0; - virtual ir::Value* truncate(ir::Type type, ir::Type srcType, ir::Value* src) - = 0; + virtual ir::Value* truncate(ir::Type type, ir::Value* src) = 0; virtual void store(ir::Type srcType, ir::Value* src, ir::Value* dst) = 0; virtual ir::Value* load(ir::SignExtendMode signExtend, diff --git a/src/codegen/compiler.cpp b/src/codegen/compiler.cpp index dc9c6dd79e..e833a1d591 100644 --- a/src/codegen/compiler.cpp +++ b/src/codegen/compiler.cpp @@ -2560,17 +2560,16 @@ class MyCompiler: public Compiler { static_cast(index), handler); } - virtual ir::Value* truncate(ir::Type type, ir::Type srcType, ir::Value* src) + virtual ir::Value* truncate(ir::Type type, ir::Value* src) { - assert(&c, srcType == src->type); assert(&c, src->type.flavor() == type.flavor()); assert(&c, type.flavor() != ir::Type::Float); assert(&c, type.size() < src->type.size()); Value* dst = value(&c, type); appendMove(&c, lir::Move, - srcType.size(), - srcType.size(), + src->type.size(), + src->type.size(), static_cast(src), type.size(), dst); diff --git a/src/compile.cpp b/src/compile.cpp index 660a53e908..cc83db899d 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -5329,7 +5329,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp, } break; case l2i: - frame->pushInt(c->truncate(types.i4, types.i8, frame->popLong())); + frame->pushInt(c->truncate(types.i4, frame->popLong())); break; case ladd: