Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use wabt-rs wast2json? #2

Closed
pepyakin opened this issue Jan 22, 2018 · 0 comments
Closed

Use wabt-rs wast2json? #2

pepyakin opened this issue Jan 22, 2018 · 0 comments

Comments

@pepyakin
Copy link
Collaborator

No description provided.

pepyakin added a commit that referenced this issue Feb 5, 2018
NikVolf pushed a commit that referenced this issue Feb 5, 2018
* Add checking for fuzz.

* Use wabt's validation instead of wasm2wat.

Fixes #16
Fixes #34

* Check fuzz with nightly.

* Install nightly toolchain

* Travis Driven Development #1

* Travis Driven Development #2
Robbepop added a commit that referenced this issue Dec 23, 2021
Robbepop added a commit that referenced this issue Dec 30, 2021
Robbepop added a commit that referenced this issue Jan 5, 2022
Robbepop added a commit that referenced this issue Jan 6, 2022
* add doc comment to InstructionsBuilder

* make v2 module tests compile again after renaming

* apply rustfmt

* add size_of unit test for Instruction

* add len_locals field to Instruction::FuncBodyStart

This allows the wasmi v2 interpreter to eliminate an indirection when calling a Wasm function.

* move bytecode.rs as mod.rs into bytecode folder

* move bytecode utility types into utils.rs submodule

* move bytecode unit test into tests.rs submodule

* remove old unit test

* add VisitInstruction trait + Instruction::visit

* export VisitInstruction trait to engine module

* apply rustfmt

* remove Instruction::visit and add ResolvedFuncBody::visit(index)

For visit to work properly for BrTable targets we need access to the underlying slice of instructions.

* apply clippy suggestion

* add skeleton implementation for VisitInstruction for EngineInner

This will later include the entire interpreter implementation specific to each wasmi bytecode instruction.

* make assert debug_assert

* add default_memory and default_table fields to FunctionFrame

These two fields are not necessary but act as optimizations in the common case of accessing the default linear memory or default table of the associated module instance.

* rename ResizableLimits to TableType

* remove commented out code

* add PartialEq and Eq to Signature

* rename to TableType in table.rs

* fix some &mut self receivers in Table

* fix &mut self receiver on Memory type API

* use impl AsContextMut in Memory::new

* remove locals from WasmFuncEntity

The local variables are now stored directly in the bytecode.
This reduces the number of indirections required upon calling.

* add FuncEntity::new_wasm constructor

* use error types from the artificial error module in v2

* add instance API and instance support for the Store

* add module instantiation logic

Running the start function has not yet been implemented.

* fix no_std build

* fix private doc links

* rename src/v2 into v1 as suggested by pepyakin

* properly adjust imports after renaming

* fix Global::set self receiver

* fix some doc links

* remove superflous file

I have no idea how this file was duplicated ...

* finalize instantiation process without running start function

* re-export InstancePre

* allow plenty of warnings again (since warnings are gone now)

* add plenty of missing docs to error types

* panic from TableType::new instead of returning Result

* derive PartialEq + Eq for MemoryType

* implement Linker::instantiate

* no longer return Signature by reference in Func::signature

Reason: Signature already is a Copy type.

* add instance handles to Wasm functions (Func)

This required altering the module instantiation process so that the instance handle is known upfront.

* remove no longer needed code for Locals

* add WasmFuncEntity::instance method getter

* implement initial skeleton for new v1 wasm interpreter

* apply rustfmt

* apply clippy suggestion

* implement initial version of VisitInstruction for the interpreter

* re-add Extend and FromIterator impls for ValueStack

Removing them broke unit tests.

* implement visit_{get_local, set_local, tee_local}

* refactor instruction execution context impl

* implement visit_current_memory and visit_grow_memory

* fix compilation

* implement {i32,i64,f32,f64}.load for instruction executor

* implement {i32,i64,f32,f64}.store instruction execution

* implement {i32,i64}.store{8,16,32} Wasm instructions in the executor

* implement {i32,i64}.load_{8,16,32}{s,u} for instruction executor

* implement relative Wasm operator instruction execution

* implement unary int operands in executor

* apply rustfmt

* use existing traits instead of creating own ones

* implement basic arithmetic ops for instruction executor

* implement Bit{And,Or,Xor} for executor

* implement shift and rotate Wasm operands for executor

* implement unary float Wasm operators for executor

* add add,sub,mul,div impls for floats in executor

* implement float min, max and copysign for executor

* implement wrap and extend Wasm operands in executor

* rename some internal executor methods

* remove u128 and i128 impls for new LittleEndianConvert trait

* implement float->int cast and reinterpret for executor

* lazily load default memory and table in function executor

* use LittleEndianConvert trait from crate::value module

* write results back into results buffer after function execution

* implement nested Wasm function calls in executor

* add Signature::inputs_outputs accessor method

This is slightly more efficient than separately calling inputs and outputs.

* implement calling of host functions in new v1 interpreter

* properly advance the instruction pointer of the new interpreter

* rename tests/spec/mod.rs -> v0.rs

* fix tests compilation

* move v0 integration tests into v0 folder

* fix integration test compilation

* add From impls for Extern

* add AsContext and AsContextMut impls for generic references

* clean-up Caller

* re-export Caller to v1

* clean-up AsContext[Mut] impls for Store

* fix doc link

* use &mut instead of as_context_mut() in hot path

* add Instance::exports method to iterate over all exports of an instance

* make Instance::get_export public

* add doc comments to Instance methods

* add panic doc comments to Global methods

* add panic doc comments to Signature methods

* add panic doc comments to Table methods

* merge limits.rs and table.rs in v1

* add panic doc comments to Memory methods

* make Engine::new private

Users should use Engine::default for default config instead.

* unsilence a warning and clean-up imports

* clean-up FuncEntity impls slightly

* apply rustfmt

* apply rustfmt #2

* make it possible to call Wasm functions in v1 engine

* remove unneeded APIs from FuncEntity

* implement forgotten generic AsContext impl

* update docs for TableType

* add std::error::Error trait impls to some v1 error types

* add initial test skeleton for v1 based on wast crate

* silence some warnings in the new v1 wasm spec test runner

* refactor Wasm spec test module loading

* print profiles after a run

Usually profile printing is hidden. Unhide with '-- --nocapture'.

* add proper API to TestProfile

* move TestDescriptor into its own file

* move TestProfile into its own file

* turn InstanceNotRegistered into named struct variant

* move TestError and TestContext into their own respective .rs files

* better formatting for test profile printing

* ignore Wasm spec test suite for v1 for now

* fix some warnings in Wasm spec test suite runner

* apply rustfmt

* add Trap variant to TestError

* implement TestContext::invoke

* properly handle WastDirective::Invoke

* normalize dependency versions

* change Error field names

* add TestError::GlobalNotFound

* refactor TestContext::compile_and_instantiate

* fix TestContext::invoke

* add TestContext::get_global

* adjust v1 Wasm spec test runner to recent changes

* fix some warnings

* return anyhow::Error instead of TestError

* finish initial draft of the new Wasm spec test runner for v1

* clear value stack and call stack before calling a Wasm function

* write back results with proper value types

* reserve some value stack space

This is not the final solution but makes things work for now.

* do not actually clear the value stack but just reset the stack pointer

* allow allocating ByteBuffer with 0 length

In the case of true virtual memory we avoid the case anyways internally.

* improve Wasm spec test suite

* fix typo

* impl Error for LinkerError

* implement InstancePre::start

This is executing the `start` function and finishes initialization.

* use InstancePre::start instead of InstancePre::ensure_no_start_fn in test runner

* convert error into panic where appropriate

* improve panic to assert

* remove println in InstancePre::start

* rename InstancePre::ensure_no_start_fn -> ensure_no_start

* fix a bug in InstructionsBuilder

* fix bug in Memory::grow

* fix Default impl for CallStack

Now it is using the correct default call stack limit.

* fix bug in ValueStack::drain

* make yet another Wasm spec test pass

* no longer do the hacky reserve without knowledge of function stack heights

* adjust for new ValueStack::drain return type

* add MemoryType::satisfies API

* make new API crate private

* add TableType::satisfies API

* make use of new {MemoryType, TableType}::satisfies APIs

