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

Unified Diff: runtime/vm/exceptions.cc

Issue 2741553002: Do not rely on code patching on DBC for lazy deoptimization. (Closed)
Patch Set: Code review Created 3 years, 9 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/code_patcher_x64.cc ('k') | runtime/vm/instructions_dbc.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/exceptions.cc
diff --git a/runtime/vm/exceptions.cc b/runtime/vm/exceptions.cc
index 0ee20ad2f34ddbf796c25f926172cf0440938d47..88eb7c1ee1971299ba7671645ac064b5a27c084c 100644
--- a/runtime/vm/exceptions.cc
+++ b/runtime/vm/exceptions.cc
@@ -209,7 +209,6 @@ static void FindErrorHandler(uword* handler_pc,
static uword RemapExceptionPCForDeopt(Thread* thread,
uword program_counter,
uword frame_pointer) {
-#if !defined(TARGET_ARCH_DBC)
MallocGrowableArray<PendingLazyDeopt>* pending_deopts =
thread->isolate()->pending_deopts();
if (pending_deopts->length() > 0) {
@@ -231,13 +230,11 @@ static uword RemapExceptionPCForDeopt(Thread* thread,
}
}
}
-#endif // !DBC
return program_counter;
}
static void ClearLazyDeopts(Thread* thread, uword frame_pointer) {
-#if !defined(TARGET_ARCH_DBC)
MallocGrowableArray<PendingLazyDeopt>* pending_deopts =
thread->isolate()->pending_deopts();
if (pending_deopts->length() > 0) {
@@ -247,7 +244,7 @@ static void ClearLazyDeopts(Thread* thread, uword frame_pointer) {
{
DartFrameIterator frames(thread);
StackFrame* frame = frames.NextFrame();
- while ((frame != NULL) && (frame->fp() < frame_pointer)) {
+ while ((frame != NULL) && IsCalleeFrameOf(frame_pointer, frame->fp())) {
if (frame->IsMarkedForLazyDeopt()) {
frame->UnmarkForLazyDeopt();
}
@@ -260,7 +257,7 @@ static void ClearLazyDeopts(Thread* thread, uword frame_pointer) {
#endif
for (intptr_t i = 0; i < pending_deopts->length(); i++) {
- if ((*pending_deopts)[i].fp() < frame_pointer) {
+ if (IsCalleeFrameOf(frame_pointer, (*pending_deopts)[i].fp())) {
if (FLAG_trace_deoptimization) {
THR_Print(
"Lazy deopt skipped due to throw for "
@@ -275,7 +272,6 @@ static void ClearLazyDeopts(Thread* thread, uword frame_pointer) {
ValidateFrames();
#endif
}
-#endif // !DBC
}
@@ -301,8 +297,13 @@ void Exceptions::JumpToFrame(Thread* thread,
uword stack_pointer,
uword frame_pointer,
bool clear_deopt_at_target) {
- uword fp_for_clearing =
- (clear_deopt_at_target ? frame_pointer + 1 : frame_pointer);
+ uword fp_for_clearing = (clear_deopt_at_target
+#if defined(TARGET_ARCH_DBC)
+ ? frame_pointer - 1
+#else
+ ? frame_pointer + 1
+#endif
+ : frame_pointer);
ClearLazyDeopts(thread, fp_for_clearing);
#if defined(USING_SIMULATOR)
// Unwinding of the C++ frames and destroying of their stack resources is done
« no previous file with comments | « runtime/vm/code_patcher_x64.cc ('k') | runtime/vm/instructions_dbc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698