jameysharp requested fitzgen for a review on PR #8949.
jameysharp requested wasmtime-core-reviewers for a review on PR #8949.
jameysharp opened PR #8949 from jameysharp:inline-get-wasm-trap to bytecodealliance:main:
In the past, the wasmtime-runtime crate couldn't directly call
get_wasm_trapbecause the registry of loaded modules was in the wasmtime crate, so it called through a global function pointer registered withinit_trapsinstead.Since the two crates were merged in #8501, we no longer need this indirection.
While I'm here, I've also split the former
get_wasm_trapfunction into two parts:lookup_codefinds a loaded module that had been previously registered withregister_code, and thelookup_trap_codestep is now done by a helper onCodeMemory. This makes the module registry more broadly useful.I also simplified the code lookup step in two ways:
- I removed a redundant check from the code lookup.
BTreeMap::rangewill only return entries whereend >= pc, so theend < pccondition is always false.- I used checked_sub instead of writing both the comparison and subtraction explicitly.
jameysharp updated PR #8949.
alexcrichton submitted PR review.
alexcrichton merged PR #8949.
Last updated: Dec 13 2025 at 19:03 UTC