Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(310)

Side by Side Diff: src/builtins/builtins-string-gen.cc

Issue 2923183002: [string] Re-enable result caching for String.p.split (Closed)
Patch Set: Tweak Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 the V8 project authors. All rights reserved. 1 // Copyright 2017 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/builtins/builtins-string-gen.h" 5 #include "src/builtins/builtins-string-gen.h"
6 6
7 #include "src/builtins/builtins-regexp-gen.h" 7 #include "src/builtins/builtins-regexp-gen.h"
8 #include "src/builtins/builtins-utils-gen.h" 8 #include "src/builtins/builtins-utils-gen.h"
9 #include "src/builtins/builtins.h" 9 #include "src/builtins/builtins.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after
1386 1386
1387 return CallBuiltin(Builtins::kRegExpSplit, context, separator, 1387 return CallBuiltin(Builtins::kRegExpSplit, context, separator,
1388 subject_string, limit); 1388 subject_string, limit);
1389 }, 1389 },
1390 [=](Node* fn) { 1390 [=](Node* fn) {
1391 Callable call_callable = CodeFactory::Call(isolate()); 1391 Callable call_callable = CodeFactory::Call(isolate());
1392 return CallJS(call_callable, context, fn, separator, receiver, limit); 1392 return CallJS(call_callable, context, fn, separator, receiver, limit);
1393 }); 1393 });
1394 1394
1395 // String and integer conversions. 1395 // String and integer conversions.
1396 // TODO(jgruber): The old implementation used Uint32Max instead of SmiMax -
1397 // but AFAIK there should not be a difference since arrays are capped at Smi
1398 // lengths.
1399 1396
1400 Node* const subject_string = ToString_Inline(context, receiver); 1397 Node* const subject_string = ToString_Inline(context, receiver);
1401 Node* const limit_number = 1398 Node* const limit_number =
1402 Select(IsUndefined(limit), [=]() { return SmiConstant(Smi::kMaxValue); }, 1399 Select(IsUndefined(limit), [=]() { return NumberConstant(kMaxUInt32); },
1403 [=]() { return ToUint32(context, limit); }, 1400 [=]() { return ToUint32(context, limit); },
1404 MachineRepresentation::kTagged); 1401 MachineRepresentation::kTagged);
1405 Node* const separator_string = ToString_Inline(context, separator); 1402 Node* const separator_string = ToString_Inline(context, separator);
1406 1403
1407 // Shortcut for {limit} == 0. 1404 // Shortcut for {limit} == 0.
1408 { 1405 {
1409 Label next(this); 1406 Label next(this);
1410 GotoIfNot(SmiEqual(limit_number, smi_zero), &next); 1407 GotoIfNot(SmiEqual(limit_number, smi_zero), &next);
1411 1408
1412 const ElementsKind kind = FAST_ELEMENTS; 1409 const ElementsKind kind = FAST_ELEMENTS;
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
1819 CallRuntime(Runtime::kThrowIncompatibleMethodReceiver, context, 1816 CallRuntime(Runtime::kThrowIncompatibleMethodReceiver, context,
1820 HeapConstant(factory()->NewStringFromAsciiChecked( 1817 HeapConstant(factory()->NewStringFromAsciiChecked(
1821 "String Iterator.prototype.next", TENURED)), 1818 "String Iterator.prototype.next", TENURED)),
1822 iterator); 1819 iterator);
1823 Unreachable(); 1820 Unreachable();
1824 } 1821 }
1825 } 1822 }
1826 1823
1827 } // namespace internal 1824 } // namespace internal
1828 } // namespace v8 1825 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698