-
Notifications
You must be signed in to change notification settings - Fork 19
jit: drop the WITH_EXCEPT_START gate + with-frame exception-correctness fixes (#389) #532
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
2ddcadc
4d866c0
a1ae139
fe25d0a
b6883b1
dc7ba20
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1621,7 +1621,7 @@ fn run_perfn_walk( | |
| reserved_red_colors.first().copied() == Some(color); | ||
| let bridge_names_operand = | ||
| !is_frame_color && opref != ec_box && opref != frame_box; | ||
| if pyre_object::tagged_int::CAN_BE_TAGGED && bridge_names_operand { | ||
| if bridge_names_operand { | ||
| seed(color, opref); | ||
| } | ||
| continue; | ||
|
|
@@ -1822,6 +1822,7 @@ fn run_perfn_walk( | |
| ) => Some((*pc, false)), | ||
| _ => None, | ||
| }; | ||
| let mut entry_carrier_call_py_pc = None; | ||
| if let Some((abort_jit_pc, is_marker_abort)) = call_forward_abort { | ||
| // gh#467: a supported abort fired inside a TOP-level inline | ||
| // sub-walk whose callee executed no concrete effect | ||
|
|
@@ -1843,6 +1844,7 @@ fn run_perfn_walk( | |
| call_py_pc, | ||
| call_stack, | ||
| }) => { | ||
| entry_carrier_call_py_pc = Some(*call_py_pc); | ||
| if crate::state::flush_walk_end_state_at_outer_call( | ||
| ctx, | ||
| cf_addr, | ||
|
|
@@ -1961,35 +1963,46 @@ fn run_perfn_walk( | |
| } else if let Some(resume_py_pc) = | ||
| crate::jitcode_dispatch::fbw_abort_outer_resume_take() | ||
| { | ||
| // Flush while the overrides stay rooted in | ||
| // FBW_ABORT_OUTER_STACK_OVERRIDES (the flush boxes Int/Float | ||
| // locals — an allocation that can move the nursery-resident | ||
| // override refs; the area walker forwards them in place), | ||
| // then clear the cell. | ||
| let committed = crate::jitcode_dispatch::fbw_abort_outer_stack_overrides_with( | ||
| |stack_overrides| { | ||
| crate::state::flush_walk_end_state_to_frame_with_stack_overrides( | ||
| ctx, | ||
| cf_addr, | ||
| resume_py_pc, | ||
| stack_overrides, | ||
| ) | ||
| }, | ||
| ); | ||
| crate::jitcode_dispatch::fbw_abort_outer_stack_overrides_clear(); | ||
| if committed { | ||
| if entry_carrier_call_py_pc == Some(resume_py_pc) { | ||
| crate::jitcode_dispatch::fbw_abort_outer_stack_overrides_clear(); | ||
|
Comment on lines
+1966
to
+1967
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When the Entry carrier's Useful? React with 👍 / 👎. |
||
| if crate::jitcode_dispatch::fbw_debug_abort_enabled() { | ||
| eprintln!( | ||
| "[fbw-abort-flush] COMMIT abort_jit_pc={abort_jit_pc} \ | ||
| resume_py_pc={resume_py_pc} (nested inline decline)" | ||
| "[fbw-abort-flush] skipped at resume_py_pc={resume_py_pc} \ | ||
| (entry carrier already handled same resume)" | ||
| ); | ||
| } | ||
| } else { | ||
| // Flush while the overrides stay rooted in | ||
| // FBW_ABORT_OUTER_STACK_OVERRIDES (the flush boxes Int/Float | ||
| // locals — an allocation that can move the nursery-resident | ||
| // override refs; the area walker forwards them in place), | ||
| // then clear the cell. | ||
| let committed = | ||
| crate::jitcode_dispatch::fbw_abort_outer_stack_overrides_with( | ||
| |stack_overrides| { | ||
| crate::state::flush_walk_end_state_to_frame_with_stack_overrides( | ||
| ctx, | ||
| cf_addr, | ||
| resume_py_pc, | ||
| stack_overrides, | ||
| ) | ||
| }, | ||
| ); | ||
| crate::jitcode_dispatch::fbw_abort_outer_stack_overrides_clear(); | ||
| if committed { | ||
| if crate::jitcode_dispatch::fbw_debug_abort_enabled() { | ||
| eprintln!( | ||
| "[fbw-abort-flush] COMMIT abort_jit_pc={abort_jit_pc} \ | ||
| resume_py_pc={resume_py_pc} (nested inline decline)" | ||
| ); | ||
| } | ||
| WALK_END_FLUSH_COMMITTED.with(|c| c.set(true)); | ||
| } else if crate::jitcode_dispatch::fbw_debug_abort_enabled() { | ||
| eprintln!( | ||
| "[fbw-abort-flush] declined at resume_py_pc={resume_py_pc} \ | ||
| (shadow slot without concrete / depth / lastblock) — legacy replay kept" | ||
| ); | ||
| } | ||
| WALK_END_FLUSH_COMMITTED.with(|c| c.set(true)); | ||
| } else if crate::jitcode_dispatch::fbw_debug_abort_enabled() { | ||
| eprintln!( | ||
| "[fbw-abort-flush] declined at resume_py_pc={resume_py_pc} \ | ||
| (shadow slot without concrete / depth / lastblock) — legacy replay kept" | ||
| ); | ||
| } | ||
| } else if crate::jitcode_dispatch::fbw_debug_abort_enabled() { | ||
| eprintln!( | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9092,13 +9092,6 @@ impl CodeWriter { | |
| // on top. Preserve the net `+1` stack effect in the | ||
| // shadow graph and fall back to the interpreter for | ||
| // the actual helper call semantics. | ||
| // | ||
| // Portable (flowspace records a `direct_call` / | ||
| // `indirect_call`) but latent: a `with` block's | ||
| // exception table prevents the enclosing loop/callee | ||
| // from ever reaching a JIT token, so this abort is | ||
| // never reached in practice — no residual yet. | ||
| emit_abort_permanent!(py_pc); | ||
| push_fresh_ref(&mut current_state, &mut graph); | ||
| current_depth += 1; | ||
| emit_vsd!(current_depth, py_pc); | ||
|
Comment on lines
9095
to
9097
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
With this gate removed, frames containing Useful? React with 👍 / 👎. |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When
insert_renamingsemits an integer cycle, this pop only restoresregisters_i[dst]and leavesconcrete_registers_i[dst]holding whatever value the destination had before the swap. On paths where the concrete Int shadow is populated and a latergoto_if_not/iL,switch/id, orint_return/ireads it, the walker can fold or return using stale concrete data even though the symbolic OpRef was moved correctly. Mirror the ref tmpreg path by carrying atmpreg_i_concretevalue fromint_push/iand usingwrite_int_regon pop.Useful? React with 👍 / 👎.