Katelyn Gadd [Wed, 5 Apr 2023 12:23:38 +0000 (05:23 -0700)]
[wasm] Implement the ENDFINALLY opcode in the jiterpreter (#84273)
* Mark the opcode following CALL_HANDLER interpreter opcodes as a back branch target
* In the jiterpreter, record each CALL_HANDLER location when compiling them
* Then when compiling an ENDFINALLY opcode check to see whether the branch target is one we recognize and if so do a branch, otherwise bail out
* Tweak CFG to filter out branch targets that are never used
* Add browser-bench measurement for try-finally
Radek Doulik [Wed, 5 Apr 2023 11:16:13 +0000 (13:16 +0200)]
[wasm] Simd refactoring (#84170)
* [wasm] Simd refactoring
Rename few opcodes to contain `_SIMD_`.
Use more SimdIntrinsic fields to simplify the code.
* Fix build
* Fix narrowing intrinsics
* Verbose aot compilation
* Feedback
* Make it verbose on helix
* Do not set op for narrowing methods
Because `emit_hardware_intrinsics` doesn't call custom emit in such case
and so we endup with code emitted with wrong zero c0.
* Feedback
* Be quiet again :-)
Vlad-Alexandru Ionescu [Wed, 5 Apr 2023 08:24:27 +0000 (10:24 +0200)]
Enabled Sqrt and Abs intrinsics (#84011)
* Enabled abs and sqrt intrinsics
---------
Signed-off-by: Vlad - Alexandru Ionescu <vlad-alexandruionescu@Vlads-MacBook-Pro-4.local>
Co-authored-by: Vlad - Alexandru Ionescu <vlad-alexandruionescu@Vlads-MacBook-Pro-4.local>
Egor Bogatov [Tue, 4 Apr 2023 23:36:00 +0000 (01:36 +0200)]
Optimize stackalloc zeroing via BLK (#83255)
Co-authored-by: SingleAccretion <62474226+SingleAccretion@users.noreply.github.com>
Buyaa Namnan [Tue, 4 Apr 2023 23:22:03 +0000 (16:22 -0700)]
Suppress linker warnings properly (#84272)
* Suppress linker warnings properly
* Update core assembly types handling
* Update src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/SignatureHelper.cs
---------
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Egor Bogatov [Tue, 4 Apr 2023 23:04:13 +0000 (01:04 +0200)]
Mark FirstCharInUInt32IsAscii with aggressiveinlining (#84306)
Andy Ayers [Tue, 4 Apr 2023 22:34:10 +0000 (15:34 -0700)]
JIT: use synthesis to repair some reconstruction issues (#84312)
In particular, run synthesis in repair mode for cases where there are profile
counts within the method but zero counts in `fgFirstBB`.
Recall that sparse profiling effectively probes return blocks to determine the
method entry count.
So the zero-entry but not zero-everywhere case can happen if we have a method
with a very long running loop plus sparse profiling plus OSR -- we will only
get profile counts from the instrumented Tier0 method, and it will never return
(instead it will always escape to an OSR version which will eventually return,
but that version won't be instrumented).
I originally was a bit more ambitious and ran repair for a broader set of
reconstruction issues, but lead to a large number of diffs, in part because
repair doesn't cope well with irreducible loops.
Leaving the entry count zero can have fairly disastrous impact on the quality
of optimizations done in the method.
Addresses quite a few of the worst-performing benchmarks in #84264.
Vladimir Sadov [Tue, 4 Apr 2023 22:29:54 +0000 (15:29 -0700)]
[NativeAOT] Remove unused native memcopy helpers. (#84314)
* Remove unused (and in some cases broken) RhpCopy helpers.
* PR feedback
Jakob Botsch Nielsen [Tue, 4 Apr 2023 22:26:03 +0000 (00:26 +0200)]
JIT: Handle some "field offset computation" patterns (#81998)
Both during local morph and during VN.
Fix #40021
Saves 3 KB on BasicMinimalApi after #84095 (there's 1111 __GetFieldHelper functions). About 0.04%. There's still a null check kept for each offset computation, which we cannot really get rid of, but NAOT could maybe emit the IL such that there is a dominating null check so that only one is emitted.
Example:
Base:
```
.managed:
0000000140347CC0 loc_140347CC0: ; CODE XREF: S_P_CoreLib_System_Collections_Generic_KeyValuePair_2_System_Net_Security_System_Net_Security_SslSessionsCache_SslCredKey__System___Canon_____GetFieldHelper+23↑j
.managed:
0000000140347CC0 ; DATA XREF: .rdata:__readonlydata_S_P_CoreLib_System_Collections_Generic_KeyValuePair_2_System_Net_Security_System_Net_Security_SslSessionsCache_SslCredKey__System___Canon_____GetFieldHelper↓o
.managed:
0000000140347CC0 lea rax, ??_7Boxed_System_Net_Security_System_Net_Security_SslSessionsCache_SslCredKey@@6B@ ; jumptable
0000000140347CB3 case 0
.managed:
0000000140347CC7 mov [r9], rax
.managed:
0000000140347CCA cmp [rcx], cl
.managed:
0000000140347CCC lea rax, [rcx+8]
.managed:
0000000140347CD0 sub rax, rcx
.managed:
0000000140347CD3 add rsp, 8
.managed:
0000000140347CD7 retn
```
Diff:
```
.managed:
0000000140347AA0 loc_140347AA0: ; CODE XREF: S_P_CoreLib_System_Collections_Generic_KeyValuePair_2_System_Net_Security_System_Net_Security_SslSessionsCache_SslCredKey__System___Canon_____GetFieldHelper+23↑j
.managed:
0000000140347AA0 ; DATA XREF: .rdata:__readonlydata_S_P_CoreLib_System_Collections_Generic_KeyValuePair_2_System_Net_Security_System_Net_Security_SslSessionsCache_SslCredKey__System___Canon_____GetFieldHelper↓o
.managed:
0000000140347AA0 lea rax, ??_7Boxed_System_Net_Security_System_Net_Security_SslSessionsCache_SslCredKey@@6B@ ; jumptable
0000000140347A93 case 0
.managed:
0000000140347AA7 mov [r9], rax
.managed:
0000000140347AAA cmp [rcx], cl
.managed:
0000000140347AAC mov eax, 8
.managed:
0000000140347AB1 add rsp, 8
.managed:
0000000140347AB5 retn
```
Local morph changes handle the pattern for local structs -- VN changes handle the pattern for classes (and more complicated struct cases, like storing them in locals, which there are a few examples of in #40021).
Daniel Svensson [Tue, 4 Apr 2023 22:11:10 +0000 (00:11 +0200)]
Improve XmlDictionaryWriter UTF8 encoding performance (#73336)
* Speed up text encoding
* Update implementation
* Add tests for binary xml strings
* limit counting code to 256 bit vectors
* reword comment
* rename test
* move bytesmax
* Fix bytesMax after moving variable initialization
* use unicode escape value in test
* fix test typo "*" -> "+"
* Update src/libraries/System.Private.DataContractSerialization/src/System/Xml/XmlStreamNodeWriter.cs
Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Remvoe vectorized code from UnsafeGetUTF8Length
* Fix overfload
* use for loop which seems faster
* remove vector loop
* make sealed encoding to allow devirtualisation
* back some changes
* use uint for UnsafeGetUTF8Chars comparison
* revert more changes
* Fix cutoff based on new measurements
* use BinaryPrimitives.ReverseEndianness as suggested
* Update cutoff from 24 to 32 chars before calling, due to regression for text based DataContractSerializer
* Remove sealed encoding since it only improves XmlConvert
---------
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Tom Deseyn [Tue, 4 Apr 2023 20:56:21 +0000 (22:56 +0200)]
ConvertIcuTimeFormatString: convert narrow no-break spaces to spaces too. (#83589)
Egor Bogatov [Tue, 4 Apr 2023 20:55:52 +0000 (22:55 +0200)]
Fast-path in String.Trim (#84300)
David Wrighton [Tue, 4 Apr 2023 20:16:00 +0000 (13:16 -0700)]
Use similar types for self-referential generics instead of the exact canonical type (#83995)
- Take advantage of work done a few years ago to simplify the interaction with the interop subsystem
- In the problematic case, simulate loads with two different types as instantiations which are unrelated in field layout, and see if they match up. Only enable this code in a few very small isolated parts of the runtime
- Filter more of the type loader logic through the byvalue class cache which should improve performance a bit
- Similarly when considering blittability, tweak the logic to use the special load path
- Support for self-recursive generics is not enabled for static fields, as that requires a somewhat different tweak, and there is less apparent demand. (For that scenario self-referential generics really should support having fields of type T.)
- Support for indirect self-recursive generics is also not enabled. The approach taken here is not practical for that, and there does not appear to be significant demand for that either.
Fixes #6924
Mark Plesko [Tue, 4 Apr 2023 18:32:55 +0000 (11:32 -0700)]
Add error check for skipped tests in merged groups (#84284)
If I test is written in the old style (with a Main and OutputType==Exe without an attribute such as RequiresProcessIsolation) in a merged test group directory, it will be skipped. This change adds a check to detect those cases.
I have struggled with ways to automatically set OutputType. Directory.Build.props is too early (the test project file will override it). Directory.Build.targets is too late as the C# targets files will already have been processed and set other variables based on the value of OutputType. This Target doesn't execute until later, but since it is an error it doesn't matter how those additional properties were set.
Since this adds more boilerplate to each merged test directory, I created a src/tests/Directory.Merged.props to share all of that.
This catches 3 tests that aren't currently executing.
Unrelated:
- Use GetPathOfFileAbove in nearby locations for Directory.Build.props chaining rather than specific paths
- Fix two easy IL warnings that appeared in my local build of all tests
Resolves https://github.com/dotnet/runtime/issues/84182
Will Smith [Tue, 4 Apr 2023 17:47:21 +0000 (10:47 -0700)]
[JIT] Fix re-use val zero on GC tracking (#84051)
* Initial work
* Added genCodeForReuseVal
* Only create a label if the current IG is not empty
Will Smith [Tue, 4 Apr 2023 17:43:47 +0000 (10:43 -0700)]
[JIT] ARM64/X64 - Add `IsVNNeverNegative` (#83694)
* Initial work
* Handle arrlen case
* Added ifdef
* Additional cases
* Additional cases
* Add assert to IsVNNeverNegative
* Update src/coreclr/jit/valuenum.cpp
Co-authored-by: Bruce Forstall <brucefo@microsoft.com>
* Additional cases
---------
Co-authored-by: Bruce Forstall <brucefo@microsoft.com>
Tomas Weinfurt [Tue, 4 Apr 2023 16:23:54 +0000 (09:23 -0700)]
don't load MsQuic unless needed by HttpClient (#83494)
* don't load MsQuic unless needed by HttpClient
* feedback from review
Bruce Forstall [Tue, 4 Apr 2023 15:37:20 +0000 (08:37 -0700)]
Fix parallel SuperPMI output handling (#84219)
Previously, parallel SuperPMI parsed very few kinds of output from
the child processes, and ignored and discarded the rest. Change this
so all output from the child processes is output by the parent
process.
For example, this allows the child process JIT to print out statistics,
disasm, etc., and have it visible by the parent invoker.
David Cantú [Tue, 4 Apr 2023 15:22:42 +0000 (10:22 -0500)]
Only call base.DisposeAsync on classes derived from FileStream (#82874)
* Only call base.DisposeAsync on classes derived from FileStream
* Fix typo
Vlad Brezae [Tue, 4 Apr 2023 15:07:50 +0000 (18:07 +0300)]
[mono][sgen] Remove old code associated with domain unload (#84242)
* [mono][sgen] Remove unused suspend finalizers functionality
* [mono][sgen] Remove threadpool shutdown logic
No longer used
* [mono][sgen] Remove logic associated with gc shutdown
* [mono][sgen] Remove logic for clearing handle stack during cleanup
* [mono][sgen] Remove code for xdomain checks
* [mono][sgen] Remove more code associated with finalization
* [mono][sgen] Remove code for freeing objects during domain unload
* [mono][sgen] Remove mono_gc_clear_domain
It is dead code
Stephen Toub [Tue, 4 Apr 2023 11:20:58 +0000 (07:20 -0400)]
Fix FrozenDictionary/Set handling of ValueTuple keys (#84280)
For small collections of comparable value types, we were using an implementation that sorted the keys in order to a) quickly rule out values outside of the known contained range, and b) stop searching when we hit a value that was too small. However, this can break for some well-known types. In particular, `ValueTuple<...>` implements `IComparable<ValueTuple<...>>`, but it might throw an exception if you actually try to use its `IComparable<>` implementation if any of the `T` types in the tuple are themselves not comparable. Since we have no good way then to dynamically select an implementation based on whether it implements `IComparable<>`, I've simply removed those checks / calls from the implementation.
Testing this also highlighted that our existing shared set tests don't like being given non-comparable types, as they use SortedSet which itself suffers from effectively the same issue (but there you can choose to not use SortedSet if it doesn't work for your data, and "sort"ing is part of the name).
Egor Bogatov [Tue, 4 Apr 2023 10:50:11 +0000 (12:50 +0200)]
fix addrmode assert (#84252)
Johan Lorensson [Tue, 4 Apr 2023 10:16:59 +0000 (12:16 +0200)]
[Mono]: Library mode enhancements. (#84165)
Add support for direct pinvoke charset on Windows.
NativeAOT direct pinvoke support handles pinvoke charset on Windows,
this commit adds the same logic to Mono when targeting Windows,
so it will follow the same charset rules as NativeAOT.
Direct pinvoke wrappers on none full AOT builds.
Library mode builds will have option to create a self contained static
or shared library, including all needed resources, embedding assemblies
and static link all external dependencies (using direct pinvoke). Library mode
also exports UnamangedCallersOnly methods that can be called by application
loading the library. Currently the wrappers needed for UnmanagedCallersOnly
methods will be generated when doing none full AOT builds, but not
pinvoke wrappers. This PR adds support to generate the pinvoke wrappers, but
only for the methods described by direct pinvoke AOT compiler arguments,
so for none full AOT builds not using direct pinvoke arguments, no pinvoke
wrappers will be generated, inline with current none full AOT behavior.
Direct pinvoke wrappers on profiled AOT builds.
Enhanced the profile-only option doing profile AOT to emit managed-to-native
and native-to-managed wrappers. Needed in order for library build to work
together with profiled AOT builds.
Wrappers-only AOT option.
On platforms like Android, we still run majority of code using JIT. Since library
mode should produce a self contained library, including pinvokes
(for all direct pinvoked functions) as well as UnmanagedCallersOnly wrappers,
Android would need to at least run none full AOT build of all used assemblies.
By default, that will AOT a lot more methods that is really needed and there is
no way to reduce the AOT:ed code and still run as much as possible using JIT.
The profile-only option opens up ability to reduce what managed methods that
will be AOT:ed, but still generates a number of inflated methods not needed by
UnmanagedCallersOnly and direct pinvoke wrappers and piggy back on an
existing option with additional functionality is not optimal. This PR adds an
undocumented AOT option intended to be used by library builder, wrappers-only,
and that will only include wrappers in AOT object giving library builder the ability
to build a self contained library on Android that still runs majority of managed
code using JIT.
Fan Yang [Tue, 4 Apr 2023 10:01:44 +0000 (06:01 -0400)]
[Mono] Support get_Count and get_AllBitsSet for mini JIT on Arm64 (#84180)
* Support get_Count and get_AllBitsSet
* nint and nuint are 8 bytes on arm64 as well.
* Fix syntax
Vitek Karas [Tue, 4 Apr 2023 09:44:28 +0000 (02:44 -0700)]
Static cctor analysis for reflection (#84089)
This brings the NativeAOT behavior around static cctor analysis on part with illink.
Main change is to add checks for RUC/RAF/RDC on static cctor and produces a warning if there is one (as these are not allowed on static cctor).
The rest of the changes are just minor fixes and adjusting tests to the new behavior.
Contributes to https://github.com/dotnet/runtime/issues/82447.
Tomáš Rylek [Tue, 4 Apr 2023 09:42:40 +0000 (11:42 +0200)]
Add issues.targets entry for known issue #84007 (#84268)
* Add issues.targets entry for known issue #84007
* Add handling for NEW_MDARR_RARE
---------
Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
Jakob Botsch Nielsen [Tue, 4 Apr 2023 08:04:31 +0000 (10:04 +0200)]
JIT: Properly allocate shadow space for block op helpers on win-x64 (#84124)
Move the accounting of the outgoing arg space size from simple lowering
to lowering and start accounting for the fact that some block ops may
turn into helper calls.
Fix #80140
Ilona Tomkowicz [Tue, 4 Apr 2023 07:07:04 +0000 (09:07 +0200)]
[browser][non-icu] `HybridGlobalization` change case (#84019)
* Enabled `HybridGlobalization` mode.
* Enabled non-icu change case.
* Tests.
* Revert not connected changes.
* Fix: Add the new file to the project.
* Fix: this PR is for Browser, so add it to condition.
* Fixed calls to js.
* Trying to fix CI.
* False is default, redundant lines.
* Trying to fix the CI.
* Remove redundant code.
* This PR is partial solution, this file will be added in a follow-up.
* Fix for EAT lib tests.
* We do not trim anything for Hybrid currently.
* Check if functions invoked only in specific modes.
* Change confusing name + move the common property to the main part of the class.
* Applied @mkhamoyan's suggestion.
* Fix previous commit: missing directive.
* Fix previous commit: missing directive.
* It's not IOS-connected.
* Move hybrid tests to correct dir + separate ios and wasm + update sln.
* Invariant and hybrid cannot be both true.
* Remove old version of hybrid tests proj.
* Applied @kg's review.
Michal Strehovský [Tue, 4 Apr 2023 03:37:16 +0000 (12:37 +0900)]
Fix reflection invoke file format issue for generic methods (#83438)
The file format that mapped reflection metadata to runtime artifacts had a limitation that required generic methods to be always instantiated over concrete types - we could not place canonical method bodies there. The limitation stemmed from the fact that the mapping table was placing a generic dictionary in it.
This switches the table to use NameAndSignature + an array of instantiation arguments.
The rest of this change is just deleting code that was working around the problem. The fixes in NativeLayoutVertexNode and NodeFactory.NativeLayout are fixing analysis holes that were exposed by our ability to be more lazy.
Also saves 0.4% on BasicWebApi, which is always nice.
Vladimir Sadov [Tue, 4 Apr 2023 03:29:57 +0000 (20:29 -0700)]
Introduce a diagnostic switch to turn off the use of file mapping in PE loader. (#84151)
* Introduce a diagnostic switch to turn off use of file mapping in PE loader.
* change default to off
* fix condition on Unix
Kunal Pathak [Tue, 4 Apr 2023 02:05:51 +0000 (19:05 -0700)]
Arm64: Implement VectorTableLookup/VectorTableLookupExtension intrinsinsic + Consecutive registers support (#80297)
* Add VectorTableLookup 2/3/4 in hwinstrinsiclistarm64.h
* Add VectorTableLookup
* fixes to libraries
* Prototype of simple tbl
* Some progress
* Some more updates
* working model
* Vector64<byte> support
* Add VectorTableLookup_3
* Add VectorTableLookup_4
* cleanup
* Remove regCount from LclVarDsc
* Some more cleanup
Some more cleanup
* setNextConsecutiveRegisterAssignment
* Some more cleanup
* TARGET_ARM64
* Use getNextConsecutiveRefPositions instead of nextConsecutiveRefPosition field
* jit format
* Move getNextConsecutiveRefPosition
* SA1141: Use tuple syntax
* Remove the unwanted field list code
* revert the flag that was mistakenly changed
* Add test cases
* FIELD_LIST
* Use FIELD_LIST approach
* jit format and fix arm build
* fix assert failure
* Add summary docs
Add summary docs in all the required files.
* Make APIs public again
* cleanup
* Handle case for reg mod 32
* Remove references from ref until API is approved
* Use generic getFreeCandidates()
* Add entries in ExtraAPis
* Set CLSCompliant=false
* Move in inner class
* Remove CLSCompliant flag
* Add a suppression file for System.Runtime.Intrinsics on the new APIs until it they go through API review
* Review feedback
* Add workaround for building tests
* review feedback
* TP: remove needsConsecutive parameter from BuildUse()
* TP: Remove pseudo intrinsic entries
* More fixes
* Add the missing csproj
* Fix test cases
* Add fake lib for AdvSimd.Arm64* as well
* Remove the workaround
* Use template to control if consecutive registers is needed or not
* jit format
* fix the workaround
* Revert "fix the workaround"
This reverts commit
1cb22d00d7159f40d33538ea29008e6764d52e45.
* Revert "Remove the workaround"
This reverts commit
b0b6a5e9abea195bd6dc35c5a638d280f20d6ed2.
* Add VectorTableLookupExtensions in libraries
* Add support for VectorTableLookupExtension
* WIP: available regs
* WIP: Remove test hacks
* Update getFreeCandidates() for consecutive registers
* Add missing resetRegState()
* Do not assume the current assigned register for consecutiveRegisters refposition is good.
If a refposition is marked as needConsecutive, then do not just assume that the existing register assigned
is good. We still go through the allocation for it to make sure that we allocate it a register such that the
consecutive registers are also free.
* Handle case for copyReg
For copyReg, if we assigned a different register, do not forget to free the existing register it was holding
* Update setNextConsecutiveRegister() with UPPER_VECTOR_RESTORE
* Update code around copyReg
Updated code such that if the refPosition is already assigned a register, then
check if assignedRegister satisfies are needs (for first / non-first refposition).
If not, performs copyReg.
TODO: Extract the code surrounding and including copyReg until where we `continue`.
* Create the VectorTableLookup fake CoreLib as a reference assembly
Make the AdvSimd.Arm64 tests reference the VectorTableLookup fake
CoreLib as reference assembly; and ensure that it is not included as a
ProjectReference by the toplevel HardwareIntrinsics merged test
runners.
The upshot is that the AdvSimd.Arm64 tests can call the extra APIs via
a direct reference to CoreLib (instead of through System.Runtime), but
the fake library is not copied into any test artifact directories, and
the Mono AOT compiler never sees it.
That said, after applying this, the test fails during AOT compilation
of the *real* CoreLib
```
Mono Ahead of Time compiler - compiling assembly /Users/alklig/work/dotnet-runtime/runtime-bugs2/artifacts/tests/coreclr/osx.arm64.Release/Tests/Core_Root/System.Private.CoreLib.dll
AOTID
EA8D702E-9736-3BD5-435B-
A9D5EEADCC78
%"System.ValueTuple`2<System.Runtime.Intrinsics.Vector128`1<byte>, System.Runtime.Intrinsics.Vector128`1<byte>>"* %arg_table
<16 x i8>
* Assertion: should not be reached at /Users/alklig/work/dotnet-runtime/runtime-bugs2/src/mono/mono/mini/mini-llvm.c:1455
```
* Rename VectorTableLookup to VectorTableLookup.RefOnly
* Start consecutive refpositions with RefTypeUse and never with RefTypeUpperVectorSave
* Add test cases for VectorTableLookupExtension
* Pass the missing defaultValues
* Use platform neutral BitScanForward
* jit format
* Remove the fake testlib workaround
* Fix mono failures
* Fix x64 TP regression
* Fix test cases
* fix some more tp regression
* Fix test build
* misc. changes
* Fix the bug where we were not freeing copyReg causing an assert in tier0
* Refactor little bit to reduce checks for VectorTableLookup
* Add template parameter for allocateReg/copyReg/select
* Comments
* Fix mono failures
* Added some more comments
* Call allocateReg/assignCopyReg/select methods only for refpositions that need consecutive registers
* Add heuristics to pick best possible set of registers which will need less spilling
* setNextConsecutiveRegisterAssignment() no longer checks for areNextConsecutiveRegistersFree()
* Rename getFreeCandidates() -> getConsecutiveCandidates()
* fix parameters to areNextConsecutiveRegistersFree()
* Rename and update canAssignNextConsecutiveRegisters()
* Add the missing setNextConsecutiveRegisterAssignment() calls
* Fix a condition for upperVector
* Update spill heurisitic to handle cases for jitstressregs
* Misc. remove popcount() check from getConsecutiveRegisters()
* jit format
* Fix a bug in canAssignNextConsecutiveRegisters()
* Add filterConsecutiveCandidates() and perform free/busy candidates scan
* Consume the new free/busy consecutive candidates method
* Handle case where 'copyReg == assignedReg'
* Misc. cleanup
* Include LsraExtraFPSetForConsecutive for stress regs
* handle case where 'assignedInterval == nullptr' for try_SPILL_COST()
* fix build error
* Call consecutiveCandidates() only for first refposition
* Only perform special handling for non-uppervectorrestore
* jit format
* Add impVectorTableLookup/impVectorTableLookupExtension
* Add the missing break
* Update assert
* Move definitions in GenTree, fix assert
* fix arm issue
* Remove common functions
* Rename info.needsConsecutiveRegisters to info.compNeedsConsecutiveRegisters
* Use needsConsecutiveRegisters template parameter for all configurations
* Handle case of round-robin in getConsecutiveRegisters()
* Disable tests for Mono
* Initialize outArray in test
* Add IsSupported checks for VectorLookup/VectorLookupExtension
* Fix the test cases for RunReflectionScenario_UnsafeRead()
* Review feedback
* wip
* fix a typo in test case
* Add filterConsecutiveCandidatesForSpill() to select range that needs fewer register spilling
* Add mono support.
* Delay free the registers for VectorTableLookupExtension
* fix mono build error
---------
Co-authored-by: Tanner Gooding <tagoo@outlook.com>
Co-authored-by: Aleksey Kliger <alklig@microsoft.com>
Co-authored-by: Zoltan Varga <vargaz@gmail.com>
Lee Culver [Tue, 4 Apr 2023 01:01:57 +0000 (18:01 -0700)]
Fix debugger stack unwind AV (#84270)
In the debugger we do not have in-memory pointers to the context record. Stack unwinds are all concrete, and update pCurrentContext instead. Due to this, this change https://github.com/dotnet/runtime/commit/
60adacb2b7a4ab9dc1e5af6c71fdfce7ad87fac0 zeroed out the m_Ptrs variable for all callee saved registers.
This change wasn't sufficient, however, because we actually try to use pCurrentContextPointers in a variety of places while dealing with reporting GC references, leading to an AV when GcInfoDecoder::GetStackSlot attempts to report an offset to RBP for certain kinds of coreclr!Frames.
This change updates pCurrentContextPointers to point to pCurrentContext in the dac.
(This issue/change only applies to AMD64.)
xtqqczze [Mon, 3 Apr 2023 23:26:06 +0000 (00:26 +0100)]
Refactor Interop.LocalAlloc follow-up (#84164)
Jeremy Koritzinsky [Mon, 3 Apr 2023 23:06:26 +0000 (16:06 -0700)]
Prepare ComInterfaceGenerator for going into the public API (#83894)
Cameron Aavik [Mon, 3 Apr 2023 21:14:01 +0000 (07:14 +1000)]
[PERF] Enable daily perf runs on cloud VMs (#84203)
* Add perf run for cloud VMs
* Ensure x64 is built
* Use non-open queue for internal runs
Aleksey Kliger (λgeek) [Mon, 3 Apr 2023 19:13:05 +0000 (15:13 -0400)]
[mono] update sgen codewoners (#84255)
VincentWu [Mon, 3 Apr 2023 19:11:42 +0000 (03:11 +0800)]
[RISC-V] Port Mono for RISC-V 64 Arch (1/3) lp64d ABI (#83714)
* support abi lp64d for RISC-V 64
* format
SingleAccretion [Mon, 3 Apr 2023 19:00:36 +0000 (22:00 +0300)]
Delete `LCL_VAR_ADDR` (#84185)
* Delete GT_LCL_VAR_ADDR
The node is exactly equivalent to LCL_FLD_ADDR at offset zero.
There is no reason to have two representations for the same thing.
* Delete OperIsLocalAddr
No longer needed.
* GT_LCL_FLD_ADDR -> GT_LCL_ADDR
The generalized "local address" node.
* Help MSVC
Turns a 0.05% TP regression into a 0.05% TP win.
* gtNewLclFldAddrNode -> gtNewLclAddrNode
* Fix formatting
Zoltan Varga [Mon, 3 Apr 2023 18:15:03 +0000 (14:15 -0400)]
[wasm] Don't publish the aot-instances.dll assembly, its not needed any more. (#84214)
The runtime creates a dummy version of it internally.
Zoltan Varga [Mon, 3 Apr 2023 17:42:09 +0000 (13:42 -0400)]
[mono] Remove the support for non r4fp, its not used by any supported platforms. (#82005)
Katelyn Gadd [Mon, 3 Apr 2023 17:30:32 +0000 (10:30 -0700)]
[wasm] Re-enable jiterp null check optimization for mid-method traces (#84058)
* Generate a bitset in the interpreter's codegen that identifies which spaces in the stack have had their address taken
* Use the interpreter bitset for jiterpreter null check optimization
* Enable null check optimization for all traces
Elinor Fung [Mon, 3 Apr 2023 16:54:00 +0000 (09:54 -0700)]
Stop excluding existing files from CORE_ROOT generation (#84195)
dotnet bot [Mon, 3 Apr 2023 16:18:48 +0000 (09:18 -0700)]
Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2149555 (#84102)
* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2147000
* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2147850
Michal Strehovský [Mon, 3 Apr 2023 16:01:24 +0000 (01:01 +0900)]
Split Rank1 MdArray allocation into a separate helper (#84205)
MdArray rank1 with all-zero lower bounds gets actually allocated as an SzArray. On Native AOT this means we need to spin up to the type loader to potentially load the new type. Split this expensive (and impossible-to-express-in-C#) thing into a separate helper so we can trim the type loader.
https://github.com/dotnet/runtime/pull/84156#issuecomment-
1491402863
Zoltan Varga [Mon, 3 Apr 2023 15:22:06 +0000 (11:22 -0400)]
[mono][llvm] Add a fastpath to calling mini_init_method_rgctx (). (#84226)
* [mono][llvm] Add a fastpath to calling mini_init_method_rgctx ().
* Add arm64 JIT support.
Zoltan Varga [Mon, 3 Apr 2023 15:21:45 +0000 (11:21 -0400)]
[mono] Futher cleanups to delegate invocation (#83705)
* [mono] Cache delegate->method_ptr in MonoDelegateTrampInfo instead of in delegate->method_code.
Repurpose the method_code field to store the MonoDelegateTrampInfo pointer
for future optimizations.
* Remove now unused MONO_PATCH_INFO_METHOD_CODE_SLOT.
* Remove unused mono_runtime_create_delegate_trampoline ().
* Reduce handle usage in mini_init_delegate ().
* Small cleanups to mono_delegate_trampoline ().
* Use the MonoDelegateTrampInfo from the delegate if possible.
dotnet-maestro[bot] [Mon, 3 Apr 2023 14:49:36 +0000 (09:49 -0500)]
[main] Update dependencies from dotnet/arcade (#83882)
* Update dependencies from https://github.com/dotnet/arcade build
20230323.3
Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
From Version 8.0.0-beta.23172.2 -> To Version 8.0.0-beta.23173.3
* Update dependencies from https://github.com/dotnet/arcade build
20230324.1
Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
From Version 8.0.0-beta.23172.2 -> To Version 8.0.0-beta.23174.1
* Update dependencies from https://github.com/dotnet/arcade build
20230327.4
Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
From Version 8.0.0-beta.23172.2 -> To Version 8.0.0-beta.23177.4
---------
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
dotnet-maestro[bot] [Mon, 3 Apr 2023 14:47:45 +0000 (09:47 -0500)]
[main] Update dependencies from dotnet/roslyn (#84017)
* Update dependencies from https://github.com/dotnet/roslyn build
20230328.1
Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
From Version 4.6.0-3.23175.1 -> To Version 4.6.0-3.23178.1
* Update dependencies from https://github.com/dotnet/roslyn build
20230328.17
Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
From Version 4.6.0-3.23175.1 -> To Version 4.7.0-1.23178.17
* Update dependencies from https://github.com/dotnet/roslyn build
20230329.16
Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
From Version 4.6.0-3.23175.1 -> To Version 4.7.0-1.23179.16
---------
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Anton Firszov [Mon, 3 Apr 2023 14:46:21 +0000 (16:46 +0200)]
Use timeouts in 2 socket test cases (#84030)
* SendRecv_Stream_TCP_LargeMultiBufferSends, TcpPeerReceivesFinOnShutdownWithPendingData
* use PortBlocker in SendRecv_Stream_TCP_LargeMultiBufferSends
Michal Strehovský [Mon, 3 Apr 2023 12:37:39 +0000 (21:37 +0900)]
Add constprop handling for `typeof(T) == typeof(Foo)` (#84224)
* Add constprop handling for `typeof(T) == typeof(Foo)`
The pattern `typeof(T) == typeof(Foo)` is a common way to do generic specialization in C#. Since we operate on instantiated code, we should be able to optimize this in many situations. Adding support for this in constprop.
RyuJIT would already handle this, but the problem is that if we don't handle this in IL scanning, we might have expanded the whole program view graph too much and it's hard to get rid of side effects of that. The added test shows one of such examples (we introduce an extra "used" virtual slot that is impossible to get rid of after the fact).
Saves 0.5% on BasicMinimalApi.
* We can optimize more now - update the test
SingleAccretion [Mon, 3 Apr 2023 09:07:40 +0000 (12:07 +0300)]
Delete GTF_BLK_VOLATILE and GTF_BLK_UNALIGNED (#84217)
These struct ASG-specific flags are as legacy leftover from
GT_COPYBLK days, inconsistent with how non-struct stores are handled.
Chet Husk [Mon, 3 Apr 2023 07:47:24 +0000 (02:47 -0500)]
Update usage of AllowEmptyTelemetry based on changes to the task in the SDK (#82804)
Andrii Kurdiumov [Mon, 3 Apr 2023 07:46:43 +0000 (13:46 +0600)]
Remove redundant settings (#83041)
Gérald Barré [Sun, 2 Apr 2023 18:09:37 +0000 (14:09 -0400)]
Change culture-sensitive IndexOf to culture-insensitive (#84223)
Bruce Forstall [Sun, 2 Apr 2023 16:38:16 +0000 (09:38 -0700)]
Delete dead code (#84197)
Bruce Forstall [Sun, 2 Apr 2023 16:37:18 +0000 (09:37 -0700)]
Refine BBF_GC_SAFE_POINT handling in reachability computation (#84215)
* Refine BBF_GC_SAFE_POINT handling in reachability computation
* Tweak the code some more
Egor Bogatov [Sun, 2 Apr 2023 15:55:31 +0000 (17:55 +0200)]
Eliminate bound checks for "arr[arr.Length - cns]" (#84213)
Egor Bogatov [Sun, 2 Apr 2023 15:55:17 +0000 (17:55 +0200)]
Improve Guid.Parse for input without whitespaces (#84210)
Co-authored-by: Stephen Toub <stoub@microsoft.com>
SingleAccretion [Sat, 1 Apr 2023 20:54:51 +0000 (23:54 +0300)]
Disallow the `InitObj` form for SIMD types (#84211)
Bruce Forstall [Sat, 1 Apr 2023 18:20:33 +0000 (11:20 -0700)]
Improve reachability sets computation (#84204)
* Improve reachability sets computation
Two changes to improve the throughput of computing `bbReach` sets:
1. In `fgComputeReachabilitySets()`, iterate over the blocks in reverse
post-order. This leads to fewer outer `do ... while(change)` iterations.
To do this, the `fgDfsReversePostorder()` function which creates the
reverse post-order numbers and ordering was hoisted out of dominator
creation and above reachability computation.
2. Create a `BlockSetOps::UnionDChanged()` function that does a `UnionD`
operation but also returns `true` if the target bitset changed value.
Some additional stats were added under `COUNT_BASIC_BLOCKS` regarding
how many iterations dominators and reachability computations take to
converge.
* Code review feedback
Mark Plesko [Sat, 1 Apr 2023 17:42:33 +0000 (10:42 -0700)]
Address timeouts in merged test groups (#84193)
See #68529 for theories.
Should solve the first timeouts in #83961 (baseservices/threading), Directed_1, Regression_1, and Regression_2 by marking tests as RequiresProcessIsolation.
Adds striping to Regression_1, Regression_4, threading_group1.
Egor Bogatov [Sat, 1 Apr 2023 13:59:52 +0000 (15:59 +0200)]
Improve Guid.Parse (#84200)
Michal Strehovský [Sat, 1 Apr 2023 13:31:30 +0000 (22:31 +0900)]
Use FastAllocateString in InvariantModeCasing (#84206)
A delegate with a ValueTuple over a reference type triggers generation of type loader data structures to load arbitrary ValueTuples over reference types at runtime. The replacement is a lot less expensive.
https://github.com/dotnet/runtime/pull/84156#issuecomment-
1491405388
Ruihan-Yin [Sat, 1 Apr 2023 05:53:03 +0000 (22:53 -0700)]
Optimization on LinearScan::buildPhysRegRecords (#83862)
* Optimization on LinearScan::buildPhysRegRecords by skipping non-AVX512 register if AVX512 not available.
* code changes based on the reviews.
* put the upper register group declaration in global
fix the offset value when allocating upper registers, it should
be the length of the lower register group.
Daniel Svensson [Sat, 1 Apr 2023 03:05:46 +0000 (05:05 +0200)]
Improve Binary Xml (XmlDictionaryWriter) performance (#71478)
* Improve perf of XmlBinaryWriter using Unsafe
* Use ReverseEndianness to simplify writes
* Use span in a few places
* Add back old comparison, but only write float as int if it saves space
* Use span in array writing to reduce bounds checks
* Extract all unsafe code to shared method
* Fix nodetype type
* Avoid pinning and unsafe when writing arrays
* add back CheckArray
* Fix Assert condition
* Apply suggestions from code review
Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Fix review comments
* use new span ctor
* add tests
* Add tests for very long arrays
* Fixx overload resolution for WriteText method
* Just copy guid arrays on LittleEndian platforms
* Add testversion of XmlBinaryNodeType with hardcoded values to use same appoach as in reader PR
* call corrreect version of getbuffer
* Update src/libraries/System.Runtime.Serialization.Xml/tests/ReflectionOnly/System.Runtime.Serialization.Xml.ReflectionOnly.Tests.csproj
* fix merge conflict
* Fix merge conflicts.
* Restored Big-Endian functionality. Ugly though.
* Cleaned up arrays.
* Remove leftover using in tests.
---------
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Steve Molloy <smolloy@microsoft.com>
SingleAccretion [Sat, 1 Apr 2023 02:59:49 +0000 (05:59 +0300)]
Delete GT_ADDR (#84147)
Emmanuel André [Sat, 1 Apr 2023 01:54:32 +0000 (03:54 +0200)]
Preserve OCE.CancellationToken in ReadAtLeastAsync of StreamPipeReader (#83926)
Vladimir Sadov [Sat, 1 Apr 2023 01:48:29 +0000 (18:48 -0700)]
Reverting: Set AssemblyName.ProcessorArchitecture for compatibility (#80581) (#84028)
* Reverting #80581
* Adjust the test.
* keep new version of CalculateProcArch (do not revert)
Buyaa Namnan [Sat, 1 Apr 2023 00:19:01 +0000 (17:19 -0700)]
Initial step for adding AssemblyBuilder.Save implementation (#83554)
* Initial import AB.Save
* Move code from S.R.Metadata to S.R.Emit
* Add additional proj refs for VS
* Add resources strings
* Namespace, name updates
* Update names
* Merge some of the test comparisons
* Update test with meaningful name and other small changes
---------
Co-authored-by: Steve Harter <steveharter@users.noreply.github.com>
Co-authored-by: Dan Moseley <danmose@microsoft.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Trayan Zapryanov [Fri, 31 Mar 2023 23:59:59 +0000 (02:59 +0300)]
Improve XmlSerializationWriter.WriteTypedPrimitive (#76436)
* Introduce TryFormats for almost all primitive types
* Use primitive char buffer in XmlSerializationWriter
* Fix char cast
* Add tests for different types
* Add byte type
* Address feedback
* Fix tests
* remove using
* Increase duration char buffer size as it is not enough for TimeSpan.Max/Min
* Address feedback
* Added assert if we cannot format primitive value to the suppiled buffer
* Lazy create primitives buffer
* Address new feadback
* Resolve feedback
* Optimize float and double TryFormat
* Replace ArrayPool renting with Interlocked. Fix Debug.Assert
* Do not expect concurrency when using primitives buffer
---------
Co-authored-by: Traian Zaprianov <Traian.Zaprianov@docuware.com>
Andy Gocke [Fri, 31 Mar 2023 23:04:55 +0000 (16:04 -0700)]
Add linker flags to add fixup data to PDBs (#58417) (#84099)
Fixup data can assist native debugging tools in providing more accurate data
(cherry picked from commit
4c814fa006c7178eaf4549fada27ec4a6f7d42dd)
Jan Kotas [Fri, 31 Mar 2023 21:30:34 +0000 (14:30 -0700)]
Delete unmanaged type name parser from CoreCLR (#84159)
* Delete unmanaged type name parser from CoreCLR
* Improve naming and comments
SingleAccretion [Fri, 31 Mar 2023 20:05:26 +0000 (23:05 +0300)]
Delete two quirks for some CQ (#84176)
Vladimir Sadov [Fri, 31 Mar 2023 19:43:54 +0000 (12:43 -0700)]
[NativeAOT] Fixes for two rare stress issues. (#83908)
* Couple stress fixes
* PR feedback
* typos in comments
Egor Bogatov [Fri, 31 Mar 2023 19:02:21 +0000 (21:02 +0200)]
Vectorize Convert.FromHexString (#82521)
Co-authored-by: Günther Foidl <gue@korporal.at>
SwapnilGaikwad [Fri, 31 Mar 2023 17:26:28 +0000 (18:26 +0100)]
Use ldp/stp with SIMD registers on Arm64 (#84135)
* Use ldp/stp with SIMD registers on Arm64
Use pairwise load/stores for
1. the instructions using SIMD registers
```
ldr q1, [x0, #0x20]
ldr q2, [x0, #0x30] => ldp q1, q2, [x0, #0x20]
```
2. the instructions using base and base plus immediate offset format
```
ldr w1, [x20]
ldr w2, [x20, #0x04] => ldp w1, w2, [x20]
ldr q1, [x0]
ldr q2, [x0, #0x10] => ldp q1, q2, [x0]
```
* Incorporate review comments
Elinor Fung [Fri, 31 Mar 2023 16:22:12 +0000 (09:22 -0700)]
Fix error thrown on multiple non-conforming StartupHook.Initialize signatures (#84158)
Mark Plesko [Fri, 31 Mar 2023 15:52:25 +0000 (08:52 -0700)]
Convert JIT\Regression tests to merged test groups (#83895)
Remaining usability issues are listed in https://github.com/dotnet/runtime/issues/71732
Conversion steps:
- static-none uses args - add comment to RequiresProcessIsolation
- remove unused arg in Runtime_80731.il
- Rewrite 4 IL tests to use newarr instead of args
- [cs-main] remove unused args in C# tests
- Update 9 tests with Main(args)
- Workaround: add RequiresProcessIsolation to LdfldaHack
- Move [Fact] to correct location in b12263
- In b06020, wrap $ class so that the C# wrapper can call it
- [ILTransform -public]
- [ILTransform -sr]
- Manually rename b598031/test and test2.
These were missed by the previous ILTransform -n run.
They no longer clash because run renamed all of their conflicts,
but this renames them for consistency.
- [ILTransform -prociso] Rerun for new tests
- Wrappers
- [ILTransform -ilfact]
- Manually do missed -collapse-main-sig and fix placement of [Fact]
- Fix b89946 that referred to Main
- Fix Runtime_59444 reflection on Test*
* Fix TestSummary.cs to handle invalid XML characters
* [ILTransform -a]
* Manual fixes
* Update test groupings and add extern aliases
* Finish merge - incorporate changes to csproj/Dir.B.props - fix xunit.analyzers errors
* [ILTransform -public]
* [ILTransform -prociso]
* [ILTransform -ilfact] (undo GitHub_26491)
* Fix xUnit1003 in Runtime_83003
* Update new test Runtime_83941 for merged groups
* 59444 - Changing methods to internal broke reflection calls. Use this
opportunity to remove the reflection and simply mark the callees as [Fact]s.
- 64883/76273 - Suppress the xunit warning so that the code can continue
using the normal (public-only) reflection search.
- Fix TestSummary.cs to handle invalid XML characters
- Add RequiresProcessIsolation for existing issues.target entry (AOT compiler fails)
- undo JIT/opt/And/Regressions/Regression1.csproj (possibly from manual merge from main)
Marc Brooks [Fri, 31 Mar 2023 14:00:12 +0000 (09:00 -0500)]
Add additional close statuses in ManagedWebSocket (#83827)
* Allow non RFC close statuses in ManagedWebSocket
Add ServiceRestart (1012), TryAgainLater (1013), and BadGateway (1014) to the list of `WebSocketCloseStatus` values and allow them to be used as valid WebSocket close statuses so we don't reject the close and discard the status description by adding them to the private `IsValueCloseStatus` method switch statement declaring them as valid `true`.
These codes are documented [here as IANA registered codes](https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent/code) as valid server-initiated close reasons.
Fixes Issue https://github.com/dotnet/runtime/issues/82602
* Cleanup comment format
Co-authored-by: MartyIX <203266+MartyIX@users.noreply.github.com>
* Rename test data to CloseStatuses
Co-authored-by: Natalia Kondratyeva <knatalia@microsoft.com>
* Rename test method to follow naming convention.
Co-authored-by: Natalia Kondratyeva <knatalia@microsoft.com>
* Addressed PR feedback
Finished rename of CloseStatuses test data
Renamed `closeStatusDescription` to `serverMessage`
Send hello message and close status then await both responses and
check they are as expected. This necessitated switching to the `ReceiveAsync` that accepts an `ArraySegment`.
Explicitly typed `var`s
Inlined helper methods (for clarity)
* Rename local for per PR feedback
Swapping back to a distinct and more appropriately named variable for the `closeStatusDescription`
Co-authored-by: Natalia Kondratyeva <knatalia@microsoft.com>
* Label the boolean for isServer flag
Co-authored-by: Natalia Kondratyeva <knatalia@microsoft.com>
* Use better local variable name
Renamed local `serverMessage` back to `closeStatusDescription` per PR feedback.
Co-authored-by: Natalia Kondratyeva <knatalia@microsoft.com>
* Address PR and rebase to main
Rebased to current main, updated the commit messages and added the remaining changes to address the PR comments.
---------
Co-authored-by: MartyIX <203266+MartyIX@users.noreply.github.com>
Co-authored-by: Natalia Kondratyeva <knatalia@microsoft.com>
Egor Bogatov [Fri, 31 Mar 2023 08:29:50 +0000 (10:29 +0200)]
Fix assert when SpanHelpers.SequenceEqual is unused (#84155)
Michal Strehovský [Fri, 31 Mar 2023 08:06:14 +0000 (17:06 +0900)]
Split `TryGetGenericMethodComponents` into two overloads (#84156)
Resolves #83069. Hello World is now 1.45 MB, down from 1.65 MB.
Half of the callers don't care about the `MethodNameAndSignature` part - don't spend time computing it.
This also allows trimming `MethodNameAndSignature` from a hello world, which allows trimming pretty much all of the type loader.
SingleAccretion [Fri, 31 Mar 2023 08:03:25 +0000 (11:03 +0300)]
Take advantage of simplifications enabled by folding all indirect access to locals (#79722)
* Simplify DefinesLocal
* Delete DefinesLocalAddr from VN
* Simplify fgPerNodeLocalVarLiveness
* Simplify fgRemoveDeadStore
* Simplify gtSetEvalOrder
* Simplify optComputeLoopSideEffectsOfBlock
* Bring back some folding in morph
Forward sub can bring in local address nodes
and not recognizing them pessimizes things
* Delete IsLocalAddrExpr
* Delete DefinesLocalAddr
* Delete IndirTransform::None
xtqqczze [Fri, 31 Mar 2023 04:42:28 +0000 (05:42 +0100)]
Refactor `Interop.LocalAlloc` (#82450)
* Refactor `Interop.LocalAlloc`
Theodor Zoulias [Fri, 31 Mar 2023 00:57:13 +0000 (03:57 +0300)]
Correct three code comments in Dictionary.cs (#84128)
Three code comments refer to the EqualityComparer<TValue>.Default, instead of the correct EqualityComparer<TKey>.Default.
Jan Kotas [Fri, 31 Mar 2023 00:11:44 +0000 (17:11 -0700)]
Fix type parsing error returned for type names with invalid start of assembly name (#84141)
* Fix type parsing error returned for type names with invalid start of assembly name
Fixes #84118
* Mono error handling is different
Jan Vorlicek [Thu, 30 Mar 2023 20:33:29 +0000 (22:33 +0200)]
Fix AREA alignment warning on Windows ARM64 (#84020)
The arm64 build on Windows is warning about ALIGN instruction in the
asmhelpers.asm having alignment larger than the alignment of the current
area. This change fixes it by replacing TEXTAREA by an area with the
proper alignment set.
Jeff Handley [Thu, 30 Mar 2023 20:23:45 +0000 (13:23 -0700)]
Update API Review Process doc with updated link and blurb (#84133)
Vladimir Sadov [Thu, 30 Mar 2023 17:15:39 +0000 (10:15 -0700)]
Disable System.Net.Sockets\tests\FunctionalTests\System.Net.Sockets.Tests.csproj on NativeAOT (#84114)
Michal Strehovský [Thu, 30 Mar 2023 16:23:07 +0000 (01:23 +0900)]
Switch attribute equality to the valuetype equality plan (#84095)
Attribute.Equals/GetHashCode is currently implemented using reflection. The implementation
iterates over all instance fields and calls Equals/GetHashCode as needed.
This has problems because the code is not actually trim safe (requires special casing
in the compiler to work around an invalid suppression in CoreLib) and has extra problems
for reflection blocking (we need to make sure the fields are never subject to blocking).
In this PR I'm switching Attribute to a similar plan that .NET Native had.
In .NET Native we injected a pair of virtual methods to read and access fields
on System.Attribute descendants. We can actually get away with one method - I'm
reusing all the infrastructure we have for ValueType.Equals/GetHashCode since the
problem is the same.
Saves 5.8% on a Hello World. For BasicMinimalApi, this is a wash (almost
to the byte). It will become an improvement once RyuJIT starts generating
better code for the field offset computations we're doing in the injected
method.
Contributes to #83069.
Jan Kotas [Thu, 30 Mar 2023 16:15:58 +0000 (09:15 -0700)]
Proper type name parser for native AOT compiler (#83657)
* Proper type name parser for native AOT compiler
* Track failure of CA search rules in the type name parser
* Fix tests
* Suppress new native AOT warning for libraries tests
Co-authored-by: vitek-karas <10670590+vitek-karas@users.noreply.github.com>
Fixes #72833
Katelyn Gadd [Thu, 30 Mar 2023 14:02:58 +0000 (07:02 -0700)]
[wasm] Implement MINT_SHL_AND_ in the jiterpreter (#84083)
Fan Yang [Thu, 30 Mar 2023 14:02:36 +0000 (10:02 -0400)]
[Mono] Intrinsify multiply and divide for mini JIT on ARM64 (#84004)
* Support multiply and divide
* Use expend op code instead
* Remove unused code
* Uncomment
Milos Kotlar [Thu, 30 Mar 2023 13:58:22 +0000 (15:58 +0200)]
[mono] Implement GC descriptor for structs with InlineArray attribute (#84097)
* Implement GC descriptor for structs with InlineArrayAttribute and add Mono GC test
* Enable GC test on CoreCLR
* Add warning when field_iter too large
Jakob Botsch Nielsen [Thu, 30 Mar 2023 13:29:18 +0000 (15:29 +0200)]
Fix profiler handle GC tests (#83968)
The JIT may extend the lifetime of these object references which can
keep them alive unexpectedly.
Fix #83962
Tanner Gooding [Thu, 30 Mar 2023 12:33:51 +0000 (05:33 -0700)]
Fixing a few xml doc comments for the Vector###.WithUpper APIs (#84113)
Eirik Tsarpalis [Thu, 30 Mar 2023 11:40:48 +0000 (12:40 +0100)]
Revert #80698 and obsolete JsonSerializerOptions.AddContext (#84022)
* Revert
9a6686be5dde9171ea9a827e700dae3770af1e06.
* Obsolete JsonSerializerOptions.AddContext
Tanner Gooding [Thu, 30 Mar 2023 04:24:24 +0000 (21:24 -0700)]
Expose helper APIS for GetLower/Upper and WithLower/Upper (#83982)
* Expose and use a gtNewSimdGetLowerNode and gtNewSimdGetUpperNode
* Expose and use a gtNewSimdWithLowerNode and gtNewSimdWithUpperNode
* Apply formatting patch
* Ensure op1 and op2 are passed for WithLower/Upper
* Ensure we aren't creating unnecessary idx nodes
* Ensure args are popped in the right order
* Ensure Vector512.WithUpper/Lower are handled as intrinsic
* Ensure Vector512.GetLower/Upper and WithLower/Upper are fully hooked up
* Applying formatting patch
* Fix a copy/paste error
* Move NI_Vector128_GetUpper to be handled in codegen to improve emitted code
* Fix an assert
github-actions[bot] [Thu, 30 Mar 2023 04:13:20 +0000 (21:13 -0700)]
Update check-service-labels to trigger on branch edit (#84109)
Co-authored-by: Juan Hoyos <19413848+hoyosjs@users.noreply.github.com>
Vladimir Sadov [Thu, 30 Mar 2023 02:51:09 +0000 (19:51 -0700)]
[NativeAOT] Making thread local storage completely managed. (#84060)
* move m_pThreadLocalModuleStatics to managed
* typo - should use newSize once computed
Jan Kotas [Wed, 29 Mar 2023 23:36:35 +0000 (16:36 -0700)]
Smaller static constructor context (#83937)
This makes native aot compiled binaries smaller and reduces code size of inlined static constructor checks that are being worked on.