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

Side by Side Diff: test/mjsunit/elide-double-hole-check-10.js

Issue 1066003003: Make sure builtins preserve guarantees about empty element array prototypes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: REBASE, fix nits. Created 5 years, 8 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/hydrogen.cc ('k') | test/mjsunit/elide-double-hole-check-11.js » ('j') | 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 2015 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 f1(a, i) {
8 return a[i] + 0.5;
9 }
10 var arr = [,0.0,2.5];
11 assertEquals(0.5, f1(arr, 1));
12 assertEquals(0.5, f1(arr, 1));
13 %OptimizeFunctionOnNextCall(f1);
14 assertEquals(0.5, f1(arr, 1));
15
16 // Trick crankshaft into accepting feedback with the array prototype
17 // map even though a call on that map was never made. optopush should
18 // refuse to inline the push call based on the danger that it's modifying
19 // the array prototype.
20 var push = Array.prototype.push;
21 var array_prototype = Array.prototype;
22
23 function optopush(a) {
24 push.call(a, 1);
25 }
26
27 function foo() {
28 optopush(array_prototype);
29 }
30
31 optopush([]);
32 optopush([]);
33 optopush([]);
34 %OptimizeFunctionOnNextCall(foo);
35 foo();
36 assertEquals(1.5, f1(arr, 0));
OLDNEW
« no previous file with comments | « src/hydrogen.cc ('k') | test/mjsunit/elide-double-hole-check-11.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698