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/lookup.h" | 5 #include "src/lookup.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/elements.h" | 9 #include "src/elements.h" |
10 #include "src/field-type.h" | 10 #include "src/field-type.h" |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 case InterceptorState::kProcessNonMasking: | 630 case InterceptorState::kProcessNonMasking: |
631 return false; | 631 return false; |
632 } | 632 } |
633 } | 633 } |
634 return interceptor_state_ == InterceptorState::kProcessNonMasking; | 634 return interceptor_state_ == InterceptorState::kProcessNonMasking; |
635 } | 635 } |
636 | 636 |
637 JSReceiver* LookupIterator::NextHolder(Map* map) { | 637 JSReceiver* LookupIterator::NextHolder(Map* map) { |
638 DisallowHeapAllocation no_gc; | 638 DisallowHeapAllocation no_gc; |
639 if (map->prototype() == heap()->null_value()) return NULL; | 639 if (map->prototype() == heap()->null_value()) return NULL; |
640 | 640 if (!check_prototype_chain() && !map->has_hidden_prototype()) return NULL; |
641 DCHECK(!map->IsJSGlobalProxyMap() || map->has_hidden_prototype()); | |
642 | |
643 if (!check_prototype_chain() && | |
644 !(check_hidden() && map->has_hidden_prototype()) && | |
645 // Always lookup behind the JSGlobalProxy into the JSGlobalObject, even | |
646 // when not checking other hidden prototypes. | |
647 !map->IsJSGlobalProxyMap()) { | |
648 return NULL; | |
649 } | |
650 | |
651 return JSReceiver::cast(map->prototype()); | 641 return JSReceiver::cast(map->prototype()); |
652 } | 642 } |
653 | 643 |
654 LookupIterator::State LookupIterator::NotFound(JSReceiver* const holder) const { | 644 LookupIterator::State LookupIterator::NotFound(JSReceiver* const holder) const { |
655 DCHECK(!IsElement()); | 645 DCHECK(!IsElement()); |
656 if (!holder->IsJSTypedArray() || !name_->IsString()) return NOT_FOUND; | 646 if (!holder->IsJSTypedArray() || !name_->IsString()) return NOT_FOUND; |
657 | 647 |
658 Handle<String> name_string = Handle<String>::cast(name_); | 648 Handle<String> name_string = Handle<String>::cast(name_); |
659 if (name_string->length() == 0) return NOT_FOUND; | 649 if (name_string->length() == 0) return NOT_FOUND; |
660 | 650 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 case v8::internal::kAccessor: | 750 case v8::internal::kAccessor: |
761 return ACCESSOR; | 751 return ACCESSOR; |
762 } | 752 } |
763 | 753 |
764 UNREACHABLE(); | 754 UNREACHABLE(); |
765 return state_; | 755 return state_; |
766 } | 756 } |
767 | 757 |
768 } // namespace internal | 758 } // namespace internal |
769 } // namespace v8 | 759 } // namespace v8 |
OLD | NEW |