Reviewers: Sven Panne,

Description:
Add missing if (FLAG_verify_heap) checks around heap verification

BUG=chromium:449943
[email protected]
LOG=n

Please review this at https://codereview.chromium.org/848403003/

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+18, -6 lines):
  M src/api.cc
  M src/bootstrapper.cc
  M src/execution.cc
  M src/heap-snapshot-generator.cc


Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 3f6e1090a05633df5c666dededd19ab0c969157b..feacc306b0ff906f46116858a57e5362611bdfe7 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<i::Object> 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<i::Object> result = i::GlobalHandles::CopyGlobal(obj);
 #ifdef VERIFY_HEAP
-  (*obj)->ObjectVerify();
+  if (i::FLAG_verify_heap) {
+    (*obj)->ObjectVerify();
+  }
 #endif  // VERIFY_HEAP
   return result.location();
 }
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 049519b6a83f08c224f13e49e12060cb93c967da..076ae691ee7de02185817b4d26d1a27327054e31 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;
Index: src/execution.cc
diff --git a/src/execution.cc b/src/execution.cc
index b09904d949d4e21e7441369b301807cb9289f561..998afb8524e6aab5c81205e1dd3d84b75c537c8e 100644
--- a/src/execution.cc
+++ b/src/execution.cc
@@ -109,7 +109,9 @@ MUST_USE_RESULT static MaybeHandle<Object> Invoke(
   }

 #ifdef VERIFY_HEAP
-  value->ObjectVerify();
+  if (FLAG_verify_heap) {
+    value->ObjectVerify();
+  }
 #endif

   // Update the pending exception flag and return the value.
Index: src/heap-snapshot-generator.cc
diff --git a/src/heap-snapshot-generator.cc b/src/heap-snapshot-generator.cc
index dec42a8b5fdd1812d488ade889d6f068db530f9f..ec1f645cadb1048bd1f62d615feddb88534b755a 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();


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to