diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-02-03 19:02:06 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-02-03 19:03:05 +0100 |
commit | 10494e1b7d0b3cd945bb76dca10f5637cf786f27 (patch) | |
tree | 8a6487e386c06e7dfe63f2a4f2ffe5b589c59f60 /dom/workers | |
parent | 559933a9a58f96ac62ad0f60602f45344581604f (diff) | |
parent | e27da6cc5e825b58f810b368b2bd59bca2164ab0 (diff) | |
download | UXP-10494e1b7d0b3cd945bb76dca10f5637cf786f27.tar UXP-10494e1b7d0b3cd945bb76dca10f5637cf786f27.tar.gz UXP-10494e1b7d0b3cd945bb76dca10f5637cf786f27.tar.lz UXP-10494e1b7d0b3cd945bb76dca10f5637cf786f27.tar.xz UXP-10494e1b7d0b3cd945bb76dca10f5637cf786f27.zip |
Merge branch 'ported-moebius'
Remove GCZeal code from Spidermonkey.
This resolves #8
Diffstat (limited to 'dom/workers')
-rw-r--r-- | dom/workers/RuntimeService.cpp | 67 | ||||
-rw-r--r-- | dom/workers/RuntimeService.h | 13 | ||||
-rw-r--r-- | dom/workers/WorkerPrefs.h | 3 | ||||
-rw-r--r-- | dom/workers/WorkerPrivate.cpp | 60 | ||||
-rw-r--r-- | dom/workers/WorkerPrivate.h | 5 | ||||
-rw-r--r-- | dom/workers/Workers.h | 8 |
6 files changed, 0 insertions, 156 deletions
diff --git a/dom/workers/RuntimeService.cpp b/dom/workers/RuntimeService.cpp index d1d76e3d1..1f5616873 100644 --- a/dom/workers/RuntimeService.cpp +++ b/dom/workers/RuntimeService.cpp @@ -290,13 +290,6 @@ LoadContextOptions(const char* aPrefName, void* /* aClosure */) return; } -#ifdef JS_GC_ZEAL - if (prefName.EqualsLiteral(PREF_JS_OPTIONS_PREFIX PREF_GCZEAL) || - prefName.EqualsLiteral(PREF_WORKERS_OPTIONS_PREFIX PREF_GCZEAL)) { - return; - } -#endif - // Context options. JS::ContextOptions contextOptions; contextOptions.setAsmJS(GetWorkerPref<bool>(NS_LITERAL_CSTRING("asmjs"))) @@ -317,37 +310,6 @@ LoadContextOptions(const char* aPrefName, void* /* aClosure */) } } -#ifdef JS_GC_ZEAL -void -LoadGCZealOptions(const char* /* aPrefName */, void* /* aClosure */) -{ - AssertIsOnMainThread(); - - RuntimeService* rts = RuntimeService::GetService(); - if (!rts) { - // May be shutting down, just bail. - return; - } - - int32_t gczeal = GetWorkerPref<int32_t>(NS_LITERAL_CSTRING(PREF_GCZEAL), -1); - if (gczeal < 0) { - gczeal = 0; - } - - int32_t frequency = - GetWorkerPref<int32_t>(NS_LITERAL_CSTRING("gcZeal.frequency"), -1); - if (frequency < 0) { - frequency = JS_DEFAULT_ZEAL_FREQ; - } - - RuntimeService::SetDefaultGCZeal(uint8_t(gczeal), uint32_t(frequency)); - - if (rts) { - rts->UpdateAllWorkerGCZeal(); - } -} -#endif - void UpdateCommonJSGCMemoryOption(RuntimeService* aRuntimeService, const nsACString& aPrefName, JSGCParamKey aKey) @@ -994,10 +956,6 @@ InitJSContextForWorker(WorkerPrivate* aWorkerPrivate, JSContext* aWorkerCx) js::SetCTypesActivityCallback(aWorkerCx, CTypesActivityCallback); -#ifdef JS_GC_ZEAL - JS_SetGCZeal(aWorkerCx, settings.gcZeal, settings.gcZealFrequency); -#endif - return true; } @@ -1981,10 +1939,6 @@ RuntimeService::Init() sDefaultJSSettings.chrome.maxScriptRuntime = -1; sDefaultJSSettings.chrome.compartmentOptions.behaviors().setVersion(JSVERSION_LATEST); sDefaultJSSettings.content.maxScriptRuntime = MAX_SCRIPT_RUN_TIME_SEC; -#ifdef JS_GC_ZEAL - sDefaultJSSettings.gcZealFrequency = JS_DEFAULT_ZEAL_FREQ; - sDefaultJSSettings.gcZeal = 0; -#endif SetDefaultJSGCSettings(JSGC_MAX_BYTES, WORKER_DEFAULT_RUNTIME_HEAPSIZE); SetDefaultJSGCSettings(JSGC_ALLOCATION_THRESHOLD, WORKER_DEFAULT_ALLOCATION_THRESHOLD); @@ -2033,12 +1987,6 @@ RuntimeService::Init() LoadJSGCMemoryOptions, PREF_WORKERS_OPTIONS_PREFIX PREF_MEM_OPTIONS_PREFIX, nullptr)) || -#ifdef JS_GC_ZEAL - NS_FAILED(Preferences::RegisterCallback( - LoadGCZealOptions, - PREF_JS_OPTIONS_PREFIX PREF_GCZEAL, - nullptr)) || -#endif #define WORKER_SIMPLE_PREF(name, getter, NAME) \ NS_FAILED(Preferences::RegisterCallbackAndCall( \ @@ -2227,12 +2175,6 @@ RuntimeService::Cleanup() #undef WORKER_SIMPLE_PREF #undef WORKER_PREF -#ifdef JS_GC_ZEAL - NS_FAILED(Preferences::UnregisterCallback( - LoadGCZealOptions, - PREF_JS_OPTIONS_PREFIX PREF_GCZEAL, - nullptr)) || -#endif NS_FAILED(Preferences::UnregisterCallback( LoadJSGCMemoryOptions, PREF_JS_OPTIONS_PREFIX PREF_MEM_OPTIONS_PREFIX, @@ -2644,15 +2586,6 @@ RuntimeService::UpdateAllWorkerMemoryParameter(JSGCParamKey aKey, BROADCAST_ALL_WORKERS(UpdateJSWorkerMemoryParameter, aKey, aValue); } -#ifdef JS_GC_ZEAL -void -RuntimeService::UpdateAllWorkerGCZeal() -{ - BROADCAST_ALL_WORKERS(UpdateGCZeal, sDefaultJSSettings.gcZeal, - sDefaultJSSettings.gcZealFrequency); -} -#endif - void RuntimeService::GarbageCollectAllWorkers(bool aShrinking) { diff --git a/dom/workers/RuntimeService.h b/dom/workers/RuntimeService.h index 2e5cc1dad..2ab8cbabe 100644 --- a/dom/workers/RuntimeService.h +++ b/dom/workers/RuntimeService.h @@ -215,19 +215,6 @@ public: void UpdateAllWorkerMemoryParameter(JSGCParamKey aKey, uint32_t aValue); -#ifdef JS_GC_ZEAL - static void - SetDefaultGCZeal(uint8_t aGCZeal, uint32_t aFrequency) - { - AssertIsOnMainThread(); - sDefaultJSSettings.gcZeal = aGCZeal; - sDefaultJSSettings.gcZealFrequency = aFrequency; - } - - void - UpdateAllWorkerGCZeal(); -#endif - void GarbageCollectAllWorkers(bool aShrinking); diff --git a/dom/workers/WorkerPrefs.h b/dom/workers/WorkerPrefs.h index c9b605a84..9a1be4801 100644 --- a/dom/workers/WorkerPrefs.h +++ b/dom/workers/WorkerPrefs.h @@ -44,6 +44,3 @@ WORKER_PREF("intl.accept_languages", PrefLanguagesChanged) WORKER_PREF("general.appname.override", AppNameOverrideChanged) WORKER_PREF("general.appversion.override", AppVersionOverrideChanged) WORKER_PREF("general.platform.override", PlatformOverrideChanged) -#ifdef JS_GC_ZEAL -WORKER_PREF("dom.workers.options.gcZeal", LoadGCZealOptions) -#endif diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index 1df4e5551..c2ab4aca3 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -1391,30 +1391,6 @@ private: } }; -#ifdef JS_GC_ZEAL -class UpdateGCZealRunnable final : public WorkerControlRunnable -{ - uint8_t mGCZeal; - uint32_t mFrequency; - -public: - UpdateGCZealRunnable(WorkerPrivate* aWorkerPrivate, - uint8_t aGCZeal, - uint32_t aFrequency) - : WorkerControlRunnable(aWorkerPrivate, WorkerThreadUnchangedBusyCount), - mGCZeal(aGCZeal), mFrequency(aFrequency) - { } - -private: - virtual bool - WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate) override - { - aWorkerPrivate->UpdateGCZealInternal(aCx, mGCZeal, mFrequency); - return true; - } -}; -#endif - class GarbageCollectRunnable final : public WorkerControlRunnable { bool mShrinking; @@ -3148,27 +3124,6 @@ WorkerPrivateParent<Derived>::UpdateJSWorkerMemoryParameter(JSGCParamKey aKey, } } -#ifdef JS_GC_ZEAL -template <class Derived> -void -WorkerPrivateParent<Derived>::UpdateGCZeal(uint8_t aGCZeal, uint32_t aFrequency) -{ - AssertIsOnParentThread(); - - { - MutexAutoLock lock(mMutex); - mJSSettings.gcZeal = aGCZeal; - mJSSettings.gcZealFrequency = aFrequency; - } - - RefPtr<UpdateGCZealRunnable> runnable = - new UpdateGCZealRunnable(ParentAsWorkerPrivate(), aGCZeal, aFrequency); - if (!runnable->Dispatch()) { - NS_WARNING("Failed to update worker gczeal!"); - } -} -#endif - template <class Derived> void WorkerPrivateParent<Derived>::GarbageCollect(bool aShrinking) @@ -6323,21 +6278,6 @@ WorkerPrivate::UpdateJSWorkerMemoryParameterInternal(JSContext* aCx, } } -#ifdef JS_GC_ZEAL -void -WorkerPrivate::UpdateGCZealInternal(JSContext* aCx, uint8_t aGCZeal, - uint32_t aFrequency) -{ - AssertIsOnWorkerThread(); - - JS_SetGCZeal(aCx, aGCZeal, aFrequency); - - for (uint32_t index = 0; index < mChildWorkers.Length(); index++) { - mChildWorkers[index]->UpdateGCZeal(aGCZeal, aFrequency); - } -} -#endif - void WorkerPrivate::GarbageCollectInternal(JSContext* aCx, bool aShrinking, bool aCollectChildren) diff --git a/dom/workers/WorkerPrivate.h b/dom/workers/WorkerPrivate.h index ad906b054..8008f30e5 100644 --- a/dom/workers/WorkerPrivate.h +++ b/dom/workers/WorkerPrivate.h @@ -386,11 +386,6 @@ public: void UpdateJSWorkerMemoryParameter(JSGCParamKey key, uint32_t value); -#ifdef JS_GC_ZEAL - void - UpdateGCZeal(uint8_t aGCZeal, uint32_t aFrequency); -#endif - void GarbageCollect(bool aShrinking); diff --git a/dom/workers/Workers.h b/dom/workers/Workers.h index 89e2ccfca..ad083d3b8 100644 --- a/dom/workers/Workers.h +++ b/dom/workers/Workers.h @@ -143,15 +143,7 @@ struct JSSettings JSGCSettingsArray gcSettings; JS::ContextOptions contextOptions; -#ifdef JS_GC_ZEAL - uint8_t gcZeal; - uint32_t gcZealFrequency; -#endif - JSSettings() -#ifdef JS_GC_ZEAL - : gcZeal(0), gcZealFrequency(0) -#endif { for (uint32_t index = 0; index < ArrayLength(gcSettings); index++) { new (gcSettings + index) JSGCSetting(); |