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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 property_details_(PropertyDetails::Empty()), | 52 property_details_(PropertyDetails::Empty()), |
53 isolate_(name->GetIsolate()), | 53 isolate_(name->GetIsolate()), |
54 name_(name), | 54 name_(name), |
55 // kMaxUInt32 isn't a valid index. | 55 // kMaxUInt32 isn't a valid index. |
56 index_(kMaxUInt32), | 56 index_(kMaxUInt32), |
57 receiver_(receiver), | 57 receiver_(receiver), |
58 holder_(GetRoot(receiver_, isolate_)), | 58 holder_(GetRoot(receiver_, isolate_)), |
59 holder_map_(holder_->map(), isolate_), | 59 holder_map_(holder_->map(), isolate_), |
60 initial_holder_(holder_), | 60 initial_holder_(holder_), |
61 number_(DescriptorArray::kNotFound) { | 61 number_(DescriptorArray::kNotFound) { |
62 #if 0 // TODO(verwaest): Enable once blocking hacks are removed. | |
63 #ifdef DEBUG | 62 #ifdef DEBUG |
64 uint32_t index; // Assert that the name is not an array index. | 63 uint32_t index; // Assert that the name is not an array index. |
65 DCHECK(!name->AsArrayIndex(&index)); | 64 DCHECK(!name->AsArrayIndex(&index)); |
66 #endif // DEBUG | 65 #endif // DEBUG |
67 #endif | |
68 Next(); | 66 Next(); |
69 } | 67 } |
70 | 68 |
71 LookupIterator(Handle<Object> receiver, Handle<Name> name, | 69 LookupIterator(Handle<Object> receiver, Handle<Name> name, |
72 Handle<JSReceiver> holder, | 70 Handle<JSReceiver> holder, |
73 Configuration configuration = PROTOTYPE_CHAIN) | 71 Configuration configuration = PROTOTYPE_CHAIN) |
74 : configuration_(ComputeConfiguration(configuration, name)), | 72 : configuration_(ComputeConfiguration(configuration, name)), |
75 state_(NOT_FOUND), | 73 state_(NOT_FOUND), |
76 exotic_index_state_(ExoticIndexState::kUninitialized), | 74 exotic_index_state_(ExoticIndexState::kUninitialized), |
77 interceptor_state_(InterceptorState::kUninitialized), | 75 interceptor_state_(InterceptorState::kUninitialized), |
78 property_details_(PropertyDetails::Empty()), | 76 property_details_(PropertyDetails::Empty()), |
79 isolate_(name->GetIsolate()), | 77 isolate_(name->GetIsolate()), |
80 name_(name), | 78 name_(name), |
81 // kMaxUInt32 isn't a valid index. | 79 // kMaxUInt32 isn't a valid index. |
82 index_(kMaxUInt32), | 80 index_(kMaxUInt32), |
83 receiver_(receiver), | 81 receiver_(receiver), |
84 holder_(holder), | 82 holder_(holder), |
85 holder_map_(holder_->map(), isolate_), | 83 holder_map_(holder_->map(), isolate_), |
86 initial_holder_(holder_), | 84 initial_holder_(holder_), |
87 number_(DescriptorArray::kNotFound) { | 85 number_(DescriptorArray::kNotFound) { |
88 #if 0 // TODO(verwaest): Enable once blocking hacks are removed. | |
89 #ifdef DEBUG | 86 #ifdef DEBUG |
90 uint32_t index; // Assert that the name is not an array index. | 87 uint32_t index; // Assert that the name is not an array index. |
91 DCHECK(!name->AsArrayIndex(&index)); | 88 DCHECK(!name->AsArrayIndex(&index)); |
92 #endif // DEBUG | 89 #endif // DEBUG |
93 #endif | |
94 Next(); | 90 Next(); |
95 } | 91 } |
96 | 92 |
97 LookupIterator(Isolate* isolate, Handle<Object> receiver, uint32_t index, | 93 LookupIterator(Isolate* isolate, Handle<Object> receiver, uint32_t index, |
98 Configuration configuration = PROTOTYPE_CHAIN) | 94 Configuration configuration = PROTOTYPE_CHAIN) |
99 : configuration_(configuration), | 95 : configuration_(configuration), |
100 state_(NOT_FOUND), | 96 state_(NOT_FOUND), |
101 exotic_index_state_(ExoticIndexState::kUninitialized), | 97 exotic_index_state_(ExoticIndexState::kUninitialized), |
102 interceptor_state_(InterceptorState::kUninitialized), | 98 interceptor_state_(InterceptorState::kUninitialized), |
103 property_details_(PropertyDetails::Empty()), | 99 property_details_(PropertyDetails::Empty()), |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 return property_details().representation(); | 201 return property_details().representation(); |
206 } | 202 } |
207 FieldIndex GetFieldIndex() const; | 203 FieldIndex GetFieldIndex() const; |
208 Handle<HeapType> GetFieldType() const; | 204 Handle<HeapType> GetFieldType() const; |
209 int GetAccessorIndex() const; | 205 int GetAccessorIndex() const; |
210 int GetConstantIndex() const; | 206 int GetConstantIndex() const; |
211 Handle<PropertyCell> GetPropertyCell() const; | 207 Handle<PropertyCell> GetPropertyCell() const; |
212 Handle<Object> GetAccessors() const; | 208 Handle<Object> GetAccessors() const; |
213 Handle<InterceptorInfo> GetInterceptor() const; | 209 Handle<InterceptorInfo> GetInterceptor() const; |
214 Handle<Object> GetDataValue() const; | 210 Handle<Object> GetDataValue() const; |
215 // Usually returns the value that was passed in. In case of typed array | 211 void WriteDataValue(Handle<Object> value); |
216 // accesses it returns the converted value. | |
217 Handle<Object> WriteDataValue(Handle<Object> value); | |
218 void InternalizeName(); | 212 void InternalizeName(); |
219 | 213 |
220 private: | 214 private: |
221 enum class InterceptorState { | 215 enum class InterceptorState { |
222 kUninitialized, | 216 kUninitialized, |
223 kSkipNonMasking, | 217 kSkipNonMasking, |
224 kProcessNonMasking | 218 kProcessNonMasking |
225 }; | 219 }; |
226 | 220 |
227 Handle<Map> GetReceiverMap() const; | 221 Handle<Map> GetReceiverMap() const; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 Handle<JSReceiver> holder_; | 280 Handle<JSReceiver> holder_; |
287 Handle<Map> holder_map_; | 281 Handle<Map> holder_map_; |
288 const Handle<JSReceiver> initial_holder_; | 282 const Handle<JSReceiver> initial_holder_; |
289 uint32_t number_; | 283 uint32_t number_; |
290 }; | 284 }; |
291 | 285 |
292 | 286 |
293 } } // namespace v8::internal | 287 } } // namespace v8::internal |
294 | 288 |
295 #endif // V8_LOOKUP_H_ | 289 #endif // V8_LOOKUP_H_ |
OLD | NEW |