Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/design/datacontracts/ExecutionManager.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ public enum CodeKind : uint
Jitted = 11,
ReadyToRun = 12,
Interpreter = 13,
ThePreStub = 14
ThePreStub = 14,
WrapperStub = 15,
ShuffleThunk = 16
}
```

Expand Down
9 changes: 0 additions & 9 deletions docs/design/datacontracts/Loader.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ enum LoaderAllocatorHeapType
LowFrequencyHeap,
HighFrequencyHeap,
StaticsHeap,
StubHeap,
ExecutableHeap,
FixupPrecodeHeap,
NewStubPrecodeHeap,
Expand Down Expand Up @@ -112,7 +111,6 @@ TargetPointer GetGlobalLoaderAllocator();
TargetPointer GetSystemAssembly();
TargetPointer GetHighFrequencyHeap(TargetPointer loaderAllocatorPointer);
TargetPointer GetLowFrequencyHeap(TargetPointer loaderAllocatorPointer);
TargetPointer GetStubHeap(TargetPointer loaderAllocatorPointer);
TargetPointer GetObjectHandle(TargetPointer loaderAllocatorPointer);
TargetPointer GetILHeader(ModuleHandle handle, uint token);
TargetPointer GetDynamicIL(ModuleHandle handle, uint token);
Expand Down Expand Up @@ -193,7 +191,6 @@ enum ClrModifiableAssemblies : uint
| `LoaderAllocator` | `ObjectHandle` | `ObjectHandle` | Handle to the managed loader allocator object |
| `LoaderAllocator` | `ReferenceCount` | `uint32` | Reference count of the loader allocator |
| `LoaderAllocator` | `StaticsHeap` | `pointer` | Heap containing statics-related allocations |
| `LoaderAllocator` | `StubHeap` | `pointer` | Heap containing runtime stubs |
| `LoaderAllocator` | `VirtualCallStubManager` | `pointer` | Pointer to the virtual-call stub manager |
| `LoaderHeap` | `FirstBlock` | `pointer` | Pointer to the first loader-heap block |
| `LoaderHeapBlock` | `Next` | `pointer` | Pointer to the next loader-heap block |
Expand Down Expand Up @@ -850,11 +847,6 @@ TargetPointer GetLowFrequencyHeap(TargetPointer loaderAllocatorPointer)
return target.ReadPointer(loaderAllocatorPointer + /* LoaderAllocator::LowFrequencyHeap offset */);
}

TargetPointer GetStubHeap(TargetPointer loaderAllocatorPointer)
{
return target.ReadPointer(loaderAllocatorPointer + /* LoaderAllocator::StubHeap offset */);
}

TargetPointer GetObjectHandle(TargetPointer loaderAllocatorPointer)
{
return target.ReadPointer(loaderAllocatorPointer + /* LoaderAllocator::ObjectHandle offset */);
Expand All @@ -870,7 +862,6 @@ IReadOnlyDictionary<LoaderAllocatorHeapType, TargetPointer> GetLoaderAllocatorHe
[LoaderAllocatorHeapType.LowFrequencyHeap] = la.LowFrequencyHeap,
[LoaderAllocatorHeapType.HighFrequencyHeap] = la.HighFrequencyHeap,
[LoaderAllocatorHeapType.StaticsHeap] = la.StaticsHeap,
[LoaderAllocatorHeapType.StubHeap] = la.StubHeap,
[LoaderAllocatorHeapType.ExecutableHeap] = la.ExecutableHeap,
};

Expand Down
1 change: 0 additions & 1 deletion docs/design/datacontracts/RuntimeTypeSystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,6 @@ static class RuntimeTypeSystem_1_Helpers
| `LoaderAllocator` | `ObjectHandle` | `ObjectHandle` | Handle to the managed loader allocator object |
| `LoaderAllocator` | `ReferenceCount` | `uint32` | Reference count of the loader allocator |
| `LoaderAllocator` | `StaticsHeap` | `pointer` | Heap containing statics-related allocations |
| `LoaderAllocator` | `StubHeap` | `pointer` | Heap containing runtime stubs |
| `LoaderAllocator` | `VirtualCallStubManager` | `pointer` | Pointer to the virtual-call stub manager |
| `MethodDesc` | *(type size)* | `uint32` | Base size for mcIL classification |
| `MethodDesc` | `ChunkIndex` | `uint8` | Offset of this MethodDesc relative to the end of its containing MethodDescChunk - in multiples of MethodDescAlignment |
Expand Down
1 change: 0 additions & 1 deletion docs/design/datacontracts/data-descriptor-meanings.json
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@
"LoaderAllocator.ObjectHandle": "Handle to the managed loader allocator object",
"LoaderAllocator.ReferenceCount": "Reference count of the loader allocator",
"LoaderAllocator.StaticsHeap": "Heap containing statics-related allocations",
"LoaderAllocator.StubHeap": "Heap containing runtime stubs",
"LoaderAllocator.VirtualCallStubManager": "Pointer to the virtual-call stub manager",
"LoaderCodeHeap.LoaderHeap": "Offset of the embedded `ExplicitControlLoaderHeap` within the `LoaderCodeHeap` object; adding this to the object's base address yields the loader heap address",
"LoaderHeap.FirstBlock": "Pointer to the first loader-heap block",
Expand Down
3 changes: 0 additions & 3 deletions src/coreclr/debug/daccess/request.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2453,7 +2453,6 @@ ClrDataAccess::GetAppDomainData(CLRDATA_ADDRESS addr, struct DacpAppDomainData *
PTR_LoaderAllocator pLoaderAllocator = SystemDomain::GetGlobalLoaderAllocator();
appdomainData->pHighFrequencyHeap = HOST_CDADDR(pLoaderAllocator->GetHighFrequencyHeap());
appdomainData->pLowFrequencyHeap = HOST_CDADDR(pLoaderAllocator->GetLowFrequencyHeap());
appdomainData->pStubHeap = HOST_CDADDR(pLoaderAllocator->GetStubHeap());
appdomainData->appDomainStage = STAGE_OPEN;

appdomainData->dwId = DefaultADID;
Expand Down Expand Up @@ -3681,7 +3680,6 @@ static const char *LoaderAllocatorLoaderHeapNames[] =
"LowFrequencyHeap",
"HighFrequencyHeap",
"StaticsHeap",
"StubHeap",
"ExecutableHeap",
"FixupPrecodeHeap",
"NewStubPrecodeHeap",
Expand Down Expand Up @@ -3721,7 +3719,6 @@ HRESULT ClrDataAccess::GetLoaderAllocatorHeaps(CLRDATA_ADDRESS loaderAllocatorAd
pLoaderHeaps[i++] = HOST_CDADDR(pLoaderAllocator->GetLowFrequencyHeap());
pLoaderHeaps[i++] = HOST_CDADDR(pLoaderAllocator->GetHighFrequencyHeap());
pLoaderHeaps[i++] = HOST_CDADDR(pLoaderAllocator->GetStaticsHeap());
pLoaderHeaps[i++] = HOST_CDADDR(pLoaderAllocator->GetStubHeap());
pLoaderHeaps[i++] = HOST_CDADDR(pLoaderAllocator->GetExecutableHeap());
pLoaderHeaps[i++] = HOST_CDADDR(pLoaderAllocator->GetFixupPrecodeHeap());
pLoaderHeaps[i++] = HOST_CDADDR(pLoaderAllocator->GetNewStubPrecodeHeap());
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/inc/eventtracebase.h
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@ namespace ETW
static VOID MethodJitted(MethodDesc *pMethodDesc, SString *namespaceOrClassName, SString *methodName, SString *methodSignature, PCODE pNativeCodeStartAddress, PrepareCodeConfig *pConfig);
static VOID SendMethodDetailsEvent(MethodDesc *pMethodDesc);
static VOID SendNonDuplicateMethodDetailsEvent(MethodDesc* pMethodDesc, MethodDescSet* set);
static VOID StubInitialized(ULONGLONG ullHelperStartAddress, LPCWSTR pHelperName);
static VOID StubInitialized(ULONGLONG ullHelperStartAddress, ULONG ulHelperSize, LPCWSTR pHelperName);
static VOID MethodRestored(MethodDesc * pMethodDesc);
static VOID DynamicMethodDestroyed(MethodDesc *pMethodDesc);
static VOID LogMethodInstrumentationData(MethodDesc* method, uint32_t cbData, BYTE *data, TypeHandle* pTypeHandles, uint32_t numTypeHandles, MethodDesc** pMethods, uint32_t numMethods);
Expand All @@ -970,7 +970,7 @@ namespace ETW
static VOID GetR2RGetEntryPoint(MethodDesc *pMethodDesc, PCODE pEntryPoint) {};
static VOID MethodJitting(MethodDesc *pMethodDesc, COR_ILMETHOD_DECODER* methodDecoder, SString *namespaceOrClassName, SString *methodName, SString *methodSignature);
static VOID MethodJitted(MethodDesc *pMethodDesc, SString *namespaceOrClassName, SString *methodName, SString *methodSignature, PCODE pNativeCodeStartAddress, PrepareCodeConfig *pConfig);
static VOID StubInitialized(ULONGLONG ullHelperStartAddress, LPCWSTR pHelperName) {};
static VOID StubInitialized(ULONGLONG ullHelperStartAddress, ULONG ulHelperSize, LPCWSTR pHelperName) {};
static VOID MethodRestored(MethodDesc * pMethodDesc) {};
static VOID DynamicMethodDestroyed(MethodDesc *pMethodDesc) {};
static VOID LogMethodInstrumentationData(MethodDesc* method, uint32_t cbData, BYTE *data, TypeHandle* pTypeHandles, uint32_t numTypeHandles, MethodDesc** pMethods, uint32_t numMethods) {};
Expand Down
47 changes: 0 additions & 47 deletions src/coreclr/inc/holder.h
Original file line number Diff line number Diff line change
Expand Up @@ -1128,53 +1128,6 @@ struct CoTaskMemTraits final
template<typename T>
using CoTaskMemHolder = LifetimeHolder<CoTaskMemTraits<T>>;

//-----------------------------------------------------------------------------
// StubHolder : holder for runtime-emitted Stub-like objects.
// On scope exit, calls DecRef through the executable-memory
// writer-holder so the refcount field can be written.
//
// Note: StubHolder does NOT call IncRef on assignment - the caller owns
// matching IncRef/DecRef pairing on the value it hands to the holder.
//
// Usage example:
//
// {
// StubHolder<Stub> foo;
// foo = new Stub();
// foo->AddRef();
// } // foo->DecRef() on out of scope
//-----------------------------------------------------------------------------
template<typename T>
class ExecutableWriterHolderNoLog;

class ExecutableAllocator;

template<typename T>
struct StubTraits final
{
using Type = T*;
static constexpr Type Default() { return nullptr; }
static void Free(Type value)
{
STATIC_CONTRACT_WRAPPER;
if (value != nullptr)
{
#ifdef LOG_EXECUTABLE_ALLOCATOR_STATISTICS
#ifdef HOST_UNIX
ExecutableAllocator::LogUsage(__FILE__, __LINE__, __PRETTY_FUNCTION__);
#else
ExecutableAllocator::LogUsage(__FILE__, __LINE__, __FUNCTION__);
#endif
#endif // LOG_EXECUTABLE_ALLOCATOR_STATISTICS
ExecutableWriterHolderNoLog<T> stubWriterHolder(value, sizeof(T));
stubWriterHolder.GetRW()->DecRef();
}
}
};

template<typename T>
using StubHolder = LifetimeHolder<StubTraits<T>>;

//
// We need the following methods to have volatile arguments, so that they can accept
// raw pointers in addition to the results of the & operator on Volatile<T>.
Expand Down
19 changes: 2 additions & 17 deletions src/coreclr/vm/appdomain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,28 +188,14 @@ FORCEINLINE void PinnedHeapHandleBlockHolder__StaticFree(PinnedHeapHandleBlockH
pHolder->FreeData();
};

//--------------------------------------------------------------------------------------
// Base class for domains. It provides an abstract way of finding the first assembly and
// for creating assemblies in the domain. The system domain only has one assembly, it
// contains the classes that are logically shared between domains. All other domains can
// have multiple assemblies. Iteration is done be getting the first assembly and then
// calling the Next() method on the assembly.
//
// The system domain should be as small as possible, it includes object, exceptions, etc.
// which are the basic classes required to load other assemblies. All other classes
// should be loaded into the domain. Of coarse there is a trade off between loading the
// same classes multiple times, requiring all domains to load certain assemblies (working
// set) and being able to specify specific versions.
//

#define LOW_FREQUENCY_HEAP_RESERVE_SIZE (3 * minipal_getpagesize())
#define LOW_FREQUENCY_HEAP_COMMIT_SIZE (1 * minipal_getpagesize())

#define HIGH_FREQUENCY_HEAP_RESERVE_SIZE (8 * minipal_getpagesize())
#define HIGH_FREQUENCY_HEAP_COMMIT_SIZE (1 * minipal_getpagesize())

#define STUB_HEAP_RESERVE_SIZE (3 * minipal_getpagesize())
#define STUB_HEAP_COMMIT_SIZE (1 * minipal_getpagesize())
#define EXECUTABLE_HEAP_RESERVE_SIZE (3 * minipal_getpagesize())
#define EXECUTABLE_HEAP_COMMIT_SIZE (1 * minipal_getpagesize())

#define STATIC_FIELD_HEAP_RESERVE_SIZE (2 * minipal_getpagesize())
#define STATIC_FIELD_HEAP_COMMIT_SIZE (1 * minipal_getpagesize())
Expand Down Expand Up @@ -1297,7 +1283,6 @@ class AppDomain final
}
#endif // FEATURE_COMINTEROP

PTR_LoaderHeap GetStubHeap();
PTR_LoaderHeap GetLowFrequencyHeap();
PTR_LoaderHeap GetHighFrequencyHeap();

Expand Down
7 changes: 0 additions & 7 deletions src/coreclr/vm/appdomain.inl
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,4 @@ inline PTR_LoaderHeap AppDomain::GetLowFrequencyHeap()
return GetLoaderAllocator()->GetLowFrequencyHeap();
}

inline PTR_LoaderHeap AppDomain::GetStubHeap()
{
WRAPPER_NO_CONTRACT;
return GetLoaderAllocator()->GetStubHeap();
}

#endif // _APPDOMAIN_I

4 changes: 2 additions & 2 deletions src/coreclr/vm/array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,7 @@ class ArrayOpLinker : public ILStubLinker
}
};

Stub *GenerateArrayOpStub(ArrayMethodDesc* pMD)
PCODE GenerateArrayOpStub(ArrayMethodDesc* pMD)
{
STANDARD_VM_CONTRACT;

Expand Down Expand Up @@ -908,7 +908,7 @@ Stub *GenerateArrayOpStub(ArrayMethodDesc* pMD)
NULL,
&sl);

return Stub::NewStub(JitILStub(pStubMD));
return JitILStub(pStubMD);
}


Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/vm/array.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class MethodTable;


Stub *GenerateArrayOpStub(ArrayMethodDesc* pMD);
PCODE GenerateArrayOpStub(ArrayMethodDesc* pMD);



Expand Down
7 changes: 0 additions & 7 deletions src/coreclr/vm/assembly.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -557,13 +557,6 @@ PTR_LoaderHeap Assembly::GetHighFrequencyHeap()
}


PTR_LoaderHeap Assembly::GetStubHeap()
{
WRAPPER_NO_CONTRACT;

return GetLoaderAllocator()->GetStubHeap();
}

Module *Assembly::FindModuleByExportedType(mdExportedType mdType,
Loader::LoadFlag loadFlag,
mdTypeDef mdNested,
Expand Down
2 changes: 0 additions & 2 deletions src/coreclr/vm/assembly.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,6 @@ class Assembly

PTR_LoaderHeap GetLowFrequencyHeap();
PTR_LoaderHeap GetHighFrequencyHeap();
PTR_LoaderHeap GetStubHeap();

PTR_Module GetModule()
{
LIMITED_METHOD_CONTRACT;
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/vm/cgensys.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#define __cgensys_h__

class MethodDesc;
class Stub;
class Thread;
class CrawlFrame;
struct EE_ILEXCEPTION_CLAUSE;
Expand Down
23 changes: 0 additions & 23 deletions src/coreclr/vm/class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,29 +81,6 @@ void EEClass::Destruct()
#endif // FEATURE_COMINTEROP_UNMANAGED_ACTIVATION
#endif // FEATURE_COMINTEROP


if (IsDelegate())
{
DelegateEEClass* pDelegateEEClass = (DelegateEEClass*)this;
for (Stub* pThunk : {pDelegateEEClass->m_pStaticCallStub, pDelegateEEClass->m_pInstRetBuffCallStub})
{
if (pThunk == nullptr)
continue;

_ASSERTE(pThunk->IsShuffleThunk());

if (pThunk->HasExternalEntryPoint()) // IL thunk
{
pThunk->DecRef();
}
else
{
ExecutableWriterHolder<Stub> stubWriterHolder(pThunk, sizeof(Stub));
stubWriterHolder.GetRW()->DecRef();
}
}
}

#ifdef FEATURE_COMINTEROP
if (GetSparseCOMInteropVTableMap() != NULL)
delete GetSparseCOMInteropVTableMap();
Expand Down
8 changes: 2 additions & 6 deletions src/coreclr/vm/class.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ class MethodDescChunk;
class MethodTable;
class Module;
class Object;
class Stub;
enum class AsyncMethodFlags;
class Substitution;
class SystemDomain;
Expand Down Expand Up @@ -1898,8 +1897,8 @@ class DelegateEEClass : public EEClass
{
public:
DAC_ALIGNAS(EEClass) // Align the first member to the alignment of the base class
PTR_Stub m_pStaticCallStub;
PTR_Stub m_pInstRetBuffCallStub;
PCODE m_pStaticCallStub;
PCODE m_pInstRetBuffCallStub;
PTR_MethodDesc m_pInvokeMethod;
PCODE m_pMultiCastInvokeStub;
UMThunkMarshInfo* m_pUMThunkMarshInfo;
Expand All @@ -1920,9 +1919,6 @@ class DelegateEEClass : public EEClass
LIMITED_METHOD_CONTRACT;
// Note: Memory allocated on loader heap is zero filled
}

// We need a LoaderHeap that lives at least as long as the DelegateEEClass, but ideally no longer
LoaderHeap *GetStubHeap();
#endif // !DACCESS_COMPILE

};
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/vm/classcompat.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class MethodNameHash;
class MethodTable;
class Module;
class Object;
class Stub;
class Substitution;
class SystemDomain;
class TypeHandle;
Expand Down
Loading