* fix docs and doc links

* apply clippy suggestion

* add TestDescriptor::spanned API for better debugging output

* fix compilation errors in the new TestDescriptor API

* make shared ref to TestDescriptor part of TestContext

* improve debug message for .wast -> .wasm conversion

* improve debug message for AssertException directive

* add TODO comment

* improve a bunch of debugging messages

* improve yet another bunch of Wasm spec test debug messages

* generically improve debug messages if not caught

* remove unused imports

* fix v1 test runner

* implement WastDirective::Register

* improve some more Wasm spec test runner panic messages

* improve v1 test generator macro

* ignore only necessary Wasm spec tests for v1

We ignore them until they are fixed for CI to work better.

* slight clean-up in some macros

* remove unused ValueStack methods

* do plenty of code clean-ups

* clean-up Wasm spec test suite for v1 a bit

* apply rustfmt

* add new benchmark for v1 engine

* add benchmark for v1 fac_recursive

* add benchmark for v1 tiny_keccak

* clean up some benchmark code

* add host_calls benchmarks

* fix Float::copysign implementation

Also add regression unit test.

* fix Float::{min,max} implementations

Also add regression unit tests for both operations.
Now both operations adhere to the Wasm specification.

* enable wasm_f32[_bitwise], wasm_f64[_bitwise] and wasm_float_misc tests for v1

They are all now passing.

* fix wasm_imports Wasm spec test

* apply rustfmt

* fix InstancePre::start implementation

* add missing print func export to implicit "spectest" module

* enable wasm_start Wasm spec test

* rename TableEntity::ty -> table_type

* decrease size_of<DropKeep>

This directly influences the size_of<Instruction> for v1.

* decrease size of InstructionIdx

* decrease size_of<Instruction> from 24 to 16

* add recursive_ok_v1 benchmark

* apply rustfmt

* add #[inline] statement to ResolvedFuncBody::visit

Benchmarks show that this #[inline] statement significantly improves performance of the v1 engine.

* add benchmarks for compilation & validation and for module instantiation to v0

* add benchmarks for compilation & validation and for module instantiation for v1

* fix benchmark warnings

* fix benchmark warnings specific to v1 benchmarks

* move benches into workspace

* add TableType::from_elements constructor

* use new TableType::from_elements constructor

* add MemoryType::from_elements constructor

* make use of new MemoryType::from_elements constructor

* Revert "move benches into workspace"

This reverts commit 954a320.

* update Wasm spec test suite

* update Wasm spec test suite

* update Wasm spec test suite

* use own version of the Wasm spec test suite for v1

* update Wasm spec testsuite for v1

* update Wasm spec test suite for v1

* update Wasm spec test suite for v1

* update Wasm spec test suite

* update Wasm spec test suite for v1

* update Wasm spec test suite for v1

* update Wasm spec test suite for v1

* register function max stack heights and adjust value stack dynamically

* enabled wasm_skip_stack_guard_page Wasm spec test

Further investigation for extreme slow down is needed!

* add Config for Engine and add maximum limits to {Value,Call}Stack

* properly extract maximum value stack height during function compilation

* apply clippy suggestions

* change visibility of MemoryType::from_elements to pub(crate)

* fix compile bug m(

* fix compile bug #2 m(

* fix virtual memory in v1

* clean-up benchmarks

* fix recursive_ok v1 benchmarks

* add count_until benchmarks between v0 and v1

* make wasmi traps more conformant to Wasm specification

* move Trap as variant into base v1::Error type

* adjust v1 test spec runner to assert trap messages

This yielded some inconsistencies with wasmi's trap handling so far.

* removed commented out code

* use lto = "fat" and codegen-units = "1" for benchmarks

This heavily improves performance of v1 but does not much to v0.

* improve Caller to support an internal optional instance handle

* propagate instance handle for Wasm -> host calls
Robbepop added a commit that referenced this issue Jul 5, 2022
Robbepop added a commit that referenced this issue Sep 11, 2022
Robbepop added a commit that referenced this issue Nov 4, 2022
Robbepop added a commit that referenced this issue Nov 4, 2022
* disable contract instantiation benchmarks for now

* attempt #2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant