From ea3d7196a4eef98713df588e6ded742f9f1dd34b Mon Sep 17 00:00:00 2001 From: Jaroslav Sevcik Date: Mon, 2 Oct 2017 17:06:50 +0200 Subject: [PATCH] [heap] Only verify object layout with --heap-verify on. Change-Id: I0de0ea0798c39831765bb3c00a00d0df7471bc3b Reviewed-on: https://chromium-review.googlesource.com/695407 Reviewed-by: Ulan Degenbaev Commit-Queue: Jaroslav Sevcik Cr-Commit-Position: refs/heads/master@{#48269} --- src/heap/heap.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/heap/heap.cc b/src/heap/heap.cc index 91fccd90b1..eab9dfaa6c 100644 --- a/src/heap/heap.cc +++ b/src/heap/heap.cc @@ -4102,8 +4102,10 @@ void Heap::NotifyObjectLayoutChange(HeapObject* object, int size, } } #ifdef VERIFY_HEAP - DCHECK_NULL(pending_layout_change_object_); - pending_layout_change_object_ = object; + if (FLAG_verify_heap) { + DCHECK_NULL(pending_layout_change_object_); + pending_layout_change_object_ = object; + } #endif } @@ -4126,6 +4128,8 @@ class SlotCollectingVisitor final : public ObjectVisitor { }; void Heap::VerifyObjectLayoutChange(HeapObject* object, Map* new_map) { + if (!FLAG_verify_heap) return; + // Check that Heap::NotifyObjectLayout was called for object transitions // that are not safe for concurrent marking. // If you see this check triggering for a freshly allocated object,