diff --git a/src/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/System.Private.CoreLib/System.Private.CoreLib.csproj
index f8adb1c8443a..d231b4d1254f 100644
--- a/src/System.Private.CoreLib/System.Private.CoreLib.csproj
+++ b/src/System.Private.CoreLib/System.Private.CoreLib.csproj
@@ -314,7 +314,6 @@
-
@@ -326,6 +325,7 @@
+
diff --git a/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems b/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems
index dd569436083d..afb7c6b3c3e0 100644
--- a/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems
+++ b/src/System.Private.CoreLib/shared/System.Private.CoreLib.Shared.projitems
@@ -349,6 +349,7 @@
+
diff --git a/src/System.Private.CoreLib/src/System/Reflection/LocalVariableInfo.cs b/src/System.Private.CoreLib/shared/System/Reflection/LocalVariableInfo.cs
similarity index 50%
rename from src/System.Private.CoreLib/src/System/Reflection/LocalVariableInfo.cs
rename to src/System.Private.CoreLib/shared/System/Reflection/LocalVariableInfo.cs
index 241a3c4de623..1540bde531d9 100644
--- a/src/System.Private.CoreLib/src/System/Reflection/LocalVariableInfo.cs
+++ b/src/System.Private.CoreLib/shared/System/Reflection/LocalVariableInfo.cs
@@ -8,17 +8,10 @@ namespace System.Reflection
{
public class LocalVariableInfo
{
- #region Private Data Members
- private RuntimeType m_type;
- private int m_isPinned;
- private int m_localIndex;
- #endregion
-
- #region Constructor
+ public virtual Type LocalType { get { Debug.Fail("type must be set!"); return null; } }
+ public virtual int LocalIndex => 0;
+ public virtual bool IsPinned => false;
protected LocalVariableInfo() { }
- #endregion
-
- #region Object Overrides
public override string ToString()
{
string toString = LocalType.ToString() + " (" + LocalIndex + ")";
@@ -28,13 +21,6 @@ public override string ToString()
return toString;
}
- #endregion
-
- #region Public Members
- public virtual Type LocalType { get { Debug.Assert(m_type != null, "type must be set!"); return m_type; } }
- public virtual bool IsPinned { get { return m_isPinned != 0; } }
- public virtual int LocalIndex { get { return m_localIndex; } }
- #endregion
}
}
diff --git a/src/System.Private.CoreLib/src/System/Reflection/RuntimeLocalVariableInfo.cs b/src/System.Private.CoreLib/src/System/Reflection/RuntimeLocalVariableInfo.cs
new file mode 100644
index 000000000000..77b45919f015
--- /dev/null
+++ b/src/System.Private.CoreLib/src/System/Reflection/RuntimeLocalVariableInfo.cs
@@ -0,0 +1,21 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Diagnostics;
+
+namespace System.Reflection
+{
+ internal sealed class RuntimeLocalVariableInfo : LocalVariableInfo
+ {
+ private RuntimeType _type;
+ private int _localIndex;
+ private bool _isPinned;
+
+ protected RuntimeLocalVariableInfo() { }
+
+ public override Type LocalType { get { Debug.Assert(_type != null, "type must be set!"); return _type; } }
+ public override int LocalIndex => _localIndex;
+ public override bool IsPinned => _isPinned;
+ }
+}
diff --git a/src/vm/mscorlib.h b/src/vm/mscorlib.h
index d6caea23a7c1..dcd434ee8cfb 100644
--- a/src/vm/mscorlib.h
+++ b/src/vm/mscorlib.h
@@ -552,11 +552,11 @@ DEFINE_FIELD_U(m_catchMetadataToken, ExceptionHandlingClause, m_cat
DEFINE_FIELD_U(m_filterOffset, ExceptionHandlingClause, m_filterOffset)
DEFINE_CLASS(EH_CLAUSE, Reflection, ExceptionHandlingClause)
-DEFINE_CLASS_U(Reflection, LocalVariableInfo, LocalVariableInfo)
-DEFINE_FIELD_U(m_type, LocalVariableInfo, m_type)
-DEFINE_FIELD_U(m_isPinned, LocalVariableInfo, m_bIsPinned)
-DEFINE_FIELD_U(m_localIndex, LocalVariableInfo, m_localIndex)
-DEFINE_CLASS(LOCAL_VARIABLE_INFO, Reflection, LocalVariableInfo)
+DEFINE_CLASS_U(Reflection, RuntimeLocalVariableInfo, RuntimeLocalVariableInfo)
+DEFINE_FIELD_U(_type, RuntimeLocalVariableInfo, _type)
+DEFINE_FIELD_U(_localIndex, RuntimeLocalVariableInfo, _localIndex)
+DEFINE_FIELD_U(_isPinned, RuntimeLocalVariableInfo, _isPinned)
+DEFINE_CLASS(RUNTIME_LOCAL_VARIABLE_INFO, Reflection, RuntimeLocalVariableInfo)
DEFINE_CLASS_U(Reflection, MethodBody, MethodBody)
DEFINE_FIELD_U(m_IL, MethodBody, m_IL)
diff --git a/src/vm/runtimehandles.cpp b/src/vm/runtimehandles.cpp
index 1d0fb955c2df..f587b4c7f1fd 100644
--- a/src/vm/runtimehandles.cpp
+++ b/src/vm/runtimehandles.cpp
@@ -2430,7 +2430,7 @@ FCIMPL2(MethodBody *, RuntimeMethodHandle::GetMethodBody, ReflectMethodObject *p
{
METHODBODYREF MethodBodyObj;
EXCEPTIONHANDLINGCLAUSEREF EHClauseObj;
- LOCALVARIABLEINFOREF LocalVariableInfoObj;
+ RUNTIMELOCALVARIABLEINFOREF RuntimeLocalVariableInfoObj;
U1ARRAYREF U1Array;
BASEARRAYREF TempArray;
REFLECTCLASSBASEREF declaringType;
@@ -2439,7 +2439,7 @@ FCIMPL2(MethodBody *, RuntimeMethodHandle::GetMethodBody, ReflectMethodObject *p
gc.MethodBodyObj = NULL;
gc.EHClauseObj = NULL;
- gc.LocalVariableInfoObj = NULL;
+ gc.RuntimeLocalVariableInfoObj = NULL;
gc.U1Array = NULL;
gc.TempArray = NULL;
gc.declaringType = (REFLECTCLASSBASEREF)ObjectToOBJECTREF(pDeclaringTypeUNSAFE);
@@ -2469,7 +2469,7 @@ FCIMPL2(MethodBody *, RuntimeMethodHandle::GetMethodBody, ReflectMethodObject *p
MethodTable * pExceptionHandlingClauseMT = MscorlibBinder::GetClass(CLASS__EH_CLAUSE);
TypeHandle thEHClauseArray = ClassLoader::LoadArrayTypeThrowing(TypeHandle(pExceptionHandlingClauseMT), ELEMENT_TYPE_SZARRAY);
- MethodTable * pLocalVariableMT = MscorlibBinder::GetClass(CLASS__LOCAL_VARIABLE_INFO);
+ MethodTable * pLocalVariableMT = MscorlibBinder::GetClass(CLASS__RUNTIME_LOCAL_VARIABLE_INFO);
TypeHandle thLocalVariableArray = ClassLoader::LoadArrayTypeThrowing(TypeHandle(pLocalVariableMT), ELEMENT_TYPE_SZARRAY);
Module* pModule = pMethod->GetModule();
@@ -2551,21 +2551,21 @@ FCIMPL2(MethodBody *, RuntimeMethodHandle::GetMethodBody, ReflectMethodObject *p
for (INT32 i = 0; i < cLocals; i ++)
{
- gc.LocalVariableInfoObj = (LOCALVARIABLEINFOREF)AllocateObject(pLocalVariableMT);
+ gc.RuntimeLocalVariableInfoObj = (RUNTIMELOCALVARIABLEINFOREF)AllocateObject(pLocalVariableMT);
- gc.LocalVariableInfoObj->m_localIndex = i;
+ gc.RuntimeLocalVariableInfoObj->_localIndex = i;
metaSig.NextArg();
CorElementType eType;
IfFailThrow(metaSig.GetArgProps().PeekElemType(&eType));
if (ELEMENT_TYPE_PINNED == eType)
- gc.LocalVariableInfoObj->m_bIsPinned = TRUE;
+ gc.RuntimeLocalVariableInfoObj->_isPinned = TRUE;
TypeHandle tempType= metaSig.GetArgProps().GetTypeHandleThrowing(pModule, &sigTypeContext);
OBJECTREF refLocalType = tempType.GetManagedClassObject();
- gc.LocalVariableInfoObj->SetType(refLocalType);
- gc.MethodBodyObj->m_localVariables->SetAt(i, (OBJECTREF) gc.LocalVariableInfoObj);
+ gc.RuntimeLocalVariableInfoObj->SetType(refLocalType);
+ gc.MethodBodyObj->m_localVariables->SetAt(i, (OBJECTREF) gc.RuntimeLocalVariableInfoObj);
}
}
else
diff --git a/src/vm/runtimehandles.h b/src/vm/runtimehandles.h
index c757f9d8a4fb..f35ef44e6aa9 100644
--- a/src/vm/runtimehandles.h
+++ b/src/vm/runtimehandles.h
@@ -32,16 +32,16 @@ typedef enum ReflectionCallConv {
class ExceptionHandlingClause;
class MethodBody;
-class LocalVariableInfo;
+class RuntimeLocalVariableInfo;
#ifdef USE_CHECKED_OBJECTREFS
typedef REF EXCEPTIONHANDLINGCLAUSEREF;
typedef REF METHODBODYREF;
-typedef REF LOCALVARIABLEINFOREF;
+typedef REF RUNTIMELOCALVARIABLEINFOREF;
#else
typedef DPTR(ExceptionHandlingClause) EXCEPTIONHANDLINGCLAUSEREF;
typedef DPTR(MethodBody) METHODBODYREF;
-typedef DPTR(LocalVariableInfo) LOCALVARIABLEINFOREF;
+typedef DPTR(RuntimeLocalVariableInfo) RUNTIMELOCALVARIABLEINFOREF;
#endif
class ExceptionHandlingClause : Object
@@ -80,28 +80,28 @@ class MethodBody : Object
CLR_BOOL m_initLocals;
};
-class LocalVariableInfo : Object
+class RuntimeLocalVariableInfo : Object
{
private:
// Disallow creation and copy construction of these.
- LocalVariableInfo() { }
- LocalVariableInfo(LocalVariableInfo &r) { }
+ RuntimeLocalVariableInfo() { }
+ RuntimeLocalVariableInfo(RuntimeLocalVariableInfo &r) { }
public:
REFLECTCLASSBASEREF GetType()
{
- return (REFLECTCLASSBASEREF)m_type;
+ return (REFLECTCLASSBASEREF)_type;
}
void SetType(OBJECTREF type)
{
- SetObjectReference(&m_type, type, GetAppDomain());
+ SetObjectReference(&_type, type, GetAppDomain());
}
- OBJECTREF m_type;
- INT32 m_bIsPinned;
- INT32 m_localIndex;
+ OBJECTREF _type;
+ INT32 _localIndex;
+ CLR_BOOL _isPinned;
};
class MdUtf8String {