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

Unified Diff: src/contexts.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: Adaptations to feedback and now all V8 exceptions are counted 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
Index: src/contexts.cc
diff --git a/src/contexts.cc b/src/contexts.cc
index a18f181bef8ccb3e0ca80d43dc5a1f3107105d73..f43e579138a9bc89fedf35c0c95a18038cb18063 100644
--- a/src/contexts.cc
+++ b/src/contexts.cc
@@ -589,5 +589,17 @@ bool Context::IsBootstrappingOrGlobalObject(Isolate* isolate, Object* object) {
}
#endif
Michael Starzinger 2015/10/30 12:27:10 nit: Two empty newlines between top-level declarat
Michael Hablich 2015/10/30 15:55:03 Done.
+void Context::IncrementExceptionsThrown() {
+ DCHECK(IsNativeContext());
+
+ int previous_value = Smi::cast(exceptions_thrown())->value();
+ set_exceptions_thrown(Smi::FromInt(previous_value+1));
+}
+
+
+int Context::GetExceptionsThrown() {
+ return Smi::cast(exceptions_thrown())->value();
+}
+
} // namespace internal
} // namespace v8

Powered by Google App Engine
This is Rietveld 408576698