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

Unified Diff: test/mjsunit/compiler/osr-manual2.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/osr-manual1.js ('k') | test/mjsunit/compiler/osr-regex-id.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/compiler/osr-manual2.js
diff --git a/test/mjsunit/compiler/osr-manual2.js b/test/mjsunit/compiler/osr-manual2.js
index 463ba89353186da7b72b03f22246ccff3eeb7a2b..8aa5d69db309bff01943c72c8dde629138bb4e0b 100644
--- a/test/mjsunit/compiler/osr-manual2.js
+++ b/test/mjsunit/compiler/osr-manual2.js
@@ -6,39 +6,27 @@
var counter = 188;
-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--; var j=2; while(j--); }" +
- " while (b > 0) { Z(1); y += 23; b--; var j=2; while(j--); }" +
- " while (c > 0) { Z(2); z += 29; c--; var j=2; while(j--); }" +
- " 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--; var j=2; while(j--); }" +
+ " while (b > 0) { " + Z[1] + "; y += 23; b--; var j=2; while(j--); }" +
+ " while (c > 0) { " + Z[2] + "; z += 29; c--; var j=2; while(j--); }" +
+ " 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/osr-manual1.js ('k') | test/mjsunit/compiler/osr-regex-id.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698