platform/upstream/dotnet/runtime.git
17 months ago[browser] disable memorySnapshot for WS test (#83583)
Pavel Savara [Fri, 17 Mar 2023 15:24:16 +0000 (16:24 +0100)]
[browser] disable memorySnapshot for WS test (#83583)

* disable memorySnapshot for WS test
* Update src/mono/wasm/test-main.js

Co-authored-by: Radek Doulik <radek.doulik@gmail.com>
17 months agoRuntime lookup clean up, enable for helper-based tail calls (#83430)
Egor Bogatov [Fri, 17 Mar 2023 13:30:52 +0000 (14:30 +0100)]
Runtime lookup clean up, enable for helper-based tail calls (#83430)

17 months ago[tasks] Add auto runtime initialization template to LibraryBuilder (#83050)
Mitchell Hwang [Fri, 17 Mar 2023 13:27:10 +0000 (09:27 -0400)]
[tasks] Add auto runtime initialization template to LibraryBuilder (#83050)

* [tasks] Add auto runtime initialization template to LibraryBuilder

* Grab shared library directory

* [tasks] Extend auto initialization template to account for customization

* Revert "Grab shared library directory"

This reverts commit bc86f2b91c76f0e40ad60516dcb1031d02e7054b.

* Remove platform specific naming

* [tasks] Move App Context setup back to autoinit.c

* Remove registering bundled modules and debugging until they can be validated

* Remove unnecessary wrapper

* Grab bundle_path later without eglib

Setting bundle_path in constructor may be too early for environment variables to be set
so grab it first thing when initializing the runtime.

Use getenv directly instead of calling into eglib with just one api

* Rename AssetsPath to AssembliesLocation

* Move assembly loading into separate function

* Remove unnecessary function

* Cleanup CMakeLists template indentation

* Add dotnet header to autoinit.c

* Default bundle_path if assemblies path environment variable not set

* Pass bundle_path to load assemblies

* Add logging and abort on failures

* Load assemblies with partial name

* Clean up targets and unneeded properties

* Rename source file

* Remove preload hook and make out of memory error more generic

* Throw when no exported symbols are found

* Remove aot data load prehook and aotdata generation

* Address feedback

* Address more feedback

* Add various fixes and make bundle_path a local variable

* Reintroduce load aot data hook in autoinit with guard

* Fix closing tag

* Include guard library-builder.h

* Fix typo

17 months ago[nodejs] add active issue (#83580)
Pavel Savara [Fri, 17 Mar 2023 13:21:56 +0000 (14:21 +0100)]
[nodejs] add active issue (#83580)

17 months ago [browser] fix advanced sample for MT (#83582)
Pavel Savara [Fri, 17 Mar 2023 13:19:46 +0000 (14:19 +0100)]
 [browser] fix advanced sample for MT (#83582)

17 months agoSlightly improve struct zeroing & copying (#83488)
Egor Bogatov [Fri, 17 Mar 2023 12:38:12 +0000 (13:38 +0100)]
Slightly improve struct zeroing & copying (#83488)

17 months agoUse nameof in attributes (#83566)
Stephen Toub [Fri, 17 Mar 2023 12:28:19 +0000 (08:28 -0400)]
Use nameof in attributes (#83566)

17 months ago[wasm] Implement rotate left/right immediate interp intrinsics in jiterpreter; implem...
Katelyn Gadd [Fri, 17 Mar 2023 10:06:19 +0000 (03:06 -0700)]
[wasm] Implement rotate left/right immediate interp intrinsics in jiterpreter; implement clz/ctz/popcnt (#83573)

* Implement rotate left/right immediate interp intrinsics
* Implement clz/ctz/popcnt

17 months agoEnsure free buffer space when reading TLS messages (#83480)
Radek Zikmund [Fri, 17 Mar 2023 08:17:18 +0000 (09:17 +0100)]
Ensure free buffer space when reading TLS messages (#83480)

* Ensure free buffer space when reading TLS messages

* Move buffer expansion outside of the loop to prevent unbounded grow

* Fix failing tests

The initial size is not enough to cover later TLS frames

17 months ago[wasm] Post 3.1.30 emscripten bump feedback (#83391)
Radek Doulik [Fri, 17 Mar 2023 06:39:24 +0000 (07:39 +0100)]
[wasm] Post 3.1.30 emscripten bump feedback (#83391)

* [wasm] Post 3.1.30 emscripten bump feedback

Make the minimal build env vars item group "private".

Enable simd for old v8 in tests

* Add jsvu binaries to the path

Do not use experimental flags, as we should get newer v8

* Export PATH and echo it

* Use webassembly helix image

17 months agodisable NTLM tests on RedHat.7 (#83559)
Tomas Weinfurt [Fri, 17 Mar 2023 05:40:49 +0000 (22:40 -0700)]
disable NTLM tests on RedHat.7 (#83559)

* disable NTLM tests on RedHat.7

* Package_Unsupported_NTLM

17 months agoUse Environment.SystemDirectory to get system directory (#83564)
Jan Kotas [Fri, 17 Mar 2023 03:25:53 +0000 (20:25 -0700)]
Use Environment.SystemDirectory to get system directory (#83564)

Environment.SystemDirectory is a lot more efficient than Environment.GetFolderPath(System.Environment.SpecialFolder.System).

Contributes to https://github.com/dotnet/aspnetcore/issues/47269

17 months agoRevert "ActiveIssue for BuildInvalidSignatureTwice on mono interpreter. (#82864)...
Kevin Jones [Fri, 17 Mar 2023 01:34:47 +0000 (21:34 -0400)]
Revert "ActiveIssue for BuildInvalidSignatureTwice on mono interpreter. (#82864)" (#83542)

This reverts commit ac226b4c14a81dd101a54a619baa349101c7aa5b.

17 months ago[mono] Allow a single call when inlining methods (#83548)
Katelyn Gadd [Fri, 17 Mar 2023 01:20:12 +0000 (18:20 -0700)]
[mono] Allow a single call when inlining methods (#83548)

Allow a single call when inlining methods, this makes it theoretically possible to inline List.get_Item
Don't allow doesnotreturn method calls to disable inlining, since we know they are unlikely to be called

17 months agoupdate msquic (#83493)
Tomas Weinfurt [Fri, 17 Mar 2023 00:45:09 +0000 (17:45 -0700)]
update msquic (#83493)

* update msquic

* update

17 months agoFixed wrong date format in XUnitWrapperLibrary Test Summary. (#83553)
Ivan Diaz Sanchez [Fri, 17 Mar 2023 00:16:58 +0000 (17:16 -0700)]
Fixed wrong date format in XUnitWrapperLibrary Test Summary. (#83553)

17 months ago[JIT] ARM64 - Optimize `x < 0` and `x >= 0` (#83176)
Will Smith [Thu, 16 Mar 2023 23:59:39 +0000 (16:59 -0700)]
[JIT] ARM64 - Optimize `x < 0` and `x >= 0` (#83176)

* Initial work that allows optimizing x < 0

* Few tweaks

* Optimized x < 0 and x >= 0 for conditionals

* Removed old commented code. Switched tbz and tbnz

* Simplified

* Fix build

* Check for possible interference

* Reverse

* Check invariant-range

* Cleanup

* Cleanup

* Handle new JCMP flags in gtReverseCond

* Comment update

* Remove extra flags

* Simplify further

* Fix warning

* Update src/coreclr/jit/lower.cpp

Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
* Fix warning

* Fixing assert

---------

Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
17 months agoConvert to GeneratedRegexAttribute fixer should preserve references to const string...
Badre BSAILA [Thu, 16 Mar 2023 23:35:23 +0000 (00:35 +0100)]
Convert to GeneratedRegexAttribute fixer should preserve references to const string fields (#81997)

* Convert to GeneratedRegexAttribute fixer should preserve references to const string fields

* add test to cover external const case

* fix double slashes

* simplify verbatime string generation

* delete unused quote

17 months agoRaise inlining length limit in the interpreter from 20 to 30. (#83490)
Katelyn Gadd [Thu, 16 Mar 2023 23:24:53 +0000 (16:24 -0700)]
Raise inlining length limit in the interpreter from 20 to 30. (#83490)

This is enough to allow List<T>.get_Item to be inlined (as long as we also allow calls), among other critical methods, and enables big speedups for some benchmarks.

17 months agofix a bug where totalCPU count was being used for cachesize computation (#83528)
Manish Godse [Thu, 16 Mar 2023 21:46:36 +0000 (14:46 -0700)]
fix a bug where totalCPU count was being used for cachesize computation (#83528)

17 months agoCoreCLR support for InlineArrayAttribute. (struct layout part) (#82744)
Vladimir Sadov [Thu, 16 Mar 2023 21:45:39 +0000 (14:45 -0700)]
CoreCLR support for InlineArrayAttribute.  (struct layout part) (#82744)

* initial port from the prototype

* parse the attribute in MT builder

* validate replicated size

* aot changes

* refmap

* validate total size in ilc

* add the actual attribute

* Apply suggestions from code review

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* add a small use of InlineArray in CoreLib - to get some crossgen coverage.

* a few more uses in CorLib

* fix for sequential layout

* Standardize on use of "InlineArray" in the implementation

* simpler layout replication

* some initial tests (will add more)

* more tests

* limit the max size of array instance to 1MiB

* fix an assert in importercalls.cpp

* "result" in GC layout should track the pointer count, not the size

* error messages

* fixed uses of "value array" in comments.

* PR feedback on StackAllocedArguments

* use the same size limit for inline arrays in the typeloader

* more PR feedback

* remove SetCannotBeBlittedByObjectCloner

* moving GetInlineArrayLength to MetadataType and related changes

* use  type.Context.Target.PointerSize

* lost resources change

* fix for x86

* Do not make InlineArrayType an inline array just yet.

* CORINFO_FLG_INDEXABLE_FIELDS

---------

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
17 months agoCreate source generator for configuration binding (#82179)
Layomi Akinrinade [Thu, 16 Mar 2023 21:42:38 +0000 (14:42 -0700)]
Create source generator for configuration binding (#82179)

* Create source generator for configuration binding

* Add baseline tests

* Rename test project folders

* Avoid passing entire compilation to generator execute method

* Enable nullable

* Add logic to include generator in nuget package and enable it conditionally

* Address feedback

17 months agoRemove S.S.Permissions reference from S.DirectoryServices (#82453)
Steve Harter [Thu, 16 Mar 2023 21:26:58 +0000 (16:26 -0500)]
Remove S.S.Permissions reference from S.DirectoryServices (#82453)

17 months agodisable startupMemoryCache by default (#83536)
Pavel Savara [Thu, 16 Mar 2023 20:37:56 +0000 (21:37 +0100)]
disable startupMemoryCache by default (#83536)

17 months agoAdding support for Vector512 bitwise operations: And, AndNot, Or, OnesComplement...
Tanner Gooding [Thu, 16 Mar 2023 20:36:24 +0000 (13:36 -0700)]
Adding support for Vector512 bitwise operations: And, AndNot, Or, OnesComplement, and Xor (#83354)

* Adding support for Vector512 bitwise operations: And, AndNot, Or, OnesComplement, and Xor

* Adding AVX512F APIs for And, AndNot, Load, Or, Store, and Xor

* Fix the "throw new PlatformNotSupported" expressions for Avx512F

* Fixing some test build failures

* Ensure the Avx512F and related classes can lightup in import

* Ensure that JitStressEvexEncoding is only checked in debug

* Allow 64-bit alignment in the test data table types and fix the AVX512 enablement check

17 months ago[node] unblock WS tests (#83518)
Pavel Savara [Thu, 16 Mar 2023 20:34:31 +0000 (21:34 +0100)]
[node] unblock WS tests (#83518)

* active issue https://github.com/dotnet/runtime/issues/83517
Co-authored-by: Marek Fišera <mara@neptuo.com>
17 months agoFix System.Management wminet_utils.dll lookup code for arm64 (#83522)
Viktor Hofer [Thu, 16 Mar 2023 20:27:16 +0000 (21:27 +0100)]
Fix System.Management wminet_utils.dll lookup code for arm64 (#83522)

* Fix System.Management wminet_utils.dll lookup code for arm64

* Update ManagementScope.cs

17 months agoUse SOS to dump managed stack traces from a dump on Windows (#82867)
Jeremy Koritzinsky [Thu, 16 Mar 2023 20:14:39 +0000 (13:14 -0700)]
Use SOS to dump managed stack traces from a dump on Windows (#82867)

17 months agoImplements Requires*Attribute on class behavior for NativeAOT (#83417)
Vitek Karas [Thu, 16 Mar 2023 13:49:47 +0000 (06:49 -0700)]
Implements Requires*Attribute on class behavior for NativeAOT (#83417)

Implements most of the missing pieces to get Requires on class working correctly in NativeAOT.

Major changes:
* Detect Requires mismatch between derived and base class
* Warn on field access if the owning class has Requires
* Changes to reflection marking to warn on more cases (instance methods on Requires classes for example)

Supportive changes:
* The helpers to detect Requires attributes now return the found attribute view out parameter

Fixes #81158

Still two missing pieces - tracked by https://github.com/dotnet/runtime/issues/82447:
* Requires on attributes - NativeAOT doesn't handle this at all yet, part of it is Requires on the attribute class
* Avoid warning when DAM marking an override method which has Requires (or its class has) - this avoids lot of noise, NativeAOT currently generates these warnings in full

17 months ago[mono][interp] Lower div.un to shr.un.imm (#83498)
Vlad Brezae [Thu, 16 Mar 2023 13:05:44 +0000 (15:05 +0200)]
[mono][interp] Lower div.un to shr.un.imm (#83498)

* [mono][interp] Remove redundant opcode

Generate sub opcode instead which is detected by other optimizations.

* [mono][interp] Lower div.un to shr.un

17 months agoChange LSRA to more efficiently initialize the availableRegs array (#83479)
Tanner Gooding [Thu, 16 Mar 2023 12:59:31 +0000 (05:59 -0700)]
Change LSRA to more efficiently initialize the availableRegs array (#83479)

* Change LSRA to more efficiently initialize the availableRegs array

* Apply formatting patch

17 months agoUpdated generated interop files from msquic (#83092)
Marie Píchová [Thu, 16 Mar 2023 10:20:48 +0000 (11:20 +0100)]
Updated generated interop files from msquic (#83092)

17 months ago[browser] Fix encoding problem when publishing (#82833)
Ilona Tomkowicz [Thu, 16 Mar 2023 07:54:34 +0000 (08:54 +0100)]
[browser] Fix encoding problem when publishing (#82833)

* Fixed https://github.com/dotnet/runtime/issues/78953.

* New wbt publish test case: Unicode sign in project name.

* Removed duplicated, unused function + addressed @akoeplinger review.

* Fix.

* Revert AOT tests to fix them in a follow-up.

* Test Blazor as well.

* @radical's review: test reduction + relinking

* Block relinking tests with Unicode signs.

* Added active issue link.

17 months agoChange execution order conditions for intellisense swapping and copying msbuild targe...
Carlos Sánchez López [Thu, 16 Mar 2023 07:45:27 +0000 (00:45 -0700)]
Change execution order conditions for intellisense swapping and copying msbuild targets. (#83117)

* Change execution order conditions for intellisense swapping and copying msbuild targets.

* Don't change doc file when there isn't a intellisense one

---------

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
17 months agoRemove System.Drawing.Common from runtime (#83356)
Viktor Hofer [Thu, 16 Mar 2023 02:58:09 +0000 (03:58 +0100)]
Remove System.Drawing.Common from runtime (#83356)

* Remove System.Drawing.Common from runtime

System.Drawing.Common was merged into winforms with
https://github.com/dotnet/winforms/pull/8633.

Removing its sources and using PackageReferences to reference it.

* Remove dependency and fix tests

* Fix shim S.D.C reference

* Remove runtime test which causes failures

17 months ago[main] Update dependencies from dotnet/arcade (#83386)
dotnet-maestro[bot] [Thu, 16 Mar 2023 02:30:29 +0000 (22:30 -0400)]
[main] Update dependencies from dotnet/arcade (#83386)

* Update dependencies from https://github.com/dotnet/arcade build 20230313.1

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 8.0.0-beta.23159.1 -> To Version 8.0.0-beta.23163.1

* Update dependencies from https://github.com/dotnet/arcade build 20230314.2

Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
 From Version 8.0.0-beta.23159.1 -> To Version 8.0.0-beta.23164.2

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
17 months ago[wasm][debugger] Debug CI (#83266)
Thays Grazia [Thu, 16 Mar 2023 01:27:09 +0000 (22:27 -0300)]
[wasm][debugger] Debug CI (#83266)

Increase timeout
wait until the runtime is ready when receive dotnet.runtests command.

17 months agoAdd host tests for asset resolution behaviour without fallback graph (#83434)
Elinor Fung [Thu, 16 Mar 2023 00:15:41 +0000 (17:15 -0700)]
Add host tests for asset resolution behaviour without fallback graph (#83434)

17 months agoAdd property to get owner composite executable (#83339)
Eduardo Velarde [Wed, 15 Mar 2023 22:12:18 +0000 (15:12 -0700)]
Add property to get owner composite executable (#83339)

17 months agoAdd lowering for get_One, get_AllBitSet, createScalar(), createScalarUnsafe(). ...
DeepakRajendrakumaran [Wed, 15 Mar 2023 21:07:40 +0000 (14:07 -0700)]
Add lowering for get_One,  get_AllBitSet, createScalar(), createScalarUnsafe(). (#83402)

* Add lowering for get_One, and get_AllBitSet.

* CreateScalar() CreateScalarUnsafe()

* Fix incorrect switch + disasm

17 months ago[Codespaces] Fix prebuild by using newer dotnet sdk (#83331)
Alexander Köplinger [Wed, 15 Mar 2023 21:00:25 +0000 (22:00 +0100)]
[Codespaces] Fix prebuild by using newer dotnet sdk (#83331)

fix to resolve a build error during Codespaces prebuild: https://github.com/dotnet/msbuild/issues/8531

17 months agoRevert "[wasm] Add a monitoring phase to jiterpreter traces and discard unproductive...
Katelyn Gadd [Wed, 15 Mar 2023 20:36:38 +0000 (13:36 -0700)]
Revert "[wasm] Add a monitoring phase to jiterpreter traces and discard unproductive ones (#83432)" (#83446)

This reverts commit 1cfda5e9a887d39004644c2f96a87b31fcca0ac7.

17 months agothrow specific Authentication exception for ephemeral keys on Windows (#83436)
Tomas Weinfurt [Wed, 15 Mar 2023 19:31:38 +0000 (12:31 -0700)]
throw specific Authentication exception for ephemeral keys on Windows (#83436)

* throw specific Authentication exception for ephemenral keys on Windows

* cleanup

* android

* Update src/libraries/System.Net.Security/src/Resources/Strings.resx

Co-authored-by: Kevin Jones <vcsjones@github.com>
---------

Co-authored-by: Kevin Jones <vcsjones@github.com>
17 months agoSwitch tests for --depsfile to mocked components (#83435)
Elinor Fung [Wed, 15 Mar 2023 18:21:09 +0000 (11:21 -0700)]
Switch tests for --depsfile to mocked components (#83435)

17 months agoJIT: Fold unreachable cases for switch in importer. (#82793)
Julie Lee [Wed, 15 Mar 2023 16:14:49 +0000 (09:14 -0700)]
JIT: Fold unreachable cases for switch in importer. (#82793)

* Fold unreachable cases for switch in importer.

* Enable Switch Folding only when opts.OptimizationEnabled() is true to resolve regression in minopts.

* Code cleanup.

17 months ago[wasm] Fix threading startup after emscripten bump; add smoke test (#83352)
Aleksey Kliger (λgeek) [Wed, 15 Mar 2023 15:45:05 +0000 (11:45 -0400)]
[wasm] Fix threading startup after emscripten bump; add smoke test (#83352)

* Fix threading startup after Emscripten 3.1.30 bump

* Add threading smoke test

* Run threading smoke test on rolling builds and on every PR

* force run the threading smoke tests for runtime-wasm

* Apply suggestions from code review

* threading smoke tests only on browser

* remove all default smoke tests before adding minimal threading test

Co-authored-by: Ankit Jain <radical@gmail.com>
17 months agoJIT: fix bug in cloning conditions for jagged array (#83414)
Andy Ayers [Wed, 15 Mar 2023 14:53:22 +0000 (07:53 -0700)]
JIT: fix bug in cloning conditions for jagged array (#83414)

When checking that an inner array access is in bounds, we must ensure any outer
access is fully in bounds too. We were checking that `idx < array.Len` but not
that `idx >= 0`.

Use an unsigned compare for this check so we can do both sides with a single
instruction.

Fixes #83242.

17 months agoSpecify compacting GC in ObjWriter (#83447)
Michal Strehovský [Wed, 15 Mar 2023 14:43:42 +0000 (23:43 +0900)]
Specify compacting GC in ObjWriter (#83447)

17 months agoObjectFactory should verify against a null serviceProvider (#82739)
Badre BSAILA [Wed, 15 Mar 2023 13:34:01 +0000 (14:34 +0100)]
ObjectFactory should verify against a null serviceProvider (#82739)

17 months agoFix Test Watcher Timeouts and Log Checker File Reading Issues (#83427)
Ivan Diaz Sanchez [Wed, 15 Mar 2023 12:54:37 +0000 (05:54 -0700)]
Fix Test Watcher Timeouts and Log Checker File Reading Issues (#83427)

* Added safeguards for reading files with the log checker and fixed the low timeouts.

* Changed seconds to elapsedmilliseconds

17 months ago[Mono] Add more binary op intrinsics for ARM64 mini JIT (#83337)
Fan Yang [Wed, 15 Mar 2023 12:15:41 +0000 (08:15 -0400)]
[Mono] Add more binary op intrinsics for ARM64 mini JIT (#83337)

* Add more arm64 intrinsics for binary op

* Enable two operator operations

* Enable UnaryPlus

* Address review feedback

* Remove name

17 months agoJIT: Remove "add copies" phase (#83310)
Jakob Botsch Nielsen [Wed, 15 Mar 2023 10:57:55 +0000 (11:57 +0100)]
JIT: Remove "add copies" phase (#83310)

This phase seems to try to do some ad-hoc live range splitting to improve things in assertion prop, but it almost barely kicks in.
When it does kick in it seems to overall be a regression, both in ASM diffs and in TP diffs.
Furthermore, we pay 16 bytes in every LclVarDsc (out of 88) for bookkeeping purposes for this pass, even in MinOpts.

17 months agofix noisy tests (#83448)
Pavel Savara [Wed, 15 Mar 2023 10:03:20 +0000 (11:03 +0100)]
fix noisy tests (#83448)

17 months ago[browser] new EmccEnableAssertions and EmccEnvironment MSBuild props (#82954)
Pavel Savara [Wed, 15 Mar 2023 10:02:51 +0000 (11:02 +0100)]
[browser] new EmccEnableAssertions and EmccEnvironment MSBuild props (#82954)

* EmccEnableAssertions and EmccEnvironment MSBuild props
* symbols as separate asset type

Co-authored-by: Ankit Jain <radical@gmail.com>
Co-authored-by: Marek Fišera <mara@neptuo.com>
17 months agoProduce IL3000 and IL3001 from NativeAOT compiler (#83253)
Vitek Karas [Wed, 15 Mar 2023 09:38:29 +0000 (02:38 -0700)]
Produce IL3000 and IL3001 from NativeAOT compiler (#83253)

This also implements the suppression of the IL3002 on the affected methods both in the NativeAOT compiler and the analyzer.

Adds single-file specific tests which are skipped for the trimmer.

Fixes: https://github.com/dotnet/runtime/issues/83088
Fixes: https://github.com/dotnet/runtime/issues/82475

17 months agoEventPipe container types optimizations. (#83251)
Johan Lorensson [Wed, 15 Mar 2023 08:07:42 +0000 (09:07 +0100)]
EventPipe container types optimizations. (#83251)

During work collecting regressions statistics for #78852 I did some profiling on performance tests included in native EventPipe tests, https://github.com/dotnet/runtime/blob/main/src/mono/mono/eventpipe/test. This commit implements a couple of optimizations in the EventPipe native container classes as well as Mono's EventPipe implementation improving performance in low level native EventPipe performance tests.

Commit also includes a number of new native EventPipe tests covering optimizations done in dn_vector_ptr_t.

17 months agoBump webpack from 5.68.0 to 5.76.0 in /src/mono/sample/wasm/node-webpack (#83418)
dependabot[bot] [Wed, 15 Mar 2023 08:01:27 +0000 (09:01 +0100)]
Bump webpack from 5.68.0 to 5.76.0 in /src/mono/sample/wasm/node-webpack (#83418)

Bumps [webpack](https://github.com/webpack/webpack) from 5.68.0 to 5.76.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.68.0...v5.76.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
17 months agoAdd an INTERP_OPT for the jiterpreter (#83363)
Katelyn Gadd [Wed, 15 Mar 2023 07:52:47 +0000 (00:52 -0700)]
Add an INTERP_OPT for the jiterpreter (#83363)

This ensures that it will be disabled when debugging

17 months agoImplement JsonSerializerOptions.TypeInfoResolverChain. (#83358)
Eirik Tsarpalis [Wed, 15 Mar 2023 07:16:26 +0000 (07:16 +0000)]
Implement JsonSerializerOptions.TypeInfoResolverChain. (#83358)

* Implement JsonSerializerOptions.TypeInfoResolverChain.

* Move DebuggerDisplay from ConfigurationList to JsonTypeInfoResolverChain -- address feedback.

* Ensure JsonSerializerOptions hash equates null with empty converter list.

* Use correct error message when modifying readonly resolver chains.

* Update src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.Caching.cs

* Update src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.Caching.cs

17 months agoEnable EventSource in ILC (#83433)
Michal Strehovský [Wed, 15 Mar 2023 06:20:21 +0000 (15:20 +0900)]
Enable EventSource in ILC (#83433)

17 months ago[wasm] Add a monitoring phase to jiterpreter traces and discard unproductive ones...
Katelyn Gadd [Wed, 15 Mar 2023 05:33:41 +0000 (22:33 -0700)]
[wasm] Add a monitoring phase to jiterpreter traces and discard unproductive ones (#83432)

* Add a monitoring phase to jiterpreter traces, where we determine the average distance (in bytes) they travel. Then reject traces that have a low average distance after the monitoring period

17 months agoImplement HResult swapping for generated COM methods. (#83348)
Jeremy Koritzinsky [Wed, 15 Mar 2023 02:24:48 +0000 (19:24 -0700)]
Implement HResult swapping for generated COM methods. (#83348)

17 months agoFix spurious exception while compiling optimized code (#83324)
Michal Strehovský [Wed, 15 Mar 2023 01:28:51 +0000 (10:28 +0900)]
Fix spurious exception while compiling optimized code (#83324)

When RyuJIT tried to inline an unboxing stub, it would trigger an exception that would abort the inline. Make it so that we don't trigger an exception.

17 months ago[wasm] Disable a failing System.Drawing.Primitives test. (#83397)
Zoltan Varga [Wed, 15 Mar 2023 00:33:35 +0000 (20:33 -0400)]
[wasm] Disable a failing System.Drawing.Primitives test. (#83397)

* [wasm] Disable a failing System.Drawing.Primitives test.

* Update src/libraries/System.Drawing.Primitives/tests/RectangleTests.cs

Co-authored-by: Ankit Jain <radical@gmail.com>
---------

Co-authored-by: Ankit Jain <radical@gmail.com>
17 months agoMisleading error "Cannot delete an already deleted object" (#83410)
Badre BSAILA [Wed, 15 Mar 2023 00:03:45 +0000 (01:03 +0100)]
Misleading error "Cannot delete an already deleted object" (#83410)

17 months agoAdd references to xunit.*.dll to CLRTest.Crossgen.targets (#83413)
Tomáš Rylek [Tue, 14 Mar 2023 22:59:42 +0000 (23:59 +0100)]
Add references to xunit.*.dll to CLRTest.Crossgen.targets (#83413)

This change fixes the exceptions thrown from Crossgen2 JIT
interface when JIT tries to resolve tokens from xunit.assert.
As a secondary effect the frequent exception throws triggered
the race condition

https://github.com/dotnet/runtime/issues/81884

triggering non-deterministic native CoreCLR runtime failures on
arm64. I was originally reluctant to fix this primary issue until
the native runtime bug is understood as otherwise this fix would
just cause the issue to stop manifesting without being actually
fixed. As the runtime bug has been fixed by now, I am fixing
Crossgen2 executions to stop hitting these resolution exceptions.

Thanks

Tomas

17 months agoUse IAttributeOperation for our attribute-based analyzers (#83239)
Jeremy Koritzinsky [Tue, 14 Mar 2023 22:53:17 +0000 (15:53 -0700)]
Use IAttributeOperation for our attribute-based analyzers (#83239)

17 months agoJIT: Expand runtime lookups in a late phase (#81635)
Egor Bogatov [Tue, 14 Mar 2023 22:33:05 +0000 (23:33 +0100)]
JIT: Expand runtime lookups in a late phase (#81635)

Co-authored-by: Jakob Botsch Nielsen <jakob.botsch.nielsen@gmail.com>
17 months agoEnsure that default media type is used when 'null' is passed-in to StringContent...
Simon Lovely [Tue, 14 Mar 2023 22:07:21 +0000 (22:07 +0000)]
Ensure that default media type is used when 'null' is passed-in to StringContent #81506 (#81722)

17 months ago[mono][interp] Add intrinsics for BitOperations (#82827)
Vlad Brezae [Tue, 14 Mar 2023 20:42:09 +0000 (22:42 +0200)]
[mono][interp] Add intrinsics for BitOperations (#82827)

* [mono][interp] Add intrinsics for BitOperations.RotateLeft/Right

* [mono][interp] Remove no longer used method

* [mono][interp] Add intrinsics for bit count operations

* [mono][interp] Intrinsify also S.R.I.X86.Lzcnt and WasmBase

* [mono][interp] Add intrinsic also for BitOperations.Log2

* [mono][interp] Remove intrinsics for X86Base

17 months ago[NativeAOT] simpler ObjectHasComponentSize (#83374)
Vladimir Sadov [Tue, 14 Mar 2023 19:47:48 +0000 (12:47 -0700)]
[NativeAOT] simpler ObjectHasComponentSize (#83374)

* simplified ObjectHasComponentSize

* removes EETypePtr.ComponentSize and EETypePtr.IsAbstract

* call entire GetUninitializedObject on nullable underlying type (for static ctors)

17 months agoRemove the defunct DiagnosticUtility/Fx classes from DataContractSerialization (...
Stephen Toub [Tue, 14 Mar 2023 19:41:48 +0000 (15:41 -0400)]
Remove the defunct DiagnosticUtility/Fx classes from DataContractSerialization (#82324)

- Fx.Assert just delegated to Debug.Assert: replace all the call sites with Debug.Assert/Fail.
- DiagnosticUtility.DebugAssert just delegated to Debug.Assert: replace all the call sites with Debug.Assert/Fail.
- DiagnosticUtility.ExceptionUtility.ThrowHelperError didn't throw anything and just returned its argument: removed all uses of it
- DiagnosticUtility.ExceptionUtility.ThrowHelperCallback didn't throw anything and just returned its argument: removed all uses of it.
- DiagnosticUtility.ExceptionUtility.ThrowHelperFatal didn't throw anything and just wrapped its arguments in a new Exception that was then returned: just changed the call sites to create that exception.
- DiagnosticUtility.ExceptionUtility.ThrowHelperArgument{Null} didn't throw anything and just returned new instances of Argument{Null}Exception: just changed the call sites to create that exception.
- Replaced some argument validation with helpers like ThrowIfNegative.
- Fx.IsFatal: moved to ExceptionUtility class

17 months agoTest merging baseservices/threading (#83143)
Brian Bohe [Tue, 14 Mar 2023 17:06:59 +0000 (14:06 -0300)]
Test merging baseservices/threading (#83143)

* Removing cs test entrypoint args

* Running ILTransform -n

* Running ILTransform -prociso

* Running ILTransform -public

* Running ILTransform -ilfact

* Adding JIT/Directed merge tests wrapper

* Patching merge wrapper generator code

* Fixing accesibility problems after wrapper generator updates

17 months agoFix stress test failures on 1es-windows-2022-open (#83211)
Anton Firszov [Tue, 14 Mar 2023 15:18:57 +0000 (16:18 +0100)]
Fix stress test failures on 1es-windows-2022-open (#83211)

17 months agoJIT: Stop relying on type handles in CSE (#83306)
Jakob Botsch Nielsen [Tue, 14 Mar 2023 15:01:07 +0000 (16:01 +0100)]
JIT: Stop relying on type handles in CSE (#83306)

Fix #83215

17 months agoOverride Write(Span) for CryptoStream to clear arrays before returning to pool (...
Kevin Jones [Tue, 14 Mar 2023 14:33:56 +0000 (10:33 -0400)]
Override Write(Span) for CryptoStream to clear arrays before returning to pool (#83338)

17 months agoJIT: Remove lvaPInvokeFrameRegSaveVar (#83309)
Jakob Botsch Nielsen [Tue, 14 Mar 2023 10:43:28 +0000 (11:43 +0100)]
JIT: Remove lvaPInvokeFrameRegSaveVar (#83309)

This does not seem to be used for anything meaningful.

Fix #83052

17 months ago[browser] wasm memory snapshot into browser cache (#82049)
Pavel Savara [Tue, 14 Mar 2023 10:05:08 +0000 (11:05 +0100)]
[browser] wasm memory snapshot into browser cache (#82049)

Co-authored-by: Marek Fišera <mara@neptuo.com>
Co-authored-by: Katelyn Gadd <kg@luminance.org>
17 months agoJIT: Add missing 'MadeChanges = true' in gtSplitTree (#83360)
Jakob Botsch Nielsen [Tue, 14 Mar 2023 09:37:31 +0000 (10:37 +0100)]
JIT: Add missing 'MadeChanges = true' in gtSplitTree (#83360)

Fix #83332

17 months agoDo not generate Equals/GetHashCode support for async state machines (#83369)
Michal Strehovský [Tue, 14 Mar 2023 08:21:42 +0000 (17:21 +0900)]
Do not generate Equals/GetHashCode support for async state machines (#83369)

Saves 0.63% on BasicMinimalApi.

This logic controls whether we inject the `__GetFieldHelper` override for the type (see https://github.com/dotnet/corert/pull/5436).

17 months agoFix superpmi unit test on Alpine (#83372)
Bruce Forstall [Tue, 14 Mar 2023 08:20:35 +0000 (02:20 -0600)]
Fix superpmi unit test on Alpine (#83372)

`perl` was removed from the Alpine images we use. The superpmi unit
test harness was using `perl` to convert the line endings in the
superpmicollect.sh wrapper script harness from Windows CR/LF format
to Linux/Mac LF format.

It appears this is no longer necessary, as the wrapper scripts appear
to be built in CI during the "Generate tests wrappers" step on Linux
when they will be run on Linux, so they already have the correct line
endings. Remove the call to invoke `perl`.

Fixes #83320

17 months agoFix the compiling errors for LoongArch64 and (#83370)
Qiao Pengcheng [Tue, 14 Mar 2023 08:18:49 +0000 (04:18 -0400)]
Fix the compiling errors for LoongArch64 and (#83370)

delete unused code for ARM64.

17 months agoDo not generate relocs to empty type dictionaries (#83367)
Michal Strehovský [Tue, 14 Mar 2023 05:57:45 +0000 (14:57 +0900)]
Do not generate relocs to empty type dictionaries (#83367)

If the generic dictionary is empty, there's no legitimate reason to access it. Saves 20 kB on BasicMinimalApi.

Also deleting a multimodule extensibility point that was getting in the way. We didn't use it and I don't see a future need for it either.

17 months agoReduce duplicity in GVM analysis (#83250)
Michal Strehovský [Tue, 14 Mar 2023 05:32:15 +0000 (14:32 +0900)]
Reduce duplicity in GVM analysis (#83250)

There were two very similar pieces of logic in the generic virtual method analysis. First one was deciding whether we need to emit GVM bookkeeping about the type, the second one was deciding whether the type should participate in GVM analysis (the N*M algorithm, "for each type relevant to GVM analysis" * "GVM virtual method called").

Made this into one so that it's in one spot. The interface method resolution is not cheap so this also speeds up the compilation. We should also do this for non-generic virtuals at some point.

I did a test pass with an assert that the analysis came up with the same conclusions to ensure I didn't mess up.

17 months ago[NativeAOT] Unify common cases of Array.Copy with CoreCLR (#83351)
Vladimir Sadov [Tue, 14 Mar 2023 02:39:18 +0000 (19:39 -0700)]
[NativeAOT] Unify common cases of Array.Copy with CoreCLR (#83351)

* Unify common cases of Array.Copy

* ContainsGCPointers

* removed EETypePtr.FastEquals

* AreSameType

* fix the build after rebase

17 months ago[browser][debugger] Cleanup runtime_ready tests
Pavel Savara [Tue, 14 Mar 2023 01:07:29 +0000 (02:07 +0100)]
[browser][debugger] Cleanup runtime_ready tests

17 months agoJIT: Remove LclVarDsc::lvExactSize and LclVarDsc::lvSIMDType (#83307)
Jakob Botsch Nielsen [Mon, 13 Mar 2023 23:01:07 +0000 (00:01 +0100)]
JIT: Remove LclVarDsc::lvExactSize and LclVarDsc::lvSIMDType (#83307)

Turn these into functions.

17 months agoUse `MethodTable.Of` in generated valuetype methods (#83325)
Michal Strehovský [Mon, 13 Mar 2023 21:17:14 +0000 (06:17 +0900)]
Use `MethodTable.Of` in generated valuetype methods (#83325)

I thought it might improve codegen, but the improvements are marginal. Still, contributes to dotnet/runtimelab#232.

17 months agoLocalized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 213397...
dotnet bot [Mon, 13 Mar 2023 18:26:59 +0000 (11:26 -0700)]
Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2133979 (#83240)

* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2131973

* Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2132876

17 months agoConstant folding for RuntimeInformation.IsOSPlatform(OSPlatform) (#83308)
Egor Bogatov [Mon, 13 Mar 2023 18:11:08 +0000 (19:11 +0100)]
Constant folding for RuntimeInformation.IsOSPlatform(OSPlatform) (#83308)

17 months agoShared helpers for creating framework-dependent/self-contained apps in host tests...
Elinor Fung [Mon, 13 Mar 2023 17:49:27 +0000 (10:49 -0700)]
Shared helpers for creating framework-dependent/self-contained apps in host tests (#83291)

- Add centralized helpers for:
  - Creating framework-dependent or self-contained apps
  - Host binaries' names and paths
- Update native search directories test to validate behaviour with .deps.json (the test was using an app without .deps.json)

17 months agoUnify unroll limits in a single entry point (#83274)
Egor Bogatov [Mon, 13 Mar 2023 17:14:22 +0000 (18:14 +0100)]
Unify unroll limits in a single entry point (#83274)

17 months agoRemove the dotnet (1) man page (#78229)
Omair Majid [Mon, 13 Mar 2023 16:33:40 +0000 (12:33 -0400)]
Remove the dotnet (1) man page (#78229)

All the man pages, including a different version of dotnet.1, are
currently maintained in the dotnet/sdk repo. See
https://github.com/dotnet/sdk/tree/main/documentation/manpages and in
particular, the documentation on how those are generated from
dotnet/docs repository:
https://github.com/dotnet/sdk/blob/main/documentation/manpages/tool/README.md

This leftover copy of dotnet.1 in this repository is extremely out of
date and unmaintained. Lets just delete it.

Co-authored-by: Andy Gocke <angocke@microsoft.com>
17 months agoreplace redhawk with nativeaot (#79217)
kasperk81 [Mon, 13 Mar 2023 16:28:39 +0000 (18:28 +0200)]
replace redhawk with nativeaot (#79217)

* replace redhawk with nativeaot

* apply suggestions

Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
---------

Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
17 months ago[mono] Use unsigned char when computing UTF8 string hashes (#83273)
Aleksey Kliger (λgeek) [Mon, 13 Mar 2023 14:14:21 +0000 (10:14 -0400)]
[mono] Use unsigned char when computing UTF8 string hashes (#83273)

* [mono] Use `unsigned char` when computing UTF8 string hashes

The C standard does not specify whether `char` is signed or unsigned, it is implementation defined.

Apparently Android aarch64 makes a different choice than other platforms (at least macOS arm64 and Windows x64 give different results).

Mono uses `mono_metadata_str_hash` in the AOT compiler and AOT runtime to optimize class name lookup.  As a result, classes whose names include UTF-8 continuation bytes (with the high bit = 1) will hash differently in the AOT compiler and on the device.

Fixes https://github.com/dotnet/runtime/issues/82187
Fixes https://github.com/dotnet/runtime/issues/78638

* [aot] add DEBUG_AOT_NAME_TABLE code for debugging the class names

   AOT compiler: Emits a second "class_name_table_debug" symbol that has all the class names and hashes as strings.

   AOT runtime: warns if a class is not found in the name cache

* Add regression test

17 months ago[mono] Clean up the delegate ctor code. (#83288)
Zoltan Varga [Mon, 13 Mar 2023 13:43:33 +0000 (09:43 -0400)]
[mono] Clean up the delegate ctor code. (#83288)

* [mono] Clean up the delegate ctor code.

* Merge the virtual and non-virtual cases.
* Reorder the code in handle_delegate_ctor () to reduce the llvm_only conditionals.
* Name variables etc. delegate info instead of delegate trampoline.
* Avoid setting the del->is_virtual field if its FALSE.

* Remove some code which is already done by mono_resolve_patch_target_ext ().

* Remove some dead code.

* Unify the virtual/non-virtual case for llvmonly as well.

17 months ago[mono][jit] Adding more arm64 SIMD operations, SIMD codegen with instruction table...
Jan Dupej [Mon, 13 Mar 2023 12:41:39 +0000 (13:41 +0100)]
[mono][jit] Adding more arm64 SIMD operations, SIMD codegen with instruction table. (#83094)

* [mono][jit] Handling vector operations on arm64, comparisions and a few others, tabular approach to instruciton specs.

* [mono][jit] Adding compare vector operations, not, neg. Mono IR to machine code transformation is now table-generated for select operations. Fixing issues.

* YAGNI on a macro.

* [mono][jit] Table-driven code SIMD generation on arm64 is now restricted to exclude certain operations that are easily implemented manually.

* [mono][jit] Code cleanup.

* Temporarily disable SIMD on arm64. Fix indentation. Comments.

17 months agoOverride all write/flush methods on NullTextWriter (#83293)
Stephen Toub [Mon, 13 Mar 2023 12:04:12 +0000 (08:04 -0400)]
Override all write/flush methods on NullTextWriter (#83293)

The base implementations do non-trivial work, like calling ToString on the arguments, calling string.Format, queueing tasks, etc.  None of that should be done if TextWriter.Null is used.

17 months agoFix address data emitted in the MonoProfilerGCRoots ETW event (#83284)
Filip Navara [Mon, 13 Mar 2023 10:19:02 +0000 (11:19 +0100)]
Fix address data emitted in the MonoProfilerGCRoots ETW event (#83284)

17 months agoRemove VersionSuffix from servicing builds (#83311)
Adeel Mujahid [Mon, 13 Mar 2023 08:52:40 +0000 (10:52 +0200)]
Remove VersionSuffix from servicing builds (#83311)