summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/cacheir/object-constructor-metadata-builder.js
blob: 7568f17885f04c5aec8ef16119b8659653e077df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
let capture = [];

for (let i = 0; i <= 200; ++i) {
  if (i === 100) {
    enableTrackAllocations();
  }

  // Create a new object through `new Object` and capture the result.
  capture[i & 1] = new Object();

  // Ensure the allocation is properly tracked when inlining `new Object` in CacheIR.
  let data = getAllocationMetadata(capture[i & 1]);
  assertEq(data !== null, i >= 100);
}