mirror of
https://github.com/corda/corda.git
synced 2025-03-17 17:45:17 +00:00
fix sizing of some stack ints
This commit is contained in:
parent
d62d083733
commit
43eb49cf53
@ -114,6 +114,9 @@ class Compiler {
|
||||
ir::Type truncateType,
|
||||
ir::Value* src) = 0;
|
||||
|
||||
virtual ir::Value* truncate(ir::Type type, ir::Type srcType, ir::Value* src)
|
||||
= 0;
|
||||
|
||||
virtual void store(ir::Type srcType, ir::Value* src, ir::Value* dst) = 0;
|
||||
virtual ir::Value* load(ir::SignExtendMode signExtend,
|
||||
ir::Type srcType,
|
||||
|
@ -2515,12 +2515,12 @@ class MyCompiler: public Compiler {
|
||||
return result;
|
||||
}
|
||||
|
||||
virtual void return_(ir::Type type, ir::Value* value)
|
||||
virtual void return_(ir::Type type, ir::Value* a)
|
||||
{
|
||||
// TODO: once type information is flowed properly, enable this assert.
|
||||
// Some time later, we can remove the parameter.
|
||||
// assert(&c, static_cast<Value*>(value)->type == type);
|
||||
appendReturn(&c, type.size(), static_cast<Value*>(value));
|
||||
// assert(&c, a->type == type);
|
||||
appendReturn(&c, type.size(), static_cast<Value*>(a));
|
||||
}
|
||||
|
||||
virtual void return_()
|
||||
@ -2614,6 +2614,19 @@ class MyCompiler: public Compiler {
|
||||
static_cast<Value*>(index), handler);
|
||||
}
|
||||
|
||||
virtual ir::Value* truncate(ir::Type type, ir::Type srcType, ir::Value* src)
|
||||
{
|
||||
Value* dst = value(&c, type);
|
||||
appendMove(&c,
|
||||
lir::Move,
|
||||
srcType.size(),
|
||||
srcType.size(),
|
||||
static_cast<Value*>(src),
|
||||
type.size(),
|
||||
dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
virtual ir::Value* truncateThenExtend(ir::SignExtendMode signExtend,
|
||||
ir::Type extendType,
|
||||
ir::Type truncateType,
|
||||
|
@ -1760,6 +1760,7 @@ class Frame {
|
||||
|
||||
void pushLongQuiet(ir::Value* o)
|
||||
{
|
||||
// assert(t, o->type == types.i8);
|
||||
pushQuiet(types.i8, o);
|
||||
}
|
||||
|
||||
@ -4357,7 +4358,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
||||
|
||||
case areturn: {
|
||||
handleExit(t, frame);
|
||||
c->return_(types.address, frame->popObject());
|
||||
c->return_(types.object, frame->popObject());
|
||||
} goto next;
|
||||
|
||||
case arraylength: {
|
||||
@ -5329,8 +5330,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
||||
} break;
|
||||
|
||||
case l2i:
|
||||
frame->pushInt(
|
||||
c->load(ir::SignExtend, types.i8, frame->popLong(), types.address));
|
||||
frame->pushInt(c->truncate(types.i4, types.i8, frame->popLong()));
|
||||
break;
|
||||
|
||||
case ladd:
|
||||
@ -5366,11 +5366,11 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
||||
} break;
|
||||
|
||||
case lconst_0:
|
||||
frame->pushLong(c->constant(0, types.i4));
|
||||
frame->pushLong(c->constant(0, types.i8));
|
||||
break;
|
||||
|
||||
case lconst_1:
|
||||
frame->pushLong(c->constant(1, types.i4));
|
||||
frame->pushLong(c->constant(1, types.i8));
|
||||
break;
|
||||
|
||||
case ldc:
|
||||
@ -5388,7 +5388,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
||||
if (singletonIsObject(t, pool, index - 1)) {
|
||||
object v = singletonObject(t, pool, index - 1);
|
||||
|
||||
loadMemoryBarrier();
|
||||
loadMemoryBarrier();
|
||||
|
||||
if (objectClass(t, v) == type(t, Machine::ReferenceType)) {
|
||||
object reference = v;
|
||||
@ -5809,7 +5809,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
||||
case ByteField:
|
||||
case BooleanField:
|
||||
c->store(
|
||||
types.address,
|
||||
types.i4,
|
||||
value,
|
||||
c->memory(table, types.i1, targetFieldOffset(context, field)));
|
||||
break;
|
||||
@ -5817,7 +5817,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
||||
case CharField:
|
||||
case ShortField:
|
||||
c->store(
|
||||
types.address,
|
||||
types.i4,
|
||||
value,
|
||||
c->memory(table, types.i2, targetFieldOffset(context, field)));
|
||||
break;
|
||||
@ -5831,7 +5831,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
||||
|
||||
case IntField:
|
||||
c->store(
|
||||
types.address,
|
||||
types.i4,
|
||||
value,
|
||||
c->memory(table, types.i4, targetFieldOffset(context, field)));
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user