Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Unified Diff: src/base/logging.h

Issue 769263002: Add support for enabling DCHECKs in release mode (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/base/logging.h
diff --git a/src/base/logging.h b/src/base/logging.h
index 83c1bb60136c1ec9d626c0230db452f3dbb2bf96..9bfa74427942aebc26c78c92b3b8a53e6aaa6285 100644
--- a/src/base/logging.h
+++ b/src/base/logging.h
@@ -12,10 +12,16 @@
extern "C" void V8_Fatal(const char* file, int line, const char* format, ...);
+#if defined(DEBUG) || defined(DCHECK_ALWAYS_ON)
+#define DCHECK_IS_ON 1
+#else
+#define DCHECK_IS_ON 0
+#endif
+
// The FATAL, UNREACHABLE and UNIMPLEMENTED macros are useful during
// development, but they should not be relied on in the final product.
-#ifdef DEBUG
+#if DCHECK_IS_ON
#define FATAL(msg) \
V8_Fatal(__FILE__, __LINE__, "%s", (msg))
#define UNIMPLEMENTED() \
@@ -191,8 +197,8 @@ void DumpBacktrace();
// The DCHECK macro is equivalent to CHECK except that it only
-// generates code in debug builds.
-#ifdef DEBUG
+// generates code in debug builds or if DCHECK_ALWAYS_ON is defined.
+#if DCHECK_IS_ON
#define DCHECK_RESULT(expr) CHECK(expr)
#define DCHECK(condition) CHECK(condition)
#define DCHECK_EQ(v1, v2) CHECK_EQ(v1, v2)

Powered by Google App Engine
This is Rietveld 408576698