Skip to content

Commit 8b79b85

Browse files
authored
Delete redundant RhpUniversalTransition (#122689)
Left-over from .NET Native calling convention converter. We only need the tailcall variant of universal transition.
1 parent 6cfcaf9 commit 8b79b85

19 files changed

+27
-91
lines changed

src/coreclr/nativeaot/Runtime/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,6 @@ if(CLR_CMAKE_TARGET_ARCH_ARM OR CLR_CMAKE_TARGET_ARCH_WASM)
272272
add_definitions(-DFEATURE_64BIT_ALIGNMENT)
273273
endif()
274274

275-
add_definitions(-DFEATURE_CUSTOM_IMPORTS)
276-
add_definitions(-DFEATURE_DYNAMIC_CODE)
277275
add_compile_definitions($<$<CONFIG:Debug,Checked>:FEATURE_GC_STRESS>)
278276
add_definitions(-DFEATURE_NATIVEAOT)
279277
add_definitions(-DVERIFY_HEAP)

src/coreclr/nativeaot/Runtime/StackFrameIterator.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,7 @@
3232
#pragma warning(disable:4061)
3333

3434
#if !defined(FEATURE_PORTABLE_HELPERS) // @TODO: these are (currently) only implemented in assembly helpers
35-
36-
#if defined(FEATURE_DYNAMIC_CODE)
37-
EXTERN_C CODE_LOCATION ReturnFromUniversalTransition;
38-
EXTERN_C CODE_LOCATION ReturnFromUniversalTransition_DebugStepTailCall;
39-
#endif
35+
EXTERN_C CODE_LOCATION ReturnFromUniversalTransitionTailCall;
4036

4137
EXTERN_C CODE_LOCATION RhpCallCatchFunclet2;
4238
EXTERN_C CODE_LOCATION RhpCallFinallyFunclet2;
@@ -2231,13 +2227,10 @@ StackFrameIterator::ReturnAddressCategory StackFrameIterator::CategorizeUnadjust
22312227

22322228
#else // defined(FEATURE_PORTABLE_HELPERS)
22332229

2234-
#if defined(FEATURE_DYNAMIC_CODE)
2235-
if (EQUALS_RETURN_ADDRESS(returnAddress, ReturnFromUniversalTransition) ||
2236-
EQUALS_RETURN_ADDRESS(returnAddress, ReturnFromUniversalTransition_DebugStepTailCall))
2230+
if (EQUALS_RETURN_ADDRESS(returnAddress, ReturnFromUniversalTransitionTailCall))
22372231
{
22382232
return InUniversalTransitionThunk;
22392233
}
2240-
#endif
22412234

22422235
if (EQUALS_RETURN_ADDRESS(returnAddress, RhpThrowEx2) ||
22432236
EQUALS_RETURN_ADDRESS(returnAddress, RhpThrowHwEx2) ||

src/coreclr/nativeaot/Runtime/amd64/CachedInterfaceDispatchAot.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ LEAF_ENTRY RhpInterfaceDispatchSlow, _TEXT
1414
// r11 contains indirection cell address already, so it will naturally be passed to RhpCidResolve
1515
// the universal transition thunk as an argument to RhpCidResolve
1616
mov r10, [rip + REL_C_FUNC(RhpCidResolve)]
17-
jmp qword ptr [rip + REL_C_FUNC(RhpUniversalTransition_DebugStepTailCall)]
17+
jmp qword ptr [rip + REL_C_FUNC(RhpUniversalTransitionTailCall)]
1818

1919
LEAF_END RhpInterfaceDispatchSlow, _TEXT

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,14 @@
44
include AsmMacros.inc
55

66
EXTERN RhpCidResolve : PROC
7-
EXTERN RhpUniversalTransition_DebugStepTailCall : PROC
8-
9-
EXTERN RhpCidResolve : PROC
10-
EXTERN RhpUniversalTransition_DebugStepTailCall : PROC
7+
EXTERN RhpUniversalTransitionTailCall : PROC
118

129
;; Cache miss case, call the runtime to resolve the target and update the cache.
1310
;; Use universal transition helper to allow an exception to flow out of resolution
1411
LEAF_ENTRY RhpInterfaceDispatchSlow, _TEXT
1512
;; r11 contains indirection cell address
1613
lea r10, RhpCidResolve
17-
jmp RhpUniversalTransition_DebugStepTailCall
14+
jmp RhpUniversalTransitionTailCall
1815

1916
LEAF_END RhpInterfaceDispatchSlow, _TEXT
2017

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

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
.intel_syntax noprefix
55
#include <unixasmmacros.inc>
66

7-
#ifdef FEATURE_DYNAMIC_CODE
8-
97
#ifdef _DEBUG
108
#define TRASH_SAVED_ARGUMENT_REGISTERS 1
119
#endif
@@ -153,10 +151,4 @@ NESTED_END Rhp\FunctionName, _TEXT
153151

154152
.endm // UNIVERSAL_TRANSITION
155153

156-
// To enable proper step-in behavior in the debugger, we need to have two instances
157-
// of the thunk. For the first one, the debugger steps into the call in the function,
158-
// for the other, it steps over it.
159-
UNIVERSAL_TRANSITION UniversalTransition
160-
UNIVERSAL_TRANSITION UniversalTransition_DebugStepTailCall
161-
162-
#endif // FEATURE_DYNAMIC_CODE
154+
UNIVERSAL_TRANSITION UniversalTransitionTailCall

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

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
include AsmMacros.inc
55

6-
ifdef FEATURE_DYNAMIC_CODE
7-
86
ifdef _DEBUG
97
TRASH_SAVED_ARGUMENT_REGISTERS equ 1
108
else
@@ -152,12 +150,6 @@ NESTED_END Rhp&FunctionName, _TEXT
152150

153151
endm
154152

155-
; To enable proper step-in behavior in the debugger, we need to have two instances
156-
; of the thunk. For the first one, the debugger steps into the call in the function,
157-
; for the other, it steps over it.
158-
UNIVERSAL_TRANSITION UniversalTransition
159-
UNIVERSAL_TRANSITION UniversalTransition_DebugStepTailCall
160-
161-
endif
153+
UNIVERSAL_TRANSITION UniversalTransitionTailCall
162154

163155
end

src/coreclr/nativeaot/Runtime/arm/UniversalTransition.S

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
#include <AsmOffsets.inc> // generated by the build from AsmOffsets.cpp
88
#include <unixasmmacros.inc>
99

10-
#ifdef FEATURE_DYNAMIC_CODE
11-
1210
#ifdef _DEBUG
1311
#define TRASH_SAVED_ARGUMENT_REGISTERS
1412
#endif
@@ -144,10 +142,4 @@ NESTED_END Rhp\FunctionName, _TEXT
144142

145143
.endm
146144

147-
// To enable proper step-in behavior in the debugger, we need to have two instances
148-
// of the thunk. For the first one, the debugger steps into the call in the function,
149-
// for the other, it steps over it.
150-
UNIVERSAL_TRANSITION UniversalTransition
151-
UNIVERSAL_TRANSITION UniversalTransition_DebugStepTailCall
152-
153-
#endif // FEATURE_DYNAMIC_CODE
145+
UNIVERSAL_TRANSITION UniversalTransitionTailCall

src/coreclr/nativeaot/Runtime/arm64/CachedInterfaceDispatchAot.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#ifdef FEATURE_CACHED_INTERFACE_DISPATCH
88

99
.extern RhpCidResolve
10-
.extern RhpUniversalTransition_DebugStepTailCall
10+
.extern RhpUniversalTransitionTailCall
1111

1212
//
1313
// Cache miss case, call the runtime to resolve the target and update the cache.
@@ -20,7 +20,7 @@
2020
// xip1: parameter of the thunk's target
2121
PREPARE_EXTERNAL_VAR RhpCidResolve, xip0
2222
mov xip1, x11
23-
b C_FUNC(RhpUniversalTransition_DebugStepTailCall)
23+
b C_FUNC(RhpUniversalTransitionTailCall)
2424
LEAF_END RhpInterfaceDispatchSlow, _TEXT
2525

2626
#endif // FEATURE_CACHED_INTERFACE_DISPATCH

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#ifdef FEATURE_CACHED_INTERFACE_DISPATCH
99

1010
EXTERN RhpCidResolve
11-
EXTERN RhpUniversalTransition_DebugStepTailCall
11+
EXTERN RhpUniversalTransitionTailCall
1212

1313
;;
1414
;; Cache miss case, call the runtime to resolve the target and update the cache.
@@ -21,7 +21,7 @@
2121
;; xip1: parameter of the thunk's target
2222
ldr xip0, =RhpCidResolve
2323
mov xip1, x11
24-
b RhpUniversalTransition_DebugStepTailCall
24+
b RhpUniversalTransitionTailCall
2525
LEAF_END RhpInterfaceDispatchSlow
2626

2727
#endif // FEATURE_CACHED_INTERFACE_DISPATCH

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,5 @@ ALTERNATE_ENTRY ReturnFrom\FunctionName
158158

159159
.endm
160160

161-
// To enable proper step-in behavior in the debugger, we need to have two instances
162-
// of the thunk. For the first one, the debugger steps into the call in the function,
163-
// for the other, it steps over it.
164-
UNIVERSAL_TRANSITION UniversalTransition
165-
UNIVERSAL_TRANSITION UniversalTransition_DebugStepTailCall
161+
UNIVERSAL_TRANSITION UniversalTransitionTailCall
166162

0 commit comments

Comments
 (0)