| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_ARM64. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_ARM64. |
| 6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
| 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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 LocationSummary* locs) { | 358 LocationSummary* locs) { |
| 359 UNIMPLEMENTED(); | 359 UNIMPLEMENTED(); |
| 360 } | 360 } |
| 361 | 361 |
| 362 | 362 |
| 363 void FlowGraphCompiler::GenerateDartCall(intptr_t deopt_id, | 363 void FlowGraphCompiler::GenerateDartCall(intptr_t deopt_id, |
| 364 intptr_t token_pos, | 364 intptr_t token_pos, |
| 365 const ExternalLabel* label, | 365 const ExternalLabel* label, |
| 366 PcDescriptors::Kind kind, | 366 PcDescriptors::Kind kind, |
| 367 LocationSummary* locs) { | 367 LocationSummary* locs) { |
| 368 UNIMPLEMENTED(); | 368 __ BranchLinkPatchable(label); |
| 369 AddCurrentDescriptor(kind, deopt_id, token_pos); |
| 370 RecordSafepoint(locs); |
| 371 // Marks either the continuation point in unoptimized code or the |
| 372 // deoptimization point in optimized code, after call. |
| 373 const intptr_t deopt_id_after = Isolate::ToDeoptAfter(deopt_id); |
| 374 if (is_optimizing()) { |
| 375 AddDeoptIndexAtCall(deopt_id_after, token_pos); |
| 376 } else { |
| 377 // Add deoptimization continuation point after the call and before the |
| 378 // arguments are removed. |
| 379 AddCurrentDescriptor(PcDescriptors::kDeopt, deopt_id_after, token_pos); |
| 380 } |
| 369 } | 381 } |
| 370 | 382 |
| 371 | 383 |
| 372 void FlowGraphCompiler::GenerateRuntimeCall(intptr_t token_pos, | 384 void FlowGraphCompiler::GenerateRuntimeCall(intptr_t token_pos, |
| 373 intptr_t deopt_id, | 385 intptr_t deopt_id, |
| 374 const RuntimeEntry& entry, | 386 const RuntimeEntry& entry, |
| 375 intptr_t argument_count, | 387 intptr_t argument_count, |
| 376 LocationSummary* locs) { | 388 LocationSummary* locs) { |
| 377 __ CallRuntime(entry, argument_count); | 389 __ CallRuntime(entry, argument_count); |
| 378 AddCurrentDescriptor(PcDescriptors::kOther, deopt_id, token_pos); | 390 AddCurrentDescriptor(PcDescriptors::kOther, deopt_id, token_pos); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 } | 451 } |
| 440 | 452 |
| 441 | 453 |
| 442 void FlowGraphCompiler::EmitUnoptimizedStaticCall( | 454 void FlowGraphCompiler::EmitUnoptimizedStaticCall( |
| 443 const Function& target_function, | 455 const Function& target_function, |
| 444 const Array& arguments_descriptor, | 456 const Array& arguments_descriptor, |
| 445 intptr_t argument_count, | 457 intptr_t argument_count, |
| 446 intptr_t deopt_id, | 458 intptr_t deopt_id, |
| 447 intptr_t token_pos, | 459 intptr_t token_pos, |
| 448 LocationSummary* locs) { | 460 LocationSummary* locs) { |
| 449 UNIMPLEMENTED(); | 461 // TODO(srdjan): Improve performance of function recognition. |
| 462 MethodRecognizer::Kind recognized_kind = |
| 463 MethodRecognizer::RecognizeKind(target_function); |
| 464 int num_args_checked = 0; |
| 465 if ((recognized_kind == MethodRecognizer::kMathMin) || |
| 466 (recognized_kind == MethodRecognizer::kMathMax)) { |
| 467 num_args_checked = 2; |
| 468 } |
| 469 const ICData& ic_data = ICData::ZoneHandle( |
| 470 ICData::New(parsed_function().function(), // Caller function. |
| 471 String::Handle(target_function.name()), |
| 472 arguments_descriptor, |
| 473 deopt_id, |
| 474 num_args_checked)); // No arguments checked. |
| 475 ic_data.AddTarget(target_function); |
| 476 uword label_address = 0; |
| 477 if (ic_data.num_args_tested() == 0) { |
| 478 label_address = StubCode::ZeroArgsUnoptimizedStaticCallEntryPoint(); |
| 479 } else if (ic_data.num_args_tested() == 2) { |
| 480 label_address = StubCode::TwoArgsUnoptimizedStaticCallEntryPoint(); |
| 481 } else { |
| 482 UNIMPLEMENTED(); |
| 483 } |
| 484 ExternalLabel target_label("StaticCallICStub", label_address); |
| 485 __ LoadObject(R5, ic_data, PP); |
| 486 GenerateDartCall(deopt_id, |
| 487 token_pos, |
| 488 &target_label, |
| 489 PcDescriptors::kUnoptStaticCall, |
| 490 locs); |
| 491 __ Drop(argument_count); |
| 450 } | 492 } |
| 451 | 493 |
| 452 | 494 |
| 453 void FlowGraphCompiler::EmitOptimizedStaticCall( | 495 void FlowGraphCompiler::EmitOptimizedStaticCall( |
| 454 const Function& function, | 496 const Function& function, |
| 455 const Array& arguments_descriptor, | 497 const Array& arguments_descriptor, |
| 456 intptr_t argument_count, | 498 intptr_t argument_count, |
| 457 intptr_t deopt_id, | 499 intptr_t deopt_id, |
| 458 intptr_t token_pos, | 500 intptr_t token_pos, |
| 459 LocationSummary* locs) { | 501 LocationSummary* locs) { |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { | 667 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { |
| 626 UNIMPLEMENTED(); | 668 UNIMPLEMENTED(); |
| 627 } | 669 } |
| 628 | 670 |
| 629 | 671 |
| 630 #undef __ | 672 #undef __ |
| 631 | 673 |
| 632 } // namespace dart | 674 } // namespace dart |
| 633 | 675 |
| 634 #endif // defined TARGET_ARCH_ARM64 | 676 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |