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

Unified Diff: src/objects-inl.h

Issue 917743004: Enable layout descriptor consistency checks in heap verification mode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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 | « src/objects-debug.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 748406a41313364193bd1cec63a8a67318d6b4ff..5e6e32c7945ab08435876923fa8d0526cf6358c2 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -5306,8 +5306,16 @@ void Map::UpdateDescriptors(DescriptorArray* descriptors,
if (layout_descriptor()->IsSlowLayout()) {
set_layout_descriptor(layout_desc);
}
+#ifdef VERIFY_HEAP
+ // TODO(ishell): remove these checks from VERIFY_HEAP mode.
+ if (FLAG_verify_heap) {
+ CHECK(layout_descriptor()->IsConsistentWithMap(this));
+ CHECK(visitor_id() == StaticVisitorBase::GetVisitorId(this));
+ }
+#else
SLOW_DCHECK(layout_descriptor()->IsConsistentWithMap(this));
DCHECK(visitor_id() == StaticVisitorBase::GetVisitorId(this));
+#endif
}
}
@@ -5320,7 +5328,14 @@ void Map::InitializeDescriptors(DescriptorArray* descriptors,
if (FLAG_unbox_double_fields) {
set_layout_descriptor(layout_desc);
+#ifdef VERIFY_HEAP
+ // TODO(ishell): remove these checks from VERIFY_HEAP mode.
+ if (FLAG_verify_heap) {
+ CHECK(layout_descriptor()->IsConsistentWithMap(this));
+ }
+#else
SLOW_DCHECK(layout_descriptor()->IsConsistentWithMap(this));
+#endif
set_visitor_id(StaticVisitorBase::GetVisitorId(this));
}
}
« no previous file with comments | « src/objects-debug.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698