summaryrefslogtreecommitdiff
path: root/src/vm/gcenv.h
diff options
context:
space:
mode:
authordotnet-bot <dotnet-bot@microsoft.com>2015-01-30 14:14:42 -0800
committerdotnet-bot <dotnet-bot@microsoft.com>2015-01-30 14:14:42 -0800
commitef1e2ab328087c61a6878c1e84f4fc5d710aebce (patch)
treedee1bbb89e9d722e16b0d1485e3cdd1b6c8e2cfa /src/vm/gcenv.h
downloadcoreclr-ef1e2ab328087c61a6878c1e84f4fc5d710aebce.tar.gz
coreclr-ef1e2ab328087c61a6878c1e84f4fc5d710aebce.tar.bz2
coreclr-ef1e2ab328087c61a6878c1e84f4fc5d710aebce.zip
Initial commit to populate CoreCLR repo
[tfs-changeset: 1407945]
Diffstat (limited to 'src/vm/gcenv.h')
-rw-r--r--src/vm/gcenv.h108
1 files changed, 108 insertions, 0 deletions
diff --git a/src/vm/gcenv.h b/src/vm/gcenv.h
new file mode 100644
index 0000000000..fc5ca6de86
--- /dev/null
+++ b/src/vm/gcenv.h
@@ -0,0 +1,108 @@
+//
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+//
+
+#ifndef GCENV_H_
+#define GCENV_H_
+
+//
+// Extra VM headers required to compile GC-related files
+//
+
+#include "finalizerthread.h"
+
+#include "threadsuspend.h"
+
+#ifdef FEATURE_COMINTEROP
+#include <windows.ui.xaml.h>
+#endif
+
+#include "stubhelpers.h"
+
+#include "eeprofinterfaces.inl"
+
+#ifdef GC_PROFILING
+#include "eetoprofinterfaceimpl.h"
+#include "eetoprofinterfaceimpl.inl"
+#include "profilepriv.h"
+#endif
+
+#ifdef DEBUGGING_SUPPORTED
+#include "dbginterface.h"
+#endif
+
+#ifdef FEATURE_COMINTEROP
+#include "runtimecallablewrapper.h"
+#endif // FEATURE_COMINTEROP
+
+#ifdef FEATURE_REMOTING
+#include "remoting.h"
+#endif
+
+#ifdef FEATURE_UEF_CHAINMANAGER
+// This is required to register our UEF callback with the UEF chain manager
+#include <mscoruefwrapper.h>
+#endif // FEATURE_UEF_CHAINMANAGER
+
+
+struct ScanContext;
+class CrawlFrame;
+
+typedef void promote_func(PTR_PTR_Object, ScanContext*, DWORD);
+
+typedef struct
+{
+ promote_func* f;
+ ScanContext* sc;
+ CrawlFrame * cf;
+} GCCONTEXT;
+
+
+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.
+
+ //
+ // The GC roots enumeration callback
+ //
+ static void ScanStackRoots(Thread * pThread, promote_func* fn, ScanContext* sc);
+
+ // Optional static GC refs scanning for better parallelization of server GC marking
+ static void ScanStaticGCRefsOpportunistically(promote_func* fn, ScanContext* sc);
+
+ //
+ // Callbacks issues during GC that the execution engine can do its own bookeeping
+ //
+
+ // start of GC call back - single threaded
+ static void GcStartWork(int condemned, int max_gen);
+
+ //EE can perform post stack scanning action, while the
+ // user threads are still suspended
+ static void AfterGcScanRoots(int condemned, int max_gen, ScanContext* sc);
+
+ // Called before BGC starts sweeping, the heap is walkable
+ static void GcBeforeBGCSweepWork();
+
+ // post-gc callback.
+ static void GcDone(int condemned);
+
+ // Sync block cache management
+ static void SyncBlockCacheWeakPtrScan(HANDLESCANPROC scanProc, LPARAM lp1, LPARAM lp2);
+ static void SyncBlockCacheDemote(int max_gen);
+ static void SyncBlockCachePromotionsGranted(int max_gen);
+};
+
+#endif // GCENV_H_ \ No newline at end of file