Commit Graph
501 Commits
Author SHA1 Message Date
Iulian Moraru 890273720e Backed out 5 changesets (bug 1904429) for causing ThreadSanitizer linux tsan failures.
Backed out changeset 787f23230ebd (bug 1904429)
Backed out changeset 81e85421af01 (bug 1904429)
Backed out changeset 9bf9011b0736 (bug 1904429)
Backed out changeset a59511524bc7 (bug 1904429)
Backed out changeset e74a80333551 (bug 1904429)
2024-08-22 23:57:12 +03:00
Matthew Gaudet 4a16c973d1 Bug 1904429 - Connect JS_LOG to MOZ_LOG via the JS Logging interface r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D217875
2024-08-22 17:06:00 +00:00
Tamas Szentpeteri 6b4d7b4396 Backed out changeset 316531363a05 (bug 1904810) for not fixing the regressions. CLOSED TREE 2024-07-09 19:31:17 +03:00
Jon Coppeard e60e4c8754 Bug 1904810 - Add an API to drop a JS holder that has already been cleared r=mccr8
This adds an optional second argument to DropJSObjects to allow skipping
clearing of JS references in cases where that has already happened. In debug
builds it asserts that such references have already been cleared.

This is then used in CallbackObject::Reset.

Differential Revision: https://phabricator.services.mozilla.com/D215493
2024-07-03 10:06:31 +00:00
Steve Fink 242858bbc1 Bug 1899872 - Move SliceBudget (and {Work,Time}Budget) from js:: namespace to JS:: r=jonco,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D212303
2024-06-21 16:22:26 +00:00
pstanciu 66663d5583 Backed out changeset e38543d56e9b (bug 1899872) for causing build bustages CLOSED TREE 2024-06-19 01:26:07 +03:00
Steve Fink 043e1856ca Bug 1899872 - Move SliceBudget (and {Work,Time}Budget) from js:: namespace to JS:: r=jonco,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D212303
2024-06-18 21:46:32 +00:00
Noemi Erli f0cee3546c Backed out changeset 2753b7c1309f (bug 1899872) for causing build bustages in testSliceBudget.cpp CLOSED TREE 2024-06-13 03:05:33 +03:00
Steve Fink 180361fc44 Bug 1899872 - Move SliceBudget (and {Work,Time}Budget) from js:: namespace to JS:: r=jonco,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D212303
2024-06-12 23:01:12 +00:00
Jon Coppeard 999df33c62 Bug 1900050 - Optimize CycleCollectedRuntime's sweeping of nursery wrappers a little r=sfink,mccr8
This adds js::gc::InCollectedNurseryRegion which is fully inlinable and makes
JSObjectsTenured call the finalizers directly.

I don't think this makes a massive difference but it's still probably worth
doing.

Differential Revision: https://phabricator.services.mozilla.com/D212290
2024-06-01 09:08:04 +00:00
Steve Fink ab23205e94 Bug 1899620 - Emit MinorGC markers for all JS running threads, not just mainthread r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D212053
2024-06-01 03:06:37 +00:00
Emilio Cobos Álvarez 2808374848 Bug 1892257 - Move nsStringBuffer to mfbt. r=nika,xpcom-reviewers,glandium
Inline Create() and Realloc() so that we don't get negative leaks, since
were that code end up in mozglue, it wouldn't have access to the logging
machinery.

Differential Revision: https://phabricator.services.mozilla.com/D209663
2024-05-14 14:24:26 +00:00
Jon Coppeard 70a044c196 Bug 1787526 - Part 18: Browser integration for semispace nursery r=sfink
This filters CycleCollectedRuntime::mNurseryObjects so that only objects that
have died are finalized, and objects promoted to the second nursery generation
remain. Also a post barrier is added when updating a wrapper cache object.

I'll ask Andrew for review on this too when it gets closer to landing.

