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

Unified Diff: src/isolate.cc

Issue 2247353005: [builtins] support exception handling in TFJ builtins (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index b4b3c38289dcf1a3fc92f7eff04156c284f271a9..51978d82bb08c88e3afb074760d73295bb516ef9 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -1280,6 +1280,28 @@ Object* Isolate::UnwindAndFindHandler() {
}
}
+ if (frame->is_stub() && catchable_by_js) {
+ StubFrame* stub_frame = StubFrame::cast(frame);
+ int stack_depth = 0;
+ int code_offset =
+ stub_frame->LookupExceptionHandlerInTable(&stack_depth, nullptr);
+ if (code_offset >= 0) {
+ Address return_sp = frame->fp() -
+ StandardFrameConstants::kFixedFrameSizeFromFp -
+ stack_depth * kPointerSize;
+ STATIC_ASSERT(TryBlockConstant::kElementCount == 1);
+ Object* maybe_context = Memory::Object_at(return_sp - kPointerSize);
+ context = maybe_context->IsContext() ? Context::cast(maybe_context)
+ : raw_native_context();
caitp 2016/08/18 03:08:57 I'm not sure about this: For TFJ builtins, it loo
+
+ code = frame->LookupCode();
+ handler_sp = return_sp;
+ handler_fp = frame->fp();
+ offset = code_offset;
caitp 2016/08/18 03:08:57 Without setting the offset, the stub is restarted
+ break;
+ }
+ }
+
RemoveMaterializedObjectsOnUnwind(frame);
}

Powered by Google App Engine
This is Rietveld 408576698