Thefrank [Wed, 11 Jan 2023 10:29:31 +0000 (02:29 -0800)]
Fix CPU_COUNT check for FreeBSD 13.1+ (#77867)
HAVE_GNU_CPU_COUNT has always incorrectly failed for FreeBSD.
This has not been an issue until FreeBSD 13.1 with its addition of `sched_getaffinity` and `sched_setaffinity`.
Jakob Botsch Nielsen [Wed, 11 Jan 2023 08:19:46 +0000 (09:19 +0100)]
JIT: Add a pass of early liveness and use it for forward sub and last-use copy elision for implicit byrefs (#79346)
This runs a pass of liveness right after local morph and uses it for forward sub and to omit copies of structs when passed as implicit byrefs at their last use.
Fix #76069
Fix #75206
Fix #65025
Fix #9839
This PR introduces the following new JIT invariants:
* When optimizing, local morph will now thread all locals into a tree list accessed by Statement::LocalsTreeList. This tree list is kept valid starting from local morph and ending with forward sub. There is no memory impact of this since we reuse the GenTree::gtPrev and GenTree::gtNext fields.
* Early liveness information (GTF_VAR_DEATH and the promoted struct death vars map) is kept valid (sound) starting from early liveness and ending with morph.
There are asserts that the tree list is up to date when it is accessed. This is done through a new member fgNodeThreading that replaces the preexisting fgStmtListThreaded and keeps information about what the current kind of node threading is.
The benefits are large, -2 MB on win-x64 collections (-0.85% on libraries.pmi that only has optimized contexts), with a number of regressions as expected when removing locals.
The improvements primarily come from the omission of copies for implicit byrefs, so the benefits on platforms with fewer implicit byrefs is smaller, but the forward sub change alone is still very impactful (e.g. -300K on linux-x64).
The throughput impact is around 1% in optimized contexts and below 0.1% in unoptimized contexts, the latter due to local morph needing to check if it should be threading nodes.
Viktor Hofer [Wed, 11 Jan 2023 08:16:41 +0000 (09:16 +0100)]
Remove Drawing.Common .NETCoreApp PNSEs (#80435)
System.Drawing.Common was throwing PNSEs on non Windows platforms when
accessing public API which makes sense as the library isn't supposed to
be used on other platforms.
That said, we already have a runtime hook that throws when DllImports
are invoked. We intentionally want to allow accessing Drawing exchange
types to not break customers when they don't rely on GDI+ or other
native functions.
This is also part of a wider effort that allows this library to be
ported to another repository (which doesn't support targeting RIDs).
Mike McLaughlin [Wed, 11 Jan 2023 08:13:37 +0000 (00:13 -0800)]
Fix multiple dumps from being generated (#80474)
Issue: https://github.com/dotnet/runtime/issues/78956
After a core dump is generated because of a unhandled managed exception
abort() is called but a SIGSEGV is generated in libpthread.so which is
caught by the runtime and a second core dump is generated. The fix is
to uninstall/uninitialize all the signal handlers, not just SIGABORT.
Katelyn Gadd [Wed, 11 Jan 2023 05:39:19 +0000 (21:39 -0800)]
[wasm] Jiterpreter opcode updates + implement safepoints (#80479)
* Implement CPOBJ_VT_NOREF
* Implement STOBJ_VT_NOREF and improve bailout statistics
* Support performing safepoints in jiterpreter traces without bailing out
Michal Strehovský [Wed, 11 Jan 2023 02:37:52 +0000 (11:37 +0900)]
Reduce the number of forced `MethodTable`s (#79594)
When we're doing an optimized build, we go over the whole program twice:
* First time to build a whole program view: at this point we e.g. scan the IL method bodies to see what they depend on, or analyze reflection use within the program
* The second time to do actual codegen: this time we no longer analyze reflection use and expect that the first phase would have rooted everything that's necessary from reflection perspective.
In both phases, we assume any type with a "constructed" `MethodTable` is visible to reflection because one can just call `object.GetType()` and reflect on stuff. We need to pass a list of constructed `MethodTable`s from the first phase to the second phase because some `MethodTable`s could be the result of reflection analysis and we need to make sure they're compiled.
But crucially, up until now we didn't really track which `MethodTable`s are actual reflection roots and which ones just showed up in the dependency graph because the analyzed program happened to use it. We don't actually need to pass the latter ones as roots to compilation because the compilation phase is going to figure them out if they're needed anyway and if the compilation doesn't come up with some, that's fine because one wouldn't be able to call `object.GetType` on those anyway, because they're _not actually part of the program_.
Passing all of the MethodTables we saw from scanning to compilation is actually size bloat because scanning overapproximates things (by necessity, since it doesn't have a whole program view).
In this pull request I'm introducing `ReflectedTypeNode` to model `MethodTable`s that are actual targets of reflection. Only those will get passed as roots to the compilation phase. From now on we need to be mindful of how we refer to types. If a reference to a type is a result of non-code dependency, we should use `ReflectedType` to model it.
Saves about 1.2% (32 kB) in size on a Hello World.
I'm seeing it helps in two patterns:
https://github.com/dotnet/runtime/blob/
b1a2080b9ce5833802fe2d632f79de6402097f14/src/libraries/System.Private.CoreLib/src/System/Byte.cs#L1088-L1093
RyuJIT is able to eliminate the dead code in the if branch, but we were still rooting the type within the branch from the box.
The second pattern seems to be around RyuJIT devirtualizing things and preventing a box, which now eliminates the `MethodTable`.
tkrafael [Wed, 11 Jan 2023 00:41:22 +0000 (21:41 -0300)]
Feature/logging messagetemplate compat (#80364)
Co-authored-by: Rafael Nicoletti <rafael.nicoletti@ubuntu>
Allan Targino [Tue, 10 Jan 2023 23:45:30 +0000 (20:45 -0300)]
Adds diagnostic for out parameter in LSG (#80458)
fixes https://github.com/dotnet/runtime/issues/64665
Szczepan Ćwikliński [Tue, 10 Jan 2023 23:35:16 +0000 (00:35 +0100)]
Add initial support for FreeBSD.arm64 (#71486)
* changes to compile runtime under FreeBSD ARM64 host
* TOOLSET_PREFIX for FreeBSD host set to llvm during crossbuild
* Detect FreeBSD amd64 or aarch64 message
* Fix gen-dactable-rva.sh padding zeros
* cross build options for FreeBSD arm64 for mono
* Revert eng/native/configuretools.cmake
* Try to better detect host arch under FreeBSD
* Indent
* Don't pad DAC_TABLE_RVA
* Comment update
* Add freebsd-arm64 RIDs, enable CG2 package generation for FreeBSD builds
* Extra condition for mono build
* Added targetos to crossgen2 command during build
* Add targetos along with targetarch for crossgen2 commands
* Typo fixed in comment
* Set Cpsr to gp_spsr for FreeBSD/aarch64 (still crashing exception
unwind)
* Fix mono configure/build CPU_COUNT for FreeBSD
* Use check_symbol_exists for HAVE_GNU_CPU_COUNT check
* fix cross compile error
* Fix build error with targetos
Co-authored-by: Szczepan <sec@codebay.pl>
Juan Hoyos [Tue, 10 Jan 2023 21:42:41 +0000 (13:42 -0800)]
Revert "Reserve memory for FOH in-range (#78292)" (#80400)
Original change did improve codegen for certain cases but we were unable to detect performance improvements from that. It caused some troubles for !dumpheap - it's easier to revert it than fix.
Tlakaelel Axayakatl Ceja [Tue, 10 Jan 2023 21:33:04 +0000 (13:33 -0800)]
Build tools subset to generate artifacts (#80406)
Build the tools along with the libraries to produce the illink packages in the artifacts folder during the runtime official build (#80406)
Katelyn Gadd [Tue, 10 Jan 2023 21:10:49 +0000 (13:10 -0800)]
[wasm] optimize out 'is this method MulticastDelegate.Invoke' checks in aot->interp transitions (#80181)
* When creating an InterpMethod, identify whether it is MulticastDelegate.Invoke and store that in a flag to optimize interp_entry
* Always inline some jiterpreter APIs
Bruce Forstall [Tue, 10 Jan 2023 20:51:19 +0000 (12:51 -0800)]
Increase test scenario invocation parallelism (#80409)
The MSBuild code that invokes Helix to execute coreclr and libraries tests
spawns an MSBuild task for each "configuration" (which is a particular set of
environment variables, such as a set of JIT stress modes), and each of those
MSBuild invocations creates a (large) set of HelixWorkItem that are submitted
to Helix for running for that particular configuration. (One HelixWorkItem
is created for each partition of the test tree). But the MSBuild task also
waits for all the work items to finish before letting another configuration
start. The MSBuild invocations are run in parallel, but only to the level
of parallelism allowed by MSBuild settings. MSBuild is invoked with "/maxcpucount",
which means one MSBuild "node" per processor on the machine, thus one
configuration in parallel per processor. The AzDO machines we run on appear
to have 3 processors allocated to them (at least in some cases). Many test configurations
have far more than 3 configurations (e.g., jitstress-isas-x86 has 55 configurations),
so that's a lot of waiting.
These MSBuild tasks are doing very little: creating HelixWorkItems, invoking Helix,
and waiting. We can run many, many more MSBuild tasks in parallel,
to "flood" Helix with more work that could be done in parallel.
This change passes a larger `/maxcpucount` argument when invoking MSBuild in
cases where this would be beneficial.
(Note that ideally we wouldn't depend on MSBuild parallelism, and a single MSBuild
instance, or other code not written in MSBuild, could create and wait for all the
needed HelixWorkItems for all scenarios in a single process. But that's not how
it's currently architected.)
Eric Erhardt [Tue, 10 Jan 2023 19:57:11 +0000 (13:57 -0600)]
Remove RequiresDynamicCode from Microsoft.Extensions.DependencyInjection (#79425)
* Remove RequiresDynamicCode from Microsoft.Extensions.DependencyInjection
We need a better approach in order to support applications that use DependencyInjection and publish for NativeAOT. DependencyInjection needs to have reliable behavior before and after publishing for NativeAOT. The application can't work successfully at development-time, but then fail after publishing with PublishAot=true.
We will resolve the 2 NativeAOT warnings above by adding a runtime check that is behind the new AppContext switch added in https://github.com/dotnet/runtime/pull/80246 (`System.Runtime.CompilerServices.RuntimeFeature.IsDynamicCodeSupported`). The runtime check ensures the Types being used with Enumerable and Open Generic services are only Reference Types. If an application tries to create an Enumerable or Closed Generic service of a ValueType, DependencyInjection will throw an exception. The check is enabled by default when PublishAot=true.
Fix #79286
Alexander Köplinger [Tue, 10 Jan 2023 17:57:38 +0000 (18:57 +0100)]
Don't upgrade homebrew packages in CI (#80443)
Fixes https://github.com/dotnet/runtime/issues/80428, originally caused by https://github.com/actions/setup-python/issues/577 and https://github.com/actions/runner-images/issues/6868
Thays Grazia [Tue, 10 Jan 2023 17:34:14 +0000 (14:34 -0300)]
[wasm][debugger] Removing console.debug message helper to make debugger work. (#72812)
* Removing console.debug message helper to make debugger work.
* Update src/mono/wasm/runtime/debug.ts
Co-authored-by: Larry Ewing <lewing@microsoft.com>
* Addressing @radical comments offline.
* Fixing merge.
* Fix line change error.
* Totally removing the message.
* Remove unused comment
Co-authored-by: Larry Ewing <lewing@microsoft.com>
Co-authored-by: Ilona Tomkowicz <32700855+ilonatommy@users.noreply.github.com>
Thays Grazia [Tue, 10 Jan 2023 15:45:58 +0000 (12:45 -0300)]
Reverting wrong commit changing the helloworld sample (#80390)
Steve Pfister [Tue, 10 Jan 2023 14:53:05 +0000 (09:53 -0500)]
[workloads] Specify arm64 alias instead of arm in the arm64 pack (#79555)
Kunal Pathak [Tue, 10 Jan 2023 14:20:21 +0000 (06:20 -0800)]
Cache allregs to avoid checking the type repeatedly (#76850)
* cache the available registers
* Convert to PhasedVar
* Store the references instead of values
* Replace allRegs(constant_index) with actual values
* Remove call to varTypeIsSIMD()
Stephen Toub [Tue, 10 Jan 2023 12:53:48 +0000 (07:53 -0500)]
Remove some string allocation from NormalizeServiceName (#80384)
Mostly just using AsSpan/Slice instead of Substring. The remaining Substrings could away if we added a Uri.CheckHostName overload that took a span.
Stephen Toub [Tue, 10 Jan 2023 12:48:21 +0000 (07:48 -0500)]
Remove Substrings from PhoneAttribute (#80389)
Miha Zupan [Tue, 10 Jan 2023 11:50:44 +0000 (12:50 +0100)]
Enforce HttpClient limits on GetFromJsonAsync (#79386)
* Enforce HttpClient limits on GetFromJsonAsync
* Disable tests requiring Sockets on Browser
* Avoid LengthLimitReadStream overhead for DeleteFromJsonAsync
* Improve wrapper stream
* Remove content null check
Badre BSAILA [Tue, 10 Jan 2023 11:15:38 +0000 (12:15 +0100)]
measure the perf impact of deduplicating IsCompleted call in GetConsumingEnumerable (#78887)
* measure the perf impact of deduplicating IsCompleted call in GetConsumingEnumerable
* simplify the while condition
Co-authored-by: Krzysztof Wicher <mordotymoja@gmail.com>
Co-authored-by: Krzysztof Wicher <mordotymoja@gmail.com>
dotnet-maestro[bot] [Tue, 10 Jan 2023 11:01:15 +0000 (12:01 +0100)]
[main] Update dependencies from dotnet/icu dotnet/runtime-assets dotnet/emsdk dotnet/runtime dotnet/roslyn-analyzers dotnet/roslyn dotnet/llvm-project (#80235)
* Update dependencies from https://github.com/dotnet/runtime-assets build
20230104.2
Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Drawing.Common.TestData , System.Formats.Tar.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.23054.1 -> To Version 8.0.0-beta.23054.2
* Update dependencies from https://github.com/dotnet/emsdk build
20230104.1
Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100
From Version 8.0.0-alpha.1.22620.1 -> To Version 8.0.0-alpha.1.23054.1
* Update dependencies from https://github.com/dotnet/roslyn-analyzers build
20230104.1
Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
From Version 3.3.4-beta1.23053.6 -> To Version 3.3.4-beta1.23054.1
* Update dependencies from https://github.com/dotnet/roslyn build
20230104.16
Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
From Version 4.6.0-1.23054.2 -> To Version 4.6.0-1.23054.16
* Update dependencies from https://github.com/dotnet/roslyn-analyzers build
20230105.4
Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
From Version 3.3.4-beta1.23053.6 -> To Version 3.3.4-beta1.23055.4
* Update dependencies from https://github.com/dotnet/roslyn build
20230105.11
Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
From Version 4.6.0-1.23054.2 -> To Version 4.6.0-1.23055.11
* Update dependencies from https://github.com/dotnet/llvm-project build
20230106.1
runtime.linux-arm64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-musl-x64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-musl-x64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-x64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.ObjWriter , runtime.osx.11.0-arm64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.osx.11.0-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.ObjWriter , runtime.win-arm64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.win-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.win-x64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.ObjWriter
From Version 1.0.0-alpha.1.23052.1 -> To Version 1.0.0-alpha.1.23056.1
* Update dependencies from https://github.com/dotnet/icu build
20230106.1
Microsoft.NETCore.Runtime.ICU.Transport
From Version 8.0.0-alpha.1.23052.1 -> To Version 8.0.0-alpha.1.23056.1
* Update dependencies from https://github.com/dotnet/roslyn-analyzers build
20230106.1
Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
From Version 3.3.4-beta1.23053.6 -> To Version 3.3.4-beta1.23056.1
* Update dependencies from https://github.com/dotnet/roslyn build
20230106.14
Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
From Version 4.6.0-1.23054.2 -> To Version 4.6.0-1.23056.14
* Update dependencies from https://github.com/dotnet/roslyn build
20230108.1
Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
From Version 4.6.0-1.23054.2 -> To Version 4.6.0-1.23058.1
* Fix new compiler warning
* More warning fixes
* Update dependencies from https://github.com/dotnet/runtime-assets build
20230109.1
Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Drawing.Common.TestData , System.Formats.Tar.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.23054.1 -> To Version 8.0.0-beta.23059.1
* Update dependencies from https://github.com/dotnet/runtime build
20230108.2
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-alpha.1.22631.1 -> To Version 8.0.0-alpha.1.23058.2
* Update dependencies from https://github.com/dotnet/roslyn-analyzers build
20230108.2
Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
From Version 3.3.4-beta1.23053.6 -> To Version 3.3.4-beta1.23058.2
* Update dependencies from https://github.com/dotnet/llvm-project build
20230109.1
runtime.linux-arm64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-musl-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-musl-x64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-musl-x64.Microsoft.NETCore.Runtime.ObjWriter , runtime.linux-x64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.ObjWriter , runtime.osx.11.0-arm64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.osx.11.0-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.ObjWriter , runtime.win-arm64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.win-arm64.Microsoft.NETCore.Runtime.ObjWriter , runtime.win-x64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.ObjWriter
From Version 1.0.0-alpha.1.23052.1 -> To Version 1.0.0-alpha.1.23059.1
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: vitek-karas <10670590+vitek-karas@users.noreply.github.com>
dotnet bot [Tue, 10 Jan 2023 10:57:02 +0000 (02:57 -0800)]
Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2083765 (#80405)
Qiao Pengcheng [Tue, 10 Jan 2023 10:02:05 +0000 (05:02 -0500)]
[LoongArch64] fix the addr error on embedded CPU. (#80412)
Michal Strehovský [Tue, 10 Jan 2023 07:48:18 +0000 (16:48 +0900)]
Generate fewer TentativeInstanceMethod nodes (#80414)
In order for the compiler to be able to eliminate bodies of instance methods on types that were never allocated, the compiler has a concept of "tentative instance methods".
E.g.
```csharp
Foo f = null;
f?.DoSomething();
class Foo
{
public void DoSomething() { expensive stuff }
}
```
When compiling `Main()` instead of generating code that refers to the entrypoint of `DoSomething` (that we would then have to compile), we generate it as a reference to a "tentative method". This tentative method will either turn into a throw helper, or the real instance method. This depends on whether the owning type of the method was seen as allocated - the tentative method conditionally depends on the real body if the type was allocated.
Before this PR, tentative methods were dispensed from `MethodEntrypoint` method on `NodeFactory`. I.e. anyone asking for a method entrypoint could potentially get a tentative entrypoint. But this also means that places that refer to method bodies and already know the owning type is allocated still introduce an unnecessary tentative entrypoint node. They should refer to the entrypoint directly. This pull request does that. One now needs to explicitly ask for a tentative entrypoint - `MethodEntrypoint`. We actually only have two places that really need to do it.
This is pretty much a zero diff change - we only change bookkeeping within the compiler.
I saw one difference in WebApi - references to finalizers from unconstructed MethodTables now bring the real method. We can fix that multiple ways. I couldn't decide the best one, so I left it out for now (should we ask for a tentative entrypoint? should we fill it out as zero? should we say unconstructed types don't have finalizers and skip it?)
Giridhar Trivedi [Tue, 10 Jan 2023 03:04:25 +0000 (08:34 +0530)]
[mono] Fix crash when GetDelegateForFunctionPointer is passed non delegate type (#79744)
When GetDelegateForFunctionPointer is invoked with non delegate type.
It iterates over all the methods available to check if these
methods are present. "Invoke" method is one such method which is
executed by the coreCLR for any type of delegates. Having said that
with non delegate "Invoke" method is not supported hence
"mono_class_get_method_from_name_checked" returns NULL.
Handle this case whenever mono_class_get_method_from_name_checked
returns NULL for any methods which are not supported.
Co-authored-by: Giridhar Trivedi <giridhar.trivedi@in.ibm.com>
Giridhar Trivedi [Tue, 10 Jan 2023 03:03:23 +0000 (08:33 +0530)]
Handle crash when [out] parameter of type Intptr* is passed to delegate (#79763)
When a delegate is passed an [out] parameter of type "intptr *"
it will crash since this data type is not handled in
emit_managed_wrapper_ilgen. This will lead to a crash.
With this fix [out] parameter of type "Intptr *" is handled
after adding an addition case statement to handle MONO_TYPE_PTR
in emit_managed_wrapper_ilgen.
Co-authored-by: Giridhar Trivedi <giridhar.trivedi@in.ibm.com>
Stephen Toub [Tue, 10 Jan 2023 02:31:00 +0000 (21:31 -0500)]
Remove Substring from EventSource.InitializeProviderMetadata (#80386)
Eric Erhardt [Tue, 10 Jan 2023 02:29:19 +0000 (20:29 -0600)]
Update Libraries Feature Switches for DynamicCodeSupport (#80397)
Elinor Fung [Tue, 10 Jan 2023 02:26:06 +0000 (18:26 -0800)]
Remove check for assembly name in p/invoke library load (#80394)
Stephen Toub [Tue, 10 Jan 2023 01:28:02 +0000 (20:28 -0500)]
Rename some BinaryPrimitives files (and move some functions) (#80381)
Zero code changes... just renamed some files, moved the contents of one file to another, and deleted a then empty file.
Stephen Toub [Tue, 10 Jan 2023 01:27:32 +0000 (20:27 -0500)]
Add public RefSafetyRulesAttribute (#80379)
Jakob Botsch Nielsen [Mon, 9 Jan 2023 23:38:05 +0000 (00:38 +0100)]
AOT: Handle printing names of generic parameter types (#80371)
This case is hittable with tokens representing open generic types that
may have their full type names printed as a comment in JIT disasm after
e398ba2.
Tanner Gooding [Mon, 9 Jan 2023 21:35:55 +0000 (13:35 -0800)]
Add a debug only config knob to control the maximum force inline depth (#80349)
Tomáš Rylek [Mon, 9 Jan 2023 21:31:17 +0000 (22:31 +0100)]
Fix HFA detection in Crossgen2 (#80218)
According to customer feedback some WPF apps are crashing on arm64
at runtime in debug mode when compiled with Crossgen2. Based on
the initial investigation by Anton Lapounov and with help from
Jan Vorlicek I have managed to identify that the problem is caused
by a mismatch between the native CoreCLR runtime and Crossgen2
w.r.t. identification of HFA types.
This change puts Crossgen2 behavior in sync with the CoreCLR
runtime. I have verified locally that this makes the GC ref map
for the method System.Windows.Media.PathGeometry.GetPathBoundsAsRB
identical with the runtime version and avoids the assertion failure
that was previously triggered in debug CoreCLR builds due to this
mismatch.
Thanks
Tomas
Lee Coward [Mon, 9 Jan 2023 20:47:13 +0000 (12:47 -0800)]
remove draft UUID section superseded by RFC 4122 (#80377)
Eric Erhardt [Mon, 9 Jan 2023 20:42:00 +0000 (14:42 -0600)]
Add IsDynamicCodeSupported Feature Switch (#80246)
* Add IsDynamicCodeSupported Feature Switch
This adds the ability to disable reflection emit for testing. It also allows for applications/libraries to simulate NativeAOT behavior (like switching on RuntimeFeature.IsDynamicCodeSupported) without actually publishing for NativeAOT.
Fix #39806
* Add IsDynamicCodeSupported feature switch support for Mono
* Remove featuredefault for IsDynamicCodeSupported so it isn't substituted during CoreLib's build.
* Add Intrinsic attribute back for Mono
Eirik Tsarpalis [Mon, 9 Jan 2023 20:04:42 +0000 (20:04 +0000)]
Add sourcegen support for required & init-only properties. (#79828)
* Add sourcegen support for required & init-only properties.
* Add test coverage for required fields & remove a few async void methods.
* Remove commented out code.
* Tweak JsonSerializerOptions resolution logic in wrapper implementation
Bruce Forstall [Mon, 9 Jan 2023 18:56:09 +0000 (10:56 -0800)]
Report more accurately when loop unrolling changes the IR (#80310)
Since unrolling rarely kicks in, reduce JitDump volume by not printing
IR in the JitDump after the unrolling phase unless necessary.
Adam Sitnik [Mon, 9 Jan 2023 18:53:02 +0000 (19:53 +0100)]
perfcollect docs: run two commands instead of three (#76325)
Mukund Raghav Sharma (Moko) [Mon, 9 Jan 2023 18:04:48 +0000 (10:04 -0800)]
Updated type of heap_segment_survived from int to size_t to facilitate survival >= 2GB. (#80302)
* Updated type of survived from int to size_t
* Fixed another printf message
* Reordered the survived field
* Addressed feedback.
Co-authored-by: Mukund Raghav Sharma <musharm@microsoft.com>
Allan Targino [Mon, 9 Jan 2023 17:54:57 +0000 (14:54 -0300)]
retrieve method symbol only once in logging source gen parser (#80365)
Martin Taillefer [Mon, 9 Jan 2023 15:58:12 +0000 (07:58 -0800)]
Add more specialized frozen collection types. (#79794)
* Add more specialized frozen collection types.
- Add SmallFrozenDictionary/Set which don't do any hashing and simply iterate through arrays,
testing each element
- Add SparseRangeInt32FrozenSet which uses a bit vector for storage.
FrozenDictionary/Set each have some constants defined to drive the heuristics that
decide when to use the small and sparse collection types. I did some preliminary tuning
of these, but this could use a detailed benchmark to pick the right values. I'll leave
the fine-tuning to a separate PR.
* Expand supported numeric sets on .NET 7+
Co-authored-by: Martin Taillefer <mataille@microsoft.com>
Radek Doulik [Mon, 9 Jan 2023 10:41:51 +0000 (11:41 +0100)]
Use PackedIndexOfIsSupported checks in more places (#80254)
* Use PackedIndexOfIsSupported checks in more places
This should avoids the size regression on WebAssembly and possibly other
platforms without Sse2.
The regression is side effect of https://github.com/dotnet/runtime/pull/78861
which uses `PackedSpanHelpers.CanUsePackedIndexOf (!!T)` and TShouldUsePacked.Value
to guard the usage of PackedSpanHelpers.
Because these involve generics, illinker is unable to link
the PackedSpanHelpers type away and that pulls other parts in, like
System.Runtime.Intrinsics.X86.* types. See https://gist.github.com/radekdoulik/
c0b52247d472f69bcf983ade78a924ea
for more complete list.
This change gets us back 9,216 bytes in the case of app used to repro
the regression.
...
- Type System.PackedSpanHelpers
- Type System.Runtime.Intrinsics.X86.X86Base
- Type System.Runtime.Intrinsics.X86.Sse
- Type System.Runtime.Intrinsics.X86.Sse2
Summary:
- 9,216 File size -0.76% (of 1,215,488)
- 2,744 Metadata size -0.43% (of 636,264)
- 4 Types count
* Update src/libraries/System.Private.CoreLib/src/System/IndexOfAnyValues/IndexOfAnyValues.cs
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* Update src/libraries/System.Private.CoreLib/src/System/IndexOfAnyValues/IndexOfAnyValues.cs
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* Feedback
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
Jakob Botsch Nielsen [Mon, 9 Jan 2023 09:30:42 +0000 (10:30 +0100)]
JIT: Fall back to a canonical SIMD handle in gtGetStructHandleForSimdOrHW (#80240)
Jakob Botsch Nielsen [Mon, 9 Jan 2023 09:30:12 +0000 (10:30 +0100)]
JIT: Fix purity of CORINFO_HELP_GETREFANY on win-x64 (#80292)
We mark this helper as pure, but on win-x64 the struct argument becomes
an implicit byref and the JIT does not support purity through the
"load".
Radek Zikmund [Mon, 9 Jan 2023 08:34:05 +0000 (09:34 +0100)]
Add SslClientAuthenticationOptions.ClientCertificateContext (#80182)
* Add SslClientAuthenticationOptions.ClientCertificateContext
* Minor changes
* Add test for mutual authentication
* Add diagnostic events
* More tests
* Small fixes
* fixup! Add diagnostic events
* Regenerate ref files
* Early return in case of CertificateContext
* Remove unwanted test
* fixup! Early return in case of CertificateContext
* Add docs
* Fix failing test on Win 7
* Remove unnecessary section in mutual auth test
* Fix failing tests
* Fix test failures on OSX
dotnet bot [Mon, 9 Jan 2023 08:29:54 +0000 (00:29 -0800)]
Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2081878 (#80322)
tkrafael [Mon, 9 Jan 2023 00:42:28 +0000 (21:42 -0300)]
initial support for '@' symbol in message template (#79038)
Co-authored-by: Rafael Nicoletti <rafael.nicoletti@ubuntu>
Qiao Pengcheng [Sun, 8 Jan 2023 08:00:22 +0000 (03:00 -0500)]
[LoongArch64] amend the ABI for the tests: (#80326)
`JIT/SIMD/Vector3Interop_r/Vector3Interop_r.sh`
`JIT/Directed/VectorABI/VectorMgdMgd_r/VectorMgdMgd_r.sh`
Vladimir Sadov [Sun, 8 Jan 2023 07:50:29 +0000 (23:50 -0800)]
clone the QueueUserAPC2 related defninitions to not require 22621 (#80333)
Jason Malinowski [Sun, 8 Jan 2023 04:08:48 +0000 (20:08 -0800)]
Mark Task.IsFaulted as ensuring that Task.Exception is non-null (#80278)
* Mark Task.IsFaulted as ensuring that Task.Exception is non-null
* Address PR feedback
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Huo Yaoyuan [Sun, 8 Jan 2023 03:46:57 +0000 (11:46 +0800)]
Add debugger display for huge BigInteger (#75796)
* Add debugger display for huge BigInteger
* Apply suggestions from code review
Co-authored-by: tfenise <tfenise@live.com>
* Adjust for overflow and rounding
* Fix and add test
* Apply suggestions from code review
Co-authored-by: tfenise <tfenise@live.com>
* Skip test on browser
* Adjust overflow handling and comment
* Apply suggestions from code review
Co-authored-by: Dan Moseley <danmose@microsoft.com>
* Revert "Adjust overflow handling and comment"
This reverts commit
ceac7654aeb7ce4b2b91f6d84cf891c4bcdce755.
* Update ToString culture
Co-authored-by: tfenise <tfenise@live.com>
* Apply suggestions from code review
Co-authored-by: Tanner Gooding <tagoo@outlook.com>
* Update for constant and shortcut
* Use invariant culture in test
* Use log10(2) as a constant
Co-authored-by: Drew Kersnar <18474647+dakersnar@users.noreply.github.com>
* Update length thresold to 4*uint
* Update bigger test cases
* Update test value
Co-authored-by: tfenise <tfenise@live.com>
Co-authored-by: Dan Moseley <danmose@microsoft.com>
Co-authored-by: Tanner Gooding <tagoo@outlook.com>
Co-authored-by: Drew Kersnar <18474647+dakersnar@users.noreply.github.com>
Jochem [Sun, 8 Jan 2023 03:43:31 +0000 (04:43 +0100)]
Clarify INumber.IsPositive and INumber.IsNegative documentation (#80026)
* Clarify INumber.IsPositive and INumber.IsNegative documentation
* Add clarification for negative zero
gpetrou [Sun, 8 Jan 2023 03:40:18 +0000 (05:40 +0200)]
Fix nullable annotations in ITypedList (#80033)
Steve Molloy [Sun, 8 Jan 2023 03:38:04 +0000 (19:38 -0800)]
Restore Advance when reading float/double with XmlBufferReader. (#80274)
* Restore Advance when reading float/double with XmlBufferReader.
* Removing extra unneeded usings that got magically added and are failing on not-my-machine.
Stephen Toub [Sat, 7 Jan 2023 20:48:01 +0000 (15:48 -0500)]
Enable new analyzers CA1510/11/12/13 and CA1856/57/58 (#80149)
* Enable new analyzers CA1510/11/12/13 and CA1856/57/58
CA1510: Use ArgumentNullException throw helper
CA1511: Use ArgumentException throw helper
CA1512: Use ArgumentOutOfRangeException throw helper
CA1513: Use ObjectDisposedException throw helper
CA1856: Incorrect usage of ConstantExpected attribute
CA1857: A constant is expected for the parameter
CA1858: Use 'StartsWith' instead of 'IndexOf'
* More fixes
* Address PR feedback
madelson [Sat, 7 Jan 2023 20:10:22 +0000 (15:10 -0500)]
Increase timeout for TestResourceManagerIsSafeForConcurrentAccessAndEnumeration (#80330)
This raises the timeout to 30s, the same as what we have for the equivalent ResourceManager test (https://github.com/dotnet/runtime/blob/
15fcb990fe17348ab6ddde0939200b900169920b/src/libraries/System.Resources.ResourceManager/tests/ResourceManagerTests.cs#L255).
fix #80277
Lee Coward [Sat, 7 Jan 2023 20:10:04 +0000 (12:10 -0800)]
remove UUID section superceded by RFC 4122 (#80320)
Qiao Pengcheng [Sat, 7 Jan 2023 16:04:29 +0000 (11:04 -0500)]
[LoongArch64] Fix the building error for GenTreeIntrinsic. (#80325)
Pavel Savara [Sat, 7 Jan 2023 07:20:27 +0000 (08:20 +0100)]
[wasi] compile with libs.native (#79046)
* setup compilation of libs.native and mono for WASI platform
* provision SDK and wasmtime
* feedback
Co-authored-by: Ankit Jain <radical@gmail.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
Jo Shields [Sat, 7 Jan 2023 03:37:16 +0000 (22:37 -0500)]
Fix failing official build (#80316)
Resolves official build breakage caused by https://github.com/dotnet/runtime/pull/74428 (where `PackageRID` can be `linux-wasm` or `osx-wasm` instead of `browser-wasm` when `/p:PortableBuild=true`, but `OutputRid` is fine)
Jeremy Koritzinsky [Sat, 7 Jan 2023 02:04:07 +0000 (18:04 -0800)]
Fix alloc/dealloc mismatches and some buffer overruns found by ASAN (#80189)
Tanner Gooding [Sat, 7 Jan 2023 00:45:06 +0000 (16:45 -0800)]
Rewrite how Matrix3x2 and Matrix4x4 are implemented (#80091)
* Rewrite how Matrix3x2 and Matrix4x4 are implemented
* Fix a bug in lowerxarch related to merging Sse41.Insert chains
Vladimir Sadov [Fri, 6 Jan 2023 23:45:45 +0000 (15:45 -0800)]
[NativeAOT] Use QueueUserAPC2 in GC suspension, if available. (#80087)
* QueueUserAPC2
* fixes, do not stack APCs
* adjust for newer SDK
* force a failure - to see if lab machines have support for this
* cleanup some includes
* FEATURE_SUSPEND_APC2
* remove intentional failure
* one more case of FEATURE_SUSPEND_APC2
* comment
* fail if QUEUE_USER_APC_CALLBACK_DATA_CONTEXT supported
* Apply suggestions from code review
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* FEATURE_SUSPEND_APC2 -> FEATURE_SPECIAL_USER_MODE_APC
* throw - to make sure this fails on Release builds
* un-break the feature
* fix for a stress issue.
* check for a failure to queue an APC.
* use the same activation optimization on Unix
* PR feedback
* unmark ActivationPending if APC failed to queue.
* a bit more robust against sharing the signal with something else.
* initialize QueueUserAPC2 on demand
* Check for STATUS_INVALID_PARAMETER
* print the error
* STATUS_INVALID_PARAMETER -> ERROR_INVALID_PARAMETER
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Tomáš Rylek [Fri, 6 Jan 2023 22:48:16 +0000 (23:48 +0100)]
Improve logging of GC ref map mismatches (#80219)
Katelyn Gadd [Fri, 6 Jan 2023 22:19:05 +0000 (14:19 -0800)]
Improve jiterpreter heuristic branch handling (#80275)
* Improve jiterpreter heuristic and bailout conditions
* Handle backwards branches in the jiterpreter heuristic
Katelyn Gadd [Fri, 6 Jan 2023 22:18:22 +0000 (14:18 -0800)]
[wasm] add a total wasm bytes quota to the jiterpreter; adjust parameters (#80266)
* Adjust jiterpreter parameters to avoid making S.T.J AOT tests slower
* Add a total wasm bytes quota to the jiterpreter to avoid generating way too much code in degenerate cases
Rich Lander [Fri, 6 Jan 2023 22:04:02 +0000 (14:04 -0800)]
Update copyright guidance for Creative Commons (#80272)
* Update copyright guidance
* Update link
* Remove space
* Add public domain link
* Update CONTRIBUTING.md
* Update docs/project/copyright.md
Co-authored-by: Theodore Tsirpanis <teo@tsirpanis.gr>
* Update per feedback
* Address linter error
* Clean up wording
* Update links
* Clean up wording
Co-authored-by: Theodore Tsirpanis <teo@tsirpanis.gr>
Pavel Savara [Fri, 6 Jan 2023 20:18:17 +0000 (21:18 +0100)]
[browser] make dynamic import cancelable (#80257)
* make dynamic import cancelable
* feedback
Andy Ayers [Fri, 6 Jan 2023 20:06:07 +0000 (12:06 -0800)]
JIT: Refactor post phase checks (#80194)
Add finer-grained notions of what post-phase checks are enabled. Start checking
some IR and FG invariants earlier than we did before.
This is largely done in anticipation of moving pred list building earlier
(#80193). We should also consider moving some of the IR checking
earlier as well.
Bruce Forstall [Fri, 6 Jan 2023 19:55:04 +0000 (11:55 -0800)]
Convert JitHashTable iteration to range-based `for` (#80265)
Tanner Gooding [Fri, 6 Jan 2023 18:58:01 +0000 (10:58 -0800)]
SimdAsHWIntrinsic improvements and cleanup (#80134)
* Merge common code paths in simdashwintrinsic.cpp
* Fixing a bug in the WithElement node for CreateFromVector
* Ensure simdashwintrinsic paths consistently use the gtNewSimd*Node helpers where one path was already
* Ensure remaining simdashwintrinsic paths use the gtNewSimd*Node helpers
* Consistently use fgMakeMultiUse in the gtNewSimd*Node APIs
* Applying formatting patch
* Ensure isSimdAsHWIntrinsic gets passed through
* Revert "Consistently use fgMakeMultiUse in the gtNewSimd*Node APIs"
This reverts commit
edb2ce8aa64c123f9407bd2a2f44c08900c54295.
* Handle SN_op_UnaryNegation for Vector2/3/4 on Mono
* Ensure short, ushort, float, and double don't assert for Vector128_Dot on downlevel hardware
Katelyn Gadd [Fri, 6 Jan 2023 18:55:42 +0000 (10:55 -0800)]
Fix alignment of interp stack on 32-bit platforms (#80299)
#80197 accidentally broke interp stack alignment on 32-bit platforms due to pointers being 4 bytes there.
Jan Vorlicek [Fri, 6 Jan 2023 17:26:31 +0000 (18:26 +0100)]
Fix embedded coreclr detection in corhost.cpp (#80294)
The `CORECLR_EMBEDDED` define that is used in corhost.cpp to detect
whether the current host has coreclr and some other native libraries
embedded or not doesn't work. The reason is that corhost.cpp is not
compiled separately for the cases of embedded and non-embedded coreclr.
The proper way is to check the `g_coreclr_embedded` global variable
that is defined in the ceemain.cpp, which is compiled separately for
those two cases.
While we could also make the corhost.cpp build twice, it would be
a waste of time.
Tanner Gooding [Fri, 6 Jan 2023 16:18:55 +0000 (08:18 -0800)]
Improving the SIMD codegen for SIMD12 load/store (#80083)
* Improving the SIMD codegen for SIMD12 load/store
* Apply formatting patch
* Ensure the right index is used for insertps
* Ensure emitIns_SIMD_* is used for insertps to handle the non-rmw form
* Fix the input size flag for extractps
* Fix an issue where the second half of a TYP_SIMD12 store used the wrong register
* Ensure relocatable handles for TYP_SIMD12 load/stores are not contained
* Ensure arm32 can build
Jan Vorlicek [Fri, 6 Jan 2023 16:02:30 +0000 (17:02 +0100)]
Remove incorrect assert from UnixEvent::Wait (#80270)
* Remove incorrect assert from UnixEvent::Wait
There is an incorrect assert checking that when `pthread_cond_timedwait`
timeouts, the event is not set. That assumption is incorrect, according
to the `pthread_cond_timedwait` documentation.
It fired in one of the CI runs recently.
Close #80166
* Fix one more occurence of the same assert
Austin Wise [Fri, 6 Jan 2023 14:04:15 +0000 (06:04 -0800)]
[NativeAOT] remove duplicate load of register (#80285)
This appears to be a copy-paste of the line above.
Tomas Weinfurt [Fri, 6 Jan 2023 08:14:14 +0000 (00:14 -0800)]
disable SendFileGetsCanceledByDispose on MacOS (#80286)
Michal Strehovský [Fri, 6 Jan 2023 08:00:10 +0000 (17:00 +0900)]
Add more precise tracking of static bases (#80093)
Under some circumstances, the compiler needs to generate information about the bases where static fields of a type are placed.
The existing logic was simple: if a static base was accessed, generate the owning type. If owning type was generated, generate all of it's static bases. At object emission, go over all generated types and preserve information about their bases.
We couldn't do better at the time this was implemented.
The information about static bases is needed in two cases:
1. A static field on the type is reflectable. We now know when that happens and it doesn't happen very often.
2. The generic type whose static base we generated has a template and we could build the type at runtime. This also doesn't happen very often anymore.
This PR teaches the compiler to only emit the information for these two cases. It prevents generating unnecessary EETypes, static bases, and .cctors.
Also adding a test case for scenario 2 above since we didn't have coverage for the scenario. Scenario 1 is covered.
Saves 0.2% on a hello world. Not much, but at least it's easier to reason about why this is generated.
Michał Petryka [Fri, 6 Jan 2023 07:35:57 +0000 (08:35 +0100)]
Convert MemoryMarshal.GetArrayDataReference to a JIT intrinsic (#79760)
* Convert MemoryMarshal.GetArrayDataReference to a JIT intrinsic
Converts MemoryMarshal.GetArrayDataReference to
an always expand JIT intrinsic and removes the VM intrinsics.
Introduces JIT tests validating the correct behaviour.
Fixes invalid codegen samples from:
https://github.com/dotnet/runtime/issues/58312#issuecomment-
993491291
* Update importer.cpp
* Update importer.cpp
* Update importer.cpp
* Update MemoryMarshalGetArrayDataReference.cs
* Update MemoryMarshalGetArrayDataReference.cs
* Fix nullchecks, improve tests, remove dead code
* Update project files
* Update MemoryMarshalGetArrayDataReference.cs
* Fix cloning of bounds-check-less INDEX_ADDRs
* Fix formatting
* Remove COMMA
* Move the nullcheck insertion to morph
* Fix compilation
* Revert morph changes
* Try a hack to see if the diffs are better
* Revert "Try a hack to see if the diffs are better"
This reverts commit
7af6e18a18457fa5f3eab4e73a5801ce9a9b2a16.
* Add more tests
* Future-proof against delegate inlining
* Redo changes, add test
* Revert merge issue
* Reorganize tests
* Update MemoryMarshalGetArrayDataReference.cs
* Update MemoryMarshalGetArrayDataReference.cs
* Test
* Update MemoryMarshalGetArrayDataReference.cs
* Update importercalls.cpp
* Update compiler.hpp
* Update compiler.hpp
* Update importercalls.cpp
* Add an assert
Co-authored-by: SingleAccretion <AccretionMail@yandex.ru>
Zoltan Varga [Fri, 6 Jan 2023 05:32:27 +0000 (00:32 -0500)]
[mono][aot] Disable dedup for wrapper with a return type which has a cmod. (#80279)
The wrappers are not found at runtime in some cases.
Ref: https://github.com/dotnet/runtime/issues/79814.
Tomas Weinfurt [Fri, 6 Jan 2023 05:27:55 +0000 (21:27 -0800)]
improve SslStream exception after disposal (#79329)
* improve SslStream exception after disposal
* add tests
* add StreamUse
* fix cleanup
* fix condition
* avoid casting
Vladimir Sadov [Fri, 6 Jan 2023 04:09:53 +0000 (20:09 -0800)]
Do not run managed pre-mortem callbacks for GC threads. (#80276)
Michal Strehovský [Fri, 6 Jan 2023 03:46:50 +0000 (12:46 +0900)]
Make metadata reader smaller (#80224)
Saves 12 kB of useless argument checks on a hello world.
Tanner Gooding [Fri, 6 Jan 2023 02:21:07 +0000 (18:21 -0800)]
Fix a build error around the ConstantExpected analyzer (#80282)
Ankit Jain [Fri, 6 Jan 2023 01:54:05 +0000 (20:54 -0500)]
[wasm] WBT: Update expected blazor tfm to net8.0 to match the latest sdk (#80241)
* [wasm] WBT: Update expected blazor tfm to net8.0 to match the latest sdk
* [wasm] WBT: Re-enable BlazorRunTest. Fixes #79514
* [wasm] WBT: re-enable running a blazor test
* [wasm] WBT: Use -O1 for some blazor tests
* Add -O1 for NativeBuild_WithDeployOnBuild_UsedByVS
* Fix test
Tanner Gooding [Fri, 6 Jan 2023 00:47:35 +0000 (16:47 -0800)]
Annotate platform specific hardware intrinsics with the ConstExpected attribute (#80192)
* Annotate platform specific hardware intrinsics with the ConstExpected attribute
* Remove a 'c' that was accidentally inserted
* Fixing using directives
Jan Kotas [Fri, 6 Jan 2023 00:06:05 +0000 (16:06 -0800)]
Use function pointers instead of marshalled delegates in EventSource (#79970)
* Delete obsolete security kernel annotations
* Use function pointers instead of marshalled delegates in EventSource
Zoltan Varga [Thu, 5 Jan 2023 23:35:29 +0000 (18:35 -0500)]
[wasm] Disable llvm for methods/calls with more than 1000 parameters. (#80243)
Some test suites are using methods like it and it causes a load
error in some v8 versions.
Will Smith [Thu, 5 Jan 2023 23:23:39 +0000 (15:23 -0800)]
[JIT] X64/ARM64 - Fold 'x & 255' and 'x & 65535' to a cast (#79630)
* Fold 'x & 256' and 'x & 65535'
* Remove comments
* Handle more cases
* Minor change
* Put header back
* Some refactoring
* Minor change
* Minor change
* Feedback
Aaron Robinson [Thu, 5 Jan 2023 22:37:07 +0000 (14:37 -0800)]
Fix assembly unloading for DispatchInfo (#80203)
* Fix assembly unloading for DispatchInfo
Create DispatchInfo functions for manipulating
loader handles instead of sharing the LoaderAllocator.
Make the DispatchMemberInfo look more
regular and make all fields private.
Jeremy Koritzinsky [Thu, 5 Jan 2023 22:30:21 +0000 (14:30 -0800)]
Ensure that we don't root the compilation when using a custom exception marshalling type. (#80147)
Jeremy Koritzinsky [Thu, 5 Jan 2023 22:29:59 +0000 (14:29 -0800)]
Remove dead code relating to switching AppDomains in CCWs (#80187)
Katelyn Gadd [Thu, 5 Jan 2023 22:03:03 +0000 (14:03 -0800)]
Remove remaining use of handles in interp_exec_method and instead use a reserved slot at the top of the stack (#80197)
Right now every time we enter the interpreter we waste some CPU time allocating a handle, even though the only remaining use of the handle is in the BOX opcodes. This PR instead allocates some space at the top of the stack for a temporary GC-visible object pointer, and then uses that instead of a handle.
Zoltan Varga [Thu, 5 Jan 2023 21:29:47 +0000 (16:29 -0500)]
[mono][aot] Avoid emitting gshared methods multiple times when preferring instances of them. (#80100)
This fixes a part of the size regression added by
c7c6aa032175f4ee48c38757d1d9f32df25f02c6.
Aleksey Kliger (λgeek) [Thu, 5 Jan 2023 21:23:01 +0000 (16:23 -0500)]
[build] Use MonoWasmBuildVariant to select runtime variant (#80024)
Use `MonoWasmBuildVariant=multithread` and
`MonoWasmBuildVariant=perftrace` consistently to select the runtime
variant. Previously we also supported setting `WasmEnableThreads` or
`WasmEnablePerfTracing` to configure the runtime variant. This PR
removes support for that.
Note that this is distinct from what users do: the public
`WasmEnableThreads` (respectively, `WasmEnablePerfTracing`) property
are used in user project to choose the threaded (respectively,
diagnostic tracing) runtime pack in a user project. That support is
not going way in this PR.
The only tricky bit is that when building and testing the sample
projects, we need to set the public properties, not the wasm build
variant property.
Fixes https://github.com/dotnet/runtime/issues/75152
Jo Shields [Thu, 5 Jan 2023 20:41:32 +0000 (15:41 -0500)]
Cross-compile Wasm cross-compilers for ARM64 machines (#74428)
This change enables building arbitrary cross-compilers for non-x64 hosts. Right now, only osx-arm64->browser-wasm and linux-arm64->browser-wasm are actually enabled, as runtime bugs prevent us from building any arm64->x86 or arm64->x64 cross-compilers. Getting this framework in will unblock workload work related to "native" wasm on M1 Mac.
== BREAKING CHANGE FOR DEVELOPERS ==
MonoAOTLLVMDir no longer exists.
Old:
`/p:MonoLLVMDir=/path/to/llvm` specifies the directory with LLVM binaries compiled for `$(TargetArchitecture)`, for compiling the Mono JIT on that target architecture
`/p:MonoAOTLLVMDir=/path/to/llvm` specifies the directory with LLVM binaries compiled for `$(BuildArchitecture)`, for compiling the mono-aot-cross executable
```
New:
`/p:MonoLLVMDir=/path/to/llvm` specifies a parent-level directory with LLVM binaries compiled for relevant architectures - e.g. `$(MonoLLVMDir)\x64` contains LLVM built for `x64`, current OS. `$(MonoLLVMDir)\arm64 contains LLVM built for arm64`, current OS.
You do not need to specify `/p:MonoLLVMDir=` manually, unless you are a developer who may be using custom, non-nupkg LLVM.
This change is necessary to stop hardcoding the assumptions that a) `$(BuildArchitecture)` is always `x64` and b) AOT binaries should be compiled for $(BuildArchitecture)
Closes: #74175