Differential Revision: https://phabricator.services.mozilla.com/D196451
2024-03-18 16:13:58 +00:00
Bas Schouten a64f018d79 Bug 1883088: Fix string encoding specification on GCMajor marker payload. r=mstange DONTBUILD
Differential Revision: https://phabricator.services.mozilla.com/D203295
2024-03-07 18:20:13 +00:00
Gabriele Svelto e1e9346196 Bug 1831092 - Use the new pull-based API for all crash annotations and remove the global annotations table r=jgilbert,necko-reviewers,media-playback-reviewers,profiler-reviewers,win-reviewers,padenot,handyman,afranchuk,valentin,alwu,sotaro
This changes comes with several different refactorings all rolled into one,
unfotunately I couldn't find a way to pull them apart:
- First of all annotations now can either recorded (that is, we copy the value
  and have the crash reporting code own the copy) or registered. Several
  annotations are changed to use this functionality so that we don't need to
  update them as their value change.
- The code in the exception handler is modified to read the annotations from
  the mozannotation_client crate. This has the unfortunate side-effect that
  we need three different bits of code to serialize them: one for annotations
  read from a child process, one for reading annotations from the main process
  outside of the exception handler and one for reading annotations from the
  main process within the exception handler. As we move to fully
  out-of-process crash reporting the last two methods will go away.
- The mozannotation_client crate now doesn't record annotation types anymore.
  I realized as I was working on this that storing types at runtime has two
  issues: the first one is that buggy code might change the type of an
  annotation (that is record it under two different types at two different
  moments), the second issue is that types might become corrupt during a
  crash, so better enforce them at annotation-writing time. The end result is
  that the mozannotation_* crates now only store byte buffers, track the
  format the data is stored in (null-terminated string, fixed size buffer,
  etc...) but not the type of data each annotation is supposed to contain.
- Which brings us to the next change: concrete types for annotations are now
  enforced when they're written out. If an annotation doesn't match the
  expected type it's skipped. Storing an annotation with the wrong type will
  also trigger an assertion in debug builds.

Differential Revision: https://phabricator.services.mozilla.com/D195248
2024-03-04 10:24:43 +00:00
Bas Schouten 8884cd5257 Bug 1869835 - Part 3: Convert CC/GC markers to the new MarkerSchema so it gets full ETW support. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D196374
2023-12-21 18:17:41 +00:00
Jon Coppeard cc69a9222d Bug 1865383 - Check slice budget when we start marking or sweeping r=sfink
The patch forces a budget check when we start marking or sweeping unless we
have just started a GC slice in the current state.

This turned out more complicated than expected because the change caused a test
that called gcslice(1) in a loop to not make any progress. This was because the
original stepAndForceCheck() method ate the single unit of work budget. The fix
was to remove the step part of this method. I don't think any of the callers
need it to step the budget as well.

Differential Revision: https://phabricator.services.mozilla.com/D193925
2023-11-20 16:28:11 +00:00
Andrew McCreight 104da93926 Bug 1862782, part 2 - Split out cases where we must never immediately finalize. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D192639
2023-11-03 14:27:22 +00:00
Andrew McCreight 3d95e8df4e Bug 1862782, part 1 - Move DeferredFinalizeType to CycleCollectedJSRuntime. r=smaug
I'm guessing that it got moved into the wrong file for the Quantum DOM
split into CCJSContext and CCJSRuntime. The only use is in the latter
so it makes sense to have it there.

Differential Revision: https://phabricator.services.mozilla.com/D192638
2023-11-03 14:27:22 +00:00
Tooru Fujisawa e44eade94e Bug 1858040 - Part 2: Add FunctionFlags::LAZY_ACCESSOR_NAME to lazily create accessor function name from unprefixed name. r=jandem
For accessors with FunctionFlags::LAZY_ACCESSOR_NAME, JSFunction::AtomSlot
contains unprefixed name.

This patch also split existing methods and APIs for function name into 3:
  1. infallible, and can return unprefixed name
  2. fallible, and returns correct name
  3. (internal only) infallibe, and returns correct name (only for functions known to not have FunctionFlags::LAZY_ACCESSOR_NAME)

