binaryen
binaryen copied to clipboard
LegalizeJSInterface: Look for get/setTempRet0 as exports
This allows emscripten to move these helper functions from JS library imports to native wasm exports.
This change continues to support getTempRet0/setTempRet0
as imports
while we transition emscripten. See https://github.com/emscripten-core/emscripten/pull/17581
See https://github.com/emscripten-core/emscripten/issues/7273
I tested this change with the current emscripten, running all of core2 and other suites.
PTAL, I think this is good to land. Once it rolls in we can look at landing the emscripten side of this, followed by a tidy up here once that is in.
Actually I'm working on writing some tests.. not quite ready for review yet.
This change is less intrusive now. A new option was added that will cause the pass to use existing exports instead of imports. This will likely only ever be used by emscripten.