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

Unified Diff: src/base/logging.cc

Issue 888613002: Initial switch to Chromium-style CHECK_* and DCHECK_* macros. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: CHECK_NULL/NOT_NULL is back. Created 5 years, 11 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 | « src/base/logging.h ('k') | src/base/platform/condition-variable.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/base/logging.cc
diff --git a/src/base/logging.cc b/src/base/logging.cc
index c3f609f98018046b5ab85aa043157b7b3a1a1b65..25d77bb1ec1dc9b9e9e84e3ac2460eb689ac088f 100644
--- a/src/base/logging.cc
+++ b/src/base/logging.cc
@@ -10,14 +10,45 @@
#elif V8_OS_QNX
# include <backtrace.h>
#endif // V8_LIBC_GLIBC || V8_OS_BSD
-#include <stdio.h>
-#include <stdlib.h>
+
+#include <cstdio>
+#include <cstdlib>
#include "src/base/platform/platform.h"
namespace v8 {
namespace base {
+// Explicit instantiations for commonly used comparisons.
+#define DEFINE_MAKE_CHECK_OP_STRING(type) \
+ template std::string* MakeCheckOpString<type, type>( \
+ type const&, type const&, char const*);
+DEFINE_MAKE_CHECK_OP_STRING(int)
+DEFINE_MAKE_CHECK_OP_STRING(long) // NOLINT(runtime/int)
+DEFINE_MAKE_CHECK_OP_STRING(long long) // NOLINT(runtime/int)
+DEFINE_MAKE_CHECK_OP_STRING(unsigned int)
+DEFINE_MAKE_CHECK_OP_STRING(unsigned long) // NOLINT(runtime/int)
+DEFINE_MAKE_CHECK_OP_STRING(unsigned long long) // NOLINT(runtime/int)
+DEFINE_MAKE_CHECK_OP_STRING(char const*)
+DEFINE_MAKE_CHECK_OP_STRING(void const*)
+#undef DEFINE_MAKE_CHECK_OP_STRING
+
+
+// Explicit instantiations for floating point checks.
+#define DEFINE_CHECK_OP_IMPL(NAME) \
+ template std::string* Check##NAME##Impl<float, float>( \
+ float const& lhs, float const& rhs, char const* msg); \
+ template std::string* Check##NAME##Impl<double, double>( \
+ double const& lhs, double const& rhs, char const* msg);
+DEFINE_CHECK_OP_IMPL(EQ)
+DEFINE_CHECK_OP_IMPL(NE)
+DEFINE_CHECK_OP_IMPL(LE)
+DEFINE_CHECK_OP_IMPL(LT)
+DEFINE_CHECK_OP_IMPL(GE)
+DEFINE_CHECK_OP_IMPL(GT)
+#undef DEFINE_CHECK_OP_IMPL
+
+
// Attempts to dump a backtrace (if supported).
void DumpBacktrace() {
#if V8_LIBC_GLIBC || V8_OS_BSD
@@ -68,7 +99,8 @@ void DumpBacktrace() {
#endif // V8_LIBC_GLIBC || V8_OS_BSD
}
-} } // namespace v8::base
+} // namespace base
+} // namespace v8
// Contains protection against recursive calls (faults while handling faults).
« no previous file with comments | « src/base/logging.h ('k') | src/base/platform/condition-variable.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698