Correctly count the number of wasm parameters. (#1337)
* Correctly count the number of wasm parameters. Following up on #1329, this further replaces `num_normal_params` with a function which calls `is_wasm_parameter` to correctly count the number of wasm parameters a function has. * Move is_wasm_parameter's implementation into the trait.
This commit is contained in:
@@ -140,7 +140,9 @@ pub trait TargetEnvironment {
|
||||
pub trait FuncEnvironment: TargetEnvironment {
|
||||
/// Is the given parameter of the given function a wasm-level parameter, as opposed to a hidden
|
||||
/// parameter added for use by the implementation?
|
||||
fn is_wasm_parameter(&self, func: &ir::Function, index: usize) -> bool;
|
||||
fn is_wasm_parameter(&self, signature: &ir::Signature, index: usize) -> bool {
|
||||
signature.params[index].purpose == ir::ArgumentPurpose::Normal
|
||||
}
|
||||
|
||||
/// Should the code be structured to use a single `fallthrough_return` instruction at the end
|
||||
/// of the function body, rather than `return` instructions as needed? This is used by VMs
|
||||
|
||||
Reference in New Issue
Block a user