| 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 25 matching lines...) Expand all Loading... |
| 36 ACCESSOR, | 36 ACCESSOR, |
| 37 DATA, | 37 DATA, |
| 38 TRANSITION, | 38 TRANSITION, |
| 39 // Set state_ to BEFORE_PROPERTY to ensure that the next lookup will be a | 39 // Set state_ to BEFORE_PROPERTY to ensure that the next lookup will be a |
| 40 // PROPERTY lookup. | 40 // PROPERTY lookup. |
| 41 BEFORE_PROPERTY = INTERCEPTOR | 41 BEFORE_PROPERTY = INTERCEPTOR |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 LookupIterator(Handle<Object> receiver, Handle<Name> name, | 44 LookupIterator(Handle<Object> receiver, Handle<Name> name, |
| 45 Configuration configuration = DEFAULT) | 45 Configuration configuration = DEFAULT) |
| 46 : configuration_(ComputeConfiguration(configuration, name)), | 46 : LookupIterator(name->GetIsolate(), receiver, name, configuration) {} |
| 47 interceptor_state_(InterceptorState::kUninitialized), | 47 |
| 48 property_details_(PropertyDetails::Empty()), | 48 LookupIterator(Isolate* isolate, Handle<Object> receiver, Handle<Name> name, |
| 49 isolate_(name->GetIsolate()), | 49 Configuration configuration = DEFAULT) |
| 50 name_(isolate_->factory()->InternalizeName(name)), | 50 : LookupIterator(isolate, receiver, name, GetRoot(isolate, receiver), |
| 51 receiver_(receiver), | 51 configuration) {} |
| 52 initial_holder_(GetRoot(isolate_, receiver)), | |
| 53 // kMaxUInt32 isn't a valid index. | |
| 54 index_(kMaxUInt32), | |
| 55 number_(DescriptorArray::kNotFound) { | |
| 56 #ifdef DEBUG | |
| 57 uint32_t index; // Assert that the name is not an array index. | |
| 58 DCHECK(!name->AsArrayIndex(&index)); | |
| 59 #endif // DEBUG | |
| 60 Start<false>(); | |
| 61 } | |
| 62 | 52 |
| 63 LookupIterator(Handle<Object> receiver, Handle<Name> name, | 53 LookupIterator(Handle<Object> receiver, Handle<Name> name, |
| 64 Handle<JSReceiver> holder, | 54 Handle<JSReceiver> holder, |
| 65 Configuration configuration = DEFAULT) | 55 Configuration configuration = DEFAULT) |
| 56 : LookupIterator(name->GetIsolate(), receiver, name, holder, |
| 57 configuration) {} |
| 58 |
| 59 LookupIterator(Isolate* isolate, Handle<Object> receiver, Handle<Name> name, |
| 60 Handle<JSReceiver> holder, |
| 61 Configuration configuration = DEFAULT) |
| 66 : configuration_(ComputeConfiguration(configuration, name)), | 62 : configuration_(ComputeConfiguration(configuration, name)), |
| 67 interceptor_state_(InterceptorState::kUninitialized), | 63 interceptor_state_(InterceptorState::kUninitialized), |
| 68 property_details_(PropertyDetails::Empty()), | 64 property_details_(PropertyDetails::Empty()), |
| 69 isolate_(name->GetIsolate()), | 65 isolate_(isolate), |
| 70 name_(isolate_->factory()->InternalizeName(name)), | 66 name_(isolate_->factory()->InternalizeName(name)), |
| 71 receiver_(receiver), | 67 receiver_(receiver), |
| 72 initial_holder_(holder), | 68 initial_holder_(holder), |
| 73 // kMaxUInt32 isn't a valid index. | 69 // kMaxUInt32 isn't a valid index. |
| 74 index_(kMaxUInt32), | 70 index_(kMaxUInt32), |
| 75 number_(DescriptorArray::kNotFound) { | 71 number_(DescriptorArray::kNotFound) { |
| 76 #ifdef DEBUG | 72 #ifdef DEBUG |
| 77 uint32_t index; // Assert that the name is not an array index. | 73 uint32_t index; // Assert that the name is not an array index. |
| 78 DCHECK(!name->AsArrayIndex(&index)); | 74 DCHECK(!name->AsArrayIndex(&index)); |
| 79 #endif // DEBUG | 75 #endif // DEBUG |
| 80 Start<false>(); | 76 Start<false>(); |
| 81 } | 77 } |
| 82 | 78 |
| 83 LookupIterator(Isolate* isolate, Handle<Object> receiver, uint32_t index, | 79 LookupIterator(Isolate* isolate, Handle<Object> receiver, uint32_t index, |
| 84 Configuration configuration = DEFAULT) | 80 Configuration configuration = DEFAULT) |
| 85 : configuration_(configuration), | 81 : LookupIterator(isolate, receiver, index, |
| 86 interceptor_state_(InterceptorState::kUninitialized), | 82 GetRoot(isolate, receiver, index), configuration) {} |
| 87 property_details_(PropertyDetails::Empty()), | |
| 88 isolate_(isolate), | |
| 89 receiver_(receiver), | |
| 90 initial_holder_(GetRoot(isolate, receiver, index)), | |
| 91 index_(index), | |
| 92 number_(DescriptorArray::kNotFound) { | |
| 93 // kMaxUInt32 isn't a valid index. | |
| 94 DCHECK_NE(kMaxUInt32, index_); | |
| 95 Start<true>(); | |
| 96 } | |
| 97 | 83 |
| 98 LookupIterator(Isolate* isolate, Handle<Object> receiver, uint32_t index, | 84 LookupIterator(Isolate* isolate, Handle<Object> receiver, uint32_t index, |
| 99 Handle<JSReceiver> holder, | 85 Handle<JSReceiver> holder, |
| 100 Configuration configuration = DEFAULT) | 86 Configuration configuration = DEFAULT) |
| 101 : configuration_(configuration), | 87 : configuration_(configuration), |
| 102 interceptor_state_(InterceptorState::kUninitialized), | 88 interceptor_state_(InterceptorState::kUninitialized), |
| 103 property_details_(PropertyDetails::Empty()), | 89 property_details_(PropertyDetails::Empty()), |
| 104 isolate_(isolate), | 90 isolate_(isolate), |
| 105 receiver_(receiver), | 91 receiver_(receiver), |
| 106 initial_holder_(holder), | 92 initial_holder_(holder), |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 const Handle<JSReceiver> initial_holder_; | 353 const Handle<JSReceiver> initial_holder_; |
| 368 const uint32_t index_; | 354 const uint32_t index_; |
| 369 uint32_t number_; | 355 uint32_t number_; |
| 370 }; | 356 }; |
| 371 | 357 |
| 372 | 358 |
| 373 } // namespace internal | 359 } // namespace internal |
| 374 } // namespace v8 | 360 } // namespace v8 |
| 375 | 361 |
| 376 #endif // V8_LOOKUP_H_ | 362 #endif // V8_LOOKUP_H_ |
| OLD | NEW |