| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
| 6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
| 7 | 7 |
| 8 #include <iosfwd> | 8 #include <iosfwd> |
| 9 | 9 |
| 10 #include "src/assert-scope.h" | 10 #include "src/assert-scope.h" |
| (...skipping 7256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7267 | 7267 |
| 7268 STATIC_ASSERT(SharedFunctionInfo::kCompilerHintsCount <= | 7268 STATIC_ASSERT(SharedFunctionInfo::kCompilerHintsCount <= |
| 7269 SharedFunctionInfo::kCompilerHintsSize * kBitsPerByte); | 7269 SharedFunctionInfo::kCompilerHintsSize * kBitsPerByte); |
| 7270 | 7270 |
| 7271 public: | 7271 public: |
| 7272 // Constants for optimizing codegen for strict mode function and | 7272 // Constants for optimizing codegen for strict mode function and |
| 7273 // native tests when using integer-width instructions. | 7273 // native tests when using integer-width instructions. |
| 7274 static const int kStrictModeBit = | 7274 static const int kStrictModeBit = |
| 7275 kStrictModeFunction + kCompilerHintsSmiTagSize; | 7275 kStrictModeFunction + kCompilerHintsSmiTagSize; |
| 7276 static const int kNativeBit = kNative + kCompilerHintsSmiTagSize; | 7276 static const int kNativeBit = kNative + kCompilerHintsSmiTagSize; |
| 7277 static const int kHasDuplicateParametersBit = |
| 7278 kHasDuplicateParameters + kCompilerHintsSmiTagSize; |
| 7277 | 7279 |
| 7278 static const int kClassConstructorBits = | 7280 static const int kClassConstructorBits = |
| 7279 FunctionKind::kClassConstructor | 7281 FunctionKind::kClassConstructor |
| 7280 << (kFunctionKind + kCompilerHintsSmiTagSize); | 7282 << (kFunctionKind + kCompilerHintsSmiTagSize); |
| 7281 | 7283 |
| 7282 // Constants for optimizing codegen for strict mode function and | 7284 // Constants for optimizing codegen for strict mode function and |
| 7283 // native tests. | 7285 // native tests. |
| 7284 // Allows to use byte-width instructions. | 7286 // Allows to use byte-width instructions. |
| 7285 static const int kStrictModeBitWithinByte = kStrictModeBit % kBitsPerByte; | 7287 static const int kStrictModeBitWithinByte = kStrictModeBit % kBitsPerByte; |
| 7286 static const int kNativeBitWithinByte = kNativeBit % kBitsPerByte; | 7288 static const int kNativeBitWithinByte = kNativeBit % kBitsPerByte; |
| 7289 static const int kHasDuplicateParametersBitWithinByte = |
| 7290 kHasDuplicateParametersBit % kBitsPerByte; |
| 7287 | 7291 |
| 7288 static const int kClassConstructorBitsWithinByte = | 7292 static const int kClassConstructorBitsWithinByte = |
| 7289 FunctionKind::kClassConstructor << kCompilerHintsSmiTagSize; | 7293 FunctionKind::kClassConstructor << kCompilerHintsSmiTagSize; |
| 7290 STATIC_ASSERT(kClassConstructorBitsWithinByte < (1 << kBitsPerByte)); | 7294 STATIC_ASSERT(kClassConstructorBitsWithinByte < (1 << kBitsPerByte)); |
| 7291 | 7295 |
| 7292 #if defined(V8_TARGET_LITTLE_ENDIAN) | 7296 #if defined(V8_TARGET_LITTLE_ENDIAN) |
| 7293 #define BYTE_OFFSET(compiler_hint) \ | 7297 #define BYTE_OFFSET(compiler_hint) \ |
| 7294 kCompilerHintsOffset + \ | 7298 kCompilerHintsOffset + \ |
| 7295 (compiler_hint + kCompilerHintsSmiTagSize) / kBitsPerByte | 7299 (compiler_hint + kCompilerHintsSmiTagSize) / kBitsPerByte |
| 7296 #elif defined(V8_TARGET_BIG_ENDIAN) | 7300 #elif defined(V8_TARGET_BIG_ENDIAN) |
| 7297 #define BYTE_OFFSET(compiler_hint) \ | 7301 #define BYTE_OFFSET(compiler_hint) \ |
| 7298 kCompilerHintsOffset + (kCompilerHintsSize - 1) - \ | 7302 kCompilerHintsOffset + (kCompilerHintsSize - 1) - \ |
| 7299 ((compiler_hint + kCompilerHintsSmiTagSize) / kBitsPerByte) | 7303 ((compiler_hint + kCompilerHintsSmiTagSize) / kBitsPerByte) |
| 7300 #else | 7304 #else |
| 7301 #error Unknown byte ordering | 7305 #error Unknown byte ordering |
| 7302 #endif | 7306 #endif |
| 7303 static const int kStrictModeByteOffset = BYTE_OFFSET(kStrictModeFunction); | 7307 static const int kStrictModeByteOffset = BYTE_OFFSET(kStrictModeFunction); |
| 7304 static const int kNativeByteOffset = BYTE_OFFSET(kNative); | 7308 static const int kNativeByteOffset = BYTE_OFFSET(kNative); |
| 7305 static const int kFunctionKindByteOffset = BYTE_OFFSET(kFunctionKind); | 7309 static const int kFunctionKindByteOffset = BYTE_OFFSET(kFunctionKind); |
| 7310 static const int kHasDuplicateParametersByteOffset = |
| 7311 BYTE_OFFSET(kHasDuplicateParameters); |
| 7306 #undef BYTE_OFFSET | 7312 #undef BYTE_OFFSET |
| 7307 | 7313 |
| 7308 private: | 7314 private: |
| 7309 // Returns entry from optimized code map for specified context and OSR entry. | 7315 // Returns entry from optimized code map for specified context and OSR entry. |
| 7310 // The result is either kNotFound, kSharedCodeIndex for context-independent | 7316 // The result is either kNotFound, kSharedCodeIndex for context-independent |
| 7311 // entry or a start index of the context-dependent entry. | 7317 // entry or a start index of the context-dependent entry. |
| 7312 int SearchOptimizedCodeMapEntry(Context* native_context, | 7318 int SearchOptimizedCodeMapEntry(Context* native_context, |
| 7313 BailoutId osr_ast_id); | 7319 BailoutId osr_ast_id); |
| 7314 | 7320 |
| 7315 DISALLOW_IMPLICIT_CONSTRUCTORS(SharedFunctionInfo); | 7321 DISALLOW_IMPLICIT_CONSTRUCTORS(SharedFunctionInfo); |
| (...skipping 3481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10797 } | 10803 } |
| 10798 return value; | 10804 return value; |
| 10799 } | 10805 } |
| 10800 }; | 10806 }; |
| 10801 | 10807 |
| 10802 | 10808 |
| 10803 } // NOLINT, false-positive due to second-order macros. | 10809 } // NOLINT, false-positive due to second-order macros. |
| 10804 } // NOLINT, false-positive due to second-order macros. | 10810 } // NOLINT, false-positive due to second-order macros. |
| 10805 | 10811 |
| 10806 #endif // V8_OBJECTS_H_ | 10812 #endif // V8_OBJECTS_H_ |
| OLD | NEW |