Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#5861 closed task (fixed)

Upgrade 0 A.D. to Spidermonkey ESR 78

Reported by: wraitii Owned by: wraitii
Priority: Release Blocker Milestone: Alpha 24
Component: Core engine Keywords: javascript
Cc: Patch:

Description

See #4893 for the starting point and #5694 for why this is a RB.

Change History (6)

comment:1 by wraitii, 3 years ago

Summary: Upgrade 0 A.D. to Spidermonkey ESR 678Upgrade 0 A.D. to Spidermonkey ESR 78

comment:2 by wraitii, 3 years ago

In 24332:

[SM78 1/2] Upgrade Spidermonkey build system and binaries to 78.6.0

SM78 drops usage of Python 2 in favour of Python 3.

SM78 is the first ESR to actually use rust, which means a new static library is bundled.
This means LLVM-objdump is now a dependency of Spidermonkey, and also 0 A.D.

SM78 also removes the need for NSPR on Windows (Bug 1556646).

Tested by: Stan, Freagarach, mammadori

Refs #5694
Refs #5861

Differential Revision: https://code.wildfiregames.com/D3167

comment:3 by wraitii, 3 years ago

Resolution: fixed
Status: assignedclosed

In 24333:

[SM78 2/2] Update to Spidermonkey 78 APIs

This ugprades 0 A.D. to the latest ESR at the moment of writing.

Mostly straighforward API changes (see meta-Bug 1633145)

  • js::Class is merged with JSClass
  • JSNewArrayObject becomes JS::NewArrayObject
  • ArrayObject-functions are moved to a new public header Array.h
  • JSMSG error messages have again been changed, requiring some tweaks.
  • AutoValueArray becomes RootedBalueArray (Bug 1634435)
  • 'uneval' is behind a Realm flag (Bug 1565170), but no removal is planned in the short-term future.
  • Some minor GC API changes (Bugs 1569564 and 1633405)
  • Error reporting has had some tweaks, and error flags have been removed (Bug 1620583)
  • StructuredClone are now always thread-safe, simplifying an API change introduced in SM52 (Bug 1607791)

Tested by: Stan, Freagarach, mammadori

Closes #5861

Differential Revision: https://code.wildfiregames.com/D3168

comment:4 by wraitii, 3 years ago

In 24346:

Improve SM build script detection of LLVM-objdump

Some distributions have an incompatible 'objdump' program, so we should prefer llvm first. Further, 'command' appears to not support multiple targets on some distros.

Parametrize the script a little more.

Reported by: Imarok

Reviewed by: Imarok

Refs #5861

Differential Revision: https://code.wildfiregames.com/D3192

comment:5 by wraitii, 3 years ago

In 24392:

Fix JS incremental GC issue (destroyed realms are not collected).

Further work would be nice to be able to only collect zones that probably have garbage to collect, but that likely requires splitting our contexts in more zones.

0 A.D. had been running in incremental GC since 1.8.5. With the SM78 upgrade, I changed this to the new default "ZONE_INCREMENTAL", which GCs specific zones.
However, I failed to realise that deleted scriptInterfaces and their corresponding zones would no longer be collected.
This corrects for that.

Fixes rP24333.

Refs #5861

Differential Revision: https://code.wildfiregames.com/D3220

comment:6 by wraitii, 3 years ago

In 24434:

Revert ZONE_INCREMENTAL gc to fix a crash.

The crash could be reproduced by hotloading. It didn't always happen (about 1 in 15?).
I do not have sufficient time to investigate, so this reverts this for now.
Introduced with the SM78 migration, refs #5861

Differential Revision: https://code.wildfiregames.com/D3239

Note: See TracTickets for help on using tickets.