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 1373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1384 __ LoadObject(R4, arguments_descriptor); | 1384 __ LoadObject(R4, arguments_descriptor); |
1385 __ AddImmediate(R0, Instructions::HeaderSize() - kHeapObjectTag); | 1385 __ AddImmediate(R0, Instructions::HeaderSize() - kHeapObjectTag); |
1386 __ blx(R0); | 1386 __ blx(R0); |
1387 AddCurrentDescriptor(PcDescriptors::kOther, Isolate::kNoDeoptId, token_pos); | 1387 AddCurrentDescriptor(PcDescriptors::kOther, Isolate::kNoDeoptId, token_pos); |
1388 RecordSafepoint(locs); | 1388 RecordSafepoint(locs); |
1389 AddDeoptIndexAtCall(Isolate::ToDeoptAfter(deopt_id), token_pos); | 1389 AddDeoptIndexAtCall(Isolate::ToDeoptAfter(deopt_id), token_pos); |
1390 __ Drop(argument_count); | 1390 __ Drop(argument_count); |
1391 } | 1391 } |
1392 | 1392 |
1393 | 1393 |
| 1394 void FlowGraphCompiler::EmitUnoptimizedStaticCall( |
| 1395 const Function& target_function, |
| 1396 const Array& arguments_descriptor, |
| 1397 intptr_t argument_count, |
| 1398 intptr_t deopt_id, |
| 1399 intptr_t token_pos, |
| 1400 LocationSummary* locs) { |
| 1401 // TODO(srdjan): Improve performance of function recognition. |
| 1402 MethodRecognizer::Kind recognized_kind = |
| 1403 MethodRecognizer::RecognizeKind(target_function); |
| 1404 int num_args_checked = 0; |
| 1405 if ((recognized_kind == MethodRecognizer::kMathMin) || |
| 1406 (recognized_kind == MethodRecognizer::kMathMax)) { |
| 1407 num_args_checked = 2; |
| 1408 } |
| 1409 const ICData& ic_data = ICData::ZoneHandle( |
| 1410 ICData::New(parsed_function().function(), // Caller function. |
| 1411 String::Handle(target_function.name()), |
| 1412 arguments_descriptor, |
| 1413 deopt_id, |
| 1414 num_args_checked)); // No arguments checked. |
| 1415 ic_data.AddTarget(target_function); |
| 1416 uword label_address = 0; |
| 1417 if (ic_data.num_args_tested() == 0) { |
| 1418 label_address = StubCode::ZeroArgsUnoptimizedStaticCallEntryPoint(); |
| 1419 } else if (ic_data.num_args_tested() == 2) { |
| 1420 label_address = StubCode::TwoArgsUnoptimizedStaticCallEntryPoint(); |
| 1421 } else { |
| 1422 UNIMPLEMENTED(); |
| 1423 } |
| 1424 ExternalLabel target_label("StaticCallICStub", label_address); |
| 1425 __ LoadObject(R5, ic_data); |
| 1426 GenerateDartCall(deopt_id, |
| 1427 token_pos, |
| 1428 &target_label, |
| 1429 PcDescriptors::kUnoptStaticCall, |
| 1430 locs); |
| 1431 __ Drop(argument_count); |
| 1432 } |
| 1433 |
| 1434 |
1394 void FlowGraphCompiler::EmitOptimizedStaticCall( | 1435 void FlowGraphCompiler::EmitOptimizedStaticCall( |
1395 const Function& function, | 1436 const Function& function, |
1396 const Array& arguments_descriptor, | 1437 const Array& arguments_descriptor, |
1397 intptr_t argument_count, | 1438 intptr_t argument_count, |
1398 intptr_t deopt_id, | 1439 intptr_t deopt_id, |
1399 intptr_t token_pos, | 1440 intptr_t token_pos, |
1400 LocationSummary* locs) { | 1441 LocationSummary* locs) { |
1401 __ LoadObject(R4, arguments_descriptor); | 1442 __ LoadObject(R4, arguments_descriptor); |
1402 // Do not use the code from the function, but let the code be patched so that | 1443 // Do not use the code from the function, but let the code be patched so that |
1403 // we can record the outgoing edges to other code. | 1444 // we can record the outgoing edges to other code. |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1876 DRegister dreg = EvenDRegisterOf(reg); | 1917 DRegister dreg = EvenDRegisterOf(reg); |
1877 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); | 1918 __ vldrd(dreg, Address(SP, kDoubleSize, Address::PostIndex)); |
1878 } | 1919 } |
1879 | 1920 |
1880 | 1921 |
1881 #undef __ | 1922 #undef __ |
1882 | 1923 |
1883 } // namespace dart | 1924 } // namespace dart |
1884 | 1925 |
1885 #endif // defined TARGET_ARCH_ARM | 1926 #endif // defined TARGET_ARCH_ARM |
OLD | NEW |