diff options
| author | Alon Zakai <azakai@google.com> | 2023-04-05 12:24:30 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-05 12:24:30 -0700 |
| commit | 30097e5da0a99fa42dac1af1efeb435c5f15e1f0 (patch) | |
| tree | c752d76f012445d092458ebfa79450bbb7a0d432 /src/wasm | |
| parent | 9ee557aa7fbb494b222c4692cbef1c2be983e532 (diff) | |
| download | binaryen-30097e5da0a99fa42dac1af1efeb435c5f15e1f0.tar.gz binaryen-30097e5da0a99fa42dac1af1efeb435c5f15e1f0.tar.bz2 binaryen-30097e5da0a99fa42dac1af1efeb435c5f15e1f0.zip | |
Only update functions in optimizeAfterInlining() (#5624)
This saves the work of freeing and allocating for all the other maps. This is a
code path that is used by several passes so it showed up in profiling for
#5561
Diffstat (limited to 'src/wasm')
| -rw-r--r-- | src/wasm/wasm.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/wasm/wasm.cpp b/src/wasm/wasm.cpp index 54e9dd142..b21c1849a 100644 --- a/src/wasm/wasm.cpp +++ b/src/wasm/wasm.cpp @@ -1568,6 +1568,13 @@ void Module::removeTags(std::function<bool(Tag*)> pred) { removeModuleElements(tags, tagsMap, pred); } +void Module::updateFunctionsMap() { + functionsMap.clear(); + for (auto& curr : functions) { + functionsMap[curr->name] = curr.get(); + } +} + void Module::updateDataSegmentsMap() { dataSegmentsMap.clear(); for (auto& curr : dataSegments) { @@ -1576,10 +1583,7 @@ void Module::updateDataSegmentsMap() { } void Module::updateMaps() { - functionsMap.clear(); - for (auto& curr : functions) { - functionsMap[curr->name] = curr.get(); - } + updateFunctionsMap(); exportsMap.clear(); for (auto& curr : exports) { exportsMap[curr->name] = curr.get(); |
