Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog.d/7185-scalar-replaced-slot-roots-fixtures.md
Original file line number Diff line number Diff line change
@@ -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).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Remove spaces inside the inline code spans.

Markdownlint reports two MD038 violations because both IR prefixes contain a trailing space before the closing backtick. Describe them as prefixes without embedding the trailing spaces.

Proposed fix
-- **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).
+- **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 the `call i64 `@js_shadow_frame_push`(i32` prefix, which `#7088` replaced with the `call ptr `@js_shadow_frame_enter`(i32` prefix (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).
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- **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).
- **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 the `call i64 `@js_shadow_frame_push`(i32` prefix, which `#7088` replaced with the `call ptr `@js_shadow_frame_enter`(i32` prefix (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).
🧰 Tools
🪛 markdownlint-cli2 (0.23.1)

[warning] 3-3: Spaces inside code span elements

(MD038, no-space-in-code)


[warning] 3-3: Spaces inside code span elements

(MD038, no-space-in-code)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@changelog.d/7185-scalar-replaced-slot-roots-fixtures.md` at line 3, Update
the two inline code spans describing the IR prefixes in the changelog entry to
remove the trailing spaces before their closing backticks, while preserving the
stated prefixes and all surrounding content.

Source: Linters/SAST tools

11 changes: 9 additions & 2 deletions crates/perry-codegen/tests/scalar_replaced_slot_roots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -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(")
Expand Down
Loading