Skip to content

Commit 86a59cd

Browse files
authored
Mop-up changes per Jakob's PR suggestions (#70180)
1) Rename CORINFO_HELP_STATIC_VIRTUAL_AMBIGUOUS_RESOLUTION to CORINFO_HELP_THROW_AMBIGUOUS_RESOLUTION_EXCEPTION and put it next to the other CORINFO_HELP_THROW methods; 2) Add the new helper to CorInfoHelpFunc.cs; 3) Remove the jitinterface member doesFieldBelongToClass; 4) Update the JIT EE GUID. Thanks Tomas Fixes: #69900
1 parent fd0a8e4 commit 86a59cd

File tree

18 files changed

+39
-172
lines changed

18 files changed

+39
-172
lines changed

src/coreclr/inc/corinfo.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,7 @@ enum CorInfoHelpFunc
625625
CORINFO_HELP_THROW_NOT_IMPLEMENTED, // throw NotImplementedException
626626
CORINFO_HELP_THROW_PLATFORM_NOT_SUPPORTED, // throw PlatformNotSupportedException
627627
CORINFO_HELP_THROW_TYPE_NOT_SUPPORTED, // throw TypeNotSupportedException
628+
CORINFO_HELP_THROW_AMBIGUOUS_RESOLUTION_EXCEPTION, // throw AmbiguousResolutionException for failed static virtual method resolution
628629

629630
CORINFO_HELP_JIT_PINVOKE_BEGIN, // Transition to preemptive mode before a P/Invoke, frame is the first argument
630631
CORINFO_HELP_JIT_PINVOKE_END, // Transition to cooperative mode after a P/Invoke, frame is the first argument
@@ -646,8 +647,6 @@ enum CorInfoHelpFunc
646647
CORINFO_HELP_VALIDATE_INDIRECT_CALL, // CFG: Validate function pointer
647648
CORINFO_HELP_DISPATCH_INDIRECT_CALL, // CFG: Validate and dispatch to pointer
648649

649-
CORINFO_HELP_STATIC_VIRTUAL_AMBIGUOUS_RESOLUTION, // Throw AmbiguousResolutionException for failed static virtual method resolution
650-
651650
CORINFO_HELP_COUNT,
652651
};
653652

src/coreclr/inc/corjit.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -495,12 +495,6 @@ class ICorJitInfo : public ICorDynamicInfo
495495
uint32_t sizeInBytes /* IN: The size of the buffer. Note that this is effectively a
496496
version number for the CORJIT_FLAGS value. */
497497
) = 0;
498-
499-
// Checks if a field belongs to a given class.
500-
virtual bool doesFieldBelongToClass(
501-
CORINFO_FIELD_HANDLE fldHnd, /* IN: the field that we are checking */
502-
CORINFO_CLASS_HANDLE cls /* IN: the class that we are checking */
503-
) = 0;
504498
};
505499

506500
/**********************************************************************************/

src/coreclr/inc/icorjitinfoimpl_generated.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -710,10 +710,6 @@ uint32_t getJitFlags(
710710
CORJIT_FLAGS* flags,
711711
uint32_t sizeInBytes) override;
712712

713-
bool doesFieldBelongToClass(
714-
CORINFO_FIELD_HANDLE fldHnd,
715-
CORINFO_CLASS_HANDLE cls) override;
716-
717713
/**********************************************************************************/
718714
// clang-format on
719715
/**********************************************************************************/

src/coreclr/inc/jiteeversionguid.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ typedef const GUID *LPCGUID;
4343
#define GUID_DEFINED
4444
#endif // !GUID_DEFINED
4545

46-
constexpr GUID JITEEVersionIdentifier = { /* f2a217c4-2a69-4308-99ce-8292c6763776 */
47-
0xf2a217c4,
48-
0x2a69,
49-
0x4308,
50-
{0x99, 0xce, 0x82, 0x92, 0xc6, 0x76, 0x37, 0x76}
46+
constexpr GUID JITEEVersionIdentifier = { /* 5868685e-b877-4ef5-83f0-73d601e50013 */
47+
0x5868685e,
48+
0xb877,
49+
0x4ef5,
50+
{0x83, 0xf0, 0x73, 0xd6, 0x01, 0xe5, 0x00, 0x13}
5151
};
5252

5353
//////////////////////////////////////////////////////////////////////////////////////////////////////////

src/coreclr/inc/jithelpers.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@
309309
JITHELPER(CORINFO_HELP_THROW_NOT_IMPLEMENTED, JIT_ThrowNotImplementedException, CORINFO_HELP_SIG_REG_ONLY)
310310
JITHELPER(CORINFO_HELP_THROW_PLATFORM_NOT_SUPPORTED, JIT_ThrowPlatformNotSupportedException, CORINFO_HELP_SIG_REG_ONLY)
311311
JITHELPER(CORINFO_HELP_THROW_TYPE_NOT_SUPPORTED, JIT_ThrowTypeNotSupportedException, CORINFO_HELP_SIG_REG_ONLY)
312+
JITHELPER(CORINFO_HELP_THROW_AMBIGUOUS_RESOLUTION_EXCEPTION, JIT_ThrowAmbiguousResolutionException, CORINFO_HELP_SIG_REG_ONLY)
312313

313314
JITHELPER(CORINFO_HELP_JIT_PINVOKE_BEGIN, JIT_PInvokeBegin, CORINFO_HELP_SIG_REG_ONLY)
314315
JITHELPER(CORINFO_HELP_JIT_PINVOKE_END, JIT_PInvokeEnd, CORINFO_HELP_SIG_REG_ONLY)
@@ -343,8 +344,6 @@
343344
JITHELPER(CORINFO_HELP_DISPATCH_INDIRECT_CALL, NULL, CORINFO_HELP_SIG_REG_ONLY)
344345
#endif
345346

346-
JITHELPER(CORINFO_HELP_STATIC_VIRTUAL_AMBIGUOUS_RESOLUTION, JIT_StaticVirtualAmbiguousResolution, CORINFO_HELP_SIG_REG_ONLY)
347-
348347
#undef JITHELPER
349348
#undef DYNAMICJITHELPER
350349
#undef JITHELPER

src/coreclr/jit/ICorJitInfo_API_names.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,5 @@ DEF_CLR_API(recordRelocation)
176176
DEF_CLR_API(getRelocTypeHint)
177177
DEF_CLR_API(getExpectedTargetArchitecture)
178178
DEF_CLR_API(getJitFlags)
179-
DEF_CLR_API(doesFieldBelongToClass)
180179

181180
#undef DEF_CLR_API

src/coreclr/jit/ICorJitInfo_API_wrapper.hpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1690,16 +1690,6 @@ uint32_t WrapICorJitInfo::getJitFlags(
16901690
return temp;
16911691
}
16921692

1693-
bool WrapICorJitInfo::doesFieldBelongToClass(
1694-
CORINFO_FIELD_HANDLE fldHnd,
1695-
CORINFO_CLASS_HANDLE cls)
1696-
{
1697-
API_ENTER(doesFieldBelongToClass);
1698-
bool temp = wrapHnd->doesFieldBelongToClass(fldHnd, cls);
1699-
API_LEAVE(doesFieldBelongToClass);
1700-
return temp;
1701-
}
1702-
17031693
/**********************************************************************************/
17041694
// clang-format on
17051695
/**********************************************************************************/

src/coreclr/tools/Common/JitInterface/CorInfoBase.cs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2549,25 +2549,10 @@ static uint _getJitFlags(IntPtr thisHandle, IntPtr* ppException, CORJIT_FLAGS* f
25492549
}
25502550
}
25512551

