🧹 Remove unused used field in CodePage - #318
Conversation
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_cad62df8-ae84-452d-a4f9-7b92c2a0112b) |
|
Tick the box to add this pull request to the merge queue (same as
|
🎯 What: Removed the
usedfield and its complex#[cfg_attr(..., allow(dead_code))]fromCodePageinin-cli/src/jit_runtime.rs. The required byte count is now passed directly as an argument (_used) to thefinalizemethod.💡 Why: This simplifies the struct definition, removes an unnecessary and clunky conditional compilation attribute for silencing dead code warnings on unsupported platforms (like x86_64), and cleans up initialization logic by making
pageimmutable when loading JIT code.✅ Verification: Verified by ensuring the code formats with
cargo fmt, passes linting viacargo clippy --all-targets --features extended --locked -- -D warnings, and passes both thejit_runtimespecific test and the full test suite (cargo test).✨ Result: A cleaner
CodePagestructure with better memory layout and safer, immutable initialization without dead-code allowance hacks.PR created automatically by Jules for task 16642229359867925454 started by @undivisible
Note
Low Risk
Localized JIT runtime cleanup with no change to when or how much memory is flushed or made executable.
Overview
Refactors how the JIT runtime tracks how many bytes were written into an executable
CodePage.The
usedfield is removed fromCodePage, along with the platform-specificallow(dead_code)attribute that existed becauseusedwas only read on macOS and AArch64 Linux for instruction-cache invalidation.finalizenow takes the written byte count (code.len()fromJitRuntime::load) instead of reading it from the page.loadno longer mutates the page after allocation—only copies code, applies relocations, pushes the page, then callsfinalize(code.len()).Behavior for icache flush and mprotect is unchanged; the count is just supplied at finalize time rather than stored on the struct.
Reviewed by Cursor Bugbot for commit 81b3d74. Configure here.