Skip to content

aabalke/gojit

 
 

Repository files navigation

aabalke/gojit: Jit Compiler for Golang

aabalke/gojit is a revival of nelhage/gojit and rasky/gojit, providing jit compilation for Golang version 1.17+. The major functionality this fork adds is the ability for Go functions to be called from jit code, without causing errors from stack checks during garbage collection or stack growth.

Resources

Writeup

Video

Requirements

This jit compiler requires an x86/amd64 system, and go version 1.17+. For handling in golang version 1.16 and earlier please read.

If a Go function is called from jit code, the Go functions must have a nosplit directive. If the JIT mutates variables though pointers, those variables must be heap allocated, and/or global.

Examples

See the example directory for basic examples, or see the Guac Emulator if you are interested in a real-life example. It includes the setup of multiple JIT pages, analysis and metrics for JIT compilation thresholds, invalidation, and an LRU cache for invalidating dead JIT compiler blocks.

About

JIT code-generation in golang!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Go 99.0%
  • Assembly 1.0%