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

Method is_next_sequence_reachable

winch/codegen/src/codegen/control.rs:1020–1038  ·  view source on GitHub ↗

This function is used at the end of unreachable code handling to determine if the reachability status should be updated.

(&self)

Source from the content-addressed store, hash-verified

1018 /// This function is used at the end of unreachable code handling
1019 /// to determine if the reachability status should be updated.
1020 pub fn is_next_sequence_reachable(&self) -> bool {
1021 use ControlStackFrame::*;
1022
1023 match self {
1024 // For if/else, the reachability of the next sequence is determined
1025 // by the reachability state at the start of the block. An else
1026 // block will be reachable if the if block is also reachable at
1027 // entry.
1028 If { reachable, .. } | Else { reachable, .. } => *reachable,
1029 // For blocks, the reachability of the next sequence is determined
1030 // if they're a branch target.
1031 Block {
1032 is_branch_target, ..
1033 } => *is_branch_target,
1034 // Loops are not used for reachability analysis,
1035 // given that they don't have exit branches.
1036 Loop { .. } => false,
1037 }
1038 }
1039
1040 /// Returns a reference to the [StackState] of the block.
1041 pub fn stack_state(&self) -> &StackState {

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected