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

Unified Diff: runtime/vm/globals.h

Issue 9209001: Move utils.h and utils.cc from runtime/vm to runtime/platform (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 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
Index: runtime/vm/globals.h
diff --git a/runtime/vm/globals.h b/runtime/vm/globals.h
index ffb6d3ff036d6d57901f18b22bf8245770d26b98..56fc56e8af6fa17e7ebd5e8adb47f6eb63d9d8cf 100644
--- a/runtime/vm/globals.h
+++ b/runtime/vm/globals.h
@@ -22,121 +22,6 @@
namespace dart {
-// Processor architecture detection. For more info on what's defined, see:
-// http://msdn.microsoft.com/en-us/library/b0084kay.aspx
-// http://www.agner.org/optimize/calling_conventions.pdf
-// or with gcc, run: "echo | gcc -E -dM -"
-#if defined(_M_X64) || defined(__x86_64__)
-#define HOST_ARCH_X64 1
-#define ARCH_IS_64_BIT 1
-#elif defined(_M_IX86) || defined(__i386__)
-#define HOST_ARCH_IA32 1
-#define ARCH_IS_32_BIT 1
-#elif defined(__ARMEL__)
-#define HOST_ARCH_ARM 1
-#define ARCH_IS_32_BIT 1
-#else
-#error Architecture was not detected as supported by Dart.
-#endif
-
-#if !defined(TARGET_ARCH_ARM)
-#if !defined(TARGET_ARCH_X64)
-#if !defined(TARGET_ARCH_IA32)
-// No target architecture specified pick the one matching the host architecture.
-#if defined(HOST_ARCH_ARM)
-#define TARGET_ARCH_ARM 1
-#elif defined(HOST_ARCH_X64)
-#define TARGET_ARCH_X64 1
-#elif defined(HOST_ARCH_IA32)
-#define TARGET_ARCH_IA32 1
-#else
-#error Automatic target architecture detection failed.
-#endif
-#endif
-#endif
-#endif
-
-// Verify that host and target architectures match, we cannot
-// have a 64 bit Dart VM generating 32 bit code or vice-versa.
-#if defined(TARGET_ARCH_X64)
-#if !defined(ARCH_IS_64_BIT)
-#error Mismatched Host/Target architectures.
-#endif
-#elif defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_ARM)
-#if !defined(ARCH_IS_32_BIT)
-#error Mismatched Host/Target architectures.
-#endif
-#endif
-
-
-// Printf format for intptr_t on Windows.
-#if !defined(PRIxPTR) && defined(TARGET_OS_WINDOWS)
-#if defined(ARCH_IS_32_BIT)
-#define PRIxPTR "x"
-#else
-#define PRIxPTR "llx"
-#endif // defined(ARCH_IS_32_BIT)
-#endif // !defined(PRIxPTR) && defined(TARGET_OS_WINDOWS)
-
-
-// Suffixes for 64-bit integer literals.
-#ifdef _MSC_VER
-#define DART_INT64_C(x) x##I64
-#define DART_UINT64_C(x) x##UI64
-#else
-#define DART_INT64_C(x) x##LL
-#define DART_UINT64_C(x) x##ULL
-#endif
-
-
-// The following macro works on both 32 and 64-bit platforms.
-// Usage: instead of writing 0x1234567890123456
-// write DART_2PART_UINT64_C(0x12345678,90123456);
-#define DART_2PART_UINT64_C(a, b) \
- (((static_cast<uint64_t>(a) << 32) + 0x##b##u))
-
-
-// Types for native machine words. Guaranteed to be able to hold pointers and
-// integers.
-typedef intptr_t word;
-typedef uintptr_t uword;
-
-// A type large enough to contain the value of the C++ vtable. This is needed
-// to support the handle operations.
-typedef uword cpp_vtable;
-
-// Byte sizes.
-const int kWordSize = sizeof(word);
-#ifdef ARCH_IS_32_BIT
-const int kWordSizeLog2 = 2;
-#else
-const int kWordSizeLog2 = 3;
-#endif
-
-// Bit sizes.
-const int kBitsPerByte = 8;
-const int kBitsPerByteLog2 = 3;
-const int kBitsPerWord = kWordSize * kBitsPerByte;
-
-// System-wide named constants.
-const int KB = 1024;
-const int MB = KB * KB;
-const int GB = KB * KB * KB;
-const intptr_t kIntptrOne = 1;
-const intptr_t kIntptrMin = (kIntptrOne << (kBitsPerWord - 1));
-const intptr_t kIntptrMax = ~kIntptrMin;
-
-// Time constants.
-const int kMillisecondsPerSecond = 1000;
-const int kMicrosecondsPerMillisecond = 1000;
-const int kMicrosecondsPerSecond = (kMicrosecondsPerMillisecond *
- kMillisecondsPerSecond);
-const int kNanosecondsPerMicrosecond = 1000;
-const int kNanosecondsPerMillisecond = (kNanosecondsPerMicrosecond *
- kMicrosecondsPerMillisecond);
-const int kNanosecondsPerSecond = (kNanosecondsPerMicrosecond *
- kMicrosecondsPerSecond);
-
// The expression ARRAY_SIZE(array) is a compile-time constant of type
// size_t which represents the number of elements of the given
// array. You should only use ARRAY_SIZE on statically allocated

Powered by Google App Engine
This is Rietveld 408576698