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/code_observers.h" | 7 #include "vm/code_observers.h" |
8 #include "vm/dart_api_state.h" | 8 #include "vm/dart_api_state.h" |
9 #include "vm/flags.h" | 9 #include "vm/flags.h" |
10 #include "vm/freelist.h" | 10 #include "vm/freelist.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 const Snapshot* snapshot = Snapshot::SetupFromBuffer(snapshot_buffer); | 157 const Snapshot* snapshot = Snapshot::SetupFromBuffer(snapshot_buffer); |
158 ASSERT(snapshot->kind() == Snapshot::kFull); | 158 ASSERT(snapshot->kind() == Snapshot::kFull); |
159 if (FLAG_trace_isolates) { | 159 if (FLAG_trace_isolates) { |
160 OS::Print("Size of isolate snapshot = %d\n", snapshot->length()); | 160 OS::Print("Size of isolate snapshot = %d\n", snapshot->length()); |
161 } | 161 } |
162 SnapshotReader reader(snapshot->content(), snapshot->length(), | 162 SnapshotReader reader(snapshot->content(), snapshot->length(), |
163 Snapshot::kFull, isolate); | 163 Snapshot::kFull, isolate); |
164 reader.ReadFullSnapshot(); | 164 reader.ReadFullSnapshot(); |
165 if (FLAG_trace_isolates) { | 165 if (FLAG_trace_isolates) { |
166 isolate->heap()->PrintSizes(); | 166 isolate->heap()->PrintSizes(); |
| 167 isolate->megamorphic_cache_table()->PrintSizes(); |
167 } | 168 } |
168 if (FLAG_print_bootstrap) { | 169 if (FLAG_print_bootstrap) { |
169 PrintLibrarySources(isolate); | 170 PrintLibrarySources(isolate); |
170 } | 171 } |
171 } | 172 } |
172 | 173 |
173 StubCode::Init(isolate); | 174 StubCode::Init(isolate); |
| 175 isolate->megamorphic_cache_table()->InitMissHandler(); |
174 isolate->heap()->EnableGrowthControl(); | 176 isolate->heap()->EnableGrowthControl(); |
175 isolate->set_init_callback_data(data); | 177 isolate->set_init_callback_data(data); |
176 if (FLAG_print_class_table) { | 178 if (FLAG_print_class_table) { |
177 isolate->class_table()->Print(); | 179 isolate->class_table()->Print(); |
178 } | 180 } |
179 return Error::null(); | 181 return Error::null(); |
180 } | 182 } |
181 | 183 |
182 | 184 |
183 void Dart::ShutdownIsolate() { | 185 void Dart::ShutdownIsolate() { |
184 Isolate* isolate = Isolate::Current(); | 186 Isolate* isolate = Isolate::Current(); |
185 if (FLAG_trace_isolates) { | 187 if (FLAG_trace_isolates) { |
186 isolate->heap()->PrintSizes(); | 188 isolate->heap()->PrintSizes(); |
| 189 isolate->megamorphic_cache_table()->PrintSizes(); |
187 } | 190 } |
188 void* callback_data = isolate->init_callback_data(); | 191 void* callback_data = isolate->init_callback_data(); |
189 isolate->Shutdown(); | 192 isolate->Shutdown(); |
190 delete isolate; | 193 delete isolate; |
191 | 194 |
192 Dart_IsolateShutdownCallback callback = Isolate::ShutdownCallback(); | 195 Dart_IsolateShutdownCallback callback = Isolate::ShutdownCallback(); |
193 if (callback != NULL) { | 196 if (callback != NULL) { |
194 (callback)(callback_data); | 197 (callback)(callback_data); |
195 } | 198 } |
196 } | 199 } |
197 | 200 |
198 | 201 |
199 } // namespace dart | 202 } // namespace dart |
OLD | NEW |