Bug 1833854 - Part 3: Allow min and max nursery sizes to be set regardless of current...
commit21d8a4c7d34bda45df1bc8a8155917f341261541
authorJon Coppeard <jcoppeard@mozilla.com>
Sat, 20 May 2023 08:29:48 +0000 (20 08:29 +0000)
committerJon Coppeard <jcoppeard@mozilla.com>
Sat, 20 May 2023 08:29:48 +0000 (20 08:29 +0000)
tree448513b3c7d49c586dd2659ab36b2a597a69fbee
parent581a84731ba62e745dce44af34722709b724715b
Bug 1833854 - Part 3: Allow min and max nursery sizes to be set regardless of current values r=sfink

Currently we prevent setting a new minimum value that's greater than the
current maximum value and vice versa.

This is problematic because the caller may not know the current values. For
example, they may want to set both min and max to values that are valid with
respect to each other but not with resepect to existing values. (This is caused
by the fact that the API only allows setting one value at a time but that's a
larger issue.)

Instead, handle this the way we do for all other parmeters. When setting a new
value that invalidates an invariant with repsect to another parmeter, adjust
that other parameter to maintain the invariant.

Differential Revision: https://phabricator.services.mozilla.com/D178527
js/src/gc/Scheduling.cpp
js/src/gc/Scheduling.h
js/src/jit-test/tests/gc/bug-1531626.js