Agent skill

Jit Compilation

by mohitmishra786 in mohitmishra786/low-level-dev-skills

JIT compilation skill for runtime code generation. An agent skill from mohitmishra786/low-level-dev-skills.

MITAuto-check passedDevelopment

Install Jit Compilation

skills CLI
$ npx skills add mohitmishra786/low-level-dev-skills --skill jit-compilation -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install mohitmishra786/low-level-dev-skills jit-compilation --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/mohitmishra786/low-level-dev-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/compiler-internals/jit-compilation .claude/skills/jit-compilation && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
jit-compilation
GitHub stars
253
Token cost
~1.8k tokens
SKILL.md length
297 words
Files
1
Skills in repo
138
Repo updated
First seen
Licence
MIT

At a glance

JIT compilation skill for runtime code generation. An agent skill from mohitmishra786/low-level-dev-skills.

  • Works in 9 steps: JIT architecture overview → LLJIT — simplest LLVM JIT → ORC JIT v2 layers → …
  • Building LLVM ORC JIT
  • SKILL.md covers Purpose, When to Use, Workflow and Common Problems, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Jit Compilation is an agent skill from mohitmishra786/low-level-dev-skills. JIT compilation skill for runtime code generation. Use when building LLVM ORC JIT, LLJIT, Cranelift JIT, inline caches, trampolines, or Rust dynasm codegen. Activates on queries about ORC JIT, LLJIT, Cranelift, ExecutionSession, inline cache, W^X, or dynasm.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Project scaffolding. It works with Rust. The repository describes itself as: A curated suite of AI agent skills for systems and low-level programming with C/C++, Rust, and Zig toolchains, covering compilers, debuggers, profilers, build systems…. The licence is MIT.

When your agent uses it

  • Building LLVM ORC JIT
  • Rust dynasm codegen

Example prompts

  • “/jit-compilation”

Workflow steps

9 steps, taken from the step headings in SKILL.md.

  1. JIT architecture overview
  2. LLJIT — simplest LLVM JIT
  3. ORC JIT v2 layers
  4. Lazy compilation with trampolines
  5. Inline caches
  6. Cranelift JIT
  7. Security — W^X policy
  8. Rust dynasm (x86)
  9. Decision tree

What it can do on your machine

Read from SKILL.md and the folder at commit bdc5847. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are cpp, rust, bash, javascript and c).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Jit Compilation loads about 1.8k tokens when it runs. Until then it costs about 69 tokens; SKILL.md has 297 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~69
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from mohitmishra786/low-level-dev-skills at commit bdc5847, republished under its MIT licence (© mohitmishra786). 297 words, ~1,759 tokens.

