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

Unified Diff: src/isolate.cc

Issue 1154163006: Debugger: consider try-finally scopes not catching wrt debug events. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: do not specifically test turbofan Created 5 years, 7 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
« src/isolate.h ('K') | « src/isolate.h ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index dc5b5368f6e4d383a0b9d0d819234d975af83567..37e4d882a88e573004a518a765f7c78efc9640d5 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -1067,7 +1067,7 @@ Object* Isolate::UnwindAndFindHandler() {
if (frame->is_optimized() && catchable_by_js) {
OptimizedFrame* js_frame = static_cast<OptimizedFrame*>(frame);
int stack_slots = 0; // Will contain stack slot count of frame.
- offset = js_frame->LookupExceptionHandlerInTable(&stack_slots);
+ offset = js_frame->LookupExceptionHandlerInTable(&stack_slots, NULL);
if (offset >= 0) {
// Compute the stack pointer from the frame pointer. This ensures that
// argument slots on the stack are dropped as returning would.
@@ -1087,7 +1087,7 @@ Object* Isolate::UnwindAndFindHandler() {
if (frame->is_java_script() && catchable_by_js) {
JavaScriptFrame* js_frame = static_cast<JavaScriptFrame*>(frame);
int stack_slots = 0; // Will contain operand stack depth of handler.
- offset = js_frame->LookupExceptionHandlerInTable(&stack_slots);
+ offset = js_frame->LookupExceptionHandlerInTable(&stack_slots, NULL);
if (offset >= 0) {
// Compute the stack pointer from the frame pointer. This ensures that
// operand stack slots are dropped for nested statements. Also restore
@@ -1125,7 +1125,8 @@ Object* Isolate::UnwindAndFindHandler() {
}
-Isolate::CatchType Isolate::PredictExceptionCatcher() {
+Isolate::CatchType Isolate::PredictExceptionCatcher(
+ Isolate::ExceptionPredictionMode mode) {
Address external_handler = thread_local_top()->try_catch_handler_address();
Address entry_handler = Isolate::handler(thread_local_top());
if (IsExternalHandlerOnTop(nullptr)) return CAUGHT_BY_EXTERNAL;
@@ -1143,8 +1144,13 @@ Isolate::CatchType Isolate::PredictExceptionCatcher() {
if (frame->is_java_script()) {
JavaScriptFrame* js_frame = static_cast<JavaScriptFrame*>(frame);
int stack_slots = 0; // The computed stack slot count is not used.
- if (js_frame->LookupExceptionHandlerInTable(&stack_slots) > 0) {
- return CAUGHT_BY_JAVASCRIPT;
+ HandlerTable::CatchPrediction prediction;
+ if (js_frame->LookupExceptionHandlerInTable(&stack_slots, &prediction) >
+ 0) {
+ if (mode != CONSERVATIVE_PREDICTION ||
+ prediction != HandlerTable::UNCAUGHT) {
+ return CAUGHT_BY_JAVASCRIPT;
+ }
}
}
@@ -1573,7 +1579,7 @@ Handle<Object> Isolate::GetPromiseOnStackOnThrow() {
for (JavaScriptFrameIterator it(this); !it.done(); it.Advance()) {
JavaScriptFrame* frame = it.frame();
int stack_slots = 0; // The computed stack slot count is not used.
- if (frame->LookupExceptionHandlerInTable(&stack_slots) > 0) {
+ if (frame->LookupExceptionHandlerInTable(&stack_slots, NULL) > 0) {
// Throwing inside a Promise only leads to a reject if not caught by an
// inner try-catch or try-finally.
if (frame->function() == *promise_function) {
« src/isolate.h ('K') | « src/isolate.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698