Chromium Code Reviews| Index: src/objects.h |
| diff --git a/src/objects.h b/src/objects.h |
| index 559ada63f41922bdb30efb209884a6b9a1280be3..d7acded2a253acdbc406473829b010e0b252fd7e 100644 |
| --- a/src/objects.h |
| +++ b/src/objects.h |
| @@ -4370,7 +4370,6 @@ class SharedFunctionInfo: public HeapObject { |
| kThisPropertyAssignmentsOffset + kPointerSize, |
| kSize> BodyDescriptor; |
| - private: |
| // Bit positions in start_position_and_type. |
| // The source code start position is in the 30 most significant bits of |
| // the start_position_and_type field. |
| @@ -4389,6 +4388,35 @@ class SharedFunctionInfo: public HeapObject { |
| static const int kOptimizationDisabled = 7; |
| static const int kStrictModeFunction = 8; |
| +private: |
|
Martin Maly
2011/02/15 19:18:43
Turns out similar trick for byte-wide operations i
|
| +#if V8_HOST_ARCH_32_BIT |
| + // On 32 bit platforms, compiler hints is a smi. |
| + static const int kCompilerHintsSmiTagSize = kSmiTagSize; |
| + static const int kCompilerHintsSize = kPointerSize; |
| +#else |
| + // On 64 bit platforms, compiler hints is not a smi, see comment above. |
| + static const int kCompilerHintsSmiTagSize = 0; |
| + static const int kCompilerHintsSize = kIntSize; |
| +#endif |
| + |
| +public: |
| + // Constants for optimizing codegen for strict mode function tests. |
| + // Allows to use byte-widgh instructions. |
| + static const int kStrictModeBitWithinByte = |
| + (kStrictModeFunction + kCompilerHintsSmiTagSize) % kBitsPerByte; |
| + |
| +#if __BYTE_ORDER == __LITTLE_ENDIAN |
| + static const int kStrictModeByteOffset = kCompilerHintsOffset + |
| + (kStrictModeFunction + kCompilerHintsSmiTagSize) / kBitsPerByte; |
| +#elif __BYTE_ORDER == __BIG_ENDIAN |
| + static const int kStrictModeByteOffset = kCompilerHintsOffset + |
| + (kCompilerHintsSize - 1) - |
| + ((kStrictModeFunction + kCompilerHintsSmiTagSize) / kBitsPerByte); |
| +#else |
| +#error Unknown byte ordering |
| +#endif |
| + |
| +private: |
| DISALLOW_IMPLICIT_CONSTRUCTORS(SharedFunctionInfo); |
| }; |