MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / exit_frame

Method exit_frame

crates/wasmtime/src/runtime/debug.rs:416–442  ·  view source on GitHub ↗

Create a new FrameHandle at the exit frame of an activation. # Safety The provided activation must be valid currently.

(store: &mut StoreOpaque, activation: Activation)

Source from the content-addressed store, hash-verified

414 ///
415 /// The provided activation must be valid currently.
416 unsafe fn exit_frame(store: &mut StoreOpaque, activation: Activation) -> Option<FrameHandle> {
417 // SAFETY: activation is valid as per our safety condition.
418 let mut cursor = unsafe { activation.cursor() };
419
420 // Find the first virtual frame. Each physical frame may have
421 // zero or more virtual frames.
422 while !cursor.done() {
423 let (cache, registry) = store.frame_data_cache_mut_and_registry();
424 let frames = cache.lookup_or_compute(registry, cursor.frame());
425 if frames.len() > 0 {
426 return Some(FrameHandle {
427 cursor,
428 virtual_frame_idx: 0,
429 store_id: store.id(),
430 store_version: store.vm_store_context().execution_version,
431 });
432 }
433 // SAFETY: activation is still valid (valid on entry per
434 // our safety condition, and we have not returned control
435 // since above).
436 unsafe {
437 cursor.advance(store.unwinder());
438 }
439 }
440
441 None
442 }
443
444 /// Determine whether this handle can still be used to refer to a
445 /// frame.

Callers

nothing calls this directly

Calls 10

lookup_or_computeMethod · 0.80
frameMethod · 0.80
advanceMethod · 0.80
cursorMethod · 0.45
doneMethod · 0.45
lenMethod · 0.45
idMethod · 0.45
vm_store_contextMethod · 0.45
unwinderMethod · 0.45

Tested by

no test coverage detected