Commit 03788c05 authored by Marja Hölttä's avatar Marja Hölttä Committed by Commit Bot

[Map::TransitionToDataProperty speed] Streamline TransitionsAccessor::IsMatchingMap

Should help the case where the single existing transition matches.

BUG=v8:8547

Change-Id: Ic459357a10311346499ea054447d6cc42352fc0d
Reviewed-on: https://chromium-review.googlesource.com/c/1363133Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58090}
parent 190a4450
......@@ -307,6 +307,11 @@ class PropertyDetails {
return AttributesField::decode(value_);
}
bool HasKindAndAttributes(PropertyKind kind, PropertyAttributes attributes) {
return (value_ & (KindField::kMask | AttributesField::kMask)) ==
(KindField::encode(kind) | AttributesField::encode(attributes));
}
int dictionary_index() const {
return DictionaryStorageField::decode(value_);
}
......
......@@ -305,8 +305,8 @@ bool TransitionsAccessor::IsMatchingMap(Map target, Name name,
DescriptorArray descriptors = target->instance_descriptors();
Name key = descriptors->GetKey(descriptor);
if (key != name) return false;
PropertyDetails details = descriptors->GetDetails(descriptor);
return (details.kind() == kind && details.attributes() == attributes);
return descriptors->GetDetails(descriptor)
.HasKindAndAttributes(kind, attributes);
}
// static
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment