diff options
author | Alon Zakai <azakai@google.com> | 2021-03-18 16:15:20 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-18 16:15:20 -0700 |
commit | 5575c13b1e8faef31e11ee0f009cd0f5d78b3e65 (patch) | |
tree | 987cc5218f5e653e920905873606bb8138ca152f /src/tools/wasm-emscripten-finalize.cpp | |
parent | 26e6888d235645e993a9f870d597612412d28faf (diff) | |
download | binaryen-5575c13b1e8faef31e11ee0f009cd0f5d78b3e65.tar.gz binaryen-5575c13b1e8faef31e11ee0f009cd0f5d78b3e65.tar.bz2 binaryen-5575c13b1e8faef31e11ee0f009cd0f5d78b3e65.zip |
Revert the effect of #3689 (#3705)
That PR assumed that wasm-emscripten-finalize does not need to scan
function bodies for metadata. But there is a case where it does, which is
that EM_ASMs with pthreads do still require scanning of the code. So that
approach is not valid.
We could maybe disable the optimization just on pthreads, but I think
major use cases need that. Also there is no simple way to disable it atm,
we'd need changes on both emscripten and binaryen. Also that PR can
no longer be reverted cleanly due to other changes. For all those reasons,
this just disables the optimization so that users of tot are no longer
broken, while we figure out how a valid way to optimize this use case.
Diffstat (limited to 'src/tools/wasm-emscripten-finalize.cpp')
-rw-r--r-- | src/tools/wasm-emscripten-finalize.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/tools/wasm-emscripten-finalize.cpp b/src/tools/wasm-emscripten-finalize.cpp index eb475a73b..b2f28dca0 100644 --- a/src/tools/wasm-emscripten-finalize.cpp +++ b/src/tools/wasm-emscripten-finalize.cpp @@ -220,8 +220,9 @@ int main(int argc, const char* argv[]) { // If we are not writing the output then all we are doing is simple parsing // of metadata from global parts of the wasm such as imports and exports. In // that case, it is unnecessary to parse function contents which are the - // great bulk of the work, and we can skip all that. - reader.setSkipFunctionBodies(true); + // great bulk of the work, and we can skip all that. However, the one + // exception is pthreads, which does require scanning the code, and so for + // now we cannot do reader.setSkipFunctionBodies(true); here yet. } try { reader.read(infile, wasm, inputSourceMapFilename); |