2552-
[UnmanagedCallersOnly]
2553-
static byte _doesFieldBelongToClass(IntPtr thisHandle, IntPtr* ppException, CORINFO_FIELD_STRUCT_* fldHnd, CORINFO_CLASS_STRUCT_* cls)
2554-
{
2555-
var _this = GetThis(thisHandle);
2556-
try
2557-
{
2558-
return _this.doesFieldBelongToClass(fldHnd, cls) ? (byte)1 : (byte)0;
2559-
}
2560-
catch (Exception ex)
2561-
{
2562-
*ppException = _this.AllocException(ex);
2563-
return default;
2564-
}
2565-
}
2566-
25672552

25682553
static IntPtr GetUnmanagedCallbacks()
25692554
{
2570-
void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 173);
2555+
void** callbacks = (void**)Marshal.AllocCoTaskMem(sizeof(IntPtr) * 172);
25712556

25722557
callbacks[0] = (delegate* unmanaged<IntPtr, IntPtr*, CORINFO_METHOD_STRUCT_*, byte>)&_isIntrinsic;
25732558
callbacks[1] = (delegate* unmanaged<IntPtr, IntPtr*, CORINFO_METHOD_STRUCT_*, uint>)&_getMethodAttribs;
@@ -2741,7 +2726,6 @@ static IntPtr GetUnmanagedCallbacks()
27412726
callbacks[169] = (delegate* unmanaged<IntPtr, IntPtr*, void*, ushort>)&_getRelocTypeHint;
27422727
callbacks[170] = (delegate* unmanaged<IntPtr, IntPtr*, uint>)&_getExpectedTargetArchitecture;
27432728
callbacks[171] = (delegate* unmanaged<IntPtr, IntPtr*, CORJIT_FLAGS*, uint, uint>)&_getJitFlags;
2744-
callbacks[172] = (delegate* unmanaged<IntPtr, IntPtr*, CORINFO_FIELD_STRUCT_*, CORINFO_CLASS_STRUCT_*, byte>)&_doesFieldBelongToClass;
27452729

27462730
return (IntPtr)callbacks;
27472731
}

src/coreclr/tools/Common/JitInterface/CorInfoHelpFunc.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ which is the right helper to use to allocate an object of a given type. */
271271
CORINFO_HELP_THROW_NOT_IMPLEMENTED, // throw NotImplementedException
272272
CORINFO_HELP_THROW_PLATFORM_NOT_SUPPORTED, // throw PlatformNotSupportedException
273273
CORINFO_HELP_THROW_TYPE_NOT_SUPPORTED, // throw TypeNotSupportedException
274+
CORINFO_HELP_THROW_AMBIGUOUS_RESOLUTION_EXCEPTION, // throw AmbiguousResolutionException for failed static virtual method resolution
274275

275276
CORINFO_HELP_JIT_PINVOKE_BEGIN, // Transition to preemptive mode before a P/Invoke, frame is the first argument
276277
CORINFO_HELP_JIT_PINVOKE_END, // Transition to cooperative mode after a P/Invoke, frame is the first argument

src/coreclr/tools/Common/JitInterface/ThunkGenerator/ThunkInput.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,4 +325,3 @@ FUNCTIONS
325325
uint16_t getRelocTypeHint(void* target)
326326
uint32_t getExpectedTargetArchitecture()
327327
uint32_t getJitFlags(CORJIT_FLAGS* flags, uint32_t sizeInBytes)
328-
bool doesFieldBelongToClass(CORINFO_FIELD_HANDLE fldHnd, CORINFO_CLASS_HANDLE cls)

0 commit comments

Comments
 (0)