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