mirror of
https://github.com/fluencelabs/wasmer
synced 2025-04-02 07:51:03 +00:00
Use vec.push instead of .insert for vmctx arg
This commit is contained in:
parent
b7c3cc09d1
commit
b6416068a8
@ -459,8 +459,8 @@ impl<'env, 'module, 'isa> FuncEnvironment for FuncEnv<'env, 'module, 'isa> {
|
|||||||
// Build a value list for the indirect call instruction containing the call_args
|
// Build a value list for the indirect call instruction containing the call_args
|
||||||
// and the vmctx parameter.
|
// and the vmctx parameter.
|
||||||
let mut args = Vec::with_capacity(call_args.len() + 1);
|
let mut args = Vec::with_capacity(call_args.len() + 1);
|
||||||
|
args.push(vmctx_ptr);
|
||||||
args.extend(call_args.iter().cloned());
|
args.extend(call_args.iter().cloned());
|
||||||
args.insert(0, vmctx_ptr);
|
|
||||||
|
|
||||||
Ok(pos.ins().call_indirect(sig_ref, func_ptr, &args))
|
Ok(pos.ins().call_indirect(sig_ref, func_ptr, &args))
|
||||||
}
|
}
|
||||||
@ -485,8 +485,8 @@ impl<'env, 'module, 'isa> FuncEnvironment for FuncEnv<'env, 'module, 'isa> {
|
|||||||
.expect("missing vmctx parameter");
|
.expect("missing vmctx parameter");
|
||||||
|
|
||||||
let mut args = Vec::with_capacity(call_args.len() + 1);
|
let mut args = Vec::with_capacity(call_args.len() + 1);
|
||||||
|
args.push(vmctx);
|
||||||
args.extend(call_args.iter().cloned());
|
args.extend(call_args.iter().cloned());
|
||||||
args.insert(0, vmctx);
|
|
||||||
|
|
||||||
Ok(pos.ins().call(callee, &args))
|
Ok(pos.ins().call(callee, &args))
|
||||||
}
|
}
|
||||||
@ -532,8 +532,8 @@ impl<'env, 'module, 'isa> FuncEnvironment for FuncEnv<'env, 'module, 'isa> {
|
|||||||
let sig_ref = pos.func.dfg.ext_funcs[callee].signature;
|
let sig_ref = pos.func.dfg.ext_funcs[callee].signature;
|
||||||
|
|
||||||
let mut args = Vec::with_capacity(call_args.len() + 1);
|
let mut args = Vec::with_capacity(call_args.len() + 1);
|
||||||
|
args.push(imported_vmctx_addr);
|
||||||
args.extend(call_args.iter().cloned());
|
args.extend(call_args.iter().cloned());
|
||||||
args.insert(0, imported_vmctx_addr);
|
|
||||||
|
|
||||||
Ok(pos
|
Ok(pos
|
||||||
.ins()
|
.ins()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user