platform/upstream/dotnet/runtime.git
15 months ago[interp] Add float32 Vector128.Equals (#86738)
Katelyn Gadd [Thu, 25 May 2023 04:37:39 +0000 (21:37 -0700)]
[interp] Add float32 Vector128.Equals (#86738)

15 months agoAdd Microsoft.Extensions.Diagnostics.* to Aspnet Transport package (#86725)
William Godbe [Thu, 25 May 2023 02:16:53 +0000 (19:16 -0700)]
Add Microsoft.Extensions.Diagnostics.* to Aspnet Transport package (#86725)

15 months agoUse globalization invariant mode + prefer speed for AOT compilers (#86691)
Michal Strehovský [Thu, 25 May 2023 02:07:04 +0000 (11:07 +0900)]
Use globalization invariant mode + prefer speed for AOT compilers (#86691)

15 months agoOnly build specific tracing tests for NativeAOT leg (#86697)
Elinor Fung [Wed, 24 May 2023 23:17:37 +0000 (01:17 +0200)]
Only build specific tracing tests for NativeAOT leg (#86697)

15 months ago[wasm] Exports cleanup (#86718)
Radek Doulik [Wed, 24 May 2023 21:05:45 +0000 (23:05 +0200)]
[wasm] Exports cleanup (#86718)

Remove sections for old emscripten builds

15 months agoImplement byval-out marshalling for unmanaged->managed (#86666)
Jeremy Koritzinsky [Wed, 24 May 2023 20:43:37 +0000 (13:43 -0700)]
Implement byval-out marshalling for unmanaged->managed (#86666)

15 months agoFix timeouts in resourcemanager test (#86680)
madelson [Wed, 24 May 2023 20:38:16 +0000 (16:38 -0400)]
Fix timeouts in resourcemanager test (#86680)

* Update BinaryResourceWriterUnitTest.cs

Apply suggestion from https://github.com/dotnet/runtime/issues/86013#issuecomment-1560231543

Co-authored-by: Buyaa Namnan <buyankhishig.namnan@microsoft.com>
15 months agoUse the BannedApiAnalyzer instead of the LinqPoison mechanism to ban Linq in the...
Jeremy Koritzinsky [Wed, 24 May 2023 20:02:50 +0000 (13:02 -0700)]
Use the BannedApiAnalyzer instead of the LinqPoison mechanism to ban Linq in the managed type system (#86673)

15 months agoAvoid unnecessary closure in ServiceProviderEngineScope.CaptureDisposable (#86683)
Stephen Toub [Wed, 24 May 2023 18:07:01 +0000 (14:07 -0400)]
Avoid unnecessary closure in ServiceProviderEngineScope.CaptureDisposable (#86683)

Every call to this method is allocating a closure object, in order to capture `service`, even though it's only needed for a rare case.

15 months ago[ComInterfaceGenerator] Warn if StringMarshalling doesn't match base and warn if...
Jackson Schuster [Wed, 24 May 2023 17:44:05 +0000 (10:44 -0700)]
[ComInterfaceGenerator] Warn if StringMarshalling doesn't match base and warn if base interface cannot be generated (#86467)

15 months agoDelete native AOT interop doc (#86704)
Jan Kotas [Wed, 24 May 2023 17:37:53 +0000 (10:37 -0700)]
Delete native AOT interop doc (#86704)

This document lives at
https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/interop
now.

15 months agoAdd comments in asm for R_AI (#86677)
Egor Bogatov [Wed, 24 May 2023 16:49:50 +0000 (18:49 +0200)]
Add comments in asm for R_AI (#86677)

15 months agoReduce allocation in Activity.{Parent}Id (#86685)
Stephen Toub [Wed, 24 May 2023 16:36:58 +0000 (12:36 -0400)]
Reduce allocation in Activity.{Parent}Id (#86685)

15 months agoUnify Roslyn testing SDK version across the repo (#86669)
Jeremy Koritzinsky [Wed, 24 May 2023 16:30:29 +0000 (09:30 -0700)]
Unify Roslyn testing SDK version across the repo (#86669)

15 months ago[mono][aot] Deduplicate runtime invoke wrappers on iOS (#85908)
Milos Kotlar [Wed, 24 May 2023 15:55:07 +0000 (17:55 +0200)]
[mono][aot] Deduplicate runtime invoke wrappers on iOS (#85908)

* Deduplicate runtime invoke wrappers on iOS

* Move log to the add_extra_method_full

15 months ago[ppc64le] Added float32 support and implemented all R4 opcodes (#86092)
Alhad Deshpande [Wed, 24 May 2023 15:15:10 +0000 (20:45 +0530)]
[ppc64le] Added float32 support and implemented all R4 opcodes (#86092)

* [ppc64le] Fixed thunk address 8 byte alignment issue

* Fixed FSharp crash issue

* [ppc64le] Implementation of mono_arch_get_delegate_virtual_invoke_impl method for ppc64le architecture

* Fixed clang15 build issues and returning address of sc_sp instead of value

* Added float32 support and implemented related opcodes

* Correction in OP_RCONV_TO_R cases

* Corrected code for few opcodes

15 months agoUse an mrgctx for all gshared methods on iOS (#86583)
Milos Kotlar [Wed, 24 May 2023 14:51:57 +0000 (16:51 +0200)]
Use an mrgctx for all gshared methods on iOS (#86583)

15 months agoFix MakeGenericType/Method argument validation for function pointers (#86686)
Jan Kotas [Wed, 24 May 2023 12:17:56 +0000 (05:17 -0700)]
Fix MakeGenericType/Method argument validation for function pointers (#86686)

Fixes #86628

15 months ago[OSX] HybridGlobalization implement compare native function (#85965)
Meri Khamoyan [Wed, 24 May 2023 11:08:56 +0000 (15:08 +0400)]
[OSX] HybridGlobalization implement compare native function (#85965)

Implemented CompareStringNative for OSX platforms
Added changes done by @ilonatommy in #86305

15 months agoDelete `GT_ASG` (#85871)
SingleAccretion [Wed, 24 May 2023 10:51:33 +0000 (13:51 +0300)]
Delete `GT_ASG` (#85871)

* Physical promotion

* Early liveness

* Local morph

* Add internal blocks

* Object allocator

* Inlining

* Indirect call transformer

* Patchpoint transformation

* Instrumentation

* Importer: production

* Importer: consumption

* Delete assignment rationalization

* Simple dead code removal

* More code removal

* Fix up some comments and variable names

* Fix stress

* Simplify BasicBlock::FirstNonPhiDef

* Duplicate a comment

* Remove dead code

* Fix naming and comments

15 months agoJIT: Follow related intervals for single-reg LIR temp intervals (#86632)
Jakob Botsch Nielsen [Wed, 24 May 2023 09:31:26 +0000 (11:31 +0200)]
JIT: Follow related intervals for single-reg LIR temp intervals (#86632)

15 months agoFix a bug in type hierarchy marking in the trimmer (#86635)
Vitek Karas [Wed, 24 May 2023 08:20:22 +0000 (01:20 -0700)]
Fix a bug in type hierarchy marking in the trimmer (#86635)

If the base class has DAM annotation on it, but the only access is through a variabled typed as the derived class, the marking of everything on the base class happens during the processing of the derived class.

The bug was that it would only apply marking for the difference in effective annotations between derived and base, so if the annotation is on base, then both have effectively the same annotation and there would be no additional marking on base. So for example private methods would not be marked.

This also affected warnings on virtual methods - see tests for more details.

15 months ago[mono][wasm] Fix support for virtual invokes. (#86687)
Zoltan Varga [Wed, 24 May 2023 08:20:03 +0000 (04:20 -0400)]
[mono][wasm] Fix support for virtual invokes. (#86687)

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

15 months agoadd nuget.projectmodel to version.details (#86650)
Oleksandr Didyk [Wed, 24 May 2023 08:16:28 +0000 (10:16 +0200)]
add nuget.projectmodel to version.details (#86650)

15 months ago[browser][non-icu] `HybridGlobalization` normalization. (#85510)
Ilona Tomkowicz [Wed, 24 May 2023 07:12:11 +0000 (09:12 +0200)]
[browser][non-icu] `HybridGlobalization` normalization. (#85510)

* Normalization.

* Missing measurement.

* Trying to fix trimming error.

* Applied @pavelsavara's idea.

* Code review improvement.

* Feedback: standardize the exceptions.

* Revert changes from #85516 to clean the CI.

* feedback

15 months ago[main] Update dependencies from dotnet/runtime dotnet/xharness dotnet/hotreload-utils...
dotnet-maestro[bot] [Tue, 23 May 2023 20:43:31 +0000 (15:43 -0500)]
[main] Update dependencies from dotnet/runtime dotnet/xharness dotnet/hotreload-utils (#86582)

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

Microsoft.NET.ILLink.Tasks , Microsoft.NET.Sdk.IL , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.ILAsm , runtime.native.System.IO.Ports , System.Text.Json
 From Version 8.0.0-preview.5.23265.1 -> To Version 8.0.0-preview.5.23272.1

* Update dependencies from https://github.com/dotnet/xharness build 20230522.1

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 8.0.0-prerelease.23259.1 -> To Version 8.0.0-prerelease.23272.1

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

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 8.0.0-alpha.0.23265.2 -> To Version 8.0.0-alpha.0.23272.2

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
15 months agoMetrics APIs Additions (#86567)
Tarek Mahmoud Sayed [Tue, 23 May 2023 19:44:37 +0000 (12:44 -0700)]
Metrics APIs Additions (#86567)

15 months agoRemove STJ dependency on IncrementalValuesProvider.Collect() (#86616)
Eirik Tsarpalis [Tue, 23 May 2023 19:38:17 +0000 (20:38 +0100)]
Remove STJ dependency on IncrementalValuesProvider.Collect() (#86616)

* Remove dependency on IncrementalValuesProvider.Collect()

* Address feedback.

15 months agoRemove ProjectCapability=DotNetCoreWeb from WasiApp (#86639)
Marek Fišera [Tue, 23 May 2023 18:56:04 +0000 (20:56 +0200)]
Remove ProjectCapability=DotNetCoreWeb from WasiApp (#86639)

15 months agoAlways use simple while loop when simd is not supported (#85267)
Daniel Svensson [Tue, 23 May 2023 18:51:54 +0000 (20:51 +0200)]
Always use simple while loop when simd is not supported (#85267)

15 months agoDogfood ComInterfaceGenerator in crossgen2 (#84643)
Jackson Schuster [Tue, 23 May 2023 18:32:36 +0000 (11:32 -0700)]
Dogfood ComInterfaceGenerator in crossgen2 (#84643)

15 months agoOnly call Free in unmanaged->managed stubs when ownership has been transfered to...
Jeremy Koritzinsky [Tue, 23 May 2023 18:13:26 +0000 (11:13 -0700)]
Only call Free in unmanaged->managed stubs when ownership has been transfered to the callee (#86415)

15 months agoFix possible stack overflow in TotalOrderIeee754Comparer (#86593)
Kevin Jones [Tue, 23 May 2023 17:07:17 +0000 (13:07 -0400)]
Fix possible stack overflow in TotalOrderIeee754Comparer (#86593)

* Fix possible stack overflow in TotalOrderIeee754Comparer

* Add a test

15 months agoUpdate dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimizati...
dotnet-maestro[bot] [Tue, 23 May 2023 17:06:23 +0000 (13:06 -0400)]
Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20230522.4 (#86637)

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

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
15 months agoImprove Microsoft.Extensions.Configuration debugging (#86624)
James Newton-King [Tue, 23 May 2023 17:06:00 +0000 (01:06 +0800)]
Improve Microsoft.Extensions.Configuration debugging (#86624)

* Improve Microsoft.Extensions.Configuration debugging

* Clean up

* Clean up

* Clean up + tests

15 months agoJIT: Use unsigned native return types for small structs (#86631)
Jakob Botsch Nielsen [Tue, 23 May 2023 16:54:24 +0000 (18:54 +0200)]
JIT: Use unsigned native return types for small structs (#86631)

Prefer the return type to be unsigned when small structs are returned in
registers. This causes the backend to use zero extension instead of sign
extension in a few cases, which has a smaller encoding on xarch.

15 months agoFix assert failure in grow_heap_segment in no GC region. (#86644)
Peter Sollich [Tue, 23 May 2023 16:37:03 +0000 (18:37 +0200)]
Fix assert failure in grow_heap_segment in no GC region. (#86644)

This addresses issue #86612.

We won't actually decommit anything once we enter a no GC region, so the assert was overeager for this case, but it seems better to keep the assert and turn off the gradual_decommit_in_progress_p flag when we enter a no GC region.

15 months agoDynamic heap count (#86245)
Peter Sollich [Tue, 23 May 2023 15:43:41 +0000 (17:43 +0200)]
Dynamic heap count (#86245)

This is an initial implementation for changing the GC heap count dynamically in response to changing load conditions.

Using more heaps will increase memory footprint, but in most cases also improve throughput because more GC work is parallelized, and lock contention on the allocation code path is reduced by spreading the load.

We try to keep the measured overhead from lock contention and GC pauses at 5% or below, and only reduce the heap count if the measured overhead is below 1% and we estimate a significant reduction in memory footprint. There is some more fine tuning for the cases where smaller reductions in either footprint or overhead are possible without impacting the other side of the equation too much.

Because the input data for GC pause etc. are quite noisy, we use a median of 3 filter before the data is used to make decisions. Preliminary data suggests this is effective, but we may need to do more filtering if gains in either direction appear to be small.

15 months ago[mono][interp] Attempt to devirtualize call if we have type information about `this...
Vlad Brezae [Tue, 23 May 2023 15:31:31 +0000 (18:31 +0300)]
[mono][interp] Attempt to devirtualize call if we have type information about `this` (#85528)

* [mono][interp] Preserve klass information when generating MINT_CKNULL

This information will be useful to later devirtualize the call

* [mono][interp] Add more specific type information for EqualityComparer.Default

* [mono][interp] Devirtualize calls if we can find a final implementation

Remove asserts from mono_class_get_virtual_method so we can check a virtual method on any klass, returning NULL if no implementation is found.

* [mono][interp] Optimize out null check on ldloca

* [mono][interp] Constant fold unop conditionals applied to non null values

* [mono][interp] Optimize out unused MINT_BOX

* [mono] Remove duplicated code between interp and jit

* [mono][metadata] Allow method to be called for abstract classes

It will just return null if a concrete implementation wasn't found.

* [mono][interp] Don't populate wrong type information into the stack state

* [mono][interp] Don't devirtualize final methods

They can still be overriden

* [mono][interp] Ensure class is initialized before getting aot method

15 months agoFix Incorrect RequiresDynamicCode attribute message (#86602)
Rupesh Ghosh [Tue, 23 May 2023 13:41:12 +0000 (19:11 +0530)]
Fix Incorrect RequiresDynamicCode attribute message (#86602)

* Fix Incorrect RequiresDynamicCode attribute message

Replace GetEnumValues<TEnum> in the RequiresDynamicCode attribute message on System.Type.GetEnumValues, System.Reflection.SignatureType.GetEnumValues and System.Runtime.GetEnumValues with Enum.GetValues<T> with Enum.GetValues<T>

Fix #86585

* Update attribute message as suggested in PR

* Add warning suppression

15 months ago[mono][AOT] Enabled tests which fail to JIT compile during AOT (#86581)
Vlad-Alexandru Ionescu [Tue, 23 May 2023 11:11:48 +0000 (13:11 +0200)]
[mono][AOT] Enabled tests which fail to JIT compile during AOT (#86581)

* Enabled 2 tests

Signed-off-by: Vlad - Alexandru Ionescu <vlad-alexandruionescu@Vlads-MacBook-Pro-5.local>
---------

Signed-off-by: Vlad - Alexandru Ionescu <vlad-alexandruionescu@Vlads-MacBook-Pro-5.local>
Co-authored-by: Vlad - Alexandru Ionescu <vlad-alexandruionescu@Vlads-MacBook-Pro-5.local>
15 months ago[browser] Turn webcil off for .NET < 8.0 (#86505)
Marek Fišera [Tue, 23 May 2023 08:54:46 +0000 (10:54 +0200)]
[browser] Turn webcil off for .NET < 8.0 (#86505)

15 months agoUnreachable filter end (#86492)
Vitek Karas [Tue, 23 May 2023 07:53:01 +0000 (00:53 -0700)]
Unreachable filter end (#86492)

Fixes the problem described in https://github.com/dotnet/roslyn/issues/67494 for illink.

`endfilter` instruction must be kept if the filter block is kept, even if the instruction itself is unreachable - per the ECMA spec. Fix the branch removal code to preserve the instruction unconditionally.

Adds a test to validate the new behavior.

I also enabled the test to run on NativeAOT, since it has code to handle this as well. We only validate that the compiler will not crash/warn, the Kept validation is disabled, since we can't really inspect IL of the produced methods in AOT.

Also fixes a bug in the illink test infra where the `By` property on `SkipKeptItemsValidationAttribute` was ignored.

15 months agoFix endless loop in illink analyzer (#86449)
Vitek Karas [Tue, 23 May 2023 07:50:10 +0000 (00:50 -0700)]
Fix endless loop in illink analyzer (#86449)

The root cause is the fact that `ArrayValue` is mutable, so it needs to be `DeepCopy` everywhere. So the first set of fixes is to make sure that even hoisted locals are correctly copied.
The second problem is that we use `HashSet` to store multiple values in `ValueSet`/`MultiValue`. HashSet assumes that items don't change identity (equality group) while they're stored inside. But `ArrayValue` does exactly that. So we can't rely on pure `HashSet` functionality to implement `Equals`.

Changes:
* Make Maybe<T> an IDeepCopyValue and make sure it deep copies its value - because it can store values which require a deep copy
* Make ValueSet<T> an IDeepCopyValue since it can store values which require a deep copy (this causes an effective rename of MultiValue.Clone to MultiValue.DeepCopy - lot of files touched)
* Modify ValueSet<T> to be careful when comparing for equality - we can't rely on immutability of values and since we store them in a hashset, the hashset itself effectively breaks. Maybe we should consider switching to a simple List? But then we want to to unify same values.
* Modify array equality comparison - previously it caused an allocation of a `HashSet` - we compare values quite a bit (in analyzer during multi-pass analysis). Currently we rely on values in arrays to be immutable.

Future looking:
The data flow analysis simply doesn't have a solution for mutable values (mostly mutable refence types, but I think similar set of problems might occur with structs as well). ILLink implements by-ref values, which are probably the closest approximation yet, but the full CFG data flow doesn't support those yet. And ultimately it's probably more complex then just by-ref values.
Proper fix is complex, and requires some design work first.

Note that we will want to backport this to .NET 7 very likely - I haven't looked yet how well it will port.

15 months agoAllow overbudget for small methods (#86473)
Egor Bogatov [Tue, 23 May 2023 07:21:59 +0000 (09:21 +0200)]
Allow overbudget for small methods (#86473)

Co-authored-by: Andy Ayers <andya@microsoft.com>
15 months agoAdd note about transient pointers to ECMA augments (#86622)
Jan Kotas [Tue, 23 May 2023 05:04:38 +0000 (22:04 -0700)]
Add note about transient pointers to ECMA augments (#86622)

Fixes #62784

15 months agoAbstract out System.Reflection.Emit.ILGenerator (#86594)
Buyaa Namnan [Tue, 23 May 2023 02:36:40 +0000 (19:36 -0700)]
Abstract out System.Reflection.Emit.ILGenerator (#86594)

* Abstract out ILGenerator

* Finish up abstracting

* Remove protected abstract methods, use more public abstract instead

* Use RuntimeILGenerator for Linq test

15 months agoUpdate GetElement and ToScalar to lower IND, LCL_FLD, and LCL_VAR specially (#86400)
Tanner Gooding [Tue, 23 May 2023 01:53:29 +0000 (18:53 -0700)]
Update GetElement and ToScalar to lower IND, LCL_FLD, and LCL_VAR specially (#86400)

* Update GetElement and ToScalar to lower IND, LCL_FLD, and LCL_VAR specially

* Ensure GetElement still correctly handles too large indices

* Only optimize to LCL_FLD for lvDoNotEnregister

* Account for an extreme edge case in offset overflow

* Use simdSize rather than maxSIMDStructBytes

15 months ago[wasm] No longer discard jiterp inference information when crossing a branch (#86611)
Katelyn Gadd [Tue, 23 May 2023 01:52:18 +0000 (18:52 -0700)]
[wasm] No longer discard jiterp inference information when crossing a branch (#86611)

* Discarding inferred state when crossing a branch is not strictly necessary and reduces performance
* Don't allow treating ldloca'd addresses as constant

15 months agoAdd a test for the first chance exception event (#86560)
SingleAccretion [Mon, 22 May 2023 23:33:11 +0000 (02:33 +0300)]
Add a test for the first chance exception event (#86560)

15 months agoRename setting for using RID graph to System.Runtime.Loader.UseRidGraph (#86598)
Elinor Fung [Mon, 22 May 2023 22:29:48 +0000 (00:29 +0200)]
Rename setting for using RID graph to System.Runtime.Loader.UseRidGraph (#86598)

15 months agoEnsure Avx512Vbmi has [Intrinsic] on the right members (#86604)
Tanner Gooding [Mon, 22 May 2023 22:25:03 +0000 (15:25 -0700)]
Ensure Avx512Vbmi has [Intrinsic] on the right members (#86604)

* Ensure Avx512Vbmi has [Intrinsic] on the right members

* Ensure vpermb is covered

15 months agoJIT: Switch basic block successors to a visitor pattern (#86543)
Jakob Botsch Nielsen [Mon, 22 May 2023 22:00:37 +0000 (00:00 +0200)]
JIT: Switch basic block successors to a visitor pattern (#86543)

BasicBlock::GetAllSuccs seems to be very slow.

15 months agoSwitch physical promotion stress modes to only be enabled in checked builds (#86590)
Jakob Botsch Nielsen [Mon, 22 May 2023 21:53:06 +0000 (23:53 +0200)]
Switch physical promotion stress modes to only be enabled in checked builds (#86590)

Otherwise we may be running old preview 4 bits with physical promotion
enabled and running into issues that were already fixed.

Fix #86588

15 months agoAvoid capturing diagnostic objects in Regex source generator incremental values ...
Stephen Toub [Mon, 22 May 2023 21:44:38 +0000 (17:44 -0400)]
Avoid capturing diagnostic objects in Regex source generator incremental values (#86606)

It's mostly a non-issue given how we use it, but Diagnostic's message arguments are compared with reference equality rather than value equality.  Store the data into our own object instead, and only create the actual Diagnostic objects when we're about to report them.

15 months agoAvoid capturing diagnostic objects in SG incremental values. (#86605)
Eirik Tsarpalis [Mon, 22 May 2023 21:39:42 +0000 (22:39 +0100)]
Avoid capturing diagnostic objects in SG incremental values. (#86605)

15 months ago[main] Update dependencies from dnceng/internal/dotnet-optimization (#86436)
dotnet-maestro[bot] [Mon, 22 May 2023 21:02:11 +0000 (14:02 -0700)]
[main] Update dependencies from dnceng/internal/dotnet-optimization (#86436)

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

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

Dependency coherency updates

Microsoft.SourceLink.GitHub,Microsoft.DotNet.XliffTasks
 From Version 8.0.0-beta.23252.2 -> To Version 8.0.0-beta.23218.3 (parent: Microsoft.DotNet.Arcade.Sdk

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

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

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

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

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

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

* Require clang-16 for PGO optimization

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

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

* Revert sourcelink and xliff-tasks downgrades

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
Co-authored-by: Sven Boemer <sbomer@gmail.com>
15 months agoAvoid ToString allocations for each ISpanFormattable value in string.Concat/Join...
Stephen Toub [Mon, 22 May 2023 19:51:08 +0000 (15:51 -0400)]
Avoid ToString allocations for each ISpanFormattable value in string.Concat/Join(..., IEnumerable<T>) (#86521)

We can use a T's ISpanFormattable implementation to avoid the individual ToStrings. We also don't need to maintain a separate implementation for Concat; at the cost of one branch per value, we can just reuse the Join implementation and pick up all of its optimizations for Concat.

15 months agoVectorize IEnumerable<T>.Sum where possible (#84519)
Brant Burnett [Mon, 22 May 2023 19:37:52 +0000 (15:37 -0400)]
Vectorize IEnumerable<T>.Sum where possible (#84519)

* Vectorize IEnumerable<T>.Sum where possible

* Remove unnecessary CreateChecked and fix long test

* Add more assertions

* Improve comments, don't use Unsafe.Add, use T.MinValue

15 months agoApply the SourceWriter pattern to the STJ source generator. (#86526)
Eirik Tsarpalis [Mon, 22 May 2023 17:30:34 +0000 (18:30 +0100)]
Apply the SourceWriter pattern to the STJ source generator. (#86526)

* Use the SourceWriter pattern in the STJ SG emitter.

* Make helper method static.

* Minimize the size of the generic helper method.

15 months ago[LoongArch64] Fix some bugs in the test sets 'System.Runtime.Tests' and 'System.Linq...
Xu Liangyu [Mon, 22 May 2023 17:17:31 +0000 (01:17 +0800)]
[LoongArch64] Fix some bugs in the test sets 'System.Runtime.Tests' and 'System.Linq.Expressions.Tests' for loongarch64. (#86435)

* Fix the error of the Truncate/Saturate convert from Float/Double NAN to UINT32/UINT64.
* fix some random failed testcases in System.Runtime.Tests.

* Update codegenloongarch64.cpp

Fix the RangeCheck bug of the TYP_INT case in CodeGen::genRangeCheck().

15 months agoRename a couple model specs for config binding generator (#86459)
Layomi Akinrinade [Mon, 22 May 2023 16:38:43 +0000 (09:38 -0700)]
Rename a couple model specs for config binding generator (#86459)

15 months agoUpdate createdumpwindows to not appear to succeed after getting ERROR_PARTIAL_COPY...
Andrew Moskevitz [Mon, 22 May 2023 16:09:07 +0000 (12:09 -0400)]
Update createdumpwindows to not appear to succeed after getting ERROR_PARTIAL_COPY 5 times (#85462)

* Update createdumpwindows.cpp

create dump has same bug as documented and fixed in dotnet-dump (https://github.com/dotnet/diagnostics/issues/3829)

* Update createdumpwindows.cpp

changed retry count to 10 to match dotnet-dump

15 months ago[mono] When creating an array type, don't do full initialization of the element type...
Aleksey Kliger (λgeek) [Mon, 22 May 2023 15:21:21 +0000 (11:21 -0400)]
[mono] When creating an array type, don't do full initialization of the element type (#85828)

Consider code like this:

```csharp
public class Node<T>
{
    public Node<T>[][] Children;
}

Console.WriteLine (typeof(Node<int>));
```

In this case, when we're JITing ``ldtoken class Node`1<int32>`` we first have to parse the type ``Node`1<int32>`` and initialize it.
When we're initializing it, we need to resolve the types of all the fields in the class in order to to figure out if its instance size.

To resolve the field types we have to parse the types of all the fields, and we eventually end up parsing the type ``Node`1<!0>[][]`` which ends up here:

https://github.com/dotnet/runtime/blob/558345d16cf76525d0c7fdbafbfd3a2457142b39/src/mono/mono/metadata/metadata.c#L4023-L4027

When we get to line 4027 the second time (recursively), `etype` is ``Node`1<!0>`` as a `MonoType*`.  And we want to set `type->data.klass` to its corresponding `MonoClass*`.   That ends up calling `mono_class_from_mono_type_internal`, which does this:

https://github.com/dotnet/runtime/blob/558345d16cf76525d0c7fdbafbfd3a2457142b39/src/mono/mono/metadata/class.c#L2214-L2215

When we call `mono_class_create_array` we end up here:

https://github.com/dotnet/runtime/blob/558345d16cf76525d0c7fdbafbfd3a2457142b39/src/mono/mono/metadata/class-init.c#L1186-L1187

with `eclass` equal to ``Node`1<!0>` which we try to initialize and we get a TLE because we're going to try to initialize the same generic type definition ``Node`1`` twice.

Compare with this other class:

```csharp
public unsafe class Node2<T>
{
    public Node2<T>[] Children;
}
```

In this case we only end up calling `mono_class_from_mono_type_internal` on ``Node2`1<int32>`` (not an array).  And that branch does not do any initialization - it just returns `type->data.klass` (for ``Node2`1<!0>`` - which is seen as a gtd at this point) or `mono_class_create_generic_inst (type->data.generic_class)` (for ``Node2`1<int32>`` which is seen later when `ldtoken` inflates the gtd)) - without any extra initialization.

---

It seems the reason we get into trouble is because `mono_class_create_array` does more work than other `MonoClass` creation functions - it tries to initialize the `MonoClass` a little bit (for example by setting `MonoClass:has_references`) which needs at least a little bit of the element class to be initialized.

But note that the code has this:

https://github.com/dotnet/runtime/blob/558345d16cf76525d0c7fdbafbfd3a2457142b39/src/mono/mono/metadata/class-init.c#L1186-L1189

I feel fairly certain we don't need the full class initialization if we're going to immediately initialize the field size information.

Fixes #85821

15 months agoVectorize shorter buffers for CRC-32 on Intel (#86539)
Brant Burnett [Mon, 22 May 2023 14:58:56 +0000 (10:58 -0400)]
Vectorize shorter buffers for CRC-32 on Intel (#86539)

15 months agodisable JitOptimizationSensitive check on NativeAOT testing (#86523)
Lakshan Fernando [Mon, 22 May 2023 14:45:13 +0000 (07:45 -0700)]
disable JitOptimizationSensitive check on NativeAOT testing (#86523)

15 months agoLots of tweaks to FrozenDictionary/Set analysis and hashing (#86293)
Stephen Toub [Mon, 22 May 2023 14:34:54 +0000 (10:34 -0400)]
Lots of tweaks to FrozenDictionary/Set analysis and hashing (#86293)

- Some minor internal refactorings, e.g. changed the internal KeyAnalyzer.Analyze from being void returning with an out results to instead just return those results, and did some internal renaming.
- We were previously computing the min/max string length in KeyAnalyzer.Analyze twice, once in UseSubstring and then again after that in Analyze.  We were also computing it in the length buckets analyzer.  Changed the code to do the checks just once at the beginning and then pass that information around to everywhere that needs it.
- Once that information is passed in, AnalysisResults can then be made readonly, rather than being mutated to store the min/max after it was constructed.
- If the min length is 0, there's no point calling TryUseSubstring as it'll never find one, so skip the call to it entirely if there's an empty string in the mix.
- In TryUseSubstring, for a given substring length first check all the left justifications and then check all the right justifications, rather than intermingling them.  Left justifications are a bit cheaper to look up, plus we can avoid creating any objects related to checking right justification if we end up finding a left justification for a given substring length first.
- We can also avoid doing any right justification checks if all of the input strings are of the same length, as at that point there's nothing right justification could find that left justification couldn't.
- When constructing the HashSets for evaluating uniqueness, when targeting more recent .NET versions we can presize the HashSets to avoid the expansion as we add all the items.
- Importantly, set a limit on the maximum length of substring we'll consider.  This significantly curtails the worst-case analysis performance for very large inputs that don't yield any unique substrings.  While it's certainly possible to construct cases where this will then fail to find a substring when it otherwise could, it's much more rare, and the longer we're dealing with the less we're saving on the hashing costs, which is the only thing this is avoiding.
- For hashing, create dedicated branchless hash checks for each of lengths 0 to 4.
- When we're doing the ASCII check to see if we can use an ASCII-optimized comparer, if OrdinalIgnoreCase was used, we can also check to see if the substring contains any ASCII letters; if the only the thing the substrings contain are ASCII non-letters, then we can switch to being case-sensitive, as no casing will impact the comparisons.
- The ASCII check downlevel was erroneously including 0x7f as being non-ASCII. Fixed it to be 0x80 instead of 0x7f.
- Changed GetHashCodeOrdinalIgnoreCase to delegate to GetHashCodeOrdinal after doing its non-ASCII casing work.
- On .NET 6+, we can use GetValueRefOrAddDefault to avoid some dictionary lookups.
- For the length-bucketing implementation, we can do a quick up-front check to rule out applicability of many inputs where we know just based on the number of input strings and the min/max lengths whether some bucket will be forced to be too big.

15 months ago[main] Update dependencies from dotnet/roslyn-analyzers (#86384)
dotnet-maestro[bot] [Mon, 22 May 2023 14:32:36 +0000 (09:32 -0500)]
[main] Update dependencies from dotnet/roslyn-analyzers (#86384)

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

Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
 From Version 3.3.5-beta1.23262.2 -> To Version 3.3.5-beta1.23266.2

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

Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
 From Version 3.3.5-beta1.23262.2 -> To Version 3.3.5-beta1.23268.1

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

Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
 From Version 3.3.5-beta1.23262.2 -> To Version 3.3.5-beta1.23269.1

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

Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
 From Version 3.3.5-beta1.23262.2 -> To Version 3.3.5-beta1.23270.2

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
15 months ago[main] Update dependencies from dotnet/roslyn (#86497)
dotnet-maestro[bot] [Mon, 22 May 2023 14:31:46 +0000 (09:31 -0500)]
[main] Update dependencies from dotnet/roslyn (#86497)

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

Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
 From Version 4.7.0-1.23259.11 -> To Version 4.7.0-1.23268.11

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

Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
 From Version 4.7.0-1.23259.11 -> To Version 4.7.0-1.23269.2

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
15 months agoThis fixes an issue with gradual decommit in scenarios where we have … (#84975)
Peter Sollich [Mon, 22 May 2023 13:59:36 +0000 (15:59 +0200)]
This fixes an issue with gradual decommit in scenarios where we have … (#84975)

This fixes an issue with gradual decommit in scenarios where we have almost exclusively background GCs.

The problem is that we turn off the gradual_decommit_in_progress_p flag and rely on the distribute_free_regions flag to turn it back on. If we only trigger a BGC however, distribute_free_regions won't get called and the flag will stay off, despite the global_regions_to_decommit list being non-empty.

This will cause regions to accumulate in the global_regions_to_decommit list, and eventual will cause the process to run out of memory.

The fix is to just test for the no gc region case in decommit_step. This will also turn off the gradual_decommit_in_progress_p flag for the no gc region case, but not for background GCs.

15 months agoUse new queue for iOS arm64 device tests (#86575)
Alexander Köplinger [Mon, 22 May 2023 13:56:02 +0000 (15:56 +0200)]
Use new queue for iOS arm64 device tests (#86575)

15 months ago[mono][aot] Enabling AOT wrappers for virtual delegates (#85643)
Vlad-Alexandru Ionescu [Mon, 22 May 2023 10:35:01 +0000 (12:35 +0200)]
[mono][aot] Enabling AOT wrappers for virtual delegates (#85643)

* Adding AOT virtual delegates wrappers

Signed-off-by: Vlad - Alexandru Ionescu <vlad-alexandruionescu@Vlads-MacBook-Pro-5.local>
---------

Signed-off-by: Vlad - Alexandru Ionescu <vlad-alexandruionescu@Vlads-MacBook-Pro-5.local>
Co-authored-by: Vlad - Alexandru Ionescu <vlad-alexandruionescu@Vlads-MacBook-Pro-5.local>
15 months agoFix code coverage of corelib by updating coverlet (#86566)
Stephen Toub [Mon, 22 May 2023 10:19:30 +0000 (06:19 -0400)]
Fix code coverage of corelib by updating coverlet (#86566)

15 months ago[wasm] Refactor name convention (#86446)
Ilona Tomkowicz [Mon, 22 May 2023 10:17:59 +0000 (12:17 +0200)]
[wasm] Refactor name convention (#86446)

* Change case type restricted to threading files.

* Feedback - preserve consistent naming.

* Fix

* @pavelsavara's fix for samples on Windows (not connected with refactoring).

15 months ago[main] Update dependencies from 7 repositories (#85913)
dotnet-maestro[bot] [Mon, 22 May 2023 07:40:07 +0000 (09:40 +0200)]
[main] Update dependencies from 7 repositories (#85913)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Elinor Fung <elfung@microsoft.com>
15 months agoIncrease timeouts on perf-slow pipeline (because of current load on queues). (#86547)
Jiri Cincura ↹ [Mon, 22 May 2023 06:29:00 +0000 (08:29 +0200)]
Increase timeouts on perf-slow pipeline (because of current load on queues). (#86547)

15 months agoBaseline a couple more JIT tests (#86429)
Michal Strehovský [Mon, 22 May 2023 02:06:57 +0000 (11:06 +0900)]
Baseline a couple more JIT tests (#86429)

15 months agoAdd DebuggerDisplay for SearchValues (#86559)
Stephen Toub [Mon, 22 May 2023 01:55:04 +0000 (21:55 -0400)]
Add DebuggerDisplay for SearchValues (#86559)

15 months agoMake merged test wrappers single file friendly (#86428)
Michal Strehovský [Sun, 21 May 2023 23:53:52 +0000 (08:53 +0900)]
Make merged test wrappers single file friendly (#86428)

Assembly.Location returns an empty string in single file.

15 months agoUse VEX xorps to zero a zmm reg (#86555)
Egor Bogatov [Sun, 21 May 2023 20:41:51 +0000 (22:41 +0200)]
Use VEX xorps to zero a zmm reg (#86555)

Co-authored-by: Tanner Gooding <tagoo@outlook.com>
15 months agoRemove ZMM_RECOMMENDED_THRESHOLD workaround (#86552)
Egor Bogatov [Sun, 21 May 2023 16:09:07 +0000 (18:09 +0200)]
Remove ZMM_RECOMMENDED_THRESHOLD workaround (#86552)

15 months agoStop using LocalizationResources within framework (#86430)
Michal Strehovský [Sun, 21 May 2023 03:58:09 +0000 (12:58 +0900)]
Stop using LocalizationResources within framework (#86430)

Fixes #81459.

I moved the messages to `EventAttribute.Message` which I believe should be equivalent, but I would appreciate if someone could double-check.
I also removed all the now-unused resource strings. I believe they all need to be prefixed by one of well-known prefixes. I would appreciate if someone could double-check.

15 months agoNoGCRegion Callback (#82045)
Andrew Au [Sun, 21 May 2023 01:46:51 +0000 (18:46 -0700)]
NoGCRegion Callback (#82045)

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
15 months agoavoid GCHandle in ConnectEx and SendTo on Windows (#86524)
Tomas Weinfurt [Sat, 20 May 2023 21:58:12 +0000 (14:58 -0700)]
avoid GCHandle in ConnectEx and SendTo on Windows (#86524)

* avoid GCHandle in ConnectEx and SendTo on Windows

* s/Span/ReadOnlySpan/ndd

15 months agoPipeReader.CopyToAsync(Stream) should not perform zero-length writes (#85768)
Marc Gravell [Sat, 20 May 2023 21:36:24 +0000 (22:36 +0100)]
PipeReader.CopyToAsync(Stream) should not perform zero-length writes (#85768)

* add failing test for zero-length write

* simplify test

* apply fix

15 months agoAdd new status code (#85841)
hrrrrustic [Sat, 20 May 2023 21:35:42 +0000 (00:35 +0300)]
Add new status code (#85841)

15 months agoClean up GenTreeCall's inline info (#86540)
Egor Bogatov [Sat, 20 May 2023 19:49:01 +0000 (21:49 +0200)]
Clean up GenTreeCall's inline info (#86540)

15 months agofix(66229): Fix invalid processing of empty Dictionary node. (#86485)
Maksim Golev [Sat, 20 May 2023 17:51:37 +0000 (21:51 +0400)]
fix(66229): Fix invalid processing of empty Dictionary node. (#86485)

Co-authored-by: Maksim Golev <mgolev@htc-cs.ru>
15 months ago[LoongArch64] delete the rsGetRsvdReg() for LA64. (#86319)
Qiao Pengcheng [Sat, 20 May 2023 15:57:43 +0000 (23:57 +0800)]
[LoongArch64] delete the rsGetRsvdReg() for LA64. (#86319)

* [LoongArch64] delete the rsGetRsvdReg() for LA64.

* delete dead code for CR.

15 months ago[interp] Remove char element type support from transform-simd (#86534)
Katelyn Gadd [Sat, 20 May 2023 15:53:58 +0000 (08:53 -0700)]
[interp] Remove char element type support from transform-simd (#86534)

Remove char element type support from transform-simd
Also disable unusual types for packedsimd

15 months agoAllow using active host context in hostfxr_get_runtime_delegate (#86460)
Justin Anderson [Sat, 20 May 2023 07:45:57 +0000 (00:45 -0700)]
Allow using active host context in hostfxr_get_runtime_delegate (#86460)

These changes allow for passing `nullptr` for the handle parameter of the `hostfxr_get_runtime_delegate` function. This allows in-process callers who do not have the real host context handle to invoke this function and get a runtime delegate for the primary runtime instance. Calling hostfxr_get_runtime_delegate without the handle will only work if there is an active host context, otherwise it will return StatusCode::HostInvalidState.

15 months agoRemove references to P/Invokes and DllImport from resource strings. (#85178)
Jeremy Koritzinsky [Sat, 20 May 2023 06:43:26 +0000 (23:43 -0700)]
Remove references to P/Invokes and DllImport from resource strings. (#85178)

15 months agoMake the RefreshMemoryLimit API public (#85549)
Andrew Au [Sat, 20 May 2023 03:31:02 +0000 (20:31 -0700)]
Make the RefreshMemoryLimit API public (#85549)

15 months agoEnsure Vector2/3/4, Quaternion, and Plane don't have a false dependency on Vector...
Tanner Gooding [Sat, 20 May 2023 01:59:50 +0000 (18:59 -0700)]
Ensure Vector2/3/4, Quaternion, and Plane don't have a false dependency on Vector<T> (#86481)

* Ensure Vector2/3/4, Quaternion, and Plane don't have a false dependency on Vector<T>

* Apply JIT formatting patch

* Fixing a build issue

* Handle an SPMI assert

15 months agoAdd marshallers for GeneratedComInterface-based types (#86177)
Jeremy Koritzinsky [Sat, 20 May 2023 01:59:29 +0000 (18:59 -0700)]
Add marshallers for GeneratedComInterface-based types (#86177)

15 months agoRefactor our linear collection marshalling implementation (#86519)
Jeremy Koritzinsky [Fri, 19 May 2023 22:55:27 +0000 (15:55 -0700)]
Refactor our linear collection marshalling implementation (#86519)

Co-authored-by: Jackson Schuster <36744439+jtschuster@users.noreply.github.com>
15 months agoEnsure we use bytes, not bits (#86510)
Tanner Gooding [Fri, 19 May 2023 21:46:56 +0000 (14:46 -0700)]
Ensure we use bytes, not bits (#86510)

15 months agoFix marking of saved assemblies (#86474)
Sven Boemer [Fri, 19 May 2023 20:41:26 +0000 (13:41 -0700)]
Fix marking of saved assemblies (#86474)

This ensures the fix from
https://github.com/dotnet/runtime/pull/82197 works also for
assemblies which get the `save` action (which isn't supported
from the command-line, but may happen in custom steps).

It also ensures that `save` assemblies get fully marked
regardless of `DisableMarkingOfCopyAssemblies`.

---------

Co-authored-by: Jackson Schuster <36744439+jtschuster@users.noreply.github.com>
15 months agoRemove fgMorphCastedBitwiseOp (#86491)
Egor Bogatov [Fri, 19 May 2023 20:38:33 +0000 (22:38 +0200)]
Remove fgMorphCastedBitwiseOp (#86491)

15 months ago[wasm] CI: Fix firefox debugger tests failure (#86476)
Ankit Jain [Fri, 19 May 2023 20:36:54 +0000 (16:36 -0400)]
[wasm] CI: Fix firefox debugger tests failure (#86476)

Tests are failing with:

```
  Failed DebuggerTests.ArrayTests.InspectGenericValueTypeArrayLocals(line: 89, col: 8, method_name: "DebuggerTests.ArrayTestsClass.GenericValueTypeLoca"..., test_prev_frame: False, frame_idx: 0, use_cfo: True) [>
  Error Message:
   System.InvalidCastException : Cannot cast Newtonsoft.Json.Linq.JObject to Newtonsoft.Json.Linq.JToken.
  Stack Trace:
     at Newtonsoft.Json.Linq.Extensions.Convert[T,U](T token)
   at DebuggerTests.FirefoxInspectorClient.HandleMessage(String msg, CancellationToken token) in /_/src/mono/wasm/debugger/DebuggerTestSuite/FirefoxInspectorClient.cs:line 184
   at Microsoft.WebAssembly.Diagnostics.RunLoop.RunActualAsync(CancellationTokenSource x) in /_/src/mono/wasm/debugger/BrowserDebugProxy/Common/RunLoop.cs:line 142
   at Microsoft.WebAssembly.Diagnostics.RunLoop.<>c__DisplayClass20_0.<<RunAsync>b__0>d.MoveNext() in /_/src/mono/wasm/debugger/BrowserDebugProxy/Common/RunLoop.cs:line 54
--- End of stack trace from previous location ---
   at System.Threading.Channels.AsyncOperation`1.GetResult(Int16 token)
   at System.Threading.Tasks.ValueTask`1.ValueTaskSourceAsTask.<>c.<.cctor>b__4_0(Object state)
```

One of the arguments of the message is a `JObject`, and thus fails with
`.Value<string>()`.

The full message:
```json
{
   "from" : "server1.conn0.windowGlobal10737418242/windowGlobalTarget2",
   "resources" : [
      {
         "message" : {
            "arguments" : [
               "mono_wasm_debug_event_raised:aef14bca-5519-4dfe-b35a-f867abc123ae",
               {
                  "actor" : "server1.conn0.windowGlobal10737418242/longstractor35",
                  "initial" : "{\"eventName\":\"AssemblyLoaded\",\"assembly_name\":\"System.Private.CoreLib.dll\",\"assembly_b64\":\"V2JJTAAAAAADAAAACCAAAEgAAACYYj4AVAAAAPRDPgAAIAAAAEQ+AEwAAABMBAAAAIA+AAAGAABMRD4ADAAAAACgPgAAAgAATEo+ANBjPgAAAAAASAAAAAIABQDQ4RkAyIAkAAkAAAAAAAAAsFMUADjSAwBQ4RkAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHgIoJAIABipeAigkAgAGAheNogAAAiUWA5x9AQAABCo6AigkAgAGAgN9AQAABCo6AigkAgAGAgN9AgAABCo6AigkAgAGAgN9AwAABCoeAigDMAUAjQAAAAEAABEgAAIAAOD+DyAAAQAAcwEAAAoMCAoCBgMEBW8CAAAKCwctIg4EEgAWBhYoAQAAKygDAAAKDBIC/hYBAAAbb3cDAAZRFyoHGDM+IAAFAACNpAAAAigEAAAKCgIGAwQFbwIAAAotIg4EEgAWBhYoAQAAKygDAAAKDBIC/hYBAAAbb3cDAAZRFyoOBBRRFiomAgMEKA8AAAZ6RgIsDQIo6gAABgMEKAkAAAYqTgIWai8MKFcAAAYDBCgJAAAGAio2KFcAAAYUFigJAAAGKjICagMEKAsAAAYmAioDMAIAsgEAAAIAABEPAChSAAAGCwcgFAABADBJByAGAAEAMBsHIAIAAQA7zQAAAAcgBgABADsUAQAAOHcBAAAHIAgAAQA7sgAAAAcgCwABADsrAQAAByAUAAEAOzYBAAA4UQEAAAcgJQABADAbByAWAAEAOw4BAAAHICUAAQA7pwAAADguAQAAByAtAAEALhUHIDkAAQAuQAcgQgABAC5cOBEBAAAELTADLAgDKBMAAAYsJQMozwUABiwLKLsdAAZzUmwABioovB0ABgMo0RoABgNzVGwABioDK",
                  "length" : 7737462,
                  "type" : "longString"
               },
               "{}"
            ],
            "columnNumber" : 12734,
            "filename" : "http://localhost:9400/dotnet.runtime.js",
            "innerWindowID" : 10737418242,
            "level" : "debug",
            "lineNumber" : 3,
            "private" : true,
            "sourceId" : null,
            "timeStamp" : 1684452298362.82
         },
         "resourceType" : "console-message"
      }
   ],
   "type" : "resource-available-form"
}
```