Pavel Savara [Thu, 19 Jan 2023 17:33:44 +0000 (18:33 +0100)]
[browser][http] Fix blocking of streaming response and abort (#80693)
- return bytes of streaming response as soon as available
- fix unhandled error in reader.cancel() promise
- return cancelable promise from http_wasm_get_streamed_response_bytes
- unit test for slowly streamed chunks
- unit test for streaming and default cancellation
Thefrank [Thu, 19 Jan 2023 16:24:48 +0000 (08:24 -0800)]
NativeAOT for FreeBSD (#80323)
* add inotify for FreeBSD during linking
* remove FreeBSD for now
* netstandard does not understand FreeBSD
* add FreeBSD platform to HostModel Tests
* add inotify for FreeBSD during linking
* remove FreeBSD for now
* netstandard does not understand FreeBSD
* add FreeBSD platform to HostModel Tests
* Use Clang12, update LinkerArg
* WIP FreeBSD NativeAOT
* add inotify for FreeBSD during linking
* remove FreeBSD for now
* netstandard does not understand FreeBSD
* add FreeBSD platform to HostModel Tests
* WIP FreeBSD NativeAOT
* remove FreeBSD for now
* add FreeBSD platform to HostModel Tests
* Use Clang12, update LinkerArg
* Update JITTools and ObjWriter for FreeBSD-x64
* fixes for tests
* fixes for tests
* add TargetTriple for FreeBSD
* Some changes from feedback, remove out of scope
* HostModel back to netstandard2.0
* Update src/coreclr/CMakeLists.txt
* Publish crossgen2 as single-file on cross-os
* pass NativeAotSupported to MSBuild crossgen2 tasks
* Can't use NativeAOT in source build yet
Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
* Update private string HostFxr and HostPolicy
* Fix private string HostPolicy
* Apply suggestions from code review
Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Robin Sue <robinsue@live.de>
Andy Ayers [Thu, 19 Jan 2023 15:58:17 +0000 (07:58 -0800)]
JIT: update bbNums before inverting loops (#80827)
We use the bbNum to decide how to manipulate "in loop" edges when inverting
loops, and this was sometimes misleading as the bbNums did not reflect block
order.
Per the code this is not a correctness issue, but needless redirections can
confuse loop recognition.
Fixes #80809.
Vitek Karas [Thu, 19 Jan 2023 15:20:23 +0000 (07:20 -0800)]
NativeAOT fixes around data flow analysis (#80694)
Removes the `Origin` class as it doesn't seem to serve any purpose anymore. The code used it to basically just only call `GetDisplayName` on members and pass that as the `reason` to dependency analysis. Replaced with passing just string directly as the `reason`.
Fixes bugs in warning subsystem when the warning is generated from an origin which is a module or assembly. This would previously crash the compiler. There are basically no tests for this right now - some of the tests in linker which hit this can't be easily ported yet due to NativeAOT not producing "reflection access to DAM" warnings. I have these mostly working locally but enabling the warnings fails some tests outside of the linker ones, so it needs more work.
Fixes analysis bugs when methods or fields are accessed via `ldtoken` or `ldftn` instructions. In such cases we still need to process them for RUC and DAM based warnings and so on. There are only a few tests for this in this change - more will come when we port the `AnnotatedMembersAccessedViaReflection` from linker, but those all require to enable the "reflection access to DAM" warnings as mentioned above.
* This required addition of a new TrimAnalysisPattern since the processing happens in reflection scanning and all warnings/marking hapening from there must go through the patterns.
Changes `DynamicDependencyAttribute` processing to happen in a separate dependency node. Previously if there were warnings generated due to the `DynamicDependencyAttribute` the compiler may report them multiple times (if it hit the same member twice during the rest of the analysis). To avoid this, the processing is postponed by adding a new dependency node - which then acts as the unification mechanism and thus warnings are produced just once.
Anton Firszov [Thu, 19 Jan 2023 15:12:40 +0000 (16:12 +0100)]
disable DnsGetHostAddresses_PostCancelledToken_Throws (#80792)
Eric Erhardt [Thu, 19 Jan 2023 15:10:49 +0000 (09:10 -0600)]
LambdaExpression.CanCompileToIL should respect IsDynamicCodeSupported (#80759)
* LambdaExpression.CanCompileToIL should respect IsDynamicCodeSupported
With the new feature switch added in https://github.com/dotnet/runtime/issues/39806, calling LambdaExpression.Compile is throwing a PlatformNotSupportedException. Instead, LambdaExpression should respect IsDynamicCodeSupported and switch to using the interpreter when IsDynamicCodeSupported is false.
* Add tests
Jan Vorlicek [Thu, 19 Jan 2023 13:46:55 +0000 (14:46 +0100)]
Fix dynamic class zeroing (#80822)
Recent change in the `ThreadLocalModule::AllocateDynamicClass` has
accidentally removed zeroing for new CollectibleDynamicEntry instances.
That leads to crashes when running code in an unloadable context.
This change fixes that.
Egor Bogatov [Thu, 19 Jan 2023 12:32:21 +0000 (13:32 +0100)]
NativeAOT: devirtualize isinst/castclass for monomorphic cases (#80831)
Ivan Povazan [Thu, 19 Jan 2023 10:17:02 +0000 (11:17 +0100)]
[mono] Prefix exported symbols via UnmanagedCallersOnly attribute (#79880)
Fixes https://github.com/dotnet/runtime/issues/79491
Vlad Brezae [Thu, 19 Jan 2023 09:11:42 +0000 (11:11 +0200)]
[mono][interp] Properly initialize fields of LocalValue (#80795)
We were storing uninitialized values. Bug caught with valgrind, hopefully fixes some real crashes.
Michal Strehovský [Thu, 19 Jan 2023 08:57:39 +0000 (17:57 +0900)]
Remove `CustomAttributeData` usage in IsByRefLike (#80841)
Grabbing custom attribute data brings the entire reflection stack (we need properties, constructors, fields, methods).
We ask `IsByRefLike` in type loader constraint validation. Ideally we should be able to get rid of the type loader from a hello world, but that's for later. This is a more efficient implementation either way.
Michal Strehovský [Thu, 19 Jan 2023 07:10:48 +0000 (16:10 +0900)]
Remove uses of `TypeInfo` from the reflection stack (#80833)
Contributes to #80165.
Not aware of a good reason to keep using it. Removes `TypeDelegator` from apps that don't use it. Saves 7 kB (but also stepping stone for the larger savings later).
Jeremy Koritzinsky [Thu, 19 Jan 2023 01:09:52 +0000 (17:09 -0800)]
Remove the TypeKey concept as the primary user for the concept is unable to use it effectively. (#79418)
Michal Strehovský [Thu, 19 Jan 2023 00:20:54 +0000 (09:20 +0900)]
Make TypeComponentsCache trimmable (#80726)
Contributes to #80165.
Dispensing of reflection member infos is done through a member policies class. This is a generic class that has specialized implementations for each kind of member info.
It used a clever trick to get to the specific implementations. Just access `MemberPolicies<EventInfo>.Default` to get one for events or `MemberPolicies<PropertyInfo>.Default` to get one for properties. It was also absolutely not trimming friendly.
This change removes the clever trick and replaces it with good old fashioned parameter passing.
LateApexEarlySpeed [Wed, 18 Jan 2023 23:55:40 +0000 (07:55 +0800)]
Make WriteCommentValue overloads have same behavior (#75074)
Squashed commit of the following:
commit
e89bcfe2d8c3f45232f3d0b861be34ccede948f1
Author: lateapexearlyspeed <lateapexearlyspeed@163.com>
Date: Wed Nov 9 11:56:41 2022 +0800
Change comment behavior: add newline between comments.
commit
60d730ae151c9c2bffdaf7b6ca3cfa68180ba8b8
Author: lateapexearlyspeed <lateapexearlyspeed@163.com>
Date: Thu Oct 27 15:36:43 2022 +0800
Fix comment: test multiple comments in same line.
commit
977e76a298e52ad184adf78ab7172be99b97b9e2
Merge:
64b6be97fd4 9b9b0c95c67
Author: LateApexEarlySpeed <
72254037+lateapexearlyspeed@users.noreply.github.com>
Date: Fri Sep 23 12:56:01 2022 +0800
Merge branch 'main' into lateapexearlyspeed-MakeWriteCommentValueOverloadSameBehavior
commit
64b6be97fd4c9b59fc601db8a0e6ddd8a8b97a7f
Author: lateapexearlyspeed <lateapexearlyspeed@163.com>
Date: Thu Sep 22 10:39:32 2022 +0800
Fix comment: keep newtonsoft.json asserting tests; add non-indented tests; use pattern match.
commit
e3a772ac985801eb89abc028f5a71f2ad502cd55
Author: lateapexearlyspeed <lateapexearlyspeed@163.com>
Date: Tue Sep 20 16:20:59 2022 +0800
Inline expectedIndentedJson to local var.
commit
9e16463cc8826890e6fbeb115ba9a05867ee5017
Author: lateapexearlyspeed <lateapexearlyspeed@163.com>
Date: Tue Sep 20 11:46:44 2022 +0800
Fix comment: update test cases to use string literal to assert.
commit
bebb09c0c9bc7b7b1c5076ab6dbcf1f5ec1d884a
Author: lateapexearlyspeed <lateapexearlyspeed@163.com>
Date: Thu Sep 15 17:56:44 2022 +0800
Add tests.
commit
2f9dbff3629f0b9b8b24f2bb2c32ec9c620a6fcd
Author: lateapexearlyspeed <lateapexearlyspeed@163.com>
Date: Wed Sep 7 11:01:11 2022 +0800
Add NewLine between comment and start of (object and array).
commit
9c1bb280f59e3755227747251a1a51fdca9eeab1
Author: lateapexearlyspeed <lateapexearlyspeed@163.com>
Date: Mon Sep 5 15:11:57 2022 +0800
Make WriteCommentValue() overloads have same behavior.
Bruce Forstall [Wed, 18 Jan 2023 23:24:15 +0000 (15:24 -0800)]
Add missing license header (#80802)
Andy Ayers [Wed, 18 Jan 2023 22:46:48 +0000 (14:46 -0800)]
JIT: fix remaining phases that were rebuilding pred edges (#80769)
Loop canonicalization now maintains pred edges. GC poll insertion was already
maintaining the edges but was rebuilding them anyways.
Now pred lists are never rebuilt.
Also revise `fgUpdateChangedFlowGraph` so that it no longer has the
ability to remove or rebuild.
Fixes #49030.
Also fixes #80772.
Thays Grazia [Wed, 18 Jan 2023 22:29:41 +0000 (19:29 -0300)]
[wasm][debug]Press alt-shift-d and open firefox debug tab attached to the blazor app (#80722)
* press alt-shift-d and open tab to debug blazor app on firefox.
* Update src/mono/wasm/debugger/BrowserDebugProxy/Firefox/FirefoxDebuggerProxy.cs
Co-authored-by: Ankit Jain <radical@gmail.com>
* addressing @radical comments
Co-authored-by: Ankit Jain <radical@gmail.com>
Jeremy Koritzinsky [Wed, 18 Jan 2023 22:06:53 +0000 (14:06 -0800)]
Switch to using the .NET SDK properties that are defined to provide the TFM instead of using the assembly that defines System.Object (#80646)
Fixes https://github.com/dotnet/runtime/issues/80621
dotnet-maestro[bot] [Wed, 18 Jan 2023 20:37:25 +0000 (14:37 -0600)]
[main] Update dependencies from dotnet/roslyn (#80656)
* Update dependencies from https://github.com/dotnet/roslyn build
20230113.14
Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
From Version 4.6.0-1.23058.1 -> To Version 4.6.0-1.23063.14
* Update dependencies from https://github.com/dotnet/roslyn build
20230116.1
Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
From Version 4.6.0-1.23058.1 -> To Version 4.6.0-1.23066.1
* Update dependencies from https://github.com/dotnet/roslyn build
20230117.16
Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
From Version 4.6.0-1.23058.1 -> To Version 4.6.0-1.23067.16
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Aleksey Kliger (λgeek) [Wed, 18 Jan 2023 20:13:56 +0000 (15:13 -0500)]
Implement Startup hooks support in Mono; refactor StartupHookProvider (#80391)
Fixes #47462
**CoreCLR** This also makes some changes to CoreCLR to decouple EventPipe and startup hooks. Presently if startup hooks are disabled, `RuntimeEventSource.Initialize` is never called. The PR makes the two features independent by moving runtime event source initialization out of the startup hook feature check.
* Implement startup hooks support in Mono
* Keep StartupHookProvider.ProcessStartupHooks under feature flag
* Don't catch/cleanup the exceptions from startup hooks.
* Add an ios simulator startup hook functional test
* Implement Android functional test
* Add WASM functional test
* Make a single managed startup method for CoreCLR
A common configuration for coreclr is event source enabled, startup
hooks disabled, so at least one managed call is inevitable. Since we
have to call into managed no matter what, let the trimmer determine
what happens once we get there.
This is different from mono where published trimmed apps may have both
startup hooks and event source disabled. In that case we would rather
avoid a managed call to an empty method early in startup.
* fix build and line damage
Jakob Botsch Nielsen [Wed, 18 Jan 2023 19:51:37 +0000 (20:51 +0100)]
JIT: Streamline TreeLifeUpdater (#80611)
TreeLifeUpdater at most needs to flip 4 bits in two liveness sets when
it is called, however before this change it uses several full width
bitset operations to do this. This changes TreeLifeUpdater to do its job
in a much more direct way by updating the liveness sets directly.
Jakob Botsch Nielsen [Wed, 18 Jan 2023 19:17:48 +0000 (20:17 +0100)]
SPMI: Update -metrics passthrough (#80775)
jit-analyze no longer accepts comma-separated metrics after
https://github.com/dotnet/jitutils/pull/362, instead requiring each
metric to be specified separately on the command line.
Miha Zupan [Wed, 18 Jan 2023 18:48:46 +0000 (19:48 +0100)]
Add AVX2 support to IndexOfAnyValues (#78863)
Miha Zupan [Wed, 18 Jan 2023 18:24:13 +0000 (19:24 +0100)]
Fix recent IndexOf regressions (#80779)
* Improve IndexOf codegen for non-char types
* Call directly into NonPackedIndexOf where it makes sense
Tomas Weinfurt [Wed, 18 Jan 2023 17:47:43 +0000 (09:47 -0800)]
add unsupported attributes to System.Net.Security (#80717)
* add unsupported attributes to System.Net.Security
* using
* CA1416
Jan Kotas [Wed, 18 Jan 2023 17:39:28 +0000 (09:39 -0800)]
Partial revert of #71486 to unblock dotnet/sdk (#80791)
dotnet-maestro[bot] [Wed, 18 Jan 2023 16:48:36 +0000 (17:48 +0100)]
Update dependencies from https://github.com/dotnet/linker build
20230117.1 (#80782)
Microsoft.NET.ILLink.Tasks
From Version 8.0.100-1.23064.1 -> To Version 8.0.100-1.23067.1
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
dotnet-maestro[bot] [Wed, 18 Jan 2023 16:44:10 +0000 (17:44 +0100)]
Update dependencies from https://github.com/dotnet/arcade build
20230117.5 (#80780)
Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
From Version 8.0.0-beta.23066.1 -> To Version 8.0.0-beta.23067.5
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Elinor Fung [Wed, 18 Jan 2023 15:44:12 +0000 (07:44 -0800)]
Use TaskDialog for error dialog in Windows GUI apps (#78087)
Elinor Fung [Wed, 18 Jan 2023 15:43:30 +0000 (07:43 -0800)]
Fix diagnosticport test failure in ilasm/ildasm round-trip testing (#80766)
Vlad Brezae [Wed, 18 Jan 2023 15:20:52 +0000 (17:20 +0200)]
[mono][interp] Add 16 byte default alignment to interp frames (#80700)
* [mono][interp] Remove MINT_VT_ALIGNMENT
It serves no purpose nowadays. All vars are aligned to MINT_STACK_SLOT_SIZE.
* [mono][interp] Add 16 byte default alignment to optimized code
This will enable us to control alignment of Vector128 vars at compile time.
* [mono][interp] Add stack alignment for unoptimized code
For normal calls, we introduce a new opcode before the call that will move all the arguments to aligned stack location. When emitting the code for the call, we emit directly the aligned call args offset instead. Unoptimized code has its own opcodes that do moving of param, we tweak them to copy them into aligned location.
Zoltan Varga [Wed, 18 Jan 2023 11:30:09 +0000 (06:30 -0500)]
[mono][aot] Optimize the layout of the extra_method_table. (#80682)
Stephen Toub [Wed, 18 Jan 2023 11:00:36 +0000 (06:00 -0500)]
Fix use of span local in WebSocketHandle.ConnectAsync (#80770)
Zoltan Varga [Wed, 18 Jan 2023 09:21:58 +0000 (04:21 -0500)]
[wasm] Enable dedup by default. (#80260)
* [wasm] Enable dedup by default.
* [wasm] Enable symbol map for AOT tests too
* MonoAOTCompiler: Fix up the path for the output items if they had been
.. copied to `aot-in` for the compilation step.
Example:
- when using WasmDedup=true, we get the main assemblies in `publish`
directory after linking, but `aot-instances.dll` is in different directory.
- this causes `MonoAOTCompiler` to copy all of them to a temporary `aot-in` dir for compiling with `mono-aot-cross`.
- And when the output items are set, we get:
```
Output Item(s):
_WasmAssembliesInternal=
obj/Debug/net8.0/browser-wasm/wasm/for-publish/aot-in/Debug_u4nbxx3i.gc5.dll
LlvmBitcodeFile=obj/Debug/net8.0/browser-wasm/wasm/for-publish/Debug_u4nbxx3i.gc5.dll.bc
```
- here the `ItemSpec` is incorrectly set to the temporary `aot-in` path
- which can cause build failures in the following build steps
* WBT: remove redundant case
Co-authored-by: Ankit Jain <radical@gmail.com>
Jakob Botsch Nielsen [Wed, 18 Jan 2023 09:18:07 +0000 (10:18 +0100)]
JIT: Add a stress mode that poisons implicit byrefs (#80691)
This stress mode poisons all implicit byrefs before returns from the
method. GC pointers are nulled out and other parts of the structs are
filled with 0xcd bytes.
This should help expose incorrectly elided copies in the recently added
last-use copy elision optimization.
Jakob Botsch Nielsen [Wed, 18 Jan 2023 09:06:44 +0000 (10:06 +0100)]
JIT: Account for GT_JMP implicit uses in local morph ref counting (#80734)
Fix #80731
Jakob Botsch Nielsen [Wed, 18 Jan 2023 09:01:49 +0000 (10:01 +0100)]
JIT: Fix GC hole for Armv8.1 Atomics (#80740)
Unlike seemingly all other ARM instructions, the set of instructions
marked by this PR actually write their result in the second operand
register instead of the first. This means we were incorrectly updating
GC info when emitting these instructions.
Fix #79431
Fix #80582
Fix #80584
Fix #80585
Fix #80586
Fix #80587
Fix #80588
Ankit Jain [Wed, 18 Jan 2023 08:44:48 +0000 (03:44 -0500)]
[wasm] WBT: Add `submit-wbt-helix` make target (#80763)
Vladimir Sadov [Wed, 18 Jan 2023 06:04:07 +0000 (22:04 -0800)]
Set AssemblyName.ProcessorArchitecture for compatibility. (#80581)
* Set AssemblyName.ProcessorArchitecture for compatibility.
* Simplified ProcArch computation.
dotnet-maestro[bot] [Wed, 18 Jan 2023 03:58:17 +0000 (21:58 -0600)]
[main] Update dependencies from dotnet/arcade (#80547)
* Update dependencies from https://github.com/dotnet/arcade build
20230111.1
Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
From Version 8.0.0-beta.23053.5 -> To Version 8.0.0-beta.23061.1
* Update dependencies from https://github.com/dotnet/arcade build
20230112.3
Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
From Version 8.0.0-beta.23059.1 -> To Version 8.0.0-beta.23062.3
* Update dependencies from https://github.com/dotnet/arcade build
20230113.7
Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
From Version 8.0.0-beta.23059.1 -> To Version 8.0.0-beta.23063.7
* Update dependencies from https://github.com/dotnet/arcade build
20230116.1
Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions
From Version 8.0.0-beta.23059.1 -> To Version 8.0.0-beta.23066.1
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
dotnet-maestro[bot] [Wed, 18 Jan 2023 03:56:54 +0000 (21:56 -0600)]
Update dependencies from https://github.com/dotnet/linker build
20230114.1 (#80655)
Microsoft.NET.ILLink.Tasks
From Version 8.0.100-1.23062.1 -> To Version 8.0.100-1.23064.1
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Will Smith [Wed, 18 Jan 2023 03:22:13 +0000 (19:22 -0800)]
Updating stind_ref.il test to actually use stind_ref (#80761)
Jan Kotas [Wed, 18 Jan 2023 01:01:18 +0000 (17:01 -0800)]
Default to ILC host architecture that matches OS architecture on Windows (#80752)
It allows compilation using msbuild.exe that is x86 by default
Andy Ayers [Wed, 18 Jan 2023 00:31:19 +0000 (16:31 -0800)]
JIT: maintain pred lists during loop unrolling (#80625)
We now update pred lists during loop unrolling, rather than recomputing
them from scratch.
There are several parts to the fix: first, `optRedirectBlock' now has
a new ability to add pred references for the flow from a newly cloned
block, be it either to a remapped successor or a non-remapped successor.
Along with this we no longer copy over the block ref count in `CloneBlockState`.
These changes allow us to create the right pred links and ref counts in the
interior of a cloned subgraph.
Second, we now scrub block references from the original loop body blocks
instead of just setting their ref counts to zero.
Finally, we fix up references for exterior flow into and out of the unroll
complex.
Addresses one of the cases mentioned in #49030.
Egor Bogatov [Tue, 17 Jan 2023 23:30:43 +0000 (00:30 +0100)]
Introduce TieredPGO_InstrumentedTierAlwaysOptimized for PGO tests (#80524)
Ankit Jain [Tue, 17 Jan 2023 21:28:47 +0000 (16:28 -0500)]
[wasm] Change TrimMode setting for templates, and tests (#80639)
* [wasm] Set TrimMode=full for templates
* [wasm] Remove TrimMode=partial default setting
.. and set TrimMode=partial for library tests.
* [wasm] don't set TrimMode explicitly for template projects. it will default to full now
Adam Sitnik [Tue, 17 Jan 2023 21:24:08 +0000 (22:24 +0100)]
Solve recently introduce ASCII regression (#80709)
* call the helper methods directly to reduce overhead (important for small inputs)
* inline the helper that was supposed to be public into it's only caller
Aleksey Kliger (λgeek) [Tue, 17 Jan 2023 20:36:05 +0000 (15:36 -0500)]
[wbt] correctly add RunAnalyzers property to template projects (#80747)
* [wbt] correctly add RunAnalyzers property to template projects
Follow-up for https://github.com/dotnet/runtime/pull/77704
The first argument to `AddItemsPropertiesToProject` is the project file
* Catch non-existent projectFiles even if there's nothing to add
Zoltan Varga [Tue, 17 Jan 2023 19:33:30 +0000 (14:33 -0500)]
[mono][aot] Reduce collisions in mono_aot_method_hash () for some wrappers. (#80667)
Jakob Botsch Nielsen [Tue, 17 Jan 2023 17:52:57 +0000 (18:52 +0100)]
Fix fuzzers for .NET 8 SDK publish (#80673)
dotnet publish does not allow publishing with an output path in the .NET
8 SDK. They failed this weekend's rolling runs so this change makes the
build scripts specify the project to build.
Mike McLaughlin [Tue, 17 Jan 2023 17:40:58 +0000 (09:40 -0800)]
Add the DbgDisablePagemapUse environment variable to control pagemap useage (#80714)
The default is currently opt-in. "DbgDisablePagemapUse=0" needs to be set to
enable the pagemap checking feature. It is opt-in because it is breaking createdump
testing against 8.0.
Ankit Jain [Tue, 17 Jan 2023 16:54:57 +0000 (11:54 -0500)]
[wasm] debugger tests- Misc improvements (#80660)
* [wasm] DebuggerTests - Split EvaluateOnCallFrameTests
* [wasm] debugger tests - emit some output on CI
Andrii Kurdiumov [Tue, 17 Jan 2023 16:06:07 +0000 (22:06 +0600)]
Add location of NativeAot Corelib project (#80738)
Eirik Tsarpalis [Tue, 17 Jan 2023 14:53:07 +0000 (14:53 +0000)]
Update JsonSerializerOptions.AddContext to have combine semantics. (#80698)
* Update JsonSerializerOptions.AddContext to have combine semantics.
* Remove unused property setter.
* Remove unused error message.
* Update XML documentation.
Adeel Mujahid [Tue, 17 Jan 2023 14:19:41 +0000 (16:19 +0200)]
Add statically linked libnuma support for AOT (#80671)
* Add statically linked libnuma support for AOT
* Fix windows build
* Update src/coreclr/nativeaot/docs/compiling.md
* Align formatting in doc
* Address CR feedback
* Add ability to skip static PIE
* Cleanup pal.cpp
* Highlight LGPL with a note in doc
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Stephen Toub [Tue, 17 Jan 2023 13:02:30 +0000 (08:02 -0500)]
Use CompressionLevel.SmallestSize in Bundler (#80372)
Egor Bogatov [Tue, 17 Jan 2023 11:47:29 +0000 (12:47 +0100)]
Don't try to fold ADD(CNS, CNS-handle) in gtWalkOp (#80704)
Pavel Savara [Tue, 17 Jan 2023 11:08:46 +0000 (12:08 +0100)]
[browser] avoid undefined stack (#80707)
Adeel Mujahid [Tue, 17 Jan 2023 10:21:24 +0000 (12:21 +0200)]
Update cross-arm-alpine image to Ubuntu 22.04 host (#80725)
Viktor Hofer [Tue, 17 Jan 2023 10:20:05 +0000 (11:20 +0100)]
Disable onelocbuild in official builds (#80730)
Tlakaelel Axayakatl Ceja [Tue, 17 Jan 2023 09:54:31 +0000 (01:54 -0800)]
Don't build tools along with libraries to stop producing the Microsoft.NET.ILLink.Tasks package (#80720)
Bruce Forstall [Tue, 17 Jan 2023 06:49:05 +0000 (22:49 -0800)]
Fix overwriting of superpmi log file (#80716)
* Fix overwriting of superpmi log file
The invocation of "tpdiff" was overwriting the log file generated by
superpmi.py of the asmdiffs run. Use a unique log file for each
invocation.
run-superpmi-diffs-job.yml is already configured to copy all
`superpmi_*.log` files to the output, so these new names will get saved.
* Fix file list in DownloadFilesFromResults
Jan Kotas [Tue, 17 Jan 2023 05:57:01 +0000 (21:57 -0800)]
Revert "Decommit memory as needed (#79912)" (#80723)
This reverts commit
6da8e2a27bd43a913b8a2a8a107cefbf57b069c8.
Michal Strehovský [Tue, 17 Jan 2023 05:55:28 +0000 (14:55 +0900)]
Make it possible to construct StackFrame without MethodBase (#80681)
Contributes to #80165.
Resolving a `MethodBase` is a pretty expensive operation and currently even a hello world needs it because of `Exception.ToString()`. This pull request is trying to get `MethodBase` out of the picture when constructing the exception string.
We currently only need `_method` for two things - the public `GetMethod` API, and `StackFrame.ToString`. The `StackFrame.ToString` can already deal with `_method` being null (and that codepath exists solely for NativeAOT). This is the minimal change. We could potentially explore other approaches - leave `MethodBase` always at null, or unshare the `StackFrame` class.
Jan Kotas [Tue, 17 Jan 2023 02:54:07 +0000 (18:54 -0800)]
Merge pull request #80678 from tlakollo/SyncILLink
Sync ILLink
Nagaev Renat [Tue, 17 Jan 2023 02:34:22 +0000 (05:34 +0300)]
Remove usage of ComPlus_ variables in tests (#78377)
In coreclr's configuration cache, DOTNET_ is preferred over COMPlus_
Fix #76484
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Bruce Forstall [Tue, 17 Jan 2023 00:02:27 +0000 (16:02 -0800)]
Increase superpmi-replay x64 parallelism (#80712)
Increase partitions per platform from 2 to 3 for x64 runs to
reduce overall run time.
Michal Strehovský [Mon, 16 Jan 2023 23:28:31 +0000 (08:28 +0900)]
Generate fewer templates for generic virtual methods (#80600)
The only reason left why we needed the extra template was because when we're breaking down a `RuntimeMethodHandle` into components, we were trying to break it down into `RuntimeTypeHandle`s. But what we need is a `MethodDesc`. So shortcut the codepath that computes `MethodDesc`, then breaks it down into various type handles and then get a `MethodDesc` again.
Michal Strehovský [Mon, 16 Jan 2023 23:27:50 +0000 (08:27 +0900)]
Add type loader support for resolving static virtuals (#80601)
The implementation of static virtuals was limited to compile-time resolution in .NET 7. I erroneously believed runtime resolution can only happen with `MakeGenericType`/`MakeGenericMethod` and therefore falls into the general "don't do dynamic code" bucket. But this is also reachable from generic instance virtual method resolution that is also dynamic-like (we don't attempt to precompute all runtime artifacts, only canonical code).
This contains compiler changes to start tracking static virtual method use within type loader templates the same way how we track instance generic virtual method use (i.e. those static virtual uses that happen at compile time are not tracked in this - only the dynamic ones). We also make sure the computed targets get generated into the appropriate table.
The other part of the change is a type loader change to call into the generic virtual method resolution logic when needed.
Tanner Gooding [Mon, 16 Jan 2023 20:39:29 +0000 (12:39 -0800)]
Refactor lookupNamedIntrinsic to avoid common duplicate checks (#80705)
Adeel Mujahid [Mon, 16 Jan 2023 17:56:33 +0000 (19:56 +0200)]
Normalize RepoRoot path to improve logs readability (#80664)
Šimon Rozsíval [Mon, 16 Jan 2023 17:54:21 +0000 (18:54 +0100)]
[Android] Improvements to remote certificate verification in SslStream (#77386)
* Extract existing validation code into a separate class
* Implement AndroidDexBuilderTask
* Implement TrustManager proxy
* Integrate the trust manager proxy with SslStream on Android
* Update tests
* Update System.Net.Http tests
* Update System.Net.Security tests
* Fix packaging
* Propagate caught exceptions
* Build and pack .jar
* Optimize allocation and deallocation of memory for certificate data
* Fix building .jar
* Cleanup
* Remove complicated certificate copying
* Remove unnecessary JNI classes and methods
* Simplify and fix the core implementation
* Update enabled and disabled tests
* Cleanup
* Renaming
* Remove unnecessary changes
* Fix invoking validation even when the Java callbacks aren't called (no peer certificate to validate)
* Minor refactoring
* Enable more unnecessarily disabled tests
* Refactor exception handling
* Update disabled tests
* Renaming
* Remove network security config workarounds
* Keep existing active issue
* Remove unnecessary changes
* Remove unnecessary code
* Enable more disabled tests
* Fix throwing exception
* Fix intptr_t cast to Java
* Remove initialization lock
* Update naming
* Fix type casting
* Improve throwing validation exception
* Experiment with code structure
* Fix repeated calls to beginHandshake
* Make SslStream proxy mandatory
* Add missing attributes
* Free temporary buffer
* Update src/native/libs/System.Security.Cryptography.Native.Android/pal_sslstream.c
Co-authored-by: Elinor Fung <elfung@microsoft.com>
* Refactor creating array of trust managers
* Add comments and clean up pal_sslstream.c
* Revert experimental change
* Remove special case for IPv6 addresses as hostnames and disable affected tests
* Fix duplicate variable after merge
* Improve code formatting
* Remove the hack with SafeDeleteContextStub
* Enable passing test
* Remove unnecessary factory
* Move clearing selected client certificate out of the remote certificate verification method
* Fix typo in comment
* Add comment with java equivalent
* Move Android specific runtime files into a separate item group
* Apply suggestions from code review
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
* Update src/native/libs/build-native.proj
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
* Disable test that fails on Android emualtors
Co-authored-by: Elinor Fung <elfung@microsoft.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
Šimon Rozsíval [Mon, 16 Jan 2023 15:50:13 +0000 (16:50 +0100)]
[Android] Add error code to the assert error message (#80423)
Jakob Botsch Nielsen [Mon, 16 Jan 2023 14:29:20 +0000 (15:29 +0100)]
JIT: Fix implicit byref block expansion (#80659)
Fix #80616
Milos Kotlar [Mon, 16 Jan 2023 13:40:08 +0000 (14:40 +0100)]
[mono][interp] Expand bblocks reordering with common patterns to facilitate propagation of values (#80362)
* Optimize interp_reorder_bblocks function by moving known patterns into callers bblocks.
* Update interp_inline_into_callers function to match specific patterns and return lookup cond_ins.
Alexander Köplinger [Mon, 16 Jan 2023 13:05:39 +0000 (14:05 +0100)]
[mono] Cleanup some unused functions/headers (#80618)
Kevin Jones [Mon, 16 Jan 2023 10:36:41 +0000 (05:36 -0500)]
Add tests for exercising certificates with platform provider keys (#80558)
* Add tests for exercising certificate with platform provider keys.
* Refactor CngKey PCP test key creation
Marie Píchová [Mon, 16 Jan 2023 09:41:25 +0000 (10:41 +0100)]
[QUIC] Log msquic version and commit hash to event log and to test output. (#80612)
* Log msquic version and commit hash to event log and to test output.
* Feedback
Michal Strehovský [Mon, 16 Jan 2023 09:17:28 +0000 (18:17 +0900)]
Make reading custom attributes in NativeLibrary avoidable (#80677)
Contributes to #80165.
Unfortunately, the `NativeLibrary` APIs contain a pattern where one can skip providing a parameter to the API and then something expensive (custom attribute reading) will happen to compute the value. We have a `TryLoad` call in a hello world that does provide the value (in GlobalizationMode.cs). Make it possible to avoid the expensive thing internally.
Michal Strehovský [Mon, 16 Jan 2023 08:59:30 +0000 (17:59 +0900)]
Rename System.Text.Json test exclusion (#80676)
Tlakaelel Axayakatl Ceja [Mon, 16 Jan 2023 05:36:53 +0000 (05:36 +0000)]
Merge branch 'main' of ../linker into main
Tlakaelel Axayakatl Ceja [Mon, 16 Jan 2023 04:36:34 +0000 (20:36 -0800)]
Add logger and tests for xml parsing in NativeAOT (#80470)
Add logger to LinkerXml Processing
Hookup xml reading into testing infra
Port linker xml tests to test cases
Document differences in testing between linker and NativeAOT
Open issues in NativeAOT for remaining differences
Don't throw if not able to resolve assembly
Add a comment on why the MarkAndPreserve method is implemented differently from illink
Tanner Gooding [Sun, 15 Jan 2023 22:25:39 +0000 (14:25 -0800)]
Update our inline observations to special case a few more intrinsics (#80637)
* Update our inline observations to special case a few more intrinsics
* Apply formatting patch
Robin Lindner [Sun, 15 Jan 2023 22:11:50 +0000 (23:11 +0100)]
[API Implementation]: Deconstruct for DateTime, DateTimeOffset, DateOnly, and TimeOnly (#79499)
Closes https://github.com/dotnet/runtime/issues/24601
Bruce Forstall [Sun, 15 Jan 2023 18:48:05 +0000 (10:48 -0800)]
Be more conservative with peephole optimization (#80645)
Do not allow any peephole optimization between a NOGC and
non-NOGC IG.
This introduces a very few diffs, all regressions and none
existing GC holes, where a register load as the first instruction
of a NOGC region is not optimized. These mostly look like cases
where we zero initialize a struct then copy the struct to another
stack-based struct. If we could forward-prop the zero that might
eliminate most of the diffs.
The check on `emitForceNewIG` introduced in #78074 is still
required, as that is used to "exit" a NOGC region without actually
creating a new IG without the NOGC flag.
Egor Bogatov [Sun, 15 Jan 2023 18:46:22 +0000 (19:46 +0100)]
Use ROS<long> in FormattingHelpers instead of ROS<byte> (#80668)
Bruce Forstall [Sun, 15 Jan 2023 18:44:13 +0000 (10:44 -0800)]
Remove duplicate function (#80643)
Remove function `emitGetInstrDescSizeSC()`, only used on arm,
and replace uses by the identical `emitGetInstrDescSize()`.
Egor Bogatov [Sun, 15 Jan 2023 16:47:52 +0000 (17:47 +0100)]
Handle float/double for RVA[cns] optimization in fgValueNumberConstLoad (#80661)
Radek Doulik [Sun, 15 Jan 2023 16:08:29 +0000 (17:08 +0100)]
[wasm] Quote illink substitutions path (#80657)
Andrii Kurdiumov [Sun, 15 Jan 2023 07:15:22 +0000 (13:15 +0600)]
Add ability statically link OpenSSL (#80380)
* Add ability statically link OpenSSL
This setup works if I apply this as local customizations, I do not sure that I use OpenSSL in most secure way, I do not competent. This setup and StaticExecutable=true allow package just EXE file + /etc/ssl/certs/ folder in Docker
* Share build scripts across Globalization and OpenSSL
* Add warning
Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
Tanner Gooding [Sun, 15 Jan 2023 06:13:25 +0000 (22:13 -0800)]
Fix some low-hanging HWIntrinsic issues (#80626)
* Ensure isSimdAsHWIntrinsic is false for Vector64/128/256.WithElement
* Ensure AsVector2 and AsVector3 are intrinsic
* Ensure AsVector128(Vector2) and AsVector128(Vector3) are handled as intrinsic
* Ensure Vector64/128/256.AsNInt and AsNUInt are handled as intrinsic
* Ensure Vector*<T>.IsSupported is handled as intrinsic
* Ensure get_Count for Vector64/128/256<T> and Vector<T> is handled as intrinsic
* Apply formatting patch
* Ensure the right simdSize is selected for AsVector128
* Ensure AsVector2/3 are correctly handled in lowering
* Ensure AsVector2 passes in op1 on Arm64
Zoltan Varga [Sun, 15 Jan 2023 02:31:53 +0000 (21:31 -0500)]
[mono][wasm] Avoid emitting the eh info table, its not used on wasm. (#80653)
Adeel Mujahid [Sat, 14 Jan 2023 22:23:46 +0000 (00:23 +0200)]
Add support for llvm linker (lld) (#80613)
Jakob Botsch Nielsen [Sat, 14 Jan 2023 18:51:43 +0000 (19:51 +0100)]
Fix GC hole in newly added test (#80630)
GC stress is red after
78ccdaeeb4ccc5d0eff36b2eadc5e1cb07403fcd due to a
delegate not being kept alive.
Larry Ewing [Sat, 14 Jan 2023 16:23:17 +0000 (10:23 -0600)]
Remove forward slash in trimmer args (#80631)
Egor Bogatov [Sat, 14 Jan 2023 10:43:56 +0000 (11:43 +0100)]
Set FieldSeq in CreateSpan (#80622)
Sven Boemer [Sat, 14 Jan 2023 08:51:00 +0000 (00:51 -0800)]
Fix race condition in build (dotnet/linker#3185)
Commit migrated from https://github.com/dotnet/linker/commit/
44520382eda0c82c5a4d3f38d3f59965f3ba90b0
Michal Strehovský [Sat, 14 Jan 2023 06:09:05 +0000 (15:09 +0900)]
Allow eliminating virtual methods on abstract classes (#80607)
Allow removing method bodies of virtual methods on abstract classes when the methods were overriden by descendants.
E.g.
```csharp
Base b = new Derived();
b.Expensive();
abstract class Base
{
public virtual void Expensive() { expensive stuff; }
}
class Derived : Base
{
public override void Expensive() { other stuff; }
}
```
The method body of `Base.Expensive` is unreachable, but we're still generating it because it's referenced from the `Base` vtable. Not anymore.
This is pretty much a rollback of https://github.com/dotnet/runtime/pull/66145 with a small fix in ILScanner that fixes the problematic scenarios. I don't know why I gave up so quickly last time.
What we do is instead of generating hard dependencies on the implementation method entrypoints in abstract classes, we delay the dependency on the entrypoint until a derived non-abstract MethodTable. If no non-abstract `MethodTable` that uses this shows up, the entrypoint turns into a throw helper.
Bruce Forstall [Sat, 14 Jan 2023 06:08:48 +0000 (22:08 -0800)]
Add additional IG assertion checking (#80599)
* Add additional IG assertion checking
Especially, check various IG flags to ensure illegal combinations
do not occur.
* Feedback