| 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_ARM. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM. |
| 6 #if defined(TARGET_ARCH_ARM) | 6 #if defined(TARGET_ARCH_ARM) |
| 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 1314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1325 ASSERT(Smi::New(0) == 0); | 1325 ASSERT(Smi::New(0) == 0); |
| 1326 __ cmp(R0, Operand(0)); | 1326 __ cmp(R0, Operand(0)); |
| 1327 | 1327 |
| 1328 __ b(&done, NE); // Return if already computed. | 1328 __ b(&done, NE); // Return if already computed. |
| 1329 __ mov(R0, Operand(R9)); // Restore receiver in R0. | 1329 __ mov(R0, Operand(R9)); // Restore receiver in R0. |
| 1330 | 1330 |
| 1331 __ Bind(&megamorphic_call); | 1331 __ Bind(&megamorphic_call); |
| 1332 __ Comment("Slow case: megamorphic call"); | 1332 __ Comment("Slow case: megamorphic call"); |
| 1333 } | 1333 } |
| 1334 __ LoadObject(R9, cache); | 1334 __ LoadObject(R9, cache); |
| 1335 __ ldr(LR, Address(THR, Thread::megamorphic_lookup_entry_point_offset())); | 1335 __ ldr(LR, Address(THR, Thread::megamorphic_lookup_checked_entry_offset())); |
| 1336 __ blx(LR); | 1336 __ blx(LR); |
| 1337 __ blx(R1); | |
| 1338 | 1337 |
| 1339 __ Bind(&done); | 1338 __ Bind(&done); |
| 1340 RecordSafepoint(locs, slow_path_argument_count); | 1339 RecordSafepoint(locs, slow_path_argument_count); |
| 1341 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); | 1340 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); |
| 1342 if (FLAG_precompiled_mode) { | 1341 if (FLAG_precompiled_mode) { |
| 1343 // Megamorphic calls may occur in slow path stubs. | 1342 // Megamorphic calls may occur in slow path stubs. |
| 1344 // If valid use try_index argument. | 1343 // If valid use try_index argument. |
| 1345 if (try_index == CatchClauseNode::kInvalidTryIndex) { | 1344 if (try_index == CatchClauseNode::kInvalidTryIndex) { |
| 1346 try_index = CurrentTryIndex(); | 1345 try_index = CurrentTryIndex(); |
| 1347 } | 1346 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1365 __ Drop(argument_count); | 1364 __ Drop(argument_count); |
| 1366 } | 1365 } |
| 1367 | 1366 |
| 1368 | 1367 |
| 1369 void FlowGraphCompiler::EmitSwitchableInstanceCall( | 1368 void FlowGraphCompiler::EmitSwitchableInstanceCall( |
| 1370 const ICData& ic_data, | 1369 const ICData& ic_data, |
| 1371 intptr_t argument_count, | 1370 intptr_t argument_count, |
| 1372 intptr_t deopt_id, | 1371 intptr_t deopt_id, |
| 1373 TokenPosition token_pos, | 1372 TokenPosition token_pos, |
| 1374 LocationSummary* locs) { | 1373 LocationSummary* locs) { |
| 1374 ASSERT(ic_data.NumArgsTested() == 1); |
| 1375 const Code& initial_stub = Code::ZoneHandle( |
| 1376 StubCode::ICLookupThroughFunction_entry()->code()); |
| 1377 |
| 1375 __ Comment("SwitchableCall"); | 1378 __ Comment("SwitchableCall"); |
| 1379 |
| 1376 __ LoadFromOffset(kWord, R0, SP, (argument_count - 1) * kWordSize); | 1380 __ LoadFromOffset(kWord, R0, SP, (argument_count - 1) * kWordSize); |
| 1377 ASSERT(ic_data.NumArgsTested() == 1); | |
| 1378 __ LoadUniqueObject(R9, ic_data); | 1381 __ LoadUniqueObject(R9, ic_data); |
| 1379 __ BranchLinkPatchable(*StubCode::ICLookupThroughFunction_entry()); | 1382 __ LoadUniqueObject(CODE_REG, initial_stub); |
| 1380 __ blx(R1); | 1383 __ ldr(LR, FieldAddress(CODE_REG, Code::checked_entry_point_offset())); |
| 1384 __ blx(LR); |
| 1381 | 1385 |
| 1382 AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId, token_pos); | 1386 AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId, token_pos); |
| 1383 RecordSafepoint(locs); | 1387 RecordSafepoint(locs); |
| 1384 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); | 1388 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); |
| 1385 if (is_optimizing()) { | 1389 if (is_optimizing()) { |
| 1386 AddDeoptIndexAtCall(deopt_id_after, token_pos); | 1390 AddDeoptIndexAtCall(deopt_id_after, token_pos); |
| 1387 } else { | 1391 } else { |
| 1388 // Add deoptimization continuation point after the call and before the | 1392 // Add deoptimization continuation point after the call and before the |
| 1389 // arguments are removed. | 1393 // arguments are removed. |
| 1390 AddCurrentDescriptor(RawPcDescriptors::kDeopt, | 1394 AddCurrentDescriptor(RawPcDescriptors::kDeopt, |
| (...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1990 DRegister dreg = EvenDRegisterOf(reg); | 1994 DRegister dreg = EvenDRegisterOf(reg); |
| 1991 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); | 1995 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); |
| 1992 } | 1996 } |
| 1993 | 1997 |
| 1994 | 1998 |
| 1995 #undef __ | 1999 #undef __ |
| 1996 | 2000 |
| 1997 } // namespace dart | 2001 } // namespace dart |
| 1998 | 2002 |
| 1999 #endif // defined TARGET_ARCH_ARM | 2003 #endif // defined TARGET_ARCH_ARM |
| OLD | NEW |