Add GetLoaderAllocatorObjectForGC to IGCToCLR (#17443)
[platform/upstream/coreclr.git] / src / vm / gcenv.ee.h
1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
4
5 #ifndef _GCENV_EE_H_
6 #define _GCENV_EE_H_
7
8 #include "gcinterface.h"
9
10 #ifdef FEATURE_STANDALONE_GC
11
12 namespace standalone
13 {
14
15 class GCToEEInterface : public IGCToCLR {
16 public:
17     GCToEEInterface() = default;
18     ~GCToEEInterface() = default;
19
20     void SuspendEE(SUSPEND_REASON reason);
21     void RestartEE(bool bFinishedGC);
22     void GcScanRoots(promote_func* fn, int condemned, int max_gen, ScanContext* sc);
23     void GcStartWork(int condemned, int max_gen);
24     void AfterGcScanRoots(int condemned, int max_gen, ScanContext* sc);
25     void GcBeforeBGCSweepWork();
26     void GcDone(int condemned);
27     bool RefCountedHandleCallbacks(Object * pObject);
28     void SyncBlockCacheWeakPtrScan(HANDLESCANPROC scanProc, uintptr_t lp1, uintptr_t lp2);
29     void SyncBlockCacheDemote(int max_gen);
30     void SyncBlockCachePromotionsGranted(int max_gen);
31     uint32_t GetActiveSyncBlockCount();
32     bool IsPreemptiveGCDisabled();
33     bool EnablePreemptiveGC();
34     void DisablePreemptiveGC();
35     Thread* GetThread();
36     gc_alloc_context * GetAllocContext();
37     void GcEnumAllocContexts(enum_alloc_context_func* fn, void* param);
38     uint8_t* GetLoaderAllocatorObjectForGC(Object* pObject);
39
40     // Diagnostics methods.
41     void DiagGCStart(int gen, bool isInduced);
42     void DiagUpdateGenerationBounds();
43     void DiagGCEnd(size_t index, int gen, int reason, bool fConcurrent);
44     void DiagWalkFReachableObjects(void* gcContext);
45     void DiagWalkSurvivors(void* gcContext);
46     void DiagWalkLOHSurvivors(void* gcContext);
47     void DiagWalkBGCSurvivors(void* gcContext);
48     void StompWriteBarrier(WriteBarrierParameters* args);
49
50     void EnableFinalization(bool foundFinalizers);
51     void HandleFatalError(unsigned int exitCode);
52     bool ShouldFinalizeObjectForUnload(AppDomain* pDomain, Object* obj);
53     bool ForceFullGCToBeBlocking();
54     bool EagerFinalized(Object* obj);
55     MethodTable* GetFreeObjectMethodTable();
56     bool GetBooleanConfigValue(const char* key, bool* value);
57     bool GetIntConfigValue(const char* key, int64_t* value);
58     bool GetStringConfigValue(const char* key, const char** value);
59     void FreeStringConfigValue(const char* value);
60     bool IsGCThread();
61     bool WasCurrentThreadCreatedByGC();
62     bool CreateThread(void (*threadStart)(void*), void* arg, bool is_suspendable, const char* name);
63     void WalkAsyncPinnedForPromotion(Object* object, ScanContext* sc, promote_func* callback);
64     void WalkAsyncPinned(Object* object, void* context, void(*callback)(Object*, Object*, void*));
65     IGCToCLREventSink* EventSink();
66 };
67
68 } // namespace standalone
69
70 #endif // FEATURE_STANDALONE_GC
71
72 #endif // _GCENV_EE_H_