Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions _posts/2026-08-09-locals.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: "Representing local variables in compiler IRs"
layout: post
---

It's useful to lift local variables into SSA nodes in a compiler

But local variables can be observed/reified by explicit runtime reflection
(incl. `locals()`, `eval()`, ...), exceptions, debuggers

Local variables also have nonlocal things sometimes like Ruby blocks

LLVM

* CFG
* Allocate everything on stack
* mem2reg

PyPy

* Trace

JavaScriptCore

Cinder

* FrameState
* Ignore `locals()`/`sys._getframe`

ZJIT

Graal

* FrameState
Loading