diff --git a/src/SOS/Strike/gcroot.cpp b/src/SOS/Strike/gcroot.cpp index 70988f2bca..975faf9da0 100644 --- a/src/SOS/Strike/gcroot.cpp +++ b/src/SOS/Strike/gcroot.cpp @@ -27,7 +27,6 @@ #include "sos.h" #include "disasm.h" -#include "gcdesc.h" #include "safemath.h" inline size_t ALIGN_DOWN( size_t val, size_t alignment ) diff --git a/src/SOS/Strike/sos.cpp b/src/SOS/Strike/sos.cpp index 65bda1e299..ae795c3a42 100644 --- a/src/SOS/Strike/sos.cpp +++ b/src/SOS/Strike/sos.cpp @@ -4,7 +4,6 @@ #include "strike.h" #include "util.h" #include "sos.h" -#include "gcdesc.h" namespace sos { diff --git a/src/SOS/Strike/sos.h b/src/SOS/Strike/sos.h index 170722378a..97d7c552d6 100644 --- a/src/SOS/Strike/sos.h +++ b/src/SOS/Strike/sos.h @@ -27,8 +27,6 @@ #endif class LinearReadCache; -class CGCDesc; -class CGCDescSeries; namespace sos { diff --git a/src/shared/README.txt b/src/shared/README.txt index 0d3406cce4..0553f34834 100644 --- a/src/shared/README.txt +++ b/src/shared/README.txt @@ -14,7 +14,6 @@ runtime/src/coreclr/debug/inc/runtimeinfo.h -> diagnostics/src/share runtime/src/coreclr/gcdump -> diagnostics/src/shared/gcdump runtime/src/coreclr/gcinfo/gcinfodumper.cpp -> diagnostics/src/shared/gcinfo/gcinfodumper.cpp runtime/src/coreclr/vm/gcinfodecoder.cpp -> diagnostics/src/shared/vm/gcinfodecoder.cpp -runtime/src/coreclr/gc/gcdesc.h -> diagnostics/src/shared/gc/gcdesc.h runtime/src/coreclr/dlls/mscorrc/resource.h -> diagnostics/src/shared/dlls/mscorrc/resource.h runtime/src/coreclr/hosts/inc/coreclrhost.h -> diagnostics/src/shared/hosts/inc/coreclrhost.h runtime/src/coreclr/minipal -> diagnostics/src/shared/minipal @@ -35,7 +34,7 @@ diagnostics/src/shared/pal/src/configure.cmake diagnostics/src/shared/pal/src/config.h.in diagnostics/eng/native/tryrun.cmake -There are a lot of include and source files that need to be carefully merged from the runtime because +There are a lot of include and source files that need to be carefully merged from the runtime because there is functions that the diagnostics repo doesn't need (i.e. Mutexes) and functions that were removed from the runtime PAL that the diagnostics repo needs (i.e. RemoveDirectoryA). diff --git a/src/shared/gc/gcdesc.h b/src/shared/gc/gcdesc.h deleted file mode 100644 index 6c3b86af8b..0000000000 --- a/src/shared/gc/gcdesc.h +++ /dev/null @@ -1,269 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// -// -// GC Object Pointer Location Series Stuff -// - - - -#ifndef _GCDESC_H_ -#define _GCDESC_H_ - -#ifdef HOST_64BIT -typedef uint32_t HALF_SIZE_T; -#else // HOST_64BIT -typedef uint16_t HALF_SIZE_T; -#endif - - -typedef size_t *JSlot; - - -// -// These two classes make up the apparatus with which the object references -// within an object can be found. -// -// CGCDescSeries: -// -// The CGCDescSeries class describes a series of object references within an -// object by describing the size of the series (which has an adjustment which -// will be explained later) and the starting point of the series. -// -// The series size is adjusted when the map is created by subtracting the -// GetBaseSize() of the object. On retieval of the size the total size -// of the object is added back. For non-array objects the total object -// size is equal to the base size, so this returns the same value. For -// array objects this will yield the size of the data portion of the array. -// Since arrays containing object references will contain ONLY object references -// this is a fast way of handling arrays and normal objects without a -// conditional test -// -// -// -// CGCDesc: -// -// The CGCDesc is a collection of CGCDescSeries objects to describe all the -// different runs of pointers in a particular object. [add more on the strange -// way the CGCDesc grows backwards in memory behind the MethodTable] -// - -struct val_serie_item -{ - HALF_SIZE_T nptrs; - HALF_SIZE_T skip; - void set_val_serie_item (HALF_SIZE_T nptrs, HALF_SIZE_T skip) - { - this->nptrs = nptrs; - this->skip = skip; - } -}; - -typedef DPTR(class CGCDescSeries) PTR_CGCDescSeries; -typedef DPTR(class MethodTable) PTR_MethodTable; -class CGCDescSeries -{ -public: - union - { - size_t seriessize; // adjusted length of series (see above) in bytes - val_serie_item val_serie[1]; //coded serie for value class array - }; - - size_t startoffset; - - size_t GetSeriesCount () - { - return seriessize/sizeof(JSlot); - } - - void SetSeriesCount (size_t newcount) - { - seriessize = newcount * sizeof(JSlot); - } - - void IncSeriesCount (size_t increment = 1) - { - seriessize += increment * sizeof(JSlot); - } - - size_t GetSeriesSize () - { - return seriessize; - } - - void SetSeriesSize (size_t newsize) - { - seriessize = newsize; - } - - void SetSeriesValItem (val_serie_item item, int index) - { - val_serie [index] = item; - } - - void SetSeriesOffset (size_t newoffset) - { - startoffset = newoffset; - } - - size_t GetSeriesOffset () - { - return startoffset; - } -}; - - - - - -typedef DPTR(class CGCDesc) PTR_CGCDesc; -class CGCDesc -{ - // Don't construct me, you have to hand me a ptr to the *top* of my storage in Init. - CGCDesc () {} - - // - // NOTE: for alignment reasons, NumSeries is stored as a size_t. - // This makes everything nicely 8-byte aligned on IA64. - // -public: - static size_t ComputeSize (size_t NumSeries) - { - _ASSERTE (ptrdiff_t(NumSeries) > 0); - - return sizeof(size_t) + NumSeries*sizeof(CGCDescSeries); - } - - // For value type array - static size_t ComputeSizeRepeating (size_t NumSeries) - { - _ASSERTE (ptrdiff_t(NumSeries) > 0); - - return sizeof(size_t) + sizeof(CGCDescSeries) + - (NumSeries-1)*sizeof(val_serie_item); - } - -#ifndef DACCESS_COMPILE - static void Init (void* mem, size_t NumSeries) - { - *((size_t*)mem-1) = NumSeries; - } - - static void InitValueClassSeries (void* mem, size_t NumSeries) - { - *((ptrdiff_t*)mem-1) = -((ptrdiff_t)NumSeries); - } -#endif - - static PTR_CGCDesc GetCGCDescFromMT (MethodTable * pMT) - { - // If it doesn't contain pointers, there isn't a GCDesc - PTR_MethodTable mt(pMT); -#ifndef SOS_INCLUDE - _ASSERTE(mt->ContainsGCPointers()); -#endif - return PTR_CGCDesc(mt); - } - - size_t GetNumSeries () - { - return *(PTR_size_t(PTR_CGCDesc(this))-1); - } - - // Returns lowest series in memory. - // Cannot be used for valuetype arrays - PTR_CGCDescSeries GetLowestSeries () - { - _ASSERTE (ptrdiff_t(GetNumSeries()) > 0); - return PTR_CGCDescSeries(PTR_uint8_t(PTR_CGCDesc(this)) - - ComputeSize(GetNumSeries())); - } - - // Returns highest series in memory. - PTR_CGCDescSeries GetHighestSeries () - { - return PTR_CGCDescSeries(PTR_size_t(PTR_CGCDesc(this))-1)-1; - } - - // Returns number of immediate pointers this object has. It should match the number of - // pointers enumerated by go_through_object_cl macro. The implementation shape has intentional - // similarity with the go_through_object family of macros. - // size is only used if you have an array of value types. -#ifndef DACCESS_COMPILE - static size_t GetNumPointers (MethodTable* pMT, size_t ObjectSize, size_t NumComponents) - { - size_t NumOfPointers = 0; - - if (pMT->ContainsGCPointers()) - { - CGCDesc* map = GetCGCDescFromMT(pMT); - CGCDescSeries* cur = map->GetHighestSeries(); - ptrdiff_t cnt = (ptrdiff_t)map->GetNumSeries(); - - if (cnt >= 0) - { - CGCDescSeries* last = map->GetLowestSeries(); - do - { - NumOfPointers += (cur->GetSeriesSize() + ObjectSize) / sizeof(JSlot); - cur--; - } - while (cur >= last); - } - else - { - /* Handle the repeating case - array of valuetypes */ - for (ptrdiff_t __i = 0; __i > cnt; __i--) - { - NumOfPointers += (cur->val_serie + __i)->nptrs; - } - - NumOfPointers *= NumComponents; - } - } - -#ifndef FEATURE_NATIVEAOT - if (pMT->Collectible()) - { - NumOfPointers += 1; - } -#endif - - return NumOfPointers; - } -#endif - - // Size of the entire slot map. - size_t GetSize () - { - ptrdiff_t numSeries = (ptrdiff_t) GetNumSeries(); - if (numSeries < 0) - { - return ComputeSizeRepeating(-numSeries); - } - else - { - return ComputeSize(numSeries); - } - } - - uint8_t *GetStartOfGCData() - { - return ((uint8_t *)this) - GetSize(); - } - -private: - - BOOL IsValueClassSeries() - { - return ((ptrdiff_t) GetNumSeries()) < 0; - } - -}; - -#define MAX_SIZE_FOR_VALUECLASS_IN_ARRAY 0xffff -#define MAX_PTRS_FOR_VALUECLASSS_IN_ARRAY 0xffff - - -#endif // _GCDESC_H_