Skip to content

Commit

Permalink
deps: cherry-pick 866ee63 from upstream V8
Browse files Browse the repository at this point in the history
Original commit message:

    [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}

PR-URL: #13630
Fixes: #13445
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information
targos committed Jun 20, 2017
1 parent 8f907b6 commit 7cdcca7
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions deps/v8/src/builtins/builtins-string-gen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1190,14 +1190,11 @@ 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.

Callable tostring_callable = CodeFactory::ToString(isolate());
Node* const subject_string = CallStub(tostring_callable, 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 =
Expand Down

0 comments on commit 7cdcca7

Please sign in to comment.