Граф коммитов

351 Коммитов

Автор SHA1 Сообщение Дата
Jon Coppeard 8086cc2149 Bug 1833854 - Part 1: Remove the unused JSGC_PRETENURE_GROUP_THRESHOLD GC parameter r=sfink
This has been unused since we removed object groups.

Differential Revision: https://phabricator.services.mozilla.com/D178524
2023-05-22 14:31:40 +00:00
Norisz Fay 34dd3fd540 Backed out 7 changesets (bug 1833854) for causing bustages on Scheduling.cpp CLOSED TREE
Backed out changeset 503290081afb (bug 1833854)
Backed out changeset fccbd85a653c (bug 1833854)
Backed out changeset 6629a120ed76 (bug 1833854)
Backed out changeset 1545749d5317 (bug 1833854)
Backed out changeset ce5f0d5ba79c (bug 1833854)
Backed out changeset 0f2110cf713c (bug 1833854)
Backed out changeset e81efd1cfa8d (bug 1833854)
2023-05-20 12:06:11 +03:00
Jon Coppeard 8a1f52efea Bug 1833854 - Part 1: Remove the unused JSGC_PRETENURE_GROUP_THRESHOLD GC parameter r=sfink
This has been unused since we removed object groups.

Differential Revision: https://phabricator.services.mozilla.com/D178524
2023-05-20 08:29:48 +00:00
Jon Coppeard 47aaf13047 Bug 1830921 - Discard JIT code when disabling or enabling the nursery r=jandem
This makes it so we always discard JIT code when the kinds of GC thing we can
allocate in a zone changes. Previously this happened in two separate places for
pretenuring, and didn't happen when we enabled/disabled the nursery.

Differential Revision: https://phabricator.services.mozilla.com/D177272
2023-05-09 08:47:59 +00:00
Jon Coppeard 66adc8077b Bug 1827621 - Add a mininum heap size threashold at which to use parallel marking r=sfink
Benchmark results show that using parallel marking is not always a win for
small heaps, so add a threshold for its use.

This is set to 10MB, which will result in using parallel marking ~70% of the
time.

This parameter is set to zero for jit-tests and shell js tests so we get test
coverage where heap sizes are expected to be small (and maximum performance is
not a goal).

Differential Revision: https://phabricator.services.mozilla.com/D175249
2023-04-13 16:38:11 +00:00
Jon Coppeard ef8387ded2 Bug 1823286 - Fix documentation comments for JSGC_MAX_EMPTY_CHUNK_COUNT r=jandem DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D173163
2023-03-22 17:59:47 +00:00
Steve Fink 231aa8be0a Bug 1814295 - Handle references in the analysis, in particular AutoCheckCannotGC&&. r=jonco
The hazard analysis needs to be able to pass a parameter of type AutoCheckCannotGC&& that can be considered to be "consumed" either explicitly by calling reset() on it, or given over to a calle with std::move().

Differential Revision: https://phabricator.services.mozilla.com/D170142
2023-03-15 17:43:35 +00:00
Julian Seward 6dbd528357 Bug 1820120 - Manage Wasm{Array,Struct}Object OOL-storage-blocks using a thread-private cache. r=jonco,rhunt.
Wasm{Array,Struct}Objects may be freely nursery-allocated, hence enjoying the
benefits of generational GC.  However, those with out-of-line storage in the
C++ heap (called "trailer blocks" in the patch) have those blocks managed by
js_malloc/js_free.  This is expensive, and especially for objects which don't
get tenured, undercuts the benefit gained from generational GC.

This patch adds to js::Nursery, two new mechanisms:

* a cache of blocks, js::gc::MallocedBlockCache, which are suitable for use as
  trailers.  Allocation and freeing of trailers is done mostly from this
  cache.  A supporting type, js::PointerAndUint7, has also been added, as
  extra data (a freelist ID) is needed when returning blocks to the cache.

