mirror of
https://github.com/corda/corda.git
synced 2025-01-22 12:28:11 +00:00
don't skip move when MoveEvent is followed by a PushEvent which is not active; use existing register site in ValueSite when possible
This commit is contained in:
parent
7791b1df80
commit
c96f44d77d
@ -3875,11 +3875,11 @@ finish(MyThread* t, Context* context)
|
||||
strcmp
|
||||
(reinterpret_cast<const char*>
|
||||
(&byteArrayBody(t, className(t, methodClass(t, context->method)), 0)),
|
||||
"java/lang/Class") == 0 and
|
||||
"java/lang/Number") == 0 and
|
||||
strcmp
|
||||
(reinterpret_cast<const char*>
|
||||
(&byteArrayBody(t, methodName(t, context->method), 0)),
|
||||
"replace") == 0)
|
||||
"<init>") == 0)
|
||||
{
|
||||
asm("int3");
|
||||
}
|
||||
|
@ -332,7 +332,7 @@ class Event {
|
||||
|
||||
virtual void compile(Context* c) = 0;
|
||||
|
||||
virtual bool isBranch() { return false; };
|
||||
virtual bool skipMove(unsigned) { return false; }
|
||||
|
||||
Event* next;
|
||||
Stack* stack;
|
||||
@ -682,6 +682,11 @@ class ValueSite: public AbstractSite {
|
||||
if (s and s->type(c) == RegisterOperand) {
|
||||
return s;
|
||||
} else {
|
||||
for (Site* s = r->value->sites; s; s = s->next) {
|
||||
if (s->type(c) == RegisterOperand) {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
return freeRegister(c, r->size, true);
|
||||
}
|
||||
}
|
||||
@ -988,6 +993,10 @@ class PushEvent: public Event {
|
||||
nextRead(c, s->value);
|
||||
}
|
||||
|
||||
virtual bool skipMove(unsigned size) {
|
||||
return active and size >= 4;
|
||||
}
|
||||
|
||||
Stack* s;
|
||||
bool active;
|
||||
};
|
||||
@ -1182,9 +1191,9 @@ class MoveEvent: public Event {
|
||||
Site* target;
|
||||
unsigned cost;
|
||||
if (type == Move
|
||||
and size >= BytesPerWord
|
||||
and dst->reads
|
||||
and next == dst->reads->event)
|
||||
and next == dst->reads->event
|
||||
and dst->reads->event->skipMove(size))
|
||||
{
|
||||
target = src->source;
|
||||
cost = 0;
|
||||
@ -1575,8 +1584,6 @@ class BranchEvent: public Event {
|
||||
nextRead(c, address);
|
||||
}
|
||||
|
||||
virtual bool isBranch() { return true; };
|
||||
|
||||
UnaryOperation type;
|
||||
Value* address;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user