Provide proper function index and name in the FrameInfo (#824)

* fix function index

* Add function name to JITFunctionTag

* Add ModuleSyncString.
This commit is contained in:
Yury Delendik
2020-01-16 12:36:51 -06:00
committed by GitHub
parent adcc047f4a
commit b2bfb98f1f
8 changed files with 63 additions and 12 deletions

View File

@@ -1,5 +1,5 @@
use crate::func_environ::FuncEnvironment;
use crate::module::{Export, MemoryPlan, Module, TableElements, TablePlan};
use crate::module::{Export, MemoryPlan, Module, ModuleSyncString, TableElements, TablePlan};
use crate::tunables::Tunables;
use cranelift_codegen::ir;
use cranelift_codegen::ir::{AbiParam, ArgumentPurpose};
@@ -369,6 +369,11 @@ impl<'data> cranelift_wasm::ModuleEnvironment<'data> for ModuleEnvironment<'data
});
Ok(())
}
fn declare_func_name(&mut self, func_index: FuncIndex, name: &'data str) -> WasmResult<()> {
self.result.module.func_names[func_index] = ModuleSyncString::new(Some(name));
Ok(())
}
}
/// Add environment-specific function parameters.