From f655da8188990d980ee989e3cabfb92bdbb4c163 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ralph=20K=C3=BCpper?= Date: Mon, 3 Aug 2026 15:44:02 +0200 Subject: [PATCH] chore(codegen): drop the object-cache field and doc claim that outlived setjmp --- changelog.d/7312-drop-orphaned-setjmp-state.md | 15 +++++++++++++++ crates/perry-codegen/src/native_emit.rs | 6 ++++-- crates/perry/src/commands/compile/object_cache.rs | 4 ---- .../compile/object_cache/object_cache_tests.rs | 1 - 4 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 changelog.d/7312-drop-orphaned-setjmp-state.md diff --git a/changelog.d/7312-drop-orphaned-setjmp-state.md b/changelog.d/7312-drop-orphaned-setjmp-state.md new file mode 100644 index 0000000000..77e8100c25 --- /dev/null +++ b/changelog.d/7312-drop-orphaned-setjmp-state.md @@ -0,0 +1,15 @@ +#7302/#7305 replaced setjmp/longjmp exception lowering with `invoke`/`landingpad` +and deleted `volatile_setjmp.rs`. Two references to that machinery outlived it: + +- `PERRY_SETJMP_VOLATILE` was still hashed into the object-cache key. The pass it + gated no longer exists, so the field could never vary — dead state in a cache + key, plus a test asserting its presence. Both removed. (Object-cache keys shift + once as a result; the next build repopulates.) +- `native_emit.rs`'s module doc still claimed `has_try` functions render text + "whose setjmp volatile pass needs whole-function analysis". That pass is gone + and no such exception remains. Reworded to record the history rather than + assert a present-tense behaviour that is no longer true. + +The `_setjmp` link in `perry-ext-fastify` is deliberate and untouched — #7305 +keeps the private Rust-side boundary trap, since Rust cannot catch a foreign +exception. diff --git a/crates/perry-codegen/src/native_emit.rs b/crates/perry-codegen/src/native_emit.rs index 0048cc0a9f..69ba73cd81 100644 --- a/crates/perry-codegen/src/native_emit.rs +++ b/crates/perry-codegen/src/native_emit.rs @@ -25,8 +25,10 @@ //! per-line stream including entry-alloca hoists, boundary splices and //! return-site rewrites, shared with `to_ir` so those transforms have //! exactly one implementation. No per-function text is materialized on this -//! path; the exception is `has_try` functions, whose setjmp volatile pass -//! needs whole-function analysis and therefore still renders text. What +//! path. (Until #7302 `has_try` functions were an exception, because the +//! setjmp volatile pass needed whole-function analysis and forced a text +//! render; invoke/landingpad deleted that pass, so no such exception +//! remains.) What //! stops existing everywhere is the module-scale concatenation and the //! full-grammar LLVM parse. The follow-up (typed `LlInst` variants) removes //! the remaining per-LINE formatting; the `instructions=` counter logged per diff --git a/crates/perry/src/commands/compile/object_cache.rs b/crates/perry/src/commands/compile/object_cache.rs index 1c333afd95..dc66c1586d 100644 --- a/crates/perry/src/commands/compile/object_cache.rs +++ b/crates/perry/src/commands/compile/object_cache.rs @@ -906,10 +906,6 @@ fn compute_object_cache_key_with_env( "env_codegen_unit_size", env_var("PERRY_CODEGEN_UNIT_SIZE").as_deref().unwrap_or(""), ); - h.field( - "env_setjmp_volatile", - env_var("PERRY_SETJMP_VOLATILE").as_deref().unwrap_or(""), - ); h.field( "env_gc_moving_loop_polls", env_var("PERRY_GC_MOVING_LOOP_POLLS") diff --git a/crates/perry/src/commands/compile/object_cache/object_cache_tests.rs b/crates/perry/src/commands/compile/object_cache/object_cache_tests.rs index d36aa631fa..a56c1c41a1 100644 --- a/crates/perry/src/commands/compile/object_cache/object_cache_tests.rs +++ b/crates/perry/src/commands/compile/object_cache/object_cache_tests.rs @@ -603,7 +603,6 @@ fn key_changes_with_codegen_env_vars() { "PERRY_ENTRY_SYMBOL", "PERRY_CODEGEN_UNITS", "PERRY_CODEGEN_UNIT_SIZE", - "PERRY_SETJMP_VOLATILE", "PERRY_GC_MOVING_LOOP_POLLS", // Inline-hot-small (#6850 follow-up). "PERRY_INLINE_HOT_SMALL",