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