summaryrefslogtreecommitdiffstats
path: root/js/src/devtools/gc-ubench/benchmarks/globalArrayNewObject.js
blob: 2ab04dff075711cd66fec94c9f4e226f641143cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
window.tests.set('globalArrayNewObject', (function() {
var garbage = [];
var garbageIndex = 0;
return {
    description: "var foo = [new Object(), ....]",
    load: (N) => { garbage = new Array(N); },
    unload: () => { garbage = []; garbageIndex = 0; },
    makeGarbage: (N) => {
        for (var i = 0; i < N; i++) {
            garbage[garbageIndex++] = new Object();
            if (garbageIndex == garbage.length)
                garbageIndex = 0;
        }
    }
};
})());