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

Side by Side Diff: src/lookup.cc

Issue 1975763002: [runtime] Make sure that LookupIterator::OWN always performs a HIDDEN lookup as well. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comment Created 4 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 | « src/lookup.h ('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/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
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
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
OLDNEW
« no previous file with comments | « src/lookup.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698