* a more limited version of the existing Nursery::mallocedBuffers mechanism.
  The goal is the same -- to enumerate the subtraction of sets of allocated vs
  tenured trailer blocks, at the end of minor GC.  The new version differs in
  that (1) it tracks PointerAndUint7, not void*s, (2) block resizing is not
  supported, and (3) the difference is computed via vector comparison rather
  than a hash set, for performance reasons.

An SMDOC explaining the mechanisms in detail has been added to WasmGcObject.cpp.

Differential Revision: https://phabricator.services.mozilla.com/D171551
2023-03-07 22:05:59 +00:00
Jon Coppeard 82dbe984bc Bug 1812268 - Add a GC parameter to control the number of threads used for parallel marking r=sfink
This also adds a shell option to set the parameter.

Care is taken to avoid using more threads than we start parallel GC tasks for
as otherwise we can deadlock.

Differential Revision: https://phabricator.services.mozilla.com/D167783
2023-01-25 17:20:04 +00:00
Jon Coppeard 641c66c5a4 Bug 1802897 - Part 1: Add a pref for parallel marking, disabled by default r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D163461
2022-12-07 12:58:49 +00:00
Cristian Tuns 58e3b12e8a Backed out 13 changesets (bug 1802897) for causing build bustages on Marking.cpp CLOSED TREE
Backed out changeset 61a336a6d2c9
Backed out changeset 5c3c2afd76af (bug 1802897)
Backed out changeset 1b2d9c4afee8 (bug 1802897)
Backed out changeset bf236f6a197c (bug 1802897)
Backed out changeset b3e82a32e13e (bug 1802897)
Backed out changeset 9fcff7ae8aac (bug 1802897)
Backed out changeset f21b54985888 (bug 1802897)
Backed out changeset d6c6eaa2508a (bug 1802897)
Backed out changeset ab00bd1ada69 (bug 1802897)
Backed out changeset f98def4568e6 (bug 1802897)
Backed out changeset 68880308ca96 (bug 1802897)
Backed out changeset 73ad67b6e4f6 (bug 1802897)
Backed out changeset 28c061eb2993 (bug 1802897)
2022-12-06 14:44:08 -05:00
Jon Coppeard 0c7ec55801 Bug 1802897 - Part 1: Add a pref for parallel marking, disabled by default r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D163461
2022-12-06 18:19:28 +00:00
Jon Coppeard c9b0e72b33 Bug 1797755 - Part 4: Remove option to set maximum mark stack capacity in release builds r=sfink
Currently we have a GC parameter that allows setting a maximum mark stack
capacity. This is only ever used by test code, not in the browser. This
requires extra unnecessary work in release builds if we move to a different
stack representation as we won't be able to fold the comparison into the
current capacity check as we do now.

The patch makes this feature condtional on JS_GC_ZEAL.

Depends on D160526

Differential Revision: https://phabricator.services.mozilla.com/D160527
2022-10-28 15:17:43 +00:00
Iulian Moraru 15e9bd170d Backed out 5 changesets (bug 1797755) for causing bp-hybrid bustages on Marking.cpp.
Backed out changeset 7cda151d97a5 (bug 1797755)
Backed out changeset 098569654f17 (bug 1797755)
Backed out changeset 6e5a935e576a (bug 1797755)
Backed out changeset eb109d0ce408 (bug 1797755)
Backed out changeset 186a012563fc (bug 1797755)
2022-10-28 17:37:22 +03:00
Jon Coppeard 99f39c9c1b Bug 1797755 - Part 4: Remove option to set maximum mark stack capacity in release builds r=sfink
Currently we have a GC parameter that allows setting a maximum mark stack
capacity. This is only ever used by test code, not in the browser. This
requires extra unnecessary work in release builds if we move to a different
stack representation as we won't be able to fold the comparison into the
current capacity check as we do now.

The patch makes this feature condtional on JS_GC_ZEAL.

Depends on D160526

