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}
This commit is contained in:
jochen 2015-01-19 02:12:28 -08:00 committed by Commit bot
parent 173b69f041
commit 502407335d
4 changed files with 18 additions and 6 deletions

View File

@ -409,7 +409,9 @@ i::Object** V8::GlobalizeReference(i::Isolate* isolate, i::Object** obj) {
LOG_API(isolate, "Persistent::New"); LOG_API(isolate, "Persistent::New");
i::Handle<i::Object> result = isolate->global_handles()->Create(*obj); i::Handle<i::Object> result = isolate->global_handles()->Create(*obj);
#ifdef VERIFY_HEAP #ifdef VERIFY_HEAP
if (i::FLAG_verify_heap) {
(*obj)->ObjectVerify(); (*obj)->ObjectVerify();
}
#endif // VERIFY_HEAP #endif // VERIFY_HEAP
return result.location(); 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::Object** V8::CopyPersistent(i::Object** obj) {
i::Handle<i::Object> result = i::GlobalHandles::CopyGlobal(obj); i::Handle<i::Object> result = i::GlobalHandles::CopyGlobal(obj);
#ifdef VERIFY_HEAP #ifdef VERIFY_HEAP
if (i::FLAG_verify_heap) {
(*obj)->ObjectVerify(); (*obj)->ObjectVerify();
}
#endif // VERIFY_HEAP #endif // VERIFY_HEAP
return result.location(); return result.location();
} }

View File

@ -2164,7 +2164,9 @@ bool Genesis::InstallNatives() {
} }
#ifdef VERIFY_HEAP #ifdef VERIFY_HEAP
if (FLAG_verify_heap) {
builtins->ObjectVerify(); builtins->ObjectVerify();
}
#endif #endif
return true; return true;

View File

@ -109,7 +109,9 @@ MUST_USE_RESULT static MaybeHandle<Object> Invoke(
} }
#ifdef VERIFY_HEAP #ifdef VERIFY_HEAP
if (FLAG_verify_heap) {
value->ObjectVerify(); value->ObjectVerify();
}
#endif #endif
// Update the pending exception flag and return the value. // Update the pending exception flag and return the value.

View File

@ -2551,13 +2551,17 @@ bool HeapSnapshotGenerator::GenerateSnapshot() {
#ifdef VERIFY_HEAP #ifdef VERIFY_HEAP
Heap* debug_heap = heap_; Heap* debug_heap = heap_;
if (FLAG_verify_heap) {
debug_heap->Verify(); debug_heap->Verify();
}
#endif #endif
SetProgressTotal(2); // 2 passes. SetProgressTotal(2); // 2 passes.
#ifdef VERIFY_HEAP #ifdef VERIFY_HEAP
if (FLAG_verify_heap) {
debug_heap->Verify(); debug_heap->Verify();
}
#endif #endif
snapshot_->AddSyntheticRootEntries(); snapshot_->AddSyntheticRootEntries();