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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 assertTrue(%HasFastSmiElements(a4)); | 273 assertTrue(%HasFastSmiElements(a4)); |
274 assertEquals([1,1,2,3], a4); | 274 assertEquals([1,1,2,3], a4); |
275 a4 = [1,2,3]; | 275 a4 = [1,2,3]; |
276 a4.unshift(1.1); | 276 a4.unshift(1.1); |
277 // TODO(verwaest): We'll want to support double unshifting as well. | 277 // TODO(verwaest): We'll want to support double unshifting as well. |
278 // assertTrue(%HasFastDoubleElements(a4)); | 278 // assertTrue(%HasFastDoubleElements(a4)); |
279 assertTrue(%HasFastObjectElements(a4)); | 279 assertTrue(%HasFastObjectElements(a4)); |
280 assertEquals([1.1,1,2,3], a4); | 280 assertEquals([1.1,1,2,3], a4); |
281 a4 = [1.1,2,3]; | 281 a4 = [1.1,2,3]; |
282 a4.unshift(1); | 282 a4.unshift(1); |
283 // assertTrue(%HasFastDoubleElements(a4)); | 283 assertTrue(%HasFastDoubleElements(a4)); |
284 assertTrue(%HasFastObjectElements(a4)); | |
285 assertEquals([1,1.1,2,3], a4); | 284 assertEquals([1,1.1,2,3], a4); |
286 a4 = [{},2,3]; | 285 a4 = [{},2,3]; |
287 a4.unshift(1); | 286 a4.unshift(1); |
288 assertTrue(%HasFastObjectElements(a4)); | 287 assertTrue(%HasFastObjectElements(a4)); |
289 assertEquals([1,{},2,3], a4); | 288 assertEquals([1,{},2,3], a4); |
290 a4 = [{},2,3]; | 289 a4 = [{},2,3]; |
291 a4.unshift(1.1); | 290 a4.unshift(1.1); |
292 assertTrue(%HasFastObjectElements(a4)); | 291 assertTrue(%HasFastObjectElements(a4)); |
293 assertEquals([1.1,{},2,3], a4); | 292 assertEquals([1.1,{},2,3], a4); |
294 } | 293 } |
295 | 294 |
296 for (var i = 0; i < 3; i++) { | 295 for (var i = 0; i < 3; i++) { |
297 array_natives_test(); | 296 array_natives_test(); |
298 } | 297 } |
299 %OptimizeFunctionOnNextCall(array_natives_test); | 298 %OptimizeFunctionOnNextCall(array_natives_test); |
300 array_natives_test(); | 299 array_natives_test(); |
OLD | NEW |