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

Unified Diff: test/mjsunit/compiler/osr-manual1.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/compiler/optimized-for-in.js ('k') | test/mjsunit/compiler/osr-manual2.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/compiler/osr-manual1.js
diff --git a/test/mjsunit/compiler/osr-manual1.js b/test/mjsunit/compiler/osr-manual1.js
index 786a70dfefbc34d1bb04868c32361dc9fd95c2ee..29a4948a65f9e19b2ad2a80b4b2ddb00839ee53e 100644
--- a/test/mjsunit/compiler/osr-manual1.js
+++ b/test/mjsunit/compiler/osr-manual1.js
@@ -4,41 +4,29 @@
// Flags: --allow-natives-syntax --use-osr --turbo-osr
-var counter = 188;
+var counter = 111;
-function gen() { // defeat compiler cache.
+function gen(w) { // defeat compiler cache.
var num = counter++;
- var src =
- "function f" + num + "(Z,a,b,c) {" +
- " var x = 0;" +
- " var y = 0;" +
- " var z = 0;" +
- " while (a > 0) { Z(0); x += 19; a--; }" +
- " while (b > 0) { Z(1); y += 23; b--; }" +
- " while (c > 0) { Z(2); z += 29; c--; }" +
- " return x + y + z;" +
- "} f" + num;
-
+ var Z = [ "", "", "", ];
+ Z[w] = "%OptimizeOsr()";
+ var src =
+ "function f" + num + "(a,b,c) {" +
+ " var x = 0;" +
+ " var y = 0;" +
+ " var z = 0;" +
+ " while (a > 0) { " + Z[0] + "; x += 19; a--; }" +
+ " while (b > 0) { " + Z[1] + "; y += 23; b--; }" +
+ " while (c > 0) { " + Z[2] + "; z += 29; c--; }" +
+ " return x + y + z;" +
+ "} f" + num;
return eval(src);
}
-function compiler(a) { // manual control of OSR compiles.
- var x = 0;
- function count(l) {
- if (l == a && (x++) > 0) {
- %OptimizeFunctionOnNextCall(count.caller, "osr");
- }
- }
- return count;
-}
-
function check(x,a,b,c) {
- function none(l) { }
-
for (var i = 0; i < 3; i++) {
- var f = gen();
- assertEquals(x, f(compiler(i), a, b, c));
- assertEquals(x, f(none, a, b, c));
+ var f = gen(i);
+ assertEquals(x, f(a, b, c));
}
}
« no previous file with comments | « test/mjsunit/compiler/optimized-for-in.js ('k') | test/mjsunit/compiler/osr-manual2.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698