From 13fca70d9968976b06ba0f1bc3ea1e4465fe0676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Mon, 12 Jun 2017 10:27:03 +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 --- 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 =