summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Memory-trackingAllocationSites-02.js
blob: 5fa91f002aa377211454438bd226686d05fa70b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Test that we don't get allocation sites when nobody has asked for them.

const root = newGlobal({newCompartment: true});

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

dbg.memory.trackingAllocationSites = true;
root.eval("this.obj = {};");
dbg.memory.trackingAllocationSites = false;
root.eval("this.obj2 = {};");

let wrappedObj = wrappedRoot.makeDebuggeeValue(root.obj);
let allocationSite = wrappedObj.allocationSite;
assertEq(allocationSite != null && typeof allocationSite == "object", true);

let wrappedObj2 = wrappedRoot.makeDebuggeeValue(root.obj2);
let allocationSite2 = wrappedObj2.allocationSite;
assertEq(allocationSite2, null);