Skip to content
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions src/coreclr/inc/corinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -612,20 +612,11 @@ enum CorInfoType
CORINFO_TYPE_NATIVEUINT = 0xd,
CORINFO_TYPE_FLOAT = 0xe,
CORINFO_TYPE_DOUBLE = 0xf,
CORINFO_TYPE_STRING = 0x10, // Not used, should remove
CORINFO_TYPE_PTR = 0x11,
CORINFO_TYPE_BYREF = 0x12,
CORINFO_TYPE_VALUECLASS = 0x13,
CORINFO_TYPE_CLASS = 0x14,
CORINFO_TYPE_REFANY = 0x15,

// CORINFO_TYPE_VAR is for a generic type variable.
// Generic type variables only appear when the JIT is doing
// verification (not NOT compilation) of generic code
// for the EE, in which case we're running
// the JIT in "import only" mode.

CORINFO_TYPE_VAR = 0x16,
CORINFO_TYPE_PTR = 0x10,
CORINFO_TYPE_BYREF = 0x11,
CORINFO_TYPE_VALUECLASS = 0x12,
CORINFO_TYPE_CLASS = 0x13,

CORINFO_TYPE_COUNT, // number of jit types
};

Expand Down
10 changes: 5 additions & 5 deletions src/coreclr/inc/jiteeversionguid.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@

#include <minipal/guid.h>

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

