HomeWildfire Games

Second (main) commit for the SpiderMonkey upgrade.

Description

Second (main) commit for the SpiderMonkey upgrade.

This commit contains all the required changes to our source files and build scripts (hopefully).
A next commit will remove the old stuff of SpiderMonkey 1.8.5.

Spcial thanks to:

  • H4writer who helped a lot mainly with the performance issues we had/have, but also with other problems or questions.
  • Leper for the review.
  • Historic_bruno for implementing the build scripts on Mac OS X and testing on the Mac.
  • The people from the #jsapi channel and from mozilla.dev.tech.js-engine who answered a lot of questions and helped solving problems.
  • All the other people who helped

Refs #1886
Fixes #2442
Fixes #2416

Details

Committed
YvesMar 28 2014, 9:26 PM
Parents
rP14876: First commit for the SpiderMonkey upgrade (new binaries and headers).
Branches
Unknown
Tags
Unknown

Event Timeline

elexis added a subscriber: elexis.Nov 26 2017, 5:01 PM

It was the upgrade to SpiderMonkey v24.

Silier added a subscriber: Silier.Apr 3 2019, 9:44 PM
Silier added inline comments.
/ps/trunk/source/simulation2/system/ComponentManager.cpp
253

should not here be

if (!proto.isObjectOrNull())
elexis added inline comments.Apr 3 2019, 10:18 PM
/ps/trunk/source/simulation2/system/ComponentManager.cpp
253
Silier added inline comments.Apr 3 2019, 10:47 PM
/ps/trunk/source/simulation2/system/ComponentManager.cpp
253

In that case proto variable is useless and can be removed :)

elexis added inline comments.Jul 13 2019, 1:28 PM
/ps/trunk/source/simulation2/system/ComponentManager.cpp
253

Note to self: proto != protoVal. The prototype property is still one that should always exist, but it seems ok to keep the safeguard as you did in D1817, especially since Script_RegisterComponentType is called only once per script component type.

JavaScript only has one construct: objects. Each object has a private property which holds a link to another object called its prototype

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain

elexis added inline comments.Jul 13 2019, 1:44 PM
/ps/trunk/source/simulation2/system/ComponentManager.cpp
253

until an object is reached with null as its prototype. By definition, null has no prototype, and acts as the final link in this prototype chain.

(so the safeguard can be triggered by passing the empty object as the prototype constructor in JS, which can be considered an error by design rather than something to support)

elexis added inline comments.Jul 14 2019, 4:11 PM
/ps/trunk/source/simulation2/system/ComponentManager.cpp
225

As mentioned in D1817 the GetProperty(ctor.get(), "prototype call is redundant to the introduced one below, the isObject check is assumed true in this place, and Null also shouldn't pass.

elexis added inline comments.Jul 24 2019, 4:52 AM
/ps/trunk/source/gui/scripting/JSInterface_IGUIObject.cpp
156

I don't see when this may ever be Null:
https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/JSAPI_Reference/JS::Value
also read a bit of the SM code but not everything involved.

.setcan only yield in MOZ_REALLY_CRASH afaics

wraitii added inline comments.
/ps/trunk/source/scriptinterface/ScriptInterface.h
423

This seems to have been unused from the start.