Bug 1584892 - Remove CycleCollectedJSContext::Initialize's nursery size param r=karlt
authorPaul Bone <pbone@mozilla.com>
Mon, 16 Dec 2019 04:14:55 +0000
changeset 507330 d89e641acc9d8fc96aa609147bbba23efcaf5442
parent 507329 f0e49f75b1db2474bfd539b62d2129a9e05d82d9
child 507331 d0dc795680f570add16b2240e74311f46e31b3d8
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)
reviewerskarlt
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 - Remove CycleCollectedJSContext::Initialize's nursery size param r=karlt Differential Revision: https://phabricator.services.mozilla.com/D47873
dom/workers/RuntimeService.cpp
dom/worklet/WorkletThread.cpp
js/xpconnect/src/XPCJSContext.cpp
xpcom/base/CycleCollectedJSContext.cpp
xpcom/base/CycleCollectedJSContext.h
--- a/dom/workers/RuntimeService.cpp
+++ b/dom/workers/RuntimeService.cpp
@@ -947,18 +947,17 @@ class WorkerJSContext final : public moz
   WorkerJSContext* GetAsWorkerJSContext() override { return this; }
 
   CycleCollectedJSRuntime* CreateRuntime(JSContext* aCx) override {
     return new WorkerJSRuntime(aCx, mWorkerPrivate);
   }
 
   nsresult Initialize(JSRuntime* aParentRuntime) {
     nsresult rv = CycleCollectedJSContext::Initialize(
-        aParentRuntime, WORKER_DEFAULT_RUNTIME_HEAPSIZE,
-        JS::DefaultNurseryMaxBytes);
+        aParentRuntime, WORKER_DEFAULT_RUNTIME_HEAPSIZE);
     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
@@ -116,18 +116,17 @@ class WorkletJSContext final : public Cy
   CycleCollectedJSRuntime* CreateRuntime(JSContext* aCx) override {
     return new WorkletJSRuntime(aCx);
   }
 
   nsresult Initialize(JSRuntime* aParentRuntime) {
     MOZ_ASSERT(!NS_IsMainThread());
 
     nsresult rv = CycleCollectedJSContext::Initialize(
-        aParentRuntime, WORKLET_DEFAULT_RUNTIME_HEAPSIZE,
-        JS::DefaultNurseryMaxBytes);
+        aParentRuntime, WORKLET_DEFAULT_RUNTIME_HEAPSIZE);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
 
     JSContext* cx = Context();
 
     js::SetPreserveWrapperCallback(cx, PreserveWrapper);
     JS_InitDestroyPrincipalsCallback(cx, WorkletPrincipals::Destroy);
--- a/js/xpconnect/src/XPCJSContext.cpp
+++ b/js/xpconnect/src/XPCJSContext.cpp
@@ -1097,17 +1097,17 @@ XPCJSRuntime* XPCJSContext::Runtime() co
 }
 
 CycleCollectedJSRuntime* XPCJSContext::CreateRuntime(JSContext* aCx) {
   return new XPCJSRuntime(aCx);
 }
 
 nsresult XPCJSContext::Initialize() {
   nsresult rv = CycleCollectedJSContext::Initialize(
-      nullptr, JS::DefaultHeapMaxBytes, JS::DefaultNurseryMaxBytes);
+      nullptr, JS::DefaultHeapMaxBytes);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   MOZ_ASSERT(Context());
   JSContext* cx = Context();
 
   // The JS engine permits us to set different stack limits for system code,
--- a/xpcom/base/CycleCollectedJSContext.cpp
+++ b/xpcom/base/CycleCollectedJSContext.cpp
@@ -111,28 +111,25 @@ CycleCollectedJSContext::~CycleCollected
   mOwningThread->SetScriptObserver(nullptr);
   NS_RELEASE(mOwningThread);
 
   delete mRuntime;
   mRuntime = nullptr;
 }
 
 nsresult CycleCollectedJSContext::Initialize(JSRuntime* aParentRuntime,
-                                             uint32_t aMaxBytes,
-                                             uint32_t aMaxNurseryBytes) {
+                                             uint32_t aMaxBytes) {
   MOZ_ASSERT(!mJSContext);
 
   mozilla::dom::InitScriptSettings();
   mJSContext = JS_NewContext(aMaxBytes, aParentRuntime);
   if (!mJSContext) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
-  JS_SetGCParameter(mJSContext, JSGC_MAX_NURSERY_BYTES, aMaxNurseryBytes);
-
   mRuntime = CreateRuntime(mJSContext);
   mRuntime->AddContext(this);
 
   mOwningThread->SetScriptObserver(this);
   // The main thread has a base recursion depth of 0, workers of 1.
   mBaseRecursionDepth = RecursionDepth();
 
   NS_GetCurrentThread()->SetCanInvokeJS(true);
--- a/xpcom/base/CycleCollectedJSContext.h
+++ b/xpcom/base/CycleCollectedJSContext.h
@@ -90,18 +90,17 @@ class CycleCollectedJSContext
       private JS::JobQueue {
   friend class CycleCollectedJSRuntime;
 
  protected:
   CycleCollectedJSContext();
   virtual ~CycleCollectedJSContext();
 
   MOZ_IS_CLASS_INIT
-  nsresult Initialize(JSRuntime* aParentRuntime, uint32_t aMaxBytes,
-                      uint32_t aMaxNurseryBytes);
+  nsresult Initialize(JSRuntime* aParentRuntime, uint32_t aMaxBytes);
 
   virtual CycleCollectedJSRuntime* CreateRuntime(JSContext* aCx) = 0;
 
   size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
 
  private:
   static JSObject* GetIncumbentGlobalCallback(JSContext* aCx);
   static bool EnqueuePromiseJobCallback(JSContext* aCx,