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

Side by Side Diff: test/mjsunit/array-constructor-feedback.js

Issue 416403002: Keep new arrays allocated with 'new Array(N)' in fast mode (revisited) (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 6 years, 5 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 | « test/mjsunit/apply.js ('k') | test/mjsunit/array-feedback.js » ('j') | 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 return new Array(len); 123 return new Array(len);
124 } 124 }
125 a = bar(10); 125 a = bar(10);
126 a[0] = "a string"; 126 a[0] = "a string";
127 a = bar(10); 127 a = bar(10);
128 assertKind(elements_kind.fast, a); 128 assertKind(elements_kind.fast, a);
129 %OptimizeFunctionOnNextCall(bar); 129 %OptimizeFunctionOnNextCall(bar);
130 a = bar(10); 130 a = bar(10);
131 assertKind(elements_kind.fast, a); 131 assertKind(elements_kind.fast, a);
132 assertOptimized(bar); 132 assertOptimized(bar);
133 a = bar(100000); 133 bar(100000);
134 assertKind(elements_kind.dictionary, a);
135 assertOptimized(bar); 134 assertOptimized(bar);
136 135
137 // If the argument isn't a smi, things should still work. 136 // If the argument isn't a smi, things should still work.
138 a = bar("oops"); 137 a = bar("oops");
139 assertOptimized(bar); 138 assertOptimized(bar);
140 assertKind(elements_kind.fast, a); 139 assertKind(elements_kind.fast, a);
141 140
142 function barn(one, two, three) { 141 function barn(one, two, three) {
143 return new Array(one, two, three); 142 return new Array(one, two, three);
144 } 143 }
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 a = bar(100); 210 a = bar(100);
212 assertTrue(isHoley(a)); 211 assertTrue(isHoley(a));
213 a = bar(0); 212 a = bar(0);
214 assertOptimized(bar); 213 assertOptimized(bar);
215 // Crankshafted functions don't use mementos, so feedback still 214 // Crankshafted functions don't use mementos, so feedback still
216 // indicates a packed array is desired. (unless --nocrankshaft is in use). 215 // indicates a packed array is desired. (unless --nocrankshaft is in use).
217 if (4 != %GetOptimizationStatus(bar)) { 216 if (4 != %GetOptimizationStatus(bar)) {
218 assertFalse(isHoley(a)); 217 assertFalse(isHoley(a));
219 } 218 }
220 })(); 219 })();
OLDNEW
« no previous file with comments | « test/mjsunit/apply.js ('k') | test/mjsunit/array-feedback.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698