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

Side by Side Diff: test/mjsunit/unbox-double-arrays.js

Issue 10170030: Implement tracking and optimizations of packed arrays (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review feedback Created 8 years, 7 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/regress/regress-smi-only-concat.js ('k') | tools/gyp/v8.gyp » ('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 2011 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
11 // with the distribution. 11 // with the distribution.
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 assertEquals(large_array_size+10002, large_array.length); 369 assertEquals(large_array_size+10002, large_array.length);
370 370
371 // Test dictionary -> double elements -> fast elements. 371 // Test dictionary -> double elements -> fast elements.
372 var large_array2 = new Array(large_array_size); 372 var large_array2 = new Array(large_array_size);
373 force_to_fast_double_array(large_array2); 373 force_to_fast_double_array(large_array2);
374 delete large_array2[5]; 374 delete large_array2[5];
375 375
376 // Convert back to fast elements and make sure the contents of the array are 376 // Convert back to fast elements and make sure the contents of the array are
377 // unchanged. 377 // unchanged.
378 large_array2[25] = new Object(); 378 large_array2[25] = new Object();
379 assertTrue(%HasFastElements(large_array2)); 379 assertTrue(%HasFastObjectElements(large_array2));
380 for (var i= 0; i < approx_dict_to_elements_threshold; i += 500 ) { 380 for (var i= 0; i < approx_dict_to_elements_threshold; i += 500 ) {
381 if (i != 25 && i != 5) { 381 if (i != 25 && i != 5) {
382 assertEquals(expected_array_value(i), large_array2[i]); 382 assertEquals(expected_array_value(i), large_array2[i]);
383 } 383 }
384 } 384 }
385 assertEquals(undefined, large_array2[5]); 385 assertEquals(undefined, large_array2[5]);
386 assertEquals(undefined, large_array2[large_array_size-1]); 386 assertEquals(undefined, large_array2[large_array_size-1]);
387 assertEquals(undefined, large_array2[-1]); 387 assertEquals(undefined, large_array2[-1]);
388 assertEquals(large_array_size, large_array2.length); 388 assertEquals(large_array_size, large_array2.length);
389 389
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 assertEquals(expected_array_value(2), large_array4[2]); 537 assertEquals(expected_array_value(2), large_array4[2]);
538 } 538 }
539 539
540 test_setter(); 540 test_setter();
541 test_setter(); 541 test_setter();
542 test_setter(); 542 test_setter();
543 %OptimizeFunctionOnNextCall(test_setter); 543 %OptimizeFunctionOnNextCall(test_setter);
544 test_setter(); 544 test_setter();
545 test_setter(); 545 test_setter();
546 test_setter(); 546 test_setter();
OLDNEW
« no previous file with comments | « test/mjsunit/regress/regress-smi-only-concat.js ('k') | tools/gyp/v8.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698