If the result doesn't have to be exactly correct name, for example if it's for
debug logging or profiler marker, the 1st infallible functions are used.

Differential Revision: https://phabricator.services.mozilla.com/D191457
2023-10-27 22:08:04 +00:00
Adam Brouwers-Harries 4a2ba69cbc Bug 1421651 - Remove obseleted timeline and TimelineMarker code r=canaltinova,webidl,devtools-reviewers,saschanaz,smaug,ochameau
This patch removes the old docshell timeline and timeline markers codebase and replaces them with equivalent Gecko profiler marker. This patch also fixes Bug 1834143, which is a subset of 1421651.

Differential Revision: https://phabricator.services.mozilla.com/D184217
2023-10-24 15:18:12 +00:00
Narcis Beleuzu 67b61b8b2c Backed out changeset 714aaf6484fb (bug 1421651) for causing Bug 1860719. CLOSED TREE 2023-10-24 17:31:02 +03:00
Adam Brouwers-Harries 720e582a3a Bug 1421651 - Remove obseleted timeline and TimelineMarker code r=canaltinova,webidl,devtools-reviewers,saschanaz,smaug,ochameau
This patch removes the old docshell timeline and timeline markers codebase and replaces them with equivalent Gecko profiler marker. This patch also fixes Bug 1834143, which is a subset of 1421651.

Differential Revision: https://phabricator.services.mozilla.com/D184217
2023-10-23 13:55:50 +00:00
Jon Coppeard 8f4e660dcd Bug 1846835 - Part 1: Allow the same nursery collection callback to be registered more than once r=sfink
This adds the data parameter to the remove API and only removes when both
callback and data argument match, allowing the same callback to be registered
more than once with different data pointers. This also asserts that the
callback is found when removal is requestd.

Differential Revision: https://phabricator.services.mozilla.com/D185306
2023-08-07 08:46:59 +00:00
Jon Coppeard 9c451e1f32 Bug 1713022 - Part 1: Allow more than one nursery collection callback r=sfink
This extends the nursery collection callback mechanism in line with the other
GC callbacks. It also moves the location the callback is stored to GCRuntime
like the other callbacks, rather than Statistics.

Differential Revision: https://phabricator.services.mozilla.com/D184000
2023-07-19 18:31:39 +00:00
Kris Maglione 05f4be4468 Bug 1563825: Don't assert on failure to decode message after OOM. r=mccr8
Ideally, we don't want to continue running a child process if it fails to
handle a message from the parent, since that could mean child and parent state
could get out of sync. But since this assertion is only a diagnostic assert,
it isn't guaranteeing that in release builds anyway. And since the vast
majority of the crashes we are seeing in builds with diagnostic asserts
enabled appear to be OOMs, we can't really use crash reports to diagnose other
issues.

Ideally (again), we'd determine if the failure was caused by an OOM based on
the failure code returned by the structured clone decode call. Unfortunately,
though, since the spec requires that we return a generic `DataCloneError` on
failure, the structured clone code intentionally hides the specifics of
failure from callers. Propagating out more specific failure reasons for use by
privileged callers is nontrivial. So this patch essentially does the same
thing as crash reports do, and checks whether an OOM was reported recently,
and hasn't been recovered from by a successful GC.

Differential Revision: https://phabricator.services.mozilla.com/D176288
2023-04-25 06:46:42 +00:00
Jon Coppeard 1609f5219b Bug 1785804 - Part 2: Remove tracing name context and pass name through the trace methods r=sfink
One point of difference between the DoMarking fast path and other tracers is
handling the edge name. Passing this through to the concrete tracer and
handling it there removes this differemce.

Eventually we should be able to inline some of these these calls at which point
it should get optimsed away for tracers that ignore it.

Depends on D156559

