diff --git a/src/coreclr/inc/jiteeversionguid.h b/src/coreclr/inc/jiteeversionguid.h index cda748635c721e..5e6a2ef98993e2 100644 --- a/src/coreclr/inc/jiteeversionguid.h +++ b/src/coreclr/inc/jiteeversionguid.h @@ -16,7 +16,7 @@ // Note that this file is parsed by some tools, namely superpmi.py, so make sure the first line is exactly // of the form: // -// constexpr GUID JITEEVersionIdentifier = { /* a7bb194e-4e7c-4850-af12-ea9f30ea5a13 */ +// constexpr GUID JITEEVersionIdentifier = { /* 1776ab48-edfa-49be-a11f-ec216b28174c */ // // (without the leading slashes or spaces). // @@ -43,11 +43,11 @@ typedef const GUID *LPCGUID; #define GUID_DEFINED #endif // !GUID_DEFINED -constexpr GUID JITEEVersionIdentifier = { /* a1f5e9a1-ee44-42f9-9319-e2a2dbf8c5c9 */ - 0xa1f5e9a1, - 0xee44, - 0x42f9, - {0x93, 0x19, 0xe2, 0xa2, 0xdb, 0xf8, 0xc5, 0xc9} +constexpr GUID JITEEVersionIdentifier = { /* 1776ab48-edfa-49be-a11f-ec216b28174c */ + 0x1776ab48, + 0xedfa, + 0x49be, + {0xa1, 0x1f, 0xec, 0x21, 0x6b, 0x28, 0x17, 0x4c} }; ////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/coreclr/jit/importer.cpp b/src/coreclr/jit/importer.cpp index 56a341b3fdd1d9..a15d20afc1ff78 100644 --- a/src/coreclr/jit/importer.cpp +++ b/src/coreclr/jit/importer.cpp @@ -16998,9 +16998,10 @@ bool Compiler::impReturnInstruction(int prefixFlags, OPCODE& opcode) impBashVarAddrsToI(op2); op2 = impImplicitIorI4Cast(op2, info.compRetType); op2 = impImplicitR4orR8Cast(op2, info.compRetType); + // Note that we allow TYP_I_IMPL<->TYP_BYREF transformation, but only TYP_I_IMPL<-TYP_REF. assertImp((genActualType(op2->TypeGet()) == genActualType(info.compRetType)) || - ((op2->TypeGet() == TYP_I_IMPL) && (info.compRetType == TYP_BYREF)) || - ((op2->TypeGet() == TYP_BYREF) && (info.compRetType == TYP_I_IMPL)) || + ((op2->TypeGet() == TYP_I_IMPL) && TypeIs(info.compRetType, TYP_BYREF)) || + (op2->TypeIs(TYP_BYREF, TYP_REF) && (info.compRetType == TYP_I_IMPL)) || (varTypeIsFloating(op2->gtType) && varTypeIsFloating(info.compRetType)) || (varTypeIsStruct(op2) && varTypeIsStruct(info.compRetType))); @@ -17049,9 +17050,10 @@ bool Compiler::impReturnInstruction(int prefixFlags, OPCODE& opcode) if (returnType != originalCallType) { - // Allow TYP_BYREF to be returned as TYP_I_IMPL and vice versa - if (((returnType == TYP_BYREF) && (originalCallType == TYP_I_IMPL)) || - ((returnType == TYP_I_IMPL) && (originalCallType == TYP_BYREF))) + // Allow TYP_BYREF to be returned as TYP_I_IMPL and vice versa. + // Allow TYP_REF to be returned as TYP_I_IMPL and NOT vice verse. + if ((TypeIs(returnType, TYP_BYREF, TYP_REF) && (originalCallType == TYP_I_IMPL)) || + ((returnType == TYP_I_IMPL) && TypeIs(originalCallType, TYP_BYREF))) { JITDUMP("Allowing return type mismatch: have %s, needed %s\n", varTypeName(returnType), varTypeName(originalCallType)); diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs index d99c51d236950c..22f9c309f9bce5 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs @@ -1579,8 +1579,7 @@ private int appendClassName(char** ppBuf, ref int pnBufLen, CORINFO_CLASS_STRUCT private bool isValueClass(CORINFO_CLASS_STRUCT_* cls) { - TypeDesc type = HandleToObject(cls); - return type.IsValueType || type.IsPointer || type.IsFunctionPointer; + return HandleToObject(cls).IsValueType; } private CorInfoInlineTypeCheck canInlineTypeCheck(CORINFO_CLASS_STRUCT_* cls, CorInfoInlineTypeCheckSource source) @@ -1602,10 +1601,6 @@ private uint getClassAttribsInternal(TypeDesc type) CorInfoFlag result = (CorInfoFlag)0; - // CoreCLR uses UIntPtr in place of pointers here - if (type.IsPointer || type.IsFunctionPointer) - type = _compilation.TypeSystemContext.GetWellKnownType(WellKnownType.UIntPtr); - var metadataType = type as MetadataType; // The array flag is used to identify the faked-up methods on diff --git a/src/coreclr/vm/jitinterface.cpp b/src/coreclr/vm/jitinterface.cpp index 2423c4887d61e5..dc8bdb96db7c94 100644 --- a/src/coreclr/vm/jitinterface.cpp +++ b/src/coreclr/vm/jitinterface.cpp @@ -3772,11 +3772,7 @@ bool CEEInfo::isValueClass(CORINFO_CLASS_HANDLE clsHnd) _ASSERTE(clsHnd); - // Note that clsHnd.IsValueType() would not return what the JIT expects - // for corner cases like ELEMENT_TYPE_FNPTR - TypeHandle VMClsHnd(clsHnd); - MethodTable * pMT = VMClsHnd.GetMethodTable(); - ret = (pMT != NULL) ? pMT->IsValueType() : false; + ret = TypeHandle(clsHnd).IsValueType(); EE_TO_JIT_TRANSITION_LEAF(); @@ -3888,7 +3884,7 @@ uint32_t CEEInfo::getClassAttribsInternal (CORINFO_CLASS_HANDLE clsHnd) if (pMT->HasComponentSize()) ret |= CORINFO_FLG_VAROBJSIZE; - if (pMT->IsValueType()) + if (VMClsHnd.IsValueType()) { ret |= CORINFO_FLG_VALUECLASS;