| // This test should not crash. |
| let numberOfIterations = 1000; |
| function captureScopedArguments(i) { |
| eval("arr[" + i + "] = arguments"); |
| function addPointersToEdenGenObjects(i) { |
| Array.prototype.push.call(arr[i], [,,]); |
| Array.prototype.reverse.call(arr[i]) |
| for (var i = 0; i < numberOfIterations; i++) { |
| captureScopedArguments(i); |
| gc(); // Promote those ScopeArguments to the old generation. |
| for (var i = 0; i < numberOfIterations; i++) { |
| addPointersToEdenGenObjects(i); |
| edenGC(); // Do eden GC to scan the remembered set which should include the ScopedArguments. |
| gc(); // Scan the ScopedArguments again. They better not point to collected objects. |