Page MenuHomeWildfire Games

[SM60] API changes
ClosedPublic

Authored by wraitii on Nov 18 2020, 9:09 PM.

Details

Reviewers
None
Commits
rP24243: [SM60 2/2] Update to Spidermonkey 60 APIs
Trac Tickets
#5859
Summary

Windows user -> please test https://github.com/wraitii/0ad/tree/sm60

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.
  • The GC callback behaviour has changed slightly, and we should now only look for GC_SLICE_BEGIN and GC_SLICE_END calls (see D3137)

Other updates are largely minor:

  • JSVOID->JSUNDEFINED
  • Compartment behaviours update
  • Bug 1308236 - avoid ambiguous comparison
  • Bug 1421358, REFRESH_FRAME was removed. API is indicated in jsapi.h so use that
  • ClassOps changes
  • Minor tests touchups again
Test Plan

Compile on all major platforms. Run the game. Run tests. Play online.

Event Timeline

wraitii created this revision.Nov 18 2020, 9:09 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/3085/display/redirect

wraitii edited the summary of this revision. (Show Details)Nov 19 2020, 6:02 PM
wraitii edited the test plan for this revision. (Show Details)
wraitii updated this revision to Diff 14080.Nov 19 2020, 6:35 PM

Rebase for clean looking diff

wraitii added inline comments.Nov 19 2020, 6:40 PM
source/gui/Scripting/JSInterface_CText.cpp
50 ↗(On Diff #14080)

errrr

source/gui/Scripting/JSInterface_GUIProxy_impl.h
23

This bit is required by SM, it static_asserts it. It doesn't seem to be required _by itself_, but they did it, so I'll use it.

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/3679/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/2024/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/3126/display/redirect

wraitii requested review of this revision.Nov 19 2020, 7:23 PM
wraitii updated this revision to Diff 14089.Nov 19 2020, 8:36 PM

Fix compilation and remove some additional proxy changes that I ought to do after the migration, not within.

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/3687/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/3134/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/2032/display/redirect

wraitii updated this revision to Diff 14176.Nov 24 2020, 11:27 AM

Include the profiler fix

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/3203/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

builderr-debug-gcc6.txt
g++: internal compiler error: Segmentation fault (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[1]: *** [obj/simulation2_Debug/BinarySerializer.o] Error 4
make: *** [simulation2] Error 2

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/3760/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

builderr-debug-macos.txt
../../../source/simulation2/scripting/JSInterface_Simulation.cpp:154:4: warning: suggest braces around initialization of subobject [-Wmissing-braces]
                        CFixedVector2D(-halfSize.X, -halfSize.Y),
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
../../../source/simulation2/serialization/BinarySerializer.cpp:71:7: error: use of undeclared identifier 'JSTYPE_UNDEFINED'; did you mean 'JSVAL_TYPE_UNDEFINED'?
        case JSTYPE_UNDEFINED:
             ^~~~~~~~~~~~~~~~
             JSVAL_TYPE_UNDEFINED
/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/js/Value.h:53:5: note: 'JSVAL_TYPE_UNDEFINED' declared here
    JSVAL_TYPE_UNDEFINED           = 0x02,
    ^
../../../source/simulation2/serialization/BinarySerializer.cpp:298:7: error: duplicate case value: 'JSVAL_TYPE_UNDEFINED' and 'JSTYPE_FUNCTION' both equal '2'
        case JSTYPE_FUNCTION:
             ^
../../../source/simulation2/serialization/BinarySerializer.cpp:71:7: note: previous case defined here
        case JSTYPE_UNDEFINED:
             ^
2 errors generated.
make[1]: *** [obj/simulation2_Debug/BinarySerializer.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [simulation2] Error 2

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/2103/display/redirect

wraitii updated this revision to Diff 14178.Nov 24 2020, 1:40 PM

Update the proxies back to the new API to fix an assertion in debug mode, as reported by Stan.

See https://bugzilla.mozilla.org/show_bug.cgi?id=1237504 and https://bugzilla.mozilla.org/show_bug.cgi?id=1339411 for background details.

Build failure - The Moirai have given mortals hearts that can endure.

builderr-debug-gcc6.txt
g++: internal compiler error: Segmentation fault (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
make[1]: *** [obj/simulation2_Debug/BinarySerializer.o] Error 4
make: *** [simulation2] Error 2

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/3761/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/3204/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

builderr-debug-macos.txt
../../../source/simulation2/serialization/BinarySerializer.cpp:71:7: error: use of undeclared identifier 'JSTYPE_UNDEFINED'; did you mean 'JSVAL_TYPE_UNDEFINED'?
        case JSTYPE_UNDEFINED:
             ^~~~~~~~~~~~~~~~
             JSVAL_TYPE_UNDEFINED
/Users/wfg/Jenkins/workspace/macos-differential/build/workspaces/gcc/../../../libraries/source/spidermonkey/include-unix-debug/js/Value.h:53:5: note: 'JSVAL_TYPE_UNDEFINED' declared here
    JSVAL_TYPE_UNDEFINED           = 0x02,
    ^
../../../source/simulation2/serialization/BinarySerializer.cpp:298:7: error: duplicate case value: 'JSVAL_TYPE_UNDEFINED' and 'JSTYPE_FUNCTION' both equal '2'
        case JSTYPE_FUNCTION:
             ^
../../../source/simulation2/serialization/BinarySerializer.cpp:71:7: note: previous case defined here
        case JSTYPE_UNDEFINED:
             ^
2 errors generated.
make[1]: *** [obj/simulation2_Debug/BinarySerializer.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [simulation2] Error 2

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/2104/display/redirect

wraitii edited the summary of this revision. (Show Details)Nov 24 2020, 1:44 PM
This revision was not accepted when it landed; it landed in state Needs Review.Nov 24 2020, 4:47 PM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.