4.1 Placement of WAM and IR Registers

The “WAM registers” arg0..arg2 are for passing parameters from the JIT code to the runtime system. These “WAM registers” must be preserved by the machine code that implements the IR instructions (i.e. the generated machine code must not used any of arg0..arg2 as scratchpad registers).

The “WAM registers” arg3..arg5 are scratchpad registers of the runtime system and may also be freely used by the machine code that implements the IR instructions.

For x86_64, the exact offsets of ac0 and ac1 are ABI dependent (Windows vs. non-Windows).

For PPC64, the CTR register is used by context(_) instructions, in predicate-to-predicate calls, and for jumping to continuations. The link register is used in call and ccall instructions. Otherwise, CTR can be used freely, and so can the link register. Additionally R0 and arg3..arg5 can be used freely by the machine code that implements the IR instructions.

WAMx86x86_64PPC64
sp%esp%rspr1
tocr2
val%eax%raxr3
arg00(%esp)%raxr3
arg14(%esp)%r10r4
arg28(%esp)%r11r5
arg3r6
arg4r7
arg5r8
s%edx%rdxr9
ac028(%esp)OFF(%rsp)r9
ac132(%esp)OFF(%rsp)r10
abW_LOCAL_UNCOND(w)NODE_LOCAL_TOP(b)r11
hbW_GLOBAL_UNCOND(w)NODE_GLOBAL_TOP(b)r12
bW_NODE(w)r8r14
a%ebp%rbpr15
h%esi%rsir16
trW_TRAIL_TOP(w)r9r17
e%edi%rdir18
cp%ecx%rcxr19
w%ebx%rbxr20
w_insnW_INSN(w)W_INSN(w)r21
w_heap_warn_softW_HEAP_WARN_SOFT(w)W_HEAP_WARN_SOFT(w)W_HEAP_WARN_SOFT(w)
w_next_nodeW_NEXT_NODE(w)W_NEXT_NODE(w)W_NEXT_NODE(w)
w_numstack_endW_NUMSTACK_END(w)W_NUMSTACK_END(w)W_NUMSTACK_END(w)
w_stack_startW_STACK_START(w)W_STACK_START(w)W_STACK_START(w)
w_stack_warnW_STACK_WARN(w)W_STACK_WARN(w)W_STACK_WARN(w)
w_fli_stack_startW_FLI_STACK_START(w)W_FLI_STACK_START(w)W_FLI_STACK_START(w)
x(0)W_TERM0(w)%r12r22
x(1)W_TERM1(w)%r13r23
x(2)W_TERM2(w)%r14r24
x(3)W_TERM3(w)%r15r25
x(4)W_TERM4(w)W_TERM4(w)r26
x(5)W_TERM5(w)W_TERM5(w)r27
x(6)W_TERM6(w)W_TERM6(w)r28
x(7)W_TERM7(w)W_TERM7(w)r29
x(8)W_TERM8(w)W_TERM8(w)r30
x(9)W_TERM9(w)W_TERM9(w)r31


Send feedback on this subject.