mirror of
https://github.com/corda/corda.git
synced 2025-02-02 01:08:09 +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 (cost) {
|
||||
addSite(c, dst, target);
|
||||
|
||||
bool useTemporary = ((target->type(c) == MemoryOperand
|
||||
and src->source->type(c) == MemoryOperand)
|
||||
or (srcSize != dstSize
|
||||
and target->type(c) != RegisterOperand));
|
||||
|
||||
addSite(c, dst, target);
|
||||
|
||||
if (target->match(c, dstMask) and not useTemporary) {
|
||||
if (DebugMoves) {
|
||||
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);
|
||||
} else {
|
||||
target->freeze(c, dst);
|
||||
|
||||
assert(c, dstMask.typeMask & (1 << RegisterOperand));
|
||||
|
||||
Site* tmpTarget = freeRegisterSite(c, dstMask.registerMask);
|
||||
@ -2465,6 +2467,8 @@ maybeMove(Context* c, BinaryOperation type, unsigned srcSize, Value* src,
|
||||
} else {
|
||||
removeSite(c, dst, target);
|
||||
}
|
||||
|
||||
target->thaw(c, dst);
|
||||
}
|
||||
} else {
|
||||
target = src->source;
|
||||
|
@ -86,6 +86,11 @@ public class Misc {
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
{ Foo foo = new Foo();
|
||||
|
Loading…
x
Reference in New Issue
Block a user