Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: runtime/vm/stub_code_arm64.cc

Issue 2380403003: Lazy deopt without code patching. (Closed)
Patch Set: remove tracing register assignment Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « runtime/vm/stub_code_arm.cc ('k') | runtime/vm/stub_code_ia32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « runtime/vm/stub_code_arm.cc ('k') | runtime/vm/stub_code_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698