mirror of
https://github.com/corda/corda.git
synced 2025-01-09 06:23:04 +00:00
only set target equal to src->source in MoveEvent.compile if it is a simple load or store
This commit is contained in:
parent
ad6153612b
commit
08a1921eb7
@ -1500,6 +1500,9 @@ class MoveEvent: public Event {
|
|||||||
fprintf(stderr, "MoveEvent.compile\n");
|
fprintf(stderr, "MoveEvent.compile\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool isLoad = src->reads->next == 0;
|
||||||
|
bool isStore = dst->reads == 0;
|
||||||
|
|
||||||
Site* target;
|
Site* target;
|
||||||
unsigned cost;
|
unsigned cost;
|
||||||
if (type == Move
|
if (type == Move
|
||||||
@ -1512,7 +1515,7 @@ class MoveEvent: public Event {
|
|||||||
} else {
|
} else {
|
||||||
target = targetOrRegister(c, dst);
|
target = targetOrRegister(c, dst);
|
||||||
cost = src->source->copyCost(c, target);
|
cost = src->source->copyCost(c, target);
|
||||||
if (cost == 0) {
|
if (cost == 0 and (isLoad or isStore)) {
|
||||||
target = src->source;
|
target = src->source;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1521,9 +1524,7 @@ class MoveEvent: public Event {
|
|||||||
nextRead(c, src);
|
nextRead(c, src);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isStore = dst->reads == 0;
|
assert(c, isLoad or isStore or target != src->source);
|
||||||
|
|
||||||
assert(c, isStore or target != src->source or src->reads == 0);
|
|
||||||
|
|
||||||
if (not isStore) {
|
if (not isStore) {
|
||||||
addSite(c, stack, size, dst, target);
|
addSite(c, stack, size, dst, target);
|
||||||
|
Loading…
Reference in New Issue
Block a user