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

Side by Side Diff: src/base/logging.cc

Issue 2527883004: Revert of [base] Pass scalar arguments by value in CHECK/DCHECK (Closed)
Patch Set: Created 4 years 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 unified diff | Download patch
« no previous file with comments | « src/base/logging.h ('k') | test/unittests/base/logging-unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/base/logging.h" 5 #include "src/base/logging.h"
6 6
7 #include <cstdio> 7 #include <cstdio>
8 #include <cstdlib> 8 #include <cstdlib>
9 9
10 #include "src/base/debug/stack_trace.h" 10 #include "src/base/debug/stack_trace.h"
11 #include "src/base/platform/platform.h" 11 #include "src/base/platform/platform.h"
12 12
13 namespace v8 { 13 namespace v8 {
14 namespace base { 14 namespace base {
15 15
16 // Explicit instantiations for commonly used comparisons. 16 // Explicit instantiations for commonly used comparisons.
17 #define DEFINE_MAKE_CHECK_OP_STRING(type) \ 17 #define DEFINE_MAKE_CHECK_OP_STRING(type) \
18 template std::string* MakeCheckOpString<type, type>(type, type, char const*); 18 template std::string* MakeCheckOpString<type, type>( \
19 type const&, type const&, char const*);
19 DEFINE_MAKE_CHECK_OP_STRING(int) 20 DEFINE_MAKE_CHECK_OP_STRING(int)
20 DEFINE_MAKE_CHECK_OP_STRING(long) // NOLINT(runtime/int) 21 DEFINE_MAKE_CHECK_OP_STRING(long) // NOLINT(runtime/int)
21 DEFINE_MAKE_CHECK_OP_STRING(long long) // NOLINT(runtime/int) 22 DEFINE_MAKE_CHECK_OP_STRING(long long) // NOLINT(runtime/int)
22 DEFINE_MAKE_CHECK_OP_STRING(unsigned int) 23 DEFINE_MAKE_CHECK_OP_STRING(unsigned int)
23 DEFINE_MAKE_CHECK_OP_STRING(unsigned long) // NOLINT(runtime/int) 24 DEFINE_MAKE_CHECK_OP_STRING(unsigned long) // NOLINT(runtime/int)
24 DEFINE_MAKE_CHECK_OP_STRING(unsigned long long) // NOLINT(runtime/int) 25 DEFINE_MAKE_CHECK_OP_STRING(unsigned long long) // NOLINT(runtime/int)
25 DEFINE_MAKE_CHECK_OP_STRING(char const*) 26 DEFINE_MAKE_CHECK_OP_STRING(char const*)
26 DEFINE_MAKE_CHECK_OP_STRING(void const*) 27 DEFINE_MAKE_CHECK_OP_STRING(void const*)
27 #undef DEFINE_MAKE_CHECK_OP_STRING 28 #undef DEFINE_MAKE_CHECK_OP_STRING
28 29
29 30
30 // Explicit instantiations for floating point checks. 31 // Explicit instantiations for floating point checks.
31 #define DEFINE_CHECK_OP_IMPL(NAME) \ 32 #define DEFINE_CHECK_OP_IMPL(NAME) \
32 template std::string* Check##NAME##Impl<float, float>(float lhs, float rhs, \ 33 template std::string* Check##NAME##Impl<float, float>( \
33 char const* msg); \ 34 float const& lhs, float const& rhs, char const* msg); \
34 template std::string* Check##NAME##Impl<double, double>( \ 35 template std::string* Check##NAME##Impl<double, double>( \
35 double lhs, double rhs, char const* msg); 36 double const& lhs, double const& rhs, char const* msg);
36 DEFINE_CHECK_OP_IMPL(EQ) 37 DEFINE_CHECK_OP_IMPL(EQ)
37 DEFINE_CHECK_OP_IMPL(NE) 38 DEFINE_CHECK_OP_IMPL(NE)
38 DEFINE_CHECK_OP_IMPL(LE) 39 DEFINE_CHECK_OP_IMPL(LE)
39 DEFINE_CHECK_OP_IMPL(LT) 40 DEFINE_CHECK_OP_IMPL(LT)
40 DEFINE_CHECK_OP_IMPL(GE) 41 DEFINE_CHECK_OP_IMPL(GE)
41 DEFINE_CHECK_OP_IMPL(GT) 42 DEFINE_CHECK_OP_IMPL(GT)
42 #undef DEFINE_CHECK_OP_IMPL 43 #undef DEFINE_CHECK_OP_IMPL
43 44
44 } // namespace base 45 } // namespace base
45 } // namespace v8 46 } // namespace v8
(...skipping 12 matching lines...) Expand all
58 v8::base::OS::PrintError("\n#\n"); 59 v8::base::OS::PrintError("\n#\n");
59 60
60 v8::base::debug::StackTrace trace; 61 v8::base::debug::StackTrace trace;
61 trace.Print(); 62 trace.Print();
62 63
63 fflush(stderr); 64 fflush(stderr);
64 // Avoid dumping stack trace on abort signal. 65 // Avoid dumping stack trace on abort signal.
65 v8::base::debug::DisableSignalStackDump(); 66 v8::base::debug::DisableSignalStackDump();
66 v8::base::OS::Abort(); 67 v8::base::OS::Abort();
67 } 68 }
OLDNEW
« no previous file with comments | « src/base/logging.h ('k') | test/unittests/base/logging-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698