OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 #ifndef V8_BASE_LOGGING_H_ | 5 #ifndef V8_BASE_LOGGING_H_ |
6 #define V8_BASE_LOGGING_H_ | 6 #define V8_BASE_LOGGING_H_ |
7 | 7 |
8 #include <cstring> | 8 #include <cstring> |
9 #include <sstream> | 9 #include <sstream> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "src/base/build_config.h" | 12 #include "src/base/build_config.h" |
13 #include "src/base/compiler-specific.h" | 13 #include "src/base/compiler-specific.h" |
14 | 14 |
15 extern "C" PRINTF_FORMAT(3, 4) V8_NORETURN | 15 extern "C" PRINTF_FORMAT(3, 4) V8_NORETURN |
16 void V8_Fatal(const char* file, int line, const char* format, ...); | 16 void V8_Fatal(const char* file, int line, const char* format, ...); |
17 | 17 |
18 extern "C" void V8_RuntimeError(const char* file, int line, | |
19 const char* message); | |
20 | |
21 // The FATAL, UNREACHABLE and UNIMPLEMENTED macros are useful during | 18 // The FATAL, UNREACHABLE and UNIMPLEMENTED macros are useful during |
22 // development, but they should not be relied on in the final product. | 19 // development, but they should not be relied on in the final product. |
23 #ifdef DEBUG | 20 #ifdef DEBUG |
24 #define FATAL(msg) \ | 21 #define FATAL(msg) \ |
25 V8_Fatal(__FILE__, __LINE__, "%s", (msg)) | 22 V8_Fatal(__FILE__, __LINE__, "%s", (msg)) |
26 #define UNIMPLEMENTED() \ | 23 #define UNIMPLEMENTED() \ |
27 V8_Fatal(__FILE__, __LINE__, "unimplemented code") | 24 V8_Fatal(__FILE__, __LINE__, "unimplemented code") |
28 #define UNREACHABLE() \ | 25 #define UNREACHABLE() \ |
29 V8_Fatal(__FILE__, __LINE__, "unreachable code") | 26 V8_Fatal(__FILE__, __LINE__, "unreachable code") |
30 #else | 27 #else |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 #define DCHECK_GT(v1, v2) ((void) 0) | 168 #define DCHECK_GT(v1, v2) ((void) 0) |
172 #define DCHECK_GE(v1, v2) ((void) 0) | 169 #define DCHECK_GE(v1, v2) ((void) 0) |
173 #define DCHECK_LT(v1, v2) ((void) 0) | 170 #define DCHECK_LT(v1, v2) ((void) 0) |
174 #define DCHECK_LE(v1, v2) ((void) 0) | 171 #define DCHECK_LE(v1, v2) ((void) 0) |
175 #define DCHECK_NULL(val) ((void) 0) | 172 #define DCHECK_NULL(val) ((void) 0) |
176 #define DCHECK_NOT_NULL(val) ((void) 0) | 173 #define DCHECK_NOT_NULL(val) ((void) 0) |
177 #define DCHECK_IMPLIES(v1, v2) ((void) 0) | 174 #define DCHECK_IMPLIES(v1, v2) ((void) 0) |
178 #endif | 175 #endif |
179 | 176 |
180 #endif // V8_BASE_LOGGING_H_ | 177 #endif // V8_BASE_LOGGING_H_ |
OLD | NEW |