XMLWordPrintable

Details

    • Sub-task
    • Resolution: Fixed
    • P2: Important
    • 6.10
    • None
    • None
    • WebAssembly
    • 140701c0e (dev), 48859317a (dev)

    Description

      Background

      Emscripten provides two "modes" for features like asyncify, exceptions, and stjmp/longjmp: Emscripten emulated and native wasm. The two modes are incompatible, and applications must select feature implementations from at most one of them, e.g. mixing asyncify JSPI with Emscripten emulated exceptions does not work.

       

      Mode Exceptions  flag Exceptions Performance Suported Asyncify Supported longjmp Requires Browser Support
      Emscripten Emulated -fexceptions Slow (JS roundtrip) Asyncify 1 Emscripten No
      Native Wasm -fwasm-exceptions Fast Asyncify 2 (JSPI) wasm Yes

      Tasks

      Make sure it's possible to create a working JSPI-enabled build using the existing configure options:

      configure [...] -device-option QT_EMSCRIPTEN_ASYNCIFY=2 -feature-wasm-exceptions

      • Select correct exceptions type
        • modules which enables exceptions must enable the correct type
      • Enable correct setjmp/longjmp type
      • Disable 4GB memory (Emscripten compatibility issue)
        • Causes run-time error TypeError: WebAssembly.promising(): Argument 0 must be a WebAssembly exported function
      • Mark EMSCRIPTEN_BINDINGS exported functions with emscripten::async
        • Functions which suspend must have emscripten::async.
        • Also transitively: e.g event handlers do not suspend themselves, but may call code which does.
        • emscripten::async is not allowed for non-jspi builds

      Attachments

        For Gerrit Dashboard: QTBUG-129747
        # Subject Branch Project Status CR V

        Activity

          People

            sorvig Morten Sørvig
            sorvig Morten Sørvig
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes