OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 "vm/ast_printer.h" | 10 #include "vm/ast_printer.h" |
(...skipping 1277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1288 RawPcDescriptors::kOther, locs); | 1288 RawPcDescriptors::kOther, locs); |
1289 AddStaticCallTarget(function); | 1289 AddStaticCallTarget(function); |
1290 __ Drop(argument_count); | 1290 __ Drop(argument_count); |
1291 } | 1291 } |
1292 | 1292 |
1293 | 1293 |
1294 Condition FlowGraphCompiler::EmitEqualityRegConstCompare( | 1294 Condition FlowGraphCompiler::EmitEqualityRegConstCompare( |
1295 Register reg, | 1295 Register reg, |
1296 const Object& obj, | 1296 const Object& obj, |
1297 bool needs_number_check, | 1297 bool needs_number_check, |
1298 TokenPosition token_pos) { | 1298 TokenPosition token_pos, |
| 1299 intptr_t deopt_id) { |
1299 ASSERT(!needs_number_check || | 1300 ASSERT(!needs_number_check || |
1300 (!obj.IsMint() && !obj.IsDouble() && !obj.IsBigint())); | 1301 (!obj.IsMint() && !obj.IsDouble() && !obj.IsBigint())); |
1301 | 1302 |
1302 if (obj.IsSmi() && (Smi::Cast(obj).Value() == 0)) { | 1303 if (obj.IsSmi() && (Smi::Cast(obj).Value() == 0)) { |
1303 ASSERT(!needs_number_check); | 1304 ASSERT(!needs_number_check); |
1304 __ testl(reg, reg); | 1305 __ testl(reg, reg); |
1305 return EQUAL; | 1306 return EQUAL; |
1306 } | 1307 } |
1307 | 1308 |
1308 if (needs_number_check) { | 1309 if (needs_number_check) { |
1309 __ pushl(reg); | 1310 __ pushl(reg); |
1310 __ PushObject(obj); | 1311 __ PushObject(obj); |
1311 if (is_optimizing()) { | 1312 if (is_optimizing()) { |
1312 __ Call(*StubCode::OptimizedIdenticalWithNumberCheck_entry()); | 1313 __ Call(*StubCode::OptimizedIdenticalWithNumberCheck_entry()); |
1313 } else { | 1314 } else { |
1314 __ Call(*StubCode::UnoptimizedIdenticalWithNumberCheck_entry()); | 1315 __ Call(*StubCode::UnoptimizedIdenticalWithNumberCheck_entry()); |
1315 } | 1316 } |
1316 if (token_pos.IsReal()) { | 1317 AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, deopt_id, token_pos); |
1317 AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, Thread::kNoDeoptId, | |
1318 token_pos); | |
1319 } | |
1320 // Stub returns result in flags (result of a cmpl, we need ZF computed). | 1318 // Stub returns result in flags (result of a cmpl, we need ZF computed). |
1321 __ popl(reg); // Discard constant. | 1319 __ popl(reg); // Discard constant. |
1322 __ popl(reg); // Restore 'reg'. | 1320 __ popl(reg); // Restore 'reg'. |
1323 } else { | 1321 } else { |
1324 __ CompareObject(reg, obj); | 1322 __ CompareObject(reg, obj); |
1325 } | 1323 } |
1326 return EQUAL; | 1324 return EQUAL; |
1327 } | 1325 } |
1328 | 1326 |
1329 | 1327 |
1330 Condition FlowGraphCompiler::EmitEqualityRegRegCompare( | 1328 Condition FlowGraphCompiler::EmitEqualityRegRegCompare(Register left, |
1331 Register left, | 1329 Register right, |
1332 Register right, | 1330 bool needs_number_check, |
1333 bool needs_number_check, | 1331 TokenPosition token_pos, |
1334 TokenPosition token_pos) { | 1332 intptr_t deopt_id) { |
1335 if (needs_number_check) { | 1333 if (needs_number_check) { |
1336 __ pushl(left); | 1334 __ pushl(left); |
1337 __ pushl(right); | 1335 __ pushl(right); |
1338 if (is_optimizing()) { | 1336 if (is_optimizing()) { |
1339 __ Call(*StubCode::OptimizedIdenticalWithNumberCheck_entry()); | 1337 __ Call(*StubCode::OptimizedIdenticalWithNumberCheck_entry()); |
1340 } else { | 1338 } else { |
1341 __ Call(*StubCode::UnoptimizedIdenticalWithNumberCheck_entry()); | 1339 __ Call(*StubCode::UnoptimizedIdenticalWithNumberCheck_entry()); |
1342 } | 1340 } |
1343 if (token_pos.IsReal()) { | 1341 AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, deopt_id, token_pos); |
1344 AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, Thread::kNoDeoptId, | |
1345 token_pos); | |
1346 } | |
1347 // Stub returns result in flags (result of a cmpl, we need ZF computed). | 1342 // Stub returns result in flags (result of a cmpl, we need ZF computed). |
1348 __ popl(right); | 1343 __ popl(right); |
1349 __ popl(left); | 1344 __ popl(left); |
1350 } else { | 1345 } else { |
1351 __ cmpl(left, right); | 1346 __ cmpl(left, right); |
1352 } | 1347 } |
1353 return EQUAL; | 1348 return EQUAL; |
1354 } | 1349 } |
1355 | 1350 |
1356 | 1351 |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1728 __ movups(reg, Address(ESP, 0)); | 1723 __ movups(reg, Address(ESP, 0)); |
1729 __ addl(ESP, Immediate(kFpuRegisterSize)); | 1724 __ addl(ESP, Immediate(kFpuRegisterSize)); |
1730 } | 1725 } |
1731 | 1726 |
1732 | 1727 |
1733 #undef __ | 1728 #undef __ |
1734 | 1729 |
1735 } // namespace dart | 1730 } // namespace dart |
1736 | 1731 |
1737 #endif // defined TARGET_ARCH_IA32 | 1732 #endif // defined TARGET_ARCH_IA32 |
OLD | NEW |