[turbofan] Use CheckMaps for the COW check on elements.
Use a single CheckMaps node instead of the sequence of LoadField, ReferenceEqual and CheckIf. This also makes it easier to eliminate the COW check if there are multiple of them in a row. R=yangguo@chromium.org Review-Url: https://codereview.chromium.org/2216453002 Cr-Commit-Position: refs/heads/master@{#38321}
This commit is contained in:
parent
6f94976b02
commit
887583a15a
@ -972,13 +972,9 @@ JSNativeContextSpecialization::BuildElementAccess(
|
||||
// Don't try to store to a copy-on-write backing store.
|
||||
if (access_mode == AccessMode::kStore &&
|
||||
IsFastSmiOrObjectElementsKind(elements_kind)) {
|
||||
Node* elements_map = effect =
|
||||
graph()->NewNode(simplified()->LoadField(AccessBuilder::ForMap()),
|
||||
elements, effect, control);
|
||||
Node* check = graph()->NewNode(
|
||||
simplified()->ReferenceEqual(Type::Any()), elements_map,
|
||||
jsgraph()->HeapConstant(factory()->fixed_array_map()));
|
||||
effect = graph()->NewNode(simplified()->CheckIf(), check, effect, control);
|
||||
effect = graph()->NewNode(
|
||||
simplified()->CheckMaps(1), elements,
|
||||
jsgraph()->HeapConstant(factory()->fixed_array_map()), effect, control);
|
||||
}
|
||||
|
||||
if (IsFixedTypedArrayElementsKind(elements_kind)) {
|
||||
|
Loading…
Reference in New Issue
Block a user