Commit Graph

9279 Commits

Author SHA1 Message Date
Dan Gohman
3f24098edc Implement the remaining valid spec tests.
And lots of other miscellaneous changes. Rename InstanceWorld to
InstancePlus and reorganize its contents. This still isn't a great name,
but at least now it has a clear purpose.
2018-12-12 11:49:02 -08:00
Jef
189996accd Fix receiving more than 6 arguments, allow calling functions with more than 6 arguments 2018-12-12 13:23:43 +01:00
Jef
86353cba5e Allow calling functions with any signature 2018-12-12 11:52:48 +01:00
Dan Gohman
8bd35e154b Tidy up some match bindings to be more consistent with the rest of the codebase. 2018-12-11 13:22:28 -08:00
Dan Gohman
6dd39dee6a Update to Cranelift 0.26.0. 2018-12-11 13:21:03 -08:00
Dan Gohman
c8e457e834 Bump version to 0.26.0 2018-12-11 12:54:23 -08:00
Dan Gohman
56850d481d Initial support for function, table, memory, and global imports. 2018-12-11 12:49:14 -08:00
Dan Gohman
bc18085ad1 Use EntityRef::from_u32 to reduce casting. 2018-12-11 15:40:24 -05:00
Dan Gohman
a55c933f19 Factor out a MemFlags constructor for trusted notrap/aligned accesses. 2018-12-11 15:40:24 -05:00
Dan Gohman
68a13646f9 Add a from_u32 function to EntityRef.
This eliminates the need for casting in common cases.
2018-12-11 15:40:24 -05:00
Dan Gohman
b841652539 Add a Slice to supplement PrimaryMap. 2018-12-11 15:40:24 -05:00
Dan Gohman
5b03581442 Tidy up use declaration syntax. 2018-12-11 15:40:24 -05:00
Dan Gohman
95a6a25db3 Update to pretty_env_logger 0.3.0. 2018-12-11 15:40:24 -05:00
Dan Gohman
7b51195f49 Add an offset to cranelift-wasm's GlobalVariable. 2018-12-11 15:40:24 -05:00
Dan Gohman
605f34257b Fix a missing #[test]. 2018-12-11 15:40:24 -05:00
Dan Gohman
30a0890319 Rename GlobalInit::GlobalRef to GlobalInit::GetGlobal.
"Ref" is an increasingly overloaded term.
2018-12-11 15:40:24 -05:00
Dan Gohman
566c160c37 Add a function to return the pointer type for a given triple.
Also use a slightly tidier naming convention for such functions.
2018-12-11 15:40:24 -05:00
Dan Gohman
38d1d58e06 Change GlobalInit::Import() to GlobalInit::Import. 2018-12-11 15:40:24 -05:00
Dan Gohman
76583192a8 Change ZeroOneOrMore::Zero() to TableElementType::Zero. 2018-12-11 15:40:24 -05:00
Dan Gohman
42e35c4c57 Implement PrimaryMap::with_capacity. 2018-12-11 15:40:24 -05:00
Dan Gohman
6e17bebf44 Publish TableElementType for library users. 2018-12-11 15:40:24 -05:00
Dan Gohman
f0dbba0ec8 Change TableElementType::Func() to TableElementType::Func. 2018-12-11 15:40:24 -05:00
Dan Gohman
c287231720 Implement FromIterator for PrimaryMap. 2018-12-11 15:40:24 -05:00
Dan Gohman
e623da51c6 Suppress dead-code warnings on functions expanded from entity_impl!. 2018-12-11 15:40:24 -05:00
Dan Gohman
91477d21c8 Add an as_u32() member to entity_impl types.
This allows us to avoid a lot of casting indices back to u32.
2018-12-11 15:40:24 -05:00
Dan Gohman
954573440d Remove ModuleEnvironment::get_func_name, which is unused. 2018-12-11 15:40:24 -05:00
Dan Gohman
a20c852148 Support heaps with no offset-guard pages.
Also, say "guard-offset pages" rather than just "guard pages" to describe the
region of a heap which is never accessible and which exists to support
optimizations for heap accesses with offsets.

And, introduce a `Uimm64` immediate type, and make all heap fields use
`Uimm64` instead of `Imm64` since they really are unsigned.
2018-12-11 15:40:24 -05:00
Sergey Pepyakin
b32f77ea02 Add the fib test. 2018-12-11 20:15:26 +01:00
Sergey Pepyakin
0cd70c649a Implement returns. 2018-12-11 20:13:20 +01:00
Sergey Pepyakin
e02dbf1bc2 Add i32 literals support. 2018-12-11 20:12:55 +01:00
Sergey Pepyakin
0e9ba8332f Pass arguments. 2018-12-11 19:46:41 +01:00
Benjamin Bouvier
93696a80bb Fixes #614: Implement a debug trap; 2018-12-10 14:14:04 -05:00
Dan Gohman
93f33141e9 Introduce VMFunctionBody to add extra type safety. 2018-12-08 21:00:42 -05:00
Dan Gohman
10bb311aea Reorganize unsafe code. 2018-12-08 21:00:42 -05:00
Dan Gohman
7dcca6be5b Improve error handling, and start refactoring Instance.
Introduce proper error handling in several places, and perform a first
pass at refactoring Instance to make it easier to use.
2018-12-07 23:51:23 -05:00
Sergey Pepyakin
078486e080 Basic form of a function call 2018-12-07 19:16:42 +01:00
Dan Gohman
fe562297a7 Rename wasmtime's --function to --invoke.
This highlights the similarity with the `invoke` command in `wast` files.
2018-12-07 06:25:23 -05:00
Dan Gohman
f065b39d65 Add Wasmtime as another example user of Cranelift. 2018-12-07 01:01:12 -05:00
Dan Gohman
a635861425 Report traps in functions invoked from the command line. 2018-12-06 23:56:45 -05:00
Dan Gohman
3b280e8799 Update to Rust 1.31.0. 2018-12-06 23:20:16 -05:00
Dan Gohman
230079d460 Improved error handling. 2018-12-06 23:03:32 -05:00
Dan Gohman
1fda62ed33 Flesh out the README.md with more specific goals. 2018-12-06 23:03:23 -05:00
Dan Gohman
dca7729313 Improve error handling and misc cleanups. 2018-12-06 23:03:12 -05:00
Dan Gohman
6198b89110 Update to pretty_env_logger 0.3.0. 2018-12-06 23:02:57 -05:00
Dan Gohman
08488591a9 Fix clippy warning namespaces. 2018-12-06 23:02:42 -05:00
Dan Gohman
06de604729 Rename InvokeOutcome to ActionOutcome and move it to its own module. 2018-12-06 23:02:33 -05:00
Dan Gohman
d9b4bd1de8 Support imports. 2018-12-06 23:02:19 -05:00
Dan Gohman
8170a9db79 Update to the rustfmt in rust 1.31, which is now stable. 2018-12-06 22:59:46 -05:00
Dan Gohman
5d7ece3d15 Fix clippy warning namespaces. 2018-12-06 20:50:38 -05:00
Dan Gohman
5adab629f2 Update to the rustfmt in rust 1.31, which is now stable. 2018-12-06 16:15:48 -05:00