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}

Fixes: #13445
PR-URL: #13515
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
targos authored and addaleax committed Jul 24, 2017
1 parent 8e96729 commit 06d419f
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 06d419f

Please sign in to comment.