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(); |
} |