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

Side by Side Diff: src/lookup.cc

Issue 389353002: Remove hole handling since holes cannot occur in JSObjects anymore. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « src/hydrogen.cc ('k') | src/objects.cc » ('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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/bootstrapper.h" 7 #include "src/bootstrapper.h"
8 #include "src/lookup.h" 8 #include "src/lookup.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 bool LookupIterator::HasProperty() { 107 bool LookupIterator::HasProperty() {
108 ASSERT_EQ(PROPERTY, state_); 108 ASSERT_EQ(PROPERTY, state_);
109 ASSERT(is_guaranteed_to_have_holder()); 109 ASSERT(is_guaranteed_to_have_holder());
110 110
111 if (property_encoding_ == DICTIONARY) { 111 if (property_encoding_ == DICTIONARY) {
112 Handle<JSObject> holder = GetHolder(); 112 Handle<JSObject> holder = GetHolder();
113 number_ = holder->property_dictionary()->FindEntry(name_); 113 number_ = holder->property_dictionary()->FindEntry(name_);
114 if (number_ == NameDictionary::kNotFound) return false; 114 if (number_ == NameDictionary::kNotFound) return false;
115 115
116 property_details_ = GetHolder()->property_dictionary()->DetailsAt(number_); 116 property_details_ = GetHolder()->property_dictionary()->DetailsAt(number_);
117 // Holes in dictionary cells are absent values unless marked as read-only. 117 // Holes in dictionary cells are absent values.
118 if (holder->IsGlobalObject() && 118 if (holder->IsGlobalObject() &&
119 (property_details_.IsDeleted() || 119 (property_details_.IsDeleted() || FetchValue()->IsTheHole())) {
120 (!property_details_.IsReadOnly() && FetchValue()->IsTheHole()))) {
121 return false; 120 return false;
122 } 121 }
123 } else { 122 } else {
124 property_details_ = holder_map_->instance_descriptors()->GetDetails( 123 property_details_ = holder_map_->instance_descriptors()->GetDetails(
125 number_); 124 number_);
126 } 125 }
127 126
128 switch (property_details_.type()) { 127 switch (property_details_.type()) {
129 case v8::internal::FIELD: 128 case v8::internal::FIELD:
130 case v8::internal::NORMAL: 129 case v8::internal::NORMAL:
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 ASSERT(has_property_); 170 ASSERT(has_property_);
172 ASSERT_EQ(ACCESSOR, property_kind_); 171 ASSERT_EQ(ACCESSOR, property_kind_);
173 return FetchValue(); 172 return FetchValue();
174 } 173 }
175 174
176 175
177 Handle<Object> LookupIterator::GetDataValue() const { 176 Handle<Object> LookupIterator::GetDataValue() const {
178 ASSERT(has_property_); 177 ASSERT(has_property_);
179 ASSERT_EQ(DATA, property_kind_); 178 ASSERT_EQ(DATA, property_kind_);
180 Handle<Object> value = FetchValue(); 179 Handle<Object> value = FetchValue();
181 if (value->IsTheHole()) {
182 ASSERT(property_details_.IsReadOnly());
183 return factory()->undefined_value();
184 }
185 return value; 180 return value;
186 } 181 }
187 182
188 183
189 } } // namespace v8::internal 184 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698