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

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

Issue 282093009: Emit mementos in crankshaft. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: REBASE. Created 6 years, 6 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/cctest/test-heap.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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 a = bar(); 183 a = bar();
184 bar(); 184 bar();
185 %OptimizeFunctionOnNextCall(bar); 185 %OptimizeFunctionOnNextCall(bar);
186 b = bar(); 186 b = bar();
187 // This only makes sense to test if we allow crankshafting 187 // This only makes sense to test if we allow crankshafting
188 if (4 != %GetOptimizationStatus(bar)) { 188 if (4 != %GetOptimizationStatus(bar)) {
189 assertOptimized(bar); 189 assertOptimized(bar);
190 %DebugPrint(3); 190 %DebugPrint(3);
191 b[0] = 3.5; 191 b[0] = 3.5;
192 c = bar(); 192 c = bar();
193 // This assert should be relaxed as we may continue emitting mementos for
194 // pretenuring purposes in crankshaft if we don't have enough samples yet.
193 assertKind(elements_kind.fast_smi_only, c); 195 assertKind(elements_kind.fast_smi_only, c);
194 assertOptimized(bar); 196 assertOptimized(bar);
195 } 197 }
196 })(); 198 })();
197 199
198 200
199 // Test: create arrays in two contexts, verifying that the correct 201 // Test: create arrays in two contexts, verifying that the correct
200 // map for Array in that context will be used. 202 // map for Array in that context will be used.
201 (function() { 203 (function() {
202 function bar() { return new Array(); } 204 function bar() { return new Array(); }
(...skipping 29 matching lines...) Expand all
232 assertTrue(isHoley(a)); 234 assertTrue(isHoley(a));
233 a = bar(0); 235 a = bar(0);
234 assertOptimized(bar); 236 assertOptimized(bar);
235 // Crankshafted functions don't use mementos, so feedback still 237 // Crankshafted functions don't use mementos, so feedback still
236 // indicates a packed array is desired. (unless --nocrankshaft is in use). 238 // indicates a packed array is desired. (unless --nocrankshaft is in use).
237 if (4 != %GetOptimizationStatus(bar)) { 239 if (4 != %GetOptimizationStatus(bar)) {
238 assertFalse(isHoley(a)); 240 assertFalse(isHoley(a));
239 } 241 }
240 })(); 242 })();
241 } 243 }
OLDNEW
« no previous file with comments | « test/cctest/test-heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698