Skip to content

Commit

Permalink
Revert "GetCorElementTypeOfElementType"
Browse files Browse the repository at this point in the history
This reverts commit b59fa9d.
  • Loading branch information
huoyaoyuan committed Jun 2, 2024
1 parent 7ffe745 commit b610b35
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -617,8 +617,13 @@ public unsafe int GetLowerBound(int dimension)
return Unsafe.Add(ref RuntimeHelpers.GetMultiDimensionalArrayBounds(this), rank + dimension);
}

[MethodImpl(MethodImplOptions.InternalCall)]
internal extern CorElementType GetCorElementTypeOfElementType();
internal unsafe CorElementType GetCorElementTypeOfElementType()
{
MethodTable* pMT = RuntimeHelpers.GetMethodTable(this);
CorElementType et = pMT->GetArrayElementTypeHandle().GetVerifierCorElementType();
GC.KeepAlive(this);
return et;
}

private unsafe bool IsValueOfElementType(object value)
{
Expand Down
11 changes: 0 additions & 11 deletions src/coreclr/classlibnative/bcltype/arraynative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,6 @@

#include "arraynative.inl"

// Returns a bool to indicate if the array is of primitive types or not.
FCIMPL1(INT32, ArrayNative::GetCorElementTypeOfElementType, ArrayBase* arrayUNSAFE)
{
FCALL_CONTRACT;

_ASSERTE(arrayUNSAFE != NULL);

return arrayUNSAFE->GetArrayElementTypeHandle().GetVerifierCorElementType();
}
FCIMPLEND

extern "C" PCODE QCALLTYPE Array_GetElementConstructorEntrypoint(QCall::TypeHandle pArrayTypeHnd)
{
QCALL_CONTRACT;
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/classlibnative/bcltype/arraynative.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ struct FCALLRuntimeFieldHandle
class ArrayNative
{
public:
static FCDECL1(INT32, GetCorElementTypeOfElementType, ArrayBase* arrayUNSAFE);

static FCDECL2(FC_BOOL_RET, IsSimpleCopy, ArrayBase* pSrc, ArrayBase* pDst);

Expand Down
2 changes: 0 additions & 2 deletions src/coreclr/vm/ecalllist.h
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,6 @@ FCFuncStart(gCastHelpers)
FCFuncEnd()

FCFuncStart(gArrayFuncs)
FCFuncElement("GetCorElementTypeOfElementType", ArrayNative::GetCorElementTypeOfElementType)
FCFuncElement("IsSimpleCopy", ArrayNative::IsSimpleCopy)
FCFuncElement("InternalSetValue", ArrayNative::SetValue)
FCFuncEnd()
Expand Down Expand Up @@ -537,7 +536,6 @@ FCFuncEnd()
// Note these have to remain sorted by name:namespace pair (Assert will wack you if you don't)
// The sorting is case-sensitive

FCClassElement("Array", "System", gArrayFuncs)
FCClassElement("AssemblyLoadContext", "System.Runtime.Loader", gAssemblyLoadContextFuncs)
FCClassElement("Buffer", "System", gBufferFuncs)
FCClassElement("CastHelpers", "System.Runtime.CompilerServices", gCastHelpers)
Expand Down

0 comments on commit b610b35

Please sign in to comment.