Skip to content

Commit d570b32

Browse files
committed
test(codegen): update scalar_replaced_slot_roots fixtures to #7088's frame enter
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.
1 parent 6406ed6 commit d570b32

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

‎crates/perry-codegen/tests/scalar_replaced_slot_roots.rs‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,14 @@ fn enclosing_function<'a>(ir: &'a str, needle: &str) -> &'a str {
188188
}
189189

190190
/// The slot count baked into this module-init function's frame push.
191+
///
192+
/// #7088 replaced the handle-returning `js_shadow_frame_push` with
193+
/// `js_shadow_frame_enter`, which returns the `ShadowStackState` pointer the
194+
/// inline slot stores address (the pop handle is derived from `frame_top`).
195+
/// The slot-count operand is unchanged, so only the callee name and its
196+
/// return type move.
191197
fn frame_slot_count(ir: &str) -> u32 {
192-
let needle = "call i64 @js_shadow_frame_push(i32 ";
198+
let needle = "call ptr @js_shadow_frame_enter(i32 ";
193199
let start = ir
194200
.find(needle)
195201
.map(|i| i + needle.len())
@@ -587,8 +593,9 @@ fn bind_is_hoisted_into_the_entry_block_ahead_of_the_storing_loop() {
587593
);
588594

589595
let body = enclosing_function(&ir, "call void @js_shadow_slot_bind(");
596+
// #7088: the push is `js_shadow_frame_enter` (returns the state pointer).
590597
let push = body
591-
.find("call i64 @js_shadow_frame_push(")
598+
.find("call ptr @js_shadow_frame_enter(")
592599
.unwrap_or_else(|| panic!("no frame push in the binding function:\n{body}"));
593600
let bind = body
594601
.find("call void @js_shadow_slot_bind(")

0 commit comments

Comments
 (0)