| 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" | 5 #include "vm/globals.h" |
| 6 #if defined(TARGET_ARCH_ARM64) | 6 #if defined(TARGET_ARCH_ARM64) |
| 7 | 7 |
| 8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
| 9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 // Code above cannot cause GC. | 511 // Code above cannot cause GC. |
| 512 // There is a Dart Frame on the stack. We must restore PP and leave frame. | 512 // There is a Dart Frame on the stack. We must restore PP and leave frame. |
| 513 __ LeaveDartFrame(); | 513 __ LeaveDartFrame(); |
| 514 | 514 |
| 515 // Frame is fully rewritten at this point and it is safe to perform a GC. | 515 // Frame is fully rewritten at this point and it is safe to perform a GC. |
| 516 // Materialize any objects that were deferred by FillFrame because they | 516 // Materialize any objects that were deferred by FillFrame because they |
| 517 // require allocation. | 517 // require allocation. |
| 518 // Enter stub frame with loading PP. The caller's PP is not materialized yet. | 518 // Enter stub frame with loading PP. The caller's PP is not materialized yet. |
| 519 __ EnterStubFrame(); | 519 __ EnterStubFrame(); |
| 520 if (preserve_result) { | 520 if (preserve_result) { |
| 521 __ Push(ZR); // Workaround for dropped stack slot during GC. | |
| 522 __ Push(R1); // Preserve result, it will be GC-d here. | 521 __ Push(R1); // Preserve result, it will be GC-d here. |
| 523 } | 522 } |
| 524 __ Push(ZR); // Space for the result. | 523 __ Push(ZR); // Space for the result. |
| 525 __ CallRuntime(kDeoptimizeMaterializeRuntimeEntry, 0); | 524 __ CallRuntime(kDeoptimizeMaterializeRuntimeEntry, 0); |
| 526 // Result tells stub how many bytes to remove from the expression stack | 525 // Result tells stub how many bytes to remove from the expression stack |
| 527 // of the bottom-most frame. They were used as materialization arguments. | 526 // of the bottom-most frame. They were used as materialization arguments. |
| 528 __ Pop(R1); | 527 __ Pop(R1); |
| 529 __ SmiUntag(R1); | 528 __ SmiUntag(R1); |
| 530 if (preserve_result) { | 529 if (preserve_result) { |
| 531 __ Pop(R0); // Restore result. | 530 __ Pop(R0); // Restore result. |
| 532 __ Drop(1); // Workaround for dropped stack slot during GC. | |
| 533 } | 531 } |
| 534 __ LeaveStubFrame(); | 532 __ LeaveStubFrame(); |
| 535 // Remove materialization arguments. | 533 // Remove materialization arguments. |
| 536 __ add(SP, SP, Operand(R1)); | 534 __ add(SP, SP, Operand(R1)); |
| 537 __ ret(); | 535 __ ret(); |
| 538 } | 536 } |
| 539 | 537 |
| 540 | 538 |
| 541 void StubCode::GenerateDeoptimizeLazyStub(Assembler* assembler) { | 539 void StubCode::GenerateDeoptimizeLazyStub(Assembler* assembler) { |
| 542 // Correct return address to point just after the call that is being | 540 // Correct return address to point just after the call that is being |
| (...skipping 1610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2153 // Result: | 2151 // Result: |
| 2154 // R1: entry point. | 2152 // R1: entry point. |
| 2155 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { | 2153 void StubCode::GenerateMegamorphicLookupStub(Assembler* assembler) { |
| 2156 EmitMegamorphicLookup(assembler, R0, R1, R1); | 2154 EmitMegamorphicLookup(assembler, R0, R1, R1); |
| 2157 __ ret(); | 2155 __ ret(); |
| 2158 } | 2156 } |
| 2159 | 2157 |
| 2160 } // namespace dart | 2158 } // namespace dart |
| 2161 | 2159 |
| 2162 #endif // defined TARGET_ARCH_ARM64 | 2160 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |