diff options
author | Mukul Sabharwal <mjsabby@gmail.com> | 2019-04-24 17:27:06 -0700 |
---|---|---|
committer | Noah Falk <noahfalk@users.noreply.github.com> | 2019-04-24 17:27:06 -0700 |
commit | c2dacd2025145c586a5569408c1427899a3767cc (patch) | |
tree | e913bc9be0c0220d926f44f9520720944706d823 /src/gc | |
parent | 4a2654124ecf38300a717db79926334703abeb70 (diff) | |
download | coreclr-c2dacd2025145c586a5569408c1427899a3767cc.tar.gz coreclr-c2dacd2025145c586a5569408c1427899a3767cc.tar.bz2 coreclr-c2dacd2025145c586a5569408c1427899a3767cc.zip |
Add Medium GC Profiling Mode & ICorProfilerInfo::GetObjectReferences (#24156)
Diffstat (limited to 'src/gc')
-rw-r--r-- | src/gc/env/gcenv.ee.h | 2 | ||||
-rw-r--r-- | src/gc/gc.cpp | 21 | ||||
-rw-r--r-- | src/gc/gcenv.ee.standalone.inl | 4 | ||||
-rw-r--r-- | src/gc/gcimpl.h | 1 | ||||
-rw-r--r-- | src/gc/gcinterface.ee.h | 2 | ||||
-rw-r--r-- | src/gc/gcinterface.h | 4 | ||||
-rw-r--r-- | src/gc/sample/gcenv.ee.cpp | 2 |
7 files changed, 29 insertions, 7 deletions
diff --git a/src/gc/env/gcenv.ee.h b/src/gc/env/gcenv.ee.h index c91eadb6de..b9918ec5b7 100644 --- a/src/gc/env/gcenv.ee.h +++ b/src/gc/env/gcenv.ee.h @@ -63,7 +63,7 @@ public: static void DiagUpdateGenerationBounds(); static void DiagGCEnd(size_t index, int gen, int reason, bool fConcurrent); static void DiagWalkFReachableObjects(void* gcContext); - static void DiagWalkSurvivors(void* gcContext); + static void DiagWalkSurvivors(void* gcContext, bool fCompacting); static void DiagWalkLOHSurvivors(void* gcContext); static void DiagWalkBGCSurvivors(void* gcContext); static void StompWriteBarrier(WriteBarrierParameters* args); diff --git a/src/gc/gc.cpp b/src/gc/gc.cpp index 9e0356b5ff..bcffca016b 100644 --- a/src/gc/gc.cpp +++ b/src/gc/gc.cpp @@ -23060,7 +23060,7 @@ void gc_heap::plan_phase (int condemned_gen_number) assert (generation_allocation_segment (consing_gen) == ephemeral_heap_segment); - GCToEEInterface::DiagWalkSurvivors(__this); + GCToEEInterface::DiagWalkSurvivors(__this, true); relocate_phase (condemned_gen_number, first_condemned_address); compact_phase (condemned_gen_number, first_condemned_address, @@ -23270,7 +23270,7 @@ void gc_heap::plan_phase (int condemned_gen_number) fix_older_allocation_area (older_gen); } - GCToEEInterface::DiagWalkSurvivors(__this); + GCToEEInterface::DiagWalkSurvivors(__this, false); gen0_big_free_spaces = 0; make_free_lists (condemned_gen_number); @@ -37212,6 +37212,23 @@ void GCHeap::DiagWalkObject (Object* obj, walk_fn fn, void* context) } } +void GCHeap::DiagWalkObject2 (Object* obj, walk_fn2 fn, void* context) +{ + uint8_t* o = (uint8_t*)obj; + if (o) + { + go_through_object_cl (method_table (o), o, size(o), oo, + { + if (*oo) + { + if (!fn (obj, oo, context)) + return; + } + } + ); + } +} + void GCHeap::DiagWalkSurvivorsWithType (void* gc_context, record_surv_fn fn, void* diag_context, walk_surv_type type) { gc_heap* hp = (gc_heap*)gc_context; diff --git a/src/gc/gcenv.ee.standalone.inl b/src/gc/gcenv.ee.standalone.inl index b5c2c764b6..7a9b8b1014 100644 --- a/src/gc/gcenv.ee.standalone.inl +++ b/src/gc/gcenv.ee.standalone.inl @@ -155,10 +155,10 @@ inline void GCToEEInterface::DiagWalkFReachableObjects(void* gcContext) g_theGCToCLR->DiagWalkFReachableObjects(gcContext); } -inline void GCToEEInterface::DiagWalkSurvivors(void* gcContext) +inline void GCToEEInterface::DiagWalkSurvivors(void* gcContext, bool fCompacting) { assert(g_theGCToCLR != nullptr); - g_theGCToCLR->DiagWalkSurvivors(gcContext); + g_theGCToCLR->DiagWalkSurvivors(gcContext, fCompacting); } inline void GCToEEInterface::DiagWalkLOHSurvivors(void* gcContext) diff --git a/src/gc/gcimpl.h b/src/gc/gcimpl.h index dffe2f17aa..bdf3a5cc36 100644 --- a/src/gc/gcimpl.h +++ b/src/gc/gcimpl.h @@ -210,6 +210,7 @@ public: bool ShouldRestartFinalizerWatchDog(); void DiagWalkObject (Object* obj, walk_fn fn, void* context); + void DiagWalkObject2 (Object* obj, walk_fn2 fn, void* context); void SetFinalizeRunOnShutdown(bool value); public: // FIX diff --git a/src/gc/gcinterface.ee.h b/src/gc/gcinterface.ee.h index 4ce9203ab0..4d12ae9df9 100644 --- a/src/gc/gcinterface.ee.h +++ b/src/gc/gcinterface.ee.h @@ -296,7 +296,7 @@ public: // gives the diagnostics code a chance to run. This includes LOH if we are // compacting LOH. virtual - void DiagWalkSurvivors(void* gcContext) = 0; + void DiagWalkSurvivors(void* gcContext, bool fCompacting) = 0; // During a full GC after we discover what objects to survive on LOH, // gives the diagnostics code a chance to run. diff --git a/src/gc/gcinterface.h b/src/gc/gcinterface.h index 4c2a2fbf52..e6c2ccb862 100644 --- a/src/gc/gcinterface.h +++ b/src/gc/gcinterface.h @@ -444,6 +444,7 @@ typedef enum } GCHeapType; typedef bool (* walk_fn)(Object*, void*); +typedef bool (* walk_fn2)(Object*, uint8_t**, void*); typedef void (* gen_walk_fn)(void* context, int generation, uint8_t* range_start, uint8_t* range_end, uint8_t* range_reserved); typedef void (* record_surv_fn)(uint8_t* begin, uint8_t* end, ptrdiff_t reloc, void* context, bool compacting_p, bool bgc_p); typedef void (* fq_walk_fn)(bool, void*); @@ -829,6 +830,9 @@ public: // Walks an object, invoking a callback on each member. virtual void DiagWalkObject(Object* obj, walk_fn fn, void* context) = 0; + // Walks an object, invoking a callback on each member. + virtual void DiagWalkObject2(Object* obj, walk_fn2 fn, void* context) = 0; + // Walk the heap object by object. virtual void DiagWalkHeap(walk_fn fn, void* context, int gen_number, bool walk_large_object_heap_p) = 0; diff --git a/src/gc/sample/gcenv.ee.cpp b/src/gc/sample/gcenv.ee.cpp index abf6e09c2c..973b7f4491 100644 --- a/src/gc/sample/gcenv.ee.cpp +++ b/src/gc/sample/gcenv.ee.cpp @@ -253,7 +253,7 @@ void GCToEEInterface::DiagWalkFReachableObjects(void* gcContext) { } -void GCToEEInterface::DiagWalkSurvivors(void* gcContext) +void GCToEEInterface::DiagWalkSurvivors(void* gcContext, bool fCompacting) { } |