Download SKILL.mdSave it as .claude/skills/jit-compilation/SKILL.md (or your agent's skills folder).
name
jit-compilation
description
JIT compilation skill for runtime code generation. Use when building LLVM ORC JIT, LLJIT, Cranelift JIT, inline caches, trampolines, or Rust dynasm codegen. Activates on queries about ORC JIT, LLJIT, Cranelift, ExecutionSession, inline cache, W^X, or dynasm.

JIT Compilation

Purpose

Guide agents through just-in-time compilation: LLVM ORC JIT v2 (ExecutionSession, IRLayer, ObjectLayer), LLJIT for simpler use cases, Cranelift JIT, inline caches for dynamic dispatch, trampolines for lazy compilation, security considerations (W^X, code signing), and Rust dynasm for x86 codegen.

When to Use

  • Building an interpreter with a JIT hot-path
  • Implementing lazy function compilation on first call
  • Embedding dynamic code generation in a REPL or game engine
  • Prototyping codegen without writing a full linker
  • Creating inline caches for polymorphic call sites
  • Generating x86 machine code from Rust with dynasm

Workflow

1. JIT architecture overview
Source/AST/Bytecode
    → IR (LLVM IR or Cranelift CLIF)
    → Object file (in memory)
    → Runtime linker (RTDyldObjectLinkingLayer)
    → Executable code in R+X memory
    → Function pointer call
2. LLJIT — simplest LLVM JIT
cpp
#include "llvm/ExecutionEngine/Orc/LLJIT.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/IRBuilder.h"

using namespace llvm;
using namespace llvm::orc;

int main() {
    auto JIT = cantFail(LLJITBuilder().create());

    LLVMContext Context;
    auto M = std::make_unique<Module>("jit", Context);
    IRBuilder<> Builder(Context);

    // int add(int a, int b) { return a + b; }
    Function *AddFn = Function::Create(
        FunctionType::get(Builder.getInt32Ty(),
                          {Builder.getInt32Ty(), Builder.getInt32Ty()}, false),
        Function::ExternalLinkage, "add", M.get());

    BasicBlock *BB = BasicBlock::Create(Context, "entry", AddFn);
    Builder.SetInsertPoint(BB);
    auto Args = AddFn->arg_begin();
    Value *Sum = Builder.CreateAdd(Args, Args + 1);
    Builder.CreateRet(Sum);

    cantFail(JIT->addIRModule(ThreadSafeModule(std::move(M), std::make_unique<LLVMContext>())));

    auto AddSym = JIT->lookup("add");
    auto *AddPtr = (int (*)(int, int))AddSym->getValue();
    int result = AddPtr(3, 4);  // 7
    return 0;
}
bash
clang++ -std=c++17 jit.cpp $(llvm-config --cxxflags --ldflags --libs core orcjit native) -o jit
3. ORC JIT v2 layers
cpp
ExecutionSession ES;
auto &MainJD = ES.createBareJITDylib("main");

RTDyldObjectLinkingLayer ObjectLayer(
    ES, []() { return std::make_unique<SectionMemoryManager>(); });

IRCompileLayer CompileLayer(
    ES, ObjectLayer, std::make_unique<TargetMachineBuilder>());

// Add IR module to JITDylib
ThreadSafeModule TSM = ...;
CompileLayer.add(MainJD, std::move(TSM));

// Resolve symbol
auto Sym = ES.lookup({&MainJD}, "my_func");

Layers:

  • IRLayer — compiles LLVM IR to object
  • ObjectLayer — links relocatable objects
  • ExecutionSession — symbol lookup and JITDylib management
4. Lazy compilation with trampolines
First call → trampoline → compile function → patch trampoline → direct call
cpp
// Simplified lazy compile on first invocation
void *LazyCompile(const std::string &Name) {
    if (!Compiled.count(Name)) {
        auto Fn = CompileFromAST(Name);
        Compiled[Name] = Fn;
        // Patch call site or update function pointer table
    }
    return Compiled[Name];
}

ORC supports lazy reexports and lazy compilation via LazyCallThroughManager.

5. Inline caches
javascript
// Concept: monomorphic call site caches resolved target
// Pseudocode for dynamic language
function call_site(obj, method, args) {
    if (obj.class_id === cache.class_id) {
        return cache.fn_ptr(args);  // fast path
    }
    cache.class_id = obj.class_id;
    cache.fn_ptr = resolve_method(obj, method);
    return cache.fn_ptr(args);
}

JIT generates specialized code per cached type; deoptimize on cache miss.

6. Cranelift JIT
rust
use cranelift::prelude::*;
use cranelift_jit::{JITBuilder, JITModule};
use cranelift_module::{Linkage, Module};

let isa = cranelift_native::builder().finish(settings::Flags::new(settings::builder()))?;
let jit_builder = JITBuilder::with_isa(isa, cranelift_module::default_libcall_names());
let mut module = JITModule::new(jit_builder);

let mut ctx = module.make_context();
ctx.func = Function::with_name_signature(
    module.declare_function("add", Linkage::Export, &sig)?,
    sig,
);
// ... build IR in ctx.func ...
module.define_function(func_id, &mut ctx)?;
module.finalize_definitions()?;
let code = module.get_finalized_function(func_id);
let add_fn: fn(i32, i32) -> i32 = unsafe { std::mem::transmute(code) };

Cranelift: faster compile times than LLVM, good for embeddable JITs.

7. Security — W^X policy
W^X (Write XOR Execute)
├── Memory page is writable OR executable, never both
├── JIT: allocate RW → write code → mprotect(RX)
└── macOS hardened runtime requires signed JIT pages
c
#include <sys/mman.h>

void *mem = mmap(NULL, size, PROT_READ | PROT_WRITE,
                 MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
// write machine code to mem
mprotect(mem, size, PROT_READ | PROT_EXEC);

Linux: MAP_JIT on Apple platforms; sealed memfd on hardened systems.

8. Rust dynasm (x86)
rust
use dynasm::dynasm;
use dynasmrt::{Assembler, ExecutableBuffer};

let mut asm = Assembler::new().unwrap();
dynasm!(asm
    ; .arch x86_64
    ; add:
    ; add eax, ecx
    ; ret
);
let buf = asm.finalize().unwrap();
let add_fn: fn(i32, i32) -> i32 = unsafe { std::mem::transmute(buf.ptr(0)) };

Use for lightweight asm snippets without LLVM dependency.

9. Decision tree
JIT backend choice?
├── Need LLVM optimizations → ORC JIT / LLJIT
├── Fast compile, embeddable → Cranelift
├── Tiny asm snippets → dynasm
└── ML workloads → MLIR → ORC pipeline

Common Problems

SymptomCauseFix
Symbol not found on lookupName mangling or not exportedUse C linkage; LLVMExternalLinkage
Segfault calling JIT codeABI mismatchMatch calling convention and types
W^X mmap failedSELinux/grsecurityUse MAP_JIT; check dmesg
Stale code after recompileOld function pointerInvalidate caches; use trampolines
LLVM JIT slow compile-O2 in JITUse -O0 for JIT; optimize hot paths only
Cranelift verify errorInvalid CLIFEnable cranelift_codegen::verify_function
  • skills/compiler-internals/llvm-passes — optimize before JIT
  • skills/compiler-internals/compiler-frontend — AST to IR for JIT input
  • skills/compiler-internals/mlir — MLIR lowering to LLVM for JIT
  • skills/compilers/llvm — LLVM IR fundamentals
  • skills/low-level-programming/interpreters — bytecode interpreters using JIT
  • skills/low-level-programming/assembly-x86 — hand-written asm context

© mohitmishra786, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/compiler-internals/jit-compilation of mohitmishra786/low-level-dev-skills.

Open the folder on GitHubat commit bdc5847

Compare with similar skills

Jit Compilation next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Jit Compilation compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Jit Compilation this skillmohitmishra786/low-level-dev-skills253—~1.8kAutomated safety check: PassMIT
Rust Hygiene Audittsz-org/tsz577—~1.5kAutomated safety check: PassApache-2.0
New CrateDevolutions/IronRDP3.2k—~236Automated safety check: PassApache-2.0
Frb Code Generationfzyzcjy/flutter_rust_bridge5.4k—~1.5kAutomated safety check: PassMIT
Jinja Codegenxberg-io/alef100—~735Automated safety check: PassMIT
Rocky Codegenrocky-data/rocky304—~1.9kAutomated safety check: PassApache-2.0

Similar skills

  • Run a deep DRY + code-hygiene audit of the Rust workspace and turn the findings into verified, deduplicated, hierarchical GitHub tech-debt issues.

    577 GitHub stars~1.5k tokensUpdated 29 days ago
    DevelopmentAuto-check passed
  • New Crate

    Devolutions/IronRDP

    Create and integrate a new Rust crate in the IronRDP workspace.

    3.2k GitHub stars~236 tokensUpdated today
    DevelopmentAuto-check passed
  • Frb Code Generation

    fzyzcjy/flutter_rust_bridge

    A skill your agent uses when modifying Rust APIs, codegen, generated examples, or platform scaffolds in flutterrustbridge to select generation commands and preserve source-of-truth and convergence…

    5.4k GitHub stars~1.5k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Jinja Codegen

    xberg-io/alef

    Mechanics of alef's Minijinja template system: which templateenv module to call, how to register a template, inline-template rules, and engine settings.

    100 GitHub stars~735 tokensUpdated today
    DevelopmentAuto-check passed
  • Rocky Codegen

    rocky-data/rocky

    Rocky CLI JSON-output schema cascade. An agent skill from rocky-data/rocky.

    304 GitHub stars~1.9k tokensUpdated today
    DevelopmentAuto-check passed
  • Codegen

    s3s-project/s3s

    Change generated code in this repository. An agent skill from s3s-project/s3s.

    311 GitHub stars~726 tokensUpdated today
    DevelopmentAuto-check passed

More from mohitmishra786/low-level-dev-skills

All 138 skills in this repo
  • ARM and AArch64 Assembly

    mohitmishra786/low-level-dev-skills

    Guides reading and writing AArch64 and ARM Thumb assembly: compiler output, inline asm, registers, the AAPCS calling convention and NEON or SVE basics.

    253 GitHub stars~1.9k tokensUpdated 3 mo ago
    Auto-check passed
  • RISC-V Assembly Guide

    mohitmishra786/low-level-dev-skills

    Reference for RISC-V assembly on RV32 and RV64: register names and calling convention, extension naming, GCC and Clang inline asm, and QEMU with GDB debugging.

    253 GitHub stars~1.8k tokensUpdated 3 mo ago
    Auto-check passed
  • x86-64 Assembly Reference

    mohitmishra786/low-level-dev-skills

    Explains x86-64 registers, the System V AMD64 calling convention, and how to read compiler-generated or inline assembly.

    253 GitHub stars~1.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Bazel for C and C++

    mohitmishra786/low-level-dev-skills

    Guides your agent through Bazel for C/C++ projects: BUILD files, Bzlmod dependencies, toolchain registration, remote execution, dependency queries and sandbox debugging.

    253 GitHub stars~1.5k tokensUpdated 3 mo ago
    Auto-check passed
  • Binary Hardening

    mohitmishra786/low-level-dev-skills

    Binary hardening skill for security-hardened C/C++ builds. An agent skill from mohitmishra786/low-level-dev-skills.

    253 GitHub stars~2k tokensUpdated 3 mo ago
    Auto-check passed
  • Binutils

    mohitmishra786/low-level-dev-skills

    GNU binutils skill for binary manipulation and analysis. An agent skill from mohitmishra786/low-level-dev-skills.

    253 GitHub stars~1.2k tokensUpdated 3 mo ago
    Auto-check passed

Works with

Categories

Questions about Jit Compilation

What does Jit Compilation do?

JIT compilation skill for runtime code generation. An agent skill from mohitmishra786/low-level-dev-skills. Jit Compilation is an agent skill from mohitmishra786/low-level-dev-skills. JIT compilation skill for runtime code generation.

When should I use Jit Compilation?

Jit Compilation fits situations like: building LLVM ORC JIT; rust dynasm codegen.

How do I install Jit Compilation in Claude Code?

Run `npx skills add mohitmishra786/low-level-dev-skills --skill jit-compilation -a claude-code`. Or copy the skill folder (skills/compiler-internals/jit-compilation in mohitmishra786/low-level-dev-skills) into .claude/skills/jit-compilation in your project. Claude Code loads it when a task matches its description.

How do I install Jit Compilation in Codex?

Run `npx skills add mohitmishra786/low-level-dev-skills --skill jit-compilation -a codex`. Or copy the skill folder (skills/compiler-internals/jit-compilation in mohitmishra786/low-level-dev-skills) into .agents/skills/jit-compilation in your project. Codex loads it when a task matches its description.

Can I use Jit Compilation in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mohitmishra786/low-level-dev-skills --skill jit-compilation -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/jit-compilation, .gemini/skills/jit-compilation, .github/skills/jit-compilation and .opencode/skills/jit-compilation in your project.

What does Jit Compilation need to run?

SKILL.md names no scripts, command-line tools or credentials: Jit Compilation is instructions for the agent only.

Does Jit Compilation access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Jit Compilation safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Jit Compilation use?

Jit Compilation is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Jit Compilation use?

About 1.8k tokens (SKILL.md is roughly 7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Jit Compilation?

Skills that share tags, products or a category with Jit Compilation: Rust Hygiene Audit (tsz-org/tsz, 577 stars), New Crate (Devolutions/IronRDP, 3.2k stars), Frb Code Generation (fzyzcjy/flutter_rust_bridge, 5.4k stars) and Jinja Codegen (xberg-io/alef, 100 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Jit Compilation?

mohitmishra786 (a GitHub user) maintains it in mohitmishra786/low-level-dev-skills, which has 253 GitHub stars. The repository holds 138 skills in this directory. The repository was last updated on June 27, 2026.

Source: mohitmishra786/low-level-dev-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.