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_COMPILER_ACCESS_INFO_H_ | 5 #ifndef V8_COMPILER_ACCESS_INFO_H_ |
6 #define V8_COMPILER_ACCESS_INFO_H_ | 6 #define V8_COMPILER_ACCESS_INFO_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 | 9 |
10 #include "src/field-index.h" | 10 #include "src/field-index.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 }; | 64 }; |
65 | 65 |
66 static PropertyAccessInfo NotFound(MapList const& receiver_maps, | 66 static PropertyAccessInfo NotFound(MapList const& receiver_maps, |
67 MaybeHandle<JSObject> holder); | 67 MaybeHandle<JSObject> holder); |
68 static PropertyAccessInfo DataConstant(MapList const& receiver_maps, | 68 static PropertyAccessInfo DataConstant(MapList const& receiver_maps, |
69 Handle<Object> constant, | 69 Handle<Object> constant, |
70 MaybeHandle<JSObject> holder); | 70 MaybeHandle<JSObject> holder); |
71 static PropertyAccessInfo DataField( | 71 static PropertyAccessInfo DataField( |
72 MapList const& receiver_maps, FieldIndex field_index, | 72 MapList const& receiver_maps, FieldIndex field_index, |
73 MachineRepresentation field_representation, Type* field_type, | 73 MachineRepresentation field_representation, Type* field_type, |
| 74 MaybeHandle<Map> field_map = MaybeHandle<Map>(), |
74 MaybeHandle<JSObject> holder = MaybeHandle<JSObject>(), | 75 MaybeHandle<JSObject> holder = MaybeHandle<JSObject>(), |
75 MaybeHandle<Map> transition_map = MaybeHandle<Map>()); | 76 MaybeHandle<Map> transition_map = MaybeHandle<Map>()); |
76 static PropertyAccessInfo AccessorConstant(MapList const& receiver_maps, | 77 static PropertyAccessInfo AccessorConstant(MapList const& receiver_maps, |
77 Handle<Object> constant, | 78 Handle<Object> constant, |
78 MaybeHandle<JSObject> holder); | 79 MaybeHandle<JSObject> holder); |
79 | 80 |
80 PropertyAccessInfo(); | 81 PropertyAccessInfo(); |
81 | 82 |
82 bool Merge(PropertyAccessInfo const* that) WARN_UNUSED_RESULT; | 83 bool Merge(PropertyAccessInfo const* that) WARN_UNUSED_RESULT; |
83 | 84 |
84 bool IsNotFound() const { return kind() == kNotFound; } | 85 bool IsNotFound() const { return kind() == kNotFound; } |
85 bool IsDataConstant() const { return kind() == kDataConstant; } | 86 bool IsDataConstant() const { return kind() == kDataConstant; } |
86 bool IsDataField() const { return kind() == kDataField; } | 87 bool IsDataField() const { return kind() == kDataField; } |
87 bool IsAccessorConstant() const { return kind() == kAccessorConstant; } | 88 bool IsAccessorConstant() const { return kind() == kAccessorConstant; } |
88 | 89 |
89 bool HasTransitionMap() const { return !transition_map().is_null(); } | 90 bool HasTransitionMap() const { return !transition_map().is_null(); } |
90 | 91 |
91 Kind kind() const { return kind_; } | 92 Kind kind() const { return kind_; } |
92 MaybeHandle<JSObject> holder() const { return holder_; } | 93 MaybeHandle<JSObject> holder() const { return holder_; } |
93 MaybeHandle<Map> transition_map() const { return transition_map_; } | 94 MaybeHandle<Map> transition_map() const { return transition_map_; } |
94 Handle<Object> constant() const { return constant_; } | 95 Handle<Object> constant() const { return constant_; } |
95 FieldIndex field_index() const { return field_index_; } | 96 FieldIndex field_index() const { return field_index_; } |
96 Type* field_type() const { return field_type_; } | 97 Type* field_type() const { return field_type_; } |
97 MachineRepresentation field_representation() const { | 98 MachineRepresentation field_representation() const { |
98 return field_representation_; | 99 return field_representation_; |
99 } | 100 } |
| 101 MaybeHandle<Map> field_map() const { return field_map_; } |
100 MapList const& receiver_maps() const { return receiver_maps_; } | 102 MapList const& receiver_maps() const { return receiver_maps_; } |
101 | 103 |
102 private: | 104 private: |
103 PropertyAccessInfo(MaybeHandle<JSObject> holder, | 105 PropertyAccessInfo(MaybeHandle<JSObject> holder, |
104 MapList const& receiver_maps); | 106 MapList const& receiver_maps); |
105 PropertyAccessInfo(Kind kind, MaybeHandle<JSObject> holder, | 107 PropertyAccessInfo(Kind kind, MaybeHandle<JSObject> holder, |
106 Handle<Object> constant, MapList const& receiver_maps); | 108 Handle<Object> constant, MapList const& receiver_maps); |
107 PropertyAccessInfo(MaybeHandle<JSObject> holder, | 109 PropertyAccessInfo(MaybeHandle<JSObject> holder, |
108 MaybeHandle<Map> transition_map, FieldIndex field_index, | 110 MaybeHandle<Map> transition_map, FieldIndex field_index, |
109 MachineRepresentation field_representation, | 111 MachineRepresentation field_representation, |
110 Type* field_type, MapList const& receiver_maps); | 112 Type* field_type, MaybeHandle<Map> field_map, |
| 113 MapList const& receiver_maps); |
111 | 114 |
112 Kind kind_; | 115 Kind kind_; |
113 MapList receiver_maps_; | 116 MapList receiver_maps_; |
114 Handle<Object> constant_; | 117 Handle<Object> constant_; |
115 MaybeHandle<Map> transition_map_; | 118 MaybeHandle<Map> transition_map_; |
116 MaybeHandle<JSObject> holder_; | 119 MaybeHandle<JSObject> holder_; |
117 FieldIndex field_index_; | 120 FieldIndex field_index_; |
118 MachineRepresentation field_representation_; | 121 MachineRepresentation field_representation_; |
119 Type* field_type_; | 122 Type* field_type_; |
| 123 MaybeHandle<Map> field_map_; |
120 }; | 124 }; |
121 | 125 |
122 | 126 |
123 // Factory class for {ElementAccessInfo}s and {PropertyAccessInfo}s. | 127 // Factory class for {ElementAccessInfo}s and {PropertyAccessInfo}s. |
124 class AccessInfoFactory final { | 128 class AccessInfoFactory final { |
125 public: | 129 public: |
126 AccessInfoFactory(CompilationDependencies* dependencies, | 130 AccessInfoFactory(CompilationDependencies* dependencies, |
127 Handle<Context> native_context, Zone* zone); | 131 Handle<Context> native_context, Zone* zone); |
128 | 132 |
129 bool ComputeElementAccessInfo(Handle<Map> map, AccessMode access_mode, | 133 bool ComputeElementAccessInfo(Handle<Map> map, AccessMode access_mode, |
(...skipping 28 matching lines...) Expand all Loading... |
158 Zone* const zone_; | 162 Zone* const zone_; |
159 | 163 |
160 DISALLOW_COPY_AND_ASSIGN(AccessInfoFactory); | 164 DISALLOW_COPY_AND_ASSIGN(AccessInfoFactory); |
161 }; | 165 }; |
162 | 166 |
163 } // namespace compiler | 167 } // namespace compiler |
164 } // namespace internal | 168 } // namespace internal |
165 } // namespace v8 | 169 } // namespace v8 |
166 | 170 |
167 #endif // V8_COMPILER_ACCESS_INFO_H_ | 171 #endif // V8_COMPILER_ACCESS_INFO_H_ |
OLD | NEW |