Reviewers: Kevin Millikin,

Description:
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!


Please review this at https://chromiumcodereview.appspot.com/9295048/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/checks.h


Index: src/checks.h
diff --git a/src/checks.h b/src/checks.h
index d93d4510f6e8a1145e7e8a73300228661443d6a8..608aa148064b9fe6ba9cb297e9c738d9c57666da 100644
--- a/src/checks.h
+++ b/src/checks.h
@@ -51,20 +51,12 @@ extern "C" void V8_Fatal(const char* file, int line, const char* format, ...);
 #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

Reply via email to