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

Unified Diff: runtime/vm/flow_graph_compiler_ia32.cc

Issue 504143003: Support Int32 representation for selected binary operations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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 5705373aaa6ee1ad7664aaddc71c16ecca5dffdd..a00e8b99efe1c8f7d2133a56aadf0abce5920843 100644
--- a/runtime/vm/flow_graph_compiler_ia32.cc
+++ b/runtime/vm/flow_graph_compiler_ia32.cc
@@ -1576,6 +1576,9 @@ void ParallelMoveResolver::EmitMove(int index) {
const Object& constant = source.constant();
if (constant.IsSmi() && (Smi::Cast(constant).Value() == 0)) {
__ xorl(destination.reg(), destination.reg());
+ } else if (constant.IsSmi() &&
+ source.constant_instruction()->representation() == kUnboxedInt32) {
srdjan 2014/08/27 16:17:12 add parentheses
Vyacheslav Egorov (Google) 2014/08/28 20:48:36 Done.
+ __ movl(destination.reg(), Immediate(Smi::Cast(constant).Value()));
} else {
__ LoadObjectSafely(destination.reg(), constant);
}
@@ -1609,7 +1612,14 @@ void ParallelMoveResolver::EmitMove(int index) {
__ movsd(destination.ToStackSlotAddress(), XMM0);
} else {
ASSERT(destination.IsStackSlot());
- StoreObject(destination.ToStackSlotAddress(), source.constant());
+ const Object& constant = source.constant();
+ if (constant.IsSmi() &&
+ source.constant_instruction()->representation() == kUnboxedInt32) {
srdjan 2014/08/27 16:17:12 add parentheses
Vyacheslav Egorov (Google) 2014/08/28 20:48:36 Done.
+ __ movl(destination.ToStackSlotAddress(),
+ Immediate(Smi::Cast(constant).Value()));
+ } else {
+ StoreObject(destination.ToStackSlotAddress(), source.constant());
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698