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 defined(V8_TARGET_LITTLE_ENDIAN) |
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 defined(V8_TARGET_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 5401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7372 kOptCountAndBailoutReasonOffset + kIntSize; | 7379 kOptCountAndBailoutReasonOffset + kIntSize; |
7373 | 7380 |
7374 // Total size. | 7381 // Total size. |
7375 static const int kSize = kCountersOffset + kIntSize; | 7382 static const int kSize = kCountersOffset + kIntSize; |
7376 | 7383 |
7377 #endif | 7384 #endif |
7378 | 7385 |
7379 // The construction counter for inobject slack tracking is stored in the | 7386 // The construction counter for inobject slack tracking is stored in the |
7380 // most significant byte of compiler_hints which is otherwise unused. | 7387 // most significant byte of compiler_hints which is otherwise unused. |
7381 // Its offset depends on the endian-ness of the architecture. | 7388 // Its offset depends on the endian-ness of the architecture. |
7382 #if __BYTE_ORDER == __LITTLE_ENDIAN | 7389 #if defined(V8_TARGET_LITTLE_ENDIAN) |
7383 static const int kConstructionCountOffset = kCompilerHintsOffset + 3; | 7390 static const int kConstructionCountOffset = kCompilerHintsOffset + 3; |
7384 #elif __BYTE_ORDER == __BIG_ENDIAN | 7391 #elif defined(V8_TARGET_BIG_ENDIAN) |
7385 static const int kConstructionCountOffset = kCompilerHintsOffset + 0; | 7392 static const int kConstructionCountOffset = kCompilerHintsOffset + 0; |
7386 #else | 7393 #else |
7387 #error Unknown byte ordering | 7394 #error Unknown byte ordering |
7388 #endif | 7395 #endif |
7389 | 7396 |
7390 static const int kAlignedSize = POINTER_SIZE_ALIGN(kSize); | 7397 static const int kAlignedSize = POINTER_SIZE_ALIGN(kSize); |
7391 | 7398 |
7392 typedef FixedBodyDescriptor<kNameOffset, | 7399 typedef FixedBodyDescriptor<kNameOffset, |
7393 kInitialMapOffset + kPointerSize, | 7400 kInitialMapOffset + kPointerSize, |
7394 kSize> BodyDescriptor; | 7401 kSize> BodyDescriptor; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7448 public: | 7455 public: |
7449 // Constants for optimizing codegen for strict mode function and | 7456 // Constants for optimizing codegen for strict mode function and |
7450 // native tests. | 7457 // native tests. |
7451 // Allows to use byte-width instructions. | 7458 // Allows to use byte-width instructions. |
7452 static const int kStrictModeBitWithinByte = | 7459 static const int kStrictModeBitWithinByte = |
7453 (kStrictModeFunction + kCompilerHintsSmiTagSize) % kBitsPerByte; | 7460 (kStrictModeFunction + kCompilerHintsSmiTagSize) % kBitsPerByte; |
7454 | 7461 |
7455 static const int kNativeBitWithinByte = | 7462 static const int kNativeBitWithinByte = |
7456 (kNative + kCompilerHintsSmiTagSize) % kBitsPerByte; | 7463 (kNative + kCompilerHintsSmiTagSize) % kBitsPerByte; |
7457 | 7464 |
7458 #if __BYTE_ORDER == __LITTLE_ENDIAN | 7465 #if defined(V8_TARGET_LITTLE_ENDIAN) |
7459 static const int kStrictModeByteOffset = kCompilerHintsOffset + | 7466 static const int kStrictModeByteOffset = kCompilerHintsOffset + |
7460 (kStrictModeFunction + kCompilerHintsSmiTagSize) / kBitsPerByte; | 7467 (kStrictModeFunction + kCompilerHintsSmiTagSize) / kBitsPerByte; |
7461 static const int kNativeByteOffset = kCompilerHintsOffset + | 7468 static const int kNativeByteOffset = kCompilerHintsOffset + |
7462 (kNative + kCompilerHintsSmiTagSize) / kBitsPerByte; | 7469 (kNative + kCompilerHintsSmiTagSize) / kBitsPerByte; |
7463 #elif __BYTE_ORDER == __BIG_ENDIAN | 7470 #elif defined(V8_TARGET_BIG_ENDIAN) |
7464 static const int kStrictModeByteOffset = kCompilerHintsOffset + | 7471 static const int kStrictModeByteOffset = kCompilerHintsOffset + |
7465 (kCompilerHintsSize - 1) - | 7472 (kCompilerHintsSize - 1) - |
7466 ((kStrictModeFunction + kCompilerHintsSmiTagSize) / kBitsPerByte); | 7473 ((kStrictModeFunction + kCompilerHintsSmiTagSize) / kBitsPerByte); |
7467 static const int kNativeByteOffset = kCompilerHintsOffset + | 7474 static const int kNativeByteOffset = kCompilerHintsOffset + |
7468 (kCompilerHintsSize - 1) - | 7475 (kCompilerHintsSize - 1) - |
7469 ((kNative + kCompilerHintsSmiTagSize) / kBitsPerByte); | 7476 ((kNative + kCompilerHintsSmiTagSize) / kBitsPerByte); |
7470 #else | 7477 #else |
7471 #error Unknown byte ordering | 7478 #error Unknown byte ordering |
7472 #endif | 7479 #endif |
7473 | 7480 |
(...skipping 3548 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 |