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

1273 Коммитов

Автор SHA1 Сообщение Дата
Jon Coppeard 911a5d3265 Bug 1657850 - Add prefs to control how many background threads are used for GC r=sfink
This adds a thread count for GC parallel tasks calculated from GC parameters
for a helper thread ratio and max helper thread count. It also adds one to
report the number of helper threads used for GC.

This is slightly complicated by the fact that the helper thread system is
per-process and there are potentially many JS runtimes in a process. I
disallowed setting these parameters from workers (i.e. child JS runtimes), but
there may be more than one non-worker JS runtime so this isn't perfect.

I had to swap the mutex order for the GC and helper thread locks.  Whatever
reason they were the other way round seems to have gone and this order makes
more sense to me (I see the GC lock as being 'coarser' than the helper thread
lock).

Differential Revision: https://phabricator.services.mozilla.com/D86725
2020-08-18 15:38:24 +00:00
Csoregi Natalia c9c139cfd7 Backed out changeset fb664f6d43ed (bug 1657850) for failures on helper-thread-params.js. CLOSED TREE 2020-08-13 21:41:13 +03:00
Jon Coppeard df6a3dabdf Bug 1657850 - Add prefs to control how many background threads are used for GC r=sfink
This adds a thread count for GC parallel tasks calculated from GC parameters
for a helper thread ratio and max helper thread count. It also adds one to
report the number of helper threads used for GC.

This is slightly complicated by the fact that the helper thread system is
per-process and there are potentially many JS runtimes in a process. I
disallowed setting these parameters from workers (i.e. child JS runtimes), but
there may be more than one non-worker JS runtime so this isn't perfect.

I had to swap the mutex order for the GC and helper thread locks.  Whatever
reason they were the other way round seems to have gone and this order makes
more sense to me (I see the GC lock as being 'coarser' than the helper thread
lock).

Differential Revision: https://phabricator.services.mozilla.com/D86725
2020-08-13 17:35:04 +00:00
Paul Bone 291ecec432 Bug 1482089 - pt 1. Remove DOM code for processing GCTelemetry r=mccr8
This code glues the JS GC code that creates the telemetry with a JS module
that processes it.  This patch removes this code unhooking these
components.

Differential Revision: https://phabricator.services.mozilla.com/D84163
2020-07-21 05:18:28 +00:00
Jon Coppeard 3cd1ede76a Bug 1648453 - Fix build errors caused by MacOS headers defining check macro r=smaug
These patches have triggered a case where a MacOS header defines 'check' as a macro which then conflicts with use of 'check' as a method name in AccessCheck.h, probably due to unified builds.

This was fixed independently in a couple of places before, but I think it makes sense to move the fix to AccessCheck.h itself.

Differential Revision: https://phabricator.services.mozilla.com/D83796
2020-07-17 17:36:04 +00:00
Razvan Maries 6767314b95 Backed out 4 changesets (bug 1648453) for hazzard bustages on CycleCollectedJSContext.cpp. CLOSED TREE
Backed out changeset 9598a75cca47 (bug 1648453)
Backed out changeset 473e7d55a25e (bug 1648453)
Backed out changeset 0afcee198ecd (bug 1648453)
Backed out changeset 623252539387 (bug 1648453)
2020-07-17 00:01:11 +03:00
Jon Coppeard f283a08ed4 Bug 1648453 - Fix build errors caused by MacOS headers defining check macro r=smaug
These patches have triggered a case where a MacOS header defines 'check' as a macro which then conflicts with use of 'check' as a method name in AccessCheck.h, probably due to unified builds.

This was fixed independently in a couple of places before, but I think it makes sense to move the fix to AccessCheck.h itself.

Differential Revision: https://phabricator.services.mozilla.com/D83796
2020-07-16 15:37:42 +00:00
Simon Giesecke 9364b353d4 Bug 1648010 - Remove NS_NAMED_LITERAL_CSTRING and NS_NAMED_LITERAL_STRING macros. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80631
2020-07-01 08:42:31 +00:00
Simon Giesecke cd8b8939b9 Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Kris Maglione 6aa06b33a7 Bug 1645510: Part 2 - Avoid using the unprivileged junk scope where possible. r=bholley
Differential Revision: https://phabricator.services.mozilla.com/D79720
2020-06-27 03:06:28 +00:00
Tom Schuster 4f64f475f2 Bug 1595046 - Make it possible to inspect every exception value in the web console. r=jonco,baku,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D64437
2020-05-08 20:54:17 +00:00
Steve Fink 3b17c8c75a Bug 1633176 - re-land incremental weakmap marking
Differential Revision: https://phabricator.services.mozilla.com/D74079
2020-05-06 16:38:33 +00:00
Steve Fink 685bd6c5b0 Backed out incremental weakmap marking (bug 1167452 and bug 1633176) to postpone until after Fx77
Differential Revision: https://phabricator.services.mozilla.com/D73394
2020-05-01 00:53:15 +00:00
Jon Coppeard 72eac88fe9 Bug 1633752 - Calculate non-incremental threshold based on heap size and increase it for smaller heaps r=sfink
This adds a splits the non-incremental threshold parameter into one for small heaps and one for large.  What counts as large and small are controlled by the existing parameters that were previously used for dynamic heap growth.  I also renamed the parameter from "non-incremental threshold" to "incremental limit".

