| 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 2901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2912 static inline void NoWriteBarrierSet(FixedArray* array, | 2912 static inline void NoWriteBarrierSet(FixedArray* array, |
| 2913 int index, | 2913 int index, |
| 2914 Object* value); | 2914 Object* value); |
| 2915 | 2915 |
| 2916 private: | 2916 private: |
| 2917 STATIC_ASSERT(kHeaderSize == Internals::kFixedArrayHeaderSize); | 2917 STATIC_ASSERT(kHeaderSize == Internals::kFixedArrayHeaderSize); |
| 2918 | 2918 |
| 2919 DISALLOW_IMPLICIT_CONSTRUCTORS(FixedArray); | 2919 DISALLOW_IMPLICIT_CONSTRUCTORS(FixedArray); |
| 2920 }; | 2920 }; |
| 2921 | 2921 |
| 2922 // BoilerplateDescription is a list of properties consisting of name value | |
| 2923 // pairs. In addition to the properties, it provides the projected number | |
| 2924 // of properties in the backing store. This number includes properties with | |
| 2925 // computed names that are not | |
| 2926 // in the list. | |
| 2927 class BoilerplateDescription : public FixedArray { | |
| 2928 public: | |
| 2929 Object* name(int index) const; | |
| 2930 Object* value(int index) const; | |
| 2931 | |
| 2932 // The number of boilerplate properties. | |
| 2933 int size() const; | |
| 2934 | |
| 2935 // Number of boilerplate properties and properties with computed names. | |
| 2936 int backing_store_size() const; | |
| 2937 | |
| 2938 void set_backing_store_size(Isolate* isolate, int backing_store_size); | |
| 2939 | |
| 2940 DECLARE_CAST(BoilerplateDescription) | |
| 2941 | |
| 2942 private: | |
| 2943 bool has_number_of_properties() const; | |
| 2944 }; | |
| 2945 | |
| 2946 // FixedDoubleArray describes fixed-sized arrays with element type double. | 2922 // FixedDoubleArray describes fixed-sized arrays with element type double. |
| 2947 class FixedDoubleArray: public FixedArrayBase { | 2923 class FixedDoubleArray: public FixedArrayBase { |
| 2948 public: | 2924 public: |
| 2949 // Setter and getter for elements. | 2925 // Setter and getter for elements. |
| 2950 inline double get_scalar(int index); | 2926 inline double get_scalar(int index); |
| 2951 inline uint64_t get_representation(int index); | 2927 inline uint64_t get_representation(int index); |
| 2952 static inline Handle<Object> get(FixedDoubleArray* array, int index, | 2928 static inline Handle<Object> get(FixedDoubleArray* array, int index, |
| 2953 Isolate* isolate); | 2929 Isolate* isolate); |
| 2954 inline void set(int index, double value); | 2930 inline void set(int index, double value); |
| 2955 inline void set_the_hole(Isolate* isolate, int index); | 2931 inline void set_the_hole(Isolate* isolate, int index); |
| (...skipping 3768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6724 DECLARE_VERIFIER(ContextExtension) | 6700 DECLARE_VERIFIER(ContextExtension) |
| 6725 | 6701 |
| 6726 static const int kScopeInfoOffset = HeapObject::kHeaderSize; | 6702 static const int kScopeInfoOffset = HeapObject::kHeaderSize; |
| 6727 static const int kExtensionOffset = kScopeInfoOffset + kPointerSize; | 6703 static const int kExtensionOffset = kScopeInfoOffset + kPointerSize; |
| 6728 static const int kSize = kExtensionOffset + kPointerSize; | 6704 static const int kSize = kExtensionOffset + kPointerSize; |
| 6729 | 6705 |
| 6730 private: | 6706 private: |
| 6731 DISALLOW_IMPLICIT_CONSTRUCTORS(ContextExtension); | 6707 DISALLOW_IMPLICIT_CONSTRUCTORS(ContextExtension); |
| 6732 }; | 6708 }; |
| 6733 | 6709 |
| 6734 // Pair of {ElementsKind} and an array of constant values for {ArrayLiteral} | |
| 6735 // expressions. Used to communicate with the runtime for literal boilerplate | |
| 6736 // creation within the {Runtime_CreateArrayLiteral} method. | |
| 6737 class ConstantElementsPair : public Struct { | |
| 6738 public: | |
| 6739 DECL_INT_ACCESSORS(elements_kind) | |
| 6740 DECL_ACCESSORS(constant_values, FixedArrayBase) | |
| 6741 | |
| 6742 DECLARE_CAST(ConstantElementsPair) | |
| 6743 | |
| 6744 // Dispatched behavior. | |
| 6745 DECLARE_PRINTER(ConstantElementsPair) | |
| 6746 DECLARE_VERIFIER(ConstantElementsPair) | |
| 6747 | |
| 6748 static const int kElementsKindOffset = HeapObject::kHeaderSize; | |
| 6749 static const int kConstantValuesOffset = kElementsKindOffset + kPointerSize; | |
| 6750 static const int kSize = kConstantValuesOffset + kPointerSize; | |
| 6751 | |
| 6752 private: | |
| 6753 DISALLOW_IMPLICIT_CONSTRUCTORS(ConstantElementsPair); | |
| 6754 }; | |
| 6755 | |
| 6756 // Script describes a script which has been added to the VM. | 6710 // Script describes a script which has been added to the VM. |
| 6757 class Script: public Struct { | 6711 class Script: public Struct { |
| 6758 public: | 6712 public: |
| 6759 // Script types. | 6713 // Script types. |
| 6760 enum Type { | 6714 enum Type { |
| 6761 TYPE_NATIVE = 0, | 6715 TYPE_NATIVE = 0, |
| 6762 TYPE_EXTENSION = 1, | 6716 TYPE_EXTENSION = 1, |
| 6763 TYPE_NORMAL = 2, | 6717 TYPE_NORMAL = 2, |
| 6764 TYPE_WASM = 3, | 6718 TYPE_WASM = 3, |
| 6765 TYPE_INSPECTOR = 4 | 6719 TYPE_INSPECTOR = 4 |
| (...skipping 4956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11722 } | 11676 } |
| 11723 }; | 11677 }; |
| 11724 | 11678 |
| 11725 | 11679 |
| 11726 } // NOLINT, false-positive due to second-order macros. | 11680 } // NOLINT, false-positive due to second-order macros. |
| 11727 } // NOLINT, false-positive due to second-order macros. | 11681 } // NOLINT, false-positive due to second-order macros. |
| 11728 | 11682 |
| 11729 #include "src/objects/object-macros-undef.h" | 11683 #include "src/objects/object-macros-undef.h" |
| 11730 | 11684 |
| 11731 #endif // V8_OBJECTS_H_ | 11685 #endif // V8_OBJECTS_H_ |
| OLD | NEW |