Skip to content

Commit 5a8c497

Browse files
committed
fixes after rebasing
1 parent af82616 commit 5a8c497

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+2489
-4680
lines changed

src/coreclr/gc/env/gctoeeinterface.standalone.inl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,21 @@ namespace standalone
1919
::GCToEEInterface::RestartEE(bFinishedGC);
2020
}
2121

22+
void GcScanCurrentStackRoots(promote_func* fn, ScanContext* sc)
23+
{
24+
::GCToEEInterface::GcScanCurrentStackRoots(fn, sc);
25+
}
26+
2227
void GcScanRoots(promote_func* fn, int condemned, int max_gen, ScanContext* sc)
2328
{
2429
::GCToEEInterface::GcScanRoots(fn, condemned, max_gen, sc);
2530
}
2631

32+
void GcPoll()
33+
{
34+
::GCToEEInterface::GcPoll();
35+
}
36+
2737
void GcStartWork(int condemned, int max_gen)
2838
{
2939
::GCToEEInterface::GcStartWork(condemned, max_gen);

src/coreclr/gc/gc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ inline bool IsServerHeap()
338338
{
339339
#ifdef FEATURE_SVR_GC
340340
assert(g_gc_heap_type != GC_HEAP_INVALID);
341-
return g_gc_heap_type == GC_HEAP_SVR;
341+
return g_gc_heap_type >= GC_HEAP_SVR;
342342
#else // FEATURE_SVR_GC
343343
return false;
344344
#endif // FEATURE_SVR_GC

src/coreclr/gc/gchandletable.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ HHANDLETABLE GCHandleStore::GetTable()
7373

7474
OBJECTHANDLE GCHandleStore::CreateHandleOfType(Object* object, HandleType type)
7575
{
76+
#ifdef FEATURE_SATORI_GC
77+
HHANDLETABLE handletable = _underlyingBucket.pTable[GetCurrentThreadHomeHeapNumber()];
78+
#else
7679
HHANDLETABLE handletable = GetTable();
80+
#endif
7781
return ::HndCreateHandle(handletable, type, ObjectToOBJECTREF(object));
7882
}
7983

src/coreclr/gc/handletablescan.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,10 @@ void BlockResetAgeMapForBlocksWorker(uint32_t *pdwGen, uint32_t dwClumpMask, Sca
787787
STATIC_CONTRACT_GC_NOTRIGGER;
788788
STATIC_CONTRACT_MODE_COOPERATIVE;
789789

790+
#if FEATURE_SATORI_GC
791+
__UNREACHABLE();
792+
#endif
793+
790794
// fetch the table segment we are working in
791795
TableSegment *pSegment = pInfo->pCurrentSegment;
792796

src/coreclr/gc/objecthandle.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,11 +1326,13 @@ bool Ref_ScanDependentHandlesForPromotion(DhContext *pDhContext)
13261326
if (walk->pBuckets[i] != NULL)
13271327
{
13281328
int uCPUindex = getSlotNumber(pDhContext->m_pScanContext);
1329-
// int uCPUlimit = getNumberOfSlots();
1330-
// assert(uCPUlimit > 0);
1331-
int uCPUstep = getThreadCount(pDhContext->m_pScanContext);
13321329
HHANDLETABLE* pTable = walk->pBuckets[i]->pTable;
1333-
// for ( ; uCPUindex < uCPUlimit; uCPUindex += uCPUstep)
1330+
#if !defined(FEATURE_SATORI_GC)
1331+
int uCPUlimit = getNumberOfSlots();
1332+
assert(uCPUlimit > 0);
1333+
int uCPUstep = getThreadCount(pDhContext->m_pScanContext);
1334+
for (; uCPUindex < uCPUlimit; uCPUindex += uCPUstep)
1335+
#endif
13341336
{
13351337
HHANDLETABLE hTable = pTable[uCPUindex];
13361338
if (hTable)
@@ -1411,11 +1413,13 @@ void Ref_ScanWeakInteriorPointersForRelocation(uint32_t condemned, uint32_t maxg
14111413
if (walk->pBuckets[i] != NULL)
14121414
{
14131415
int uCPUindex = getSlotNumber(sc);
1416+
HHANDLETABLE* pTable = walk->pBuckets[i]->pTable;
1417+
#if !defined(FEATURE_SATORI_GC)
14141418
int uCPUlimit = getNumberOfSlots();
14151419
assert(uCPUlimit > 0);
14161420
int uCPUstep = getThreadCount(sc);
1417-
HHANDLETABLE* pTable = walk->pBuckets[i]->pTable;
1418-
for ( ; uCPUindex < uCPUlimit; uCPUindex += uCPUstep)
1421+
for (; uCPUindex < uCPUlimit; uCPUindex += uCPUstep)
1422+
#endif
14191423
{
14201424
HHANDLETABLE hTable = pTable[uCPUindex];
14211425
if (hTable)

src/coreclr/gc/satori/SatoriAllocator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class SatoriAllocator
125125
#else
126126
BitScanReverse(&highestBit, value);
127127
#endif
128-
return min(highestBit - Satori::REGION_BITS, Satori::ALLOCATOR_BUCKET_COUNT - 1);
128+
return min((int)highestBit - Satori::REGION_BITS, Satori::ALLOCATOR_BUCKET_COUNT - 1);
129129
}
130130
};
131131

src/coreclr/gc/satori/SatoriGC.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -891,3 +891,12 @@ uint64_t SatoriGC::GetGenerationBudget(int generation)
891891
// avoid IDE0060: Remove unused parameter 'generation'
892892
return -1 + 0 * generation;
893893
}
894+
895+
size_t SatoriGC::GetLOHThreshold()
896+
{
897+
return Satori::LARGE_OBJECT_THRESHOLD;
898+
}
899+
900+
void SatoriGC::DiagWalkHeapWithACHandling(walk_fn fn, void *context, int gen_number, bool walk_large_object_heap_p)
901+
{
902+
}

src/coreclr/gc/satori/SatoriGC.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,10 @@ class SatoriGC : public IGCHeapInternal
165165

166166
// Inherited via IGCHeapInternal
167167
uint64_t GetGenerationBudget(int generation) override;
168+
169+
// Inherited via IGCHeapInternal
170+
size_t GetLOHThreshold() override;
171+
void DiagWalkHeapWithACHandling(walk_fn fn, void *context, int gen_number, bool walk_large_object_heap_p) override;
168172
};
169173

170174
#endif

src/coreclr/gc/satori/SatoriObject.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void SatoriObject::DirtyCardsForContent()
9191
{
9292
_ASSERTE(IsMarked());
9393
MethodTable* mt = RawGetMethodTable();
94-
if (mt->ContainsPointersOrCollectible())
94+
if (mt->ContainsGCPointersOrCollectible())
9595
{
9696
SatoriPage* page = ContainingRegion()->m_containingPage;
9797
// if dealing with a collectible type, include MT in the dirty range

src/coreclr/gc/satori/SatoriObject.inl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ inline void SatoriObject::ForEachObjectRef(F lambda, bool includeCollectibleAllo
282282
lambda((SatoriObject**)&loaderAllocator);
283283
}
284284

285-
if (!mt->ContainsPointers())
285+
if (!mt->ContainsGCPointers())
286286
{
287287
return;
288288
}
@@ -354,7 +354,7 @@ inline void SatoriObject::ForEachObjectRef(F lambda, size_t size, bool includeCo
354354
lambda((SatoriObject**)&loaderAllocator);
355355
}
356356

357-
if (!mt->ContainsPointers())
357+
if (!mt->ContainsGCPointers())
358358
{
359359
return;
360360
}
@@ -421,7 +421,7 @@ inline void SatoriObject::ForEachObjectRef(F lambda, size_t start, size_t end)
421421
lambda((SatoriObject**)&loaderAllocator);
422422
}
423423

424-
if (!mt->ContainsPointers())
424+
if (!mt->ContainsGCPointers())
425425
{
426426
return;
427427
}

0 commit comments

Comments
 (0)