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

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: 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
« src/contexts.cc ('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/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index f475efcc7725c72a9179a1b580baae0e44116ecb..da7ba35c6e4dc23828509eee98f34a8f9a4f8389 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -726,6 +726,7 @@ 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());
+ context->set_exceptions_thrown(Smi::FromInt(0));
DCHECK(context->IsNativeContext());
return context;
}
@@ -1159,6 +1160,7 @@ Handle<Object> Factory::NewError(Handle<JSFunction> constructor,
Handle<Object> Factory::New##NAME(MessageTemplate::Template template_index, \
Handle<Object> arg0, Handle<Object> arg1, \
Handle<Object> arg2) { \
+ isolate()->native_context()->IncrementExceptionsThrown(); \
jochen (gone - plz use gerrit) 2015/10/30 12:13:38 this looks wrong. It's not uncommon to do var a =
Yang 2015/10/30 13:01:02 As discussed offline, I suggested to do it in %For
Michael Hablich 2015/10/30 15:55:03 I moved the call to %FormatMessageString. During t
return NewError(isolate()->name##_function(), template_index, arg0, arg1, \
arg2); \
}
« src/contexts.cc ('K') | « src/counters.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698