Commit 8f8b452f authored by Mike Stanton's avatar Mike Stanton Committed by Commit Bot

[TurboFan] Enable Array.prototype.some inlining

Along with double holey support.

Bug: v8:1956
Change-Id: Ic7fb233c57cbc3d43a5a6190f5d166686ae86df7
Reviewed-on: https://chromium-review.googlesource.com/874476Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Michael Stanton <mvstanton@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50712}
parent 0ca3078d
...@@ -2517,11 +2517,6 @@ Reduction JSCallReducer::ReduceArraySome(Handle<JSFunction> function, ...@@ -2517,11 +2517,6 @@ Reduction JSCallReducer::ReduceArraySome(Handle<JSFunction> function,
const ElementsKind kind = receiver_maps[0]->elements_kind(); const ElementsKind kind = receiver_maps[0]->elements_kind();
// TODO(pwong): Handle holey double elements kinds.
if (IsDoubleElementsKind(kind) && IsHoleyElementsKind(kind)) {
return NoChange();
}
for (Handle<Map> receiver_map : receiver_maps) { for (Handle<Map> receiver_map : receiver_maps) {
if (!CanInlineArrayIteratingBuiltin(receiver_map)) return NoChange(); if (!CanInlineArrayIteratingBuiltin(receiver_map)) return NoChange();
// We can handle different maps, as long as their elements kind are the // We can handle different maps, as long as their elements kind are the
...@@ -2621,8 +2616,13 @@ Reduction JSCallReducer::ReduceArraySome(Handle<JSFunction> function, ...@@ -2621,8 +2616,13 @@ Reduction JSCallReducer::ReduceArraySome(Handle<JSFunction> function,
if (IsHoleyElementsKind(kind)) { if (IsHoleyElementsKind(kind)) {
// Holey elements kind require a hole check and skipping of the element in // Holey elements kind require a hole check and skipping of the element in
// the case of a hole. // the case of a hole.
Node* check = graph()->NewNode(simplified()->ReferenceEqual(), element, Node* check;
jsgraph()->TheHoleConstant()); if (IsDoubleElementsKind(kind)) {
check = graph()->NewNode(simplified()->NumberIsFloat64Hole(), element);
} else {
check = graph()->NewNode(simplified()->ReferenceEqual(), element,
jsgraph()->TheHoleConstant());
}
Node* branch = Node* branch =
graph()->NewNode(common()->Branch(BranchHint::kFalse), check, control); graph()->NewNode(common()->Branch(BranchHint::kFalse), check, control);
hole_true = graph()->NewNode(common()->IfTrue(), branch); hole_true = graph()->NewNode(common()->IfTrue(), branch);
...@@ -3148,6 +3148,8 @@ Reduction JSCallReducer::ReduceJSCall(Node* node) { ...@@ -3148,6 +3148,8 @@ Reduction JSCallReducer::ReduceJSCall(Node* node) {
return ReduceArrayFind(ArrayFindVariant::kFindIndex, function, node); return ReduceArrayFind(ArrayFindVariant::kFindIndex, function, node);
case Builtins::kArrayEvery: case Builtins::kArrayEvery:
return ReduceArrayEvery(function, node); return ReduceArrayEvery(function, node);
case Builtins::kArraySome:
return ReduceArraySome(function, node);
case Builtins::kArrayPrototypePush: case Builtins::kArrayPrototypePush:
return ReduceArrayPrototypePush(node); return ReduceArrayPrototypePush(node);
case Builtins::kArrayPrototypePop: case Builtins::kArrayPrototypePop:
......
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