Remove handle assignment validation from GC side.
authorAditya Mandaleeka <adityam@microsoft.com>
Mon, 17 Apr 2017 22:53:38 +0000 (15:53 -0700)
committerAditya Mandaleeka <adityam@microsoft.com>
Mon, 17 Apr 2017 22:53:38 +0000 (15:53 -0700)
Commit migrated from https://github.com/dotnet/coreclr/commit/ae75f5d540b7373743d3698d6e2c1e7be93fd821

src/coreclr/src/gc/handletable.inl

index ae815c1..752a7b0 100644 (file)
@@ -22,13 +22,6 @@ inline void HndAssignHandle(OBJECTHANDLE handle, OBJECTREF objref)
     // sanity
     _ASSERTE(handle);
 
-#ifdef _DEBUG_IMPL
-    // handle should not be in unloaded domain
-    ValidateAppDomainForHandle(handle);
-
-    // Make sure the objref is valid before it is assigned to a handle
-    ValidateAssignObjrefForHandle(objref, HndGetHandleTableADIndex(HndGetHandleTable(handle)));
-#endif
     // unwrap the objectref we were given
     _UNCHECKED_OBJECTREF value = OBJECTREF_TO_UNCHECKED_OBJECTREF(objref);
 
@@ -49,13 +42,6 @@ inline void* HndInterlockedCompareExchangeHandle(OBJECTHANDLE handle, OBJECTREF
     // sanity
     _ASSERTE(handle);
 
-#ifdef _DEBUG_IMPL
-    // handle should not be in unloaded domain
-    ValidateAppDomainForHandle(handle);
-
-    // Make sure the objref is valid before it is assigned to a handle
-    ValidateAssignObjrefForHandle(objref, HndGetHandleTableADIndex(HndGetHandleTable(handle)));
-#endif
     // unwrap the objectref we were given
     _UNCHECKED_OBJECTREF value = OBJECTREF_TO_UNCHECKED_OBJECTREF(objref);
     _UNCHECKED_OBJECTREF oldValue = OBJECTREF_TO_UNCHECKED_OBJECTREF(oldObjref);
@@ -88,13 +74,6 @@ inline BOOL HndFirstAssignHandle(OBJECTHANDLE handle, OBJECTREF objref)
     // sanity
     _ASSERTE(handle);
 
-#ifdef _DEBUG_IMPL
-    // handle should not be in unloaded domain
-    ValidateAppDomainForHandle(handle);
-
-    // Make sure the objref is valid before it is assigned to a handle
-    ValidateAssignObjrefForHandle(objref, HndGetHandleTableADIndex(HndGetHandleTable(handle)));
-#endif
     // unwrap the objectref we were given
     _UNCHECKED_OBJECTREF value = OBJECTREF_TO_UNCHECKED_OBJECTREF(objref);
     _UNCHECKED_OBJECTREF null = NULL;