| 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 7102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7113 // function from which eval was called. | 7113 // function from which eval was called. |
| 7114 DECL_ACCESSORS(eval_from_shared, Object) | 7114 DECL_ACCESSORS(eval_from_shared, Object) |
| 7115 | 7115 |
| 7116 // [eval_from_position]: the source position in the code for the function | 7116 // [eval_from_position]: the source position in the code for the function |
| 7117 // from which eval was called, as positive integer. Or the code offset in the | 7117 // from which eval was called, as positive integer. Or the code offset in the |
| 7118 // code from which eval was called, as negative integer. | 7118 // code from which eval was called, as negative integer. |
| 7119 DECL_INT_ACCESSORS(eval_from_position) | 7119 DECL_INT_ACCESSORS(eval_from_position) |
| 7120 | 7120 |
| 7121 // [shared_function_infos]: weak fixed array containing all shared | 7121 // [shared_function_infos]: weak fixed array containing all shared |
| 7122 // function infos created from this script. | 7122 // function infos created from this script. |
| 7123 DECL_ACCESSORS(shared_function_infos, Object) | 7123 DECL_ACCESSORS(shared_function_infos, FixedArray) |
| 7124 | 7124 |
| 7125 // [flags]: Holds an exciting bitfield. | 7125 // [flags]: Holds an exciting bitfield. |
| 7126 DECL_INT_ACCESSORS(flags) | 7126 DECL_INT_ACCESSORS(flags) |
| 7127 | 7127 |
| 7128 // [source_url]: sourceURL from magic comment | 7128 // [source_url]: sourceURL from magic comment |
| 7129 DECL_ACCESSORS(source_url, Object) | 7129 DECL_ACCESSORS(source_url, Object) |
| 7130 | 7130 |
| 7131 // [source_mapping_url]: sourceMappingURL magic comment | 7131 // [source_mapping_url]: sourceMappingURL magic comment |
| 7132 DECL_ACCESSORS(source_mapping_url, Object) | 7132 DECL_ACCESSORS(source_mapping_url, Object) |
| 7133 | 7133 |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7732 // Indicates that this is a synthesized function to set up class instance | 7732 // Indicates that this is a synthesized function to set up class instance |
| 7733 // fields. | 7733 // fields. |
| 7734 DECL_BOOLEAN_ACCESSORS(is_class_field_initializer) | 7734 DECL_BOOLEAN_ACCESSORS(is_class_field_initializer) |
| 7735 | 7735 |
| 7736 // Indicates that this function is an asm function. | 7736 // Indicates that this function is an asm function. |
| 7737 DECL_BOOLEAN_ACCESSORS(asm_function) | 7737 DECL_BOOLEAN_ACCESSORS(asm_function) |
| 7738 | 7738 |
| 7739 // Indicates that the the shared function info is deserialized from cache. | 7739 // Indicates that the the shared function info is deserialized from cache. |
| 7740 DECL_BOOLEAN_ACCESSORS(deserialized) | 7740 DECL_BOOLEAN_ACCESSORS(deserialized) |
| 7741 | 7741 |
| 7742 // Indicates that the the shared function info has never been compiled before. | |
| 7743 DECL_BOOLEAN_ACCESSORS(never_compiled) | |
| 7744 | |
| 7745 // Whether this function was created from a FunctionDeclaration. | 7742 // Whether this function was created from a FunctionDeclaration. |
| 7746 DECL_BOOLEAN_ACCESSORS(is_declaration) | 7743 DECL_BOOLEAN_ACCESSORS(is_declaration) |
| 7747 | 7744 |
| 7748 // Whether this function was marked to be tiered up. | 7745 // Whether this function was marked to be tiered up. |
| 7749 DECL_BOOLEAN_ACCESSORS(marked_for_tier_up) | 7746 DECL_BOOLEAN_ACCESSORS(marked_for_tier_up) |
| 7750 | 7747 |
| 7751 // Indicates that asm->wasm conversion failed and should not be re-attempted. | 7748 // Indicates that asm->wasm conversion failed and should not be re-attempted. |
| 7752 DECL_BOOLEAN_ACCESSORS(is_asm_wasm_broken) | 7749 DECL_BOOLEAN_ACCESSORS(is_asm_wasm_broken) |
| 7753 | 7750 |
| 7754 inline FunctionKind kind() const; | 7751 inline FunctionKind kind() const; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7829 | 7826 |
| 7830 void ResetForNewContext(int new_ic_age); | 7827 void ResetForNewContext(int new_ic_age); |
| 7831 | 7828 |
| 7832 // Iterate over all shared function infos. | 7829 // Iterate over all shared function infos. |
| 7833 class Iterator { | 7830 class Iterator { |
| 7834 public: | 7831 public: |
| 7835 explicit Iterator(Isolate* isolate); | 7832 explicit Iterator(Isolate* isolate); |
| 7836 SharedFunctionInfo* Next(); | 7833 SharedFunctionInfo* Next(); |
| 7837 | 7834 |
| 7838 private: | 7835 private: |
| 7839 bool NextScript(); | 7836 void NextScript(); |
| 7840 | 7837 |
| 7841 Script::Iterator script_iterator_; | 7838 Script::Iterator script_iterator_; |
| 7842 WeakFixedArray::Iterator sfi_iterator_; | 7839 WeakFixedArray::Iterator sfi_iterator_; |
| 7840 Script* current_script_; |
| 7841 int index_; |
| 7843 DisallowHeapAllocation no_gc_; | 7842 DisallowHeapAllocation no_gc_; |
| 7844 DISALLOW_COPY_AND_ASSIGN(Iterator); | 7843 DISALLOW_COPY_AND_ASSIGN(Iterator); |
| 7845 }; | 7844 }; |
| 7846 | 7845 |
| 7847 DECLARE_CAST(SharedFunctionInfo) | 7846 DECLARE_CAST(SharedFunctionInfo) |
| 7848 | 7847 |
| 7849 // Constants. | 7848 // Constants. |
| 7850 static const int kDontAdaptArgumentsSentinel = -1; | 7849 static const int kDontAdaptArgumentsSentinel = -1; |
| 7851 | 7850 |
| 7852 // Layout description. | 7851 // Layout description. |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7994 static const int kIsTopLevelBit = 1; | 7993 static const int kIsTopLevelBit = 1; |
| 7995 static const int kStartPositionShift = 2; | 7994 static const int kStartPositionShift = 2; |
| 7996 static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1); | 7995 static const int kStartPositionMask = ~((1 << kStartPositionShift) - 1); |
| 7997 | 7996 |
| 7998 // Bit positions in compiler_hints. | 7997 // Bit positions in compiler_hints. |
| 7999 enum CompilerHints { | 7998 enum CompilerHints { |
| 8000 // byte 0 | 7999 // byte 0 |
| 8001 kAllowLazyCompilation, | 8000 kAllowLazyCompilation, |
| 8002 kMarkedForTierUp, | 8001 kMarkedForTierUp, |
| 8003 kOptimizationDisabled, | 8002 kOptimizationDisabled, |
| 8004 kNeverCompiled, | 8003 kIsClassFieldInitializer, |
| 8005 kNative, | 8004 kNative, |
| 8006 kStrictModeFunction, | 8005 kStrictModeFunction, |
| 8007 kUsesArguments, | 8006 kUsesArguments, |
| 8008 kNeedsHomeObject, | 8007 kNeedsHomeObject, |
| 8009 // byte 1 | 8008 // byte 1 |
| 8010 kHasDuplicateParameters, | 8009 kHasDuplicateParameters, |
| 8011 kForceInline, | 8010 kForceInline, |
| 8012 kIsAsmFunction, | 8011 kIsAsmFunction, |
| 8013 kIsAnonymousExpression, | 8012 kIsAnonymousExpression, |
| 8014 kNameShouldPrintAsAnonymous, | 8013 kNameShouldPrintAsAnonymous, |
| 8015 kIsFunction, | 8014 kIsFunction, |
| 8016 kMustUseIgnitionTurbo, | 8015 kMustUseIgnitionTurbo, |
| 8017 kDontFlush, | 8016 kDontFlush, |
| 8018 // byte 2 | 8017 // byte 2 |
| 8019 kFunctionKind, | 8018 kFunctionKind, |
| 8020 // rest of byte 2 and first two bits of byte 3 are used by FunctionKind | 8019 // rest of byte 2 and first two bits of byte 3 are used by FunctionKind |
| 8021 // byte 3 | 8020 // byte 3 |
| 8022 kDeserialized = kFunctionKind + 10, | 8021 kDeserialized = kFunctionKind + 10, |
| 8023 kIsDeclaration, | 8022 kIsDeclaration, |
| 8024 kIsAsmWasmBroken, | 8023 kIsAsmWasmBroken, |
| 8025 kRequiresClassFieldInit, | 8024 kRequiresClassFieldInit, |
| 8026 kIsClassFieldInitializer, | |
| 8027 kCompilerHintsCount, // Pseudo entry | 8025 kCompilerHintsCount, // Pseudo entry |
| 8028 }; | 8026 }; |
| 8029 // kFunctionKind has to be byte-aligned | 8027 // kFunctionKind has to be byte-aligned |
| 8030 STATIC_ASSERT((kFunctionKind % kBitsPerByte) == 0); | 8028 STATIC_ASSERT((kFunctionKind % kBitsPerByte) == 0); |
| 8031 | 8029 |
| 8032 class FunctionKindBits : public BitField<FunctionKind, kFunctionKind, 10> {}; | 8030 class FunctionKindBits : public BitField<FunctionKind, kFunctionKind, 10> {}; |
| 8033 | 8031 |
| 8034 class DeoptCountBits : public BitField<int, 0, 4> {}; | 8032 class DeoptCountBits : public BitField<int, 0, 4> {}; |
| 8035 class OptReenableTriesBits : public BitField<int, 4, 18> {}; | 8033 class OptReenableTriesBits : public BitField<int, 4, 18> {}; |
| 8036 class ICAgeBits : public BitField<int, 22, 8> {}; | 8034 class ICAgeBits : public BitField<int, 22, 8> {}; |
| (...skipping 3922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11959 } | 11957 } |
| 11960 return value; | 11958 return value; |
| 11961 } | 11959 } |
| 11962 }; | 11960 }; |
| 11963 | 11961 |
| 11964 | 11962 |
| 11965 } // NOLINT, false-positive due to second-order macros. | 11963 } // NOLINT, false-positive due to second-order macros. |
| 11966 } // NOLINT, false-positive due to second-order macros. | 11964 } // NOLINT, false-positive due to second-order macros. |
| 11967 | 11965 |
| 11968 #endif // V8_OBJECTS_H_ | 11966 #endif // V8_OBJECTS_H_ |
| OLD | NEW |