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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 holder_(holder), | 113 holder_(holder), |
114 holder_map_(holder_->map(), isolate_), | 114 holder_map_(holder_->map(), isolate_), |
115 initial_holder_(holder_), | 115 initial_holder_(holder_), |
116 number_(DescriptorArray::kNotFound) { | 116 number_(DescriptorArray::kNotFound) { |
117 Next(); | 117 Next(); |
118 } | 118 } |
119 | 119 |
120 Isolate* isolate() const { return isolate_; } | 120 Isolate* isolate() const { return isolate_; } |
121 State state() const { return state_; } | 121 State state() const { return state_; } |
122 | 122 |
123 Handle<Name> name() const { return name_; } | 123 Handle<Name> name() const { |
| 124 DCHECK(!IsElement()); |
| 125 return name_; |
| 126 } |
| 127 Handle<String> GetName() { |
| 128 if (name_.is_null()) { |
| 129 DCHECK(IsElement()); |
| 130 name_ = isolate_->factory()->Uint32ToString(index_); |
| 131 } |
| 132 return Handle<String>::cast(name_); |
| 133 } |
124 uint32_t index() const { return index_; } | 134 uint32_t index() const { return index_; } |
125 | 135 |
126 bool IsElement() const { return index_ != kMaxUInt32; } | 136 bool IsElement() const { return index_ != kMaxUInt32; } |
127 | 137 |
128 bool IsFound() const { return state_ != NOT_FOUND; } | 138 bool IsFound() const { return state_ != NOT_FOUND; } |
129 void Next(); | 139 void Next(); |
130 void NotFound() { | 140 void NotFound() { |
131 has_property_ = false; | 141 has_property_ = false; |
132 state_ = NOT_FOUND; | 142 state_ = NOT_FOUND; |
133 } | 143 } |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 Handle<JSReceiver> holder_; | 266 Handle<JSReceiver> holder_; |
257 Handle<Map> holder_map_; | 267 Handle<Map> holder_map_; |
258 const Handle<JSReceiver> initial_holder_; | 268 const Handle<JSReceiver> initial_holder_; |
259 uint32_t number_; | 269 uint32_t number_; |
260 }; | 270 }; |
261 | 271 |
262 | 272 |
263 } } // namespace v8::internal | 273 } } // namespace v8::internal |
264 | 274 |
265 #endif // V8_LOOKUP_H_ | 275 #endif // V8_LOOKUP_H_ |
OLD | NEW |