summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Memory-drainAllocationsLog-06.js
blob: e112cd8c0e28753dc0222e999133d8b77637c0f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Test doing a GC while we have a non-empty log.

const root = newGlobal({newCompartment: true});
const dbg = new Debugger();
dbg.addDebuggee(root)
dbg.memory.trackingAllocationSites = true;

root.eval("(" + function immediate() {
  this.tests = [
    ({}),
    [],
    /(two|2)\s*problems/,
    new function Ctor(){},
    new Object(),
    new Array(),
    new Date(),
  ];
} + "());");

gc();

const allocs = dbg.memory.drainAllocationsLog();
assertEq(allocs.length >= root.tests.length, true);