| 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 1323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1334 __ CompareClassId(RDI, kOneByteStringCid); | 1334 __ CompareClassId(RDI, kOneByteStringCid); |
| 1335 __ j(NOT_EQUAL, &megamorphic_call, Assembler::kNearJump); | 1335 __ j(NOT_EQUAL, &megamorphic_call, Assembler::kNearJump); |
| 1336 __ movq(RAX, FieldAddress(RDI, String::hash_offset())); | 1336 __ movq(RAX, FieldAddress(RDI, String::hash_offset())); |
| 1337 __ cmpq(RAX, Immediate(0)); | 1337 __ cmpq(RAX, Immediate(0)); |
| 1338 __ j(NOT_EQUAL, &done, Assembler::kNearJump); | 1338 __ j(NOT_EQUAL, &done, Assembler::kNearJump); |
| 1339 | 1339 |
| 1340 __ Bind(&megamorphic_call); | 1340 __ Bind(&megamorphic_call); |
| 1341 __ Comment("Slow case: megamorphic call"); | 1341 __ Comment("Slow case: megamorphic call"); |
| 1342 } | 1342 } |
| 1343 __ LoadObject(RBX, cache); | 1343 __ LoadObject(RBX, cache); |
| 1344 __ call(Address(THR, Thread::megamorphic_lookup_checked_entry_offset())); | 1344 __ call(Address(THR, Thread::megamorphic_call_checked_entry_offset())); |
| 1345 | 1345 |
| 1346 __ Bind(&done); | 1346 __ Bind(&done); |
| 1347 RecordSafepoint(locs, slow_path_argument_count); | 1347 RecordSafepoint(locs, slow_path_argument_count); |
| 1348 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); | 1348 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); |
| 1349 if (FLAG_precompiled_mode) { | 1349 if (FLAG_precompiled_mode) { |
| 1350 // Megamorphic calls may occur in slow path stubs. | 1350 // Megamorphic calls may occur in slow path stubs. |
| 1351 // If valid use try_index argument. | 1351 // If valid use try_index argument. |
| 1352 if (try_index == CatchClauseNode::kInvalidTryIndex) { | 1352 if (try_index == CatchClauseNode::kInvalidTryIndex) { |
| 1353 try_index = CurrentTryIndex(); | 1353 try_index = CurrentTryIndex(); |
| 1354 } | 1354 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1373 | 1373 |
| 1374 | 1374 |
| 1375 void FlowGraphCompiler::EmitSwitchableInstanceCall( | 1375 void FlowGraphCompiler::EmitSwitchableInstanceCall( |
| 1376 const ICData& ic_data, | 1376 const ICData& ic_data, |
| 1377 intptr_t argument_count, | 1377 intptr_t argument_count, |
| 1378 intptr_t deopt_id, | 1378 intptr_t deopt_id, |
| 1379 TokenPosition token_pos, | 1379 TokenPosition token_pos, |
| 1380 LocationSummary* locs) { | 1380 LocationSummary* locs) { |
| 1381 ASSERT(ic_data.NumArgsTested() == 1); | 1381 ASSERT(ic_data.NumArgsTested() == 1); |
| 1382 const Code& initial_stub = Code::ZoneHandle( | 1382 const Code& initial_stub = Code::ZoneHandle( |
| 1383 StubCode::ICLookupThroughFunction_entry()->code()); | 1383 StubCode::ICCallThroughFunction_entry()->code()); |
| 1384 | 1384 |
| 1385 __ Comment("SwitchableCall"); | 1385 __ Comment("SwitchableCall"); |
| 1386 __ movq(RDI, Address(RSP, (argument_count - 1) * kWordSize)); | 1386 __ movq(RDI, Address(RSP, (argument_count - 1) * kWordSize)); |
| 1387 __ LoadUniqueObject(RBX, ic_data); | 1387 __ LoadUniqueObject(RBX, ic_data); |
| 1388 __ LoadUniqueObject(CODE_REG, initial_stub); | 1388 __ LoadUniqueObject(CODE_REG, initial_stub); |
| 1389 __ movq(RCX, FieldAddress(CODE_REG, Code::checked_entry_point_offset())); | 1389 __ movq(RCX, FieldAddress(CODE_REG, Code::checked_entry_point_offset())); |
| 1390 __ call(RCX); | 1390 __ call(RCX); |
| 1391 | 1391 |
| 1392 AddCurrentDescriptor(RawPcDescriptors::kOther, | 1392 AddCurrentDescriptor(RawPcDescriptors::kOther, |
| 1393 Thread::kNoDeoptId, token_pos); | 1393 Thread::kNoDeoptId, token_pos); |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1864 __ movups(reg, Address(RSP, 0)); | 1864 __ movups(reg, Address(RSP, 0)); |
| 1865 __ AddImmediate(RSP, Immediate(kFpuRegisterSize)); | 1865 __ AddImmediate(RSP, Immediate(kFpuRegisterSize)); |
| 1866 } | 1866 } |
| 1867 | 1867 |
| 1868 | 1868 |
| 1869 #undef __ | 1869 #undef __ |
| 1870 | 1870 |
| 1871 } // namespace dart | 1871 } // namespace dart |
| 1872 | 1872 |
| 1873 #endif // defined TARGET_ARCH_X64 | 1873 #endif // defined TARGET_ARCH_X64 |
| OLD | NEW |