#endif // JIT_EE_VERSIONING_GUID_H
9 changes: 0 additions & 9 deletions src/coreclr/interpreter/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2348,15 +2348,13 @@ static InterpType GetInterpType(CorInfoType corInfoType)
return InterpTypeR4;
case CORINFO_TYPE_DOUBLE:
return InterpTypeR8;
case CORINFO_TYPE_STRING:
case CORINFO_TYPE_CLASS:
return InterpTypeO;
case CORINFO_TYPE_PTR:
return InterpTypeI;
case CORINFO_TYPE_BYREF:
return InterpTypeByRef;
case CORINFO_TYPE_VALUECLASS:
case CORINFO_TYPE_REFANY:
return InterpTypeVT;
case CORINFO_TYPE_VOID:
return InterpTypeVoid;
Expand Down Expand Up @@ -6151,7 +6149,6 @@ void InterpCompiler::EmitSuspend(const CORINFO_CALL_INFO &callInfo, Continuation
suspendData->asyncMethodReturnType = m_methodInfo->args.retTypeClass;
suspendData->asyncMethodReturnTypePrimitiveSize = 0;
Comment thread
jkotas marked this conversation as resolved.
Comment thread
jkotas marked this conversation as resolved.
Comment thread
jkotas marked this conversation as resolved.
break;
case CORINFO_TYPE_STRING:
case CORINFO_TYPE_CLASS:
suspendData->asyncMethodReturnType = m_compHnd->getBuiltinClass(CLASSID_SYSTEM_OBJECT);
suspendData->asyncMethodReturnTypePrimitiveSize = 0;
Expand Down Expand Up @@ -6199,13 +6196,7 @@ void InterpCompiler::EmitSuspend(const CORINFO_CALL_INFO &callInfo, Continuation
case CORINFO_TYPE_PTR:
suspendData->asyncMethodReturnTypePrimitiveSize = sizeof(void*);
break;
case CORINFO_TYPE_REFANY:
BADCODE("TypedReference return types not supported for async methods");
break;

case CORINFO_TYPE_VAR:
BADCODE("VAR return types should have been translated before we get here on async methods");
break;
default:
// Other types are not supported
BADCODE("Unsupported async method return type");
Expand Down
11 changes: 1 addition & 10 deletions src/coreclr/interpreter/naming.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,10 @@ void AppendCorInfoType(TArray<char, MallocAllocator>* printer, CorInfoType corIn
"nuint",
"float",
"double",
"string",
"ptr",
"byref",
"struct",
"class",
"typedbyref",
"var"
"class"
};

const char *corInfoTypeName = "CORINFO_TYPE_INVALID";
Expand Down Expand Up @@ -209,11 +206,8 @@ void AppendMethodName(COMP_HANDLE comp,
CorInfoType type = strip(withMod);
switch (type)
{
case CORINFO_TYPE_STRING:
case CORINFO_TYPE_CLASS:
case CORINFO_TYPE_VAR:
case CORINFO_TYPE_VALUECLASS:
case CORINFO_TYPE_REFANY:
{
CORINFO_CLASS_HANDLE clsHnd = comp->getArgClass(sig, argLst);
// For some SIMD struct types we can get a nullptr back from eeGetArgClass on Linux/X64
Expand Down Expand Up @@ -243,11 +237,8 @@ void AppendMethodName(COMP_HANDLE comp,
printer->Add(':');
switch (retType)
{
case CORINFO_TYPE_STRING:
case CORINFO_TYPE_CLASS:
case CORINFO_TYPE_VAR:
case CORINFO_TYPE_VALUECLASS:
case CORINFO_TYPE_REFANY:
{
CORINFO_CLASS_HANDLE clsHnd = sig->retTypeClass;
if (clsHnd != NO_CLASS_HANDLE)
Expand Down
4 changes: 0 additions & 4 deletions src/coreclr/jit/compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1725,10 +1725,6 @@ unsigned Compiler::compGetTypeSize(CorInfoType cit, CORINFO_CLASS_HANDLE clsHnd)
{
sigSize = info.compCompHnd->getClassSize(clsHnd);
}
else if (cit == CORINFO_TYPE_REFANY)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JIT handles TypedReference as a regular byref-like type. We do not need to special case it in the CORINFO_TYPE_... enum.

{
sigSize = 2 * TARGET_POINTER_SIZE;
}
return sigSize;
}

Expand Down
3 changes: 0 additions & 3 deletions src/coreclr/jit/ee_il_dll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,9 +401,6 @@ unsigned Compiler::eeGetArgSize(CorInfoType corInfoType, CORINFO_CLASS_HANDLE ty
isHfa = (hfaType != TYP_UNDEF);
unsigned structSize = info.compCompHnd->getClassSize(typeHnd);

// make certain the EE passes us back the right thing for refanys
assert(corInfoType != CORINFO_TYPE_REFANY || structSize == 2 * TARGET_POINTER_SIZE);

// For each target that supports passing struct args in multiple registers
// apply the target specific rules for them here:

Expand Down
50 changes: 10 additions & 40 deletions src/coreclr/jit/ee_il_dll.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,25 +213,11 @@ inline var_types JITtype2varType(CorInfoType type)
TYP_I_IMPL, // CORINFO_TYPE_NATIVEUINT = 0xd,
TYP_FLOAT, // CORINFO_TYPE_FLOAT = 0xe,
TYP_DOUBLE, // CORINFO_TYPE_DOUBLE = 0xf,
TYP_REF, // CORINFO_TYPE_STRING = 0x10, // Not used, should remove
TYP_I_IMPL, // CORINFO_TYPE_PTR = 0x11,
TYP_BYREF, // CORINFO_TYPE_BYREF = 0x12,
TYP_STRUCT, // CORINFO_TYPE_VALUECLASS = 0x13,
TYP_REF, // CORINFO_TYPE_CLASS = 0x14,
TYP_STRUCT, // CORINFO_TYPE_REFANY = 0x15,

// Generic type variables only appear when we're doing
// verification of generic code, in which case we're running
// in "import only" mode. Annoyingly the "import only"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not have import only mode in the JIT for verification anymore.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in e239d06: I removed the obsolete import-only/verification comment block in ee_il_dll.hpp along with the CORINFO_TYPE_VAR mapping cleanup.

// mode of the JIT actually does a fair bit of compilation,
// so we have to trick the compiler into thinking it's compiling
// a real instantiation. We do that by just pretending we're
// compiling the "object" instantiation of the code, i.e. by
// turing all generic type variables refs, except for a few
// choice places to do with verification, where we use
// verification types and CLASS_HANDLEs to track the difference.

TYP_REF, // CORINFO_TYPE_VAR = 0x16,
TYP_I_IMPL, // CORINFO_TYPE_PTR = 0x10,
TYP_BYREF, // CORINFO_TYPE_BYREF = 0x11,
TYP_STRUCT, // CORINFO_TYPE_VALUECLASS = 0x12,
TYP_REF, // CORINFO_TYPE_CLASS = 0x13,

Comment thread
jkotas marked this conversation as resolved.
Outdated
};

// spot check to make certain enumerations have not changed
Expand All @@ -244,7 +230,6 @@ inline var_types JITtype2varType(CorInfoType type)
assert(varTypeMap[CORINFO_TYPE_DOUBLE] == TYP_DOUBLE);
assert(varTypeMap[CORINFO_TYPE_VOID] == TYP_VOID);
assert(varTypeMap[CORINFO_TYPE_VALUECLASS] == TYP_STRUCT);
assert(varTypeMap[CORINFO_TYPE_REFANY] == TYP_STRUCT);

assert(type < CORINFO_TYPE_COUNT);
assert(varTypeMap[type] != TYP_UNDEF);
Expand Down Expand Up @@ -274,25 +259,11 @@ inline var_types JitType2PreciseVarType(CorInfoType type)
TYP_U_IMPL, // CORINFO_TYPE_NATIVEUINT = 0xd,
TYP_FLOAT, // CORINFO_TYPE_FLOAT = 0xe,
TYP_DOUBLE, // CORINFO_TYPE_DOUBLE = 0xf,
TYP_REF, // CORINFO_TYPE_STRING = 0x10, // Not used, should remove
TYP_U_IMPL, // CORINFO_TYPE_PTR = 0x11,
TYP_BYREF, // CORINFO_TYPE_BYREF = 0x12,
TYP_STRUCT, // CORINFO_TYPE_VALUECLASS = 0x13,
TYP_REF, // CORINFO_TYPE_CLASS = 0x14,
TYP_STRUCT, // CORINFO_TYPE_REFANY = 0x15,

// Generic type variables only appear when we're doing
// verification of generic code, in which case we're running
// in "import only" mode. Annoyingly the "import only"
// mode of the JIT actually does a fair bit of compilation,
// so we have to trick the compiler into thinking it's compiling
// a real instantiation. We do that by just pretending we're
// compiling the "object" instantiation of the code, i.e. by
// turing all generic type variables refs, except for a few
// choice places to do with verification, where we use
// verification types and CLASS_HANDLEs to track the difference.

TYP_REF, // CORINFO_TYPE_VAR = 0x16,
TYP_U_IMPL, // CORINFO_TYPE_PTR = 0x10,
TYP_BYREF, // CORINFO_TYPE_BYREF = 0x11,
TYP_STRUCT, // CORINFO_TYPE_VALUECLASS = 0x12,
TYP_REF, // CORINFO_TYPE_CLASS = 0x13,

};

// spot check to make certain enumerations have not changed
Expand All @@ -305,7 +276,6 @@ inline var_types JitType2PreciseVarType(CorInfoType type)
assert(preciseVarTypeMap[CORINFO_TYPE_DOUBLE] == TYP_DOUBLE);
assert(preciseVarTypeMap[CORINFO_TYPE_VOID] == TYP_VOID);
assert(preciseVarTypeMap[CORINFO_TYPE_VALUECLASS] == TYP_STRUCT);
assert(preciseVarTypeMap[CORINFO_TYPE_REFANY] == TYP_STRUCT);

assert(type < CORINFO_TYPE_COUNT);
assert(preciseVarTypeMap[type] != TYP_UNDEF);
Expand Down
9 changes: 4 additions & 5 deletions src/coreclr/jit/eeinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,10 @@ void Compiler::eePrintCorInfoType(StringPrinter* printer, CorInfoType corInfoTyp
{
static const char* preciseVarTypeMap[CORINFO_TYPE_COUNT] = {// see the definition of enum CorInfoType in file
// inc/corinfo.h
"<UNDEF>", "void", "bool", "char", "sbyte",
"byte", "short", "ushort", "int", "uint",
"long", "ulong", "nint", "nuint", "float",
"double", "string", "ptr", "byref", "struct",
"class", "typedbyref", "var"};
"<UNDEF>", "void", "bool", "char", "sbyte",
"byte", "short", "ushort", "int", "uint",
"long", "ulong", "nint", "nuint", "float",
"double", "ptr", "byref", "struct", "class"};

const char* corInfoTypeName = "CORINFO_TYPE_INVALID";
if (corInfoType >= 0 && corInfoType < CORINFO_TYPE_COUNT)
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/jit/importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2631,7 +2631,7 @@ bool Compiler::checkTailCallConstraint(OPCODE opcode,
// Disallow the tailcall for this kind.
CORINFO_CLASS_HANDLE classHandle;
CorInfoType ciType = strip(info.compCompHnd->getArgType(&sig, args, &classHandle));
if ((ciType == CORINFO_TYPE_PTR) || (ciType == CORINFO_TYPE_BYREF) || (ciType == CORINFO_TYPE_REFANY))
if ((ciType == CORINFO_TYPE_PTR) || (ciType == CORINFO_TYPE_BYREF))
{
return false;
}
Expand Down
8 changes: 3 additions & 5 deletions src/coreclr/jit/importercalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -636,8 +636,7 @@ var_types Compiler::impImportCall(OPCODE opcode,
if (sig->retTypeSigClass != actualMethodRetTypeSigClass)
{
if (actualMethodRetTypeSigClass != nullptr && sig->retType != CORINFO_TYPE_CLASS &&
sig->retType != CORINFO_TYPE_BYREF && sig->retType != CORINFO_TYPE_PTR &&
sig->retType != CORINFO_TYPE_VAR)
sig->retType != CORINFO_TYPE_BYREF && sig->retType != CORINFO_TYPE_PTR)
{
// Make sure that all valuetypes (including enums) that we push are loaded.
// This is to guarantee that if a GC is triggered from the prestub of this methods,
Expand Down Expand Up @@ -6554,7 +6553,7 @@ void Compiler::impPopCallArgs(CORINFO_SIG_INFO* sig, GenTreeCall* call)
params[i].CorType = strip(info.compCompHnd->getArgType(sig, sigArg, &params[i].ClassHandle));

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

if ((sig->retTypeSigClass != nullptr) && (sig->retType != CORINFO_TYPE_CLASS) &&
(sig->retType != CORINFO_TYPE_BYREF) && (sig->retType != CORINFO_TYPE_PTR) &&
(sig->retType != CORINFO_TYPE_VAR))
(sig->retType != CORINFO_TYPE_BYREF) && (sig->retType != CORINFO_TYPE_PTR))
{
// Make sure that all valuetypes (including enums) that we push are loaded.
// This is to guarantee that if a GC is triggered from the prestub of this methods,
Expand Down
3 changes: 0 additions & 3 deletions src/coreclr/jit/lclvars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -871,9 +871,6 @@ void Compiler::lvaInitVarDsc(LclVarDsc* varDsc,
case CORINFO_TYPE_PTR:
case CORINFO_TYPE_BYREF:
case CORINFO_TYPE_CLASS:
case CORINFO_TYPE_STRING:
case CORINFO_TYPE_VAR:
case CORINFO_TYPE_REFANY:
varDsc->lvIsPtr = 1;
break;
Comment thread
jkotas marked this conversation as resolved.
Comment thread
jkotas marked this conversation as resolved.
Comment thread
jkotas marked this conversation as resolved.
default:
Expand Down
19 changes: 5 additions & 14 deletions src/coreclr/tools/Common/JitInterface/CorInfoTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -729,20 +729,11 @@ public enum CorInfoType
CORINFO_TYPE_NATIVEUINT = 0xd,
CORINFO_TYPE_FLOAT = 0xe,
CORINFO_TYPE_DOUBLE = 0xf,
CORINFO_TYPE_STRING = 0x10, // Not used, should remove
CORINFO_TYPE_PTR = 0x11,
CORINFO_TYPE_BYREF = 0x12,
CORINFO_TYPE_VALUECLASS = 0x13,
CORINFO_TYPE_CLASS = 0x14,
CORINFO_TYPE_REFANY = 0x15,

// CORINFO_TYPE_VAR is for a generic type variable.
// Generic type variables only appear when the JIT is doing
// verification (not NOT compilation) of generic code
// for the EE, in which case we're running
// the JIT in "import only" mode.

CORINFO_TYPE_VAR = 0x16,
CORINFO_TYPE_PTR = 0x10,
CORINFO_TYPE_BYREF = 0x11,
CORINFO_TYPE_VALUECLASS = 0x12,
CORINFO_TYPE_CLASS = 0x13,

CORINFO_TYPE_COUNT, // number of jit types
}

Expand Down
7 changes: 0 additions & 7 deletions src/coreclr/tools/superpmi/mcs/verbildump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ void DumpPrimToConsoleBare(MethodContext* mc, CorInfoType prim, DWORDLONG classH
case CORINFO_TYPE_DOUBLE:
printf("float64");
return;
// case CORINFO_TYPE_STRING: printf("string"); return;
case CORINFO_TYPE_PTR:
printf("ptr");
return;
Expand Down Expand Up @@ -95,12 +94,6 @@ void DumpPrimToConsoleBare(MethodContext* mc, CorInfoType prim, DWORDLONG classH

return;
}
Comment thread
jkotas marked this conversation as resolved.
case CORINFO_TYPE_REFANY:
printf("refany");
return;
case CORINFO_TYPE_VAR:
printf("var");
return;
default:
LogWarning("unknown type in PrimToString(0x%x)", prim);
DEBUG_BREAK;
Expand Down
12 changes: 2 additions & 10 deletions src/coreclr/tools/superpmi/superpmi-shared/methodcontext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -576,20 +576,14 @@ const char* toString(CorInfoType cit)
return "float";
case CORINFO_TYPE_DOUBLE:
return "double";
case CORINFO_TYPE_STRING:
return "string";
case CORINFO_TYPE_CLASS:
return "class";
case CORINFO_TYPE_PTR:
return "ptr";
case CORINFO_TYPE_BYREF:
return "byref";
case CORINFO_TYPE_VALUECLASS:
return "valueclass";
case CORINFO_TYPE_CLASS:
return "class";
case CORINFO_TYPE_REFANY:
return "refany";
case CORINFO_TYPE_VAR:
return "var";
default:
return "UNKNOWN";
}
Expand Down Expand Up @@ -641,9 +635,7 @@ unsigned int toCorInfoSize(CorInfoType cit)
case CORINFO_TYPE_CLASS:
return (int)SpmiTargetPointerSize();

case CORINFO_TYPE_STRING:
case CORINFO_TYPE_VALUECLASS:
case CORINFO_TYPE_REFANY:
case CORINFO_TYPE_UNDEF:
case CORINFO_TYPE_VOID:
default:
Expand Down
Loading
Loading