| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 } else { | 89 } else { |
| 90 // Initialize from snapshot (this should replicate the functionality | 90 // Initialize from snapshot (this should replicate the functionality |
| 91 // of Object::Init(..) in a regular isolate creation path. | 91 // of Object::Init(..) in a regular isolate creation path. |
| 92 Object::InitFromSnapshot(isolate); | 92 Object::InitFromSnapshot(isolate); |
| 93 const Snapshot* snapshot = Snapshot::SetupFromBuffer(snapshot_buffer); | 93 const Snapshot* snapshot = Snapshot::SetupFromBuffer(snapshot_buffer); |
| 94 if (FLAG_trace_isolates) { | 94 if (FLAG_trace_isolates) { |
| 95 OS::Print("Size of isolate snapshot = %ld\n", snapshot->length()); | 95 OS::Print("Size of isolate snapshot = %ld\n", snapshot->length()); |
| 96 } | 96 } |
| 97 SnapshotReader reader(snapshot, isolate); | 97 SnapshotReader reader(snapshot, isolate); |
| 98 reader.ReadFullSnapshot(); | 98 reader.ReadFullSnapshot(); |
| 99 if (FLAG_trace_isolates) { |
| 100 isolate->heap()->PrintSizes(); |
| 101 } |
| 99 } | 102 } |
| 100 | 103 |
| 101 StubCode::Init(isolate); | 104 StubCode::Init(isolate); |
| 102 isolate->set_init_callback_data(data); | 105 isolate->set_init_callback_data(data); |
| 103 if (FLAG_print_class_table) { | 106 if (FLAG_print_class_table) { |
| 104 isolate->class_table()->Print(); | 107 isolate->class_table()->Print(); |
| 105 } | 108 } |
| 106 return Error::null(); | 109 return Error::null(); |
| 107 } | 110 } |
| 108 | 111 |
| 109 | 112 |
| 110 void Dart::ShutdownIsolate() { | 113 void Dart::ShutdownIsolate() { |
| 111 Isolate* isolate = Isolate::Current(); | 114 Isolate* isolate = Isolate::Current(); |
| 112 isolate->Shutdown(); | 115 isolate->Shutdown(); |
| 113 delete isolate; | 116 delete isolate; |
| 114 } | 117 } |
| 115 | 118 |
| 116 } // namespace dart | 119 } // namespace dart |
| OLD | NEW |