summaryrefslogtreecommitdiff
path: root/src/gc
diff options
context:
space:
mode:
authorSergey <shallowstack@gmail.com>2017-09-30 02:16:44 +0300
committerSean Gillespie <segilles@microsoft.com>2017-09-29 16:16:44 -0700
commit5b10f0eb85d8e8ccdcf9b5e38e5dd372e241e24e (patch)
tree33cc1ab7a1ad56da4cc11ce983e0f0a379f9766a /src/gc
parent32c46737c396afa05ab748fbcc243de7512c11ec (diff)
downloadcoreclr-5b10f0eb85d8e8ccdcf9b5e38e5dd372e241e24e.tar.gz
coreclr-5b10f0eb85d8e8ccdcf9b5e38e5dd372e241e24e.tar.bz2
coreclr-5b10f0eb85d8e8ccdcf9b5e38e5dd372e241e24e.zip
StompWriteBarrier initialization path refactoring (#14105)
* refactored arm, arm64, amd64 and x86 to signal about icache flush and ee restarts * refactored gc init stage to stomp write barrier (hence flush icache) only once * review fixes, care taken of icache invalidation during StompResize * fixed heap boundaries initialization bug introduced after refactoring gc.cpp * stylistic review fixe * global variable rename * global variable rename once more
Diffstat (limited to 'src/gc')
-rw-r--r--src/gc/gc.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/gc/gc.cpp b/src/gc/gc.cpp
index cb5e7d098e..ce8540939f 100644
--- a/src/gc/gc.cpp
+++ b/src/gc/gc.cpp
@@ -2327,7 +2327,7 @@ void stomp_write_barrier_ephemeral(uint8_t* ephemeral_low, uint8_t* ephemeral_hi
GCToEEInterface::StompWriteBarrier(&args);
}
-void stomp_write_barrier_initialize()
+void stomp_write_barrier_initialize(uint8_t* ephemeral_low, uint8_t* ephemeral_high)
{
WriteBarrierParameters args = {};
args.operation = WriteBarrierOp::Initialize;
@@ -2341,8 +2341,8 @@ void stomp_write_barrier_initialize()
args.lowest_address = g_gc_lowest_address;
args.highest_address = g_gc_highest_address;
- args.ephemeral_low = reinterpret_cast<uint8_t*>(1);
- args.ephemeral_high = reinterpret_cast<uint8_t*>(~0);
+ args.ephemeral_low = ephemeral_low;
+ args.ephemeral_high = ephemeral_high;
GCToEEInterface::StompWriteBarrier(&args);
}
@@ -10602,7 +10602,18 @@ gc_heap::init_gc_heap (int h_number)
make_background_mark_stack (b_arr);
#endif //BACKGROUND_GC
- adjust_ephemeral_limits();
+ ephemeral_low = generation_allocation_start(generation_of(max_generation - 1));
+ ephemeral_high = heap_segment_reserved(ephemeral_heap_segment);
+ if (heap_number == 0)
+ {
+ stomp_write_barrier_initialize(
+#ifdef MULTIPLE_HEAPS
+ reinterpret_cast<uint8_t*>(1), reinterpret_cast<uint8_t*>(~0)
+#else
+ ephemeral_low, ephemeral_high
+#endif //!MULTIPLE_HEAPS
+ );
+ }
#ifdef MARK_ARRAY
// why would we clear the mark array for this page? it should be cleared..
@@ -33575,8 +33586,6 @@ HRESULT GCHeap::Initialize ()
return E_FAIL;
}
- stomp_write_barrier_initialize();
-
#ifndef FEATURE_REDHAWK // Redhawk forces relocation a different way
#if defined (STRESS_HEAP) && !defined (MULTIPLE_HEAPS)
if (GCStress<cfg_any>::IsEnabled()) {