Skip to content

Commit ff05c8a

Browse files
CopilotjkotasCopilot
authored
Delete obsolete CORINFO_TYPE_... entries (#128243)
Delete `CORINFO_TYPE_STRING`, legacy `CORINFO_TYPE_REFANY`, and `CORINFO_TYPE_VAR` enum slots from the JIT/EE --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com> Co-authored-by: Jan Kotas <jkotas@microsoft.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 3206a8e commit ff05c8a

16 files changed

Lines changed: 44 additions & 145 deletions

File tree

src/coreclr/inc/corinfo.h

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -612,20 +612,11 @@ enum CorInfoType
612612
CORINFO_TYPE_NATIVEUINT = 0xd,
613613
CORINFO_TYPE_FLOAT = 0xe,
614614
CORINFO_TYPE_DOUBLE = 0xf,
615-
CORINFO_TYPE_STRING = 0x10, // Not used, should remove
616-
CORINFO_TYPE_PTR = 0x11,
617-
CORINFO_TYPE_BYREF = 0x12,
618-
CORINFO_TYPE_VALUECLASS = 0x13,
619-
CORINFO_TYPE_CLASS = 0x14,
620-
CORINFO_TYPE_REFANY = 0x15,
621-
622-
// CORINFO_TYPE_VAR is for a generic type variable.
623-
// Generic type variables only appear when the JIT is doing
624-
// verification (not NOT compilation) of generic code
625-
// for the EE, in which case we're running
626-
// the JIT in "import only" mode.
627-
628-
CORINFO_TYPE_VAR = 0x16,
615+
CORINFO_TYPE_PTR = 0x10,
616+
CORINFO_TYPE_BYREF = 0x11,
617+
CORINFO_TYPE_VALUECLASS = 0x12,
618+
CORINFO_TYPE_CLASS = 0x13,
619+
629620
CORINFO_TYPE_COUNT, // number of jit types
630621
};
631622

src/coreclr/inc/jiteeversionguid.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@
3737

3838
#include <minipal/guid.h>
3939

