| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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_index_table.h" | 7 #include "vm/code_index_table.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 21 matching lines...) Expand all Loading... |
| 32 } | 32 } |
| 33 OS::InitOnce(); | 33 OS::InitOnce(); |
| 34 VirtualMemory::InitOnce(); | 34 VirtualMemory::InitOnce(); |
| 35 Isolate::InitOnce(); | 35 Isolate::InitOnce(); |
| 36 PortMap::InitOnce(); | 36 PortMap::InitOnce(); |
| 37 FreeListElement::InitOnce(); | 37 FreeListElement::InitOnce(); |
| 38 // Create the VM isolate and finish the VM initialization. | 38 // Create the VM isolate and finish the VM initialization. |
| 39 { | 39 { |
| 40 ASSERT(vm_isolate_ == NULL); | 40 ASSERT(vm_isolate_ == NULL); |
| 41 ASSERT(Flags::Initialized()); | 41 ASSERT(Flags::Initialized()); |
| 42 vm_isolate_ = Isolate::Init(); | 42 vm_isolate_ = Isolate::Init("vm-isolate"); |
| 43 Zone zone(vm_isolate_); | 43 Zone zone(vm_isolate_); |
| 44 HandleScope handle_scope(vm_isolate_); | 44 HandleScope handle_scope(vm_isolate_); |
| 45 Heap::Init(vm_isolate_); | 45 Heap::Init(vm_isolate_); |
| 46 ObjectStore::Init(vm_isolate_); | 46 ObjectStore::Init(vm_isolate_); |
| 47 Object::InitOnce(); | 47 Object::InitOnce(); |
| 48 StubCode::InitOnce(); | 48 StubCode::InitOnce(); |
| 49 Scanner::InitOnce(); | 49 Scanner::InitOnce(); |
| 50 } | 50 } |
| 51 Isolate::SetCurrent(NULL); // Unregister the VM isolate from this thread. | 51 Isolate::SetCurrent(NULL); // Unregister the VM isolate from this thread. |
| 52 Isolate::SetCreateCallback(create); | 52 Isolate::SetCreateCallback(create); |
| 53 Isolate::SetInterruptCallback(interrupt); | 53 Isolate::SetInterruptCallback(interrupt); |
| 54 return true; | 54 return true; |
| 55 } | 55 } |
| 56 | 56 |
| 57 | 57 |
| 58 Isolate* Dart::CreateIsolate() { | 58 Isolate* Dart::CreateIsolate(const char* name_prefix) { |
| 59 // Create a new isolate. | 59 // Create a new isolate. |
| 60 Isolate* isolate = Isolate::Init(); | 60 Isolate* isolate = Isolate::Init(name_prefix); |
| 61 ASSERT(isolate != NULL); | 61 ASSERT(isolate != NULL); |
| 62 return isolate; | 62 return isolate; |
| 63 } | 63 } |
| 64 | 64 |
| 65 | 65 |
| 66 void Dart::InitializeIsolate(const uint8_t* snapshot_buffer, void* data) { | 66 void Dart::InitializeIsolate(const uint8_t* snapshot_buffer, void* data) { |
| 67 // Initialize the new isolate. | 67 // Initialize the new isolate. |
| 68 TIMERSCOPE(time_isolate_initialization); | 68 TIMERSCOPE(time_isolate_initialization); |
| 69 Isolate* isolate = Isolate::Current(); | 69 Isolate* isolate = Isolate::Current(); |
| 70 ASSERT(isolate != NULL); | 70 ASSERT(isolate != NULL); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 90 } | 90 } |
| 91 | 91 |
| 92 | 92 |
| 93 void Dart::ShutdownIsolate() { | 93 void Dart::ShutdownIsolate() { |
| 94 Isolate* isolate = Isolate::Current(); | 94 Isolate* isolate = Isolate::Current(); |
| 95 isolate->Shutdown(); | 95 isolate->Shutdown(); |
| 96 delete isolate; | 96 delete isolate; |
| 97 } | 97 } |
| 98 | 98 |
| 99 } // namespace dart | 99 } // namespace dart |
| OLD | NEW |