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

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

Issue 2151253003: Do not reload isolates if we are in the process of shutting down the VM (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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
« no previous file with comments | « runtime/vm/isolate.h ('k') | no next file » | 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 "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/text_buffer.h" 10 #include "platform/text_buffer.h"
(...skipping 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after
1065 lib.SetLoaded(); 1065 lib.SetLoaded();
1066 } 1066 }
1067 lib.InitExportedNamesCache(); 1067 lib.InitExportedNamesCache();
1068 } 1068 }
1069 TokenStream::CloseSharedTokenList(this); 1069 TokenStream::CloseSharedTokenList(this);
1070 } 1070 }
1071 1071
1072 1072
1073 bool Isolate::CanReload() const { 1073 bool Isolate::CanReload() const {
1074 #ifndef PRODUCT 1074 #ifndef PRODUCT
1075 return (!ServiceIsolate::IsServiceIsolateDescendant(this) && 1075 return !ServiceIsolate::IsServiceIsolateDescendant(this) &&
1076 is_runnable() && !IsReloading() && no_reload_scope_depth_ == 0); 1076 is_runnable() && !IsReloading() && (no_reload_scope_depth_ == 0) &&
1077 IsolateCreationEnabled();
1077 #else 1078 #else
1078 return false; 1079 return false;
1079 #endif 1080 #endif
1080 } 1081 }
1081 1082
1082 1083
1083 #ifndef PRODUCT 1084 #ifndef PRODUCT
1084 void Isolate::ReportReloadError(const Error& error) { 1085 void Isolate::ReportReloadError(const Error& error) {
1085 ASSERT(IsReloading()); 1086 ASSERT(IsReloading());
1086 reload_context_->AbortReload(error); 1087 reload_context_->AbortReload(error);
(...skipping 1345 matching lines...) Expand 10 before | Expand all | Expand 10 after
2432 creation_enabled_ = false; 2433 creation_enabled_ = false;
2433 } 2434 }
2434 2435
2435 2436
2436 void Isolate::EnableIsolateCreation() { 2437 void Isolate::EnableIsolateCreation() {
2437 MonitorLocker ml(isolates_list_monitor_); 2438 MonitorLocker ml(isolates_list_monitor_);
2438 creation_enabled_ = true; 2439 creation_enabled_ = true;
2439 } 2440 }
2440 2441
2441 2442
2443 bool Isolate::IsolateCreationEnabled() {
2444 MonitorLocker ml(isolates_list_monitor_);
2445 return creation_enabled_;
2446 }
2447
2448
2442 void Isolate::KillLocked(LibMsgId msg_id) { 2449 void Isolate::KillLocked(LibMsgId msg_id) {
2443 Dart_CObject kill_msg; 2450 Dart_CObject kill_msg;
2444 Dart_CObject* list_values[4]; 2451 Dart_CObject* list_values[4];
2445 kill_msg.type = Dart_CObject_kArray; 2452 kill_msg.type = Dart_CObject_kArray;
2446 kill_msg.value.as_array.length = 4; 2453 kill_msg.value.as_array.length = 4;
2447 kill_msg.value.as_array.values = list_values; 2454 kill_msg.value.as_array.values = list_values;
2448 2455
2449 Dart_CObject oob; 2456 Dart_CObject oob;
2450 oob.type = Dart_CObject_kInt32; 2457 oob.type = Dart_CObject_kInt32;
2451 oob.value.as_int32 = Message::kIsolateLibOOBMsg; 2458 oob.value.as_int32 = Message::kIsolateLibOOBMsg;
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
2867 void IsolateSpawnState::DecrementSpawnCount() { 2874 void IsolateSpawnState::DecrementSpawnCount() {
2868 ASSERT(spawn_count_monitor_ != NULL); 2875 ASSERT(spawn_count_monitor_ != NULL);
2869 ASSERT(spawn_count_ != NULL); 2876 ASSERT(spawn_count_ != NULL);
2870 MonitorLocker ml(spawn_count_monitor_); 2877 MonitorLocker ml(spawn_count_monitor_);
2871 ASSERT(*spawn_count_ > 0); 2878 ASSERT(*spawn_count_ > 0);
2872 *spawn_count_ = *spawn_count_ - 1; 2879 *spawn_count_ = *spawn_count_ - 1;
2873 ml.Notify(); 2880 ml.Notify();
2874 } 2881 }
2875 2882
2876 } // namespace dart 2883 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/isolate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698