From 372edb81017d314683a8bdbf44f9fb678e216726 Mon Sep 17 00:00:00 2001 From: Jan Kotas Date: Tue, 7 Jun 2016 09:26:19 -0700 Subject: [PATCH] Update GC from CoreRT (#5522) https://github.com/dotnet/corert/tree/master/src/Native/gc 3bd148c2089a781458b99d787395377a25bd23d0 --- src/gc/env/gcenv.base.h | 1 + src/gc/env/gcenv.os.h | 2 +- src/gc/gc.cpp | 1 + src/gc/sample/gcenv.ee.cpp | 5 +++++ src/gc/sample/gcenv.h | 6 ------ src/gc/sample/gcenv.windows.cpp | 7 ------- src/gc/softwarewritewatch.cpp | 5 ++--- 7 files changed, 10 insertions(+), 17 deletions(-) diff --git a/src/gc/env/gcenv.base.h b/src/gc/env/gcenv.base.h index 7077082..88f86ce 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 IsSuspendEEThread(); class CLRConfig { diff --git a/src/gc/env/gcenv.os.h b/src/gc/env/gcenv.os.h index 45b958c..0cdc7a4 100644 --- a/src/gc/env/gcenv.os.h +++ b/src/gc/env/gcenv.os.h @@ -226,7 +226,7 @@ public: // // Global memory info // - + // Return the size of the user-mode portion of the virtual address space of this process. // Return: // non zero if it has succeeded, 0 if it has failed diff --git a/src/gc/gc.cpp b/src/gc/gc.cpp index 904f949..1de3caf 100644 --- a/src/gc/gc.cpp +++ b/src/gc/gc.cpp @@ -9398,6 +9398,7 @@ void gc_heap::get_write_watch_for_gc_heap(bool reset, void *base_address, size_t #ifdef FEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP SoftwareWriteWatch::GetDirty(base_address, region_size, dirty_pages, dirty_page_count_ref, reset, is_runtime_suspended); #else // !FEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP + UNREFERENCED_PARAMETER(is_runtime_suspended); bool success = GCToOSInterface::GetWriteWatch(reset, base_address, region_size, dirty_pages, dirty_page_count_ref); assert(success); #endif // FEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP diff --git a/src/gc/sample/gcenv.ee.cpp b/src/gc/sample/gcenv.ee.cpp index 3205900..2ce0fda 100644 --- a/src/gc/sample/gcenv.ee.cpp +++ b/src/gc/sample/gcenv.ee.cpp @@ -249,6 +249,11 @@ void StompWriteBarrierResize(bool /* isRuntimeSuspended */, bool /*bReqUpperBoun { } +bool IsSuspendEEThread() +{ + return false; +} + void SwitchToWriteWatchBarrier() { } diff --git a/src/gc/sample/gcenv.h b/src/gc/sample/gcenv.h index 1b4b7b7..d407eba 100644 --- a/src/gc/sample/gcenv.h +++ b/src/gc/sample/gcenv.h @@ -79,12 +79,6 @@ public: Thread * GetThread(); -inline BOOL IsSuspendEEThread() -{ - // TODO: Implement - return false; -} - class ThreadStore { public: diff --git a/src/gc/sample/gcenv.windows.cpp b/src/gc/sample/gcenv.windows.cpp index 64faa32..1324bd3 100644 --- a/src/gc/sample/gcenv.windows.cpp +++ b/src/gc/sample/gcenv.windows.cpp @@ -315,13 +315,6 @@ uint64_t GCToOSInterface::GetPhysicalMemoryLimit() // ms - pointer to the structure that will be filled in with the memory status void GCToOSInterface::GetMemoryStatus(uint32_t* memory_load, uint64_t* available_physical, uint64_t* available_page_file) { - CONTRACTL - { - NOTHROW; - GC_NOTRIGGER; - } - CONTRACTL_END; - MEMORYSTATUSEX memStatus; memStatus.dwLength = sizeof(MEMORYSTATUSEX); diff --git a/src/gc/softwarewritewatch.cpp b/src/gc/softwarewritewatch.cpp index bbd37ef..5197449 100644 --- a/src/gc/softwarewritewatch.cpp +++ b/src/gc/softwarewritewatch.cpp @@ -5,13 +5,12 @@ #include "common.h" #include "softwarewritewatch.h" -#include "../inc/static_assert.h" #include "gcenv.h" #ifdef FEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP #ifndef DACCESS_COMPILE -static_assert_no_msg((static_cast(1) << SOFTWARE_WRITE_WATCH_AddressToTableByteIndexShift) == OS_PAGE_SIZE); +static_assert((static_cast(1) << SOFTWARE_WRITE_WATCH_AddressToTableByteIndexShift) == OS_PAGE_SIZE, "Unexpected OS_PAGE_SIZE"); extern "C" { @@ -73,7 +72,7 @@ bool SoftwareWriteWatch::GetDirtyFromBlock( while (dirtyBytes != 0) { DWORD bitIndex; - static_assert_no_msg(sizeof(size_t) <= 8); + static_assert(sizeof(size_t) <= 8, "Unexpected sizeof(size_t)"); if (sizeof(size_t) == 8) { BitScanForward64(&bitIndex, static_cast(dirtyBytes)); -- 2.7.4