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

Side by Side Diff: test/mjsunit/keyed-load-hole-to-undefined.js

Issue 2653753007: [tests] Cleanup tests that use assertOptimized()/assertUnoptimized(). (Closed)
Patch Set: Addressing comments Created 3 years, 11 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 | « test/mjsunit/harmony/do-expressions.js ('k') | test/mjsunit/keyed-load-with-string-key.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 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 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 // Flags: --allow-natives-syntax 5 // Flags: --allow-natives-syntax
6 // Flags: --nostress-opt 6 // Flags: --no-stress-opt --crankshaft --no-always-opt
7 7
8 // --nostress-opt is specified because the test corrupts the "pristine" 8 // --nostress-opt is specified because the test corrupts the "pristine"
9 // array prototype chain by storing an element, and this is tracked 9 // array prototype chain by storing an element, and this is tracked
10 // per-isolate. A subsequent stress run would send the load generic, 10 // per-isolate. A subsequent stress run would send the load generic,
11 // and no more deoptimizations of foo would occur. 11 // and no more deoptimizations of foo would occur.
12 12
13 function foo(a, i) { return a[i]; } 13 function foo(a, i) { return a[i]; }
14 14
15 var a = ['one', , 'three']; 15 var a = ['one', , 'three'];
16 foo(a, 0); 16 foo(a, 0);
17 foo(a, 0); 17 foo(a, 0);
18 foo(a, 0); 18 foo(a, 0);
19 %OptimizeFunctionOnNextCall(foo); 19 %OptimizeFunctionOnNextCall(foo);
20 assertEquals(undefined, foo(a, 1)); 20 assertEquals(undefined, foo(a, 1));
21 assertOptimized(foo); 21 assertOptimized(foo);
22 22
23 // Whereas if we disrupt the prototype chain... 23 // Whereas if we disrupt the prototype chain...
24 Array.prototype[1] = 'cow'; 24 Array.prototype[1] = 'cow';
25 assertEquals('cow', foo(a, 1)); 25 assertEquals('cow', foo(a, 1));
26 assertUnoptimized(foo); 26 assertUnoptimized(foo);
OLDNEW
« no previous file with comments | « test/mjsunit/harmony/do-expressions.js ('k') | test/mjsunit/keyed-load-with-string-key.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698