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

Unified Diff: runtime/vm/isolate_reload.cc

Issue 2490233004: - Turn on canonicalization verification after a reload in debug mode. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/object.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 139c6d4dbe38863c7a0dd8085390a88eadc1d2f5..afc32a84a5b98cbe282ce34e3de203ad801e1fd3 100644
--- a/runtime/vm/isolate_reload.cc
+++ b/runtime/vm/isolate_reload.cc
@@ -1164,6 +1164,31 @@ void IsolateReloadContext::Commit() {
libs.Length());
}
}
+
+ // Rehash constants map for all new classes and the closure class.
+ Class& cls = Class::Handle(zone_);
+ cls = I->class_table()->At(kClosureCid);
+ cls.RehashConstants(zone_);
+ {
+ ASSERT(class_map_storage_ != Array::null());
+ UnorderedHashMap<ClassMapTraits> map(class_map_storage_);
+ UnorderedHashMap<ClassMapTraits>::Iterator it(&map);
+ while (it.MoveNext()) {
+ const intptr_t entry = it.Current();
+ cls = Class::RawCast(map.GetKey(entry));
+ cls.RehashConstants(zone_);
+ }
+ map.Release();
+ }
+
+#ifdef DEBUG
+ // Verify that all canonical instances are correctly setup in the
+ // corresponding canonical tables.
+ Thread* thread = Thread::Current();
+ I->heap()->CollectAllGarbage();
+ VerifyCanonicalVisitor check_canonical(thread);
+ I->heap()->IterateObjects(&check_canonical);
+#endif // DEBUG
}
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698