Commit 887583a1 authored by bmeurer's avatar bmeurer Committed by Commit bot

[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}
parent 6f94976b
......@@ -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)) {
......
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