Tidy up unneeded '&'s.
This commit is contained in:
@@ -74,7 +74,7 @@ impl Compiler {
|
|||||||
SetupError,
|
SetupError,
|
||||||
> {
|
> {
|
||||||
let (compilation, relocations) =
|
let (compilation, relocations) =
|
||||||
cranelift::compile_module(&module, function_body_inputs, &*self.isa)
|
cranelift::compile_module(module, function_body_inputs, &*self.isa)
|
||||||
.map_err(SetupError::Compile)?;
|
.map_err(SetupError::Compile)?;
|
||||||
|
|
||||||
let allocated_functions =
|
let allocated_functions =
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ pub fn link_module(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Apply relocations, now that we have virtual addresses for everything.
|
// Apply relocations, now that we have virtual addresses for everything.
|
||||||
relocate(allocated_functions, relocations, &module);
|
relocate(allocated_functions, relocations, module);
|
||||||
|
|
||||||
Ok(Imports::new(
|
Ok(Imports::new(
|
||||||
function_imports,
|
function_imports,
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ impl Namespace {
|
|||||||
field_name: &str,
|
field_name: &str,
|
||||||
args: &[RuntimeValue],
|
args: &[RuntimeValue],
|
||||||
) -> Result<ActionOutcome, ActionError> {
|
) -> Result<ActionOutcome, ActionError> {
|
||||||
invoke(compiler, &mut self.instances[index], &field_name, &args)
|
invoke(compiler, &mut self.instances[index], field_name, args)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get a slice of memory from an instance.
|
/// Get a slice of memory from an instance.
|
||||||
@@ -76,12 +76,12 @@ impl Namespace {
|
|||||||
start: usize,
|
start: usize,
|
||||||
len: usize,
|
len: usize,
|
||||||
) -> Result<&[u8], ActionError> {
|
) -> Result<&[u8], ActionError> {
|
||||||
inspect_memory(&self.instances[index], &field_name, start, len)
|
inspect_memory(&self.instances[index], field_name, start, len)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the value of an exported global from an instance.
|
/// Get the value of an exported global from an instance.
|
||||||
pub fn get(&self, index: InstanceIndex, field_name: &str) -> Result<RuntimeValue, ActionError> {
|
pub fn get(&self, index: InstanceIndex, field_name: &str) -> Result<RuntimeValue, ActionError> {
|
||||||
get(&self.instances[index], &field_name)
|
get(&self.instances[index], field_name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -570,7 +570,7 @@ impl Instance {
|
|||||||
|
|
||||||
/// Return a reference to the vmctx used by compiled wasm code.
|
/// Return a reference to the vmctx used by compiled wasm code.
|
||||||
pub fn vmctx(&self) -> &VMContext {
|
pub fn vmctx(&self) -> &VMContext {
|
||||||
&self.mmap_field.contents().vmctx()
|
self.mmap_field.contents().vmctx()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return a raw pointer to the vmctx used by compiled wasm code.
|
/// Return a raw pointer to the vmctx used by compiled wasm code.
|
||||||
@@ -818,7 +818,7 @@ fn create_memories(
|
|||||||
let mut memories: PrimaryMap<DefinedMemoryIndex, _> =
|
let mut memories: PrimaryMap<DefinedMemoryIndex, _> =
|
||||||
PrimaryMap::with_capacity(module.memory_plans.len() - num_imports);
|
PrimaryMap::with_capacity(module.memory_plans.len() - num_imports);
|
||||||
for plan in &module.memory_plans.values().as_slice()[num_imports..] {
|
for plan in &module.memory_plans.values().as_slice()[num_imports..] {
|
||||||
memories.push(LinearMemory::new(&plan).map_err(InstantiationError::Resource)?);
|
memories.push(LinearMemory::new(plan).map_err(InstantiationError::Resource)?);
|
||||||
}
|
}
|
||||||
Ok(memories.into_boxed_slice())
|
Ok(memories.into_boxed_slice())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ impl WastContext {
|
|||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
let index = self.get_index(&instance_name)?;
|
let index = self.get_index(&instance_name)?;
|
||||||
self.namespace
|
self.namespace
|
||||||
.invoke(&mut *self.compiler, index, &field, &value_args)
|
.invoke(&mut *self.compiler, index, field, &value_args)
|
||||||
.map_err(WastError::Action)
|
.map_err(WastError::Action)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ fn handle_module(
|
|||||||
// If a function to invoke was given, invoke it.
|
// If a function to invoke was given, invoke it.
|
||||||
if let Some(ref f) = args.flag_invoke {
|
if let Some(ref f) = args.flag_invoke {
|
||||||
match namespace
|
match namespace
|
||||||
.invoke(compiler, index, &f, &[])
|
.invoke(compiler, index, f, &[])
|
||||||
.map_err(|e| e.to_string())?
|
.map_err(|e| e.to_string())?
|
||||||
{
|
{
|
||||||
ActionOutcome::Returned { .. } => {}
|
ActionOutcome::Returned { .. } => {}
|
||||||
|
|||||||
Reference in New Issue
Block a user