mirror of
https://github.com/corda/corda.git
synced 2025-05-06 10:38:29 +00:00
freeze move operand sites prior to calling the assembler so the assembler won't steal them
This commit is contained in:
parent
21fa23d84b
commit
ee2d105f6c
@ -1698,6 +1698,8 @@ move(Context* c, Value* value, Site* src, Site* dst)
|
|||||||
Site* tmp = freeRegisterSite(c);
|
Site* tmp = freeRegisterSite(c);
|
||||||
addSite(c, value, tmp);
|
addSite(c, value, tmp);
|
||||||
|
|
||||||
|
tmp->freeze(c, value);
|
||||||
|
|
||||||
if (DebugMoves) {
|
if (DebugMoves) {
|
||||||
char srcb[256]; src->toString(c, srcb, 256);
|
char srcb[256]; src->toString(c, srcb, 256);
|
||||||
char tmpb[256]; tmp->toString(c, tmpb, 256);
|
char tmpb[256]; tmp->toString(c, tmpb, 256);
|
||||||
@ -1706,6 +1708,7 @@ move(Context* c, Value* value, Site* src, Site* dst)
|
|||||||
|
|
||||||
apply(c, Move, BytesPerWord, src, 0, BytesPerWord, tmp, 0);
|
apply(c, Move, BytesPerWord, src, 0, BytesPerWord, tmp, 0);
|
||||||
|
|
||||||
|
tmp->thaw(c, value);
|
||||||
dst->thaw(c, value);
|
dst->thaw(c, value);
|
||||||
src->thaw(c, value);
|
src->thaw(c, value);
|
||||||
|
|
||||||
@ -1719,9 +1722,11 @@ move(Context* c, Value* value, Site* src, Site* dst)
|
|||||||
}
|
}
|
||||||
|
|
||||||
src->freeze(c, value);
|
src->freeze(c, value);
|
||||||
|
dst->freeze(c, value);
|
||||||
|
|
||||||
apply(c, Move, BytesPerWord, src, 0, BytesPerWord, dst, 0);
|
apply(c, Move, BytesPerWord, src, 0, BytesPerWord, dst, 0);
|
||||||
|
|
||||||
|
dst->thaw(c, value);
|
||||||
src->thaw(c, value);
|
src->thaw(c, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2469,6 +2474,8 @@ maybeMove(Context* c, BinaryOperation type, unsigned srcSize,
|
|||||||
+= (srcSize - srcSelectSize);
|
+= (srcSize - srcSelectSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
target->freeze(c, dst);
|
||||||
|
|
||||||
if (target->match(c, dstMask) and not useTemporary) {
|
if (target->match(c, dstMask) and not useTemporary) {
|
||||||
if (DebugMoves) {
|
if (DebugMoves) {
|
||||||
char srcb[256]; src->source->toString(c, srcb, 256);
|
char srcb[256]; src->source->toString(c, srcb, 256);
|
||||||
@ -2483,8 +2490,6 @@ maybeMove(Context* c, BinaryOperation type, unsigned srcSize,
|
|||||||
|
|
||||||
src->source->thaw(c, src);
|
src->source->thaw(c, src);
|
||||||
} else {
|
} else {
|
||||||
target->freeze(c, dst);
|
|
||||||
|
|
||||||
// pick a temporary register which is valid as both a
|
// pick a temporary register which is valid as both a
|
||||||
// destination and a source for the moves we need to perform:
|
// destination and a source for the moves we need to perform:
|
||||||
|
|
||||||
@ -2507,6 +2512,8 @@ maybeMove(Context* c, BinaryOperation type, unsigned srcSize,
|
|||||||
|
|
||||||
addSite(c, dst, tmpTarget);
|
addSite(c, dst, tmpTarget);
|
||||||
|
|
||||||
|
tmpTarget->freeze(c, dst);
|
||||||
|
|
||||||
if (DebugMoves) {
|
if (DebugMoves) {
|
||||||
char srcb[256]; src->source->toString(c, srcb, 256);
|
char srcb[256]; src->source->toString(c, srcb, 256);
|
||||||
char dstb[256]; tmpTarget->toString(c, dstb, 256);
|
char dstb[256]; tmpTarget->toString(c, dstb, 256);
|
||||||
@ -2516,6 +2523,8 @@ maybeMove(Context* c, BinaryOperation type, unsigned srcSize,
|
|||||||
|
|
||||||
apply(c, type, srcSelectSize, src->source, 0, dstSize, tmpTarget, 0);
|
apply(c, type, srcSelectSize, src->source, 0, dstSize, tmpTarget, 0);
|
||||||
|
|
||||||
|
tmpTarget->thaw(c, dst);
|
||||||
|
|
||||||
src->source->thaw(c, src);
|
src->source->thaw(c, src);
|
||||||
|
|
||||||
if (useTemporary or isStore) {
|
if (useTemporary or isStore) {
|
||||||
@ -2538,9 +2547,9 @@ maybeMove(Context* c, BinaryOperation type, unsigned srcSize,
|
|||||||
} else {
|
} else {
|
||||||
removeSite(c, dst, target);
|
removeSite(c, dst, target);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
target->thaw(c, dst);
|
target->thaw(c, dst);
|
||||||
}
|
|
||||||
|
|
||||||
if (addOffset) {
|
if (addOffset) {
|
||||||
static_cast<MemorySite*>(src->source)->offset
|
static_cast<MemorySite*>(src->source)->offset
|
||||||
@ -2653,6 +2662,8 @@ class MoveEvent: public Event {
|
|||||||
|
|
||||||
addSite(c, dst, low);
|
addSite(c, dst, low);
|
||||||
|
|
||||||
|
low->freeze(c, dst);
|
||||||
|
|
||||||
if (DebugMoves) {
|
if (DebugMoves) {
|
||||||
char srcb[256]; src->source->toString(c, srcb, 256);
|
char srcb[256]; src->source->toString(c, srcb, 256);
|
||||||
char dstb[256]; low->toString(c, dstb, 256);
|
char dstb[256]; low->toString(c, dstb, 256);
|
||||||
@ -2662,6 +2673,8 @@ class MoveEvent: public Event {
|
|||||||
|
|
||||||
apply(c, Move, BytesPerWord, src->source, 0, BytesPerWord, low, 0);
|
apply(c, Move, BytesPerWord, src->source, 0, BytesPerWord, low, 0);
|
||||||
|
|
||||||
|
low->thaw(c, dst);
|
||||||
|
|
||||||
src->source->thaw(c, src);
|
src->source->thaw(c, src);
|
||||||
|
|
||||||
assert(c, dstHighMask.typeMask & (1 << RegisterOperand));
|
assert(c, dstHighMask.typeMask & (1 << RegisterOperand));
|
||||||
@ -2672,6 +2685,8 @@ class MoveEvent: public Event {
|
|||||||
|
|
||||||
addSite(c, dst->high, high);
|
addSite(c, dst->high, high);
|
||||||
|
|
||||||
|
high->freeze(c, dst->high);
|
||||||
|
|
||||||
if (DebugMoves) {
|
if (DebugMoves) {
|
||||||
char srcb[256]; low->toString(c, srcb, 256);
|
char srcb[256]; low->toString(c, srcb, 256);
|
||||||
char dstb[256]; high->toString(c, dstb, 256);
|
char dstb[256]; high->toString(c, dstb, 256);
|
||||||
@ -2681,6 +2696,8 @@ class MoveEvent: public Event {
|
|||||||
|
|
||||||
apply(c, Move, BytesPerWord, low, 0, dstSize, low, high);
|
apply(c, Move, BytesPerWord, low, 0, dstSize, low, high);
|
||||||
|
|
||||||
|
high->thaw(c, dst->high);
|
||||||
|
|
||||||
low->thaw(c, dst);
|
low->thaw(c, dst);
|
||||||
} else {
|
} else {
|
||||||
maybeMove(c, Move, BytesPerWord, BytesPerWord, src, BytesPerWord, dst,
|
maybeMove(c, Move, BytesPerWord, BytesPerWord, src, BytesPerWord, dst,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user