summaryrefslogtreecommitdiff
path: root/src/vm/method.cpp
diff options
context:
space:
mode:
authorJan Kotas <jkotas@microsoft.com>2016-12-06 21:30:54 -0800
committerRussell C Hadley <rhadley@microsoft.com>2017-01-11 14:12:57 -0800
commit0bedde3a63f22b65155d5f369e75c448c6afb786 (patch)
treece0c00bd13c7b2e5ff727b3daabae789c059f7ec /src/vm/method.cpp
parentbaa998029e27b5927122d40f3a3a208e6e728421 (diff)
downloadcoreclr-0bedde3a63f22b65155d5f369e75c448c6afb786.tar.gz
coreclr-0bedde3a63f22b65155d5f369e75c448c6afb786.tar.bz2
coreclr-0bedde3a63f22b65155d5f369e75c448c6afb786.zip
Initial implementation of two field span.
Implements two field span struct which is comprised of a byref field that may be an interior pointer to a managed object, or a native pointer indicating the start of the span, and a length field which describes the span of access. Since there is no MSIL operation which assign a byref field, the jit gets involved and treats the constructor and getter of a special struct called ByReference that contains an declared IntPtr. This special struct is then used as a field in the span implementation and recognized by the runtime as a field that may contain a GC pointer. In implementation, the ctor of ByReference is converted into an assignment value is returned by a reverse assignment. Since there are some dependencies on CoreFX for the span implementation local testing of the implementation has been done using the BasicSpanTest.cs in the CoreCLR tests. Once this is checked in and is propagated to CoreFX the apporopate code in the packages will be enabled and then may be referenced in CoreCLR tests. At that time more span tests will be added. Additional comments and fixes based on code review added.
Diffstat (limited to 'src/vm/method.cpp')
-rw-r--r--src/vm/method.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/vm/method.cpp b/src/vm/method.cpp
index 7afe0e9de2..07636d6950 100644
--- a/src/vm/method.cpp
+++ b/src/vm/method.cpp
@@ -2466,7 +2466,18 @@ MethodDesc* Entry2MethodDesc(PCODE entryPoint, MethodTable *pMT)
BOOL MethodDesc::IsFCallOrIntrinsic()
{
WRAPPER_NO_CONTRACT;
- return (IsFCall() || IsArray());
+
+ if (IsFCall() || IsArray())
+ return TRUE;
+
+#ifdef FEATURE_SPAN_OF_T
+ // Intrinsic methods on ByReference<T> or Span<T>
+ MethodTable * pMT = GetMethodTable();
+ if (pMT->IsByRefLike() && pMT->GetModule()->IsSystem())
+ return TRUE;
+#endif
+
+ return FALSE;
}
//*******************************************************************************