Differential Revision: https://phabricator.services.mozilla.com/D156560
2022-09-07 09:49:58 +00:00
Olli Pettay 048bd344c4 Bug 1777574, automate CC zone handling, r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D155084
2022-09-07 11:22:51 +00:00
Butkovits Atila cbb4c622a9 Backed out 7 changesets (bug 1785804) for causing reftest crashes at @ mozilla::dom::Promise::MaybeReject(nsresult). CLOSED TREE
Backed out changeset 31ef32f519f2 (bug 1785804)
Backed out changeset 361dc2862d74 (bug 1785804)
Backed out changeset 27771c8d9865 (bug 1785804)
Backed out changeset f9e864cd34a6 (bug 1785804)
Backed out changeset a115e9eaffee (bug 1785804)
Backed out changeset 271975a555d0 (bug 1785804)
Backed out changeset 55855c5ad184 (bug 1785804)
2022-09-07 14:09:56 +03:00
Jon Coppeard 63caab8bab Bug 1785804 - Part 2: Remove tracing name context and pass name through the trace methods r=sfink
One point of difference between the DoMarking fast path and other tracers is
handling the edge name. Passing this through to the concrete tracer and
handling it there removes this differemce.

Eventually we should be able to inline some of these these calls at which point
it should get optimsed away for tracers that ignore it.

Depends on D156559

Differential Revision: https://phabricator.services.mozilla.com/D156560
2022-09-07 09:49:58 +00:00
Steve Fink f08af29c37 Bug 1774651 - Add a MinorGC perfstat measurement r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D149556
2022-06-30 17:36:32 +00:00
Nika Layzell 8f1c2692df Bug 1758115 - Part 2: Streamline locking, initialization and shutdown for TimelineConsumers, r=smaug
The current implementation of TimelineConsumers contains some unnecessary
complexity due to how it is initialized as a singleton, and the need for it to
be initialized and used in a threadsafe way. This patch attempts to simplify it
by making all members static, and removing the need to explicitly observe
shutdown for cleanup.

In addition, this approach avoids the risk of the type being accessed from
off-main-thread during initialization or shutdown.

Depends on D150442

Differential Revision: https://phabricator.services.mozilla.com/D150443
2022-06-29 15:01:51 +00:00
Matthew Gaudet 82a7de2802 Bug 1747059 - Gecko support for ShadowRealms r=peterv,smaug
This connects [Exposed=*] in WebIDL to ShadowRealms

Differential Revision: https://phabricator.services.mozilla.com/D146349
2022-06-28 22:04:18 +00:00
Csoregi Natalia d91db2b437 Backed out 9 changesets (bug 1747059, bug 1767525)for causing hazard failures on ShadowRealmGlobalScope.cpp. CLOSED TREE
Backed out changeset ed7aad37f2cf (bug 1747059)
Backed out changeset 40a257fb4788 (bug 1747059)
Backed out changeset f7b049ef3b8c (bug 1747059)
Backed out changeset aad38abc7139 (bug 1747059)
Backed out changeset 8115813e77a5 (bug 1747059)
Backed out changeset e06192e664fd (bug 1747059)
Backed out changeset a198b0893220 (bug 1767525)
Backed out changeset c083f0824619 (bug 1767525)
Backed out changeset 9a3bf794ec6d (bug 1767525)
2022-06-28 02:39:08 +03:00
Matthew Gaudet c024226c18 Bug 1747059 - Gecko support for ShadowRealms r=peterv,smaug
This connects [Exposed=*] in WebIDL to ShadowRealms

Differential Revision: https://phabricator.services.mozilla.com/D146349
2022-06-27 21:17:36 +00:00
Jon Coppeard 796193115a Bug 1768734 - Make sure JS holders are cleared before a shutdown GC r=mccr8
Previously this was optimized to trace only gray roots in collecting zones, but
there was a bug in that it also skipped clearing roots because this happens
before the start of GC when zones are selected for collection.

Instead, make sure we only perform this optimziation when marking.

