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

Side by Side Diff: test/mjsunit/elements-kind.js

Issue 10532063: Optimistically assume that elements IC only transition once. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 8 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 | « src/stub-cache.cc ('k') | test/mjsunit/elements-transition-hoisting.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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 assertEquals(value, array[1]); 217 assertEquals(value, array[1]);
218 } 218 }
219 smis = construct_smis(); 219 smis = construct_smis();
220 for (var i = 0; i < 3; i++) { 220 for (var i = 0; i < 3; i++) {
221 convert_mixed(smis, 1.5, elements_kind.fast_double); 221 convert_mixed(smis, 1.5, elements_kind.fast_double);
222 } 222 }
223 doubles = construct_doubles(); 223 doubles = construct_doubles();
224 for (var i = 0; i < 3; i++) { 224 for (var i = 0; i < 3; i++) {
225 convert_mixed(doubles, "three", elements_kind.fast); 225 convert_mixed(doubles, "three", elements_kind.fast);
226 } 226 }
227 convert_mixed(construct_smis(), "three", elements_kind.fast);
228 convert_mixed(construct_doubles(), "three", elements_kind.fast);
229 %OptimizeFunctionOnNextCall(convert_mixed);
227 smis = construct_smis(); 230 smis = construct_smis();
228 doubles = construct_doubles(); 231 doubles = construct_doubles();
229 %OptimizeFunctionOnNextCall(convert_mixed);
230 convert_mixed(smis, 1, elements_kind.fast); 232 convert_mixed(smis, 1, elements_kind.fast);
231 convert_mixed(doubles, 1, elements_kind.fast); 233 convert_mixed(doubles, 1, elements_kind.fast);
232 assertTrue(%HaveSameMap(smis, doubles)); 234 assertTrue(%HaveSameMap(smis, doubles));
233 } 235 }
234 236
235 // Crankshaft support for smi-only elements in dynamic array literals. 237 // Crankshaft support for smi-only elements in dynamic array literals.
236 function get(foo) { return foo; } // Used to generate dynamic values. 238 function get(foo) { return foo; } // Used to generate dynamic values.
237 239
238 function crankshaft_test() { 240 function crankshaft_test() {
239 if (support_smi_only_arrays) { 241 if (support_smi_only_arrays) {
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 var a = ["foo", "bar"]; 339 var a = ["foo", "bar"];
338 assertKind(elements_kind.fast, a); 340 assertKind(elements_kind.fast, a);
339 var b = a.splice(0, 1); 341 var b = a.splice(0, 1);
340 assertKind(elements_kind.fast, b); 342 assertKind(elements_kind.fast, b);
341 var c = a.slice(0, 1); 343 var c = a.slice(0, 1);
342 assertKind(elements_kind.fast, c); 344 assertKind(elements_kind.fast, c);
343 } 345 }
344 346
345 // Throw away type information in the ICs for next stress run. 347 // Throw away type information in the ICs for next stress run.
346 gc(); 348 gc();
OLDNEW
« no previous file with comments | « src/stub-cache.cc ('k') | test/mjsunit/elements-transition-hoisting.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698