| 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, print_class_table); |
| 25 DECLARE_FLAG(bool, trace_isolates); | 25 DECLARE_FLAG(bool, trace_isolates); |
| 26 | 26 |
| 27 Isolate* Dart::vm_isolate_ = NULL; | 27 Isolate* Dart::vm_isolate_ = NULL; |
| 28 ThreadPool* Dart::thread_pool_ = NULL; | 28 ThreadPool* Dart::thread_pool_ = NULL; |
| 29 Dart_FileWriterFunction Dart::perf_events_writer_ = NULL; |
| 29 DebugInfo* Dart::pprof_symbol_generator_ = NULL; | 30 DebugInfo* Dart::pprof_symbol_generator_ = NULL; |
| 30 FileWriterFunction Dart::flow_graph_writer_ = NULL; | 31 Dart_FileWriterFunction Dart::flow_graph_writer_ = NULL; |
| 31 | 32 |
| 32 // An object visitor which will mark all visited objects. This is used to | 33 // An object visitor which will mark all visited objects. This is used to |
| 33 // premark all objects in the vm_isolate_ heap. | 34 // premark all objects in the vm_isolate_ heap. |
| 34 class PremarkingVisitor : public ObjectVisitor { | 35 class PremarkingVisitor : public ObjectVisitor { |
| 35 public: | 36 public: |
| 36 explicit PremarkingVisitor(Isolate* isolate) : ObjectVisitor(isolate) {} | 37 explicit PremarkingVisitor(Isolate* isolate) : ObjectVisitor(isolate) {} |
| 37 | 38 |
| 38 void VisitObject(RawObject* obj) { | 39 void VisitObject(RawObject* obj) { |
| 39 // RawInstruction objects are premarked on allocation. | 40 // RawInstruction objects are premarked on allocation. |
| 40 if (!obj->IsMarked()) { | 41 if (!obj->IsMarked()) { |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 isolate->Shutdown(); | 138 isolate->Shutdown(); |
| 138 delete isolate; | 139 delete isolate; |
| 139 | 140 |
| 140 Dart_IsolateShutdownCallback callback = Isolate::ShutdownCallback(); | 141 Dart_IsolateShutdownCallback callback = Isolate::ShutdownCallback(); |
| 141 if (callback != NULL) { | 142 if (callback != NULL) { |
| 142 (callback)(callback_data); | 143 (callback)(callback_data); |
| 143 } | 144 } |
| 144 } | 145 } |
| 145 | 146 |
| 146 } // namespace dart | 147 } // namespace dart |
| OLD | NEW |