Hasty Briefsbeta

Bilingual

Making your JITted Code known: Let me count the ways

6 days ago
  • #Performance Profiling
  • #Debugging Tools
  • #JIT Compilation
  • AOT compilers traditionally include metadata with machine code for system use, such as symbol names for functions and debug data.
  • MoarVM, a virtual machine for Raku, encountered issues with stack unwinding on Windows due to changes in longjmp behavior.
  • Solutions for providing unwinding information for JITted code include using WinAPI functions like RtlAddFunctionTable and simpler fixes.
  • Various APIs exist for making JITted code known to the system and tools, including perf map, libunwind, GDB's JIT Debug Info Readers, and JITDUMP format.
  • Creating loadable shared objects is a comprehensive but complex approach for integrating JITted code with external tools.
  • GDB's jitreader feature allows detailed integration of JITted code with debuggers, though it requires custom implementation.
  • The JITDUMP format enables detailed profiling and debugging of JITted code with tools like Linux's perf, including disassembly views.
  • Valgrind lacks straightforward support for integrating JITted code names and boundaries into its tools like callgrind and cachegrind.
  • The post expresses a desire for a unified solution to integrate JITted code with all necessary debugging and profiling tools.