diff options
author | Ashley Nelson <nashley@google.com> | 2022-09-15 15:59:49 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-15 15:59:49 -0700 |
commit | 2a06bb4a7315162328d091a6eb2bb04fb53018c5 (patch) | |
tree | b67ad2833ccb7687e9c20c419c8df43de13aa723 /src/tools/wasm-split/split-options.cpp | |
parent | 2fdb22bc26185e94ccd775bbfe8ea271be03df45 (diff) | |
download | binaryen-2a06bb4a7315162328d091a6eb2bb04fb53018c5.tar.gz binaryen-2a06bb4a7315162328d091a6eb2bb04fb53018c5.tar.bz2 binaryen-2a06bb4a7315162328d091a6eb2bb04fb53018c5.zip |
Multi-Memories wasm-split (#4977)
Adds an --in-secondary-memory switch to the wasm-split tool that allows profile data to be stored in a separate memory from module main memory. With this option, users do not need to reserve the initial memory region for profile data and the data can be shared between multiple threads.
Diffstat (limited to 'src/tools/wasm-split/split-options.cpp')
-rw-r--r-- | src/tools/wasm-split/split-options.cpp | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/src/tools/wasm-split/split-options.cpp b/src/tools/wasm-split/split-options.cpp index b8ccde83e..d077c70bc 100644 --- a/src/tools/wasm-split/split-options.cpp +++ b/src/tools/wasm-split/split-options.cpp @@ -185,10 +185,12 @@ WasmSplitOptions::WasmSplitOptions() [&](Options* o, const std::string& argument) { placeholderMap = true; }) .add("--import-namespace", "", - "The namespace from which to import objects from the primary " - "module into the secondary module.", + "When provided as an option for module splitting, the namespace from " + "which to import objects from the primary " + "module into the secondary module. In instrument mode, refers to the " + "namespace from which to import the secondary memory, if any.", WasmSplitOption, - {Mode::Split}, + {Mode::Split, Mode::Instrument}, Options::Arguments::One, [&](Options* o, const std::string& argument) { importNamespace = argument; @@ -246,6 +248,29 @@ WasmSplitOptions::WasmSplitOptions() storageKind = StorageKind::InMemory; }) .add( + "--in-secondary-memory", + "", + "Store profile information in a separate memory, rather than in module " + "main memory or globals (the default). With this option, users do not " + "need to reserve the initial memory region for profile data and the " + "data can be shared between multiple threads.", + WasmSplitOption, + {Mode::Instrument}, + Options::Arguments::Zero, + [&](Options* o, const std::string& argument) { + storageKind = StorageKind::InSecondaryMemory; + }) + .add("--secondary-memory-name", + "", + "The name of the secondary memory created to store profile " + "information.", + WasmSplitOption, + {Mode::Instrument}, + Options::Arguments::One, + [&](Options* o, const std::string& argument) { + secondaryMemoryName = argument; + }) + .add( "--emit-module-names", "", "Emit module names, even if not emitting the rest of the names section. " |