Differential Revision: https://phabricator.services.mozilla.com/D160527
2022-10-28 09:47:14 +00:00
Cristian Tuns 16e757373f Backed out 5 changesets (bug 1797755) for causing spidermonkey bustages CLOSED TREE
Backed out changeset 27d9b7db5e1c (bug 1797755)
Backed out changeset f207beed6252 (bug 1797755)
Backed out changeset 4746d15d7a9f (bug 1797755)
Backed out changeset 8be86d9e2f18 (bug 1797755)
Backed out changeset 9a3821fa6bb8 (bug 1797755)
2022-10-27 14:57:28 -04:00
Jon Coppeard 60ce070cab Bug 1797755 - Part 4: Remove option to set maximum mark stack capacity in release builds r=sfink
Currently we have a GC parameter that allows setting a maximum mark stack
capacity. This is only ever used by test code, not in the browser. This
requires extra unnecessary work in release builds if we move to a different
stack representation as we won't be able to fold the comparison into the
current capacity check as we do now.

The patch makes this feature condtional on JS_GC_ZEAL.

Depends on D160526

Differential Revision: https://phabricator.services.mozilla.com/D160527
2022-10-27 18:23:03 +00:00
Jon Coppeard 26490d4e4f Bug 1770768 - Part 6: Calculate balanced heap limits r=sfink
This patch adds the calculation of the heap limit based on the formula from the paper.

