Aloha!
Couple of weeks ago I've put Parrot's jit prototype on hold. One of the major issue was C macro preprocessor. Now, it's time to unhold it
struct
definitions and preprocessor.opsc_llvm
branch I moved little bit further. Two major achievements:runcore
from within Parrot it self.VTABLE
(which is auto-generated during build from template by some dark magic) and parrot_interp_t. Just load pre-compiled LLVM bitcode and lookup type by name..sub 'main' :main say "Answer" say 42 say "Correct" .end
0000: 00000000 00000000 say_sc
0002: 00000001 0000002a say_ic
0004: 00000000 00000001 say_sc
0006: 00000002 end
opsc_llvm
. When I started this branch it was purely my own playground for LLVM/opsc/JIT/etc. I had no idea what I can get out of it. Especially because I had no previous experience not only with with LLVM but with Parrot's NCI (Native Call Interface) as well. But now I can almost get something really useful - Fully Functional LLVM Bindings.op
is smallest operation available. For example add $I0, $I1, $I2
and goto label
. Ops are implemented in some kind of C with quite few macro-substitutions for accessing registers and flow control. Let's take simple add
op. int foo() { printf("Hello World\n"); return 42; }