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

Side by Side Diff: test/mjsunit/array-shift5.js

Issue 2874453002: [turbofan] Boost performance of Array.prototype.shift by 4x. (Closed)
Patch Set: Cosmetic fixes. Created 3 years, 7 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 | « src/objects.h ('k') | 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
(Empty)
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
3 // found in the LICENSE file.
4
5 // Flags: --allow-natives-syntax
6
7 (function() {
8 function doShift(a) { return a.shift(); }
9
10 function test() {
11 var a = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16];
12 assertEquals(0, doShift(a));
13 assertEquals([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16], a);
14 }
15
16 test();
17 test();
18 %OptimizeFunctionOnNextCall(doShift);
19 test();
20 })();
21
22 (function() {
23 function doShift(a) { return a.shift(); }
24
25 function test() {
26 var a = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16.1];
27 assertEquals(0, doShift(a));
28 assertEquals([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16.1], a);
29 }
30
31 test();
32 test();
33 %OptimizeFunctionOnNextCall(doShift);
34 test();
35 })();
36
37 (function() {
38 function doShift(a) { return a.shift(); }
39
40 function test() {
41 var a = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,"16"];
42 assertEquals(0, doShift(a));
43 assertEquals([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,"16"], a);
44 }
45
46 test();
47 test();
48 %OptimizeFunctionOnNextCall(doShift);
49 test();
50 })();
OLDNEW
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698