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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32. 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_IA32.
6 #if defined(TARGET_ARCH_IA32) 6 #if defined(TARGET_ARCH_IA32)
7 7
8 #include "vm/flow_graph_compiler.h" 8 #include "vm/flow_graph_compiler.h"
9 9
10 #include "lib/error.h" 10 #include "lib/error.h"
(...skipping 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after
1215 if (destination.IsXmmRegister()) { 1215 if (destination.IsXmmRegister()) {
1216 __ movsd(destination.xmm_reg(), ToStackSlotAddress(source)); 1216 __ movsd(destination.xmm_reg(), ToStackSlotAddress(source));
1217 } else { 1217 } else {
1218 ASSERT(destination.IsDoubleStackSlot()); 1218 ASSERT(destination.IsDoubleStackSlot());
1219 __ movsd(XMM0, ToStackSlotAddress(source)); 1219 __ movsd(XMM0, ToStackSlotAddress(source));
1220 __ movsd(ToStackSlotAddress(destination), XMM0); 1220 __ movsd(ToStackSlotAddress(destination), XMM0);
1221 } 1221 }
1222 } else { 1222 } else {
1223 ASSERT(source.IsConstant()); 1223 ASSERT(source.IsConstant());
1224 if (destination.IsRegister()) { 1224 if (destination.IsRegister()) {
1225 __ LoadObject(destination.reg(), source.constant()); 1225 const Object& constant = source.constant();
1226 if (constant.IsSmi() && (Smi::Cast(constant).Value() == 0)) {
1227 __ xorl(destination.reg(), destination.reg());
1228 } else {
1229 __ LoadObject(destination.reg(), constant);
1230 }
1226 } else { 1231 } else {
1227 ASSERT(destination.IsStackSlot()); 1232 ASSERT(destination.IsStackSlot());
1228 StoreObject(ToStackSlotAddress(destination), source.constant()); 1233 StoreObject(ToStackSlotAddress(destination), source.constant());
1229 } 1234 }
1230 } 1235 }
1231 1236
1232 move->Eliminate(); 1237 move->Eliminate();
1233 } 1238 }
1234 1239
1235 1240
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
1323 __ popl(ECX); 1328 __ popl(ECX);
1324 __ popl(EAX); 1329 __ popl(EAX);
1325 } 1330 }
1326 1331
1327 1332
1328 #undef __ 1333 #undef __
1329 1334
1330 } // namespace dart 1335 } // namespace dart
1331 1336
1332 #endif // defined TARGET_ARCH_IA32 1337 #endif // defined TARGET_ARCH_IA32
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698