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

Unified Diff: src/v8.cc

Issue 186163002: Add support for allowing an embedder to get the V8 profile timer event logs. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8.cc
diff --git a/src/v8.cc b/src/v8.cc
index a415f26197b7f5cf9d001823c39021bef4d7703c..8e19638a1b1e1ced2e09d3e5f636dc2db0cb1c6e 100644
--- a/src/v8.cc
+++ b/src/v8.cc
@@ -51,6 +51,13 @@
namespace v8 {
namespace internal {
+static void empty_log_internal_events(const char* name, int se) { return; }
Yang 2014/03/06 12:05:33 I think we can remove that return statement too. j
fmeawad 2014/03/06 19:23:04 Done.
+
+static void log_internal_events(const char* name, int se) {
+ Isolate* isolate = Isolate::Current();
+ LOG(isolate, Logger::TimerEvent(static_cast<Logger::StartEnd>(se), name));
+}
+
V8_DECLARE_ONCE(init_once);
List<CallCompletedCallback>* V8::call_completed_callbacks_ = NULL;
@@ -79,6 +86,12 @@ bool V8::Initialize(Deserializer* des) {
if (isolate->IsDead()) return false;
if (isolate->IsInitialized()) return true;
+ if (!isolate->event_logger() && FLAG_log_internal_timer_events) {
+ isolate->set_event_logger(log_internal_events);
+ } else {
+ isolate->set_event_logger(empty_log_internal_events);
+ }
Yang 2014/03/06 12:05:33 I think this should be put into Isolate::Init. And
fmeawad 2014/03/06 19:23:04 Done.
+
#ifdef V8_USE_DEFAULT_PLATFORM
DefaultPlatform* platform = static_cast<DefaultPlatform*>(platform_);
platform->SetThreadPoolSize(isolate->max_available_threads());
« no previous file with comments | « src/log.cc ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698