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

Unified Diff: runtime/vm/stack_frame.h

Issue 2392613002: Reapply "Lazy deopt without code patching." (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/stub_code_arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stack_frame.h
diff --git a/runtime/vm/stack_frame.h b/runtime/vm/stack_frame.h
index 268ca4a9998819930ed8b30b3cb92ef2bab75a7e..69adea4bfbd5119a24e157e053595aea460afbde 100644
--- a/runtime/vm/stack_frame.h
+++ b/runtime/vm/stack_frame.h
@@ -53,6 +53,7 @@ class StackFrame : public ValueObject {
void set_pc(uword value) {
*reinterpret_cast<uword*>(sp() + (kSavedPcSlotFromSp * kWordSize)) = value;
+ pc_ = value;
}
void set_pc_marker(RawCode* code) {
@@ -110,8 +111,21 @@ class StackFrame : public ValueObject {
}
uword GetCallerPc() const {
- return *(reinterpret_cast<uword*>(
+ uword raw_pc = *(reinterpret_cast<uword*>(
fp() + (kSavedCallerPcSlotFromFp * kWordSize)));
+ ASSERT(raw_pc != StubCode::DeoptimizeLazyFromThrow_entry()->EntryPoint());
+ if (raw_pc == StubCode::DeoptimizeLazyFromReturn_entry()->EntryPoint()) {
+ uword fp = GetCallerFp();
+ MallocGrowableArray<PendingLazyDeopt>* pending_deopts =
+ isolate()->pending_deopts();
+ for (intptr_t i = 0; i < pending_deopts->length(); i++) {
+ if ((*pending_deopts)[i].fp() == fp) {
+ return (*pending_deopts)[i].pc();
+ }
+ }
+ UNREACHABLE();
+ }
+ return raw_pc;
}
uword fp_;
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/stub_code_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698