mirror of
https://github.com/corda/corda.git
synced 2025-01-07 13:38:47 +00:00
support absolute operands on virtual stack and absolute to memory movs
This commit is contained in:
parent
740e86a084
commit
33b2a4a1e8
@ -262,6 +262,8 @@ class AbsoluteOperand: public MyOperand {
|
||||
value(value)
|
||||
{ }
|
||||
|
||||
virtual StackOperand* logicalPush(Context* c);
|
||||
|
||||
virtual void apply(Context* c, Operation operation);
|
||||
|
||||
virtual void apply(Context* c, Operation operation, MyOperand* operand) {
|
||||
@ -295,6 +297,7 @@ class MemoryOperand: public MyOperand {
|
||||
|
||||
virtual void accept(Context*, Operation, RegisterOperand*);
|
||||
virtual void accept(Context*, Operation, ImmediateOperand*);
|
||||
virtual void accept(Context*, Operation, AbsoluteOperand*);
|
||||
|
||||
MyOperand* base;
|
||||
int displacement;
|
||||
@ -851,6 +854,13 @@ ImmediateOperand::apply(Context* c, Operation operation)
|
||||
}
|
||||
}
|
||||
|
||||
StackOperand*
|
||||
AbsoluteOperand::logicalPush(Context* c)
|
||||
{
|
||||
return c->stack = new (c->zone.allocate(sizeof(StackOperand)))
|
||||
StackOperand(this, c->stack);
|
||||
}
|
||||
|
||||
void
|
||||
AbsoluteOperand::apply(Context* c, Operation operation)
|
||||
{
|
||||
@ -914,6 +924,24 @@ MemoryOperand::accept(Context* c, Operation operation,
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MemoryOperand::accept(Context* c, Operation operation,
|
||||
AbsoluteOperand* operand)
|
||||
{
|
||||
switch (operation) {
|
||||
case mov: {
|
||||
RegisterOperand* tmp = temporary(c, true);
|
||||
|
||||
tmp->accept(c, mov, operand);
|
||||
accept(c, mov, tmp);
|
||||
|
||||
tmp->release(c);
|
||||
} break;
|
||||
|
||||
default: abort(c);
|
||||
}
|
||||
}
|
||||
|
||||
unsigned
|
||||
PoolPromise::value(Context* c)
|
||||
{
|
||||
|
@ -24,7 +24,7 @@ public class Misc {
|
||||
int c = a + b;
|
||||
|
||||
Misc m = new Misc();
|
||||
// String s = "hello";
|
||||
String s = "hello";
|
||||
// m.foo(s);
|
||||
// m.bar(s);
|
||||
// baz(s);
|
||||
|
Loading…
Reference in New Issue
Block a user