| 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 |
| 560 // R0: result, must be preserved | 561 // R0: result, must be preserved |
| 561 void StubCode::GenerateDeoptimizeLazyFromReturnStub(Assembler* assembler) { | 562 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); |
| 562 // Push zap value instead of CODE_REG for lazy deopt. | 566 // Push zap value instead of CODE_REG for lazy deopt. |
| 563 __ LoadImmediate(TMP, 0xf1f1f1f1); | 567 __ LoadImmediate(TMP, 0xf1f1f1f1); |
| 564 __ Push(TMP); | 568 __ 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())); | |
| 568 GenerateDeoptimizationSequence(assembler, kLazyDeoptFromReturn); | 569 GenerateDeoptimizationSequence(assembler, kLazyDeoptFromReturn); |
| 569 } | 570 } |
| 570 | 571 |
| 571 | 572 |
| 573 // LR: return address + call-instruction-size |
| 572 // R0: exception, must be preserved | 574 // R0: exception, must be preserved |
| 573 // R1: stacktrace, must be preserved | 575 // R1: stacktrace, must be preserved |
| 574 void StubCode::GenerateDeoptimizeLazyFromThrowStub(Assembler* assembler) { | 576 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); |
| 575 // Push zap value instead of CODE_REG for lazy deopt. | 580 // Push zap value instead of CODE_REG for lazy deopt. |
| 576 __ LoadImmediate(TMP, 0xf1f1f1f1); | 581 __ LoadImmediate(TMP, 0xf1f1f1f1); |
| 577 __ Push(TMP); | 582 __ 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())); | |
| 581 GenerateDeoptimizationSequence(assembler, kLazyDeoptFromThrow); | 583 GenerateDeoptimizationSequence(assembler, kLazyDeoptFromThrow); |
| 582 } | 584 } |
| 583 | 585 |
| 584 | 586 |
| 585 void StubCode::GenerateDeoptimizeStub(Assembler* assembler) { | 587 void StubCode::GenerateDeoptimizeStub(Assembler* assembler) { |
| 586 GenerateDeoptimizationSequence(assembler, kEagerDeopt); | 588 GenerateDeoptimizationSequence(assembler, kEagerDeopt); |
| 587 } | 589 } |
| 588 | 590 |
| 589 | 591 |
| 590 static void GenerateDispatcherCode(Assembler* assembler, | 592 static void GenerateDispatcherCode(Assembler* assembler, |
| (...skipping 1721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2312 } | 2314 } |
| 2313 | 2315 |
| 2314 | 2316 |
| 2315 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { | 2317 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { |
| 2316 __ brk(0); | 2318 __ brk(0); |
| 2317 } | 2319 } |
| 2318 | 2320 |
| 2319 } // namespace dart | 2321 } // namespace dart |
| 2320 | 2322 |
| 2321 #endif // defined TARGET_ARCH_ARM64 | 2323 #endif // defined TARGET_ARCH_ARM64 |
| OLD | NEW |