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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/hydrogen.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 o.c = 3; 235 o.c = 3;
236 o.d = 4; 236 o.d = 4;
237 o.e = 5; 237 o.e = 5;
238 o.f = 6; 238 o.f = 6;
239 return o; 239 return o;
240 }, function (t) { 240 }, function (t) {
241 var r = []; 241 var r = [];
242 for (var i in t) r.push(i + t[i]); 242 for (var i in t) r.push(i + t[i]);
243 return r.join(''); 243 return r.join('');
244 }); 244 });
245
246 // Test OSR inside for each.
fschneider 2012/02/22 15:29:59 s/for each/for-in/
247 function osr (t) {
248 var sum = 0;
249 for (var x in t) {
250 for (var i = 0; i < t[x].length; i++) {
251 sum += t[x][i];
252 }
253 }
254 return sum;
255 }
256
257 function test_osr() {
258 with ({}) {} // Disable optimizations of this function.
259 var arr = new Array(1000000);
260 for (var i = 0; i < arr.length; i++) arr[i] = i;
261 osr({x: arr});
262 }
263
264 test_osr();
OLDNEW
« 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