summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Memory-drainAllocationsLog-13.js
blob: 4ac6b26a5c7d0deeb185d938c38873aaa5c9661e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Test that we don't crash while logging allocations and there is
// off-main-thread compilation. OMT compilation will allocate functions and
// regexps, but we just punt on measuring that accurately.

if (helperThreadCount() === 0) {
  quit(0);
}

const root = newGlobal();
root.eval("this.dbg = new Debugger()");
root.dbg.addDebuggee(this);
root.dbg.memory.trackingAllocationSites = true;

offThreadCompileScript(
  "function foo() {\n" +
  "  print('hello world');\n" +
  "}"
);