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

Side by Side Diff: runtime/vm/flow_graph_compiler_ia32.cc

Issue 10984051: More compact code for strict compare with 0. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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
« no previous file with comments | « runtime/vm/flow_graph_compiler_ia32.h ('k') | runtime/vm/flow_graph_compiler_x64.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after
1118 GenerateDartCall(deopt_id, 1118 GenerateDartCall(deopt_id,
1119 token_pos, 1119 token_pos,
1120 &StubCode::CallStaticFunctionLabel(), 1120 &StubCode::CallStaticFunctionLabel(),
1121 PcDescriptors::kFuncCall, 1121 PcDescriptors::kFuncCall,
1122 locs); 1122 locs);
1123 } 1123 }
1124 __ Drop(argument_count); 1124 __ Drop(argument_count);
1125 } 1125 }
1126 1126
1127 1127
1128 void FlowGraphCompiler::EmitEqualityRegConstCompare(Register reg,
1129 const Object& obj) {
1130 if (obj.IsSmi() && (Smi::Cast(obj).Value() == 0)) {
1131 __ testl(reg, reg);
1132 } else {
1133 __ CompareObject(reg, obj);
1134 }
1135 }
1136
1137
1128 void FlowGraphCompiler::LoadDoubleOrSmiToXmm(XmmRegister result, 1138 void FlowGraphCompiler::LoadDoubleOrSmiToXmm(XmmRegister result,
1129 Register reg, 1139 Register reg,
1130 Register temp, 1140 Register temp,
1131 Label* not_double_or_smi) { 1141 Label* not_double_or_smi) {
1132 Label is_smi, done; 1142 Label is_smi, done;
1133 __ testl(reg, Immediate(kSmiTagMask)); 1143 __ testl(reg, Immediate(kSmiTagMask));
1134 __ j(ZERO, &is_smi); 1144 __ j(ZERO, &is_smi);
1135 __ CompareClassId(reg, kDoubleCid, temp); 1145 __ CompareClassId(reg, kDoubleCid, temp);
1136 __ j(NOT_EQUAL, not_double_or_smi); 1146 __ j(NOT_EQUAL, not_double_or_smi);
1137 __ movsd(result, FieldAddress(reg, Double::value_offset())); 1147 __ movsd(result, FieldAddress(reg, Double::value_offset()));
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
1367 __ popl(ECX); 1377 __ popl(ECX);
1368 __ popl(EAX); 1378 __ popl(EAX);
1369 } 1379 }
1370 1380
1371 1381
1372 #undef __ 1382 #undef __
1373 1383
1374 } // namespace dart 1384 } // namespace dart
1375 1385
1376 #endif // defined TARGET_ARCH_IA32 1386 #endif // defined TARGET_ARCH_IA32
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_compiler_ia32.h ('k') | runtime/vm/flow_graph_compiler_x64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698