40-
constexpr GUID JITEEVersionIdentifier = { /* ff61c3a1-5780-4001-84cf-c3a060138d2f */
41-
0xff61c3a1,
42-
0x5780,
43-
0x4001,
44-
{0x84, 0xcf, 0xc3, 0xa0, 0x60, 0x13, 0x8d, 0x2f}
40+
constexpr GUID JITEEVersionIdentifier = { /* 4b5934bd-e9a2-4376-bfbf-d4739f11bdb0 */
41+
0x4b5934bd,
42+
0xe9a2,
43+
0x4376,
44+
{0xbf, 0xbf, 0xd4, 0x73, 0x9f, 0x11, 0xbd, 0xb0}
4545
};
4646

4747
#endif // JIT_EE_VERSIONING_GUID_H

src/coreclr/interpreter/compiler.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2348,15 +2348,13 @@ static InterpType GetInterpType(CorInfoType corInfoType)
23482348
return InterpTypeR4;
23492349
case CORINFO_TYPE_DOUBLE:
23502350
return InterpTypeR8;
2351-
case CORINFO_TYPE_STRING:
23522351
case CORINFO_TYPE_CLASS:
23532352
return InterpTypeO;
23542353
case CORINFO_TYPE_PTR:
23552354
return InterpTypeI;
23562355
case CORINFO_TYPE_BYREF:
23572356
return InterpTypeByRef;
23582357
case CORINFO_TYPE_VALUECLASS:
2359-
case CORINFO_TYPE_REFANY:
23602358
return InterpTypeVT;
23612359
case CORINFO_TYPE_VOID:
23622360
return InterpTypeVoid;
@@ -6151,7 +6149,6 @@ void InterpCompiler::EmitSuspend(const CORINFO_CALL_INFO &callInfo, Continuation
61516149
suspendData->asyncMethodReturnType = m_methodInfo->args.retTypeClass;
61526150
suspendData->asyncMethodReturnTypePrimitiveSize = 0;
61536151
break;
6154-
case CORINFO_TYPE_STRING:
61556152
case CORINFO_TYPE_CLASS:
61566153
suspendData->asyncMethodReturnType = m_compHnd->getBuiltinClass(CLASSID_SYSTEM_OBJECT);
61576154
suspendData->asyncMethodReturnTypePrimitiveSize = 0;
@@ -6199,13 +6196,7 @@ void InterpCompiler::EmitSuspend(const CORINFO_CALL_INFO &callInfo, Continuation
61996196
case CORINFO_TYPE_PTR:
62006197
suspendData->asyncMethodReturnTypePrimitiveSize = sizeof(void*);
62016198
break;
6202-
case CORINFO_TYPE_REFANY:
6203-
BADCODE("TypedReference return types not supported for async methods");
6204-
break;
62056199

6206-
case CORINFO_TYPE_VAR:
6207-
BADCODE("VAR return types should have been translated before we get here on async methods");
6208-
break;
62096200
default:
62106201
// Other types are not supported
62116202
BADCODE("Unsupported async method return type");

src/coreclr/interpreter/naming.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,10 @@ void AppendCorInfoType(TArray<char, MallocAllocator>* printer, CorInfoType corIn
4848
"nuint",
4949
"float",
5050
"double",
51-
"string",
5251
"ptr",
5352
"byref",
5453
"struct",
55-
"class",
56-
"typedbyref",
57-
"var"
54+
"class"
5855
};
5956

6057
const char *corInfoTypeName = "CORINFO_TYPE_INVALID";
@@ -209,11 +206,8 @@ void AppendMethodName(COMP_HANDLE comp,
209206
CorInfoType type = strip(withMod);
210207
switch (type)
211208
{
212-
case CORINFO_TYPE_STRING:
213209
case CORINFO_TYPE_CLASS:
214-
case CORINFO_TYPE_VAR:
215210
case CORINFO_TYPE_VALUECLASS:
216-
case CORINFO_TYPE_REFANY:
217211
{
218212
CORINFO_CLASS_HANDLE clsHnd = comp->getArgClass(sig, argLst);
219213
// For some SIMD struct types we can get a nullptr back from eeGetArgClass on Linux/X64
@@ -243,11 +237,8 @@ void AppendMethodName(COMP_HANDLE comp,
243237
printer->Add(':');
244238
switch (retType)
245239
{
246-
case CORINFO_TYPE_STRING:
247240
case CORINFO_TYPE_CLASS:
248-
case CORINFO_TYPE_VAR:
249241
case CORINFO_TYPE_VALUECLASS:
250-
case CORINFO_TYPE_REFANY:
251242
{
252243
CORINFO_CLASS_HANDLE clsHnd = sig->retTypeClass;
253244
if (clsHnd != NO_CLASS_HANDLE)

src/coreclr/jit/compiler.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1725,10 +1725,6 @@ unsigned Compiler::compGetTypeSize(CorInfoType cit, CORINFO_CLASS_HANDLE clsHnd)
17251725
{
17261726
sigSize = info.compCompHnd->getClassSize(clsHnd);
17271727
}
1728-
else if (cit == CORINFO_TYPE_REFANY)
1729-
{
1730-
sigSize = 2 * TARGET_POINTER_SIZE;
1731-
}
17321728
return sigSize;
17331729
}
17341730

src/coreclr/jit/ee_il_dll.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,9 +401,6 @@ unsigned Compiler::eeGetArgSize(CorInfoType corInfoType, CORINFO_CLASS_HANDLE ty
401401
isHfa = (hfaType != TYP_UNDEF);
402402
unsigned structSize = info.compCompHnd->getClassSize(typeHnd);
403403

404-
// make certain the EE passes us back the right thing for refanys
405-
assert(corInfoType != CORINFO_TYPE_REFANY || structSize == 2 * TARGET_POINTER_SIZE);
406-
407404
// For each target that supports passing struct args in multiple registers
408405
// apply the target specific rules for them here:
409406

src/coreclr/jit/ee_il_dll.hpp

Lines changed: 9 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -213,25 +213,10 @@ inline var_types JITtype2varType(CorInfoType type)
213213
TYP_I_IMPL, // CORINFO_TYPE_NATIVEUINT = 0xd,
214214
TYP_FLOAT, // CORINFO_TYPE_FLOAT = 0xe,
215215
TYP_DOUBLE, // CORINFO_TYPE_DOUBLE = 0xf,
216-
TYP_REF, // CORINFO_TYPE_STRING = 0x10, // Not used, should remove
217-
TYP_I_IMPL, // CORINFO_TYPE_PTR = 0x11,
218-
TYP_BYREF, // CORINFO_TYPE_BYREF = 0x12,
219-
TYP_STRUCT, // CORINFO_TYPE_VALUECLASS = 0x13,
220-
TYP_REF, // CORINFO_TYPE_CLASS = 0x14,
221-
TYP_STRUCT, // CORINFO_TYPE_REFANY = 0x15,
222-
223-
// Generic type variables only appear when we're doing
224-
// verification of generic code, in which case we're running
225-
// in "import only" mode. Annoyingly the "import only"
226-
// mode of the JIT actually does a fair bit of compilation,
227-
// so we have to trick the compiler into thinking it's compiling
228-
// a real instantiation. We do that by just pretending we're
229-
// compiling the "object" instantiation of the code, i.e. by
230-
// turing all generic type variables refs, except for a few
231-
// choice places to do with verification, where we use
232-
// verification types and CLASS_HANDLEs to track the difference.
233-
234-
TYP_REF, // CORINFO_TYPE_VAR = 0x16,
216+
TYP_I_IMPL, // CORINFO_TYPE_PTR = 0x10,
217+
TYP_BYREF, // CORINFO_TYPE_BYREF = 0x11,
218+
TYP_STRUCT, // CORINFO_TYPE_VALUECLASS = 0x12,
219+
TYP_REF, // CORINFO_TYPE_CLASS = 0x13,
235220
};
236221

237222
// spot check to make certain enumerations have not changed
@@ -244,7 +229,6 @@ inline var_types JITtype2varType(CorInfoType type)
244229
assert(varTypeMap[CORINFO_TYPE_DOUBLE] == TYP_DOUBLE);
245230
assert(varTypeMap[CORINFO_TYPE_VOID] == TYP_VOID);
246231
assert(varTypeMap[CORINFO_TYPE_VALUECLASS] == TYP_STRUCT);
247-
assert(varTypeMap[CORINFO_TYPE_REFANY] == TYP_STRUCT);
248232

249233
assert(type < CORINFO_TYPE_COUNT);
250234
assert(varTypeMap[type] != TYP_UNDEF);
@@ -274,25 +258,11 @@ inline var_types JitType2PreciseVarType(CorInfoType type)
274258
TYP_U_IMPL, // CORINFO_TYPE_NATIVEUINT = 0xd,
275259
TYP_FLOAT, // CORINFO_TYPE_FLOAT = 0xe,
276260
TYP_DOUBLE, // CORINFO_TYPE_DOUBLE = 0xf,
277-
TYP_REF, // CORINFO_TYPE_STRING = 0x10, // Not used, should remove
278-
TYP_U_IMPL, // CORINFO_TYPE_PTR = 0x11,
279-
TYP_BYREF, // CORINFO_TYPE_BYREF = 0x12,
280-
TYP_STRUCT, // CORINFO_TYPE_VALUECLASS = 0x13,
281-
TYP_REF, // CORINFO_TYPE_CLASS = 0x14,
282-
TYP_STRUCT, // CORINFO_TYPE_REFANY = 0x15,
283-
284-
// Generic type variables only appear when we're doing
285-
// verification of generic code, in which case we're running
286-
// in "import only" mode. Annoyingly the "import only"
287-
// mode of the JIT actually does a fair bit of compilation,
288-
// so we have to trick the compiler into thinking it's compiling
289-
// a real instantiation. We do that by just pretending we're
290-
// compiling the "object" instantiation of the code, i.e. by
291-
// turing all generic type variables refs, except for a few
292-
// choice places to do with verification, where we use
293-
// verification types and CLASS_HANDLEs to track the difference.
294-
295-
TYP_REF, // CORINFO_TYPE_VAR = 0x16,
261+
TYP_U_IMPL, // CORINFO_TYPE_PTR = 0x10,
262+
TYP_BYREF, // CORINFO_TYPE_BYREF = 0x11,
263+
TYP_STRUCT, // CORINFO_TYPE_VALUECLASS = 0x12,
264+
TYP_REF, // CORINFO_TYPE_CLASS = 0x13,
265+
296266
};
297267

298268
// spot check to make certain enumerations have not changed
@@ -305,7 +275,6 @@ inline var_types JitType2PreciseVarType(CorInfoType type)
305275
assert(preciseVarTypeMap[CORINFO_TYPE_DOUBLE] == TYP_DOUBLE);
306276
assert(preciseVarTypeMap[CORINFO_TYPE_VOID] == TYP_VOID);
307277
assert(preciseVarTypeMap[CORINFO_TYPE_VALUECLASS] == TYP_STRUCT);
308-
assert(preciseVarTypeMap[CORINFO_TYPE_REFANY] == TYP_STRUCT);
309278

310279
assert(type < CORINFO_TYPE_COUNT);
311280
assert(preciseVarTypeMap[type] != TYP_UNDEF);

src/coreclr/jit/eeinterface.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,10 @@ void Compiler::eePrintCorInfoType(StringPrinter* printer, CorInfoType corInfoTyp
9292
{
9393
static const char* preciseVarTypeMap[CORINFO_TYPE_COUNT] = {// see the definition of enum CorInfoType in file
9494
// inc/corinfo.h
95-
"<UNDEF>", "void", "bool", "char", "sbyte",
96-
"byte", "short", "ushort", "int", "uint",
97-
"long", "ulong", "nint", "nuint", "float",
98-
"double", "string", "ptr", "byref", "struct",
99-
"class", "typedbyref", "var"};
95+
"<UNDEF>", "void", "bool", "char", "sbyte",
96+
"byte", "short", "ushort", "int", "uint",
97+
"long", "ulong", "nint", "nuint", "float",
98+
"double", "ptr", "byref", "struct", "class"};
10099

101100
const char* corInfoTypeName = "CORINFO_TYPE_INVALID";
102101
if (corInfoType >= 0 && corInfoType < CORINFO_TYPE_COUNT)

src/coreclr/jit/importer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2631,7 +2631,7 @@ bool Compiler::checkTailCallConstraint(OPCODE opcode,
26312631
// Disallow the tailcall for this kind.
26322632
CORINFO_CLASS_HANDLE classHandle;
26332633
CorInfoType ciType = strip(info.compCompHnd->getArgType(&sig, args, &classHandle));
2634-
if ((ciType == CORINFO_TYPE_PTR) || (ciType == CORINFO_TYPE_BYREF) || (ciType == CORINFO_TYPE_REFANY))
2634+
if ((ciType == CORINFO_TYPE_PTR) || (ciType == CORINFO_TYPE_BYREF))
26352635
{
26362636
return false;
26372637
}

src/coreclr/jit/importercalls.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -636,8 +636,7 @@ var_types Compiler::impImportCall(OPCODE opcode,
636636
if (sig->retTypeSigClass != actualMethodRetTypeSigClass)
637637
{
638638
if (actualMethodRetTypeSigClass != nullptr && sig->retType != CORINFO_TYPE_CLASS &&
639-
sig->retType != CORINFO_TYPE_BYREF && sig->retType != CORINFO_TYPE_PTR &&
640-
sig->retType != CORINFO_TYPE_VAR)
639+
sig->retType != CORINFO_TYPE_BYREF && sig->retType != CORINFO_TYPE_PTR)
641640
{
642641
// Make sure that all valuetypes (including enums) that we push are loaded.
643642
// This is to guarantee that if a GC is triggered from the prestub of this methods,
@@ -6554,7 +6553,7 @@ void Compiler::impPopCallArgs(CORINFO_SIG_INFO* sig, GenTreeCall* call)
65546553
params[i].CorType = strip(info.compCompHnd->getArgType(sig, sigArg, &params[i].ClassHandle));
65556554

65566555
if (params[i].CorType != CORINFO_TYPE_CLASS && params[i].CorType != CORINFO_TYPE_BYREF &&
6557-
params[i].CorType != CORINFO_TYPE_PTR && params[i].CorType != CORINFO_TYPE_VAR)
6556+
params[i].CorType != CORINFO_TYPE_PTR)
65586557
{
65596558
CORINFO_CLASS_HANDLE argRealClass = info.compCompHnd->getArgClass(sig, sigArg);
65606559
if (argRealClass != nullptr)
@@ -6572,8 +6571,7 @@ void Compiler::impPopCallArgs(CORINFO_SIG_INFO* sig, GenTreeCall* call)
65726571
}
65736572

65746573
if ((sig->retTypeSigClass != nullptr) && (sig->retType != CORINFO_TYPE_CLASS) &&
6575-
(sig->retType != CORINFO_TYPE_BYREF) && (sig->retType != CORINFO_TYPE_PTR) &&
6576-
(sig->retType != CORINFO_TYPE_VAR))
6574+
(sig->retType != CORINFO_TYPE_BYREF) && (sig->retType != CORINFO_TYPE_PTR))
65776575
{
65786576
// Make sure that all valuetypes (including enums) that we push are loaded.
65796577
// This is to guarantee that if a GC is triggered from the prestub of this methods,

0 commit comments

Comments
 (0)