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

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: remove modes for PredictExceptionCatcher 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
« no previous file with comments | « src/full-codegen.cc ('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..a0ea93033b8125d5e7579d8d4d793d65bd7b30a5 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
@@ -1143,8 +1143,12 @@ 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) {
+ // We are conservative with our prediction: try-finally is considered
+ // to always rethrow, to meet the expectation of the debugger.
+ if (prediction == HandlerTable::CAUGHT) return CAUGHT_BY_JAVASCRIPT;
}
}
@@ -1573,7 +1577,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) {
« no previous file with comments | « src/full-codegen.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698