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

Unified Diff: runtime/vm/dart.cc

Issue 1294023009: Switch to a VM wide timeline recorder (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 | « runtime/bin/main.cc ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart.cc
diff --git a/runtime/vm/dart.cc b/runtime/vm/dart.cc
index 8880a89ad83899e4defa5211695b5d5b810c2ea0..467156009f86e612629f658709e393a61ceb7ee9 100644
--- a/runtime/vm/dart.cc
+++ b/runtime/vm/dart.cc
@@ -27,13 +27,11 @@
#include "vm/symbols.h"
#include "vm/thread_interrupter.h"
#include "vm/thread_pool.h"
-#include "vm/timeline.h"
#include "vm/virtual_memory.h"
#include "vm/zone.h"
namespace dart {
-DECLARE_FLAG(bool, complete_timeline);
DECLARE_FLAG(bool, print_class_table);
DECLARE_FLAG(bool, trace_isolates);
DEFINE_FLAG(bool, keep_code, false,
@@ -87,6 +85,10 @@ const char* Dart::InitOnce(const uint8_t* vm_isolate_snapshot,
OS::InitOnce();
VirtualMemory::InitOnce();
Thread::InitOnceBeforeIsolate();
+ Timeline::InitOnce();
+ Thread::EnsureInit();
+ TimelineDurationScope tds(Timeline::GetVMStream(),
+ "Dart::InitOnce");
Isolate::InitOnce();
PortMap::InitOnce();
FreeListElement::InitOnce();
@@ -97,6 +99,7 @@ const char* Dart::InitOnce(const uint8_t* vm_isolate_snapshot,
SemiSpace::InitOnce();
Metric::InitOnce();
StoreBuffer::InitOnce();
+ Thread::EnsureInit();
Ivan Posva 2015/08/21 02:25:38 Shouldn't this be called ReallyEnsureInit? Since i
#if defined(USING_SIMULATOR)
Simulator::InitOnce();
@@ -216,6 +219,7 @@ const char* Dart::Cleanup() {
Profiler::Shutdown();
CodeObservers::DeleteAll();
+ Timeline::Shutdown();
return NULL;
}
@@ -234,10 +238,21 @@ RawError* Dart::InitializeIsolate(const uint8_t* snapshot_buffer, void* data) {
// Initialize the new isolate.
Isolate* isolate = Isolate::Current();
TIMERSCOPE(isolate, time_isolate_initialization);
+ TimelineDurationScope tds(isolate,
+ isolate->GetIsolateStream(),
+ "InitializeIsolate");
+ tds.SetNumArguments(1);
+ tds.CopyArgument(0, "isolateName", isolate->name());
+
ASSERT(isolate != NULL);
StackZone zone(isolate);
HandleScope handle_scope(isolate);
- ObjectStore::Init(isolate);
+ {
+ TimelineDurationScope tds(isolate,
+ isolate->GetIsolateStream(),
+ "ObjectStore::Init");
+ ObjectStore::Init(isolate);
+ }
// Setup for profiling.
Profiler::InitProfilingForIsolate(isolate);
@@ -248,7 +263,9 @@ RawError* Dart::InitializeIsolate(const uint8_t* snapshot_buffer, void* data) {
}
if (snapshot_buffer != NULL) {
// Read the snapshot and setup the initial state.
-
+ TimelineDurationScope tds(isolate,
+ isolate->GetIsolateStream(),
+ "IsolateSnapshotReader");
// TODO(turnidge): Remove once length is not part of the snapshot.
const Snapshot* snapshot = Snapshot::SetupFromBuffer(snapshot_buffer);
if (snapshot == NULL) {
@@ -282,7 +299,13 @@ RawError* Dart::InitializeIsolate(const uint8_t* snapshot_buffer, void* data) {
Object::VerifyBuiltinVtables();
- StubCode::Init(isolate);
+ {
+ TimelineDurationScope tds(isolate,
+ isolate->GetIsolateStream(),
+ "StubCode::Init");
+ StubCode::Init(isolate);
+ }
+
isolate->megamorphic_cache_table()->InitMissHandler();
if (snapshot_buffer == NULL) {
if (!isolate->object_store()->PreallocateObjects()) {
@@ -309,13 +332,6 @@ RawError* Dart::InitializeIsolate(const uint8_t* snapshot_buffer, void* data) {
const UserTag& default_tag = UserTag::Handle(UserTag::DefaultTag());
isolate->set_current_tag(default_tag);
- if (FLAG_complete_timeline) {
- isolate->SetTimelineEventRecorder(new TimelineEventEndlessRecorder());
- } else {
- isolate->SetTimelineEventRecorder(new TimelineEventRingRecorder());
- }
-
-
if (FLAG_keep_code) {
isolate->set_deoptimized_code_array(
GrowableObjectArray::Handle(GrowableObjectArray::New()));
« no previous file with comments | « runtime/bin/main.cc ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698