Commit 866ee63c authored by jgruber's avatar jgruber Committed by Commit Bot

[string] Re-enable result caching for String.p.split

Runtime::kStringSplit's result caching is only enabled when limit equals
kMaxUInt32.

BUG=v8:6463

Review-Url: https://codereview.chromium.org/2923183002
Cr-Commit-Position: refs/heads/master@{#45724}
parent c22ca7f7
......@@ -1393,13 +1393,10 @@ TF_BUILTIN(StringPrototypeSplit, StringBuiltinsAssembler) {
});
// String and integer conversions.
// TODO(jgruber): The old implementation used Uint32Max instead of SmiMax -
// but AFAIK there should not be a difference since arrays are capped at Smi
// lengths.
Node* const subject_string = ToString_Inline(context, receiver);
Node* const limit_number =
Select(IsUndefined(limit), [=]() { return SmiConstant(Smi::kMaxValue); },
Select(IsUndefined(limit), [=]() { return NumberConstant(kMaxUInt32); },
[=]() { return ToUint32(context, limit); },
MachineRepresentation::kTagged);
Node* const separator_string = ToString_Inline(context, separator);
......
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