Revision: 9767
Author:   [email protected]
Date:     Tue Oct 25 02:06:07 2011
Log:      Provide fast-path for CHECK macro.

Makes debug build 20% faster.

[email protected]

Review URL: http://codereview.chromium.org/8256011
http://code.google.com/p/v8/source/detail?r=9767

Modified:
 /branches/bleeding_edge/src/checks.h

=======================================
--- /branches/bleeding_edge/src/checks.h        Thu Oct 13 04:54:19 2011
+++ /branches/bleeding_edge/src/checks.h        Tue Oct 25 02:06:07 2011
@@ -63,7 +63,9 @@

 // The CHECK macro checks that the given condition is true; if not, it
 // prints a message to stderr and aborts.
-#define CHECK(condition) CheckHelper(__FILE__, __LINE__, #condition, condition)
+#define CHECK(condition) do {                                             \
+    if (!(condition)) CheckHelper(__FILE__, __LINE__, #condition, false); \
+  } while(0)


 // Helper function used by the CHECK_EQ function when given int

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to