| 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_X64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_X64. |
| 6 #if defined(TARGET_ARCH_X64) | 6 #if defined(TARGET_ARCH_X64) |
| 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 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1225 const uword label_address = | 1225 const uword label_address = |
| 1226 stub_code->UnoptimizedStaticCallEntryPoint(ic_data.NumArgsTested()); | 1226 stub_code->UnoptimizedStaticCallEntryPoint(ic_data.NumArgsTested()); |
| 1227 ExternalLabel target_label(label_address); | 1227 ExternalLabel target_label(label_address); |
| 1228 __ LoadObject(RBX, ic_data, PP); | 1228 __ LoadObject(RBX, ic_data, PP); |
| 1229 GenerateDartCall(deopt_id, | 1229 GenerateDartCall(deopt_id, |
| 1230 token_pos, | 1230 token_pos, |
| 1231 &target_label, | 1231 &target_label, |
| 1232 RawPcDescriptors::kUnoptStaticCall, | 1232 RawPcDescriptors::kUnoptStaticCall, |
| 1233 locs); | 1233 locs); |
| 1234 __ Drop(argument_count, RCX); | 1234 __ Drop(argument_count, RCX); |
| 1235 #if defined(DEBUG) | |
| 1236 __ movq(RBX, Immediate(kInvalidObjectPointer)); | |
| 1237 __ movq(R10, Immediate(kInvalidObjectPointer)); | |
| 1238 #endif | |
| 1239 } | 1235 } |
| 1240 | 1236 |
| 1241 | 1237 |
| 1242 void FlowGraphCompiler::EmitEdgeCounter() { | 1238 void FlowGraphCompiler::EmitEdgeCounter() { |
| 1243 // We do not check for overflow when incrementing the edge counter. The | 1239 // We do not check for overflow when incrementing the edge counter. The |
| 1244 // function should normally be optimized long before the counter can | 1240 // function should normally be optimized long before the counter can |
| 1245 // overflow; and though we do not reset the counters when we optimize or | 1241 // overflow; and though we do not reset the counters when we optimize or |
| 1246 // deoptimize, there is a bound on the number of | 1242 // deoptimize, there is a bound on the number of |
| 1247 // optimization/deoptimization cycles we will attempt. | 1243 // optimization/deoptimization cycles we will attempt. |
| 1248 const Array& counter = Array::ZoneHandle(Array::New(1, Heap::kOld)); | 1244 const Array& counter = Array::ZoneHandle(Array::New(1, Heap::kOld)); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1299 intptr_t token_pos, | 1295 intptr_t token_pos, |
| 1300 LocationSummary* locs) { | 1296 LocationSummary* locs) { |
| 1301 ASSERT(Array::Handle(ic_data.arguments_descriptor()).Length() > 0); | 1297 ASSERT(Array::Handle(ic_data.arguments_descriptor()).Length() > 0); |
| 1302 __ LoadObject(RBX, ic_data, PP); | 1298 __ LoadObject(RBX, ic_data, PP); |
| 1303 GenerateDartCall(deopt_id, | 1299 GenerateDartCall(deopt_id, |
| 1304 token_pos, | 1300 token_pos, |
| 1305 target_label, | 1301 target_label, |
| 1306 RawPcDescriptors::kIcCall, | 1302 RawPcDescriptors::kIcCall, |
| 1307 locs); | 1303 locs); |
| 1308 __ Drop(argument_count, RCX); | 1304 __ Drop(argument_count, RCX); |
| 1309 #if defined(DEBUG) | |
| 1310 __ movq(R10, Immediate(kInvalidObjectPointer)); | |
| 1311 #endif | |
| 1312 } | 1305 } |
| 1313 | 1306 |
| 1314 | 1307 |
| 1315 void FlowGraphCompiler::EmitMegamorphicInstanceCall( | 1308 void FlowGraphCompiler::EmitMegamorphicInstanceCall( |
| 1316 const ICData& ic_data, | 1309 const ICData& ic_data, |
| 1317 intptr_t argument_count, | 1310 intptr_t argument_count, |
| 1318 intptr_t deopt_id, | 1311 intptr_t deopt_id, |
| 1319 intptr_t token_pos, | 1312 intptr_t token_pos, |
| 1320 LocationSummary* locs) { | 1313 LocationSummary* locs) { |
| 1321 MegamorphicCacheTable* table = Isolate::Current()->megamorphic_cache_table(); | 1314 MegamorphicCacheTable* table = Isolate::Current()->megamorphic_cache_table(); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1443 if (is_optimizing()) { | 1436 if (is_optimizing()) { |
| 1444 __ CallPatchable(&stub_code->OptimizedIdenticalWithNumberCheckLabel()); | 1437 __ CallPatchable(&stub_code->OptimizedIdenticalWithNumberCheckLabel()); |
| 1445 } else { | 1438 } else { |
| 1446 __ CallPatchable(&stub_code->UnoptimizedIdenticalWithNumberCheckLabel()); | 1439 __ CallPatchable(&stub_code->UnoptimizedIdenticalWithNumberCheckLabel()); |
| 1447 } | 1440 } |
| 1448 if (token_pos != Scanner::kNoSourcePos) { | 1441 if (token_pos != Scanner::kNoSourcePos) { |
| 1449 AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, | 1442 AddCurrentDescriptor(RawPcDescriptors::kRuntimeCall, |
| 1450 Isolate::kNoDeoptId, | 1443 Isolate::kNoDeoptId, |
| 1451 token_pos); | 1444 token_pos); |
| 1452 } | 1445 } |
| 1453 #if defined(DEBUG) | |
| 1454 // Do this *after* adding the pc descriptor! | |
| 1455 if (!is_optimizing()) { | |
| 1456 __ movq(R10, Immediate(kInvalidObjectPointer)); | |
| 1457 __ movq(RBX, Immediate(kInvalidObjectPointer)); | |
| 1458 } | |
| 1459 #endif | |
| 1460 // Stub returns result in flags (result of a cmpq, we need ZF computed). | 1446 // Stub returns result in flags (result of a cmpq, we need ZF computed). |
| 1461 __ popq(right); | 1447 __ popq(right); |
| 1462 __ popq(left); | 1448 __ popq(left); |
| 1463 } else { | 1449 } else { |
| 1464 __ cmpl(left, right); | 1450 __ cmpl(left, right); |
| 1465 } | 1451 } |
| 1466 return EQUAL; | 1452 return EQUAL; |
| 1467 } | 1453 } |
| 1468 | 1454 |
| 1469 | 1455 |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1783 __ movups(reg, Address(RSP, 0)); | 1769 __ movups(reg, Address(RSP, 0)); |
| 1784 __ AddImmediate(RSP, Immediate(kFpuRegisterSize), PP); | 1770 __ AddImmediate(RSP, Immediate(kFpuRegisterSize), PP); |
| 1785 } | 1771 } |
| 1786 | 1772 |
| 1787 | 1773 |
| 1788 #undef __ | 1774 #undef __ |
| 1789 | 1775 |
| 1790 } // namespace dart | 1776 } // namespace dart |
| 1791 | 1777 |
| 1792 #endif // defined TARGET_ARCH_X64 | 1778 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |