From 06d419f8a4598be49512c11a6fda912b64e37d58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Mon, 12 Jun 2017 10:48:46 +0200 Subject: [PATCH] deps: cherry-pick 866ee63 from upstream V8 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: https://github.com/nodejs/node/issues/13445 PR-URL: https://github.com/nodejs/node/pull/13515 Reviewed-By: James M Snell Reviewed-By: Anna Henningsen --- deps/v8/src/builtins/builtins-string-gen.cc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/deps/v8/src/builtins/builtins-string-gen.cc b/deps/v8/src/builtins/builtins-string-gen.cc index 25bf14ce2bd83d..ed559eadfdf911 100644 --- a/deps/v8/src/builtins/builtins-string-gen.cc +++ b/deps/v8/src/builtins/builtins-string-gen.cc @@ -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 =