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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 initial_holder_(holder_), | 120 initial_holder_(holder_), |
121 number_(DescriptorArray::kNotFound) { | 121 number_(DescriptorArray::kNotFound) { |
122 // kMaxUInt32 isn't a valid index. | 122 // kMaxUInt32 isn't a valid index. |
123 DCHECK_NE(kMaxUInt32, index_); | 123 DCHECK_NE(kMaxUInt32, index_); |
124 Next(); | 124 Next(); |
125 } | 125 } |
126 | 126 |
127 static LookupIterator PropertyOrElement( | 127 static LookupIterator PropertyOrElement( |
128 Isolate* isolate, Handle<Object> receiver, Handle<Name> name, | 128 Isolate* isolate, Handle<Object> receiver, Handle<Name> name, |
129 Configuration configuration = DEFAULT) { | 129 Configuration configuration = DEFAULT) { |
130 name = isolate->factory()->InternalizeName(name); | |
131 uint32_t index; | 130 uint32_t index; |
132 LookupIterator it = | 131 if (name->AsArrayIndex(&index)) { |
133 name->AsArrayIndex(&index) | 132 LookupIterator it = |
134 ? LookupIterator(isolate, receiver, index, configuration) | 133 LookupIterator(isolate, receiver, index, configuration); |
135 : LookupIterator(receiver, name, configuration); | 134 it.name_ = name; |
136 it.name_ = name; | 135 return it; |
137 return it; | 136 } |
| 137 return LookupIterator(receiver, name, configuration); |
138 } | 138 } |
139 | 139 |
140 static LookupIterator PropertyOrElement( | 140 static LookupIterator PropertyOrElement( |
141 Isolate* isolate, Handle<Object> receiver, Handle<Name> name, | 141 Isolate* isolate, Handle<Object> receiver, Handle<Name> name, |
142 Handle<JSReceiver> holder, Configuration configuration = DEFAULT) { | 142 Handle<JSReceiver> holder, Configuration configuration = DEFAULT) { |
143 name = isolate->factory()->InternalizeName(name); | |
144 uint32_t index; | 143 uint32_t index; |
145 LookupIterator it = | 144 if (name->AsArrayIndex(&index)) { |
146 name->AsArrayIndex(&index) | 145 LookupIterator it = |
147 ? LookupIterator(isolate, receiver, index, holder, configuration) | 146 LookupIterator(isolate, receiver, index, holder, configuration); |
148 : LookupIterator(receiver, name, holder, configuration); | 147 it.name_ = name; |
149 it.name_ = name; | 148 return it; |
150 return it; | 149 } |
| 150 return LookupIterator(receiver, name, holder, configuration); |
151 } | 151 } |
152 | 152 |
153 static LookupIterator PropertyOrElement( | 153 static LookupIterator PropertyOrElement( |
154 Isolate* isolate, Handle<Object> receiver, Handle<Object> key, | 154 Isolate* isolate, Handle<Object> receiver, Handle<Object> key, |
155 bool* success, Configuration configuration = DEFAULT); | 155 bool* success, Configuration configuration = DEFAULT); |
156 | 156 |
157 void Restart() { RestartInternal(InterceptorState::kUninitialized); } | 157 void Restart() { RestartInternal(InterceptorState::kUninitialized); } |
158 | 158 |
159 Isolate* isolate() const { return isolate_; } | 159 Isolate* isolate() const { return isolate_; } |
160 State state() const { return state_; } | 160 State state() const { return state_; } |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 Handle<JSReceiver> holder_; | 335 Handle<JSReceiver> holder_; |
336 const Handle<JSReceiver> initial_holder_; | 336 const Handle<JSReceiver> initial_holder_; |
337 uint32_t number_; | 337 uint32_t number_; |
338 }; | 338 }; |
339 | 339 |
340 | 340 |
341 } // namespace internal | 341 } // namespace internal |
342 } // namespace v8 | 342 } // namespace v8 |
343 | 343 |
344 #endif // V8_LOOKUP_H_ | 344 #endif // V8_LOOKUP_H_ |
OLD | NEW |