Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Unified Diff: runtime/vm/flow_graph_compiler_x64.cc

Issue 10918097: Allow smi comparisons to have constant operands. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 53443e19667851a821ef07a4938b172095b51348..3352cb7618276538013c15699acebe9dd7b495fc 100644
--- a/runtime/vm/flow_graph_compiler_x64.cc
+++ b/runtime/vm/flow_graph_compiler_x64.cc
@@ -1233,7 +1233,12 @@ void ParallelMoveResolver::EmitMove(int index) {
} else {
ASSERT(source.IsConstant());
if (destination.IsRegister()) {
- __ LoadObject(destination.reg(), source.constant());
+ const Object& constant = source.constant();
+ if (constant.IsSmi() && (Smi::Cast(constant).Value() == 0)) {
+ __ xorq(destination.reg(), destination.reg());
+ } else {
+ __ LoadObject(destination.reg(), constant);
+ }
} else {
ASSERT(destination.IsStackSlot());
StoreObject(ToStackSlotAddress(destination), source.constant());

Powered by Google App Engine
This is Rietveld 408576698