Index: runtime/vm/flow_graph_compiler_x64.cc |
diff --git a/runtime/vm/flow_graph_compiler_x64.cc b/runtime/vm/flow_graph_compiler_x64.cc |
index 1c4b7d7380f4011d06d150375ba0f057969f6425..a7b1e2d5357e33241b9cc4d6f87a6bdbed687b83 100644 |
--- a/runtime/vm/flow_graph_compiler_x64.cc |
+++ b/runtime/vm/flow_graph_compiler_x64.cc |
@@ -1595,6 +1595,9 @@ void ParallelMoveResolver::EmitMove(int index) { |
if (destination.IsRegister()) { |
if (constant.IsSmi() && (Smi::Cast(constant).Value() == 0)) { |
__ xorq(destination.reg(), destination.reg()); |
+ } else if (constant.IsSmi() && |
+ (source.constant_instruction()->representation() == kUnboxedInt32)) { |
+ __ movl(destination.reg(), Immediate(Smi::Cast(constant).Value())); |
} else { |
__ LoadObject(destination.reg(), constant, PP); |
} |
@@ -1616,7 +1619,13 @@ void ParallelMoveResolver::EmitMove(int index) { |
__ movsd(destination.ToStackSlotAddress(), XMM0); |
} else { |
ASSERT(destination.IsStackSlot()); |
- StoreObject(destination.ToStackSlotAddress(), constant); |
+ if (constant.IsSmi() && |
+ (source.constant_instruction()->representation() == kUnboxedInt32)) { |
+ __ movl(destination.ToStackSlotAddress(), |
+ Immediate(Smi::Cast(constant).Value())); |
+ } else { |
+ StoreObject(destination.ToStackSlotAddress(), constant); |
+ } |
} |
} |