add type assert in load, fix ensuing problems

This commit is contained in:
Joshua Warner 2014-05-03 19:49:56 -06:00 committed by Joshua Warner
parent 6fdd5d13ca
commit 69966f1d36
2 changed files with 9 additions and 8 deletions

View File

@ -2613,6 +2613,7 @@ class MyCompiler: public Compiler {
{
assert(&c, srcType.flavor() == dstType.flavor());
assert(&c, src->type.flavor() == dstType.flavor());
assert(&c, src->type == srcType);
Value* dst = value(&c, dstType);
appendMove(&c,

View File

@ -4361,11 +4361,11 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
} goto next;
case arraylength: {
frame->pushInt(
c->load(ir::SignExtend,
types.address,
c->memory(frame->popObject(), types.i4, TargetArrayLength),
types.i4));
frame->pushInt(c->load(
ir::SignExtend,
types.address,
c->memory(frame->popObject(), types.address, TargetArrayLength),
types.i4));
} break;
case astore:
@ -4679,7 +4679,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
frame->pushInt(c->load(
ir::SignExtend,
types.i1,
c->memory(table, types.i4, targetFieldOffset(context, field)),
c->memory(table, types.i1, targetFieldOffset(context, field)),
types.i4));
break;
@ -4687,7 +4687,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
frame->pushInt(c->load(
ir::ZeroExtend,
types.i2,
c->memory(table, types.i4, targetFieldOffset(context, field)),
c->memory(table, types.i2, targetFieldOffset(context, field)),
types.i4));
break;
@ -4695,7 +4695,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
frame->pushInt(c->load(
ir::SignExtend,
types.i2,
c->memory(table, types.i4, targetFieldOffset(context, field)),
c->memory(table, types.i2, targetFieldOffset(context, field)),
types.i4));
break;