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" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 Zone zone(vm_isolate_); | 71 Zone zone(vm_isolate_); |
72 HandleScope handle_scope(vm_isolate_); | 72 HandleScope handle_scope(vm_isolate_); |
73 Heap::Init(vm_isolate_); | 73 Heap::Init(vm_isolate_); |
74 ObjectStore::Init(vm_isolate_); | 74 ObjectStore::Init(vm_isolate_); |
75 Object::InitOnce(); | 75 Object::InitOnce(); |
76 StubCode::InitOnce(); | 76 StubCode::InitOnce(); |
77 Scanner::InitOnce(); | 77 Scanner::InitOnce(); |
78 Symbols::InitOnce(vm_isolate_); | 78 Symbols::InitOnce(vm_isolate_); |
79 PremarkingVisitor premarker(vm_isolate_); | 79 PremarkingVisitor premarker(vm_isolate_); |
80 vm_isolate_->heap()->IterateOldObjects(&premarker); | 80 vm_isolate_->heap()->IterateOldObjects(&premarker); |
| 81 vm_isolate_->heap()->WriteProtect(true); |
81 } | 82 } |
82 Isolate::SetCurrent(NULL); // Unregister the VM isolate from this thread. | 83 Isolate::SetCurrent(NULL); // Unregister the VM isolate from this thread. |
83 Isolate::SetCreateCallback(create); | 84 Isolate::SetCreateCallback(create); |
84 Isolate::SetInterruptCallback(interrupt); | 85 Isolate::SetInterruptCallback(interrupt); |
85 Isolate::SetShutdownCallback(shutdown); | 86 Isolate::SetShutdownCallback(shutdown); |
86 return true; | 87 return true; |
87 } | 88 } |
88 | 89 |
89 | 90 |
90 Isolate* Dart::CreateIsolate(const char* name_prefix) { | 91 Isolate* Dart::CreateIsolate(const char* name_prefix) { |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 isolate->Shutdown(); | 171 isolate->Shutdown(); |
171 delete isolate; | 172 delete isolate; |
172 | 173 |
173 Dart_IsolateShutdownCallback callback = Isolate::ShutdownCallback(); | 174 Dart_IsolateShutdownCallback callback = Isolate::ShutdownCallback(); |
174 if (callback != NULL) { | 175 if (callback != NULL) { |
175 (callback)(callback_data); | 176 (callback)(callback_data); |
176 } | 177 } |
177 } | 178 } |
178 | 179 |
179 } // namespace dart | 180 } // namespace dart |
OLD | NEW |