[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser] 135/311: Bug 1752861 - [profiler] Expose GC and CC operations to the JS view r=sfink, smaug, a=dmeehan



This is an automated email from the git hooks/post-receive script.

pierov pushed a commit to branch geckoview-99.0.1-11.0-1
in repository tor-browser.

commit 9ca8331321e477218077b4c8dc04a53d8d35b355
Author: Julien Wajsberg <felash@xxxxxxxxx>
AuthorDate: Fri Mar 11 09:18:31 2022 +0000

    Bug 1752861 - [profiler] Expose GC and CC operations to the JS view r=sfink,smaug, a=dmeehan
    
    Differential Revision: https://phabricator.services.mozilla.com/D140390
---
 dom/base/nsJSEnvironment.cpp      | 5 +++--
 js/xpconnect/src/XPCJSRuntime.cpp | 1 +
 xpcom/base/nsCycleCollector.cpp   | 4 ++--
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp
index 0e7d71722834e..82db36d86cbaa 100644
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -1081,6 +1081,7 @@ void nsJSContext::GarbageCollectNow(JS::GCReason aReason,
 void nsJSContext::RunIncrementalGCSlice(JS::GCReason aReason,
                                         IsShrinking aShrinking,
                                         js::SliceBudget& aBudget) {
+  AUTO_PROFILER_LABEL_RELEVANT_FOR_JS("Incremental GC", GCCC);
   GarbageCollectImpl(aReason, aShrinking, aBudget);
 }
 
@@ -1415,8 +1416,6 @@ void nsJSContext::RunCycleCollectorSlice(CCReason aReason,
   AUTO_PROFILER_MARKER_TEXT("CCSlice", GCCC, {},
                             aDeadline.IsNull() ? ""_ns : "(idle)"_ns);
 
-  AUTO_PROFILER_LABEL("nsJSContext::RunCycleCollectorSlice", GCCC);
-
   PrepareForCycleCollectionSlice(aReason, aDeadline);
 
   // Decide how long we want to budget for this slice.
@@ -1529,6 +1528,8 @@ void nsJSContext::EndCycleCollectionCallback(CycleCollectorResults& aResults) {
 
 /* static */
 bool CCGCScheduler::CCRunnerFired(TimeStamp aDeadline) {
+  AUTO_PROFILER_LABEL_RELEVANT_FOR_JS("Incremental CC", GCCC);
+
   bool didDoWork = false;
 
   // The CC/GC scheduler (sScheduler) decides what action(s) to take during
diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.cpp
index 87108e00550ca..74b5049bb4015 100644
--- a/js/xpconnect/src/XPCJSRuntime.cpp
+++ b/js/xpconnect/src/XPCJSRuntime.cpp
@@ -140,6 +140,7 @@ const char* const XPCJSRuntime::mStrings[] = {
 class AsyncFreeSnowWhite : public Runnable {
  public:
   NS_IMETHOD Run() override {
+    AUTO_PROFILER_LABEL_RELEVANT_FOR_JS("Incremental CC", GCCC);
     AUTO_PROFILER_LABEL("AsyncFreeSnowWhite::Run", GCCC_FreeSnowWhite);
 
     TimeStamp start = TimeStamp::Now();
diff --git a/xpcom/base/nsCycleCollector.cpp b/xpcom/base/nsCycleCollector.cpp
index cb2f650da6e6e..c6350e2e802c7 100644
--- a/xpcom/base/nsCycleCollector.cpp
+++ b/xpcom/base/nsCycleCollector.cpp
@@ -3370,6 +3370,8 @@ bool nsCycleCollector::Collect(CCReason aReason, ccIsManual aIsManual,
                                SliceBudget& aBudget,
                                nsICycleCollectorListener* aManualListener,
                                bool aPreferShorterSlices) {
+  AUTO_PROFILER_LABEL_RELEVANT_FOR_JS("Incremental CC", GCCC);
+
   CheckThreadSafety();
 
   // This can legitimately happen in a few cases. See bug 383651.
@@ -3854,8 +3856,6 @@ void nsCycleCollector_forgetSkippable(js::SliceBudget& aBudget,
   MOZ_ASSERT(data);
   MOZ_ASSERT(data->mCollector);
 
-  AUTO_PROFILER_LABEL("nsCycleCollector_forgetSkippable", GCCC);
-
   TimeLog timeLog;
   data->mCollector->ForgetSkippable(aBudget, aRemoveChildlessNodes,
                                     aAsyncSnowWhiteFreeing);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits