Skip to content

Commit 19076e4

Browse files
More fixes
1 parent bfc3003 commit 19076e4

5 files changed

Lines changed: 9 additions & 59 deletions

File tree

src/coreclr/nativeaot/Runtime/EHHelpers.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,18 +276,14 @@ static bool InWriteBarrierHelper(uintptr_t faultingIP)
276276
return false;
277277
}
278278

279-
#if (defined(HOST_AMD64) || defined(HOST_ARM64)) && defined(HOST_WINDOWS)
280279
EXTERN_C CODE_LOCATION RhpResolveInterfaceMethodFast;
281-
#endif
282280

283281
static bool InInterfaceDispatchHelper(uintptr_t faultingIP)
284282
{
285283
#ifndef FEATURE_PORTABLE_HELPERS
286284
static uintptr_t interfaceDispatchAVLocations[] =
287285
{
288-
#if (defined(HOST_AMD64) || defined(HOST_ARM64)) && defined(HOST_WINDOWS)
289286
(uintptr_t)&RhpResolveInterfaceMethodFast,
290-
#endif
291287
};
292288

293289
// compare the IP against the list of known possible AV locations in the interface dispatch helpers

src/coreclr/nativeaot/Runtime/StackFrameIterator.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@
3333

3434
#if !defined(FEATURE_PORTABLE_HELPERS) // @TODO: these are (currently) only implemented in assembly helpers
3535
EXTERN_C CODE_LOCATION ReturnFromUniversalTransitionTailCall;
36-
#if (defined(HOST_AMD64) || defined(HOST_ARM64)) && defined(HOST_WINDOWS)
37-
EXTERN_C CODE_LOCATION ReturnFromUniversalTransitionReturnResult;
38-
#endif
3936

4037
EXTERN_C CODE_LOCATION RhpCallCatchFunclet2;
4138
EXTERN_C CODE_LOCATION RhpCallFinallyFunclet2;
@@ -2234,12 +2231,6 @@ StackFrameIterator::ReturnAddressCategory StackFrameIterator::CategorizeUnadjust
22342231
{
22352232
return InUniversalTransitionThunk;
22362233
}
2237-
#if (defined(HOST_AMD64) || defined(HOST_ARM64)) && defined(HOST_WINDOWS)
2238-
if (EQUALS_RETURN_ADDRESS(returnAddress, ReturnFromUniversalTransitionReturnResult))
2239-
{
2240-
return InUniversalTransitionThunk;
2241-
}
2242-
#endif
22432234

22442235
if (EQUALS_RETURN_ADDRESS(returnAddress, RhpThrowImpl2) ||
22452236
EQUALS_RETURN_ADDRESS(returnAddress, RhpThrowHwEx2) ||

src/coreclr/nativeaot/Runtime/amd64/UniversalTransition.asm

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ DISTANCE_FROM_CHILDSP_TO_CALLERSP equ DISTANCE_FROM_CHILDSP_TO_RET
8282
; everything between the base of the ReturnBlock and the top of the StackPassedArgs.
8383
;
8484

85-
UNIVERSAL_TRANSITION macro FunctionName, ExitSequence
85+
UNIVERSAL_TRANSITION macro FunctionName
8686

8787
NESTED_ENTRY Rhp&FunctionName, _TEXT
8888

@@ -144,13 +144,12 @@ ALTERNATE_ENTRY ReturnFrom&FunctionName
144144
; Pop the space that was allocated between the ChildSP and the caller return address.
145145
add rsp, DISTANCE_FROM_CHILDSP_TO_RETADDR
146146

147-
ExitSequence
147+
TAILJMP_RAX
148148

149149
NESTED_END Rhp&FunctionName, _TEXT
150150

151151
endm
152152

153-
UNIVERSAL_TRANSITION UniversalTransitionTailCall, TAILJMP_RAX
154-
UNIVERSAL_TRANSITION UniversalTransitionReturnResult, ret
153+
UNIVERSAL_TRANSITION UniversalTransitionTailCall
155154

156155
end

src/coreclr/nativeaot/Runtime/arm64/DispatchResolve.asm

Lines changed: 4 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
TEXTAREA
77

88
EXTERN RhpCidResolve
9-
EXTERN RhpUniversalTransitionReturnResult
9+
EXTERN RhpUniversalTransitionTailCall
1010

11-
NESTED_ENTRY RhpResolveInterfaceMethodFast, _TEXT
11+
LEAF_ENTRY RhpResolveInterfaceMethodFast, _TEXT
1212

1313
;; Load the MethodTable from the object instance in x0.
1414
;; Trigger an AV if we're dispatching on a null this.
@@ -17,40 +17,11 @@
1717
;; to a NullReferenceException at the callsite.
1818
ldr x12, [x0]
1919

20-
;; x11 currently contains the indirection cell address.
21-
;; load x13 to point to the cache block.
22-
ldr x13, [x11, #OFFSETOF__InterfaceDispatchCell__m_pCache]
23-
and x14, x13, #IDC_CACHE_POINTER_MASK
24-
cbnz x14, RhpResolveInterfaceMethodFast_SlowPath
25-
26-
add x14, x13, #OFFSETOF__InterfaceDispatchCache__m_rgEntries
27-
ldr x15, [x14]
28-
cmp x15, x12
29-
bne RhpResolveInterfaceMethodFast_Polymorphic
30-
ldur x15, [x14, #8]
31-
ret
32-
33-
RhpResolveInterfaceMethodFast_Polymorphic
34-
ldr w13, [x13, #OFFSETOF__InterfaceDispatchCache__m_cEntries]
35-
36-
RhpResolveInterfaceMethodFast_NextEntry
37-
add x14, x14, #SIZEOF__InterfaceDispatchCacheEntry
38-
sub w13, w13, #1
39-
cmp w13, #0
40-
beq RhpResolveInterfaceMethodFast_SlowPath
41-
42-
ldr x15, [x14]
43-
cmp x15, x12
44-
bne RhpResolveInterfaceMethodFast_NextEntry
45-
46-
ldur x15, [x14, #8]
47-
ret
48-
4920
RhpResolveInterfaceMethodFast_SlowPath
5021
ldr xip0, =RhpCidResolve
5122
mov xip1, x11
52-
b RhpUniversalTransitionReturnResult
23+
b RhpUniversalTransitionTailCall
5324

54-
NESTED_END RhpResolveInterfaceMethodFast
25+
LEAF_END RhpResolveInterfaceMethodFast
5526

5627
END

src/coreclr/nativeaot/Runtime/arm64/UniversalTransition.asm

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
TEXTAREA
9090

9191
MACRO
92-
UNIVERSAL_TRANSITION $FunctionName, $ReturnResult
92+
UNIVERSAL_TRANSITION $FunctionName
9393

9494
NESTED_ENTRY Rhp$FunctionName
9595

@@ -142,20 +142,13 @@
142142
;; Restore FP and LR registers, and free the allocated stack block
143143
EPILOG_RESTORE_REG_PAIR fp, lr, #STACK_SIZE!
144144

145-
IF $ReturnResult == 0
146145
;; Tailcall to the target address.
147146
EPILOG_NOP br x12
148-
ELSE
149-
;; Return target address
150-
EPILOG_NOP mov x15, x12
151-
ret
152-
ENDIF
153147

154148
NESTED_END Rhp$FunctionName
155149

156150
MEND
157151

158-
UNIVERSAL_TRANSITION UniversalTransitionTailCall, 0
159-
UNIVERSAL_TRANSITION UniversalTransitionReturnResult, 1
152+
UNIVERSAL_TRANSITION UniversalTransitionTailCall
160153

161154
END

0 commit comments

Comments
 (0)