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

Unified Diff: runtime/vm/flow_graph_compiler_arm.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_arm.cc
diff --git a/runtime/vm/flow_graph_compiler_arm.cc b/runtime/vm/flow_graph_compiler_arm.cc
index 7347085a29e1fbd5ea51567a78ff158c1991cb06..1bb28294528eff35bd122d7a013c7748ff16396a 100644
--- a/runtime/vm/flow_graph_compiler_arm.cc
+++ b/runtime/vm/flow_graph_compiler_arm.cc
@@ -1600,7 +1600,11 @@ void ParallelMoveResolver::EmitMove(int index) {
ASSERT(source.IsConstant());
const Object& constant = source.constant();
if (destination.IsRegister()) {
- __ LoadObject(destination.reg(), constant);
+ if (source.constant_instruction()->representation() == kUnboxedInt32) {
+ __ LoadImmediate(destination.reg(), Smi::Cast(constant).Value());
+ } else {
+ __ LoadObject(destination.reg(), constant);
+ }
} else if (destination.IsFpuRegister()) {
const DRegister dst = EvenDRegisterOf(destination.fpu_reg());
if (Utils::DoublesBitEqual(Double::Cast(constant).value(), 0.0) &&
@@ -1626,7 +1630,11 @@ void ParallelMoveResolver::EmitMove(int index) {
} else {
ASSERT(destination.IsStackSlot());
const intptr_t dest_offset = destination.ToStackSlotOffset();
- __ LoadObject(TMP, constant);
+ if (source.constant_instruction()->representation() == kUnboxedInt32) {
+ __ LoadImmediate(TMP, Smi::Cast(constant).Value());
+ } else {
+ __ LoadObject(TMP, constant);
+ }
__ StoreToOffset(kWord, TMP, FP, dest_offset);
}
}

Powered by Google App Engine
This is Rietveld 408576698