Revision: 10550 Author: [email protected] Date: Mon Jan 30 05:02:48 2012 Log: Inline an inline function into the CHECK macro
CheckHelper was only used within the macro itself. Furthermore, GCC with -Winline was not always happy with the inline function. Simple solution: Inline the inline function into the macro itself. Inlining squared! Review URL: https://chromiumcodereview.appspot.com/9295048 http://code.google.com/p/v8/source/detail?r=10550 Modified: /branches/bleeding_edge/src/checks.h ======================================= --- /branches/bleeding_edge/src/checks.h Wed Jan 4 06:45:29 2012 +++ /branches/bleeding_edge/src/checks.h Mon Jan 30 05:02:48 2012 @@ -49,22 +49,14 @@ V8_Fatal("", 0, "unimplemented code") #define UNREACHABLE() ((void) 0) #endif - - -// Used by the CHECK macro -- should not be called directly. -inline void CheckHelper(const char* file, - int line, - const char* source, - bool condition) { - if (!condition) - V8_Fatal(file, line, "CHECK(%s) failed", source); -} // The CHECK macro checks that the given condition is true; if not, it // prints a message to stderr and aborts. -#define CHECK(condition) do { \ - if (!(condition)) CheckHelper(__FILE__, __LINE__, #condition, false); \ +#define CHECK(condition) do { \ + if (!(condition)) { \ + V8_Fatal(__FILE__, __LINE__, "CHECK(%s) failed", #condition); \ + } \ } while (0) -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
