OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_LOOKUP_H_ | 5 #ifndef V8_LOOKUP_H_ |
6 #define V8_LOOKUP_H_ | 6 #define V8_LOOKUP_H_ |
7 | 7 |
8 #include "src/factory.h" | 8 #include "src/factory.h" |
9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
10 #include "src/objects.h" | 10 #include "src/objects.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 : configuration_(ComputeConfiguration(configuration, name)), | 49 : configuration_(ComputeConfiguration(configuration, name)), |
50 state_(NOT_FOUND), | 50 state_(NOT_FOUND), |
51 exotic_index_state_(ExoticIndexState::kUninitialized), | 51 exotic_index_state_(ExoticIndexState::kUninitialized), |
52 interceptor_state_(InterceptorState::kUninitialized), | 52 interceptor_state_(InterceptorState::kUninitialized), |
53 property_details_(PropertyDetails::Empty()), | 53 property_details_(PropertyDetails::Empty()), |
54 isolate_(name->GetIsolate()), | 54 isolate_(name->GetIsolate()), |
55 name_(Name::Flatten(name)), | 55 name_(Name::Flatten(name)), |
56 // kMaxUInt32 isn't a valid index. | 56 // kMaxUInt32 isn't a valid index. |
57 index_(kMaxUInt32), | 57 index_(kMaxUInt32), |
58 receiver_(receiver), | 58 receiver_(receiver), |
59 holder_(GetRoot(receiver_, isolate_)), | 59 holder_(GetRoot(isolate_, receiver)), |
60 holder_map_(holder_->map(), isolate_), | 60 holder_map_(holder_->map(), isolate_), |
61 initial_holder_(holder_), | 61 initial_holder_(holder_), |
62 number_(DescriptorArray::kNotFound) { | 62 number_(DescriptorArray::kNotFound) { |
63 #ifdef DEBUG | 63 #ifdef DEBUG |
64 uint32_t index; // Assert that the name is not an array index. | 64 uint32_t index; // Assert that the name is not an array index. |
65 DCHECK(!name->AsArrayIndex(&index)); | 65 DCHECK(!name->AsArrayIndex(&index)); |
66 #endif // DEBUG | 66 #endif // DEBUG |
67 Next(); | 67 Next(); |
68 } | 68 } |
69 | 69 |
(...skipping 25 matching lines...) Expand all Loading... |
95 Configuration configuration = DEFAULT) | 95 Configuration configuration = DEFAULT) |
96 : configuration_(configuration), | 96 : configuration_(configuration), |
97 state_(NOT_FOUND), | 97 state_(NOT_FOUND), |
98 exotic_index_state_(ExoticIndexState::kUninitialized), | 98 exotic_index_state_(ExoticIndexState::kUninitialized), |
99 interceptor_state_(InterceptorState::kUninitialized), | 99 interceptor_state_(InterceptorState::kUninitialized), |
100 property_details_(PropertyDetails::Empty()), | 100 property_details_(PropertyDetails::Empty()), |
101 isolate_(isolate), | 101 isolate_(isolate), |
102 name_(), | 102 name_(), |
103 index_(index), | 103 index_(index), |
104 receiver_(receiver), | 104 receiver_(receiver), |
105 holder_(GetRoot(receiver_, isolate_)), | 105 holder_(GetRoot(isolate, receiver, index)), |
106 holder_map_(holder_->map(), isolate_), | 106 holder_map_(holder_->map(), isolate_), |
107 initial_holder_(holder_), | 107 initial_holder_(holder_), |
108 number_(DescriptorArray::kNotFound) { | 108 number_(DescriptorArray::kNotFound) { |
109 // kMaxUInt32 isn't a valid index. | 109 // kMaxUInt32 isn't a valid index. |
110 DCHECK_NE(kMaxUInt32, index_); | 110 DCHECK_NE(kMaxUInt32, index_); |
111 Next(); | 111 Next(); |
112 } | 112 } |
113 | 113 |
114 LookupIterator(Isolate* isolate, Handle<Object> receiver, uint32_t index, | 114 LookupIterator(Isolate* isolate, Handle<Object> receiver, uint32_t index, |
115 Handle<JSReceiver> holder, | 115 Handle<JSReceiver> holder, |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 bool is_dictionary_holder() const { return holder_map_->is_dictionary_map(); } | 189 bool is_dictionary_holder() const { return holder_map_->is_dictionary_map(); } |
190 Handle<Map> transition_map() const { | 190 Handle<Map> transition_map() const { |
191 DCHECK_EQ(TRANSITION, state_); | 191 DCHECK_EQ(TRANSITION, state_); |
192 return Handle<Map>::cast(transition_); | 192 return Handle<Map>::cast(transition_); |
193 } | 193 } |
194 template <class T> | 194 template <class T> |
195 Handle<T> GetHolder() const { | 195 Handle<T> GetHolder() const { |
196 DCHECK(IsFound()); | 196 DCHECK(IsFound()); |
197 return Handle<T>::cast(holder_); | 197 return Handle<T>::cast(holder_); |
198 } | 198 } |
199 static Handle<JSReceiver> GetRoot(Handle<Object> receiver, Isolate* isolate); | 199 static Handle<JSReceiver> GetRoot(Isolate* isolate, Handle<Object> receiver, |
| 200 uint32_t index = kMaxUInt32); |
200 bool HolderIsReceiverOrHiddenPrototype() const; | 201 bool HolderIsReceiverOrHiddenPrototype() const; |
201 | 202 |
202 /* ACCESS_CHECK */ | 203 /* ACCESS_CHECK */ |
203 bool HasAccess() const; | 204 bool HasAccess() const; |
204 | 205 |
205 /* PROPERTY */ | 206 /* PROPERTY */ |
206 void PrepareForDataProperty(Handle<Object> value); | 207 void PrepareForDataProperty(Handle<Object> value); |
207 void PrepareTransitionToDataProperty(Handle<Object> value, | 208 void PrepareTransitionToDataProperty(Handle<Object> value, |
208 PropertyAttributes attributes, | 209 PropertyAttributes attributes, |
209 Object::StoreFromKeyed store_mode); | 210 Object::StoreFromKeyed store_mode); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 Handle<JSReceiver> holder_; | 309 Handle<JSReceiver> holder_; |
309 Handle<Map> holder_map_; | 310 Handle<Map> holder_map_; |
310 const Handle<JSReceiver> initial_holder_; | 311 const Handle<JSReceiver> initial_holder_; |
311 uint32_t number_; | 312 uint32_t number_; |
312 }; | 313 }; |
313 | 314 |
314 | 315 |
315 } } // namespace v8::internal | 316 } } // namespace v8::internal |
316 | 317 |
317 #endif // V8_LOOKUP_H_ | 318 #endif // V8_LOOKUP_H_ |
OLD | NEW |