| 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 #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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 return handle(Handle<HeapObject>::cast(receiver)->map()); | 46 return handle(Handle<HeapObject>::cast(receiver)->map()); |
| 47 } | 47 } |
| 48 | 48 |
| 49 | 49 |
| 50 bool LookupIterator::NextHolder() { | 50 bool LookupIterator::NextHolder() { |
| 51 if (holder_map_->prototype()->IsNull()) return false; | 51 if (holder_map_->prototype()->IsNull()) return false; |
| 52 | 52 |
| 53 Handle<JSReceiver> next(JSReceiver::cast(holder_map_->prototype())); | 53 Handle<JSReceiver> next(JSReceiver::cast(holder_map_->prototype())); |
| 54 | 54 |
| 55 if (!check_derived() && | 55 if (!check_derived() && |
| 56 // TODO(verwaest): Check if this is actually necessary currently. If it | 56 !(check_hidden() && |
| 57 // is, this should be handled by setting is_hidden_prototype on the | 57 // TODO(verwaest): Check if this is actually necessary currently. If it |
| 58 // global object behind the proxy. | 58 // is, this should be handled by setting is_hidden_prototype on the |
| 59 !holder_map_->IsJSGlobalProxyMap() && | 59 // global object behind the proxy. |
| 60 !next->map()->is_hidden_prototype()) { | 60 (holder_map_->IsJSGlobalProxyMap() || |
| 61 next->map()->is_hidden_prototype()))) { |
| 61 return false; | 62 return false; |
| 62 } | 63 } |
| 63 | 64 |
| 64 holder_map_ = handle(next->map()); | 65 holder_map_ = handle(next->map()); |
| 65 maybe_holder_ = next; | 66 maybe_holder_ = next; |
| 66 return true; | 67 return true; |
| 67 } | 68 } |
| 68 | 69 |
| 69 | 70 |
| 70 LookupIterator::State LookupIterator::LookupInHolder() { | 71 LookupIterator::State LookupIterator::LookupInHolder() { |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 ASSERT_EQ(ACCESSOR, property_kind_); | 183 ASSERT_EQ(ACCESSOR, property_kind_); |
| 183 return FetchValue(); | 184 return FetchValue(); |
| 184 } | 185 } |
| 185 | 186 |
| 186 | 187 |
| 187 Handle<Object> LookupIterator::GetDataValue() const { | 188 Handle<Object> LookupIterator::GetDataValue() const { |
| 188 ASSERT(has_property_); | 189 ASSERT(has_property_); |
| 189 ASSERT_EQ(DATA, property_kind_); | 190 ASSERT_EQ(DATA, property_kind_); |
| 190 Handle<Object> value = FetchValue(); | 191 Handle<Object> value = FetchValue(); |
| 191 if (value->IsTheHole()) { | 192 if (value->IsTheHole()) { |
| 192 ASSERT_EQ(DICTIONARY, property_encoding_); | |
| 193 ASSERT(GetHolder()->IsGlobalObject()); | |
| 194 ASSERT(property_details_.IsReadOnly()); | 193 ASSERT(property_details_.IsReadOnly()); |
| 195 return factory()->undefined_value(); | 194 return factory()->undefined_value(); |
| 196 } | 195 } |
| 197 return value; | 196 return value; |
| 198 } | 197 } |
| 199 | 198 |
| 200 | 199 |
| 201 } } // namespace v8::internal | 200 } } // namespace v8::internal |
| OLD | NEW |