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 "vm/code_observers.h" | 10 #include "vm/code_observers.h" |
(...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
930 } | 930 } |
931 } | 931 } |
932 } | 932 } |
933 | 933 |
934 | 934 |
935 bool Isolate::MakeRunnable() { | 935 bool Isolate::MakeRunnable() { |
936 ASSERT(Isolate::Current() == NULL); | 936 ASSERT(Isolate::Current() == NULL); |
937 | 937 |
938 MutexLocker ml(mutex_); | 938 MutexLocker ml(mutex_); |
939 // Check if we are in a valid state to make the isolate runnable. | 939 // Check if we are in a valid state to make the isolate runnable. |
940 if (is_runnable_ == true) { | 940 if (is_runnable() == true) { |
941 return false; // Already runnable. | 941 return false; // Already runnable. |
942 } | 942 } |
943 // Set the isolate as runnable and if we are being spawned schedule | 943 // Set the isolate as runnable and if we are being spawned schedule |
944 // isolate on thread pool for execution. | 944 // isolate on thread pool for execution. |
945 ASSERT(object_store()->root_library() != Library::null()); | 945 ASSERT(object_store()->root_library() != Library::null()); |
946 is_runnable_ = true; | 946 set_is_runnable(true); |
947 if (!ServiceIsolate::IsServiceIsolate(this)) { | 947 if (!ServiceIsolate::IsServiceIsolate(this)) { |
948 message_handler()->set_pause_on_start(FLAG_pause_isolates_on_start); | 948 message_handler()->set_pause_on_start(FLAG_pause_isolates_on_start); |
949 message_handler()->set_pause_on_exit(FLAG_pause_isolates_on_exit); | 949 message_handler()->set_pause_on_exit(FLAG_pause_isolates_on_exit); |
950 } | 950 } |
951 IsolateSpawnState* state = spawn_state(); | 951 IsolateSpawnState* state = spawn_state(); |
952 if (state != NULL) { | 952 if (state != NULL) { |
953 ASSERT(this == state->isolate()); | 953 ASSERT(this == state->isolate()); |
954 Run(); | 954 Run(); |
955 } | 955 } |
956 return true; | 956 return true; |
(...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2020 serialized_message_, serialized_message_len_); | 2020 serialized_message_, serialized_message_len_); |
2021 } | 2021 } |
2022 | 2022 |
2023 | 2023 |
2024 void IsolateSpawnState::Cleanup() { | 2024 void IsolateSpawnState::Cleanup() { |
2025 SwitchIsolateScope switch_scope(I); | 2025 SwitchIsolateScope switch_scope(I); |
2026 Dart::ShutdownIsolate(); | 2026 Dart::ShutdownIsolate(); |
2027 } | 2027 } |
2028 | 2028 |
2029 } // namespace dart | 2029 } // namespace dart |
OLD | NEW |