summaryrefslogtreecommitdiff
path: root/src/vm/util.cpp
AgeCommit message (Collapse)AuthorFilesLines
2019-07-19Fix typo: `_TARGET_X86` -> `_TARGET_X86_` (#25788)Andy Hanson1-1/+1
This typo was in #24989 so would be a new regression in 3.0. In an x86 build, it causes us to not get the cache size correct, leading us to use a smaller default cache size and do more GCs. Tested with GCPerfSim and this PR reduces TotalNumberGCs by 33% using an x86 build.
2019-06-11Fall back to CpuId if failed to get cache size from OS (#24989)Andy Hanson1-57/+58
* Fall back to CpuId if failed to get cache size from OS It's possible for GetLogicalProcessorCacheSizeFromOS() to fail; this happens on alpine linux where it compiles to just `return 0;`. As a fallback, we can get the cache size from CpuId. Previously that was specific to x86; this PR preserves the behavior that we never call GetLogicalProcessorCacheSizeFromOS on x86. CpuId only works on x86 and amd64; on other systems we may still return 0 from here. Then GC defaults to a cache size of only 0.25MB. Note: Removed the code in an `#ifdef _WIN64` that was nested inside of `#if defined (_TARGET_X86_)`. Presuming that is dead code. * Fix exception handler
2019-06-11Delete dead code (#25066)Jan Kotas1-33/+0
2019-06-07Reduce indirect function calls (#24980)David Wrighton1-16/+0
* Reduce indirect dispatch in hot paths in metadata * Remove allocation indirections in utilcode for coreclr - we no longer have a multi-dll distribution of code that needs to share heaps * Remove unused code in GetCLRFunction * Remove virtual dispatch around impl/decl methodtable access in MethodData
2019-05-30Remove unused code in vm/util.* (#24863)Aaron Robinson1-314/+3
* Remove unused code in vm/util.*
2019-05-29Remove all uses of CanRunManagedCode() (#24847)Aaron Robinson1-5/+0
* Remove all uses of CanRunManagedCode()
2019-05-15Remove concept of AppDomains from the GC (#24536)David Wrighton1-43/+0
* Remove concept of AppDomains from the GC - Leave constructs allowing for multiple handle tables, as scenarios for that have been proposed - Remove FEATURE_APPDOMAIN_RESOURCE_MONITORING
2019-05-13Delete InternalCasingHelper (#24511)Jan Kotas1-173/+0
The unmanaged runtime has number of different paths for case-insensitive operations, each with unique issues. This is replacing InternalCasingHelper with SString to reduce number of different paths for case-insensitive operations that need to be maintained. Contributes to #20616
2019-03-07conversionSinan Kaya1-1/+1
2019-02-18Remove resetting of unmanaged thread locale from thread pool APIs (#22682)Jan Kotas1-19/+0
The cost of doing this is showing up in the TechEmpower profiles. There is a lot of thread locale state in unmanaged libraries and OS APIs that the threadpool friendly code has to be aware off. It does not make sense to keep reseting just the Locale.
2019-01-29To support container scenario, 2 HardLimit configs are added - (#22180)Maoni Stephens1-1/+1
GCHeapHardLimit - specifies a hard limit for the GC heap GCHeapHardLimitPercent - specifies a percentage of the physical memory this process is allowed to use If both are specified, GCHeapHardLimit is checked first and only when it's not specified would we check GCHeapHardLimitPercent. If neither is specified but the process is running inside a container with a memory limit specified, we will take this as the hard limit: max (20mb, 75% of the memory limit on the container) If one of the HardLimit configs is specified, and the process is running inside a container with a memory limit, the GC heap usage will not exceed the HardLimit but the total memory is still the memory limit on the container so when we calculate the memory load it's based off the container memory limit. An example, process is running inside a container with 200mb limit user also specified GCHeapHardLimit as 100mb. if 50mb out of the 100mb is used for GC, and 100mb is used for other things, the memory load is (50 + 100)/200 = 75%. Some notes on these configs - + The limit is the commit size. + This is only supported on 64-bit. + For Server GC the minimum *reserved* segment size is 16mb per heap, this is to avoid the scenario where the hard limit is small but the process can use many procs and we end up with tiny segments which doesn't make sense. We then keep track of the committed on the segments so the total does not exceed the hard limit.
2019-01-23Remove all traces of FEATURE_STACK_PROBE. (#22149)Filip Navara1-32/+1
2018-08-31[local gc] move DacNotifyGCMarkEnd and AnalyzeSurvivorsRequested to ↵David Mason1-1/+1
GCToEEInterface (#19774)
2018-03-19Delete unused downlevel globalization support (#17022)Jan Kotas1-7/+2
Delete ENABLE_DOWNLEVEL_FOR_NLS and everything under it
2018-01-29Perform PhysicalMemoryLimit check for workstation GC, refactor ↵Tom Deseyn1-3/+29
GetLargestOnDieCacheSize into GetCacheSizePerLogicalCpu (#15975) * refactor: combine GetLargestOnDieCacheSize and GetLogicalCpuCount in GetCacheSizePerLogicalCpu * Perform PhysicalMemoryLimit check also for workstation GC
2017-09-18Change jit notifications so that they pass the native code address. (#14021)David Mason1-7/+8
* Change jit notifications so that they pass the native code address. This fixes !bpmd so that it will set the correct breakpoint on tiered jitted methods. * code review feedback * don't handle OnCodeGenerated
2017-08-17Support GDBJIT on NI/IL_STUBS (#13417)Jonghyun Park1-9/+1
* Support GDBJIT on NI/IL_STUBS * Move tls_isSymReaderInProgress into gdbjit.cpp
2017-08-02[Arm64] GetLargestOnDieCacheSize (#13071)Steve MacLean1-8/+9
Look for cache info in /sys/.../cache/index*/size If that fails estimate cache size based on processor count
2017-07-05Jitted Code Pitching Feature implementedsergey ignatov1-6/+6
2017-05-17Finish deleting dead CAS code from CoreLib (#11436)Jan Kotas1-470/+0
Fixes #9321 and deletes CleanupToDoList.cs Delete unmanaged security implementation
2017-04-20[x86/Linux] Use CDECL as STDAPICALLTYPE (#10969)Jonghyun Park1-5/+5
* [x86/Linux] Use CDECL as STDAPICALLTYPE * Use system default calling convention for internal functions
2017-03-05Remove hosting methods that always return false (#9930)Austin Wise1-9/+0
* Remove CLRIoCompletionHosted as it always returns false. * Remove CLRSyncHosted as it always returns false. * Remove CLRMemoryHosted as it always returns false. * Remove CLRTaskHosted as it always returns false. * Remove CLRAssemblyHosted, CLRGCHosted,and CLRSecurityHosted. They are not called. * Remove IsThreadPoolHosted as it always returns false. * Remove EnterRuntime and LeaveRuntime, as they do nothing. * Add back calls to RevertIfImpersonated and GCX_PREEMP. I accidentally deleted the call to RevertIfImpersonated instead of just removing an extra parameter. When I removed the HR_LEAVE_RUNTIME_HOLDER macro from windowsruntime.h, I not only removed a LeaveRuntimeHolder but also a GCX_PREEMP. So I added it back. The holder and GCX_PREEMP where only inserted when the FEATURE_LEAVE_RUNTIME_HOLDER macro was defined. Since it is always defined, I removed it. Also as I understand it, you would always want to have a GCX_PREEMP before calling into the Windows API as not to block the GC, so I'm not sure why you would want to disable it.
2017-02-14Remove never defined FEATURE_INCLUDE_ALL_INTERFACESdanmosemsft1-61/+0
2017-02-11Revert "Remove always defined FEATURE_CORESYSTEM"danmosemsft1-0/+81
This reverts commit 751771a8976f909af772e35c167bd7e3ffbe44c8.
2017-02-10Remove always defined FEATURE_CORECLRdanmosemsft1-13/+0
2017-02-10Remove always defined FEATURE_CORESYSTEMdanmosemsft1-81/+0
2016-12-08[x86/Linux] Fix inconsistent GetCLRFunction definitions (#8472)Jonghyun Park1-1/+1
* [x86/Linux] Fix inconsistency in GetCLRFunction definitions GetCLRFunction is treated as pfnGetCLRFunction_t which has __stdcall convention, but is implemented without __stdcall. This inconsistency causes segmentaion fault while initializing CoreCLR for x86/Linux. This commit fixes such inconsistency via adding __stdcall to GetCLRFunction implementation. In addition, this commit declares GetCLRFuntion in 'utilcode.h' and and revises .cpp files to include 'utilcode.h' instead of declaring 'GetCLRFunction'. * Remove unnecessary includes * Remove another unnecessay include
2016-12-01fix permissive C++ code (MSVC /permissive-) (#8337)Phil Christensen1-12/+13
* fix permissive C++ code (MSVC /permissive-) These were found by the C++ compiler group when doing "Real world code" build tests using /permissive-. We are sharing these with you to help you clean up your code before the new version of the compiler comes out. For more information on /permissive- see https://blogs.msdn.microsoft.com/vcblog/2016/11/16/permissive-switch/. ---------------------------- Under /permissive-, skipping the initialization of a variable is not allowed. As an extension the compiler allowed this when there was no destructor for the type. void func(bool b) { if(b) goto END; int value = 0; //error C2362: initialization of 'value' is skipped by 'goto END' int array[10]; //Okay, not initialized. //... value used here END: return; } Fix 1) Limit the scope of value: { int value = 0; //... value used here } END: Fix 2) Initialize/declare value before the 'goto' int value = 0; if(b) goto END; //... value used here END: Fix 3) Don't initialize value in the variable declaration. int value; value = 0 //... value used here END: ------------------- Alternative token representations. The following are reserved as alternative representations for operators: and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq //Can't use reserved names for variables: static int and = 0; // Change name (possibly to 'and_') void func() { _asm { xor edx,edx // xor is reserved, change to uppercase XOR or eax,eax // or is reserved, change to uppercase OR } } * Apply formatting patch. * fixes from code review. I addressed @janvorli requests from the pull request code review.
2016-10-27Introduce new CORJIT_FLAGS typeBruce Forstall1-10/+3
The "JIT flags" currently passed between the EE and the JIT have traditionally been bit flags in a 32-bit word. Recently, a second 32-bit word was added to accommodate additional flags, but that set of flags is definitely "2nd class": they are not universally passed, and require using a separate set of bit definitions, and comparing those bits against the proper, 2nd word. This change replaces all uses of bare DWORD or 'unsigned int' types representing flags with CORJIT_FLAGS, which is now an opaque type. All flag names were renamed from CORJIT_FLG_* to CORJIT_FLAG_* to ensure all cases were changed to use the new names, which are also scoped within the CORJIT_FLAGS type itself. Another motivation to do this, besides cleaner code, is to allow enabling the SSE/AVX flags for x86. For x86, we had fewer bits available in the "first word", so would have to either put them in the "second word", which, as stated, was very much 2nd class and not plumbed through many usages, or we could move other bits to the "second word", with the same issues. Neither was a good option. RyuJIT compiles with both COR_JIT_EE_VERSION > 460 and <= 460. I introduced a JitFlags adapter class in jitee.h to handle both JIT flag types. All JIT code uses this JitFlags type, which operates identically to the new CORJIT_FLAGS type. In addition to introducing the new CORJIT_FLAGS type, the SSE/AVX flags are enabled for x86. The JIT-EE interface GUID is changed, as this is a breaking change.
2016-09-02LTO build: fix perf regression from strict alias violation and incorrect ↵kchoi1-6/+9
inline assembly (#7018) Fix inline assembly implementation of getextcpuid() and strict aliasing violations in its callers The implementation writes to the unsigned char result array, so the clobber "memory" is needed. As well its callers have strict aliasing violations from reading the result array as a DWORD array. The fix is to memcpy the resulting buffer onto the DWORD array.
2016-07-28Merge pull request #6278 from Dmitri-Botcharnikov/feature-gdbjitnoahfalk1-1/+16
[Linux] GDB JIT support for source line debug information.
2016-07-27Add flag to check re-entrancy of JIT notificationEvgeny Pavlov1-1/+7
2016-07-25Arm64: DebuggerRama Krishnan Raghupathy1-0/+40
Instruction emulation for Break Points Debugger::FuncEvalSetup NativeWalker ExceptionHijack Exception intercept Managed Return Value
2016-07-22Add GDB JIT support for source line debug information.Dmitri Botcharnikov1-1/+10
2016-02-16Finish fixing VSO #190301. DACRaiseException need some STATIC_ contracts.Mike McLaughlin1-2/+4
[tfs-changeset: 1575640]
2016-02-11Fix VSO bug #190301 contract problems in DACRaiseException.Mike McLaughlin1-6/+76
Added the proper contracts to the DAC notification functions.
2016-02-10Fix SOS managed breakpoints when coreclr symbols are stripped.Mike McLaughlin1-12/+41
Added a SOS DAC interface (ISOSDacInterface4::GetClrNotification) to get the exception notification arguments instead of using the GetLastExceptionInformation function from the lldb sosplugin that depends on coreclr symbols being present. On the coreclr side, the clr notification arguments are saved in a global variable that is DAC accessible. A critical section was added to protect this global variable while the special exception is raised. Setting the internal COMPlus_DebugBreakOnAssert environment variable causes 3 or 4 breaks in the debugger with no reason. It was breaking in the function that was determining whether it should break. I was using COMPlus_BreakOnEELoad=2 to break after coreclr was loaded and initialized to set managed breakpoints and on a debug build it generates an assert (on release just a DebugBreak).
2016-01-27Update license headersdotnet-bot1-4/+3
2015-09-25Fix for 134453: fix prefast warningsRahul Kumar1-1/+1
[tfs-changeset: 1529946]
2015-08-27Replace missed MAX_PATH defines with new defines in vm.Lakshmi Priya Sekar1-1/+1
2015-08-25Replace MAX_PATH with new defines in vm.Lakshmi Priya Sekar1-11/+11
2015-07-24Add ARM target for CoreCLR on Linux.Ben Pye1-1/+0
c_runtime/vprintf/test1 is disabled as casting NULL to va_list is against the C specification. Fix SetFilePointer tests on 32 bit platforms. Define _FILE_OFFSET_BITS=64 so that we have long file support on 32 bit platforms. Implement context capture/restore for ARM. Link libgcc_s before libunwind on ARM so C++ exceptions work. Translate armasm to gas syntax. Specify Thumb, VFPv3, ARMv7 for the ARM target. Add ARM configuration to mscorlib build Implement GetLogicalProcessorCacheSizeFromOS in PAL. Set UNWIND_CONTEXT_IS_UCONTEXT_T from configure check.
2015-03-17Fix some of the issues found by Viva64 static analyserJan Kotas1-5/+3
2015-03-12Implement GetLogicalCpuCountFromOS in the PAL for OSXGeoff Norton1-3/+3
2015-01-30Initial commit to populate CoreCLR repo dotnet-bot1-0/+4000
[tfs-changeset: 1407945]