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

Unified Diff: src/checks.h

Issue 4008: In release, disable UNREACHABLE and make UNIMPLEMENTED and FATAL simpler. (Closed)
Patch Set: Created 12 years, 3 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/checks.h
diff --git a/src/checks.h b/src/checks.h
index 3908ab4c3ed69c622510e93f9c8f8c4c42aab24a..020f1294ea711e92cd4e3b86717971343bacfbbd 100644
--- a/src/checks.h
+++ b/src/checks.h
@@ -37,14 +37,20 @@ void API_Fatal(const char* location, const char* format, ...);
// The FATAL, UNREACHABLE and UNIMPLEMENTED macros are useful during
// development, but they should not be relied on in the final product.
+#ifdef DEBUG
#define FATAL(msg) \
V8_Fatal(__FILE__, __LINE__, "%s", (msg))
-
+#define UNIMPLEMENTED() \
+ V8_Fatal(__FILE__, __LINE__, "unimplemented code")
#define UNREACHABLE() \
V8_Fatal(__FILE__, __LINE__, "unreachable code")
-
+#else
+#define FATAL(msg) \
+ V8_Fatal("", 0, "%s", (msg))
#define UNIMPLEMENTED() \
- V8_Fatal(__FILE__, __LINE__, "unimplemented code")
+ V8_Fatal("", 0, "unimplemented code")
+#define UNREACHABLE() ((void) 0)
+#endif
// Used by the CHECK macro -- should not be called directly.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698