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

Function cold_blocks

cranelift/codegen/src/write.rs:719–738  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

717
718 #[test]
719 fn cold_blocks() {
720 let mut func = Function::new();
721 {
722 let mut pos = FuncCursor::new(&mut func);
723
724 let block0 = pos.func.dfg.make_block();
725 pos.insert_block(block0);
726 pos.func.layout.set_cold(block0);
727
728 let block1 = pos.func.dfg.make_block();
729 pos.insert_block(block1);
730 pos.func.dfg.append_block_param(block1, types::I32);
731 pos.func.layout.set_cold(block1);
732 }
733
734 assert_eq!(
735 func.to_string(),
736 "function u0:0() fast {\nblock0 cold:\n\nblock1(v0: i32) cold:\n}\n"
737 );
738 }
739}

Callers

nothing calls this directly

Calls 5

make_blockMethod · 0.80
set_coldMethod · 0.80
newFunction · 0.50
insert_blockMethod · 0.45
append_block_paramMethod · 0.45

Tested by

no test coverage detected