| 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/isolate.h" | 5 #include "vm/isolate.h" |
| 6 | 6 |
| 7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "platform/json.h" | 9 #include "platform/json.h" |
| 10 #include "lib/mirrors.h" | 10 #include "lib/mirrors.h" |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 object_id_ring_(NULL), | 336 object_id_ring_(NULL), |
| 337 profiler_data_(NULL), | 337 profiler_data_(NULL), |
| 338 thread_state_(NULL), | 338 thread_state_(NULL), |
| 339 tag_table_(GrowableObjectArray::null()), | 339 tag_table_(GrowableObjectArray::null()), |
| 340 current_tag_(UserTag::null()), | 340 current_tag_(UserTag::null()), |
| 341 next_(NULL), | 341 next_(NULL), |
| 342 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_INITIALIZERS) | 342 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_INITIALIZERS) |
| 343 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_INIT) | 343 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_INIT) |
| 344 reusable_handles_() { | 344 reusable_handles_() { |
| 345 set_vm_tag(VMTag::kIdleTagId); | 345 set_vm_tag(VMTag::kIdleTagId); |
| 346 set_user_tag(UserTags::kNoUserTag); | 346 set_user_tag(UserTags::kDefaultUserTag); |
| 347 } | 347 } |
| 348 #undef REUSABLE_HANDLE_SCOPE_INIT | 348 #undef REUSABLE_HANDLE_SCOPE_INIT |
| 349 #undef REUSABLE_HANDLE_INITIALIZERS | 349 #undef REUSABLE_HANDLE_INITIALIZERS |
| 350 | 350 |
| 351 | 351 |
| 352 Isolate::~Isolate() { | 352 Isolate::~Isolate() { |
| 353 delete [] name_; | 353 delete [] name_; |
| 354 delete heap_; | 354 delete heap_; |
| 355 delete object_store_; | 355 delete object_store_; |
| 356 delete api_state_; | 356 delete api_state_; |
| (...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1006 } | 1006 } |
| 1007 | 1007 |
| 1008 | 1008 |
| 1009 void Isolate::set_current_tag(const UserTag& tag) { | 1009 void Isolate::set_current_tag(const UserTag& tag) { |
| 1010 intptr_t user_tag = tag.tag(); | 1010 intptr_t user_tag = tag.tag(); |
| 1011 set_user_tag(static_cast<uword>(user_tag)); | 1011 set_user_tag(static_cast<uword>(user_tag)); |
| 1012 current_tag_ = tag.raw(); | 1012 current_tag_ = tag.raw(); |
| 1013 } | 1013 } |
| 1014 | 1014 |
| 1015 | 1015 |
| 1016 void Isolate::clear_current_tag() { | |
| 1017 set_user_tag(UserTags::kNoUserTag); | |
| 1018 current_tag_ = UserTag::null(); | |
| 1019 } | |
| 1020 | |
| 1021 | |
| 1022 void Isolate::VisitIsolates(IsolateVisitor* visitor) { | 1016 void Isolate::VisitIsolates(IsolateVisitor* visitor) { |
| 1023 if (visitor == NULL) { | 1017 if (visitor == NULL) { |
| 1024 return; | 1018 return; |
| 1025 } | 1019 } |
| 1026 MonitorLocker ml(isolates_list_monitor_); | 1020 MonitorLocker ml(isolates_list_monitor_); |
| 1027 Isolate* current = isolates_list_head_; | 1021 Isolate* current = isolates_list_head_; |
| 1028 while (current) { | 1022 while (current) { |
| 1029 visitor->VisitIsolate(current); | 1023 visitor->VisitIsolate(current); |
| 1030 current = current->next_; | 1024 current = current->next_; |
| 1031 } | 1025 } |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1181 return func.raw(); | 1175 return func.raw(); |
| 1182 } | 1176 } |
| 1183 | 1177 |
| 1184 | 1178 |
| 1185 void IsolateSpawnState::Cleanup() { | 1179 void IsolateSpawnState::Cleanup() { |
| 1186 SwitchIsolateScope switch_scope(isolate()); | 1180 SwitchIsolateScope switch_scope(isolate()); |
| 1187 Dart::ShutdownIsolate(); | 1181 Dart::ShutdownIsolate(); |
| 1188 } | 1182 } |
| 1189 | 1183 |
| 1190 } // namespace dart | 1184 } // namespace dart |
| OLD | NEW |