Debian Codegraph @

js/src/jit-test/tests/debug/Memory-drainAllocationsLog-09.js

raw
1 // Test logs that contain allocations from many debuggee compartments.
2
3 const dbg = new Debugger();
4
5 const root1 = newGlobal({newCompartment: true});
6 const root2 = newGlobal({newCompartment: true});
7 const root3 = newGlobal({newCompartment: true});
8
9 dbg.addDebuggee(root1);
10 dbg.addDebuggee(root2);
11 dbg.addDebuggee(root3);
12
13 dbg.memory.trackingAllocationSites = true;
14
15 root1.eval("this.alloc = {}");
16 root2.eval("this.alloc = {}");
17 root3.eval("this.alloc = {}");
18
19 const allocs = dbg.memory.drainAllocationsLog();
20 assertEq(allocs.length >= 3, true);