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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // This class encapsulates all information required to access a certain | 55 // This class encapsulates all information required to access a certain |
56 // object property, either on the object itself or on the prototype chain. | 56 // object property, either on the object itself or on the prototype chain. |
57 class PropertyAccessInfo final { | 57 class PropertyAccessInfo final { |
58 public: | 58 public: |
59 enum Kind { | 59 enum Kind { |
60 kInvalid, | 60 kInvalid, |
61 kNotFound, | 61 kNotFound, |
62 kDataConstant, | 62 kDataConstant, |
63 kDataField, | 63 kDataField, |
64 kAccessorConstant, | 64 kAccessorConstant, |
| 65 kFunctionPrototype, |
65 kGeneric | 66 kGeneric |
66 }; | 67 }; |
67 | 68 |
68 static PropertyAccessInfo NotFound(MapList const& receiver_maps, | 69 static PropertyAccessInfo NotFound(MapList const& receiver_maps, |
69 MaybeHandle<JSObject> holder); | 70 MaybeHandle<JSObject> holder); |
70 static PropertyAccessInfo DataConstant(MapList const& receiver_maps, | 71 static PropertyAccessInfo DataConstant(MapList const& receiver_maps, |
71 Handle<Object> constant, | 72 Handle<Object> constant, |
72 MaybeHandle<JSObject> holder); | 73 MaybeHandle<JSObject> holder); |
73 static PropertyAccessInfo DataField( | 74 static PropertyAccessInfo DataField( |
74 MapList const& receiver_maps, FieldIndex field_index, | 75 MapList const& receiver_maps, FieldIndex field_index, |
75 MachineRepresentation field_representation, Type* field_type, | 76 MachineRepresentation field_representation, Type* field_type, |
76 MaybeHandle<Map> field_map = MaybeHandle<Map>(), | 77 MaybeHandle<Map> field_map = MaybeHandle<Map>(), |
77 MaybeHandle<JSObject> holder = MaybeHandle<JSObject>(), | 78 MaybeHandle<JSObject> holder = MaybeHandle<JSObject>(), |
78 MaybeHandle<Map> transition_map = MaybeHandle<Map>()); | 79 MaybeHandle<Map> transition_map = MaybeHandle<Map>()); |
79 static PropertyAccessInfo AccessorConstant(MapList const& receiver_maps, | 80 static PropertyAccessInfo AccessorConstant(MapList const& receiver_maps, |
80 Handle<Object> constant, | 81 Handle<Object> constant, |
81 MaybeHandle<JSObject> holder); | 82 MaybeHandle<JSObject> holder); |
| 83 static PropertyAccessInfo FunctionPrototype(MapList const& receiver_maps); |
82 static PropertyAccessInfo Generic(MapList const& receiver_maps); | 84 static PropertyAccessInfo Generic(MapList const& receiver_maps); |
83 | 85 |
84 PropertyAccessInfo(); | 86 PropertyAccessInfo(); |
85 | 87 |
86 bool Merge(PropertyAccessInfo const* that) WARN_UNUSED_RESULT; | 88 bool Merge(PropertyAccessInfo const* that) WARN_UNUSED_RESULT; |
87 | 89 |
88 bool IsNotFound() const { return kind() == kNotFound; } | 90 bool IsNotFound() const { return kind() == kNotFound; } |
89 bool IsDataConstant() const { return kind() == kDataConstant; } | 91 bool IsDataConstant() const { return kind() == kDataConstant; } |
90 bool IsDataField() const { return kind() == kDataField; } | 92 bool IsDataField() const { return kind() == kDataField; } |
91 bool IsAccessorConstant() const { return kind() == kAccessorConstant; } | 93 bool IsAccessorConstant() const { return kind() == kAccessorConstant; } |
| 94 bool IsFunctionPrototype() const { return kind() == kFunctionPrototype; } |
92 bool IsGeneric() const { return kind() == kGeneric; } | 95 bool IsGeneric() const { return kind() == kGeneric; } |
93 | 96 |
94 bool HasTransitionMap() const { return !transition_map().is_null(); } | 97 bool HasTransitionMap() const { return !transition_map().is_null(); } |
95 | 98 |
96 Kind kind() const { return kind_; } | 99 Kind kind() const { return kind_; } |
97 MaybeHandle<JSObject> holder() const { return holder_; } | 100 MaybeHandle<JSObject> holder() const { return holder_; } |
98 MaybeHandle<Map> transition_map() const { return transition_map_; } | 101 MaybeHandle<Map> transition_map() const { return transition_map_; } |
99 Handle<Object> constant() const { return constant_; } | 102 Handle<Object> constant() const { return constant_; } |
100 FieldIndex field_index() const { return field_index_; } | 103 FieldIndex field_index() const { return field_index_; } |
101 Type* field_type() const { return field_type_; } | 104 Type* field_type() const { return field_type_; } |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 Zone* const zone_; | 169 Zone* const zone_; |
167 | 170 |
168 DISALLOW_COPY_AND_ASSIGN(AccessInfoFactory); | 171 DISALLOW_COPY_AND_ASSIGN(AccessInfoFactory); |
169 }; | 172 }; |
170 | 173 |
171 } // namespace compiler | 174 } // namespace compiler |
172 } // namespace internal | 175 } // namespace internal |
173 } // namespace v8 | 176 } // namespace v8 |
174 | 177 |
175 #endif // V8_COMPILER_ACCESS_INFO_H_ | 178 #endif // V8_COMPILER_ACCESS_INFO_H_ |
OLD | NEW |