summaryrefslogtreecommitdiffstats
path: root/js/src/devtools/gc-ubench/benchmarks/propertyTreeSplitting.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/devtools/gc-ubench/benchmarks/propertyTreeSplitting.js')
-rw-r--r--js/src/devtools/gc-ubench/benchmarks/propertyTreeSplitting.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/js/src/devtools/gc-ubench/benchmarks/propertyTreeSplitting.js b/js/src/devtools/gc-ubench/benchmarks/propertyTreeSplitting.js
new file mode 100644
index 000000000..47001030f
--- /dev/null
+++ b/js/src/devtools/gc-ubench/benchmarks/propertyTreeSplitting.js
@@ -0,0 +1,25 @@
+window.tests.set('propertyTreeSplitting', (function() {
+var garbage = [];
+var garbageIndex = 0;
+return {
+ description: "use delete to generate Shape garbage",
+ load: (N) => { garbage = new Array(N); },
+ unload: () => { garbage = []; garbageIndex = 0; },
+ makeGarbage: (N) => {
+ function f()
+ {
+ var a1 = eval;
+ delete eval;
+ eval = a1;
+ var a3 = toString;
+ delete toString;
+ toString = a3;
+ }
+ for (var a = 0; a < N; ++a) {
+ garbage[garbageIndex++] = new f();
+ if (garbageIndex == garbage.length)
+ garbageIndex = 0;
+ }
+ }
+};
+})());