Skip to content
This repository has been archived by the owner on Dec 1, 2020. It is now read-only.

Migrating to v25

Ricardo Quesada edited this page Oct 31, 2013 · 13 revisions

Changes needed to migrate to SpiderMonkey v25 from v23

Misc Changes

Compiler update

SpiderMonkey uses static_assert in some header files. So projects that use SpiderMonkey like JS Bindings needs to update its compiler to a C++11 compiler.

API Changes

JS_Init

JS_Init() needs to be called at the very beginning.

JS_SetProperty / JS_GetProperty

JS_SetProperty and JS_GetProperty no longer work with jsval objects. Instead now receives JS::RootedValue objects.

// Old Way
jsval someJSval = OBJECT_TO_JSVAL(someObject);
JS_SetProperty(cx, object, "cp", &someJSval);
JS_GetProperty(cx, object, "cp", &someJSval);

// New Way
JS::RootedValue someJSval(_cx);
someJSval = OBJECT_TO_JSVAL(someObject);
JS_SetProperty(cx, object, "cp", someJSval);
JS_GetProperty(cx, object, "cp", &someJSval);

JS_NewGlobalObject

// Old Way
JS_NewGlobalObject(cx, &global_class, NULL);

// New Way
JS_NewGlobalObject(cx, &global_class, NULL, JS::DontFireOnNewGlobalHook /* or JS::FireOnNewGlobalHook */);

JS_SetVersion

// Old Way
JS_SetVersion(_cx, JSVERSION_LATEST);

// New Way
JS_SetVersionForCompartment(js::GetContextCompartment(_cx), JSVERSION_LATEST);

Patched files

build-*

Adds build-ios, build-osx, build-android and build-win32 scripts

configure.in, configure, aclocal.m4, ios.m4

Adds iOS options

Android.mk

Needed to compile Android

Disables LLVM PR8927 check

Backport 911893 bug fix

https://github.com/ricardoquesada/Spidermonkey/commit/0e492ed44a628df4688d642b06244807b159eaec

Patches for vm/Runtime.h

https://github.com/ricardoquesada/Spidermonkey/commit/729cde6171ad84c7679b28f29ed4d2957e215e2f https://github.com/ricardoquesada/Spidermonkey/commit/33a2f81c7f3ab35cce10435063161b84890b663c

vm/NumericConversions.h

Disables ARM assembly optimizations when using clang

Forces JS_NO_JSVAL_JSID_STRUCT_TYPES in jspubtd.h

Disables "DEBUG" class id in order to have ABI compatibility between DEBUG and RELEASE builds

js::IsInRequest available in RELEASE mode

https://github.com/ricardoquesada/Spidermonkey/commit/333f7ffd9674b9c114a0724f97a8567cc7c4eb07

Clone this wiki locally