Remove Wrapper delegate kind, switch ARM32 VSD hidden arg to R12#129403
Conversation
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
|
@copilot Remove all wrapper handling code from |
|
@copilot Remove all wrapper handling code from MulticastDelegate.CoreCLR.cs too. |
|
Tagging subscribers to this area: @agocke |
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
|
@copilot Tests are still failing with Assert failure(PID 16 [0x00000010], Thread: 16 [0x0010]): Data pointer is outside of loaded image. |
…bDispatch Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
|
@copilot Revert last commit. Change REG_R2R_INDIRECT_PARAM to r12 instead |
…rtualStubDispatch" This reverts commit 9295b50. Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Fixed in the last two commits:
|
|
@copilot Investigate test failures |
… VSD Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
…bbering lr Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
... The root cause was in the simple case of Fixed in the latest commit by replacing
|
…tail call
- Replace ThumbEmitProlog(3,0,FALSE) with direct ThumbEmitPush({r4,r5,r6})
- Remove lr save since we're tail-calling (not making a subroutine call)
- Replace ldr r6,[r12]+str r6,[sp+...] with ldr pc,[r12] tail call
- Replace ThumbEmitEpilog() with ThumbEmitPop({r4,r5,r6})+ldr pc,[r12]
- Update cbSavedRegs to 3*4 (r4,r5,r6 only, no lr)
- Delete ThumbEmitProlog and ThumbEmitEpilog methods from cgencpu.h
- Delete DescribeProlog from stublink.h and stublink.cpp
- Delete prolog tracking fields (m_fProlog, m_cCalleeSavedRegs, m_cbStackFrame, m_fPushArgRegs)
Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
|
@dotnet/jit-contrib Could you please review this? This is deleting CoreCLR Arm32 ABI quirk and supporting infrastructure. IIRC, this quirk was a micro-optimization for Arm32 done in the Windows Phone era. We can live without this Arm32 specific micro-optimization going forward. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 39 out of 39 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
src/coreclr/jit/targetarm.h:183
- On ARM32 this change makes both VSD hidden parameter and the R2R indirection cell register be R12. Existing ARM32 call emission for VSD/R2R indirection typically needs a scratch register to load the call target from [R12] before calling; with R12 now reserved for the hidden indirection-cell value, loading into (or otherwise clobbering) R12 would break stub dispatch (the callee would no longer receive the indirection cell in the expected register). Please ensure the ARM32 call sequence is updated to preserve R12 while still performing an indirect call (e.g., an explicit call-via-memory pattern) and that LSRA/codegen are updated accordingly.
// R2R indirect call. Use the same registers as VSD
#define REG_R2R_INDIRECT_PARAM REG_R12
#define RBM_R2R_INDIRECT_PARAM RBM_R12
// JMP Indirect call register
#define REG_INDIRECT_CALL_TARGET_REG REG_R12
CoreCLR’s "Wrapper" delegate kind was retained only to satisfy an ARM32 VSD ABI quirk (
r4hidden cell). This change removes that special delegate path by moving ARM32 VSD hidden-parameter passing tor12and deleting wrapper-delegate infrastructure.Fixes #129399