lightning.git - Portable just-in-time compiler library

index : lightning.git
Portable just-in-time compiler library
summary refs log tree commit diff
path: root/lib/jit_ppc.c
diff options
context:
space:
mode:
authorpcpa <paulo.cesar.pereira.de.andrade@gmail.com>2014年10月24日 14:31:41 -0200
committerpcpa <paulo.cesar.pereira.de.andrade@gmail.com>2014年10月24日 14:31:41 -0200
commit0c6f675c8a026826b2482db9f978d422ef1f5328 (patch)
tree30bdd152cd6106e74ee39abcff57973133f59f9b /lib/jit_ppc.c
parent9c5e2b511ec6f80a350d756d4464acfb10373ee4 (diff)
downloadlightning-0c6f675c8a026826b2482db9f978d422ef1f5328.tar.gz
Properly handle jit_tramp and function descriptors
* lib/jit_ia64.c, lib/jit_ppc.c: Correct handling of function descriptor when first prolog is a jit_tramp prolog. The test case was using the same jit_context_t, so was not triggering this condition. * lib/jit_ppc-cpu.c: Properly handle jump displacements that do not fit on 24 powerpc. This required changing from previous "mtlr reg, blr" to "mtctr reg, bctr" to properly handle the logic to "hide" function descriptors, but that would also be required as the proper jit_jmpr when/if implementing optimizations to leaf functions (was working with blr because it is saved/reloaded in prolog/epilog).
Diffstat (limited to 'lib/jit_ppc.c')
-rw-r--r--lib/jit_ppc.c 20
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/jit_ppc.c b/lib/jit_ppc.c
index cbc5dda..8ef6119 100644
--- a/lib/jit_ppc.c
+++ b/lib/jit_ppc.c
@@ -778,11 +778,19 @@ _emit_code(jit_state_t *_jit)
#if __powerpc__
undo.prolog_offset = 0;
- /* code may start with a jump so add an initial function descriptor */
- word = _jit->pc.w + sizeof(void*) * 3;
- iw(word); /* addr */
- iw(0); /* toc */
- iw(0); /* env */
+ for (node = _jitc->head; node; node = node->next)
+ if (node->code != jit_code_label &&
+ node->code != jit_code_note &&
+ node->code != jit_code_name)
+ break;
+ if (node && (node->code != jit_code_prolog ||
+ !(_jitc->functions.ptr + node->w.w)->assume_frame)) {
+ /* code may start with a jump so add an initial function descriptor */
+ word = _jit->pc.w + sizeof(void*) * 3;
+ iw(word); /* addr */
+ iw(0); /* toc */
+ iw(0); /* env */
+ }
#endif
#define case_rr(name, type) \
@@ -1262,7 +1270,7 @@ _emit_code(jit_state_t *_jit)
}
}
else
- jmpi(node->u.w);
+ (void)jmpi_p(node->u.w);
break;
case jit_code_callr:
callr(rn(node->u.w));
generated by cgit v1.2.3 (git 2.25.1) at 2025年10月01日 23:20:36 +0000

AltStyle によって変換されたページ (->オリジナル) /