Bug 1584892 - Use the default max nursery size for workers r=baku,karlt
authorPaul Bone <pbone@mozilla.com>
Mon, 16 Dec 2019 03:55:24 +0000
changeset 507329 f0e49f75b1db2474bfd539b62d2129a9e05d82d9
parent 507328 7c86675ec7b24b6e6c7c953196aa18c7b264f076
child 507330 d89e641acc9d8fc96aa609147bbba23efcaf5442
push id103364
push userpbone@mozilla.com
push dateMon, 16 Dec 2019 23:17:39 +0000
treeherderautoland@d89e641acc9d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku, karlt
bugs1584892
milestone73.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1584892 - Use the default max nursery size for workers r=baku,karlt This patch updates this for workers and worklets. Differential Revision: https://phabricator.services.mozilla.com/D47872
dom/workers/RuntimeService.cpp
dom/worklet/WorkletThread.cpp
--- a/dom/workers/RuntimeService.cpp
+++ b/dom/workers/RuntimeService.cpp
@@ -88,19 +88,16 @@ namespace dom {
 
 using namespace workerinternals;
 
 namespace workerinternals {
 
 // The size of the worker runtime heaps in bytes. May be changed via pref.
 #define WORKER_DEFAULT_RUNTIME_HEAPSIZE 32 * 1024 * 1024
 
-// The size of the generational GC nursery for workers, in bytes.
-#define WORKER_DEFAULT_NURSERY_SIZE 1 * 1024 * 1024
-
 // The size of the worker JS allocation threshold in MB. May be changed via
 // pref.
 #define WORKER_DEFAULT_ALLOCATION_THRESHOLD 30
 
 // Half the size of the actual C stack, to be safe.
 #define WORKER_CONTEXT_NATIVE_STACK_LIMIT 128 * sizeof(size_t) * 1024
 
 // The maximum number of hardware concurrency, overridable via pref.
@@ -951,17 +948,17 @@ class WorkerJSContext final : public moz
 
   CycleCollectedJSRuntime* CreateRuntime(JSContext* aCx) override {
     return new WorkerJSRuntime(aCx, mWorkerPrivate);
   }
 
   nsresult Initialize(JSRuntime* aParentRuntime) {
     nsresult rv = CycleCollectedJSContext::Initialize(
         aParentRuntime, WORKER_DEFAULT_RUNTIME_HEAPSIZE,
-        WORKER_DEFAULT_NURSERY_SIZE);
+        JS::DefaultNurseryMaxBytes);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
 
     JSContext* cx = Context();
 
     js::SetPreserveWrapperCallback(cx, PreserveWrapper);
     JS_InitDestroyPrincipalsCallback(cx, WorkerPrincipal::Destroy);
--- a/dom/worklet/WorkletThread.cpp
+++ b/dom/worklet/WorkletThread.cpp
@@ -17,19 +17,16 @@
 namespace mozilla {
 namespace dom {
 
 namespace {
 
 // The size of the worklet runtime heaps in bytes.
 #define WORKLET_DEFAULT_RUNTIME_HEAPSIZE 32 * 1024 * 1024
 
-// The size of the generational GC nursery for worklet, in bytes.
-#define WORKLET_DEFAULT_NURSERY_SIZE 1 * 1024 * 1024
-
 // The C stack size. We use the same stack size on all platforms for
 // consistency.
 const uint32_t kWorkletStackSize = 256 * sizeof(size_t) * 1024;
 
 // Half the size of the actual C stack, to be safe.
 #define WORKLET_CONTEXT_NATIVE_STACK_LIMIT 128 * sizeof(size_t) * 1024
 
 // Helper functions
@@ -120,17 +117,17 @@ class WorkletJSContext final : public Cy
     return new WorkletJSRuntime(aCx);
   }
 
   nsresult Initialize(JSRuntime* aParentRuntime) {
     MOZ_ASSERT(!NS_IsMainThread());
 
     nsresult rv = CycleCollectedJSContext::Initialize(
         aParentRuntime, WORKLET_DEFAULT_RUNTIME_HEAPSIZE,
-        WORKLET_DEFAULT_NURSERY_SIZE);
+        JS::DefaultNurseryMaxBytes);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
 
     JSContext* cx = Context();
 
     js::SetPreserveWrapperCallback(cx, PreserveWrapper);
     JS_InitDestroyPrincipalsCallback(cx, WorkletPrincipals::Destroy);