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_trap
because the registry of loaded modules was in the wasmtime crate, so it called through a global function pointer registered withinit_traps
instead.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_trap
function into two parts:lookup_code
finds a loaded module that had been previously registered withregister_code
, and thelookup_trap_code
step 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::range
will only return entries whereend >= pc
, so theend < pc
condition 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 23 2024 at 12:05 UTC