platform/upstream/dotnet/runtime.git
16 months agoFix which path is taken in Enumerable.Select for empty partition (#88425)
Stephen Toub [Thu, 6 Jul 2023 01:01:51 +0000 (21:01 -0400)]
Fix which path is taken in Enumerable.Select for empty partition (#88425)

* Fix which path is taken in Enumerable.Select for empty partition

My recent changes to improve perf of some LINQ iterators by implementing `IList<T>` caused Select on an empty partition to start preferring a path that wasn't optimized for empty.  This fixes it.  I searched and don't see any other operators that would be similarly negatively affected.

* Use is check

16 months agoType equivalence support in Crossgen2 (#87899)
David Wrighton [Thu, 6 Jul 2023 00:55:38 +0000 (17:55 -0700)]
Type equivalence support in Crossgen2 (#87899)

We currently have a small behavior hole on Windows where if a binary uses TypeEquivalence, it is technically possible to get crossgen2 to generate invalid code.

This fixes that by adding support for type equivalence to the managed type system, and adjusting crossgen2 to use it. This is complicated by the detail that this may generate some type references which cannot be referenced from an R2R file, so additional error checking was needed (this additional error checking is what fixes #67855).

However, while basic support for type equivalence has been added to the type system, support for actually performing type equivalent interface resolution has not been, so devirtualization of type equivalent interface calls is disabled. At this time, I do not expect to see a customer need for implementing that fairly complicated feature

Fixes #67855

16 months agoAdd consultants for some extensions areas (#88430)
Eric StJohn [Thu, 6 Jul 2023 00:31:01 +0000 (17:31 -0700)]
Add consultants for some extensions areas (#88430)

* Add consultants for some extensions areas

* Update area-owners.md

---------

Co-authored-by: Dan Moseley <danmose@microsoft.com>
16 months agoAdd docs for AsyncInterfaces (#88432)
Eric StJohn [Wed, 5 Jul 2023 23:55:38 +0000 (16:55 -0700)]
Add docs for AsyncInterfaces (#88432)

16 months agoDedup Task.WhenAll non-generic and generic implementations (#88154)
Stephen Toub [Wed, 5 Jul 2023 23:41:24 +0000 (19:41 -0400)]
Dedup Task.WhenAll non-generic and generic implementations (#88154)

The generic implementation was calling the non-generic one and then using an additional continuation to extract the resulting `Task<TResult>` due to lack of covariance on classes.  We can instead just factor the shared implementation out into a generic with the type parameter constrained to be a Task.  This results in simpler code as well as avoiding an extra continuation in the generic case.

As part of cleaning this up:
- I changed code where we need to make a defensive copy of an input collection to use CopyTo; we were already doing this in some places but not others.  This saves on an enumerator allocation when enumerating the source collection, as well as multiple interface calls.
- I augmented WhenAny to also special-case `List<Task>`, as that's a common input and we can handle it a bit more efficiently, especially if the collection ends up containing just two tasks.
- I removed the `GenericDelegateCache<TAntecedentResult, TResult>`.  That was from a time before the C# compiler supported caching of generic lambdas. It would have needed to have been updated to handle the stronger type coming out of CommonCWAnyLogic, so I instead just got rid of it.  We're better off lazily-creating these rarely used delegates, anyway.

16 months agoMake DoesConsoleSupportAnsi respect DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTIO...
June Rhodes [Wed, 5 Jul 2023 23:22:05 +0000 (09:22 +1000)]
Make DoesConsoleSupportAnsi respect DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION (#88241)

Co-authored-by: Adam Sitnik <adam.sitnik@gmail.com>
16 months agoAdd gtNewGenericCon (#88440)
Egor Bogatov [Wed, 5 Jul 2023 23:19:11 +0000 (01:19 +0200)]
Add gtNewGenericCon (#88440)

16 months agoJIT: Always look for SIMD fields during promotion (#84122)
Jakob Botsch Nielsen [Wed, 5 Jul 2023 22:16:25 +0000 (00:16 +0200)]
JIT: Always look for SIMD fields during promotion (#84122)

16 months ago[mono] Fix sorting custom attributes in ILStrip (#88435)
Alexander Köplinger [Wed, 5 Jul 2023 21:27:26 +0000 (23:27 +0200)]
[mono] Fix sorting custom attributes in ILStrip (#88435)

The change in https://github.com/dotnet/runtime/pull/87923 was subtly wrong, the problem is that RID on a Cecil metadata token masks out the token type.
We actually have to reconstruct the custom attribute coded-index.

16 months agoAdd option to decrypt Quic traffic in debug builds (#83001)
Tomas Weinfurt [Wed, 5 Jul 2023 21:17:11 +0000 (14:17 -0700)]
Add option to decrypt Quic traffic in debug builds (#83001)

* Add option to decrypt Quic traffic in debug builds

* feedback from review

* fixes & feedback

* feedback from review

16 months agoUnify Default Comparer logic (#88006)
Michał Petryka [Wed, 5 Jul 2023 19:07:19 +0000 (21:07 +0200)]
Unify Default Comparer logic (#88006)

Unifies (Equality)Comparer.Default logic so that it matches between CoreCLR, NativeAOT, Mono in runtime and intrinsic implementations.

Fixes devirt behaviour around Nullable types.

Also enables devirt for non final types in CoreCLR and NativeAOT.

Required for #87579.
Fixes #87391.

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
16 months agoFix AVX512 moves on X86 (#88421)
Michał Petryka [Wed, 5 Jul 2023 19:01:33 +0000 (21:01 +0200)]
Fix AVX512 moves on X86 (#88421)

Extracted from #85875.

16 months agoFix Codespaces prebuild after CMake upgrade and set policy in Mono (#88410)
Alexander Köplinger [Wed, 5 Jul 2023 19:00:40 +0000 (21:00 +0200)]
Fix Codespaces prebuild after CMake upgrade and set policy in Mono (#88410)

The prebuild on Codespaces broke after the minimum CMake version was bumped in https://github.com/dotnet/runtime/pull/86530 because the container was still using Ubuntu 20.04 (Focal) which only has CMake 3.16.1.

Upgrade to Ubuntu 22.04 (Jammy) so we have a new enough CMake.

Also fix a missing policy in the Mono CMakeLists.txt that was accidentally removed.

16 months agoJIT: Compute BB weights with higher precision, use tolerance in if-conversion (#88385)
Jakob Botsch Nielsen [Wed, 5 Jul 2023 18:37:09 +0000 (20:37 +0200)]
JIT: Compute BB weights with higher precision, use tolerance in if-conversion (#88385)

In https://github.com/dotnet/runtime/issues/88376#issuecomment-1620371447
I noticed a spurious diff in the System.Tests.Perf_Int32.ToStringHex
benchmark that looked like this:

```diff
 G_M62987_IG13:
        and      edi, esi
        mov      ebx, dword ptr [rbp+88H]
-       mov      ecx, 1
        test     ebx, ebx
-       cmovle   ebx, ecx
+       jg       SHORT G_M62987_IG15
+ ;; size=12 bbWeight=1.00 PerfScore 2.50
+G_M62987_IG14:
+       mov      ebx, 1
+ ;; size=5 bbWeight=0.98 PerfScore 0.24
+G_M62987_IG15:
```

Investigating, it turns out to be caused by a check in if-conversion for
detecting loops, that is using a very sharp boundary. It turns out that
the integral block weights are exactly the same (in both the base and
diff), but the floating point calculation ended up with exactly 1 and
very close to 1 in the base/diff cases respectively.

So two changes to address it:
* Switch getBBWeight to multiply by BB_UNITY_WEIGHT after dividing
* Switch if-conversion to have a 5% tolerance so that losing just a
  single count in the wrong place will not cause a decision change. Note
  that the check here is used as a cheap "is inside loop" check.

16 months ago[main] Update dependencies from dnceng/internal/dotnet-optimization (#88132)
dotnet-maestro[bot] [Wed, 5 Jul 2023 18:24:16 +0000 (13:24 -0500)]
[main] Update dependencies from dnceng/internal/dotnet-optimization (#88132)

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20230627.5

optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR
 From Version 1.0.0-prerelease.23326.3 -> To Version 1.0.0-prerelease.23327.5

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20230628.5

optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR
 From Version 1.0.0-prerelease.23326.3 -> To Version 1.0.0-prerelease.23328.5

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20230629.5

optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR
 From Version 1.0.0-prerelease.23326.3 -> To Version 1.0.0-prerelease.23329.5

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20230630.5

optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR
 From Version 1.0.0-prerelease.23326.3 -> To Version 1.0.0-prerelease.23330.5

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20230701.5

optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR
 From Version 1.0.0-prerelease.23326.3 -> To Version 1.0.0-prerelease.23351.5

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20230704.4

optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR
 From Version 1.0.0-prerelease.23326.3 -> To Version 1.0.0-prerelease.23354.4

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
16 months ago[mono] Fix InlineArrayAttribute access on big-endian platforms (#88417)
Ulrich Weigand [Wed, 5 Jul 2023 18:18:25 +0000 (20:18 +0200)]
[mono] Fix InlineArrayAttribute access on big-endian platforms (#88417)

Use "guint32" instead of "gpointer" to access the length field in
InlineArrayAttribute; fixes serious regression after PR #88419.

16 months agoFix SIMD node DOT retType (#88363)
Kunal Pathak [Wed, 5 Jul 2023 17:05:14 +0000 (10:05 -0700)]
Fix SIMD node DOT retType (#88363)

* Fix SIMD node DOT retType

* no need for lengthsquared

16 months agoSuppress System.Drawing.Common dependency from System.Windows.Extensions (#88157)
Eric StJohn [Wed, 5 Jul 2023 16:54:49 +0000 (09:54 -0700)]
Suppress System.Drawing.Common dependency from System.Windows.Extensions (#88157)

* Suppress System.Drawing.Common dependency from System.Windows.Extensions

* Add Drawing reference to Windows.Extensions tests

16 months agoInline more helpers in RegexParser (#88392)
Dan Moseley [Wed, 5 Jul 2023 16:11:54 +0000 (09:11 -0700)]
Inline more helpers in RegexParser (#88392)

* inline RightCharMoveRight()

* inline Textpos()

* inline MoveLeft()

* inline MoveRight()

* Inline CharAt()

* Inline RightChar()

* Inline RightChar()

* Inline CharsRight()

* Inline Textto()

* rename _pattern and _currentPos

* cleanup Category table

* Cleanup ScanBlank()

* reorder <

* reorder - =

* reorder >=

* reorder - >

* more

* bool param name

* comments

* merge

16 months ago[iOS] Add temp cindex attribute to build on xcode 15 (#88261)
Steve Pfister [Wed, 5 Jul 2023 16:10:17 +0000 (09:10 -0700)]
[iOS] Add temp cindex attribute to build on xcode 15 (#88261)

Without CursorKind 437, the cross build for iOS/tvOS and iOS/tvOSSimulator will fail. This change adds a temporary attribute to avoid that.

16 months agoJIT: Propagate multi-reg-index for upper-vector-restore ref positions (#88380)
Jakob Botsch Nielsen [Wed, 5 Jul 2023 15:16:33 +0000 (17:16 +0200)]
JIT: Propagate multi-reg-index for upper-vector-restore ref positions (#88380)

`LinearScan::resolveRegisters` will write the register back to the IR
node for an upper-vector-restore RP, so without this propagation we
would overwrite the register assignment for an unrelated field.

For example, for IR like
```scala
N001 (  9,  6) [000090] m------N---                   t90 =    LCL_VAR   struct<JIT.HardwareIntrinsics.Arm._AdvSimd.SimpleTernaryOpTest__AbsoluteDifferenceWideningUpperAndAdd_Vector128_UInt32+TestStruct, 48>(P) V00 loc0
                                                            ▌    simd16 field V00._fld1 (fldOffset=0x0) -> V14 tmp10         (last use)
                                                            ▌    simd16 field V00._fld2 (fldOffset=0x10) -> V15 tmp11         (last use)
                                                            ▌    simd16 field V00._fld3 (fldOffset=0x20) -> V16 tmp12         (last use) $540
                                                            ┌──▌  t90    struct
N002 ( 10,  7) [000091] -----------                         ▌  RETURN    struct $VN.Void
```
we could build ref positions such as

```
[000091] 449.#639 U14  UVRs   UVRes    NA   │    │    │    │    │    │    │    │    │    │    │    │    │V16a│    │    │    │
         449.#640 d0   Fixd   Keep     d0   │    │    │    │    │    │    │    │    │    │    │    │    │V16a│    │    │    │
         449.#641 V14  Use *  ReLod    d0   │    │    │    │    │    │    │    │    │    │    │V14a│    │V16a│    │    │    │
                              Keep     d0   │    │    │    │    │    │    │    │    │    │    │V14i│    │V16a│    │    │    │
         449.#642 U15  UVRs   UVRes    NA   │    │    │    │    │    │    │    │    │    │    │    │    │V16a│    │    │    │
         449.#643 d1   Fixd   Keep     d1   │    │    │    │    │    │    │    │    │    │    │    │    │V16a│    │    │    │
         449.#644 V15  Use *  ReLod    d1   │    │    │    │    │    │    │    │    │    │    │    │V15a│V16a│    │    │    │
                              Keep     d1   │    │    │    │    │    │    │    │    │    │    │    │V15i│V16a│    │    │    │
         449.#645 d2   Fixd   Keep     d2   │    │    │    │    │    │    │    │    │    │    │    │    │V16a│    │    │    │
         449.#646 V16  Use *  Keep     d2   │    │    │    │    │    │    │    │    │    │    │    │    │V16i│    │    │    │
```

When writing back register assignments the upper-vector-restore at #642
ended up overwriting the assignment for the first field on [000090],
resulting in

```scala
N447 (  9,  6) [000090] m------N--z                   t90 =    LCL_VAR   struct<JIT.HardwareIntrinsics.Arm._AdvSimd.SimpleTernaryOpTest__AbsoluteDifferenceWideningUpperAndAdd_Vector128_UInt32+TestStruct, 48>(P) V00 loc0          NA
                                                            ▌    simd16 field V00._fld1 (fldOffset=0x0) -> V14 tmp10         (last use)
                                                            ▌    simd16 field V00._fld2 (fldOffset=0x10) -> V15 tmp11         (last use)
                                                            ▌    simd16 field V00._fld3 (fldOffset=0x20) -> V16 tmp12         d2 (last use) REG NA,d1,d2 $540
                                                            ┌──▌  t90    struct
N449 ( 10,  7) [000091] -----------                         ▌  RETURN    struct REG NA $VN.Void
```
(note the REG NA instead of REG d0).

16 months agoTar: set directory modification times while extracting. (#88231)
Tom Deseyn [Wed, 5 Jul 2023 14:44:44 +0000 (16:44 +0200)]
Tar: set directory modification times while extracting. (#88231)

* Tar: set directory modification times while extracting.

* Extend test and change entry write order.

* Get rid of some enumeration allocations.

* test: check DateTime using InRange.

* Extend comment explaining the order of entries.

* Apply suggestions from code review

Co-authored-by: Dan Moseley <danmose@microsoft.com>
* Try including AltDirectorySeparatorChar.

* Revert "Try including AltDirectorySeparatorChar."

This reverts commit 086aac43a897826394156692bd82f79feb3eca9d.

* Try using Directory.SetLastWriteTime instead of File's.

* Tie up some ends.

---------

Co-authored-by: Dan Moseley <danmose@microsoft.com>
16 months agoLocalized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 221445...
dotnet bot [Wed, 5 Jul 2023 13:16:16 +0000 (15:16 +0200)]
Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2214454 (#88399)

16 months agoImplement JsonTypeInfoResolver.WithAddedModifier (#88255)
Eirik Tsarpalis [Wed, 5 Jul 2023 12:55:21 +0000 (13:55 +0100)]
Implement JsonTypeInfoResolver.WithAddedModifier (#88255)

16 months ago[mono][interp] Add vectorization for Vector4 (#87822)
Vlad Brezae [Wed, 5 Jul 2023 12:36:20 +0000 (15:36 +0300)]
[mono][interp] Add vectorization for Vector4 (#87822)

* [mono][interp] Reuse vectorization for Vector4

Which is pretty much Vector<float>

* [mono][interp] Implement Vector.One for float gparam

* [mono][interp] Extract code to be reused later

* [mono][interp] Intrinsify Vector<T> ctor and Vector4 ctor

The constructors receive each element as an argument. This is the same as `Vector128.Create` so we reuse that code. This ends up generating a MINT_SIMD_V128_I*_CREATE opcode which receives each element value as an argument.

* [mono][interp] Track r4 var value during interpreter optimizations

Since it is common to instantiate Vector4 with constant values, add also support for tracking R4 values during optimizations. If all elements are constant, we generate instead a single MINT_SIMD_V128_LDC, which has the entire vector value embedded in the instruction stream.

* [mono][interp] Fix Vector ctor instrinsic when called explicitly

* [mono][interp] Replace ldloca + stobj.vt pair with mov.vt

* [mono][interp] Return early if vector_klass is not simd type

It is not marked as simd type if the generic param is not valid (ex not primitive type). Future checks are not expecting this scenario and can potentially crash.

16 months agoImprove non-SIMD block copy/init codegen (#88393)
Egor Bogatov [Wed, 5 Jul 2023 12:26:24 +0000 (14:26 +0200)]
Improve non-SIMD block copy/init codegen (#88393)

16 months agoAdd clr.tools subset to runtime-community (#88160)
Jo Shields [Wed, 5 Jul 2023 10:47:48 +0000 (06:47 -0400)]
Add clr.tools subset to runtime-community (#88160)

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
16 months agoPermit trailing data after PKCS12 (#88340)
Kevin Jones [Wed, 5 Jul 2023 09:52:59 +0000 (05:52 -0400)]
Permit trailing data after PKCS12 (#88340)

16 months agoFaster optimized frozen dictionary creation (6/6) (#88093)
Adam Sitnik [Wed, 5 Jul 2023 07:45:54 +0000 (09:45 +0200)]
Faster optimized frozen dictionary creation (6/6)  (#88093)

* don't use custom ToArray for small frozen collections, up to 50% gain for creation time for collections with <= 4 items

* for these types GetHashCode returns their value casted to int, so when we receive a Dictionary/HashSet where there are key we know that all hash codes are unique and we can avoid some work later

10-15% CPU time gain and 15-20% allocation reduction for FrozenDictionary and FrozenHashSet where TKey is uint, short, ushort, byte, sbyte

* move Length Buckets code to a dedicated helper type to reduce code duplication and decrease code size

* add tests for Frozen Dictionaries with key being uint, short, ushort, byte, sbyte, nint and nuint

* fix discovered bug: IntPtr started implementing IComparable<IntPtr> in .NET 5

16 months agoBump to libc++ without libatomic linkage (#88402)
Jo Shields [Wed, 5 Jul 2023 03:41:44 +0000 (23:41 -0400)]
Bump to libc++ without libatomic linkage (#88402)

Closes: https://github.com/dotnet/runtime/issues/88361

16 months agoMove IMeterFactory to System.Diagnostics.DiagnosticSource (#88302)
Tarek Mahmoud Sayed [Wed, 5 Jul 2023 00:45:20 +0000 (17:45 -0700)]
Move IMeterFactory to System.Diagnostics.DiagnosticSource (#88302)

16 months ago[mono][llvm] Fix another crash when using opaque pointers. (#88397)
Zoltan Varga [Wed, 5 Jul 2023 00:26:05 +0000 (20:26 -0400)]
[mono][llvm] Fix another crash when using opaque pointers. (#88397)

16 months ago[mono] Respect KeepNativeSymbols when building cross compilers. (#88398)
Zoltan Varga [Wed, 5 Jul 2023 00:25:43 +0000 (20:25 -0400)]
[mono] Respect KeepNativeSymbols when building cross compilers. (#88398)

16 months agochange regex options tests to extension method (#88366)
Dan Moseley [Wed, 5 Jul 2023 00:11:43 +0000 (17:11 -0700)]
change regex options tests to extension method (#88366)

* extension method for regexoptions

* Revert "extension method for regexoptions"

This reverts commit 95b05489f0245d23d6d265a2cad2fca2ae0975a0.

* Inline UseOption

16 months ago[mono][interp] Extract simd create opcodes in separate methods (#88381)
Vlad Brezae [Tue, 4 Jul 2023 17:42:46 +0000 (20:42 +0300)]
[mono][interp] Extract simd create opcodes in separate methods (#88381)

Newer versions of clang allocate the local buffer repeatedly by bumping the stack. This behavior seems dubious, leading to stack overflows, but extracting the code outside the interp main loop is an improvement anyway for the interpreter.

16 months ago[LoongArch64] Fix the NotImplementedException within R2RDump. (#88379)
Qiao Pengcheng [Tue, 4 Jul 2023 17:02:35 +0000 (01:02 +0800)]
[LoongArch64] Fix the NotImplementedException within R2RDump. (#88379)

16 months agoJIT: Handle primitive-sized remainders overlapping padding/promotions in physical...
Jakob Botsch Nielsen [Tue, 4 Jul 2023 16:02:38 +0000 (18:02 +0200)]
JIT: Handle primitive-sized remainders overlapping padding/promotions in physical promotion (#88109)

The remainder may be separated by a bit of padding or other promoted fields but
still fit into a primitive; in this case it is still beneficial to copy it all
as a primitive, instead of falling back to a full block copy.

Example:
```csharp
private S _s;

void Foo()
{
    S s = new();
    s.A = 10;
    s.D = 20;
    s.F = 30; // A, D, F gets promoted
    _s = s;
}

private struct S
{
    public byte A;
    public byte B;
    public byte C;
    public byte D;
    public byte E;
    public byte F;
}
```

```diff
 Processing block operation [000018] that involves replacements
   dst+003 <- V04 (V01.[003..004)) (last use)
   dst+005 <- V05 (V01.[005..006)) (last use)
   Block op remainder: [001..003) [004..005)
-  => Remainder strategy: retain a full block op
+  => Remainder strategy: int at +001
```

```diff
 ;  V00 this         [V00,T01] (  3,  3   )     ref  ->  rcx         this class-hnd single-def
 ;* V01 loc0         [V01    ] (  0,  0   )  struct ( 8) zero-ref    do-not-enreg[SF] ld-addr-op
 ;# V02 OutArgs      [V02    ] (  1,  1   )  struct ( 0) [rsp+00H]   do-not-enreg[XS] addr-exposed "OutgoingArgSpace"
 ;* V03 tmp1         [V03    ] (  0,  0   )   ubyte  ->  zero-ref    "V01.[000..001)"
 ;* V04 tmp2         [V04    ] (  0,  0   )   ubyte  ->  zero-ref    "V01.[003..004)"
 ;* V05 tmp3         [V05    ] (  0,  0   )   ubyte  ->  zero-ref    "V01.[005..006)"
 ;  V06 tmp4         [V06,T00] (  5, 10   )   byref  ->  rcx         single-def "Spilling address for field-by-field copy"
 ;
 ; Lcl frame size = 0

 G_M52879_IG01:  ;; offset=0000H
  ;; size=0 bbWeight=1 PerfScore 0.00
 G_M52879_IG02:  ;; offset=0000H
        add      rcx, 8
        xor      eax, eax
-       mov      dword ptr [rcx], eax
-       mov      dword ptr [rcx+02H], eax
+       mov      dword ptr [rcx+01H], eax
        mov      byte  ptr [rcx], 10
        mov      byte  ptr [rcx+03H], 20
        mov      byte  ptr [rcx+05H], 30
- ;; size=22 bbWeight=1 PerfScore 5.50
-G_M52879_IG03:  ;; offset=0016H
+ ;; size=20 bbWeight=1 PerfScore 4.50
+G_M52879_IG03:  ;; offset=0014H
        ret
  ;; size=1 bbWeight=1 PerfScore 1.00

-; Total bytes of code 23, prolog size 0, PerfScore 8.80, instruction count 8, allocated bytes for code 23 (MethodHash=1da13170) for method Program:Foo():this (FullOpts)
+; Total bytes of code 21, prolog size 0, PerfScore 7.60, instruction count 7, allocated bytes for code 21 (MethodHash=1da13170) for method Program:Foo():this (FullOpts)
 ; ============================================================

```

We have to be careful, however, since the covering segment can now contain
promoted fields. If this happens we need to make sure we write the promoted
field _after_ the remainder.

16 months agoJIT: Quirk a quirk in fgExpandVirtualVtableCallTarget (#88374)
Jakob Botsch Nielsen [Tue, 4 Jul 2023 13:18:39 +0000 (15:18 +0200)]
JIT: Quirk a quirk in fgExpandVirtualVtableCallTarget (#88374)

Fix #88349

16 months ago[mono] Reenable disabled tests as mono now respects non-public custom attributes...
Ivan Povazan [Tue, 4 Jul 2023 13:02:54 +0000 (15:02 +0200)]
[mono] Reenable disabled tests as mono now respects non-public custom attributes in dynamic assemblies (#88322)

* Reenable disabled tests
* Disable Roslyn analyzer tests in the browser as Monitor.Wait / Monitor.Pulse are not supported on single-threaded WASM

Contributes to: https://github.com/dotnet/runtime/issues/60650

16 months agoEmail addresses in same domain not equal (#87721)
feiyun0112 [Tue, 4 Jul 2023 10:26:27 +0000 (18:26 +0800)]
Email addresses in same domain not equal (#87721)

Different email addresses in same domain should not be equal.
UriComponents.UserInfo will compare also UserInfo from the Uris.

16 months agoonly log errors of Task/Promise marshaling (#88326)
Pavel Savara [Tue, 4 Jul 2023 09:23:46 +0000 (11:23 +0200)]
only log errors of Task/Promise marshaling (#88326)

16 months agoUnified source file formatting (#88330)
Marie Píchová [Tue, 4 Jul 2023 09:17:51 +0000 (11:17 +0200)]
Unified source file formatting (#88330)

16 months ago[OSX] HybridGlobalization Workaround for insufficiently sized destination buffer...
Meri Khamoyan [Tue, 4 Jul 2023 06:20:43 +0000 (10:20 +0400)]
[OSX] HybridGlobalization Workaround for  insufficiently sized destination buffer (#88184)

Workaround for insufficiently sized dest buffer

16 months agoRemove conservative generic scanning logic (#88360)
Michal Strehovský [Tue, 4 Jul 2023 06:20:06 +0000 (15:20 +0900)]
Remove conservative generic scanning logic (#88360)

@EgorBo's #88025 made it possible to undo conservative scanning logic added in dotnet/corert#7618.

Saves 0.4% in size for Stage1 and Stage2 apps.

16 months agoAllow inlining array methods (#88367)
Michal Strehovský [Tue, 4 Jul 2023 05:48:39 +0000 (14:48 +0900)]
Allow inlining array methods (#88367)

`CanInline` would return false to methods that implement generic interfaces on arrays because we didn't consider the magic `Array<T>` types constructed.

For:

```csharp
static int Main()
{
    IReadOnlyCollection<int> l = new int[] { 1, 2, 3 };
    return l.Count;
}
```

Before:

```
       sub      rsp, 40
                                                ;; size=4 bbWeight=1 PerfScore 0.25
G_M24375_IG02:  ;; offset=0004H
       lea      rcx, [(reloc 0x4000000000420a70)]      ; int[]
       mov      edx, 3
       call     CORINFO_HELP_NEWARR_1_VC
       lea      rcx, [(reloc 0x4000000000420aa8)]      ; const ptr
       mov      rdx, qword ptr [rcx]
       mov      qword ptr [rax+10H], rdx
       mov      rdx, qword ptr [rcx+04H]
       mov      qword ptr [rax+14H], rdx
       mov      rcx, rax
       call     System.Array`1[int]:get_Count():int:this
       nop
                                                ;; size=48 bbWeight=1 PerfScore 9.75
G_M24375_IG03:  ;; offset=0034H
       add      rsp, 40
       ret
```

After:

```
       sub      rsp, 40
                                                ;; size=4 bbWeight=1 PerfScore 0.25
G_M24375_IG02:  ;; offset=0004H
       lea      rcx, [(reloc 0x4000000000420a70)]      ; int[]
       mov      edx, 3
       call     CORINFO_HELP_NEWARR_1_VC
       lea      rcx, [(reloc 0x4000000000420aa8)]      ; const ptr
       mov      rdx, qword ptr [rcx]
       mov      qword ptr [rax+10H], rdx
       mov      rdx, qword ptr [rcx+04H]
       mov      qword ptr [rax+14H], rdx
       mov      eax, 3
                                                ;; size=44 bbWeight=1 PerfScore 8.50
G_M24375_IG03:  ;; offset=0030H
       add      rsp, 40
       ret
```

16 months agoRemove empty files (#88362)
Dan Moseley [Tue, 4 Jul 2023 05:22:09 +0000 (22:22 -0700)]
Remove empty files (#88362)

16 months agoFix libraries Windows test runner script (#88354)
Bruce Forstall [Tue, 4 Jul 2023 04:18:09 +0000 (21:18 -0700)]
Fix libraries Windows test runner script (#88354)

Having HAS_TEST_RESULTS unset leads to a Windows CMD script
syntax error.

Clean up a few other things while there:
1. Explicitly set ENABLEEXTENSIONS
2. Set a variable to the test exit code. There's an unsafe assumption
currently that `%ERRORLEVEL%` doesn't change between the test run
and all of the subsequent uses.
3. Remove unnecessary quotes around setting `HAS_TEST_RESULTS=1`

Fixes #88353

16 months agoUp Minimum CMake Version to 3.20 (#86530)
Ivan Diaz Sanchez [Tue, 4 Jul 2023 02:03:12 +0000 (19:03 -0700)]
Up Minimum CMake Version to 3.20 (#86530)

* Let's see what happens :)

* CMake 3.20 works on my machine???

* Upped the llibraries CMake version to 3.20

* Upped native libs CMake version to 3.20, and updated the requirements docs.

* Add CMake Policy to 3.17.0 for native libs because of wasm.

* Downgraded native libs CMake to 3.17.0 temporarily, while we figure out the funny troublemaker wasm.

* Added a couple notes regarding CMake on Linux and Windows, and upped the corehost and libunwind CMake versions to 3.20

* Reverted external native components CMake versions, and upped tests to 3.20. Only Mono remains now.

* Added mono to the 3.20 gang. Also, changed the condition for wasm.

* Had to condition mono's CMake version as well because of wasm.

* DEBUG-ONLY COMMIT: Added some CMake logging to help me figure out what is set for wasm to think of the appropriate conditional.

* DEBUG-ONLY COMMIT: I think I have the answer for wasm now/

* Restored the DEBUG-ONLY changes and set 3.20 as the universal CMake, as the missing machines have now been updated.

* Updated requirements doc with notes for Debian 11 and lower.

16 months agoImprove LoggerFactory and Logger debugging (#88313)
James Newton-King [Tue, 4 Jul 2023 01:42:39 +0000 (09:42 +0800)]
Improve LoggerFactory and Logger debugging (#88313)

16 months agoTry adding cross-compilers for Musl (#87841)
Jo Shields [Mon, 3 Jul 2023 21:53:34 +0000 (17:53 -0400)]
Try adding cross-compilers for Musl (#87841)

* Add cross-compilers for Musl

* Fix LLVM linkage on Musl

16 months agoPass exact context to getMethodInfo (#88025)
Egor Bogatov [Mon, 3 Jul 2023 21:36:59 +0000 (23:36 +0200)]
Pass exact context to getMethodInfo (#88025)

* Modify JIT-EE API

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
16 months agoShrink column width in `ilc --help` (#88356)
Adeel Mujahid [Mon, 3 Jul 2023 21:19:50 +0000 (00:19 +0300)]
Shrink column width in `ilc --help` (#88356)

16 months agoFix condition for ENSURE_PRIMARY_STACK_SIZE (#88342)
Jan Kotas [Mon, 3 Jul 2023 20:58:35 +0000 (13:58 -0700)]
Fix condition for ENSURE_PRIMARY_STACK_SIZE (#88342)

Fixes #88339

16 months ago TcpListener should implement IDisposable (#88043)
Alexander Radchenko [Mon, 3 Jul 2023 20:52:51 +0000 (02:52 +0600)]
 TcpListener should implement IDisposable (#88043)

* TcpListener should implement IDisposable

* lint

* Code review

* Update src/libraries/System.Net.Sockets/src/System/Net/Sockets/TCPListener.cs

Co-authored-by: Anton Firszov <antonfir@gmail.com>
* Update TCPListener.cs [EditorBrowsable(EditorBrowsableState.Never)]

* Code review

* lint

* Code review

---------

Co-authored-by: Anton Firszov <antonfir@gmail.com>
16 months agoFix incorrect sequence number used in NTLM signature calculation (#87998)
Filip Navara [Mon, 3 Jul 2023 20:44:14 +0000 (22:44 +0200)]
Fix incorrect sequence number used in NTLM signature calculation (#87998)

16 months ago[mono] Remove mono_loader_save_bundled_library() (#88331)
Alexander Köplinger [Mon, 3 Jul 2023 20:14:43 +0000 (22:14 +0200)]
[mono] Remove mono_loader_save_bundled_library() (#88331)

16 months agoRemove TODO from a comment in System.Guid.cs (#88337)
SwapnilGaikwad [Mon, 3 Jul 2023 19:43:36 +0000 (20:43 +0100)]
Remove TODO from a comment in System.Guid.cs (#88337)

16 months agoLocalized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 221346...
dotnet bot [Mon, 3 Jul 2023 15:46:39 +0000 (17:46 +0200)]
Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2213468 (#88301)

16 months ago[Crossgen] Don't display list of enum values in help (#88324)
Adam Sitnik [Mon, 3 Jul 2023 14:14:56 +0000 (16:14 +0200)]
[Crossgen] Don't display list of enum values in help (#88324)

16 months agoUpgrade to LLVM 16 & C++17, and bundle libc++ on Linux (#87190)
Jo Shields [Mon, 3 Jul 2023 13:46:29 +0000 (09:46 -0400)]
Upgrade to LLVM 16 & C++17, and bundle libc++ on Linux (#87190)

* Upgrade to LLVM 16, and stop focusing on C++11 ABi stuff from CentOS 7

Co-authored-by: Zoltan Varga <vargaz@gmail.com>
16 months ago[mono] fix memfuncs for FreeBSD (#88300)
Thefrank [Mon, 3 Jul 2023 13:31:49 +0000 (06:31 -0700)]
[mono] fix memfuncs for FreeBSD (#88300)

* fix memfuncs for FreeBSD

* match format

16 months agoImprove Hosting debugging (#88308)
James Newton-King [Mon, 3 Jul 2023 12:43:08 +0000 (20:43 +0800)]
Improve Hosting debugging (#88308)

* Improve Hosting debugging

* Update

* Remove Logger

* PR feedback

16 months agoExpose stack trace metadata stripping as a supported option (#88235)
Michal Strehovský [Mon, 3 Jul 2023 04:08:33 +0000 (13:08 +0900)]
Expose stack trace metadata stripping as a supported option (#88235)

16 months agoFix OptionsValidator source-gen to skip static and const members (#88254)
Nikita Balabaev [Sun, 2 Jul 2023 18:37:07 +0000 (20:37 +0200)]
Fix OptionsValidator source-gen to skip static and const members (#88254)

Co-authored-by: Nikita Balabaev <nbalabaev@microsoft.com>
16 months agoImplement IList<T> on some LINQ iterators (#88249)
Stephen Toub [Sat, 1 Jul 2023 22:14:52 +0000 (18:14 -0400)]
Implement IList<T> on some LINQ iterators (#88249)

`ICollection<T>` provides both a Count and a CopyTo, and `IList<T>` an indexer, all of which can make various consumption mechanisms more efficient. We only implement the interfaces when the underlying collection has a fixed size and all of the interface implementations are side-effect free (in particular, while appealing to do so, we don't implement them on various Select iterators).

Some of the serialization tests need to be fixed as a result. The state of Queue's array is a bit different based on how its initialized, and such private details show up in BinaryFormatter output.  Rather than special-casing the output per framework and core, I've just changed the test itself to ensure Queue can't see the size of the input collection.

16 months ago[wasm] Implement complete PackedSimd feature set in interpreter (#87903)
Katelyn Gadd [Sat, 1 Jul 2023 20:08:33 +0000 (13:08 -0700)]
[wasm] Implement complete PackedSimd feature set in interpreter (#87903)

Implement all PackedSIMD APIs in wasm builds of the interpreter based on a table and auto-generated code
Implement most PackedSIMD APIs in jiterpreter
Detect constant simd arguments in jiterpreter and verify them
Simplify unused/temporary dregs in interp

16 months agoAvoid reporting frozen segments in GetGenerationBounds (#85727)
Andrew Au [Sat, 1 Jul 2023 20:04:28 +0000 (13:04 -0700)]
Avoid reporting frozen segments in GetGenerationBounds (#85727)

Co-authored-by: Noah Falk <noahfalk@users.noreply.github.com>
16 months agoUnify JIT interface getTypeLayout between VM and crossgen2; refine what is considered...
Jakob Botsch Nielsen [Sat, 1 Jul 2023 19:35:12 +0000 (21:35 +0200)]
Unify JIT interface getTypeLayout between VM and crossgen2; refine what is considered "significant padding" (#88238)

* Stop considering auto layout types to have significant padding in the VM. This was already the behavior in crossgen2. This fixes one of the points of #71711.
* Remove special case where we never considered structs with GC pointers to have significant padding. After the above change this has no additional diffs.
* Fix the inline array layout expansion; the numFields of the inline array node was computed incorrectly, and the parent indices of descendants were not updated correctly

Example C#:
```csharp
private (long, int) _tuple;

[MethodImpl(MethodImplOptions.NoInlining)]
private void Foo()
{
    _tuple = (5, 10);
}
```

Before:
```asm
;  V00 this         [V00,T00] (  3,  3   )     ref  ->  rcx         this class-hnd single-def
;# V01 OutArgs      [V01    ] (  1,  1   )  struct ( 0) [rsp+00H]   do-not-enreg[XS] addr-exposed "OutgoingArgSpace"
;  V02 tmp1         [V02    ] (  4,  8   )  struct (16) [rsp+08H]   do-not-enreg[SB] ld-addr-op "NewObj constructor temp"
;  V03 tmp2         [V03,T01] (  3,  5   )    long  ->  [rsp+08H]   do-not-enreg[] "field V02.Item1 (fldOffset=0x0)" P-DEP
;  V04 tmp3         [V04,T02] (  3,  5   )     int  ->  [rsp+10H]   do-not-enreg[] "field V02.Item2 (fldOffset=0x8)" P-DEP
;
; Lcl frame size = 24

G_M52879_IG01:  ;; offset=0000H
       sub      rsp, 24
       vzeroupper
;; size=7 bbWeight=1 PerfScore 1.25
G_M52879_IG02:  ;; offset=0007H
       vxorps   xmm0, xmm0, xmm0
       vmovups  xmmword ptr [rsp+08H], xmm0
       mov      qword ptr [rsp+08H], 5
       mov      dword ptr [rsp+10H], 10
       vmovups  xmm0, xmmword ptr [rsp+08H]
       vmovups  xmmword ptr [rcx+08H], xmm0
;; size=38 bbWeight=1 PerfScore 8.33
G_M52879_IG03:  ;; offset=002DH
       add      rsp, 24
       ret
;; size=5 bbWeight=1 PerfScore 1.25

; Total bytes of code 50, prolog size 7, PerfScore 15.83, instruction count 10, allocated bytes for code 50 (MethodHash=1da13170) for method Program:Foo():this (FullOpts)
```

After:
```asm
;  V00 this         [V00,T00] (  4,  4   )     ref  ->  rcx         this class-hnd single-def
;# V01 OutArgs      [V01    ] (  1,  1   )  struct ( 0) [rsp+00H]   do-not-enreg[XS] addr-exposed "OutgoingArgSpace"
;* V02 tmp1         [V02    ] (  0,  0   )  struct (16) zero-ref    ld-addr-op "NewObj constructor temp"
;* V03 tmp2         [V03,T01] (  0,  0   )    long  ->  zero-ref    "field V02.Item1 (fldOffset=0x0)" P-INDEP
;* V04 tmp3         [V04,T02] (  0,  0   )     int  ->  zero-ref    "field V02.Item2 (fldOffset=0x8)" P-INDEP
;
; Lcl frame size = 0

G_M52879_IG01:  ;; offset=0000H
;; size=0 bbWeight=1 PerfScore 0.00
G_M52879_IG02:  ;; offset=0000H
       mov      qword ptr [rcx+08H], 5
       mov      dword ptr [rcx+10H], 10
;; size=15 bbWeight=1 PerfScore 2.00
G_M52879_IG03:  ;; offset=000FH
       ret
;; size=1 bbWeight=1 PerfScore 1.00

; Total bytes of code 16, prolog size 0, PerfScore 4.60, instruction count 3, allocated bytes for code 16 (MethodHash=1da13170) for method Program:Foo():this (FullOpts)
```

16 months agoFix make repro cli command (#88289)
Adeel Mujahid [Sat, 1 Jul 2023 19:02:19 +0000 (22:02 +0300)]
Fix make repro cli command (#88289)

16 months agoJIT: Remove a quirk in regular promotion (#88130)
Jakob Botsch Nielsen [Sat, 1 Jul 2023 18:36:20 +0000 (20:36 +0200)]
JIT: Remove a quirk in regular promotion (#88130)

Also fix a bug in LSRA: if we undo promotion of one field of a multi-reg
struct and as a result undo for the other fields as well, we must also
clear out the largeVectorVars bitset to indicate these are no longer
candidates.

16 months agoApply a number of improvements and bugfixes to JsonNode (#88194)
Eirik Tsarpalis [Sat, 1 Jul 2023 08:07:46 +0000 (09:07 +0100)]
Apply a number of improvements and bugfixes to JsonNode (#88194)

* Avoid JsonElement torn read in a few JsonArray/JsonDocument and unify code patterns.

* Simplify and clean up JsonValue implementation -- fix DeepEquality bugs.

* Update src/libraries/System.Text.Json/src/System/Text/Json/Nodes/JsonValueOfTPrimitive.cs

* Avoid delegate allocation in the JsonObject setter.

16 months ago[wasm] Introduce <InvariantTimezone> build flag (#87284)
Pavel Savara [Sat, 1 Jul 2023 07:50:21 +0000 (09:50 +0200)]
[wasm] Introduce <InvariantTimezone> build flag (#87284)

16 months agoJIT: Don't set patchpoints in methods with CORINFO_DEBUG_CODE (#88227)
Andy Ayers [Sat, 1 Jul 2023 01:53:48 +0000 (18:53 -0700)]
JIT: Don't set patchpoints in methods with CORINFO_DEBUG_CODE (#88227)

In #88199 the debugger is overriding some jit flags, but has left other flags set
that confuse the jit: both `TIER0` and `DEBUG_CODE` end uip set so one part of the jit
used logic appropriate for `TIER0` and another part did not.

The JIT ended up creating a patchpoint for OSR in a method with localloc and this
combination is not supported by OSR and lead to a crash.

Harden the jit so if the runtime asks for debuggable code, the jit will never
generate patchpoints.

16 months agoFix Out of memory with source gen tests (#88266)
Tarek Mahmoud Sayed [Sat, 1 Jul 2023 00:52:21 +0000 (17:52 -0700)]
Fix Out of memory with source gen tests (#88266)

16 months agoClean up Guid.DecodeByte (#88267)
Egor Bogatov [Fri, 30 Jun 2023 23:17:52 +0000 (01:17 +0200)]
Clean up Guid.DecodeByte (#88267)

16 months agoFix build failures when declaring a COM-style enumerable type (#88263)
Jeremy Koritzinsky [Fri, 30 Jun 2023 21:34:20 +0000 (14:34 -0700)]
Fix build failures when declaring a COM-style enumerable type (#88263)

16 months ago[browser] Fix missing braces when resolving application culture (#88264)
Ilona Tomkowicz [Fri, 30 Jun 2023 21:15:28 +0000 (23:15 +0200)]
[browser] Fix missing braces when resolving application culture (#88264)

Regression from https://github.com/dotnet/runtime/pull/86255.

16 months agoAdd IHostedLifecycleService (#87335)
Steve Harter [Fri, 30 Jun 2023 21:04:00 +0000 (16:04 -0500)]
Add IHostedLifecycleService (#87335)

16 months agoDelete stale SkipOnTargetFramework attributes (and a few tests) (#88251)
Stephen Toub [Fri, 30 Jun 2023 20:48:31 +0000 (16:48 -0400)]
Delete stale SkipOnTargetFramework attributes (and a few tests) (#88251)

These projects don't run tests on .NET Framework.

16 months agoSimplify LINQ Shuffler test helper (#88252)
Stephen Toub [Fri, 30 Jun 2023 20:48:22 +0000 (16:48 -0400)]
Simplify LINQ Shuffler test helper (#88252)

The seed support is dead code, and the whole thing can be simplified down to a one-line helper.

16 months agoRename JITAllowOptionalRelocs to JitEnableOptionalRelocs (#88243)
Egor Bogatov [Fri, 30 Jun 2023 20:20:09 +0000 (22:20 +0200)]
Rename JITAllowOptionalRelocs to JitEnableOptionalRelocs (#88243)

Co-authored-by: Michał Petryka <35800402+MichalPetryka@users.noreply.github.com>
16 months agoRemove code in nativeaot event trace files under !FEATURE_NATIVEAOT or FEATURE_DTRACE...
Elinor Fung [Fri, 30 Jun 2023 20:08:27 +0000 (16:08 -0400)]
Remove code in nativeaot event trace files under !FEATURE_NATIVEAOT or FEATURE_DTRACE (#88258)

16 months agoAdd NFloat as an interop intrinsic for the source generator (#88257)
Jeremy Koritzinsky [Fri, 30 Jun 2023 18:30:22 +0000 (11:30 -0700)]
Add NFloat as an interop intrinsic for the source generator (#88257)

16 months agoReduce allocations in Microsoft.Extensions.Configuration (#88211)
Pent Ploompuu [Fri, 30 Jun 2023 16:39:46 +0000 (19:39 +0300)]
Reduce allocations in Microsoft.Extensions.Configuration (#88211)

Co-authored-by: Günther Foidl <gue@korporal.at>
16 months ago[libs] Fix poll events conversion (#86843)
Trung Nguyen [Fri, 30 Jun 2023 16:05:40 +0000 (02:05 +1000)]
[libs] Fix poll events conversion (#86843)

- Use bitwise and to check for all flags instead of using a switch
statement for poll events flags conversion.
- Convert poll events before comparison in assert statement.

16 months agoTweak the register order for xarch to better account for callee saved (#88151)
Tanner Gooding [Fri, 30 Jun 2023 15:43:01 +0000 (08:43 -0700)]
Tweak the register order for xarch to better account for callee saved (#88151)

* Tweak the register order for xarch to better account for callee saved

* Have a different register order for leaf methods

* Preference R12 after R13 for 2x the savings

* Allow float/vector constants to use EVEX registers

* Fix Runtime_34937 to expect the right codegen on Unix

* Don't add VAR_ORDER_LEAF and add a comment explaining why we prefer callee trash then callee save

* Simplifying the REG_VAR_ORDER_FLT_EVEX_CALLEE_* defines

* Ensure x86 matches the general x64 ordering

* Ensure that AllBitsSet vector constants correctly handle high simd registers

* Ensure that Runtime_34937 expects the right codegen for Windows x64

* Improve the register ordering more

* Ensure scalar AllBitsSet handles EVEX registers

* Don't change register allocation order for x86

* Minimize the diffs

16 months agoImprove Microsoft.Extensions.DependencyInjection debugging (#88082)
James Newton-King [Fri, 30 Jun 2023 13:19:14 +0000 (21:19 +0800)]
Improve Microsoft.Extensions.DependencyInjection debugging (#88082)

16 months agoJIT: Refactor physical promotion store decomposition slightly (#88182)
Jakob Botsch Nielsen [Fri, 30 Jun 2023 12:50:14 +0000 (14:50 +0200)]
JIT: Refactor physical promotion store decomposition slightly (#88182)

Introduce a LocationAccess helper class to create derived accesses off
of the destination and source locations for the store. Unify all the
code that looks for regularly promoted fields in this class, and use it
consistently for all the derived accesses.

Also update terminology from "assignment" to "store" in a few places,
and add a "(last use)" string for fields when decomposing block stores.

16 months agoupdate QuicError (#88234)
Tomas Weinfurt [Fri, 30 Jun 2023 12:15:05 +0000 (14:15 +0200)]
update QuicError (#88234)

* update QuicError

* feedback

* ProtocolError

16 months agoUpdate System.CommandLine version (#84229)
Adeel Mujahid [Fri, 30 Jun 2023 12:06:43 +0000 (15:06 +0300)]
Update System.CommandLine version (#84229)

16 months agoUpdate the CompilerPlatformTestingVersion. (#88221)
Parker Bibus [Fri, 30 Jun 2023 08:34:57 +0000 (01:34 -0700)]
Update the CompilerPlatformTestingVersion. (#88221)

16 months agoLocalized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 221217...
dotnet bot [Fri, 30 Jun 2023 08:29:21 +0000 (10:29 +0200)]
Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2212176 (#88219)

16 months agoDon't emit nor generate the manifest for NativeRuntimeEventSource (#86850)
Nickolas McDonald [Fri, 30 Jun 2023 07:45:25 +0000 (03:45 -0400)]
Don't emit nor generate the manifest for NativeRuntimeEventSource (#86850)

16 months ago[OSX] When HybridGlobalization mode is on load hybrid icu file (#88041)
Meri Khamoyan [Fri, 30 Jun 2023 07:00:22 +0000 (11:00 +0400)]
[OSX] When HybridGlobalization mode is on load hybrid icu file  (#88041)

Load icudt_hybrid.dat file when hybrid mode is on

16 months agoDisable Aot and Trim analyzers when building runtime tests (#88209)
Jan Kotas [Fri, 30 Jun 2023 06:53:58 +0000 (23:53 -0700)]
Disable Aot and Trim analyzers when building runtime tests (#88209)

When targeting native AOT, these analyzers are producing warnings that are treated as errors

16 months ago[nativeaot][perf] Simplify the build process for the perf measurements (#88201)
Milos Kotlar [Fri, 30 Jun 2023 06:08:30 +0000 (08:08 +0200)]
[nativeaot][perf] Simplify the build process for the perf measurements (#88201)

* Simplify the build process and update sample app build script

* Update eng/pipelines/coreclr/perf-non-wasm-jobs.yml

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
---------

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
16 months agoSpecially consider CLong, CULong and Guid strictly blittable (#88213)
Jeremy Koritzinsky [Fri, 30 Jun 2023 02:58:29 +0000 (19:58 -0700)]
Specially consider CLong, CULong and Guid strictly blittable (#88213)

16 months agoFix MSBuild integration for the host build with CMake 3.26 (#88208)
Jeremy Koritzinsky [Thu, 29 Jun 2023 23:05:19 +0000 (16:05 -0700)]
Fix MSBuild integration for the host build with CMake 3.26 (#88208)

16 months ago[wasm][debugger] Fixing "Frame not in module" after vscode-js-debug changes (#87979)
Thays Grazia [Thu, 29 Jun 2023 22:15:43 +0000 (19:15 -0300)]
[wasm][debugger] Fixing "Frame not in module" after vscode-js-debug changes (#87979)

* support executionContextsCleared message

* addressing @radical comments

* change singleordefault with firstordefault

16 months agoReplace EventWrittenEventArgs.EmptyPayload with ReadOnlyCollection.Empty singleton...
Stephen Toub [Thu, 29 Jun 2023 21:02:24 +0000 (17:02 -0400)]
Replace EventWrittenEventArgs.EmptyPayload with ReadOnlyCollection.Empty singleton (#87906)