diff --git a/_posts/2026-08-09-locals.md b/_posts/2026-08-09-locals.md new file mode 100644 index 000000000..6e0b6fb7e --- /dev/null +++ b/_posts/2026-08-09-locals.md @@ -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