Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(574)

Side by Side Diff: runtime/vm/isolate.cc

Issue 1073983010: Add asserts that isolates have a root library set up before they become runnable. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | tests/lib/mirrors/spawn_function_root_library_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « runtime/vm/dart_api_impl.cc ('k') | tests/lib/mirrors/spawn_function_root_library_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698