mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-08 00:07:30 +09:00
parent
97a4b8e1e1
commit
97a0673483
18 changed files with 1 additions and 1045 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue