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

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: 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') | src/objects.cc » ('J')
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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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_
OLDNEW
« no previous file with comments | « no previous file | src/objects.h » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698