Index: src/objects.h |
diff --git a/src/objects.h b/src/objects.h |
index 1f656bc0b50bbc0f1ad27a19e6345ced0a244515..a3765e3210c47171f6f8eb68acba13dde7163787 100644 |
--- a/src/objects.h |
+++ b/src/objects.h |
@@ -1953,11 +1953,18 @@ class HeapNumber: public HeapObject { |
// Layout description. |
static const int kValueOffset = HeapObject::kHeaderSize; |
// IEEE doubles are two 32 bit words. The first is just mantissa, the second |
- // is a mixture of sign, exponent and mantissa. Our current platforms are all |
- // little endian apart from non-EABI arm which is little endian with big |
- // endian floating point word ordering! |
+ // is a mixture of sign, exponent and mantissa. The offsets of two 32 bit |
+ // words within double numbers are endian dependent and they are set |
+ // accordingly. |
+#if __BYTE_ORDER == __LITTLE_ENDIAN |
Jakob Kummerow
2014/04/15 08:11:20
Any reason this doesn't use V8_TARGET_LITTLE_ENDIA
dusmil
2014/04/15 15:22:22
It is used to keep consistency because there are o
dusmil
2014/04/15 15:22:22
Done.
|
static const int kMantissaOffset = kValueOffset; |
static const int kExponentOffset = kValueOffset + 4; |
+#elif __BYTE_ORDER == __BIG_ENDIAN |
+ static const int kMantissaOffset = kValueOffset + 4; |
+ static const int kExponentOffset = kValueOffset; |
+#else |
+#error Unknown byte ordering |
+#endif |
static const int kSize = kValueOffset + kDoubleSize; |
static const uint32_t kSignMask = 0x80000000u; |