Create a new FrameHandle at the exit frame of an activation. # Safety The provided activation must be valid currently.
(store: &mut StoreOpaque, activation: Activation)
| 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. |
nothing calls this directly
no test coverage detected