Index: src/bootstrapper.cc |
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc |
index 79e1a792413bc48def34ed1b412302908b7ac19a..6ba836a8e0317e8a21ff2db8ab85ee3320a2fdba 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()); |
@@ -3205,6 +3208,9 @@ Genesis::Genesis(Isolate* isolate, |
if (!ConfigureGlobalObjects(global_proxy_template)) return; |
} |
isolate->counters()->contexts_created_from_scratch()->Increment(); |
+ // Re-initialize the counter because it got incremented during snapshot |
+ // creation. |
+ isolate->native_context()->set_errors_thrown(Smi::FromInt(0)); |
} |
// Install experimental natives. Do not include them into the |