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

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

Issue 417953004: Revert 22595: "Keep new arrays allocated with 'new Array(N)' in fast mode" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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 bar(100000); 133 a = bar(100000);
134 assertKind(elements_kind.dictionary, a);
134 assertOptimized(bar); 135 assertOptimized(bar);
135 136
136 // If the argument isn't a smi, things should still work. 137 // If the argument isn't a smi, things should still work.
137 a = bar("oops"); 138 a = bar("oops");
138 assertOptimized(bar); 139 assertOptimized(bar);
139 assertKind(elements_kind.fast, a); 140 assertKind(elements_kind.fast, a);
140 141
141 function barn(one, two, three) { 142 function barn(one, two, three) {
142 return new Array(one, two, three); 143 return new Array(one, two, three);
143 } 144 }
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 a = bar(100); 211 a = bar(100);
211 assertTrue(isHoley(a)); 212 assertTrue(isHoley(a));
212 a = bar(0); 213 a = bar(0);
213 assertOptimized(bar); 214 assertOptimized(bar);
214 // Crankshafted functions don't use mementos, so feedback still 215 // Crankshafted functions don't use mementos, so feedback still
215 // indicates a packed array is desired. (unless --nocrankshaft is in use). 216 // indicates a packed array is desired. (unless --nocrankshaft is in use).
216 if (4 != %GetOptimizationStatus(bar)) { 217 if (4 != %GetOptimizationStatus(bar)) {
217 assertFalse(isHoley(a)); 218 assertFalse(isHoley(a));
218 } 219 }
219 })(); 220 })();
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