summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Memory-drainAllocationsLog-18.js
blob: 614c4e55974c0b42e0d82a9900af7cf91b5e2d52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Test drainAllocationsLog() entries' inNursery flag.

const root = newGlobal();
const dbg = new Debugger();
const wrappedRoot = dbg.addDebuggee(root);

dbg.memory.trackingAllocationSites = true;

root.eval(
  `
  for (let i = 0; i < 10; i++)
    allocationMarker({ nursery: true });

  for (let i = 0; i < 10; i++)
    allocationMarker({ nursery: false });
  `
);

let entries = dbg.memory.drainAllocationsLog().filter(e => e.class == "AllocationMarker");

assertEq(entries.length, 20);

for (let i = 0; i < 10; i++)
  assertEq(entries[i].inNursery, true);

for (let i = 10; i < 20; i++)
  assertEq(entries[i].inNursery, false);