Age | Commit message (Collapse) | Author | Files | Lines |
|
required (#22560)
* These changes enable the inlining of some PInvokes that do not require any marshalling. With inlined pinvokes, R2R performance should become slightly better, since we'll avoid jitting some of the pinvoke IL stubs that we jit today for S.P.CoreLib. Performance gains not yet measured.
* Added JIT_PInvokeBegin/End helpers for all architectures. Linux stubs not yet implemented
* Add INLINE_GETTHREAD for arm/arm64
* Set CORJIT_FLAG_USE_PINVOKE_HELPERS jit flag for ReadyToRun compilations
* Updating R2RDump tool to handle pinvokes
|
|
It fixes COR_CTOR_METHOD_NAME_W and many other macros on Linux
to be of type char16_t[] (not wchar_t[]) by using W("") instead of L"".
Bug: #21977
|
|
llvm
|
|
* Extend WindowsEventLog test
Verify EntryPointFilter solves logging problem with native host swallowing exceptions
WindowsEventLog only look at new entries
WindowsEventLog remove time check
Add mechanism to corhost to emulate host swallowing all exceptions
* PR feedback
|
|
* FindResource direct implementation in PEDecoder
* Fixup bugs identified in resource reading
|
|
Socket #23334 (#23357)
- Attempt to close-behind unix domain socket and repurpose LF_REMOTING facility.
- On shutdown, attempt to unlink the bound socket so it can be removed from the file system when the last reference to it it closed.
- Rename unused LF_REMOTING to LF_DIAGNOSTICS_PORT. This new flag will be used by the diagnostic server stress log calls.
- libcmtd.lib(initializers.obj) : warning LNK4098: defaultlib 'libcmt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library [S:\github.com\jorive\coreclr\bin\obj\Windows_NT.x64.Checked\src\dlls\mscoree\coreclr\coreclr.vcxproj]
- Move some preprocessors and includes around.
|
|
Utf8String is an experimental type that is string-like (heap-allocated, immutable, variable-length, null-terminated) but whose inner representation is UTF-8, not UTF-16.
This is a skeleton implementation of the basic API shape. The ecosystem of APIs has not yet been built around it. All Utf8String-related code is currently surrounded by ifdefs to allow easy identification and removal from release branches.
|
|
(#23106)
This is the first commit to enable a "diagnostic port" using IPC (Named Pipe on Windows and Unix Domain Socket on other platforms). This change currently enable EventPipe to be enabled/disabled without the use of a file drop.
- Split the DiagnosticsIpc into (DiagnosticsIpc/IpcStream)
- DiagnosticsIpc (IPC listener) is meant to be used by the Diagnostic server.
- IpcStream (IPC channel) is meant to be use to communicate with the connected client.
- Change the FastSerializer dependency from `CFileStream` to `StreamWriter`
This abstraction is meant decouple the writing of objects in order to extend its usability.
The main objective is to reuse FastSerializer to stream data through the open IPC channel.
- Moved the EventPipeSessionProvider* classes to their own file.
- Added a more streamlined parsing achievable by defining a simpler binary protocol (by noahfalk).
1. Only one allocation is needed for the EventPipeProviderConfiguration array, no allocations or copies are needed for strings because we can refer to them directly out of the incoming command buffer
2. No change to the EventPipe API for enable is required. EventPipeProviderConfiguration retains its current behavior of not deleting the string pointers it holds.
3. No leaks happen because the command buffer owns the string memory and ensures that it stays alive for the duration of the Enable() call.
|
|
.Net -> .NET
|
|
* Use HKLM for CLSID lookup
* Delete unused functions
|
|
Fix no-return false positives in static analyzer build
|
|
GCC doesn't like attributes before the extern keyword.
|
|
There were about 800 false positive issues in the clang status analyzer
build caused by the fact that various forms of asserts were not considered
by the analyzer as not returning.
This change adds __attribute__((analyzer_noreturn)) (wrapped in a macro) to
those assertion functions.
|
|
GCC Signed compare and Narrowing warnings
|
|
|
|
|
|
Remove IsContinuableException declaration & fix comment
Clean up ThreadBaseRedirectingFilter
Clean up comment
Cleanup dead code
|
|
* Add parenthesis
src/vm/sha1.cpp: In function ‘void SHA1_block(SHA1_CTX*)’:
src/vm/sha1.cpp:93:29: warning: suggest parentheses around arithmetic in operand of ‘|’ [-Wparentheses]
#define ROUND3(B, C, D) ((C & (B | D) | (B & D)) + sha1_round3)
^
src/vm/sha1.cpp:139:32: note: in expansion of macro ‘ROUND3’
e += ROTATE32L(a, 5) + ROUND3(b, c, d) + msg80[i];
* Move declaration into same file as one was defined Extern the other one was static
* Remove hr=hr undefined assignment
* Fix mutli-line comment warning
* Convert multi-character literal
* Remove null check for stack local variables
rc/vm/invokeutil.cpp: In static member function ‘static void InvokeUtil::SetValidField(CorElementType, TypeHandle, FieldDesc*, OBJECTREF*, OBJECTREF*, TypeHandle, CLR_BOOL*)’:
src/vm/invokeutil.cpp:978:29: warning: the address of ‘Throwable’ will never be NULL [-Waddress]
EX_CATCH_THROWABLE(&Throwable);
^
src/inc/ex.h:1087:21: note: in definition of macro ‘EX_CATCH_THROWABLE’
if (NULL != ppThrowable)
^
|
|
|
|
(#22895)
|
|
added a profiling event mask in the high 32-bit, COR_PRF_HIGH_BASIC_GC, for basic GC monitoring. it can be set via `ICorProfilerInfo5::SetEventMask2`. all this gives you is
* GC start callback
* GC end callback
* update generational bounds
note that one different behavior between this and the existing COR_PRF_MONITOR_GC is, aside from the obvious that it doesn't give you any info beyond the above, is that the GC end callback + update generational bounds are enabled for _all_ GCs, not just non concurrent GCs. I kept the behavior the same for COR_PRF_MONITOR_GC because I don't want to risk breaking existing profiling tools that do not anticipate these for concurrent GCs.
|
|
|
|
* Replace __sync_swap with __atomic_exchange_n
__sync_swap() is a clang specific function.
* Remove multiline comment
* Add paranthesis around sum
src/md/hotdata/../inc/streamutil.h:73:34: warning: suggest parentheses around ‘+’ in operand of ‘&’ [-Wparentheses]
UINT32 aligned = *totalBytes + 3 & ~3;
* Define __int64
* Define windows types for tests
* Remove undefined has_builtin defines and define alloca and inline for GNUC
* Remove __clang__ where possible
* Add implicit casting to help compiler find WCHAR* variant
src/binder/assembly.cpp:294:73: error: no matching function for call to ‘SString::SString(SString)’
return (pAsmName == nullptr ? nullptr : pAsmName->GetSimpleName());
^
In file included from src/inc/sstring.h:1082:0,
from src/inc/ex.h:19,
from src/inc/stgpool.h:28,
from src/inc/../md/inc/metamodel.h:18,
from src/inc/../md/inc/metamodelro.h:19,
from src/inc/metadata.h:17,
from src/binder/../vm/util.hpp:19,
from src/binder/../vm/common.h:110,
from src/binder/assembly.cpp:14:
src/inc/sstring.inl:73:8: note: candidate: SString::SString(void*, COUNT_T)
inline SString::SString(void *buffer, COUNT_T size)
^
src/inc/sstring.inl:73:8: note: candidate expects 2 arguments, 1 provided
src/inc/sstring.inl:436:8: note: candidate: SString::SString(SString::tagLiteral, const WCHAR*, COUNT_T)
inline SString::SString(tagLiteral dummytag, const WCHAR *literal, COUNT_T count)
^
src/inc/sstring.inl:436:8: note: candidate expects 3 arguments, 1 provided
src/inc/sstring.inl:418:8: note: candidate: SString::SString(SString::tagLiteral, const WCHAR*)
inline SString::SString(tagLiteral dummytag, const WCHAR *literal)
^
src/inc/sstring.inl:418:8: note: candidate expects 2 arguments, 1 provided
src/inc/sstring.inl:401:8: note: candidate: SString::SString(SString::tagUTF8Literal, const UTF8*)
inline SString::SString(tagUTF8Literal dummytag, const UTF8 *literal)
^
src/inc/sstring.inl:401:8: note: candidate expects 2 arguments, 1 provided
src/inc/sstring.inl:382:8: note: candidate: SString::SString(SString::tagLiteral, const CHAR*)
inline SString::SString(tagLiteral dummytag, const ASCII *literal)
* Reorder DLLEXPORT and STDAPI
GNUC wants extern "C" <attribute> format.
* Abstract __FUNCSIG__
* Abstract __debugbreak()
* Move common compiler options out of clang and add Wno-unused-value
* Add paranthesis around || and &&
src/gc/gc.cpp:9084:38: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
(!chosen_power2) && (i < free_space_count));
* Set Wno-delete-non-virtual-dtor for CXX files only
* Don't warn on unterminated endif labels
* Suppress unused functions
* Use 0x syntax rather than h syntax on GNU asm files
* Correct constructor call directly
src/ToolBox/superpmi/superpmi-shared/logging.cpp:301:27: required from here
src/inc/clr_std/string:58:9: error: cannot call constructor ‘std::basic_string<char>::basic_string’ directly
this->basic_string::basic_string(_Ptr, c_len(_Ptr));
* Suppress NULL used in arithmetic warnings
|
|
|
|
|
|
* removing references to COUNTER_ONLY, ENABLE_PERF_COUNTERS in src/vm directory
* removing perfcounters* files
* Fix build
* Remove PerfCounterSupportedBuild
* Some more cleanup on the GC side
|
|
(#22662)
* Abstract selectany
* Fix initializer element is not constant
src/corefx/System.Globalization.Native/pal_icushim.c:58:34: error: initializer element is not constant
static const int MaxICUVersion = MinICUVersion + 20;
* Enable ms extensions
* Apply LLVM patterns to GCC
* Remove deprecated function
* Fix const conversion error
src/corefx/System.Globalization.Native/pal_calendarData.c:390:16: warning: passing argument 1 of ‘ures_close_ptr’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
ures_close(erasResBundle);
src/corefx/System.Globalization.Native/pal_calendarData.c:419:22: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
char* name = GetCalendarName(calendarId);
* Remove old compiler option
|
|
For single-def locals, the type of a reference seen at the assignment to the
local may be a more specific type than the local's declared type. If so the jit
would prefer to use the assignment type to describe the local's value, as this
will lead to better optimization. For instance in
```
object x = "a string"; // only assignment to x
```
the jit can optimize better if it models the type of `x` as `string`.
Instead of relying on `mergeClasses` plus some jit-side screening to decide if
the assignment type is a more specific type, implement a new jit interface
method `isMoreSpecificType` that tries to answer this question more directly.
Added a test case with type equivalence that hit asserts.
Closes #22583.
|
|
* Fix ifdef for `g_DbgSuppressAllocationAsserts`.
It needs to be defined under `FEATURE_INTEROP_DEBUGGING`.
* Unify contracts disabling for UNIX/ARM.
It also disables some parts that were disabled for ARM, but not for UNIX.
It fixes the difference that we see between ARM32 and ARM64 Unix Checked.
* Disable contracts on arm64.
FIxes the difference that we see between windows arm32 and arm64 in checked/debug builds.
* Revert CoreFX arm64 timeout change.
That is no longer necessary.
* Reenable arm64 corefx jobs.
They should not fail with timeouts anymore.
* Don't allow `g_DbgSuppressAllocationAsserts` defnition in release builds.
* delete AssertAllocationAllowed
|
|
(#22285)
* GCHeapHash
- Hashtable implementation for runtime use
- Implementation written in C++
- Data storage in managed heap memory
- Based on SHash design, but using managed memory
CrossLoaderAllocatorHash
- Hash for c++ Pointer to C++ pointer where the lifetimes are controlled by different loader allocators
- Support for add/remove/visit all entries of 1 key/visit all entries/ remove all entries of 1 key
- Supports holding data which is unmanaged, but data items themselves can be of any size (key/value are templated types)
* Swap MethodDescBackpatchInfo to use the CrossLoaderAllocatorHash
* The MethodDescBackpatchCrst needs to be around an allocation
- Adjust the Crst so that it can safely be used around code which allocates
- Required moving its use out from within the EESuspend logic used in rejit
|
|
* Reorder extern "C" and visibility statements
In file included from coreclr/src/pal/inc/pal.h:70:0,
coreclr/src/pal/inc/pal_mstypes.h:30:25: error: expected unqualified-id
before string constant
#define EXTERN_C extern "C"
^
coreclr/src/pal/inc/rt/palrt.h:216:30: note:
in expansion of macro 'EXTERN_C'
#define STDAPI_(type) EXTERN_C type STDAPICALLTYPE
* Need double quotes around single quotes in error statements
fix error statements
Can't have ' character in error statement
* Abstract __declspec(noinline)
Generate compiler independent macros for noinline request.
* Remove unused DBG_NOINLINE_X86__RET_INLINE
* Abstract __declspec(nothrow)
|
|
* Update comment on SuppressUnmanagedCodeSecurityAttribute.
* Remove unused declsec.h header.
|
|
|
|
|
|
Add config option to disable tier 0 JIT
Fixes https://github.com/dotnet/coreclr/issues/21856
- For methods that don't have pregenerated code, using tier 0 JIT can improve startup perf, and disabling tier 0 JIT can be useful to sacrifice some startup time to avoid issues of running tier 0 code for too long. In some cases, it may also be desirable to avoid tiering up much later.
- A fixed value for the call count indicates that tier 0 call counting is disabled. When disabled, the method starts at tier 1.
- Also modified call counting to start from a predetermined threshold and count down to zero, as it simplifies some things, allows for methods to have different thresholds, and likely is what we would want eventually anyway
- Took a small step towards eliminating knowledge of specific tier levels in code that should not care, though more is to be done there
|
|
We want to support GNU compilation for CoreCLR. Luckily both LLVM
and GNU compilers define __GNUC__ and there are a lot of things
they can share.
|
|
Throw the approved exception per dotnet/corefx#34124.
|
|
* Abstract away NOINLINE statement
MSVC and GNU compilers use different attributes for noinline.
Abstract away compiler differences.
* Replace __sync_swap with __atomic_exchange_n
__sync_swap doesn't exist on GNU. Replacing with __atomic_exchange_n
which is universally available.
* Define CDECL for GNUC
__cdecl is not defined by default on GNU compilers.
* Define gcc version of __declspec(thread)
* Correct pointer casting
A pointer value is usually unsigned long on most platforms.
Casting it to integer causes signedness issues. Use size_t
to be efficient on all 32 and 64 bit architectures.
* Put quotes around the error string
Correct error statement. GNU G++ is picky about the string
following the error statement with ' character in it. It needs
to be enclosed with double quotes.
* Fix casting problem
Seeing these warnings with GNU G++ compiler
src/pal/src/sync/cs.cpp: In function ‘void CorUnix::InternalInitializeCriticalSectionAndSpinCount(PCRITICAL_SECTION, DWORD, bool)’:
src/pal/src/sync/cs.cpp:630:48: warning: converting to non-pointer type ‘SIZE_T {aka long unsigned int}’ from NULL [-Wconversion-null]
pPalCriticalSection->OwningThread = NULL;
^
src/pal/src/sync/cs.cpp: In function ‘void CorUnix::InternalLeaveCriticalSection(CorUnix::CPalThread*, _CRITICAL_SECTION*)’:
src/pal/src/sync/cs.cpp:880:43: warning: converting to non-pointer type ‘SIZE_T {aka long unsigned int}’ from NULL [-Wconversion-null]
pPalCriticalSection->OwningThread = NULL;
^
* Abstract optnone compiler attribute
GNU compiler doesn't support optnone attribute.
pal/src/exception/seh-unwind.cpp:449:77: warning: ‘optnone’ attribute directive ignored [-Wattributes]
* Set the aligned attribute for GNU compiler
* Make __rotl and __rotr functions portable
GNU compiler doesn't have an intrinsic for these. Open code them
using the provided implementation.
* Define deprecated attribute for gcc
* Add throw specifier for GCC
/usr/include/string.h:43:28: error: declaration of ‘void* memcpy(void*, const void*, size_t) throw ()’ has a different exception specifier
size_t __n) __THROW __nonnull ((1, 2));
|
|
The checked in batch script was only usable if you have a Razzle environment and even then it didn't update the right files.
|
|
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.
|
|
|
|
|
|
|
|
this next (#22054)
* Add comments on headers that gets parsed by Mono linker for whoever touches this next
* add more comments to the targets file
|
|
* Preliminary Changes
* Module Index Resolution
* Change infoModule encoding
* Change referencing module in R2R
* Pre-condition Check
* Virtual Method Module Resolution
* Remove Workarounds and add conditional import loading
* Add signature kind module override
* Add ELEMENT_TYPE_MODULE_ZAPSIG
* Add switch to enable large version bubble
* Cleanup
* Change Native header check
* Add large version bubble test
* Add Large Version Bubble Checks
* Cleanup
* Revert unnecessary check
* Change EncodeMethod Version Bubble Condition
* Add Large Version Bubble asserts
* Cleanup
* Add default argument to runtests.py
* Change test PreCommands
* Revert whitespace changes
* Change breaking conditional check
* Streamline Version Bubble test
* Address PR Feedback
* Address PR Feedback #2
* Remove dead code
* Add crossgen-time ifdef
|
|
Patch vtable slots and similar when tiering is enabled
For a method eligible for code versioning and vtable slot backpatch:
- It does not have a precode (`HasPrecode()` returns false)
- It does not have a stable entry point (`HasStableEntryPoint()` returns false)
- A call to the method may be:
- An indirect call through the `MethodTable`'s backpatchable vtable slot
- A direct call to a backpatchable `FuncPtrStub`, perhaps through a `JumpStub`
- For interface methods, an indirect call through the virtual stub dispatch (VSD) indirection cell to a backpatchable `DispatchStub` or a `ResolveStub` that refers to a backpatchable `ResolveCacheEntry`
- The purpose is that typical calls to the method have no additional overhead when code versioning is enabled
Recording and backpatching slots:
- In order for all vtable slots for the method to be backpatchable:
- A vtable slot initially points to the `MethodDesc`'s temporary entry point, even when the method is inherited by a derived type (the slot's value is not copied from the parent)
- The temporary entry point always points to the prestub and is never backpatched, in order to be able to discover new vtable slots through which the method may be called
- The prestub, as part of `DoBackpatch()`, records any slots that are transitioned from the temporary entry point to the method's at-the-time current, non-prestub entry point
- Any further changes to the method's entry point cause recorded slots to be backpatched in `BackpatchEntryPointSlots()`
- In order for the `FuncPtrStub` to be backpatchable:
- After the `FuncPtrStub` is created and exposed, it is patched to point to the method's at-the-time current entry point if necessary
- Any further changes to the method's entry point cause the `FuncPtrStub` to be backpatched in `BackpatchEntryPointSlots()`
- In order for VSD entities to be backpatchable:
- A `DispatchStub`'s entry point target is aligned and recorded for backpatching in `BackpatchEntryPointSlots()`
- The `DispatchStub` was modified on x86 and x64 such that the entry point target is aligned to a pointer to make it backpatchable
- A `ResolveCacheEntry`'s entry point target is recorded for backpatching in `BackpatchEntryPointSlots()`
Slot lifetime and management of recorded slots:
- A slot is recorded in the `LoaderAllocator` in which the slot is allocated, see `RecordAndBackpatchEntryPointSlot()`
- An inherited slot that has a shorter lifetime than the `MethodDesc`, when recorded, needs to be accessible by the `MethodDesc` for backpatching, so the dependent `LoaderAllocator` with the slot to backpatch is also recorded in the `MethodDesc`'s `LoaderAllocator`, see `MethodDescBackpatchInfo::AddDependentLoaderAllocator_Locked()`
- At the end of a `LoaderAllocator`'s lifetime, the `LoaderAllocator` is unregistered from dependency `LoaderAllocators`, see `MethodDescBackpatchInfoTracker::ClearDependencyMethodDescEntryPointSlots()`
- When a `MethodDesc`'s entry point changes, backpatching also includes iterating over recorded dependent `LoaderAllocators` to backpatch the relevant slots recorded there, see `BackpatchEntryPointSlots()`
Synchronization between entry point changes and backpatching slots
- A global lock is used to ensure that all recorded backpatchable slots corresponding to a `MethodDesc` point to the same entry point, see `DoBackpatch()` and `BackpatchEntryPointSlots()` for examples
Due to startup time perf issues:
- `IsEligibleForTieredCompilation()` is called more frequently with this change and in hotter paths. I chose to use a `MethodDesc` flag to store that information for fast retreival. The flag is initialized by `DetermineAndSetIsEligibleForTieredCompilation()`.
- Initially, I experimented with allowing a method versionable with vtable slot backpatch to have a precode, and allocated a new precode that would also be the stable entry point when a direct call is necessary. That also allows recording a new slot to be optional - in the event of an OOM, the slot may just point to the stable entry point. There are a large number of such methods and the allocations were slowing down startup perf. So, I had to eliminate precodes for methods versionable with vtable slot backpatch and that in turn means that recording slots is necessary for versionability.
|
|
Normalize a few more spin-wait loops
- Fixed a few more spin-waits to normalize the spin-wait duration between processors
- These spin-waits have so far not needed to be retuned to avoid unreasonably long spin-wait durations. They can be retuned as necessary in the future.
- Added a version of YieldProcessorNormalized() that normalizes based on spin-wait counts tuned for pre-Skylake processors for spin-wait loops that have not been retuned.
- Moved some files around to make YieldProcessorNormalized() and the like available in more places. Initialization is still only done in the VM. Uses outside the VM will use the defaults, where there would be no significant change from before.
- Made YieldProcessor() private outside of the GC and added System_YieldProcessor() for when the system-defined implementation is intended to be used
|
|
Turns out there's a long-standing typo in CoreCLR that reverses
the helper enumeration values for DBL and FLT. This doesn't seem
to be a problem in the CoreCLR repo as such because it solely
uses the legacy identifiers CORINFO_HELP_DBLREM et al. We have
however ported the incorrect helper enumeration values into R2RDump
and ILCompiler. This change immediately fixes R2RDump as it resides
in the same repo, I'll send out the ILCompiler change in
a separate PR.
|
|
+alloc lock split into SOH and LOH
+provisional mode to fix too many gen2 GCs triggered in low mem situation when the heap has heavy pinning fragmentation
+better free list usage
+premature OOM fixes
+3 new configs: GCHeapAffinitizeMask, GCHighMemPercent, GCLOHThreshold (will be documented)
YieldProcessor scaling factor is different on core due to the different implementation on core.
|
|
This change improves detection of allocators with side effects.
Allocators can cause side effects if the allocated object may have a finalizer.
This change adds a pHasSideEffects parameter to getNewHelper JitEE interface
method. It's used by the jit to check for allocator side effects instead of
guessing from helper ids.
Fixes #21530.
|