For all modes, the prefix sequence is preceded by a single word containing a pointer to the current predicate. The prefix sequence is followed by three sections of code and data.
The main body of the generated JIT code.
Several small help routines for branching to kernel subroutines and other predicates.
An array of constants for loading instead of synthesizing, for cases where loading is faster.
A pointer to the TOC is maintained in toc
and is refreshed by the context(_)
IR instruction. Every TOC must begin with:
toc+0 : native_shunt_link toc+8 : native_restore_link toc+16 : native_nonjit toc+24 : native_c
In the lead-in sequence, the toc register is guaranteed to point at some valid JIT-TOC, and thus contain the above four entries.
Mode | Lead-In | Prefix |
---|---|---|
jitex | ld 0,0(toc) | ld 0,w_heap_warn_soft |
mtctr 0 | cmpld 7,h,0 [PERM: Is this cmpl cr7,1,h,0 ? Why CR7 and not the default CR0?] | |
bctr | blt 7,1f [PERM: Is this blt cr7,1f ? Why CR7 and not the default CR0?] | |
ld 0,16(toc) | ||
mtctr 0 | ||
bctr | ||
1: | ||
wamex | ld 0,16(toc) | ld 0,8(toc) |
mtctr 0 | mtctr 0 | |
bctr | bctr | |
cex | ld 0,24(toc) | — |
mtctr 0 | — | |
bctr | — |