97413e3d53db9c8fc8f1f84d6a4408d19aba2099
[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
39     // Diagnostics methods.
40     void DiagGCStart(int gen, bool isInduced);
41     void DiagUpdateGenerationBounds();
42     void DiagGCEnd(size_t index, int gen, int reason, bool fConcurrent);
43     void DiagWalkFReachableObjects(void* gcContext);
44     void DiagWalkSurvivors(void* gcContext);
45     void DiagWalkLOHSurvivors(void* gcContext);
46     void DiagWalkBGCSurvivors(void* gcContext);
47     void StompWriteBarrier(WriteBarrierParameters* args);
48
49     void EnableFinalization(bool foundFinalizers);
50     void HandleFatalError(unsigned int exitCode);
51     bool ShouldFinalizeObjectForUnload(AppDomain* pDomain, Object* obj);
52     bool ForceFullGCToBeBlocking();
53     bool EagerFinalized(Object* obj);
54     MethodTable* GetFreeObjectMethodTable();
55     bool GetBooleanConfigValue(const char* key, bool* value);
56     bool GetIntConfigValue(const char* key, int64_t* value);
57     bool GetStringConfigValue(const char* key, const char** value);
58     void FreeStringConfigValue(const char* value);
59     bool IsGCThread();
60     bool WasCurrentThreadCreatedByGC();
61     bool CreateThread(void (*threadStart)(void*), void* arg, bool is_suspendable, const char* name);
62     void WalkAsyncPinnedForPromotion(Object* object, ScanContext* sc, promote_func* callback);
63     void WalkAsyncPinned(Object* object, void* context, void(*callback)(Object*, Object*, void*));
64     IGCToCLREventSink* EventSink();
65 };
66
67 } // namespace standalone
68
69 #endif // FEATURE_STANDALONE_GC
70
71 #endif // _GCENV_EE_H_