@@ -586,11 +586,9 @@ NESTED_END OnCallCountThresholdReachedStub, _TEXT
586586NESTED_ENTRY JIT_Patchpoint , _TEXT , NoHandler
587587 PROLOG_WITH_TRANSITION_BLOCK
588588
589- // x0 = pointer to TransitionBlock
590- add x0 , sp , #__PWTB_TransitionBlock
589+ add x0 , sp , #__PWTB_TransitionBlock // TransitionBlock *
591590 bl C_FUNC(JIT_PatchpointWorkerWorkerWithPolicy)
592591
593- // If we return , restore all registers and return to caller
594592 EPILOG_WITH_TRANSITION_BLOCK_RETURN
595593NESTED_END JIT_Patchpoint , _TEXT
596594
@@ -2899,62 +2897,3 @@ NESTED_ENTRY IL_Rethrow, _TEXT, NoHandler
28992897 brk # 0
29002898NESTED_END IL_Rethrow , _TEXT
29012899
2902- // ------------------------------------------------------------------
2903- // ClrRestoreNonvolatileContextWorker
2904- //
2905- // Restores registers based on ContextFlags and jumps to the target IP .
2906- // When CONTEXT_INTEGER is set , restores ALL integer registers (x0 - x28)
2907- // because exception handling needs x0 (exception object).
2908- // When CONTEXT_FLOATING_POINT is set , restores non - volatile FP regs (d8 - d15).
2909- //
2910- // Arguments:
2911- // x0 - pointer to CONTEXT structure
2912- //
2913- // Does not return - jumps directly to the Pc stored in the CONTEXT
2914- // ------------------------------------------------------------------
2915- LEAF_ENTRY ClrRestoreNonvolatileContextWorker , _TEXT
2916-
2917- // Save context pointer in x16 since we'll overwrite x0
2918- mov x16 , x0
2919-
2920- // Check ContextFlags to see if we should restore floating point registers
2921- ldr w17 , [ x16 , #OFFSETOF__CONTEXT__ContextFlags ]
2922- tbz w17 , #CONTEXT_FLOATING_POINT_BIT , LOCAL_LABEL(SkipFloatingPointRestore)
2923-
2924- // Restore non - volatile FP registers d8 - d15 (lower 64 bits of v8 - v15)
2925- // V8 is at OFFSETOF__CONTEXT__V0 + 8 * 16 = 0x110 + 0x80 = 0x190
2926- ldp q8 , q9 , [ x16 , #(OFFSETOF__CONTEXT__V0 + 8 * 16 ) ]
2927- ldp q10 , q11 , [ x16 , #(OFFSETOF__CONTEXT__V0 + 10 * 16 ) ]
2928- ldp q12 , q13 , [ x16 , #(OFFSETOF__CONTEXT__V0 + 12 * 16 ) ]
2929- ldp q14 , q15 , [ x16 , #(OFFSETOF__CONTEXT__V0 + 14 * 16 ) ]
2930-
2931- LOCAL_LABEL(SkipFloatingPointRestore):
2932- // Check ContextFlags to see if we should restore integer registers
2933- tbz w17 , #CONTEXT_INTEGER_BIT , LOCAL_LABEL(SkipIntegerRestore)
2934-
2935- // Restore argument registers x0 - x7 (exception handling needs x0 for exception object)
2936- // and non - volatile registers x19 - x28
2937- ldp x0 , x1 , [ x16 , #OFFSETOF__CONTEXT__X0 ]
2938- ldp x2 , x3 , [ x16 , #(OFFSETOF__CONTEXT__X0 + 16 ) ]
2939- ldp x4 , x5 , [ x16 , #(OFFSETOF__CONTEXT__X0 + 32 ) ]
2940- ldp x6 , x7 , [ x16 , #(OFFSETOF__CONTEXT__X0 + 48 ) ]
2941- // Skip x8 - x18: x8 - x15 are scratch , x16 - x17 we're using , x18 is platform reserved
2942- ldp x19 , x20 , [ x16 , #OFFSETOF__CONTEXT__X19 ]
2943- ldp x21 , x22 , [ x16 , #(OFFSETOF__CONTEXT__X19 + 16 ) ]
2944- ldp x23 , x24 , [ x16 , #(OFFSETOF__CONTEXT__X19 + 32 ) ]
2945- ldp x25 , x26 , [ x16 , #(OFFSETOF__CONTEXT__X19 + 48 ) ]
2946- ldp x27 , x28 , [ x16 , #(OFFSETOF__CONTEXT__X19 + 64 ) ]
2947-
2948- LOCAL_LABEL(SkipIntegerRestore):
2949- // Restore fp (x29) and lr (x30)
2950- ldp fp , lr , [ x16 , #OFFSETOF__CONTEXT__Fp ]
2951-
2952- // Load Sp and Pc into scratch registers (after all other loads)
2953- ldr x17 , [ x16 , #OFFSETOF__CONTEXT__Sp ]
2954- ldr x16 , [ x16 , #OFFSETOF__CONTEXT__Pc ]
2955-
2956- // Set sp and jump to target
2957- mov sp , x17
2958- br x16
2959-
2960- LEAF_END ClrRestoreNonvolatileContextWorker , _TEXT
0 commit comments