summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-io.cpp
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-03-18 15:12:28 -0700
committerGitHub <noreply@github.com>2021-03-18 15:12:28 -0700
commit26e6888d235645e993a9f870d597612412d28faf (patch)
treeca334ea3506933360cb157dbd8a04373850f82df /src/wasm/wasm-io.cpp
parente5aaa07844687493e0155dacb6b79bf856a4dd81 (diff)
downloadbinaryen-26e6888d235645e993a9f870d597612412d28faf.tar.gz
binaryen-26e6888d235645e993a9f870d597612412d28faf.tar.bz2
binaryen-26e6888d235645e993a9f870d597612412d28faf.zip
wasm-emscripten-finalize: Do not read the Names section when not writing output (#3698)
When not writing output we don't need debug info, as it is not relevant for our metadata. This saves loading and interning all the names, which takes several seconds on massive inputs. This is possible in principle in other tools, but this does not change anything in them for now. (We do use names internally in some nontrivial ways without opting in to it, so that would require further refactoring. Also the other tools almost always do write an output.) This is not 100% unobservable. If validation fails then the validation error would just contain the function index instead of the name from the Names section if there is one. However finalize does not validate atm so that would only matter if we change that later.
Diffstat (limited to 'src/wasm/wasm-io.cpp')
-rw-r--r--src/wasm/wasm-io.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/wasm/wasm-io.cpp b/src/wasm/wasm-io.cpp
index f2c5af6db..42eb9ab46 100644
--- a/src/wasm/wasm-io.cpp
+++ b/src/wasm/wasm-io.cpp
@@ -50,6 +50,7 @@ void ModuleReader::readBinaryData(std::vector<char>& input,
std::string sourceMapFilename) {
std::unique_ptr<std::ifstream> sourceMapStream;
WasmBinaryBuilder parser(wasm, input);
+ parser.setDebugInfo(debugInfo);
parser.setDWARF(DWARF);
parser.setSkipFunctionBodies(skipFunctionBodies);
if (sourceMapFilename.size()) {