object-constructor-metadata-builder.js (387B)
1 let capture = []; 2 3 for (let i = 0; i <= 200; ++i) { 4 if (i === 100) { 5 enableTrackAllocations(); 6 } 7 8 // Create a new object through `new Object` and capture the result. 9 capture[i & 1] = new Object(); 10 11 // Ensure the allocation is properly tracked when inlining `new Object` in CacheIR. 12 let data = getAllocationMetadata(capture[i & 1]); 13 assertEq(data !== null, i >= 100); 14 }