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

Unified Diff: src/bootstrapper.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: Adapted to Yang's feedback Created 5 years, 1 month 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 | « no previous file | src/contexts.h » ('j') | src/contexts.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 069a2c2e3400d7b0838e6990b87ebf00bc247893..9d2ae1b56c44aa82cb8b5cdf1f1ad0f3eaee105f 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -370,6 +370,9 @@ static void SetObjectPrototype(Handle<JSObject> object, Handle<Object> proto) {
void Bootstrapper::DetachGlobal(Handle<Context> env) {
+ env->GetIsolate()->counters()->errors_thrown_per_context()->AddSample(
+ env->GetErrorsThrown());
+
Factory* factory = env->GetIsolate()->factory();
Handle<JSGlobalProxy> global_proxy(JSGlobalProxy::cast(env->global_proxy()));
global_proxy->set_native_context(*factory->null_value());
@@ -3151,6 +3154,11 @@ Genesis::Genesis(Isolate* isolate,
AddToWeakNativeContextList(*native_context());
isolate->set_context(*native_context());
isolate->counters()->contexts_created_by_snapshot()->Increment();
+
+ // Re-initialize the counter because it got incremented during snapshot
+ // creation.
+ isolate->native_context()->set_errors_thrown(Smi::FromInt(0));
Yang 2015/11/05 07:50:01 Move this below please. Otherwise we would get wro
Michael Hablich 2015/11/05 13:23:11 After an offline discussion I now get it why it sh
+
#if TRACE_MAPS
if (FLAG_trace_maps) {
Handle<JSFunction> object_fun = isolate->object_function();
« no previous file with comments | « no previous file | src/contexts.h » ('j') | src/contexts.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698