diff options
author | Jan Kotas <jkotas@microsoft.com> | 2018-06-26 22:38:42 -0700 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2018-06-26 22:38:42 -0700 |
commit | 51cdf2c39d6064f6fbc7805f10f09149b0b85970 (patch) | |
tree | 06f1010aea55514d50051eedea04f08e630610b1 | |
parent | d1d26ac8fd6aabbfe655de03bf0ee3ecb2d096cd (diff) | |
download | coreclr-51cdf2c39d6064f6fbc7805f10f09149b0b85970.tar.gz coreclr-51cdf2c39d6064f6fbc7805f10f09149b0b85970.tar.bz2 coreclr-51cdf2c39d6064f6fbc7805f10f09149b0b85970.zip |
Add VM support for Unsafe.AsRef(in T)
-rw-r--r-- | src/vm/jitinterface.cpp | 3 | ||||
-rw-r--r-- | src/vm/metasig.h | 2 | ||||
-rw-r--r-- | src/vm/mscorlib.h | 3 |
3 files changed, 6 insertions, 2 deletions
diff --git a/src/vm/jitinterface.cpp b/src/vm/jitinterface.cpp index ccd99df9ac..c532f201d4 100644 --- a/src/vm/jitinterface.cpp +++ b/src/vm/jitinterface.cpp @@ -7047,7 +7047,8 @@ bool getILIntrinsicImplementationForUnsafe(MethodDesc * ftn, } else if (tk == MscorlibBinder::GetMethod(METHOD__UNSAFE__BYREF_AS)->GetMemberDef() || tk == MscorlibBinder::GetMethod(METHOD__UNSAFE__OBJECT_AS)->GetMemberDef() || - tk == MscorlibBinder::GetMethod(METHOD__UNSAFE__AS_REF)->GetMemberDef()) + tk == MscorlibBinder::GetMethod(METHOD__UNSAFE__AS_REF_POINTER)->GetMemberDef() || + tk == MscorlibBinder::GetMethod(METHOD__UNSAFE__AS_REF_IN)->GetMemberDef()) { // Return the argument that was passed in. static const BYTE ilcode[] = { CEE_LDARG_0, CEE_RET }; diff --git a/src/vm/metasig.h b/src/vm/metasig.h index 49e26f17e9..b3a4139a7c 100644 --- a/src/vm/metasig.h +++ b/src/vm/metasig.h @@ -290,6 +290,8 @@ DEFINE_METASIG(GM(RefByte_T_RetVoid, IMAGE_CEE_CS_CALLCONV_DEFAULT, 1, r(b) M(0) DEFINE_METASIG(GM(PtrVoid_RetT, IMAGE_CEE_CS_CALLCONV_DEFAULT, 1, P(v), M(0))) DEFINE_METASIG(GM(PtrVoid_T_RetVoid, IMAGE_CEE_CS_CALLCONV_DEFAULT, 1, P(v) M(0), v)) +DEFINE_METASIG(GM(RefT_RetRefT, IMAGE_CEE_CS_CALLCONV_DEFAULT, 1, r(M(0)), r(M(0)))) +DEFINE_METASIG(GM(VoidPtr_RetRefT, IMAGE_CEE_CS_CALLCONV_DEFAULT, 1, P(v), r(M(0)))) DEFINE_METASIG(GM(RefTFrom_RetRefTTo, IMAGE_CEE_CS_CALLCONV_DEFAULT, 2, r(M(0)), r(M(1)))) DEFINE_METASIG(GM(Obj_RetT, IMAGE_CEE_CS_CALLCONV_DEFAULT, 1, j, M(0))) DEFINE_METASIG(GM(RefT_Int_RetRefT, IMAGE_CEE_CS_CALLCONV_DEFAULT, 1, r(M(0)) i, r(M(0)))) diff --git a/src/vm/mscorlib.h b/src/vm/mscorlib.h index c9715e1396..c57290ff12 100644 --- a/src/vm/mscorlib.h +++ b/src/vm/mscorlib.h @@ -775,7 +775,8 @@ DEFINE_METHOD(JIT_HELPERS, GET_RAW_SZ_ARRAY_DATA, GetRawSzArrayData, N DEFINE_CLASS(UNSAFE, InternalCompilerServices, Unsafe) DEFINE_METHOD(UNSAFE, AS_POINTER, AsPointer, NoSig) -DEFINE_METHOD(UNSAFE, AS_REF, AsRef, NoSig) +DEFINE_METHOD(UNSAFE, AS_REF_IN, AsRef, GM_RefT_RetRefT) +DEFINE_METHOD(UNSAFE, AS_REF_POINTER, AsRef, GM_VoidPtr_RetRefT) DEFINE_METHOD(UNSAFE, SIZEOF, SizeOf, NoSig) DEFINE_METHOD(UNSAFE, BYREF_AS, As, GM_RefTFrom_RetRefTTo) DEFINE_METHOD(UNSAFE, OBJECT_AS, As, GM_Obj_RetT) |