Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(651)

Side by Side Diff: src/lookup.h

Issue 1147863002: Prepare GetProperty(Attributes)WithInterceptor to support elements (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 initial_holder_(holder_), 119 initial_holder_(holder_),
120 number_(DescriptorArray::kNotFound) { 120 number_(DescriptorArray::kNotFound) {
121 // kMaxUInt32 isn't a valid index. 121 // kMaxUInt32 isn't a valid index.
122 DCHECK_NE(kMaxUInt32, index_); 122 DCHECK_NE(kMaxUInt32, index_);
123 Next(); 123 Next();
124 } 124 }
125 125
126 Isolate* isolate() const { return isolate_; } 126 Isolate* isolate() const { return isolate_; }
127 State state() const { return state_; } 127 State state() const { return state_; }
128 128
129 Handle<Name> name() const { return name_; } 129 Handle<Name> name() const {
130 DCHECK(!IsElement());
131 return name_;
132 }
133 Handle<Name> GetName() {
134 if (name_.is_null()) {
135 DCHECK(IsElement());
136 name_ = isolate_->factory()->Uint32ToString(index_);
137 }
138 return name_;
139 }
130 uint32_t index() const { return index_; } 140 uint32_t index() const { return index_; }
131 141
132 bool IsElement() const { return index_ != kMaxUInt32; } 142 bool IsElement() const { return index_ != kMaxUInt32; }
133 143
134 bool IsFound() const { return state_ != NOT_FOUND; } 144 bool IsFound() const { return state_ != NOT_FOUND; }
135 void Next(); 145 void Next();
136 void NotFound() { 146 void NotFound() {
137 has_property_ = false; 147 has_property_ = false;
138 state_ = NOT_FOUND; 148 state_ = NOT_FOUND;
139 } 149 }
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 Handle<JSReceiver> holder_; 272 Handle<JSReceiver> holder_;
263 Handle<Map> holder_map_; 273 Handle<Map> holder_map_;
264 const Handle<JSReceiver> initial_holder_; 274 const Handle<JSReceiver> initial_holder_;
265 uint32_t number_; 275 uint32_t number_;
266 }; 276 };
267 277
268 278
269 } } // namespace v8::internal 279 } } // namespace v8::internal
270 280
271 #endif // V8_LOOKUP_H_ 281 #endif // V8_LOOKUP_H_
OLDNEW
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698