platform/upstream/dotnet/runtime.git
3 years agoAdd AOT support for the EntryPoint property for UnmanagedCallersOnly. (#44809)
Zoltan Varga [Thu, 19 Nov 2020 10:24:37 +0000 (05:24 -0500)]
Add AOT support for the EntryPoint property for UnmanagedCallersOnly. (#44809)

* Change mono_reflection_create_custom_attr_data_args_noalloc () so it returns the beginning of the metadata string so its length can be computed.

* Add AOT support for the EntryPoint property for UnmanagedCallersOnly.

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

* Update src/mono/mono/mini/driver.c

Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
3 years agoFix s390x unwinding and remove need for backchain pointer (#44927)
monojenkins [Thu, 19 Nov 2020 08:46:51 +0000 (03:46 -0500)]
Fix s390x unwinding and remove need for backchain pointer (#44927)

Fix unwinding for s390x. Removes the `-mbackchain` flag that had been used in the past when unwinding stack frames but has not been required for sometime. This should also improve performance.

Co-authored-by: nealef <nealef@users.noreply.github.com>
3 years agoUse simple array for AggregateException inner exceptions storage (#44787)
Marek Safar [Thu, 19 Nov 2020 08:23:17 +0000 (09:23 +0100)]
Use simple array for AggregateException inner exceptions storage (#44787)

* Use simple array for AggregateException inner exceptions storage

* Replace cases which called into InnerExceptions inside SPC

* Update src/libraries/System.Private.CoreLib/src/System/AggregateException.cs

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Fix typo

Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoFix regression in XDocumentType (#44868)
Krzysztof Wicher [Thu, 19 Nov 2020 08:16:00 +0000 (09:16 +0100)]
Fix regression in XDocumentType (#44868)

3 years agoEnsure Debugging assets are signed. (#44915)
Juan Hoyos [Thu, 19 Nov 2020 06:10:51 +0000 (22:10 -0800)]
Ensure Debugging assets are signed. (#44915)

3 years agoSync SPC File.cs implementation with full the implementation in SIF (#44902)
Marek Safar [Thu, 19 Nov 2020 04:39:01 +0000 (05:39 +0100)]
Sync SPC File.cs implementation with full the implementation in SIF (#44902)

3 years agoFix ListSeparator with ICU (#44732)
Tarek Mahmoud Sayed [Thu, 19 Nov 2020 03:20:17 +0000 (19:20 -0800)]
Fix ListSeparator with ICU (#44732)

3 years agoFor x86/x64, call a stack probe helper for all frame sizes equal or over one page...
Egor Chesakov [Thu, 19 Nov 2020 01:39:27 +0000 (17:39 -0800)]
For x86/x64, call a stack probe helper for all frame sizes equal or over one page (#44664)

3 years agoVerify that OCSP and CRL checks fall back.
Kevin Jones [Thu, 19 Nov 2020 01:18:12 +0000 (20:18 -0500)]
Verify that OCSP and CRL checks fall back.

Test that a CRL timeout chain build will use OCSP, and that an OCSP timeout chain build will use CRL.

3 years agoChange gtGetThisArg not to return nullptr. (#44398)
Sergey Andreenko [Thu, 19 Nov 2020 00:40:54 +0000 (14:40 -1000)]
Change gtGetThisArg not to return nullptr. (#44398)

* Don't wrap string literal const as nop for CoreRT.

It was probably an old workaround for another Jit bug, it is most likely fixed by now.

* Change `gtGetThisArg` not to return `nullptr`.

There was only 1 case where a null return was tolerated - for a tail call in `optAssertionGen` marked as virtual.
However, a transformed tail call is never a virtual, fix `fgMorphTailCallViaJitHelper` to unset virtual flag.

* Keep x86 tail call via jit helper as a virtual stub call.

3 years agoMake minor change to corinfo.h to test SuperPMI AzDO job trigger (#44893)
Bruce Forstall [Wed, 18 Nov 2020 23:50:37 +0000 (15:50 -0800)]
Make minor change to corinfo.h to test SuperPMI AzDO job trigger (#44893)

3 years agoFix illumos managed build (#44386)
Adeel Mujahid [Wed, 18 Nov 2020 23:47:03 +0000 (01:47 +0200)]
Fix illumos managed build (#44386)

* Fix illumos managed build
* Fix CA1823 (unused private field) in `NetworkChange` partial for
  `UnknownUnix`.
* Use official casing `illumos` in MSBuild property names (as done for
  iOS).
* Fix Solaris version in test with SDK's PlatformDetection.
  * only major version is needed.

* Implement Enviornment.WorkingSet for SunOS
Difference between Linux and SunOS procfs is that files in latter
contain binary data, so we need `read(2)` and cast into corresponding
struct. Redeclaring system structs in managed code is not ideal, as
they do change across the major versions of OS, which inevitably
requires recompilation of binaries and replicating them in C# as is
means additional/unnecessary maintenance of code.

* Address CR feedback

3 years agoImprove dumping GC info in R2RDump (#44857)
Anton Lapounov [Wed, 18 Nov 2020 23:24:32 +0000 (15:24 -0800)]
Improve dumping GC info in R2RDump (#44857)

The --raw command-line option used to dump bytes prefixed with their RVAs for all structures except GC blobs, which were dumped with file offsets instead. This change fixes that inconsistency. It also fixes the size reported by x86.GcInfo, which determines how many bytes to dump. In addition I simplified ReadyToRunMethod's code to store just the GC blob's RVA and avoid the delegate allocation.

3 years agoFix discuss #44785:optimize constructor of ElapsedEventArgs (#44853)
LeaFrock [Wed, 18 Nov 2020 23:17:17 +0000 (07:17 +0800)]
Fix discuss #44785:optimize constructor of ElapsedEventArgs (#44853)

* optimize constructor of ElapsedEventArgs

* delete the old ctor

3 years agoAdd test for Timer.Elapsed DateTime (#44881)
Stephen Toub [Wed, 18 Nov 2020 23:06:12 +0000 (18:06 -0500)]
Add test for Timer.Elapsed DateTime (#44881)

3 years agoRemove unnecessary GetTypeInfo from Microsoft.Extensions. (#44891)
Eric Erhardt [Wed, 18 Nov 2020 22:57:23 +0000 (16:57 -0600)]
Remove unnecessary GetTypeInfo from Microsoft.Extensions. (#44891)

I also made a slight optimization to CallSiteFactory to use ToArray instead of ToList.

3 years agoDelete now unused target in crossgen2.csproj. (#44888)
Jeremy Koritzinsky [Wed, 18 Nov 2020 22:41:58 +0000 (14:41 -0800)]
Delete now unused target in crossgen2.csproj. (#44888)

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
3 years agoRemove some allocations from ManifestBuilder.CreateManifestString (#44532)
Stephen Toub [Wed, 18 Nov 2020 22:39:56 +0000 (17:39 -0500)]
Remove some allocations from ManifestBuilder.CreateManifestString (#44532)

For the RuntimeEventSource, this removes around 30K of allocation, though that's only ~3% of what gets allocated.

3 years agoFix nullable annotations on HttpClient.Post/Put/PatchAsync (#44880)
Stephen Toub [Wed, 18 Nov 2020 22:21:45 +0000 (17:21 -0500)]
Fix nullable annotations on HttpClient.Post/Put/PatchAsync (#44880)

Null content is allowed.

3 years agoFix ComponentDocumentDesigner references in DesignerAttribute to include right base...
Santiago Fernandez Madero [Wed, 18 Nov 2020 21:37:41 +0000 (13:37 -0800)]
Fix ComponentDocumentDesigner references in DesignerAttribute to include right base type (#44774)

* Fix IComponent Designer attribute that was missing base designer type

* Fix IRootDesigner references to use assembly qualified name

* Fix build failures

3 years agoChange SuperPMI collection to not use altjit mechanism (#44834)
Bruce Forstall [Wed, 18 Nov 2020 21:18:14 +0000 (13:18 -0800)]
Change SuperPMI collection to not use altjit mechanism (#44834)

* Change SuperPMI collection to not use altjit mechanism

The SuperPMI collection process interposes a "shim" JIT between the JIT and EE.
As it is inconvenient to physically replace the existing JIT, currently this
is done by enabling altjit compilation and setting `COMPlus_AltJitName` to the
name of the shim JIT. This creates other inconvenience, especially with the
new way of saving the altjit flag in the JIT flags, by requiring us to
force the altjit flags bit to not be set, and force unset all the altjit flags.
It also makes it inconvenient to collect and/or replay with an actual altjit.

Change this collection mechanism to use the newly restored `COMPlus_JitName`
variable to allow specifying the JIT, and use that to specify the SuperPMI shim.

In addition, do not record in the MC file the `COMPlus_EnableExtraSuperPmiQueries`
variable. This is only used during collections to attempt to make replays more
flexible, but we never want to tell the JIT during replay that this is set.

* Enable `COMPlus_JitName` for crossgen as well

* Fix issue with empty collection args

3 years agoAvoid string.Split in LoggerRuleSelector.IsBetter (#44753)
Stephen Toub [Wed, 18 Nov 2020 20:02:11 +0000 (15:02 -0500)]
Avoid string.Split in LoggerRuleSelector.IsBetter (#44753)

3 years agoRemove closure allocations from ServiceCollectionDescriptorExtensions (#44696)
Ben Adams [Wed, 18 Nov 2020 19:25:34 +0000 (19:25 +0000)]
Remove closure allocations from ServiceCollectionDescriptorExtensions (#44696)

3 years agoRestore the Microsoft.NETCore.DotNetAppHost package since the SDK transitively uses...
Jeremy Koritzinsky [Wed, 18 Nov 2020 19:07:06 +0000 (11:07 -0800)]
Restore the Microsoft.NETCore.DotNetAppHost package since the SDK transitively uses it through the Microsoft.NETCore.DotNetHostResolver package. (#44883)

3 years agoAvoid string.Concat(params string[]) in SimpleConsoleFormatter.CreateDefaultLogMessag...
Stephen Toub [Wed, 18 Nov 2020 17:41:24 +0000 (12:41 -0500)]
Avoid string.Concat(params string[]) in SimpleConsoleFormatter.CreateDefaultLogMessage (#44765)

It's resulting in a string[] allocation and a string allocation, when we can instead just make a few more individual calls to Write and stackalloc the integer.

3 years agoGetUninitializedObject fixes & improved tests (#44843)
Levi Broderick [Wed, 18 Nov 2020 17:38:30 +0000 (09:38 -0800)]
GetUninitializedObject fixes & improved tests (#44843)

* Improve unit test coverage for GetUninitializedObject
* Normalize most checks between coreclr and mono

3 years agoRemove most LINQ usage from Microsoft.Extensions.Configuration (#44825)
Stephen Toub [Wed, 18 Nov 2020 17:13:45 +0000 (12:13 -0500)]
Remove most LINQ usage from Microsoft.Extensions.Configuration (#44825)

Resulting in several hundred Func, IEnumerable, set, and string allocations at startup.

3 years agoFix a comment in the bundle marker (#44874)
Vitek Karas [Wed, 18 Nov 2020 16:21:05 +0000 (08:21 -0800)]
Fix a comment in the bundle marker (#44874)

3 years ago[browser][wasm] Cleanup debug statement (#44870)
Kenneth Pouncey [Wed, 18 Nov 2020 16:14:23 +0000 (17:14 +0100)]
[browser][wasm] Cleanup debug statement (#44870)

3 years agoRemove unnecessary suppression (#44811)
Rikki Gibson [Wed, 18 Nov 2020 15:16:49 +0000 (07:16 -0800)]
Remove unnecessary suppression (#44811)

3 years agoUse read-only auto-implemented property (#44677)
xtqqczze [Wed, 18 Nov 2020 13:37:25 +0000 (13:37 +0000)]
Use read-only auto-implemented property (#44677)

* Use read-only auto-implemented property in src\libraries\Common

Use read-only auto-implemented property (RCS1170)

https://github.com/JosefPihrt/Roslynator/blob/master/docs/analyzers/RCS1170.md

* Revert changes except to ComEventsMethod

3 years agoIntegrate misc fixes from dotnet/runtimelab:NativeAOT (#44851)
Jan Kotas [Wed, 18 Nov 2020 13:00:29 +0000 (05:00 -0800)]
Integrate misc fixes from dotnet/runtimelab:NativeAOT (#44851)

3 years agofew minor MemoryCache perf improvements (#44797)
Adam Sitnik [Wed, 18 Nov 2020 12:30:04 +0000 (13:30 +0100)]
few minor MemoryCache perf improvements (#44797)

* make ValidateCacheKey and CheckDisposed inlinable by moving throws to separate methods

* ensure that the check for expiration does not require a method call for the most common case

* update the last expiration scan when the Scan Task starts actual work

* Apply suggestions from code review

Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years ago[master] Update dependencies from dotnet/arcade (#44835)
dotnet-maestro[bot] [Wed, 18 Nov 2020 10:49:34 +0000 (11:49 +0100)]
[master] Update dependencies from dotnet/arcade (#44835)

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

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

* Update global.json

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
Co-authored-by: Juan Hoyos <juan.hoyos@microsoft.com>
3 years agoFix decoding GC information in R2RDump (#44682)
Anton Lapounov [Wed, 18 Nov 2020 05:46:24 +0000 (21:46 -0800)]
Fix decoding GC information in R2RDump (#44682)

3 years agoEnable nullable annotations for M.E.L.Abstractions (#43892)
Maryam Ariyan [Wed, 18 Nov 2020 04:50:05 +0000 (20:50 -0800)]
Enable nullable annotations for M.E.L.Abstractions (#43892)

* Enable nullable annotations for M.E.L.Abstractions

* Corrections from review

* LoggerExtensions.cs: params object?[] -> params object?[]

* using Nullable Annotations,
to allow annotations on relevant projects, not yet enabled

* formatter not null

3 years agoFix NRE when default value is null and ServiceCallSite is not found (#44675)
Maryam Ariyan [Wed, 18 Nov 2020 04:33:27 +0000 (20:33 -0800)]
Fix NRE when default value is null and ServiceCallSite is not found (#44675)

* Fix NRE when default value is null and ServiceCallSite is not found

3 years agoMake $(TargetOS) lowercase windows in eng/coredistools.target (#44845)
Egor Chesakov [Wed, 18 Nov 2020 04:05:37 +0000 (20:05 -0800)]
Make $(TargetOS) lowercase windows in eng/coredistools.target (#44845)

* Make $(TargetOS) lowercase windows in eng/coredistools.target

* Make $(TargetOS) lowercase windows in src/tests/Common/Directory.Build.targets

3 years agoUpdate nullability on some LINQ expression methods (#44844)
Smit Patel [Wed, 18 Nov 2020 02:25:01 +0000 (18:25 -0800)]
Update nullability on some LINQ expression methods (#44844)

- MethodCallExpression can take nullable instance when static method
- LambdaExpression.Update does not return null in any case

Resolves #44821
Resolves #44822

3 years agoTrigger SuperPMI collection pipeline if JIT-EE GUID changes (#44846)
Bruce Forstall [Wed, 18 Nov 2020 02:02:00 +0000 (18:02 -0800)]
Trigger SuperPMI collection pipeline if JIT-EE GUID changes (#44846)

Changing the JIT-EE GUID invalidates previous SuperPMI collections,
necessitating a re-collection. As a proxy for determining whether
the JIT-EE GUID has changed, just trigger anytime the corinfo.h file
changes.

3 years ago[wasm] Use the functions in emscripten/stack.h to compute stack bounds. (#44819)
monojenkins [Wed, 18 Nov 2020 01:38:57 +0000 (20:38 -0500)]
[wasm] Use the functions in emscripten/stack.h to compute stack bounds. (#44819)

Co-authored-by: vargaz <vargaz@users.noreply.github.com>
3 years agoFix building host lineup packages. (#44839)
Jeremy Koritzinsky [Wed, 18 Nov 2020 00:42:03 +0000 (16:42 -0800)]
Fix building host lineup packages. (#44839)

* Fix building host lineup packages.

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
* Update src/installer/pkg/projects/host-packages.proj

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
3 years agoRestore Snapcraft files. (#44812)
Jeremy Koritzinsky [Tue, 17 Nov 2020 22:57:38 +0000 (14:57 -0800)]
Restore Snapcraft files. (#44812)

3 years agoFix non-thread-safe EntityTagHeaderValue.Any (#44802)
Stephen Toub [Tue, 17 Nov 2020 22:56:28 +0000 (17:56 -0500)]
Fix non-thread-safe EntityTagHeaderValue.Any (#44802)

* Fix non-thread-safe EntityTagHeaderValue.Any

It was being published before fully populated.

* Address PR feedback

* Update EntityTagHeaderValue.cs

3 years agoReturn pooled arrays in Regex.Replace when no replacements (#44833)
Stephen Toub [Tue, 17 Nov 2020 22:55:53 +0000 (17:55 -0500)]
Return pooled arrays in Regex.Replace when no replacements (#44833)

When Regex.Replace doesn't actually need to replace anything, we're inadvertently not returning a previously rented ArrayPool array to the pool.  On repeated use, that drains the pool of the desired size, such that every attempt ends up allocating a new array, even if there are no replacements to be made.

The fix is to lazily rent from the pool.  This not only fixes the problem, but helps perf further by not taking the rental cost unless we actually need an array to store a replacement segment.

3 years agoRemove some overhead from Process.Start (#44691)
Stephen Toub [Tue, 17 Nov 2020 22:48:19 +0000 (17:48 -0500)]
Remove some overhead from Process.Start (#44691)

- Avoid StringBuilder marshaling
- Let CreateProcess{WithLogonW} determine the current working directory
- Avoid creating SafeHandles for GetCurrentProcess()
- Avoid forcing ProcessStartInfo.ArgumentList into existence just to check if it contains anything
- Prefer using ProcessStartInfo.Arguments in Start(string, IEnumerable<string>) if there's only one string in the enumerable
- Use ValueStringBuilder instead of StringBuilder to build up arguments, so as to use stack space / pooled char[]s and avoid actually needing to produce strings.
- Avoid unnecessary SafeHandle for PROCESS_INFORMATION.hThread

3 years agoUpdate archives package to fix zip/tar naming. (#44827)
Jeremy Koritzinsky [Tue, 17 Nov 2020 22:24:40 +0000 (14:24 -0800)]
Update archives package to fix zip/tar naming. (#44827)

3 years agoRemove HashProviderDispenser.Android.cs (#44814)
Egor Bogatov [Tue, 17 Nov 2020 22:20:57 +0000 (14:20 -0800)]
Remove HashProviderDispenser.Android.cs (#44814)

3 years ago[Android] Add ability to set env vars via command line (#44644)
Egor Bogatov [Tue, 17 Nov 2020 22:20:28 +0000 (14:20 -0800)]
[Android] Add ability to set env vars via command line (#44644)

3 years agoHandle unicode and e-notation differences between S.T.J and J.N tests (#35042)
Marcus Turewicz [Tue, 17 Nov 2020 21:55:51 +0000 (08:55 +1100)]
Handle unicode and e-notation differences between S.T.J and J.N tests (#35042)

* Handle unicode and e-notation differences between S.T.J and J.N tests

Fixes #32350

* Remove TODO

* Bumping CI

* Bump CI

* Handle relaxed escaping and precision properly

* Move else if

* Move else if back

* Remove relaxedEscaping param and skip whitespace

* Apply Jozkee final touches

* Add missing period

Co-authored-by: David Cantu <dacantu@microsoft.com>
3 years agoAdd the emscripten version to the wasm runtime pack and check it at app build time...
Zoltan Varga [Tue, 17 Nov 2020 21:53:55 +0000 (16:53 -0500)]
Add the emscripten version to the wasm runtime pack and check it at app build time when relinking the wasm runtime. (#44715)

* Add the emscripten version to the wasm runtime pack and check it at app build time when relinking the wasm runtime.

* Update src/mono/wasm/Makefile

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
3 years agoSigning cleanup (#44658)
Jeremy Koritzinsky [Tue, 17 Nov 2020 20:30:05 +0000 (12:30 -0800)]
Signing cleanup (#44658)

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
3 years agoFix the culture parent chain for zh-Han[s|t]-* (#44737)
Tarek Mahmoud Sayed [Tue, 17 Nov 2020 19:08:18 +0000 (11:08 -0800)]
Fix the culture parent chain for zh-Han[s|t]-* (#44737)

3 years agoOptimize HelloWorld usage (#44711)
Andrew Au [Tue, 17 Nov 2020 18:36:47 +0000 (10:36 -0800)]
Optimize HelloWorld usage (#44711)

3 years agoUse new CoreDisTools package (#44490)
Egor Chesakov [Tue, 17 Nov 2020 18:20:42 +0000 (10:20 -0800)]
Use new CoreDisTools package (#44490)

R2RDump and GCStress use a version of coredistools produced from https://github.com/dotnet/jitutils

3 years agoAdd workflow to update solution files with SlnGen and update them initially (#44703)
Viktor Hofer [Tue, 17 Nov 2020 17:23:30 +0000 (18:23 +0100)]
Add workflow to update solution files with SlnGen and update them initially (#44703)

* Add slngen infra

* Update all solution files

3 years agoAvoid unnecessary LINQ and string joins in JsonConfigurationFileParser (#44734)
Stephen Toub [Tue, 17 Nov 2020 16:37:43 +0000 (11:37 -0500)]
Avoid unnecessary LINQ and string joins in JsonConfigurationFileParser (#44734)

3 years agoEnables the interpreter on Android (#44649)
Steve Pfister [Tue, 17 Nov 2020 16:02:49 +0000 (11:02 -0500)]
Enables the interpreter on Android (#44649)

To enable on tests, you can pass MonoForceInterpreter=true as an extra MSBuild property.

AndroidAppBuilder now has an ForceInterpreter property which will flow the setting down
to the device / simluator.

3 years agoFix full-aot support for unmanaged function pointers. (#44783)
Zoltan Varga [Tue, 17 Nov 2020 15:29:29 +0000 (10:29 -0500)]
Fix full-aot support for unmanaged function pointers. (#44783)

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

3 years agoMake ImmutableArray readonly (#44640)
Huo Yaoyuan [Tue, 17 Nov 2020 13:19:10 +0000 (21:19 +0800)]
Make ImmutableArray readonly (#44640)

* Add reference to Unsafe.

* Mark ImmutableArray as readonly struct.

* Update ImmutableInterlocked to use Unsafe.As.

* Also include S.R.CS.Unsafe for netstandard1.0.

* Add explicit '=default' to avoid CS0649.

* Use Unsafe.AsRef instead of Unsafe.As.

3 years agoAdded condition of empty for concurrent dictionary (#44581)
Shreyas Jejurkar [Tue, 17 Nov 2020 12:56:18 +0000 (18:26 +0530)]
Added condition of empty for concurrent dictionary (#44581)

* Added condition of empty for concurrent dictionary

Collection is already empty why to initialize it again with new emtpy tables.

* Made AreAllBucketsEmpty method private from local function.

Addressed PR feedback.

* Addressed PR feedback.

Comment corrected.

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoDon't use interfaces for sharing Tuple implementation methods (#44684)
Marek Safar [Tue, 17 Nov 2020 12:06:08 +0000 (13:06 +0100)]
Don't use interfaces for sharing Tuple implementation methods (#44684)

3 years agoAvoid string/StringBuilder/char[] allocation in LogValuesFormatter's ctor (#44746)
Stephen Toub [Tue, 17 Nov 2020 10:33:54 +0000 (05:33 -0500)]
Avoid string/StringBuilder/char[] allocation in LogValuesFormatter's ctor (#44746)

This is producing thousands of allocations at ASP.NET startup, due to almost 1000 call sites to LoggerMessage.Define.

3 years agoAdjust Mono EventPipe/DiagnosticServer C library to better support CoreCLR shim....
Johan Lorensson [Tue, 17 Nov 2020 08:24:39 +0000 (09:24 +0100)]
Adjust Mono EventPipe/DiagnosticServer C library to better support CoreCLR shim. (#44527)

* Adjust EventPipe/DiagnosticServer C library to support CoreCLR shim.

Adjustments done to better align with implementation of CoreCLR shim
using CoreCLR artifacts and C++ code (CoreCLR implementation done in
separate PR).

Disconnect runtime specific shim info from shared sources, all included
shim files handled through defines.

Exception safety and improved error handling, adding error checking
and error returns into shim container functions.

Walkthrough of codebase, aligning with gaps from CoreCLR + port of
sample profiler and json file serializer.

Implement core dump diagnostic command and runtime layer (needed by CoreCLR,
currently not implemented on Mono).

Implemented process env diagnostic command and runtime layer.

Implemented profiler attach diagnostic command and runtime layer (needed by
CoreCLR, currently not implemented on Mono).

Fix native EventPipe test aligning with changes.

* Fix build errors.

* Review feedback.

3 years agoRemove use of Tuple<> from corelib (#44706)
Stephen Toub [Tue, 17 Nov 2020 07:23:52 +0000 (02:23 -0500)]
Remove use of Tuple<> from corelib (#44706)

3 years agoRemove ALT_JIT define and replace with runtime logic (#44565)
David Wrighton [Tue, 17 Nov 2020 07:21:59 +0000 (23:21 -0800)]
Remove ALT_JIT define and replace with runtime logic (#44565)

* Remove ALT_JIT define and replace with runtime logic

* Fix SuperPMI for new altjit jit flag

Co-authored-by: Bruce Forstall <brucefo@microsoft.com>
3 years agoReplace Tuples with ValueTuples (#44712)
Stephen Toub [Tue, 17 Nov 2020 06:28:01 +0000 (01:28 -0500)]
Replace Tuples with ValueTuples (#44712)

Some help to remove allocation, some just help to avoid pulling in Tuple and likely increasing build size.

* Update src/libraries/Common/src/System/Security/Cryptography/Pkcs12Kdf.cs

Co-authored-by: Jeremy Barton <jbarton@microsoft.com>
3 years agoSpecial-case zero parameters in GetParameters (#44759)
Stephen Toub [Tue, 17 Nov 2020 06:25:50 +0000 (01:25 -0500)]
Special-case zero parameters in GetParameters (#44759)

3 years agoDrop ReadOnlyCollection dependency from TaskExceptionHolder (#44757)
Marek Safar [Tue, 17 Nov 2020 06:22:47 +0000 (07:22 +0100)]
Drop ReadOnlyCollection dependency from TaskExceptionHolder (#44757)

it's used only to copy data aroud locally

3 years agoRemove unnecessary closure / delegate allocation from CallSiteFactory.GetCallSite...
Stephen Toub [Tue, 17 Nov 2020 06:21:12 +0000 (01:21 -0500)]
Remove unnecessary closure / delegate allocation from CallSiteFactory.GetCallSite (#44755)

Nothing is ever removed from the cache, and CreateCallSite is already storing the newly created ServiceCallSite into the dictionary, so GetOrAdd isn't providing any meaningful value: we can simply TryGetValue and then call CreateCallSite if it fails.

3 years agoAvoid MediaTypeHeaderValue.ToString allocation when no parameters (#44750)
Stephen Toub [Tue, 17 Nov 2020 06:19:55 +0000 (01:19 -0500)]
Avoid MediaTypeHeaderValue.ToString allocation when no parameters (#44750)

3 years agoHarmonize pointer type handling (#44465)
Michal Strehovský [Tue, 17 Nov 2020 06:06:29 +0000 (07:06 +0100)]
Harmonize pointer type handling (#44465)

* CoreCLR treats pointer types as UIntPtr in a couple places.

* Regression test

3 years agoarm64 osx: support byte sizes from lowering to codegen. (#43024)
Sergey Andreenko [Tue, 17 Nov 2020 05:38:53 +0000 (19:38 -1000)]
arm64 osx: support byte sizes from lowering to codegen. (#43024)

* arm64 osx: support byte sizes from lowering to codegen.

* a better message about GT_PUTARG_SPLIT.

* Fix arm

* Response review.

* format GenTreePutArgStk(genTreeOps.

* response Egor's review.

3 years agoMake DirectoryInfoWrapper better handle missing directories (#44671)
Eric StJohn [Tue, 17 Nov 2020 05:38:38 +0000 (21:38 -0800)]
Make DirectoryInfoWrapper better handle missing directories (#44671)

EnumerateFileSystemInfos tries to noop when root directory does not exist
but the directory might be deleted between the time it checks Exists and
begins enumerating.  The value for Exists might also be stale as it is cached.

3 years agoSystem.Memory.Data (#44633)
Eric StJohn [Tue, 17 Nov 2020 04:50:13 +0000 (20:50 -0800)]
System.Memory.Data (#44633)

* Add BinaryData

Ported from https://github.com/Azure/azure-sdk-for-net/commit/995a13b14c5f635b293c117bfb657d9532b2a202

* Make System.Memory.Data build and fix tests

* Simplify type default

* Respond to feedback

* Use common ReadOnlyMemoryStream

Make common ReadOnlyMemoryStream support compiling for NETFramework and
NETStandard2.0, and add ObjectDisposedException checking.

* Add tests cases for null objects/types

* Fix System.Text.Json reference

* Simplify ReadOnlyMemoryStream.Dispose

* Throw on Disposed for more cases in ReadOnlyMemoryStream

Co-authored-by: JoshLove-msft <54595583+JoshLove-msft@users.noreply.github.com>
3 years agoMake System.Guid readonly (#44629)
Levi Broderick [Tue, 17 Nov 2020 04:36:08 +0000 (20:36 -0800)]
Make System.Guid readonly (#44629)

3 years agoFix RCS1036: Remove redundant empty line (#44631)
xtqqczze [Tue, 17 Nov 2020 03:54:49 +0000 (03:54 +0000)]
Fix RCS1036: Remove redundant empty line (#44631)

Sync with PowerShell/PowerShell#13404

3 years agoAvoid MemoryMarshal.Cast unaligned accesses in Marvin (#44617)
Levi Broderick [Tue, 17 Nov 2020 02:30:34 +0000 (18:30 -0800)]
Avoid MemoryMarshal.Cast unaligned accesses in Marvin (#44617)

3 years agoSupport System.Type.Missing arguments for late bound calls to IDynamicObject methods...
Charles Stoner [Mon, 16 Nov 2020 18:01:30 +0000 (10:01 -0800)]
Support System.Type.Missing arguments for late bound calls to IDynamicObject methods with 8 or more arguments (#44434)

3 years agoDelete unnecessary entry in global.json (#44709)
Jan Kotas [Mon, 16 Nov 2020 14:45:20 +0000 (06:45 -0800)]
Delete unnecessary entry in global.json (#44709)

3 years agoOrganize SendReceive tests and isolate non-parallel test collection (#44591)
Anton Firszov [Mon, 16 Nov 2020 12:50:48 +0000 (13:50 +0100)]
Organize SendReceive tests and isolate non-parallel test collection (#44591)

Some `SendReceive` socket tests may be prone to timing issues on CI. This seems to be the root cause of #1712. We need a reliable way to run such tests to unblock the work on new UDP socket API-s in #33418.

This PR defines a new `SendReceiveNonParallel` test group, moving `SendToRecvFrom_Datagram_UDP` into that group. Since this is already a significant reorganization, it seemed reasonable to also:
- Harmonize naming: all SendReceive test classses are now named either  `SendReceive_[SubVariant]`
 or `SendReceiveNonParallel_[SubVariant]`
- Split `SendReceive.cs` into multiple files:
    - `SendReceive.cs` for the parallel variants
    - `SendReceiveNonParallel.cs` for the new, non-parallel variants
    - Rename the non-generic class `SendReceive` to `SendReceiveMisc` (to avoid name collision and confusion with `SendReceive<T>`) and move it to `SendReceiveMisc.cs`
    - Move `SendReceiveListener` and `SendReceiveUdpClient` to separate files, rename `SendReceiveListener` to `SendReceiveTcpClient`

3 years agoFix `-output_mch_path` argument to superpmi.py (#44693)
Bruce Forstall [Mon, 16 Nov 2020 03:49:11 +0000 (19:49 -0800)]
Fix `-output_mch_path` argument to superpmi.py (#44693)

Convert the given path argument to an absolute path. Without this,
the `collect` command changes the current directory before doing its
work, so the file doesn't end up where you expeect it to.

Also, print the given argument in any error message.

3 years agoFixed various comments and minor refactor ServiceController. (#44014)
Shreyas Jejurkar [Sun, 15 Nov 2020 23:32:35 +0000 (05:02 +0530)]
Fixed various comments and minor refactor ServiceController. (#44014)

* Fixed various comments in ServiceController.

1. Fixed comments, so that VS can infer and show in tooltip.
2. Removed redundant base constructor call.
3. Used auto-properties.

* Addressed PR feedback

* Update src/libraries/System.ServiceProcess.ServiceController/src/System/ServiceProcess/ServiceController.cs

Co-authored-by: Dan Moseley <danmose@microsoft.com>
3 years agoimprove parsing network files on WSL (#44680)
Tomas Weinfurt [Sun, 15 Nov 2020 17:50:22 +0000 (09:50 -0800)]
improve parsing network files on WSL (#44680)

* improve parsing network files on WSL

* Apply suggestions from code review

Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoRemove allocations from IsCustomAttributeDefined (#44694)
Ben Adams [Sun, 15 Nov 2020 03:23:30 +0000 (03:23 +0000)]
Remove allocations from IsCustomAttributeDefined (#44694)

3 years agoFix Android runtime tests to upload .apk per work item (#44662)
Alexander Köplinger [Sat, 14 Nov 2020 10:25:15 +0000 (11:25 +0100)]
Fix Android runtime tests to upload .apk per work item (#44662)

Instead of uploading all .apk's as a correlation payload.

3 years agoOnly sign in the official build pipeline, not in any other pipeline (#44668)
Jeremy Koritzinsky [Sat, 14 Nov 2020 02:00:26 +0000 (18:00 -0800)]
Only sign in the official build pipeline, not in any other pipeline (#44668)

* Only sign in the official build pipeline, not in any other pipeline (was breaking the perf pipeline).

* Pass signBinaries directly to crossdac-build

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
* Only install MicroBuild when we are signing.

Signed-off-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
3 years agoFix MONO exports not actually being callable through Module (#44634)
Katelyn Gadd [Sat, 14 Nov 2020 01:39:52 +0000 (17:39 -0800)]
Fix MONO exports not actually being callable through Module (#44634)

3 years agoRemove extraneous dependency ignore. (#44672)
Jeremy Koritzinsky [Sat, 14 Nov 2020 01:35:59 +0000 (17:35 -0800)]
Remove extraneous dependency ignore. (#44672)

3 years agoAdd allocation-free StringInfo APIs, improve unit tests (#44609)
Levi Broderick [Fri, 13 Nov 2020 22:36:09 +0000 (14:36 -0800)]
Add allocation-free StringInfo APIs, improve unit tests (#44609)

3 years agoCheck args before asking runtime to resolve fqns to avoid assert (#44635)
Katelyn Gadd [Fri, 13 Nov 2020 21:27:46 +0000 (13:27 -0800)]
Check args before asking runtime to resolve fqns to avoid assert (#44635)

3 years agoSupport multi-buffer sends in WebAssembly WebSockets (#44611)
Brennan [Fri, 13 Nov 2020 21:08:14 +0000 (13:08 -0800)]
Support multi-buffer sends in WebAssembly WebSockets (#44611)

* Support multi-buffer sends in WebAssembly WebSockets

Proposed fix for https://github.com/dotnet/runtime/issues/44551

* Update BrowserWebSocket.cs

* Whitespace

* TryGetBuffer

3 years agoAdd feature switch for disabling startup hooks (#44050)
Mateo Torres-Ruiz [Fri, 13 Nov 2020 21:04:25 +0000 (13:04 -0800)]
Add feature switch for disabling startup hooks (#44050)

* Introduce feature switch for startup hook

* Add test

* Update md

* Update src/coreclr/src/System.Private.CoreLib/src/System/StartupHookProvider.cs

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Add UnreferencedCode attribute

* Apply suggestions from code review

Co-authored-by: Vitek Karas <vitek.karas@microsoft.com>
* Update message

* Update baseline

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
Co-authored-by: Vitek Karas <vitek.karas@microsoft.com>
3 years agoAdd link to github issues (#44650)
Fan Yang [Fri, 13 Nov 2020 20:28:34 +0000 (15:28 -0500)]
Add link to github issues (#44650)

3 years agoDon't build archives or installers for Mono builds. (#44656)
Jeremy Koritzinsky [Fri, 13 Nov 2020 20:12:48 +0000 (12:12 -0800)]
Don't build archives or installers for Mono builds. (#44656)

3 years agoupdate version (#44478)
Anirudh Agnihotry [Fri, 13 Nov 2020 19:42:49 +0000 (11:42 -0800)]
update version (#44478)

3 years agoRuntimeResourceSet improvements (#44454)
Marek Safar [Fri, 13 Nov 2020 19:03:25 +0000 (20:03 +0100)]
RuntimeResourceSet improvements (#44454)

* RuntimeResourceSet improvements

- remove unnecessary base class calls to trim more of base type
- remove code paths which were never executed
- replaced nested locking with simple locks
- fix caching for case insensitive mode
- add tests for more code paths

* Move local caseInsensitiveTable initialisation

* Clean up unused code

* Revert "Clean up unused code"

It's actually used via reflection in System.Resources.Extensions

3 years agoEnable WASM AOT option in build and update MonoAOTCompiler (#44468)
Alexander Köplinger [Fri, 13 Nov 2020 16:25:02 +0000 (17:25 +0100)]
Enable WASM AOT option in build and update MonoAOTCompiler (#44468)

Allows creating AOT images for WASM with the AOT compiler and consuming them in the runtime.

Use `make build AOT=1` in `src/mono/netcore/sample/wasm/console` to try it out.

--

Also fix a regression in aot-compiler.c regarding SPC->corlib assembly name:

In https://github.com/dotnet/runtime/commit/035ebeab160b9a281e5fbb3fa0c237f244c81b7a we added a simplified prefix for symbol names in System.Private.CoreLib.
However this shouldn't happen for the actual assembly name otherwise we aren't able to find the AOT module linked statically into the binary.

3 years agoMove PollingFileProviderShouldntConsumeINotifyInstances to outerloop (#44651)
Eric StJohn [Fri, 13 Nov 2020 16:19:49 +0000 (08:19 -0800)]
Move PollingFileProviderShouldntConsumeINotifyInstances to outerloop (#44651)

3 years agoFix race condition in TestExited_SynchronizingObject test (#44627)
Stephen Toub [Fri, 13 Nov 2020 16:08:09 +0000 (11:08 -0500)]
Fix race condition in TestExited_SynchronizingObject test (#44627)