platform/upstream/dotnet/runtime.git
2 years agoFix SpecialTypeInfo.Byte (#67261)
Elinor Fung [Mon, 28 Mar 2022 23:39:33 +0000 (16:39 -0700)]
Fix SpecialTypeInfo.Byte (#67261)

2 years agoAdd some documentation on `GT_CAST`'s semantics (#67208)
SingleAccretion [Mon, 28 Mar 2022 23:24:06 +0000 (02:24 +0300)]
Add some documentation on `GT_CAST`'s semantics (#67208)

* Add documentation on GT_CAST's semantics

The semantics of cast nodes are notoriously complicated.
It was requested documentation be added clarifying some
of the less obvious bits, this change does just that.

* Fix a typo, add the "integer -> FP" case

"Integer -> FP" (always) unchecked casts also use "IsUnsigned".

2 years agoIssue at most one connection attempt per request (#67114)
Miha Zupan [Mon, 28 Mar 2022 23:21:59 +0000 (16:21 -0700)]
Issue at most one connection attempt per request (#67114)

* Issue at most one connection attempt per request

* Drop the Try- from PeekNextRequestForConnectionAttempt

* Add test

* PR feedback

* Entry => QueueItem

2 years agoAdd struct info to JitDump for INDEX and IND nodes (#67135)
Bruce Forstall [Mon, 28 Mar 2022 23:20:05 +0000 (16:20 -0700)]
Add struct info to JitDump for INDEX and IND nodes (#67135)

Also, shorten struct type name display. Use the `appendClassName`
API to construct a smaller class name, without the full assembly info.

2 years ago[wasm] Improved error handling in debug proxy (#65828)
Ankit Jain [Mon, 28 Mar 2022 22:49:05 +0000 (18:49 -0400)]
[wasm] Improved error handling in debug proxy (#65828)

* [wasm] Mark result as Error if it has 'exceptionDetails' field

* [wasm] Don't swallow errors from methods that enumerate properties

.. like for getting locals. Instead, surface the original errors which
have details of the actual failure, to the point before we send a
response.

This helps debugging a lot, so instead of `Unable to evaluate dotnet:scope:1`,
we get more detailed errors.

* [wasm] Throw an exception when a debugger agent command fails

We are checking `HasError` property on the binary reader in very few
places. Other places just try to use the reader which then fails with
errors in reading, or base64 conversion etc, and we don't get any info
about what command failed.

Instead, throw an exception on error by default. But the existing
locations that do check `HasError`, don't throw for them.

* [wasm] Fix evaluating expression calling a non-existant method

Issue: https://github.com/dotnet/runtime/issues/65744

The test doesn't fail because it is expecting an error, and it gets
that.

But the log shows an assertion:

`console.error: * Assertion at /workspaces/runtime/src/mono/mono/metadata/class-accessors.c:71, condition `<disabled>' not met`

1. This is because the debugger-agent does not check that the `klass`
argument is NULL, which is fixed by adding that check.

2. But the reason why this got called with `klass==NULL`, is because
`MemberReferenceResolver.Resolve` tries first to find the non-existant
method on the type itself. Then it tries to find the method on
`System.Linq.Enumerable`, but fails to find a typeid for that.
  - but continues to send a command to get the methods on that
  `linqTypeId==0`.

* [wasm] Add some missing exception logging in the proxy

* cleaup

* [wasm] GetMethodIdByName: throw on invalid type ids

* [wasm] Improve error handling in expression evaluation

* Cleanup

* Disable failing test - https://github.com/dotnet/runtime/issues/65881

* Add missed files

* Address @ilonatommy's feedback

2 years ago[wasm] Bump emscripten to 3.1.7 (#67006)
Radek Doulik [Mon, 28 Mar 2022 22:45:08 +0000 (00:45 +0200)]
[wasm] Bump emscripten to 3.1.7 (#67006)

* Bump emscripten to 3.1.7

* Use new docker images with emscripten 3.1.7

* Update exported functions list for 3.1.7:

* Use 3.1.7 emsdk and icu packages

Co-authored-by: Ankit Jain <radical@gmail.com>
2 years ago[main] Update dependencies from dotnet/roslyn-analyzers (#67189)
dotnet-maestro[bot] [Mon, 28 Mar 2022 22:41:45 +0000 (16:41 -0600)]
[main] Update dependencies from dotnet/roslyn-analyzers (#67189)

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

Microsoft.CodeAnalysis.NetAnalyzers
 From Version 7.0.0-preview1.22166.1 -> To Version 7.0.0-preview1.22174.1

* React to DisableRuntimeMarshalling attribute analyzer by switching a few extraneous places to source-generated marshalling and removing some unused attributes.

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Jeremy Koritzinsky <jkoritzinsky@gmail.com>
2 years ago[MAUI][PERF] Maui Perf add iOS Podcast SOD Tests (#67165)
Parker Bibus [Mon, 28 Mar 2022 22:21:55 +0000 (17:21 -0500)]
[MAUI][PERF] Maui Perf add iOS Podcast SOD Tests (#67165)

* Publish the maui iOS Podcast app in the build yml
* Pipe the built Podcast IPA file through and test it.

2 years agoAdd arm64 cross-arch msi installers (#67066)
Jeremy Koritzinsky [Mon, 28 Mar 2022 22:14:04 +0000 (15:14 -0700)]
Add arm64 cross-arch msi installers (#67066)

2 years agoRemove unnecessary remark from ObservableCollection.CollectionChanged (#67250)
Carlos Sanchez [Mon, 28 Mar 2022 21:52:05 +0000 (14:52 -0700)]
Remove unnecessary remark from ObservableCollection.CollectionChanged (#67250)

Co-authored-by: carlossanlop <carlossanlop@users.noreply.github.com>
2 years agoObsolete ToXmlString and FromXmlString on ECC types
Kevin Jones [Mon, 28 Mar 2022 21:07:19 +0000 (17:07 -0400)]
Obsolete ToXmlString and FromXmlString on ECC types

Co-authored-by: Jeremy Barton <jbarton@microsoft.com>
2 years ago[wasm] MonoProxy.cs: Avoid some errors by pre-emptively checking (#67243)
Ankit Jain [Mon, 28 Mar 2022 19:51:01 +0000 (15:51 -0400)]
[wasm] MonoProxy.cs: Avoid some errors by pre-emptively checking (#67243)

.. inspired by https://github.com/dotnet/runtime/issues/66149 .

2 years ago[wasm] EmccCompile: Improve AOT time by better utilizing the cores (#67195)
Ankit Jain [Mon, 28 Mar 2022 19:48:00 +0000 (15:48 -0400)]
[wasm] EmccCompile: Improve AOT time by better utilizing the cores (#67195)

* [wasm] EmccCompile: Improve AOT time by better utilizing the cores

Problem:

`EmccCompile` tasks compiles `.bc` files to `.o` files, and uses
`Parallel.ForEach` to run `emcc` for these in parallel.

The problem manifests when `EmccCompile` is compiling lot of files.
- To start with, the intended number of cores are being used
- but at some point (in my case after ~150 out of 180 files), the number
  of cores being utilized goes down to 1.
- And the reason is that `Parallel.ForEach` partitions the list of
  files(jobs), and they execute only the assigned jobs

From: https://github.com/dotnet/runtime/issues/46146#issuecomment-754021690

Stephen Toub:
    "As such, by default ForEach works on a scheme whereby each
    thread takes one item each time it goes back to the enumerator,
    and then after a few times of this upgrades to taking two items
    each time it goes back to the enumerator, and then four, and
    then eight, and so on. This ammortizes the cost of taking and
    releasing the lock across multiple items, while still enabling
    parallelization for enumerables containing just a few items. It
    does, however, mean that if you've got a case where the body
    takes a really long time and the work for every item is
    heterogeneous, you can end up with an imbalance."

The above means that with wildy different times taken by each job, we
can end up in this imbalance, leading to some cores being idle, which
others get reduced to running jobs sequentially.

Instead, we want to use work-stealing so jobs can be run by any partition.

In my highly unscientific testing, with AOT for `System.Buffers.Tests`,
the total time to run `EmccCompile` for 181 assemblies goes from 5.7mins
to 4.0mins .

* MonoAOTCompiler.cs: Ensure that the parallel jobs get scheduled with

.. work-stealing, instead of being partitioned.

2 years ago[PERF] Added --logbuildoutput to microbenchmark runs. (#67111)
Nathan Ricci [Mon, 28 Mar 2022 17:35:18 +0000 (13:35 -0400)]
[PERF] Added --logbuildoutput to microbenchmark runs. (#67111)

Added --logbuildoutput to microbenchmark runs.

2 years agoFix a few issues with merged wrappers uncovered by local testing (#67211)
Tomáš Rylek [Mon, 28 Mar 2022 16:02:58 +0000 (18:02 +0200)]
Fix a few issues with merged wrappers uncovered by local testing (#67211)

After merging in the last preparatory change (deduplication of
tests with the same assembly names) I'm now testing the "final"
JIT/Methodical switchover change; this testing uncovered a few
previously unseen issues related to the merged wrappers and I'm
sending them for a separate PR to decouple them from the big
mechanical switchover change.

1) For out-of-process tests, "Method" contains the relative test
execution script path; we need to prefix the string with "@"
to avoid complaining about backslashes on Windows.

2) Jeremy recently added a consistency check to catch multiple
projects producing assemblies with the same simple name; turns
out there was a subtle bug where the check blew up on projects
with DisableProjectBuild set to true.

3) A similar problem exists for projects with the property
CLRTestTargetUnsupported but I haven't added it to the fix;
I believe it is healthy to receive this type of error in the build
as with the merged wrappers the CLRTestTargetUnsupported clauses
need to be removed and replaced with ConditionalFactAttribute
annotations, otherwise we could lose part of the conditional
code coverage as in the lab the managed tests are build only
once on an arbitrary platform so their individual platform-specific
exclusions must be postponed to execution time.

Thanks

Tomas

2 years agoLet CustomTypeMarshaller implementation use Span of unmanaged type for Value marshall...
Elinor Fung [Mon, 28 Mar 2022 15:52:43 +0000 (08:52 -0700)]
Let CustomTypeMarshaller implementation use Span of unmanaged type for Value marshalling (#67172)

2 years agoadd gregsdennis to area-system-text-json (#67224)
Greg Dennis [Mon, 28 Mar 2022 14:23:52 +0000 (03:23 +1300)]
add gregsdennis to area-system-text-json (#67224)

2 years ago[API Implementation]: Use TimeSpan everywhere we use an int for seconds, milliseconds...
Robin Lindner [Mon, 28 Mar 2022 14:14:09 +0000 (16:14 +0200)]
[API Implementation]: Use TimeSpan everywhere we use an int for seconds, milliseconds, and timeouts (Group 1/3) (#64860)

2 years agox ^ 0 opt
Sychev Vadim [Mon, 28 Mar 2022 10:41:36 +0000 (13:41 +0300)]
x ^ 0 opt

2 years agoPort SequenceEqual to crossplat Vectors, optimize vector compare on x64 (#67202)
Egor Bogatov [Mon, 28 Mar 2022 09:47:11 +0000 (12:47 +0300)]
Port SequenceEqual to crossplat Vectors, optimize vector compare on x64 (#67202)

2 years agoDo not reorder HTTP header values (#65249)
feiyun0112 [Mon, 28 Mar 2022 08:51:11 +0000 (16:51 +0800)]
Do not reorder HTTP header values (#65249)

* Do not reorder HTTP header values

* fix complie error

* make the changes @ danmoseley recommended

* make the changes @MihaZupan recommended

* make the changes @MihaZupan recommended

* make the changes @MihaZupan recommended

* make the changes @MihaZupan recommended

* make the changes @MihaZupan recommended

* check array length

* fix unit test

* Update src/libraries/System.Net.Http/tests/UnitTests/Headers/HttpHeadersTest.cs

Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* Update src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeaders.cs

Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* Update src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeaders.cs

Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* Update src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeaders.cs

Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* make the changes @MihaZupan recommended

* Update src/libraries/System.Net.Http/src/System/Net/Http/Headers/CacheControlHeaderParser.cs

Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* chang unit test

* GetParsedValueLength

* fix build error

* Update src/libraries/System.Net.Http/src/System/Net/Http/Headers/CacheControlHeaderParser.cs

Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* Update src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeaders.cs

Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* unit test

* make changes @geoffkizer recommended

* CloneAndAddValue for InvalidValues

* Update src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeaders.cs

Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* Update src/libraries/System.Net.Http/src/System/Net/Http/Headers/HttpHeaders.cs

Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* Final nits

Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
2 years agoCI matrix change: Windows (#58989)
Jan Jahoda [Mon, 28 Mar 2022 07:37:41 +0000 (09:37 +0200)]
CI matrix change: Windows (#58989)

* CI matrix change: Windows

* Remove Windows Server RS5

* Revert .net Framework change

* Add 19H1 to rolling

* Add Windows.Server.Core.20H2 to CI matrix

* Remove Windows 8.1

* Remove 20H2 as thhere is a PR for it #60054

* Typo

Co-authored-by: Jan Jahoda <jajahoda@microsoft.com>
Co-authored-by: Andy Gocke <andy@commentout.net>
Co-authored-by: Dan Moseley <danmose@microsoft.com>
2 years agoDon't apply IMAGE_REL_BASED_REL32 when address doesn't belong to current section...
Egor Chesakov [Sun, 27 Mar 2022 17:07:05 +0000 (10:07 -0700)]
Don't apply IMAGE_REL_BASED_REL32 when address doesn't belong to current section (#66855)

* Don't attempt to apply IMAGE_REL_BASED_REL32 when address doesn't belong to current block in src/coreclr/ToolBox/superpmi/superpmi-shared/compileresult.cpp

* Update "Exit Codes" section in the superpmi help command output

2 years agoAdd reciprocal and SinCos methods to IFloatingPoint (#59521)
Bar Arnon [Sun, 27 Mar 2022 14:34:56 +0000 (17:34 +0300)]
Add reciprocal and SinCos methods to IFloatingPoint (#59521)

2 years ago[arm64] JIT: Move LowerSIMD to shared lower.cpp (#67190)
Egor Bogatov [Sat, 26 Mar 2022 21:07:40 +0000 (00:07 +0300)]
[arm64] JIT: Move LowerSIMD to shared lower.cpp (#67190)

2 years agoUse generic `Enum` methods in more places. (#67147)
Theodore Tsirpanis [Sat, 26 Mar 2022 19:34:21 +0000 (21:34 +0200)]
Use generic `Enum` methods in more places. (#67147)

2 years agoFix race condition in loading assemblies with composite native images (#67000)
Tomáš Rylek [Sat, 26 Mar 2022 09:32:59 +0000 (10:32 +0100)]
Fix race condition in loading assemblies with composite native images (#67000)

I originally hit this bug when testing my Crossgen2 perf optimization
change involving only registering composite code range once but I
managed to disprove the bug was caused by this change. Indeed, it
was caused by my earlier change improving component assembly caching.

In my overzealous attempt to make sure the assembly gets always
registered I added a new method NativeImage::AddComponentAssemblyToCache
that registered the assembly which had triggered the native image load
in the first place. This was incorrect, by that point the assembly
wasn't yet fully initialized and putting it in the cache made it
visible to other threads that subsequently crashed trying to access
the assembly before it was fully loaded.

Furthermore it was unnecessary, once the assembly gets loaded, it
gets stored in the cache via the call to
SetNativeMetadataAssemblyRefInCache from ZapSig::DecodeModuleFromIndex.
Before the fix I was able to repro the bug locally typically after
about 500 iterations of the thread14 unit test, with the fix I was
unable to repro after 4500 iterations.

Thanks

Tomas

Fixes: https://github.com/dotnet/runtime/issues/66954
Probably also fixes: https://github.com/dotnet/runtime/issues/66210

2 years agoFix jit attach hang at Shutdown (#67166)
Noah Falk [Sat, 26 Mar 2022 04:52:22 +0000 (21:52 -0700)]
Fix jit attach hang at Shutdown (#67166)

Fixes #66715

We are seeing exceptions thrown at shutdown turn into hangs because the debugger
lock suspends threads at that point. We are mitigating that problem by disabling the
jit attach setup work and allowing WatsonLastChance to continue.

2 years agoFixes InvalidCastException when using other attributes (#67179)
Maryam Ariyan [Sat, 26 Mar 2022 04:27:51 +0000 (21:27 -0700)]
Fixes InvalidCastException when using other attributes (#67179)

- alongside LoggerMessageAttribute

Fixes #67167

2 years agoObsolete outdated constructors on Rfc2898DeriveBytes
Kevin Jones [Sat, 26 Mar 2022 00:27:20 +0000 (20:27 -0400)]
Obsolete outdated constructors on Rfc2898DeriveBytes

2 years agoRefactor HandleCollectionsAsync to an xunit Theory (#67126)
Eirik Tsarpalis [Fri, 25 Mar 2022 23:45:00 +0000 (23:45 +0000)]
Refactor HandleCollectionsAsync to an xunit Theory (#67126)

* Refactor HandleCollectionsAsync to a Theory

* add small buffer testing in StreamTests

* redisable test for mono/wasm platforms

2 years agoDisable multi-level lookup by default (#67022)
Elinor Fung [Fri, 25 Mar 2022 23:41:38 +0000 (16:41 -0700)]
Disable multi-level lookup by default (#67022)

2 years agoExpose the custom type marshalling types for source-generated interop. (#67052)
Jeremy Koritzinsky [Fri, 25 Mar 2022 22:54:39 +0000 (15:54 -0700)]
Expose the custom type marshalling types for source-generated interop. (#67052)

Co-authored-by: Elinor Fung <elfung@microsoft.com>
2 years agoUpdate Ubuntu version names in the workflow docs (#67169)
Andy Gocke [Fri, 25 Mar 2022 22:24:32 +0000 (15:24 -0700)]
Update Ubuntu version names in the workflow docs (#67169)

16.04 and 18.04 are out of support, but we always support the latest Ubuntu LTS

2 years agoPoC TLS resume on Linux client (#64369)
Tomas Weinfurt [Fri, 25 Mar 2022 22:08:09 +0000 (15:08 -0700)]
PoC TLS resume on Linux client (#64369)

* TLS resume on client

* shim functions introduced in 1.1.1

* add missing struct

* disable resume on old OpenSSL

* feedback from review

* fix source build

* update comment

* feedback from review

* feedback from review

* avoild client resume on old OpenSSL

2 years ago[wasm][aot] Run the high resource AOT tests on build machine itself (#67017)
Ankit Jain [Fri, 25 Mar 2022 21:32:27 +0000 (17:32 -0400)]
[wasm][aot] Run the high resource AOT tests on build machine itself (#67017)

Some library tests fail to AOT on helix by getting oomkill'ed. Since the
build machine have more resources than helix, we can AOT these specific
library tests there, and send the built output to helix to run.

Specifically:
- `System.Text.Json.SourceGeneration.Roslyn3.11.Tests`
- `System.Text.Json.SourceGeneration.Roslyn4.0.Tests`
- `System.Text.Json.Tests`
- `Microsoft.Extensions.Logging.Generators.Roslyn3.11.Tests`

This adds two new jobs to `runtime-wasm`, and for rolling builds - `LibraryTests_HighResource_AOT` for linux, and windows.

Fixes #65356
Fixes #65411
Fixes #61524
Fixes #66647

2 years agoAvoid empty array allocation in MethodBase.GetParameterTypes (#67149)
Stephen Toub [Fri, 25 Mar 2022 20:38:53 +0000 (16:38 -0400)]
Avoid empty array allocation in MethodBase.GetParameterTypes (#67149)

No parameters is very common.  Avoid a `new Type[0]` array in such cases.

2 years agoRemove some array allocations from RuntimeType.CreateInstanceImpl (#67148)
Stephen Toub [Fri, 25 Mar 2022 20:38:26 +0000 (16:38 -0400)]
Remove some array allocations from RuntimeType.CreateInstanceImpl (#67148)

- It's commonly used with zero args; we can use Type.EmptyTypes rather than new Type[0]
- It calls GetConstructors, which internally uses ListBuilder and then resizes if the created array isn't filled, but since we don't need the correctly sized array, we can just use the ListBuilder and avoid the resize
- It creates a List and then ToArray's it, but if none of the constructors are filtered out, it's better to just use the array we built up directly.

2 years ago[perf] Set job name for the performance jobs (#67124)
Ankit Jain [Fri, 25 Mar 2022 20:03:24 +0000 (16:03 -0400)]
[perf] Set job name for the performance jobs (#67124)

job.yml uses name instead of displayName to set the job's name. But perf jobs don't set that. Without this, pre-defined variables like System.PhaseName get value Job1.
This will help with differentiating builds in kusto.

2 years ago[Group 4] Enable nullable annotations for `Microsoft.Extensions.Logging.TraceSource...
Maksym Koshovyi [Fri, 25 Mar 2022 19:47:40 +0000 (21:47 +0200)]
[Group 4] Enable nullable annotations for `Microsoft.Extensions.Logging.TraceSource` (#66892)

2 years agoInfra for regeneration of third-party-notices file (#60091)
Nikola Milosavljevic [Fri, 25 Mar 2022 19:26:51 +0000 (12:26 -0700)]
Infra for regeneration of third-party-notices file (#60091)

* Infra for regeneration of third-party-notices file

* Update eng/regenerate-third-party-notices.proj

Co-authored-by: Davis Goodin <dagood@users.noreply.github.com>
* Addressing PR comments

* Updated copyright in all .cs files

* Update dotnet/liner repo name

* Add dotnet/emsdk to the list

Co-authored-by: Davis Goodin <dagood@users.noreply.github.com>
2 years agoDeduplicate project files with the same name in different folders (#64841)
Tomáš Rylek [Fri, 25 Mar 2022 19:16:08 +0000 (20:16 +0100)]
Deduplicate project files with the same name in different folders (#64841)

This is a somewhat annoying aspect hitting less than 10% of the
JIT/Methodical subtree: as the new merged wrapper logic is based
on simple assembly names, we cannot merge multiple test projects
that produce a test assembly with the same name otherwise such
assemblies stomp over each other when getting copied to the merged
wrapper folder. I have added a new option to ILTransform to include
the directory name in the project names in these cases. We can
remove some of this in the future when selectively merging actual
test source code (compiling multiple tests into a single asssembly).

Thanks

Tomas

2 years agoDelete unused native code in src/native (#67087)
Adeel Mujahid [Fri, 25 Mar 2022 19:02:35 +0000 (21:02 +0200)]
Delete unused native code in src/native (#67087)

* Delete unused native code in src/native

* Delete set_* functions from version types

2 years agoRevert "[mono][workload] Add workloads for win-arm64 using emulation (#65089)" (...
Larry Ewing [Fri, 25 Mar 2022 18:24:58 +0000 (13:24 -0500)]
Revert "[mono][workload] Add workloads for win-arm64 using emulation (#65089)" (#67154)

This reverts commit 4e7ccfa1d386670a57636231c3160c77c537d9b2.

2 years ago[mono][workload] Add workloads for win-arm64 using emulation (#65089)
Larry Ewing [Fri, 25 Mar 2022 18:22:06 +0000 (13:22 -0500)]
[mono][workload] Add workloads for win-arm64 using emulation (#65089)

* Add wasm workload for win-arm64 using emulation

* Add aliases for win-arm64 to all the win-x64 cases as well (android, ios)

2 years agoperf: Pass --dotnet-path to use dotnet-workload for wasm (#66795)
Ankit Jain [Fri, 25 Mar 2022 17:56:12 +0000 (13:56 -0400)]
perf: Pass --dotnet-path to use dotnet-workload for wasm (#66795)

This ensures that the the benchmarks project is always built with the same dotnet, avoid corrupted builds.

2 years agoFix error reporting for objects with unsupported property types (#67109)
Eirik Tsarpalis [Fri, 25 Mar 2022 16:51:11 +0000 (16:51 +0000)]
Fix error reporting for objects with unsupported property types (#67109)

* Fix error reporting for objects with unsupported property types

* refactor dictionary tests to use xunit theories

* lift test class to abstracted test harness

2 years agoJIT: block some struct promotion for OSR (#67131)
Andy Ayers [Fri, 25 Mar 2022 15:22:30 +0000 (08:22 -0700)]
JIT: block some struct promotion for OSR (#67131)

This undoes part of #65903. OSR methods can't rely solely on their own analysis
for struct promotion as they only see parts of methods.

2 years agoDisable multimodule test (#67137)
Michal Strehovský [Fri, 25 Mar 2022 15:07:42 +0000 (00:07 +0900)]
Disable multimodule test (#67137)

* Disable multimodule test

Can't use issues.targets because this is a compile failure and compilation runs during test build, not execution.

* Update MultiModule.csproj

2 years agoStabilize summary blobs (#67086)
Michal Strehovský [Fri, 25 Mar 2022 15:06:35 +0000 (00:06 +0900)]
Stabilize summary blobs (#67086)

I was trying to repro #66191 and assumed determinism is the root cause. I used `CoreRT_DeterminismSeed` to perturb the dependency node evaluation and it found differences.

Now, I don't think the differences really matter. We already seem to be deterministic in the multithreaded compilation (the outputs are always the same no matter how many times I try).

`CoreRT_DeterminismSeed` perturbs the order in which node dependencies are evaluated and that exposes more ordering issues than we practically have.

In normal multithreaded compilation we grab nodes in different order from the `NodeFactory` as part of method compilation, but the order in which those nodes are evaluated is still fixed. This means the nodes we grabbed are still getting marked in a deterministic order and we get stable ordering even without an explicit sort in this spot.

But maybe as part of https://github.com/dotnet/runtimelab/issues/1631 we should enable `CoreRT_Determinism` in our testing and for that we need this extra sorting.

2 years ago[Group 4] Enable nullable annotations for `Microsoft.Extensions.Logging.Debug` (...
Maksym Koshovyi [Fri, 25 Mar 2022 13:38:06 +0000 (15:38 +0200)]
[Group 4] Enable nullable annotations for `Microsoft.Extensions.Logging.Debug` (#66862)

Related to #43605

2 years agoAdd tighter bound to range check for matching Regex char classes (#67133)
Stephen Toub [Fri, 25 Mar 2022 12:40:06 +0000 (08:40 -0400)]
Add tighter bound to range check for matching Regex char classes (#67133)

When we emit a bitmap lookup for character classes containing only ASCII characters, we currently bound the check by 128, e.g.
```C#
if (ch < 128 && lookupTable[...])
```
but we can easily lower that 128 to instead be the actual exclusive upper bound based on the char set.  Doing so means we don't need to hit the lookup table for a larger set of characters.

(We could also actually shrink the size of the lookup table itself, but doing so would only save a few bytes, and it didn't seem worth the complexity right now.  We could also add a lower range check, but that's also additional checks to execute whereas this one is just improving an existing check that's also required for correctness.)

2 years agoEnable CA1822 (Mark members as static) analyzer (#66333)
Marek Safar [Fri, 25 Mar 2022 11:06:33 +0000 (12:06 +0100)]
Enable CA1822 (Mark members as static) analyzer (#66333)

2 years agoDon't throw PNSE on QuicImplementationProvider.IsSupported (#67036)
Radek Zikmund [Fri, 25 Mar 2022 10:37:41 +0000 (11:37 +0100)]
Don't throw PNSE on QuicImplementationProvider.IsSupported (#67036)

2 years ago[mono][wasm] Store the exception object in a GC handle while it is being thrown....
Zoltan Varga [Fri, 25 Mar 2022 07:34:40 +0000 (03:34 -0400)]
[mono][wasm] Store the exception object in a GC handle while it is being thrown. (#67121)

2 years agoExclude throwinnestedtrycatch_il_r from Arm runs (#67122)
Kunal Pathak [Fri, 25 Mar 2022 01:53:26 +0000 (18:53 -0700)]
Exclude throwinnestedtrycatch_il_r from Arm runs (#67122)

2 years agoReplace bool[] arrays with Span<bool> in XML deserialization (#66914)
Stephen Toub [Fri, 25 Mar 2022 01:38:46 +0000 (21:38 -0400)]
Replace bool[] arrays with Span<bool> in XML deserialization (#66914)

The XML deserializer tracks for each property whether it's already been seen in the input being deserialized, and to do that the reader allocates a bool[] array.  We can instead stackalloc that for a reasonable number of properties.

2 years agoFix link and clarify how community members can edit notifications without portal...
Dan Moseley [Fri, 25 Mar 2022 01:24:15 +0000 (19:24 -0600)]
Fix link and clarify how community members can edit notifications without portal (#67073)

2 years agoAdd dynamic shim for SSL_CTX_set_options and SSL_set_options
Radek Zikmund [Fri, 25 Mar 2022 00:30:08 +0000 (01:30 +0100)]
Add dynamic shim for SSL_CTX_set_options and SSL_set_options

This works around ABI breaking change made between OpenSSL 1.1 and 3.0 where argument type and return type was changed from unsigned long to uint64_t, which caused issues on arm32 architectures with OpenSSL 3.0 installed.

Co-authored-by: Jeremy Barton <jbarton@microsoft.com>
Co-authored-by: Tomas Weinfurt <tweinfurt@yahoo.com>
2 years agoEnable localization for LibraryImportGenerator (#67107)
Elinor Fung [Thu, 24 Mar 2022 23:21:51 +0000 (16:21 -0700)]
Enable localization for LibraryImportGenerator (#67107)

2 years agoImplement {Try}HashData on asymmetric algorithms
Kevin Jones [Thu, 24 Mar 2022 21:09:22 +0000 (17:09 -0400)]
Implement {Try}HashData on asymmetric algorithms

Historically, the asymmetric algorithm base classes have had the hashing routines as abstract (or virtual+throw).

Now the base classes provide an implementation for these methods, reducing the amount of redundant effort on the part of derived types.

2 years agoFix typo in a summary comment in SharedAttribute (#67120)
Dan Roberts [Thu, 24 Mar 2022 20:39:13 +0000 (20:39 +0000)]
Fix typo in a summary comment in SharedAttribute (#67120)

2 years ago[Android] Re-enable System.Security.Cryptography tests (#67057)
Steve Pfister [Thu, 24 Mar 2022 19:36:42 +0000 (15:36 -0400)]
[Android] Re-enable System.Security.Cryptography tests (#67057)

The crypto test suites were originally disabled as they would run out of memory on both emulators and devices somewhat frequently.

This change enables them again, with the difference being that xunit will run tests on a single thread.

Addresses #62547

2 years agoAvoid issuing connection attempts for already cancelled requests (#66992)
Miha Zupan [Thu, 24 Mar 2022 19:25:12 +0000 (12:25 -0700)]
Avoid issuing connection attempts for already cancelled requests (#66992)

* Avoid issuing connection attempts for already canceled requests

* Cancelled => Canceled

* Guard SocketsHttpHandler tests under SocketsHttpHandler.IsSupported

2 years agoDelete AssemblyBuilderData and ModuleBuilderData (#66996)
Jan Kotas [Thu, 24 Mar 2022 18:47:43 +0000 (11:47 -0700)]
Delete AssemblyBuilderData and ModuleBuilderData (#66996)

There is no good reason for these to be separate types.

Co-authored-by: Theodore Tsirpanis <teo@tsirpanis.gr>
2 years agoDelete custom cmake config cache mechanism on Unix (#64370)
Adeel Mujahid [Thu, 24 Mar 2022 18:33:45 +0000 (20:33 +0200)]
Delete custom cmake config cache mechanism on Unix (#64370)

When cmake configuration fails due to missing dependency or manually terminated in the middle (Ctrl+C) for some reason, re-running the build command fails with these messages:

```
  CMake command line is unchanged. Reusing previous cache instead of regenerating.
  Unable to find generated build files for "native libraries component" project!
```

The workaround is to delete artifacts directory and rerun the build command, which is wasteful (as it repreforms all the previous steps including rebuilding the previous subsets). cmake has its own up-to-date caching mechanism which works well on Unix (it has some issues on Windows/MSBuild), so deleting the custom sentinel-based cache on Unix makes it more robust and saves some time. The one in `gen-buildsys.cmd` for Windows is kept intact.

2 years ago[main] Update dependencies from dotnet/xharness dotnet/msquic (#67094)
dotnet-maestro[bot] [Thu, 24 Mar 2022 18:19:44 +0000 (19:19 +0100)]
[main] Update dependencies from dotnet/xharness dotnet/msquic (#67094)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years ago[main] Update dependencies from dotnet/linker (#66985)
dotnet-maestro[bot] [Thu, 24 Mar 2022 18:17:10 +0000 (19:17 +0100)]
[main] Update dependencies from dotnet/linker (#66985)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoFix loop cloning for OSR (#67067)
Bruce Forstall [Thu, 24 Mar 2022 17:18:03 +0000 (10:18 -0700)]
Fix loop cloning for OSR (#67067)

Fix a previously unused piece of code to handle a loop cloning case
where the `head` block of a loop branches to the entry block.

2 years ago[mono] Ensure exception_message points to a string (#66991)
Stefan Schulze Frielinghaus [Thu, 24 Mar 2022 13:39:08 +0000 (14:39 +0100)]
[mono] Ensure exception_message points to a string (#66991)

2 years agoEnsure Sync stream serialization is handling IAsyncEnumerable correctly (#67035)
Eirik Tsarpalis [Thu, 24 Mar 2022 13:26:46 +0000 (13:26 +0000)]
Ensure Sync stream serialization is handling IAsyncEnumerable correctly (#67035)

* Fix #66687

* enable small buffer async tests for collections

2 years agoUpdate the latest node (#67060)
Kevin Jones [Thu, 24 Mar 2022 13:07:08 +0000 (09:07 -0400)]
Update the latest node (#67060)

2 years agoFix #66727. (#67041)
Eirik Tsarpalis [Thu, 24 Mar 2022 13:06:32 +0000 (13:06 +0000)]
Fix #66727. (#67041)

2 years agoUse stackalloc in NumberFormatterBase (#67003)
Trayan Zapryanov [Thu, 24 Mar 2022 12:46:37 +0000 (14:46 +0200)]
Use stackalloc in NumberFormatterBase (#67003)

Co-authored-by: Trayan Zapryanov <Traian.Zaprianov@docuware.com>
2 years agoFix entry point for EnumPrinters (#67081)
Elinor Fung [Thu, 24 Mar 2022 12:14:34 +0000 (05:14 -0700)]
Fix entry point for EnumPrinters (#67081)

2 years agoAdd timestamp-based expiration to cached SafeFreeCredentials (#66334)
Radek Zikmund [Thu, 24 Mar 2022 12:03:10 +0000 (13:03 +0100)]
Add timestamp-based expiration to cached SafeFreeCredentials (#66334)

* Add Expiry timestamp on SafeFreeCredentials handle

* Recalculate expiration timestamp based on CertificateContext

* Fix case when user provides CertificateContext

2 years agoCoreCLR runtime tests on Mono Windows x64. (#64281)
Johan Lorensson [Thu, 24 Mar 2022 07:54:35 +0000 (08:54 +0100)]
CoreCLR runtime tests on Mono Windows x64. (#64281)

Fixed and enabled CoreCLR runtime tests running on Mono Windows x64.

2 years ago[main] Update dependencies from 8 repositories (#66826)
dotnet-maestro[bot] [Thu, 24 Mar 2022 06:45:05 +0000 (23:45 -0700)]
[main] Update dependencies from 8 repositories (#66826)

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

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

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

Microsoft.CodeAnalysis.NetAnalyzers
 From Version 7.0.0-preview1.22166.1 -> To Version 7.0.0-preview1.22167.1

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

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

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

Microsoft.CodeAnalysis.NetAnalyzers
 From Version 7.0.0-preview1.22166.1 -> To Version 7.0.0-preview1.22168.1

* Update dependencies from https://github.com/dotnet/runtime build 20220321.1

runtime.native.System.IO.Ports , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.DotNetHost , Microsoft.NETCore.ILAsm , Microsoft.NETCore.DotNetHostPolicy , System.Text.Json , Microsoft.NET.Sdk.IL
 From Version 7.0.0-preview.3.22163.2 -> To Version 7.0.0-preview.3.22171.1

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

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

* Update dependencies from https://github.com/dotnet/icu build 20220321.4

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 7.0.0-preview.3.22157.1 -> To Version 7.0.0-preview.4.22171.4

* Update dependencies from https://github.com/dotnet/runtime-assets build 20220321.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.22166.2 -> To Version 7.0.0-beta.22171.1

* Update dependencies from https://github.com/dotnet/emsdk build 20220321.3

Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.0-preview.3.22167.1 -> To Version 7.0.0-preview.4.22171.3

* Update dependencies from https://github.com/dotnet/hotreload-utils build 20220321.1

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 1.0.2-alpha.0.22164.2 -> To Version 1.0.2-alpha.0.22171.1

* Update dependencies from https://github.com/dotnet/llvm-project build 20220321.2

runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools
 From Version 11.1.0-alpha.1.22164.2 -> To Version 11.1.0-alpha.1.22171.2

* Update dependencies from https://github.com/dotnet/emsdk build 20220322.1

Microsoft.NET.Workload.Emscripten.Manifest-7.0.100
 From Version 7.0.0-preview.3.22121.1 -> To Version 7.0.0-preview.4.22172.1

* Update dependencies from https://github.com/dotnet/icu build 20220322.1

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 7.0.0-preview.3.22121.1 -> To Version 7.0.0-preview.4.22172.1

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

Microsoft.CodeAnalysis.NetAnalyzers
 From Version 7.0.0-preview1.22166.1 -> To Version 7.0.0-preview1.22172.1

* Revert changes from Roslyn-Analyzers

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
Co-authored-by: Juan Hoyos <juan.hoyos@microsoft.com>
2 years agoImprove vectorization of String.Split (#64899)
Jesper Meyer [Thu, 24 Mar 2022 02:02:01 +0000 (03:02 +0100)]
Improve vectorization of String.Split (#64899)

2 years agoUpdate coding-style to include target-typed new() guideline (#67061)
Eric Erhardt [Thu, 24 Mar 2022 00:54:51 +0000 (19:54 -0500)]
Update coding-style to include target-typed new() guideline (#67061)

* Update coding-style to include target-typed new guideline

Similar to `var` usage, `new()` usage is only allowed when the Type can be understood from the same line.

Fix #53369

* Fix coding style violations

2 years agoAdd a --aot-lazy-assembly-load command line option to load assemblies… (#67024)
Zoltan Varga [Thu, 24 Mar 2022 00:45:31 +0000 (20:45 -0400)]
Add a --aot-lazy-assembly-load command line option to load assemblies… (#67024)

* Add a --aot-lazy-assembly-load command line option to load assemblies referenced by AOT images lazily.

Note that this requires the assemblies used at AOT time to exactly match
the assemblies loaded at runtime, otherwise the runtime will abort
when it loads the mismatching reference.

* Handle the options added by options.h in mono_jit_parse_options ().

2 years agoEat cancellation exceptions from WaitAsync in Parallel.ForEachAsync (#66712)
Stephen Toub [Wed, 23 Mar 2022 22:40:09 +0000 (18:40 -0400)]
Eat cancellation exceptions from WaitAsync in Parallel.ForEachAsync (#66712)

We can safely ignore cancellation exceptions due to WaitAsync being canceled.  They do not represent work that was started and interrupted, and we know exactly the source of the exception (as compared to if the exception emerged from either MoveNextAsync or the loop body).

2 years ago[mono] Optimize generic sharing for generic methods. (#64129)
Zoltan Varga [Wed, 23 Mar 2022 22:18:48 +0000 (18:18 -0400)]
[mono] Optimize generic sharing for generic methods. (#64129)

* [mono] Optimize generic sharing for generic methods.

  Previously, rgctx entries where stored either in the class rgctx
or the method rgctx in linked structures, and accessed using
rgctx trampolines (for non-llvmonly configuration), or
inline code and fallback C code (for llvmonly configuration).
However, if a method has an mrgctx parameter, all the rgctx entries
can be stored as an array in the mrgctx and accessed using a simple
load.
One complication is that the mrgctx might need to be allocated before
the method is compiled/loaded, so the rgctx entries need to be stored
in a separate array, and the array needs to be initialized on
demand.

* Add an 'entries' field to MonoMethodRuntimeGenericContext which stores
the rgctx entries.
* Add a MonoGSharedMethodInfo structure which stores the information
needed to initialize a MonoMethodRuntimeGenericContext, i.e. the
number of rgctx entries and their contents.
* Add a MONO_PATCH_INFO_GSHARED_METHOD_INFO patch type to refer
to the previous structure.
* Add a mini_init_method_rgctx () JIT icall, which initializes
an mrgctx if needed and generate code in the prolog of gshared methods
to call it.

* [mono] Pass an mrgctx to static/valuetype gshared methods.

Previously, these methods were passed a vtable. Passing the mrgctx
instead simplifies some runtime code and allows smaller/faster access to
rgctx entries.

* Add rgctx trampolines in get_ftnptr_for_method ().

* [mono][wasm] Avoid AOTing Microsoft.CodeAnalysis.dll as well.

2 years agoUpdate EventSourceLogger.cs (#67065)
Maksym Koshovyi [Wed, 23 Mar 2022 22:07:07 +0000 (00:07 +0200)]
Update EventSourceLogger.cs (#67065)

2 years agoRemove unnecessary XmlQualifiedName allocations from XsdBuilder.ProcessElement/Attrib...
Stephen Toub [Wed, 23 Mar 2022 22:02:11 +0000 (18:02 -0400)]
Remove unnecessary XmlQualifiedName allocations from XsdBuilder.ProcessElement/Attribute (#67045)

2 years agoAvoid bool[] allocation in MemberInfoCache.PopulateProperties (#66912)
Stephen Toub [Wed, 23 Mar 2022 22:01:33 +0000 (18:01 -0400)]
Avoid bool[] allocation in MemberInfoCache.PopulateProperties (#66912)

2 years ago[Group 4] Enable nullable annotations for `Microsoft.Extensions.Logging.EventSource...
Maksym Koshovyi [Wed, 23 Mar 2022 21:02:09 +0000 (23:02 +0200)]
[Group 4] Enable nullable annotations for `Microsoft.Extensions.Logging.EventSource` (#66802)

* Annotate src

* Annotate ref

* Make internal parameters non-nullable if they never receive null

2 years agoRemove libunwind disabled warnings. (#67042)
Aaron Robinson [Wed, 23 Mar 2022 20:51:27 +0000 (16:51 -0400)]
Remove libunwind disabled warnings. (#67042)

2 years ago[resubmit] BigInteger parsing optimization for large decimal string (#55121)
keymoon [Wed, 23 Mar 2022 20:36:27 +0000 (05:36 +0900)]
[resubmit] BigInteger parsing optimization for large decimal string (#55121)

* implement divide-and-conquer method for parsing digits

* fix argument order in Assert when x equals to 0

* Apply format fix

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* add test for non-naive algorithm

* add description for naiveThreshold

* fix trivial part

* add check for boundary condition

* add assertions and descriptions

* change variable name

* remove inappropreate use of var

* to use ArrayPool<int>.Shared.Rent for newBuffer allocation

* move both algorithms to separate methods

* add and fix comments

* trivial fix

Co-authored-by: Stephen Toub <stoub@microsoft.com>
2 years agoEnsure that fgMorphFieldToSimdGetElement doesn't call gtNewSimdGetElementNode if...
Tanner Gooding [Wed, 23 Mar 2022 20:35:33 +0000 (13:35 -0700)]
Ensure that fgMorphFieldToSimdGetElement doesn't call gtNewSimdGetElementNode if the ISA is unsupported (#66853)

* Ensure that fgMorphFieldToSimdGetElement doesn't call gtNewSimdGetElementNode if the ISA is unsupported

* Ensure fgMorphFieldToSimdGetElement is correctly checking for AdvSimd support on Arm64

* Ensure impExpandHalfConstEqualsSIMD checks for baseline simd support

2 years agoImprove nullable annotations for `ILogger.BeginScope` (#66960)
Maksym Koshovyi [Wed, 23 Mar 2022 18:35:24 +0000 (20:35 +0200)]
Improve nullable annotations for `ILogger.BeginScope` (#66960)

* BeginScope can return a null IDisposable. And TState is not nullable.

2 years agoGive end-marker symbols their own addresses to work around a linker bug (#66999)
Jakob Botsch Nielsen [Wed, 23 Mar 2022 17:13:00 +0000 (18:13 +0100)]
Give end-marker symbols their own addresses to work around a linker bug (#66999)

It seems there is a linker bug related to control-flow guard that is
causing #66969. In eb8460f a thunktemplates.asm file was added that has
a LEAF_END_MARKED at the end of the file. This creates two symbols for
the same upcoming address. Normally that should be fine, but in this
case it causes the linker to place the same address twice in a CFG table
in the PE file. This causes the kernel to fail while loading the image.

A simple workaround would be to add a nop at the end of
thunktemplates.asm, but @janvorli suggested giving these symbols their
own address in all cases for goodness when debugging. We already do so
for Windows x64 it looks like.

Fix #66969

2 years agoImproves handling of env prefixes containing __ (#65757)
David Edey [Wed, 23 Mar 2022 16:38:15 +0000 (16:38 +0000)]
Improves handling of env prefixes containing __ (#65757)

Both the un-altered and colon-normalized prefixes now match
environment variables in either the __ or colon formats.

The change includes minor refactors to
the EnvironmentVariablesConfigurationProvider
to make the code easier to follow and reduce the likelihood
of future regressions.

Test naming has been made clearer, and a comprehensive test
has been added.

Fix #65756

2 years agoAdd Fedora 37 RID (#67021)
Omair Majid [Wed, 23 Mar 2022 16:33:41 +0000 (12:33 -0400)]
Add Fedora 37 RID (#67021)

Fedora 37 has now started development, and the distribution now
identifies itself as Fedora 37 instead of Fedora 36:
https://fedorapeople.org/groups/schedule/f-37/f-37-key-tasks.html

This is a forward-port of https://github.com/dotnet/runtime/pull/65392

2 years agoAdd the CustomTypeMarshallerAttribute type to make it easier to identify marshaller...
Jeremy Koritzinsky [Wed, 23 Mar 2022 16:06:32 +0000 (09:06 -0700)]
Add the CustomTypeMarshallerAttribute type to make it easier to identify marshaller types (#65591)

2 years agoChange CoreCLR diagnostic resource production to remove cross-component build depende...
Jeremy Koritzinsky [Wed, 23 Mar 2022 16:05:54 +0000 (09:05 -0700)]
Change CoreCLR diagnostic resource production to remove cross-component build dependency (#67018)

2 years agoWorkaround NuGet error in Content_Types (#66744)
Eric StJohn [Wed, 23 Mar 2022 15:13:36 +0000 (08:13 -0700)]
Workaround NuGet error in Content_Types (#66744)

2 years agoDelete System.Runtime.Experimental leftovers (#66819)
Viktor Hofer [Wed, 23 Mar 2022 15:12:34 +0000 (16:12 +0100)]
Delete System.Runtime.Experimental leftovers (#66819)

* Delete System.Runtime.Experimental leftovers

e34e8dd85e7ffaaad8c884de0967cb8d845af5c6 merged the API surface of System.Runtime.Experimental inbox and deleted the project and the package. Hence we should delete leftovers that reference it.

* Update System.Runtime.csproj

2 years agoRemove delegate/closure allocations from DynamicAssemblies.IsTypeDynamic (#66797)
Stephen Toub [Wed, 23 Mar 2022 15:03:21 +0000 (11:03 -0400)]
Remove delegate/closure allocations from DynamicAssemblies.IsTypeDynamic (#66797)

2 years ago[mono][interp] Enable some tests (#66947)
Vlad Brezae [Wed, 23 Mar 2022 14:46:56 +0000 (16:46 +0200)]
[mono][interp] Enable some tests (#66947)

* [mono][interp] Enable all IL_Conformance tests

* [mono][interp] Enable tests

* [mono][interp] Enable test

* [tests] Fix ckfinite test

According to spec, ckfinite can throw ArithmeticException. CoreCLR throws OverflowException while mono throws ArithmeticException. Change test to catch all ArithmeticExceptions.