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 "include/dart_native_api.h" | 8 #include "include/dart_native_api.h" |
9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
10 #include "platform/json.h" | 10 #include "platform/json.h" |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
761 registered_service_extension_handlers_(GrowableObjectArray::null()), | 761 registered_service_extension_handlers_(GrowableObjectArray::null()), |
762 metrics_list_head_(NULL), | 762 metrics_list_head_(NULL), |
763 compilation_allowed_(true), | 763 compilation_allowed_(true), |
764 cha_(NULL), | 764 cha_(NULL), |
765 next_(NULL), | 765 next_(NULL), |
766 pause_loop_monitor_(NULL), | 766 pause_loop_monitor_(NULL), |
767 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_INITIALIZERS) | 767 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_INITIALIZERS) |
768 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_INIT) | 768 REUSABLE_HANDLE_LIST(REUSABLE_HANDLE_SCOPE_INIT) |
769 reusable_handles_() { | 769 reusable_handles_() { |
770 flags_.CopyFrom(api_flags); | 770 flags_.CopyFrom(api_flags); |
771 set_vm_tag(VMTag::kEmbedderTagId); | 771 Thread::Current()->set_vm_tag(VMTag::kEmbedderTagId); |
772 set_user_tag(UserTags::kDefaultUserTag); | 772 set_user_tag(UserTags::kDefaultUserTag); |
773 } | 773 } |
774 | 774 |
775 #undef REUSABLE_HANDLE_SCOPE_INIT | 775 #undef REUSABLE_HANDLE_SCOPE_INIT |
776 #undef REUSABLE_HANDLE_INITIALIZERS | 776 #undef REUSABLE_HANDLE_INITIALIZERS |
777 | 777 |
778 Isolate::~Isolate() { | 778 Isolate::~Isolate() { |
779 free(name_); | 779 free(name_); |
780 free(debugger_name_); | 780 free(debugger_name_); |
781 delete store_buffer_; | 781 delete store_buffer_; |
(...skipping 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1930 if (entry.thread == mutator) { | 1930 if (entry.thread == mutator) { |
1931 ThreadInterrupter::InterruptThread(mutator); | 1931 ThreadInterrupter::InterruptThread(mutator); |
1932 break; | 1932 break; |
1933 } | 1933 } |
1934 } | 1934 } |
1935 return 1; | 1935 return 1; |
1936 } | 1936 } |
1937 | 1937 |
1938 | 1938 |
1939 void Isolate::ProfileIdle() { | 1939 void Isolate::ProfileIdle() { |
1940 vm_tag_counters_.Increment(vm_tag()); | 1940 // Currently we are only sampling the mutator thread. |
| 1941 vm_tag_counters_.Increment(VMTag::kIdleTagId); |
1941 } | 1942 } |
1942 | 1943 |
1943 | 1944 |
1944 void Isolate::set_tag_table(const GrowableObjectArray& value) { | 1945 void Isolate::set_tag_table(const GrowableObjectArray& value) { |
1945 tag_table_ = value.raw(); | 1946 tag_table_ = value.raw(); |
1946 } | 1947 } |
1947 | 1948 |
1948 | 1949 |
1949 void Isolate::set_current_tag(const UserTag& tag) { | 1950 void Isolate::set_current_tag(const UserTag& tag) { |
1950 uword user_tag = tag.tag(); | 1951 uword user_tag = tag.tag(); |
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2560 serialized_message_, serialized_message_len_); | 2561 serialized_message_, serialized_message_len_); |
2561 } | 2562 } |
2562 | 2563 |
2563 | 2564 |
2564 void IsolateSpawnState::Cleanup() { | 2565 void IsolateSpawnState::Cleanup() { |
2565 SwitchIsolateScope switch_scope(I); | 2566 SwitchIsolateScope switch_scope(I); |
2566 Dart::ShutdownIsolate(); | 2567 Dart::ShutdownIsolate(); |
2567 } | 2568 } |
2568 | 2569 |
2569 } // namespace dart | 2570 } // namespace dart |
OLD | NEW |