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 7349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7360 // Inline cache age is used to infer whether the function survived a context | 7360 // Inline cache age is used to infer whether the function survived a context |
7361 // disposal or not. In the former case we reset the opt_count. | 7361 // disposal or not. In the former case we reset the opt_count. |
7362 inline int ic_age(); | 7362 inline int ic_age(); |
7363 inline void set_ic_age(int age); | 7363 inline void set_ic_age(int age); |
7364 | 7364 |
7365 // Indicates if this function can be lazy compiled. | 7365 // Indicates if this function can be lazy compiled. |
7366 // This is used to determine if we can safely flush code from a function | 7366 // This is used to determine if we can safely flush code from a function |
7367 // when doing GC if we expect that the function will no longer be used. | 7367 // when doing GC if we expect that the function will no longer be used. |
7368 DECL_BOOLEAN_ACCESSORS(allows_lazy_compilation) | 7368 DECL_BOOLEAN_ACCESSORS(allows_lazy_compilation) |
7369 | 7369 |
7370 // Indicates if this function can be lazy compiled without a context. | |
7371 // This is used to determine if we can force compilation without reaching | |
7372 // the function through program execution but through other means (e.g. heap | |
7373 // iteration by the debugger). | |
7374 DECL_BOOLEAN_ACCESSORS(allows_lazy_compilation_without_context) | |
7375 | |
7376 // Indicates whether optimizations have been disabled for this | 7370 // Indicates whether optimizations have been disabled for this |
7377 // shared function info. If a function is repeatedly optimized or if | 7371 // shared function info. If a function is repeatedly optimized or if |
7378 // we cannot optimize the function we disable optimization to avoid | 7372 // we cannot optimize the function we disable optimization to avoid |
7379 // spending time attempting to optimize it again. | 7373 // spending time attempting to optimize it again. |
7380 DECL_BOOLEAN_ACCESSORS(optimization_disabled) | 7374 DECL_BOOLEAN_ACCESSORS(optimization_disabled) |
7381 | 7375 |
7382 // Indicates the language mode. | 7376 // Indicates the language mode. |
7383 inline LanguageMode language_mode(); | 7377 inline LanguageMode language_mode(); |
7384 inline void set_language_mode(LanguageMode language_mode); | 7378 inline void set_language_mode(LanguageMode language_mode); |
7385 | 7379 |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7683 // the start_position_and_type field. | 7677 // the start_position_and_type field. |
7684 static const int kIsNamedExpressionBit = 0; | 7678 static const int kIsNamedExpressionBit = 0; |
7685 static const int kIsTopLevelBit = 1; | 7679 static const int kIsTopLevelBit = 1; |
7686 static const int kStartPositionShift = 2; | 7680 static const int kStartPositionShift = 2; |
7687 static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1); | 7681 static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1); |
7688 | 7682 |
7689 // Bit positions in compiler_hints. | 7683 // Bit positions in compiler_hints. |
7690 enum CompilerHints { | 7684 enum CompilerHints { |
7691 // byte 0 | 7685 // byte 0 |
7692 kAllowLazyCompilation, | 7686 kAllowLazyCompilation, |
7693 kAllowLazyCompilationWithoutContext, | 7687 kIsDeclaration, |
7694 kOptimizationDisabled, | 7688 kOptimizationDisabled, |
7695 kNeverCompiled, | 7689 kNeverCompiled, |
7696 kNative, | 7690 kNative, |
7697 kStrictModeFunction, | 7691 kStrictModeFunction, |
7698 kUsesArguments, | 7692 kUsesArguments, |
7699 kNeedsHomeObject, | 7693 kNeedsHomeObject, |
7700 // byte 1 | 7694 // byte 1 |
7701 kHasDuplicateParameters, | 7695 kHasDuplicateParameters, |
7702 kForceInline, | 7696 kForceInline, |
7703 kIsAsmFunction, | 7697 kIsAsmFunction, |
7704 kIsAnonymousExpression, | 7698 kIsAnonymousExpression, |
7705 kNameShouldPrintAsAnonymous, | 7699 kNameShouldPrintAsAnonymous, |
7706 kIsFunction, | 7700 kIsFunction, |
7707 kDontCrankshaft, | 7701 kDontCrankshaft, |
7708 kDontFlush, | 7702 kDontFlush, |
7709 // byte 2 | 7703 // byte 2 |
7710 kFunctionKind, | 7704 kFunctionKind, |
7711 // rest of byte 2 and first two bits of byte 3 are used by FunctionKind | 7705 // rest of byte 2 and first two bits of byte 3 are used by FunctionKind |
7712 // byte 3 | 7706 // byte 3 |
7713 kDeserialized = kFunctionKind + 10, | 7707 kDeserialized = kFunctionKind + 10, |
7714 kIsDeclaration, | |
7715 kIsAsmWasmBroken, | 7708 kIsAsmWasmBroken, |
7716 kRequiresClassFieldInit, | 7709 kRequiresClassFieldInit, |
7717 kIsClassFieldInitializer, | 7710 kIsClassFieldInitializer, |
7718 kCompilerHintsCount, // Pseudo entry | 7711 kCompilerHintsCount, // Pseudo entry |
7719 }; | 7712 }; |
7720 // kFunctionKind has to be byte-aligned | 7713 // kFunctionKind has to be byte-aligned |
7721 STATIC_ASSERT((kFunctionKind % kBitsPerByte) == 0); | 7714 STATIC_ASSERT((kFunctionKind % kBitsPerByte) == 0); |
7722 | 7715 |
7723 class FunctionKindBits : public BitField<FunctionKind, kFunctionKind, 10> {}; | 7716 class FunctionKindBits : public BitField<FunctionKind, kFunctionKind, 10> {}; |
7724 | 7717 |
(...skipping 3681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11406 } | 11399 } |
11407 return value; | 11400 return value; |
11408 } | 11401 } |
11409 }; | 11402 }; |
11410 | 11403 |
11411 | 11404 |
11412 } // NOLINT, false-positive due to second-order macros. | 11405 } // NOLINT, false-positive due to second-order macros. |
11413 } // NOLINT, false-positive due to second-order macros. | 11406 } // NOLINT, false-positive due to second-order macros. |
11414 | 11407 |
11415 #endif // V8_OBJECTS_H_ | 11408 #endif // V8_OBJECTS_H_ |
OLD | NEW |