Provide fast-path for CHECK macro.

Makes debug build 20% faster.

R=erik.corry@gmail.com

Review URL: http://codereview.chromium.org/8256011

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9767 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
vegorov@chromium.org 2011-10-25 09:06:07 +00:00
parent 436fb5318c
commit 93f99ec06b

View File

@ -63,7 +63,9 @@ static inline void CheckHelper(const char* file,
// The CHECK macro checks that the given condition is true; if not, it // The CHECK macro checks that the given condition is true; if not, it
// prints a message to stderr and aborts. // 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 // Helper function used by the CHECK_EQ function when given int