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

Unified Diff: src/checks.h

Issue 148293020: Merge experimental/a64 to bleeding_edge. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Remove ARM from OWNERS Created 6 years, 10 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/builtins.cc ('k') | src/code-stubs.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/checks.h
diff --git a/src/checks.h b/src/checks.h
index f7b145fc8a8ceb052a573c05b590d3057ac8ddaa..3829b4ac39b80973a9b7300d3531260cad4c9fc9 100644
--- a/src/checks.h
+++ b/src/checks.h
@@ -34,6 +34,9 @@
extern "C" void V8_Fatal(const char* file, int line, const char* format, ...);
+// Define custom A64 preprocessor helpers to facilitate development.
+#ifndef V8_TARGET_ARCH_A64
+
// The FATAL, UNREACHABLE and UNIMPLEMENTED macros are useful during
// development, but they should not be relied on in the final product.
#ifdef DEBUG
@@ -51,6 +54,71 @@ extern "C" void V8_Fatal(const char* file, int line, const char* format, ...);
#define UNREACHABLE() ((void) 0)
#endif
+#else
+
+ #ifdef DEBUG
+ #define FATAL(msg) \
+ V8_Fatal(__FILE__, __LINE__, "%s", (msg))
+ #define UNREACHABLE() \
+ V8_Fatal(__FILE__, __LINE__, "unreachable code")
+ #else
+ #define FATAL(msg) \
+ V8_Fatal("", 0, "%s", (msg))
+ #define UNREACHABLE() ((void) 0)
+ #endif
+
+ #define ABORT() printf("in %s, line %i, %s", __FILE__, __LINE__, __func__); \
+ abort()
+
+ #define ALIGNMENT_EXCEPTION() printf("ALIGNMENT EXCEPTION\t"); ABORT()
+
+ // Helpers for unimplemented sections.
+ #define UNIMPLEMENTED() \
+ do { \
+ printf("UNIMPLEMENTED: %s, line %d, %s\n", \
+ __FILE__, __LINE__, __func__); \
+ V8_Fatal(__FILE__, __LINE__, "unimplemented code"); \
+ } while (0)
+ #define UNIMPLEMENTED_M(message) \
+ do { \
+ printf("UNIMPLEMENTED: %s, line %d, %s : %s\n", \
+ __FILE__, __LINE__, __func__, message); \
+ V8_Fatal(__FILE__, __LINE__, "unimplemented code"); \
+ } while (0)
+ // Like UNIMPLEMENTED, but does not abort.
+ #define TODO_UNIMPLEMENTED(message) \
+ do { \
+ static const unsigned int kLimit = 1; \
+ static unsigned int printed = 0; \
+ if (printed < UINT_MAX) { \
+ printed++; \
+ } \
+ if (printed <= kLimit) { \
+ printf("UNIMPLEMENTED: %s, line %d, %s: %s\n", \
+ __FILE__, __LINE__, __func__, message); \
+ } \
+ } while (0)
+
+ // Simulator specific helpers.
+ #ifdef USE_SIMULATOR
+ // Helpers for unimplemented sections.
+ // TODO(all): If possible automatically prepend an indicator like
+ // UNIMPLEMENTED or LOCATION.
+ #define ASM_UNIMPLEMENTED(message) \
+ __ Debug(message, __LINE__, NO_PARAM)
+ #define ASM_UNIMPLEMENTED_BREAK(message) \
+ __ Debug(message, __LINE__, \
+ FLAG_ignore_asm_unimplemented_break ? NO_PARAM : BREAK)
+ #define ASM_LOCATION(message) \
+ __ Debug("LOCATION: " message, __LINE__, NO_PARAM)
+ #else
+ #define ASM_UNIMPLEMENTED(message)
+ #define ASM_UNIMPLEMENTED_BREAK(message)
+ #define ASM_LOCATION(message)
+ #endif
+
+#endif
+
// The CHECK macro checks that the given condition is true; if not, it
// prints a message to stderr and aborts.
« no previous file with comments | « src/builtins.cc ('k') | src/code-stubs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698