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

Unified Diff: test/mjsunit/compiler/optimized-for-in.js

Issue 9431030: Support OSR in for-in loops. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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 | « src/hydrogen.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/compiler/optimized-for-in.js
diff --git a/test/mjsunit/compiler/optimized-for-in.js b/test/mjsunit/compiler/optimized-for-in.js
index c8076ac73659301608a806a834cab8268e949690..4b841b20d40bff78c3068abe03d3733a43951e84 100644
--- a/test/mjsunit/compiler/optimized-for-in.js
+++ b/test/mjsunit/compiler/optimized-for-in.js
@@ -242,3 +242,23 @@ tryFunction("a1b2c3d4e5f6", function () {
for (var i in t) r.push(i + t[i]);
return r.join('');
});
+
+// Test OSR inside for each.
fschneider 2012/02/22 15:29:59 s/for each/for-in/
+function osr (t) {
+ var sum = 0;
+ for (var x in t) {
+ for (var i = 0; i < t[x].length; i++) {
+ sum += t[x][i];
+ }
+ }
+ return sum;
+}
+
+function test_osr() {
+ with ({}) {} // Disable optimizations of this function.
+ var arr = new Array(1000000);
+ for (var i = 0; i < arr.length; i++) arr[i] = i;
+ osr({x: arr});
+}
+
+test_osr();
« no previous file with comments | « src/hydrogen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698