mirror of
https://github.com/corda/corda.git
synced 2025-01-07 05:28:51 +00:00
remove redundant load srcType parameter
This commit is contained in:
parent
69966f1d36
commit
963b371e04
@ -115,7 +115,6 @@ class Compiler {
|
|||||||
|
|
||||||
virtual void store(ir::Type srcType, ir::Value* src, ir::Value* dst) = 0;
|
virtual void store(ir::Type srcType, ir::Value* src, ir::Value* dst) = 0;
|
||||||
virtual ir::Value* load(ir::SignExtendMode signExtend,
|
virtual ir::Value* load(ir::SignExtendMode signExtend,
|
||||||
ir::Type srcType,
|
|
||||||
ir::Value* src,
|
ir::Value* src,
|
||||||
ir::Type dstType) = 0;
|
ir::Type dstType) = 0;
|
||||||
|
|
||||||
|
@ -2607,19 +2607,16 @@ class MyCompiler: public Compiler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual ir::Value* load(ir::SignExtendMode signExtend,
|
virtual ir::Value* load(ir::SignExtendMode signExtend,
|
||||||
ir::Type srcType,
|
|
||||||
ir::Value* src,
|
ir::Value* src,
|
||||||
ir::Type dstType)
|
ir::Type dstType)
|
||||||
{
|
{
|
||||||
assert(&c, srcType.flavor() == dstType.flavor());
|
|
||||||
assert(&c, src->type.flavor() == dstType.flavor());
|
assert(&c, src->type.flavor() == dstType.flavor());
|
||||||
assert(&c, src->type == srcType);
|
|
||||||
|
|
||||||
Value* dst = value(&c, dstType);
|
Value* dst = value(&c, dstType);
|
||||||
appendMove(&c,
|
appendMove(&c,
|
||||||
signExtend == ir::SignExtend ? lir::Move : lir::MoveZ,
|
signExtend == ir::SignExtend ? lir::Move : lir::MoveZ,
|
||||||
srcType.size(),
|
src->type.size(),
|
||||||
srcType.size(),
|
src->type.size(),
|
||||||
static_cast<Value*>(src),
|
static_cast<Value*>(src),
|
||||||
dstType.size() < TargetBytesPerWord ? TargetBytesPerWord
|
dstType.size() < TargetBytesPerWord ? TargetBytesPerWord
|
||||||
: dstType.size(),
|
: dstType.size(),
|
||||||
|
@ -3739,7 +3739,6 @@ ir::Value* popLongAddress(Frame* frame)
|
|||||||
ir::Types types(TargetBytesPerWord);
|
ir::Types types(TargetBytesPerWord);
|
||||||
return TargetBytesPerWord == 8 ? frame->popLong()
|
return TargetBytesPerWord == 8 ? frame->popLong()
|
||||||
: frame->c->load(ir::SignExtend,
|
: frame->c->load(ir::SignExtend,
|
||||||
types.i8,
|
|
||||||
frame->popLong(),
|
frame->popLong(),
|
||||||
types.address);
|
types.address);
|
||||||
}
|
}
|
||||||
@ -3783,7 +3782,7 @@ intrinsic(MyThread* t, Frame* frame, object target)
|
|||||||
ir::Value* address = popLongAddress(frame);
|
ir::Value* address = popLongAddress(frame);
|
||||||
frame->popObject();
|
frame->popObject();
|
||||||
frame->pushInt(c->load(
|
frame->pushInt(c->load(
|
||||||
ir::SignExtend, types.i1, c->memory(address, types.i1), types.i4));
|
ir::SignExtend, c->memory(address, types.i1), types.i4));
|
||||||
return true;
|
return true;
|
||||||
} else if (MATCH(methodName(t, target), "putByte")
|
} else if (MATCH(methodName(t, target), "putByte")
|
||||||
and MATCH(methodSpec(t, target), "(JB)V"))
|
and MATCH(methodSpec(t, target), "(JB)V"))
|
||||||
@ -3801,7 +3800,7 @@ intrinsic(MyThread* t, Frame* frame, object target)
|
|||||||
ir::Value* address = popLongAddress(frame);
|
ir::Value* address = popLongAddress(frame);
|
||||||
frame->popObject();
|
frame->popObject();
|
||||||
frame->pushInt(c->load(
|
frame->pushInt(c->load(
|
||||||
ir::SignExtend, types.i2, c->memory(address, types.i2), types.i4));
|
ir::SignExtend, c->memory(address, types.i2), types.i4));
|
||||||
return true;
|
return true;
|
||||||
} else if ((MATCH(methodName(t, target), "putShort")
|
} else if ((MATCH(methodName(t, target), "putShort")
|
||||||
and MATCH(methodSpec(t, target), "(JS)V"))
|
and MATCH(methodSpec(t, target), "(JS)V"))
|
||||||
@ -3823,7 +3822,7 @@ intrinsic(MyThread* t, Frame* frame, object target)
|
|||||||
ir::Type type = MATCH(methodName(t, target), "getInt") ? types.i4
|
ir::Type type = MATCH(methodName(t, target), "getInt") ? types.i4
|
||||||
: types.f4;
|
: types.f4;
|
||||||
frame->pushSmall(
|
frame->pushSmall(
|
||||||
c->load(ir::SignExtend, type, c->memory(address, type), type));
|
c->load(ir::SignExtend, c->memory(address, type), type));
|
||||||
return true;
|
return true;
|
||||||
} else if ((MATCH(methodName(t, target), "putInt")
|
} else if ((MATCH(methodName(t, target), "putInt")
|
||||||
and MATCH(methodSpec(t, target), "(JI)V"))
|
and MATCH(methodSpec(t, target), "(JI)V"))
|
||||||
@ -3847,7 +3846,7 @@ intrinsic(MyThread* t, Frame* frame, object target)
|
|||||||
ir::Type type = MATCH(methodName(t, target), "getLong") ? types.i8
|
ir::Type type = MATCH(methodName(t, target), "getLong") ? types.i8
|
||||||
: types.f8;
|
: types.f8;
|
||||||
frame->pushLarge(
|
frame->pushLarge(
|
||||||
c->load(ir::SignExtend, type, c->memory(address, type), type));
|
c->load(ir::SignExtend, c->memory(address, type), type));
|
||||||
return true;
|
return true;
|
||||||
} else if ((MATCH(methodName(t, target), "putLong")
|
} else if ((MATCH(methodName(t, target), "putLong")
|
||||||
and MATCH(methodSpec(t, target), "(JJ)V"))
|
and MATCH(methodSpec(t, target), "(JJ)V"))
|
||||||
@ -3867,7 +3866,6 @@ intrinsic(MyThread* t, Frame* frame, object target)
|
|||||||
ir::Value* address = popLongAddress(frame);
|
ir::Value* address = popLongAddress(frame);
|
||||||
frame->popObject();
|
frame->popObject();
|
||||||
frame->pushLong(c->load(ir::SignExtend,
|
frame->pushLong(c->load(ir::SignExtend,
|
||||||
types.address,
|
|
||||||
c->memory(address, types.address),
|
c->memory(address, types.address),
|
||||||
types.i8));
|
types.i8));
|
||||||
return true;
|
return true;
|
||||||
@ -4148,7 +4146,6 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
|||||||
case aaload:
|
case aaload:
|
||||||
frame->pushObject(
|
frame->pushObject(
|
||||||
c->load(ir::SignExtend,
|
c->load(ir::SignExtend,
|
||||||
types.object,
|
|
||||||
c->memory(array, types.object, TargetArrayBody, index),
|
c->memory(array, types.object, TargetArrayBody, index),
|
||||||
types.object));
|
types.object));
|
||||||
break;
|
break;
|
||||||
@ -4156,7 +4153,6 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
|||||||
case faload:
|
case faload:
|
||||||
frame->pushFloat(
|
frame->pushFloat(
|
||||||
c->load(ir::SignExtend,
|
c->load(ir::SignExtend,
|
||||||
types.f4,
|
|
||||||
c->memory(array, types.f4, TargetArrayBody, index),
|
c->memory(array, types.f4, TargetArrayBody, index),
|
||||||
types.f4));
|
types.f4));
|
||||||
break;
|
break;
|
||||||
@ -4164,7 +4160,6 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
|||||||
case iaload:
|
case iaload:
|
||||||
frame->pushInt(
|
frame->pushInt(
|
||||||
c->load(ir::SignExtend,
|
c->load(ir::SignExtend,
|
||||||
types.i4,
|
|
||||||
c->memory(array, types.i4, TargetArrayBody, index),
|
c->memory(array, types.i4, TargetArrayBody, index),
|
||||||
types.i4));
|
types.i4));
|
||||||
break;
|
break;
|
||||||
@ -4172,7 +4167,6 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
|||||||
case baload:
|
case baload:
|
||||||
frame->pushInt(
|
frame->pushInt(
|
||||||
c->load(ir::SignExtend,
|
c->load(ir::SignExtend,
|
||||||
types.i1,
|
|
||||||
c->memory(array, types.i1, TargetArrayBody, index),
|
c->memory(array, types.i1, TargetArrayBody, index),
|
||||||
types.i4));
|
types.i4));
|
||||||
break;
|
break;
|
||||||
@ -4180,7 +4174,6 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
|||||||
case caload:
|
case caload:
|
||||||
frame->pushInt(
|
frame->pushInt(
|
||||||
c->load(ir::ZeroExtend,
|
c->load(ir::ZeroExtend,
|
||||||
types.i2,
|
|
||||||
c->memory(array, types.i2, TargetArrayBody, index),
|
c->memory(array, types.i2, TargetArrayBody, index),
|
||||||
types.i4));
|
types.i4));
|
||||||
break;
|
break;
|
||||||
@ -4188,7 +4181,6 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
|||||||
case daload:
|
case daload:
|
||||||
frame->pushDouble(
|
frame->pushDouble(
|
||||||
c->load(ir::SignExtend,
|
c->load(ir::SignExtend,
|
||||||
types.f8,
|
|
||||||
c->memory(array, types.f8, TargetArrayBody, index),
|
c->memory(array, types.f8, TargetArrayBody, index),
|
||||||
types.f8));
|
types.f8));
|
||||||
break;
|
break;
|
||||||
@ -4196,7 +4188,6 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
|||||||
case laload:
|
case laload:
|
||||||
frame->pushLong(
|
frame->pushLong(
|
||||||
c->load(ir::SignExtend,
|
c->load(ir::SignExtend,
|
||||||
types.i8,
|
|
||||||
c->memory(array, types.i8, TargetArrayBody, index),
|
c->memory(array, types.i8, TargetArrayBody, index),
|
||||||
types.i8));
|
types.i8));
|
||||||
break;
|
break;
|
||||||
@ -4204,7 +4195,6 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
|||||||
case saload:
|
case saload:
|
||||||
frame->pushInt(
|
frame->pushInt(
|
||||||
c->load(ir::SignExtend,
|
c->load(ir::SignExtend,
|
||||||
types.i2,
|
|
||||||
c->memory(array, types.i2, TargetArrayBody, index),
|
c->memory(array, types.i2, TargetArrayBody, index),
|
||||||
types.i4));
|
types.i4));
|
||||||
break;
|
break;
|
||||||
@ -4363,7 +4353,6 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
|||||||
case arraylength: {
|
case arraylength: {
|
||||||
frame->pushInt(c->load(
|
frame->pushInt(c->load(
|
||||||
ir::SignExtend,
|
ir::SignExtend,
|
||||||
types.address,
|
|
||||||
c->memory(frame->popObject(), types.address, TargetArrayLength),
|
c->memory(frame->popObject(), types.address, TargetArrayLength),
|
||||||
types.i4));
|
types.i4));
|
||||||
} break;
|
} break;
|
||||||
@ -4678,7 +4667,6 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
|||||||
case BooleanField:
|
case BooleanField:
|
||||||
frame->pushInt(c->load(
|
frame->pushInt(c->load(
|
||||||
ir::SignExtend,
|
ir::SignExtend,
|
||||||
types.i1,
|
|
||||||
c->memory(table, types.i1, targetFieldOffset(context, field)),
|
c->memory(table, types.i1, targetFieldOffset(context, field)),
|
||||||
types.i4));
|
types.i4));
|
||||||
break;
|
break;
|
||||||
@ -4686,7 +4674,6 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
|||||||
case CharField:
|
case CharField:
|
||||||
frame->pushInt(c->load(
|
frame->pushInt(c->load(
|
||||||
ir::ZeroExtend,
|
ir::ZeroExtend,
|
||||||
types.i2,
|
|
||||||
c->memory(table, types.i2, targetFieldOffset(context, field)),
|
c->memory(table, types.i2, targetFieldOffset(context, field)),
|
||||||
types.i4));
|
types.i4));
|
||||||
break;
|
break;
|
||||||
@ -4694,7 +4681,6 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
|||||||
case ShortField:
|
case ShortField:
|
||||||
frame->pushInt(c->load(
|
frame->pushInt(c->load(
|
||||||
ir::SignExtend,
|
ir::SignExtend,
|
||||||
types.i2,
|
|
||||||
c->memory(table, types.i2, targetFieldOffset(context, field)),
|
c->memory(table, types.i2, targetFieldOffset(context, field)),
|
||||||
types.i4));
|
types.i4));
|
||||||
break;
|
break;
|
||||||
@ -4702,7 +4688,6 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
|||||||
case FloatField:
|
case FloatField:
|
||||||
frame->pushFloat(c->load(
|
frame->pushFloat(c->load(
|
||||||
ir::SignExtend,
|
ir::SignExtend,
|
||||||
types.f4,
|
|
||||||
c->memory(table, types.f4, targetFieldOffset(context, field)),
|
c->memory(table, types.f4, targetFieldOffset(context, field)),
|
||||||
types.f4));
|
types.f4));
|
||||||
break;
|
break;
|
||||||
@ -4710,7 +4695,6 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
|||||||
case IntField:
|
case IntField:
|
||||||
frame->pushInt(c->load(
|
frame->pushInt(c->load(
|
||||||
ir::SignExtend,
|
ir::SignExtend,
|
||||||
types.i4,
|
|
||||||
c->memory(table, types.i4, targetFieldOffset(context, field)),
|
c->memory(table, types.i4, targetFieldOffset(context, field)),
|
||||||
types.i4));
|
types.i4));
|
||||||
break;
|
break;
|
||||||
@ -4718,7 +4702,6 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
|||||||
case DoubleField:
|
case DoubleField:
|
||||||
frame->pushDouble(c->load(
|
frame->pushDouble(c->load(
|
||||||
ir::SignExtend,
|
ir::SignExtend,
|
||||||
types.f8,
|
|
||||||
c->memory(table, types.f8, targetFieldOffset(context, field)),
|
c->memory(table, types.f8, targetFieldOffset(context, field)),
|
||||||
types.f8));
|
types.f8));
|
||||||
break;
|
break;
|
||||||
@ -4726,7 +4709,6 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
|||||||
case LongField:
|
case LongField:
|
||||||
frame->pushLong(c->load(
|
frame->pushLong(c->load(
|
||||||
ir::SignExtend,
|
ir::SignExtend,
|
||||||
types.i8,
|
|
||||||
c->memory(table, types.i8, targetFieldOffset(context, field)),
|
c->memory(table, types.i8, targetFieldOffset(context, field)),
|
||||||
types.i8));
|
types.i8));
|
||||||
break;
|
break;
|
||||||
@ -4734,7 +4716,6 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
|||||||
case ObjectField:
|
case ObjectField:
|
||||||
frame->pushObject(c->load(
|
frame->pushObject(c->load(
|
||||||
ir::SignExtend,
|
ir::SignExtend,
|
||||||
types.object,
|
|
||||||
c->memory(table, types.object, targetFieldOffset(context, field)),
|
c->memory(table, types.object, targetFieldOffset(context, field)),
|
||||||
types.object));
|
types.object));
|
||||||
break;
|
break;
|
||||||
@ -6233,7 +6214,6 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
|||||||
normalizedKey);
|
normalizedKey);
|
||||||
|
|
||||||
c->jmp(c->load(ir::SignExtend,
|
c->jmp(c->load(ir::SignExtend,
|
||||||
types.address,
|
|
||||||
context->bootContext
|
context->bootContext
|
||||||
? c->binaryOp(lir::Add,
|
? c->binaryOp(lir::Add,
|
||||||
types.address,
|
types.address,
|
||||||
|
Loading…
Reference in New Issue
Block a user