MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / make_dynCall

Function make_dynCall

tools/js_manipulation.py:109–125  ·  view source on GitHub ↗
(sig, args)

Source from the content-addressed store, hash-verified

107
108
109def 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
128def make_invoke(sig):

Callers 1

make_invokeFunction · 0.85

Calls 2

is_legal_sigFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected