diff options
Diffstat (limited to 'src/gc/env')
-rw-r--r-- | src/gc/env/gcenv.base.h | 2 | ||||
-rw-r--r-- | src/gc/env/gcenv.ee.h | 38 | ||||
-rw-r--r-- | src/gc/env/gcenv.object.h | 2 | ||||
-rw-r--r-- | src/gc/env/gcenv.os.h | 3 |
4 files changed, 16 insertions, 29 deletions
diff --git a/src/gc/env/gcenv.base.h b/src/gc/env/gcenv.base.h index a94f1a6394..94f73762f8 100644 --- a/src/gc/env/gcenv.base.h +++ b/src/gc/env/gcenv.base.h @@ -447,7 +447,7 @@ extern bool g_fFinalizerRunOnShutDown; // Locks // -struct alloc_context; +struct gc_alloc_context; class Thread; Thread * GetThread(); diff --git a/src/gc/env/gcenv.ee.h b/src/gc/env/gcenv.ee.h index 0c1fd4988a..beb0c1a98f 100644 --- a/src/gc/env/gcenv.ee.h +++ b/src/gc/env/gcenv.ee.h @@ -7,35 +7,11 @@ #ifndef __GCENV_EE_H__ #define __GCENV_EE_H__ -struct ScanContext; -class CrawlFrame; - -typedef void promote_func(PTR_PTR_Object, ScanContext*, uint32_t); - -typedef void enum_alloc_context_func(alloc_context*, void*); - -typedef struct -{ - promote_func* f; - ScanContext* sc; - CrawlFrame * cf; -} GCCONTEXT; - -// GC background thread function prototype -typedef uint32_t (__stdcall *GCBackgroundThreadFunction)(void* param); +#include "gcinterface.h" class GCToEEInterface { public: - // - // Suspend/Resume callbacks - // - typedef enum - { - SUSPEND_FOR_GC = 1, - SUSPEND_FOR_GC_PREP = 6 - } SUSPEND_REASON; - static void SuspendEE(SUSPEND_REASON reason); static void RestartEE(bool bFinishedGC); //resume threads. @@ -74,12 +50,22 @@ public: static void EnablePreemptiveGC(Thread * pThread); static void DisablePreemptiveGC(Thread * pThread); - static alloc_context * GetAllocContext(Thread * pThread); + static gc_alloc_context * GetAllocContext(Thread * pThread); static bool CatchAtSafePoint(Thread * pThread); static void GcEnumAllocContexts(enum_alloc_context_func* fn, void* param); static Thread* CreateBackgroundThread(GCBackgroundThreadFunction threadStart, void* arg); + + // Diagnostics methods. + static void DiagGCStart(int gen, bool isInduced); + static void DiagUpdateGenerationBounds(); + static void DiagGCEnd(size_t index, int gen, int reason, bool fConcurrent); + static void DiagWalkFReachableObjects(void* gcContext); + static void DiagWalkSurvivors(void* gcContext); + static void DiagWalkLOHSurvivors(void* gcContext); + static void DiagWalkBGCSurvivors(void* gcContext); + static void StompWriteBarrier(WriteBarrierParameters* args); }; #endif // __GCENV_EE_H__ diff --git a/src/gc/env/gcenv.object.h b/src/gc/env/gcenv.object.h index c999e4538e..db8995a118 100644 --- a/src/gc/env/gcenv.object.h +++ b/src/gc/env/gcenv.object.h @@ -31,6 +31,8 @@ public: void ClrGCBit() { m_uSyncBlockValue &= ~BIT_SBLK_GC_RESERVE; } }; +static_assert(sizeof(ObjHeader) == sizeof(uintptr_t), "this assumption is made by the VM!"); + #define MTFlag_ContainsPointers 1 #define MTFlag_HasFinalizer 2 #define MTFlag_IsArray 4 diff --git a/src/gc/env/gcenv.os.h b/src/gc/env/gcenv.os.h index bb0153f117..6a126f29ed 100644 --- a/src/gc/env/gcenv.os.h +++ b/src/gc/env/gcenv.os.h @@ -73,13 +73,12 @@ public: // Reserve virtual memory range. // Parameters: - // address - starting virtual address, it can be NULL to let the function choose the starting address // size - size of the virtual memory range // alignment - requested memory alignment // flags - flags to control special settings like write watching // Return: // Starting virtual address of the reserved range - static void* VirtualReserve(void *address, size_t size, size_t alignment, uint32_t flags); + static void* VirtualReserve(size_t size, size_t alignment, uint32_t flags); // Release virtual memory range previously reserved using VirtualReserve // Parameters: |