platform/upstream/dotnet/runtime.git
22 months agoImprove reachability sets computation (#84204)
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

22 months agoAddress timeouts in merged test groups (#84193)
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.

22 months agoImprove Guid.Parse (#84200)
Egor Bogatov [Sat, 1 Apr 2023 13:59:52 +0000 (15:59 +0200)]
Improve Guid.Parse (#84200)

22 months agoUse FastAllocateString in InvariantModeCasing (#84206)
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

22 months agoOptimization on LinearScan::buildPhysRegRecords (#83862)
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.

22 months agoImprove Binary Xml (XmlDictionaryWriter) performance (#71478)
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>
22 months agoDelete GT_ADDR (#84147)
SingleAccretion [Sat, 1 Apr 2023 02:59:49 +0000 (05:59 +0300)]
Delete GT_ADDR (#84147)

22 months agoPreserve OCE.CancellationToken in ReadAtLeastAsync of StreamPipeReader (#83926)
Emmanuel André [Sat, 1 Apr 2023 01:54:32 +0000 (03:54 +0200)]
Preserve OCE.CancellationToken in ReadAtLeastAsync of StreamPipeReader (#83926)

22 months agoReverting: Set AssemblyName.ProcessorArchitecture for compatibility (#80581) (#84028)
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)

22 months agoInitial step for adding AssemblyBuilder.Save implementation (#83554)
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>
22 months agoImprove XmlSerializationWriter.WriteTypedPrimitive (#76436)
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>
22 months agoAdd linker flags to add fixup data to PDBs (#58417) (#84099)
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)

22 months agoDelete unmanaged type name parser from CoreCLR (#84159)
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

22 months agoDelete two quirks for some CQ (#84176)
SingleAccretion [Fri, 31 Mar 2023 20:05:26 +0000 (23:05 +0300)]
Delete two quirks for some CQ (#84176)

22 months ago[NativeAOT] Fixes for two rare stress issues. (#83908)
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

22 months agoVectorize Convert.FromHexString (#82521)
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>
22 months agoUse ldp/stp with SIMD registers on Arm64 (#84135)
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

22 months agoFix error thrown on multiple non-conforming StartupHook.Initialize signatures (#84158)
Elinor Fung [Fri, 31 Mar 2023 16:22:12 +0000 (09:22 -0700)]
Fix error thrown on multiple non-conforming StartupHook.Initialize signatures (#84158)

22 months agoConvert JIT\Regression tests to merged test groups (#83895)
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)

22 months agoAdd additional close statuses in ManagedWebSocket (#83827)
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>
22 months agoFix assert when SpanHelpers.SequenceEqual is unused (#84155)
Egor Bogatov [Fri, 31 Mar 2023 08:29:50 +0000 (10:29 +0200)]
Fix assert when SpanHelpers.SequenceEqual is unused (#84155)

22 months agoSplit `TryGetGenericMethodComponents` into two overloads (#84156)
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.

22 months agoTake advantage of simplifications enabled by folding all indirect access to locals...
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

22 months agoRefactor `Interop.LocalAlloc` (#82450)
xtqqczze [Fri, 31 Mar 2023 04:42:28 +0000 (05:42 +0100)]
Refactor `Interop.LocalAlloc` (#82450)

* Refactor `Interop.LocalAlloc`

22 months agoCorrect three code comments in Dictionary.cs (#84128)
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.

22 months agoFix type parsing error returned for type names with invalid start of assembly name...
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

22 months agoFix AREA alignment warning on Windows ARM64 (#84020)
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.

22 months agoUpdate API Review Process doc with updated link and blurb (#84133)
Jeff Handley [Thu, 30 Mar 2023 20:23:45 +0000 (13:23 -0700)]
Update API Review Process doc with updated link and blurb (#84133)

22 months agoDisable System.Net.Sockets\tests\FunctionalTests\System.Net.Sockets.Tests.csproj...
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)

22 months agoSwitch attribute equality to the valuetype equality plan (#84095)
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.

22 months agoProper type name parser for native AOT compiler (#83657)
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

22 months ago[wasm] Implement MINT_SHL_AND_ in the jiterpreter (#84083)
Katelyn Gadd [Thu, 30 Mar 2023 14:02:58 +0000 (07:02 -0700)]
[wasm] Implement MINT_SHL_AND_ in the jiterpreter (#84083)

22 months ago[Mono] Intrinsify multiply and divide for mini JIT on ARM64 (#84004)
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

22 months ago[mono] Implement GC descriptor for structs with InlineArray attribute (#84097)
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

22 months agoFix profiler handle GC tests (#83968)
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

22 months agoFixing a few xml doc comments for the Vector###.WithUpper APIs (#84113)
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)

22 months agoRevert #80698 and obsolete JsonSerializerOptions.AddContext (#84022)
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

22 months agoExpose helper APIS for GetLower/Upper and WithLower/Upper (#83982)
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

22 months agoUpdate check-service-labels to trigger on branch edit (#84109)
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>
22 months ago[NativeAOT] Making thread local storage completely managed. (#84060)
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

22 months agoSmaller static constructor context (#83937)
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.

22 months agoUpdating some places to cover xmm16-xmm31 (#84088)
Tanner Gooding [Wed, 29 Mar 2023 23:19:44 +0000 (16:19 -0700)]
Updating some places to cover xmm16-xmm31 (#84088)

* Updating some places to cover xmm16-xmm31

* Remove XMM0-XMM31 and K0-K7 from mapRegNumToDwarfReg

22 months agoRemove double quotes from OwnerCompositeExecutable (#83552)
Eduardo Velarde [Wed, 29 Mar 2023 18:23:42 +0000 (11:23 -0700)]
Remove double quotes from OwnerCompositeExecutable (#83552)

22 months agoUnroll SequenceEqual(ref byte, ref byte, nuint) in JIT (#83945)
Egor Bogatov [Wed, 29 Mar 2023 15:17:08 +0000 (17:17 +0200)]
Unroll SequenceEqual(ref byte, ref byte, nuint) in JIT (#83945)

Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
22 months ago[wasm] Implement integer log2 in jiterpreter (#84068)
Katelyn Gadd [Wed, 29 Mar 2023 15:12:02 +0000 (08:12 -0700)]
[wasm] Implement integer log2 in jiterpreter (#84068)

22 months ago[wasm] Filter jiterp cfg back branch table before generating a dispatch table (#84067)
Katelyn Gadd [Wed, 29 Mar 2023 15:00:13 +0000 (08:00 -0700)]
[wasm] Filter jiterp cfg back branch table before generating a dispatch table (#84067)

If the cfg only contains one back branch target, use a br_if instead of a br_table

22 months agoFix #84053. (#84070)
Eirik Tsarpalis [Wed, 29 Mar 2023 14:26:53 +0000 (15:26 +0100)]
Fix #84053. (#84070)

22 months agoRemove HybridGlobalization info from linker feature switches (#84073)
Meri Khamoyan [Wed, 29 Mar 2023 13:50:05 +0000 (17:50 +0400)]
Remove HybridGlobalization info from linker feature switches (#84073)

22 months ago[mono] Mono support for InlineArrayAttribute (#83776)
Milos Kotlar [Wed, 29 Mar 2023 12:02:44 +0000 (14:02 +0200)]
[mono] Mono support for InlineArrayAttribute (#83776)

* Add InlineArray attribute in class init

* Add constraints for InlineArrayAttribute

* Consider the struct field as an array in compute_class_bitmap

* Make a note on marshalling structs with InlineArrayAttribute

* Enable InlineArray tests on Mono

* Move custom attribute value retrieval to a callback function

22 months agoStreamline a few members of char (#84024)
Stephen Toub [Wed, 29 Mar 2023 11:12:17 +0000 (07:12 -0400)]
Streamline a few members of char (#84024)

- Remove a branch from IsLetterOrDigit
- Slightly shrink the asm for IsPunctuation and IsSymbol
- Remove a bounds check from IsSurrogatePair
- Remove some bounds checks, other branching, and duplicative code from ConvertToUtf32

22 months agoMake use of "space" and "whitespace" consistent in emitted regex comments (#84055)
Stephen Toub [Wed, 29 Mar 2023 11:11:11 +0000 (07:11 -0400)]
Make use of "space" and "whitespace" consistent in emitted regex comments (#84055)

There are a few places we output a description of `\s` or `\S` in the generator.  Some of them say "space" and some say "whitespace".  This just makes them consistently use the latter.

22 months agoFix static test methods on abstract classes (#84054)
Stephen Toub [Wed, 29 Mar 2023 11:10:12 +0000 (07:10 -0400)]
Fix static test methods on abstract classes (#84054)

xunit isn't finding these to run them.  The fix is to make them non-static.

22 months agoLocalized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 214640...
dotnet bot [Wed, 29 Mar 2023 09:08:46 +0000 (02:08 -0700)]
Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2146401 (#84063)

22 months ago[mono][interp] Add super instruction for common left shift pattern (#83512)
Vlad Brezae [Wed, 29 Mar 2023 07:45:13 +0000 (10:45 +0300)]
[mono][interp] Add super instruction for common left shift pattern (#83512)

* [mono][interp] Add super instruction for common left shift pattern

Where we mask against 31 / 63

* [mono][interp] Special case for 31 and 63 immediates

It adds great speedup while these being by far the most common patterns.

22 months agoSet minimum language version allowed by config binding generator (#83996)
Layomi Akinrinade [Wed, 29 Mar 2023 04:47:17 +0000 (21:47 -0700)]
Set minimum language version allowed by config binding generator (#83996)

* Set minimum language version allowed by config binding generator

* Address feedback; use correct diagnostic severity

22 months agouse ROSpan in SslStreamCertificateContext (#83485)
Tomas Weinfurt [Wed, 29 Mar 2023 03:06:10 +0000 (20:06 -0700)]
use ROSpan in SslStreamCertificateContext (#83485)

* use ROSpan in SslStreamCertificateContext

* feedback from review

22 months agoCoalesce identical constant WordCategories (#84047)
Marc Brooks [Wed, 29 Mar 2023 01:05:10 +0000 (20:05 -0500)]
Coalesce identical constant WordCategories (#84047)

* Coalesce identical constant WordCategories

There are four places the same mask is computed in this project, can't eliminate the one in RegexGenerator.Emitter or its matching unit test because that's outputting the actual C# source string.
Changed the name `WordCategoriesMask` to avoid a conflict with  existing member.
Removed the detritus in the comments from the copy-paste from Emitter source (trailing `"` and `,`)

* Update src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexCharClass.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
---------

Co-authored-by: Stephen Toub <stoub@microsoft.com>
22 months ago[wasm] Boost hit count for outer back branch targets; improve conditional execution...
Katelyn Gadd [Wed, 29 Mar 2023 00:25:38 +0000 (17:25 -0700)]
[wasm] Boost hit count for outer back branch targets; improve conditional execution detection (#83630)

* More intelligently identify whether a given instruction will be conditionally executed
* If a back branch target can't be reached from inside the current trace and it is a trace prepare point, boost its hit count
This will cause it to get jitted sooner

22 months agoAdd lowering for As*() and dependent methods. (#83861)
DeepakRajendrakumaran [Tue, 28 Mar 2023 23:38:05 +0000 (16:38 -0700)]
Add lowering for As*() and dependent methods. (#83861)

* Add lowering for As*() and dependent methods.

This includes the following:
As(), AsByte(), AsDouble(), AsInt16(), AsInt32(), AsInt64(), AsNInt(), AsNUInt(), AsByte(), AsSingle(), AsUInt16(), AsUInt32(), AsUInt64(), AsVector(), AsVector512(), GetLower(), ToVector512()

* Handling xmm <-> zmm conversions.

* Addressing review comments.

22 months agoJIT: small OSR locals must be normalize on load (#84000)
Andy Ayers [Tue, 28 Mar 2023 23:27:21 +0000 (16:27 -0700)]
JIT: small OSR locals must be normalize on load (#84000)

When I changed the importation strategy for OSR in #83910 it
exposed a latent issue -- small OSR locals must normalized on load if
they were exposed at Tier0.

Fixes #83959.
Fixes #83960.

23 months agoFix precondition if HOST_UNIX in ClrVirtualAllocWithinRange() (#84023)
Ilia [Tue, 28 Mar 2023 23:06:03 +0000 (01:06 +0200)]
Fix precondition if HOST_UNIX in ClrVirtualAllocWithinRange() (#84023)

Fixes #83818

23 months agoRestore original stack ref enumeration behavior (#84034)
Lee Culver [Tue, 28 Mar 2023 21:03:03 +0000 (14:03 -0700)]
Restore original stack ref enumeration behavior (#84034)

The previous change to ICorDebugGCReferenceEnum accidently inverted the logic for interior pointers.

23 months agoFix service label action (#84046)
Carlos Sánchez López [Tue, 28 Mar 2023 20:21:41 +0000 (13:21 -0700)]
Fix service label action (#84046)

23 months agoCreate action to check servicing label (#84038)
Juan Hoyos [Tue, 28 Mar 2023 19:17:01 +0000 (12:17 -0700)]
Create action to check servicing label (#84038)

23 months agoProvide support for exposing .NET classes to COM through source generation (#83755)
Jeremy Koritzinsky [Tue, 28 Mar 2023 18:01:18 +0000 (11:01 -0700)]
Provide support for exposing .NET classes to COM through source generation (#83755)

23 months agoLibraries area pod updates for March 2023, plus some fabricbot maintenance (#83897)
Jeff Handley [Tue, 28 Mar 2023 17:39:32 +0000 (10:39 -0700)]
Libraries area pod updates for March 2023, plus some fabricbot maintenance (#83897)

* Regenerate fabricbot.json with pod updates

* Tag the area-System-ComponentModel-DataAnnotations team

* Add marek-safar as a mentionee for linkable-framework

* Libraries area pod updates March 2023. Includes catching area-owners.json up to area-owners.md.

* Add bartonjs as mentions for security/formats areas

* Sort issue routing areas

* Add areas missing from issue routing

* Use dotnet/area-system-speech team mention

* Add vcsjones as a consultant for Asn1 and Cbor

* Remove empty condition on 'breaking-change' label config

* Add wfurt as a consultant to System.Security

23 months agoReimplement DacStackReferenceWalker and DacHandleWalker (#83836)
Lee Culver [Tue, 28 Mar 2023 16:36:21 +0000 (09:36 -0700)]
Reimplement DacStackReferenceWalker and DacHandleWalker (#83836)

* Refactor DacStackReferenceWalker

Added a flag to not resolve interior pointers to the start of the object. This allows the debugger to shoulder that burden instead of the dac doing this work. This greatly speeds up stack root walking.

Greatly simplified the logic. There's a memory error in this code lurking somewhere because it used some complicated pointer arithmetic that wasn't correct. Since copying references isn't time critical code, I made this as dead simple as possible so it's easy to validate.

* Clean up and simplify DacHandleWalker

* Minor fixes

* Only produce SOS style reference lists

* Fix build warnings

* Fix handle walking issue

* Fix minor handle walking issue

23 months agoUpdate backport template and servicing docs (#83795)
Carlos Sánchez López [Tue, 28 Mar 2023 16:34:21 +0000 (09:34 -0700)]
Update backport template and servicing docs (#83795)

* Update backport template to indicate new staging branches rule.

* Update library servicing.

23 months agoDelete Microsoft.Windows.Compatibility from runtime (#84013)
Viktor Hofer [Tue, 28 Mar 2023 15:39:25 +0000 (17:39 +0200)]
Delete Microsoft.Windows.Compatibility from runtime (#84013)

https://github.com/dotnet/winforms/pull/8909 moves the M.W.C package into
windowsdesktop. Deleting the source from runtime and the package
versions that aren't used anymore.

23 months agoCheck in shim typeforwards and remove the dependency on the underlying targeting...
Viktor Hofer [Tue, 28 Mar 2023 15:32:33 +0000 (17:32 +0200)]
Check in shim typeforwards and remove the dependency on the underlying targeting packs (#79147)

* Make .NET Framework and .NET Standard facade changes trackable

Fixes https://github.com/dotnet/runtime/issues/65997

GenFacade is a tool that inspects a contract assembly's public API surface safe area, compares it with a passed in assembly closure and emits a C# source file with type forwards in it so that the satisfied API can be forwarded from the contract to the "implementation". GenFacades is used to construct the .NETFramework and the .NETStandard shim assemblies which live under src/libraries/shims/.

The generated source file isn't checked into the tree, it's placed into the project's intermediate output path. IMO it would help if we check these files into the tree so that any changes that impact shims - intentional or unintentional - are trackable. As an example, I just recently refactored how the shims are structured under src/libraries/shims and unintentionally removed a type forward from an assembly. I only noticed this regression by pure luck later.

The priority of this issue just rose because source build plans to remove their .NET Framework reference assembly packages during the .NET 8 release. That means that we can't automatically generate the type forwards during source-build. I will work on removing the dependency and check the type forwards in instead.

* Make shim projects declare the dependencies explicitly

Also remove the System.Xml special runtime project which isn't necessary
anymore as the compiler now allows type forwards to Obsolete types with
error=true.

* System.Core build fix

* Remove unused file

* Revert "Remove unused file"

This reverts commit 2f5d410a1ff2ed4705a7256c19cd65aa11107267.

* Add README and fix GenFacades zero version logic

23 months agoEnsure that CONTEXT_XStateFeaturesMask is explicitly zeroed out on RtlCaptureContext...
Tanner Gooding [Tue, 28 Mar 2023 14:42:36 +0000 (07:42 -0700)]
Ensure that CONTEXT_XStateFeaturesMask is explicitly zeroed out on RtlCaptureContext (#84012)

23 months agoRenable running Arm64 test cases in CI (#83948)
Kunal Pathak [Tue, 28 Mar 2023 14:31:13 +0000 (07:31 -0700)]
Renable running Arm64 test cases in CI (#83948)

* remove _IncludeArm64HWIntrinsicTests restriction

* Remove _IncludeXarchHWIntrinsicTests

* Remove comments

23 months ago[wasm] Use docker images with emscripten 3.1.30 (#84014)
Radek Doulik [Tue, 28 Mar 2023 13:07:02 +0000 (15:07 +0200)]
[wasm] Use docker images with emscripten 3.1.30 (#84014)

Currently the webassembly docker images with name ending with net8 have
emscripten 3.1.34 and break wasm builds on CI.

23 months ago[workload] Fix using empty RuntimeIdentifier in LibraryBuilder AutoImport.props ...
Steve Pfister [Tue, 28 Mar 2023 12:51:33 +0000 (08:51 -0400)]
[workload] Fix using empty RuntimeIdentifier in LibraryBuilder AutoImport.props (#83834)

When `mobile-librarybuilder-experimental` is installed, the LibraryBuilder SDK AutoImport.props activates and it incorrectly tries to IndexOf RuntimeIdentifier even when it's an empty string. This can lead to annoying error messages popping up even when not using the workload.

The fix is to add a condition only when RuntimeIdentifier has a value.

23 months agoFix infinite timeout passed to CancellationTokenSource.CancelAfter (#84009)
Stephen Toub [Tue, 28 Mar 2023 10:24:48 +0000 (06:24 -0400)]
Fix infinite timeout passed to CancellationTokenSource.CancelAfter (#84009)

The recent change to introduce ITimer broke CTS.CancelAfter(Timeout.InfiniteTimeSpan).  The TimeSpan's milliseconds were extracted as a uint but then ended up being cast to a long, such that rather than representing -1 milliseconds, it represented 4294967295 milliseconds.  With the uint representation in Timer, Timeout.UnsignedInfinite needs to be special-cased.

23 months agoUse bit mask in Regex's IsWordChar (#84003)
Stephen Toub [Tue, 28 Mar 2023 10:22:42 +0000 (06:22 -0400)]
Use bit mask in Regex's IsWordChar (#84003)

23 months agoEnable regex source gen / compiler vectorization of all sets (#83992)
Stephen Toub [Tue, 28 Mar 2023 10:18:27 +0000 (06:18 -0400)]
Enable regex source gen / compiler vectorization of all sets (#83992)

* Enable regex source gen / compiler vectorization of all sets

When emitting TryFindNextPossibleStartingPosition based on a set that's a fixed-distance from the start of the pattern, today we're able to vectorize a variety of cases.  In .NET 7, this was largely limited to very small sets that contained only 1-5 characters.  Earlier in .NET 8, we expanded this to include ranges (e.g. [0-9]) and more impactfully sets containing any number of only ASCII values (e.g. [A-Za-z0-9]).  That still, however, leaves sets that are non-continguous and contain anything non-ASCII, which is extremely common.  For example, the set `[a-z]` with `RegexOptions.IgnoreCase` actually gets expanded to be `[A-Za-z\u212A]` because the Kelvin sign is considered case-equivalent with `k`, and that means for such a set, we wouldn't employ any vectorized helper and would instead just walk character by character.

With this PR, we'lll now employ some vectorization as part of that remaining class of set as well in the compiler and source generator.  In particular, we do a vectorize a search for the ASCII portion of the set along with anything non-ASCII.  If the found result is ASCII, we're done.  If the found result is non-ASCII, then we proceed to walk character by character as was done previously.

* Address PR feedback

23 months agoInitial changes for GetLocaleInfoString (#81470)
Meri Khamoyan [Tue, 28 Mar 2023 08:13:28 +0000 (12:13 +0400)]
Initial changes for GetLocaleInfoString (#81470)

Initial changes for globalization hybrid mode.
Implemented GetLocaleInfoStringName and GetLocaleNameNative for osx platforms.

23 months agoJIT: Allow forward substituting small-typed nodes (#83969)
Jakob Botsch Nielsen [Tue, 28 Mar 2023 07:07:52 +0000 (09:07 +0200)]
JIT: Allow forward substituting small-typed nodes (#83969)

23 months agoJIT: Generalize handling of commas in block morphing (#83590)
Jakob Botsch Nielsen [Tue, 28 Mar 2023 07:03:17 +0000 (09:03 +0200)]
JIT: Generalize handling of commas in block morphing  (#83590)

Eliminate commas early in block morphing, before the rest of the
transformation needs to look at it. Do this by extracting their side
effects and adding them on top of the returned result instead. This
allows us to handle arbitrary COMMAs on destination operand in a general
manner.

Prerequisite to #83388.

Fix #1699.

23 months agoMark the windows runtime packs workload as abstract (#83230)
Larry Ewing [Tue, 28 Mar 2023 04:51:43 +0000 (23:51 -0500)]
Mark the windows runtime packs workload as abstract (#83230)

23 months agoAdd osx-arm64 for coreclr packages. (#84001)
Aaron Robinson [Tue, 28 Mar 2023 04:50:50 +0000 (21:50 -0700)]
Add osx-arm64 for coreclr packages. (#84001)

* Add osx-arm64 for coreclr packages.

This was found looking for TestHost osx-arm64

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
23 months agoExtend mstat format with information that maps to dependency nodes (#83578)
Michal Strehovský [Tue, 28 Mar 2023 03:45:48 +0000 (12:45 +0900)]
Extend mstat format with information that maps to dependency nodes (#83578)

This will allow crossreferencing MSTAT with DGML files. The ultimate goal is to allow folding information from DGML into MSTAT (so that we don't need two files) but... baby steps.

This is a breaking change to the file format. I don't anticipate a breaking change after this. The DGML folding would be backwards compatible. I considered making it non-breaking, but I think it's just better to bite the bullet now. To fix existing readers, just skip over the new entry. Like in this diff: https://gist.github.com/MichalStrehovsky/2c7cb3d623c7f8901541914dab04238d/revisions

This adds an extra instruction encoding the name into each entry of the Method and Types stream.

We avoid the problem in #75328 (where the strings ran over the 16 MB total length limit) by generating the textual strings into a separate PE section. The record contains an integer index into this section.

If you would like to read it, it's not possible with Cecil, but the superior metadata reader in S.R.Metadata comes to the rescue. This is the ~diff you'd want to apply (and make a similar adjustment for methods): https://gist.github.com/MichalStrehovsky/195967f3a117663b6340cd828a52dfc7/revisions. If you're worried about duplicate loading, I'd suggest creating a memory mapped view of the file and sharing the same view between Cecil and S.R.Metadata. S.R.Metadata is pretty much no overhead on it's own.

23 months ago[mono][jit] Fix the removal of relations added by basic blocks. (#83943)
Zoltan Varga [Tue, 28 Mar 2023 02:42:21 +0000 (22:42 -0400)]
[mono][jit] Fix the removal of relations added by basic blocks. (#83943)

If a basic block added two relations to the same variable, like by two op_not_null
opcodes, then sometimes the relations were not removed, causing
invalid null check elimination in unrelated basic blocks.

Fixes https://github.com/dotnet/runtime/issues/83941.

23 months ago[System.Net] Introduce CIDR IPNetwork (#82779)
Murat Duisenbayev [Mon, 27 Mar 2023 23:25:56 +0000 (01:25 +0200)]
[System.Net] Introduce CIDR IPNetwork (#82779)

23 months agoFix function pointer as fields inspection (#83981)
Aaron Robinson [Mon, 27 Mar 2023 21:31:31 +0000 (14:31 -0700)]
Fix function pointer as fields inspection (#83981)

This was missed when C# function pointers support
was added to the runtime. The current fix is reporting
all functions pointers as `IntPtr` type. It should be
possible in a future update to properly represent a
more accurate type for the function pointer.

23 months agoAdd ability specify core_root when run (#82387)
Andrii Kurdiumov [Mon, 27 Mar 2023 20:11:52 +0000 (02:11 +0600)]
Add ability specify core_root when run (#82387)

I use this to run tests of Loongarch, it was long time ago when I implement this, but most likely missing crossgen2 do not allow me properly build Core_Root automatically, so I have to specify it manually from well known location.

23 months agoSwitch the channel from 8.0 to 8.0-preview (#83984)
Kunal Pathak [Mon, 27 Mar 2023 19:30:17 +0000 (12:30 -0700)]
Switch the channel from 8.0 to 8.0-preview (#83984)

23 months agoupdate types mentioned in comment to match method (#82768)
Tom Rathbone [Mon, 27 Mar 2023 18:58:46 +0000 (20:58 +0200)]
update types mentioned in comment to match method (#82768)

seems that the comment got copied over from FrozenSet and not updated

23 months agoadd link to interop guidelines (#83987)
Dan Moseley [Mon, 27 Mar 2023 18:40:19 +0000 (12:40 -0600)]
add link to interop guidelines (#83987)

23 months agoModernize XmlUTF8TextWriter with u8/inline out's. (#75812)
Joseph Lennox [Mon, 27 Mar 2023 18:14:52 +0000 (11:14 -0700)]
Modernize XmlUTF8TextWriter with u8/inline out's. (#75812)

* Modernize XmlUTF8TextWriter with u8/inline out's.

* PR feedback

---------

Co-authored-by: Steve Molloy <smolloy@microsoft.com>
23 months agoFix Iran time zone test case (#83952)
Tarek Mahmoud Sayed [Mon, 27 Mar 2023 18:04:09 +0000 (11:04 -0700)]
Fix Iran time zone test case (#83952)

Co-authored-by: Stephen Toub <stoub@microsoft.com>
23 months agoUpdating Unix to save/restore Avx512 state (#83784)
Tanner Gooding [Mon, 27 Mar 2023 17:42:51 +0000 (10:42 -0700)]
Updating Unix to save/restore Avx512 state (#83784)

* Updating Unix to save/restore Avx512 state

* Ensure compilation works when XSTATE_SUPPORTED isn't defined

* Ensure __cpuid isn't implemented on Arm32/Arm64

* Fixing a couple of build failures

* Fixing some OSX failures

* More OSX fixes

* More build fixes

* AltJit and another OSX build fix

* Ensure an assert checks the right bit

* Fixing an assert on OSX to account for general XSTATE tracking

* Addressing PR feedback

* Various fixups and bug fixes to appease CI

* Use HOST_AMD64 not HOST_64BIT

* Explicitly bypass AVX512 support on OSX until thread enablement can be resolved

* Remove commented out code for OSX in favor of just leaving a comment explaining

* Use HAVE_MACH_EXCEPTIONS not TARGET_OSX

23 months agoIssue 83667 (#83820)
careri [Mon, 27 Mar 2023 17:06:09 +0000 (19:06 +0200)]
Issue 83667 (#83820)

* Fixed devcontainer

* Issue-83667 Fixed misleading exception message

* issue-83667 Fixed test

* issue-83667 Reverted .devcontainer fix

23 months ago[main] Update dependencies from dotnet/roslyn (#83301)
dotnet-maestro[bot] [Mon, 27 Mar 2023 15:21:55 +0000 (10:21 -0500)]
[main] Update dependencies from dotnet/roslyn (#83301)

* Update dependencies from https://github.com/dotnet/roslyn build 20230310.6

Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
 From Version 4.6.0-3.23160.1 -> To Version 4.6.0-3.23160.6

* Update dependencies from https://github.com/dotnet/roslyn build 20230311.1

Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
 From Version 4.6.0-3.23160.1 -> To Version 4.6.0-3.23161.1

* Update dependencies from https://github.com/dotnet/roslyn build 20230313.3

Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
 From Version 4.6.0-3.23160.1 -> To Version 4.6.0-3.23163.3

* Update dependencies from https://github.com/dotnet/roslyn build 20230314.6

Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
 From Version 4.6.0-3.23160.1 -> To Version 4.6.0-3.23164.6

* Update dependencies from https://github.com/dotnet/roslyn build 20230320.16

Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
 From Version 4.6.0-3.23160.1 -> To Version 4.6.0-3.23170.16

* Update dependencies from https://github.com/dotnet/roslyn build 20230321.17

Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
 From Version 4.6.0-3.23160.1 -> To Version 4.6.0-3.23171.17

* Update dependencies from https://github.com/dotnet/roslyn build 20230322.9

Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
 From Version 4.6.0-3.23160.1 -> To Version 4.6.0-3.23172.9

* Update dependencies from https://github.com/dotnet/roslyn build 20230324.2

Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
 From Version 4.6.0-3.23160.1 -> To Version 4.6.0-3.23174.2

* Add unsafe

* Update dependencies from https://github.com/dotnet/roslyn build 20230324.3

Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
 From Version 4.6.0-3.23160.1 -> To Version 4.6.0-3.23174.3

* Update dependencies from https://github.com/dotnet/roslyn build 20230325.1

Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
 From Version 4.6.0-3.23160.1 -> To Version 4.6.0-3.23175.1

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
23 months agoDocumentation for loading custom files in Blazor. (#83925)
Ilona Tomkowicz [Mon, 27 Mar 2023 15:00:45 +0000 (17:00 +0200)]
Documentation for loading custom files in Blazor. (#83925)

* How to load custom icu files in Blazor.

* Specify the path form.

Specify how the path should look like for both: Blazor and WASM app.

* Nit

23 months agoImplement checking for Requires* on attributes for NativeAOT (#83550)
Vitek Karas [Mon, 27 Mar 2023 11:28:03 +0000 (04:28 -0700)]
Implement checking for Requires* on attributes for NativeAOT (#83550)

Any of the RUC/RDC/RAF attributes can be added to an attribute (either the type or the .ctor or properties). The compiler needs to check for these and produce warnings if such attribute is instantiated somewhere.

This was added to "Dataflow" existing class, while it's not exactly data flow, adding a new abstraction didn't seem worth it.

Also does a simple dedupe of RUC/RDC/RAF checks in some places.

Adapt the tests to the new behavior. The most notable change is that NativeAOT will only look at attributes for reflection enabled members, so had to modify the tests to reflection access basically everything.

Use GetDisplayName for anything which is supported by that extension method - this fixes wrong origin printed out for property/event (we would print out 'PropertyPseudoDescriptor').

Mapping IL offset to source file/line number - if the PDB specifies that line as "hidden", then don't use it, instead look for the begining of the method - so first non-hidden sequence point in the method's body.
This is a copy of the logic implemented in illink already.

23 months agoTrim away netframework targets in source-build (#83899)
Nikola Milosavljevic [Mon, 27 Mar 2023 09:33:58 +0000 (02:33 -0700)]
Trim away netframework targets in source-build (#83899)

* Trim away netframework targets in source-build

* Move property unsetting to Directory.Build.props so it works in repo source-build

23 months agoJIT: Fix ordering of type initialization and stsfld (#80485)
Mark Plesko [Mon, 27 Mar 2023 09:11:16 +0000 (02:11 -0700)]
JIT: Fix ordering of type initialization and stsfld  (#80485)

Insertion of the type initializer before the tree for a stsfld could reorder them inappropriately. This includes those computation in the spill check.

Fixes #72354.

23 months agoDisable test failing on bad Alt-Svc header (#83876)
Marie Píchová [Mon, 27 Mar 2023 08:54:10 +0000 (10:54 +0200)]
Disable test failing on bad Alt-Svc header (#83876)