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

Unified Diff: src/lookup.cc

Issue 1675223002: Mark maps having a hidden prototype rather than maps of hidden prototypes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comment Created 4 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ic/ic.cc ('k') | src/mips/builtins-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lookup.cc
diff --git a/src/lookup.cc b/src/lookup.cc
index 106dc7ac04fa0098048586486467e72fc6a3af6b..58d9633b4b4ae06bb79ba4003444385394bfe3bc 100644
--- a/src/lookup.cc
+++ b/src/lookup.cc
@@ -122,7 +122,7 @@ Handle<Map> LookupIterator::GetReceiverMap() const {
Handle<JSObject> LookupIterator::GetStoreTarget() const {
if (receiver_->IsJSGlobalProxy()) {
- PrototypeIterator iter(isolate(), receiver_);
+ PrototypeIterator iter(isolate(), Handle<JSGlobalProxy>::cast(receiver_));
if (iter.IsAtEnd()) return Handle<JSGlobalProxy>::cast(receiver_);
return PrototypeIterator::GetCurrent<JSGlobalObject>(iter);
}
@@ -398,11 +398,13 @@ bool LookupIterator::HolderIsReceiverOrHiddenPrototype() const {
JSReceiver* current = JSReceiver::cast(*receiver_);
JSReceiver* object = *holder_;
if (current == object) return true;
- if (!object->map()->is_hidden_prototype()) return false;
+ if (!current->map()->has_hidden_prototype()) return false;
// JSProxy do not occur as hidden prototypes.
if (current->IsJSProxy()) return false;
- PrototypeIterator iter(isolate(), current);
- while (!iter.IsAtEnd(PrototypeIterator::END_AT_NON_HIDDEN)) {
+ PrototypeIterator iter(isolate(), current,
+ PrototypeIterator::START_AT_PROTOTYPE,
+ PrototypeIterator::END_AT_NON_HIDDEN);
+ while (!iter.IsAtEnd()) {
if (iter.GetCurrent<JSReceiver>() == object) return true;
iter.Advance();
}
@@ -553,19 +555,17 @@ JSReceiver* LookupIterator::NextHolder(Map* map) {
DisallowHeapAllocation no_gc;
if (!map->prototype()->IsJSReceiver()) return NULL;
- JSReceiver* next = JSReceiver::cast(map->prototype());
- DCHECK(!next->map()->IsJSGlobalObjectMap() ||
- next->map()->is_hidden_prototype());
+ DCHECK(!map->IsJSGlobalProxyMap() || map->has_hidden_prototype());
if (!check_prototype_chain() &&
- !(check_hidden() && next->map()->is_hidden_prototype()) &&
+ !(check_hidden() && map->has_hidden_prototype()) &&
// Always lookup behind the JSGlobalProxy into the JSGlobalObject, even
// when not checking other hidden prototypes.
!map->IsJSGlobalProxyMap()) {
return NULL;
}
- return next;
+ return JSReceiver::cast(map->prototype());
}
LookupIterator::State LookupIterator::NotFound(JSReceiver* const holder) const {
« no previous file with comments | « src/ic/ic.cc ('k') | src/mips/builtins-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698