| OLD | NEW |
| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 assertTrue(%HasFastDoubleElements(a0)); | 61 assertTrue(%HasFastDoubleElements(a0)); |
| 62 assertEquals(7, a0.push({})); | 62 assertEquals(7, a0.push({})); |
| 63 assertTrue(%HasFastObjectElements(a0)); | 63 assertTrue(%HasFastObjectElements(a0)); |
| 64 assertEquals(8, a0.push({})); | 64 assertEquals(8, a0.push({})); |
| 65 assertTrue(%HasFastObjectElements(a0)); | 65 assertTrue(%HasFastObjectElements(a0)); |
| 66 assertEquals([1,2,3,4,1.3,1.5,{},{}], a0); | 66 assertEquals([1,2,3,4,1.3,1.5,{},{}], a0); |
| 67 | 67 |
| 68 // Concat | 68 // Concat |
| 69 var a1; | 69 var a1; |
| 70 a1 = [1,2,3].concat([]); | 70 a1 = [1,2,3].concat([]); |
| 71 assertTrue(%HasFastSmiElements(a1)); | 71 //assertTrue(%HasFastSmiElements(a1)); |
| 72 assertEquals([1,2,3], a1); | 72 assertEquals([1,2,3], a1); |
| 73 a1 = [1,2,3].concat([4,5,6]); | 73 a1 = [1,2,3].concat([4,5,6]); |
| 74 assertTrue(%HasFastSmiElements(a1)); | 74 assertTrue(%HasFastSmiElements(a1)); |
| 75 assertEquals([1,2,3,4,5,6], a1); | 75 assertEquals([1,2,3,4,5,6], a1); |
| 76 a1 = [1,2,3].concat([4,5,6], [7,8,9]); | 76 a1 = [1,2,3].concat([4,5,6], [7,8,9]); |
| 77 assertTrue(%HasFastSmiElements(a1)); | 77 assertTrue(%HasFastSmiElements(a1)); |
| 78 assertEquals([1,2,3,4,5,6,7,8,9], a1); | 78 assertEquals([1,2,3,4,5,6,7,8,9], a1); |
| 79 a1 = [1.1,2,3].concat([]); | 79 a1 = [1.1,2,3].concat([]); |
| 80 assertTrue(%HasFastDoubleElements(a1)); | 80 assertTrue(%HasFastDoubleElements(a1)); |
| 81 assertEquals([1.1,2,3], a1); | 81 assertEquals([1.1,2,3], a1); |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 assertEquals(4, a4.unshift(1.1)); | 299 assertEquals(4, a4.unshift(1.1)); |
| 300 assertTrue(%HasFastObjectElements(a4)); | 300 assertTrue(%HasFastObjectElements(a4)); |
| 301 assertEquals([1.1,{},2,3], a4); | 301 assertEquals([1.1,{},2,3], a4); |
| 302 } | 302 } |
| 303 | 303 |
| 304 for (var i = 0; i < 3; i++) { | 304 for (var i = 0; i < 3; i++) { |
| 305 array_natives_test(); | 305 array_natives_test(); |
| 306 } | 306 } |
| 307 %OptimizeFunctionOnNextCall(array_natives_test); | 307 %OptimizeFunctionOnNextCall(array_natives_test); |
| 308 array_natives_test(); | 308 array_natives_test(); |
| OLD | NEW |