-
Notifications
You must be signed in to change notification settings - Fork 645
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(runtime): Wasmer 1.0 runner #3799
Conversation
let func = info.functions.get(index.clone()).unwrap(); | ||
let sig = info.signatures.get(func.clone()).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is unwrap safe here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still not answered
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is safe, this function is almost identical to wasmer_runner::check_method, just wasmer_runtime_core::module::ExportIndex::Func
=> wasmer_types::ExportIndex::Function
refactor done by wasmer. as i checked wasmer code, when Function(index)
is in module.info().exports
, corresponding index
always exist in info.functions
, say it is func
, and func
is always in info.signatures
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please address nit comments first
@@ -306,6 +314,19 @@ impl From<PrepareError> for VMError { | |||
} | |||
} | |||
|
|||
impl From<&VMLogicError> for VMError { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: why we use &VMLogicError
instead of VMLogicError
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There're two calls this with e.into()
, one e
is a &VMLogicError, another is VMLogicError, so make a From<&VMLogicError>
works for both
let func = info.functions.get(index.clone()).unwrap(); | ||
let sig = info.signatures.get(func.clone()).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still not answered
Add Wasmer 1.0 runner, enabled by wasmer1_vm features (similar to wasmtime_vm). Expose wasmer 1.0 runner and wasmtime runner available to neard and vm standalone.
Test Plan
All near-vm-runner tests pass. compatible behavior as wasmer 0.17. neard compiles and work with wasmer 1.0 runner turns on