mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-21 18:43:39 +00:00
[SM60 2/2] Update to Spidermonkey 60 APIs
Two noteworthy changes:
- Proxies are update to the SM60 API, having an explicit reserved slot
and a private slot, in which the 'proxy data' and the C++ object are
stored. This fixes a debug assertion failure of SM52 (See bugs 1237504
and 1339411)
- The GC callback behaviour has changed slightly, and we should now only
look for GC_SLICE_BEGIN and GC_SLICE_END calls (Bug 1364547)
Other updates are minor:
- Bug 1339036: JSTYPE_VOID beomes JSTYPE_UNDEFINED
- Bug 1308236 - avoid ambiguous comparison by changing NULL to nullptr
- Bug 1421358, GC::reason::REFRESH_FRAME was removed. API is indicated
in jsapi.h so use that.
- Compartment behaviours update
- ClassOps changes (Bug 1389510 removed the getter/setter - 7c04ea0211 -
and bug 1370608 added one more before that so net minus one)
- Minor tests touchups again.
Tested by: SubitaNeo, Stan
Thanks to bellaz89 for the Shared Array fix
Closes #5859
Differential Revision: https://code.wildfiregames.com/D3116
This was SVN commit r24243.
This commit is contained in:
@@ -98,7 +98,7 @@ JSClassOps global_classops = {
|
||||
nullptr, nullptr,
|
||||
nullptr, nullptr,
|
||||
nullptr, nullptr, nullptr,
|
||||
nullptr, nullptr, nullptr, nullptr,
|
||||
nullptr, nullptr, nullptr,
|
||||
JS_GlobalObjectTraceHook
|
||||
};
|
||||
|
||||
@@ -327,10 +327,7 @@ ScriptInterface_impl::ScriptInterface_impl(const char* nativeScopeName, const sh
|
||||
JS::CompartmentCreationOptions creationOpt;
|
||||
// Keep JIT code during non-shrinking GCs. This brings a quite big performance improvement.
|
||||
creationOpt.setPreserveJitCode(true);
|
||||
JS::CompartmentBehaviors behaviors;
|
||||
behaviors.setVersion(JSVERSION_LATEST);
|
||||
|
||||
JS::CompartmentOptions opt(creationOpt, behaviors);
|
||||
JS::CompartmentOptions opt(creationOpt, JS::CompartmentBehaviors{});
|
||||
|
||||
JSAutoRequest rq(m_cx);
|
||||
m_glob = JS_NewGlobalObject(m_cx, &global_class, nullptr, JS::OnNewGlobalHookOption::FireOnNewGlobalHook, opt);
|
||||
@@ -494,7 +491,7 @@ void ScriptInterface::DefineCustomObjectType(JSClass *clasp, JSNative constructo
|
||||
ps, fs, // Properties, methods
|
||||
static_ps, static_fs)); // Constructor properties, methods
|
||||
|
||||
if (obj == NULL)
|
||||
if (obj == nullptr)
|
||||
{
|
||||
ScriptException::CatchPending(rq);
|
||||
throw PSERROR_Scripting_DefineType_CreationFailed();
|
||||
|
||||
Reference in New Issue
Block a user