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

Method debug_assert_vmctx_kind

crates/cranelift/src/compiler.rs:1370–1391  ·  view source on GitHub ↗
(
        &self,
        builder: &mut FunctionBuilder,
        vmctx: ir::Value,
        expected_vmctx_magic: u32,
    )

Source from the content-addressed store, hash-verified

1368 }
1369
1370 fn debug_assert_vmctx_kind(
1371 &self,
1372 builder: &mut FunctionBuilder,
1373 vmctx: ir::Value,
1374 expected_vmctx_magic: u32,
1375 ) {
1376 if !self.emit_debug_checks {
1377 return;
1378 }
1379 let magic = builder.ins().load(
1380 ir::types::I32,
1381 MemFlagsData::trusted().with_endianness(self.isa.endianness()),
1382 vmctx,
1383 0,
1384 );
1385 let is_expected_vmctx = builder.ins().icmp_imm(
1386 ir::condcodes::IntCC::Equal,
1387 magic,
1388 i64::from(expected_vmctx_magic),
1389 );
1390 builder.ins().trapz(is_expected_vmctx, TRAP_INTERNAL_ASSERT);
1391 }
1392
1393 fn array_to_wasm_trampoline(
1394 &self,

Calls 6

fromFunction · 0.85
loadMethod · 0.45
insMethod · 0.45
with_endiannessMethod · 0.45
endiannessMethod · 0.45
trapzMethod · 0.45

Tested by

no test coverage detected