Michal Strehovský [Thu, 2 Mar 2023 01:15:31 +0000 (10:15 +0900)]
Try skipping generation of empty method dictionaries (#82591)
Say we're compiling `Foo<__Canon>.Method` for:
```csharp
class Foo<T>
{
static void Method() => GenericMethod<List<T>>();
static void GenericMethod<T>() { }
}
```
In the method body, we're generating a call to `GenericMethod<__Canon>` with a generic dictionary that we looked up from `Foo`s dictionary. But as you can see, the dictionary is empty because `GenericMethod` doesn't do anything with it's T. RyuJIT might even inline it.
The problem is that we computed how the dictionary will look like during scanning and we're forever stuck with instruction to generate a generic dictionary for every `Foo<T>` instantiation.
This is adding an optimization - if during scanning we find out that the dictionary layout of the target method is empty, we instruct RyuJIT to generate a null generic context pointer.
Saves 1.5% on BasicMinimalApi.
Cc @dotnet/ilc-contrib
dotnet bot [Thu, 2 Mar 2023 00:24:07 +0000 (16:24 -0800)]
Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2122151 (#81871)
Co-authored-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
Elinor Fung [Wed, 1 Mar 2023 22:50:04 +0000 (14:50 -0800)]
Implement load_assembly delegate for hosting API (#82797)
Katelyn Gadd [Wed, 1 Mar 2023 22:00:31 +0000 (14:00 -0800)]
[wasm] Implement more jiterpreter opcodes (#82849)
Implement the following opcodes:
* MINT_NEWSTR
* MINT_ARRAY_ELEMENT_SIZE
* MINT_DIV_I8
* MINT_REM_I8
Jakob Botsch Nielsen [Wed, 1 Mar 2023 21:04:39 +0000 (22:04 +0100)]
JIT: Unify arm64 and x64 GT_SELECT handling (#82610)
This unifies GT_SELECT/GT_SELECTCC handling between arm64 and x64. The
arm64 backend no longer uses containment for compare chains; instead,
there is a new GT_CCMP node that both produces and consumes flags, and
lowering can lower GT_AND(op, relop) down to this node.
Koundinya Veluri [Wed, 1 Mar 2023 17:53:50 +0000 (09:53 -0800)]
Check for pending IO in the portable thread pool's worker threads (#82245)
* Check for pending IO in the portable thread pool's worker threads
- When Resource Monitor is attached, some async IO operations are bound to the thread that issued it even though the IO handle is bound to an IOCP. If the thread exits, the async IO operation is aborted. This can lead to hangs or unexpected exceptions.
- Added a check that was missing in the portable thread pool implementation to prevent exiting a worker thread when it has pending IO
Fixes https://github.com/dotnet/runtime/issues/82207
Radek Doulik [Wed, 1 Mar 2023 17:31:15 +0000 (18:31 +0100)]
[wasm] Enable SIMD (#80797)
* [wasm] Enable SIMD
* Let old V8 use simd
Co-authored-by: Ankit Jain <radical@gmail.com>
* [wasm] ManagedToNativeGenerator: Skip unmanaged dlls
.. instead crashing with an exception like:
```
src/mono/wasm/build/WasmApp.Native.targets(296,5): error MSB4018: (NETCORE_ENGINEERING_TELEMETRY=Build) The "ManagedToNativeGenerator" task failed unexpectedly.
System.BadImageFormatException: This PE image is not a managed executable.
at System.Reflection.MetadataLoadContext.LoadFromStreamCore(Stream peStream)
at System.Reflection.MetadataLoadContext.LoadFromAssemblyPath(String assemblyPath)
at PInvokeTableGenerator.Generate(String[] pinvokeModules, String[] assemblies, String outputPath) in /_/src/tasks/WasmAppBuilder/PInvokeTableGenerator.cs:line 42
at ManagedToNativeGenerator.ExecuteInternal() in /_/src/tasks/WasmAppBuilder/ManagedToNativeGenerator.cs:line 68
at ManagedToNativeGenerator.Execute() in /_/src/tasks/WasmAppBuilder/ManagedToNativeGenerator.cs:line 53
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)
```
The wasm targets currently are not able to differentiate the managed
assemblies from the unmanaged ones. so it needs to be handled here.
* [wasm] WasmApp.Native.targets: do not trigger relinking when WasmEnableSIMD=true
Instead, let the property be effective only for the AOT case.
* Use staging image with newer v8
* [wasm] WasmAppHost: Add support for host arguments
* [wasm] console template: Add --experimental-wasm-simd to node, and remove v8 config as that isn't supported
* [wasm] Pass --experiment-wasm-simd for aot library tests too
* Try to pass full path to v8
Also remove --experimental-wasm-simd option, which shouldn't be needed
for newer v8
* Use docker image for all wasm helix jobs
As we need newer v8
* Set DOTNET_CLI_HOME under workitem payload
The correlation payload is read only
* Revert "Try to pass full path to v8"
This reverts commit
a15b3ef5dcab31b0abe2bc914eee6299df7cf56f.
* Use DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
Let see whether it will avoid all the writes to correlation payload
path
* Set NeedsEMSDKNode to false
To try if we can use newer node in path
* Revert "Set DOTNET_CLI_HOME under workitem payload"
This reverts commit
5dec1aaab403f4cbbd7b0e9f03d965e96efde51c.
* Set DOTNET_CLI_HOME under workitem payload
The correlation payload is read only. And even with
`export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1` we have still many
failures.
* Reverse the test here as we don't relink anymore
* Set _ExtraTrimmerArgs for tests
So that linker substitution files are used
* Put the SIMD/trim related props in separate group
More changes from Ankit
* Add dynamic dependency
* Disable Vector128IsHardwareAcceleratedTest
Til we have the interpreter support in place
* Disable GenericVectorTests.IsHardwareAcceleratedTest
Til we have the interpreter support in place
* Disable check_no_intrinsic_cattr in emit_vector_2_3_4
And add note about opened issue
* [mono] Disable few quaternion intrinsics
For * and / operators as these are not the same as vector operations.
Opened https://github.com/dotnet/runtime/issues/82408 to implement
correct ones in future.
* Change comparison order
* Use stable images
* WBT: Add --engine-arg=--experimental-wasm-simd for node, and v8
* Do not skip dotnet 1st time experience anymore
---------
Co-authored-by: Ankit Jain <radical@gmail.com>
Aleksey Kliger (λgeek) [Wed, 1 Mar 2023 16:03:52 +0000 (11:03 -0500)]
[wasm] Add an internal GC lock API (#82646)
The goal is to provide an API that can be called from JS to block a background GC from moving objects that may be accessed unsafely from JS. Blazor does this during rendering - it traverses a set of rendering objects from JS in order to apply changes to the DOM.
Important notes for consumers of this API:
1. While the runtime GC lock is locked, calling any C# function or doing anything that may trigger managed allocation will block the runtime.
2. In a threaded build, only the main browser thread is allowed to call the `mono_wasm_gc_lock` function
3. The runtime lock is not recursive
4. Background threads initially continue running, so the managed object graph may change even while the GC lock is held (although objects may not move). Background threads could mutate valuetype fields of reachable objects, even while the GC lock is held. However background threads will block as soon as they try to do any allocation.
5. The main browser thread may assume that managed heap objects will not move while the lock is held.
The corresponding aspnetcore API is https://github.com/dotnet/aspnetcore/pull/46909
* add wasm entrypoints to lock the GC from JS
* move gc lock api to INTERNAL object
* enter GC Unsafe before manipulating the locks
This is an exported API, so we're normally in GC Safe mode on entry
Tomas Weinfurt [Wed, 1 Mar 2023 15:59:38 +0000 (07:59 -0800)]
update msquic (#81742)
* update msquic
* Update src/libraries/System.Net.Quic/src/System.Net.Quic.csproj
Co-authored-by: Marie Píchová <11718369+ManickaP@users.noreply.github.com>
---------
Co-authored-by: Marie Píchová <11718369+ManickaP@users.noreply.github.com>
Pavel Savara [Wed, 1 Mar 2023 15:09:21 +0000 (16:09 +0100)]
[wasi+browser] bundle timezones into .wasm (#82250)
Co-authored-by: Ankit Jain <radical@gmail.com>
Pavel Savara [Wed, 1 Mar 2023 14:43:12 +0000 (15:43 +0100)]
[API] OperatingSystem.IsWasi() (#82817)
implement approved API https://github.com/dotnet/runtime/issues/78389
Marie Píchová [Wed, 1 Mar 2023 13:31:36 +0000 (14:31 +0100)]
Fix test throwing from send (#82787)
Marie Píchová [Wed, 1 Mar 2023 13:30:01 +0000 (14:30 +0100)]
[QUIC] Disable failing test on arm machines (#82780)
* Disable failing test on arm machines
* Feedback
Ilona Tomkowicz [Wed, 1 Mar 2023 12:57:24 +0000 (13:57 +0100)]
[browser][icu][libraries] Load full ICU in library tests only when it's necessary (#82619)
* Moved the flag to libs that really need it.
* Remaining libs.
* Property should not be set in ItemsGroup.
* Previos approach did not work, revert and try new one.
* Only placing it here does not trim the assigned value.
* Add comment to the workaround.
Steve [Wed, 1 Mar 2023 12:29:50 +0000 (21:29 +0900)]
Fix build failure in pal_ssl (#82816)
Alexander Köplinger [Wed, 1 Mar 2023 12:13:30 +0000 (13:13 +0100)]
Add more type-forwarders for Xamarin.Android compatibility to mscorlib.dll (#82618)
The legacy Xamarin.Android version of mscorlib.dll differed a bit compared to the .NET Framework mscorlib.dll, mostly because of additions for .NET Standard 2.1 support.
This meant that an assembly which was compiled against that mscorlib expects types there but since we didn't have type-forwarders in our mscorlib.dll shim to point them to the right assembly you'd get a TypeLoadException when running on modern .NET 6 Android.
Fixes https://github.com/dotnet/runtime/issues/82193
Ulrich Weigand [Wed, 1 Mar 2023 11:57:24 +0000 (12:57 +0100)]
[mono] Raise soft RLIMIT_NOFILE on Linux (#82429)
Replace darwin_change_default_file_handles by a new routine increase_descriptor_limit, which mirrors the logic in the CoreCLR INIT_IncreaseDescriptorLimit routine.
Fixes https://github.com/dotnet/runtime/issues/82428.
Pavel Savara [Wed, 1 Mar 2023 11:13:23 +0000 (12:13 +0100)]
[browser] delete unused mono_wasm_* functions (#82767)
* delete unused mono_wasm_get_icudt_name
* remove unused mono_wasm_array_length
* remove unused GlobalizationNative_GetICUDTName
Jakob Botsch Nielsen [Wed, 1 Mar 2023 08:53:57 +0000 (09:53 +0100)]
JIT: Enable interlocked profiling for basic block counts too (#82775)
Maoni Stephens [Wed, 1 Mar 2023 01:48:25 +0000 (17:48 -0800)]
Annotation changes only (part 3) (#82697)
* Annotation changes only (part 3)
+ moved the fields to be at the end of the gc_heap class arranged by their categories - instance fields before static fields. this also makes the gc_heap way easier to read in the debugger (so we don't see static fields mixed with instance fields). I also added in the comment the convention of how I organized each category.
+ made members that should be private actually private - most methods/fields on the gc_heap are private now
+ changed the bookkeeping fields from MAINTAINED to INIT to be more appropriate for regions
+ moved reset_mm_p into gc_heap class.
+ got rid of the frozen_object_p method - this shouldn't have been added, there's already an API on the GCHeap interface that provides this info
+ there are members that really don't need to be public but I'm trying to avoid too many kinds of changes at a time so I left them as public such as gc_started/wait_for_gc_done()/region_info enum. things like WaitLonger/stomp_write_barrier_ephemeral/reserved_memory_limit should really just be gc_heap methods
Brian Bohe [Wed, 1 Mar 2023 01:36:18 +0000 (22:36 -0300)]
Refactoring store liveness update (#80539)
* Unifying var desc and liveness update on storeLclFld/Var
* Updating varDsc home after spill and refactoring
* Adding back function comment
* Forcing inline of store update on liveness
* Fixing format
Stephen Toub [Tue, 28 Feb 2023 22:43:01 +0000 (17:43 -0500)]
Make debug-only SafeHandle _ctorStackTrace coreclr-only (#82376)
Stephen Toub [Tue, 28 Feb 2023 22:21:25 +0000 (17:21 -0500)]
Tweak IndexOfAnyValues.TryGetSingleRange (#82786)
Move the instance creation logic to its callers.
Katelyn Gadd [Tue, 28 Feb 2023 21:13:43 +0000 (13:13 -0800)]
[wasm] Implement partial backward branch support in the Jiterpreter (#82756)
Add partial backward branch support to the Jiterpreter
Disable early trace abort / trace transfer if back branches are enabled, since it impairs looping
Add back branch success rate statistic
Remove ldelem_ref write barrier
Buyaa Namnan [Tue, 28 Feb 2023 17:58:27 +0000 (09:58 -0800)]
Do not use ALC name for AssemblyName (#82754)
Jackson Schuster [Tue, 28 Feb 2023 17:32:29 +0000 (09:32 -0800)]
[ComInterfaceGenerator] Rewrite exception handler if retval is a pointer (#82740)
Andy Ayers [Tue, 28 Feb 2023 16:09:45 +0000 (08:09 -0800)]
JIT: Revise DFS RPO computation (#82752)
Give block postorder numbers their customary meaning: the block's position
in the postorder, not in the reverse postorder.
Rename "InvPostOrder" to the more customary ReversePostorder. Also, compute
preorder numbers.
Preparatory work for running DFS RPO earlier to classify edges.
Stephen Halter [Tue, 28 Feb 2023 15:00:37 +0000 (07:00 -0800)]
Preserve OCE.CancellationToken in StreamPipeReader (#82745)
Aleksey Kliger (λgeek) [Tue, 28 Feb 2023 14:11:18 +0000 (09:11 -0500)]
[class] DIMs in the vtable of abstract classes may be overridden (#82556)
* [class] treat slot as empty if it's filled in with a DIM
Classes may override an interface method slot if it was filled in with a DIM, just as if it was empty.
Related to https://github.com/dotnet/runtime/issues/81882
Shawn Beachy [Tue, 28 Feb 2023 12:43:22 +0000 (07:43 -0500)]
Correct "abstact" to "abstract". (#82738)
Pavel Savara [Tue, 28 Feb 2023 11:10:36 +0000 (12:10 +0100)]
test retry logic (#82722)
Katelyn Gadd [Tue, 28 Feb 2023 09:10:22 +0000 (01:10 -0800)]
[jiterp] Remove write barrier from ldelem_ref (#82757)
dotnet-maestro[bot] [Tue, 28 Feb 2023 09:01:39 +0000 (10:01 +0100)]
[main] Update dependencies from dotnet/arcade (#82599)
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Eric StJohn <ericstj@microsoft.com>
Co-authored-by: Elinor Fung <elfung@microsoft.com>
Vlad Brezae [Tue, 28 Feb 2023 08:07:07 +0000 (10:07 +0200)]
[mono][interp] Add instrinsics for common Vector128 operations (#81782)
* [mono][interp] Move defines from transform.c
* [mono][interp] Move more defines from transform.c
* [mono][interp] Add intrinsics for most common V128 operations
We add intrinsics for Vector128 intrinsics that are actively used within our bcl.
We declare a set of simd method names, the same way we do it with jit, in `simd-methods.def`. In `transform-simd.c` we lookup method names in the list of supported intrinsics for `Vector128` and `Vector128<T>`. Once we find a supported instrinsic, we generate code for it, typically a `MINT_SIMD_INTRINS_*` opcode. In order to avoid adding too many new opcodes to the interpreter, simd intrinsics are grouped by signature. So all simd intrinsics that receive a single argument and return a value, will be called through `MINT_SIMD_INTRINS_P_P`. This instruction will receive an index to get the intrinsic implementation and calls it indirectly.
Some of the intrinsics are implemented using the standard vector intrinsics, supported by gcc and clang. These do not fully expose the SIMD capabilities, so some intrinsics are implemented naively. This should still be faster than using nonvectorized approach from managed code. In the future we can add better implmentation, on platforms where we have low level support. This would both be faster and reduce code size.
* [mono][interp] Add option to disable simd intrinsics
* [mono][interp] Disable simd intrinsics by default on wasm
These intrinsics are not yet implemented on jiterpreter, making it slighty slower instead.
* [mono][interp] Replace v128_create with v128_ldc if possible
v128_create receives as an argument every single element of the vector. This method is typically used with constants. For a Vector128<short> this means that creating a constant vector required 8 ldc.i4 and a v128_create. We can instead use a single instruction and embed the vector value in the code stream directly.
* [mono][interp] Remove op_Division
It is actually not used in bcl, it is not really vectorized on any platforms and the codegen for the interp implementation is massive and inefficient.
* [mono][interp] Don't emit intrinsics for unsupported vector types
* [mono][interp] Vector extensions used in these intrinsics are a GNUC extension
Andy Ayers [Tue, 28 Feb 2023 07:53:18 +0000 (23:53 -0800)]
Stop incrementing class profile counter once the reservoir table is full (#82723)
The counter in the class profile counter is used to determine when to
switch to probabilistic updates of the reservior table, but it is currently
not used to detemine the probability of an update. So there's no need to keep
incrementing it once the table is full.
Since the count is mutable shared state, bypassing updates should reduce cache
contention somewhat.
Contributes to #72387.
Michal Strehovský [Tue, 28 Feb 2023 07:22:28 +0000 (16:22 +0900)]
Trim managed debugging support code (#82696)
NativeAOT is not debugged with a managed debugger that would be able to understand these. It's also questionable whether a possible future managed debugger would be using this (versus debugging with IL that gets embedded in debugging symbols like .NET Native does).
Ankit Jain [Tue, 28 Feb 2023 03:04:58 +0000 (22:04 -0500)]
Add support for skipping workloads testing for previous versions (#82742)
* Add support for skipping workloads testing for previous versions
This will skip installing manifests for 6, and 7, for example, and
install only install the latest ones. This is because on release
branches the newest versions might not have public packages available
yet.
* Set $(WorkloadsTestPreviousVersions) in the yml
.. based on the branch. Set it to `true` only for `main`.
Carlos Sánchez López [Tue, 28 Feb 2023 00:47:31 +0000 (18:47 -0600)]
Bump main PreReleaseVersionIteration to 3 (#82658)
* Bump main PreReleaseVersionIteration to 3
* [wasm] Update emscripten dependencies to preview3
---------
Co-authored-by: carlossanlop <carlossanlop@users.noreply.github.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
Michal Strehovský [Mon, 27 Feb 2023 23:49:37 +0000 (08:49 +0900)]
Split generic virtual method slot use and impl tracking (#82222)
* Split generic virtual method slot use and impl tracking
I'm looking at generic virtual method again because of #80602.
The analysis of generic virtual methods within the compiler is an N * M algorithm where N is the number of unique generic virtual method instantiations called and M is the number of types that implement generic virtual methods.
We use dynamic dependencies within the dependency analysis engine to model this relationship.
It is important to try to limit the N and M. Looking at things, I realized the N we're currently operating on is bigger than it needs to be:
```csharp
Foo f = new Bar();
f.Blah<int>();
f = new Baz();
f.Blah<double>();
class Foo { public virtual void Blah<T>() { } }
class Bar : Foo { public override void Blah<T> { } }
class Baz : Foo { public override void Blah<T> { } }
```
Previously, the analysis would see M = 3 and N = 6 because we would track each of the overrides as something that needs to be considered for each M. This changes the analysis to only look at the definition of the slot, i.e. N = 2 (one for int, other for double).
The result of the analysis will still be same, it will just take less time. The new GenericVirtualMethodImpl node responds false to HasDynamicDependencies and doesn't participate in expensive activities.
Adeel Mujahid [Mon, 27 Feb 2023 23:00:34 +0000 (01:00 +0200)]
Replace IlcHostArch with SDK-computed value (#82645)
* Replace IlcHostArch with SDK-computed value
* Respect TPI in targetOS calculation
* Keep using OSArchitecture on Windows
* Simplify host vs. target package prop name
* Avoid mixing host/target
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Avoid mixing host/target
* Use _targetOS and _targetArchitecture in conditions
* .
* Derive _targetOS from RuntimeIdentifier
* Fix copy/paste error
* Remove condition that always evaluates to true
* Revert "Remove condition that always evaluates to true"
This reverts commit
c9e910eb3e4340c968b84ccc1ab95569d8447f03.
---------
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
SingleAccretion [Mon, 27 Feb 2023 21:08:08 +0000 (00:08 +0300)]
Prevent tests from importing "normal" NuGet props/targets (#80573)
We import them manually from a shared location.
Usually this is not a problem because batch build (via the build script)
does its own restore thing, but it is a problem in case the project is
restored on its own, such as when it is built with "dotnet build".
Zoltan Varga [Mon, 27 Feb 2023 21:03:47 +0000 (16:03 -0500)]
Fix a typo. (#78105)
Thays Grazia [Mon, 27 Feb 2023 20:05:16 +0000 (17:05 -0300)]
Just create the C# file with colon on name on Linux, keep the csproj always there (#82724)
Zoltan Varga [Mon, 27 Feb 2023 20:01:53 +0000 (15:01 -0500)]
[wasi] Build cross compiler for wasi. (#82702)
* [wasi] Build cross compiler for wasi.
* Disable building the cross compiler on windows for now.
Aleksey Kliger (λgeek) [Mon, 27 Feb 2023 18:20:40 +0000 (13:20 -0500)]
[wasm] don't call export_internal twice (#82713)
Jan Vorlicek [Mon, 27 Feb 2023 17:29:55 +0000 (18:29 +0100)]
Fix pthread_cond_wait race on macOS (#82709)
The native runtime event implementations for nativeaot and GC use
pthread_cond_wait to wait for the event and pthread_cond_broadcast
to signal that the event was set. While the usage of the
pthread_cond_broadcast conforms with the documentation, it turns out
that glibc before 2.25 had a race in the implementation that can
cause the pthread_cond_broadcast to be unnoticed and the wait
waiting forever. It turns out that macOS implementation has the
same issue.
The fix for the issue is to call pthread_cond_broadcast while the
related mutex is taken.
This change fixes intermittent crossgen2 hangs with nativeaot build of
crossgen2 reported in #81570. I was able to repro the hang locally in
tens of thousands of iterations of running crossgen2 without any arguments
(the hang occurs when server GC creates threads). With this fix,
it ran without problems over the weekend, passing 5.5 million iterations.
Viktor Hofer [Mon, 27 Feb 2023 16:55:41 +0000 (17:55 +0100)]
Set VSDebugger_ValidateDotnetDebugLibSignatures (#82710)
When using the `-vs` switch, disable signature validation. See https://github.com/dotnet/runtime/blob/main/docs/workflow/building/libraries/README.md#debugging for more details
Marek Fišera [Mon, 27 Feb 2023 15:43:11 +0000 (16:43 +0100)]
[wasm] Make `WasmMainJSPath` optional (#81484)
Use WasmMainJSPath only on command-like hosts like v8 or node.
Co-authored-by: Ankit Jain <radical@gmail.com>
Antoine Martin [Mon, 27 Feb 2023 14:37:44 +0000 (09:37 -0500)]
pal_console.c: cast TIOCSWINSZ to int when HAVE_IOCTL_WITH_INT_REQUEST (#82676)
Ondřej Kubíček [Mon, 27 Feb 2023 14:37:28 +0000 (15:37 +0100)]
Typo in DeniedValuesAttribute (#82665)
* Typo in DeniedValuesAttribute
* PR feedback
Zoltan Varga [Mon, 27 Feb 2023 12:02:42 +0000 (07:02 -0500)]
[mono][aot] Emit llvm intrinsic declarations lazily. (#82519)
This makes llvm bitcode files a bit smaller and easier to read.
Kevin Jones [Mon, 27 Feb 2023 08:52:52 +0000 (03:52 -0500)]
Permit trailing data when parsing an X.509 certificate by DER content (#82688)
Craig Johnson [Mon, 27 Feb 2023 08:48:40 +0000 (01:48 -0700)]
Fix juxtaposed command - correct value is noted in eng\build.ps1 (#81572)
MSDN.WhiteKnight [Mon, 27 Feb 2023 00:59:46 +0000 (05:59 +0500)]
Fix links in Portable PDB spec (#82683)
Ankit Jain [Sun, 26 Feb 2023 22:10:21 +0000 (17:10 -0500)]
[wasm] CI: trigger wasm jobs on internal linker changes (#82655)
* CI: trigger wasm jobs on internal linker changes
* Fix dependency
Zoltan Varga [Sun, 26 Feb 2023 20:26:11 +0000 (15:26 -0500)]
[wasm] Remove unused AOTMode msbuild property. (#82675)
dotnet-maestro[bot] [Sun, 26 Feb 2023 17:38:06 +0000 (11:38 -0600)]
[main] Update dependencies from dotnet/roslyn-analyzers (#82477)
* Update dependencies from https://github.com/dotnet/roslyn-analyzers build
20230221.1
Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
From Version 3.3.5-beta1.23117.2 -> To Version 3.3.5-beta1.23121.1
* Update dependencies from https://github.com/dotnet/roslyn-analyzers build
20230224.1
Microsoft.CodeAnalysis.Analyzers , Microsoft.CodeAnalysis.NetAnalyzers
From Version 3.3.5-beta1.23117.2 -> To Version 3.3.5-beta1.23124.1
---------
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Maoni Stephens [Sun, 26 Feb 2023 07:54:25 +0000 (23:54 -0800)]
Fixing a FATAL_GC_ERROR in loh_allocate_in_condemned when in extremely low memory situations (#82418)
I'm running GCPerfSim with this commandline and this env -
corerun.exe GCPerfSim.dll -tc 60 -tagb 100 -tlgb 9.5 -lohar 0 -pohar 0 -sohsr 100-4000 -lohsr 102400-204800 -pohsr 100-204800 -sohsi 50 -lohsi 0 -pohsi 0 -sohpi 0 -lohpi 0 -sohfi 0 -lohfi 0 -pohfi 0 -allocType simple -testKind time
set COMPlus_GCServer=1
set COMPlus_GCHeapCount=1e
set COMPlus_GCHeapHardLimit=
280000000
this causes us to hit this FATAL_GC_ERROR. We have one object which is at the very end of the region and we are asking for its size and padding of 2 * loh_padding_obj_size. since (heap_segment_allocated - heap_segment_mem) is (size + loh_padding_obj_size), loh_size_fit_p reports its not fitting so we call grow_heap_segment and at this point we are so low on memory we don't have ~16 pages left so we try to goto the next region and there's no more regions (in this case this is the only region in gen3).
We shouldn't be asking for (2 * loh_padding_obj_size) for padding because this is at the end of a region (same with segments).
Adeel Mujahid [Sun, 26 Feb 2023 07:53:26 +0000 (09:53 +0200)]
Add stub for mini_is_gsharedvt_inst (#82678)
* Add guard around mini_is_gsharedvt_inst call
* Add stub for mini_is_gsharedvt_inst
Maoni Stephens [Sun, 26 Feb 2023 01:18:12 +0000 (17:18 -0800)]
move fence to the right place (#82661)
Aleksey Kliger (λgeek) [Sun, 26 Feb 2023 00:53:03 +0000 (19:53 -0500)]
[jiterp] cmpxchg opcodes are supported (#82674)
Will Smith [Sat, 25 Feb 2023 20:26:37 +0000 (12:26 -0800)]
[JIT] Fixed regression for `AND(X, CNS(-1))` lowering optimization (#82659)
* Fixed regression for `AND(X, CNS(-1))` lowering optimization
* Feedback
* Feedback
Filip Navara [Sat, 25 Feb 2023 15:43:07 +0000 (16:43 +0100)]
[NativeAOT] Implement thunk page generation and mapping for iOS-like platforms (#82317)
* NativeAOT: Implement thunk page generation and mapping for iOS-like platforms
* Use minipal_getexepath instead of libproc
* Reimplement PalAllocateThunksFromTemplate to work inside shared libraries
* Specify correct rpath in tests for all Apple platforms
Mike McLaughlin [Sat, 25 Feb 2023 03:45:56 +0000 (19:45 -0800)]
Add runtime file version to RuntimeInfo (#82648)
The diagnostic tooling needs the runtime file version for single-file
applications to:
1) Build the long name DAC on Windows
2) SOS commands and other tooling need the version to adjust for different runtime behavior
Jb Evain [Sat, 25 Feb 2023 03:44:25 +0000 (19:44 -0800)]
Provide more information to the user about usage of MonoPInvokeCallback (#82653)
Unity's IL2CPP accepts a MonoPInvokeCallback constructor without any argument. When porting interop code from Unity's IL2CPP to Mono AOT this gives a hint to the user about what they need to fix.
Andy Ayers [Sat, 25 Feb 2023 02:33:42 +0000 (18:33 -0800)]
JIT: fix finally target flags after some flow graph updates (#82623)
In particular those done by profile instrumentation.
Fixes #82275.
Buyaa Namnan [Sat, 25 Feb 2023 01:25:26 +0000 (17:25 -0800)]
Add CA 2021 into CodeAnalysis config (#82649)
Jackson Schuster [Sat, 25 Feb 2023 00:54:30 +0000 (16:54 -0800)]
Update GeneratedComInterfaceAttribute (#82647)
Will Smith [Sat, 25 Feb 2023 00:21:28 +0000 (16:21 -0800)]
[JIT] X64 - Extend emitter peephole optimization of eliminating unnecessary `mov` instructions (#79381)
Ankit Jain [Fri, 24 Feb 2023 23:35:57 +0000 (18:35 -0500)]
[wasi] provision.ps1: stop on error (#82641)
Related - https://github.com/dotnet/runtime/issues/82627
Stephen Toub [Fri, 24 Feb 2023 23:35:32 +0000 (18:35 -0500)]
Remove some IAsyncResult implementations from System.Net.Mail (#82644)
Whittling away at our remaining APM implementations.
Jeremy Koritzinsky [Fri, 24 Feb 2023 23:33:00 +0000 (15:33 -0800)]
Convert all usages of target_link_libraries to use PUBLIC/PRIVATE specifiers (#81924)
Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
Ankit Jain [Fri, 24 Feb 2023 23:31:12 +0000 (18:31 -0500)]
[wasi] Misc fixes (#82569)
* [wasi] CI: Enable assert messages on CI
* Correctly set rid for ilproj on wasi
* Enable assert messages for wasi
* [wasi] Disable `System.Formats.Cbor.Tests.CborWriterTests` - crypto not
.. supported.
```
[00:52:00] fail: [FAIL] System.Formats.Cbor.Tests.CborWriterTests.CoseKeyHelpers_ECDsaExportCosePublicKey_HappyPath(expectedHexEncoding: "a501020326200121582065eda5a12577c2bae829437fe33870"..., hexQx: "65eda5a12577c2bae829437fe338701a10aaa375e1bb5b5de1"..., hexQy: "1e52ed75701163f7f9e40ddf9f341b3dc9ba860af7e0ca7ca7"..., hashAlgorithmName: "SHA256", curveFriendlyName: "ECDSA_P256")
[00:52:00] info: System.PlatformNotSupportedException : System.Security.Cryptography is not supported on this platform.
[00:52:00] info: at System.Security.Cryptography.HashAlgorithmName..ctor(String name)
[00:52:00] info: at System.Formats.Cbor.Tests.CborWriterTests.CoseKeyHelpers_ECDsaExportCosePublicKey_HappyPath(String expectedHexEncoding, String hexQx, String hexQy, String hashAlgorithmName, String curveFriendlyName)
[00:52:00] info: at System.Reflection.MethodInvoker.InterpretedInvoke(Object obj, IntPtr* args)
[00:52:00] info: at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
```
* [wasi] Disable crypto tests - https://github.com/dotnet/runtime/issues/37669
Tanner Gooding [Fri, 24 Feb 2023 23:11:32 +0000 (15:11 -0800)]
Make `TYP_SIMD32` be xarch only (#82624)
* Make `TYP_SIMD32` be xarch only
* Applying formatting patch
Elinor Fung [Fri, 24 Feb 2023 22:36:11 +0000 (14:36 -0800)]
Fix host tests clean-up of test artifact parent directories (#82573)
Jackson Schuster [Fri, 24 Feb 2023 21:26:14 +0000 (13:26 -0800)]
Use MarshallerHelpers method in ComInterfaceGenerator to make compiler friendly generic (#82582)
Stephen Toub [Fri, 24 Feb 2023 20:52:33 +0000 (15:52 -0500)]
Fix handling of partial reads in SqlBytes (#82620)
Stephen Toub [Fri, 24 Feb 2023 20:51:45 +0000 (15:51 -0500)]
Use Array.Reverse<T> in ImmutableArray<T>.Builder.Reverse (#82629)
Sven Boemer [Fri, 24 Feb 2023 20:40:35 +0000 (12:40 -0800)]
Add cecil dependency to ILLink package (#82630)
* Add cecil dependency to ILLink package
* Trigger libraries allConfigurations on illink changes
To run package validation (dependency closure verification)
Tanner Gooding [Fri, 24 Feb 2023 20:39:54 +0000 (12:39 -0800)]
Add a var_types_classification for simd (#82616)
* Add a var_types_classification for simd
* Ensure TYP_SIMD are actually marked VTF_VEC
Thays Grazia [Fri, 24 Feb 2023 20:06:06 +0000 (17:06 -0300)]
[mono][debugger] Show loaded symbols on VS module window (#82587)
* Fix 82417
* testing size of the ppdb
* Addressing @akoeplinger comments of 82555 PR
Bill Holmes [Fri, 24 Feb 2023 19:15:32 +0000 (14:15 -0500)]
Fix Mono default interface methods with protected virtual class methods (#82577)
Fixing the METHOD_ATTRIBUTE_PUBLIC flag check on the class method for
check_interface_method_override.
Kevin Jones [Fri, 24 Feb 2023 18:41:51 +0000 (13:41 -0500)]
Implement RSA.GetMaxOutputSize
Co-authored-by: Jeremy Barton <jbarton@microsoft.com>
Jan Kotas [Fri, 24 Feb 2023 18:24:25 +0000 (10:24 -0800)]
[NativeAOT] Delete .NET SDK 6 support (#82568)
No longer needed
Elinor Fung [Fri, 24 Feb 2023 18:14:43 +0000 (10:14 -0800)]
Add tests that use the host's computed RID (#82574)
Add tests that rely on the host's computed RID (sets `DOTNET_RUNTIME_ID` to empty, which we treat as the same as not set) and use the fallback graph from the built `Microsoft.NETCore.App.deps.json`.
Stephen Toub [Fri, 24 Feb 2023 17:16:51 +0000 (12:16 -0500)]
Remove stale IAsyncResult implementation from tests (#82609)
Stephen Toub [Fri, 24 Feb 2023 16:59:28 +0000 (11:59 -0500)]
Add and use public TaskToAsyncResult helper type (#82557)
* Add and use public TaskToAsyncResult helper type
* Disable thread blocking test on browser
Ivan Povazan [Fri, 24 Feb 2023 16:42:55 +0000 (17:42 +0100)]
Adding HelloiOS sample for NativeAOT (#82249)
- The application is intended to be used by developers who work on enabling NativeAOT on iOS-like platforms and can serve as PoC
- Currently still relies on dotnet/runtime internals and requires local builds instead of package references
Marie Píchová [Fri, 24 Feb 2023 15:17:09 +0000 (16:17 +0100)]
[HTTP/3] Attempt at using newer image to allow H/3 Windows stress (#82226)
* Attempt at using newer image to allow H/3 Windows stress
* Failing docker experiments
* Removed testing print
Adeel Mujahid [Fri, 24 Feb 2023 15:02:08 +0000 (17:02 +0200)]
Fix ilc package name for linux-musl (#82590)
Alexander Köplinger [Fri, 24 Feb 2023 14:57:07 +0000 (15:57 +0100)]
Fix warning/error with gcc11 in PalRedhawkUnix.cpp (#82596)
Otherwise you get:
```
error: ignoring return value of ‘ssize_t write(int, const void*, std::size_t)’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]
681 | write(STDERR_FILENO, message, strlen(message));
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
The same warning was already fixed for `alloca()` in encee.cpp as part of https://github.com/dotnet/runtime/commit/
5d6d55977270b3d1549a5c2e454b191487bef5eb#diff-f1018f796e7e06f60f7f4558583ec116f8e394bc90e29177c9dbdbfd29b78ab5R670, applying the same fix here
Kunal Pathak [Fri, 24 Feb 2023 14:45:55 +0000 (06:45 -0800)]
Let GenTreeCopyOrReload handle scenarios when FEATURE_MULTIREG_RET is disabled (#82451)
* remove FEATURE_MULTIREG_RET check
* Remove comments
* updated comment
Ilona Tomkowicz [Fri, 24 Feb 2023 12:59:32 +0000 (13:59 +0100)]
[wasm][icu] ICU files sharding + custom icu data loading for WASM (#80421)
* User can set `GlobalizationShard`.
* Sample for sharding, might be transformed into a test.
* Option of custom shard file upload.
* Replaced sample with WBT.
* Remove unnecessary change.
* Fixed invariantMode + full custom path + nit.
* Draft of documentation.
* Rename to reflect usage better.
* Fix full path file loading to the Browser.
* Fixed WBT build errors.
* Docs: only one ICU file can be used.
* Fixed NodeJs: `navigator` is not defined.
* Paritial fix of sharding tests.
* RuntimePack can differ for AOT and Release.
* Fix `ja-JP` culture not found in CheckDateTimeLocale.
* Fixedculture not found in SatelliteAssemblyTests.
* Fixed culture not found in System.Runtime tests.
* `icudt.dat` should not be loaded when <IcuFileName> empty + EFIGS contains only some specific locales + `IsIcuFilePredefined` is not necessary.
* Improved doc readability using @radical's suggestions.
* Forgot to remove comments.
* Missing change for
5df3c9ccc851c45fbdbc3acfd96162c3237973c1.
* WBT: Applied review.
* Applied @pavelsavara's suggestion.
* Added `WasmIncludeFullIcuData` to work like Blazor.
* Another missing change for
5df3c9ccc851c45fbdbc3acfd96162c3237973c1.
* Missing change for
b5a1308372ed00f1dea08dadd647e97dffe57e27.
* Fix debugger failures for real, previous flag was in the wrong place.
* Fixed most libraries that require full ICU.
* WBT should load full icu only when invariant off.
* Applied @radical's idea.
* Missing change for the last commit.
* Build args should not be edited inside of `BuildProject()` + Identity on a property does not exist.
* One flag for all lib tests instead of multiple changes.
* Revert comments for the prev commit.
* Fix for trimming tests.
* Rename + throwing when file not found.
* Fixed NoopNativeRebuildTest WBT.
* Forgotten logging.
* Tests with custom shard.
* Added more complex tests.
* Should fix wasm tests on helix.
* Fix WBT.
* [wasm] Update eng/testing/scenarios/BuildWasmAppsJobsList.txt
* [wasm] fix testassets path
* Default mode for tests should be the same as default mode for template apps.
* Checking preferred icu when assets are still not populated was incorrect.
* DataTimeFormat does not work well for browser + wrong condition.
* Removed empty space changes.
* WBT for automatic icu selection based on locale.
* Moved the full icu flag from libs to lib tests.
* Flag in tests.wasm.targets should be enough for trimming tests.
* Debugger tests in default globalization mode unless CJK needed. Firefox does not respect UILocale.
* Removing forgotten comment.
* Fixed sharding wbt.
* This should not be commented out.
* Sharding WBT do not make sense on v8 + fixed debugger tests on Linux + fixed WBT on Chrome on Windows.
* Fix test to have sense.
* Fixed tests to reflect expected behavior after removing predefinedCulturesOnly=true from WASM + added en-US to custom ICU.
* Fixed merge errors, removed redundant comment.
* Update docs, disable NodeJS in tests.
* @radical's review part 1: embedded comments.
* Test clean-up by @radical.
* Fix arg order in debugger + revert wasi sharding.
---------
Co-authored-by: Ankit Jain <radical@gmail.com>
Katelyn Gadd [Fri, 24 Feb 2023 12:14:30 +0000 (04:14 -0800)]
[wasm] Migrate jiterpreter LDELEMA1 and LDLEN from C helper to inline in traces (#82576)
Inline ldelema1 and ldlen operations into traces instead of using a C helper, which should mitigate the regressions we saw in array-heavy benchmarks once turning on the jiterpreter
Clean up some correctness issues with null check optimization
Improve diagnostics and clean up some comments
Pavel Savara [Fri, 24 Feb 2023 11:51:46 +0000 (12:51 +0100)]
- remove custom startup sequence of blazor (#82532)
- remove legacy mono_load_runtime_and_bcl_args
- unused MonoConfigError removal
Egor Bogatov [Fri, 24 Feb 2023 11:27:06 +0000 (12:27 +0100)]
Enable constant folding in Tier0 (#82412)
Tlakaelel Axayakatl Ceja [Fri, 24 Feb 2023 09:01:57 +0000 (01:01 -0800)]
Fix missing changes in from ProducedBy enum change (#82575)
Egor Bogatov [Fri, 24 Feb 2023 08:48:24 +0000 (09:48 +0100)]
Fix rva[cns] folding (#81854)
Katelyn Gadd [Fri, 24 Feb 2023 06:56:27 +0000 (22:56 -0800)]
[wasm] Disable jiterpreter null check optimization for mid-method traces (#82585)
* Disable null check optimization when starting mid-method since we don't know which locals have had their address taken
* Improve null check optimization diagnostics
Steve Pfister [Fri, 24 Feb 2023 03:17:51 +0000 (19:17 -0800)]
[workloads] Bump net7 package version (#82270)