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(")