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 #include <ostream> | 5 #include <ostream> |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/compilation-dependencies.h" | 8 #include "src/compilation-dependencies.h" |
9 #include "src/compiler/access-info.h" | 9 #include "src/compiler/access-info.h" |
10 #include "src/compiler/type-cache.h" | 10 #include "src/compiler/type-cache.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 receiver_maps); | 90 receiver_maps); |
91 } | 91 } |
92 | 92 |
93 // static | 93 // static |
94 PropertyAccessInfo PropertyAccessInfo::AccessorConstant( | 94 PropertyAccessInfo PropertyAccessInfo::AccessorConstant( |
95 MapList const& receiver_maps, Handle<Object> constant, | 95 MapList const& receiver_maps, Handle<Object> constant, |
96 MaybeHandle<JSObject> holder) { | 96 MaybeHandle<JSObject> holder) { |
97 return PropertyAccessInfo(kAccessorConstant, holder, constant, receiver_maps); | 97 return PropertyAccessInfo(kAccessorConstant, holder, constant, receiver_maps); |
98 } | 98 } |
99 | 99 |
100 // static | |
101 PropertyAccessInfo PropertyAccessInfo::Generic(MapList const& receiver_maps) { | |
102 return PropertyAccessInfo(kGeneric, MaybeHandle<JSObject>(), Handle<Object>(), | |
103 receiver_maps); | |
104 } | |
105 | |
106 PropertyAccessInfo::PropertyAccessInfo() | 100 PropertyAccessInfo::PropertyAccessInfo() |
107 : kind_(kInvalid), | 101 : kind_(kInvalid), |
108 field_representation_(MachineRepresentation::kNone), | 102 field_representation_(MachineRepresentation::kNone), |
109 field_type_(Type::None()) {} | 103 field_type_(Type::None()) {} |
110 | 104 |
111 PropertyAccessInfo::PropertyAccessInfo(MaybeHandle<JSObject> holder, | 105 PropertyAccessInfo::PropertyAccessInfo(MaybeHandle<JSObject> holder, |
112 MapList const& receiver_maps) | 106 MapList const& receiver_maps) |
113 : kind_(kNotFound), | 107 : kind_(kNotFound), |
114 receiver_maps_(receiver_maps), | 108 receiver_maps_(receiver_maps), |
115 holder_(holder), | 109 holder_(holder), |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 // Check if we actually access the same constant. | 164 // Check if we actually access the same constant. |
171 if (this->constant_.address() == that->constant_.address()) { | 165 if (this->constant_.address() == that->constant_.address()) { |
172 this->receiver_maps_.insert(this->receiver_maps_.end(), | 166 this->receiver_maps_.insert(this->receiver_maps_.end(), |
173 that->receiver_maps_.begin(), | 167 that->receiver_maps_.begin(), |
174 that->receiver_maps_.end()); | 168 that->receiver_maps_.end()); |
175 return true; | 169 return true; |
176 } | 170 } |
177 return false; | 171 return false; |
178 } | 172 } |
179 | 173 |
180 case kNotFound: | 174 case kNotFound: { |
181 case kGeneric: { | |
182 this->receiver_maps_.insert(this->receiver_maps_.end(), | 175 this->receiver_maps_.insert(this->receiver_maps_.end(), |
183 that->receiver_maps_.begin(), | 176 that->receiver_maps_.begin(), |
184 that->receiver_maps_.end()); | 177 that->receiver_maps_.end()); |
185 return true; | 178 return true; |
186 } | 179 } |
187 } | 180 } |
188 | 181 |
189 UNREACHABLE(); | 182 UNREACHABLE(); |
190 return false; | 183 return false; |
191 } | 184 } |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 } | 561 } |
569 return false; | 562 return false; |
570 } | 563 } |
571 | 564 |
572 | 565 |
573 Factory* AccessInfoFactory::factory() const { return isolate()->factory(); } | 566 Factory* AccessInfoFactory::factory() const { return isolate()->factory(); } |
574 | 567 |
575 } // namespace compiler | 568 } // namespace compiler |
576 } // namespace internal | 569 } // namespace internal |
577 } // namespace v8 | 570 } // namespace v8 |
OLD | NEW |