Delete unused AssemblyName._hashForControl and related code (#23972)
authorJan Kotas <jkotas@microsoft.com>
Sun, 14 Apr 2019 03:15:48 +0000 (20:15 -0700)
committerGitHub <noreply@github.com>
Sun, 14 Apr 2019 03:15:48 +0000 (20:15 -0700)
src/System.Private.CoreLib/shared/System/Reflection/AssemblyName.cs
src/vm/assemblyspec.cpp
src/vm/assemblyspec.hpp
src/vm/mscorlib.h
src/vm/object.h

index 89a6217..498a368 100644 (file)
@@ -23,9 +23,7 @@ namespace System.Reflection
 
         private StrongNameKeyPair _strongNameKeyPair;
 
-        private byte[] _hashForControl;
         private AssemblyHashAlgorithm _hashAlgorithm;
-        private AssemblyHashAlgorithm _hashAlgorithmForControl;
 
         private AssemblyVersionCompatibility _versionCompatibility;
         private AssemblyNameFlags _flags;
@@ -142,8 +140,6 @@ namespace System.Reflection
                 _codeBase = _codeBase,
                 _hashAlgorithm = _hashAlgorithm,
                 _versionCompatibility = _versionCompatibility,
-                _hashForControl = _hashForControl,
-                _hashAlgorithmForControl = _hashAlgorithmForControl
             };
             return name;
         }
index b44cd26..ad2ebfd 100644 (file)
@@ -434,13 +434,6 @@ HRESULT AssemblySpec::InitializeSpec(StackingAllocator* alloc, ASSEMBLYNAMEREF*
 
     CloneFieldsToStackingAllocator(alloc);
 
-    // Hash for control 
-    // <TODO>@TODO cts, can we use unsafe in this case!!!</TODO>
-    if ((*pName)->GetHashForControl() != NULL)
-        SetHashForControl((*pName)->GetHashForControl()->GetDataPtr(), 
-                          (*pName)->GetHashForControl()->GetNumComponents(), 
-                          (*pName)->GetHashAlgorithmForControl());
-
     // Extract embedded WinRT name, if present.
     ParseEncodedName();
 
index 798f73c..a52c2fc 100644 (file)
@@ -34,7 +34,6 @@ class AssemblySpec  : public BaseAssemblySpec
     friend class AssemblyNameNative;
     
     AppDomain       *m_pAppDomain;
-    SBuffer          m_HashForControl;
     DWORD            m_dwHashAlg;
     DomainAssembly  *m_pParentAssembly;
 
@@ -187,7 +186,6 @@ class AssemblySpec  : public BaseAssemblySpec
         SetFallbackLoadContextBinderForRequestingAssembly(pSource->GetFallbackLoadContextBinderForRequestingAssembly());
         m_fPreferFallbackLoadContextBinder = pSource->GetPreferFallbackLoadContextBinder();
 
-        m_HashForControl = pSource->m_HashForControl;
         m_dwHashAlg = pSource->m_dwHashAlg;
     }
 
@@ -248,21 +246,6 @@ class AssemblySpec  : public BaseAssemblySpec
         return m_pAppDomain;
     }
 
-    HRESULT SetHashForControl(PBYTE pHashForControl, DWORD dwHashForControl, DWORD dwHashAlg)
-    {
-        CONTRACTL
-        {
-            THROWS;
-            GC_NOTRIGGER;
-            PRECONDITION(CheckPointer(pHashForControl));
-        }
-        CONTRACTL_END;
-
-        m_HashForControl.Set(pHashForControl, dwHashForControl);
-        m_dwHashAlg=dwHashAlg; 
-        return S_OK;
-    }
-
     void ParseEncodedName();
     
     void SetWindowsRuntimeType(LPCUTF8 szNamespace, LPCUTF8 szClassName);
index ccdec0f..ec96d5e 100644 (file)
@@ -114,9 +114,7 @@ DEFINE_FIELD_U(_publicKeyToken,            AssemblyNameBaseObject, _publicKeyTok
 DEFINE_FIELD_U(_cultureInfo,               AssemblyNameBaseObject, _cultureInfo)
 DEFINE_FIELD_U(_codeBase,                  AssemblyNameBaseObject, _codeBase)
 DEFINE_FIELD_U(_version,                   AssemblyNameBaseObject, _version)
-DEFINE_FIELD_U(_hashForControl,            AssemblyNameBaseObject, _hashForControl)
 DEFINE_FIELD_U(_hashAlgorithm,             AssemblyNameBaseObject, _hashAlgorithm)
-DEFINE_FIELD_U(_hashAlgorithmForControl, AssemblyNameBaseObject, _hashAlgorithmForControl)
 DEFINE_FIELD_U(_versionCompatibility,      AssemblyNameBaseObject, _versionCompatibility)
 DEFINE_FIELD_U(_flags,                     AssemblyNameBaseObject, _flags)
 DEFINE_CLASS(ASSEMBLY_NAME,         Reflection,             AssemblyName)
index b9b7b3a..173036d 100644 (file)
@@ -1678,9 +1678,7 @@ class AssemblyNameBaseObject : public Object
     OBJECTREF     _codeBase;
     OBJECTREF     _version;
     OBJECTREF     _strongNameKeyPair;
-    U1ARRAYREF    _hashForControl;
     DWORD         _hashAlgorithm;
-    DWORD         _hashAlgorithmForControl;
     DWORD         _versionCompatibility;
     DWORD         _flags;
 
@@ -1698,8 +1696,6 @@ class AssemblyNameBaseObject : public Object
     OBJECTREF GetVersion() { LIMITED_METHOD_CONTRACT; return _version; }
     DWORD GetAssemblyHashAlgorithm() { LIMITED_METHOD_CONTRACT; return _hashAlgorithm; }
     DWORD GetFlags() { LIMITED_METHOD_CONTRACT; return _flags; }
-    U1ARRAYREF GetHashForControl() { LIMITED_METHOD_CONTRACT; return _hashForControl;}
-    DWORD GetHashAlgorithmForControl() { LIMITED_METHOD_CONTRACT; return _hashAlgorithmForControl; }
 };
 
 // VersionBaseObject