OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_PROPERTY_H_ | 5 #ifndef V8_PROPERTY_H_ |
6 #define V8_PROPERTY_H_ | 6 #define V8_PROPERTY_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 | 9 |
10 #include "src/factory.h" | 10 #include "src/factory.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 details_(attributes, type, representation, field_index) { } | 66 details_(attributes, type, representation, field_index) { } |
67 | 67 |
68 friend class DescriptorArray; | 68 friend class DescriptorArray; |
69 friend class Map; | 69 friend class Map; |
70 }; | 70 }; |
71 | 71 |
72 | 72 |
73 std::ostream& operator<<(std::ostream& os, const Descriptor& d); | 73 std::ostream& operator<<(std::ostream& os, const Descriptor& d); |
74 | 74 |
75 | 75 |
76 class DataDescriptor FINAL : public Descriptor { | 76 class DataDescriptor final : public Descriptor { |
77 public: | 77 public: |
78 DataDescriptor(Handle<Name> key, int field_index, | 78 DataDescriptor(Handle<Name> key, int field_index, |
79 PropertyAttributes attributes, Representation representation) | 79 PropertyAttributes attributes, Representation representation) |
80 : Descriptor(key, HeapType::Any(key->GetIsolate()), attributes, DATA, | 80 : Descriptor(key, HeapType::Any(key->GetIsolate()), attributes, DATA, |
81 representation, field_index) {} | 81 representation, field_index) {} |
82 // The field type is either a simple type or a map wrapped in a weak cell. | 82 // The field type is either a simple type or a map wrapped in a weak cell. |
83 DataDescriptor(Handle<Name> key, int field_index, | 83 DataDescriptor(Handle<Name> key, int field_index, |
84 Handle<Object> wrapped_field_type, | 84 Handle<Object> wrapped_field_type, |
85 PropertyAttributes attributes, Representation representation) | 85 PropertyAttributes attributes, Representation representation) |
86 : Descriptor(key, wrapped_field_type, attributes, DATA, representation, | 86 : Descriptor(key, wrapped_field_type, attributes, DATA, representation, |
87 field_index) { | 87 field_index) { |
88 DCHECK(wrapped_field_type->IsSmi() || wrapped_field_type->IsWeakCell()); | 88 DCHECK(wrapped_field_type->IsSmi() || wrapped_field_type->IsWeakCell()); |
89 } | 89 } |
90 }; | 90 }; |
91 | 91 |
92 | 92 |
93 class DataConstantDescriptor FINAL : public Descriptor { | 93 class DataConstantDescriptor final : public Descriptor { |
94 public: | 94 public: |
95 DataConstantDescriptor(Handle<Name> key, Handle<Object> value, | 95 DataConstantDescriptor(Handle<Name> key, Handle<Object> value, |
96 PropertyAttributes attributes) | 96 PropertyAttributes attributes) |
97 : Descriptor(key, value, attributes, DATA_CONSTANT, | 97 : Descriptor(key, value, attributes, DATA_CONSTANT, |
98 value->OptimalRepresentation()) {} | 98 value->OptimalRepresentation()) {} |
99 }; | 99 }; |
100 | 100 |
101 | 101 |
102 class AccessorConstantDescriptor FINAL : public Descriptor { | 102 class AccessorConstantDescriptor final : public Descriptor { |
103 public: | 103 public: |
104 AccessorConstantDescriptor(Handle<Name> key, Handle<Object> foreign, | 104 AccessorConstantDescriptor(Handle<Name> key, Handle<Object> foreign, |
105 PropertyAttributes attributes) | 105 PropertyAttributes attributes) |
106 : Descriptor(key, foreign, attributes, ACCESSOR_CONSTANT, | 106 : Descriptor(key, foreign, attributes, ACCESSOR_CONSTANT, |
107 Representation::Tagged()) {} | 107 Representation::Tagged()) {} |
108 }; | 108 }; |
109 | 109 |
110 | 110 |
111 } } // namespace v8::internal | 111 } } // namespace v8::internal |
112 | 112 |
113 #endif // V8_PROPERTY_H_ | 113 #endif // V8_PROPERTY_H_ |
OLD | NEW |