I'm trying out cranelift for the first time for a JIT, and I'm unclear on how traps are meant to be used. I did fb.ins().resumable_trap(TrapCode::User(0x51f1));
, but the generated assembly appears to only contain a ud2
, with no reference to 0x51f1
. I'm using a NullTrapSink
right now; it would make sense if I needed to implement a TrapSink
, but that doesn't appear to answer resumableness.
The trap code is only written to the trap sink. If yoy need it, you must store it somewhere. You can resume from the trap by returning from the SIGILL signal handler and resuming execution at the next instructiin.
Last updated: Nov 22 2024 at 17:03 UTC