Commit Graph

11 Commits

Author SHA1 Message Date
Sergei Pepyakin b67af25899
Apply cargo-fix on wasmi (#191)
* cargo-fix wasmi

* fmt

* Remove allow_failures

* Add dyn in benches

* Fix nightly
2019-07-10 17:45:06 +03:00
Sergei Pepyakin a3aad8a549
Extract validation into a separate crate (#176)
* Add some docs.

* return_type isn't failable

* Add comment about safety of top_label

* Attempt number 10

* Rework.

Now we will a compiler which wraps and uses info from a evaluation simulator.

* Get rid of outcome

* Introduce StartedWith

* Actually use started_with.

* Mirror label_stack.

* Avoid using frame_type.

* Finally get rid from frame_type.

* Extract compilation

* Refactoring cleaning

* Validation separated from compilation.

* Move sink to FunctionReader

* Rename to compiler.

* fmt

* Move push_label under validation context.

* Add Validation traits

* Express the compiler using validation trait

* Move code under prepare

* Comments.

* WIP

* The great move of validation

* Make validation compile

* Make it compile.

* Format it.

* Fix warnings.

* Clean.

* Make it work under no_std

* Move deny_floating_point to wasmi

* Rename validate_module2 → validate_module

* Make validation tests work

* Make wasmi compilation tests work

* Renamings.

* Get rid of memory_units dependency in validation

* Rename.

* Clean.

* Estimate capacity.

* fmt.

* Clean and detail End opcode.

* Add comment about top_label safety

* Remove another TODO

* Comment access to require_target

* Remove redundant PartialEq

* Print value that can't be coerced to u32

* s/with_instruction_capacity/with_capacity

* fmt.

* fmt

* Proofs

* Add better proof

* Get rid of unreachable in StackValueType

* Propagate error if frame stack overflown on create

* use checked sub instead of -

* Keep::count
2019-04-19 16:05:09 +02:00
Jef 899cc32e45 rustfmt (#151) 2018-12-11 12:54:06 +01:00
Julius Rakow 20154c5e24 Add no_std support (#122)
* add default-enabled std feature

* use parity-wasm/std feature only if std is enabled

* drop dependency on std::io

* use hashmap_core instead of std::collections::HashMap

* disable std::error in no_std

* core and alloc all the things

* mention no_std in readme

* add no_std feature and use hashmap_core only on no_std

* rename the no_std feature to core

* drop dependency on byteorder/std

* simplify float impl macro

* remove some trailing whitespace

* use libm for float math in no_std

* add note about no_std panics of libm to readme

* Embed nan-preserving-float crate.

* Add no_std check to the Travis CI config

* add missing dev-dependency
2018-10-29 11:16:55 +01:00
Sergey Pepyakin fa82dee676 Add docs (#32) 2018-02-01 19:46:33 +03:00
Sergey Pepyakin c96735d6d6 Wasm function can only trap (#29)
* Introduce Trap struct.

* get_local can't fail.

* Add MemoryOutOfBounds trap.

* from_little_endian use slice instead of vec.

* MemoryAccessOutOfBounds for mem get and set.

* from_little_endian conversion can't fail.

* call_indirect traps.

* DivisionByZero and InvalidConversionToInt

* Use traps in value to convey an error

* select: int condition on stack top

* if: int condition on stack top

* Assert pops.

* Another protions of assert pops

* Introduce ValueStack

Also, hide FunctionContext and remove some stale code

* Traps in execution

* Make it compile.

* Check args before invoke.

* Document RuntimeArgs.

* Update host.rs

* Add rustdoc for Trap.
2018-02-01 14:59:21 +03:00
Sergey Pepyakin 551c992730
4th iteration on documentation (#22)
* Rename LoadedModule to Module

* Hide TryInto

* Fix rustdoc tests.

* Rename from_parity_wasm_module and doc it.

* Document `Module::from_buffer`

* Tidy Module docs

* Some rustdoc headers.

* Document FuncInstance::{alloc_host, signature}

* Document descriptors.

* Doc NotStartedModuleRef

* Fix cargo-deadlinks
2018-01-26 19:24:40 +03:00
Nikolay Volf 429aaa2a4e
Merge pull request #11 from pepyakin/docs-1
First iteration on documentation.
2018-01-23 20:00:29 +03:00
Sergey Pepyakin 41983cff0a First iteration on documentation. 2018-01-23 19:38:49 +03:00
Sergey Pepyakin a98852e62a Couple of fixes 2018-01-23 18:12:52 +03:00
Sergey Pepyakin 49347a63ee Initial commit 2018-01-17 19:54:06 +03:00