platform/upstream/dotnet/runtime.git
2 years agoFixed relative links in Memory-model.md (#79785)
Günther Foidl [Sat, 17 Dec 2022 15:25:52 +0000 (16:25 +0100)]
Fixed relative links in Memory-model.md (#79785)

2 years ago[mono] Disable a few outerloop tests and update issue numbers (#79759)
Alexander Köplinger [Sat, 17 Dec 2022 11:39:38 +0000 (12:39 +0100)]
[mono] Disable a few outerloop tests and update issue numbers (#79759)

2 years agoJIT: Fix indir flags propagation for a couple of cases (#79751)
Jakob Botsch Nielsen [Sat, 17 Dec 2022 09:10:43 +0000 (10:10 +0100)]
JIT: Fix indir flags propagation for a couple of cases (#79751)

SetIndirExceptionFlags expects only unary indirs (reads) and does not
handle other cases correctly. Add an assert for it and fix the users.

Only fgMorphStoreDynBlock had the bug since gtUpdateNodeOperSideEffects
assumes the caller will propagate effect flags from operands afterwards.

Extracted from early liveness PR.

Fix #79750

2 years agoJIT: Fix switch peeling flags propagation (#79748)
Jakob Botsch Nielsen [Sat, 17 Dec 2022 09:10:20 +0000 (10:10 +0100)]
JIT: Fix switch peeling flags propagation (#79748)

Otherwise we could propagate overlapping flags that change meaning.
Extracted from early liveness PR.

2 years agoJIT: Clean up some old style walks and QMARK validation (#79747)
Jakob Botsch Nielsen [Sat, 17 Dec 2022 09:09:56 +0000 (10:09 +0100)]
JIT: Clean up some old style walks and QMARK validation (#79747)

* JIT: Clean up some old style walks

Extracted from early liveness PR. Also small visitor change.

* Remove dead code, more cleanup

2 years agoDelete some commented tests (#79742)
Jakob Botsch Nielsen [Sat, 17 Dec 2022 09:08:11 +0000 (10:08 +0100)]
Delete some commented tests (#79742)

* (Re)enable some SysV pinvoke tests

Fix #4680

* Delete tests instead

2 years agoAvoid boxing in DeferredDisposableLifetime (#79778)
Miha Zupan [Sat, 17 Dec 2022 04:58:41 +0000 (05:58 +0100)]
Avoid boxing in DeferredDisposableLifetime (#79778)

* Avoid boxing in DeferredDisposableLifetime

* Move `typeof` lookup behind the if check

2 years agoEnsure that `TryGetContainableHWIntrinsicOp` is non-mutating (#79363)
Tanner Gooding [Fri, 16 Dec 2022 22:05:39 +0000 (14:05 -0800)]
Ensure that `TryGetContainableHWIntrinsicOp` is non-mutating (#79363)

* Ensure that `TryGetContainableHWIntrinsicOp` is non-mutating

* Applying formatting patch

* Ensure BuildOperandUses handles CreateScalarUnsafe being contained

* Ensure CreateScalarUnsafe is only contained for regOptional when the op1 type is a floating-point

* Directly check that op1 is contained/regOptional

* Ensure FusedMultiplyAdd rechecks CreateScalarUnsafe containment after removing NEG nodes

* Ensure BroadcastScalarToVector doesn't regress containable scenarios

* Applying formatting patch

2 years agoFixes #79558: (#79681)
DeepakRajendrakumaran [Fri, 16 Dec 2022 21:56:50 +0000 (13:56 -0800)]
Fixes #79558: (#79681)

INS_movd can represent either movd or movq(https://github.com/dotnet/runtime/issues/47943).
As such, this is a special case and we need to calculate inputSize based on emitAttr.

2 years agoFix failing coreclr tests in `runincontext` mode (#79705)
Jan Vorlicek [Fri, 16 Dec 2022 21:18:47 +0000 (22:18 +0100)]
Fix failing coreclr tests in `runincontext` mode (#79705)

* Fix unloadability tests with `runincontext`

This change makes the run of coreclr tests with `runincontext` argument
pass without any errors. It disables couple of tests incompatible with
unloadability and one test with known unloadability issue
(https://github.com/dotnet/runtime/issues/79588).
It also fixes two COM interop tests that were not releasing a wrapper,
which blocked the ability to unload it.

* Fix the JIT il tests instead of disabling

2 years agoChange the default for ilc compiler architecture (#79761)
Jan Kotas [Fri, 16 Dec 2022 20:18:44 +0000 (12:18 -0800)]
Change the default for ilc compiler architecture (#79761)

The host architecture for the ilc compiler package should default to .NET SDK architecture that the build is running under.

Fixes #79253

2 years agoimprove SendFileGetsCanceledByDispose test (#79718)
Tomas Weinfurt [Fri, 16 Dec 2022 19:58:54 +0000 (11:58 -0800)]
improve SendFileGetsCanceledByDispose test (#79718)

2 years agodisable SslStream_AllowRenegotiation_False_Throws (#79730)
Tomas Weinfurt [Fri, 16 Dec 2022 19:57:59 +0000 (11:57 -0800)]
disable SslStream_AllowRenegotiation_False_Throws (#79730)

2 years agoadd EventSource log to alpn on macOS (#79737)
Tomas Weinfurt [Fri, 16 Dec 2022 19:56:58 +0000 (11:56 -0800)]
add EventSource log to alpn on macOS (#79737)

2 years agoMemory model document. (#75790)
Vladimir Sadov [Fri, 16 Dec 2022 19:26:07 +0000 (11:26 -0800)]
Memory model document. (#75790)

* Created memory-model.md

* addresses some comments

* More details and samples.

* Fix trailing whitespaces.

* More trailing whitespace

* More trailing whitespace.

* Apply suggestions from code review (typos)

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Dan Moseley <danmose@microsoft.com>
* replaced references to CLR with ".NET runtime"

* Addressed some PR review feedback

* Moved to specs folder

* More addressing PR feedback

* Volatile/Interlocked methods are atomic

* Better notes about atomicity of pointers

* Apply suggestions from code review

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Addressing more PR feedback

* Updated singleton sample for more clarity.

* Trailing whitespace.

* Move data dependent reads to general section

* Compat disambiguation note on object assignments.

* Apply suggestions from code review

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* No dots at title ends

* "Data-dependent" spelled with dash consistently

* Apply suggestions from code review

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Apply suggestions from code review

Co-authored-by: Aaron Robinson <arobins@microsoft.com>
* Apply suggestions from code review

Co-authored-by: Bruce Forstall <brucefo@microsoft.com>
* order of object assignment and data-dependent memory accesses

* Listed primitive types.

* Briefly explained motivations for the treatment of memory access sideeffects.

* Update docs/design/specs/Memory-model.md

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Link to the data-dependent accesses and compiler optimizations followup issue.

* removed unnecessary `[`

* Update docs/design/specs/Memory-model.md

* Trailing whitespace

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Dan Moseley <danmose@microsoft.com>
Co-authored-by: Aaron Robinson <arobins@microsoft.com>
Co-authored-by: Bruce Forstall <brucefo@microsoft.com>
2 years agoAdd nullable reference type annotations to System.Text.Json source gen (#79613)
Eirik Tsarpalis [Fri, 16 Dec 2022 18:44:06 +0000 (20:44 +0200)]
Add nullable reference type annotations to System.Text.Json source gen (#79613)

* Add nullability annotaitons to sourcegen components.

* Move sourcegen testing from Roslyn4.0 to Roslyn4.4.

* Fix accessibility modifiers

* Allow source generators to multi-target

* Binplace only netstandard2.0 compiled source generators

* Use live NetCoreAppCurrent tfm

* Update Directory.Build.targets

* Pick correct analyzer asset for consumption

* Fix build

* Revert "Move sourcegen testing from Roslyn4.0 to Roslyn4.4."

This reverts commit fe7857066040ddf0ef632c135e83e49b097c28f7.

* Make analyzer P2Ps choose the right asset

* PR feedback

* Update src/libraries/System.Text.Json/gen/JsonSourceGenerator.Parser.cs

* Make source generator target an LKG

* Update project-guidelines.md

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
2 years agoImprove spmi diffs summary report (#79725)
Bruce Forstall [Fri, 16 Dec 2022 18:29:43 +0000 (10:29 -0800)]
Improve spmi diffs summary report (#79725)

1. In the overall summary, if base/diff MISSED are the same,
only display a single number.
2. Also display MISSED count as percentage of total MISSED
3. Display "same size" count in improvements/regressions table

2 years agoEnable SendRecvPollSync_TcpListener_Socket Test (#79145)
Ahmet Ibrahim AKSOY [Fri, 16 Dec 2022 15:18:59 +0000 (16:18 +0100)]
Enable SendRecvPollSync_TcpListener_Socket Test (#79145)

2 years agoAvoid touching `NameMangler` during scanning (#79738)
Michal Strehovský [Fri, 16 Dec 2022 15:04:29 +0000 (00:04 +0900)]
Avoid touching `NameMangler` during scanning (#79738)

When we're running in a scan-only mode (such as when running trimming tests), we were still computing mangled names for things because two nodes eagerly needed them. This structures things a bit differently so that we can finish scanning without ever touching the `NameMangler`.

This is also an improvement for end user scenarios because we really don't need them during scanning (we avoid the work), and we don't have to hold on to a useless string for who knows how many GC collections.

2 years ago[mono][interp] Allow passing vtypes with a single scalar field to native code using...
Zoltan Varga [Fri, 16 Dec 2022 14:13:18 +0000 (09:13 -0500)]
[mono][interp] Allow passing vtypes with a single scalar field to native code using the faster code path. (#79686)

This affects types like ObjectHandleOnStack which are passed to icalls.

2 years ago[Android] Fix SslStream.IsMutuallyAuthenticated (#79601)
Šimon Rozsíval [Fri, 16 Dec 2022 12:28:57 +0000 (13:28 +0100)]
[Android] Fix SslStream.IsMutuallyAuthenticated (#79601)

* Implement CertificateValidationPal.IsLocalCertificateUsed on Android

* Enable test on Android

* Update comment

2 years agoUpgrade .NET Framework queue (#79667)
Viktor Hofer [Fri, 16 Dec 2022 11:20:37 +0000 (12:20 +0100)]
Upgrade .NET Framework queue (#79667)

* Upgrade .NET Framework queue

* Update helix-queues-setup.yml

2 years agoLook up Queryable operator MethodInfos without MakeGenericMethod (#79717)
Shay Rojansky [Fri, 16 Dec 2022 09:18:07 +0000 (10:18 +0100)]
Look up Queryable operator MethodInfos without MakeGenericMethod (#79717)

For NativeAOT compatibility, better speed.

Closes #79199

2 years agoAvoid hydrating type system entities for all of CoreLib (#79732)
Michal Strehovský [Fri, 16 Dec 2022 09:00:44 +0000 (18:00 +0900)]
Avoid hydrating type system entities for all of CoreLib (#79732)

Instead of `foreach (TypeInModule) foreach (MethodOnType) CheckCustomAttribute` do a `foreach (CustomAttribute)`.

Saves about 30 ms wallclock time.

2 years ago[wasm] Improve SIMD vector equality operator (#79719)
Radek Doulik [Fri, 16 Dec 2022 08:50:03 +0000 (09:50 +0100)]
[wasm] Improve SIMD vector equality operator (#79719)

Improve the code we emit for vector equality. Instead of using multiple shuffles, use alltrue instructions

    i8x16.all_true(a: v128) -> i32
    i16x8.all_true(a: v128) -> i32
    i32x4.all_true(a: v128) -> i32
    i64x2.all_true(a: v128) -> i32

That saves size and greatly improves performance. For example Span's SequenceEqual improves like this on chrome.

| measurement | old | new |
|-:|-:|-:|
|              Span, SequenceEqual bytes |     0.0087ms |     0.0021ms |
|              Span, SequenceEqual chars |     0.0174ms |     0.0042ms |

The dotnet.wasm size drops by cca 20kbytes for bench sample.

The code diff:

```
> wa-diff -d -f corlib_System_SpanHelpers_SequenceEqual_byte__byte__uintptr dotnet.old.wasm dotnet.new.wasm
...
          v128.load    [SIMD]
          i8x16.eq    [SIMD]
-         local.tee $4
+         i8x16.all.true    [SIMD]
-         local.get $4
-         i8x16.shuffle 0x00000000000000000f0e0d0c0b0a0908    [SIMD]
-         local.get $4
-         v128.and    [SIMD]
-         local.tee $4
-         local.get $4
-         i8x16.shuffle 0x00000000000000000000000007060504    [SIMD]
-         local.get $4
-         v128.and    [SIMD]
-         local.tee $4
-         local.get $4
-         i8x16.shuffle 0x00000000000000000000000000000302    [SIMD]
-         local.get $4
-         v128.and    [SIMD]
-         local.tee $4
-         local.get $4
-         i8x16.shuffle 0x00000000000000000000000000000001    [SIMD]
-         local.get $4
-         v128.and    [SIMD]
-         i8x16.extract.lane.u 0    [SIMD]
          i32.eqz
          if
...
```

2 years agoSkip nested types in `EcmaModule.GetType` (#79734)
Michal Strehovský [Fri, 16 Dec 2022 06:04:56 +0000 (15:04 +0900)]
Skip nested types in `EcmaModule.GetType` (#79734)

Opened this methods because I saw it in the profiler, but I think this is a correctness issue. Might help perf. Didn't measure.

2 years agoDo not run recursive cycle detection on debug builds (#79735)
Michal Strehovský [Fri, 16 Dec 2022 06:04:19 +0000 (15:04 +0900)]
Do not run recursive cycle detection on debug builds (#79735)

These add pretty significant overhead to inner loop. Leaving the code in if we ever need to debug the algorithm.

2 years agoMake MethodDesc.IsStaticConstructor more efficient (#79733)
Michal Strehovský [Fri, 16 Dec 2022 06:03:17 +0000 (15:03 +0900)]
Make MethodDesc.IsStaticConstructor more efficient (#79733)

This is called a lot from reflection-dataflow-related places.

2 years agoNeed to ensure the symbol table and symbol string table for the dylinker (#79728)
Mike McLaughlin [Fri, 16 Dec 2022 05:41:28 +0000 (21:41 -0800)]
Need to ensure the symbol table and symbol string table for the dylinker (#79728)

module is part of the core dump for the dump readers. They still need
to look up the "dyld_all_image_infos" symbol.

2 years agoJIT: Refactor gtExtractSideEffList (#79611)
Jakob Botsch Nielsen [Thu, 15 Dec 2022 20:20:21 +0000 (21:20 +0100)]
JIT: Refactor gtExtractSideEffList (#79611)

Inline gtBuildCommaList (this is the only usage) and build it in the
right order to allow doing it during the walk. Also fix propagation of
GTF_DEBUG_NODE_MORPHED flag.

Fix #79543

2 years ago[NativeAOT] Thin locks (#79519)
Vladimir Sadov [Thu, 15 Dec 2022 18:56:15 +0000 (10:56 -0800)]
[NativeAOT] Thin locks (#79519)

* switch to managed thread ID in Lock

* fattening the lock

* __declspec(selectany)

* few tweaks

* fairness

* more room for thread ids

* remove CurrentNativeThreadId

* couple fixes

* fix win-arm64 build

* win-arm64 build , another try

* Apply suggestions from code review

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* fix after renaming

* do not report successful spin if thread has waited

* keep extern and undo mangling of tls_CurrentThread in asm

* use SyncTable indexer in less perf-sensitive places.

* GetNewHashCode just delegate to shared random

* Apply suggestions from code review

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* unchecked const conversion

* some refactoring comments and typos

* min number of spins in the backoff

* moved CurrentManagedThreadIdUnchecked to ManagedThreadId

* Use `-1` to report success and allow using  element #1 in the SyncTable

* use threadstatic for managed thread ID

* check before calling RhGetProcessCpuCount

* use 0 as default thread ID

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2 years agoDo not avoid LCL_FLDs for indirectly accessed locals (#77980)
SingleAccretion [Thu, 15 Dec 2022 17:00:10 +0000 (20:00 +0300)]
Do not avoid LCL_FLDs for indirectly accessed locals (#77980)

They will have to be DNERed anyway.

2 years agoDisallow `IND<struct>` except as a source of `STORE_DYN_BLK` (#74784)
SingleAccretion [Thu, 15 Dec 2022 16:57:21 +0000 (19:57 +0300)]
Disallow `IND<struct>` except as a source of `STORE_DYN_BLK` (#74784)

* Don't create IND<struct> for InitializeArray

* Don't create IND<struct> in STORE_DYN_BLK morph

* Don't create IND<struct> for FIELDs

* Simplify code

* Delete "ADDR(FIELD)" wrapping for struct args

* Fix refanytype import

* Fix fwd sub

* Fix non-null prop

* Simplify impAssignStruct

* Simplify "impNormStructVal" more

2 years ago[iOS][tvOS] Skip NullableTests.ClassWithDictionariesWithNullableValues (#79675)
Steve Pfister [Thu, 15 Dec 2022 16:39:13 +0000 (08:39 -0800)]
[iOS][tvOS] Skip NullableTests.ClassWithDictionariesWithNullableValues (#79675)

The test is failing on device and is tracked by https://github.com/dotnet/runtime/issues/79583

2 years ago[wasm] fix aotProfiler init (#79651)
Pavel Savara [Thu, 15 Dec 2022 15:52:03 +0000 (16:52 +0100)]
[wasm] fix aotProfiler init (#79651)

2 years ago[mono] Initial support for unloadable ALCs (#77399)
Zoltan Varga [Thu, 15 Dec 2022 15:43:29 +0000 (10:43 -0500)]
[mono] Initial support for unloadable ALCs (#77399)

* [mono] Add LoaderAllocator type, whose instances are used to
detect whenever a collectible ALC has managed references.

* [mono] Add an implicit GC reference between objects allocated from a collectible ALC and its LoaderAllocator object.

* [mono] Add a new hash table which is similar to MonoGHashTable, but it doesn't keep the key/value objects alive by itself.

* [mono] Add a keepalive field to some reflection objects to keep the alc alive if user code
holds a reference to them. Change the reflection hashes in MonoMemoryManager to weak hashes
so the hashes themselves don't keep the alc alive.

* Fix reflection hashes.

* [mono] Optimize the case when mono_method_get_signature_checked () is called with a non-zero context and a non-generic signature.

* Free memory manager caches.

* [mono] Store static variables with GC references in collectible alcs
on the GC heap.

Normally, static variables are stored in an array inside MonoVTable
which is registered as a GC root. For collectible alcs, this would
not work, since GC references in these arrays would keep the alc alive.
Instead, store them in arrays referenced by the LoaderAllocator object.
This assumes the static variables will no longer be accessed after
the LoaderAllocator object dies.

* Add basic unload functionality.

* Fix weak hashes.

* Free MonoJitInfos belonging to unloaded memory managers.

* Avoid returning collectible types from mono_metadata_get_shared_type ().

* Add docs.

* Fix the build.

* Fix the build.

* Disable unloading for now.

2 years agoDelete MetadataType from the runtime type system (#79693)
Michal Strehovský [Thu, 15 Dec 2022 15:37:00 +0000 (00:37 +0900)]
Delete MetadataType from the runtime type system (#79693)

Casts to `MetadataType` will never succeed in the runtime type system. We had some.

* Making it so that `InstantiatedType` and `CanonType` derive from `DefType` instead of `MetadataType` in the runtime type system.
* Moved some things into dotfiles.

2 years agoFix WXORX issue in EEClass::Destruct (#79696)
Jan Vorlicek [Thu, 15 Dec 2022 14:06:03 +0000 (15:06 +0100)]
Fix WXORX issue in EEClass::Destruct (#79696)

While investigating failures of some coreclr tests when running in an
unloadable context, I've hit AV in EEClass::Destruct in one of the
tests. The reason is that we are missing ExecutableWriterHolder when
updating refCount on pDelegateEEClass->m_pInstRetBuffCallStub.

This change fixes it.

2 years agoFix perf. regression caused by signed/unsigned comp (#79137)
Adeel Mujahid [Thu, 15 Dec 2022 10:17:53 +0000 (12:17 +0200)]
Fix perf. regression caused by signed/unsigned comp (#79137)

2 years ago[wasm] WasmDebugLevel in samples (#79644)
Pavel Savara [Thu, 15 Dec 2022 09:02:55 +0000 (10:02 +0100)]
[wasm] WasmDebugLevel in samples (#79644)

* do not enable debugging is samples in release mode because it disables interp optimizations
* feedback from @thaystg and @radical

2 years agoDo not generate cctor info on generic definition `MethodTable` (#79689)
Michal Strehovský [Thu, 15 Dec 2022 05:36:17 +0000 (14:36 +0900)]
Do not generate cctor info on generic definition `MethodTable` (#79689)

This is already wrong, irrespective of #79384.

2 years agoImprove "one asg morphing" and move it to `morphblock.cpp` (#79037)
SingleAccretion [Thu, 15 Dec 2022 01:59:35 +0000 (04:59 +0300)]
Improve "one asg morphing" and move it to `morphblock.cpp` (#79037)

* Enhance OneAsg morphing

To also consider RHS types, in case the RHS wasn't suitable.

TODO: move the whole thing to the general block morphing.

* Move OneAsg morphing to morphblock.cpp

* Disable in minopts except for small types

The main point of the transformation is to keep things DNERless.

Exclude small types because for them the transformation is required
in case of "full" stores into normalize-on-store locals.

2 years agoStop producing and handling `ADDR` nodes (#78246)
SingleAccretion [Thu, 15 Dec 2022 01:57:28 +0000 (04:57 +0300)]
Stop producing and handling `ADDR` nodes (#78246)

* Start importing local address nodes

* Stop producing GT_ADDR nodes

* Use LCL_FLDs in MD array import

* Delete some ADDR uses

* Fix formatting

* Work around MSVC not being smart

Sigh.

2 years ago[wasm] dotnet-runtime-perf: Fix V8 version to 11.0.162 (#79682)
Ankit Jain [Thu, 15 Dec 2022 01:50:52 +0000 (20:50 -0500)]
[wasm] dotnet-runtime-perf: Fix V8 version to 11.0.162 (#79682)

* [wasm] dotnet-runtime-perf: Fix V8 version to 11.0.162

Context: investigating https://github.com/dotnet/perf-autofiling-issues/issues/10711

The `baseline` was run with V8 `11.0.162`, whereas the the `compare` was
run with `11.0.216`. Fixing the version to the baseline one to check if
V8 might the cause here.

2 years agoRemove some dead code from the legacy SIMD support (#79680)
Tanner Gooding [Thu, 15 Dec 2022 01:46:31 +0000 (17:46 -0800)]
Remove some dead code from the legacy SIMD support (#79680)

* Remove dead code from impSIMDRelOp

* Remove SIMDIntrinsicSub as it is dead

* Remove SIMDIntrinsicInit as it is dead

* Remove SIMDIntrinsicBitwiseOr as it is dead

* Remove SIMDIntrinsicEqual as it is dead

* Remove SIMDIntrinsicBitwiseAnd as it is dead

* Remove SIMDIntrinsicCast as it is dead

* Remove SIMDIntrinsicHWAccel as it is dead

* Removing SIMDIntrinsicShuffleSSE2 as it is dead

* Applying formatting patch

2 years agodisable loop alignment during asmdiffs (#79629)
Kunal Pathak [Thu, 15 Dec 2022 01:21:30 +0000 (17:21 -0800)]
disable loop alignment during asmdiffs (#79629)

2 years agoifdef out unsupported Enum underlying types for nativeaot (#79472)
Stephen Toub [Thu, 15 Dec 2022 01:02:42 +0000 (20:02 -0500)]
ifdef out unsupported Enum underlying types for nativeaot (#79472)

* ifdef out unsupported Enum underlying types for nativeaot

* Use dedicated ifdef

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2 years ago[wasm] Add the illink substitutions for SIMD (#79672)
Radek Doulik [Wed, 14 Dec 2022 23:14:18 +0000 (00:14 +0100)]
[wasm] Add the illink substitutions for SIMD (#79672)

This should fix size regression introduce with https://github.com/dotnet/runtime/pull/78068

The untrimmed S.N.Vector class added few kilobytes to the assemblies
of the bench sample. That wasn't that bad, OTOH the code produced
by the aot compiler was much larger, 5MB in this case.

So this will case default non-SIMD case. In the case of SIMD build we
will need more investigation.

2 years agoJIT: Properly mark compilation as having throw helpers in debug codegen (#79504)
Jakob Botsch Nielsen [Wed, 14 Dec 2022 21:00:56 +0000 (22:00 +0100)]
JIT: Properly mark compilation as having throw helpers in debug codegen (#79504)

Otherwise we may fail to allocate the outgoing arg area and align the
stack properly.

Fix #78092

2 years agoFix `IDesignerSerializationManager` nullability (#79429)
Lachlan Ennis [Wed, 14 Dec 2022 20:02:51 +0000 (06:02 +1000)]
Fix `IDesignerSerializationManager` nullability (#79429)

* Add nullable annotation based off documentation

2 years agoRevert "Fix up NativeAOT testing" & don't build clr.runtime for libraries AOT tests...
Viktor Hofer [Wed, 14 Dec 2022 20:01:15 +0000 (21:01 +0100)]
Revert "Fix up NativeAOT testing" & don't build clr.runtime for libraries AOT tests (#79637)

* Revert "Fix up NativeAOT testing (#79523)"

This reverts commit b2bebcbbd0234d7924867a40e8621f4fab82082d.

* Don't build clr.runtime for libraries AOT tests

866f3eb479a67b9c8d084bb972c4dd904db56bfd made it again possible to build
the host.native subset without the clr.runtime. Previously there was a
dependency on the singlefilehost which was removed when it isn't
required.

2 years agoThis fixes emitGetVexPrefixSize to support detecting 2-byte prefix support (#79478)
Tanner Gooding [Wed, 14 Dec 2022 19:23:41 +0000 (11:23 -0800)]
This fixes emitGetVexPrefixSize to support detecting 2-byte prefix support (#79478)

* Remove the dead emitOutputRexOrVexPrefixIfNeeded and rename emitOutputSimdPrefixIfNeeded to emitOutputRexOrSimdPrefixIfNeeded

* Remove the dead emitGetAdjustedSize and rename emitGetAdjustedSizeEvexAware to emitGetAdjustedSize

* Simplify the emitGetEvexPrefixSize and emitGetVexPrefixSize methods

* Create helper emitExtractVexPrefix and emitExtractEvexPrefix functions

* Update emitGetVexPrefixSize and emitGetEvexPrefixSize to take an instrDesc

* Update emitGetPrefixSize to take the instrDesc so the VEX prefix size can be computed correctly

* Update emitGetVexPrefixSize to support returning 2 or 3

* Ensure IF_RWR_CNS is handled in emitGetVexPrefixSize

* Don't try to estimate the 2-byte VEX prefix when optimizations are disabled

* Ensure we don't negatively impact estimated alignment sizes for debug code

* Just check MinOpts not OptimizationsDisabled

* Mark some of the modified methods as const to indicate they don't mutate the emitter

* Resolve the throughput issue by not getting optSize untill necessary

* Switch back to doing accurate vex prefix size estimation always

* Small cleanup to reduce regression

2 years agoFix libraries outerloop pipelines (#79652)
Viktor Hofer [Wed, 14 Dec 2022 18:30:45 +0000 (19:30 +0100)]
Fix libraries outerloop pipelines (#79652)

* Fix libraries outerloop pipelines

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

2 years ago[main] Update dependencies from dotnet/runtime dotnet/llvm-project dotnet/icu dotnet...
dotnet-maestro[bot] [Wed, 14 Dec 2022 18:17:21 +0000 (19:17 +0100)]
[main] Update dependencies from  dotnet/runtime dotnet/llvm-project dotnet/icu dotnet/xharness dotnet/emsdk dotnet/hotreload-utils dotnet/roslyn (#78557)

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

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 1.0.0-prerelease.22566.1 -> To Version 1.0.0-prerelease.22566.2

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

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 1.1.0-alpha.0.22510.2 -> To Version 1.1.0-alpha.0.22566.1

* Update dependencies from https://github.com/dotnet/llvm-project build 20221118.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.22566.1 -> To Version 1.0.0-alpha.1.22568.1

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

Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
 From Version 4.5.0-1.22564.5 -> To Version 4.5.0-1.22568.11

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

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 1.0.0-prerelease.22566.1 -> To Version 1.0.0-prerelease.22569.1

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

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.22559.2 -> To Version 8.0.0-alpha.1.22570.4

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

Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
 From Version 4.5.0-1.22564.5 -> To Version 4.5.0-1.22571.11

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

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 1.1.0-alpha.0.22510.2 -> To Version 1.1.0-alpha.0.22572.2

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

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.22559.2 -> To Version 8.0.0-alpha.1.22578.1

* Update dependencies from https://github.com/dotnet/llvm-project build 20221128.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.22566.1 -> To Version 1.0.0-alpha.1.22578.1

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

runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.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-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools
 From Version 14.0.0-alpha.1.22561.1 -> To Version 14.0.0-alpha.1.22578.3

* Update dependencies from https://github.com/dotnet/icu build 20221128.1

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 8.0.0-alpha.1.22557.1 -> To Version 8.0.0-alpha.1.22578.1

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

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 1.0.0-prerelease.22566.1 -> To Version 1.0.0-prerelease.22578.1

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

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 1.1.0-alpha.0.22510.2 -> To Version 1.1.0-alpha.0.22578.1

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

Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100
 From Version 8.0.0-alpha.1.22558.2 -> To Version 8.0.0-alpha.1.22578.1

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

Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
 From Version 4.5.0-1.22571.11 -> To Version 4.5.0-2.22580.13

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

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 1.1.0-alpha.0.22578.1 -> To Version 1.1.0-alpha.0.22601.1

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

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.22559.2 -> To Version 8.0.0-alpha.1.22605.1

* Update dependencies from https://github.com/dotnet/llvm-project build 20221205.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.22566.1 -> To Version 1.0.0-alpha.1.22605.1

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

runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.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-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools
 From Version 14.0.0-alpha.1.22561.1 -> To Version 14.0.0-alpha.1.22605.3

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

Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100
 From Version 8.0.0-alpha.1.22558.2 -> To Version 8.0.0-alpha.1.22605.2

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

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 1.1.0-alpha.0.22510.2 -> To Version 1.1.0-alpha.0.22605.1

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

Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
 From Version 4.5.0-1.22564.5 -> To Version 4.5.0-2.22606.12

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

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 1.0.0-prerelease.22566.1 -> To Version 1.0.0-prerelease.22607.1

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

Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
 From Version 4.5.0-1.22564.5 -> To Version 4.5.0-2.22608.4

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

Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
 From Version 4.5.0-1.22564.5 -> To Version 4.5.0-2.22608.26

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

Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
 From Version 4.5.0-1.22564.5 -> To Version 4.5.0-3.22608.21

* Update dependencies from https://github.com/dotnet/runtime build 20221211.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.22559.2 -> To Version 8.0.0-alpha.1.22611.2

* Update dependencies from https://github.com/dotnet/llvm-project build 20221212.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.22566.1 -> To Version 1.0.0-alpha.1.22612.1

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

runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.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-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools
 From Version 14.0.0-alpha.1.22561.1 -> To Version 14.0.0-alpha.1.22612.3

* Update dependencies from https://github.com/dotnet/icu build 20221212.1

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 8.0.0-alpha.1.22557.1 -> To Version 8.0.0-alpha.1.22612.1

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

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 1.0.0-prerelease.22566.1 -> To Version 1.0.0-prerelease.22612.1

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

Microsoft.NET.Workload.Emscripten.net7.Manifest-8.0.100
 From Version 8.0.0-alpha.1.22558.2 -> To Version 8.0.0-alpha.1.22612.1

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

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 1.1.0-alpha.0.22510.2 -> To Version 1.1.0-alpha.0.22612.1

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

Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
 From Version 4.5.0-1.22564.5 -> To Version 4.5.0-3.22612.3

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

runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.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-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools
 From Version 14.0.0-alpha.1.22561.1 -> To Version 14.0.0-alpha.1.22613.1

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

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.22566.1 -> To Version 1.0.0-alpha.1.22613.2

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

Microsoft.CodeAnalysis , Microsoft.CodeAnalysis.CSharp , Microsoft.Net.Compilers.Toolset
 From Version 4.5.0-1.22564.5 -> To Version 4.5.0-3.22613.20

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
2 years ago[wasm] Outline exception throws in the interp and ifdef out unreachable opcodes ...
Katelyn Gadd [Wed, 14 Dec 2022 17:53:36 +0000 (09:53 -0800)]
[wasm] Outline exception throws in the interp and ifdef out unreachable opcodes (#79239)

* Outline THROW_EX_GENERAL and ifdef out unreachable opcodes in the wasm version of the mono interpreter for better performance
* Introduce IROPDEF for intermediate opcodes that are only used during code generation
* Move IR opcodes to the end of the table and don't generate jump targets for them
* Add an include guard to mintops.def to ensure that config.h is always included when it is used
* Make the jiterp opcodes platform specific, fix a bug in genmintops that produced wrong ordering
* Fix jiterpreter heuristic erroneously rejecting mov opcodes

2 years ago[wasm] Enable the String task (#79640)
Radek Doulik [Wed, 14 Dec 2022 17:20:21 +0000 (18:20 +0100)]
[wasm] Enable the String task (#79640)

2 years agoFix workloads build step in official builds (#79656)
Viktor Hofer [Wed, 14 Dec 2022 16:36:06 +0000 (17:36 +0100)]
Fix workloads build step in official builds (#79656)

2 years agoChange RunningPublish property name to _IsPublishing (#79483)
Andy Gocke [Wed, 14 Dec 2022 12:01:27 +0000 (04:01 -0800)]
Change RunningPublish property name to _IsPublishing (#79483)

The crossgen publish capability currently uses a RunningPublish property
to signal that certain settings should be enabled. The SDK now provides a
property that serves the same purpose called '_IsPublishing'. By using the
SDK property, the right publish behavior will automatically happen if a user
runs 'dotnet publish' on the crossgen2 project.

2 years agoCreate Microsoft.NET.ILLink.Tasks package (#79609)
Viktor Hofer [Wed, 14 Dec 2022 11:55:15 +0000 (12:55 +0100)]
Create Microsoft.NET.ILLink.Tasks package (#79609)

* Create Microsoft.NET.ILLink.Tasks package

* Infrastructure support and repo clean-up

2 years agoLocalized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 206700...
dotnet bot [Wed, 14 Dec 2022 09:46:59 +0000 (01:46 -0800)]
Localized file check-in by OneLocBuild Task: Build definition ID 679: Build ID 2067005 (#79632)

2 years agoAdd kunalspathak mentionee for codegen-coreclr (#79635)
Kunal Pathak [Wed, 14 Dec 2022 09:15:14 +0000 (01:15 -0800)]
Add kunalspathak mentionee for codegen-coreclr (#79635)

2 years agoUse non-generic Array.Sort in EnumInfo on nativeaot (#79473)
Stephen Toub [Wed, 14 Dec 2022 07:00:38 +0000 (02:00 -0500)]
Use non-generic Array.Sort in EnumInfo on nativeaot (#79473)

* Use non-generic Array.Sort in EnumInfo on nativeaot

* Non-generic sort

* Update src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/NativeFormatEnumInfo.cs

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2 years agoAlways set `addlDelta` to zero on x86 (#79467)
SingleAccretion [Wed, 14 Dec 2022 00:26:48 +0000 (03:26 +0300)]
Always set `addlDelta` to zero on x86 (#79467)

* Always set "addlDelta" to zero on x86

The value is used to compensate for the additional instruction bytes,
which should only be relevant for RIP-relative addressing, while x86
uses absolute addressing.

* Re-enable the test

2 years ago[wasm] Disable running blazor template projects (#79536)
Ankit Jain [Tue, 13 Dec 2022 23:04:15 +0000 (18:04 -0500)]
[wasm] Disable running blazor template projects (#79536)

* [wasm] Print browser console messages to the test output to catch blazor issues

* WBT: Remove unused AppRefDir arguments

* Re-enable the tests without the blazor-run parts

* fix build

2 years agoFix ordering of checks in AppendInterpolatedStringHandler.AppendFormatted (#79539)
Stephen Toub [Tue, 13 Dec 2022 22:51:17 +0000 (17:51 -0500)]
Fix ordering of checks in AppendInterpolatedStringHandler.AppendFormatted (#79539)

We want to check for IsEnum first to avoid boxing the enum via ISpanFormattable.TryFormat.  This just swaps the two blocks.

2 years agoImplement DynamicMethod.RTDynamicMethod.CreateDelegate. (#79427)
madelson [Tue, 13 Dec 2022 21:04:56 +0000 (16:04 -0500)]
Implement DynamicMethod.RTDynamicMethod.CreateDelegate. (#79427)

* Implement DynamicMethod.RTDynamicMethod.CreateDelegate.

The implementation simply calls back to DynamicMethod.CreateDelegate.

fix #78365

* Refactor DynamicMethod to remove RTDynamicMethod.

See https://github.com/dotnet/runtime/pull/79427/files#r1044093019

* Remove redundant mono method

2 years agoTake EventListener.EventListenersLock in EventPipeEventDispatcher.SendCommand (#79185)
David Mason [Tue, 13 Dec 2022 21:01:28 +0000 (13:01 -0800)]
Take EventListener.EventListenersLock in EventPipeEventDispatcher.SendCommand (#79185)

2 years agoUse ReferencePathWithRefAssemblies for libs ILLink (#79595)
Viktor Hofer [Tue, 13 Dec 2022 18:54:23 +0000 (19:54 +0100)]
Use ReferencePathWithRefAssemblies for libs ILLink (#79595)

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

The libraries build invokes ILLink to perform "library" mode trimming. The libraries build step is expected to be runtime agnostic and shouldn't bind against a specific CoreLib runtime implementation.

During compilation, even though we have a ProjectReference pointing to the CoreLib/src project, we build against CoreLib/ref. But that ILLink invocation doesn't honor that as it uses the ReferencePath msbuild item instead of ReferencePathWithRefAssemblies.

2 years agosupport server ALPN on macOS (#79434)
Tomas Weinfurt [Tue, 13 Dec 2022 18:25:16 +0000 (10:25 -0800)]
support server ALPN on macOS (#79434)

* support server ALPN on macOS

* reset status

2 years agoFix memory leaks reported by static analyzer (#78492)
ws77.cho [Tue, 13 Dec 2022 16:26:35 +0000 (01:26 +0900)]
Fix memory leaks reported by static analyzer (#78492)

2 years agodo not free method name (#79608)
Pavel Savara [Tue, 13 Dec 2022 15:21:55 +0000 (16:21 +0100)]
do not free method name (#79608)

2 years agoFix mcs -dumpMap (#79571)
Jakob Botsch Nielsen [Tue, 13 Dec 2022 14:39:04 +0000 (15:39 +0100)]
Fix mcs -dumpMap (#79571)

This needs to be in sync with how printing in the JIT works to ensure
that we don't ask for data that the JIT did not make available.

Fix #79568

2 years agoFix #79556. (#79562)
Eirik Tsarpalis [Tue, 13 Dec 2022 14:38:01 +0000 (16:38 +0200)]
Fix #79556. (#79562)

2 years ago[wasm] Add few Span and String measurements (#79566)
Radek Doulik [Tue, 13 Dec 2022 14:21:24 +0000 (15:21 +0100)]
[wasm] Add few Span and String measurements (#79566)

Measure Span<T> SequenceEqual for bytes and chars
Measure string.Normalize for ASCII and non-ASCII

2 years ago[wasm] Let browser-bench post bootstrap flag (#79573)
Radek Doulik [Tue, 13 Dec 2022 14:17:47 +0000 (15:17 +0100)]
[wasm] Let browser-bench post bootstrap flag (#79573)

This helps our perf measurements infrastructure to detect successful
bootstrap of the bench run

2 years agoConsole.Unix: don't calculate cached cursor position from the last column. (#78466)
Tom Deseyn [Tue, 13 Dec 2022 13:36:02 +0000 (14:36 +0100)]
Console.Unix: don't calculate cached cursor position from the last column. (#78466)

After printing in the last column, setting CursorLeft is expected to
place the cursor back in that same row.

2 years ago[mono] Fix passing of NULL via mono_runtime_invoke to method expecting nullable ...
Vlad Brezae [Tue, 13 Dec 2022 13:17:29 +0000 (15:17 +0200)]
[mono] Fix passing of NULL via mono_runtime_invoke to method expecting nullable (#79597)

The code was always trying to unbox the boxed vt, not accounting for NULL.

2 years agoHandle RSA zero modulus for Android
Kevin Jones [Tue, 13 Dec 2022 12:50:54 +0000 (07:50 -0500)]
Handle RSA zero modulus for Android

2 years agoDon't require singlefilehost in host.native (#79565)
Andy Gocke [Tue, 13 Dec 2022 12:03:32 +0000 (04:03 -0800)]
Don't require singlefilehost in host.native (#79565)

* Don't require singlefilehost in host.native

The corehost project currently tries to build the singlefilehost with
the embedded DAC, which we can skip if we never built the
singlefilehost in the first place.

* Update corehost.proj

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
2 years ago[mono][interp] Fix some issues that are hit in tests when we tier up methods immediat...
Vlad Brezae [Tue, 13 Dec 2022 08:57:50 +0000 (10:57 +0200)]
[mono][interp] Fix some issues that are hit in tests when we tier up methods immediately (#79564)

* [mono][interp] Fix difference in behavior between tiered and untiered compilation

We were trying to get the vtable only in the tiered compilation case.

* Disable test that hits known interpreter limitation

2 years agoCondition some NamedPipe tests on COM support (#79578)
Michal Strehovský [Tue, 13 Dec 2022 08:26:55 +0000 (17:26 +0900)]
Condition some NamedPipe tests on COM support (#79578)

Fixes #79180.

2 years agoAdding new ReadyToRun helper for static cctor (#76898)
Brian Bohe [Tue, 13 Dec 2022 05:38:37 +0000 (00:38 -0500)]
Adding new ReadyToRun helper for static cctor (#76898)

* Adding new ReadyToRun helper for static cctor

When accessing a static field the static cctor of the class is
called. Then the helper CORINFO_HELP_READYTORUN_STATIC_BASE
was printed twice during the same block, the first for the cctor
and the second for the getter, as if they were two calls for the
same method.

* Removing helper CORINFO_HELP_STRCNS_CURRENT_MODULE

* Removing CORINFO_HELP_STRCNS_CURRENT_MODULE

* Changing TYP_BYREF to TYP_VOID

* Formatting files

* Splitting up R2R STATIC_BASE in more helpers

* Updating STATIC_BASE R2R helper with new helpers

* Extending getReadyToRunHelper support

Consider the new R2R helpers that were group in
CORINFO_HELP_READYTORUN_STATIC_BASE.

* Keeping the preffered R2R helper constructor

In some cases the R2R helpers already call to the
constructor. In those cases we can insert a repeated
call that will be eliminated by CSE. There are still
cases in which we may need to call the constructor.

* Extending value numbering with new helpers

* Renaming helper

* Replacing STATIC_BASE helper in ilc for NON_GC

* Fixing helper order

* Refactoring code

* Supporting R2R_STATIC_BASE helper in nativeaot

* Moving compiler var initialization to compCompile

* Using new helper names in ILC

* Encapsulating common method

* Removing CORINFO_HELP_READYTORUN_STATIC_BASE helper

* Removing comment

* Moving new helper function to shared code

* Setting undef helper as default

* Repeating same helper call for CSE optimization

Avoid hardcoding the Non-GC helper call, which is used just to
trigger the constructor if it is needed, and use the existing
helper call in the code, so CSE would persist only one.

* Update src/coreclr/jit/compiler.cpp

Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
* Update src/coreclr/tools/Common/Compiler/DependencyAnalysis/CorInfoHelpers.cs

Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
* Update src/coreclr/tools/aot/ILCompiler.RyuJit/JitInterface/CorInfoImpl.RyuJit.cs

Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
* Update src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs

Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
* Formatting jithelpers.h

* Renaming function

* Moving CorInfoHelper function to R2R/AOT interface

* Updating preferred helper when is not thread type

* Removing some helper value nums

Static base helper was removed and cctor returns
void.

* Formatting file

* Ensuring void return when the helper is cctor

* Updating preferred helper when when classes matches

* Removing cctor trigger helper from aot,vm and jit

* Updating m_prefferedInitCctor default value

It is initialized with CORINFO_HELP_UNDEF and set to R2R GC or NON
GC Static Base later.

* Updating comments

* Updating comments

Co-authored-by: Brian Bohe <brianbohe@microsoft.com>
Co-authored-by: Jakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
2 years agoFix versions of the .NET 8 ILC package (#79497)
Andrii Kurdiumov [Tue, 13 Dec 2022 04:25:01 +0000 (10:25 +0600)]
Fix versions of the .NET 8 ILC package (#79497)

* Fix versions of the .NET 8 ILC package

* Apply suggestions from code review

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2 years agoPreparation for JIT\Regression test merging - assembly/file renames (#79489)
Mark Plesko [Tue, 13 Dec 2022 02:17:54 +0000 (18:17 -0800)]
Preparation for JIT\Regression test merging - assembly/file renames (#79489)

This is a collection of renames that can be merged independently of actual test merging.  Automated changes were done with the ILTransform tool (started by @trylek, my version at https://github.com/markples/utils/tree/for-PR-dotnet-runtime-79489, commit 131b3764).

- ILTransform -p
    - Standardize project suffixes since _d, etc., are special cases for test merging but -dbg is not
    - Rename a few tests where the project and IL files had CaSiNg differences
- ILTransform -ilfile
    - Rename IL files to match the .ilproj root name (which excludes suffixes such as _d)
    - Update the project files to refer to the new filenames using $(MSBuildProjectName) except src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b323557 where the IL file doesn't have the suffix
- ILTransform -m
    - Remove all .module (including extern) lines from IL files
- ILTransform -a
    - Rename IL .assembly names to match their filenames
    - Some lines were `.assembly foo // as "foo"` - remove those comments too
- ILTransform -n -a -ilfile
    - Deduplicate project names across JIT/Regression
        - If a set of duplicates is simply one csproj and one ilproj, then add _il to the ilproj and leave the csproj alone
        - Otherwise append the difference in the closest different directory names.  For example:
            - V1-M11-Beta1/b40347/b40347.ilproj -> b40347_M11-Beta1.ilproj
            - V1-M12-Beta2/b40347/b40347.ilproj -> b40347_M12-Beta2.ilproj
        - However, avoid creating foo_foo.  For example:
            - V1-M12-Beta2/b51875/b51875.csproj -> <unchanged>
            - V1-M12-Beta2/b51875/Desktop/b51875.csproj -> b51875_Desktop.csproj
    - Also rename IL files and .assembly names to match the new project names
- Manual fixes for IL->C# assembly references in tests dev11_132534 and dev11_145295

2 years agoFix up NativeAOT testing (#79523)
Michal Strehovský [Tue, 13 Dec 2022 00:26:27 +0000 (09:26 +0900)]
Fix up NativeAOT testing (#79523)

2 years agofix SslStream.IsMutuallyAuthenticated with cached credentials (#79128)
Tomas Weinfurt [Tue, 13 Dec 2022 00:09:16 +0000 (16:09 -0800)]
fix SslStream.IsMutuallyAuthenticated with cached credentials (#79128)

* fix SslStream.IsMutuallyAuthenticated with cached credentials

* nano

* protocol

* fix test

* Apply suggestions from code review

Co-authored-by: Radek Zikmund <32671551+rzikm@users.noreply.github.com>
Co-authored-by: Simon Rozsival <simon@rozsival.com>
* fix CertificateValidationClientServer_EndToEnd_Ok test

Co-authored-by: Radek Zikmund <32671551+rzikm@users.noreply.github.com>
Co-authored-by: Simon Rozsival <simon@rozsival.com>
2 years ago[wasm] Enable System.Numerics vectors SIMD (#78068)
Radek Doulik [Mon, 12 Dec 2022 22:21:55 +0000 (23:21 +0100)]
[wasm] Enable System.Numerics vectors SIMD (#78068)

This helps in cases where there's only S.N.Vector path in the BCL code, like `SpanHelpers.IndexOfChar(ref char searchSpace, char value, int length)`. In this case the `Span:IndexOf char` measurement improves from 0.0143ms to 0.0114ms.

* [wasm] Enable System.Numerics vectors SIMD

* Do not hardcode S.N.Vector IsHardwareAccelerated

2 years agoJIT: Add missing case to relational with constant optimization (#79541)
Jakob Botsch Nielsen [Mon, 12 Dec 2022 20:16:37 +0000 (21:16 +0100)]
JIT: Add missing case to relational with constant optimization (#79541)

Almost all cases of #11349 were fixed, except for this missing one.

Fix #11349

2 years ago[NativeAOT] Objective-C Marshal: object tracker support (#78280)
Austin Wise [Mon, 12 Dec 2022 20:02:59 +0000 (12:02 -0800)]
[NativeAOT] Objective-C Marshal: object tracker support (#78280)

* NativeAOT Objective-C Marshal: object tracker support
* Remove support for registering multiple begin/end callbacks, since the API was not designed with multiple managed worlds in mind.
* Use more asserts where it should not be possible for there to be no callback.
* Add missing GC-trigger disable when calling managed callouts.
* Simplify initialization logic
* Add comments to CoreCLR and NativeAOT about constants that should have the same size.
* Remove superfluous use of C++ templates.
* Use the C# unmanaged function pointer types in more places, improving type safety
* Add SuppressGCTransition and fix compile error by adding cast

Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
Co-authored-by: Aaron Robinson <arobins@microsoft.com>
2 years ago[mono][interp] Add unbox when calling valuetype method through delegate (#79445)
Vlad Brezae [Mon, 12 Dec 2022 17:25:39 +0000 (19:25 +0200)]
[mono][interp] Add unbox when calling valuetype method through delegate (#79445)

* [mono][interp] Add unbox when calling valuetype method through delegate

If we are calling an open instance delegate, where the target method is on a valuetype, we will need to unbox this pointer.

* [mono][interp] Remove redundant check

If we are calling a method of a valuetype, then we already know `this` pointer is an instantiation of a valuetype.

* [mono][interp] Remove dead opcode

* [tests] Add regression test

* [tests] Disable test on fullaot

2 years agoAdd explicit tail. prefix to a tailcall test (#79532)
Jakob Botsch Nielsen [Mon, 12 Dec 2022 17:00:42 +0000 (18:00 +0100)]
Add explicit tail. prefix to a tailcall test (#79532)

Otherwise any change can cause us to stop tailcalling conservatively,
e.g. due to new inlining introducing an address-taken local.

Fix #79517

2 years agoFix compression (#79412)
Katya Sokolova [Mon, 12 Dec 2022 15:48:59 +0000 (16:48 +0100)]
Fix compression (#79412)

* Fix compression

* Apply suggestions from code review

Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
* Adding SendAsync to ref

* fix ws deflate tests

* Check bytes on server side

Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
Co-authored-by: Natalia Kondratyeva <knatalia@microsoft.com>
2 years agoset the return type to match the definition in InternalCalls.cs - and return the...
yowl [Mon, 12 Dec 2022 15:13:21 +0000 (10:13 -0500)]
set the return type to match the definition in InternalCalls.cs - and return the value. (#79538)

2 years agoAdd weakly typed Serialize and Deserialize overloads accepting JsonTypeInfo. (#79397)
Eirik Tsarpalis [Mon, 12 Dec 2022 13:34:22 +0000 (15:34 +0200)]
Add weakly typed Serialize and Deserialize overloads accepting JsonTypeInfo. (#79397)

2 years agoRemove hard_limit_for_bookkeeping (#77480)
Peter Sollich [Mon, 12 Dec 2022 13:14:33 +0000 (14:14 +0100)]
Remove hard_limit_for_bookkeeping (#77480)

As it turns out, it's not so easy to set aside a hard limit for the GC's bookkeeping, because some regions will be partially comitted and so will need more bookkeeping information as a percentage.

So this removes the hard_limit_for_bookkeeping and associated fields, and instead commits memory for the mark array eagerly, even if BGC is not in progress.

The issue is that GC needs at least one free region, and it needs the mark array committed. So when it tries to get a region at the end, and we cannot commit the mark array, we cannot actually get a free region. Currently we AV in this case, but there really isn't a good option to recover at this point. So it's better to keep the mark array committed and perhaps fail with an OOM exception.

2 years ago[wasm] reduce MethodImplOptions.NoInlining (#79457)
Pavel Savara [Mon, 12 Dec 2022 12:13:44 +0000 (13:13 +0100)]
[wasm] reduce MethodImplOptions.NoInlining (#79457)

* reduce MethodImplOptions.NoInlining

2 years ago[wasm] Disable failing blazor tests (#79526)
Ankit Jain [Mon, 12 Dec 2022 11:22:43 +0000 (06:22 -0500)]
[wasm] Disable failing blazor tests (#79526)

Issue: #79514

2 years agoMark test Outerloop (#79528)
Ahmet Ibrahim AKSOY [Mon, 12 Dec 2022 11:20:00 +0000 (12:20 +0100)]
Mark test Outerloop (#79528)

2 years agoSplit library and package Readme (#78888)
MSDN.WhiteKnight [Mon, 12 Dec 2022 10:57:58 +0000 (15:57 +0500)]
Split library and package Readme (#78888)

* Split library and package Readme

* Fix punctuation

* Fix lint issues

* Automatically include package readme file if existent

* Rename README.md to PACKAGE.md

* Move PACKAGE.md into source directory

* Reinstate examples in README.md

* Update contributing guidelines

* Update docs/coding-guidelines/libraries-packaging.md

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
2 years ago[mono][interp] Throw invalid program if stack state is invalid (#73215)
Vlad Brezae [Mon, 12 Dec 2022 10:47:19 +0000 (12:47 +0200)]
[mono][interp] Throw invalid program if stack state is invalid (#73215)

Rather than printing warning and then overflowing the stack info buffer. Store error in TransformData to reduce code size.