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

feat: add import&export macro and serialized data copy pass #157

Merged
merged 30 commits into from
Mar 31, 2022

Conversation

brew0722
Copy link
Contributor

@brew0722 brew0722 commented Feb 23, 2022

Description

Closes #153

  • Add #[callable_point] that supports the easy function export and deserialize passed args internally.
  • Add #[dynamic_link] that supports the easy function import and serialize the passing args internally.
  • Add above serialized data copy function on VM host side. (with wasmvm)

please note:

And, Please The dynamic_link poc PR(#153) first. This PR is based on #153.
#153 must be merged first before this PR can be reviewed.

Types of changes

  • Bug fix (changes which fixes an issue)
  • New feature (changes which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • ETC (build, ci, docs, perf, refactor, style, test)

Checklist

@brew0722 brew0722 added enhancement New feature or request dynamic_link relate the dynamic link call feature labels Feb 23, 2022
@brew0722 brew0722 self-assigned this Feb 23, 2022
@brew0722 brew0722 force-pushed the dynamic_link_proc_macro branch 7 times, most recently from a3b068b to b5da1ff Compare March 10, 2022 00:54
@brew0722 brew0722 marked this pull request as ready for review March 10, 2022 02:33
Copy link
Contributor

@loloicci loloicci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are many format! to make code strings. Use quote! instead of them.
https://doc.rust-lang.org/proc_macro/macro.quote.html

packages/derive/src/lib.rs Outdated Show resolved Hide resolved
packages/derive/src/lib.rs Outdated Show resolved Hide resolved
packages/derive/src/lib.rs Outdated Show resolved Hide resolved
Jiyong Ha added 13 commits March 18, 2022 13:18
using in #[callable_point] and #[dynamic_link]
The actual copy calls are executed by wasmvm.
proc_macro cannot do normal unit tests.
Instead, it is replaced by the contract's integration test.
proc_macro cannot do normal unit tests.
Instead, it is replaced by the contract's integration test.
When running the test with dynamic_link proc_macro,
it should be able to compile the memory module on other architectures as well.
@brew0722
Copy link
Contributor Author

brew0722 commented Mar 18, 2022

force pushed because it based on PR #153, and PR#153 is squash merged now.
So I rebased for that.

@brew0722
Copy link
Contributor Author

brew0722 commented Mar 29, 2022

There are many format! to make code strings. Use quote! instead of them.
https://doc.rust-lang.org/proc_macro/macro.quote.html

I refactored that using the quote! and proc_macro2. please review again.
(thanks good suggestion! The reason I did not use it before was because I was don't know with how to use quote! for repeatation.)

@brew0722 brew0722 requested a review from loloicci March 29, 2022 10:27
@brew0722 brew0722 merged commit 5cfcf14 into Finschia:dynamic_link Mar 31, 2022
@brew0722 brew0722 deleted the dynamic_link_proc_macro branch March 31, 2022 07:34
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

Successfully merging this pull request may close these issues.

3 participants