Commit a09ae07f authored by danno's avatar danno Committed by Commit bot

[turbofan] Inline %_FixedArrayGet intrinsic.

Review URL: https://codereview.chromium.org/1223583003

Cr-Commit-Position: refs/heads/master@{#29438}
parent 76ea6ae7
...@@ -86,6 +86,8 @@ Reduction JSIntrinsicLowering::Reduce(Node* node) { ...@@ -86,6 +86,8 @@ Reduction JSIntrinsicLowering::Reduce(Node* node) {
return ReduceValueOf(node); return ReduceValueOf(node);
case Runtime::kInlineIsMinusZero: case Runtime::kInlineIsMinusZero:
return ReduceIsMinusZero(node); return ReduceIsMinusZero(node);
case Runtime::kInlineFixedArrayGet:
return ReduceFixedArrayGet(node);
case Runtime::kInlineFixedArraySet: case Runtime::kInlineFixedArraySet:
return ReduceFixedArraySet(node); return ReduceFixedArraySet(node);
case Runtime::kInlineGetTypeFeedbackVector: case Runtime::kInlineGetTypeFeedbackVector:
...@@ -447,6 +449,17 @@ Reduction JSIntrinsicLowering::ReduceIsMinusZero(Node* node) { ...@@ -447,6 +449,17 @@ Reduction JSIntrinsicLowering::ReduceIsMinusZero(Node* node) {
} }
Reduction JSIntrinsicLowering::ReduceFixedArrayGet(Node* node) {
Node* base = node->InputAt(0);
Node* index = node->InputAt(1);
Node* effect = NodeProperties::GetEffectInput(node);
Node* control = NodeProperties::GetControlInput(node);
return Change(
node, simplified()->LoadElement(AccessBuilder::ForFixedArrayElement()),
base, index, effect, control);
}
Reduction JSIntrinsicLowering::ReduceFixedArraySet(Node* node) { Reduction JSIntrinsicLowering::ReduceFixedArraySet(Node* node) {
Node* base = node->InputAt(0); Node* base = node->InputAt(0);
Node* index = node->InputAt(1); Node* index = node->InputAt(1);
...@@ -553,6 +566,19 @@ Reduction JSIntrinsicLowering::Change(Node* node, const Operator* op, Node* a, ...@@ -553,6 +566,19 @@ Reduction JSIntrinsicLowering::Change(Node* node, const Operator* op, Node* a,
} }
Reduction JSIntrinsicLowering::Change(Node* node, const Operator* op, Node* a,
Node* b, Node* c, Node* d) {
node->set_op(op);
node->ReplaceInput(0, a);
node->ReplaceInput(1, b);
node->ReplaceInput(2, c);
node->ReplaceInput(3, d);
node->TrimInputCount(4);
RelaxControls(node);
return Changed(node);
}
Reduction JSIntrinsicLowering::ChangeToUndefined(Node* node, Node* effect) { Reduction JSIntrinsicLowering::ChangeToUndefined(Node* node, Node* effect) {
ReplaceWithValue(node, jsgraph()->UndefinedConstant(), effect); ReplaceWithValue(node, jsgraph()->UndefinedConstant(), effect);
return Changed(node); return Changed(node);
......
...@@ -53,6 +53,7 @@ class JSIntrinsicLowering final : public AdvancedReducer { ...@@ -53,6 +53,7 @@ class JSIntrinsicLowering final : public AdvancedReducer {
Reduction ReduceStringGetLength(Node* node); Reduction ReduceStringGetLength(Node* node);
Reduction ReduceUnLikely(Node* node, BranchHint hint); Reduction ReduceUnLikely(Node* node, BranchHint hint);
Reduction ReduceValueOf(Node* node); Reduction ReduceValueOf(Node* node);
Reduction ReduceFixedArrayGet(Node* node);
Reduction ReduceFixedArraySet(Node* node); Reduction ReduceFixedArraySet(Node* node);
Reduction ReduceGetTypeFeedbackVector(Node* node); Reduction ReduceGetTypeFeedbackVector(Node* node);
Reduction ReduceGetCallerJSFunction(Node* node); Reduction ReduceGetCallerJSFunction(Node* node);
...@@ -62,6 +63,8 @@ class JSIntrinsicLowering final : public AdvancedReducer { ...@@ -62,6 +63,8 @@ class JSIntrinsicLowering final : public AdvancedReducer {
Reduction Change(Node* node, const Operator* op); Reduction Change(Node* node, const Operator* op);
Reduction Change(Node* node, const Operator* op, Node* a, Node* b); Reduction Change(Node* node, const Operator* op, Node* a, Node* b);
Reduction Change(Node* node, const Operator* op, Node* a, Node* b, Node* c); Reduction Change(Node* node, const Operator* op, Node* a, Node* b, Node* c);
Reduction Change(Node* node, const Operator* op, Node* a, Node* b, Node* c,
Node* d);
Reduction ChangeToUndefined(Node* node, Node* effect = nullptr); Reduction ChangeToUndefined(Node* node, Node* effect = nullptr);
Graph* graph() const; Graph* graph() const;
......
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