@@ -3513,14 +3513,10 @@ fn build_stack_map(jit: &JITState, function: &Function, state: &FrameState) -> V
35133513 stack. extend ( current_state. stack ( ) . rev ( ) . copied ( ) . map ( to_entry) ) ;
35143514 // Frame environment data (me/cref, specval, flags) already lives in memory.
35153515 stack. push ( StackMapEntry :: Skip ( VM_ENV_DATA_SIZE . to_usize ( ) ) ) ;
3516- // Locals, top-down (local[L-1] .. local[0]). They land at fixed
3517- // EP-relative slots because we write down from cfp->sp.
3518- //
3519- // Locals backed by memory are accessed in mainline code,
3520- // so we skip over those slots to not interfere and clobber.
3521- // (The stack map is not the 1st write to the slot.)
3516+ // Locals, top-down (local[L-1] .. local[0]).
35223517 let spilled_locals = current_state. spilled_locals ( ) ;
35233518 for ( idx, & insn_id) in current_state. locals ( ) . enumerate ( ) . rev ( ) {
3519+ // Skip spilled slots which are already initialized on entry.
35243520 if spilled_locals. get ( idx) {
35253521 stack. push ( StackMapEntry :: Skip ( 1 ) ) ;
35263522 } else {
@@ -3531,9 +3527,9 @@ fn build_stack_map(jit: &JITState, function: &Function, state: &FrameState) -> V
35313527 let Some ( caller) = current_state. caller ( ) else {
35323528 break ;
35333529 } ;
3534- // Skip the callee's receiver slot below its local table. We currently
3535- // never map out the stack for `invokeblock`, which doesn't put a
3536- // receiver on cfp->sp stack.
3530+ // Skip the callee's receiver slot below its local table.
3531+ // We currently never map out the stack for `invokeblock`, which doesn't
3532+ // put a receiver on cfp->sp stack.
35373533 stack. push ( StackMapEntry :: Skip ( 1 ) ) ;
35383534 current_state = function. frame_state ( caller) ;
35393535 }
0 commit comments