Mark exception handler target blocks. flowgraph.c mark_except_handlers
(blocks: &mut [Block])
| 2081 | /// Mark exception handler target blocks. |
| 2082 | /// flowgraph.c mark_except_handlers |
| 2083 | pub(crate) fn mark_except_handlers(blocks: &mut [Block]) { |
| 2084 | // Reset handler flags |
| 2085 | for block in blocks.iter_mut() { |
| 2086 | block.except_handler = false; |
| 2087 | block.preserve_lasti = false; |
| 2088 | } |
| 2089 | // Mark target blocks of SETUP_* as except handlers |
| 2090 | let targets: Vec<usize> = blocks |
| 2091 | .iter() |
| 2092 | .flat_map(|b| b.instructions.iter()) |
| 2093 | .filter(|i| i.instr.is_block_push() && i.target != BlockIdx::NULL) |
| 2094 | .map(|i| i.target.idx()) |
| 2095 | .collect(); |
| 2096 | for idx in targets { |
| 2097 | blocks[idx].except_handler = true; |
| 2098 | } |
| 2099 | } |
| 2100 | |
| 2101 | /// flowgraph.c mark_cold |
| 2102 | fn mark_cold(blocks: &mut [Block]) { |
no test coverage detected