| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/dart.h" | 5 #include "vm/dart.h" |
| 6 | 6 |
| 7 #include "vm/dart_api_state.h" | 7 #include "vm/dart_api_state.h" |
| 8 #include "vm/flags.h" | 8 #include "vm/flags.h" |
| 9 #include "vm/freelist.h" | 9 #include "vm/freelist.h" |
| 10 #include "vm/handles.h" | 10 #include "vm/handles.h" |
| 11 #include "vm/heap.h" | 11 #include "vm/heap.h" |
| 12 #include "vm/isolate.h" | 12 #include "vm/isolate.h" |
| 13 #include "vm/object.h" | 13 #include "vm/object.h" |
| 14 #include "vm/object_store.h" | 14 #include "vm/object_store.h" |
| 15 #include "vm/port.h" | 15 #include "vm/port.h" |
| 16 #include "vm/snapshot.h" | 16 #include "vm/snapshot.h" |
| 17 #include "vm/stub_code.h" | 17 #include "vm/stub_code.h" |
| 18 #include "vm/thread_pool.h" | 18 #include "vm/thread_pool.h" |
| 19 #include "vm/virtual_memory.h" | 19 #include "vm/virtual_memory.h" |
| 20 #include "vm/zone.h" | 20 #include "vm/zone.h" |
| 21 | 21 |
| 22 namespace dart { | 22 namespace dart { |
| 23 | 23 |
| 24 DECLARE_FLAG(bool, print_class_table); |
| 24 DECLARE_FLAG(bool, trace_isolates); | 25 DECLARE_FLAG(bool, trace_isolates); |
| 25 | 26 |
| 26 Isolate* Dart::vm_isolate_ = NULL; | 27 Isolate* Dart::vm_isolate_ = NULL; |
| 27 ThreadPool* Dart::thread_pool_ = NULL; | 28 ThreadPool* Dart::thread_pool_ = NULL; |
| 28 DebugInfo* Dart::pprof_symbol_generator_ = NULL; | 29 DebugInfo* Dart::pprof_symbol_generator_ = NULL; |
| 29 | 30 |
| 30 // TODO(turnidge): We should add a corresponding Dart::Cleanup. | 31 // TODO(turnidge): We should add a corresponding Dart::Cleanup. |
| 31 bool Dart::InitOnce(Dart_IsolateCreateCallback create, | 32 bool Dart::InitOnce(Dart_IsolateCreateCallback create, |
| 32 Dart_IsolateInterruptCallback interrupt) { | 33 Dart_IsolateInterruptCallback interrupt) { |
| 33 // TODO(iposva): Fix race condition here. | 34 // TODO(iposva): Fix race condition here. |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 const Snapshot* snapshot = Snapshot::SetupFromBuffer(snapshot_buffer); | 93 const Snapshot* snapshot = Snapshot::SetupFromBuffer(snapshot_buffer); |
| 93 if (FLAG_trace_isolates) { | 94 if (FLAG_trace_isolates) { |
| 94 OS::Print("Size of isolate snapshot = %ld\n", snapshot->length()); | 95 OS::Print("Size of isolate snapshot = %ld\n", snapshot->length()); |
| 95 } | 96 } |
| 96 SnapshotReader reader(snapshot, isolate); | 97 SnapshotReader reader(snapshot, isolate); |
| 97 reader.ReadFullSnapshot(); | 98 reader.ReadFullSnapshot(); |
| 98 } | 99 } |
| 99 | 100 |
| 100 StubCode::Init(isolate); | 101 StubCode::Init(isolate); |
| 101 isolate->set_init_callback_data(data); | 102 isolate->set_init_callback_data(data); |
| 103 if (FLAG_print_class_table) { |
| 104 isolate->class_table()->Print(); |
| 105 } |
| 102 return Error::null(); | 106 return Error::null(); |
| 103 } | 107 } |
| 104 | 108 |
| 105 | 109 |
| 106 void Dart::ShutdownIsolate() { | 110 void Dart::ShutdownIsolate() { |
| 107 Isolate* isolate = Isolate::Current(); | 111 Isolate* isolate = Isolate::Current(); |
| 108 isolate->Shutdown(); | 112 isolate->Shutdown(); |
| 109 delete isolate; | 113 delete isolate; |
| 110 } | 114 } |
| 111 | 115 |
| 112 } // namespace dart | 116 } // namespace dart |
| OLD | NEW |