From 5713e228781f990c92d7897d6cf842fc285627f4 Mon Sep 17 00:00:00 2001 From: jdalton Date: Sat, 1 Aug 2026 08:34:35 -0400 Subject: [PATCH] test(codegen): update scalar_replaced_slot_roots fixtures to #7088's frame enter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two tests grepped for `call i64 @js_shadow_frame_push(i32 `, which #7088 replaced with `call ptr @js_shadow_frame_enter(i32 ` (same slot-count operand; the pop handle is now derived from frame_top). Both panicked at the grep — "expected a shadow frame push" / "no frame push in the binding function" — BEFORE reaching the assertions they exist for, so the suite was red on main while the #6968 rooting contract it guards was in fact intact. Only the callee name and return type change. Every real assertion (the field alloca is bound, the frame grows differentially, the bind is hoisted into the entry block ahead of the storing loop and after the push) is untouched and now actually executes: 11/11 pass. Refs #7088, #6968. --- .../7185-scalar-replaced-slot-roots-fixtures.md | 3 +++ .../perry-codegen/tests/scalar_replaced_slot_roots.rs | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 changelog.d/7185-scalar-replaced-slot-roots-fixtures.md diff --git a/changelog.d/7185-scalar-replaced-slot-roots-fixtures.md b/changelog.d/7185-scalar-replaced-slot-roots-fixtures.md new file mode 100644 index 0000000000..2645882830 --- /dev/null +++ b/changelog.d/7185-scalar-replaced-slot-roots-fixtures.md @@ -0,0 +1,3 @@ +### Fixed + +- **tests: `scalar_replaced_slot_roots` was red on `main` for a stale string, not a real regression**. Two helpers located the shadow frame push by grepping `call i64 @js_shadow_frame_push(i32 `, which #7088 replaced with `call ptr @js_shadow_frame_enter(i32 ` (same slot-count operand; the pop handle is now derived from `frame_top`). Both panicked at the lookup before reaching the assertions they exist for, so `scalar_replaced_object_field_holding_a_heap_value_is_bound` and `bind_is_hoisted_into_the_entry_block_ahead_of_the_storing_loop` failed while the #6968 rooting contract they guard was intact. Fixtures updated to the post-#7088 emission; every real assertion is unchanged and now actually executes (11/11 pass). diff --git a/crates/perry-codegen/tests/scalar_replaced_slot_roots.rs b/crates/perry-codegen/tests/scalar_replaced_slot_roots.rs index 4f9f4675e1..901bc51891 100644 --- a/crates/perry-codegen/tests/scalar_replaced_slot_roots.rs +++ b/crates/perry-codegen/tests/scalar_replaced_slot_roots.rs @@ -188,8 +188,14 @@ fn enclosing_function<'a>(ir: &'a str, needle: &str) -> &'a str { } /// The slot count baked into this module-init function's frame push. +/// +/// #7088 replaced the handle-returning `js_shadow_frame_push` with +/// `js_shadow_frame_enter`, which returns the `ShadowStackState` pointer the +/// inline slot stores address (the pop handle is derived from `frame_top`). +/// The slot-count operand is unchanged, so only the callee name and its +/// return type move. fn frame_slot_count(ir: &str) -> u32 { - let needle = "call i64 @js_shadow_frame_push(i32 "; + let needle = "call ptr @js_shadow_frame_enter(i32 "; let start = ir .find(needle) .map(|i| i + needle.len()) @@ -587,8 +593,9 @@ fn bind_is_hoisted_into_the_entry_block_ahead_of_the_storing_loop() { ); let body = enclosing_function(&ir, "call void @js_shadow_slot_bind("); + // #7088: the push is `js_shadow_frame_enter` (returns the state pointer). let push = body - .find("call i64 @js_shadow_frame_push(") + .find("call ptr @js_shadow_frame_enter(") .unwrap_or_else(|| panic!("no frame push in the binding function:\n{body}")); let bind = body .find("call void @js_shadow_slot_bind(")