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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
193 #endif | 193 #endif |
194 } | 194 } |
195 // Allocate the "persistent" scoped handles for the predefined API | 195 // Allocate the "persistent" scoped handles for the predefined API |
196 // values (such as Dart_True, Dart_False and Dart_Null). | 196 // values (such as Dart_True, Dart_False and Dart_Null). |
197 Api::InitHandles(); | 197 Api::InitHandles(); |
198 | 198 |
199 Thread::ExitIsolate(); // Unregister the VM isolate from this thread. | 199 Thread::ExitIsolate(); // Unregister the VM isolate from this thread. |
200 Isolate::SetCreateCallback(create); | 200 Isolate::SetCreateCallback(create); |
201 Isolate::SetShutdownCallback(shutdown); | 201 Isolate::SetShutdownCallback(shutdown); |
202 | 202 |
203 #ifndef PRODUCT | |
203 Service::SetGetServiceAssetsCallback(get_service_assets); | 204 Service::SetGetServiceAssetsCallback(get_service_assets); |
205 #endif // !PRODUCT | |
204 ServiceIsolate::Run(); | 206 ServiceIsolate::Run(); |
205 | 207 |
206 return NULL; | 208 return NULL; |
207 } | 209 } |
208 | 210 |
209 | 211 |
210 // This waits until only the VM isolate remains in the list. | 212 // This waits until only the VM isolate remains in the list. |
211 void Dart::WaitForIsolateShutdown() { | 213 void Dart::WaitForIsolateShutdown() { |
212 ASSERT(!Isolate::creation_enabled_); | 214 ASSERT(!Isolate::creation_enabled_); |
213 MonitorLocker ml(Isolate::isolates_list_monitor_); | 215 MonitorLocker ml(Isolate::isolates_list_monitor_); |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
391 } | 393 } |
392 | 394 |
393 ServiceIsolate::MaybeMakeServiceIsolate(I); | 395 ServiceIsolate::MaybeMakeServiceIsolate(I); |
394 if (!ServiceIsolate::IsServiceIsolate(I)) { | 396 if (!ServiceIsolate::IsServiceIsolate(I)) { |
395 I->message_handler()->set_should_pause_on_start( | 397 I->message_handler()->set_should_pause_on_start( |
396 FLAG_pause_isolates_on_start); | 398 FLAG_pause_isolates_on_start); |
397 I->message_handler()->set_should_pause_on_exit( | 399 I->message_handler()->set_should_pause_on_exit( |
398 FLAG_pause_isolates_on_exit); | 400 FLAG_pause_isolates_on_exit); |
399 } | 401 } |
400 ServiceIsolate::SendIsolateStartupMessage(); | 402 ServiceIsolate::SendIsolateStartupMessage(); |
403 #ifndef PRODUCT | |
rmacnak
2016/02/04 21:26:41
+ FLAG_support_debugger
| |
401 I->debugger()->NotifyIsolateCreated(); | 404 I->debugger()->NotifyIsolateCreated(); |
405 #endif // !PRODUCT | |
402 | 406 |
403 // Create tag table. | 407 // Create tag table. |
404 I->set_tag_table(GrowableObjectArray::Handle(GrowableObjectArray::New())); | 408 I->set_tag_table(GrowableObjectArray::Handle(GrowableObjectArray::New())); |
405 // Set up default UserTag. | 409 // Set up default UserTag. |
406 const UserTag& default_tag = UserTag::Handle(UserTag::DefaultTag()); | 410 const UserTag& default_tag = UserTag::Handle(UserTag::DefaultTag()); |
407 I->set_current_tag(default_tag); | 411 I->set_current_tag(default_tag); |
408 | 412 |
409 if (FLAG_keep_code) { | 413 if (FLAG_keep_code) { |
410 I->set_deoptimized_code_array( | 414 I->set_deoptimized_code_array( |
411 GrowableObjectArray::Handle(GrowableObjectArray::New())); | 415 GrowableObjectArray::Handle(GrowableObjectArray::New())); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
463 return predefined_handles_->handles_.IsValidScopedHandle(address); | 467 return predefined_handles_->handles_.IsValidScopedHandle(address); |
464 } | 468 } |
465 | 469 |
466 | 470 |
467 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { | 471 bool Dart::IsReadOnlyApiHandle(Dart_Handle handle) { |
468 ASSERT(predefined_handles_ != NULL); | 472 ASSERT(predefined_handles_ != NULL); |
469 return predefined_handles_->api_handles_.IsValidHandle(handle); | 473 return predefined_handles_->api_handles_.IsValidHandle(handle); |
470 } | 474 } |
471 | 475 |
472 } // namespace dart | 476 } // namespace dart |
OLD | NEW |