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" |
| 11 #include "src/machine-type.h" |
11 #include "src/objects.h" | 12 #include "src/objects.h" |
12 #include "src/zone-containers.h" | 13 #include "src/zone-containers.h" |
13 | 14 |
14 namespace v8 { | 15 namespace v8 { |
15 namespace internal { | 16 namespace internal { |
16 | 17 |
17 // Forward declarations. | 18 // Forward declarations. |
18 class CompilationDependencies; | 19 class CompilationDependencies; |
19 class Factory; | 20 class Factory; |
20 | 21 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 kDataField, | 62 kDataField, |
62 kAccessorConstant | 63 kAccessorConstant |
63 }; | 64 }; |
64 | 65 |
65 static PropertyAccessInfo NotFound(MapList const& receiver_maps, | 66 static PropertyAccessInfo NotFound(MapList const& receiver_maps, |
66 MaybeHandle<JSObject> holder); | 67 MaybeHandle<JSObject> holder); |
67 static PropertyAccessInfo DataConstant(MapList const& receiver_maps, | 68 static PropertyAccessInfo DataConstant(MapList const& receiver_maps, |
68 Handle<Object> constant, | 69 Handle<Object> constant, |
69 MaybeHandle<JSObject> holder); | 70 MaybeHandle<JSObject> holder); |
70 static PropertyAccessInfo DataField( | 71 static PropertyAccessInfo DataField( |
71 MapList const& receiver_maps, FieldIndex field_index, Type* field_type, | 72 MapList const& receiver_maps, FieldIndex field_index, |
| 73 MachineRepresentation field_representation, Type* field_type, |
72 MaybeHandle<JSObject> holder = MaybeHandle<JSObject>(), | 74 MaybeHandle<JSObject> holder = MaybeHandle<JSObject>(), |
73 MaybeHandle<Map> transition_map = MaybeHandle<Map>()); | 75 MaybeHandle<Map> transition_map = MaybeHandle<Map>()); |
74 static PropertyAccessInfo AccessorConstant(MapList const& receiver_maps, | 76 static PropertyAccessInfo AccessorConstant(MapList const& receiver_maps, |
75 Handle<Object> constant, | 77 Handle<Object> constant, |
76 MaybeHandle<JSObject> holder); | 78 MaybeHandle<JSObject> holder); |
77 | 79 |
78 PropertyAccessInfo(); | 80 PropertyAccessInfo(); |
79 | 81 |
80 bool Merge(PropertyAccessInfo const* that) WARN_UNUSED_RESULT; | 82 bool Merge(PropertyAccessInfo const* that) WARN_UNUSED_RESULT; |
81 | 83 |
82 bool IsNotFound() const { return kind() == kNotFound; } | 84 bool IsNotFound() const { return kind() == kNotFound; } |
83 bool IsDataConstant() const { return kind() == kDataConstant; } | 85 bool IsDataConstant() const { return kind() == kDataConstant; } |
84 bool IsDataField() const { return kind() == kDataField; } | 86 bool IsDataField() const { return kind() == kDataField; } |
85 bool IsAccessorConstant() const { return kind() == kAccessorConstant; } | 87 bool IsAccessorConstant() const { return kind() == kAccessorConstant; } |
86 | 88 |
87 bool HasTransitionMap() const { return !transition_map().is_null(); } | 89 bool HasTransitionMap() const { return !transition_map().is_null(); } |
88 | 90 |
89 Kind kind() const { return kind_; } | 91 Kind kind() const { return kind_; } |
90 MaybeHandle<JSObject> holder() const { return holder_; } | 92 MaybeHandle<JSObject> holder() const { return holder_; } |
91 MaybeHandle<Map> transition_map() const { return transition_map_; } | 93 MaybeHandle<Map> transition_map() const { return transition_map_; } |
92 Handle<Object> constant() const { return constant_; } | 94 Handle<Object> constant() const { return constant_; } |
93 FieldIndex field_index() const { return field_index_; } | 95 FieldIndex field_index() const { return field_index_; } |
94 Type* field_type() const { return field_type_; } | 96 Type* field_type() const { return field_type_; } |
| 97 MachineRepresentation field_representation() const { |
| 98 return field_representation_; |
| 99 } |
95 MapList const& receiver_maps() const { return receiver_maps_; } | 100 MapList const& receiver_maps() const { return receiver_maps_; } |
96 | 101 |
97 private: | 102 private: |
98 PropertyAccessInfo(MaybeHandle<JSObject> holder, | 103 PropertyAccessInfo(MaybeHandle<JSObject> holder, |
99 MapList const& receiver_maps); | 104 MapList const& receiver_maps); |
100 PropertyAccessInfo(Kind kind, MaybeHandle<JSObject> holder, | 105 PropertyAccessInfo(Kind kind, MaybeHandle<JSObject> holder, |
101 Handle<Object> constant, MapList const& receiver_maps); | 106 Handle<Object> constant, MapList const& receiver_maps); |
102 PropertyAccessInfo(MaybeHandle<JSObject> holder, | 107 PropertyAccessInfo(MaybeHandle<JSObject> holder, |
103 MaybeHandle<Map> transition_map, FieldIndex field_index, | 108 MaybeHandle<Map> transition_map, FieldIndex field_index, |
| 109 MachineRepresentation field_representation, |
104 Type* field_type, MapList const& receiver_maps); | 110 Type* field_type, MapList const& receiver_maps); |
105 | 111 |
106 Kind kind_; | 112 Kind kind_; |
107 MapList receiver_maps_; | 113 MapList receiver_maps_; |
108 Handle<Object> constant_; | 114 Handle<Object> constant_; |
109 MaybeHandle<Map> transition_map_; | 115 MaybeHandle<Map> transition_map_; |
110 MaybeHandle<JSObject> holder_; | 116 MaybeHandle<JSObject> holder_; |
111 FieldIndex field_index_; | 117 FieldIndex field_index_; |
| 118 MachineRepresentation field_representation_; |
112 Type* field_type_; | 119 Type* field_type_; |
113 }; | 120 }; |
114 | 121 |
115 | 122 |
116 // Factory class for {ElementAccessInfo}s and {PropertyAccessInfo}s. | 123 // Factory class for {ElementAccessInfo}s and {PropertyAccessInfo}s. |
117 class AccessInfoFactory final { | 124 class AccessInfoFactory final { |
118 public: | 125 public: |
119 AccessInfoFactory(CompilationDependencies* dependencies, | 126 AccessInfoFactory(CompilationDependencies* dependencies, |
120 Handle<Context> native_context, Zone* zone); | 127 Handle<Context> native_context, Zone* zone); |
121 | 128 |
(...skipping 29 matching lines...) Expand all Loading... |
151 Zone* const zone_; | 158 Zone* const zone_; |
152 | 159 |
153 DISALLOW_COPY_AND_ASSIGN(AccessInfoFactory); | 160 DISALLOW_COPY_AND_ASSIGN(AccessInfoFactory); |
154 }; | 161 }; |
155 | 162 |
156 } // namespace compiler | 163 } // namespace compiler |
157 } // namespace internal | 164 } // namespace internal |
158 } // namespace v8 | 165 } // namespace v8 |
159 | 166 |
160 #endif // V8_COMPILER_ACCESS_INFO_H_ | 167 #endif // V8_COMPILER_ACCESS_INFO_H_ |
OLD | NEW |