| 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/deoptimizer.h" | 8 #include "src/deoptimizer.h" |
| 9 #include "src/lookup.h" | 9 #include "src/lookup.h" |
| 10 #include "src/lookup-inl.h" | 10 #include "src/lookup-inl.h" |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 PrototypeIterator::START_AT_RECEIVER); | 266 PrototypeIterator::START_AT_RECEIVER); |
| 267 do { | 267 do { |
| 268 if (JSReceiver::cast(iter.GetCurrent()) == holder) return true; | 268 if (JSReceiver::cast(iter.GetCurrent()) == holder) return true; |
| 269 DCHECK(!current->IsJSProxy()); | 269 DCHECK(!current->IsJSProxy()); |
| 270 iter.Advance(); | 270 iter.Advance(); |
| 271 } while (!iter.IsAtEnd(PrototypeIterator::END_AT_NON_HIDDEN)); | 271 } while (!iter.IsAtEnd(PrototypeIterator::END_AT_NON_HIDDEN)); |
| 272 return false; | 272 return false; |
| 273 } | 273 } |
| 274 | 274 |
| 275 | 275 |
| 276 bool LookupIterator::HolderIsNonGlobalHiddenPrototype() const { | |
| 277 if (!HolderIsReceiverOrHiddenPrototype()) return false; | |
| 278 Handle<Object> receiver = GetReceiver(); | |
| 279 Handle<JSReceiver> holder = GetHolder<JSReceiver>(); | |
| 280 if (receiver.is_identical_to(holder)) return false; | |
| 281 if (receiver->IsJSGlobalProxy()) return !holder->IsJSGlobalObject(); | |
| 282 return true; | |
| 283 } | |
| 284 | |
| 285 | |
| 286 Handle<Object> LookupIterator::FetchValue() const { | 276 Handle<Object> LookupIterator::FetchValue() const { |
| 287 Object* result = NULL; | 277 Object* result = NULL; |
| 288 Handle<JSObject> holder = GetHolder<JSObject>(); | 278 Handle<JSObject> holder = GetHolder<JSObject>(); |
| 289 switch (property_encoding_) { | 279 switch (property_encoding_) { |
| 290 case DICTIONARY: | 280 case DICTIONARY: |
| 291 result = holder->property_dictionary()->ValueAt(number_); | 281 result = holder->property_dictionary()->ValueAt(number_); |
| 292 if (holder->IsGlobalObject()) { | 282 if (holder->IsGlobalObject()) { |
| 293 result = PropertyCell::cast(result)->value(); | 283 result = PropertyCell::cast(result)->value(); |
| 294 } | 284 } |
| 295 break; | 285 break; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 DCHECK_EQ(v8::internal::CONSTANT, property_details_.type()); | 367 DCHECK_EQ(v8::internal::CONSTANT, property_details_.type()); |
| 378 } | 368 } |
| 379 } | 369 } |
| 380 | 370 |
| 381 | 371 |
| 382 void LookupIterator::InternalizeName() { | 372 void LookupIterator::InternalizeName() { |
| 383 if (name_->IsUniqueName()) return; | 373 if (name_->IsUniqueName()) return; |
| 384 name_ = factory()->InternalizeString(Handle<String>::cast(name_)); | 374 name_ = factory()->InternalizeString(Handle<String>::cast(name_)); |
| 385 } | 375 } |
| 386 } } // namespace v8::internal | 376 } } // namespace v8::internal |
| OLD | NEW |