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

Side by Side Diff: src/js/array.js

Issue 2146293003: [builtins] implement Array.prototype.includes in TurboFan (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 (function(global, utils, extrasUtils) { 5 (function(global, utils, extrasUtils) {
6 6
7 "use strict"; 7 "use strict";
8 8
9 %CheckIsBootstrapping(); 9 %CheckIsBootstrapping();
10 10
(...skipping 1489 matching lines...) Expand 10 before | Expand all | Expand 10 after
1500 CHECK_OBJECT_COERCIBLE(this, "Array.prototype.fill"); 1500 CHECK_OBJECT_COERCIBLE(this, "Array.prototype.fill");
1501 1501
1502 var array = TO_OBJECT(this); 1502 var array = TO_OBJECT(this);
1503 var length = TO_LENGTH(array.length); 1503 var length = TO_LENGTH(array.length);
1504 1504
1505 return InnerArrayFill(value, start, end, array, length); 1505 return InnerArrayFill(value, start, end, array, length);
1506 } 1506 }
1507 1507
1508 1508
1509 function InnerArrayIncludes(searchElement, fromIndex, array, length) { 1509 function InnerArrayIncludes(searchElement, fromIndex, array, length) {
1510 %GlobalPrint("InnerArrayIncludes\n");
caitp 2016/07/14 18:01:18 debug edit from early on in this branch, to be rem
1510 if (length === 0) { 1511 if (length === 0) {
1511 return false; 1512 return false;
1512 } 1513 }
1513 1514
1514 var n = TO_INTEGER(fromIndex); 1515 var n = TO_INTEGER(fromIndex);
1515 1516
1516 var k; 1517 var k;
1517 if (n >= 0) { 1518 if (n >= 0) {
1518 k = n; 1519 k = n;
1519 } else { 1520 } else {
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
1760 %InstallToContext([ 1761 %InstallToContext([
1761 "array_pop", ArrayPop, 1762 "array_pop", ArrayPop,
1762 "array_push", ArrayPush, 1763 "array_push", ArrayPush,
1763 "array_shift", ArrayShift, 1764 "array_shift", ArrayShift,
1764 "array_splice", ArraySplice, 1765 "array_splice", ArraySplice,
1765 "array_slice", ArraySlice, 1766 "array_slice", ArraySlice,
1766 "array_unshift", ArrayUnshift, 1767 "array_unshift", ArrayUnshift,
1767 ]); 1768 ]);
1768 1769
1769 }); 1770 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698