Skip to main content

Module jit

Module jit 

Source
Expand description

CoreCLR JIT helpers — resolve precode indirections and call JIT’d methods.

CoreCLR compiles methods lazily. Before a method is JIT’d, calls go through a precode stub that triggers compilation and then patches itself to jump directly to the native code. The two common precode forms on x86-64 are:

  • ff 25 <disp32> — indirect jump through a pointer slot
  • e9 <disp32> — relative jump to the JIT’d body

resolve_jit follows one level of indirection so you get the actual native address, and patch_precode_target rewrites the indirect-jump slot to redirect a method.

call_native and call_native_float are small trampolines that call a native function pointer with up to 6 integer arguments, used by script runtimes to invoke managed methods generically.

Enums§

JitError
Errors returned by JIT helpers.

Functions§

call_native⚠
Call a native function pointer with up to 6 integer/pointer arguments.
call_native_f32x4⚠
Like call_native, but for methods returning a small struct of floats (up to 4 × f32) via xmm0+xmm1 on x86-64 SysV ABI.
call_native_float⚠
Like call_native, but for methods returning a float (xmm0 on x86-64). Supports up to 3 integer arguments.
patch_precode_target⚠
Rewrite a ff 25 precode’s target pointer to redirect the method.
peek_bytes⚠
Read count bytes starting at addr as a hex string, capped at 64.
resolve_jit⚠
Follow one level of CoreCLR precode indirection.