diff options
author | Sean Gillespie <segilles@microsoft.com> | 2016-09-08 11:27:24 -0700 |
---|---|---|
committer | Sean Gillespie <segilles@microsoft.com> | 2016-09-08 11:27:24 -0700 |
commit | 6519911fbccbec049f9592484f69c213b4b78264 (patch) | |
tree | cfb37485afcc96a1780e106a4f99d192ff42ab2a /src/vm/jithelpers.cpp | |
parent | cda9b0fc9a5f206b391b1bd104e43bd6c29aad7f (diff) | |
download | coreclr-6519911fbccbec049f9592484f69c213b4b78264.tar.gz coreclr-6519911fbccbec049f9592484f69c213b4b78264.tar.bz2 coreclr-6519911fbccbec049f9592484f69c213b4b78264.zip |
Introduce an interface separating the GC and the VM,
modifying the VM to utilize this interface.
Introduce an interface separating the GC and the rest of the VM
Remove static members of both IGCHeap and IGCHeapInternal and move the management of the singular GC heap to the VM.
Rename uses of IGCHeap in the VM to GCHeapHolder, as well as other misc. renames throughout the VM and GC.
Split each interface function into categories, document them, use consistent formatting across the interface
Undo some accidental find/replace collateral damage
Remove all ifdefs from the GC interface
Deduplicate function declarations between IGCHeap and IGCHeapInternal, expose AllocAlign8 through the interface and the reference to alloc_context to repair the ARM build
Paper cut: false -> nullptr
Repair the ARM and x86 builds
Rename GCHeapHolder -> GCHeapUtilities and address documentation feedback
Rebase against master
Rename gcholder.h/cpp -> gcheaputilities.h/cpp
Fix an uninitialized field on alloc_context causing test failures on clang
Rename the include guard for gcheaputilities.h
Un-breaks SOS by making the following changes:
1) Instructs the DAC to look for IGCHeap::gcHeapType by name,
instead of assuming that it exists near g_pGCHeap,
2) Eliminate all virtual calls on IGCHeap in the DAC, since we cannot
dispatch on an object in another process,
3) Because of 2, expose the number of generations past the GC interface
using a static variable on IGCHeap that the DAC can read directly.
repair the Windows build
Diffstat (limited to 'src/vm/jithelpers.cpp')
-rw-r--r-- | src/vm/jithelpers.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/vm/jithelpers.cpp b/src/vm/jithelpers.cpp index 1626810758..a18602e691 100644 --- a/src/vm/jithelpers.cpp +++ b/src/vm/jithelpers.cpp @@ -23,7 +23,7 @@ #include "security.h" #include "securitymeta.h" #include "dllimport.h" -#include "gc.h" +#include "gcheaputilities.h" #include "comdelegate.h" #include "jitperf.h" // to track jit perf #include "corprof.h" @@ -2858,7 +2858,7 @@ HCIMPL1(Object*, JIT_NewS_MP_FastPortable, CORINFO_CLASS_HANDLE typeHnd_) do { - _ASSERTE(GCHeap::UseAllocationContexts()); + _ASSERTE(GCHeapUtilities::UseAllocationContexts()); // This is typically the only call in the fast path. Making the call early seems to be better, as it allows the compiler // to use volatile registers for intermediate values. This reduces the number of push/pop instructions and eliminates @@ -2872,7 +2872,7 @@ HCIMPL1(Object*, JIT_NewS_MP_FastPortable, CORINFO_CLASS_HANDLE typeHnd_) SIZE_T size = methodTable->GetBaseSize(); _ASSERTE(size % DATA_ALIGNMENT == 0); - alloc_context *allocContext = thread->GetAllocContext(); + gc_alloc_context *allocContext = thread->GetAllocContext(); BYTE *allocPtr = allocContext->alloc_ptr; _ASSERTE(allocPtr <= allocContext->alloc_limit); if (size > static_cast<SIZE_T>(allocContext->alloc_limit - allocPtr)) @@ -2997,7 +2997,7 @@ HCIMPL1(StringObject*, AllocateString_MP_FastPortable, DWORD stringLength) do { - _ASSERTE(GCHeap::UseAllocationContexts()); + _ASSERTE(GCHeapUtilities::UseAllocationContexts()); // Instead of doing elaborate overflow checks, we just limit the number of elements. This will avoid all overflow // problems, as well as making sure big string objects are correctly allocated in the big object heap. @@ -3021,7 +3021,7 @@ HCIMPL1(StringObject*, AllocateString_MP_FastPortable, DWORD stringLength) _ASSERTE(alignedTotalSize >= totalSize); totalSize = alignedTotalSize; - alloc_context *allocContext = thread->GetAllocContext(); + gc_alloc_context *allocContext = thread->GetAllocContext(); BYTE *allocPtr = allocContext->alloc_ptr; _ASSERTE(allocPtr <= allocContext->alloc_limit); if (totalSize > static_cast<SIZE_T>(allocContext->alloc_limit - allocPtr)) @@ -3161,7 +3161,7 @@ HCIMPL2(Object*, JIT_NewArr1VC_MP_FastPortable, CORINFO_CLASS_HANDLE arrayTypeHn do { - _ASSERTE(GCHeap::UseAllocationContexts()); + _ASSERTE(GCHeapUtilities::UseAllocationContexts()); // Do a conservative check here. This is to avoid overflow while doing the calculations. We don't // have to worry about "large" objects, since the allocation quantum is never big enough for @@ -3198,7 +3198,7 @@ HCIMPL2(Object*, JIT_NewArr1VC_MP_FastPortable, CORINFO_CLASS_HANDLE arrayTypeHn _ASSERTE(alignedTotalSize >= totalSize); totalSize = alignedTotalSize; - alloc_context *allocContext = thread->GetAllocContext(); + gc_alloc_context *allocContext = thread->GetAllocContext(); BYTE *allocPtr = allocContext->alloc_ptr; _ASSERTE(allocPtr <= allocContext->alloc_limit); if (totalSize > static_cast<SIZE_T>(allocContext->alloc_limit - allocPtr)) @@ -3238,7 +3238,7 @@ HCIMPL2(Object*, JIT_NewArr1OBJ_MP_FastPortable, CORINFO_CLASS_HANDLE arrayTypeH do { - _ASSERTE(GCHeap::UseAllocationContexts()); + _ASSERTE(GCHeapUtilities::UseAllocationContexts()); // Make sure that the total size cannot reach LARGE_OBJECT_SIZE, which also allows us to avoid overflow checks. The // "256" slack is to cover the array header size and round-up, using a constant value here out of laziness. @@ -3266,7 +3266,7 @@ HCIMPL2(Object*, JIT_NewArr1OBJ_MP_FastPortable, CORINFO_CLASS_HANDLE arrayTypeH _ASSERTE(ALIGN_UP(totalSize, DATA_ALIGNMENT) == totalSize); - alloc_context *allocContext = thread->GetAllocContext(); + gc_alloc_context *allocContext = thread->GetAllocContext(); BYTE *allocPtr = allocContext->alloc_ptr; _ASSERTE(allocPtr <= allocContext->alloc_limit); if (totalSize > static_cast<SIZE_T>(allocContext->alloc_limit - allocPtr)) @@ -6431,7 +6431,7 @@ HCIMPL0(VOID, JIT_StressGC) bool fSkipGC = false; if (!fSkipGC) - GCHeap::GetGCHeap()->GarbageCollect(); + GCHeapUtilities::GetGCHeap()->GarbageCollect(); // <TODO>@TODO: the following ifdef is in error, but if corrected the // compiler complains about the *__ms->pRetAddr() saying machine state |