| 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 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 __ Pop(R1); // Restore stacktrace. | 550 __ Pop(R1); // Restore stacktrace. |
| 551 __ Pop(R0); // Restore exception. | 551 __ Pop(R0); // Restore exception. |
| 552 } | 552 } |
| 553 __ LeaveStubFrame(); | 553 __ LeaveStubFrame(); |
| 554 // Remove materialization arguments. | 554 // Remove materialization arguments. |
| 555 __ add(SP, SP, Operand(R2)); | 555 __ add(SP, SP, Operand(R2)); |
| 556 __ ret(); | 556 __ ret(); |
| 557 } | 557 } |
| 558 | 558 |
| 559 | 559 |
| 560 // LR: return address + call-instruction-size | |
| 561 // R0: result, must be preserved | 560 // R0: result, must be preserved |
| 562 void StubCode::GenerateDeoptimizeLazyFromReturnStub(Assembler* assembler) { | 561 void StubCode::GenerateDeoptimizeLazyFromReturnStub(Assembler* assembler) { |
| 563 // Correct return address to point just after the call that is being | |
| 564 // deoptimized. | |
| 565 __ AddImmediate(LR, LR, -CallPattern::kDeoptCallLengthInBytes); | |
| 566 // Push zap value instead of CODE_REG for lazy deopt. | 562 // Push zap value instead of CODE_REG for lazy deopt. |
| 567 __ LoadImmediate(TMP, 0xf1f1f1f1); | 563 __ LoadImmediate(TMP, 0xf1f1f1f1); |
| 568 __ Push(TMP); | 564 __ Push(TMP); |
| 565 // Return address for "call" to deopt stub. |
| 566 __ LoadImmediate(LR, 0xe1e1e1e1); |
| 567 __ ldr(CODE_REG, Address(THR, Thread::lazy_deopt_from_return_stub_offset())); |
| 569 GenerateDeoptimizationSequence(assembler, kLazyDeoptFromReturn); | 568 GenerateDeoptimizationSequence(assembler, kLazyDeoptFromReturn); |
| 570 } | 569 } |
| 571 | 570 |
| 572 | 571 |
| 573 // LR: return address + call-instruction-size | |
| 574 // R0: exception, must be preserved | 572 // R0: exception, must be preserved |
| 575 // R1: stacktrace, must be preserved | 573 // R1: stacktrace, must be preserved |
| 576 void StubCode::GenerateDeoptimizeLazyFromThrowStub(Assembler* assembler) { | 574 void StubCode::GenerateDeoptimizeLazyFromThrowStub(Assembler* assembler) { |
| 577 // Correct return address to point just after the call that is being | |
| 578 // deoptimized. | |
| 579 __ AddImmediate(LR, LR, -CallPattern::kDeoptCallLengthInBytes); | |
| 580 // Push zap value instead of CODE_REG for lazy deopt. | 575 // Push zap value instead of CODE_REG for lazy deopt. |
| 581 __ LoadImmediate(TMP, 0xf1f1f1f1); | 576 __ LoadImmediate(TMP, 0xf1f1f1f1); |
| 582 __ Push(TMP); | 577 __ Push(TMP); |
| 578 // Return address for "call" to deopt stub. |
| 579 __ LoadImmediate(LR, 0xe1e1e1e1); |
| 580 __ ldr(CODE_REG, Address(THR, Thread::lazy_deopt_from_throw_stub_offset())); |
| 583 GenerateDeoptimizationSequence(assembler, kLazyDeoptFromThrow); | 581 GenerateDeoptimizationSequence(assembler, kLazyDeoptFromThrow); |
| 584 } | 582 } |
| 585 | 583 |
| 586 | 584 |
| 587 void StubCode::GenerateDeoptimizeStub(Assembler* assembler) { | 585 void StubCode::GenerateDeoptimizeStub(Assembler* assembler) { |
| 588 GenerateDeoptimizationSequence(assembler, kEagerDeopt); | 586 GenerateDeoptimizationSequence(assembler, kEagerDeopt); |
| 589 } | 587 } |
| 590 | 588 |
| 591 | 589 |
| 592 static void GenerateDispatcherCode(Assembler* assembler, | 590 static void GenerateDispatcherCode(Assembler* assembler, |
| (...skipping 1721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2314 } | 2312 } |
| 2315 | 2313 |
| 2316 | 2314 |
| 2317 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { | 2315 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { |
| 2318 __ brk(0); | 2316 __ brk(0); |
| 2319 } | 2317 } |
| 2320 | 2318 |
| 2321 } // namespace dart | 2319 } // namespace dart |
| 2322 | 2320 |
| 2323 #endif // defined TARGET_ARCH_ARM64 | 2321 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |