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())); |