Bug 1837620 - Part 3: Don't discard JIT code twice if we sweep in slice started in...
commit0b19b12a2dca1f4e1c8ad8c180ad3d5e027e499d
authorJon Coppeard <jcoppeard@mozilla.com>
Fri, 7 Jul 2023 17:05:44 +0000 (7 17:05 +0000)
committerJon Coppeard <jcoppeard@mozilla.com>
Fri, 7 Jul 2023 17:05:44 +0000 (7 17:05 +0000)
tree5e26117a7d320a75f570cea52e43df5389b22cf6
parent753eab599d84b71cdca53e2eaae690f1083dde63
Bug 1837620 - Part 3: Don't discard JIT code twice if we sweep in slice started in prepare phase r=sfink

We skip the extra discard if we run all the way through to sweeping without
yielding, but if we start a slice in the prepare phase we will do an
unnecessary extra discard. This is probablly quite common since we always yield
at the start of an incremental GC, and budget can be long if we run in idle
time.

Using the flag rather than checking initialState makes it clearer what's going on.

Differential Revision: https://phabricator.services.mozilla.com/D181983
js/src/gc/GC.cpp
js/src/gc/GCRuntime.h
js/src/gc/Sweeping.cpp