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

Unified Diff: runtime/vm/isolate_reload.cc

Issue 2144113002: Disallow deferred loading when using isolate reloading. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Code review 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/object_reload.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/isolate_reload.cc
diff --git a/runtime/vm/isolate_reload.cc b/runtime/vm/isolate_reload.cc
index 71d8387b44f9bea59598051f833a7a461daf5dc0..68ebfdaff77bde24642ff64797fe1b65ed444ff6 100644
--- a/runtime/vm/isolate_reload.cc
+++ b/runtime/vm/isolate_reload.cc
@@ -727,24 +727,47 @@ bool IsolateReloadContext::ValidateReload() {
return false;
}
- // Already built.
- ASSERT(class_map_storage_ != Array::null());
- UnorderedHashMap<ClassMapTraits> map(class_map_storage_);
- UnorderedHashMap<ClassMapTraits>::Iterator it(&map);
- Class& cls = Class::Handle();
- Class& new_cls = Class::Handle();
- while (it.MoveNext()) {
- const intptr_t entry = it.Current();
- new_cls = Class::RawCast(map.GetKey(entry));
- cls = Class::RawCast(map.GetPayload(entry, 0));
- if (new_cls.raw() != cls.raw()) {
- if (!cls.CanReload(new_cls)) {
- map.Release();
- return false;
+ // Validate libraries.
+ {
+ ASSERT(library_map_storage_ != Array::null());
+ UnorderedHashMap<LibraryMapTraits> map(library_map_storage_);
+ UnorderedHashMap<LibraryMapTraits>::Iterator it(&map);
+ Library& lib = Library::Handle();
+ Library& new_lib = Library::Handle();
+ while (it.MoveNext()) {
+ const intptr_t entry = it.Current();
+ new_lib = Library::RawCast(map.GetKey(entry));
+ lib = Library::RawCast(map.GetPayload(entry, 0));
+ if (new_lib.raw() != lib.raw()) {
+ if (!lib.CanReload(new_lib)) {
+ map.Release();
+ return false;
+ }
}
}
+ map.Release();
+ }
+
+ // Validate classes.
+ {
+ ASSERT(class_map_storage_ != Array::null());
+ UnorderedHashMap<ClassMapTraits> map(class_map_storage_);
+ UnorderedHashMap<ClassMapTraits>::Iterator it(&map);
+ Class& cls = Class::Handle();
+ Class& new_cls = Class::Handle();
+ while (it.MoveNext()) {
+ const intptr_t entry = it.Current();
+ new_cls = Class::RawCast(map.GetKey(entry));
+ cls = Class::RawCast(map.GetPayload(entry, 0));
+ if (new_cls.raw() != cls.raw()) {
+ if (!cls.CanReload(new_cls)) {
+ map.Release();
+ return false;
+ }
+ }
+ }
+ map.Release();
}
- map.Release();
return true;
}
« no previous file with comments | « runtime/vm/code_generator.cc ('k') | runtime/vm/object_reload.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698