[turbofan] Inline %_FixedArrayGet intrinsic.

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

Cr-Commit-Position: refs/heads/master@{#29438}
This commit is contained in:
danno 2015-07-02 02:04:31 -07:00 committed by Commit bot
parent 76ea6ae744
commit a09ae07f3d
2 changed files with 29 additions and 0 deletions

View File

@ -86,6 +86,8 @@ Reduction JSIntrinsicLowering::Reduce(Node* node) {
return ReduceValueOf(node);
case Runtime::kInlineIsMinusZero:
return ReduceIsMinusZero(node);
case Runtime::kInlineFixedArrayGet:
return ReduceFixedArrayGet(node);
case Runtime::kInlineFixedArraySet:
return ReduceFixedArraySet(node);
case Runtime::kInlineGetTypeFeedbackVector:
@ -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) {
Node* base = node->InputAt(0);
Node* index = node->InputAt(1);
@ -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) {
ReplaceWithValue(node, jsgraph()->UndefinedConstant(), effect);
return Changed(node);

View File

@ -53,6 +53,7 @@ class JSIntrinsicLowering final : public AdvancedReducer {
Reduction ReduceStringGetLength(Node* node);
Reduction ReduceUnLikely(Node* node, BranchHint hint);
Reduction ReduceValueOf(Node* node);
Reduction ReduceFixedArrayGet(Node* node);
Reduction ReduceFixedArraySet(Node* node);
Reduction ReduceGetTypeFeedbackVector(Node* node);
Reduction ReduceGetCallerJSFunction(Node* node);
@ -62,6 +63,8 @@ class JSIntrinsicLowering final : public AdvancedReducer {
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, Node* c);
Reduction Change(Node* node, const Operator* op, Node* a, Node* b, Node* c,
Node* d);
Reduction ChangeToUndefined(Node* node, Node* effect = nullptr);
Graph* graph() const;