platform/upstream/dotnet/runtime.git
2 years agoUpdate fabricbot config for Libraries area pods. Scripts moved to dotnet/fabricbot...
Jeff Handley [Wed, 16 Mar 2022 18:30:09 +0000 (11:30 -0700)]
Update fabricbot config for Libraries area pods. Scripts moved to dotnet/fabricbot-config repo. (#66691)

* Update fabricbot config for Libraries area pods. Scripts moved to
dotnet/fabricbot-config repo.

* Apply the taskSource property to the generated tasks

2 years agoConsole.ReadKey should print a char, not an integer (#66609)
Adam Sitnik [Wed, 16 Mar 2022 17:02:20 +0000 (18:02 +0100)]
Console.ReadKey should print a char, not an integer (#66609)

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2 years agoClose helix tag. (#66717)
Parker Bibus [Wed, 16 Mar 2022 16:23:14 +0000 (11:23 -0500)]
Close helix tag. (#66717)

Close helix work item tag in android_scenarios.proj file that is missing it.

2 years agoFix System.Text.Json tests affected by DST (#66559)
Stephen A. Imhoff [Wed, 16 Mar 2022 12:48:00 +0000 (05:48 -0700)]
Fix System.Text.Json tests affected by DST (#66559)

* Correct whitespace

* Switch DateTime.Now -> DateTime.UtcNow

* Tweak formatting

* Change references to UtcNow to a fixed date/time value.

* Add missing common file reference

2 years agoDisabled in wasm. (#66698)
Ilona Tomkowicz [Wed, 16 Mar 2022 11:01:47 +0000 (12:01 +0100)]
Disabled in wasm. (#66698)

2 years agoFix outerloop NonBacktracking test throwing argument exception (#66693)
Stephen Toub [Wed, 16 Mar 2022 10:21:09 +0000 (06:21 -0400)]
Fix outerloop NonBacktracking test throwing argument exception (#66693)

2 years ago[mono] Optimize and clean-up `System.Reflection.Emit.ILGenerator`. (#65251)
Theodore Tsirpanis [Wed, 16 Mar 2022 10:06:11 +0000 (12:06 +0200)]
[mono] Optimize and clean-up `System.Reflection.Emit.ILGenerator`. (#65251)

2 years agoEnable some ARM32 tests (#66553)
Jakob Botsch Nielsen [Wed, 16 Mar 2022 09:51:28 +0000 (10:51 +0100)]
Enable some ARM32 tests (#66553)

- Enable tests relying on implicit tailcalls
- Enable all ABI stress tests

2 years agoCondition Windows SslCertificateTrust test on Registry value (#65848)
Radek Zikmund [Wed, 16 Mar 2022 09:34:52 +0000 (10:34 +0100)]
Condition Windows SslCertificateTrust test on Registry value (#65848)

Sending trusted issuers list on Windows is problematic (depends on registry settings), so there were no tests. This PR conditionally enables existing tests on Windows if the relevant registry setting is set.

2 years agoAwait pending client authentication task before disposing (#66682)
Radek Zikmund [Wed, 16 Mar 2022 07:30:14 +0000 (08:30 +0100)]
Await pending client authentication task before disposing (#66682)

Fixes #65455.

The assert was hit due to the SslStream being disposed during handshake, while `AuthenticateAsClientAsync` was still running. This removes a rare crash in test runs with debug libraries configuration.

2 years agoAddress a few TODOs on S.S.C.Cose. (#66641)
David Cantú [Wed, 16 Mar 2022 06:48:29 +0000 (23:48 -0700)]
Address a few TODOs on S.S.C.Cose.  (#66641)

* Make HeaderMaps optionals

* Improve handling of integers larger/smaller than int32 in Alg header

2 years agoExpose `LibraryImportAttribute` (#66434)
Elinor Fung [Wed, 16 Mar 2022 03:05:50 +0000 (20:05 -0700)]
Expose `LibraryImportAttribute` (#66434)

2 years agoRemove 4267 suppression from mono (#66552)
Adeel Mujahid [Tue, 15 Mar 2022 23:00:34 +0000 (01:00 +0200)]
Remove 4267 suppression from mono (#66552)

* Remove 4267 suppression from mono

* Fix a mono warning on linux arm64

* Remove trailing whitespaces from changeset

2 years agoFix check for IsTrimmable metadata (#66658)
Jan Kotas [Tue, 15 Mar 2022 22:52:49 +0000 (15:52 -0700)]
Fix check for IsTrimmable metadata (#66658)

Fixes #66593

2 years agoAdd withAssert flag in getTierName method (#66662)
Kunal Pathak [Tue, 15 Mar 2022 22:50:02 +0000 (15:50 -0700)]
Add withAssert flag in getTierName method (#66662)

* review feedback

* Remove the DEBUG condition

2 years agoFix stepping issues with ReadyToRun and TieredCompilation (#66491)
Aaron Robinson [Tue, 15 Mar 2022 21:49:05 +0000 (17:49 -0400)]
Fix stepping issues with ReadyToRun and TieredCompilation (#66491)

* Fix stepping with ReadyToRun and TieredCompilation assemblies

Get the correct PCODE version for ReadyToRun methods when the StubManager
  is computing the address to step to.

* Update logging
Update GetJitInfoWorker to respect code versioning

2 years agoFix register conflict between freeing large stack frames and fast tailcalls on arm32...
Jakob Botsch Nielsen [Tue, 15 Mar 2022 20:40:27 +0000 (21:40 +0100)]
Fix register conflict between freeing large stack frames and fast tailcalls on arm32 (#66588)

Fix #66585

2 years agoReenable SslStreamNetworkStreamTests on OSX #46837 (#66393)
Radek Zikmund [Tue, 15 Mar 2022 20:36:10 +0000 (21:36 +0100)]
Reenable SslStreamNetworkStreamTests on OSX  #46837 (#66393)

The underlying issue has been likely fixed by other changes

2 years agoUpdate maui SDK to 6.0.3xx (#66671)
Parker Bibus [Tue, 15 Mar 2022 19:21:49 +0000 (14:21 -0500)]
Update maui SDK to 6.0.3xx (#66671)

* Update downloaded SDK for maui to 6.0.3xx

2 years agosupport WindowsPrincipal in HttpListenerWebSocketContext (#65746)
Badre BSAILA [Tue, 15 Mar 2022 19:16:41 +0000 (20:16 +0100)]
support WindowsPrincipal in HttpListenerWebSocketContext (#65746)

* support WindowsPrincipal in HttpListenerWebSocketContext

* user Identity is known as instance of WindowsIdentity

* use TARGET_WINDOWS preprocessor

2 years agoEnsure serializer reflection-dependency sentinel is accurate (#66522)
Layomi Akinrinade [Tue, 15 Mar 2022 19:14:58 +0000 (12:14 -0700)]
Ensure serializer reflection-dependency sentinel is accurate (#66522)

* Ensure serializer reflection-dependency sentinel is accurate

* Address feedback

2 years agoFix assert for ARM shuffle thunk (#66642)
Bruce Forstall [Tue, 15 Mar 2022 18:41:22 +0000 (11:41 -0700)]
Fix assert for ARM shuffle thunk (#66642)

Handle case where gap exists at the beginning of the stack
range.

Fix #13241

2 years ago[wasm] Add vector measurements to the bench Sample (#66655)
Radek Doulik [Tue, 15 Mar 2022 18:26:29 +0000 (19:26 +0100)]
[wasm] Add vector measurements to the bench Sample (#66655)

Example output, chrome:

    | measurement | time |
    |-:|-:|
    |               Vector, Create Vector128 |     0.1340us |
    |              Vector, Add 2 Vector128's |     0.6261us |
    |         Vector, Multiply 2 Vector128's |     0.6257us |

v8:

    | measurement | time |
    |-:|-:|
    |               Vector, Create Vector128 |     0.3990us |
    |              Vector, Add 2 Vector128's |     0.9154us |
    |         Vector, Multiply 2 Vector128's |     0.9127us |

2 years agoFix for assert failure in distribute free regions (#66657)
Peter Sollich [Tue, 15 Mar 2022 18:15:50 +0000 (19:15 +0100)]
Fix for assert failure in distribute free regions (#66657)

* Fix the case where a region that was decommitted due to age is also among the highest free regions, and so gets moved to the decommit list again by region_allocator::move_highest_free_regions.

The fix is simply to check whether the region is already on the to_free_list and not move it or count it if it is.

* Fix typo.

* Fix logic in move_highest_free_regions.

2 years agoBring back unused implementation of type conversions (#66597)
Simon Rozsival [Tue, 15 Mar 2022 18:13:24 +0000 (19:13 +0100)]
Bring back unused implementation of type conversions (#66597)

2 years agoImplement X500DistinguishedNameBuilder
Kevin Jones [Tue, 15 Mar 2022 16:39:53 +0000 (12:39 -0400)]
Implement X500DistinguishedNameBuilder

2 years ago[Mono] Intrinsify Vector unary plus operator (#66586)
Simon Rozsival [Tue, 15 Mar 2022 16:31:32 +0000 (17:31 +0100)]
[Mono] Intrinsify Vector unary plus operator (#66586)

* Implement unary plus

* Fix param count assertion

2 years agoSome small copy propagation changes (#66582)
SingleAccretion [Tue, 15 Mar 2022 16:13:46 +0000 (19:13 +0300)]
Some small copy propagation changes (#66582)

* Add asserts

* Remove the quirk comment, replace with a TODO-CQ

2 years ago[Mono] Intrinsify Vector dot product on arm64 (#66589)
Simon Rozsival [Tue, 15 Mar 2022 15:13:31 +0000 (16:13 +0100)]
[Mono] Intrinsify Vector dot product on arm64 (#66589)

2 years agoUse C# 10's enhanced struct initialization features (#63131)
Günther Foidl [Tue, 15 Mar 2022 13:35:23 +0000 (14:35 +0100)]
Use C# 10's enhanced struct initialization features (#63131)

* Use C# 10's enhanced struct initialization features

* Addressed usages

* Remove #pragmas

* Fixed build

Cf. https://github.com/dotnet/runtime/pull/63131#discussion_r812406673

* Update src/libraries/Common/src/System/Collections/Generic/EnumerableHelpers.Linq.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
2 years agoRevert "Enable emitting intrinsics for System.Numerics.Vector<T> on arm64 (#66476...
Fan Yang [Tue, 15 Mar 2022 11:34:41 +0000 (07:34 -0400)]
Revert "Enable emitting intrinsics for System.Numerics.Vector<T> on arm64 (#66476)" (#66598)

This reverts commit 30c2cdc7dd78b9728d57796c4b37e5653e506166.

2 years agoRemove _socket field from HttpConnection (#66416)
Geoff Kizer [Tue, 15 Mar 2022 04:36:24 +0000 (21:36 -0700)]
Remove _socket field from HttpConnection  (#66416)

* remove _socket from HttpConnection

Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
2 years agoAdd vcsjones to more area tags (#66628)
Kevin Jones [Tue, 15 Mar 2022 03:16:25 +0000 (23:16 -0400)]
Add vcsjones to more area tags (#66628)

2 years agoTweak SuperPMI collections (#66627)
Bruce Forstall [Tue, 15 Mar 2022 02:31:13 +0000 (19:31 -0700)]
Tweak SuperPMI collections (#66627)

1. Reduce partition size from 50MB to 25MB. This increases libraries
PMI partitions from 2 to 3 and coreclr_tests partitions to 25. Should
Allow better parallelism and tighter timeouts.
2. Reduce work item timeout of 5 hours to 3 or 2 hours,
based on Kusto data of maximum work item timeouts.
3. Exclude native msquic.dll
4. Fix issue in first_fit that ignored files too large for a "maximum size":
we want to include everything, even if something is larger than max_size.

2 years agoJIT: enable reading PGO data when switching to optimized (#66618)
Andy Ayers [Tue, 15 Mar 2022 02:16:02 +0000 (19:16 -0700)]
JIT: enable reading PGO data when switching to optimized (#66618)

When QuickJitForLoops=0 (current default) and the JIT sees a Tier0 method with
a loop, it will switch to optimizing the method instead.

When this happens we should also have set `BBOPT` so that the JIT will read and
incorporate PGO data for the method and/or its inliees. But we were not doing that.

This change sets `BBOPT`.

2 years agoAdd xarch `blsi` (#66193)
Wraith [Tue, 15 Mar 2022 00:53:39 +0000 (00:53 +0000)]
Add xarch `blsi` (#66193)

* implement blsi

* add bmi intrinsics test projects

* add using System for Console.

2 years agoSet SocketsHttpHandler's default connect timeout to 15s (#66607)
Natalia Kondratyeva [Tue, 15 Mar 2022 00:34:46 +0000 (01:34 +0100)]
Set SocketsHttpHandler's default connect timeout to 15s (#66607)

* Set default connect timeout to 15s

* Fix ConnectTimeout_Default test

2 years agoA bunch of small regex tweaks (#66572)
Stephen Toub [Tue, 15 Mar 2022 00:26:46 +0000 (20:26 -0400)]
A bunch of small regex tweaks (#66572)

* Remove extra blank comment line

EmitScope's usage was resulting in a "//" line being output.  We can just delete all remaining usage of EmitScope; it's no longer helpful.

* Fix some blocks not using EmitBlock

* Minor tweak to add some uint casts to eliminate a few bounds checks

* Avoid rematching loops already matched with the literal-after-loop find optimization

Store the end of the loop position into the unused runtrackpos, and use that to jump right to that position instead of the normal loop handling code.

* Remove unnecessary writer argument to the SliceInputSpan local function

* Make sure we have some RightToLeft culture tests

* Use a more canonical form of loop in EmitLiteralAfterAtomicLoop

* Avoid unnecessary loop in literal-after-atomic-loop for no min bound

* Add more emitted comments to TryFindNextPossibleStartingPosition

* Invert some anchor checks to make the code cleaner

* Remove stray "global::"

* Rename original_pos to matchStart

* Add an additional reduction for concats containing nothings

* Fix exception type thrown for invalid NonBacktracking options combination

* Add special-cased code emitting to EmitScan

* Avoid label in TryFindNextPossibleStartingPosition when it's unnecessary

2 years agoDisable eventpipe test on OSX/x64 (#66606)
Bruce Forstall [Mon, 14 Mar 2022 23:52:58 +0000 (16:52 -0700)]
Disable eventpipe test on OSX/x64 (#66606)

* Disable eventpipe test on OSX/x64

Also, add sections for all-arch OSX and OSX/arm64 for possible future use.

* Update src/tests/issues.targets

Move to all OSX architectures

Co-authored-by: Juan Hoyos <juan.hoyos@microsoft.com>
Co-authored-by: Juan Hoyos <juan.hoyos@microsoft.com>
2 years ago[PERF][MAUI]dotnet-podcast startup time and size measurements (#65813)
Nathan Ricci [Mon, 14 Mar 2022 23:39:57 +0000 (19:39 -0400)]
[PERF][MAUI]dotnet-podcast startup time and size measurements (#65813)

Enable size and startup time monitoring for MAUI dotnet-podcast app on Android.

2 years agoAvoid Attribute.GetCustomAttributes() returning null for open generic type
madelson [Mon, 14 Mar 2022 22:08:17 +0000 (18:08 -0400)]
Avoid Attribute.GetCustomAttributes() returning null for open generic type

* Revert "Revert "Avoid Attribute.GetCustomAttributes() returning null for open generic type (#65237)" (#66508)"

This reverts commit f99ba2e2b8fbf03be5058ad23e8cdce9c4a09da6.

* Make DynamicMethod.GetCustomAttributes() return well-typed arrays.

This change makes DynamicMethod.GetCustomAttributes() compatible with
Attribute.GetCustomAttributes().

2 years agoUse `wasm-tools` workload to run benchmarks for wasm (#66493)
Ankit Jain [Mon, 14 Mar 2022 21:50:33 +0000 (17:50 -0400)]
Use `wasm-tools` workload to run benchmarks for wasm (#66493)

* [wasm] perf jobs: Use workloads to build benchmark projects

This uses the new `--wasmDataDir` parameter. And `--cli` to use the
dotnet from `dotnet-workload` which has the `wasm-tools` workload
installed from artifacts.

* perf pipeline: Use a dotnet with workload installed from artifacts

.. for running the benchmarks.

* [wasm] perf pipeline: Keep only the needed bits in the BrowserWasm

.. download, instead of copying the whole `artifacts` folder.

* Skip downloading unncessary liveLibraries build

* [wasm] Skip unncessary core_root, and corelcr download

2 years agoRemove BB limit from importer_vectorization (#66534)
Egor Bogatov [Mon, 14 Mar 2022 21:05:00 +0000 (00:05 +0300)]
Remove BB limit from importer_vectorization (#66534)

2 years agoRemove 4146 from libunwind (#66427)
Aaron Robinson [Mon, 14 Mar 2022 21:00:38 +0000 (17:00 -0400)]
Remove 4146 from libunwind (#66427)

* Remove 4146 from libunwind

Use existing libunwind align macro and use casting
  when the operation's target should reflect a signed value.

2 years agoFix macOS ARM64 stack overflow detection (#66599)
Jan Vorlicek [Mon, 14 Mar 2022 20:50:46 +0000 (21:50 +0100)]
Fix macOS ARM64 stack overflow detection (#66599)

We were incorrectly using exception_data_type_t instead of mach_exception_data_type_t
in the PAL due to a missing change when we have added support for ARM64 macOS.

The wrong type was 32 bit and it caused the address of a hardware exception to have
the upper 32 bits cut off. That prevented us from detecting stack overflow correctly.

2 years ago[wasm] Use `npm` from emsdk when running `sanitize.py` (#66533)
Ankit Jain [Mon, 14 Mar 2022 19:02:48 +0000 (15:02 -0400)]
[wasm] Use `npm` from emsdk when running `sanitize.py` (#66533)

The issue manifests are build errors:
`UnhandledPromiseRejectionWarning: Error: Cannot find module 'is-fullwidth-code-point'`

.. eventually failing the build:
`*** No rule to make target 'src/cjs/runtime.cjs.iffe.js', needed by 'dotnet.js'`

2 years ago[Mono] Intrinsify Vector WidenLower and WidenUpper on Arm64 (#66512)
Simon Rozsival [Mon, 14 Mar 2022 18:44:47 +0000 (19:44 +0100)]
[Mono] Intrinsify Vector WidenLower and WidenUpper on Arm64 (#66512)

* Implement WidenLower and WidenUpper

* Restrict code only to Arm64

2 years agoARM64 - Optimizing a % b operations (#65535)
Will Smith [Mon, 14 Mar 2022 18:29:12 +0000 (11:29 -0700)]
ARM64 - Optimizing a % b operations (#65535)

* Initial work for ARM64 mod optimization

* Updated comment

* Updated comment

* Updated comment

* Fixing build

* Remove uneeded var

* Use '%' morph logic for both x64/arm64

* Adding back in divisor check for x64

* Formatting

* Update comments

* Update comments

* Fixing

* Updated comment

* Updated comment

* Tweaking x64 transformation logic for the mod opt

* Tweaking x64 transformation logic for the mod opt

* Using IntCon

* Fixed build

* Minor tweak

* Fixing x64 diffs

* Removing flag set

* Feedback

* Fixing build

* Feedback

* Fixing tests

* Fixing tests

* Fixing tests

* Formatting

* Fixing tests

* Feedback

* Fixing build

2 years agoFix JsonSerializer src-gen issues with reference handler feature (#66422)
Layomi Akinrinade [Mon, 14 Mar 2022 17:40:01 +0000 (10:40 -0700)]
Fix JsonSerializer src-gen issues with reference handler feature (#66422)

* Fix JsonSerializer src-gen issues with reference handler feature

* Add Newtonsoft.Json reference to src-gen test project

* Fix failing tests

2 years agoMake ConfigurationManager.Sources public (#66485)
fredjeck [Mon, 14 Mar 2022 17:24:58 +0000 (18:24 +0100)]
Make ConfigurationManager.Sources public (#66485)

* Make ConfigurationManager.Sources public

ConfigurationManager.Sources is now a public property rather than
an explicit interface implementation of  ConfigurationBuilder.Sources.

#61675

2 years agoAdd time prefix to superpmi.py output (#66575)
Bruce Forstall [Mon, 14 Mar 2022 16:00:26 +0000 (09:00 -0700)]
Add time prefix to superpmi.py output (#66575)

Also, add per-operation completion times for collection operations.

These two things will make it easier to see what is taking time
during SuperPMI runs, especially those run in the CI system.

2 years agoDo not assume containment (#66385)
SingleAccretion [Mon, 14 Mar 2022 10:40:48 +0000 (13:40 +0300)]
Do not assume containment (#66385)

Codegen was assuming lowering would always contain immediates
for RMW ops. It did not for some fuzzer-generated code.

Check for containment explicitly instead.

2 years agoReenable a test in stress mode (#66501)
Jakob Botsch Nielsen [Mon, 14 Mar 2022 10:05:03 +0000 (11:05 +0100)]
Reenable a test in stress mode (#66501)

The issue #35687 was closed in #59784 and I can confirm the original
repro mentioned there no longer reproduces with this test.

Fix #65934

2 years agoBetter fix for #66242 (#66335)
SingleAccretion [Mon, 14 Mar 2022 10:00:56 +0000 (13:00 +0300)]
Better fix for #66242 (#66335)

Lowering was moving nodes without checking legality first.

2 years agoStop generating CLS_VAR (#66298)
SingleAccretion [Mon, 14 Mar 2022 09:57:58 +0000 (12:57 +0300)]
Stop generating CLS_VAR (#66298)

2 years agoGet rid of fallback to process ids enumeration in ProcessManager.IsProcessRunning...
Evgeny Peshkov [Mon, 14 Mar 2022 09:01:19 +0000 (12:01 +0300)]
Get rid of fallback to process ids enumeration in ProcessManager.IsProcessRunning (Windows) (#65041)

* ProcessManager.IsRunning on Windows: Idle process handle couldn't be opened

* Peformance optimization in ProcessManager.IsRunning on Windows: Enumerate processes on local machine only when handle check failed

2 years agoFix typo in managed port of strong name validation (#66554)
Jan Kotas [Mon, 14 Mar 2022 02:55:27 +0000 (19:55 -0700)]
Fix typo in managed port of strong name validation (#66554)

Fixes #66545

2 years ago[mono][wasm] Initialize debugger_tls_id on WASM as well. (#66560)
Zoltan Varga [Mon, 14 Mar 2022 00:52:16 +0000 (20:52 -0400)]
[mono][wasm] Initialize debugger_tls_id on WASM as well. (#66560)

Some code paths are using mono_native_tls_get_value () instead of GET_DEBUGGER_TLS ().

2 years agoEnable Fast Tail Call Optimization for ARM32 (#66282)
Dong-Heon Jung [Sun, 13 Mar 2022 11:50:20 +0000 (20:50 +0900)]
Enable Fast Tail Call Optimization for ARM32 (#66282)

2 years agoFix setting the default value of WasmExceptionHandling. (#66548)
Zoltan Varga [Sun, 13 Mar 2022 06:40:43 +0000 (01:40 -0500)]
Fix setting the default value of WasmExceptionHandling. (#66548)

2 years ago[mono] Less MonoClassField arithmetic and less direct offset access (#66519)
Aleksey Kliger (λgeek) [Sun, 13 Mar 2022 01:54:51 +0000 (20:54 -0500)]
[mono] Less MonoClassField arithmetic and less direct offset access (#66519)

This is in preparation for adding the ability for hot reload to add instance fields to existing classes.

Mostly the PR does 3 things:

Add /* TODO: metadata-update */ comments to places where we will need to do work
Add g_assert (!m_field_is_from_update (field)) to places where we either don't expect to see updated fields (for example the JIT or AOT compilers), or places where we will need to do work for hot reload.
Switch from directly iterating over MonoClass:fields to using mono_class_get_fields_internal. For hot reload we will update the iterator method to also return added fields.
Avoid accessing MonoClassField:offset directly. Go via m_field_get_offset. This is primarily to make it easier to grep for all the places that access field offsets. (Hot reload added fields aren't stored with the object, so "offset" won't make sense - they will be in separate storage that is associated with the object instances)

* Cleanup some field index arithmetic

Or add comments why its ok.

The issue: we don't want to use MonoClassField* pointer artithmetic when there is a possibility that a field was added by an EnC update.

We also don't want to iterate over all the fields or all the fields' tokens by just doing computations based on MonoClassField* addresses and first_field_idx. Instead use mono_class_get_fields_internal which will be updated to iterate over the added fields, too

* Use m_field_get_offset in more places. Add metadata-update asserts and TODO

   In places where we access the offset directly, add TODO notes and asserts that we're not looking at an added field.

2 years agoThe problem was that the assert didn't take into account the fact that some regions...
Peter Sollich [Sat, 12 Mar 2022 17:11:44 +0000 (18:11 +0100)]
The problem was that the assert didn't take into account the fact that some regions may be on the decommit list already due to aging of regions. (#66495)

2 years agoReenable HostApplicationBuilderTests disabled on Mono/Windows (#66521)
Alexander Köplinger [Sat, 12 Mar 2022 15:27:04 +0000 (16:27 +0100)]
Reenable HostApplicationBuilderTests disabled on Mono/Windows (#66521)

They were disabled against https://github.com/dotnet/runtime/issues/34582 which was fixed by https://github.com/dotnet/runtime/pull/64834

2 years agoArm64: Always use SIMD features (#66411)
Kunal Pathak [Sat, 12 Mar 2022 04:35:06 +0000 (20:35 -0800)]
Arm64: Always use SIMD features  (#66411)

* Use supportSIMDTypes() throughout

* Make featureSIMD only for non-arm64

2 years agoRe-enable RevokeEndEntity_PolicyErrors_NotTimeValid
Kevin Jones [Sat, 12 Mar 2022 02:31:43 +0000 (21:31 -0500)]
Re-enable RevokeEndEntity_PolicyErrors_NotTimeValid

2 years agoFix compiler warning 4244 in host (#66518)
Elinor Fung [Sat, 12 Mar 2022 01:22:26 +0000 (17:22 -0800)]
Fix compiler warning 4244 in host (#66518)

2 years agoAdd Activity.HasRemoteParent (#66489)
Tarek Mahmoud Sayed [Fri, 11 Mar 2022 22:05:40 +0000 (14:05 -0800)]
Add Activity.HasRemoteParent (#66489)

Co-authored-by: Stephen Toub <stoub@microsoft.com>
2 years agoRevert "Avoid Attribute.GetCustomAttributes() returning null for open generic type...
Jan Kotas [Fri, 11 Mar 2022 21:12:20 +0000 (13:12 -0800)]
Revert "Avoid Attribute.GetCustomAttributes() returning null for open generic type (#65237)" (#66508)

This reverts commit 20294957616061616e672b43f1d962460b7f4234.

2 years agoAdd comment for use of DynamicDebugViewEmptyException.Empty (#66510)
Charles Stoner [Fri, 11 Mar 2022 21:12:00 +0000 (13:12 -0800)]
Add comment for use of DynamicDebugViewEmptyException.Empty (#66510)

2 years ago[WIP] Enable regions again. (#64688)
Manish Godse [Fri, 11 Mar 2022 21:11:33 +0000 (13:11 -0800)]
[WIP] Enable regions again. (#64688)

* Enable regions again.

* disable regions for MacOS for now.

* disable for NativeAOT for now

2 years agoAdd Android 32 to RID graph (#66022)
Steve Pfister [Fri, 11 Mar 2022 21:09:58 +0000 (16:09 -0500)]
Add Android 32 to RID graph (#66022)

Supports Android 12L, which will be stable most likely by summer or earlier.

Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
2 years agoWrite the exit code tag from the Apple app wrapper (#66511)
Přemek Vysoký [Fri, 11 Mar 2022 20:42:43 +0000 (21:42 +0100)]
Write the exit code tag from the Apple app wrapper (#66511)

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
2 years agoFix early JITDUMP disasm in ARM/ARM64 (#66502)
Jakob Botsch Nielsen [Fri, 11 Mar 2022 20:36:16 +0000 (21:36 +0100)]
Fix early JITDUMP disasm in ARM/ARM64 (#66502)

2 years agoEnable emitting intrinsics for System.Numerics.Vector<T> on arm64 (#66476)
Fan Yang [Fri, 11 Mar 2022 20:09:01 +0000 (15:09 -0500)]
Enable emitting intrinsics for System.Numerics.Vector<T> on arm64 (#66476)

2 years agoAdd OSR to DacpTieredVersionData (#66507)
Andy Ayers [Fri, 11 Mar 2022 19:57:23 +0000 (11:57 -0800)]
Add OSR to DacpTieredVersionData (#66507)

2 years ago[mono] Fixup name of define (#66523)
Alexander Köplinger [Fri, 11 Mar 2022 19:54:04 +0000 (20:54 +0100)]
[mono] Fixup name of define (#66523)

2 years agoMove to Windows.10.Amd64.Server2022.ES.Open (#66404)
Elinor Fung [Fri, 11 Mar 2022 19:48:05 +0000 (11:48 -0800)]
Move to Windows.10.Amd64.Server2022.ES.Open (#66404)

2 years ago[mono] Cleanup todo items from defines-todo.cmake (#66408)
Alexander Köplinger [Fri, 11 Mar 2022 19:43:58 +0000 (20:43 +0100)]
[mono] Cleanup todo items from defines-todo.cmake (#66408)

There are roughly three categories:

1. Already implemented or completely unused defines
2. Defines we can remove because they're no longer useful:
- `MAJOR_IN_MKDEV` and `MAJOR_IN_SYSMACROS`
Not used in the runtime anymore.

- `HAVE_EPOLL` and `HAVE_KQUEUE`
Not used in the runtime anymore.

- `ANDROID_UNIFIED_HEADERS` and `HAVE_ANDROID_NDK_VERSION_H`
We're requiring a recent Android NDK now that only supports unified headers.

- `MONO_DL_NEED_USCORE`
It doesn't seem needed anymore.
dlsym() on macOS automatically prepends an underscore and from what I can find it was mostly for old *BSDs.

- `GLIBC_BEFORE_2_3_4_SCHED_SETAFFINITY`
We don't support such an old glibc anymore.

- `HAVE_SIOCGIFCONF`
We don't use this and related networking code in the runtime anymore.

- `DISABLE_HW_TRAPS`
We have `MONO_ARCH_DISABLE_HW_TRAPS` instead.

- `MONO_BIG_ARRAYS`
No longer needed and probably broken due to missing BCL changes.

- `ENABLE_MONODROID` and replace `ENABLE_MONOTOUCH` with `TARGET_APPLE_MOBILE`
ENABLE_MONODROID was unused and MonoTouch was an earlier name for Xamarin.iOS, replace it with something more descriptive

- `MONO_JEMALLOC`
We haven't used it and don't plan to.

- `MONO_XEN_OPT`
Xen is not a primary scenario for Mono anymore so we probably don't need this optimization.

3. Defines which are still useful and are implemented by this PR
- Fix `MONO_KEYWORD_THREAD` build and implement `HAVE_TLS_MODEL_ATTR`

- Boehm/Null GC support

- `MONO_SMALL_CONFIG`

- `USE_MALLOC_FOR_MEMPOOLS`

- `ENABLE_DTRACE`

- `ENABLE_EXPERIMENT_TIERED` and remove dynamic experiments

- `ENABLE_OVERRIDABLE_ALLOCATORS`

- `MONO_ARCH_ILP32`

- `RISCV_FPABI`

- `__mono_ppc64__`

- `HAVE_ARMV5/6`. There is an open question about what we'll do with `HAVE_ARMV7`, added a TODO comment.

2 years ago[Mono] Intrinsify Vector Dot product and Sum on Arm64 (#66391)
Simon Rozsival [Fri, 11 Mar 2022 19:38:16 +0000 (20:38 +0100)]
[Mono] Intrinsify Vector Dot product and Sum on Arm64 (#66391)

* Add Dot intrinsic

* WIP saddvq/uaddvq

* Add Dot and Sum impl for Arm64

* Add faddv

* Fix the Dot and Sum implementations

* Cleanup

* Cleanup

* Fix type checking

* Fix type checking

* Fix indentation

* Fix edge case with single element vectors

* Improve implementation

2 years agoUse ApiCompatTask in ApiCompat.proj (#66073)
Viktor Hofer [Fri, 11 Mar 2022 17:51:22 +0000 (18:51 +0100)]
Use ApiCompatTask in ApiCompat.proj (#66073)

* Use ApiCompatTask in ApiCompat.proj

As ApiCompat now has a task that allows to run in-proc, use that instead
of shelving out. Also use items instead of properties to define
the attribute exclusion list.

* Update ApiCompat version

2 years agoAdd support for the new WASM Exception Handling feature (#66435)
Zoltan Varga [Fri, 11 Mar 2022 16:50:33 +0000 (11:50 -0500)]
Add support for the new WASM Exception Handling feature (#66435)

* [mono] Fix parsing options added by utils/options.h when using --response.

* [mono][jit] Add support for WASM EH.

WASM EH uses the newly added llvm catchpad instructions instead of
the old landingpad instructions. Add a --wasm-exceptions option
to control whenever the old JS style or the new WASM style code
is generated.

* Add support for the new WASM Exception Handling feature.

It is controlled by the $(WasmExceptionHandling) msbuild property.

Its only used in AOT mode, the interpreter mode wouldn't benefit from it.

The only file in the runtime which contains a throw or a catch is
llvm-runtime.cpp, so create 2 small static libraries from this file:
* libmono-wasm-eh-js - compiled to use JS style EH
* libmono-wasm-eh-wasm - compiled to use WASM style EH
This avoids the need to compile 2 versions of the whole runtime.

Requires emscripten 3.x.

* Add missing quote

* Update src/mono/mono/mini/CMakeLists.txt

Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
* Update src/mono/CMakeLists.txt

Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
Co-authored-by: Radek Doulik <radek.doulik@gmail.com>
Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
2 years agoUpdate dependencies from https://github.com/dotnet/linker build 20220310.1 (#66505)
dotnet-maestro[bot] [Fri, 11 Mar 2022 16:29:49 +0000 (17:29 +0100)]
Update dependencies from https://github.com/dotnet/linker build 20220310.1 (#66505)

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-1.22158.1 -> To Version 7.0.100-1.22160.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years ago[main] Update dependencies from dotnet/runtime-assets dotnet/roslyn-analyzers (#66504)
dotnet-maestro[bot] [Fri, 11 Mar 2022 16:29:18 +0000 (17:29 +0100)]
[main] Update dependencies from dotnet/runtime-assets dotnet/roslyn-analyzers (#66504)

* Update dependencies from https://github.com/dotnet/runtime-assets build 20220310.1

Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Drawing.Common.TestData , System.IO.Compression.TestData , System.IO.Packaging.TestData , System.Net.TestData , System.Private.Runtime.UnicodeData , System.Runtime.Numerics.TestData , System.Runtime.TimeZoneData , System.Security.Cryptography.X509Certificates.TestData , System.Text.RegularExpressions.TestData , System.Windows.Extensions.TestData
 From Version 7.0.0-beta.22128.1 -> To Version 7.0.0-beta.22160.1

* Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20220310.2

Microsoft.CodeAnalysis.NetAnalyzers
 From Version 7.0.0-preview1.22157.1 -> To Version 7.0.0-preview1.22160.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agodon't run WriteChars_VeryLargeArray_DoesNotOverflow test on 32 bit platforms (#66503)
Adam Sitnik [Fri, 11 Mar 2022 15:28:34 +0000 (16:28 +0100)]
don't run WriteChars_VeryLargeArray_DoesNotOverflow test on 32 bit platforms (#66503)

2 years agoFix typo in comment (#66497)
JK Park [Fri, 11 Mar 2022 11:18:20 +0000 (20:18 +0900)]
Fix typo in comment (#66497)

thta => that

2 years agoAdd armv8l virtualized 32-bit ARM core detection (#66477)
Antoine Martin [Fri, 11 Mar 2022 09:29:12 +0000 (04:29 -0500)]
Add armv8l virtualized 32-bit ARM core detection (#66477)

2 years agoRefactor and improve MLL tests (#66332)
Vitek Karas [Fri, 11 Mar 2022 08:34:45 +0000 (00:34 -0800)]
Refactor and improve MLL tests (#66332)

* Remove duplicated code - I know that tests should be descriptive, but repeating 100 times that we want to capture output doesn't feel necessary.
* For some of them move more stuff into the shared test state - this improves perf as we avoid repeating the setup (copying files around) for each test case, we do it once for the entire class
I also changed some of the tests to "Theory" as it's easier to read that way.
  * `SDKLookup.cs` - moved most of the state in to the shared state to speed up the tests.

* Adding more cases into the "theory" tests
  * Most notably for the framework resolution I added variations on the TFM (which will be needed when we implement disable of MLL)
* Adding new tests mostly around "list runtimes" (various forms), "list sdks" (various forms) and errors (which also list runtimes or sdks)

* Ported all of the `MultiLevelLookupFramework` tests over to the `FrameworkResolution` and `DependencyResolutions` suites which have a more robust test infra and can run the same tests much faster. Along the way I added lot more variations on top of the existing tests:
  * `PerAssemblyVersionResolutionMultipleFrameworks.cs` - this is actually not an MLL test, but I moved it to the new infra to make it much faster
  * `MultipleHives.cs` - MLL framework resolution tests

For SDK resolution I kept the `MultiLevelSDKLookup.cs` just removed code duplication and added new variants.

For the core reviewers: I promise I didn't remove any single test case in spirit with these exceptions:

* We had tests which validated that framework resolution is not affected by frameworks in current directory and also by frameworks in the user's directory. I left some basic test for the current directory check, but I completely removed the user's directory variant as the product simply doesn't have any code around that anymore.

* Remove "user" directory from SDK resolution tests

The product simply doesn't have any knowledge about user directory SDK lookup, so there's little value in testing for it (even though the test expects it to not have any impact).

Co-authored-by: Elinor Fung <elfung@microsoft.com>
2 years agoUpdate repo CMake configuration to target /W4 by default (#66474)
Aaron Robinson [Fri, 11 Mar 2022 04:59:21 +0000 (23:59 -0500)]
Update repo CMake configuration to target /W4 by default (#66474)

* Update repo CMake configuration to target /W4 by default

Disable all failing warnings.

* Mono API tests only use W3

2 years ago[metadata] Avoid realloc and memcpy when >1 gparams on generics (#66458)
Aleksey Kliger (λgeek) [Fri, 11 Mar 2022 04:21:01 +0000 (23:21 -0500)]
[metadata] Avoid realloc and memcpy when >1 gparams on generics (#66458)

* [metadata] Avoid realloc and memcpy when >1 gparams on generics

* Read the first gparam row again at the beginning of the second pass

2 years agoUpdate dependencies from https://github.com/dotnet/linker build 20220308.1 (#66390)
dotnet-maestro[bot] [Fri, 11 Mar 2022 00:33:51 +0000 (00:33 +0000)]
Update dependencies from https://github.com/dotnet/linker build 20220308.1 (#66390)

[main] Update dependencies from dotnet/linker

2 years agoOne-shot decrypt in to user buffers
Kevin Jones [Fri, 11 Mar 2022 00:17:07 +0000 (19:17 -0500)]
One-shot decrypt in to user buffers

This changes the one-shot decryption to allow decrypting directly in to user-supplied buffers, even in the presence of padding, so that a copy and CryptoPool rental can be avoided.

If the buffer is large enough to accommodate the padding, then decrypt directly in to the supplied buffer, zero the padding, and indicate the de-padded amount in bytesWritten.

If the buffer is possibly large enough, then decrypt all but the last block in to the buffer, and do the last block on the stack. If the de-padded amount in the stack is small enough, then copy the remaining. If it is too large, then zero everything in the user buffer.

2 years agoAdd table of testing configurations (#66347)
Andy Gocke [Thu, 10 Mar 2022 23:48:39 +0000 (15:48 -0800)]
Add table of testing configurations (#66347)

* Add table of testing configurations

* Remove "cross" from specification

2 years agoOverhaul how regex generated code is structured (#66432)
Stephen Toub [Thu, 10 Mar 2022 23:42:19 +0000 (18:42 -0500)]
Overhaul how regex generated code is structured (#66432)

* Overhaul how regex generated code is structured

* Address PR feedback

* Change parser to return RegexMethod

Clean up how the data is structured.

* Add a test for same method name in multiple types

2 years agoUpdating Unicode files to use 14.0.0 (#66362)
Jose Perez Rodriguez [Thu, 10 Mar 2022 22:28:35 +0000 (14:28 -0800)]
Updating Unicode files to use 14.0.0 (#66362)

2 years ago[Mono] Intrinsify Narrow for for Vector{64, 128} on Arm64 (#66409)
Fan Yang [Thu, 10 Mar 2022 22:00:05 +0000 (17:00 -0500)]
[Mono] Intrinsify Narrow for for Vector{64, 128} on Arm64 (#66409)

* Add arm64 intrinsics for Narrow

* Fix integer types

* Fix more issues with integer types

* Add some comments

* Nit

* Change var names

* Fix format

* Fix format again

2 years ago[Mono] Add intrinsics for several operators (#66317)
Meri Khamoyan [Thu, 10 Mar 2022 21:56:07 +0000 (01:56 +0400)]
[Mono] Add intrinsics for several operators (#66317)

This PR contributes to  #64072

Added intrinsics for following operators
- Operator *
- Operator /
- Operator |
- Operator &
- Operator ^
- Unary operator -
- Unary operator ~

Co-authored-by: Fan Yang <yangfan@microsoft.com>
2 years ago[mono] Stop setting time_date_stamp field in MonoImage (#66452)
Alexander Köplinger [Thu, 10 Mar 2022 21:47:57 +0000 (22:47 +0100)]
[mono] Stop setting time_date_stamp field in MonoImage (#66452)

We never read that field in the runtime and it was causing unnecessary disk IO during startup (5ms on my iOS device).
It was also never set on Windows already.

2 years agoEnable/fix compiler warning 4996 in host (#66431)
Elinor Fung [Thu, 10 Mar 2022 21:23:56 +0000 (13:23 -0800)]
Enable/fix compiler warning 4996 in host (#66431)

2 years agoUpdate dependencies from https://github.com/dotnet/msquic build 20220310.2 (#66468)
dotnet-maestro[bot] [Thu, 10 Mar 2022 20:58:09 +0000 (21:58 +0100)]
Update dependencies from https://github.com/dotnet/msquic build 20220310.2 (#66468)

System.Net.MsQuic.Transport
 From Version 7.0.0-alpha.1.22159.1 -> To Version 7.0.0-alpha.1.22160.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoRemove null check that is used later to handle size request scenario. (#66428)
Aaron Robinson [Thu, 10 Mar 2022 20:02:16 +0000 (15:02 -0500)]
Remove null check that is used later to handle size request scenario. (#66428)