Skip to content

Just in Time Compilation

Michael Grossniklaus edited this page Feb 24, 2024 · 4 revisions

What is Just-in-Time Mode?

In Just-in-Time (JIT) mode, oberon-lang translates Oberon source code into the LLVM Intermediate Representation (IR). Rather than generating the entire object code from the LLVM IR, the compiler starts executing the module and only generates object code that are required to run the program. JIT mode is built on LLVM's On-Request Compilation (ORC) infrastructure. It supports loading of both static and dynamic libraries, where if a library is available in both formats, the dynamic variant is preferred.

Using JIT Mode

JIT mode is enabled by a new compiler option -r or --run that is followed by one file name of an Oberon module. Additionally, compiler options to pass library search paths (-L) and dynamic libraries (-l) can be used to tell JIT mode where to look for libraries and which libraries to load.

For example, the following command can be used to run HelloWorld.Mod in JIT mode.

> ./oberon-lang -I ".:./include" -L ".:./lib" -loberon -r HelloWorld.Mod

Known Issues

JIT mode has been tried and tested using the following configurations.

macOS 14.2.1

  • aarch64
    • LLVM 17.0.6: no known issues
  • x86_64
    • LLVM 17.0.6: no known issues

Ubuntu 22.04.3

  • aarch64
    • LLVM 17.0.6: no known issues
    • LLVM 18.0.0: no known issues
  • x86_64
    • LLVM 17.0.6: no known issues

Windows 10.0.22621.2506

  • aarch64
    • status unknown
  • x86_64
    • LLVM 17.0.2: no known issues
Clone this wiki locally