Commit 3a0a4c13 authored by Jakob Gruber's avatar Jakob Gruber Committed by Commit Bot

[gasm] Port the Array.p.filter reduction

Bug: v8:9972
Change-Id: Ic1d18586c92536575c9bf4e7b3d2758b44acab30
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1954389
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarMichael Stanton <mvstanton@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65489}
parent 438df947
......@@ -589,6 +589,22 @@ TNode<Boolean> GraphAssembler::NumberIsFloat64Hole(TNode<Number> value) {
graph()->NewNode(simplified()->NumberIsFloat64Hole(), value));
}
TNode<Boolean> GraphAssembler::ToBoolean(TNode<Object> value) {
return AddNode<Boolean>(graph()->NewNode(simplified()->ToBoolean(), value));
}
TNode<FixedArrayBase> GraphAssembler::MaybeGrowFastElements(
ElementsKind kind, const FeedbackSource& feedback, TNode<JSArray> array,
TNode<FixedArrayBase> elements, TNode<Number> new_length,
TNode<Number> old_length) {
GrowFastElementsMode mode = IsDoubleElementsKind(kind)
? GrowFastElementsMode::kDoubleElements
: GrowFastElementsMode::kSmiOrObjectElements;
return AddNode<FixedArrayBase>(graph()->NewNode(
simplified()->MaybeGrowFastElements(mode, feedback), array, elements,
new_length, old_length, effect(), control()));
}
Node* GraphAssembler::TypeGuard(Type type, Node* value) {
return AddNode(
graph()->NewNode(common()->TypeGuard(type), value, effect(), control()));
......
......@@ -355,6 +355,13 @@ class V8_EXPORT_PRIVATE GraphAssembler {
TNode<Boolean> ObjectIsCallable(TNode<Object> value);
Node* CheckIf(Node* cond, DeoptimizeReason reason);
TNode<Boolean> NumberIsFloat64Hole(TNode<Number> value);
TNode<Boolean> ToBoolean(TNode<Object> value);
TNode<FixedArrayBase> MaybeGrowFastElements(ElementsKind kind,
const FeedbackSource& feedback,
TNode<JSArray> array,
TNode<FixedArrayBase> elements,
TNode<Number> new_length,
TNode<Number> old_length);
Node* TypeGuard(Type type, Node* value);
Node* Checkpoint(FrameState frame_state);
......
This diff is collapsed.
......@@ -209,12 +209,6 @@ class V8_EXPORT_PRIVATE JSCallReducer final : public AdvancedReducer {
Node* context, Node* effect,
Node* control);
// Returns the updated {to} node, and updates control and effect along the
// way.
Node* DoFilterPostCallbackWork(ElementsKind kind, Node** control,
Node** effect, Node* a, Node* to,
Node* element, Node* callback_value);
// If {fncallback} is not callable, throw a TypeError.
// {control} is altered, and new nodes {check_fail} and {check_throw} are
// returned. {check_fail} is the control branch where IsCallable failed,
......
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