mirror of
https://github.com/corda/corda.git
synced 2025-06-16 06:08:13 +00:00
use ir::Type in Compiler::save
This commit is contained in:
committed by
Joshua Warner
parent
75f0812f7a
commit
13342d28be
@ -83,7 +83,7 @@ class Compiler {
|
|||||||
virtual Operand* register_(int number) = 0;
|
virtual Operand* register_(int number) = 0;
|
||||||
|
|
||||||
virtual void push(ir::Type type, Operand* value) = 0;
|
virtual void push(ir::Type type, Operand* value) = 0;
|
||||||
virtual void save(unsigned footprint, Operand* value) = 0;
|
virtual void save(ir::Type type, Operand* value) = 0;
|
||||||
virtual Operand* pop(unsigned footprint) = 0;
|
virtual Operand* pop(unsigned footprint) = 0;
|
||||||
virtual void pushed() = 0;
|
virtual void pushed() = 0;
|
||||||
virtual void popped(unsigned footprint) = 0;
|
virtual void popped(unsigned footprint) = 0;
|
||||||
|
@ -2347,13 +2347,19 @@ class MyCompiler: public Compiler {
|
|||||||
compiler::push(&c, typeFootprint(&c, type), static_cast<Value*>(value));
|
compiler::push(&c, typeFootprint(&c, type), static_cast<Value*>(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void save(unsigned footprint, Operand* value) {
|
virtual void save(ir::Type type, Operand* value)
|
||||||
|
{
|
||||||
|
// 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);
|
||||||
|
unsigned footprint = typeFootprint(&c, type);
|
||||||
c.saved = cons(&c, static_cast<Value*>(value), c.saved);
|
c.saved = cons(&c, static_cast<Value*>(value), c.saved);
|
||||||
if (TargetBytesPerWord == 4 and footprint > 1) {
|
if (TargetBytesPerWord == 4 and footprint > 1) {
|
||||||
assert(&c, footprint == 2);
|
assert(&c, footprint == 2);
|
||||||
assert(&c, static_cast<Value*>(value)->nextWord);
|
assert(&c, static_cast<Value*>(value)->nextWord);
|
||||||
|
|
||||||
save(1, static_cast<Value*>(value)->nextWord);
|
save(ir::Type(ir::Type::Integer, 4),
|
||||||
|
static_cast<Value*>(value)->nextWord);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5950,7 +5950,7 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
|||||||
c->condJump(lir::JumpIfLess, 4, c->constant(bottom, Compiler::IntegerType), key,
|
c->condJump(lir::JumpIfLess, 4, c->constant(bottom, Compiler::IntegerType), key,
|
||||||
frame->machineIp(defaultIp));
|
frame->machineIp(defaultIp));
|
||||||
|
|
||||||
c->save(1, key);
|
c->save(types.i4, key);
|
||||||
|
|
||||||
new (stack.push(sizeof(SwitchState))) SwitchState
|
new (stack.push(sizeof(SwitchState))) SwitchState
|
||||||
(c->saveState(), count, defaultIp, key, start, bottom, top);
|
(c->saveState(), count, defaultIp, key, start, bottom, top);
|
||||||
@ -6036,8 +6036,8 @@ compile(MyThread* t, Frame* initialFrame, unsigned initialIp,
|
|||||||
|
|
||||||
c->condJump(lir::JumpIfGreater, 4, c->constant(s->top, Compiler::IntegerType), s->key,
|
c->condJump(lir::JumpIfGreater, 4, c->constant(s->top, Compiler::IntegerType), s->key,
|
||||||
frame->machineIp(s->defaultIp));
|
frame->machineIp(s->defaultIp));
|
||||||
|
|
||||||
c->save(1, s->key);
|
c->save(types.i4, s->key);
|
||||||
ip = s->defaultIp;
|
ip = s->defaultIp;
|
||||||
stack.pushValue(Untable1);
|
stack.pushValue(Untable1);
|
||||||
} goto start;
|
} goto start;
|
||||||
|
Reference in New Issue
Block a user