Man page - wasm-split(1)

Packages contains this manual

Manual

WASM-SPLIT

NAME
DESCRIPTION

NAME

wasm-split - Split a module into a primary module and a secondary module, or instrument a

DESCRIPTION

================================================================================ wasm-split INFILES

Split a module into a primary module and a secondary module, or instrument a module to gather a profile that can inform future splitting, or manage such profiles. Options that are only accepted in particular modes are marked with the accepted "[<modes>]" in their descriptions. ================================================================================

wasm-split options: -------------------
--split

Split an input module into two output modules. The default mode.

--multi-split

Split an input module into an arbitrary number of output modules.

--instrument

Instrument an input module to allow it to generate a profile that can be used to guide splitting.

--merge-profiles

Merge multiple profiles for the same module into a single profile.

--print-profile

[print-profile] Print profile contents in a human-readable format.

--profile

[split] The profile to use to guide splitting.

--keep-funcs

[split] Comma-separated list of functions to keep in the primary module. The rest will be split out. Can be used alongside --profile and --split-funcs . You can also pass a file with one function per line by passing @filename.

--split-funcs

[split] Comma-separated list of functions to split out to the secondary module. The rest will be kept. Can be used alongside --profile and --keep-funcs . This takes precedence over other split options. You can also pass a file with one function per line by passing @filename.

--manifest

[multi-split] File describing the functions to be split into each module. Each section separated by a blank line begins with the base name of an output module, which is followed by a list of functions to place in that module, one per line.

--out-prefix

[multi-split] Prefix prepended to module names in the manifest file to create output file names.

--primary-output ,-o1

[split] Output file for the primary module.

--secondary-output ,-o2

[split] Output file for the secondary module.

--symbolmap

[split] Write a symbol map file for each of the output modules.

--no-placeholders

[split] Do not import placeholder functions. Calls to secondary functions will fail before the secondary module has been instantiated.

--placeholdermap

[split] Write a file mapping placeholder indices to the function names.

--import-namespace

[split, instrument] 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.

--placeholder-namespace

[split] The namespace from which to import placeholder functions into the primary module.

--jspi

[split] Transform the module to support asynchronously loading the secondary module before any placeholder functions have been called.

--export-prefix

[split] An identifying prefix to prepend to new export names created by module splitting.

--profile-export

[instrument] The export name of the function the embedder calls to write the profile into memory. Defaults to ‘__write_profile‘.

--in-memory

[instrument] Store profile information in memory (starting at address 0 and taking one byte per function) rather than globals (the default) so that it can be shared between multiple threads. Users are responsible for ensuring that the module does not use the initial memory region for anything else.

--in-secondary-memory

[instrument] 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.

--secondary-memory-name

[instrument] The name of the secondary memory created to store profile information.

--emit-module-names

[split, instrument] Emit module names, even if not emitting the rest of the names section. Can help differentiate the modules in stack traces. This option will be removed once simpler ways of naming modules are widely available. See https://bugs.chromium.org/p/v8/issues/detail?id=11808.

--initial-table

[split, instrument] A hack to ensure the split and instrumented modules have the same table size when using Emscripten’s SPLIT_MODULE mode with dynamic linking. TODO: Figure out a more elegant solution for that use case and remove this.

--emit-text ,-S

[split, instrument] Emit text instead of binary for the output file or files.

--debuginfo ,-g

[split, multi-split, instrument] Emit names section in wasm binary (or full debuginfo in wast)

--output ,-o

[instrument, merge-profiles, multi-split] Output file.

--unescape ,-u

Un-escape function names (in print-profile output)

--verbose ,-v

Verbose output mode. Prints the functions that will be kept and split out when splitting a module.

Tool options: -------------
--mvp-features
,-mvp

Disable all non-MVP features

--all-features ,-all

Enable all features

--detect-features

(deprecated - this flag does nothing)

--quiet ,-q

Emit less verbose output and hide trivial warnings.

--experimental-poppy

Parse wast files as Poppy IR for testing purposes.

--enable-sign-ext

Enable sign extension operations

--disable-sign-ext

Disable sign extension operations

--enable-threads

Enable atomic operations

--disable-threads

Disable atomic operations

--enable-mutable-globals

Enable mutable globals

--disable-mutable-globals

Disable mutable globals

--enable-nontrapping-float-to-int

Enable nontrapping float-to-int operations

--disable-nontrapping-float-to-int

Disable nontrapping float-to-int operations

--enable-simd

Enable SIMD operations and types

--disable-simd

Disable SIMD operations and types

--enable-bulk-memory

Enable bulk memory operations

--disable-bulk-memory

Disable bulk memory operations

--enable-exception-handling

Enable exception handling operations

--disable-exception-handling

Disable exception handling operations

--enable-tail-call

Enable tail call operations

--disable-tail-call

Disable tail call operations

--enable-reference-types

Enable reference types

--disable-reference-types

Disable reference types

--enable-multivalue

Enable multivalue functions

--disable-multivalue

Disable multivalue functions

--enable-gc

Enable garbage collection

--disable-gc

Disable garbage collection

--enable-memory64

Enable memory64

--disable-memory64

Disable memory64

--enable-relaxed-simd

Enable relaxed SIMD

--disable-relaxed-simd

Disable relaxed SIMD

--enable-extended-const

Enable extended const expressions

--disable-extended-const

Disable extended const expressions

--enable-strings

Enable strings

--disable-strings

Disable strings

--enable-multimemory

Enable multimemory

--disable-multimemory

Disable multimemory

--enable-typed-continuations

Enable typed continuations

--disable-typed-continuations

Disable typed continuations

--enable-shared-everything

Enable shared-everything threads

--disable-shared-everything

Disable shared-everything threads

--enable-fp16

Enable float 16 operations

--disable-fp16

Disable float 16 operations

--enable-typed-function-references

Deprecated compatibility flag

--disable-typed-function-references

Deprecated compatibility flag

--no-validation ,-n

Disables validation, assumes inputs are correct

--pass-arg ,-pa

An argument passed along to optimization passes being run. Must be in the form KEY@VALUE. If KEY is the name of a pass then it applies to the closest instance of that pass before us. If KEY is not the name of a pass then it is a global option that applies to all pass instances that read it.

--closed-world ,-cw

Assume code outside of the module does not inspect or interact with GC and function references, even if they are passed out. The outside may hold on to them and pass them back in, but not inspect their contents or call them.

--preserve-type-order

Preserve the order of types from the input (useful for debugging and testing)

--generate-stack-ir

generate StackIR during writing

--optimize-stack-ir

optimize StackIR during writing

--print-stack-ir

print StackIR during writing

General options: ----------------
--version

Output version information and exit

--help ,-h

Show this help message and exit

--debug ,-d

Print debug information to stderr