mirror of
https://github.com/corda/corda.git
synced 2025-06-06 09:21:47 +00:00
freeze target site when using temporary in maybeMove
This commit is contained in:
parent
4ca45ffa41
commit
29616c4abc
@ -2417,13 +2417,13 @@ maybeMove(Context* c, BinaryOperation type, unsigned srcSize, Value* src,
|
|||||||
if (srcSize != dstSize) cost = 1;
|
if (srcSize != dstSize) cost = 1;
|
||||||
|
|
||||||
if (cost) {
|
if (cost) {
|
||||||
addSite(c, dst, target);
|
|
||||||
|
|
||||||
bool useTemporary = ((target->type(c) == MemoryOperand
|
bool useTemporary = ((target->type(c) == MemoryOperand
|
||||||
and src->source->type(c) == MemoryOperand)
|
and src->source->type(c) == MemoryOperand)
|
||||||
or (srcSize != dstSize
|
or (srcSize != dstSize
|
||||||
and target->type(c) != RegisterOperand));
|
and target->type(c) != RegisterOperand));
|
||||||
|
|
||||||
|
addSite(c, dst, target);
|
||||||
|
|
||||||
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);
|
||||||
@ -2434,6 +2434,8 @@ maybeMove(Context* c, BinaryOperation type, unsigned srcSize, Value* src,
|
|||||||
|
|
||||||
apply(c, type, srcSize, src->source, 0, dstSize, target, 0);
|
apply(c, type, srcSize, src->source, 0, dstSize, target, 0);
|
||||||
} else {
|
} else {
|
||||||
|
target->freeze(c, dst);
|
||||||
|
|
||||||
assert(c, dstMask.typeMask & (1 << RegisterOperand));
|
assert(c, dstMask.typeMask & (1 << RegisterOperand));
|
||||||
|
|
||||||
Site* tmpTarget = freeRegisterSite(c, dstMask.registerMask);
|
Site* tmpTarget = freeRegisterSite(c, dstMask.registerMask);
|
||||||
@ -2465,6 +2467,8 @@ maybeMove(Context* c, BinaryOperation type, unsigned srcSize, Value* src,
|
|||||||
} else {
|
} else {
|
||||||
removeSite(c, dst, target);
|
removeSite(c, dst, target);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
target->thaw(c, dst);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
target = src->source;
|
target = src->source;
|
||||||
|
@ -86,6 +86,11 @@ public class Misc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
expect(new String(new byte[] { 99, 111, 109, 46, 101, 99, 111, 118, 97,
|
||||||
|
116, 101, 46, 110, 97, 116, 46, 98, 117,
|
||||||
|
115, 46, 83, 121, 109, 98, 111, 108 })
|
||||||
|
.equals("com.ecovate.nat.bus.Symbol"));
|
||||||
|
|
||||||
expect(queryDefault(new Object()) != null);
|
expect(queryDefault(new Object()) != null);
|
||||||
|
|
||||||
{ Foo foo = new Foo();
|
{ Foo foo = new Foo();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user