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

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

Issue 2371323006: Further fix a throw returning to a frame marked for lazy deopt. (Closed)
Patch Set: 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 | « no previous file | runtime/vm/stub_code_arm64.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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_ARM) 6 #if defined(TARGET_ARCH_ARM)
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/cpu.h" 10 #include "vm/cpu.h"
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 if (kind == kLazyDeoptFromReturn) { 515 if (kind == kLazyDeoptFromReturn) {
516 __ Push(R1); // Preserve result, it will be GC-d here. 516 __ Push(R1); // Preserve result, it will be GC-d here.
517 } else if (kind == kLazyDeoptFromThrow) { 517 } else if (kind == kLazyDeoptFromThrow) {
518 __ Push(R1); // Preserve exception, it will be GC-d here. 518 __ Push(R1); // Preserve exception, it will be GC-d here.
519 __ Push(R2); // Preserve stacktrace, it will be GC-d here. 519 __ Push(R2); // Preserve stacktrace, it will be GC-d here.
520 } 520 }
521 __ PushObject(Smi::ZoneHandle()); // Space for the result. 521 __ PushObject(Smi::ZoneHandle()); // Space for the result.
522 __ CallRuntime(kDeoptimizeMaterializeRuntimeEntry, 0); 522 __ CallRuntime(kDeoptimizeMaterializeRuntimeEntry, 0);
523 // Result tells stub how many bytes to remove from the expression stack 523 // Result tells stub how many bytes to remove from the expression stack
524 // of the bottom-most frame. They were used as materialization arguments. 524 // of the bottom-most frame. They were used as materialization arguments.
525 __ Pop(R1); 525 __ Pop(R2);
526 if (kind == kLazyDeoptFromReturn) { 526 if (kind == kLazyDeoptFromReturn) {
527 __ Pop(R0); // Restore result. 527 __ Pop(R0); // Restore result.
528 } else if (kind == kLazyDeoptFromThrow) { 528 } else if (kind == kLazyDeoptFromThrow) {
529 __ Pop(R1); // Restore stacktrace. 529 __ Pop(R1); // Restore stacktrace.
530 __ Pop(R0); // Restore exception. 530 __ Pop(R0); // Restore exception.
531 } 531 }
532 __ LeaveStubFrame(); 532 __ LeaveStubFrame();
533 // Remove materialization arguments. 533 // Remove materialization arguments.
534 __ add(SP, SP, Operand(R1, ASR, kSmiTagSize)); 534 __ add(SP, SP, Operand(R2, ASR, kSmiTagSize));
535 __ Ret(); 535 __ Ret();
536 } 536 }
537 537
538 538
539 // LR: return address + call-instruction-size 539 // LR: return address + call-instruction-size
540 // R0: result, must be preserved 540 // R0: result, must be preserved
541 void StubCode::GenerateDeoptimizeLazyFromReturnStub(Assembler* assembler) { 541 void StubCode::GenerateDeoptimizeLazyFromReturnStub(Assembler* assembler) {
542 // Correct return address to point just after the call that is being 542 // Correct return address to point just after the call that is being
543 // deoptimized. 543 // deoptimized.
544 __ AddImmediate(LR, -CallPattern::DeoptCallPatternLengthInBytes()); 544 __ AddImmediate(LR, -CallPattern::DeoptCallPatternLengthInBytes());
(...skipping 1711 matching lines...) Expand 10 before | Expand all | Expand 10 after
2256 } 2256 }
2257 2257
2258 2258
2259 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) { 2259 void StubCode::GenerateFrameAwaitingMaterializationStub(Assembler* assembler) {
2260 __ bkpt(0); 2260 __ bkpt(0);
2261 } 2261 }
2262 2262
2263 } // namespace dart 2263 } // namespace dart
2264 2264
2265 #endif // defined TARGET_ARCH_ARM 2265 #endif // defined TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/stub_code_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698