summaryrefslogtreecommitdiff
path: root/src/vm/i386
diff options
context:
space:
mode:
authorTom Deseyn <tom.deseyn@gmail.com>2018-01-29 21:11:10 +0100
committerMaoni Stephens <Maoni0@users.noreply.github.com>2018-01-29 12:11:10 -0800
commitcb73944d6d159bd02adc29f0588b97f0f76da1a1 (patch)
tree9c4f406b9d5bf886c64fceb19213c25176e988cd /src/vm/i386
parent850a5bea5b8c317250f7f7ef85152d92468382b0 (diff)
downloadcoreclr-cb73944d6d159bd02adc29f0588b97f0f76da1a1.tar.gz
coreclr-cb73944d6d159bd02adc29f0588b97f0f76da1a1.tar.bz2
coreclr-cb73944d6d159bd02adc29f0588b97f0f76da1a1.zip
Perform PhysicalMemoryLimit check for workstation GC, refactor GetLargestOnDieCacheSize into GetCacheSizePerLogicalCpu (#15975)
* refactor: combine GetLargestOnDieCacheSize and GetLogicalCpuCount in GetCacheSizePerLogicalCpu * Perform PhysicalMemoryLimit check also for workstation GC
Diffstat (limited to 'src/vm/i386')
-rw-r--r--src/vm/i386/cgenx86.cpp83
1 files changed, 0 insertions, 83 deletions
diff --git a/src/vm/i386/cgenx86.cpp b/src/vm/i386/cgenx86.cpp
index a43bc8558a..492cec4668 100644
--- a/src/vm/i386/cgenx86.cpp
+++ b/src/vm/i386/cgenx86.cpp
@@ -1513,89 +1513,6 @@ extern "C" DWORD __stdcall xmmYmmStateSupport()
#endif // !FEATURE_PAL
-// This function returns the number of logical processors on a given physical chip. If it cannot
-// determine the number of logical cpus, or the machine is not populated uniformly with the same
-// type of processors, this function returns 1.
-DWORD GetLogicalCpuCount()
-{
- // No CONTRACT possible because GetLogicalCpuCount uses SEH
-
- STATIC_CONTRACT_THROWS;
- STATIC_CONTRACT_GC_NOTRIGGER;
-
- static DWORD val = 0;
-
- // cache value for later re-use
- if (val)
- {
- return val;
- }
-
- struct Param : DefaultCatchFilterParam
- {
- DWORD retVal;
- } param;
- param.pv = COMPLUS_EXCEPTION_EXECUTE_HANDLER;
- param.retVal = 1;
-
- PAL_TRY(Param *, pParam, &param)
- {
- unsigned char buffer[16];
- DWORD* dwBuffer = NULL;
-
- DWORD maxCpuId = getcpuid(0, buffer);
-
- if (maxCpuId < 1)
- goto lDone;
-
- dwBuffer = (DWORD*)buffer;
-
- if (dwBuffer[1] == 'uneG') {
- if (dwBuffer[3] == 'Ieni') {
- if (dwBuffer[2] == 'letn') { // get SMT/multicore enumeration for Intel EM64T
-
- // TODO: Currently GetLogicalCpuCountFromOS() and GetLogicalCpuCountFallback() are broken on
- // multi-core processor, but we never call into those two functions since we don't halve the
- // gen0size when it's prescott and above processor. We keep the old version here for earlier
- // generation system(Northwood based), perf data suggests on those systems, halve gen0 size
- // still boost the performance(ex:Biztalk boosts about 17%). So on earlier systems(Northwood)
- // based, we still go ahead and halve gen0 size. The logic in GetLogicalCpuCountFromOS()
- // and GetLogicalCpuCountFallback() works fine for those earlier generation systems.
- // If it's a Prescott and above processor or Multi-core, perf data suggests not to halve gen0
- // size at all gives us overall better performance.
- // This is going to be fixed with a new version in orcas time frame.
-
- if( (maxCpuId > 3) && (maxCpuId < 0x80000000) )
- goto lDone;
-
- val = GetLogicalCpuCountFromOS(); //try to obtain HT enumeration from OS API
- if (val )
- {
- pParam->retVal = val; // OS API HT enumeration successful, we are Done
- goto lDone;
- }
-
- val = GetLogicalCpuCountFallback(); // OS API failed, Fallback to HT enumeration using CPUID
- if( val )
- pParam->retVal = val;
- }
- }
- }
-lDone: ;
- }
- PAL_EXCEPT_FILTER(DefaultCatchFilter)
- {
- }
- PAL_ENDTRY
-
- if (val == 0)
- {
- val = param.retVal;
- }
-
- return param.retVal;
-}
-
void UMEntryThunkCode::Encode(BYTE* pTargetCode, void* pvSecretParam)
{
LIMITED_METHOD_CONTRACT;