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 1316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1327 ASSERT(Smi::New(0) == 0); | 1327 ASSERT(Smi::New(0) == 0); |
1328 __ cmp(R0, Operand(0)); | 1328 __ cmp(R0, Operand(0)); |
1329 | 1329 |
1330 __ b(&done, NE); // Return if already computed. | 1330 __ b(&done, NE); // Return if already computed. |
1331 __ mov(R0, Operand(R9)); // Restore receiver in R0. | 1331 __ mov(R0, Operand(R9)); // Restore receiver in R0. |
1332 | 1332 |
1333 __ Bind(&megamorphic_call); | 1333 __ Bind(&megamorphic_call); |
1334 __ Comment("Slow case: megamorphic call"); | 1334 __ Comment("Slow case: megamorphic call"); |
1335 } | 1335 } |
1336 __ LoadObject(R9, cache); | 1336 __ LoadObject(R9, cache); |
1337 __ ldr(LR, Address(THR, Thread::megamorphic_lookup_checked_entry_offset())); | 1337 __ ldr(LR, Address(THR, Thread::megamorphic_call_checked_entry_offset())); |
1338 __ blx(LR); | 1338 __ blx(LR); |
1339 | 1339 |
1340 __ Bind(&done); | 1340 __ Bind(&done); |
1341 RecordSafepoint(locs, slow_path_argument_count); | 1341 RecordSafepoint(locs, slow_path_argument_count); |
1342 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); | 1342 const intptr_t deopt_id_after = Thread::ToDeoptAfter(deopt_id); |
1343 if (FLAG_precompiled_mode) { | 1343 if (FLAG_precompiled_mode) { |
1344 // Megamorphic calls may occur in slow path stubs. | 1344 // Megamorphic calls may occur in slow path stubs. |
1345 // If valid use try_index argument. | 1345 // If valid use try_index argument. |
1346 if (try_index == CatchClauseNode::kInvalidTryIndex) { | 1346 if (try_index == CatchClauseNode::kInvalidTryIndex) { |
1347 try_index = CurrentTryIndex(); | 1347 try_index = CurrentTryIndex(); |
(...skipping 20 matching lines...) Expand all Loading... |
1368 | 1368 |
1369 | 1369 |
1370 void FlowGraphCompiler::EmitSwitchableInstanceCall( | 1370 void FlowGraphCompiler::EmitSwitchableInstanceCall( |
1371 const ICData& ic_data, | 1371 const ICData& ic_data, |
1372 intptr_t argument_count, | 1372 intptr_t argument_count, |
1373 intptr_t deopt_id, | 1373 intptr_t deopt_id, |
1374 TokenPosition token_pos, | 1374 TokenPosition token_pos, |
1375 LocationSummary* locs) { | 1375 LocationSummary* locs) { |
1376 ASSERT(ic_data.NumArgsTested() == 1); | 1376 ASSERT(ic_data.NumArgsTested() == 1); |
1377 const Code& initial_stub = Code::ZoneHandle( | 1377 const Code& initial_stub = Code::ZoneHandle( |
1378 StubCode::ICLookupThroughFunction_entry()->code()); | 1378 StubCode::ICCallThroughFunction_entry()->code()); |
1379 | 1379 |
1380 __ Comment("SwitchableCall"); | 1380 __ Comment("SwitchableCall"); |
1381 | 1381 |
1382 __ LoadFromOffset(kWord, R0, SP, (argument_count - 1) * kWordSize); | 1382 __ LoadFromOffset(kWord, R0, SP, (argument_count - 1) * kWordSize); |
1383 __ LoadUniqueObject(R9, ic_data); | 1383 __ LoadUniqueObject(R9, ic_data); |
1384 __ LoadUniqueObject(CODE_REG, initial_stub); | 1384 __ LoadUniqueObject(CODE_REG, initial_stub); |
1385 __ ldr(LR, FieldAddress(CODE_REG, Code::checked_entry_point_offset())); | 1385 __ ldr(LR, FieldAddress(CODE_REG, Code::checked_entry_point_offset())); |
1386 __ blx(LR); | 1386 __ blx(LR); |
1387 | 1387 |
1388 AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId, token_pos); | 1388 AddCurrentDescriptor(RawPcDescriptors::kOther, Thread::kNoDeoptId, token_pos); |
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1996 DRegister dreg = EvenDRegisterOf(reg); | 1996 DRegister dreg = EvenDRegisterOf(reg); |
1997 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); | 1997 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); |
1998 } | 1998 } |
1999 | 1999 |
2000 | 2000 |
2001 #undef __ | 2001 #undef __ |
2002 | 2002 |
2003 } // namespace dart | 2003 } // namespace dart |
2004 | 2004 |
2005 #endif // defined TARGET_ARCH_ARM | 2005 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |