mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Adapt JS API to ESR 140
This commit is contained in:
@@ -257,7 +257,7 @@ void Context::MaybeIncrementalGC()
|
||||
#endif
|
||||
|
||||
// There is a tradeoff between this time and the number of frames we must run GCs on, but overall we should prioritize smooth framerates.
|
||||
const js::SliceBudget GCSliceTimeBudget = js::SliceBudget(js::TimeBudget(6)); // Milliseconds an incremental slice is allowed to run. SM respects this fairly well.
|
||||
const JS::SliceBudget GCSliceTimeBudget = JS::SliceBudget(JS::TimeBudget(6)); // Milliseconds an incremental slice is allowed to run. SM respects this fairly well.
|
||||
|
||||
PrepareZonesForIncrementalGC();
|
||||
if (!JS::IsIncrementalGCInProgress(m_cx))
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <js/Initialization.h>
|
||||
#include <list>
|
||||
|
||||
#if MOZJS_MAJOR_VERSION != 128
|
||||
#if MOZJS_MAJOR_VERSION != 140
|
||||
#error Your compiler is trying to use an incorrect major version of the \
|
||||
SpiderMonkey library. The SpiderMonkey API is subject to changes, and the \
|
||||
game will not build with the selected version of the library. Make sure \
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include <js/ComparisonOperators.h>
|
||||
#include <js/CompilationAndEvaluation.h>
|
||||
#include <js/CompileOptions.h>
|
||||
#include <js/EnvironmentChain.h>
|
||||
#include <js/GCVector.h>
|
||||
#include <js/GlobalObject.h>
|
||||
#include <js/PropertyAndElement.h>
|
||||
@@ -674,7 +675,7 @@ bool Interface::LoadScript(const VfsPath& filename, const std::string& code) con
|
||||
|
||||
JS::SourceText<mozilla::Utf8Unit> src;
|
||||
ENSURE(src.init(rq.cx, code.c_str(), code.length(), JS::SourceOwnership::Borrowed));
|
||||
JS::RootedObjectVector emptyScopeChain(rq.cx);
|
||||
JS::EnvironmentChain emptyScopeChain{ rq.cx, JS::SupportUnscopables::No };
|
||||
JS::RootedFunction func(rq.cx, JS::CompileFunction(rq.cx, emptyScopeChain, options, NULL, 0, NULL, src));
|
||||
if (func == nullptr)
|
||||
{
|
||||
|
||||
@@ -69,9 +69,10 @@ void JobQueue::runJobs(JSContext*)
|
||||
}
|
||||
}
|
||||
|
||||
JSObject* JobQueue::getIncumbentGlobal(JSContext* cx)
|
||||
bool JobQueue::getHostDefinedData(JSContext* cx, JS::MutableHandle<JSObject*> data) const
|
||||
{
|
||||
return JS::CurrentGlobalOrNull(cx);
|
||||
data.set(JS::CurrentGlobalOrNull(cx));
|
||||
return true;
|
||||
}
|
||||
|
||||
bool JobQueue::enqueuePromiseJob(JSContext* cx, JS::HandleObject, JS::HandleObject job, JS::HandleObject,
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
void runJobs(JSContext*) final;
|
||||
|
||||
private:
|
||||
JSObject* getIncumbentGlobal(JSContext* cx) final;
|
||||
bool getHostDefinedData(JSContext* cx, JS::MutableHandle<JSObject*> data) const final;
|
||||
|
||||
bool enqueuePromiseJob(JSContext* cx, JS::HandleObject, JS::HandleObject job, JS::HandleObject,
|
||||
JS::HandleObject) final;
|
||||
|
||||
Reference in New Issue
Block a user