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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 Isolate* isolate() const { return isolate_; } | 161 Isolate* isolate() const { return isolate_; } |
162 State state() const { return state_; } | 162 State state() const { return state_; } |
163 | 163 |
164 Handle<Name> name() const { | 164 Handle<Name> name() const { |
165 DCHECK(!IsElement()); | 165 DCHECK(!IsElement()); |
166 return name_; | 166 return name_; |
167 } | 167 } |
168 Handle<Name> GetName() { | 168 Handle<Name> GetName() { |
169 if (name_.is_null()) { | 169 if (name_.is_null()) { |
170 DCHECK(IsElement()); | 170 DCHECK(IsElement()); |
171 name_ = isolate_->factory()->Uint32ToString(index_); | 171 name_ = factory()->Uint32ToString(index_); |
172 } | 172 } |
173 return name_; | 173 return name_; |
174 } | 174 } |
175 uint32_t index() const { return index_; } | 175 uint32_t index() const { return index_; } |
176 | 176 |
177 bool IsElement() const { return index_ != kMaxUInt32; } | 177 bool IsElement() const { return index_ != kMaxUInt32; } |
178 | 178 |
179 bool IsFound() const { return state_ != NOT_FOUND; } | 179 bool IsFound() const { return state_ != NOT_FOUND; } |
180 void Next(); | 180 void Next(); |
181 void NotFound() { | 181 void NotFound() { |
182 has_property_ = false; | 182 has_property_ = false; |
183 state_ = NOT_FOUND; | 183 state_ = NOT_FOUND; |
184 } | 184 } |
185 | 185 |
| 186 Heap* heap() const { return isolate_->heap(); } |
186 Factory* factory() const { return isolate_->factory(); } | 187 Factory* factory() const { return isolate_->factory(); } |
187 Handle<Object> GetReceiver() const { return receiver_; } | 188 Handle<Object> GetReceiver() const { return receiver_; } |
188 Handle<JSObject> GetStoreTarget() const; | 189 Handle<JSObject> GetStoreTarget() const; |
189 bool is_dictionary_holder() const { return holder_map_->is_dictionary_map(); } | 190 bool is_dictionary_holder() const { return holder_map_->is_dictionary_map(); } |
190 Handle<Map> transition_map() const { | 191 Handle<Map> transition_map() const { |
191 DCHECK_EQ(TRANSITION, state_); | 192 DCHECK_EQ(TRANSITION, state_); |
192 return Handle<Map>::cast(transition_); | 193 return Handle<Map>::cast(transition_); |
193 } | 194 } |
194 template <class T> | 195 template <class T> |
195 Handle<T> GetHolder() const { | 196 Handle<T> GetHolder() const { |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 Handle<JSReceiver> holder_; | 310 Handle<JSReceiver> holder_; |
310 Handle<Map> holder_map_; | 311 Handle<Map> holder_map_; |
311 const Handle<JSReceiver> initial_holder_; | 312 const Handle<JSReceiver> initial_holder_; |
312 uint32_t number_; | 313 uint32_t number_; |
313 }; | 314 }; |
314 | 315 |
315 | 316 |
316 } } // namespace v8::internal | 317 } } // namespace v8::internal |
317 | 318 |
318 #endif // V8_LOOKUP_H_ | 319 #endif // V8_LOOKUP_H_ |
OLD | NEW |