summaryrefslogtreecommitdiff
path: root/src/vm/jitinterface.cpp
diff options
context:
space:
mode:
authorJan Kotas <jkotas@microsoft.com>2018-12-20 07:10:07 -0800
committerGitHub <noreply@github.com>2018-12-20 07:10:07 -0800
commitb0f325989d84c0ea429f24250e6ee1c6fd1a50a7 (patch)
tree0068af0090cddebc54a9b3efc00cff742cb4b368 /src/vm/jitinterface.cpp
parent4cc0a9a55d283e44205bf842a68657280bdabcd5 (diff)
downloadcoreclr-b0f325989d84c0ea429f24250e6ee1c6fd1a50a7.tar.gz
coreclr-b0f325989d84c0ea429f24250e6ee1c6fd1a50a7.tar.bz2
coreclr-b0f325989d84c0ea429f24250e6ee1c6fd1a50a7.zip
Replace more of JitHelpers with S.R.CS.Unsafe (#21598)
- Replace JitHelpers.UnsafeCastToStackPtr with Unsafe.AsPointer - Delete PinningHelper that was duplicate of RawData helper class
Diffstat (limited to 'src/vm/jitinterface.cpp')
-rw-r--r--src/vm/jitinterface.cpp23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/vm/jitinterface.cpp b/src/vm/jitinterface.cpp
index 7fcdd62d05..2d87c276c8 100644
--- a/src/vm/jitinterface.cpp
+++ b/src/vm/jitinterface.cpp
@@ -6973,18 +6973,7 @@ bool getILIntrinsicImplementation(MethodDesc * ftn,
// Compare tokens to cover all generic instantiations
// The body of the first method is simply ret Arg0. The second one first casts the arg to I4.
- if (tk == MscorlibBinder::GetMethod(METHOD__JIT_HELPERS__UNSAFE_CAST_TO_STACKPTR)->GetMemberDef())
- {
- // Return the argument that was passed in converted to IntPtr
- static const BYTE ilcode[] = { CEE_LDARG_0, CEE_CONV_I, CEE_RET };
- methInfo->ILCode = const_cast<BYTE*>(ilcode);
- methInfo->ILCodeSize = sizeof(ilcode);
- methInfo->maxStack = 1;
- methInfo->EHcount = 0;
- methInfo->options = (CorInfoOptions)0;
- return true;
- }
- else if (tk == MscorlibBinder::GetMethod(METHOD__JIT_HELPERS__UNSAFE_ENUM_CAST)->GetMemberDef())
+ if (tk == MscorlibBinder::GetMethod(METHOD__JIT_HELPERS__UNSAFE_ENUM_CAST)->GetMemberDef())
{
// Normally we would follow the above pattern and unconditionally replace the IL,
// relying on generic type constraints to guarantee that it will only ever be instantiated
@@ -7048,16 +7037,16 @@ bool getILIntrinsicImplementation(MethodDesc * ftn,
}
else if (tk == MscorlibBinder::GetMethod(METHOD__JIT_HELPERS__GET_RAW_SZ_ARRAY_DATA)->GetMemberDef())
{
- mdToken tokArrayPinningHelper = MscorlibBinder::GetField(FIELD__ARRAY_PINNING_HELPER__M_ARRAY_DATA)->GetMemberDef();
+ mdToken tokRawSzArrayData = MscorlibBinder::GetField(FIELD__RAW_SZARRAY_DATA__DATA)->GetMemberDef();
static BYTE ilcode[] = { CEE_LDARG_0,
CEE_LDFLDA,0,0,0,0,
CEE_RET };
- ilcode[2] = (BYTE)(tokArrayPinningHelper);
- ilcode[3] = (BYTE)(tokArrayPinningHelper >> 8);
- ilcode[4] = (BYTE)(tokArrayPinningHelper >> 16);
- ilcode[5] = (BYTE)(tokArrayPinningHelper >> 24);
+ ilcode[2] = (BYTE)(tokRawSzArrayData);
+ ilcode[3] = (BYTE)(tokRawSzArrayData >> 8);
+ ilcode[4] = (BYTE)(tokRawSzArrayData >> 16);
+ ilcode[5] = (BYTE)(tokRawSzArrayData >> 24);
methInfo->ILCode = const_cast<BYTE*>(ilcode);
methInfo->ILCodeSize = sizeof(ilcode);