platform/upstream/dotnet/runtime.git
3 years agoExpand PerfMap format to support metadata for symbol indexation (#53792)
Tomáš Rylek [Thu, 1 Jul 2021 23:17:59 +0000 (01:17 +0200)]
Expand PerfMap format to support metadata for symbol indexation (#53792)

I have expanded the PerfMap format produced by Crossgen2 and
R2RDump to produce metadata in form of pseudo-symbol records with
high addresses. In this version I have implemented four metadata
entries - output GUID, target OS, target architecture and perfmap
format version number.  I have verified for System.Private.CoreLib
and for the composite framework that Crossgen2 and R2RDump
produce identical metadata.

To facilitate a smooth transition to the new perfmap format, in
accordance with Juan's suggestion I have introduced a new command-line
option to explicitly specify the perfmap format revision. As of today,
0 corresponds to the legacy Crossgen1-style output where the
perfmap file name includes the {MVID} section, perfmap format #1
corresponds to current Crossgen2 with its new naming scheme.
As of today there are no differences in the file content.

Thanks

Tomas

3 years ago[debugger]Componentize debugger (#54887)
Thays Grazia [Thu, 1 Jul 2021 23:08:40 +0000 (20:08 -0300)]
[debugger]Componentize debugger (#54887)

* First version of componentize debugger

* Trying to save history of debugger-agent.h

* adding debugger-agent.h as a new file

* Fixing compilation

* Fixing wasm compilation

* Fixing wasm compilation.

* Running wasm app.

* Unrelated change.

* Fixing debugging console app

* Fixing compilation on linux

* Fixing wasm debugger.

* Remove unused callbacks

* Moving mini-wasm-debugger to component folder.

* Fixing wasm debugger.

* Fix non wasm compilation

* Fixing compilation on other platforms.

* Removing more code from component callback.

* Transforming more functions into static.

* Fix compilation.

* Moving more files to component folder.

* moving files.

* Fix android compilation.

* Fix wasm compilation.

* Try to fix windows compilation.

* Changing what @lambdageek suggested.

* Changing what @lamdbageek suggested.

* Not used anymore.

* Using the same function to initialize wasm and non-wasm debugger.

* Rollback exported function name.

* Changing where components are initialized.
Saving debugger transport information outside the component.

* set sdb options before component startup.

* Fixing console debug.

* Fix ios compilation.

* Fix calling parse_options without parameters.

* Last @lambdageek suggestions.

3 years ago[Mono] Include loaded interpreter methods as EventPipe session rundown method events...
Johan Lorensson [Thu, 1 Jul 2021 22:37:24 +0000 (00:37 +0200)]
[Mono] Include loaded interpreter methods as EventPipe session rundown method events. (#54953)

* Include interpreter methods in EventPipe session rundown events.

* Fix build error.

3 years agoDelete stale ActiveIssue from HttpHeadersTest (#55027)
Stephen Toub [Thu, 1 Jul 2021 20:00:55 +0000 (16:00 -0400)]
Delete stale ActiveIssue from HttpHeadersTest (#55027)

This is reported to have been fixed by https://github.com/dotnet/runtime/pull/54932.

3 years agoPoison address-exposed user variables in debug (#54685)
Jakob Botsch Nielsen [Thu, 1 Jul 2021 19:39:04 +0000 (21:39 +0200)]
Poison address-exposed user variables in debug (#54685)

* Poison address exposed user variables in debug code

Fix #13072

* Run jit-format

* Use named scratch register and kill it in LSRA

* Enable it unconditionally for testing purposes

* Remove unnecessary modified reg on ARM

* Fix OSR and get rid of test code

* Remove a declaration

* Undo modified comment and use modulo instead of and

* Add a test

* Rephrase comment

Co-authored-by: Kunal Pathak <Kunal.Pathak@microsoft.com>
* Disable poisoning test on mono

* Remove outdated line

Co-authored-by: Kunal Pathak <Kunal.Pathak@microsoft.com>
3 years agoRecategorize emsdk dependency (#55028)
Matt Mitchell [Thu, 1 Jul 2021 19:08:30 +0000 (12:08 -0700)]
Recategorize emsdk dependency (#55028)

3 years agoRemove the the wasm AOT specific test project exclusions (#54988)
Larry Ewing [Thu, 1 Jul 2021 19:02:12 +0000 (14:02 -0500)]
Remove the the wasm AOT specific test project exclusions (#54988)

Co-authored-by: Ankit Jain <radical@gmail.com>
3 years agoAllow restricting cultures creation with any arbitrary names in Globalization Invaria...
Tarek Mahmoud Sayed [Thu, 1 Jul 2021 18:55:05 +0000 (11:55 -0700)]
Allow restricting cultures creation with any arbitrary names in Globalization Invariant Mode (#54247)

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
3 years ago[samples] Include parent Directory.Build.targets in wasm/samples (#54972)
Aleksey Kliger (λgeek) [Thu, 1 Jul 2021 18:34:47 +0000 (14:34 -0400)]
[samples] Include parent Directory.Build.targets in wasm/samples (#54972)

Fixes building the samples against the intree ref assemblies

3 years agoMark vars as do not enreg earlier in minopts. (#54998)
Sergey Andreenko [Thu, 1 Jul 2021 17:31:58 +0000 (10:31 -0700)]
Mark vars as do not enreg earlier in minopts. (#54998)

* Improve morphblock logic.

* change lclVars.

* Extract compEnregLocals

* same for args/locals

3 years agoFix differences from S.S.C.Primitives autogenerated ref file.
Kevin Jones [Thu, 1 Jul 2021 17:16:30 +0000 (13:16 -0400)]
Fix differences from S.S.C.Primitives autogenerated ref file.

3 years agoPreserve necessary type and method (#54932)
Fan Yang [Thu, 1 Jul 2021 17:11:09 +0000 (13:11 -0400)]
Preserve necessary type and method (#54932)

* Preserve necessary type and method

* Change the way of getting the type

* Inline the constants

* Enable NonValidated_ValidAndInvalidValues_DictionaryMembersWork

* Enable TransformStrStrResolver3

3 years ago[mono] Implement the rest of Vector{64,128}{,<T>} (#54924)
imhameed [Thu, 1 Jul 2021 16:30:27 +0000 (09:30 -0700)]
[mono] Implement the rest of Vector{64,128}{,<T>} (#54924)

3 years ago[mono] Avoid putting static virtual methods into the IMT table. (#54981)
Zoltan Varga [Thu, 1 Jul 2021 16:09:06 +0000 (12:09 -0400)]
[mono] Avoid putting static virtual methods into the IMT table. (#54981)

3 years ago[wasm][aot] Enable System.Runtime.Tests (#54960)
Ankit Jain [Thu, 1 Jul 2021 15:27:10 +0000 (11:27 -0400)]
[wasm][aot] Enable System.Runtime.Tests (#54960)

.. this hasn't crashed in last 14 days on the tracking PR.
- And disable the one failing test with ActiveIssue

3 years ago[mono][aot] Implement fetching from the rgctx in llvmonly mode using inline code...
Zoltan Varga [Thu, 1 Jul 2021 15:23:10 +0000 (11:23 -0400)]
[mono][aot] Implement fetching from the rgctx in llvmonly mode using inline code instead of (#54840)

calling mono_fill_class_rgctx ().
Also bump the initial size of the rgctx to 16 to allow loading more entries without doing
a nested lookup.

3 years agoRemove reference to non-existent System.Net.NameResolution.Unit.Tests.csproj (#55003)
Anton Firszov [Thu, 1 Jul 2021 13:26:58 +0000 (15:26 +0200)]
Remove reference to non-existent System.Net.NameResolution.Unit.Tests.csproj (#55003)

3 years agoRevert "Add ActivitySource support to DiagnosticsHandler (#54437)" (#55006)
Miha Zupan [Thu, 1 Jul 2021 13:23:34 +0000 (06:23 -0700)]
Revert "Add ActivitySource support to DiagnosticsHandler (#54437)" (#55006)

This reverts commit c88da2905317c0b199c5814594f1ea5d079e0760.

3 years ago Add analyzers to ref-pack / ASP.NET transport package (#54950)
Eric StJohn [Thu, 1 Jul 2021 12:49:52 +0000 (05:49 -0700)]
 Add analyzers to ref-pack / ASP.NET transport package (#54950)

* Add analyzers to ref-pack / ASP.NET transport package

* Updating shared framework SDK

* Respond to feedback

* Update arcade SDKs and remove property

3 years agoFix typo in variable name (#54989)
Andrii Kurdiumov [Thu, 1 Jul 2021 12:07:21 +0000 (18:07 +0600)]
Fix typo in variable name (#54989)

3 years agoRemove RequiresAssemblyFilesAttribute in the trimmed app (#54962)
Marek Safar [Thu, 1 Jul 2021 11:48:15 +0000 (13:48 +0200)]
Remove RequiresAssemblyFilesAttribute in the trimmed app (#54962)

3 years agoRemove unnecessary Prev field in portable tailcall helpers (#54894)
Jakob Botsch Nielsen [Thu, 1 Jul 2021 11:30:56 +0000 (13:30 +0200)]
Remove unnecessary Prev field in portable tailcall helpers (#54894)

GC only ever needs to look at the top dispatcher frame as other
dispatchers cannot have live arg buffers, so it is not necessary to keep
these linked together. We can save a bit of stack this way.

Also update design document that was a bit outdated.

3 years agoEnsure pwszLanguage passed to GetFileMUIPath is empty string (#54978)
Stephen Toub [Thu, 1 Jul 2021 10:44:11 +0000 (06:44 -0400)]
Ensure pwszLanguage passed to GetFileMUIPath is empty string (#54978)

We're currently treating it only as output, but according to the docs it's also used as input and so needs to be well-formed.  Using an empty string ensures it doesn't take precedence over the flags, per the docs for the function.

3 years agoReduce overheads of EventSource.WriteEvent(int, object[]) with ETW (#54925)
Stephen Toub [Thu, 1 Jul 2021 10:43:44 +0000 (06:43 -0400)]
Reduce overheads of EventSource.WriteEvent(int, object[]) with ETW (#54925)

* Reduce overheads of EventSource.WriteEvent(int, object[]) with ETW

Cuts allocation by ~3-4x on basic use cases by avoiding a `List<int>(8)` and `List<object>(8)` allocation along with the underlying arrays.

* Fix standalone build

* Address PR feedback

3 years agoAvoid stackalloc[1] in a few places (#54746)
Stephen Toub [Thu, 1 Jul 2021 10:40:51 +0000 (06:40 -0400)]
Avoid stackalloc[1] in a few places (#54746)

3 years agoRe-enable tests on mono interpreter (#54811)
Vlad Brezae [Thu, 1 Jul 2021 10:22:31 +0000 (13:22 +0300)]
Re-enable tests on mono interpreter (#54811)

3 years agoEnable more LDAP TLS tests on linux (#54377)
iinuwa [Thu, 1 Jul 2021 09:59:59 +0000 (04:59 -0500)]
Enable more LDAP TLS tests on linux (#54377)

* Remove SupportedOsPlatform attribute for LDAP TLS

* Throw ObjectDisposedException when setting LDAP TLS settings on Linux.

3 years ago[JIT] Improve inliner: new heuristics, rely on PGO data (#52708)
Egor Bogatov [Thu, 1 Jul 2021 08:32:46 +0000 (11:32 +0300)]
[JIT] Improve inliner: new heuristics, rely on PGO data (#52708)

Co-authored-by: Andy Ayers <andya@microsoft.com>
3 years agoRemove GenerateCompiledExpressionsTempFilePathForEditing hack (#54977)
Viktor Hofer [Thu, 1 Jul 2021 07:43:28 +0000 (09:43 +0200)]
Remove GenerateCompiledExpressionsTempFilePathForEditing hack (#54977)

This was fix in Feb 2019: https://github.com/dotnet/msbuild/pull/4100.

3 years ago[main] Update dependencies from 8 repositories (#54907)
dotnet-maestro[bot] [Thu, 1 Jul 2021 05:37:22 +0000 (00:37 -0500)]
[main] Update dependencies from 8 repositories (#54907)

* Update dependencies from https://github.com/dotnet/arcade build 20210628.2

Microsoft.DotNet.XUnitExtensions , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.ApiCompat , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.GenFacades , Microsoft.DotNet.GenAPI , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.SharedFramework.Sdk
 From Version 6.0.0-beta.21324.3 -> To Version 6.0.0-beta.21328.2

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

Microsoft.NETCore.Runtime.ICU.Transport
 From Version 6.0.0-preview.7.21321.1 -> To Version 6.0.0-preview.7.21328.1

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

Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 1.0.0-prerelease.21328.2 -> To Version 1.0.0-prerelease.21328.4

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

runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , 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
 From Version 11.1.0-alpha.1.21321.1 -> To Version 11.1.0-alpha.1.21328.1

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

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21327.1 -> To Version 6.0.100-preview.6.21328.2

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

Microsoft.DotNet.HotReload.Utils.Generator.BuildTool
 From Version 1.0.1-alpha.0.21321.1 -> To Version 1.0.1-alpha.0.21328.1

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

Microsoft.NET.Runtime.Emscripten.2.0.23.Node.win-x64
 From Version 6.0.0-preview.7.21323.1 -> To Version 6.0.0-preview.7.21329.1

* Address new IL3002 and IL3003 warnings for the latest linker to unblock the build.

* Disable the trim analyzer for tests with EnableAggressiveTrimming

* Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20210629.4

optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR
 From Version 1.0.0-prerelease.21320.4 -> To Version 1.0.0-prerelease.21329.4

* Update dependencies from https://github.com/dotnet/arcade build 20210629.8

Microsoft.DotNet.XUnitExtensions , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.ApiCompat , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.GenFacades , Microsoft.DotNet.GenAPI , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.SharedFramework.Sdk
 From Version 6.0.0-beta.21321.1 -> To Version 6.0.0-beta.21329.8

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

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21317.4 -> To Version 6.0.100-preview.6.21329.2

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

Microsoft.NET.Runtime.Emscripten.2.0.23.Node.win-x64
 From Version 6.0.0-preview.7.21323.1 -> To Version 6.0.0-preview.7.21330.1

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

Microsoft.NET.ILLink.Tasks
 From Version 6.0.100-preview.6.21317.4 -> To Version 6.0.100-preview.6.21330.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Ankit Jain <radical@gmail.com>
Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
3 years agoFix single method compilation of canonical methods (#54923)
David Wrighton [Thu, 1 Jul 2021 00:52:57 +0000 (17:52 -0700)]
Fix single method compilation of canonical methods (#54923)

3 years agoAvoid object[1] allocation in PropertyInfo.SetValue (#54918)
Stephen Toub [Thu, 1 Jul 2021 00:15:52 +0000 (20:15 -0400)]
Avoid object[1] allocation in PropertyInfo.SetValue (#54918)

3 years agoOptionally capture a dump during generational aware analysis (#54517)
Andrew Au [Wed, 30 Jun 2021 20:20:36 +0000 (13:20 -0700)]
Optionally capture a dump during generational aware analysis (#54517)

3 years agoUpdate analyzer versions (#54888)
Stephen Toub [Wed, 30 Jun 2021 19:20:46 +0000 (15:20 -0400)]
Update analyzer versions (#54888)

3 years agoUpdate perf.yml to Exclude Arm64 Queues (#54973)
Aaron Kunkle [Wed, 30 Jun 2021 18:15:32 +0000 (11:15 -0700)]
Update perf.yml to Exclude Arm64 Queues (#54973)

* split off arm64 perf pipeline

* PR comments

* PR responses

* PR responses

* Renaming

3 years agoRemove unused parameter from get_code_base call (#54959)
Marek Safar [Wed, 30 Jun 2021 16:39:27 +0000 (18:39 +0200)]
Remove unused parameter from get_code_base call (#54959)

3 years agoDon't include -llvm.o files in App Resources (fixes iOS samples w/ LLVM AOT) (#54856)
Jo Shields [Wed, 30 Jun 2021 15:56:51 +0000 (11:56 -0400)]
Don't include -llvm.o files in App Resources (fixes iOS samples w/ LLVM AOT) (#54856)

Fixes: #54572

3 years agoAdd `-metrics` argument to superpmi.py asmdiffs (#54930)
Bruce Forstall [Wed, 30 Jun 2021 15:23:22 +0000 (08:23 -0700)]
Add `-metrics` argument to superpmi.py asmdiffs (#54930)

All the passed metrics are passed through to the `--metrics` argument to jit-analyze.

E.g.,
```
superpmi.py asmdiffs -metrics PerfScore
superpmi.py asmdiffs -metrics CodeSize,PerfScore
superpmi.py asmdiffs -metrics CodeSize -metrics PerfScore
superpmi.py asmdiffs -metrics CodeSize,PrologSize -metrics PerfScore
```

3 years agoadd test for opening and reading from device interface (#54673)
Adam Sitnik [Wed, 30 Jun 2021 14:57:51 +0000 (16:57 +0200)]
add test for opening and reading from device interface (#54673)

3 years agoAdd more renegotiate tests (#54609)
Jan Jahoda [Wed, 30 Jun 2021 13:41:52 +0000 (15:41 +0200)]
Add more renegotiate tests (#54609)

* Add more renegotiate tests

* Remove client certificates

* Disable test unless #54692 is merged

3 years agoUnseal StringEnumConverter. Fix #30486 (#54917)
Eirik Tsarpalis [Wed, 30 Jun 2021 12:41:27 +0000 (13:41 +0100)]
Unseal StringEnumConverter. Fix #30486 (#54917)

3 years agoRemove some allocation from NotifyCollectionChangedEventArgs (#54899)
Stephen Toub [Wed, 30 Jun 2021 11:56:26 +0000 (07:56 -0400)]
Remove some allocation from NotifyCollectionChangedEventArgs (#54899)

* Remove some allocation from NotifyCollectionChangedEventArgs

When initialized with a single object rather than a list of objects (single object is very common), the args is allocating an object[] and then wrapping that object[] in a ReadOnlyList.  We can instead just allocate a simple read-only IList wrapper for the object directly; that also makes accessing it faster.

Additionally, when constructing an instance using `public NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction action, IList? changedItems, int index, int oldIndex)`, even though the same collection instance is used for both the new and old items, it wraps it twice.  We can wrap it once.

Along the way I also simplified the code, enabling the fields to become readonly, removing duplicate assignments of fields, etc.

* Address PR feedback

3 years agoFix EventPipe native test build errors. (#54893)
Johan Lorensson [Wed, 30 Jun 2021 11:40:35 +0000 (13:40 +0200)]
Fix EventPipe native test build errors. (#54893)

3 years ago[mono][wasm] Emit more logging from the EmccCompile task. (#54937)
Zoltan Varga [Wed, 30 Jun 2021 11:34:01 +0000 (07:34 -0400)]
[mono][wasm] Emit more logging from the EmccCompile task. (#54937)

3 years ago[mono] Fix debug logging in apps created using AppleAppBuilder (#54901)
Zoltan Varga [Wed, 30 Jun 2021 11:32:57 +0000 (07:32 -0400)]
[mono] Fix debug logging in apps created using AppleAppBuilder (#54901)

3 years agoCreate handler via test helpers. (#54825)
Marie Píchová [Wed, 30 Jun 2021 11:25:18 +0000 (13:25 +0200)]
Create handler via test helpers. (#54825)

3 years agoFix handle leak in SocketProtocolSupportPal.Unix.cs (#54898)
Anton Firszov [Wed, 30 Jun 2021 10:09:53 +0000 (12:09 +0200)]
Fix handle leak in SocketProtocolSupportPal.Unix.cs (#54898)

3 years agoSaw the ASSERT_HOLDING_SPIN_LOCK fail in the region allocator. (#54896)
Peter Sollich [Wed, 30 Jun 2021 08:44:10 +0000 (10:44 +0200)]
Saw the ASSERT_HOLDING_SPIN_LOCK fail in the region allocator. (#54896)

I think this is due to a race between a thread leaving the lock and a thread entering the lock. The thread entering the lock sets the holding_thread to itself, and the thread leaving the lock sets it to -1. The thread leaving the lock is already outside of the lock, and so its write may occur after the write by the thread entering the lock.

The end result is that the lock appears taken, but with a holding_thread of -1, which causes the assert.

Swapping the order of the two writes will fix the issue, because now the write to holding_thread is under the lock, so two threads cannot do conflicting writes.

3 years agoRemove some redundant / unused binplace directories (#54890)
Eric StJohn [Wed, 30 Jun 2021 05:55:22 +0000 (22:55 -0700)]
Remove some redundant / unused binplace directories (#54890)

* Remove some redundant / unused binplace directories

* Fix runtime pack path

* Use OuputRid instead of PackageRID

On linux-musl, OutputRID differs from PackageRID.

* Add RuntimeOS to installer leg for musl

So that we have consistent values of $(PackageRID) for installer and libraries

* Move LibrariesConfiguration definition earlier in src/tests

This property was being defined after a number of places where it was
consumed resulting in quite a few inconsistent derived properties.

3 years ago[wasm] browser http response stream could be seekable (#54749)
Pavel Savara [Wed, 30 Jun 2021 05:39:20 +0000 (07:39 +0200)]
[wasm] browser http response stream could be seekable (#54749)

- browser http response stream could be seekable
- test WebAssemblyEnableStreamingResponse

3 years agoUse `Span<T>.Fill` implementation for `Array.Fill` (#52590)
xtqqczze [Wed, 30 Jun 2021 04:05:04 +0000 (05:05 +0100)]
Use `Span<T>.Fill` implementation for `Array.Fill`  (#52590)

3 years agoPrint spillweight of RefPosition (#54933)
Kunal Pathak [Wed, 30 Jun 2021 02:10:56 +0000 (19:10 -0700)]
Print spillweight of RefPosition (#54933)

3 years agoBig-endian fix for DoubleTests.cs:ParsePatterns (#54818)
Ulrich Weigand [Tue, 29 Jun 2021 21:02:03 +0000 (23:02 +0200)]
Big-endian fix for DoubleTests.cs:ParsePatterns (#54818)

The recently added DoubleTests.cs:ParsePatterns test case
incorrectly swaps characters of the hexadecimal representation
of the floating-point numbers under test on big-endian platforms.

3 years agoAdd NetCoreAppCurrent configuration to libs (Phase 1) (#54544)
Viktor Hofer [Tue, 29 Jun 2021 20:15:47 +0000 (22:15 +0200)]
Add NetCoreAppCurrent configuration to libs (Phase 1) (#54544)

* Use property to indicate NetCoreApp min version

* Add NetCoreAppCurrent to S.Numerics.Tensors

* Add NetCoreAppCurrent to S.T.AccessControl

* Add NetCoreAppCurrent to System.Memory.Data

* Add NetCoreAppCurrent to S.Composition.* projects

* Add NetCoreAppCurrent to System.IO.Packaging

* Add NetCoreAppCurrent config to System.IO.Ports

Adding a NetCoreAppCurrent configuration to System.IO.Ports and
reducing package size, build times and platform specific assets by
using runtime checks on Unix derivates for the slightly diverging
SerialPort implementation.

Contributes to https://github.com/dotnet/runtime/issues/54012

* Add NetCoreAppCurrent to System.Data.OleDb

* Add NetCoreAppCurrent to M.W32.Registry.AccessControl

* Add NetCoreAppCurrent to S.Reflection.Context

* Add NetCoreAppCurrent to S.C.Composition.Registration

* Add NetCoreAppCurrent to S.Resources.Extensions

* Add NetCoreAppCurrent to S.N.H.WinHttpHandler

3 years agoSgen: Update progress when importing types (#46415)
Tal Aloni [Tue, 29 Jun 2021 19:07:52 +0000 (22:07 +0300)]
Sgen: Update progress when importing types (#46415)

* Sgen: Update progress when importing types
* Null check
* Remove trailing whitespace
* Updated Strings.resx
* Sgen: Use string resource

3 years agoAvoid sending EndStream after RST_STREAM with dedicated lock (#54552)
Alexander Nikolaev [Tue, 29 Jun 2021 17:59:58 +0000 (19:59 +0200)]
Avoid sending EndStream after RST_STREAM with dedicated lock (#54552)

A race condition between sending RST_STREAM and checking conditions for sending EndStream was discovered during stress testing. It happens to be possible that in time after Http2Stream [checked the _responseCompletionState](https://github.com/dotnet/runtime/blob/183c4d100f68fb6c177a1fe71809d581aa25e47b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Stream.cs#L275) and [actually send EndStream](https://github.com/dotnet/runtime/blob/183c4d100f68fb6c177a1fe71809d581aa25e47b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Stream.cs#L288), a concurrent call to [Cancel method sends a RST_STREAM frame](https://github.com/dotnet/runtime/blob/183c4d100f68fb6c177a1fe71809d581aa25e47b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Http2Stream.cs#L389). Such reordering is disallowed by HTTP/2 protocol.

Note: The issue and fix were verified manually under the debugger because currently it's not clear how to reliably simulate that situation.

Fixes #42200

3 years agoDisable some recently enabled HTTP3 tests (#54843)
Geoff Kizer [Tue, 29 Jun 2021 17:40:16 +0000 (10:40 -0700)]
Disable some recently enabled HTTP3 tests  (#54843)

* disable ConnectTimeout_TimesOutSSLAuth_Throws for HTTP3

* disable HTTP3 cookie tests

Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
3 years agoRemove some unneeded code from division morphing (#53464)
SingleAccretion [Tue, 29 Jun 2021 17:06:39 +0000 (20:06 +0300)]
Remove some unneeded code from division morphing (#53464)

* Remove GTF_UNSIGNED check from the condition

It is not necessary: GTF_UNSIGNED does not have anything
to do with the operands being unsigned.

Some positive diffs in runtime tests for win-x86 and
one regression in System.Net.WebSockets.ManagedWebSocket.ApplyMask.
The regressions is because we generate two "div"s for a long UMOD
on x86 with a constant divisor, always, even for powers of two.
Something to improve for sure.

Naturally, no diffs for win-x64, linux-x64 or linux-arm.

* Don't fold casts from constants in UMOD morphing

It used to be that "ldc.i4.1 conv.i8" sequences survived
importation, and since UMOD morphing is sensitive to
constant divisors, morph tried to fold them. This is
no longer the case, so stop doing that.

Of course, morph can be called from anywhere at any
point, but if some code is creating casts from constants,
the proper place to fix is that code.

No diffs for win-x86 or win-x64 or linux-arm.

* Some code modernization

Use modern helpers and move comments around.

3 years agoHandle marker types with more than 1 generic argument correctly when they must be...
David Wrighton [Tue, 29 Jun 2021 16:43:48 +0000 (09:43 -0700)]
Handle marker types with more than 1 generic argument correctly when they must be materialized into full types (#54875)

3 years agoRevert "[main] Update dependencies from 11 repositories (#54741)" (#54909)
Viktor Hofer [Tue, 29 Jun 2021 16:18:36 +0000 (18:18 +0200)]
Revert "[main] Update dependencies from 11 repositories (#54741)" (#54909)

This reverts commit 8103a7e3f21f67bf85763ae5703d53c0aaf591ab.

3 years ago[main] Update dependencies from 11 repositories (#54741)
dotnet-maestro[bot] [Tue, 29 Jun 2021 16:02:32 +0000 (16:02 +0000)]
[main] Update dependencies from 11 repositories (#54741)

[main] Update dependencies from 11 repositories

 - Address new IL3002 and IL3003 warnings for the latest linker to unblock the build.

 - Disable the trim analyzer for tests with EnableAggressiveTrimming

 - Merge branch 'main' into darc-main-997daf91-1bd1-4e82-9eac-1347a9231dc5

3 years ago[mono] Avoid printing out LLVM failed messages when verbosity level is 0. (#54885)
Zoltan Varga [Tue, 29 Jun 2021 14:29:15 +0000 (10:29 -0400)]
[mono] Avoid printing out LLVM failed messages when verbosity level is 0. (#54885)

3 years agoupdate area-owners.md (#54900)
Aleksey Kliger (λgeek) [Tue, 29 Jun 2021 14:28:03 +0000 (10:28 -0400)]
update area-owners.md (#54900)

3 years ago[mono] Enable more runtime tests (#54852)
imhameed [Tue, 29 Jun 2021 14:00:16 +0000 (07:00 -0700)]
[mono] Enable more runtime tests (#54852)

3 years agoInternalCanonicalizeRealPath: don't call strstr with uninitialized lpBuffer. (#54824)
Tom Deseyn [Tue, 29 Jun 2021 13:43:24 +0000 (15:43 +0200)]
InternalCanonicalizeRealPath: don't call strstr with uninitialized lpBuffer. (#54824)

3 years agoFix Connect_DualMode_DnsConnect_RetrievedEndPoints_Success on Linux (#54681)
Anton Firszov [Tue, 29 Jun 2021 13:03:09 +0000 (15:03 +0200)]
Fix Connect_DualMode_DnsConnect_RetrievedEndPoints_Success on Linux (#54681)

3 years agoAvoid allocating unused prefix/localName in XmlCharCheckingReader.ValidateQName ...
Stephen Toub [Tue, 29 Jun 2021 12:05:01 +0000 (08:05 -0400)]
Avoid allocating unused prefix/localName in XmlCharCheckingReader.ValidateQName (#54836)

3 years agoEnable Http2_MultipleConnectionsEnabled_InfiniteRequestsCompletelyBlockOneConnection_...
Alexander Nikolaev [Tue, 29 Jun 2021 11:51:20 +0000 (13:51 +0200)]
Enable Http2_MultipleConnectionsEnabled_InfiniteRequestsCompletelyBlockOneConnection_RemaningRequestsAreHandledByNewConnection test (#54683)

Fixes #45204

3 years agoFound a race condition where the LOH flag on a segment is set too late. This gives...
Peter Sollich [Tue, 29 Jun 2021 07:15:59 +0000 (09:15 +0200)]
Found a race condition where the LOH flag on a segment is set too late. This gives another thread the chance to allocate in a fresh LOH region that doesn't have the LOH flag set just yet and trip over an assert in Object::ValidateInner. (#54839)

The fix is simply to set the flag in get_new_region before the region is put on the list for the LOH generation.

3 years agoStressLogAnalyzer didn't print the number of messages correctly if it exceeded the...
Peter Sollich [Tue, 29 Jun 2021 07:05:28 +0000 (09:05 +0200)]
StressLogAnalyzer didn't print the number of messages correctly if it exceeded the int range (2 billion). (#54832)

Fix is to just use 64 bit ints instead.

3 years agoadd System.Net.MsQuic.Transport as dependency for Windows build (#54851)
Tomas Weinfurt [Tue, 29 Jun 2021 06:50:32 +0000 (08:50 +0200)]
add System.Net.MsQuic.Transport as dependency for Windows build (#54851)

3 years agoFix unreached during dump. (#54861)
Sergey Andreenko [Mon, 28 Jun 2021 23:37:06 +0000 (16:37 -0700)]
Fix unreached during dump. (#54861)

3 years agoFix lowering usage of an unset LSRA field. (#54731)
Sergey Andreenko [Mon, 28 Jun 2021 22:33:32 +0000 (15:33 -0700)]
Fix lowering usage of an unset LSRA field. (#54731)

* Add repro.

* fix the issue.

* delete a dead condition

* add a todo.

* Fix the failures.

3 years agoFix setting breakpoints on AVX 256 instructions and other 32 byte immediate instructi...
Juan Hoyos [Mon, 28 Jun 2021 21:33:51 +0000 (14:33 -0700)]
Fix setting breakpoints on AVX 256 instructions and other 32 byte immediate instructions (#54786)

3 years agoAdd perf_slow yaml (#54853)
Aaron Kunkle [Mon, 28 Jun 2021 21:24:57 +0000 (14:24 -0700)]
Add perf_slow yaml (#54853)

3 years agoFaster type load for scenarios made more common by generic math (#54588)
David Wrighton [Mon, 28 Jun 2021 20:10:56 +0000 (13:10 -0700)]
Faster type load for scenarios made more common by generic math (#54588)

Change interface map layout in two interesting ways
1. For interface maps defined in System.Private.CoreLib, rely on the C# compiler to prevent any ambiguous duplicates, and to find the full interface expansion, instead of expanding it within the type loader See code marked with #SpecialCorelibInterfaceExpansionAlgorithm
- Note that this optimization is only applied for ValueTypes as the presence of inheritance makes the optimization much more complex in many cases, and isn't needed.
- This optimization reduces the amount of parsing of the interface implementation table must be done for valuetypes in CoreLib. In particular, with the new interfaces that are added as part of #54650 there is a very deep interface hierarchy that requires a great deal of scanning. As those interfaces are added to all the primitive types, the impact on startup performance is significant and measurable.
2. For interface map expansion that follows the curiously recurring generic pattern, place the open instantiation of the type in the interface map instead of the the exact instantiation, and update all places in the runtime which consider the interface map to deal with that change (Mostly by adding special purpose logic to work with the special marker type in the interface map, but there is also logic to simply force the exact interface type to be loaded, when working with the partially loaded type is not quite good enough, or excessively complex)
- This optimization reduces the set of interface types that need to be loaded if they are unused. Of particular benefit are the numerous interfaces associated with the primitive types that are added as part of #54650.

Performance of launching an extremely simple .NET process (process with empty main method). Results acquired using local testing on my developer machine, using a simple script that launches the process 500 times in a row.

| Before #54650 | After #54650 | After #54650 and #54588 (this pr) |
| :-: | :-: | :-: |
| 14.1ms | 16.5ms |14.3ms |

3 years agoMake sure we consider buffer length when marshalling back Unicode ByValTStr fields...
Jeremy Koritzinsky [Mon, 28 Jun 2021 19:41:39 +0000 (12:41 -0700)]
Make sure we consider buffer length when marshalling back Unicode ByValTStr fields (#54695)

* Use string constructor that takes length instead of the one that searches for a null terminator.

Fixes #54662

* Marshal back buffer size or string to first null terminator, whichever is shorter

* Add tests.

* Add unicode test.

* Use the same implementation style for the wstr case case as the cstr case

* Fix accidental deletion from test.

3 years agoAdd YieldProcessor implementation for arm (#54829)
Gleb Balykov [Mon, 28 Jun 2021 18:16:44 +0000 (21:16 +0300)]
Add YieldProcessor implementation for arm (#54829)

3 years agoRemove ActiveIssue for #50968 (#54831)
Larry Ewing [Mon, 28 Jun 2021 18:12:08 +0000 (13:12 -0500)]
Remove ActiveIssue for #50968 (#54831)

3 years agoEnable System.Text.Json tests for Wasm AOT (#54833)
Larry Ewing [Mon, 28 Jun 2021 18:11:30 +0000 (13:11 -0500)]
Enable System.Text.Json tests for Wasm AOT (#54833)

3 years agoRemove ActiveIssue for #51723 (#54830)
Larry Ewing [Mon, 28 Jun 2021 18:04:55 +0000 (13:04 -0500)]
Remove ActiveIssue for #51723 (#54830)

3 years agoFix load exception on generic covariant return type (#54790)
Wei Zheng [Mon, 28 Jun 2021 17:51:46 +0000 (01:51 +0800)]
Fix load exception on generic covariant return type (#54790)

3 years agoObsolete X509Certificate2.PrivateKey and PublicKey.Key. (#54562)
Kevin Jones [Mon, 28 Jun 2021 16:59:06 +0000 (12:59 -0400)]
Obsolete X509Certificate2.PrivateKey and PublicKey.Key. (#54562)

The two properties got different diagnostic IDs so that the messages could better reflect the caller recovery action.

3 years agoFirst round of converting System.Drawing.Common to COMWrappers (#54636)
Eric Erhardt [Mon, 28 Jun 2021 16:39:17 +0000 (10:39 -0600)]
First round of converting System.Drawing.Common to COMWrappers (#54636)

* First round of converting System.Drawing.Common to COMWrappers

Using COM Wrappers makes the library trim compatible.

* Add Trimming Test for Icon.Save

* Add support for OS specific trimming tests

* Use function pointers instead of delegates
* Rename Guid to IID
* Better interop to closely match the native side
* Release any COM pointer that was QueryInterface
* Use pointers instead of Marshal.PtrToStructure/StructureToPtr
* No need for a VTable struct, just set each function pointer right into the table
* Wrap all managed calls in try-catch and return HResult
* Use COM naming
* Fix method signature to use pointer instead of out.
* CheckStatus => ThrowExceptionForHR

* Pass -1 to Marshal.GetExceptionForHR so it doesn't query GetErrorInfo, and always returns the correct exception type
* Create the PictureWrapper with UniqueInstance, so it doesn't get cached. Caching it causes lifetime issues.

3 years agoFix alloc-dealloc mismatches (#54701)
Jeremy Koritzinsky [Mon, 28 Jun 2021 16:32:11 +0000 (09:32 -0700)]
Fix alloc-dealloc mismatches (#54701)

3 years agoAdd one-shot ECB methods
Kevin Jones [Mon, 28 Jun 2021 15:55:27 +0000 (11:55 -0400)]
Add one-shot ECB methods

This change adds SymmetricAlgorithm.EncryptEcb, SymmetricAlgorithm.DecryptEcb, their
respective Try- and -Core methods, derived type implementations thereof, and tests.

There's an open question of should these members on on the base class throw or
"succeed if the Mode property is in agreement with the algorithm".  While the latter is "nicer",
just throwing  is easier to reason about, and that's the current behavior.

Co-authored-by: Jeremy Barton <jbarton@microsoft.com>
3 years ago[Mono] MSBuild Task housekeeping (#54485)
Maxim Lipnin [Mon, 28 Jun 2021 15:19:52 +0000 (18:19 +0300)]
[Mono] MSBuild Task housekeeping (#54485)

- added TargetFrameworkForNETCoreTasks property similar to NetCoreAppToolCurrent one as NetCoreAppToolCurrent will likely bump more aggressively between new sdks;
- renamed TargetFrameworkForNETFramework to TargetFrameworkForNETFrameworkTasks.

3 years agoMove iOS/tvOS simulator AOT imports in the Mono workload (#54821)
Steve Pfister [Mon, 28 Jun 2021 14:50:46 +0000 (10:50 -0400)]
Move iOS/tvOS simulator AOT imports in the Mono workload (#54821)

The condition on the import group for the iOS and tvOS simulators was not valid since iOS/tvOSSimulator is not a `TargetPlatformIdentifier`. To simplify, the simulator imports were moved under iOS/tvOS.

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

Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
3 years agoRemove unnecessary char[] allocation from Uri.GetRelativeSerializationString (#54799)
Stephen Toub [Mon, 28 Jun 2021 14:46:21 +0000 (10:46 -0400)]
Remove unnecessary char[] allocation from Uri.GetRelativeSerializationString (#54799)

3 years agoReduce overhead of Enumerable.Chunk (#54782)
Stephen Toub [Mon, 28 Jun 2021 14:42:53 +0000 (10:42 -0400)]
Reduce overhead of Enumerable.Chunk (#54782)

Avoid passing the array by ref and yielding inside the loop, which defeat various optimizations (e.g. bounds checking elimination).

3 years agoFix EnumMemberRefs always returning NULL (#54805)
Tom Deseyn [Mon, 28 Jun 2021 12:57:30 +0000 (14:57 +0200)]
Fix EnumMemberRefs always returning NULL (#54805)

3 years ago[mono][debugger] Insert and search seq_point in the same MonoJitMemoryManager (#54757)
Thays Grazia [Mon, 28 Jun 2021 12:44:05 +0000 (09:44 -0300)]
[mono][debugger] Insert and search seq_point in the same MonoJitMemoryManager (#54757)

* [mono][debugger] Fixing side effect of #48483

When starting XAML Hot Reload, in transform.c the seq_point was saved using jit_mm_for_method: https://github.com/thaystg/runtime/blob/abccfadbf570033efee8ac9a6992f6f7ee51f474/src/mono/mono/mini/interp/transform.c#L9760
When trying to search was trying on get_default_jit_mm.

* Fixing everywhere that uses seq_points.

* Not used.

* Revert "Not used."

This reverts commit fd7f2061b40436300abdcc919705b56af53f4ca0.

* Revert "Fixing everywhere that uses seq_points."

This reverts commit 6faffb8c92a1c9be17d8c53d5f735075b9212220.

* Revert "[mono][debugger] Fixing side effect of #48483"

This reverts commit 44601d310bd5ca1929604af5e0b96436b416ced8.

* Always use get_default_jit_mm for seq_points.

* Adding a test case and fixing wasm debugging on ALC.

* Moving implementation to avoid changing line number

* Update src/mono/wasm/debugger/DebuggerTestSuite/Tests.cs

Co-authored-by: Larry Ewing <lewing@microsoft.com>
* Update src/mono/wasm/debugger/DebuggerTestSuite/Tests.cs

Co-authored-by: Larry Ewing <lewing@microsoft.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
3 years agoAvoid per-XmlSchemaValidator PositionInfo allocation (#54356)
Stephen Toub [Mon, 28 Jun 2021 08:31:45 +0000 (04:31 -0400)]
Avoid per-XmlSchemaValidator PositionInfo allocation (#54356)

It can easily use a static singleton, as the instance is immutable and exists purely to provide a "I don't have line info" / (0,0) value if anyone queries for position.

3 years ago[mono] Intrinsify inequality comparision between runtime types (#54602)
Vlad Brezae [Mon, 28 Jun 2021 06:39:32 +0000 (09:39 +0300)]
[mono] Intrinsify inequality comparision between runtime types (#54602)

This is needed because, when inlining op_Inequality, the information on whether the arguments are runtime types gets lost. We should track that information instead when inlining, but it is a more invasive change.

3 years agoUse Empty instead of null for DCS deserializing namespace. (#54670)
Steve Molloy [Mon, 28 Jun 2021 01:24:35 +0000 (18:24 -0700)]
Use Empty instead of null for DCS deserializing namespace. (#54670)

3 years agoFix missing entrypoints and add build-time validation (#54785)
Kevin Jones [Mon, 28 Jun 2021 01:04:20 +0000 (21:04 -0400)]
Fix missing entrypoints and add build-time validation (#54785)

* Fix missing entrypoints and add build-time validation

* Fix missing include

* Update src/libraries/Native/Unix/System.Security.Cryptography.Native.Apple/CMakeLists.txt

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
3 years agoDo not timeout HostingListener when debugging (#54791)
Martin Costello [Sun, 27 Jun 2021 17:21:13 +0000 (18:21 +0100)]
Do not timeout HostingListener when debugging (#54791)

Do not timeout waiting for the host to start when running with
the debugger attached.

Addresses dotnet/aspnetcore#33886.

3 years agoFix MacOS build on 11.x SDK and Catalyst build (#54506)
Jan Vorlicek [Sun, 27 Jun 2021 15:13:46 +0000 (17:13 +0200)]
Fix MacOS build on 11.x SDK and Catalyst build (#54506)

* Fix MacOS build on 11.x SDK and Catalyst build

The configure.cmake was not getting the minimum supported OS version because
it was being set via set_compile_options and the config functions can only
get options from CMAKE_XXX_FLAGS.

* Add comment explaining why we set the macOS options via CMAKE_XXX_FLAGS

3 years agoMake DependentHandle public (#54246)
Sergio Pedri [Sat, 26 Jun 2021 21:22:09 +0000 (23:22 +0200)]
Make DependentHandle public (#54246)

* Move DependentHandle to System.Runtime

* Update DependentHandle APIs to follow review

* Make DependentHandle type public

* Update DependentHandle on Mono runtime

* Add allocation checks to DependentHandle APIs

This avoids throwing ExecutionEngineException-s if one of the public APIs is called on a non-allocated DependentHandle instance

* Add more unit tests for new public DependentHandle APIs

* Add faster, unsafe internal APIs versions to DependentHandle

* Naming improvements to Ephemeron type

The ephemeron type is checked in the Mono runtime in "object.c" as follows:

m_class_get_image (klass) == mono_defaults.corlib && !strcmp ("Ephemeron", m_class_get_name (klass))

As such, the namespace it belongs to in the managed runtime doesn't matter: the VM will just check
that the type name matches, and that the type is in fact defined in corelib. This means we can
just move it to System.Runtime without worrying about it being properly managed in the VM.
Additionally, the type is defined in "sgen-mono.c" as follows:

typedef struct {
    GCObject* key;
    GCObject* value;
} Ephemeron;

So as long as the layout matches the one of the type defined in C# (which it does), we're also free
to rename the fields to better follow the naming guidelines, and the VM will have no issues with it.

* Code style tweaks, improved nullability annotations

* Remove incorrect DependentHandle comment on Mono

* Add default Dispose test for DependentHandle

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Fix race condition in DependentHandle on Mono

* Optimize DependentHandle.nGetPrimary on CoreCLR

Removed internal call, same optimization as GCHandle

* Small IL codegen improvement in DependentHandle.nGetPrimary

* Simplify comments, add #ifdef for using directive

* Minor code style tweaks

* Change nGetPrimaryAndSecondary to nGetSecondary

* Minor code refactoring to DependentHandle on Mono

* Rename DependentHandle FCalls

* Remove DependentHandle.UnsafeGetTargetAndDependent

* Remove DependentHandle.GetTargetAndDependent

* Fix FCall path for internal DependentHandle APIs

* Add more DependentHandle unit tests

* Reintroduce DependentHandle.GetTargetAndDependent()

This fixes a bug due to a race condition in ConditionalWeakTable<K, V>, which relies on this method which atomically retrieves both target and dependent with respect to target being set to null concurrently by other threads. This also exposes the same API publically to allow consumers to potentially implement custom conditional weak tables in the same manner.

* Minor IL tweaks to produce smaller IR in the JIT

* Add DependentHandle.StopTracking() API

This also fixes two potential GC holes when setting DependentHandle.Target (see conversation from https://github.com/dotnet/runtime/pull/54246#issuecomment-863285327 onwards)

* Rename InternalSetTarget to StopTracking, remove redundant param

* Remove FCUnique from InternalStopTracking

This was added in https://github.com/dotnet/runtime/pull/39810 to avoid a collision with MarshalNative::GCHandleInternalSet, as the two FCalls had identical implementations and their entry points were not unique. This should no longer be needed after 099fc478551f46cc54e7a18a32d9a9ac73727c73, as that changed both the signature and the implementation of this FCall.

* Update API surface to match approved specs from API review

* Update DependentHandle XML docs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoMore file stream options tests (#53982)
Adam Sitnik [Sat, 26 Jun 2021 21:20:32 +0000 (23:20 +0200)]
More file stream options tests (#53982)

* add more tests

* StreamWriter and StreamReader require FileStreamOptions with necessary access

* allow for bufferSize == 0

* extend the test

* refactor the tests

* Revert "allow for bufferSize == 0"

This reverts commit f1259be18a3446c1b8939883f484cc28347c74cf.