jit: delete the exc_edge_bridge_enabled gate and the call-site exception prologue it guarded - #1045
Conversation
…ion prologue it guarded The gate returned a constant `true`, so `call_jit.rs`'s `if !exc_edge_bridge_enabled()` prologue was unreachable: it read the backend exception cells and emitted a snapshot-less GUARD_EXCEPTION through `emit_exception_bridge_prologue`. The bridge walker emits the whole SAVE_EXC_CLASS / SAVE_EXCEPTION / RESTORE_EXCEPTION / GUARD_EXCEPTION sequence at the bridge-entry frame state, where the guard carries a snapshot, so the two routing conjuncts and the gate go with it. `emit_exception_bridge_prologue` stays as the `_prepare_exception_resumption` + `prepare_resume_from_failure` counterpart, with its doc noting it is off the live path and why. The reason the gate existed is recorded where the read that caused it lives, in `bridge_subwalk`'s `exc_edge_class`. check.py cranelift 377/377, dynasm 377/377, wasm 373/373. Assisted-by: Claude
|
Warning Review limit reached
Next review available in: 27 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🤖 Codex parity reviewStatic analysis of this diff vs the local RPython/PyPy sources (commit 84a2161). Files in the reviewed diff1. Regressions to PyPy parity introduced by this patchNone. 2. Other mismatches introduced by this patchNone. 3. Pre-existing mismatches (already present before this patch)
4. Structural adaptations
|
Follow-up to #1038, which left this behind.
Opening the exception-edge bridge on every backend made
exc_edge_bridge_enabled()return a constanttrue, which madecall_jit.rs'sif !exc_edge_bridge_enabled()prologue unreachable. That block read the backend exception cells and emitted a snapshot-less GUARD_EXCEPTION throughemit_exception_bridge_prologue.The bridge walker emits the whole SAVE_EXC_CLASS / SAVE_EXCEPTION / RESTORE_EXCEPTION / GUARD_EXCEPTION sequence itself, at the bridge-entry frame state where the guard carries a snapshot. So the dead block goes, and with it the gate and its two routing conjuncts (
call_jit.rs'sroute_exc_edge,bridge_subwalk.rs'sexc_edge_precondition).emit_exception_bridge_prologuestays. It is the_prepare_exception_resumption(pyjitpl.py:3101) +prepare_resume_from_failure(pyjitpl.py:3132) counterpart, and its doc already describes the two-phase split it needs once pyre gains resume-data replay; deleting it would drop an upstream counterpart. Its doc now says it is off the live path and why.The gate's doc comment carried the diagnosis that closed #1038, so its substance moves to where the read that caused it lives —
bridge_subwalk'sexc_edge_class, next to the pointer-width read itself. A future backend that skips the exception triple instead of lowering it hits the same wall one step later, so that is recorded there too.Verification
Rebuilt from re-extracted LLBC at this base: check.py dynasm 378/378, wasm 374/374, cranelift 378/378.
One caveat worth stating: an earlier cranelift run reported
fib_recursiveat 8.1x against an 8x gate. Re-run on the same binary it measured 6.2x (exec 2.30s → 1.49s, pypy oracle 0.28s → 0.25s). That gate sits close enough to the boundary that a loaded box can trip it; the diff here is a dead-code deletion and cannot reach a recursion benchmark.— authored by Claude