Differential Revision: https://phabricator.services.mozilla.com/D152867
2022-08-02 10:05:06 +00:00
Jon Coppeard 0ebad143ef Bug 1770768 - Part 3: Add browser prefs for the new GC parameters r=mccr8,sfink
Differential Revision: https://phabricator.services.mozilla.com/D152864
2022-08-02 10:05:05 +00:00
Jon Coppeard d5ad2725fb Bug 1770768 - Part 2: Add a GC parameter for the heap growth factor used when balanced heap limits are enabled r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D152863
2022-08-02 10:05:05 +00:00
Jon Coppeard 9d60e6b077 Bug 1770768 - Part 1: Add a GC parameter to enable or disable balanced heap limits r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D152862
2022-08-02 10:05:04 +00:00
Sylvestre Ledru 42f6811d95 Bug 1519636 - Reformat recent changes to the Google coding style r=andi,media-playback-reviewers,necko-reviewers,padenot,dragana
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D148375
2022-06-07 12:32:55 +00:00
Steve Fink 20289c208c Bug 1661293 - Make nsJSContext::MaybePokeGC trigger eager minor GCs, and change the naming to support later adding EAGER_ALLOC_TRIGGER major GCs r=jonco,smaug
Differential Revision: https://phabricator.services.mozilla.com/D100368
2022-06-06 22:53:11 +00:00
Steve Fink 2a988c91ec Bug 1661293 - Rename JS::RunIdleGCTask -> JS::MaybeRunNurseryCollection and pass through the reason, also rename IDLE_TIME_COLLECTION -> EAGER_NURSERY_COLLECTION. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D139208
2022-06-06 22:53:10 +00:00
Norisz Fay 61cd14ddcd Backed out 6 changesets (bug 1661293) for causing Bug 1758370 CLOSED TREE
Backed out changeset 8f4d646a4bf6 (bug 1661293)
Backed out changeset ec817d9e8a17 (bug 1661293)
Backed out changeset efd35f1d9bd5 (bug 1661293)
Backed out changeset 00d93cc6125f (bug 1661293)
Backed out changeset 77b0b0003ca0 (bug 1661293)
Backed out changeset 04443fa474ac (bug 1661293)
2022-03-23 17:04:22 +02:00
Jon Coppeard d40ccf2be0 Bug 1757956 - Part 3: Rename JSFreeOp to JS::GCContext in the JS engine r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D140525
2022-03-10 08:40:03 +00:00
Steve Fink c4fe49a03c Bug 1661293 - Make nsJSContext::MaybePokeGC trigger EAGER_ALLOC_TRIGGER major GCs instead of just eager minor GCs r=jonco,smaug
Differential Revision: https://phabricator.services.mozilla.com/D100368
2022-03-03 04:21:48 +00:00
Steve Fink 2b82b28cfd Bug 1661293 - Rename JS::RunIdleGCTask -> JS::MaybeRunNurseryCollection and pass through the reason, also rename IDLE_TIME_COLLECTION -> EAGER_NURSERY_COLLECTION. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D139208
2022-03-03 04:21:47 +00:00
Jon Coppeard 495e25eed1 Bug 1753958 - Part 3: Add a GCOption for shutdown GCs and use this rather than checking the GCReason r=sfink,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D138555
2022-02-15 09:45:06 +00:00
Steve Fink e10fc3efba Bug 1738096 - Compute Gecko-triggered GC slice budget in Gecko and pass SliceBudget object all the way through r=jonco,smaug
Differential Revision: https://phabricator.services.mozilla.com/D131705
2022-02-05 00:57:19 +00:00
Marian-Vasile Laza 46d7b2b63d Backed out 3 changesets (bug 1738096, bug 1747274) for causing build bustages on FuzzingFunctions.cpp. CLOSED TREE
Backed out changeset 00999caca48d (bug 1738096)
Backed out changeset eee1c8ccba69 (bug 1738096)
Backed out changeset 3593d4dcf5a1 (bug 1747274)
2022-02-04 07:48:24 +02:00
Steve Fink 94046c7803 Bug 1738096 - Compute Gecko-triggered GC slice budget in Gecko and pass SliceBudget object all the way through r=jonco,smaug
Differential Revision: https://phabricator.services.mozilla.com/D131705
2022-02-04 02:33:25 +00:00
Steve Fink 2984f44b93 Bug 1746090 - Switch RootList::init from taking an AutoCheckCannotGC token to returning one r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D135297
2022-01-22 01:34:45 +00:00
Noemi Erli 3da595ab6f Backed out 10 changesets (bug 1746090) for causing failures in HeapSnapshot.cpp CLOSED TREE
Backed out changeset 132c6be41ec2 (bug 1746090)
Backed out changeset aea63ceb5ff5 (bug 1746090)
Backed out changeset 42586bdfd56f (bug 1746090)
Backed out changeset 86dfecd590e8 (bug 1746090)
Backed out changeset 92a55bc8c1c8 (bug 1746090)
Backed out changeset 3a282a6b5f65 (bug 1746090)
Backed out changeset fe5ac63668b4 (bug 1746090)
Backed out changeset a0b1735ffffd (bug 1746090)
Backed out changeset 2f7a62b93266 (bug 1746090)
Backed out changeset b9b4558c03dc (bug 1746090)
2022-01-21 02:58:48 +02:00
Steve Fink fb8fc947c7 Bug 1746090 - Switch RootList::init from taking an AutoCheckCannotGC token to returning one r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D135297
2022-01-20 23:40:29 +00:00
Marian-Vasile Laza 5e48e30b98 Backed out 10 changesets (bug 1746090) for causing build bustages on TestingFunctions.cpp. CLOSED TREE
Backed out changeset edbf96722e4b (bug 1746090)
Backed out changeset f4e4bf6ba8ff (bug 1746090)
Backed out changeset c288fe1c6c84 (bug 1746090)
Backed out changeset 2b0caa13d0fc (bug 1746090)
Backed out changeset 1ed9d77885c6 (bug 1746090)
Backed out changeset 54a60388fb11 (bug 1746090)
Backed out changeset a9c16e721533 (bug 1746090)
Backed out changeset 774bdb9939a9 (bug 1746090)
Backed out changeset 5c5742535301 (bug 1746090)
Backed out changeset ff509fe4671d (bug 1746090)
2022-01-20 02:39:17 +02:00
Steve Fink aea0c2fa07 Bug 1746090 - Switch RootList::init from taking an AutoCheckCannotGC token to returning one r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D135297
2022-01-20 00:23:10 +00:00
Kagami Sascha Rosylight 624a3640bf Bug 1669552 - Add TestUtils support for WPT r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D135942
2022-01-14 18:36:59 +00:00
Steve Fink ec62429c88 Bug 1672121 - Implement interruptible GC slice budgets r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D109630
2021-12-22 18:06:06 +00:00
Iulian Moraru 193ccd13ad Backed out 5 changesets (bug 1672121) for various crashes on mozalloc_handle_oom. CLOSED TREE
Backed out changeset 117756828ea7 (bug 1672121)
Backed out changeset 046e37035dbc (bug 1672121)
Backed out changeset de44a280103b (bug 1672121)
Backed out changeset 4acf4539a7b4 (bug 1672121)
Backed out changeset 8001b5433e38 (bug 1672121)
2021-11-30 02:59:20 +02:00
Steve Fink 0181c4d9ce Bug 1672121 - Implement interruptible GC slice budgets r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D109630
2021-11-29 19:59:52 +00:00
Tooru Fujisawa e9ea4e3088 Bug 538450 - Part 6: Remove GCRuntime::triggerFullGCForAtoms. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D131368
2021-11-19 04:43:08 +00:00
Jon Coppeard 163eb9cddd Bug 1740254 - Check GC heap parameters are reasonable r=sfink
This adds a 4GB max limit for GC parameters related to heap size and fixes the
test that set this to an over-large value.

