Debian Codegraph @

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

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