Commit Graph

26 Commits

Author SHA1 Message Date
Jef 899cc32e45 rustfmt (#151) 2018-12-11 12:54:06 +01:00
Wei Tang 1c04be64f8 Remove redundent check_function_args (#135)
* Remove redundent check_function_args

* Remove unused format convertion in check_function_args

* Remove unnecessary alloc
2018-10-29 18:29:46 +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
Guanqun Lu 0409913a26 Typo fixes (#119)
* typo fixes

* more typo fixes
2018-08-03 16:05:10 +03:00
Sergey Pepyakin f6657bace4
Flat Stack (#98)
* Define Instruction Set.

* WIP

* WIP 2

* Tests

* Working

* Bunch of other tests.

* WIP

* WIP

* Use Vec instead of VecDeque.

* Calibrate the limits.

* Clean

* Clean

* Another round of cleaning.

* Ignore traces.

* Optimize value stack

* Optimize a bit more.

* Cache memory index.

* Inline always instruction dispatch function.

* Comments.

* Clean

* Clean

* Use vector to keep unresolved references.

* Estimate resulting size.

* do refactoring

* Validate the locals count in the begging

* Introduce Keep and DropKeep structs in isa

* Rename/Split Validator into Reader

* Document stack layout

* Remove println!

* Fix typo.

* Use .last / .last_mut in stack

* Update docs for BrTable.

* Review fixes.

* Merge.

* Add an assert that stack is empty after the exec
2018-07-04 10:08:45 +03:00
Wei Tang f91dc92119 Update parity-wasm dependency to 0.31 (#105)
* Update parity-wasm dependency to 0.31
* Fix tests
2018-06-29 14:10:04 +03:00
Jef 3890dd379f Preserve signalling bit in NaNs (#87)
* Preserve signalling bit in NaNs

* Fix warnings
2018-04-25 10:18:14 +03:00
Sergey Pepyakin d12a04f8ff
Publish with externvals (#81)
* Publish with_externvals constructor.
* Add examples to Signature::new.
* Use Iterators for ExternVal imports
2018-03-29 18:43:44 +03:00
Sergey Pepyakin 9140e869e2 Update spec testsuite; Fix instantiation bug (#61)
The bug was about instantiating a module with elements segment being out-of-bounds, however, it was with zero length. E.g.:

```
(module
  (table 0 anyfunc)
  (elem (i32.const 1))
)
```

In our impl there was no out-of-bounds, because there was no attempt to set any table entry.

This change adds early check for specifically this case.
2018-02-19 18:59:18 +03:00
Sergey Pepyakin 483736b1bd
Memory units (#42)
* Initial implementation

* Not use grow as it is makes debug builds very slow

* Use Pages::BYTE_SIZE for LINEAR_MEMORY_PAGE_SIZE

* Tidy docs.

* Use memory_units from git.
2018-02-09 16:45:21 +03:00
Sergey Pepyakin 528f468ef2 Minor fixes in docs (#38)
* Run nightly only if NIGHTLY_TOOLCHAIN is defined

* Minor fixes in docs.
2018-02-06 23:10:58 +03: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
Sergey Pepyakin cc24d8a77a Fix idents 2018-01-25 19:56:52 +03:00
Sergey Pepyakin bc89a20b96 Third iteration on documenation. 2018-01-25 18:17:25 +03:00
Sergey Pepyakin a98852e62a Couple of fixes 2018-01-23 18:12:52 +03:00
Sergey Pepyakin 730ff68599 FuncInstances hold WeakRef 2018-01-22 19:57:00 +03:00
Sergey Pepyakin e26ddb6d12 Hide MemoryType. 2018-01-22 16:34:32 +03:00
Sergey Pepyakin 973d58a643 Hide TableType. 2018-01-22 16:30:13 +03:00
Sergey Pepyakin b323d004fe Hide GlobalType 2018-01-22 16:23:07 +03:00
Sergey Pepyakin aae9a3c129 Hide validation stuff. 2018-01-22 16:11:20 +03:00
Sergey Pepyakin 469e9ef6b1 Get rid of invoke_index. 2018-01-18 17:15:11 +03:00
Sergey Pepyakin ca6299ba53 Hide ValueType. 2018-01-18 17:13:56 +03:00
Sergey Pepyakin e9470373f7 Migrate on Signature type. 2018-01-18 15:48:43 +03:00
Sergey Pepyakin 49347a63ee Initial commit 2018-01-17 19:54:06 +03:00