remove redundant Compiler::condJump type parameter

This commit is contained in:
Joshua Warner
2014-05-03 20:34:46 -06:00
committed by Joshua Warner
parent e3354617a6
commit b14709c54c
3 changed files with 12 additions and 20 deletions

View File

@ -118,7 +118,6 @@ class Compiler {
ir::Type dstType) = 0; ir::Type dstType) = 0;
virtual void condJump(lir::TernaryOperation op, virtual void condJump(lir::TernaryOperation op,
ir::Type type,
ir::Value* a, ir::Value* a,
ir::Value* b, ir::Value* b,
ir::Value* address) = 0; ir::Value* address) = 0;

View File

@ -2625,7 +2625,6 @@ class MyCompiler: public Compiler {
} }
virtual void condJump(lir::TernaryOperation op, virtual void condJump(lir::TernaryOperation op,
ir::Type type,
ir::Value* a, ir::Value* a,
ir::Value* b, ir::Value* b,
ir::Value* address) ir::Value* address)
@ -2634,14 +2633,13 @@ class MyCompiler: public Compiler {
(isGeneralBranch(op) and isGeneralValue(a) and isGeneralValue(b))or( (isGeneralBranch(op) and isGeneralValue(a) and isGeneralValue(b))or(
isFloatBranch(op) and isFloatValue(a) and isFloatValue(b))); isFloatBranch(op) and isFloatValue(a) and isFloatValue(b)));
assert(&c, type == a->type); assert(&c, a->type == b->type);
assert(&c, type == b->type);
assert(&c, assert(&c,
address->type == ir::Type(ir::Type::Integer, TargetBytesPerWord)); address->type == ir::Type(ir::Type::Integer, TargetBytesPerWord));
appendBranch(&c, appendBranch(&c,
op, op,
type.size(), a->type.size(),
static_cast<Value*>(a), static_cast<Value*>(a),
static_cast<Value*>(b), static_cast<Value*>(b),
static_cast<Value*>(address)); static_cast<Value*>(address));

View File

