diff options
author | Sean Gillespie <segilles@microsoft.com> | 2017-08-22 10:20:36 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-22 10:20:36 -0700 |
commit | 8acf6c9f7e33b1bfe77205cd2e61f2c60e8c00ce (patch) | |
tree | 5f7e55f04b5182a6ef1bd537ef76accd5a494782 /src/gc/env/gcenv.object.h | |
parent | 2766385624a9c5b73d32bed85519c044447701ff (diff) | |
download | coreclr-8acf6c9f7e33b1bfe77205cd2e61f2c60e8c00ce.tar.gz coreclr-8acf6c9f7e33b1bfe77205cd2e61f2c60e8c00ce.tar.bz2 coreclr-8acf6c9f7e33b1bfe77205cd2e61f2c60e8c00ce.zip |
[Local GC] Enable building the GC as a shared library (#13137)
* [Local GC] Build the GC using system headers
* Disable features to get the GC to build
* Get rid of the separate 'GC PAL' build
* Remove unused stuff
* Don't build gcenv.os.cpp when linking in a standalone gc
* Stub out CPUGroupInfo and NumaNodeInfo
* Stub out IsGCThread and friends
* Build the GC as a shared library :tada:
* Build, link, and run! :tada:
* Fix standalone GC build break
* Fixes where the GC's MethodTable and VM's MethodTable classes disagree
* Integrate a standalone GC into the CoreCLR build system (so it gets copied to the output folder). Re-enable some ifdef-ed out includes that are required for a non-standalone build of the GC.
* Bring changes to Unix and fix the Unix build. Implement some compiler intrinsic wrappers and alignment functions expected by the GC.
* Fix the Windows build
* 1. Code review feedback: use standard types for BitScanForward and
BitScanForward64
2. Delete FEATURE_COM stuff from the build system, not needed for this
PR
3. Fix the Unix build
* Fix the Windows x86 build - the _BitScanForward64 intrinsic is not available when targeting 32-bit platforms
* Remove a number of things from gcenv.base.h that are not used
* Remove a linker workaround now that we are not linking a standalone GC into the runtime
* Remove dead code, make the lack of GC_PROFILING for standalone gc not break profiling on the non-standalone build
* Code review feedback - use add_library_clr and other cmake-related fixes
* Fix include indentation
* Remove some extraneous parameters to cmake functions (cmake is remarkably lenient...)
Diffstat (limited to 'src/gc/env/gcenv.object.h')
-rw-r--r-- | src/gc/env/gcenv.object.h | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/src/gc/env/gcenv.object.h b/src/gc/env/gcenv.object.h index db8995a118..4261c1a148 100644 --- a/src/gc/env/gcenv.object.h +++ b/src/gc/env/gcenv.object.h @@ -33,9 +33,11 @@ public: 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 +#define MTFlag_ContainsPointers 0x0100 +#define MTFlag_HasFinalizer 0x0010 +#define MTFlag_IsArray 0x0008 +#define MTFlag_Collectible 0x1000 +#define MTFlag_HasComponentSize 0x8000 class MethodTable { @@ -64,6 +66,11 @@ public: return m_componentSize; } + bool Collectible() + { + return (m_flags & MTFlag_Collectible) != 0; + } + bool ContainsPointers() { return (m_flags & MTFlag_ContainsPointers) != 0; @@ -71,12 +78,19 @@ public: bool ContainsPointersOrCollectible() { - return ContainsPointers(); + return ContainsPointers() || Collectible(); } bool HasComponentSize() { - return m_componentSize != 0; + // Note that we can't just check m_componentSize != 0 here. The VM + // may still construct a method table that does not have a component + // size, according to this method, but still has a number in the low + // 16 bits of the method table flags parameter. + // + // The solution here is to do what the VM does and check the + // HasComponentSize flag so that we're on the same page. + return (m_flags & MTFlag_HasComponentSize) != 0; } bool HasFinalizer() @@ -104,6 +118,12 @@ public: { return true; } + + uint8_t* GetLoaderAllocatorObjectForGC() + { + // [LOCALGC TODO] this is not correct + return nullptr; + } }; class Object |