From 1a7b5ebb1d2c2e080db48ebd88bfb5982be06a6d Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 21 May 2026 21:50:08 +0200 Subject: [PATCH] LibJS: Route bytecode cache installs through owners Store ExecutableBacking on Script and SourceTextModule, and make those owners coordinate generated cache installation. Replacing executable backing now clears non-cache compile inputs and verifies that mapped cache-backed records no longer retain source or heap bytecode inputs. --- Libraries/LibJS/Script.cpp | 100 ++++++++++++++++++++++-- Libraries/LibJS/Script.h | 16 +++- Libraries/LibJS/SourceTextModule.cpp | 110 +++++++++++++++++++++++++-- Libraries/LibJS/SourceTextModule.h | 15 +++- 4 files changed, 229 insertions(+), 12 deletions(-) diff --git a/Libraries/LibJS/Script.cpp b/Libraries/LibJS/Script.cpp index 42514a81f1..61f185ae52 100644 --- a/Libraries/LibJS/Script.cpp +++ b/Libraries/LibJS/Script.cpp @@ -29,7 +29,7 @@ Result, Vector> Script::parse(StringView source_tex return Vector {}; if (rust_compilation->is_error()) return rust_compilation->release_error(); - return realm.heap().allocate