platform/upstream/dotnet/runtime.git
3 years agoMerge branch 'main' of https://github.com/dotnet/runtime into merge-main
Jeremy Koritzinsky [Tue, 14 Sep 2021 23:29:42 +0000 (16:29 -0700)]
Merge branch 'main' of https://github.com/dotnet/runtime into merge-main

3 years agoUpdate DllImportGenerator to the latest version (#59117)
Jeremy Koritzinsky [Tue, 14 Sep 2021 23:15:21 +0000 (16:15 -0700)]
Update DllImportGenerator to the latest version (#59117)

3 years ago[mono] Use SROA-friendly struct type declarations (#59007)
imhameed [Tue, 14 Sep 2021 21:14:08 +0000 (17:14 -0400)]
[mono] Use SROA-friendly struct type declarations (#59007)

LLVM's SROA can decompose loads and stores of aggregate type into a
sequence of aggregate-element-typed loads and stores. Before this
change, Mono translated .NET-level value types into LLVM IR-level
structs containing nothing but `i8` elements.

When a value type field has reference type, and a value of this value
type is copied using a `memcpy` intrinsic or an LLVM IR load followed by
a store, LLVM will emit code that loads managed references in multiple
byte-sized fragments before reconstructing the original pointer using a
sequence of ALU ops. This causes sgen to fail to pin the referent.

This change works around this by translating value types to LLVM IR
structs with pointer-sized fields. Packed value types with non-standard
alignment will be translated into LLVM IR structs containing
alignment-sized fields.

Note that this does not completely guarantee that the code we generate
will respect sgen's requirements. No specific guarantees are provided
about the translation of non-atomic LLVM IR loads and stores to machine
code. And we'll need some alternative means (perhaps a special
`gc_copy_unaligned` runtime call or similar) to copy packed or
misaligned value types that contain managed references. For stronger
LLVM IR-level guarantees, we'll want to make use of unordered atomic
loads and stores and unordered atomic memcpy, but that work is out of
scope for this change.

Fixes #58062, but see the previous paragraph for caveats.

See:
- https://github.com/dotnet/llvm-project/blob/release/11.x/llvm/lib/Transforms/Scalar/SROA.cpp#L3371-L3388
- https://github.com/dotnet/llvm-project/blob/release/11.x/llvm/lib/Transforms/Scalar/SROA.cpp#L3327-L3340

3 years agoEliminate PROJECTK_BUILD from RF (#59057)
Andrew Au [Tue, 14 Sep 2021 21:04:16 +0000 (14:04 -0700)]
Eliminate PROJECTK_BUILD from RF (#59057)

3 years ago[mono] Update attribute name used for controlling frame pointer elimination (#59069)
imhameed [Tue, 14 Sep 2021 20:40:48 +0000 (16:40 -0400)]
[mono] Update attribute name used for controlling frame pointer elimination (#59069)

LLVM 8 introduced `"frame-pointer"="all"` as a substitute for
`"no-frame-pointer-elim"="true"`. LLVM 10 outright removed
`"no-frame-pointer-elim"`.

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

3 years agoUse arcade power source build infra (#58651)
Anirudh Agnihotry [Tue, 14 Sep 2021 20:25:09 +0000 (13:25 -0700)]
Use arcade power source build infra  (#58651)

* add yml files

* add file version and condition package reference on source build

* to avoid copying the file from the cache

3 years agoChange macOS activatin injection failure handling (#59045)
Jan Vorlicek [Tue, 14 Sep 2021 19:59:55 +0000 (21:59 +0200)]
Change macOS activatin injection failure handling (#59045)

The pthread_kill can fail with ENOTSUP on macOS when the target thread
is a dispatch queue thread. Instead of aborting the process, it is
better to fail to inject the activation and rely on return address
hijacking and other means of syncing with GC.

3 years agoElide SocketFlags in Socket API (#57634)
Bar Arnon [Tue, 14 Sep 2021 19:32:22 +0000 (22:32 +0300)]
Elide SocketFlags in Socket API (#57634)

* Elide SocketFlags in Socket API

Fix #43934

* Fix SocketAsyncEventArgs tests

* Cosmetics

* Elide SocketFlags in tests

* Comments

3 years ago[WASM] Enabled strict mode on all JS files (#54011)
Daniel Genkin [Tue, 14 Sep 2021 18:31:21 +0000 (14:31 -0400)]
[WASM] Enabled strict mode on all JS files (#54011)

"use strict" for all wasm JavaScript

Co-authored-by: Daniel Genkin <t-dgenkin@microsoft.com>
Co-authored-by: Pavel Savara <pavelsavara@microsoft.com>
3 years agoExtend MemoryCacheOptions with TrackLinkedCacheEntries (#57648)
Adam Sitnik [Tue, 14 Sep 2021 15:27:44 +0000 (17:27 +0200)]
Extend MemoryCacheOptions with TrackLinkedCacheEntries (#57648)

* add the property to reference assembly

* update tests

* implementation

* Apply suggestions from code review

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Apply suggestions from code review

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
* update comment

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
3 years agoFix broken API proposal template link (#59083)
Eirik Tsarpalis [Tue, 14 Sep 2021 14:40:21 +0000 (15:40 +0100)]
Fix broken API proposal template link (#59083)

3 years agoAdd missing docs to System.Text.Json (#59053)
Eirik Tsarpalis [Tue, 14 Sep 2021 14:23:52 +0000 (15:23 +0100)]
Add missing docs to System.Text.Json (#59053)

3 years agoAdd missing System.Linq API docs (#59038)
Eirik Tsarpalis [Tue, 14 Sep 2021 14:22:41 +0000 (15:22 +0100)]
Add missing System.Linq API docs (#59038)

3 years agoUse caching ConsoleStream for both iOS and Android (#58967)
Steve Pfister [Tue, 14 Sep 2021 13:49:54 +0000 (09:49 -0400)]
Use caching ConsoleStream for both iOS and Android (#58967)

Expands on #56713 by moving the caching implementation to a separate internal class leaving only the interop calls in ConsolePal.iOS and ConsolePal.Android

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

3 years agoUpdateJson and CompilerServices.Unsafe versions (#59067)
Eric Erhardt [Tue, 14 Sep 2021 12:12:45 +0000 (06:12 -0600)]
UpdateJson and CompilerServices.Unsafe versions (#59067)

This unblocks the SDK ingestion now that we are targeting net7.0. Microsoft.NET.HostModel needs to update 7.0 versions of these libraries.

3 years agoAlign preallocationSize behavior (#58726)
Adam Sitnik [Tue, 14 Sep 2021 11:30:39 +0000 (13:30 +0200)]
Align preallocationSize behavior (#58726)

Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoMulti-target Json and Logger Source Generators between Roslyn v3.11 and v4.0 (#58446)
Eric Erhardt [Tue, 14 Sep 2021 03:05:45 +0000 (21:05 -0600)]
Multi-target Json and Logger Source Generators between Roslyn v3.11 and v4.0 (#58446)

* Multi-target LoggerMessageGenerator between Roslyn v3.11 and v4.0

* Include a .targets file in NuGet packages which will select the correct analyzer assembly depending on which Roslyn version will be used to compile.

* Multi-target JsonSourceGenerator between Roslyn v3.11 and v4.0

* Fix restore

* Update NuGet package MSBuild logic to detect when SupportsRoslynComponentVersioning is not available, and use the lowest analyzer available.

* Handle non-SDK projects by running after ResolveNuGetPackageAssets

* Respond to PR feedback

- Name .cs and .csproj files with Roslyn in the name
- Upgrade to Roslyn 3.11 so IsExplicitlyNamedTupleElement API is available
- Fix some references to the test projects
- Fix incremental pack of the analyzer targets

3 years agoRemove SupportedOSPlatforms windows on Hosting WindowsServices (#59039)
Eric Erhardt [Mon, 13 Sep 2021 20:54:30 +0000 (14:54 -0600)]
Remove SupportedOSPlatforms windows on Hosting WindowsServices (#59039)

Fix #59037

3 years ago[wasm] browser-bench improvements (#59028)
Radek Doulik [Mon, 13 Sep 2021 20:13:34 +0000 (22:13 +0200)]
[wasm] browser-bench improvements (#59028)

Do not supress all linker warnings. Use UnconditionalSuppressMessage
attribute to supress these we know are ok.

Add new WebSocketTask to the default tasks array.

Enable disabled exception measurements as they don't crash anymore.

Improve summary output.

Example output:

| measurement | time |
|-:|-:|
|        Exceptions, NoExceptionHandling |     0.2288us |
|                   Exceptions, TryCatch |     0.2480us |
|              Exceptions, TryCatchThrow |     0.0083ms |
|             Exceptions, TryCatchFilter |     0.1917us |
|       Exceptions, TryCatchFilterInline |     0.0486us |
|        Exceptions, TryCatchFilterThrow |     0.0096ms |
| Exceptions, TryCatchFilterThrowApplies |     0.0092ms |
|         Json, non-ASCII text serialize |     0.6500ms |
|       Json, non-ASCII text deserialize |     2.1381ms |
|                  Json, small serialize |     0.1419ms |
|                Json, small deserialize |     0.2167ms |
|                  Json, large serialize |    36.9640ms |
|                Json, large deserialize |    59.0562ms |
|              WebSocket, PartialSend 1B |     0.0022ms |
|            WebSocket, PartialSend 64KB |     0.0690ms |
|             WebSocket, PartialSend 1MB |     1.1455ms |
|           WebSocket, PartialReceive 1B |     0.0060ms |
|         WebSocket, PartialReceive 10KB |     0.0080ms |
|        WebSocket, PartialReceive 100KB |     0.0000us |

3 years agoFix EventPipe sample profiler resolution on Windows. (#58997)
Johan Lorensson [Mon, 13 Sep 2021 20:11:43 +0000 (22:11 +0200)]
Fix EventPipe sample profiler resolution on Windows. (#58997)

3 years agoReplace constant strings with SyntaxKind (#57898)
Gérald Barré [Mon, 13 Sep 2021 20:09:38 +0000 (16:09 -0400)]
Replace constant strings with SyntaxKind (#57898)

3 years agoMake bashing to constants nicer (#58171)
SingleAccretion [Mon, 13 Sep 2021 19:11:25 +0000 (22:11 +0300)]
Make bashing to constants nicer (#58171)

* Replace ChangeOperConst with BashToConst

The nature of bashing to a constant is that
the code doing it practically always wants to
set the constant value and the type so it makes
sense to do all three at once - it also enables
some more stringent asserts.

But mostly this method is for convenience.

* Fix a minor issue found by the new assert

It is a minor "bug" in lowering where zero-extension was used for
a TYP_INT constant instead of sign extension.

3 years ago[wasm] Fix circular dependency in WasmAppBuilder (#58904)
Ankit Jain [Mon, 13 Sep 2021 18:34:34 +0000 (18:34 +0000)]
[wasm] Fix circular dependency in WasmAppBuilder (#58904)

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

3 years agoRemove benign assert (#58980)
Jakob Botsch Nielsen [Mon, 13 Sep 2021 17:15:26 +0000 (19:15 +0200)]
Remove benign assert (#58980)

It is perfectly possible for us to replace a promoted struct by its only
field where that field is marked do-not-enregister. Since this path does
handle the proper retyping when normalization is required this assertion
is benign.

Fix #58972

3 years agoAdd JitStress=1/2 runs to jitstress-isas-x86 pipeline (#58822)
Bruce Forstall [Mon, 13 Sep 2021 16:57:42 +0000 (09:57 -0700)]
Add JitStress=1/2 runs to jitstress-isas-x86 pipeline (#58822)

* Add JitStress=1/2 runs to jitstress-isas-x86 pipeline

* Up timeout for jitstress-isas-x86 overall to 16 hours

At 8.5 hours, it timed out before running all the stress jobs.

3 years agoRemove too-short a timeout for a GCStress test (#57245)
Koundinya Veluri [Mon, 13 Sep 2021 16:24:55 +0000 (09:24 -0700)]
Remove too-short a timeout for a GCStress test (#57245)

- Also enabled the test for GCStress to try it again. The test seems to take a decent amount of time on my machine, and with the machine busy it could take longer but it should finish in reasonable time.
- Closes https://github.com/dotnet/runtime/issues/13453

3 years ago[tvOS] Be less eager in creating the non-existent special folders (#58788)
Filip Navara [Mon, 13 Sep 2021 15:23:48 +0000 (17:23 +0200)]
[tvOS] Be less eager in creating the non-existent special folders (#58788)

Fixes #58787

3 years agoAdd `JitEnregStats` complus. (#58776)
Sergey Andreenko [Mon, 13 Sep 2021 15:13:03 +0000 (08:13 -0700)]
Add `JitEnregStats` complus. (#58776)

* Add `JitEnregStats` complus.

* review response.

* response review 2.

* add a space

* fix printing/sorting

* fix merge conflicts

* format

Co-authored-by: Sergey <seandree@microsoft.com>
3 years agoImprove error messages expanding single-file (#58557)
Vitek Karas [Mon, 13 Sep 2021 15:00:28 +0000 (08:00 -0700)]
Improve error messages expanding single-file (#58557)

3 years agoTurn on the XHarness telemetry for Helix mobile devices (#58864)
Přemek Vysoký [Mon, 13 Sep 2021 14:35:56 +0000 (16:35 +0200)]
Turn on the XHarness telemetry for Helix mobile devices (#58864)

3 years agoRemove GTF_NO_CSE on the first FIELD_LIST arg (#57411)
SingleAccretion [Mon, 13 Sep 2021 14:12:14 +0000 (17:12 +0300)]
Remove GTF_NO_CSE on the first FIELD_LIST arg (#57411)

The code constructing the list reuses the original
local node for the first field. Such a node is likely
to have come from an OBJ(ADDR(LCL_VAR)) tree, thus
having GTF_NO_CSE set on it, pessimizing handling of
the promoted struct field, in particular, blocking
global constant propagation.

Fix this by calling SetOperResetFlags instead of
ChangeOper. This may lose some flags, but the other
fields in the list did not have them set in any case.

3 years ago[mono] Revive FullAOT test lanes (#55362)
imhameed [Mon, 13 Sep 2021 13:33:56 +0000 (09:33 -0400)]
[mono] Revive FullAOT test lanes (#55362)

We don't ship any products using FullAOT on Linux x64/arm64, but this
compilation mode is used for iOS, FullAOT-related issues that affect iOS are
likely to be caught by FullAOT on Linux x64/arm64, and it is a lot easier to
build, develop, and debug on desktop OSes.

3 years agoEmit diagnostics & exceptions for sourcegen handling init-only properties & JsonInclu...
Eirik Tsarpalis [Mon, 13 Sep 2021 12:27:54 +0000 (13:27 +0100)]
Emit diagnostics & exceptions for sourcegen handling init-only properties & JsonInclude attributes (#58993)

* Emit diagnostic warnings and exceptions when sourcegen is handling init-only inaccessible JsonInclude properties.

* add localizations for runtime exception messages

3 years agoDeadlock during rundown using interpreter. (#58996)
Johan Lorensson [Mon, 13 Sep 2021 09:45:53 +0000 (11:45 +0200)]
Deadlock during rundown using interpreter. (#58996)

Identified deadlock between finalizer thread and rundown enumerating
all interpreter method. Since rundown will query for method name
in callback when iterating interpreter methods, interp_jit_info_foreach,
that might lead to additional loader activity. The hash map in
interpreter keeping the methods is locked with default JIT memory manager,
but since the callback might end up in mono_class_create_from_typedef
that will take loader lock, we get the following lock order on that
code path, memory manager->loader lock. Finalizer thread invokes
OnThreadExiting using interpreter and that might end up with a reverse
lock order, loader lock->memory manager on that code path, so these
two have a potential to deadlock. This is not a problem under JIT
or AOT since the JIT hash table is lock free therefore not causing
any deadlocks due to lock order between memory manager and loader lock.

Could be fixed by changing into a lock free hash table in interpreters
for interp_code_hash might be to risky at this point. A more safe fix
is to take a copy of the pointers while holding lock and then iterate
using local copy (simple array of pointers). Since this method is
only called during rundown, only when using interpreter, and only
include the pointers (InterpMethod *) we use with the callback,
it will have some temporary memory impact (allocating an array
of pointers), but will mitigate the deadlock since we can safely
call iterator callback without holding the lock. It will also
improve interpreter performance in situations where we run session
rundown, since lock will be held a much shorter amount of time.

3 years ago[mono] Avoid some null checks in the sgen alloc wrappers. (#58968)
Zoltan Varga [Mon, 13 Sep 2021 08:43:34 +0000 (10:43 +0200)]
[mono] Avoid some null checks in the sgen alloc wrappers. (#58968)

3 years agoCreate a parent CMake project for building app bundles on CI (#58965)
Alexander Köplinger [Mon, 13 Sep 2021 08:26:58 +0000 (10:26 +0200)]
Create a parent CMake project for building app bundles on CI (#58965)

3 years ago[mini] Use alloca for runtime_invoke retval buffer (#58978)
Aleksey Kliger (λgeek) [Sun, 12 Sep 2021 23:58:26 +0000 (19:58 -0400)]
[mini] Use alloca for runtime_invoke retval buffer (#58978)

* [mini] Use alloca for runtime_invoke retval buffer

Fixes https://github.com/dotnet/runtime/issues/58957
Related to https://github.com/dotnet/runtime/pull/58215 which was attempting to
fix https://github.com/dotnet/runtime/issues/58190

* Set initial return buffer size to TARGET_SIZEOF_VOID_P

In the common case we use the return buffer just to hold a pointer to
the return value

3 years agoRevert changes from #58314 breaking build on FreeBSD. (#59004)
Jostein Kjønigsen [Sun, 12 Sep 2021 21:40:29 +0000 (23:40 +0200)]
Revert changes from #58314 breaking build on FreeBSD. (#59004)

3 years agoFix lld support (#58959)
Jan Vorlicek [Sun, 12 Sep 2021 06:51:56 +0000 (08:51 +0200)]
Fix lld support (#58959)

I have found that when I've made a change to use the lld linker in July,
I've missed to push part of the change that was supposed to go to Arcade.

I am checking it to the runtime repo to ensure that it is fixed for the
RC2 release. I will make the same change in the Arcade repo.

3 years agoSupport JsonExtensionData in STJ source-gen (#58912)
Layomi Akinrinade [Sat, 11 Sep 2021 22:25:20 +0000 (15:25 -0700)]
Support JsonExtensionData in STJ source-gen (#58912)

* Support JsonExtensionData in STJ source-gen

* Address review feedback

3 years ago[main] Update dependencies from 8 repositories (#58865)
dotnet-maestro[bot] [Sat, 11 Sep 2021 19:10:02 +0000 (19:10 +0000)]
[main] Update dependencies from 8 repositories (#58865)

[main] Update dependencies from 8 repositories

 - Merge branch 'main' into darc-main-f57c7cdb-108f-4e8a-ba19-7d69430aaaf0

3 years ago[wasm][debugger] Clear cache after don't stop in a conditional breakpoint (#58908)
Thays Grazia [Sat, 11 Sep 2021 16:06:00 +0000 (13:06 -0300)]
[wasm][debugger] Clear cache after don't stop in a conditional breakpoint (#58908)

* Clear cache after don't stop in a conditional breakpoint.
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1390250?src=WorkItemMention&src-action=artifact_link

* Adding more tests as suggested by @radical.

3 years ago[main] Update dependencies from mono/linker (#58436)
dotnet-maestro[bot] [Sat, 11 Sep 2021 10:26:04 +0000 (12:26 +0200)]
[main] Update dependencies from mono/linker (#58436)

* Update dependencies from https://github.com/mono/linker build 20210830.7

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-alpha.1.21426.2 -> To Version 7.0.100-alpha.1.21430.7

* Update dependencies from https://github.com/mono/linker build 20210831.1

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-alpha.1.21426.2 -> To Version 7.0.100-alpha.1.21431.1

* Update dependencies from https://github.com/mono/linker build 20210902.3

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-alpha.1.21426.2 -> To Version 7.0.100-alpha.1.21452.3

* Update dependencies from https://github.com/mono/linker build 20210902.5

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-alpha.1.21426.2 -> To Version 7.0.100-alpha.1.21452.5

* Update dependencies from https://github.com/mono/linker build 20210903.3

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-alpha.1.21426.2 -> To Version 7.0.100-alpha.1.21453.3

* Update dependencies from https://github.com/mono/linker build 20210906.1

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-alpha.1.21426.2 -> To Version 7.0.100-1.21456.1

* Update dependencies from https://github.com/mono/linker build 20210906.3

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-alpha.1.21426.2 -> To Version 7.0.100-1.21456.3

* Update dependencies from https://github.com/mono/linker build 20210908.2

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-alpha.1.21426.2 -> To Version 7.0.100-1.21458.2

* Update dependencies from https://github.com/mono/linker build 20210908.4

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-alpha.1.21426.2 -> To Version 7.0.100-1.21458.4

* Update dependencies from https://github.com/mono/linker build 20210910.1

Microsoft.NET.ILLink.Tasks
 From Version 7.0.100-alpha.1.21426.2 -> To Version 7.0.100-1.21460.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
3 years agoReflection nullability API: improve test coverage, fix bug found (#58479)
Buyaa Namnan [Sat, 11 Sep 2021 01:08:49 +0000 (18:08 -0700)]
Reflection nullability API: improve test coverage, fix bug found (#58479)

* Add/remove some tests, fix generics indexing bug

3 years agoHandle file-scoped namespaces (#57894)
Martin Costello [Fri, 10 Sep 2021 23:43:16 +0000 (00:43 +0100)]
Handle file-scoped namespaces (#57894)

Handle namespace not being emitted when file-scoped
namespaces are used for a log class.
Relates to #57880.

3 years agoRemove unused test libraries in baseservices/threading (#58668)
Elinor Fung [Fri, 10 Sep 2021 20:58:40 +0000 (13:58 -0700)]
Remove unused test libraries in baseservices/threading (#58668)

3 years agoResolve overload ambiguities from lambda expression inference change (#58953)
Charles Stoner [Fri, 10 Sep 2021 20:22:29 +0000 (13:22 -0700)]
Resolve overload ambiguities from lambda expression inference change (#58953)

3 years agoEnhance CrossGen2 to emit PerfMap debug directory entry (#58552)
Juan Hoyos [Fri, 10 Sep 2021 20:19:34 +0000 (13:19 -0700)]
Enhance CrossGen2 to emit PerfMap debug directory entry (#58552)

* Only pass perfmap argument for Linux
* Enhance CrossGen2 to emit PerfMap debug directory entry

This is used to correlate PE's with their corresponding PerfMaps. For example the header in the perfmap could be:
```
FFFFFFFF 00 026D4D21B3EE3D93843FF7A964235822
FFFFFFFE 00 1
FFFFFFFD 00 1
FFFFFFFC 00 3
FFFFFFFB 00 1
```
And the PE will have the corresponding entries in the PE as:
```
PerfMap (Type 21):
        System.Private.CoreLib.ni.r2rmap, Signature = 026d4d21b3ee3d93843ff7a964235822, Version = 1
```

* Emit headers for debug directory entries from the nodes themselves.
* Add PerfMap Debug Directory Entry spec
* Extend perfmap and r2r documentation

3 years agoCoalesce live var ranges before reporting (#58803)
Jakob Botsch Nielsen [Fri, 10 Sep 2021 20:06:55 +0000 (22:06 +0200)]
Coalesce live var ranges before reporting (#58803)

Do a pass of live range coalescing in genSetScopeInfoUsingVariableRanges
to make sure we catch more cases. In particular, we were not coalescing
ranges opened in the prolog with other ranges before.

3 years agoFix Unix ARM floating point registers unwinding (#58915)
Jan Vorlicek [Fri, 10 Sep 2021 19:26:57 +0000 (21:26 +0200)]
Fix Unix ARM floating point registers unwinding (#58915)

* Fix Unix ARM floating point registers unwinding

There are two problems unwinding ARM floating point registers. One is that the PAL_VirtualUnwind
is not supporting that and the second is that the libunwind we carry and use actually doesn't
have support for unwinding those.

This change updates the libunwind so that both exidx and dwarf ways of unwinding can unwind
these registers and also adds support to our PAL_VirtualUnwind to copy the callee saved
floating point registers D8..D15 between the native and windows style contexts.

I am planning to make a PR for the libunwind upstream, but given the very low amount of time
we have remaining for .NET 6 completion, I am making the change here first. Once I get them
upstream later, I'll update the whole libunwind from there.

* Enable the related test

3 years agoFix unloadability (#58948)
Jan Vorlicek [Fri, 10 Sep 2021 17:47:24 +0000 (19:47 +0200)]
Fix unloadability (#58948)

There is a bug in AppDomain::FindAssembly code path that iterates over
the domain assemblies. The iteration loop leaves the refcount of the
LoaderAllocator related to the returned DomainAssembly bumped, but
nothing ever decrements it. So when a code that needs to be unloaded
ends up in that code path, all the managed things like managed
LoaderAllocator, LoaderAllocatorScout are destroyed, but the unloading
doesn't complete due to the refcount.

We have never found it before as this code path is never executed in any
of the coreclr tests even with unloadability testing option.

3 years agoJIT: fix VN loop dependence when VN reaches budget limit (#58921)
Andy Ayers [Fri, 10 Sep 2021 16:16:30 +0000 (09:16 -0700)]
JIT: fix VN loop dependence when VN reaches budget limit (#58921)

When VN hits its budget limit while disambiguating memory, it creates
a special opaque VN that is not associated with any basic block. Make sure
we treat this special VN as varying in every loop.

Fixes #58877.

3 years ago#58181 Fix NullReferenceException in crossgen2. (#58183)
Mikhail Filippov [Fri, 10 Sep 2021 16:12:04 +0000 (19:12 +0300)]
#58181 Fix NullReferenceException in crossgen2. (#58183)

* #58181 Fix NullReferenceException in crossgen2.

* Support .exe extension in output filename.

3 years agoEnable more iOS/tvOS device tests (#58846)
Steve Pfister [Fri, 10 Sep 2021 15:30:59 +0000 (11:30 -0400)]
Enable more iOS/tvOS device tests (#58846)

Add a few more suites to help validate the device infrastructure

Enable soft trimming and skip failing tests

Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
3 years agoAdd cast/proper load size when replacing promoted struct with field in lowering ...
Jakob Botsch Nielsen [Fri, 10 Sep 2021 14:57:34 +0000 (16:57 +0200)]
Add cast/proper load size when replacing promoted struct with field in lowering (#58589)

We may need to sign/zero-extend when we do this replacement very late.
Normally this cast would be inserted in morph.

3 years agoFix soundplayer (#58918)
Dan Moseley [Fri, 10 Sep 2021 14:48:35 +0000 (08:48 -0600)]
Fix soundplayer (#58918)

3 years agoFix an issue with ILStripping mscorlib.dll (#58934)
Alexander Köplinger [Fri, 10 Sep 2021 14:40:29 +0000 (16:40 +0200)]
Fix an issue with ILStripping mscorlib.dll (#58934)

We considered mscorlib.dll as the "core" assembly instead of System.Private.CoreLib.dll which meant Cecil hit an issue while resolving types in it.
This only happened when the IL Linker was not being used since it'd have removed the mscorlib.dll facade.

Brings in https://github.com/dotnet/runtime-assets/pull/176

3 years agoFix minor type in inline comments in Decimal.cs (#58694)
Steven Weerdenburg [Fri, 10 Sep 2021 13:38:19 +0000 (14:38 +0100)]
Fix minor type in inline comments in Decimal.cs (#58694)

Fixed 3 instances of a minor typo in comments in the Decimal.cs class

3 years agoFix Type.GetTypeFromHandle nullable annotation (#58901)
Jan Kotas [Fri, 10 Sep 2021 13:37:19 +0000 (06:37 -0700)]
Fix Type.GetTypeFromHandle nullable annotation (#58901)

* Fix Type.GetTypeFromHandle nullable annotation

* Fix build warnings

* Fix warnings in System.Private.DataContractSerialization

3 years agoThrow on unsupported types in src gen (#58775)
Steve Harter [Fri, 10 Sep 2021 13:30:24 +0000 (08:30 -0500)]
Throw on unsupported types in src gen (#58775)

* Throw on unsupported types in src gen

* Misc non-functional changes and feedback

* Fix typo

* Change disallowed terminology to unsupported

3 years ago[mono] Remove MonoAssemblyContextKind MONO_ASMCTX_ enum (#58802)
Aleksey Kliger (λgeek) [Fri, 10 Sep 2021 12:26:40 +0000 (08:26 -0400)]
[mono] Remove MonoAssemblyContextKind MONO_ASMCTX_ enum (#58802)

* Delete MonoImage:load_from_context bit

   And also mono_image_open_a_lot load_from_context parameter.

   Nobody reads the MonoImage bit, it was only written.

* Drop MONO_ASMCTX_INTERNAL. Add MonoAssemblyLoadRequest:no_managed_load_event

   Use a bit on the request to ask for the managed load event not to fire, instead of an ASMCTX enum value

* drop MONO_ASMCTX_LOADFROM and asmctx_from_path_hook

   LoadFrom is handled entirely in managed code in .NET 6+

* Get rid of MonoAssemblyContext:kind field

   It no longer has any functional effect on the loader behavior

* Drop MonoAssemblyContextKind field from load requests

   Add a no_invoke_search_hook to implement the behavior of MONO_ASMCTX_INDIVIDUAL.  Most requests don't need to set it.

* Remove asmctx arg from load requests

* Remove MONO_ASMCTX_DEFAULT and MONO_ASMCTX_INDIVIDUAL

   Convert remaining use to a boolean no_invoke_search_hook flag

3 years agoUse separate VNs for DBL2INT_OVF helpers (#58868)
Egor Bogatov [Fri, 10 Sep 2021 10:55:56 +0000 (13:55 +0300)]
Use separate VNs for DBL2INT_OVF helpers (#58868)

3 years agoEnable global constant propagation for small types (#57726)
SingleAccretion [Fri, 10 Sep 2021 09:26:26 +0000 (12:26 +0300)]
Enable global constant propagation for small types (#57726)

* Centralize the "FitsIn" logic

So that there is one canonical way to check
if a type can represent some value.

* Remove a couple superfluous casts

* Enable VN constant propagation for small types

3 years agoSimplify .NETFramework tfms (#58558)
Viktor Hofer [Fri, 10 Sep 2021 07:50:11 +0000 (09:50 +0200)]
Simplify .NETFramework tfms (#58558)

* Simplfy .NETFramework tfms

Libraries which target .NET Framework usually have rid agnostic tfms,
i.e. net461. If the library targets netstandard2.0-windows as well,
the .NET Framework tfm must be rid specific, as rid specific
.NET Framework apps would otherwise pick the .NETStandard asset over
the .NETFramework one (based on the RID compatibility rules)

There is yet another reason that requires .NETFramework tfms to be RID
specific, which is when a project P2Ps other projects which are
rid-specific. Without the RID specific .NETFramework tfm, a compatible
.NETStandard asset would be picked instead.

NuGet doesn't support setting a TargetPlatform in the TargetFramework
alias when targeting .NETFramework or .NETStandard. Any such tfms in
dotnet/runtime are currently leveraging a hack that strips the
TargetPlatform / TargetFrameworkSuffix away during restore and packaging
(as NuGet Pack uses the project.assets.json file).

As NuGet will likely never support RID specific .NETFramework tfm
aliases, the distinction between a RID specific and a RID agnostic
.NETFramework tfm is unnecessary.

Remove all "TargetFrameworkSuffixes" / TargetPlatforms / RIDs
(whatever you would like to call them) from .NETFramework tfms and let
the packaging targets handle the cases where a RID specific asset is
required in the package.

Explictly don't set TargetsWindows to true for .NETFramework builds as
the Targets* properties are infered from the platform / suffix and
many projects make the assumption that net461
(without the "-windows" part) doesn't set TargetsWindows=true.

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

* Warn on .NETFramework duplicate runtime assets

* Ignore .NEtFramework non Windows and non empty RIDs

Also cleaning up the packaging.targets file and removing
the ExcludeFromPackage option which isn't needed anymore as
target frameworks aren't excluded from packages produced in
dotnet/runtime anymore.

3 years agoFix SIMD temp register interference (#58914)
Bruce Forstall [Fri, 10 Sep 2021 05:52:01 +0000 (22:52 -0700)]
Fix SIMD temp register interference (#58914)

On Windows/x86, if a call returns a SIMD8 in two registers
(eax, edx), and needs to be assembled and stored into a single
SIMD register, AND we don't have the SSE41 ABI available (because
the hardware doesn't support it, or we specifically disable it),
then we need a temporary register. In the failure case, the target
register and temporary register were the same, and then interfered
with each other. The fix is to force the temporary register to
be different from the target register.

Fixes #58899

3 years agoAddress Windows recommendations for Link APIs (#58592)
David Cantú [Fri, 10 Sep 2021 05:48:35 +0000 (22:48 -0700)]
Address Windows recommendations for Link APIs  (#58592)

* NT prefix shall not be treated as a relative path

* Remove file-folder-match validation

* Use SubstituteName instead of PrintName since the latter is just for display and can be misleading

* Fix MS.IO.Redist

* Fix whitespace in Strings.resx

* Address suggestions

3 years agomissing doc for HttpRequestOptions, HttpRequestOptionsKey and HttpRequestMessage...
Pavel Savara [Fri, 10 Sep 2021 03:56:11 +0000 (05:56 +0200)]
missing doc for HttpRequestOptions, HttpRequestOptionsKey and HttpRequestMessage.Options (#58896)

3 years ago[wasm] fix local build for NetCoreServer and RemoteLoopServer (#58900)
Pavel Savara [Fri, 10 Sep 2021 03:48:24 +0000 (05:48 +0200)]
[wasm] fix local build for NetCoreServer and RemoteLoopServer (#58900)

3 years agoIncrement source generator assembly versions with every build (#58836)
Anirudh Agnihotry [Fri, 10 Sep 2021 03:03:00 +0000 (20:03 -0700)]
Increment source generator assembly versions with every build (#58836)

* increment source generator assembly versions with every build

* use isGenerator Project property

* add comment

3 years agoAdd typeparam docs to interpolated string handler AppendFormatted methods (#58875)
Stephen Toub [Fri, 10 Sep 2021 03:00:49 +0000 (23:00 -0400)]
Add typeparam docs to interpolated string handler AppendFormatted methods (#58875)

3 years agoAdd delete operator in Crst class (#58885)
Adeel Mujahid [Fri, 10 Sep 2021 02:48:52 +0000 (05:48 +0300)]
Add delete operator in Crst class (#58885)

3 years ago[tasks] [net472] Add ProjectReferences to JsonToItemsTaskFactory (#58825)
Aleksey Kliger (λgeek) [Fri, 10 Sep 2021 02:37:29 +0000 (22:37 -0400)]
[tasks] [net472] Add ProjectReferences to JsonToItemsTaskFactory (#58825)

* [tasks] [net472] Add ProjectReferences to JsonToItemsTaskFactory

Reference the same versions of System.Threding.Tasks.Extensions and
System.Text.Json that MSBuild in Visual Studio 2022 uses.

Fixes build errors on maui-ios (and possibly blazorwasm) targets on Windows
like:

```
System.MissingMethodException: Method not found: 'System.Threading.Tasks.ValueTask`1<!!0> System.Text.Json.JsonSerializer.DeserializeAsync(System.IO.Stream, System.Text.Json.JsonSerializerOptions, System.Threading.CancellationToken)'.
   at JsonToItemsTaskFactory.JsonToItemsTaskFactory.JsonToItemsTask.<GetJsonAsync>d__24.MoveNext()
   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1.Start[TStateMachine](TStateMachine& stateMachine)
   at JsonToItemsTaskFactory.JsonToItemsTaskFactory.JsonToItemsTask.GetJsonAsync(String jsonFilePath, FileStream file)
   at JsonToItemsTaskFactory.JsonToItemsTaskFactory.JsonToItemsTask.TryGetJson(String jsonFilePath, JsonModelRoot& json)
   at JsonToItemsTaskFactory.JsonToItemsTaskFactory.JsonToItemsTask.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at
   Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
```

from `C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.MonoTargets.Sdk\6.0.0-rc.1.21451.13\Sdk\RuntimeComponentManifest.targets`

3 years agoDon't force using the system libunwind for source-build (#58641)
Omair Majid [Thu, 9 Sep 2021 22:13:08 +0000 (18:13 -0400)]
Don't force using the system libunwind for source-build (#58641)

Instead, use the runtime's normal detection logic to decide what to do.

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

3 years agoSkip dead conditions in eventpipe srcgen (#58871)
Adeel Mujahid [Thu, 9 Sep 2021 20:46:41 +0000 (23:46 +0300)]
Skip dead conditions in eventpipe srcgen (#58871)

3 years agoFix symbol package output path for host pkgproj (#58844)
Elinor Fung [Thu, 9 Sep 2021 19:05:50 +0000 (12:05 -0700)]
Fix symbol package output path for host pkgproj (#58844)

3 years ago[wasm][debugger] Fix pause on exception behavior (#58728)
Thays Grazia [Thu, 9 Sep 2021 18:30:22 +0000 (15:30 -0300)]
[wasm][debugger] Fix pause on exception behavior (#58728)

* We don't need this hacky anymore, now we receive the initial status.

* Fix for debugging with and without vs.

* Fix test behavior.

* Adding more tests.

* Update src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs

Co-authored-by: Ankit Jain <radical@gmail.com>
* Addressing @radical comments.

Co-authored-by: Ankit Jain <radical@gmail.com>
3 years agoIgnore the X.509 DuplicateExtension status from macOS 12.
Kevin Jones [Thu, 9 Sep 2021 17:21:53 +0000 (13:21 -0400)]
Ignore the X.509 DuplicateExtension status from macOS 12.

MacOS 12 introduces a new X.509 chain status, DuplicateExtension. As we do not report this in Windows and nor do we have a flag to map it to, we ignore it from macOS.

3 years agoRequest fewer threads in the thread pool (#57885)
Koundinya Veluri [Thu, 9 Sep 2021 17:03:45 +0000 (10:03 -0700)]
Request fewer threads in the thread pool (#57885)

* Request fewer threads in the thread pool

- Currently up to proc count yet-to-be-serviced thread requests are made when each work item is enqueued and when each work item is dequeued. Some of the conditions for making a thread request are speculative, making it difficult to reduce the cap without running into issues (see https://github.com/dotnet/runtime/issues/8951#issuecomment-337107933).
- When the thread pool is not fully loaded, more threads are requested than necessary, causing more threads to wake up and compete for work items, and this shows a perf degradation at some point as load is decreased
- Fixed by using a similar solution to https://github.com/dotnet/runtime/blob/50576e326d1015906608e3c06670344e335c3225/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEngine.Unix.cs#L209. With this change, at most one thread is requested at a time. A thread pool thread requests another thread for parallelization of work after dequeuing the first work item and does not request any more threads, leaving it up to whichever thread services the new thread request to parallelize further.
- After this, there was a regression in ASP.NET benchmarks on arm64 with default number of connections, see https://github.com/dotnet/runtime/issues/39559 for more info. Increased the spin-waiting duration on thread pool worker threads to compensate. Spin-waiting longer is preferrable to busy-waiting and competing with other threads for work items, and hitting a full wait and waking up frequently.
- The change seems to solve the perf cliff seen at some point as load is decreased, especially on arm64. A portion of the perf improvements seen on arm64 at lower load is due to the increase in spin-waiting.

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

3 years agoChange PKCS12 password to assist with credscan
Kevin Jones [Thu, 9 Sep 2021 15:51:50 +0000 (11:51 -0400)]
Change PKCS12 password to assist with credscan

3 years agoConsider finally that jumps to itself as non-empty (#58771)
Kunal Pathak [Thu, 9 Sep 2021 15:32:01 +0000 (08:32 -0700)]
Consider finally that jumps to itself as non-empty (#58771)

* decrement the reference of unreachable finally

* Proper fix

3 years agoonly cache credentials on success (#58594)
Tomas Weinfurt [Thu, 9 Sep 2021 15:28:23 +0000 (08:28 -0700)]
only cache credentials on success (#58594)

3 years agoUse XHarnessApkToTest to create helix work items for runtime tests when running on...
Fan Yang [Thu, 9 Sep 2021 13:05:26 +0000 (09:05 -0400)]
Use XHarnessApkToTest to create helix work items for runtime tests when running on Android (#57292)

* Try to use CustomCommand for Android jobs

* Moved property group outside of item group.

* Reverted commenting in runtime.yml

* reverted comment change to global-build.yml

* Target->TestTarget

Co-authored-by: Přemek Vysoký <premek.vysoky@microsoft.com>
* Fixed item group nesting.

* Added version string.

* Define HelixWorkItem and XHarnessApkToTest after defining Payloads

* Disable more unrelated lanes when experimenting

* Remove the code to only run one test

* Uncomment global-build

* Uncomment some jobs

* Uncomment mono and library build jobs

* Uncomment more mono build jobs

* Uncomment more mono jobs

* Fix app path

* Keep full path

* Use zip files as XHarnessApkToTest inputs

* Fix attribute error

* Fix syntax

* Update src/tests/Common/helixpublishwitharcade.proj

Co-authored-by: Přemek Vysoký <premek.vysoky@microsoft.com>
* Zip payload folder after target PreparePayloadsDirectories

* Revert the hack

* Revert unwanted changes

* Remove typo

* Address review feedback

* Add back timeout threshold

* Remove redundant var

Co-authored-by: Nathan Ricci <naricc@microsoft.com>
Co-authored-by: Přemek Vysoký <premek.vysoky@microsoft.com>
3 years ago[MonoVM] Report correct DLL name when P/Invoke lookup fails (#58206)
Filip Navara [Thu, 9 Sep 2021 11:51:01 +0000 (13:51 +0200)]
[MonoVM] Report correct DLL name when P/Invoke lookup fails (#58206)

https://github.com/dotnet/runtime/issues/58185

3 years agoSystem.Net.Ping: Skip TimeoutIsRespected test if network is unreachable (#58745)
Alexander Köplinger [Thu, 9 Sep 2021 11:40:05 +0000 (13:40 +0200)]
System.Net.Ping: Skip TimeoutIsRespected test if network is unreachable (#58745)

The TestSettings.UnreachableAddress is using 192.0.2.0 which is documented in RFC5735 as a network to be used in docs/example code.
On the Android devices in Helix the upstream network is configured to not route this address which results in a "Destination Net Unreachable" response
which causes the timeout argument to ping to be ignored and ping returns immediately.
Skip the test in these cases.

Example output from ping on the device:

```
1|sunfish:/ $ time ping -c 1 -W 2 -s 50 192.0.2.0
PING 192.0.2.0 (192.0.2.0) 50(78) bytes of data.
From 131.107.5.118: icmp_seq=1 Destination Net Unreachable

--- 192.0.2.0 ping statistics ---
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time Oms

   0m00.03s real   0m00.00s user   0m00.00s system
```

3 years ago[build] Bump XHarness version (#58830)
Aleksey Kliger (λgeek) [Thu, 9 Sep 2021 11:25:05 +0000 (07:25 -0400)]
[build] Bump XHarness version (#58830)

Pick up the changes from https://github.com/dotnet/xharness/pull/706 to fix
conflicting `-d` option that was preventing wasm test runs

3 years agoUse non-deprecated Android Helix queue (#58809)
Alexander Köplinger [Thu, 9 Sep 2021 10:17:38 +0000 (12:17 +0200)]
Use non-deprecated Android Helix queue (#58809)

Ubuntu.1804.Amd64.Android.Open was redirected to Ubuntu.1804.Amd64.Android.29.Open, use that in the .yml

Fixes https://github.com/dotnet/core-eng/issues/13179

3 years ago[wasm] WebSocket perf test (#58730)
Pavel Savara [Thu, 9 Sep 2021 09:30:21 +0000 (11:30 +0200)]
[wasm] WebSocket perf test (#58730)

- benchmark for WebSocket buffering
- async before and after batch setup

3 years agoFix x86 EH for UnmanagedCallersOnly methods (#58796)
Jan Vorlicek [Thu, 9 Sep 2021 08:54:27 +0000 (10:54 +0200)]
Fix x86 EH for UnmanagedCallersOnly methods (#58796)

* Fix x86 EH for UnmanagedCallersOnly methods

There is a bug in the exception handling on x86 when exception is
propagated from a method marked with UnmanagedCallersOnly attribute to
an immediate caller that's also managed (and calls the method via a
native delegate). In this case, there is no native frame in between and
the stack walker accidentally skips the InlinedCallFrame processing
during first pass of exception handling. The InlinedCallFrame is expected
to be processed before the related PInvoke IL stub and it doesn't happen
in this case, as a native frame is required to make the stack frame iterator
move to the explicit InlinedCallFrame. The fact that it is not processed
results in ignoring the upper limit on the stack walk and walking the stack
further than expected.

This change fixes it by detecting the direct transition from
UnmanagedCallersOnly to managed caller and forces the stack frame
iterator to process the InlinedCallFrame.

* Reflect PR feedback, use GCInfo instead of parsing the attribute

3 years agoFix reporting of live var ranges after callf+always pairs (#58815)
Jakob Botsch Nielsen [Thu, 9 Sep 2021 08:19:59 +0000 (10:19 +0200)]
Fix reporting of live var ranges after callf+always pairs (#58815)

We were basing the decision on whether a home update was needed on the
live out variables of the previous block, but that block is skipped for
callf+finally pairs. Change the logic to use the callf block instead.

Fix #57752

3 years agoCreate a separate RuntimeConfig test for Android and add incremental build (#58835)
Fan Yang [Thu, 9 Sep 2021 07:44:37 +0000 (03:44 -0400)]
Create a separate RuntimeConfig test for Android and add incremental build (#58835)

* Create a separate RuntimeConfig test for Android

* Add incremental build

3 years agoAlways write sample events in EventPipe based on sample frequency. (#58720)
Johan Lorensson [Thu, 9 Sep 2021 05:55:39 +0000 (07:55 +0200)]
Always write sample events in EventPipe based on sample frequency. (#58720)

* Always write sample events in EventPipe based on sample frequency.

If no managed frames (including helper frames) are located on stack,
sample was dropped and not emitted into EventPipe. This cause issues
in tooling that try to do thread time calculations based on sample,
especially in cases where embedded threads returned to native
code during several samples before calling back into runtime. In such
scenarios the last sampled event would be prolonged, giving false
information that that stackframe lasted much longer than it really did.

Always writing samples into EventPipe will also visualize time an attached
thread spend outside of runtime, not running managed code.

3 years agoRemove dead code (#58475)
Bruce Forstall [Thu, 9 Sep 2021 04:50:09 +0000 (21:50 -0700)]
Remove dead code (#58475)

Remove unused `isFloat` argument to `getRegName`, as well
as some additional unused reg name functions (probably left over
from the old x86 back-end).

3 years agoFix zero initialization use of "initReg" (#58410)
Bruce Forstall [Thu, 9 Sep 2021 04:48:35 +0000 (21:48 -0700)]
Fix zero initialization use of "initReg" (#58410)

If the only local is an enregistered must-init struct,
we were setting `initReg` to its register (in this case, `xmm0`).
However, `initReg` is expected to be an integer register. In the
test case, with GS cookie stress, the GS cookie code asserted
that `initReg` was an integer register, but it wasn't.

The fix is the change the condition to use the actual register
assigned to the variable (in this case, `xmm0`), not the variable
type (here, `TYP_STRUCT`).

No spmi asm diffs.

Fixes #57911

3 years agoFix incorrect SIMD temp allocation for Vector256 with AVX2 disabled (#58820)
Bruce Forstall [Thu, 9 Sep 2021 04:36:26 +0000 (21:36 -0700)]
Fix incorrect SIMD temp allocation for Vector256 with AVX2 disabled (#58820)

* Fix incorrect SIMD temp allocation for Vector256 with AVX2 disabled

The NI_Vector256_GetElement intrinsic, in some situations, requires
a stack temporary. With AVX2 disabled, this temporary was getting
allocated as a TYP_SIMD16 instead of a TYP_SIMD32, leading to overwriting
the local variable.

Add a type argument to the temp variable allocation, and allocate the
temp as the largest sized type required by any use.

Fixes #58295

* Code review change: improve arm64 SIMD temp creation type

3 years agoadd W11 test queue (#58570)
Tomas Weinfurt [Thu, 9 Sep 2021 02:47:48 +0000 (19:47 -0700)]
add W11 test queue (#58570)

3 years agoDeallocate resources for DacDbiArrayList with a matching deallocator (#58791)
Juan Hoyos [Thu, 9 Sep 2021 01:35:00 +0000 (18:35 -0700)]
Deallocate resources for DacDbiArrayList with a matching deallocator (#58791)

Deleted InfoStoreForDbiNew as there were no users.

Added DeleteDbiMemory to deal with destruction of items and proper usage of the corresponding allocator. However, using this custom new here across dll boundaries is risky as the T type will get its destructor called then the array list is destructed. The old implementation that used the CLR allocators didn't call the destructors on the inner elements (we had a potential leak, in practice it wasn't very noticeable - most objects are never deleted). After #55945, the standard array delete expression - as well as this change - call the destructor on every object. Currently, the instantiations of this type are all devoid of special destructors and are largely blittable structs, so this remains working as it was:

- ICorDebugInfo::NativeVarInfo
- GUID
- FieldData
- DebuggerIPCE_TypeArgData
- DebuggerIPCE_ExpandedTypeData
- DebuggerIPCE_BasicTypeData
- DebuggerILToNativeMap
- DacExceptionCallStackData
- CordbType *
- CORDB_ADDRESS
- COR_SEGMENT
- COR_MEMORY_RA

3 years agoAdd explicit APIs to Double/Single/Half/TimeOnly (#58774)
Prashanth Govindarajan [Wed, 8 Sep 2021 21:43:42 +0000 (14:43 -0700)]
Add explicit APIs to Double/Single/Half/TimeOnly (#58774)

* Add explicit APIs to Double/Single/Half/TimeOnly

* sq

* Fix get accessor in ref

3 years agoUpgrade to net7.0 and remove target frameworks (#58011)
Viktor Hofer [Wed, 8 Sep 2021 20:04:23 +0000 (22:04 +0200)]
Upgrade to net7.0 and remove target frameworks (#58011)

* Remove EOL tfms and upgrade to net7.0

* Make linker tests net7 aware

Make installer tests run on net7.0

Don't attempt to use live apphost

Fix payloads

Regenerate test files

Fix package testing

3 years agoFix Windows 8 detection in Pbkdf2 (#58736)
Theodore Tsirpanis [Wed, 8 Sep 2021 18:49:13 +0000 (21:49 +0300)]
Fix Windows 8 detection in Pbkdf2 (#58736)

* Fix Windows 8 detection.

Windows 8's actual version is 6.2, not 8. The test would succeed only on Windows 10+.

* Explain that Windows 8's version is 6.2.

Co-authored-by: Jeff Handley <jeffhandley@users.noreply.github.com>
Co-authored-by: Jeff Handley <jeffhandley@users.noreply.github.com>
3 years agoMore cleanups in Assembly/Loader/Binder area (#58462)
Vladimir Sadov [Wed, 8 Sep 2021 18:16:36 +0000 (11:16 -0700)]
More cleanups in Assembly/Loader/Binder area (#58462)

- [x]  fold the native `AssemblyLoadContext` into its base `AssemblyBinder`
Now `DefaultAssemblyBinder` and `CustomAssemblyBinder` derive directly from `AssemblyBinder`
- [x]  rename: NativeAssemblyLoadContext -> NativeAssemblyBinder
- [x]  misc. renames:
TPABinderContext -> DefaultBinder,   FallbackLoadContextBinder -> FallbackBinder, etc ...
- [x]  remove `CoreBindResult` and everything under `src/coreclr/vm/coreclr`  folder
The type is basically a tuple of `BINDER_SPACE::Assembly` and `HRESULT` and `HRESULT` is used in a single place right after it is set. The rest is COM support, ref-counting, holder, init/reset/delete, and other plumbing. We can just use `Assembly` directly.