summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/gc/bug-1872524.js
blob: 877a773a1fd53a2fa614485589ca72b76fc9dad3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Attempt to break invariant that smallHeapIncrementalLimit >=
// largeHeapIncrementalLimit and check that it is maintained.

function checkInvariant() {
  return gcparam("smallHeapIncrementalLimit") >=
         gcparam("largeHeapIncrementalLimit");
}

assertEq(checkInvariant(), true);

const smallLimit = gcparam("smallHeapIncrementalLimit");
gcparam("largeHeapIncrementalLimit", smallLimit + 1);
assertEq(checkInvariant(), true);

const largeLimit = gcparam("largeHeapIncrementalLimit");
gcparam("smallHeapIncrementalLimit", largeLimit - 1);
assertEq(checkInvariant(), true);