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

Unified Diff: runtime/vm/flow_graph_compiler_ia32.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_ia32.cc
diff --git a/runtime/vm/flow_graph_compiler_ia32.cc b/runtime/vm/flow_graph_compiler_ia32.cc
index 4f9dc6f3e03ca632b2fcef6ab2683fee562ca769..72c9e85e6eb91a18c81bf1f1525372719352c91f 100644
--- a/runtime/vm/flow_graph_compiler_ia32.cc
+++ b/runtime/vm/flow_graph_compiler_ia32.cc
@@ -1222,7 +1222,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)) {
+ __ xorl(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