@ -3614,7 +3614,6 @@ bool integerBranch(MyThread* t,
Frame* frame, Frame* frame,
object code, object code,
unsigned& ip, unsigned& ip,
ir::Type type,
ir::Value* a, ir::Value* a,
ir::Value* b, ir::Value* b,
unsigned* newIpp) unsigned* newIpp)
@ -3638,7 +3637,7 @@ bool integerBranch(MyThread* t,
case ifge: case ifge:
case iflt: case iflt:
case ifle: case ifle:
c->condJump(toCompilerJumpOp(t, instruction), type, a, b, target); c->condJump(toCompilerJumpOp(t, instruction), a, b, target);
break; break;
default: default:
@ -3692,7 +3691,6 @@ bool floatBranch(MyThread* t,
Frame* frame, Frame* frame,
object code, object code,
unsigned& ip, unsigned& ip,
ir::Type type,
bool lessIfUnordered, bool lessIfUnordered,
ir::Value* a, ir::Value* a,
ir::Value* b, ir::Value* b,
@ -3718,7 +3716,6 @@ bool floatBranch(MyThread* t,
case iflt: case iflt:
case ifle: case ifle:
c->condJump(toCompilerFloatJumpOp(t, instruction, lessIfUnordered), c->condJump(toCompilerFloatJumpOp(t, instruction, lessIfUnordered),
type,
a, a,
b, b,
target); target);
@ -4442,7 +4439,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
ir::Value* a = frame->popLong(); ir::Value* a = frame->popLong();
ir::Value* b = frame->popLong(); ir::Value* b = frame->popLong();
if (floatBranch(t, frame, code, ip, types.f8, false, a, b, &newIp)) { if (floatBranch(t, frame, code, ip, false, a, b, &newIp)) {
goto branch; goto branch;
} else { } else {
frame->pushInt(c->call( frame->pushInt(c->call(
@ -4462,7 +4459,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
ir::Value* a = frame->popLong(); ir::Value* a = frame->popLong();
ir::Value* b = frame->popLong(); ir::Value* b = frame->popLong();
if (floatBranch(t, frame, code, ip, types.f8, true, a, b, &newIp)) { if (floatBranch(t, frame, code, ip, true, a, b, &newIp)) {
goto branch; goto branch;
} else { } else {
frame->pushInt(c->call( frame->pushInt(c->call(
@ -4543,7 +4540,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
ir::Value* a = frame->popInt(); ir::Value* a = frame->popInt();
ir::Value* b = frame->popInt(); ir::Value* b = frame->popInt();
if (floatBranch(t, frame, code, ip, types.f4, false, a, b, &newIp)) { if (floatBranch(t, frame, code, ip, false, a, b, &newIp)) {
goto branch; goto branch;
} else { } else {
frame->pushInt(c->call( frame->pushInt(c->call(
@ -4561,7 +4558,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
ir::Value* a = frame->popInt(); ir::Value* a = frame->popInt();
ir::Value* b = frame->popInt(); ir::Value* b = frame->popInt();
if (floatBranch(t, frame, code, ip, types.f4, true, a, b, &newIp)) { if (floatBranch(t, frame, code, ip, true, a, b, &newIp)) {
goto branch; goto branch;
} else { } else {
frame->pushInt(c->call( frame->pushInt(c->call(
@ -4889,7 +4886,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
ir::Value* b = frame->popObject(); ir::Value* b = frame->popObject();
ir::Value* target = frame->machineIpValue(newIp); ir::Value* target = frame->machineIpValue(newIp);
c->condJump(toCompilerJumpOp(t, instruction), types.object, a, b, target); c->condJump(toCompilerJumpOp(t, instruction), a, b, target);
} goto branch; } goto branch;
case if_icmpeq: case if_icmpeq:
@ -4910,7 +4907,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
ir::Value* b = frame->popInt(); ir::Value* b = frame->popInt();
ir::Value* target = frame->machineIpValue(newIp); ir::Value* target = frame->machineIpValue(newIp);
c->condJump(toCompilerJumpOp(t, instruction), types.i4, a, b, target); c->condJump(toCompilerJumpOp(t, instruction), a, b, target);
} goto branch; } goto branch;
case ifeq: case ifeq:
@ -4932,7 +4929,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
ir::Value* a = c->constant(0, types.i4); ir::Value* a = c->constant(0, types.i4);
ir::Value* b = frame->popInt(); ir::Value* b = frame->popInt();
c->condJump(toCompilerJumpOp(t, instruction), types.i4, a, b, target); c->condJump(toCompilerJumpOp(t, instruction), a, b, target);
} goto branch; } goto branch;
case ifnull: case ifnull:
@ -4949,7 +4946,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
ir::Value* b = frame->popObject(); ir::Value* b = frame->popObject();
ir::Value* target = frame->machineIpValue(newIp); ir::Value* target = frame->machineIpValue(newIp);
c->condJump(toCompilerJumpOp(t, instruction), types.object, a, b, target); c->condJump(toCompilerJumpOp(t, instruction), a, b, target);
} goto branch; } goto branch;
case iinc: { case iinc: {
@ -5335,7 +5332,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
ir::Value* a = frame->popLong(); ir::Value* a = frame->popLong();
ir::Value* b = frame->popLong(); ir::Value* b = frame->popLong();
if (integerBranch(t, frame, code, ip, types.i8, a, b, &newIp)) { if (integerBranch(t, frame, code, ip, a, b, &newIp)) {
goto branch; goto branch;
} else { } else {
frame->pushInt( frame->pushInt(
@ -6061,7 +6058,6 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
ir::Value* key = frame->popInt(); ir::Value* key = frame->popInt();
c->condJump(lir::JumpIfLess, c->condJump(lir::JumpIfLess,
types.i4,
c->constant(bottom, types.i4), c->constant(bottom, types.i4),
key, key,
frame->machineIpValue(defaultIp)); frame->machineIpValue(defaultIp));
@ -6161,7 +6157,6 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
c->restoreState(s->state); c->restoreState(s->state);
c->condJump(lir::JumpIfGreater, c->condJump(lir::JumpIfGreater,
types.i4,
c->constant(s->top, types.i4), c->constant(s->top, types.i4),
s->key, s->key,
frame->machineIpValue(s->defaultIp)); frame->machineIpValue(s->defaultIp));