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

Side by Side Diff: test/mjsunit/regress-sync-optimized-lists.js

Issue 906243002: Make it easier to test OSR with %OptimizeOsr() runtime call. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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/compiler/osr-top3.js ('k') | test/mjsunit/regress/regress-379770.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 --block-concurrent-recompilation 5 // Flags: --allow-natives-syntax --block-concurrent-recompilation
6 // Flags: --no-concurrent-osr 6 // Flags: --no-concurrent-osr
7 7
8 function Ctor() { 8 function Ctor() {
9 this.a = 1; 9 this.a = 1;
10 } 10 }
11 11
12 function get_closure() { 12 function get_closure() {
13 return function add_field(obj, osr) { 13 return function add_field(obj, osr) {
14 obj.c = 3; 14 obj.c = 3;
15 var x = 0; 15 var x = 0;
16 if (osr) { 16 if (osr) %OptimizeOsr();
17 %OptimizeFunctionOnNextCall(add_field, "osr");
18 }
19 for (var i = 0; i < 10; i++) { 17 for (var i = 0; i < 10; i++) {
20 x = i + 1; 18 x = i + 1;
21 } 19 }
22 return x; 20 return x;
23 } 21 }
24 } 22 }
25 23
26 var f1 = get_closure(); 24 var f1 = get_closure();
27 f1(new Ctor(), false); 25 f1(new Ctor(), false);
28 f1(new Ctor(), false); 26 f1(new Ctor(), false);
29 27
30 %OptimizeFunctionOnNextCall(f1, "concurrent"); 28 %OptimizeFunctionOnNextCall(f1, "concurrent");
31 29
32 // Kick off concurrent recompilation and OSR. 30 // Kick off concurrent recompilation and OSR.
33 var o = new Ctor(); 31 var o = new Ctor();
34 f1(o, true); 32 f1(o, true);
35 assertOptimized(f1, "no sync"); 33 assertOptimized(f1, "no sync");
36 34
37 // Flush the optimizing compiler's queue. 35 // Flush the optimizing compiler's queue.
38 %NotifyContextDisposed(); 36 %NotifyContextDisposed();
39 assertUnoptimized(f1, "no sync"); 37 assertUnoptimized(f1, "no sync");
40 38
41 // Trigger deopt. 39 // Trigger deopt.
42 o.c = 2.2; 40 o.c = 2.2;
43 41
44 var f2 = get_closure(); 42 var f2 = get_closure();
45 f2(new Ctor(), true); 43 f2(new Ctor(), true);
OLDNEW
« no previous file with comments | « test/mjsunit/compiler/osr-top3.js ('k') | test/mjsunit/regress/regress-379770.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698