The small heap parameter is increased to 1.4.  This avoids non-incremental GC on facebook and reddit as reported in the dependent bugs and allows us to remove the splay latency hack that was previously necessary.

Differential Revision: https://phabricator.services.mozilla.com/D72903
2020-04-29 07:45:19 +00:00
Jon Coppeard d92a182d73 Bug 1633457 - Rename some GC parameters for clarity r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D73012
2020-04-29 21:54:22 +00:00
Jon Coppeard 3f616ab772 Bug 1633405 - Remove dynamic GC options that are enabled everywhere r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D72696
2020-04-28 07:59:47 +00:00
Noemi Erli ccaad0ebc4 Backed out changeset 1fc50aa5c6bc (bug 1633405) for causing bustages in bigint.js CLOSED TREE 2020-04-28 13:49:51 +03:00
Jon Coppeard 896414dfa7 Bug 1633405 - Remove dynamic GC options that are enabled everywhere r=sfink
Differential Revision: https://phabricator.services.mozilla.com/D72696
2020-04-28 07:59:47 +00:00
Sylvestre Ledru 34acbb653a Bug 1619165 - Reformat recent changes to the Google coding style r=andi
First reformat with clang-format 10

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D68802
2020-04-25 09:40:08 +00:00
Jon Coppeard b1f2f8e77a Bug 1630961 - Remove unused heurisitic to delaying GCs that may cause resets r=sfink
A while back we added a heuristic to delay a GC if it would cause a reset (bug 1367455), but it was turned off after it caused a performance regression and hasn't been reenabled since.

Telemetry shows that that only 0.2% of GCs get reset anyway so we should probably just remove this.

Depends on D71328

Differential Revision: https://phabricator.services.mozilla.com/D71329
2020-04-17 17:41:53 +00:00
Steve Fink 744c7084c2 Bug 1167452 - Add a pref to control incremental weakmap marking r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D64824

--HG--
extra : moz-landing-system : lando
2020-04-15 04:30:30 +00:00
Andreas Farre 9e36af2ab6 Bug 1620594 - Part 3: Use default target for timers using SystemGroup. r=nika
Depends on D67632

Differential Revision: https://phabricator.services.mozilla.com/D67633

--HG--
extra : moz-landing-system : lando
2020-04-07 15:16:46 +00:00
Andreas Farre 36eaf82163 Bug 1620594 - Part 2: Use SchedulerGroup::Dispatch instead of SystemGroup::Dispatch. r=nika
Depends on D67631

Differential Revision: https://phabricator.services.mozilla.com/D67632

--HG--
extra : moz-landing-system : lando
2020-04-07 15:16:33 +00:00
Tetsuharu OHZEKI 19cfb39679 Bug 1597442 - Remove the usage of nsIDocShellTreeItem from nsJSContext::MaybeRunNextCollectorSlice(). r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D63609

--HG--
extra : moz-landing-system : lando
2020-03-31 11:57:02 +00:00
Jon Coppeard c1e3671c97 Bug 1624810 - Set the multi-zone JS holder flag on appropriate cycle collected classes r=mccr8
Set the flag on the affected classes, which are:
 - CallbackTimeoutHandler
 - nsJSArgArray
 - CallbackObject
 - Console
 - MessageEvent
 - IDBIndexCursor
 - ExtendableMessageEvent
 - JSPurpleBuffer

Differential Revision: https://phabricator.services.mozilla.com/D68196

--HG--
extra : moz-landing-system : lando
2020-03-26 10:49:06 +00:00
Sebastian Streich 2ed0dc6ea9 Bug 1620684 - Refactor nsJSEnv r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D66042