Differential Revision: https://phabricator.services.mozilla.com/D146585
2022-05-18 09:04:05 +00:00
Jon Coppeard bb93c13d5b Bug 1764796 - Use the store buffer to trace preserved nursery wrappers in a minor GC r=mccr8
HeapObjectPostWriteBarrier adds or removes a store buffer entry for a change in
the GC graph entry based on the second and third arguments which are the target
of the edge before and after the change.

This patch also removes the store buffer entry in
nsWrapperCache::ReleaseWrapper which didn't happen before. This should help
keep less garbage alive unnecessarily.

Differential Revision: https://phabricator.services.mozilla.com/D143736
2022-04-19 08:48:33 +00:00
Jon Coppeard 9be1878a57 Bug 1763658 - Part 5: Remove unused tracing option r=jandem
This was only used in the ObjectGroup trace hook.

Differential Revision: https://phabricator.services.mozilla.com/D143348
2022-04-11 11:48:14 +00:00
Jon Coppeard ff4063c959 Bug 1759174 - Part 2: Optimize GCThingIsMarkedGray APIs by removing check for shared GC things r=sfink,mccr8
This splits the API into two, one that does a bunch of checks and calls into
the JS engine, and one for use by the CC where all preconditions are assumed to
be satisfied and can be inlined entirely.

Depends on D140865

Differential Revision: https://phabricator.services.mozilla.com/D140866
2022-03-14 11:13:52 +00:00
Jon Coppeard 222416decc 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
Jon Coppeard e9b99a2b4d 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
Jan de Mooij e4c7f2a49d Bug 1754405 part 8 - Rename JSID_VOID to PropertyKey::Void(). r=evilpie
Differential Revision: https://phabricator.services.mozilla.com/D138279
2022-02-13 12:01:46 +00:00
Steve Fink f0147d6446 Bug 1672121 - Don't bother resetting the budget that is going to be recreated for every slice anyway r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D131399
2021-11-29 19:59:52 +00:00
Steve Fink 46a0634d84 Bug 1672121 - Make SliceBudget::isOverBudget non-destructive and require explicit resetting of over-budget state r=jonco,smaug
Differential Revision: https://phabricator.services.mozilla.com/D131390
2021-11-29 19:59:51 +00:00
Jon Coppeard 810fb77288 Bug 1693775 - Change CallbackTracer::onChild to pass GCCellPtr by value r=sfink,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D131142
2021-11-16 09:09:37 +00:00
Gerald Squelart 8c94ff82ed Bug 1738627 - profiler_thread_is_being_profiled_for_markers - r=canaltinova
`profiler_thread_is_being_profiled` is used a lot for markers, so it makes sense to have a specialized version, which is a bit shorter, and lives in ProfilerMarkers.h.

Differential Revision: https://phabricator.services.mozilla.com/D130009
2021-11-08 23:59:35 +00:00
Cristian Tuns 839b72e1d3 Backed out 5 changesets (bug 1738627) for causing xpcshell failures on test_ext_geckoProfiler_schema.js CLOSED TREE
Backed out changeset 42d385d7da97 (bug 1738627)
Backed out changeset edeb3a338954 (bug 1738627)
Backed out changeset 98f02e35134d (bug 1738627)
Backed out changeset 711daa6dd24b (bug 1738627)
Backed out changeset 49e12753a40c (bug 1738627)
2021-11-05 05:12:28 -04:00
Gerald Squelart 019bfd575e Bug 1738627 - profiler_thread_is_being_profiled_for_markers - r=canaltinova
`profiler_thread_is_being_profiled` is used a lot for markers, so it makes sense to have a specialized version, which is a bit shorter, and lives in ProfilerMarkers.h.

Differential Revision: https://phabricator.services.mozilla.com/D130009
2021-11-05 05:52:28 +00:00
Jon Coppeard 0fde81c99d Bug 1536061 - Part 2: Support tracing gray roots incrementally in the cycle collector r=mccr8
This stores the iterator state between slices to allow us to trace these
incrementally.

Differential Revision: https://phabricator.services.mozilla.com/D125559
2021-10-10 11:06:50 +00:00
Jon Coppeard 1fd62feebd 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