From 374d85f4244355d32ef1478e027f01988ae12e8b Mon Sep 17 00:00:00 2001 From: Max Bernstein Date: Sun, 9 Aug 2026 00:56:47 -0400 Subject: [PATCH 1/2] . --- _posts/2026-08-09-locals.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 _posts/2026-08-09-locals.md diff --git a/_posts/2026-08-09-locals.md b/_posts/2026-08-09-locals.md new file mode 100644 index 000000000..16986d428 --- /dev/null +++ b/_posts/2026-08-09-locals.md @@ -0,0 +1,29 @@ +--- +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 + +ZJIT + +Graal From e1637f050fc6a4dea1c5591ae2424d4fee9c0cee Mon Sep 17 00:00:00 2001 From: Max Bernstein Date: Sun, 9 Aug 2026 00:58:24 -0400 Subject: [PATCH 2/2] . --- _posts/2026-08-09-locals.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/_posts/2026-08-09-locals.md b/_posts/2026-08-09-locals.md index 16986d428..6e0b6fb7e 100644 --- a/_posts/2026-08-09-locals.md +++ b/_posts/2026-08-09-locals.md @@ -24,6 +24,11 @@ JavaScriptCore Cinder +* FrameState +* Ignore `locals()`/`sys._getframe` + ZJIT Graal + +* FrameState