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

Unified Diff: test/mjsunit/compiler/osr-warm.js

Issue 21340002: Generate a custom OSR entrypoint for OSR compiles on all platforms, and transition to optimized cod… (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Remerge with recent changes. Created 7 years, 3 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
Index: test/mjsunit/compiler/osr-warm.js
diff --git a/test/mjsunit/compiler/osr-with-args.js b/test/mjsunit/compiler/osr-warm.js
similarity index 86%
copy from test/mjsunit/compiler/osr-with-args.js
copy to test/mjsunit/compiler/osr-warm.js
index 44fa1cb2cf9d0a1fcf3689b03fc01cc4e9f4eafc..65ada1e114856109ab2261d0bc670bf59daa983c 100644
--- a/test/mjsunit/compiler/osr-with-args.js
+++ b/test/mjsunit/compiler/osr-warm.js
@@ -27,18 +27,24 @@
// Flags: --use-osr
-function f() {
- var sum = 0;
- for (var i = 0; i < 1000000; i++) {
- var t = arguments[0] + 2;
- var x = arguments[1] + 2;
- var y = t + x + 5;
- var z = y + 3;
- sum += z;
+function f1(x) {
+ while (x > 0) {
+ x--;
}
- return sum;
+ return x;
}
-for (var i = 0; i < 4; i++) {
- assertEquals(17000000, f(2, 3));
+assertEquals(0, f1(1));
+assertEquals(0, f1(10000000));
+
+function f2(x) {
+ var sum = 1;
+ while (x > 0) {
+ x--;
+ sum++;
+ }
+ return sum;
}
+
+assertEquals(2, f2(1));
+assertEquals(10000001, f2(10000000));

Powered by Google App Engine
This is Rietveld 408576698