Differential Revision: https://phabricator.services.mozilla.com/D130749
2021-11-15 09:35:41 +00:00
Jon Coppeard 0060571eef Bug 1737240 - Part 1: Implement JS_UpdateWeakPointerAfterGC APIs using TraceWeakEdge r=mccr8,sfink
This requires passing the JSTracer through to these APIs. They also get a
boolean return value that simplifies their use a little.

Differential Revision: https://phabricator.services.mozilla.com/D129243
2021-11-10 13:01:42 +00:00
Jon Coppeard 772dfd06f5 Bug 1736602 - Part 1: Pass JSTracer to embedding callbacks which update weak pointers after moving GC r=sfink
The callbacks previously took a JSContext pointer which was never used.

Differential Revision: https://phabricator.services.mozilla.com/D128899
2021-11-08 12:23:55 +00:00
Sandor Molnar 0f0829d865 Backed out 2 changesets (bug 1736602) for causing bug 1737399. CLOSED TREE
Backed out changeset f5ca68c50650 (bug 1736602)
Backed out changeset 4a1e6cfd73ef (bug 1736602)
2021-10-28 22:18:29 +03:00
Jon Coppeard 4c692b76eb Bug 1736602 - Part 1: Pass JSTracer to embedding callbacks which update weak pointers after moving GC r=sfink
The callbacks previously took a JSContext pointer which was never used.

Differential Revision: https://phabricator.services.mozilla.com/D128899
2021-10-20 09:21:39 +00:00
Jon Coppeard ec270942e3 Bug 1536061 - Part 1: Change the gray root trace hook to allow gray roots to be marked incrementally r=sfink,mccr8
This adds a slice budget parameter and boolean return value to indicate whether tracing has finished.

Differential Revision: https://phabricator.services.mozilla.com/D125558
2021-10-10 11:06:50 +00:00
Jon Coppeard 94744c89a1 Bug 1731432 - Fix marking of gray roots during compacting GC r=sfink
There's a pretty serious bug in bug 1730140 which is that the check for whether
to trace a zone's gray roots only checks whether it is being marked gray, but
we also need to mark these roots when compacting. This only affects GCs when
we're not collecting the atoms zone though because we mark everything in that
case.

So this is a plausible culprit for the crashes here, which would have been
hidden by bug 1728273 since that made all compacting GCs full GCs.

Differential Revision: https://phabricator.services.mozilla.com/D126509
2021-09-23 15:06:43 +00:00
Marian-Vasile Laza 77d39d312e Backed out 3 changesets (bug 1536061) for conflicts with backout of bug 1730534 a=backout.
Backed out changeset 248ec4a96a70 (bug 1536061)
Backed out changeset 8c9135ac1d10 (bug 1536061)
Backed out changeset 08cdd990b675 (bug 1536061)
2021-09-20 13:20:17 +03:00