Skip to content

Generating machine code at runtime (aka JIT) using Pycopy (small Python dialect)

License

Notifications You must be signed in to change notification settings

pfalcon/pycopy-jitgen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jitgen

jitgen is a (very bare) demo of generating machine code at runtime using Pycopy (https://github.com/pfalcon/pycopy) and executing it.

Current, only x86 (32-bit) is supported. While demo is very bare (and set of supported instructions is very limited), it tries to show something more interesting than "a + b", namely, being able to do something about Python objects. For this, the code generated calls back into Pycopy for various API functions. For that to work, the executable should export symbols for functions using -rdynamic linker flag.

Summing up, to try this demo, build Pycopy's Unix version with:

make MICROPY_FORCE_32BIT=1 LDFLAGS_EXTRA=-rdynamic

License

jitgen is written by Paul Sokolovsky and released under the MIT license.

About

Generating machine code at runtime (aka JIT) using Pycopy (small Python dialect)

Topics

Resources

License

Stars

Watchers

Forks

Languages