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:
@@ -166,9 +166,16 @@ impl Compiler {
|
||||
let body_len = compilation.get(i).body.len();
|
||||
self.jit_function_ranges
|
||||
.push((ptr as usize, ptr as usize + body_len));
|
||||
let func_index = module.func_index(i);
|
||||
let func_name = module
|
||||
.func_names
|
||||
.get(func_index)
|
||||
.cloned()
|
||||
.unwrap_or_else(Default::default);
|
||||
let tag = jit_function_registry::JITFunctionTag {
|
||||
module_id: module.name.clone(),
|
||||
func_index: i.index(),
|
||||
func_index: func_index.index(),
|
||||
func_name,
|
||||
};
|
||||
jit_function_registry::register(ptr as usize, ptr as usize + body_len, tag);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ use wasmtime_environ::entity::{BoxedSlice, PrimaryMap};
|
||||
use wasmtime_environ::wasm::{DefinedFuncIndex, SignatureIndex};
|
||||
use wasmtime_environ::{
|
||||
CompileError, DataInitializer, DataInitializerLocation, Module, ModuleEnvironment,
|
||||
ModuleSyncString,
|
||||
};
|
||||
use wasmtime_runtime::{
|
||||
Export, GdbJitImageRegistration, Imports, InstanceHandle, InstantiationError, VMFunctionBody,
|
||||
@@ -76,7 +77,7 @@ impl<'data> RawCompiledModule<'data> {
|
||||
None
|
||||
};
|
||||
|
||||
translation.module.name = module_name.map(|s| s.to_string());
|
||||
translation.module.name = ModuleSyncString::new(module_name);
|
||||
|
||||
let (allocated_functions, jt_offsets, relocations, dbg_image) = compiler.compile(
|
||||
&translation.module,
|
||||
|
||||
Reference in New Issue
Block a user