Bug 1833854 - Part 3: Allow min and max nursery sizes to be set regardless of current...
commit7bd857f0429225079a0a789c21e3f3c4b6737a39
authorJon Coppeard <jcoppeard@mozilla.com>
Mon, 22 May 2023 14:31:40 +0000 (22 14:31 +0000)
committerJon Coppeard <jcoppeard@mozilla.com>
Mon, 22 May 2023 14:31:40 +0000 (22 14:31 +0000)
tree969420241a701b5fa3197c9bbe77443e7a71f41c
parente95ca1fcbac17cee89a41da149dc69b97ecea46d
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