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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/object.cc » ('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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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_reload.h" 5 #include "vm/isolate_reload.h"
6 6
7 #include "vm/become.h" 7 #include "vm/become.h"
8 #include "vm/bit_vector.h" 8 #include "vm/bit_vector.h"
9 #include "vm/code_generator.h" 9 #include "vm/code_generator.h"
10 #include "vm/compiler.h" 10 #include "vm/compiler.h"
(...skipping 1146 matching lines...) Expand 10 before | Expand all | Expand 10 after
1157 const GrowableObjectArray& saved_libs = 1157 const GrowableObjectArray& saved_libs =
1158 GrowableObjectArray::Handle(saved_libraries()); 1158 GrowableObjectArray::Handle(saved_libraries());
1159 const GrowableObjectArray& libs = 1159 const GrowableObjectArray& libs =
1160 GrowableObjectArray::Handle(I->object_store()->libraries()); 1160 GrowableObjectArray::Handle(I->object_store()->libraries());
1161 if (saved_libs.Length() != libs.Length()) { 1161 if (saved_libs.Length() != libs.Length()) {
1162 TIR_Print("Identity reload failed! B#L=%" Pd " A#L=%" Pd "\n", 1162 TIR_Print("Identity reload failed! B#L=%" Pd " A#L=%" Pd "\n",
1163 saved_libs.Length(), 1163 saved_libs.Length(),
1164 libs.Length()); 1164 libs.Length());
1165 } 1165 }
1166 } 1166 }
1167
1168 // Rehash constants map for all new classes and the closure class.
1169 Class& cls = Class::Handle(zone_);
1170 cls = I->class_table()->At(kClosureCid);
1171 cls.RehashConstants(zone_);
1172 {
1173 ASSERT(class_map_storage_ != Array::null());
1174 UnorderedHashMap<ClassMapTraits> map(class_map_storage_);
1175 UnorderedHashMap<ClassMapTraits>::Iterator it(&map);
1176 while (it.MoveNext()) {
1177 const intptr_t entry = it.Current();
1178 cls = Class::RawCast(map.GetKey(entry));
1179 cls.RehashConstants(zone_);
1180 }
1181 map.Release();
1182 }
1183
1184 #ifdef DEBUG
1185 // Verify that all canonical instances are correctly setup in the
1186 // corresponding canonical tables.
1187 Thread* thread = Thread::Current();
1188 I->heap()->CollectAllGarbage();
1189 VerifyCanonicalVisitor check_canonical(thread);
1190 I->heap()->IterateObjects(&check_canonical);
1191 #endif // DEBUG
1167 } 1192 }
1168 1193
1169 1194
1170 bool IsolateReloadContext::IsDirty(const Library& lib) { 1195 bool IsolateReloadContext::IsDirty(const Library& lib) {
1171 const intptr_t index = lib.index(); 1196 const intptr_t index = lib.index();
1172 if (index == static_cast<classid_t>(-1)) { 1197 if (index == static_cast<classid_t>(-1)) {
1173 // Treat deleted libraries as dirty. 1198 // Treat deleted libraries as dirty.
1174 return true; 1199 return true;
1175 } 1200 }
1176 ASSERT((index >= 0) && (index < library_infos_.length())); 1201 ASSERT((index >= 0) && (index < library_infos_.length()));
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
1681 ASSERT(!super_cls.IsNull()); 1706 ASSERT(!super_cls.IsNull());
1682 super_cls.AddDirectSubclass(cls); 1707 super_cls.AddDirectSubclass(cls);
1683 } 1708 }
1684 } 1709 }
1685 } 1710 }
1686 } 1711 }
1687 1712
1688 #endif // !PRODUCT 1713 #endif // !PRODUCT
1689 1714
1690 } // namespace dart 1715 } // namespace dart
OLDNEW
« 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