From 3bd9166f7d9dc2ec84f00ab39bde03b11fc1c6a9 Mon Sep 17 00:00:00 2001 From: Maoni0 Date: Mon, 13 Jun 2016 15:14:25 -0700 Subject: [PATCH 1/2] porting 5773 to release/1.0.0 --- src/gc/env/gcenv.base.h | 1 + src/gc/gc.cpp | 8 ++++---- src/gc/sample/gcenv.ee.cpp | 10 ++++++++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/gc/env/gcenv.base.h b/src/gc/env/gcenv.base.h index 7077082bb327..17a54168304e 100644 --- a/src/gc/env/gcenv.base.h +++ b/src/gc/env/gcenv.base.h @@ -550,6 +550,7 @@ void LogSpewAlways(const char *fmt, ...); void StompWriteBarrierEphemeral(bool isRuntimeSuspended); void StompWriteBarrierResize(bool isRuntimeSuspended, bool bReqUpperBoundsCheck); +bool IsGCThread(); class CLRConfig { diff --git a/src/gc/gc.cpp b/src/gc/gc.cpp index 015f0e2d9a00..7fcd86b87d3f 100644 --- a/src/gc/gc.cpp +++ b/src/gc/gc.cpp @@ -7221,7 +7221,7 @@ int gc_heap::grow_brick_card_tables (uint8_t* start, // Either this thread was the thread that did the suspension which means we are suspended; or this is called // from a GC thread which means we are in a blocking GC and also suspended. - BOOL is_runtime_suspended = IsSuspendEEThread() || IsGCSpecialThread(); + BOOL is_runtime_suspended = IsGCThread(); if (!is_runtime_suspended) { // Note on points where the runtime is suspended anywhere in this function. Upon an attempt to suspend the @@ -7268,7 +7268,7 @@ int gc_heap::grow_brick_card_tables (uint8_t* start, // to be changed, so we are doing this after all global state has // been updated. See the comment above suspend_EE() above for more // info. - StompWriteBarrierResize(!!IsSuspendEEThread(), la != saved_g_lowest_address); + StompWriteBarrierResize(!!IsGCThread(), la != saved_g_lowest_address); } // We need to make sure that other threads executing checked write barriers @@ -15320,7 +15320,7 @@ void gc_heap::gc1() if (!settings.concurrent) #endif //BACKGROUND_GC { - adjust_ephemeral_limits(!!IsSuspendEEThread()); + adjust_ephemeral_limits(!!IsGCThread()); } #ifdef BACKGROUND_GC @@ -16167,7 +16167,7 @@ BOOL gc_heap::expand_soh_with_minimal_gc() dd_gc_new_allocation (dynamic_data_of (max_generation)) -= ephemeral_size; dd_new_allocation (dynamic_data_of (max_generation)) = dd_gc_new_allocation (dynamic_data_of (max_generation)); - adjust_ephemeral_limits(!!IsSuspendEEThread()); + adjust_ephemeral_limits(!!IsGCThread()); return TRUE; } else diff --git a/src/gc/sample/gcenv.ee.cpp b/src/gc/sample/gcenv.ee.cpp index 3205900c9132..e37cc7e69bfa 100644 --- a/src/gc/sample/gcenv.ee.cpp +++ b/src/gc/sample/gcenv.ee.cpp @@ -249,6 +249,16 @@ void StompWriteBarrierResize(bool /* isRuntimeSuspended */, bool /*bReqUpperBoun { } +bool IsSuspendEEThread() +{ + return false; +} + +bool IsGCThread() +{ + return false; +} + void SwitchToWriteWatchBarrier() { } From b0571dddcccaf34c25978a5cc20f8dd0e55dba8c Mon Sep 17 00:00:00 2001 From: Maoni0 Date: Mon, 13 Jun 2016 16:20:43 -0700 Subject: [PATCH 2/2] fix build error --- src/gc/sample/gcenv.ee.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/gc/sample/gcenv.ee.cpp b/src/gc/sample/gcenv.ee.cpp index e37cc7e69bfa..1d380d0a91a3 100644 --- a/src/gc/sample/gcenv.ee.cpp +++ b/src/gc/sample/gcenv.ee.cpp @@ -249,11 +249,6 @@ void StompWriteBarrierResize(bool /* isRuntimeSuspended */, bool /*bReqUpperBoun { } -bool IsSuspendEEThread() -{ - return false; -} - bool IsGCThread() { return false;