fix some return type & intrinsic typing

This commit is contained in:
Joshua Warner 2014-05-02 08:42:41 -06:00
parent cb7f570f20
commit 7b0d577430
2 changed files with 14 additions and 19 deletions

View File

@ -2667,16 +2667,17 @@ class MyCompiler: public Compiler {
ir::Value* src,
ir::Type dstType)
{
assert(&c, dstType.size() >= TargetBytesPerWord);
assert(&c, srcType.flavor() == dstType.flavor());
assert(&c, src->type.flavor() == dstType.flavor());
Value* dst = value(&c, src->type);
Value* dst = value(&c, dstType);
appendMove(&c,
signExtend == ir::SignExtend ? lir::Move : lir::MoveZ,
srcType.size(),
srcType.size(),
static_cast<Value*>(src),
dstType.size(),
dstType.size() < TargetBytesPerWord ? TargetBytesPerWord
: dstType.size(),
dst);
return dst;
}

View File

@ -1367,10 +1367,10 @@ ir::Type operandTypeForFieldCode(Thread* t, unsigned code)
switch (code) {
case ByteField:
case BooleanField:
return types.i1;
return types.i4;
case CharField:
case ShortField:
return types.i2;
return types.i4;
case IntField:
return types.i4;
case LongField:
@ -3889,13 +3889,10 @@ intrinsic(MyThread* t, Frame* frame, object target)
{
ir::Value* address = popLongAddress(frame);
frame->popObject();
ir::Type type = MATCH(methodName(t, target), "getInt") ? types.i4
: types.f4;
frame->pushSmall(
c->load(ir::SignExtend,
types.i4,
c->memory(address,
MATCH(methodName(t, target), "getInt") ? types.i4
: types.f4),
types.address));
c->load(ir::SignExtend, type, c->memory(address, type), type));
return true;
} else if ((MATCH(methodName(t, target), "putInt")
and MATCH(methodSpec(t, target), "(JI)V"))
@ -3916,13 +3913,10 @@ intrinsic(MyThread* t, Frame* frame, object target)
{
ir::Value* address = popLongAddress(frame);
frame->popObject();
ir::Type type = MATCH(methodName(t, target), "getLong") ? types.i8
: types.f8;
frame->pushLarge(
c->load(ir::SignExtend,
types.i8,
c->memory(address,
MATCH(methodName(t, target), "getLong") ? types.i8
: types.f8),
types.i8));
c->load(ir::SignExtend, type, c->memory(address, type), type));
return true;
} else if ((MATCH(methodName(t, target), "putLong")
and MATCH(methodSpec(t, target), "(JJ)V"))
@ -4414,7 +4408,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
c->load(ir::SignExtend,
types.address,
c->memory(frame->popObject(), types.i4, TargetArrayLength),
types.address));
types.i4));
} break;
case astore:
@ -4753,7 +4747,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
ir::SignExtend,
types.f4,
c->memory(table, types.f4, targetFieldOffset(context, field)),
types.f8));
types.f4));
break;
case IntField: