diff options
author | Ben Smith <binjimin@gmail.com> | 2018-08-13 12:00:00 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-13 12:00:00 -0700 |
commit | 558bc1dd153da30d9e752988a16718565352e576 (patch) | |
tree | eba8edaf72beccc27d869753467a0633fbc55d59 /src/binary-reader-objdump.cc | |
parent | 221a39bb62a8984f894331aa5081957d332fd353 (diff) | |
download | wabt-558bc1dd153da30d9e752988a16718565352e576.tar.gz wabt-558bc1dd153da30d9e752988a16718565352e576.tar.bz2 wabt-558bc1dd153da30d9e752988a16718565352e576.zip |
[interp] Simplify host module imports (#889)
Importing from host modules used to be handled by a delegate, which is a
powerful enough solution to allow for all host import behaviors, but
makes the common case difficult and clunky.
It also assumed that every imported function/global/etc. needed to be
newly created and added to the environment, which is OK (though
wasteful) for functions, but is incorrect for mutable values like
memories and globals.
This change simplifies the common case by providing a set of functions
on `HostModule` that can be used to add exports, e.g.
AppendFuncExport("add", {{Type::I32, Type::I32}, {Type::I32}},
AddFunc);
A generic interface for functions is provided as well, to allow for
automatically generating functions as needed. This is currently used for
functions like "host.print" in `wasm-interp`.
Diffstat (limited to 'src/binary-reader-objdump.cc')
0 files changed, 0 insertions, 0 deletions