Get the raw function index associated with the current frame, and the module-relative PC as an offset within the module binary, if this is a Wasm function directly from the given `Module` (rather than a trampoline).
(
&self,
mut store: impl AsContextMut,
)
| 543 | /// this is a Wasm function directly from the given `Module` |
| 544 | /// (rather than a trampoline). |
| 545 | pub fn wasm_function_index_and_pc( |
| 546 | &self, |
| 547 | mut store: impl AsContextMut, |
| 548 | ) -> Result<Option<(DefinedFuncIndex, ModulePC)>> { |
| 549 | let mut store = store.as_context_mut(); |
| 550 | let frame_data = self.frame_data(store.0.as_store_opaque())?; |
| 551 | let FuncKey::DefinedWasmFunction(module, func) = frame_data.func_key else { |
| 552 | return Ok(None); |
| 553 | }; |
| 554 | let wasm_pc = frame_data.wasm_pc; |
| 555 | debug_assert_eq!( |
| 556 | module, |
| 557 | self.module(&mut store)? |
| 558 | .expect("module should be defined if this is a defined function") |
| 559 | .env_module() |
| 560 | .module_index |
| 561 | ); |
| 562 | Ok(Some((func, wasm_pc))) |
| 563 | } |
| 564 | |
| 565 | /// Get the number of locals in this frame. |
| 566 | pub fn num_locals(&self, mut store: impl AsContextMut) -> Result<u32> { |
no test coverage detected