#ifndef __DACIMPL_H__
#define __DACIMPL_H__
+// This header include will need to be removed as part of GitHub#12170.
+// The only reason it's here now is that this header references the GC-private
+// structure "HandleTableMap".
+#include "../../gc/objecthandle.h"
+
#if defined(_TARGET_ARM_) || defined(FEATURE_CORESYSTEM) // @ARMTODO: STL breaks the build with current VC headers
//---------------------------------------------------------------------------------------
// Setting DAC_HASHTABLE tells the DAC to use the hand rolled hashtable for
#include "stdafx.h"
#include <daccess.h>
+
+// This header include will need to be rmeoved as part of GitHub#12170.
+// The only reason it's here now is that this file references the GC-private
+// variable g_HandleTableMap.
+#include "../../gc/objecthandle.h"
#include "../../vm/virtualcallstub.h"
#include "../../vm/win32threadpool.h"
#include "../../vm/hillclimbing.h"
return static_cast<HandleType>(type);
}
+void GCHandleManager::TraceRefCountedHandles(HANDLESCANPROC callback, uintptr_t param1, uintptr_t param2)
+{
+ ::Ref_TraceRefCountHandles(callback, param1, param2);
+}
+
virtual Object* InterlockedCompareExchangeObjectInHandle(OBJECTHANDLE handle, Object* object, Object* comparandObject);
virtual HandleType HandleFetchType(OBJECTHANDLE handle);
+
+ virtual void TraceRefCountedHandles(HANDLESCANPROC callback, uintptr_t param1, uintptr_t param2);
};
#endif // GCHANDLETABLE_H_
virtual Object* InterlockedCompareExchangeObjectInHandle(OBJECTHANDLE handle, Object* object, Object* comparandObject) = 0;
virtual HandleType HandleFetchType(OBJECTHANDLE handle) = 0;
+
+ virtual void TraceRefCountedHandles(HANDLESCANPROC callback, uintptr_t param1, uintptr_t param2) = 0;
};
// IGCHeap is the interface that the VM will use when interacting with the GC.
#define GC_ALLOC_ALIGN8_BIAS 0x4
#define GC_ALLOC_ALIGN8 0x8
+#if defined(USE_CHECKED_OBJECTREFS) && !defined(_NOVM)
+#define OBJECTREF_TO_UNCHECKED_OBJECTREF(objref) (*((_UNCHECKED_OBJECTREF*)&(objref)))
+#define UNCHECKED_OBJECTREF_TO_OBJECTREF(obj) (OBJECTREF(obj))
+#else
+#define OBJECTREF_TO_UNCHECKED_OBJECTREF(objref) (objref)
+#define UNCHECKED_OBJECTREF_TO_OBJECTREF(obj) (obj)
+#endif
+
struct ScanContext
{
Thread* thread_under_crawl;
#include "gcscan.h"
#include "gcdesc.h"
#include "softwarewritewatch.h"
+#include "handletable.h"
+#include "handletable.inl"
#define SERVER_GC 1
#include "gcscan.h"
#include "gcdesc.h"
#include "softwarewritewatch.h"
+#include "handletable.h"
+#include "handletable.inl"
#ifdef SERVER_GC
#undef SERVER_GC
/*--------------------------------------------------------------------------*/
-#if defined(USE_CHECKED_OBJECTREFS) && !defined(_NOVM)
-#define OBJECTREF_TO_UNCHECKED_OBJECTREF(objref) (*((_UNCHECKED_OBJECTREF*)&(objref)))
-#define UNCHECKED_OBJECTREF_TO_OBJECTREF(obj) (OBJECTREF(obj))
-#else
-#define OBJECTREF_TO_UNCHECKED_OBJECTREF(objref) (objref)
-#define UNCHECKED_OBJECTREF_TO_OBJECTREF(obj) (obj)
-#endif
-
#ifdef _DEBUG_IMPL
void ValidateAssignObjrefForHandle(OBJECTREF, ADIndex appDomainIndex);
void ValidateFetchObjrefForHandle(OBJECTREF, ADIndex appDomainIndex);
#endif // FEATURE_COMINTEROP || FEATURE_REDHAWK
}
-#ifdef FEATURE_COMINTEROP
void Ref_TraceRefCountHandles(HANDLESCANPROC callback, uintptr_t lParam1, uintptr_t lParam2)
{
+#ifdef FEATURE_COMINTEROP
int max_slots = getNumberOfSlots();
uint32_t handleType = HNDTYPE_REFCOUNTED;
}
walk = walk->pNext;
}
+#else
+ UNREFERENCED_PARAMETER(callback);
+ UNREFERENCED_PARAMETER(lParam1);
+ UNREFERENCED_PARAMETER(lParam2);
+#endif // FEATURE_COMINTEROP
}
-#endif
void UpdateVariableHandleType(OBJECTHANDLE handle, uint32_t type);
uint32_t CompareExchangeVariableHandleType(OBJECTHANDLE handle, uint32_t oldType, uint32_t newType);
-void GCHandleValidatePinnedObject(OBJECTREF obj);
-
/*
* Convenience prototypes for using the global handles
*/
#include "eeconfig.h"
#include "spinlock.h"
-#include "objecthandle.h"
#include "cgensys.h"
#include "declsec.h"
#include "eehash.h"
-#include "handletable.h"
#include "vars.hpp"
#include "eventstore.hpp"
#include "ceeload.inl"
#include "clsload.inl"
#include "domainfile.inl"
-#include "handletable.inl"
#include "clsload.inl"
#include "method.inl"
#include "stackprobe.inl"
#include "syncblk.h"
#include "eeconfig.h"
#include "stublink.h"
-#include "handletable.h"
#include "method.hpp"
#include "codeman.h"
#include "frames.h"
#include "clrex.h"
#include "hash.h"
#include "crst.h"
-#include "objecthandle.h"
#include "cgensys.h"
#include "declsec.h"
#ifdef FEATURE_COMINTEROP
#include "clrex.h"
#include "hash.h"
#include "crst.h"
-#include "objecthandle.h"
#include "cgensys.h"
#include "declsec.h"
#include "stdinterfaces.h"
#include <ex.h>
-#include "objecthandle.h"
#include "runtimeexceptionkind.h"
#include "interoputil.h"
#include "cgensys.h"
#include "comtoclrcall.h"
#include "clrtocomcall.h"
-#include "objecthandle.h"
#include "comutilnative.h"
#include "eeconfig.h"
#include "interoputil.h"
#include "vars.hpp"
#include "stdinterfaces.h"
#include "threads.h"
-#include "objecthandle.h"
#include "comutilnative.h"
#include "spinlock.h"
#include "comtoclrcall.h"
#include "eeconfig.h"
#include "spinlock.h"
-#include "objecthandle.h"
#include "declsec.h"
#ifdef FEATURE_COMINTEROP
#include "eehash.h"
-#include "handletable.h"
#include "vars.hpp"
#include "eventstore.hpp"
#include "object.inl"
#include "clsload.inl"
#include "domainfile.inl"
-#include "handletable.inl"
#include "method.inl"
#include "stackprobe.inl"
#include "syncblk.inl"
#include "comcallablewrapper.h"
#include "threads.h"
#include "excep.h"
-#include "objecthandle.h"
#include "comutilnative.h"
#include "eeconfig.h"
#include "interoputil.h"
// We need to do work in HandleWalkCallback which may trigger a GC. We cannot do this while
// enumerating the handle table. Instead, we will build a list of RefCount handles we found
// during the handle table enumeration first (m_enumResult) during this enumeration:
- Ref_TraceRefCountHandles(BulkComLogger::HandleWalkCallback, uintptr_t(this), 0);
+ GCHandleUtilities::GetGCHandleManager()->TraceRefCountedHandles(BulkComLogger::HandleWalkCallback, uintptr_t(this), 0);
// Now that we have all of the object handles, we will walk all of the handles and write the
// etw events.
#ifndef _FIELD_H_
#define _FIELD_H_
-#include "objecthandle.h"
#include "excep.h"
// Temporary values stored in FieldDesc m_dwOffset during loading
#include "security.h"
#include "stublink.h"
#include "fieldmarshaler.h"
-#include "objecthandle.h"
#include "siginfo.hpp"
#include "gcheaputilities.h"
#include "dllimportcallback.h"
#include "vars.hpp"
#include "regdisp.h"
#include "object.h"
-#include "objecthandle.h"
#include <stddef.h>
#include "siginfo.hpp"
// context headers
+++ /dev/null
-// 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.
-
-#include "../gc/handletable.h"
+++ /dev/null
-// 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.
-
-#include "../gc/handletable.inl"
#include "gcheaputilities.h"
#include "security.h"
#include "dbginterface.h"
-#include "objecthandle.h"
#include "marshalnative.h"
#include "fcall.h"
#include "dllimportcallback.h"
// Check that the supplied object is valid to put in a pinned handle.
// Throw an exception if not.
-void GCHandleValidatePinnedObject(OBJECTREF obj)
+void ValidatePinnedObject(OBJECTREF obj)
{
CONTRACTL
{
// If it is a pinned handle, check the object type.
if (type == HNDTYPE_PINNED)
- GCHandleValidatePinnedObject(objRef);
+ ValidatePinnedObject(objRef);
assert(type >= HNDTYPE_WEAK_SHORT && type <= HNDTYPE_WEAK_WINRT);
// Create the handle.
//<TODO>@todo: If the handle is pinned check the object type.</TODO>
if (isPinned)
{
- GCHandleValidatePinnedObject(objRef);
+ ValidatePinnedObject(objRef);
}
// Update the stored object reference.
//<TODO>@todo: If the handle is pinned check the object type.</TODO>
if (isPinned)
- GCHandleValidatePinnedObject(newObjref);
+ ValidatePinnedObject(newObjref);
// Update the stored object reference.
ret = InterlockedCompareExchangeObjectInHandle(handle, newObjref, oldObjref);
if (arrayObj->GetMethodTable()->IsMultiDimArray())
COMPlusThrow(kArgumentException, IDS_EE_NOTISOMORPHIC);
- GCHandleValidatePinnedObject(arrayObj);
+ ValidatePinnedObject(arrayObj);
}
if (arrayObj == NULL)
#endif // FEATURE_COMINTEROP
};
+// Check that the supplied object is valid to put in a pinned handle,
+// throwing an exception if not.
+void ValidatePinnedObject(OBJECTREF obj);
+
#endif
#include "cor.h"
#include "hash.h"
#include "crst.h"
-#include "objecthandle.h"
#include "cgensys.h"
#include "declsec.h"
#ifdef FEATURE_COMINTEROP
#include "mdaassistants.h"
#include "comsynchronizable.h"
#include "comthreadpool.h"
+#include "marshalnative.h"
LONG OverlappedDataObject::s_CleanupRequestCount = 0;
BOOL OverlappedDataObject::s_CleanupInProgress = FALSE;
SIZE_T i;
for (i = 0; i < num; i ++)
{
- GCHandleValidatePinnedObject(pObj[i]);
+ ValidatePinnedObject(pObj[i]);
}
for (i = 0; i < num; i ++)
{
}
else
{
- GCHandleValidatePinnedObject(userObject);
+ ValidatePinnedObject(userObject);
AddMTForPinHandle(userObject);
}
+++ /dev/null
-// 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.
-
-#include "../gc/objecthandle.h"
#include "common.h"
-#include "objecthandle.h"
#include "rcwrefcache.h"
#include "comcallablewrapper.h"
#include "runtimecallablewrapper.h"
#include "utilcode.h"
#include "vars.hpp"
-#include "objecthandle.h"
#include "spinlock.h"
#include "interoputil.h"
#include "mngstdinterfaces.h"
#include "stackprobe.h"
#include "eeconfig.h"
#include "eehash.h"
-#include "objecthandle.h"
#include "interoputil.h"
#include "typedesc.h"
#include "virtualcallstub.h"
#include "util.hpp"
#include "slist.h"
#include "crst.h"
-#include "handletable.h"
#include "vars.hpp"
// #SyncBlockOverview