Bug 1037510, part 1 - Add nursery size as a parameter of CycleCollectedJSRuntime. r=khuey
This commit is contained in:
@@ -84,6 +84,9 @@ using mozilla::Preferences;
|
|||||||
// The size of the worker runtime heaps in bytes. May be changed via pref.
|
// The size of the worker runtime heaps in bytes. May be changed via pref.
|
||||||
#define WORKER_DEFAULT_RUNTIME_HEAPSIZE 32 * 1024 * 1024
|
#define WORKER_DEFAULT_RUNTIME_HEAPSIZE 32 * 1024 * 1024
|
||||||
|
|
||||||
|
// The size of the generational GC nursery for workers, in bytes.
|
||||||
|
#define WORKER_DEFAULT_NURSERY_SIZE JS::DefaultNurseryBytes
|
||||||
|
|
||||||
// The size of the worker JS allocation threshold in MB. May be changed via pref.
|
// The size of the worker JS allocation threshold in MB. May be changed via pref.
|
||||||
#define WORKER_DEFAULT_ALLOCATION_THRESHOLD 30
|
#define WORKER_DEFAULT_ALLOCATION_THRESHOLD 30
|
||||||
|
|
||||||
@@ -862,7 +865,8 @@ public:
|
|||||||
// call to JS_SetGCParameter inside CreateJSContextForWorker.
|
// call to JS_SetGCParameter inside CreateJSContextForWorker.
|
||||||
WorkerJSRuntime(JSRuntime* aParentRuntime, WorkerPrivate* aWorkerPrivate)
|
WorkerJSRuntime(JSRuntime* aParentRuntime, WorkerPrivate* aWorkerPrivate)
|
||||||
: CycleCollectedJSRuntime(aParentRuntime,
|
: CycleCollectedJSRuntime(aParentRuntime,
|
||||||
WORKER_DEFAULT_RUNTIME_HEAPSIZE),
|
WORKER_DEFAULT_RUNTIME_HEAPSIZE,
|
||||||
|
WORKER_DEFAULT_NURSERY_SIZE),
|
||||||
mWorkerPrivate(aWorkerPrivate)
|
mWorkerPrivate(aWorkerPrivate)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3095,7 +3095,7 @@ static const JSWrapObjectCallbacks WrapObjectCallbacks = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
XPCJSRuntime::XPCJSRuntime(nsXPConnect* aXPConnect)
|
XPCJSRuntime::XPCJSRuntime(nsXPConnect* aXPConnect)
|
||||||
: CycleCollectedJSRuntime(nullptr, JS::DefaultHeapMaxBytes),
|
: CycleCollectedJSRuntime(nullptr, JS::DefaultHeapMaxBytes, JS::DefaultNurseryBytes),
|
||||||
mJSContextStack(new XPCJSContextStack(MOZ_THIS_IN_INITIALIZER_LIST())),
|
mJSContextStack(new XPCJSContextStack(MOZ_THIS_IN_INITIALIZER_LIST())),
|
||||||
mCallContext(nullptr),
|
mCallContext(nullptr),
|
||||||
mAutoRoots(nullptr),
|
mAutoRoots(nullptr),
|
||||||
|
|||||||
@@ -467,7 +467,8 @@ NoteJSChildGrayWrapperShim(void* aData, void* aThing)
|
|||||||
static const JSZoneParticipant sJSZoneCycleCollectorGlobal;
|
static const JSZoneParticipant sJSZoneCycleCollectorGlobal;
|
||||||
|
|
||||||
CycleCollectedJSRuntime::CycleCollectedJSRuntime(JSRuntime* aParentRuntime,
|
CycleCollectedJSRuntime::CycleCollectedJSRuntime(JSRuntime* aParentRuntime,
|
||||||
uint32_t aMaxbytes)
|
uint32_t aMaxBytes,
|
||||||
|
uint32_t aMaxNurseryBytes)
|
||||||
: mGCThingCycleCollectorGlobal(sGCThingCycleCollectorGlobal)
|
: mGCThingCycleCollectorGlobal(sGCThingCycleCollectorGlobal)
|
||||||
, mJSZoneCycleCollectorGlobal(sJSZoneCycleCollectorGlobal)
|
, mJSZoneCycleCollectorGlobal(sJSZoneCycleCollectorGlobal)
|
||||||
, mJSRuntime(nullptr)
|
, mJSRuntime(nullptr)
|
||||||
@@ -477,7 +478,7 @@ CycleCollectedJSRuntime::CycleCollectedJSRuntime(JSRuntime* aParentRuntime,
|
|||||||
{
|
{
|
||||||
mozilla::dom::InitScriptSettings();
|
mozilla::dom::InitScriptSettings();
|
||||||
|
|
||||||
mJSRuntime = JS_NewRuntime(aMaxbytes, JS::DefaultNurseryBytes, aParentRuntime);
|
mJSRuntime = JS_NewRuntime(aMaxBytes, aMaxNurseryBytes, aParentRuntime);
|
||||||
if (!mJSRuntime) {
|
if (!mJSRuntime) {
|
||||||
MOZ_CRASH();
|
MOZ_CRASH();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,7 +114,8 @@ class CycleCollectedJSRuntime
|
|||||||
friend class IncrementalFinalizeRunnable;
|
friend class IncrementalFinalizeRunnable;
|
||||||
protected:
|
protected:
|
||||||
CycleCollectedJSRuntime(JSRuntime* aParentRuntime,
|
CycleCollectedJSRuntime(JSRuntime* aParentRuntime,
|
||||||
uint32_t aMaxbytes);
|
uint32_t aMaxBytes,
|
||||||
|
uint32_t aMaxNurseryBytes);
|
||||||
virtual ~CycleCollectedJSRuntime();
|
virtual ~CycleCollectedJSRuntime();
|
||||||
|
|
||||||
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user