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

Unified Diff: src/log.cc

Issue 388783004: Do not expose all timer events to the API callback. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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
« no previous file with comments | « src/log.h ('k') | src/optimizing-compiler-thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/log.cc
diff --git a/src/log.cc b/src/log.cc
index e8ecb1412b3ad5d08894bb798c1e16defa1e22b6..02d2c6789142999a56313c0c7689996e650a0529 100644
--- a/src/log.cc
+++ b/src/log.cc
@@ -928,7 +928,7 @@ void Logger::CurrentTimeEvent() {
}
-void Logger::TimerEvent(StartEnd se, const char* name) {
+void Logger::TimerEvent(Logger::StartEnd se, const char* name) {
if (!log_->IsEnabled()) return;
ASSERT(FLAG_log_internal_timer_events);
Log::MessageBuilder msg(log_);
@@ -941,39 +941,40 @@ void Logger::TimerEvent(StartEnd se, const char* name) {
void Logger::EnterExternal(Isolate* isolate) {
- LOG(isolate, TimerEvent(START, TimerEventScope::v8_external));
+ LOG(isolate, TimerEvent(START, TimerEventExternal::name()));
ASSERT(isolate->current_vm_state() == JS);
isolate->set_current_vm_state(EXTERNAL);
}
void Logger::LeaveExternal(Isolate* isolate) {
- LOG(isolate, TimerEvent(END, TimerEventScope::v8_external));
+ LOG(isolate, TimerEvent(END, TimerEventExternal::name()));
ASSERT(isolate->current_vm_state() == EXTERNAL);
isolate->set_current_vm_state(JS);
}
-void Logger::LogInternalEvents(const char* name, int se) {
+void Logger::DefaultTimerEventsLogger(const char* name, int se) {
Isolate* isolate = Isolate::Current();
LOG(isolate, TimerEvent(static_cast<StartEnd>(se), name));
}
-void Logger::TimerEventScope::LogTimerEvent(StartEnd se) {
- isolate_->event_logger()(name_, se);
+template <class TimerEvent>
+void TimerEventScope<TimerEvent>::LogTimerEvent(Logger::StartEnd se) {
+ if (TimerEvent::expose_to_api() ||
+ isolate_->event_logger() == Logger::DefaultTimerEventsLogger) {
+ isolate_->event_logger()(TimerEvent::name(), se);
+ }
}
-const char* Logger::TimerEventScope::v8_recompile_synchronous =
- "V8.RecompileSynchronous";
-const char* Logger::TimerEventScope::v8_recompile_concurrent =
- "V8.RecompileConcurrent";
-const char* Logger::TimerEventScope::v8_compile_full_code =
- "V8.CompileFullCode";
-const char* Logger::TimerEventScope::v8_execute = "V8.Execute";
-const char* Logger::TimerEventScope::v8_external = "V8.External";
-const char* Logger::TimerEventScope::v8_ic_miss = "V8.IcMiss";
+// Instantiate template methods.
+#define V(TimerName, expose) \
+ template void TimerEventScope<TimerEvent##TimerName>::LogTimerEvent( \
+ Logger::StartEnd se);
+TIMER_EVENTS_LIST(V)
+#undef V
void Logger::LogRegExpSource(Handle<JSRegExp> regexp) {
« no previous file with comments | « src/log.h ('k') | src/optimizing-compiler-thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698