| 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 reader.ReadFullSnapshot(); | 162 reader.ReadFullSnapshot(); |
| 163 if (FLAG_trace_isolates) { | 163 if (FLAG_trace_isolates) { |
| 164 isolate->heap()->PrintSizes(); | 164 isolate->heap()->PrintSizes(); |
| 165 } | 165 } |
| 166 if (FLAG_print_bootstrap) { | 166 if (FLAG_print_bootstrap) { |
| 167 PrintLibrarySources(isolate); | 167 PrintLibrarySources(isolate); |
| 168 } | 168 } |
| 169 } | 169 } |
| 170 | 170 |
| 171 StubCode::Init(isolate); | 171 StubCode::Init(isolate); |
| 172 if (HeapTrace::is_enabled()) { |
| 173 isolate->heap()->trace()->InitializeIsolateTracing(isolate); |
| 174 } |
| 172 isolate->heap()->EnableGrowthControl(); | 175 isolate->heap()->EnableGrowthControl(); |
| 173 isolate->set_init_callback_data(data); | 176 isolate->set_init_callback_data(data); |
| 174 if (FLAG_print_class_table) { | 177 if (FLAG_print_class_table) { |
| 175 isolate->class_table()->Print(); | 178 isolate->class_table()->Print(); |
| 176 } | 179 } |
| 177 return Error::null(); | 180 return Error::null(); |
| 178 } | 181 } |
| 179 | 182 |
| 180 | 183 |
| 181 void Dart::ShutdownIsolate() { | 184 void Dart::ShutdownIsolate() { |
| 182 Isolate* isolate = Isolate::Current(); | 185 Isolate* isolate = Isolate::Current(); |
| 183 if (FLAG_trace_isolates) { | 186 if (FLAG_trace_isolates) { |
| 184 isolate->heap()->PrintSizes(); | 187 isolate->heap()->PrintSizes(); |
| 185 } | 188 } |
| 186 void* callback_data = isolate->init_callback_data(); | 189 void* callback_data = isolate->init_callback_data(); |
| 187 isolate->Shutdown(); | 190 isolate->Shutdown(); |
| 188 delete isolate; | 191 delete isolate; |
| 189 | 192 |
| 190 Dart_IsolateShutdownCallback callback = Isolate::ShutdownCallback(); | 193 Dart_IsolateShutdownCallback callback = Isolate::ShutdownCallback(); |
| 191 if (callback != NULL) { | 194 if (callback != NULL) { |
| 192 (callback)(callback_data); | 195 (callback)(callback_data); |
| 193 } | 196 } |
| 194 } | 197 } |
| 195 | 198 |
| 196 } // namespace dart | 199 } // namespace dart |
| OLD | NEW |