diff options
author | Jan Kotas <jkotas@microsoft.com> | 2016-12-07 15:16:57 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-07 15:16:57 -0800 |
commit | 64c2ad17351ac5bc0bb042216bfcbf1c5136d7cf (patch) | |
tree | bbbec792192a88f2afe1e126f0ca4d0050348e32 /src/vm/jitinterface.cpp | |
parent | bea2a8cf3d1ffe90683c47758f27f7cc83850982 (diff) | |
download | coreclr-64c2ad17351ac5bc0bb042216bfcbf1c5136d7cf.tar.gz coreclr-64c2ad17351ac5bc0bb042216bfcbf1c5136d7cf.tar.bz2 coreclr-64c2ad17351ac5bc0bb042216bfcbf1c5136d7cf.zip |
Refactor Span<T> to ease implementation of JIT intrinsics (#8497)
- Introduce internal ByReference<T> type for byref fields and change Span to use it
- Generalize handling of byref-like types in the type loader
- Make DangerousGetPinnableReference public while I was on it
Diffstat (limited to 'src/vm/jitinterface.cpp')
-rw-r--r-- | src/vm/jitinterface.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/vm/jitinterface.cpp b/src/vm/jitinterface.cpp index fac4cb44f2..cebd410347 100644 --- a/src/vm/jitinterface.cpp +++ b/src/vm/jitinterface.cpp @@ -2303,13 +2303,9 @@ unsigned CEEInfo::getClassGClayout (CORINFO_CLASS_HANDLE clsHnd, BYTE* gcPtrs) MethodTable* pMT = VMClsHnd.GetMethodTable(); - if (pMT == g_TypedReferenceMT) // if (pMT->IsByRefLike()) // TODO-SPAN: Proper GC reporting + if (pMT->IsByRefLike()) { - if (pMT == g_TypedReferenceMT -#ifdef FEATURE_SPAN_OF_T - || pMT->HasSameTypeDefAs(g_pSpanClass) || pMT->HasSameTypeDefAs(g_pReadOnlySpanClass) -#endif - ) + if (pMT == g_TypedReferenceMT) { gcPtrs[0] = TYPE_GC_BYREF; gcPtrs[1] = TYPE_GC_NONE; @@ -2317,6 +2313,9 @@ unsigned CEEInfo::getClassGClayout (CORINFO_CLASS_HANDLE clsHnd, BYTE* gcPtrs) } else { + // TODO-SPAN: Proper GC reporting + memset(gcPtrs, TYPE_GC_NONE, + (VMClsHnd.GetSize() + sizeof(void*) -1)/ sizeof(void*)); result = 0; } } @@ -7034,7 +7033,9 @@ bool getILIntrinsicImplementationForUnsafe(MethodDesc * ftn, methInfo->options = (CorInfoOptions)0; return true; } - else if (tk == MscorlibBinder::GetMethod(METHOD__UNSAFE__BYREF_AS)->GetMemberDef()) + else if ((tk == MscorlibBinder::GetMethod(METHOD__UNSAFE__AS_REF)->GetMemberDef()) || + (tk == MscorlibBinder::GetMethod(METHOD__UNSAFE__BYREF_AS)->GetMemberDef())) + { // Return the argument that was passed in. static const BYTE ilcode[] = { CEE_LDARG_0, CEE_RET }; |