--HG--
extra : moz-landing-system : lando
2020-03-10 14:21:03 +00:00
Andrew McCreight d5d2276a11 Bug 1620623 - Ignore memory-pressure if we've begun to shut down. r=smaug
If we're in the middle of shutting down a content process, don't GC if we get a
memory pressure event. Shutting down the process is a better way to free memory!
This doesn't seem to happen much, presumably because once we've started
shutting down the content process we ignore new messages, like ones telling
us to do memory-pressure.

Differential Revision: https://phabricator.services.mozilla.com/D65755

--HG--
extra : moz-landing-system : lando
2020-03-06 20:57:08 +00:00
Andrew McCreight cb53fa9bf8 Bug 1619455 - Kill GC/CC timers on content-child-will-shutdown. r=smaug
Hopefully this will reduce the number of shutdown hangs in child processes.

Differential Revision: https://phabricator.services.mozilla.com/D65131

--HG--
extra : moz-landing-system : lando
2020-03-03 16:59:27 +00:00
Andrew McCreight 4babb2b5ab Bug 1609815 - Remove Web Replay C++ implementation. r=jgilbert,jandem,gbrown
Patch by bhackett and jlaster. Also reviewed by mccr8.

Differential Revision: https://phabricator.services.mozilla.com/D60197

--HG--
extra : moz-landing-system : lando
2020-02-27 17:39:15 +00:00
Ciure Andrei 00dd87f6f4 Backed out changeset d407a28318e6 (bug 1609815) for causing windows ming bustages CLOSED TREE
--HG--
extra : histedit_source : b2c748e31e0f6ba8fcf9960a336e0bbd361b07e6
2020-02-27 07:05:19 +02:00
Andrew McCreight b197e1f783 Bug 1609815 - Remove Web Replay C++ implementation. r=jgilbert,jandem,gbrown
Patch by bhackett and jlaster. Also reviewed by mccr8.

Differential Revision: https://phabricator.services.mozilla.com/D60197

--HG--
extra : moz-landing-system : lando
2020-02-27 04:43:48 +00:00
Simon Giesecke d94419173b Bug 1613985 - Use default for equivalent-to-default constructors/destructors in dom/base. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D63102

--HG--
extra : moz-landing-system : lando
2020-02-21 10:41:47 +00:00
Nazım Can Altınova d8afe0647a Bug 1609708 - Rename PROFILER_TRACING to PROFILER_TRACING_MARKER. r=gerald
Depends on D60229

Differential Revision: https://phabricator.services.mozilla.com/D60231

--HG--
extra : moz-landing-system : lando
2020-01-17 21:29:15 +00:00
Chris Peterson 406763af7f Bug 1570499 - Part 1: Replace MOZ_FALLTHROUGH macro with C++17's [[fallthrough]] attribute. r=froydnj
This changeset is a simple find and replace of `MOZ_FALLTHROUGH` and `[[fallthrough]]`.

Unfortunately, the MOZ_FALLTHROUGH_ASSERT macro (to assert on case fallthrough in debug builds) is still necessary after switching from [[clang::fallthrough]] to [[fallthrough]] because:

* MOZ_ASSERT(false) followed by [[fallthrough]] triggers a -Wunreachable-code warning in DEBUG builds
* but MOZ_ASSERT(false) without [[fallthrough]] triggers a -Wimplicit-fallthrough warning in NDEBUG builds.

Differential Revision: https://phabricator.services.mozilla.com/D56440

--HG--
extra : moz-landing-system : lando
2019-12-20 07:16:43 +00:00
Jeff Walden 62a130ba0a Bug 1602882 - Move array operations to a new js/Array.h header. r=sfink,bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D56595

--HG--
extra : moz-landing-system : lando
2019-12-11 06:17:44 +00:00
Jon Coppeard c64814f433 Bug 1600565 - Fix changes to CCRunnerFired made during previous refactoring r=mccr8
One thing I inadvertantly changed was that didDoWork gets set to true even if we don't call FireForgetSkippable and execute what was the third branch of the if statement:

https://searchfox.org/mozilla-central/rev/883d58bccf1a36465ef5ee14b62db0a9925ab85b/dom/base/nsJSEnvironment.cpp#1878-1883

Differential Revision: https://phabricator.services.mozilla.com/D56021

--HG--
extra : moz-landing-system : lando
2019-12-05 18:14:12 +00:00
Gabriele Svelto ace6d1063f Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55442

