(sig, args)
| 107 | |
| 108 | |
| 109 | def make_dynCall(sig, args): |
| 110 | if settings.MEMORY64: |
| 111 | args = list(args) |
| 112 | args[0] = f'Number({args[0]})' |
| 113 | # wasm2c and asyncify are not yet compatible with direct wasm table calls so use |
| 114 | # the legacy DYNCALLS mechanism. |
| 115 | if settings.DYNCALLS or not is_legal_sig(sig): |
| 116 | args = ','.join(args) |
| 117 | if settings.MAIN_MODULE or settings.SIDE_MODULE: |
| 118 | # In dynamic linking mode not all of the dynCall_xxx function are defined |
| 119 | # in the main module so might not be available as global symbols. |
| 120 | # See `registerDynCallSymbols` in `libdylink.js`. |
| 121 | return "dynCalls['%s'](%s)" % (sig, args) |
| 122 | return 'dynCall_%s(%s)' % (sig, args) |
| 123 | else: |
| 124 | call_args = ",".join(args[1:]) |
| 125 | return f'getWasmTableEntry({args[0]})({call_args})' |
| 126 | |
| 127 | |
| 128 | def make_invoke(sig): |
no test coverage detected