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

Unified Diff: src/factory.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: Moved counting from creation to throwing again 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/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index f475efcc7725c72a9179a1b580baae0e44116ecb..5266e9d8c5b27027049e2a59284a78c94e25e20e 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -726,6 +726,10 @@ Handle<Context> Factory::NewNativeContext() {
array->set_map_no_write_barrier(*native_context_map());
Handle<Context> context = Handle<Context>::cast(array);
context->set_js_array_maps(*undefined_value());
+ // Initialize with -1 because the value is incremented once
+ // during the build. This means the value is correctly initialized to
+ // 0 afterwards.
+ context->set_errors_thrown(Smi::FromInt(-1));
Yang 2015/11/02 05:48:57 This seems somewhat brittle. Could we move this l
Michael Hablich 2015/11/04 10:58:08 Thanks for the remark. I left the initialization i
DCHECK(context->IsNativeContext());
return context;
}
« src/contexts.cc ('K') | « src/counters.h ('k') | src/runtime/runtime-internal.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698