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

Support pass to reference type arguments using the EXTERNREF #152

Open
brew0722 opened this issue Jan 26, 2022 · 1 comment
Open

Support pass to reference type arguments using the EXTERNREF #152

brew0722 opened this issue Jan 26, 2022 · 1 comment
Assignees
Labels
dynamic_link relate the dynamic link call feature enhancement New feature or request

Comments

@brew0722
Copy link
Contributor

brew0722 commented Jan 26, 2022

Closes: #151

wasm cannot easily reference external memory regions, since each instance is guaranteed to be a sandboxed region of memory.
To solve this limitation, there is a feature spec that supports reference types.
I am particularly interested in the EXTERNREF keyword.

But now, it seems that most of them have been introduced in a limited way only in the web environment. find the methods using in our VM.

@brew0722 brew0722 self-assigned this Jan 26, 2022
@brew0722
Copy link
Contributor Author

https://github.com/wasmerio/wasmer/blob/4c1bf5cb15c8743412ae0c2418e17a776eb3756f/lib/types/src/features.rs#L91
To use the reference type, the bulk_memory feature must also be activated.
Before this issue, the bulk_memory related issue must be resolved first.
#154

@brew0722 brew0722 added dynamic_link relate the dynamic link call feature enhancement New feature or request labels Feb 23, 2022
brew0722 pushed a commit to brew0722/cosmwasm that referenced this issue Mar 29, 2022
brew0722 pushed a commit that referenced this issue Mar 31, 2022
* feat: add #[callable_point] proc macro

* feat: add #[dynamic_link] proc macro

* fix: publiclize the memory module

using in #[callable_point] and #[dynamic_link]

* feat: add re-exports #[callable_point] and #[dynamic_link]

* feat: make tuple return by #[callable_point] and #[dynamic_link]

* feat: add copies region of args and return between env

The actual copy calls are executed by wasmvm.

* fix: disable return the tuple type

#156

* refactor: improve error handling with proc_macro_error

* feat: update sample contract for dynamic_link

* test: add unit test for copy_region_vals_between_env

* test: add integration test for callable_point macro

proc_macro cannot do normal unit tests.
Instead, it is replaced by the contract's integration test.

* test: add integration test for dynamic_link macro

proc_macro cannot do normal unit tests.
Instead, it is replaced by the contract's integration test.

* fix: unlimit the target_arch of memory module

When running the test with dynamic_link proc_macro,
it should be able to compile the memory module on other architectures as well.

* chore: cargo fmt

* chore: update cargo.lock for contracts

* fix: fix maximum size

* chore: cargo clippy

* test: add module name test condition for dynamic_link macro

* chore: fix reverted unused warnings in the contracts

* chore: fix typo

* chore: remove unnecessary prefix

* refactor: improve abort message

* refactor: change to use quote! and proc_macro2

proc_macro2 allows the implementation of separate modules.

* chore: update cargo.lock

* chore: disable clippy warning for abort_by!

* fix: add disallowed type by parameter

see: #152

* chore:cargo fmt

* chore: avoid false-positive of clippy

* chore: again avoid clippy

* chore: fix typo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dynamic_link relate the dynamic link call feature enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant