Commit Graph

11 Commits

Author SHA1 Message Date
Dan Gohman
25b8b45a41 Avoid unnecessary BufReaders. 2017-10-03 09:34:41 -07:00
Jakob Stoklund Olesen
1349a6bdbc Always require a Flags reference for verifying functions.
Add a settings::FlagsOrIsa struct which represents a flags reference and
optionally the ISA it belongs to. Use this for passing flags/isa
information to the verifier.

The verify_function() and verify_context() functions are now generic so
they accept either a &Flags or a &TargetISa argument.

Fix the return_at_end verifier tests which no longer require an ISA
specified. The signle "set return_at_end" flag setting now makes it to
the verifier even when no ISA is present to carry it.
2017-09-14 17:51:15 -07:00
Dan Gohman
c7b1bb5f9e Simplify using map_err and expect. 2017-09-12 13:40:19 -07:00
Dan Gohman
1ab207b93c Add support for emitting code with a single return at the end. (#153)
This also enables testing of the wasmtests tests.

This also updates for wabt updating to the official "wat" filename
extension, as opposed to "wast".
2017-09-12 13:27:36 -07:00
Jakob Stoklund Olesen
dc2bee9cef Add a FuncEnvironment::make_direct_func() callback.
This allows the environment to control the signatures used for direct
function calls. The signature and calling convention may depend on
whether the function is imported or local.

Also add WasmRuntime::declare_func_{import,type} to notify the runtime
about imported and local functions. This is necessary so the runtime
knows what function indexes are referring to .

Since imported and local functions are now declared to the runtime, it
is no longer necessary to return hashes mapping between WebAssembly
indexes and Cretonne entities.

Also stop return null entries for the imported functions in the
TranslationResult. Just return a vector of local functions.
2017-09-06 12:36:19 -07:00
Dan Gohman
320c88f365 Rename cretonne_wasm to cton_wasm, for consistency with the other libraries. 2017-09-05 16:30:44 -07:00
Dan Gohman
566c772e20 Eliminate more unnecessary calls to .iter(). 2017-08-31 17:03:12 -07:00
Dan Gohman
9726bb7367 Avoid matching with reference patterns.
https://github.com/rust-lang-nursery/rust-clippy/wiki#match_ref_pats
2017-08-31 12:47:05 -07:00
Dan Gohman
2efdc0ed37 Update rustfmt to 0.9.0. 2017-08-31 10:44:59 -07:00
Dan Gohman
dcb65b59c1 Remove an unnecessary mut, fixing a compiler warning. 2017-08-30 09:10:08 -07:00
Denis Merigoux
ee9989c4b9 Dumped code from the wasm2cretonne repo.
Integrated wasm test suite translation as cretonne test

Fixes #146.
Fixes #143.
2017-08-28 15:57:43 -07:00