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 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 __ Push(R1); // Preserve result, it will be GC-d here. | 535 __ Push(R1); // Preserve result, it will be GC-d here. |
536 } else if (kind == kLazyDeoptFromThrow) { | 536 } else if (kind == kLazyDeoptFromThrow) { |
537 __ Push(R1); // Preserve exception, it will be GC-d here. | 537 __ Push(R1); // Preserve exception, it will be GC-d here. |
538 __ Push(R2); // Preserve stacktrace, it will be GC-d here. | 538 __ Push(R2); // Preserve stacktrace, it will be GC-d here. |
539 } | 539 } |
540 | 540 |
541 __ Push(ZR); // Space for the result. | 541 __ Push(ZR); // Space for the result. |
542 __ CallRuntime(kDeoptimizeMaterializeRuntimeEntry, 0); | 542 __ CallRuntime(kDeoptimizeMaterializeRuntimeEntry, 0); |
543 // Result tells stub how many bytes to remove from the expression stack | 543 // Result tells stub how many bytes to remove from the expression stack |
544 // of the bottom-most frame. They were used as materialization arguments. | 544 // of the bottom-most frame. They were used as materialization arguments. |
545 __ Pop(R1); | 545 __ Pop(R2); |
546 __ SmiUntag(R1); | 546 __ SmiUntag(R2); |
547 if (kind == kLazyDeoptFromReturn) { | 547 if (kind == kLazyDeoptFromReturn) { |
548 __ Pop(R0); // Restore result. | 548 __ Pop(R0); // Restore result. |
549 } else if (kind == kLazyDeoptFromThrow) { | 549 } else if (kind == kLazyDeoptFromThrow) { |
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(R1)); | 555 __ add(SP, SP, Operand(R2)); |
556 __ ret(); | 556 __ ret(); |
557 } | 557 } |
558 | 558 |
559 | 559 |
560 // LR: return address + call-instruction-size | 560 // LR: return address + call-instruction-size |
561 // R0: result, must be preserved | 561 // R0: result, must be preserved |
562 void StubCode::GenerateDeoptimizeLazyFromReturnStub(Assembler* assembler) { | 562 void StubCode::GenerateDeoptimizeLazyFromReturnStub(Assembler* assembler) { |
563 // Correct return address to point just after the call that is being | 563 // Correct return address to point just after the call that is being |
564 // deoptimized. | 564 // deoptimized. |
565 __ AddImmediate(LR, LR, -CallPattern::kDeoptCallLengthInBytes); | 565 __ AddImmediate(LR, LR, -CallPattern::kDeoptCallLengthInBytes); |
(...skipping 1748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2314 } | 2314 } |
2315 | 2315 |
2316 | 2316 |
2317 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { | 2317 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { |
2318 __ brk(0); | 2318 __ brk(0); |
2319 } | 2319 } |
2320 | 2320 |
2321 } // namespace dart | 2321 } // namespace dart |
2322 | 2322 |
2323 #endif // defined TARGET_ARCH_ARM64 | 2323 #endif // defined TARGET_ARCH_ARM64 |
OLD | NEW |