| 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 7065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7076 // function from which eval was called. | 7076 // function from which eval was called. |
| 7077 DECL_ACCESSORS(eval_from_shared, Object) | 7077 DECL_ACCESSORS(eval_from_shared, Object) |
| 7078 | 7078 |
| 7079 // [eval_from_position]: the source position in the code for the function | 7079 // [eval_from_position]: the source position in the code for the function |
| 7080 // from which eval was called, as positive integer. Or the code offset in the | 7080 // from which eval was called, as positive integer. Or the code offset in the |
| 7081 // code from which eval was called, as negative integer. | 7081 // code from which eval was called, as negative integer. |
| 7082 DECL_INT_ACCESSORS(eval_from_position) | 7082 DECL_INT_ACCESSORS(eval_from_position) |
| 7083 | 7083 |
| 7084 // [shared_function_infos]: weak fixed array containing all shared | 7084 // [shared_function_infos]: weak fixed array containing all shared |
| 7085 // function infos created from this script. | 7085 // function infos created from this script. |
| 7086 DECL_ACCESSORS(shared_function_infos, Object) | 7086 DECL_ACCESSORS(shared_function_infos, FixedArray) |
| 7087 | 7087 |
| 7088 // [flags]: Holds an exciting bitfield. | 7088 // [flags]: Holds an exciting bitfield. |
| 7089 DECL_INT_ACCESSORS(flags) | 7089 DECL_INT_ACCESSORS(flags) |
| 7090 | 7090 |
| 7091 // [source_url]: sourceURL from magic comment | 7091 // [source_url]: sourceURL from magic comment |
| 7092 DECL_ACCESSORS(source_url, Object) | 7092 DECL_ACCESSORS(source_url, Object) |
| 7093 | 7093 |
| 7094 // [source_mapping_url]: sourceMappingURL magic comment | 7094 // [source_mapping_url]: sourceMappingURL magic comment |
| 7095 DECL_ACCESSORS(source_mapping_url, Object) | 7095 DECL_ACCESSORS(source_mapping_url, Object) |
| 7096 | 7096 |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7695 // Indicates that this is a synthesized function to set up class instance | 7695 // Indicates that this is a synthesized function to set up class instance |
| 7696 // fields. | 7696 // fields. |
| 7697 DECL_BOOLEAN_ACCESSORS(is_class_field_initializer) | 7697 DECL_BOOLEAN_ACCESSORS(is_class_field_initializer) |
| 7698 | 7698 |
| 7699 // Indicates that this function is an asm function. | 7699 // Indicates that this function is an asm function. |
| 7700 DECL_BOOLEAN_ACCESSORS(asm_function) | 7700 DECL_BOOLEAN_ACCESSORS(asm_function) |
| 7701 | 7701 |
| 7702 // Indicates that the the shared function info is deserialized from cache. | 7702 // Indicates that the the shared function info is deserialized from cache. |
| 7703 DECL_BOOLEAN_ACCESSORS(deserialized) | 7703 DECL_BOOLEAN_ACCESSORS(deserialized) |
| 7704 | 7704 |
| 7705 // Indicates that the the shared function info has never been compiled before. | |
| 7706 DECL_BOOLEAN_ACCESSORS(never_compiled) | |
| 7707 | |
| 7708 // Whether this function was created from a FunctionDeclaration. | 7705 // Whether this function was created from a FunctionDeclaration. |
| 7709 DECL_BOOLEAN_ACCESSORS(is_declaration) | 7706 DECL_BOOLEAN_ACCESSORS(is_declaration) |
| 7710 | 7707 |
| 7711 // Whether this function was marked to be tiered up. | 7708 // Whether this function was marked to be tiered up. |
| 7712 DECL_BOOLEAN_ACCESSORS(marked_for_tier_up) | 7709 DECL_BOOLEAN_ACCESSORS(marked_for_tier_up) |
| 7713 | 7710 |
| 7714 // Indicates that asm->wasm conversion failed and should not be re-attempted. | 7711 // Indicates that asm->wasm conversion failed and should not be re-attempted. |
| 7715 DECL_BOOLEAN_ACCESSORS(is_asm_wasm_broken) | 7712 DECL_BOOLEAN_ACCESSORS(is_asm_wasm_broken) |
| 7716 | 7713 |
| 7717 inline FunctionKind kind() const; | 7714 inline FunctionKind kind() const; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7792 | 7789 |
| 7793 void ResetForNewContext(int new_ic_age); | 7790 void ResetForNewContext(int new_ic_age); |
| 7794 | 7791 |
| 7795 // Iterate over all shared function infos. | 7792 // Iterate over all shared function infos. |
| 7796 class Iterator { | 7793 class Iterator { |
| 7797 public: | 7794 public: |
| 7798 explicit Iterator(Isolate* isolate); | 7795 explicit Iterator(Isolate* isolate); |
| 7799 SharedFunctionInfo* Next(); | 7796 SharedFunctionInfo* Next(); |
| 7800 | 7797 |
| 7801 private: | 7798 private: |
| 7802 bool NextScript(); | 7799 void NextScript(); |
| 7803 | 7800 |
| 7804 Script::Iterator script_iterator_; | 7801 Script::Iterator script_iterator_; |
| 7805 WeakFixedArray::Iterator sfi_iterator_; | 7802 WeakFixedArray::Iterator sfi_iterator_; |
| 7803 Script* current_script_; |
| 7804 int index_; |
| 7806 DisallowHeapAllocation no_gc_; | 7805 DisallowHeapAllocation no_gc_; |
| 7807 DISALLOW_COPY_AND_ASSIGN(Iterator); | 7806 DISALLOW_COPY_AND_ASSIGN(Iterator); |
| 7808 }; | 7807 }; |
| 7809 | 7808 |
| 7810 DECLARE_CAST(SharedFunctionInfo) | 7809 DECLARE_CAST(SharedFunctionInfo) |
| 7811 | 7810 |
| 7812 // Constants. | 7811 // Constants. |
| 7813 static const int kDontAdaptArgumentsSentinel = -1; | 7812 static const int kDontAdaptArgumentsSentinel = -1; |
| 7814 | 7813 |
| 7815 // Layout description. | 7814 // Layout description. |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7957 static const int kIsTopLevelBit = 1; | 7956 static const int kIsTopLevelBit = 1; |
| 7958 static const int kStartPositionShift = 2; | 7957 static const int kStartPositionShift = 2; |
| 7959 static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1); | 7958 static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1); |
| 7960 | 7959 |
| 7961 // Bit positions in compiler_hints. | 7960 // Bit positions in compiler_hints. |
| 7962 enum CompilerHints { | 7961 enum CompilerHints { |
| 7963 // byte 0 | 7962 // byte 0 |
| 7964 kAllowLazyCompilation, | 7963 kAllowLazyCompilation, |
| 7965 kMarkedForTierUp, | 7964 kMarkedForTierUp, |
| 7966 kOptimizationDisabled, | 7965 kOptimizationDisabled, |
| 7967 kNeverCompiled, | 7966 kIsClassFieldInitializer, |
| 7968 kNative, | 7967 kNative, |
| 7969 kStrictModeFunction, | 7968 kStrictModeFunction, |
| 7970 kUsesArguments, | 7969 kUsesArguments, |
| 7971 kNeedsHomeObject, | 7970 kNeedsHomeObject, |
| 7972 // byte 1 | 7971 // byte 1 |
| 7973 kHasDuplicateParameters, | 7972 kHasDuplicateParameters, |
| 7974 kForceInline, | 7973 kForceInline, |
| 7975 kIsAsmFunction, | 7974 kIsAsmFunction, |
| 7976 kIsAnonymousExpression, | 7975 kIsAnonymousExpression, |
| 7977 kNameShouldPrintAsAnonymous, | 7976 kNameShouldPrintAsAnonymous, |
| 7978 kIsFunction, | 7977 kIsFunction, |
| 7979 kMustUseIgnitionTurbo, | 7978 kMustUseIgnitionTurbo, |
| 7980 kDontFlush, | 7979 kDontFlush, |
| 7981 // byte 2 | 7980 // byte 2 |
| 7982 kFunctionKind, | 7981 kFunctionKind, |
| 7983 // rest of byte 2 and first two bits of byte 3 are used by FunctionKind | 7982 // rest of byte 2 and first two bits of byte 3 are used by FunctionKind |
| 7984 // byte 3 | 7983 // byte 3 |
| 7985 kDeserialized = kFunctionKind + 10, | 7984 kDeserialized = kFunctionKind + 10, |
| 7986 kIsDeclaration, | 7985 kIsDeclaration, |
| 7987 kIsAsmWasmBroken, | 7986 kIsAsmWasmBroken, |
| 7988 kRequiresClassFieldInit, | 7987 kRequiresClassFieldInit, |
| 7989 kIsClassFieldInitializer, | |
| 7990 kCompilerHintsCount, // Pseudo entry | 7988 kCompilerHintsCount, // Pseudo entry |
| 7991 }; | 7989 }; |
| 7992 // kFunctionKind has to be byte-aligned | 7990 // kFunctionKind has to be byte-aligned |
| 7993 STATIC_ASSERT((kFunctionKind % kBitsPerByte) == 0); | 7991 STATIC_ASSERT((kFunctionKind % kBitsPerByte) == 0); |
| 7994 | 7992 |
| 7995 class FunctionKindBits : public BitField<FunctionKind, kFunctionKind, 10> {}; | 7993 class FunctionKindBits : public BitField<FunctionKind, kFunctionKind, 10> {}; |
| 7996 | 7994 |
| 7997 class DeoptCountBits : public BitField<int, 0, 4> {}; | 7995 class DeoptCountBits : public BitField<int, 0, 4> {}; |
| 7998 class OptReenableTriesBits : public BitField<int, 4, 18> {}; | 7996 class OptReenableTriesBits : public BitField<int, 4, 18> {}; |
| 7999 class ICAgeBits : public BitField<int, 22, 8> {}; | 7997 class ICAgeBits : public BitField<int, 22, 8> {}; |
| (...skipping 3922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11922 } | 11920 } |
| 11923 return value; | 11921 return value; |
| 11924 } | 11922 } |
| 11925 }; | 11923 }; |
| 11926 | 11924 |
| 11927 | 11925 |
| 11928 } // NOLINT, false-positive due to second-order macros. | 11926 } // NOLINT, false-positive due to second-order macros. |
| 11929 } // NOLINT, false-positive due to second-order macros. | 11927 } // NOLINT, false-positive due to second-order macros. |
| 11930 | 11928 |
| 11931 #endif // V8_OBJECTS_H_ | 11929 #endif // V8_OBJECTS_H_ |
| OLD | NEW |