MCPcopy Create free account
hub / github.com/Amanieu/regalloc3 / check_stack

Method check_stack

src/debug_utils/checker.rs:217–235  ·  view source on GitHub ↗

Checks the stack layout and spill slot definitions.

(&self)

Source from the content-addressed store, hash-verified

215
216 /// Checks the stack layout and spill slot definitions.
217 fn check_stack(&self) -> Result<()> {
218 let stack_layout = self.output.stack_layout();
219 for slot in stack_layout.spillslots() {
220 let Some((offset, size)) = stack_layout.spillslot_layout(slot) else {
221 continue;
222 };
223 ensure!(
224 offset.is_multiple_of(size.bytes()),
225 "{slot} offset {offset} is not aligned to size {size}"
226 );
227 let end = offset + size.bytes();
228 ensure!(
229 end <= stack_layout.spillslot_area_size(),
230 "{slot} ends at {end} which exceeds spill area size {}",
231 stack_layout.spillslot_area_size()
232 );
233 }
234 Ok(())
235 }
236
237 /// Checks the allocation result for a block and then propagates the end
238 /// state to any successor blocks.

Callers 1

check_functionMethod · 0.80

Calls 4

stack_layoutMethod · 0.80
spillslotsMethod · 0.80
spillslot_layoutMethod · 0.80
bytesMethod · 0.80

Tested by

no test coverage detected