OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 16 matching lines...) Expand all Loading... |
27 | 27 |
28 // Flags: --allow-natives-syntax --smi-only-arrays --expose-gc | 28 // Flags: --allow-natives-syntax --smi-only-arrays --expose-gc |
29 | 29 |
30 // Test element kind of objects. | 30 // Test element kind of objects. |
31 // Since --smi-only-arrays affects builtins, its default setting at compile | 31 // Since --smi-only-arrays affects builtins, its default setting at compile |
32 // time sticks if built with snapshot. If --smi-only-arrays is deactivated | 32 // time sticks if built with snapshot. If --smi-only-arrays is deactivated |
33 // by default, only a no-snapshot build actually has smi-only arrays enabled | 33 // by default, only a no-snapshot build actually has smi-only arrays enabled |
34 // in this test case. Depending on whether smi-only arrays are actually | 34 // in this test case. Depending on whether smi-only arrays are actually |
35 // enabled, this test takes the appropriate code path to check smi-only arrays. | 35 // enabled, this test takes the appropriate code path to check smi-only arrays. |
36 | 36 |
37 support_smi_only_arrays = %HasFastSmiOnlyElements([]); | 37 support_smi_only_arrays = %HasFastSmiOnlyElements([1,2,3,4,5,6,7,8,9,10]); |
38 | 38 |
39 if (support_smi_only_arrays) { | 39 if (support_smi_only_arrays) { |
40 print("Tests include smi-only arrays."); | 40 print("Tests include smi-only arrays."); |
41 } else { | 41 } else { |
42 print("Tests do NOT include smi-only arrays."); | 42 print("Tests do NOT include smi-only arrays."); |
43 } | 43 } |
44 | 44 |
45 var elements_kind = { | 45 var elements_kind = { |
46 fast_smi_only : 'fast smi only elements', | 46 fast_smi_only : 'fast smi only elements', |
47 fast : 'fast elements', | 47 fast : 'fast elements', |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 var a = ["foo", "bar"]; | 331 var a = ["foo", "bar"]; |
332 assertKind(elements_kind.fast, a); | 332 assertKind(elements_kind.fast, a); |
333 var b = a.splice(0, 1); | 333 var b = a.splice(0, 1); |
334 assertKind(elements_kind.fast, b); | 334 assertKind(elements_kind.fast, b); |
335 var c = a.slice(0, 1); | 335 var c = a.slice(0, 1); |
336 assertKind(elements_kind.fast, c); | 336 assertKind(elements_kind.fast, c); |
337 } | 337 } |
338 | 338 |
339 // Throw away type information in the ICs for next stress run. | 339 // Throw away type information in the ICs for next stress run. |
340 gc(); | 340 gc(); |
OLD | NEW |