OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1286 | 1286 |
1287 inline int get_exponent(); | 1287 inline int get_exponent(); |
1288 inline int get_sign(); | 1288 inline int get_sign(); |
1289 | 1289 |
1290 // Layout description. | 1290 // Layout description. |
1291 static const int kValueOffset = HeapObject::kHeaderSize; | 1291 static const int kValueOffset = HeapObject::kHeaderSize; |
1292 // IEEE doubles are two 32 bit words. The first is just mantissa, the second | 1292 // IEEE doubles are two 32 bit words. The first is just mantissa, the second |
1293 // is a mixture of sign, exponent and mantissa. Our current platforms are all | 1293 // is a mixture of sign, exponent and mantissa. Our current platforms are all |
1294 // little endian apart from non-EABI arm which is little endian with big | 1294 // little endian apart from non-EABI arm which is little endian with big |
1295 // endian floating point word ordering! | 1295 // endian floating point word ordering! |
1296 #if !defined(V8_HOST_ARCH_ARM) || defined(USE_ARM_EABI) | |
1297 static const int kMantissaOffset = kValueOffset; | 1296 static const int kMantissaOffset = kValueOffset; |
1298 static const int kExponentOffset = kValueOffset + 4; | 1297 static const int kExponentOffset = kValueOffset + 4; |
1299 #else | 1298 |
1300 static const int kMantissaOffset = kValueOffset + 4; | |
1301 static const int kExponentOffset = kValueOffset; | |
1302 # define BIG_ENDIAN_FLOATING_POINT 1 | |
1303 #endif | |
1304 static const int kSize = kValueOffset + kDoubleSize; | 1299 static const int kSize = kValueOffset + kDoubleSize; |
1305 static const uint32_t kSignMask = 0x80000000u; | 1300 static const uint32_t kSignMask = 0x80000000u; |
1306 static const uint32_t kExponentMask = 0x7ff00000u; | 1301 static const uint32_t kExponentMask = 0x7ff00000u; |
1307 static const uint32_t kMantissaMask = 0xfffffu; | 1302 static const uint32_t kMantissaMask = 0xfffffu; |
1308 static const int kMantissaBits = 52; | 1303 static const int kMantissaBits = 52; |
1309 static const int kExponentBits = 11; | 1304 static const int kExponentBits = 11; |
1310 static const int kExponentBias = 1023; | 1305 static const int kExponentBias = 1023; |
1311 static const int kExponentShift = 20; | 1306 static const int kExponentShift = 20; |
1312 static const int kMantissaBitsInTopWord = 20; | 1307 static const int kMantissaBitsInTopWord = 20; |
1313 static const int kNonMantissaBitsInTopWord = 12; | 1308 static const int kNonMantissaBitsInTopWord = 12; |
(...skipping 5339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6653 } else { | 6648 } else { |
6654 value &= ~(1 << bit_position); | 6649 value &= ~(1 << bit_position); |
6655 } | 6650 } |
6656 return value; | 6651 return value; |
6657 } | 6652 } |
6658 }; | 6653 }; |
6659 | 6654 |
6660 } } // namespace v8::internal | 6655 } } // namespace v8::internal |
6661 | 6656 |
6662 #endif // V8_OBJECTS_H_ | 6657 #endif // V8_OBJECTS_H_ |
OLD | NEW |