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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 // TODO(zra): Can I use a normal BranchPatchable here? Probably have to change | 349 // TODO(zra): Can I use a normal BranchPatchable here? Probably have to change |
350 // the CodePatcher. | 350 // the CodePatcher. |
351 __ BranchFixed(&StubCode::DeoptimizeLazyLabel()); | 351 __ BranchFixed(&StubCode::DeoptimizeLazyLabel()); |
352 } | 352 } |
353 | 353 |
354 | 354 |
355 void FlowGraphCompiler::GenerateCall(intptr_t token_pos, | 355 void FlowGraphCompiler::GenerateCall(intptr_t token_pos, |
356 const ExternalLabel* label, | 356 const ExternalLabel* label, |
357 PcDescriptors::Kind kind, | 357 PcDescriptors::Kind kind, |
358 LocationSummary* locs) { | 358 LocationSummary* locs) { |
359 UNIMPLEMENTED(); | 359 __ BranchLinkPatchable(label); |
| 360 AddCurrentDescriptor(kind, Isolate::kNoDeoptId, token_pos); |
| 361 RecordSafepoint(locs); |
360 } | 362 } |
361 | 363 |
362 | 364 |
363 void FlowGraphCompiler::GenerateDartCall(intptr_t deopt_id, | 365 void FlowGraphCompiler::GenerateDartCall(intptr_t deopt_id, |
364 intptr_t token_pos, | 366 intptr_t token_pos, |
365 const ExternalLabel* label, | 367 const ExternalLabel* label, |
366 PcDescriptors::Kind kind, | 368 PcDescriptors::Kind kind, |
367 LocationSummary* locs) { | 369 LocationSummary* locs) { |
368 __ BranchLinkPatchable(label); | 370 __ BranchLinkPatchable(label); |
369 AddCurrentDescriptor(kind, deopt_id, token_pos); | 371 AddCurrentDescriptor(kind, deopt_id, token_pos); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 UNIMPLEMENTED(); | 432 UNIMPLEMENTED(); |
431 } | 433 } |
432 | 434 |
433 | 435 |
434 void FlowGraphCompiler::EmitInstanceCall(ExternalLabel* target_label, | 436 void FlowGraphCompiler::EmitInstanceCall(ExternalLabel* target_label, |
435 const ICData& ic_data, | 437 const ICData& ic_data, |
436 intptr_t argument_count, | 438 intptr_t argument_count, |
437 intptr_t deopt_id, | 439 intptr_t deopt_id, |
438 intptr_t token_pos, | 440 intptr_t token_pos, |
439 LocationSummary* locs) { | 441 LocationSummary* locs) { |
440 UNIMPLEMENTED(); | 442 __ LoadObject(R5, ic_data, PP); |
| 443 GenerateDartCall(deopt_id, |
| 444 token_pos, |
| 445 target_label, |
| 446 PcDescriptors::kIcCall, |
| 447 locs); |
| 448 __ Drop(argument_count); |
441 } | 449 } |
442 | 450 |
443 | 451 |
444 void FlowGraphCompiler::EmitMegamorphicInstanceCall( | 452 void FlowGraphCompiler::EmitMegamorphicInstanceCall( |
445 const ICData& ic_data, | 453 const ICData& ic_data, |
446 intptr_t argument_count, | 454 intptr_t argument_count, |
447 intptr_t deopt_id, | 455 intptr_t deopt_id, |
448 intptr_t token_pos, | 456 intptr_t token_pos, |
449 LocationSummary* locs) { | 457 LocationSummary* locs) { |
450 UNIMPLEMENTED(); | 458 UNIMPLEMENTED(); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 bool needs_number_check, | 516 bool needs_number_check, |
509 intptr_t token_pos) { | 517 intptr_t token_pos) { |
510 UNIMPLEMENTED(); | 518 UNIMPLEMENTED(); |
511 } | 519 } |
512 | 520 |
513 | 521 |
514 void FlowGraphCompiler::EmitEqualityRegRegCompare(Register left, | 522 void FlowGraphCompiler::EmitEqualityRegRegCompare(Register left, |
515 Register right, | 523 Register right, |
516 bool needs_number_check, | 524 bool needs_number_check, |
517 intptr_t token_pos) { | 525 intptr_t token_pos) { |
518 UNIMPLEMENTED(); | 526 if (needs_number_check) { |
| 527 __ Push(left); |
| 528 __ Push(right); |
| 529 if (is_optimizing()) { |
| 530 __ BranchLinkPatchable( |
| 531 &StubCode::OptimizedIdenticalWithNumberCheckLabel()); |
| 532 } else { |
| 533 __ BranchLinkPatchable( |
| 534 &StubCode::UnoptimizedIdenticalWithNumberCheckLabel()); |
| 535 } |
| 536 if (token_pos != Scanner::kNoSourcePos) { |
| 537 AddCurrentDescriptor(PcDescriptors::kRuntimeCall, |
| 538 Isolate::kNoDeoptId, |
| 539 token_pos); |
| 540 } |
| 541 // Stub returns result in flags (result of a cmpl, we need ZF computed). |
| 542 __ Pop(right); |
| 543 __ Pop(left); |
| 544 } else { |
| 545 __ CompareRegisters(left, right); |
| 546 } |
519 } | 547 } |
520 | 548 |
521 | 549 |
522 // This function must be in sync with FlowGraphCompiler::RecordSafepoint and | 550 // This function must be in sync with FlowGraphCompiler::RecordSafepoint and |
523 // FlowGraphCompiler::SlowPathEnvironmentFor. | 551 // FlowGraphCompiler::SlowPathEnvironmentFor. |
524 void FlowGraphCompiler::SaveLiveRegisters(LocationSummary* locs) { | 552 void FlowGraphCompiler::SaveLiveRegisters(LocationSummary* locs) { |
525 // TODO(zra): Save live FPU Registers. | 553 // TODO(zra): Save live FPU Registers. |
526 | 554 |
527 // Store general purpose registers with the highest register number at the | 555 // Store general purpose registers with the highest register number at the |
528 // lowest address. | 556 // lowest address. |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { | 695 void ParallelMoveResolver::RestoreFpuScratch(FpuRegister reg) { |
668 UNIMPLEMENTED(); | 696 UNIMPLEMENTED(); |
669 } | 697 } |
670 | 698 |
671 | 699 |
672 #undef __ | 700 #undef __ |
673 | 701 |
674 } // namespace dart | 702 } // namespace dart |
675 | 703 |
676 #endif // defined TARGET_ARCH_ARM64 | 704 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |