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 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 7651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7662 // Indicates that the the shared function info is deserialized from cache. | 7662 // Indicates that the the shared function info is deserialized from cache. |
7663 DECL_BOOLEAN_ACCESSORS(deserialized) | 7663 DECL_BOOLEAN_ACCESSORS(deserialized) |
7664 | 7664 |
7665 // Indicates that the the shared function info has never been compiled before. | 7665 // Indicates that the the shared function info has never been compiled before. |
7666 DECL_BOOLEAN_ACCESSORS(never_compiled) | 7666 DECL_BOOLEAN_ACCESSORS(never_compiled) |
7667 | 7667 |
7668 // Whether this function was created from a FunctionDeclaration. | 7668 // Whether this function was created from a FunctionDeclaration. |
7669 DECL_BOOLEAN_ACCESSORS(is_declaration) | 7669 DECL_BOOLEAN_ACCESSORS(is_declaration) |
7670 | 7670 |
7671 // Whether this function was marked to be optimized. | 7671 // Whether this function was marked to be optimized. |
7672 DECL_BOOLEAN_ACCESSORS(was_marked_for_optimization) | 7672 DECL_BOOLEAN_ACCESSORS(was_marked_for_tier_up) |
rmcilroy
2016/10/26 15:07:59
nit - marked_for_tier_up (drop the "was_")
Leszek Swirski
2016/10/27 09:40:20
Done. I'm not sure about the "marked_for_" either,
| |
7673 | 7673 |
7674 // Indicates that asm->wasm conversion failed and should not be re-attempted. | 7674 // Indicates that asm->wasm conversion failed and should not be re-attempted. |
7675 DECL_BOOLEAN_ACCESSORS(is_asm_wasm_broken) | 7675 DECL_BOOLEAN_ACCESSORS(is_asm_wasm_broken) |
7676 | 7676 |
7677 inline FunctionKind kind() const; | 7677 inline FunctionKind kind() const; |
7678 inline void set_kind(FunctionKind kind); | 7678 inline void set_kind(FunctionKind kind); |
7679 | 7679 |
7680 // Indicates whether or not the code in the shared function support | 7680 // Indicates whether or not the code in the shared function support |
7681 // deoptimization. | 7681 // deoptimization. |
7682 inline bool has_deoptimization_support(); | 7682 inline bool has_deoptimization_support(); |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7913 // the start_position_and_type field. | 7913 // the start_position_and_type field. |
7914 static const int kIsNamedExpressionBit = 0; | 7914 static const int kIsNamedExpressionBit = 0; |
7915 static const int kIsTopLevelBit = 1; | 7915 static const int kIsTopLevelBit = 1; |
7916 static const int kStartPositionShift = 2; | 7916 static const int kStartPositionShift = 2; |
7917 static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1); | 7917 static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1); |
7918 | 7918 |
7919 // Bit positions in compiler_hints. | 7919 // Bit positions in compiler_hints. |
7920 enum CompilerHints { | 7920 enum CompilerHints { |
7921 // byte 0 | 7921 // byte 0 |
7922 kAllowLazyCompilation, | 7922 kAllowLazyCompilation, |
7923 kWasMarkedForOptimization, | 7923 kWasMarkedForTierUp, |
rmcilroy
2016/10/26 15:07:59
ditto and below
Leszek Swirski
2016/10/27 09:40:20
Done.
| |
7924 kOptimizationDisabled, | 7924 kOptimizationDisabled, |
7925 kNeverCompiled, | 7925 kNeverCompiled, |
7926 kNative, | 7926 kNative, |
7927 kStrictModeFunction, | 7927 kStrictModeFunction, |
7928 kUsesArguments, | 7928 kUsesArguments, |
7929 kNeedsHomeObject, | 7929 kNeedsHomeObject, |
7930 // byte 1 | 7930 // byte 1 |
7931 kHasDuplicateParameters, | 7931 kHasDuplicateParameters, |
7932 kForceInline, | 7932 kForceInline, |
7933 kIsAsmFunction, | 7933 kIsAsmFunction, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7981 kStrictModeFunction + kCompilerHintsSmiTagSize; | 7981 kStrictModeFunction + kCompilerHintsSmiTagSize; |
7982 static const int kNativeBit = kNative + kCompilerHintsSmiTagSize; | 7982 static const int kNativeBit = kNative + kCompilerHintsSmiTagSize; |
7983 static const int kHasDuplicateParametersBit = | 7983 static const int kHasDuplicateParametersBit = |
7984 kHasDuplicateParameters + kCompilerHintsSmiTagSize; | 7984 kHasDuplicateParameters + kCompilerHintsSmiTagSize; |
7985 | 7985 |
7986 static const int kFunctionKindShift = | 7986 static const int kFunctionKindShift = |
7987 kFunctionKind + kCompilerHintsSmiTagSize; | 7987 kFunctionKind + kCompilerHintsSmiTagSize; |
7988 static const int kAllFunctionKindBitsMask = FunctionKindBits::kMask | 7988 static const int kAllFunctionKindBitsMask = FunctionKindBits::kMask |
7989 << kCompilerHintsSmiTagSize; | 7989 << kCompilerHintsSmiTagSize; |
7990 | 7990 |
7991 static const int kWasMarkedForOptimizationBit = | 7991 static const int kWasMarkedForTierUpBit = |
7992 kWasMarkedForOptimization + kCompilerHintsSmiTagSize; | 7992 kWasMarkedForTierUp + kCompilerHintsSmiTagSize; |
7993 | 7993 |
7994 // Constants for optimizing codegen for strict mode function and | 7994 // Constants for optimizing codegen for strict mode function and |
7995 // native tests. | 7995 // native tests. |
7996 // Allows to use byte-width instructions. | 7996 // Allows to use byte-width instructions. |
7997 static const int kStrictModeBitWithinByte = kStrictModeBit % kBitsPerByte; | 7997 static const int kStrictModeBitWithinByte = kStrictModeBit % kBitsPerByte; |
7998 static const int kNativeBitWithinByte = kNativeBit % kBitsPerByte; | 7998 static const int kNativeBitWithinByte = kNativeBit % kBitsPerByte; |
7999 static const int kHasDuplicateParametersBitWithinByte = | 7999 static const int kHasDuplicateParametersBitWithinByte = |
8000 kHasDuplicateParametersBit % kBitsPerByte; | 8000 kHasDuplicateParametersBit % kBitsPerByte; |
8001 | 8001 |
8002 static const int kClassConstructorBitsWithinByte = | 8002 static const int kClassConstructorBitsWithinByte = |
8003 FunctionKind::kClassConstructor << kCompilerHintsSmiTagSize; | 8003 FunctionKind::kClassConstructor << kCompilerHintsSmiTagSize; |
8004 STATIC_ASSERT(kClassConstructorBitsWithinByte < (1 << kBitsPerByte)); | 8004 STATIC_ASSERT(kClassConstructorBitsWithinByte < (1 << kBitsPerByte)); |
8005 | 8005 |
8006 static const int kWasMarkedForOptimizationBitWithinByte = | 8006 static const int kWasMarkedForTierUpBitWithinByte = |
8007 kWasMarkedForOptimizationBit % kBitsPerByte; | 8007 kWasMarkedForTierUpBit % kBitsPerByte; |
8008 | 8008 |
8009 #if defined(V8_TARGET_LITTLE_ENDIAN) | 8009 #if defined(V8_TARGET_LITTLE_ENDIAN) |
8010 #define BYTE_OFFSET(compiler_hint) \ | 8010 #define BYTE_OFFSET(compiler_hint) \ |
8011 kCompilerHintsOffset + \ | 8011 kCompilerHintsOffset + \ |
8012 (compiler_hint + kCompilerHintsSmiTagSize) / kBitsPerByte | 8012 (compiler_hint + kCompilerHintsSmiTagSize) / kBitsPerByte |
8013 #elif defined(V8_TARGET_BIG_ENDIAN) | 8013 #elif defined(V8_TARGET_BIG_ENDIAN) |
8014 #define BYTE_OFFSET(compiler_hint) \ | 8014 #define BYTE_OFFSET(compiler_hint) \ |
8015 kCompilerHintsOffset + (kCompilerHintsSize - 1) - \ | 8015 kCompilerHintsOffset + (kCompilerHintsSize - 1) - \ |
8016 ((compiler_hint + kCompilerHintsSmiTagSize) / kBitsPerByte) | 8016 ((compiler_hint + kCompilerHintsSmiTagSize) / kBitsPerByte) |
8017 #else | 8017 #else |
8018 #error Unknown byte ordering | 8018 #error Unknown byte ordering |
8019 #endif | 8019 #endif |
8020 static const int kStrictModeByteOffset = BYTE_OFFSET(kStrictModeFunction); | 8020 static const int kStrictModeByteOffset = BYTE_OFFSET(kStrictModeFunction); |
8021 static const int kNativeByteOffset = BYTE_OFFSET(kNative); | 8021 static const int kNativeByteOffset = BYTE_OFFSET(kNative); |
8022 static const int kFunctionKindByteOffset = BYTE_OFFSET(kFunctionKind); | 8022 static const int kFunctionKindByteOffset = BYTE_OFFSET(kFunctionKind); |
8023 static const int kHasDuplicateParametersByteOffset = | 8023 static const int kHasDuplicateParametersByteOffset = |
8024 BYTE_OFFSET(kHasDuplicateParameters); | 8024 BYTE_OFFSET(kHasDuplicateParameters); |
8025 static const int kWasMarkedForOptimizationByteOffset = | 8025 static const int kWasMarkedForTierUpByteOffset = |
8026 BYTE_OFFSET(kWasMarkedForOptimization); | 8026 BYTE_OFFSET(kWasMarkedForTierUp); |
8027 #undef BYTE_OFFSET | 8027 #undef BYTE_OFFSET |
8028 | 8028 |
8029 private: | 8029 private: |
8030 // Returns entry from optimized code map for specified context and OSR entry. | 8030 // Returns entry from optimized code map for specified context and OSR entry. |
8031 // The result is either kNotFound, or a start index of the context-dependent | 8031 // The result is either kNotFound, or a start index of the context-dependent |
8032 // entry. | 8032 // entry. |
8033 int SearchOptimizedCodeMapEntry(Context* native_context, | 8033 int SearchOptimizedCodeMapEntry(Context* native_context, |
8034 BailoutId osr_ast_id); | 8034 BailoutId osr_ast_id); |
8035 | 8035 |
8036 DISALLOW_IMPLICIT_CONSTRUCTORS(SharedFunctionInfo); | 8036 DISALLOW_IMPLICIT_CONSTRUCTORS(SharedFunctionInfo); |
(...skipping 3719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
11756 } | 11756 } |
11757 return value; | 11757 return value; |
11758 } | 11758 } |
11759 }; | 11759 }; |
11760 | 11760 |
11761 | 11761 |
11762 } // NOLINT, false-positive due to second-order macros. | 11762 } // NOLINT, false-positive due to second-order macros. |
11763 } // NOLINT, false-positive due to second-order macros. | 11763 } // NOLINT, false-positive due to second-order macros. |
11764 | 11764 |
11765 #endif // V8_OBJECTS_H_ | 11765 #endif // V8_OBJECTS_H_ |
OLD | NEW |