OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 1935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1946 void HeapNumberPrint(FILE* out = stdout); | 1946 void HeapNumberPrint(FILE* out = stdout); |
1947 void HeapNumberPrint(StringStream* accumulator); | 1947 void HeapNumberPrint(StringStream* accumulator); |
1948 DECLARE_VERIFIER(HeapNumber) | 1948 DECLARE_VERIFIER(HeapNumber) |
1949 | 1949 |
1950 inline int get_exponent(); | 1950 inline int get_exponent(); |
1951 inline int get_sign(); | 1951 inline int get_sign(); |
1952 | 1952 |
1953 // Layout description. | 1953 // Layout description. |
1954 static const int kValueOffset = HeapObject::kHeaderSize; | 1954 static const int kValueOffset = HeapObject::kHeaderSize; |
1955 // IEEE doubles are two 32 bit words. The first is just mantissa, the second | 1955 // IEEE doubles are two 32 bit words. The first is just mantissa, the second |
1956 // is a mixture of sign, exponent and mantissa. Our current platforms are all | 1956 // is a mixture of sign, exponent and mantissa. The offsets of two 32 bit |
1957 // little endian apart from non-EABI arm which is little endian with big | 1957 // words within double numbers are endian dependent and they are set |
1958 // endian floating point word ordering! | 1958 // accordingly. |
1959 #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.
| |
1959 static const int kMantissaOffset = kValueOffset; | 1960 static const int kMantissaOffset = kValueOffset; |
1960 static const int kExponentOffset = kValueOffset + 4; | 1961 static const int kExponentOffset = kValueOffset + 4; |
1962 #elif __BYTE_ORDER == __BIG_ENDIAN | |
1963 static const int kMantissaOffset = kValueOffset + 4; | |
1964 static const int kExponentOffset = kValueOffset; | |
1965 #else | |
1966 #error Unknown byte ordering | |
1967 #endif | |
1961 | 1968 |
1962 static const int kSize = kValueOffset + kDoubleSize; | 1969 static const int kSize = kValueOffset + kDoubleSize; |
1963 static const uint32_t kSignMask = 0x80000000u; | 1970 static const uint32_t kSignMask = 0x80000000u; |
1964 static const uint32_t kExponentMask = 0x7ff00000u; | 1971 static const uint32_t kExponentMask = 0x7ff00000u; |
1965 static const uint32_t kMantissaMask = 0xfffffu; | 1972 static const uint32_t kMantissaMask = 0xfffffu; |
1966 static const int kMantissaBits = 52; | 1973 static const int kMantissaBits = 52; |
1967 static const int kExponentBits = 11; | 1974 static const int kExponentBits = 11; |
1968 static const int kExponentBias = 1023; | 1975 static const int kExponentBias = 1023; |
1969 static const int kExponentShift = 20; | 1976 static const int kExponentShift = 20; |
1970 static const int kInfinityOrNanExponent = | 1977 static const int kInfinityOrNanExponent = |
(...skipping 9051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
11022 } else { | 11029 } else { |
11023 value &= ~(1 << bit_position); | 11030 value &= ~(1 << bit_position); |
11024 } | 11031 } |
11025 return value; | 11032 return value; |
11026 } | 11033 } |
11027 }; | 11034 }; |
11028 | 11035 |
11029 } } // namespace v8::internal | 11036 } } // namespace v8::internal |
11030 | 11037 |
11031 #endif // V8_OBJECTS_H_ | 11038 #endif // V8_OBJECTS_H_ |
OLD | NEW |