--HG--
extra : moz-landing-system : lando
2019-12-06 09:24:56 +00:00
Dorel Luca a381d5c96d Backed out changeset f6e53d1c6518 (bug 1600545) for Android build bustage. CLOSED TREE 2019-12-04 17:32:27 +02:00
Gabriele Svelto bc9290f767 Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55442

--HG--
extra : moz-landing-system : lando
2019-12-04 15:01:19 +00:00
Jon Coppeard 59a54ab596 Bug 1599445 - Refactor CCRunnerFired function by writing it as a state machine r=mccr8
This makes the function into a state machine implemented with a switch statement and gets rid of the recursive call. This results in a little duplication of logic but hopefully it is easier to understand overall. What do you think?

Differential Revision: https://phabricator.services.mozilla.com/D54750

--HG--
extra : moz-landing-system : lando
2019-11-27 10:18:17 +00:00
Doug Thayer 97c5d40384 Bug 1586920 - Sometimes include dynamic string of label frames in BHR r=nika
This adds two AUTO_PROFILER_LABEL_DYNAMIC_... macros and updates select
usages of the old macros to use the new ones. These new macros cause
the dynamic string of the label to be included in BHR stacks.

We don't want to do this all of the time, as in many cases we may not
be interested enough in the dynamic string or it may be sensitive
information, but it is rather important information for certain cases.

This uses the same buffer that we use for the strings for JS frames,
and if we fail to fit into that buffer we just append the raw label.

If the string is too long for our static buffer (128 bytes), we just
leave it truncated, as it should be stable and we may be able to infer
from the truncated form what the full form would be.

Differential Revision: https://phabricator.services.mozilla.com/D51665

--HG--
extra : moz-landing-system : lando
2019-11-11 20:27:44 +00:00
Jon Coppeard 902b013ad7 Bug 1592598 - Ensure CC selected zones are scheduled for GC r=sfink,mccr8
The problem is that a GC can be triggered in a number of ways, so scheduling zones in nsJSContext::GarbageCollectNow is not effective. This patch schedules these zones in the GC callback, which is always called at the start of GC. This means we have to change the internal logic slightly to allow the GC callback to schedule addional zones; previously this state was saved and restored before/after running the callback.

Differential Revision: https://phabricator.services.mozilla.com/D51145

--HG--
extra : moz-landing-system : lando
2019-10-30 21:39:07 +00:00
Jon Coppeard 54bb6cf850 Bug 1585697 - Refactor nsJSContext::EndCycleCollectionCallback to split out telemetry and logging code into CycleCollectorStats methods r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D47922

--HG--
extra : moz-landing-system : lando
2019-10-02 17:19:24 +00:00
Jon Coppeard 0485aa7053 Bug 1585697 - Move forget skippable stats into CycleCollectorStats class r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D47920

--HG--
extra : moz-landing-system : lando
2019-10-02 17:19:09 +00:00
Jon Coppeard 53ac617cd2 Bug 1585697 - Make CycleCollectorStats instance static for consistency with other globals r=mccr8
I'm not sure what if there's a preference either way, but all the other globals in nsJSEnvironement.cpp are static so I made the CycleCollectorStats global static too.

Differential Revision: https://phabricator.services.mozilla.com/D47919

--HG--
extra : moz-landing-system : lando
2019-10-02 17:19:00 +00:00
Jon Coppeard acce9ba546 Bug 1585697 - Move CycleCollectorStats definition to the top of the file r=mccr8
This needs to be defined before FireForgetSkippable for the subsequnt patches.

Differential Revision: https://phabricator.services.mozilla.com/D47918

--HG--
extra : moz-landing-system : lando
2019-10-02 17:18:44 +00:00
Jon Coppeard 7630259d43 Bug 1580883 - Use TimeDuration for CycleCollectorStats members r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D45697

--HG--
extra : moz-landing-system : lando
2019-09-18 12:48:46 +00:00
Jon Coppeard f326bb945c Bug 1580883 - Use TimeDuration for remaining global in nsJSEnvironment.cpp r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D45696

--HG--
extra : moz-landing-system : lando
2019-09-18 12:48:32 +00:00
Jon Coppeard 99e7fae124 Bug 1580883 - Use TimeDuration for constants in nsJSEnvironment.cpp r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D45695

--HG--
extra : moz-landing-system : lando
2019-09-18 12:48:23 +00:00
Jon Coppeard 559e2c332d Bug 1580883 - Use TimeStamp/TimeDuration APIs instead of PRTime/PR_Now() in nsJSEnvironment.cpp r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D45693

--HG--
extra : moz-landing-system : lando
2019-09-18 12:48:09 +00:00