3.3 Code Outline, Lead-In and Prefix Sequences for PPC64

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.

Main Body

The main body of the generated JIT code.

Trampolines

Several small help routines for branching to kernel subroutines and other predicates.

TOC

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.

ModeLead-InPrefix
jitexld 0,0(toc)ld 0,w_heap_warn_soft
mtctr 0cmpld 7,h,0 [PERM: Is this cmpl cr7,1,h,0? Why CR7 and not the default CR0?]
bctrblt 7,1f [PERM: Is this blt cr7,1f? Why CR7 and not the default CR0?]
ld 0,16(toc)
mtctr 0
bctr
1:
 
wamexld 0,16(toc)ld 0,8(toc)
mtctr 0mtctr 0
bctrbctr
 
cexld 0,24(toc)
mtctr 0
bctr

Send feedback on this subject.