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 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 bool Isolate::MakeRunnable() { | 931 bool Isolate::MakeRunnable() { |
932 ASSERT(Isolate::Current() == NULL); | 932 ASSERT(Isolate::Current() == NULL); |
933 | 933 |
934 MutexLocker ml(mutex_); | 934 MutexLocker ml(mutex_); |
935 // Check if we are in a valid state to make the isolate runnable. | 935 // Check if we are in a valid state to make the isolate runnable. |
936 if (is_runnable_ == true) { | 936 if (is_runnable_ == true) { |
937 return false; // Already runnable. | 937 return false; // Already runnable. |
938 } | 938 } |
939 // Set the isolate as runnable and if we are being spawned schedule | 939 // Set the isolate as runnable and if we are being spawned schedule |
940 // isolate on thread pool for execution. | 940 // isolate on thread pool for execution. |
| 941 ASSERT(object_store()->root_library() != Library::null()); |
941 is_runnable_ = true; | 942 is_runnable_ = true; |
942 if (!ServiceIsolate::IsServiceIsolate(this)) { | 943 if (!ServiceIsolate::IsServiceIsolate(this)) { |
943 message_handler()->set_pause_on_start(FLAG_pause_isolates_on_start); | 944 message_handler()->set_pause_on_start(FLAG_pause_isolates_on_start); |
944 message_handler()->set_pause_on_exit(FLAG_pause_isolates_on_exit); | 945 message_handler()->set_pause_on_exit(FLAG_pause_isolates_on_exit); |
945 } | 946 } |
946 IsolateSpawnState* state = spawn_state(); | 947 IsolateSpawnState* state = spawn_state(); |
947 if (state != NULL) { | 948 if (state != NULL) { |
948 ASSERT(this == state->isolate()); | 949 ASSERT(this == state->isolate()); |
949 Run(); | 950 Run(); |
950 } | 951 } |
(...skipping 1019 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1970 serialized_message_, serialized_message_len_); | 1971 serialized_message_, serialized_message_len_); |
1971 } | 1972 } |
1972 | 1973 |
1973 | 1974 |
1974 void IsolateSpawnState::Cleanup() { | 1975 void IsolateSpawnState::Cleanup() { |
1975 SwitchIsolateScope switch_scope(I); | 1976 SwitchIsolateScope switch_scope(I); |
1976 Dart::ShutdownIsolate(); | 1977 Dart::ShutdownIsolate(); |
1977 } | 1978 } |
1978 | 1979 |
1979 } // namespace dart | 1980 } // namespace dart |
OLD | NEW |