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

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

Issue 2512483002: Support reloading from source on top of a script snapshot. (Closed)
Patch Set: ... Created 4 years, 1 month 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') | runtime/vm/isolate_reload.h » ('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 "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 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after
1095 IsolateCreationEnabled(); 1095 IsolateCreationEnabled();
1096 #else 1096 #else
1097 return false; 1097 return false;
1098 #endif 1098 #endif
1099 } 1099 }
1100 1100
1101 1101
1102 #ifndef PRODUCT 1102 #ifndef PRODUCT
1103 bool Isolate::ReloadSources(JSONStream* js, 1103 bool Isolate::ReloadSources(JSONStream* js,
1104 bool force_reload, 1104 bool force_reload,
1105 const char* root_script_url,
1106 const char* packages_url,
1105 bool dont_delete_reload_context) { 1107 bool dont_delete_reload_context) {
1106 ASSERT(!IsReloading()); 1108 ASSERT(!IsReloading());
1107 has_attempted_reload_ = true; 1109 has_attempted_reload_ = true;
1108 reload_context_ = new IsolateReloadContext(this, js); 1110 reload_context_ = new IsolateReloadContext(this, js);
1109 reload_context_->Reload(force_reload); 1111 reload_context_->Reload(force_reload, root_script_url, packages_url);
1110 bool success = !reload_context_->reload_aborted(); 1112 bool success = !reload_context_->reload_aborted();
1111 if (!dont_delete_reload_context) { 1113 if (!dont_delete_reload_context) {
1112 DeleteReloadContext(); 1114 DeleteReloadContext();
1113 } 1115 }
1114 return success; 1116 return success;
1115 } 1117 }
1116 1118
1117 1119
1118 void Isolate::DeleteReloadContext() { 1120 void Isolate::DeleteReloadContext() {
1119 // Another thread may be in the middle of GetClassForHeapWalkAt. 1121 // Another thread may be in the middle of GetClassForHeapWalkAt.
(...skipping 1801 matching lines...) Expand 10 before | Expand all | Expand 10 after
2921 void IsolateSpawnState::DecrementSpawnCount() { 2923 void IsolateSpawnState::DecrementSpawnCount() {
2922 ASSERT(spawn_count_monitor_ != NULL); 2924 ASSERT(spawn_count_monitor_ != NULL);
2923 ASSERT(spawn_count_ != NULL); 2925 ASSERT(spawn_count_ != NULL);
2924 MonitorLocker ml(spawn_count_monitor_); 2926 MonitorLocker ml(spawn_count_monitor_);
2925 ASSERT(*spawn_count_ > 0); 2927 ASSERT(*spawn_count_ > 0);
2926 *spawn_count_ = *spawn_count_ - 1; 2928 *spawn_count_ = *spawn_count_ - 1;
2927 ml.Notify(); 2929 ml.Notify();
2928 } 2930 }
2929 2931
2930 } // namespace dart 2932 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/isolate.h ('k') | runtime/vm/isolate_reload.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698