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

Unified Diff: src/isolate.cc

Issue 1413503007: Provide a counter for thrown JavaScript errors per context (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Per context counting implemented Created 5 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
« src/counters.h ('K') | « src/counters.h ('k') | no next file » | 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 f50c2fad876a7c8898ce1dc56451166e73815dd6..e6e64c20e72f1cf69eeb125753567d7c58d5954d 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -1019,6 +1019,11 @@ Object* Isolate::Throw(Object* exception, MessageLocation* location) {
Handle<Object> message_obj = CreateMessage(exception_handle, location);
thread_local_top()->pending_message_obj_ = *message_obj;
+ bool exception_is_uncaught = (
+ PredictExceptionCatcher() != CAUGHT_BY_JAVASCRIPT);
Michael Starzinger 2015/10/29 13:42:55 Notes about PredictExceptionCatcher: 1) Calling t
Michael Hablich 2015/10/29 15:23:34 I moved the whole counting into the factory which
+
+ if (exception_is_uncaught) context()->IncrementExceptionsThrown();
jochen (gone - plz use gerrit) 2015/10/29 14:37:07 use native_context()
Michael Hablich 2015/10/29 15:23:34 Done.
+
// For any exception not caught by JavaScript, even when an external
// handler is present:
// If the abort-on-uncaught-exception flag is specified, and if the
@@ -1026,7 +1031,7 @@ Object* Isolate::Throw(Object* exception, MessageLocation* location) {
// or if the custom callback determined that V8 should abort, then
// abort.
if (FLAG_abort_on_uncaught_exception &&
- PredictExceptionCatcher() != CAUGHT_BY_JAVASCRIPT &&
+ exception_is_uncaught &&
(!abort_on_uncaught_exception_callback_ ||
abort_on_uncaught_exception_callback_(
reinterpret_cast<v8::Isolate*>(this)))) {
@@ -2855,5 +2860,6 @@ bool PostponeInterruptsScope::Intercept(StackGuard::InterruptFlag flag) {
return false;
}
+
} // namespace internal
} // namespace v8
« src/counters.h ('K') | « src/counters.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698