| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/cpu.h" | 8 #include "vm/cpu.h" |
| 9 #include "vm/dart_api_state.h" | 9 #include "vm/dart_api_state.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 Isolate::SetEntropySourceCallback(entropy_source); | 94 Isolate::SetEntropySourceCallback(entropy_source); |
| 95 OS::InitOnce(); | 95 OS::InitOnce(); |
| 96 VirtualMemory::InitOnce(); | 96 VirtualMemory::InitOnce(); |
| 97 Isolate::InitOnce(); | 97 Isolate::InitOnce(); |
| 98 PortMap::InitOnce(); | 98 PortMap::InitOnce(); |
| 99 FreeListElement::InitOnce(); | 99 FreeListElement::InitOnce(); |
| 100 Api::InitOnce(); | 100 Api::InitOnce(); |
| 101 CodeObservers::InitOnce(); | 101 CodeObservers::InitOnce(); |
| 102 ThreadInterrupter::InitOnce(); | 102 ThreadInterrupter::InitOnce(); |
| 103 Profiler::InitOnce(); | 103 Profiler::InitOnce(); |
| 104 |
| 104 #if defined(USING_SIMULATOR) | 105 #if defined(USING_SIMULATOR) |
| 105 Simulator::InitOnce(); | 106 Simulator::InitOnce(); |
| 106 #endif | 107 #endif |
| 107 // Create the read-only handles area. | 108 // Create the read-only handles area. |
| 108 ASSERT(predefined_handles_ == NULL); | 109 ASSERT(predefined_handles_ == NULL); |
| 109 predefined_handles_ = new ReadOnlyHandles(); | 110 predefined_handles_ = new ReadOnlyHandles(); |
| 110 // Create the VM isolate and finish the VM initialization. | 111 // Create the VM isolate and finish the VM initialization. |
| 111 ASSERT(thread_pool_ == NULL); | 112 ASSERT(thread_pool_ == NULL); |
| 112 thread_pool_ = new ThreadPool(); | 113 thread_pool_ = new ThreadPool(); |
| 113 { | 114 { |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 } | 243 } |
| 243 isolate->megamorphic_cache_table()->InitMissHandler(); | 244 isolate->megamorphic_cache_table()->InitMissHandler(); |
| 244 #endif | 245 #endif |
| 245 | 246 |
| 246 isolate->heap()->EnableGrowthControl(); | 247 isolate->heap()->EnableGrowthControl(); |
| 247 isolate->set_init_callback_data(data); | 248 isolate->set_init_callback_data(data); |
| 248 Api::SetupAcquiredError(isolate); | 249 Api::SetupAcquiredError(isolate); |
| 249 if (FLAG_print_class_table) { | 250 if (FLAG_print_class_table) { |
| 250 isolate->class_table()->Print(); | 251 isolate->class_table()->Print(); |
| 251 } | 252 } |
| 253 |
| 254 // Setup for profiling. |
| 255 Profiler::InitProfilingForIsolate(isolate); |
| 256 |
| 252 Service::SendIsolateStartupMessage(); | 257 Service::SendIsolateStartupMessage(); |
| 253 return Error::null(); | 258 return Error::null(); |
| 254 } | 259 } |
| 255 | 260 |
| 256 | 261 |
| 257 void Dart::RunShutdownCallback() { | 262 void Dart::RunShutdownCallback() { |
| 258 Isolate* isolate = Isolate::Current(); | 263 Isolate* isolate = Isolate::Current(); |
| 259 void* callback_data = isolate->init_callback_data(); | 264 void* callback_data = isolate->init_callback_data(); |
| 260 Dart_IsolateShutdownCallback callback = Isolate::ShutdownCallback(); | 265 Dart_IsolateShutdownCallback callback = Isolate::ShutdownCallback(); |
| 261 Service::SendIsolateShutdownMessage(); | 266 Service::SendIsolateShutdownMessage(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 278 return predefined_handles_->handles_.AllocateScopedHandle(); | 283 return predefined_handles_->handles_.AllocateScopedHandle(); |
| 279 } | 284 } |
| 280 | 285 |
| 281 | 286 |
| 282 bool Dart::IsReadOnlyHandle(uword address) { | 287 bool Dart::IsReadOnlyHandle(uword address) { |
| 283 ASSERT(predefined_handles_ != NULL); | 288 ASSERT(predefined_handles_ != NULL); |
| 284 return predefined_handles_->handles_.IsValidScopedHandle(address); | 289 return predefined_handles_->handles_.IsValidScopedHandle(address); |
| 285 } | 290 } |
| 286 | 291 |
| 287 } // namespace dart | 292 } // namespace dart |
| OLD | NEW |