platform/upstream/dotnet/runtime.git
21 months ago[wasm] PackedSimd, add comparison methods (#85512)
Radek Doulik [Fri, 28 Apr 2023 16:31:45 +0000 (18:31 +0200)]
[wasm] PackedSimd, add comparison methods (#85512)

21 months ago[mono] Invoke AssemblyLoad hooks from RuntimeAssemblyBuilder:.ctor () instead from...
Zoltan Varga [Fri, 28 Apr 2023 16:22:19 +0000 (18:22 +0200)]
[mono] Invoke AssemblyLoad hooks from RuntimeAssemblyBuilder:.ctor () instead from native code. (#85307)

The call from native code is made before the manifest module was created, causing errors if the
hook tried to access Assembly.ManifestModule.

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

21 months ago[browser] cleanup of early startup code (#83411)
Pavel Savara [Fri, 28 Apr 2023 15:37:47 +0000 (17:37 +0200)]
[browser] cleanup of early startup code (#83411)

21 months agoMake preinitialized delegates reflection-visible (#85506)
Michal Strehovský [Fri, 28 Apr 2023 13:53:53 +0000 (22:53 +0900)]
Make preinitialized delegates reflection-visible (#85506)

Frozen delegate instances were bypassing the callback to metadata manager that lets metadata manager inject reflection dependencies on delegate construction. Introduce a spot for the callback.

Fixes dotnet/aspnetcore#47941.

21 months ago[NativeAOT] Use 8.1 atomics, if available, in RhpCheckedXchg/RhpCheckedLockCmpXchg...
Vladimir Sadov [Fri, 28 Apr 2023 13:33:49 +0000 (06:33 -0700)]
[NativeAOT] Use 8.1 atomics, if available, in RhpCheckedXchg/RhpCheckedLockCmpXchg (#85283)

* use atomics when available

* exch win

* conditional atomics

* moving ARM64_ATOMICS_FEATURE_FLAG_BIT to AsmOffsets.h and adding a static assert.

* enable lse locally in the asm helpers

21 months ago[NativeAOT] Allow reverse pinvoke in DoNotTriggerGc thread state regardless of coop...
Vladimir Sadov [Fri, 28 Apr 2023 13:32:49 +0000 (06:32 -0700)]
[NativeAOT] Allow reverse pinvoke in DoNotTriggerGc thread state regardless of coop mode. (#85435)

* Allow reverse pinvoke in DoNotTriggerGc thread state regardless of coop mode.

* do not attach DoNotTriggerGc threads in reverse pinvoke

* propagate useful msbuild arguments to the build

* more PR feedback.

* a nit - more consistent formatting

* Do not pass through StripSymbols

21 months agoJIT: ARR_LENGTH(new T[CNS]) --> CNS (#85496)
Egor Bogatov [Fri, 28 Apr 2023 13:10:42 +0000 (15:10 +0200)]
JIT: ARR_LENGTH(new T[CNS]) --> CNS (#85496)

21 months agoUpdate dependencies from https://github.com/dotnet/xharness build 20230428.2 (#85513)
dotnet-maestro[bot] [Fri, 28 Apr 2023 12:56:20 +0000 (12:56 +0000)]
Update dependencies from https://github.com/dotnet/xharness build 20230428.2 (#85513)

[main] Update dependencies from dotnet/xharness

21 months ago[mono][tests] Enable runtime tests for local aliasing on Mono Interpreter (#85250)
Milos Kotlar [Fri, 28 Apr 2023 10:42:00 +0000 (12:42 +0200)]
[mono][tests] Enable runtime tests for local aliasing on Mono Interpreter (#85250)

* Enable runtime tests when a local can be modified indirectly

* Split the test project into two

* Disable test in issues.targets

21 months ago[browser] Expanding timeouts for long running test projects (#85313)
Pavel Savara [Fri, 28 Apr 2023 09:13:18 +0000 (11:13 +0200)]
[browser] Expanding timeouts for long running test projects (#85313)

21 months ago[HTTP/3] Stress hack for msquic dropping connections (#84793)
Marie Píchová [Fri, 28 Apr 2023 08:37:08 +0000 (10:37 +0200)]
[HTTP/3] Stress hack for msquic dropping connections (#84793)

* Implement the same hack as for functional tests to prevent msquic from dropping connections

* Feedback: removed code sharing and used reflaction

* Try to fix missing build dependency

* Feedback - removed test only function and replaced with shared code + some reflection

* fix argument handling in build-local.ps1

* do not use MsQuicLibraryVersion

* copy msquic interop utils to the SDK base image

* use LinkBase in Functional.Tests.csproj for wildcard include

* Use MsQuicLibraryVersion in out internal logging and as a side-effect avoid the property being trimmed

* Comment

* also copy files to the Linux container

---------

Co-authored-by: antonfirsov <antonfir@gmail.com>
21 months agoComment out support for mtag extension in libunwind (#85474)
Vladimir Sadov [Fri, 28 Apr 2023 04:10:17 +0000 (21:10 -0700)]
Comment out support for mtag extension in libunwind (#85474)

Works around build breaks with some compiler versions.

Fixes https://github.com/dotnet/source-build/issues/3424

* added a commit reference to libunwind-version.txt

* move commit to the right file

---------

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
21 months agoDisable crossgen on riscv64 (#85499)
Adeel Mujahid [Fri, 28 Apr 2023 04:08:03 +0000 (07:08 +0300)]
Disable crossgen on riscv64 (#85499)

21 months agoAdd better fix for UnhandledExceptionHandlerUnix (#85497)
Adeel Mujahid [Fri, 28 Apr 2023 04:05:50 +0000 (07:05 +0300)]
Add better fix for UnhandledExceptionHandlerUnix (#85497)

21 months agoEnable AVX-512 for block unrollings (both copying and zeroing) (#85389)
Egor Bogatov [Thu, 27 Apr 2023 23:47:58 +0000 (01:47 +0200)]
Enable AVX-512 for block unrollings (both copying and zeroing) (#85389)

21 months ago[PERF] Add Android BenchmarkDotNet test (#85282)
Parker Bibus [Thu, 27 Apr 2023 22:53:57 +0000 (15:53 -0700)]
[PERF] Add Android BenchmarkDotNet test (#85282)

* Setup testing and add missing depends on.
Shift perflab dependencies to the app build through insertion rather than being in the Maui repo.
Add PERFLAB_INLAB preprocessor constant to include the environment variables section of the Maui app in the build.
Switch to using the main branch of the perf repo.
Hardcoded in the output path to avoid unused variable error when building the Maui App.
* Print runtime pack locations after updating the locations to allow verification of correct package usage.
* Up timeout time for the BDN app test as they take a little bit of time.

21 months agoTry to fix _MergedWrapperMarker (#85476)
Bruce Forstall [Thu, 27 Apr 2023 22:51:07 +0000 (15:51 -0700)]
Try to fix _MergedWrapperMarker (#85476)

Don't include markers without execution scripts

21 months agoFix createdump arg parsing for signal-based exceptions (#85422)
Juan Hoyos [Thu, 27 Apr 2023 22:06:22 +0000 (15:06 -0700)]
Fix createdump arg parsing for signal-based exceptions (#85422)

21 months ago[wasm] GenerateWasmBootJson - close file handles (#85480)
Ankit Jain [Thu, 27 Apr 2023 22:03:58 +0000 (18:03 -0400)]
[wasm] GenerateWasmBootJson - close file handles (#85480)

Close files opened with `File.OpenRead` by utilizing the `using`
pattern.

21 months ago[wasi] Fix support for paths with spaces (#85022)
Ankit Jain [Thu, 27 Apr 2023 20:07:31 +0000 (16:07 -0400)]
[wasi] Fix support for paths with spaces (#85022)

* [wasi] Fix disabling wasi build for projects

* [wasi] Fix quoting in Wasi targets

* [wasi] WBT: don't run wasi targets for the tests project

21 months agoReduce calli address spilling (#85349)
Michał Petryka [Thu, 27 Apr 2023 17:52:36 +0000 (19:52 +0200)]
Reduce calli address spilling (#85349)

21 months agoJIT: Handle GT_RETFILT in fgInsertStmtNearEnd (#85420)
Jakob Botsch Nielsen [Thu, 27 Apr 2023 17:41:50 +0000 (19:41 +0200)]
JIT: Handle GT_RETFILT in fgInsertStmtNearEnd (#85420)

Also add some logging for read backs in physical promotion.

Fix #85088

21 months agoJIT: Propagate some more indir flags in physical promotion (#85453)
Jakob Botsch Nielsen [Thu, 27 Apr 2023 17:16:33 +0000 (19:16 +0200)]
JIT: Propagate some more indir flags in physical promotion (#85453)

When physical promotion creates multiple indirections for arbitrary
BLK/FIELD sources, make sure we propagate all relevant flags.

Fix #85449

21 months ago[LoongArch64] Implements the emitter::emitDispIns. (#85375)
Qiao Pengcheng [Thu, 27 Apr 2023 17:12:40 +0000 (01:12 +0800)]
[LoongArch64] Implements the emitter::emitDispIns. (#85375)

* [LoongArch64] Implements the emitter::emitDispIns.

* LA64 don't support Instruction list before jump distance binding.

* delete some unused codes.

* amend code for CR.

21 months ago[RISC-V] GT_JMP implementation in codegen (#85416)
Alexander Soldatov [Thu, 27 Apr 2023 17:11:59 +0000 (20:11 +0300)]
[RISC-V] GT_JMP implementation in codegen (#85416)

Added GT_JMP support to codegen. Based on ARM64 implemetation.

21 months ago[RISC-V][JIT] JIT/CodeGenBringUpTest (#84748)
Dong-Heon Jung [Thu, 27 Apr 2023 17:11:25 +0000 (02:11 +0900)]
[RISC-V][JIT] JIT/CodeGenBringUpTest (#84748)

* [JIT] Update RISCV64

- Update Floating Point Compare
- Implement NYI functions

* [JIT] Update RISCV64

- Implement NYI functions

* [JIT] FIX TEST ERRORS

- Implement NYI functions

* [JIT] FIX TEST ERROR

- Update genFnPrologCalleeRegArgs

* [JIT] FIX TEST ERRORS

* [JIT] FIX TEST ERROR

Fix an error in ./JIT/CodeGenBringUpTests/struct16args_d/struct16args_d.sh

* [JIT] Fix rotate test errors

Fixed erros in belows
./JIT/CodeGenBringUpTests/Rotate_d/Rotate_d.sh
./JIT/CodeGenBringUpTests/Rotate_do/Rotate_do.sh
./JIT/CodeGenBringUpTests/Rotate_r/Rotate_r.sh
./JIT/CodeGenBringUpTests/Rotate_ro/Rotate_ro.sh

* [JIT] Fix erorrs in JTrueNeFP

Resolve
```
./JIT/CodeGenBringUpTests/JTrueNeFP_do/JTrueNeFP_do.sh
./JIT/CodeGenBringUpTests/JTrueNeFP_d/JTrueNeFP_d.sh
./JIT/CodeGenBringUpTests/JTrueNeFP_r/JTrueNeFP_r.sh
./JIT/CodeGenBringUpTests/JTrueNeFP_ro/JTrueNeFP_ro.sh
```

* [JIT] Fix an error

Add a missed part for making constant.
In the cases, it is -12.

Resolved
./JIT/CodeGenBringUpTests/NegRMW_do/NegRMW_do.sh
./JIT/CodeGenBringUpTests/NegRMW_ro/NegRMW_ro.sh

* [JIT] Optimize making constant a little

TODO-RISCV64: We should optimize constant and address construction.

* [JIT] Update emitIns_I_la more

* Add todo comment about code quality

* [JIT] Fix bugs in float and double

- Change fcvt to fmv in ins_Copy

* [JIT] Remove unnecessary comment

* [JIT] FIX

- Add rounding mode

* [JIT] Fix error

- Add Neg for float
- Add rounding mode in float arithmetic

* [JIT] Update Float Neg

* [JIT] Update rounding mode and register use

* [JIT] Update

- remove dead code

* [JIT] Support Float JumpCompare

* [JIT] Remove GT_OBJ and LCL_VAR_ADDR

* [JIT] JIT-FORMAT

* [JIT] Fix JCMP cond error

- Reverse JCMP cond for reversing jump opt

* Revert "[JIT] Fix JCMP cond error"

This reverts commit bed8b9c12bd0340bc1519e1436d4acde209a9222.

* [JIT] Remove rounding mode comments

* [JIT] Fix Float-to-Float copy

* Update Alignment and Definitions

---------

Co-authored-by: Gleb Balykov <g.balykov@samsung.com>
21 months agoStore unhandled exception info on stack in Native AOT (#84871)
Andy Gocke [Thu, 27 Apr 2023 16:56:15 +0000 (09:56 -0700)]
Store unhandled exception info on stack in Native AOT (#84871)

Allocates a span on the stack to hold the ToString of the exception, as well as a CrashRecord which contains a unique cookie that can be used to find the exception info.

Fixes #84636

21 months ago[main] Update dependencies from dotnet/llvm-project dotnet/runtime-assets dotnet...
dotnet-maestro[bot] [Thu, 27 Apr 2023 16:28:07 +0000 (11:28 -0500)]
[main] Update dependencies from dotnet/llvm-project dotnet/runtime-assets dotnet/emsdk dotnet/hotreload-utils dotnet/cecil (#85310)

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

Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport
 From Version 8.0.0-preview.4.23219.1 -> To Version 8.0.0-preview.4.23224.2

* Update dependencies from https://github.com/dotnet/cecil build 20230424.2

Microsoft.DotNet.Cecil
 From Version 0.11.4-alpha.23218.2 -> To Version 0.11.4-alpha.23224.2

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

runtime.linux-arm64.Microsoft.NETCore.Runtime.JIT.Tools , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.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.Mono.LLVM.Sdk , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.ObjWriter , runtime.osx-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , 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.Mono.LLVM.Sdk , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.ObjWriter
 From Version 14.0.0-alpha.1.23221.2 -> To Version 14.0.0-alpha.1.23224.3

* Update dependencies from https://github.com/dotnet/runtime-assets build 20230425.1

Microsoft.DotNet.CilStrip.Sources , System.ComponentModel.TypeConverter.TestData , System.Data.Common.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 8.0.0-beta.23218.1 -> To Version 8.0.0-beta.23225.1

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

Microsoft.NET.Workload.Emscripten.Current.Manifest-8.0.100.Transport
 From Version 8.0.0-preview.4.23219.1 -> To Version 8.0.0-preview.5.23225.2

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

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 8.0.0-alpha.0.23219.2 -> To Version 8.0.0-alpha.0.23225.6

* bump to p5

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

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 8.0.0-alpha.0.23219.2 -> To Version 8.0.0-alpha.0.23226.3

---------

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
21 months ago[wasm] Use latest stable version of chrome (#85114)
Ankit Jain [Thu, 27 Apr 2023 15:47:53 +0000 (11:47 -0400)]
[wasm] Use latest stable version of chrome (#85114)

21 months agoDelete support for IAT indirecting base type/interfaces (#85376)
Michal Strehovský [Thu, 27 Apr 2023 13:43:27 +0000 (22:43 +0900)]
Delete support for IAT indirecting base type/interfaces (#85376)

* Delete support for IAT indirecting base type/interfaces

This is used if we have a SharedLibrary.dll a la .NET Native. SharedLibrary.dll model had a lot of problems around versioning and a "framework-dependent" deployment model like that is unlikely to come back. I think we can start to slowly get rid of and get marginally faster code and less maintenance cost in return.

* Bump header

21 months agoMake some SystemNetSecurity properties public (#85402)
Radek Zikmund [Thu, 27 Apr 2023 12:47:50 +0000 (14:47 +0200)]
Make some SystemNetSecurity properties public (#85402)

* Change API

* Fix Quic

* Expose TlsClientHelloInfo ctor

* Remove now unnecessary suppression file

* Add API comments

21 months agoUpdate dependencies from https://github.com/dotnet/roslyn-analyzers build 20230425...
dotnet-maestro[bot] [Thu, 27 Apr 2023 08:46:44 +0000 (10:46 +0200)]
Update dependencies from https://github.com/dotnet/roslyn-analyzers build 20230425.2 (#85393)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
21 months ago[mono] Add back OP_XOP_OVR_X_X for arm64 (#85401)
Radek Doulik [Thu, 27 Apr 2023 08:43:31 +0000 (10:43 +0200)]
[mono] Add back OP_XOP_OVR_X_X for arm64 (#85401)

And also add missing intrinsic attributes.

This addresses feedback from https://github.com/dotnet/runtime/pull/85390

21 months ago[main] Update dependencies from dotnet/arcade (#85308)
dotnet-maestro[bot] [Thu, 27 Apr 2023 08:41:13 +0000 (10:41 +0200)]
[main] Update dependencies from dotnet/arcade (#85308)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
21 months agoEnable other native subsets for linux-riscv64 in CI (#85443)
Adeel Mujahid [Thu, 27 Apr 2023 08:22:05 +0000 (11:22 +0300)]
Enable other native subsets for linux-riscv64 in CI (#85443)

Follow up on https://github.com/dotnet/runtime/commit/277a28d0a357d2e568681efb400523f1cf848ecd (which enabled `linux-riscv64` coreclr build in the CI):

This PR adds `linux-riscv64 Release AllSubsets_Mono` leg in the CI to build `mono`, `libs`, `host` and `packs` subsets.

We are not running tests in the CI, but this leg is to protect the build from regressing.

21 months ago[mono][llvm] Enable the cold calling conv on osx/linux. (#83519)
Zoltan Varga [Thu, 27 Apr 2023 07:03:25 +0000 (03:03 -0400)]
[mono][llvm] Enable the cold calling conv on osx/linux. (#83519)

21 months ago[Arm64] Replace pairs of `str` with `stp` (#85032)
Kunal Pathak [Thu, 27 Apr 2023 06:10:15 +0000 (23:10 -0700)]
[Arm64] Replace pairs of `str` with `stp` (#85032)

* Add emitIns_SS_R_R_R_I()

* Introduce instrDescStrPair and use it

* rename some variables and fix a bug in outputInstr

* Rename to instrDescLclVarPair

* Add the missing SetIsLclVar()

* review feedback

* Use same code for GC/non-GC lclVar for stp'

* Use same code path for ldp/stp

* Just have asending/descending

* refactor code around emitOutputInstr()

* jit format

* Remove the comment

* Separate instrDescLclVarPair and instrDescLclVarPairCns

* useRsvdReg for assert

* add back the assert around `adr + ofs`

* Move OptimizeLdrStr() in emitarm64.cpp

* Update the assert for offset distance

* Rename emitIns_SS_R_R_R_I() to emitIns_R_R_R_I_LdStPair()

* jit format

* review feedback

21 months agoJIT: prefer edge counts; keep class profiles even if tossing counts (#85406)
Andy Ayers [Thu, 27 Apr 2023 01:05:59 +0000 (18:05 -0700)]
JIT: prefer edge counts; keep class profiles even if tossing counts (#85406)

If there are both edge and block counts for a method, prefer to use the
edge counts (block counts are no longer the default, so are more likely
to be stale).

Sometimes we decide not to use count data because of correlation or
solver issues. When this happens, keep the class profile data viable
and let the code that deals with class profiles handle the possibility
of stale or mismatched data.

Addresses some aspects of #84446, though it's still not clear why we see
static profiles with both block and edge counts.

21 months agoAdd arm64 wasm support (#83677)
Evgeny Karpov [Thu, 27 Apr 2023 00:45:00 +0000 (02:45 +0200)]
Add arm64 wasm support (#83677)

21 months agoJIT: fix phase status for some minimal instrumentation cases (#85411)
Andy Ayers [Wed, 26 Apr 2023 23:48:46 +0000 (16:48 -0700)]
JIT: fix phase status for some minimal instrumentation cases (#85411)

The instrumentation phase may modify the flow graph in anticipation of doing
some instrumentation, but then (because of minimal profiling) decide not to
instrument.

Make sure the phase status properly reflects that the phase made changes in
this case, and a few other cases where we exit early without actually doing
any instrumentation.

Fixes #85061.

21 months agoFix physical promotion scenario name and a couple of bugs (#85343)
Jakob Botsch Nielsen [Wed, 26 Apr 2023 22:43:47 +0000 (00:43 +0200)]
Fix physical promotion scenario name and a couple of bugs (#85343)

This was renamed but I forgot to update these occurrences. The result is
that runtime-jit-experimental is not actually running with physical
promotion enabled.

Also fix a couple of bugs that made it in in the meantime.

21 months agoJIT: Change GTF_ICON_INITCLASS -> GTF_IND_INITCLASS (#85396)
Jakob Botsch Nielsen [Wed, 26 Apr 2023 21:16:02 +0000 (23:16 +0200)]
JIT: Change GTF_ICON_INITCLASS -> GTF_IND_INITCLASS (#85396)

The JIT has a flag GTF_ICON_INITCLASS that represents that accesses off
that address are cctor dependent. Hoisting uses this to avoid hoisting
cctor dependent indirections unless all cctors are also hoisted.
However, local constant prop/VN-based constant prop do not handle this
flag, so we could run into cases where addresses with GTF_ICON_INITCLASS
were propagated and then subsequently hoisted incorrectly.

This change moves the flag to an OperIsIndir() flag instead of being a
flag on the constant. After some digging, I found that the original
reason the flag was not an indir flag was simply that there were no more
indir flags available, but we do have available flags today. This fix
is much simpler than the alternatives which would be to teach VN/local
copy prop to propagate this GTF_ICON_INITCLASS flag.

Also remove GTF_FLD_INITCLASS which is never set.

21 months agoFix stress builds (#85342)
Anton Firszov [Wed, 26 Apr 2023 20:38:54 +0000 (22:38 +0200)]
Fix stress builds (#85342)

Fix #85338, by switching to centos-stream8

21 months agoAdd CompositeFormat.MinimumArgumentCount and remove TryParse (#85348)
Stephen Toub [Wed, 26 Apr 2023 20:30:11 +0000 (16:30 -0400)]
Add CompositeFormat.MinimumArgumentCount and remove TryParse (#85348)

* Add CompositeFormat.MinimumArgumentCount

* Remove CompositeFormat.TryParse

It encourages bad patterns of consumption.

21 months agoFix generic dictionary lookups for param types and function pointers (#85369)
Jan Kotas [Wed, 26 Apr 2023 19:51:27 +0000 (12:51 -0700)]
Fix generic dictionary lookups for param types and function pointers (#85369)

* Fix generic dictionary lookups for param types and function pointers

Fixes #85240

* AllowUnsafeBlocks

* Disable test on Mono

21 months agolet user know working directory will be used as content root path by default (#82445)
Badre BSAILA [Wed, 26 Apr 2023 19:39:02 +0000 (21:39 +0200)]
let user know working directory will be used as content root path by default (#82445)

21 months agoFix totalILArgs for explicithis (#85347)
Michał Petryka [Wed, 26 Apr 2023 19:21:01 +0000 (21:21 +0200)]
Fix totalILArgs for explicithis (#85347)

* Fix totalILArgs for explicithis

* Fix missed places

21 months agoAdd introspection for readelf (#85298)
Adeel Mujahid [Wed, 26 Apr 2023 19:07:58 +0000 (22:07 +0300)]
Add introspection for readelf (#85298)

21 months agoBump main preview version to 5 (#85368)
Carlos Sánchez López [Wed, 26 Apr 2023 19:06:24 +0000 (12:06 -0700)]
Bump main preview version to 5 (#85368)

21 months agoAssemblyBuilder.Save add custom attributes handling. (#84580)
Buyaa Namnan [Wed, 26 Apr 2023 16:28:25 +0000 (09:28 -0700)]
AssemblyBuilder.Save add custom attributes handling. (#84580)

* Initial custom attributes handling

* Pseudo custom attributes handling and tests

* Use ReadOnlySpan for CustomAttribute binaryData

* Update some pseudo attributes handling and apply feedback

* Add one more pseudo attribute and a few small changes

* Move pseudo attributes handling

* Remove type loading logic from CustomAttributes parsing, use constants for some values

* Add MarshalAsAttribute handling and apply other feedbacks

---------

Co-authored-by: Aaron Robinson <arobins@microsoft.com>
21 months ago[mono][jit] Add an option to use an mrgctx for all gshared methods. (#82981)
Zoltan Varga [Wed, 26 Apr 2023 15:01:05 +0000 (11:01 -0400)]
[mono][jit] Add an option to use an mrgctx for all gshared methods. (#82981)

Enable it by default on WASM.

In this mode, all gshared methods get an mrgctx, which means they can access
their data using a simple load from the mrgctx instead of having to call
a rgctx fetch trampoline.

Upsides:
- much simpler.
- faster access to gshared data
- smaller code and data size in the AOT case
- if enabled by default on all platforms, large amount of gshared
  code can be removed

Downsides:
- the methods have to initialize their mrgctx in their prolog
- on non-wasm platforms, indirect calls to gshared methods
  (like virtual calls) will need to use rgctx trampolines more often
  to pass the mrgctx.

21 months ago[wasm][nodejs] enable EH for unit tests (#85387)
Pavel Savara [Wed, 26 Apr 2023 14:24:59 +0000 (16:24 +0200)]
[wasm][nodejs] enable EH for unit tests (#85387)

21 months agoMade helixpublishwitharcade's TargetOS property lowercase. (#85357)
Ivan Diaz Sanchez [Wed, 26 Apr 2023 14:16:19 +0000 (07:16 -0700)]
Made helixpublishwitharcade's TargetOS property lowercase. (#85357)

Fixes #81141. In PR #80164, the build scripts were updated to always require and/or convert the MSBuild `TargetOS` property to lowercase. However, the _helixpublishwitharcade.proj_ file was not included in these efforts, which led to some confusing behavior and misplaced files, as described in issue #81141. This PR addresses and fixes that.

21 months ago[browser] Fix webcil lazy loading and satellite assemblies in Wasm SDK (#85335)
Pavel Savara [Wed, 26 Apr 2023 14:11:22 +0000 (16:11 +0200)]
[browser] Fix webcil lazy loading and satellite assemblies in Wasm SDK (#85335)

Co-authored-by: Marek Fišera <mara@neptuo.com>
21 months ago[mono][jit] Adding Vector128.ConvertXX as intrinsic on arm64. (#85163)
Jan Dupej [Wed, 26 Apr 2023 14:03:37 +0000 (16:03 +0200)]
[mono][jit] Adding Vector128.ConvertXX as intrinsic on arm64. (#85163)

* [mono][jit] Adding Vector128.ConvertXX as intrinsic on arm64.

* Changed rounding model on f->i conversion.

* Disabled f32->i32 casting test.

* Disabled all of failing JIT tests.

21 months agoSkip 84693 test (#85381)
Will Smith [Wed, 26 Apr 2023 13:58:08 +0000 (06:58 -0700)]
Skip 84693 test (#85381)

21 months ago[mono][jit] Add Vector128.WithElement as intrinsic on arm64. (#85158)
Jan Dupej [Wed, 26 Apr 2023 12:47:57 +0000 (14:47 +0200)]
[mono][jit] Add Vector128.WithElement as intrinsic on arm64. (#85158)

* [mono][jit] Add Vector128.WithElement as intrinsic on arm64.

* Fixed store opcode mismatch.

* Optimize the nonconstant case only for Vector128 in mini.

21 months ago[wasm][WBT] Fix pack pattern take two (#85391)
Pavel Savara [Wed, 26 Apr 2023 12:00:30 +0000 (14:00 +0200)]
[wasm][WBT] Fix pack pattern take two (#85391)

21 months agoImplement ICorProfilerInfo14::EnumerateNonGCObjects (#85100)
Egor Bogatov [Wed, 26 Apr 2023 11:06:05 +0000 (13:06 +0200)]
Implement ICorProfilerInfo14::EnumerateNonGCObjects (#85100)

21 months agoJIT: Introduce GT_JTEST and clean up GT_JCMP flags (#85242)
Jakob Botsch Nielsen [Wed, 26 Apr 2023 08:04:03 +0000 (10:04 +0200)]
JIT: Introduce GT_JTEST and clean up GT_JCMP flags (#85242)

* Introduce GT_JTEST to replace GTF_JCMP_TEST
* Stop encoding JCMP conditions in GenTreeFlags by switching GT_JCMP to
  a GenTreeOpCC node. This removes GTF_JCMP_EQ and the
  LoongArch64/RISC-V specific mechanism to communicate condition codes
  to the backend via gtFlags.

21 months agoFix simd12_t size (#85362)
Egor Bogatov [Wed, 26 Apr 2023 07:34:39 +0000 (09:34 +0200)]
Fix simd12_t size (#85362)

21 months agoFold IND(frozenObj, CNS) (#85127)
Egor Bogatov [Wed, 26 Apr 2023 07:21:34 +0000 (09:21 +0200)]
Fold IND(frozenObj, CNS) (#85127)

Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
21 months ago[JIT] ARM64 - Fixed regressions for `GT_NEG` containment (#85230)
Will Smith [Wed, 26 Apr 2023 07:08:06 +0000 (00:08 -0700)]
[JIT] ARM64 - Fixed regressions for `GT_NEG` containment (#85230)

* Fixed regressions for 'GT_NEG' containment on ARM64

* Containing NEG is only valid for EQ and NE.

* Update codegenarm64.cpp

* Formatting

21 months agoChange `callvirt` into `calli` for virtual delegates (#83461)
Vlad-Alexandru Ionescu [Wed, 26 Apr 2023 06:27:29 +0000 (08:27 +0200)]
Change `callvirt` into `calli` for virtual delegates (#83461)

JIT delegates do not depend on the target method and an call is used

---------

Signed-off-by: Vlad - Alexandru Ionescu <vlad-alexandruionescu@Vlads-MacBook-Pro-2.local>
Co-authored-by: Vlad - Alexandru Ionescu <vlad-alexandruionescu@Vlads-MacBook-Pro-5.local>
21 months agoDon't re-scan previously visited blocks in helperexpansion.cpp (#85201)
Egor Bogatov [Wed, 26 Apr 2023 05:34:01 +0000 (07:34 +0200)]
Don't re-scan previously visited blocks in helperexpansion.cpp (#85201)

22 months ago[Wasm.Build.Tests] Fixup wildcard matching for runtime packs (#85286)
Aleksey Kliger (λgeek) [Wed, 26 Apr 2023 01:55:38 +0000 (21:55 -0400)]
[Wasm.Build.Tests] Fixup wildcard matching for runtime packs (#85286)

The naming is
`Microsoft.NETCore.App.Runtime.Mono.{variant}.{rid}.{version}.nupkg`

Fixes local WBT builds for non-default runtime variants (eg: build
with `/p:MonoWasmBuildVariant=multithread` then run WBT)

22 months agoGuard DynamicDependency processing against `TypeSystemException`s (#85285)
Michal Strehovský [Wed, 26 Apr 2023 01:09:13 +0000 (10:09 +0900)]
Guard DynamicDependency processing against `TypeSystemException`s (#85285)

Works around https://github.com/dotnet/fsharp/issues/15140 and it's also just good hygiene.

22 months agoRe-enable PGO for linux (#85355)
Sven Boemer [Wed, 26 Apr 2023 00:55:36 +0000 (17:55 -0700)]
Re-enable PGO for linux (#85355)

22 months ago[hot_reload] assorted hot reload fixes for cumulative property updates (#85351)
Aleksey Kliger (λgeek) [Tue, 25 Apr 2023 23:58:51 +0000 (19:58 -0400)]
[hot_reload] assorted hot reload fixes for cumulative property updates (#85351)

* [hot_reload] remove unneeded assertion

`is_addition` is already defined as `token_index-1 >=
delta_info->count[token_table].prev_gen_rows` so:

1. the assertion as written is wrong for cumulative updates that add
new properties or events
2. the assertion would be trivially true if it was updated to use
`delta_info->count[token_table].prev_gen_rows`.

Fixes the ability to cumulatively add new properties

* Update generation on MonoClassMetadataUpdateInfo when adding members

Give recompute_ginst_update_info something to work with.

* assert that generic instances don't call hot_reload_get_property

token-based lookup should only happen for class defs or GTDs

* update regression test

22 months agoJIT: improve profile update for loop inversion (#85265)
Andy Ayers [Tue, 25 Apr 2023 23:52:56 +0000 (16:52 -0700)]
JIT: improve profile update for loop inversion (#85265)

If the loop test block has multiple predecessors we will not do proper
profile updates. This can lead to downstream problems with block layout
(say leaving a cold block in a loop).

Fix by changing how we compute the amount of profile that should remain
in the test block.

Fixes #84319.

22 months agoJIT: add ssa accounting to morph's div opts (#85332)
Andy Ayers [Tue, 25 Apr 2023 23:50:22 +0000 (16:50 -0700)]
JIT: add ssa accounting to morph's div opts (#85332)

RBO triggered a morph opt that cloned an SSA local, throwing off the SSA
accounting. Fix by invoking the accounting helper after the morph expansion.

Closes #85226.

22 months agoDirectory.Build.props: don't overwrite PackageOS from source-build. (#85350)
Tom Deseyn [Tue, 25 Apr 2023 23:44:39 +0000 (01:44 +0200)]
Directory.Build.props: don't overwrite PackageOS from source-build. (#85350)

22 months agoAdd Winforms as consultant on ComponentModel (#85363)
Eric StJohn [Tue, 25 Apr 2023 21:59:52 +0000 (14:59 -0700)]
Add Winforms as consultant on ComponentModel (#85363)

22 months agoFix a few downlevel TimeProvider issues (#85346)
Stephen Toub [Tue, 25 Apr 2023 21:59:15 +0000 (17:59 -0400)]
Fix a few downlevel TimeProvider issues (#85346)

- Consistently null check the Timer stored in the state object
- Complete the a task canceled due to the CancellationToken with the CancellationToken
- Avoid an unnecessary closure in Delay
- Make TimeProvider.System.CreateTimer use Timer's ctor that takes duration/period rather than making a separate call to Change

22 months ago[wasm] Disable `Wasm.Build.Tests.Blazor.BuildPublishTests.BugRegression_60479_WithRaz...
Marek Fišera [Tue, 25 Apr 2023 20:08:10 +0000 (22:08 +0200)]
[wasm] Disable `Wasm.Build.Tests.Blazor.BuildPublishTests.BugRegression_60479_WithRazorClassLib` (#85356)

* Add active issue on blazor lazy load test

* Add active issue on blazor lazy load test

22 months agoUse CollectionsMarshal.SetCount in LINQ to deduplicate ToArray/ToList implementations...
Stephen Toub [Tue, 25 Apr 2023 20:05:30 +0000 (16:05 -0400)]
Use CollectionsMarshal.SetCount in LINQ to deduplicate ToArray/ToList implementations (#85288)

* Use CollectionsMarshal.SetCount in LINQ to deduplicate ToArray/ToList implementations

* Fix BinaryFormatter test

The test was implemented using ToList, and `List<T>` serialization serializes out its version field.  As a result, because we're now optimizing creation and not incrementing the version as much in ToList, the blob didn't match.

22 months agoFix Avx2 helpers (#85275)
Sven Boemer [Tue, 25 Apr 2023 19:56:57 +0000 (12:56 -0700)]
Fix Avx2 helpers (#85275)

Unblocks dotnet-optimization flow and
https://github.com/dotnet/runtime/issues/84711. Includes a
dotnet-optimization update to confirm this it avoids the issue
discussed in https://github.com/dotnet/runtime/pull/84635. This
fixes that issue by preventing R2R for any Avx2 helpers which
assume they are called with Avx2 enabled.

22 months agoinit-distro-rid.sh: fix unbound error when VERSION_ID is not defined. (#85319)
Tom Deseyn [Tue, 25 Apr 2023 19:50:19 +0000 (21:50 +0200)]
init-distro-rid.sh: fix unbound error when VERSION_ID is not defined. (#85319)

22 months ago[mono][NativeAOT] System.Globalization.Native build improvements (#82393)
Filip Navara [Tue, 25 Apr 2023 18:46:56 +0000 (20:46 +0200)]
[mono][NativeAOT] System.Globalization.Native build improvements (#82393)

Fixes #82389

- Fixes build of System.Globalization.Native for iOS-like, browser, and wasi platforms
- Removes ICU shim from static builds of Mono runtime and builds it as part of libs.native subset
- Switches browser/wasi to use the static libraries

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
22 months agoJIT: Create side effect commas as TYP_VOID in block morph (#85320)
Jakob Botsch Nielsen [Tue, 25 Apr 2023 18:13:58 +0000 (20:13 +0200)]
JIT: Create side effect commas as TYP_VOID in block morph (#85320)

This code could create IR shapes like

COMMA struct
  ...
  ASG struct
    dst
    src

After liveness that would sometimes result in

COMMA struct
  ...
  NOP void

which could confuse optimization phases when JitOptRepeat was enabled.

The more canonical shape for these side-effecting GT_COMMA nodes has
them TYP_VOID typed as shown by gtExtractSideEffList, so do the same in
block morph.

Fix #85037

22 months agoExpose various Convert intrinsics for Avx512F, Avx512BW, and Avx512DQ (#85281)
Tanner Gooding [Tue, 25 Apr 2023 18:11:09 +0000 (11:11 -0700)]
Expose various Convert intrinsics for Avx512F, Avx512BW, and Avx512DQ (#85281)

* Expose various Convert intrinsics for Avx512F and Avx512DQ

* Expose various integer conversion APIs for Avx512F and Avx512BW

* Ensure special instructions are handled in codegen

* Apply formatting patch

* Ensure the AVX512F_VL variant is picked for simdSize=16/32

* Ensure conversion instructions are handled in PERFSCORE

* Ensure instructions use the right tuple type

* Removing an invalid API and fix more PERFSCORE entries

* Resolve additional failures masked by #85056

* Ensure TieredCompilation=0 is also passing

* Apply formatting patch

* Fixing some more test edge cases

* Ensure uint64->double and uint64->Float masks the input

22 months agoSPMI: Always add authenticated pip feed for test job runs (#85327)
Jakob Botsch Nielsen [Tue, 25 Apr 2023 17:33:37 +0000 (19:33 +0200)]
SPMI: Always add authenticated pip feed for test job runs (#85327)

We always try to upload the collections for the tests, even on failures,
so we should also add the authed feed on failures.

22 months agoEnC Support for Generics (#85269)
mikelle-rogers [Tue, 25 Apr 2023 17:32:19 +0000 (10:32 -0700)]
EnC Support for Generics (#85269)

* EnC non-functional changes
- Update inappropriate naming
- Update many logging statements
- Remove unused code

* EnC support for fields on generic types

* EnC support for methods on generic types

* Fix use after free introduced in EnC breakpoint.
Fix off by one for string logging.

* update new feature capabilities, JIT GUID

* Fix non-enc build

* Fix EnCFieldIndex check

* Remove IsFdPrivate assert

---------

Co-authored-by: Aaron R Robinson <arobins@microsoft.com>
Co-authored-by: Juan Hoyos <19413848+hoyosjs@users.noreply.github.com>
Co-authored-by: Tom McDonald <tommcdon@microsoft.com>
22 months agoNativeAOT ComWrappers: fix race condition in when creating native wrapper (#85235)
Austin Wise [Tue, 25 Apr 2023 16:26:32 +0000 (09:26 -0700)]
NativeAOT ComWrappers: fix race condition in when creating native wrapper (#85235)

22 months agoPopulating JSON properties support (#83669)
Krzysztof Wicher [Tue, 25 Apr 2023 16:26:03 +0000 (18:26 +0200)]
Populating JSON properties support (#83669)

* Populating JSON properties support

* apply review feedback

* Attempt to fix build by reducing stack frame

* Fix docs

* Remove unnecessary properties from ReadStackFrame.

* Move source gen tests to the source gen test project.

* Improve test helper method name.

* Add argument validation to JsonPropertyInfo.ObjectCreationHandling & extend unit testing for the new metadata APIs.

* Add test coverage for invalid attribute annotations.

---------

Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
22 months ago[NativeAOT] Do not strip exported symbols from executables on Apple platforms (#85293)
Ivan Povazan [Tue, 25 Apr 2023 16:09:40 +0000 (18:09 +0200)]
[NativeAOT] Do not strip exported symbols from executables on Apple platforms (#85293)

* Do not strip exported symbols from executables when explicitly specified

* Add '_' prefix to StripFlag internal project property

22 months agoMake Guid.HexsToChars aggressively inlined (#85322)
Stephen Toub [Tue, 25 Apr 2023 16:03:33 +0000 (12:03 -0400)]
Make Guid.HexsToChars aggressively inlined (#85322)

To help mono cope with the genericized implementation.  This method is only used when Ssse3 or AdvSimd.Arm64 are not supported, or when formatting the rarely-used "X" format, but currently mono AOT without LLVM doesn't enable those intrinsics.

22 months agoRetry compat Random.NextSingle in case rounding from double produces 1.0f (#85321)
Stephen Toub [Tue, 25 Apr 2023 16:02:20 +0000 (12:02 -0400)]
Retry compat Random.NextSingle in case rounding from double produces 1.0f (#85321)

The compat implementation behind Random just casts a double to a float to produce the result of NextSingle.  Some double values close to 1.0 might round up to 1.0f, which is out of range for NextSingle.  In that case, reject it and retry.  This approach is consistent with how fairness is handled elsewhere in the implementation, and avoids changing the sequence of values returned for a fixed seed in cases where an illegal value wasn't being returned.

22 months agoFix publishing relinked dotnet.worker.js (#85314)
Marek Fišera [Tue, 25 Apr 2023 15:56:02 +0000 (17:56 +0200)]
Fix publishing relinked dotnet.worker.js (#85314)

22 months agoAdd TargetHostName to QuicConnection (#84976)
Radek Zikmund [Tue, 25 Apr 2023 15:50:34 +0000 (17:50 +0200)]
Add TargetHostName to QuicConnection (#84976)

* Add TargetHostName to QuicConnection
Fixes #80508

* Make TargetHostName not nullable

* Fix build

* Fix build of tests

* Fix failing tests

* Code review feedback

* Use unencoded hostname in user-facing properties/params

* Fix failing tests

* Revert unwanted changes

* Add test for IDN cert validation

* Fix test again

* Fix trailing dot in hostname

22 months ago[wasm] Add more PackedSimd methods, logic ops (#85303)
Radek Doulik [Tue, 25 Apr 2023 15:33:11 +0000 (17:33 +0200)]
[wasm] Add more PackedSimd methods, logic ops (#85303)

* [wasm] Add more PackedSimd methods

* Fix doc comments

22 months agoFix the TimeProvider test (#85268)
Tarek Mahmoud Sayed [Tue, 25 Apr 2023 14:32:51 +0000 (07:32 -0700)]
Fix the TimeProvider test (#85268)

* Fix the TimeProvider test

* remove the assert

22 months agoFix coreclr-release-outerloop-nightly pipeline (#85278)
Tomáš Rylek [Tue, 25 Apr 2023 14:30:53 +0000 (16:30 +0200)]
Fix coreclr-release-outerloop-nightly pipeline (#85278)

22 months ago[RISC-V] Add RISC-V CI (#85289)
Dong-Heon Jung [Tue, 25 Apr 2023 14:28:27 +0000 (23:28 +0900)]
[RISC-V] Add RISC-V CI (#85289)

- Add RISC-V Checked Build CI
- https://github.com/dotnet/runtime/issues/84834

22 months agoJIT: Support some assignment decomposition in physical promotion (#85105)
Jakob Botsch Nielsen [Tue, 25 Apr 2023 13:57:48 +0000 (15:57 +0200)]
JIT: Support some assignment decomposition in physical promotion (#85105)

Add support for directly initializing and copying into replacements
instead of doing a struct local and read back. Physically promoted
struct locals used as sources are still handled conservatively (by first
writing them back to stack, then doing the copy).

For example, for a case like

```
void Foo()
{
    S s = _field;
    s.A = s.B + 3;
    Consume(s);
}

struct S
{
    public int A, B;
}
```

We see the following:

```
STMT00000 ( 0x000[E-] ... 0x006 )
               [000003] -A-XG------                         ▌  ASG       struct (copy)
               [000002] D------N---                         ├──▌  LCL_VAR   struct<Program+S, 8> V01 loc0
               [000001] ---XG------                         └──▌  FIELD     struct Program:_field
               [000000] -----------                            └──▌  LCL_VAR   ref    V00 this          (last use)
Processing block operation [000003] that involves replacements
New statement:
STMT00000 ( 0x000[E-] ... 0x006 )
               [000029] -A-XG------                         ▌  COMMA     int
               [000021] -A-XG------                         ├──▌  ASG       int
               [000015] D------N---                         │  ├──▌  LCL_VAR   int    V03 tmp1
               [000020] ---XG------                         │  └──▌  IND       int
               [000018] -----------                         │     └──▌  ADD       ref
               [000016] -----------                         │        ├──▌  LCL_VAR   ref    V00 this
               [000017] -----------                         │        └──▌  CNS_INT   long   8
               [000028] -A-XG------                         └──▌  ASG       int
               [000022] D------N---                            ├──▌  LCL_VAR   int    V04 tmp2
               [000027] ---XG------                            └──▌  IND       int
               [000025] -----------                               └──▌  ADD       ref
               [000023] -----------                                  ├──▌  LCL_VAR   ref    V00 this
               [000024] -----------                                  └──▌  CNS_INT   long   12
```

The logic is currently quite rudimentary when it comes to
holes/uncovered parts of the struct. For example, in the above case if
we add another unused field at the end of S then the result is:

```
STMT00000 ( 0x000[E-] ... 0x006 )
               [000003] -A-XG------                         ▌  ASG       struct (copy)
               [000002] D------N---                         ├──▌  LCL_VAR   struct<Program+S, 12> V01 loc0
               [000001] ---XG------                         └──▌  FIELD     struct Program:_field
               [000000] -----------                            └──▌  LCL_VAR   ref    V00 this          (last use)
Processing block operation [000003] that involves replacements
Struct operation is not fully covered by replaced fields. Keeping struct operation.
New statement:
STMT00000 ( 0x000[E-] ... 0x006 )
               [000030] -A-XG------                         ▌  COMMA     struct
               [000021] -A-XG------                         ├──▌  ASG       int
               [000015] D------N---                         │  ├──▌  LCL_VAR   int    V03 tmp1
               [000020] ---XG------                         │  └──▌  IND       int
               [000018] -----------                         │     └──▌  ADD       ref
               [000016] -----------                         │        ├──▌  LCL_VAR   ref    V00 this
               [000017] -----------                         │        └──▌  CNS_INT   long   8
               [000029] -A-XG------                         └──▌  COMMA     struct
               [000028] -A-XG------                            ├──▌  ASG       int
               [000022] D------N---                            │  ├──▌  LCL_VAR   int    V04 tmp2
               [000027] ---XG------                            │  └──▌  IND       int
               [000025] -----------                            │     └──▌  ADD       ref
               [000023] -----------                            │        ├──▌  LCL_VAR   ref    V00 this
               [000024] -----------                            │        └──▌  CNS_INT   long   12
               [000003] -A-XG------                            └──▌  ASG       struct (copy)
               [000002] D------N---                               ├──▌  LCL_VAR   struct<Program+S, 12> V01 loc0
               [000001] ---XG------                               └──▌  FIELD     struct Program:_field
               [000000] -----------                                  └──▌  LCL_VAR   ref    V00 this
```

In this case it would be significantly more efficient to copy only the
remainder, which is just a small part of the struct. However, in the
general case it is not easy to predict the most efficient way to do
this, and in some cases we cannot even represent the hole in JIT IR (if
it involves GC pointers), so I have left this for a future change for
now. Liveness should also be beneficial for that as there are many cases
where we would expect the remainder to be dead.

22 months agoRemove useless serializability checks (#80957)
madelson [Tue, 25 Apr 2023 13:47:38 +0000 (09:47 -0400)]
Remove useless serializability checks (#80957)

22 months ago[mono] Remove mono_dl_open_runtime_lib() (#85253)
Alexander Köplinger [Tue, 25 Apr 2023 13:45:51 +0000 (15:45 +0200)]
[mono] Remove mono_dl_open_runtime_lib() (#85253)

It was only used to load the profiler from an "installed" path, but that is no longer a thing in modern .NET

22 months ago[mono][interp] Fix il_offset of inserted instructions (#85305)
Vlad Brezae [Tue, 25 Apr 2023 13:02:54 +0000 (16:02 +0300)]
[mono][interp] Fix il_offset of inserted instructions (#85305)

After the original codegen happens, where instructions have the associated il_offset set, we might still generate new instruction as part of various optimizations. They would have the associated il_offset of the end of the method which is incorrect and was screwing up mapping from native_offset to il_offset.

22 months agoAdd function pointer type support to type loader (#85287)
Michal Strehovský [Tue, 25 Apr 2023 08:51:41 +0000 (17:51 +0900)]
Add function pointer type support to type loader (#85287)

So that we can create new function pointer types at runtime within the context of `MakeGenericXXX`.

22 months agoJIT: Allow spill-at-single-def for pure defs (#85251)
Jakob Botsch Nielsen [Tue, 25 Apr 2023 08:47:09 +0000 (10:47 +0200)]
JIT: Allow spill-at-single-def for pure defs (#85251)

Allow the spill-at-single-def logic to kick in for defs without subsequent uses before the spill.