| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 #ifndef V8_OBJECTS_H_ | 28 #ifndef V8_OBJECTS_H_ |
| 29 #define V8_OBJECTS_H_ | 29 #define V8_OBJECTS_H_ |
| 30 | 30 |
| 31 #include "builtins.h" | 31 #include "builtins.h" |
| 32 #include "code-stubs.h" | 32 #include "code-stubs.h" |
| 33 #include "smart-pointer.h" | 33 #include "smart-pointer.h" |
| 34 #include "unicode-inl.h" | 34 #include "unicode-inl.h" |
| 35 #if V8_TARGET_ARCH_ARM | 35 #if V8_TARGET_ARCH_ARM |
| 36 #include "arm/constants-arm.h" | 36 #include "arm/constants-arm.h" |
| 37 #elif V8_TARGET_ARCH_MIPS |
| 38 #include "mips/constants-mips.h" |
| 37 #endif | 39 #endif |
| 38 | 40 |
| 39 // | 41 // |
| 40 // All object types in the V8 JavaScript are described in this file. | 42 // All object types in the V8 JavaScript are described in this file. |
| 41 // | 43 // |
| 42 // Inheritance hierarchy: | 44 // Inheritance hierarchy: |
| 43 // - Object | 45 // - Object |
| 44 // - Smi (immediate small integer) | 46 // - Smi (immediate small integer) |
| 45 // - Failure (immediate for marking failed operation) | 47 // - Failure (immediate for marking failed operation) |
| 46 // - HeapObject (superclass for everything allocated in the heap) | 48 // - HeapObject (superclass for everything allocated in the heap) |
| (...skipping 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1320 | 1322 |
| 1321 // Dispatched behavior. | 1323 // Dispatched behavior. |
| 1322 Object* HeapNumberToBoolean(); | 1324 Object* HeapNumberToBoolean(); |
| 1323 void HeapNumberPrint(); | 1325 void HeapNumberPrint(); |
| 1324 void HeapNumberPrint(StringStream* accumulator); | 1326 void HeapNumberPrint(StringStream* accumulator); |
| 1325 #ifdef DEBUG | 1327 #ifdef DEBUG |
| 1326 void HeapNumberVerify(); | 1328 void HeapNumberVerify(); |
| 1327 #endif | 1329 #endif |
| 1328 | 1330 |
| 1329 // Layout description. | 1331 // Layout description. |
| 1332 //// TODO(MIPS.6) |
| 1333 //#ifdef V8_TARGET_ARCH_MIPS |
| 1334 // // MODIFIED: On MIPS we need doubles to be 8-bytes aligned. (local) Memory |
| 1335 // // allocation was modified to return 8-bytes aligned objects, so we also nee
d |
| 1336 // // a multiple of 8 offset here |
| 1337 // static const int kValueOffset = (HeapObject::kHeaderSize + 7) & ~7 ; |
| 1338 //#else |
| 1330 static const int kValueOffset = HeapObject::kHeaderSize; | 1339 static const int kValueOffset = HeapObject::kHeaderSize; |
| 1331 // IEEE doubles are two 32 bit words. The first is just mantissa, the second | 1340 //#endif |
| 1341 // IEEE doubles are two 32 bit words. The first is just mantissa, the second |
| 1332 // is a mixture of sign, exponent and mantissa. Our current platforms are all | 1342 // is a mixture of sign, exponent and mantissa. Our current platforms are all |
| 1333 // little endian apart from non-EABI arm which is little endian with big | 1343 // little endian apart from non-EABI arm which is little endian with big |
| 1334 // endian floating point word ordering! | 1344 // endian floating point word ordering! |
| 1335 #if !defined(V8_HOST_ARCH_ARM) || defined(USE_ARM_EABI) | 1345 #if !defined(V8_HOST_ARCH_ARM) || defined(USE_ARM_EABI) |
| 1336 static const int kMantissaOffset = kValueOffset; | 1346 static const int kMantissaOffset = kValueOffset; |
| 1337 static const int kExponentOffset = kValueOffset + 4; | 1347 static const int kExponentOffset = kValueOffset + 4; |
| 1338 #else | 1348 #else |
| 1339 static const int kMantissaOffset = kValueOffset + 4; | 1349 static const int kMantissaOffset = kValueOffset + 4; |
| 1340 static const int kExponentOffset = kValueOffset; | 1350 static const int kExponentOffset = kValueOffset; |
| 1341 # define BIG_ENDIAN_FLOATING_POINT 1 | 1351 # define BIG_ENDIAN_FLOATING_POINT 1 |
| 1342 #endif | 1352 #endif |
| 1353 |
| 1354 //// TODO(MIPS.6) |
| 1355 //#ifdef V8_TARGET_ARCH_MIPS |
| 1356 //// static const int kSize = kValueOffset + kDoubleSize; |
| 1357 // // Fix for double alignement on MIPS |
| 1358 // static const int kSize = (kValueOffset + kDoubleSize + 7) & ~7; |
| 1359 //#else |
| 1343 static const int kSize = kValueOffset + kDoubleSize; | 1360 static const int kSize = kValueOffset + kDoubleSize; |
| 1361 //#endif |
| 1344 | 1362 |
| 1345 static const uint32_t kSignMask = 0x80000000u; | 1363 static const uint32_t kSignMask = 0x80000000u; |
| 1346 static const uint32_t kExponentMask = 0x7ff00000u; | 1364 static const uint32_t kExponentMask = 0x7ff00000u; |
| 1347 static const uint32_t kMantissaMask = 0xfffffu; | 1365 static const uint32_t kMantissaMask = 0xfffffu; |
| 1348 static const int kExponentBias = 1023; | 1366 static const int kExponentBias = 1023; |
| 1349 static const int kExponentShift = 20; | 1367 static const int kExponentShift = 20; |
| 1350 static const int kMantissaBitsInTopWord = 20; | 1368 static const int kMantissaBitsInTopWord = 20; |
| 1351 static const int kNonMantissaBitsInTopWord = 12; | 1369 static const int kNonMantissaBitsInTopWord = 12; |
| 1352 | 1370 |
| 1353 private: | 1371 private: |
| (...skipping 3797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5151 } else { | 5169 } else { |
| 5152 value &= ~(1 << bit_position); | 5170 value &= ~(1 << bit_position); |
| 5153 } | 5171 } |
| 5154 return value; | 5172 return value; |
| 5155 } | 5173 } |
| 5156 }; | 5174 }; |
| 5157 | 5175 |
| 5158 } } // namespace v8::internal | 5176 } } // namespace v8::internal |
| 5159 | 5177 |
| 5160 #endif // V8_OBJECTS_H_ | 5178 #endif // V8_OBJECTS_H_ |
| OLD | NEW |