Commit 4832e990 authored by jarin's avatar jarin Committed by Commit bot

[turbofan] Do not lower (One|Two)ByteSeqString(Get|Set)Char intrinsics.

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

Cr-Commit-Position: refs/heads/master@{#32028}
parent 67b99f7e
......@@ -74,16 +74,8 @@ Reduction JSIntrinsicLowering::Reduce(Node* node) {
return ReduceMathFloor(node);
case Runtime::kInlineMathSqrt:
return ReduceMathSqrt(node);
case Runtime::kInlineOneByteSeqStringGetChar:
return ReduceSeqStringGetChar(node, String::ONE_BYTE_ENCODING);
case Runtime::kInlineOneByteSeqStringSetChar:
return ReduceSeqStringSetChar(node, String::ONE_BYTE_ENCODING);
case Runtime::kInlineStringGetLength:
return ReduceStringGetLength(node);
case Runtime::kInlineTwoByteSeqStringGetChar:
return ReduceSeqStringGetChar(node, String::TWO_BYTE_ENCODING);
case Runtime::kInlineTwoByteSeqStringSetChar:
return ReduceSeqStringSetChar(node, String::TWO_BYTE_ENCODING);
case Runtime::kInlineValueOf:
return ReduceValueOf(node);
case Runtime::kInlineIsMinusZero:
......@@ -336,44 +328,6 @@ Reduction JSIntrinsicLowering::ReduceMathSqrt(Node* node) {
}
Reduction JSIntrinsicLowering::ReduceSeqStringGetChar(
Node* node, String::Encoding encoding) {
Node* effect = NodeProperties::GetEffectInput(node);
Node* control = NodeProperties::GetControlInput(node);
RelaxControls(node);
node->ReplaceInput(2, effect);
node->ReplaceInput(3, control);
node->TrimInputCount(4);
NodeProperties::ChangeOp(
node,
simplified()->LoadElement(AccessBuilder::ForSeqStringChar(encoding)));
return Changed(node);
}
Reduction JSIntrinsicLowering::ReduceSeqStringSetChar(
Node* node, String::Encoding encoding) {
// Note: The intrinsic has a strange argument order, so we need to reshuffle.
Node* index = NodeProperties::GetValueInput(node, 0);
Node* chr = NodeProperties::GetValueInput(node, 1);
Node* string = NodeProperties::GetValueInput(node, 2);
Node* effect = NodeProperties::GetEffectInput(node);
Node* control = NodeProperties::GetControlInput(node);
ReplaceWithValue(node, string, node);
NodeProperties::RemoveType(node);
node->ReplaceInput(0, string);
node->ReplaceInput(1, index);
node->ReplaceInput(2, chr);
node->ReplaceInput(3, effect);
node->ReplaceInput(4, control);
node->TrimInputCount(5);
NodeProperties::ChangeOp(
node,
simplified()->StoreElement(AccessBuilder::ForSeqStringChar(encoding)));
return Changed(node);
}
Reduction JSIntrinsicLowering::ReduceStringGetLength(Node* node) {
Node* value = NodeProperties::GetValueInput(node, 0);
Node* effect = NodeProperties::GetEffectInput(node);
......
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