From 502407335de60eec82a49529a8339003c033bb37 Mon Sep 17 00:00:00 2001 From: jochen Date: Mon, 19 Jan 2015 02:12:28 -0800 Subject: [PATCH] Add missing if (FLAG_verify_heap) checks around heap verification BUG=chromium:449943 R=svenpanne@chromium.org LOG=n Review URL: https://codereview.chromium.org/848403003 Cr-Commit-Position: refs/heads/master@{#26127} --- src/api.cc | 8 ++++++-- src/bootstrapper.cc | 4 +++- src/execution.cc | 4 +++- src/heap-snapshot-generator.cc | 8 ++++++-- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/api.cc b/src/api.cc index 3f6e109..feacc30 100644 --- a/src/api.cc +++ b/src/api.cc @@ -409,7 +409,9 @@ i::Object** V8::GlobalizeReference(i::Isolate* isolate, i::Object** obj) { LOG_API(isolate, "Persistent::New"); i::Handle result = isolate->global_handles()->Create(*obj); #ifdef VERIFY_HEAP - (*obj)->ObjectVerify(); + if (i::FLAG_verify_heap) { + (*obj)->ObjectVerify(); + } #endif // VERIFY_HEAP return result.location(); } @@ -418,7 +420,9 @@ i::Object** V8::GlobalizeReference(i::Isolate* isolate, i::Object** obj) { i::Object** V8::CopyPersistent(i::Object** obj) { i::Handle result = i::GlobalHandles::CopyGlobal(obj); #ifdef VERIFY_HEAP - (*obj)->ObjectVerify(); + if (i::FLAG_verify_heap) { + (*obj)->ObjectVerify(); + } #endif // VERIFY_HEAP return result.location(); } diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc index 049519b..076ae69 100644 --- a/src/bootstrapper.cc +++ b/src/bootstrapper.cc @@ -2164,7 +2164,9 @@ bool Genesis::InstallNatives() { } #ifdef VERIFY_HEAP - builtins->ObjectVerify(); + if (FLAG_verify_heap) { + builtins->ObjectVerify(); + } #endif return true; diff --git a/src/execution.cc b/src/execution.cc index b09904d..998afb8 100644 --- a/src/execution.cc +++ b/src/execution.cc @@ -109,7 +109,9 @@ MUST_USE_RESULT static MaybeHandle Invoke( } #ifdef VERIFY_HEAP - value->ObjectVerify(); + if (FLAG_verify_heap) { + value->ObjectVerify(); + } #endif // Update the pending exception flag and return the value. diff --git a/src/heap-snapshot-generator.cc b/src/heap-snapshot-generator.cc index dec42a8..ec1f645 100644 --- a/src/heap-snapshot-generator.cc +++ b/src/heap-snapshot-generator.cc @@ -2551,13 +2551,17 @@ bool HeapSnapshotGenerator::GenerateSnapshot() { #ifdef VERIFY_HEAP Heap* debug_heap = heap_; - debug_heap->Verify(); + if (FLAG_verify_heap) { + debug_heap->Verify(); + } #endif SetProgressTotal(2); // 2 passes. #ifdef VERIFY_HEAP - debug_heap->Verify(); + if (FLAG_verify_heap) { + debug_heap->Verify(); + } #endif snapshot_->AddSyntheticRootEntries(); -- 2.7.4