Make FuncEnvironment callbacks take an &mut self parameter.

The WasmRuntime trait already does this, and nothing in the function
translator requires the environment trait object to be non-mutable.
This commit is contained in:
Jakob Stoklund Olesen
2017-09-14 12:25:59 -07:00
parent 78c39ce078
commit 39992014e0
3 changed files with 19 additions and 19 deletions

View File

@@ -266,7 +266,7 @@ impl TranslationState {
&mut self,
func: &mut ir::Function,
index: u32,
environ: &FE,
environ: &mut FE,
) -> GlobalValue {
let index = index as GlobalIndex;
*self.globals.entry(index).or_insert_with(
@@ -280,7 +280,7 @@ impl TranslationState {
&mut self,
func: &mut ir::Function,
index: u32,
environ: &FE,
environ: &mut FE,
) -> ir::Heap {
let index = index as MemoryIndex;
*self.heaps.entry(index).or_insert_with(
@@ -296,7 +296,7 @@ impl TranslationState {
&mut self,
func: &mut ir::Function,
index: u32,
environ: &FE,
environ: &mut FE,
) -> (ir::SigRef, usize) {
let index = index as SignatureIndex;
*self.signatures.entry(index).or_insert_with(|| {
@@ -313,7 +313,7 @@ impl TranslationState {
&mut self,
func: &mut ir::Function,
index: u32,
environ: &FE,
environ: &mut FE,
) -> (ir::FuncRef, usize) {
let index = index as FunctionIndex;
*self.functions.entry(index).or_insert_with(|| {