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

Unified Diff: src/globals.h

Issue 18014003: Add X32 port into V8 (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 7 years, 5 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: src/globals.h
===================================================================
--- src/globals.h (revision 15486)
+++ src/globals.h (working copy)
@@ -79,7 +79,11 @@
#define V8_HOST_CAN_READ_UNALIGNED 1
#else
#define V8_HOST_ARCH_X64 1
+#if defined(__x86_64__) && !defined(__LP64__)
+#define V8_HOST_ARCH_32_BIT 1
+#else
#define V8_HOST_ARCH_64_BIT 1
+#endif // defined(__x86_64__) && !defined(__LP64__)
#define V8_HOST_CAN_READ_UNALIGNED 1
#endif // __native_client__
#elif defined(_M_IX86) || defined(__i386__)
@@ -105,8 +109,8 @@
// Target architecture detection. This may be set externally. If not, detect
// in the same way as the host architecture, that is, target the native
// environment as presented by the compiler.
-#if !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_IA32 && \
- !V8_TARGET_ARCH_ARM && !V8_TARGET_ARCH_MIPS
+#if !V8_TARGET_ARCH_X64 && !V8_TARGET_ARCH_IA32 && !V8_TARGET_ARCH_ARM && \
+ !V8_TARGET_ARCH_MIPS && !V8_TARGET_ARCH_X32
#if defined(_M_X64) || defined(__x86_64__)
#define V8_TARGET_ARCH_X64 1
#elif defined(_M_IX86) || defined(__i386__)
@@ -127,6 +131,9 @@
#if V8_TARGET_ARCH_X64 && !V8_HOST_ARCH_X64
#error Target architecture x64 is only supported on x64 host
#endif
+#if (V8_TARGET_ARCH_X32 && !V8_HOST_ARCH_X64 && !V8_HOST_ARCH_32_BIT)
+#error Target architecture x32 is only supported on x64 host with x32 support
+#endif
#if (V8_TARGET_ARCH_ARM && !(V8_HOST_ARCH_IA32 || V8_HOST_ARCH_ARM))
#error Target architecture arm is only supported on arm and ia32 host
#endif
@@ -151,6 +158,8 @@
#define V8_TARGET_LITTLE_ENDIAN 1
#elif V8_TARGET_ARCH_X64
#define V8_TARGET_LITTLE_ENDIAN 1
+#elif V8_TARGET_ARCH_X32
+#define V8_TARGET_LITTLE_ENDIAN 1
#elif V8_TARGET_ARCH_ARM
#define V8_TARGET_LITTLE_ENDIAN 1
#elif V8_TARGET_ARCH_MIPS
@@ -200,6 +209,10 @@
#define V8_PTR_PREFIX "l"
#endif
#else // V8_HOST_ARCH_64_BIT
+#if V8_TARGET_ARCH_X32
+#define V8_UINT64_C(x) (x ## ULL)
+#define V8_INT64_C(x) (x ## LL)
+#endif
#define V8_INTPTR_C(x) (x)
#define V8_PTR_PREFIX ""
#endif // V8_HOST_ARCH_64_BIT
@@ -241,13 +254,16 @@
const int kDoubleSize = sizeof(double); // NOLINT
const int kIntptrSize = sizeof(intptr_t); // NOLINT
const int kPointerSize = sizeof(void*); // NOLINT
+#if V8_TARGET_ARCH_X32
+const int kHWRegSize = kPointerSize + kPointerSize;
danno 2013/07/17 13:33:21 You should define the following for all platforms
+#endif
const int kDoubleSizeLog2 = 3;
// Size of the state of a the random number generator.
const int kRandomStateSize = 2 * kIntSize;
-#if V8_HOST_ARCH_64_BIT
+#if V8_HOST_ARCH_64_BIT && !V8_TARGET_ARCH_X32
const int kPointerSizeLog2 = 3;
const intptr_t kIntptrSignBit = V8_INT64_C(0x8000000000000000);
const uintptr_t kUintptrAllBitsSet = V8_UINT64_C(0xFFFFFFFFFFFFFFFF);

Powered by Google App Engine
This is Rietveld 408576698