[vm] Move VM globals from runtime/platform to runtime/vm.
Change-Id: Ia271602865c259cc5a6e001869f3104817d1ce44
Reviewed-on: https://dart-review.googlesource.com/63261
Reviewed-by: Zach Anderson <zra@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
diff --git a/runtime/platform/assert.cc b/runtime/platform/assert.cc
index 262548e..deac89e 100644
--- a/runtime/platform/assert.cc
+++ b/runtime/platform/assert.cc
@@ -39,7 +39,7 @@
va_end(arguments);
// Abort right away.
- NOT_IN_PRODUCT(Dart_DumpNativeStackTrace(NULL));
+ Dart_DumpNativeStackTrace(NULL);
OS::Abort();
}
diff --git a/runtime/platform/globals.h b/runtime/platform/globals.h
index 0959729..11c9d32 100644
--- a/runtime/platform/globals.h
+++ b/runtime/platform/globals.h
@@ -115,37 +115,12 @@
#error Automatic target os detection failed.
#endif
-// Setup product, release or debug build related macros.
-#if defined(PRODUCT) && defined(DEBUG)
-#error Both PRODUCT and DEBUG defined.
-#endif // defined(PRODUCT) && defined(DEBUG)
-
-#if defined(PRODUCT)
-#define NOT_IN_PRODUCT(code)
-#else // defined(PRODUCT)
-#define NOT_IN_PRODUCT(code) code
-#endif // defined(PRODUCT)
-
#if defined(DEBUG)
#define DEBUG_ONLY(code) code
#else // defined(DEBUG)
#define DEBUG_ONLY(code)
#endif // defined(DEBUG)
-#if defined(DART_PRECOMPILED_RUNTIME) && defined(DART_PRECOMPILER)
-#error DART_PRECOMPILED_RUNTIME and DART_PRECOMPILER are mutually exclusive
-#endif // defined(DART_PRECOMPILED_RUNTIME) && defined(DART_PRECOMPILER)
-
-#if defined(DART_PRECOMPILED_RUNTIME) && defined(DART_NOSNAPSHOT)
-#error DART_PRECOMPILED_RUNTIME and DART_NOSNAPSHOT are mutually exclusive
-#endif // defined(DART_PRECOMPILED_RUNTIME) && defined(DART_NOSNAPSHOT)
-
-#if defined(DART_PRECOMPILED_RUNTIME)
-#define NOT_IN_PRECOMPILED(code)
-#else
-#define NOT_IN_PRECOMPILED(code) code
-#endif // defined(DART_PRECOMPILED_RUNTIME)
-
namespace dart {
struct simd128_value_t {
@@ -709,14 +684,6 @@
#define STDERR_FILENO 2
#endif
-// For checking deterministic graph generation, we can store instruction
-// tag in the ICData and check it when recreating the flow graph in
-// optimizing compiler. Enable it for other modes (product, release) if needed
-// for debugging.
-#if defined(DEBUG)
-#define TAG_IC_DATA
-#endif
-
} // namespace dart
#endif // RUNTIME_PLATFORM_GLOBALS_H_
diff --git a/runtime/platform/text_buffer.cc b/runtime/platform/text_buffer.cc
index 5717604..b1ef63a 100644
--- a/runtime/platform/text_buffer.cc
+++ b/runtime/platform/text_buffer.cc
@@ -150,8 +150,6 @@
}
}
-#ifndef PRODUCT
-
void BufferFormatter::Print(const char* format, ...) {
va_list args;
va_start(args, format);
@@ -169,6 +167,4 @@
}
}
-#endif // !PRODUCT
-
} // namespace dart
diff --git a/runtime/vm/globals.h b/runtime/vm/globals.h
index 4fa43f2..a261211 100644
--- a/runtime/vm/globals.h
+++ b/runtime/vm/globals.h
@@ -49,10 +49,42 @@
((sizeof(array) / sizeof(*(array))) / \
static_cast<intptr_t>(!(sizeof(array) % sizeof(*(array))))) // NOLINT
+#if defined(PRODUCT) && defined(DEBUG)
+#error Both PRODUCT and DEBUG defined.
+#endif // defined(PRODUCT) && defined(DEBUG)
+
+#if defined(PRODUCT)
+#define NOT_IN_PRODUCT(code)
+#else // defined(PRODUCT)
+#define NOT_IN_PRODUCT(code) code
+#endif // defined(PRODUCT)
+
+#if defined(DART_PRECOMPILED_RUNTIME) && defined(DART_PRECOMPILER)
+#error DART_PRECOMPILED_RUNTIME and DART_PRECOMPILER are mutually exclusive
+#endif // defined(DART_PRECOMPILED_RUNTIME) && defined(DART_PRECOMPILER)
+
+#if defined(DART_PRECOMPILED_RUNTIME) && defined(DART_NOSNAPSHOT)
+#error DART_PRECOMPILED_RUNTIME and DART_NOSNAPSHOT are mutually exclusive
+#endif // defined(DART_PRECOMPILED_RUNTIME) && defined(DART_NOSNAPSHOT)
+
+#if defined(DART_PRECOMPILED_RUNTIME)
+#define NOT_IN_PRECOMPILED(code)
+#else
+#define NOT_IN_PRECOMPILED(code) code
+#endif // defined(DART_PRECOMPILED_RUNTIME)
+
#if defined(ARCH_IS_64_BIT)
#define HASH_IN_OBJECT_HEADER 1
#endif
+// For checking deterministic graph generation, we can store instruction
+// tag in the ICData and check it when recreating the flow graph in
+// optimizing compiler. Enable it for other modes (product, release) if needed
+// for debugging.
+#if defined(DEBUG)
+#define TAG_IC_DATA
+#endif
+
// The expression OFFSET_OF(type, field) computes the byte-offset of
// the specified field relative to the containing type.
//