Commit Graph

485 Commits

Author SHA1 Message Date
Nikolay Volf 1ef05d71ed Strip custom sections in wasm-prune (#150)
* strip custom sections

* line width
2021-06-10 14:29:59 +03:00
Sergei Shulepov 0cead7ba6d Merge pull request #151 from paritytech/ser-bless
Add BLESS env option
2021-06-10 11:13:04 +02:00
Sergei Shulepov e1c8ce90a1 Merge pull request #152 from paritytech/ser-fix-locals
Fix counting of the local variables
2021-06-10 10:49:36 +02:00
Sergei Shulepov 9e98400de0 Update tests/diff.rs
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
2021-06-10 10:49:16 +02:00
Sergey Shulepov 19760b5835 Fix counting of the local variables
The code assumed that the number of `Local` and number of locals is the
same thing. In reality though it is not. `Local` actually represents a
group of locals with the same type. The group can declare more than one
variable and the number of them is returned by `Local::count`.

In this PR we acknowledge this fact. Along the way we add a checked
arithmetic for locals_count and max_stack_height summation.
2021-06-09 19:22:40 +02:00
Sergey Shulepov 717aa8f0cb Add BLESS env option
Right now if there is a diff between the actual and expected results,
the expected file will be overwritten. This may be annoying. To make it
controlled we introduce BLESS option.

This means that the expected files won't be regenerated unless this
environment variable is set.

Therefore to regenerate the tests use:

    BLESS=1 cargo test
2021-06-09 19:17:54 +02:00
Sergei Shulepov d891cddcb3 Merge pull request #149 from paritytech/at-export-parity-wasm
Export the complete `parity-wasm` crate
2021-05-27 12:18:15 +02:00
Alexander Theißen 95a711bc33 Re-export the whole parity_wasm crate 2021-05-26 15:10:15 +02:00
Alexander Theißen 1b0ed1b383 Transition to Rust 2018 style imports 2021-05-26 14:59:04 +02:00
Sergei Shulepov ca45220af5 Merge pull request #148 from paritytech/at-update-deps
Update dependencies
2021-04-22 12:42:51 +03:00
Alexander Theißen 2d1f4daed7 Update dependencies 2021-04-22 09:08:41 +02:00
Alexander Theißen ad01d9b41c Bump to 0.17.1 2021-04-21 14:12:12 +02:00
Alexander Theißen b2272f39bc stack_height: if instruction should pop one value from the stack (#147)
* stack_height: 'if' instruction should pop one value from the stack

* Fix indentation
2021-04-21 14:08:50 +02:00
Alexander Theißen d9432bafa9 Bump to 0.17 2020-12-12 18:45:19 +01:00
Alexander Theißen 1131240d39 Export parity_wasm::Instruction
We should export it because it is used in a public interface.
Otherwise every crate that depends on this needs to also
directly depend on parity_wasm.
2020-12-12 17:59:47 +01:00
Alexander Theißen 988ac32095 De-Bumo to 0.16.1
Last PR did not contain any change to an interface.
2020-12-10 10:53:30 +01:00
Sergei Shulepov 712c696c2d Merge pull request #145 from paritytech/cmichi-upgrade-to-parity-wasm-0.42.1
Upgrade to `parity-wasm` 0.42.1
2020-12-09 12:23:11 +01:00
Michael Mueller 9a0f992cb3 Use results length as arity 2020-12-08 17:24:59 +01:00
Michael Mueller d6127afd1d Upgrade to parity-wasm v0.42.1 2020-12-08 16:51:55 +01:00
Alexander Theißen 7da376062a bump to 0.16 2020-10-22 16:12:22 +02:00
Sergei Shulepov 3ab49836be Merge pull request #144 from paritytech/at-unify-packet
Merge pwasm-utils-cli into the main package
2020-10-22 14:34:09 +02:00
Alexander Theißen 2430b18633 Make feature "std" a requirement for the "cli" feature 2020-10-22 12:27:31 +02:00
Alexander Theißen aebfc0fbd7 Fixes necessary for having no_std imports work with edition2018 2020-10-22 12:26:24 +02:00
Alexander Theißen a2653cff5a Update CI script 2020-10-22 10:26:26 +02:00
Alexander Theißen 3142a74de2 Update README.md to reflect the new package unification 2020-10-21 20:49:34 +02:00
Alexander Theißen f556bde4a4 Ignore .vscode directory 2020-10-21 20:26:22 +02:00
Alexander Theißen f05f43b883 Unify pwasm-utils and pwasm-utils-cli packet 2020-10-21 20:24:49 +02:00
Alexander Theißen af761da031 Add repository metadata to Cargo.toml files 2020-10-21 11:37:30 +02:00
Alexander Theißen fbaae277fc bump to 0.15 2020-10-21 11:17:15 +02:00
Sergei Shulepov e0a05c6329 Merge pull request #143 from paritytech/at-instruction-costs
Make the rules passed to gas metering injection generic
2020-10-14 14:55:58 +02:00
Alexander Theißen e0dbaef676 Wrapped overlong line 2020-10-14 14:17:12 +02:00
Alexander Theißen 880d273861 Make the rules passed to gas metering injection generic 2020-10-14 13:26:48 +02:00
Sergei Shulepov 3568667ecb Merge pull request #142 from paritytech/at-cleanup
Address all clippy lints
2020-10-13 16:24:53 +02:00
Alexander Theißen c09a924a81 Address all clippy lints
These changes do not change the behaviour of the
code and should be non-controversial.
2020-10-13 15:42:01 +02:00
Sergei Shulepov f59eb121e5 Merge pull request #141 from paritytech/at-fixes
Fix issues with the stack height metering
2020-10-13 13:51:51 +02:00
Alexander Theißen 1f8e6dd5b2 Don't generate duplicate thunks
Previously, functions that appear in multiple places
(exported, start function, table) would generate a thunk
for each place they appear in. Those additional thunks are
identical and only only one of them would be referenced.
Main offender are tables with redundant entries.

This commit eliminates those duplicate thunks without adding
any additional overhead.
2020-10-13 11:43:59 +02:00
Alexander Theißen 5e3b06de05 Fix Instruction::CallIndirect stack height metering
The stack height metering for functions containing
CallIndirect was wrong. The code did not take into
consideration that is pops one value from the stack.

The effect was that the stack height of functions
using this instruction was higher than its real height.
2020-10-13 11:43:59 +02:00
Alexander Theißen 2306999c9c Fix using Write::write without checking the return value
Use write_all instead which garantues that the whole buffer
was written.
2020-10-13 11:43:40 +02:00
NikVolf 016425a25b bump to 0.14 2020-08-04 13:54:57 +03:00
Alexander Theißen 409ced002a Allow specifying the module of the imported 'gas' function (#140)
* No need for mem::replace when doing a simple assignment

* Allow specifying the module of the imported 'gas' function

This allows users to place the imported function inside a custom
module instead of the generic 'env' module.
2020-08-04 13:53:53 +03:00
NikVolf b61f6dd52f bump to 0.13 2020-08-03 14:59:57 +03:00
Nikolay Volf e026abe166 Export internal globals instrumentation (#138)
* export internal globals

* add test

* Update src/export_globals.rs

Co-authored-by: Sergei Shulepov <sergei@parity.io>

* address review

Co-authored-by: Sergei Shulepov <sergei@parity.io>
2020-08-03 14:58:24 +03:00
Nikolay Volf 8c6dec11a4 Merge pull request #139 from paritytech/update-wabt
Update wabt to 0.10
2020-08-03 14:20:20 +03:00
NikVolf 3f2935df9c update wabt 2020-08-03 14:00:07 +03:00
Nikolay Volf dcf189b822 Merge pull request #135 from osolmaz/correct-spelling
Corrected spelling error
2020-07-29 16:05:53 +03:00
Sergei Shulepov 19b5fb50cb Merge pull request #137 from osolmaz/correct-instruction-type
Corrected InstructionType's for GetGlobal and SetGlobal
2020-07-27 22:26:16 +02:00
Onur Solmaz 1e8953a9cb Corrected InstructionType's for GetGlobal and SetGlobal 2020-07-27 13:56:53 +02:00
Onur Solmaz 377684f9c7 Corrected spelling error 2020-07-23 20:08:03 +02:00
Nikolay Volf e89abb0c17 Merge pull request #134 from bddap/bddap-nostd-on-stable
Bump 'parity-wasm' version to enable no_std builds on stable.
2019-11-01 16:36:11 +03:00
Andrew Dirksen e6336a4a90 Travis-ci was configured to build with no_std only when using rust nightly.
This commit tells travis to attempt no_std builds for both nightly and stable.
2019-10-31 16:56:11 -07:00