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

Side by Side Diff: test/mjsunit/compiler/osr-simple.js

Issue 913463002: Reduce the number of iterations in some OSR tests by using an explicit %OptimizeOsr(). (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
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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: --use-osr 5 // Flags: --allow-natives-syntax --use-osr
6 6
7 function f() { 7 function f() {
8 var sum = 0; 8 var sum = 0;
9 for (var i = 0; i < 1000000; i++) { 9 for (var i = 0; i < 1000; i++) {
10 var x = i + 2; 10 var x = i + 2;
11 var y = x + 5; 11 var y = x + 5;
12 var z = y + 3; 12 var z = y + 3;
13 sum += z; 13 sum += z;
14 if (i == 11) %OptimizeOsr();
14 } 15 }
15 return sum; 16 return sum;
16 } 17 }
17 18
18 19
19 for (var i = 0; i < 2; i++) { 20 for (var i = 0; i < 2; i++) {
20 assertEquals(500009500000, f()); 21 assertEquals(509500, f());
21 } 22 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698