jit-tutorial | How to write a very simple JIT compiler | Compiler library
kandi X-RAY | jit-tutorial Summary
kandi X-RAY | jit-tutorial Summary
How to write a very simple JIT compiler
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of jit-tutorial
jit-tutorial Key Features
jit-tutorial Examples and Code Snippets
Community Discussions
Trending Discussions on jit-tutorial
QUESTION
I'm working on a simple JIT compiler for PowerPC, I followed the examples in https://github.com/spencertipping/jit-tutorial to get a hang of how to work with it.
The problem is that the identity function in the second example "jitproto.c" can't really be ported to powerpc as is, using the "LWA" and "BLR" instructions, it just causes segfaults when executed.
In the end I used the machine code output of the SLJIT compiler (https://github.com/linux-on-ibm-z/sljit) to see what I'm doing wrong, and I see it generates 12 instruction words before what I thought would be the function.
So what are those instructions doing? Why can't I just start the function directly like in x86?
Code can be compiled with a C99 compiler on PPC64 (tested in a powermac and a power8 server).
...ANSWER
Answered 2019-Mar-25 at 18:12The instructions are required for setting up the stack layout of PPC64 ABI. See here: http://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi.html#STACK
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install jit-tutorial
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page