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

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

Issue 2186423002: Only reload libraries when they may have been modified. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Code review Created 4 years, 4 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') | 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 828 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 pause_loop_monitor_(NULL), 839 pause_loop_monitor_(NULL),
840 loading_invalidation_gen_(kInvalidGen), 840 loading_invalidation_gen_(kInvalidGen),
841 top_level_parsing_count_(0), 841 top_level_parsing_count_(0),
842 field_list_mutex_(new Mutex()), 842 field_list_mutex_(new Mutex()),
843 boxed_field_list_(GrowableObjectArray::null()), 843 boxed_field_list_(GrowableObjectArray::null()),
844 spawn_count_monitor_(new Monitor()), 844 spawn_count_monitor_(new Monitor()),
845 spawn_count_(0), 845 spawn_count_(0),
846 has_attempted_reload_(false), 846 has_attempted_reload_(false),
847 no_reload_scope_depth_(0), 847 no_reload_scope_depth_(0),
848 reload_every_n_stack_overflow_checks_(FLAG_reload_every), 848 reload_every_n_stack_overflow_checks_(FLAG_reload_every),
849 reload_context_(NULL) { 849 reload_context_(NULL),
850 last_reload_timestamp_(OS::GetCurrentTimeMillis()) {
850 NOT_IN_PRODUCT(FlagsCopyFrom(api_flags)); 851 NOT_IN_PRODUCT(FlagsCopyFrom(api_flags));
851 // TODO(asiva): A Thread is not available here, need to figure out 852 // TODO(asiva): A Thread is not available here, need to figure out
852 // how the vm_tag (kEmbedderTagId) can be set, these tags need to 853 // how the vm_tag (kEmbedderTagId) can be set, these tags need to
853 // move to the OSThread structure. 854 // move to the OSThread structure.
854 set_user_tag(UserTags::kDefaultUserTag); 855 set_user_tag(UserTags::kDefaultUserTag);
855 } 856 }
856 857
857 #undef REUSABLE_HANDLE_SCOPE_INIT 858 #undef REUSABLE_HANDLE_SCOPE_INIT
858 #undef REUSABLE_HANDLE_INITIALIZERS 859 #undef REUSABLE_HANDLE_INITIALIZERS
859 860
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
1082 } 1083 }
1083 1084
1084 1085
1085 #ifndef PRODUCT 1086 #ifndef PRODUCT
1086 void Isolate::ReportReloadError(const Error& error) { 1087 void Isolate::ReportReloadError(const Error& error) {
1087 ASSERT(IsReloading()); 1088 ASSERT(IsReloading());
1088 reload_context_->AbortReload(error); 1089 reload_context_->AbortReload(error);
1089 } 1090 }
1090 1091
1091 1092
1092 void Isolate::ReloadSources(bool dont_delete_reload_context) { 1093 void Isolate::ReloadSources(bool force_reload,
1094 bool dont_delete_reload_context) {
1093 // TODO(asiva): Add verification of canonical objects. 1095 // TODO(asiva): Add verification of canonical objects.
1094 ASSERT(!IsReloading()); 1096 ASSERT(!IsReloading());
1095 has_attempted_reload_ = true; 1097 has_attempted_reload_ = true;
1096 reload_context_ = new IsolateReloadContext(this); 1098 reload_context_ = new IsolateReloadContext(this);
1097 reload_context_->StartReload(); 1099 reload_context_->StartReload(force_reload);
1098 // TODO(asiva): Add verification of canonical objects. 1100 // TODO(asiva): Add verification of canonical objects.
1099 if (dont_delete_reload_context) { 1101 if (dont_delete_reload_context) {
1100 // Unit tests use the reload context later. Caller is responsible 1102 // Unit tests use the reload context later. Caller is responsible
1101 // for deleting the context. 1103 // for deleting the context.
1102 return; 1104 return;
1103 } 1105 }
1104 DeleteReloadContext(); 1106 DeleteReloadContext();
1105 } 1107 }
1106 1108
1107 1109
(...skipping 1783 matching lines...) Expand 10 before | Expand all | Expand 10 after
2891 void IsolateSpawnState::DecrementSpawnCount() { 2893 void IsolateSpawnState::DecrementSpawnCount() {
2892 ASSERT(spawn_count_monitor_ != NULL); 2894 ASSERT(spawn_count_monitor_ != NULL);
2893 ASSERT(spawn_count_ != NULL); 2895 ASSERT(spawn_count_ != NULL);
2894 MonitorLocker ml(spawn_count_monitor_); 2896 MonitorLocker ml(spawn_count_monitor_);
2895 ASSERT(*spawn_count_ > 0); 2897 ASSERT(*spawn_count_ > 0);
2896 *spawn_count_ = *spawn_count_ - 1; 2898 *spawn_count_ = *spawn_count_ - 1;
2897 ml.Notify(); 2899 ml.Notify();
2898 } 2900 }
2899 2901
2900 } // namespace dart 2902 } // 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