[heap] Only verify object layout with --heap-verify on.

Change-Id: I0de0ea0798c39831765bb3c00a00d0df7471bc3b
Reviewed-on: https://chromium-review.googlesource.com/695407
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Jaroslav Sevcik <jarin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48269}
This commit is contained in:
Jaroslav Sevcik 2017-10-02 17:06:50 +02:00 committed by Commit Bot
parent 38b489186b
commit ea3d7196a4

View File

@ -4102,8 +4102,10 @@ void Heap::NotifyObjectLayoutChange(HeapObject* object, int size,
} }
} }
#ifdef VERIFY_HEAP #ifdef VERIFY_HEAP
DCHECK_NULL(pending_layout_change_object_); if (FLAG_verify_heap) {
pending_layout_change_object_ = object; DCHECK_NULL(pending_layout_change_object_);
pending_layout_change_object_ = object;
}
#endif #endif
} }
@ -4126,6 +4128,8 @@ class SlotCollectingVisitor final : public ObjectVisitor {
}; };
void Heap::VerifyObjectLayoutChange(HeapObject* object, Map* new_map) { void Heap::VerifyObjectLayoutChange(HeapObject* object, Map* new_map) {
if (!FLAG_verify_heap) return;
// Check that Heap::NotifyObjectLayout was called for object transitions // Check that Heap::NotifyObjectLayout was called for object transitions
// that are not safe for concurrent marking. // that are not safe for concurrent marking.
// If you see this check triggering for a freshly allocated object, // If you see this check triggering for a freshly allocated object,