| 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 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1227 { object: arr3, type: 'splice', index: 1, removed: [], addedCount: 1 }, | 1227 { object: arr3, type: 'splice', index: 1, removed: [], addedCount: 1 }, |
| 1228 { object: arr3, type: 'splice', index: 1, removed: [,], addedCount: 0 }, | 1228 { object: arr3, type: 'splice', index: 1, removed: [,], addedCount: 0 }, |
| 1229 { object: arr3, type: 'splice', index: 1, removed: [], addedCount: 4 }, | 1229 { object: arr3, type: 'splice', index: 1, removed: [], addedCount: 4 }, |
| 1230 { object: arr3, name: '4', type: 'add' }, | 1230 { object: arr3, name: '4', type: 'add' }, |
| 1231 { object: arr3, type: 'splice', index: 1, removed: [,,,5], addedCount: 0 } | 1231 { object: arr3, type: 'splice', index: 1, removed: [,,,5], addedCount: 0 } |
| 1232 ]); | 1232 ]); |
| 1233 | 1233 |
| 1234 | 1234 |
| 1235 // Updating length on large (slow) array | 1235 // Updating length on large (slow) array |
| 1236 reset(); | 1236 reset(); |
| 1237 var slow_arr = new Array(1000000000); | 1237 var slow_arr = %NormalizeElements([]); |
| 1238 slow_arr[500000000] = 'hello'; | 1238 slow_arr[500000000] = 'hello'; |
| 1239 slow_arr.length = 1000000000; |
| 1239 Object.observe(slow_arr, observer.callback); | 1240 Object.observe(slow_arr, observer.callback); |
| 1240 var spliceRecords; | 1241 var spliceRecords; |
| 1241 function slowSpliceCallback(records) { | 1242 function slowSpliceCallback(records) { |
| 1242 spliceRecords = records; | 1243 spliceRecords = records; |
| 1243 } | 1244 } |
| 1244 Array.observe(slow_arr, slowSpliceCallback); | 1245 Array.observe(slow_arr, slowSpliceCallback); |
| 1245 slow_arr.length = 100; | 1246 slow_arr.length = 100; |
| 1246 Object.deliverChangeRecords(observer.callback); | 1247 Object.deliverChangeRecords(observer.callback); |
| 1247 observer.assertCallbackRecords([ | 1248 observer.assertCallbackRecords([ |
| 1248 { object: slow_arr, name: '500000000', type: 'delete', oldValue: 'hello' }, | 1249 { object: slow_arr, name: '500000000', type: 'delete', oldValue: 'hello' }, |
| (...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1790 for (var n1 = 0; n1 < 3; ++n1) | 1791 for (var n1 = 0; n1 < 3; ++n1) |
| 1791 for (var n2 = 0; n2 < 3; ++n2) | 1792 for (var n2 = 0; n2 < 3; ++n2) |
| 1792 for (var i in mutation) | 1793 for (var i in mutation) |
| 1793 TestFastElementsLength(mutation[i], b1 != 0, b2 != 0, 20*n1, 20*n2); | 1794 TestFastElementsLength(mutation[i], b1 != 0, b2 != 0, 20*n1, 20*n2); |
| 1794 | 1795 |
| 1795 for (var b1 = 0; b1 < 2; ++b1) | 1796 for (var b1 = 0; b1 < 2; ++b1) |
| 1796 for (var b2 = 0; b2 < 2; ++b2) | 1797 for (var b2 = 0; b2 < 2; ++b2) |
| 1797 for (var n = 0; n < 3; ++n) | 1798 for (var n = 0; n < 3; ++n) |
| 1798 for (var i in mutationByIncr) | 1799 for (var i in mutationByIncr) |
| 1799 TestFastElementsLength(mutationByIncr[i], b1 != 0, b2 != 0, 7*n, 7*n+1); | 1800 TestFastElementsLength(mutationByIncr[i], b1 != 0, b2 != 0, 7*n, 7*n+1); |
| OLD | NEW |