[Git][ghc/ghc][master] 15 commits: deriveConstants: add needed constants for wasm backend

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Tue Feb 13 19:08:20 UTC 2024



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
57bb8c92 by Cheng Shao at 2024-02-13T14:07:49-05:00
deriveConstants: add needed constants for wasm backend

This commit adds needed constants to deriveConstants. They are used by
RTS code in the wasm backend to support the JSFFI logic.

- - - - -
615eb855 by Cheng Shao at 2024-02-13T14:07:49-05:00
compiler: make genSym use C-based atomic increment on non-JS 32-bit platforms

The pure Haskell implementation causes i386 regression in unrelated
work that can be fixed by using C-based atomic increment, see added
comment for details.

- - - - -
a9918891 by Cheng Shao at 2024-02-13T14:07:49-05:00
compiler: allow JSFFI for wasm32

This commit allows the javascript calling convention to be used when
the target platform is wasm32.

- - - - -
8771a53b by Cheng Shao at 2024-02-13T14:07:49-05:00
compiler: allow boxed JSVal as a foreign type

This commit allows the boxed JSVal type to be used as a foreign
argument/result type.

- - - - -
053c92b3 by Cheng Shao at 2024-02-13T14:07:49-05:00
compiler: ensure ctors have the right priority on wasm32

This commit fixes the priorities of ctors generated by GHC codegen on
wasm32, see the referred note for details.

- - - - -
b7942e0a by Cheng Shao at 2024-02-13T14:07:49-05:00
compiler: add JSFFI desugar logic for wasm32

This commit adds JSFFI desugar logic for the wasm backend.

- - - - -
2c1dca76 by Cheng Shao at 2024-02-13T14:07:49-05:00
compiler: add JavaScriptFFI to supported extension list on wasm32

This commit adds JavaScriptFFI as a supported extension when the
target platform is wasm32.

- - - - -
9ad0e2b4 by Cheng Shao at 2024-02-13T14:07:49-05:00
rts/ghc-internal: add JSFFI support logic for wasm32

This commit adds rts/ghc-internal logic to support the wasm backend's
JSFFI functionality.

- - - - -
e9ebea66 by Cheng Shao at 2024-02-13T14:07:49-05:00
ghc-internal: fix threadDelay for wasm in browsers

This commit fixes broken threadDelay for wasm when it runs in
browsers, see added note for detailed explanation.

- - - - -
f85f3fdb by Cheng Shao at 2024-02-13T14:07:49-05:00
utils: add JSFFI utility code

This commit adds JavaScript util code to utils to support the wasm
backend's JSFFI functionality:

- jsffi/post-link.mjs, a post-linker to process the linked wasm module
  and emit a small complement JavaScript ESM module to be used with it
  at runtime
- jsffi/prelude.js, a tiny bit of prelude code as the JavaScript side
  of runtime logic
- jsffi/test-runner.mjs, run the jsffi test cases

Co-authored-by: amesgen <amesgen at amesgen.de>

- - - - -
77e91500 by Cheng Shao at 2024-02-13T14:07:49-05:00
hadrian: distribute jsbits needed for wasm backend's JSFFI support

The post-linker.mjs/prelude.js files are now distributed in the
bindist libdir, so when using the wasm backend's JSFFI feature, the
user wouldn't need to fetch them from a ghc checkout manually.

- - - - -
c47ba1c3 by Cheng Shao at 2024-02-13T14:07:49-05:00
testsuite: add opts.target_wrapper

This commit adds opts.target_wrapper which allows overriding the
target wrapper on a per test case basis when testing a cross target.
This is used when testing the wasm backend's JSFFI functionality; the
rest of the cases are tested using wasmtime, though the jsffi cases
are tested using the node.js based test runner.

- - - - -
8e048675 by Cheng Shao at 2024-02-13T14:07:49-05:00
testsuite: T22774 should work for wasm JSFFI

T22774 works since the wasm backend now supports the JSFFI feature.

- - - - -
1d07f9a6 by Cheng Shao at 2024-02-13T14:07:49-05:00
testsuite: add JSFFI test cases for wasm backend

This commit adds a few test cases for the wasm backend's JSFFI
functionality, as well as a simple README to instruct future
contributors to add new test cases.

- - - - -
b8997080 by Cheng Shao at 2024-02-13T14:07:49-05:00
docs: add documentation for wasm backend JSFFI

This commit adds changelog and user facing documentation for the wasm
backend's JSFFI feature.

- - - - -


30 changed files:

- CODEOWNERS
- compiler/GHC/Builtin/Names.hs
- compiler/GHC/CmmToAsm/Wasm/Asm.hs
- compiler/GHC/CmmToC.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/HsToCore/Foreign/Decl.hs
- + compiler/GHC/HsToCore/Foreign/Wasm.hs
- compiler/GHC/Tc/Gen/Foreign.hs
- compiler/GHC/Types/ForeignCall.hs
- compiler/GHC/Types/Unique/Supply.hs
- compiler/cbits/genSym.c
- compiler/ghc.cabal.in
- docs/users_guide/9.10.1-notes.rst
- docs/users_guide/wasm.rst
- hadrian/src/Base.hs
- hadrian/src/Rules/Generate.hs
- libraries/ghc-internal/ghc-internal.cabal
- libraries/ghc-internal/src/GHC/Conc/IO.hs
- + libraries/ghc-internal/src/GHC/Wasm/Prim.hs
- + libraries/ghc-internal/src/GHC/Wasm/Prim/Conc.hs
- + libraries/ghc-internal/src/GHC/Wasm/Prim/Conc/Internal.hs
- + libraries/ghc-internal/src/GHC/Wasm/Prim/Exports.hs
- + libraries/ghc-internal/src/GHC/Wasm/Prim/Flag.hs
- + libraries/ghc-internal/src/GHC/Wasm/Prim/Imports.hs
- + libraries/ghc-internal/src/GHC/Wasm/Prim/Types.hs
- rts/RtsSymbols.c
- rts/include/stg/SMP.h
- rts/rts.cabal
- + rts/wasm/JSFFI.c
- + rts/wasm/JSFFIGlobals.c


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d0d5acb599fda2e4645b4578a3bb7b63e196326c...b89970800c16b287f46e4267de0622ea40bb8c17

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d0d5acb599fda2e4645b4578a3bb7b63e196326c...b89970800c16b287f46e4267de0622ea40bb8c17
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240213/2abad356/attachment.html>


More information about the ghc-commits mailing list