platform/upstream/dotnet/runtime.git
3 years agoRemove some allocation at "hello world" startup (#44469)
Stephen Toub [Wed, 11 Nov 2020 14:15:06 +0000 (09:15 -0500)]
Remove some allocation at "hello world" startup (#44469)

* Specialize `EqualityComparer<string>.Default`

Removes ~80 allocations at startup.

* Avoid loading Encoding.Unicode just for CodePage

* Use fixed instead of GCHandle.Alloc in EventSource.Initialize

* Remove lock / lock object from EncodingProvider.AddProvider

* Remove lock object from AppDomain.cs

* Lazily allocate EventSource's m_createEventLock

It's only used on an error path.  We don't need to allocate it for each EventSource that's created.

* Avoid unnecessary CultureInfo access in derived TextWriters

SyncTextWriter already overrides FormatProvider, in which case the t.FormatProvider passed to the base will never be used, so this call is incurring a virtual dispatch for no benefit.  And NullTextWriter needn't access InvariantCulture and force it into existence if it isn't yet, as the formatting should never actually be used, and if it is, its FormatProvider override can supply the culture.

* Avoid allocating AssemblyLoadContext's dictionary if no direct interaction with ALC

AssemblyLoadContext.OnProcessExit gets called by EventSource, which in turn forces s_allContexts into existence in order to lock on it in order to enumerate all active contexts, and if there's been no interaction with AssemblyLoadContext, there won't be any to enumerate.  So delay allocate the object.

* Address PR feedback

* Call EventListener.DisposeOnShutdown from AppContext.OnProcessExit

Avoids the need to register with AppContext.ProcessExit, avoiding an EventHandler allocation, and avoids the need in the common case to fire AppContext.ProcessExit, which in turn avoids allocating an AppDomain and EventArgs if they weren't otherwise created, plus it avoids the delegate invocation.

* Update src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs

3 years agoUpdate dependencies from https://github.com/mono/linker build 20201110.1 (#44499)
dotnet-maestro[bot] [Wed, 11 Nov 2020 13:12:39 +0000 (14:12 +0100)]
Update dependencies from https://github.com/mono/linker build 20201110.1 (#44499)

Microsoft.NET.ILLink.Tasks
 From Version 6.0.0-alpha.1.20559.3 -> To Version 6.0.0-alpha.1.20560.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
3 years agoReduce StreamWriter allocation (#44495)
Stephen Toub [Wed, 11 Nov 2020 10:23:36 +0000 (05:23 -0500)]
Reduce StreamWriter allocation (#44495)

* Lazily-allocate StreamWriter's byte[] buffer

The byte[] buffer is used just when flushing to the underlying stream, to store the intermediate bytes as generated from the characters by the encoding.  Currently the byte[] buffer is allocated in the constructor, but for relatively small strings written/flushed synchronously (such as those often used with Console.Write), we can avoid the buffer entirely via stack allocation (in Flush); for all other cases, we can allocate it on demand.

(I considered using ArrayPool to rent/return in each Flush{Async} call, but opted not to in this change.  Someone could investigate that subsequently.)

* Undo use of static async helpers

In .NET Framework, there was a non-trivial penalty due to StreamWriter deriving from MarshalByRefObject and the impact that had on async methods accessing lifted locals on the state machine (it made them significantly more expensive).  The workaround was to make the async methods be statics and pass in all of the relevant instance state needed.  That workaround is no longer necessary on core, where MarshalByRefObjects are nops, leaving behind a workaround that is not just clunkier, but actually makes things more expensive because more state needs to be stored on the state machine objects (all of the arguments, which can instead just be accessed off of `this`).  Undo that whole change.

* Address PR feedback

3 years agoUse corlib instead of System.Private.CoreLib as a name prefix in AOT symbol names...
Zoltan Varga [Wed, 11 Nov 2020 07:11:57 +0000 (02:11 -0500)]
Use corlib instead of System.Private.CoreLib as a name prefix in AOT symbol names. (#44235)

3 years agoWASM Bindings optimizations and fixes (#41808)
Katelyn Gadd [Wed, 11 Nov 2020 04:46:06 +0000 (20:46 -0800)]
WASM Bindings optimizations and fixes (#41808)

* Fix MarshalTypedArrayByte and re-enable it. Re-enable TestFunctionApply

* Re-enable MarshalTypedArray

* Detect when the managed wrapper for a JS object has been collected and create a new one

* Remove debugging code

* Maintain a small pool of temporary root instances to minimize GC pressure. Improve benchmark

* Don't use release_roots in call_method due to varargs overhead

* Various call_method optimizations

* Checkpoint: Don't rely on finally block for teardown in call path, because it has a performance cost

* Checkpoint: Unboxing fast path for primitives

* Checkpoint: Fix unboxing fast path

* Update bindings to use bound static methods instead of call_method in various places

* Address PR feedback

* Revert sample and add separate proj for benchmark

* Fix benchmark

* Revert test change

* Fix passing mono object ptrs to bound functions
Fix passing strings across the boundary
Fix JS strings being truncated at the first null when passed to mono

* Implement unboxing for chars
Slightly optimize the unboxing slow path

* Don't allocate a root buffer for arguments if nothing needs to be rooted. Reuse scratch native buffer across calls unless re-entrant to avoid per-invoke malloc

* Fix whitespace damage from merge

* Tweaks to try and prevent boxing/gc

* Fix typo

* Add some tests

* Fix test failures

* Add more error handling and diagnostic messages
Fix a couple broken tests

* Repair merge damage

* Remove bindings benchmark

* Use TypedArray.fill 3-argument version to zero memory

* Checkpoint: Introduce format strings

* Fix interpolated strings

* Test refactoring

* Checkpoint: Add more test coverage for bindings and interop

* Checkpoint: Enum marshaling works

* Improve test coverage

* Checkpoint: Unify unboxing of primitive types

* Checkpoint: Unify unboxing of primitive types

* Checkpoint: Restore fn to satisfy runtime-test.js

* Checkpoint: Unify boxing for primitives

* Remove now-unused box methods

* Don't store names for null method IDs

* Fix indentation damage

* Add test

* Satisfy CI

* Accept weaker promises

Co-authored-by: Larry Ewing <lewing@microsoft.com>
3 years agoJIT: preliminary version of profile-based inline policy (#44427)
Andy Ayers [Wed, 11 Nov 2020 03:45:06 +0000 (19:45 -0800)]
JIT: preliminary version of profile-based inline policy (#44427)

Add a new inline policy that can be used when a method has profile data.

It uses the call site frequency to boost profitability. Size and per-call
benefit are currently using the estimates done by the model policy.

Not on by default. Set COMPlus_JitInlinePolicyProfile=1 to enable.
Add testing to weekly experimental runs.

3 years agoImplement internal ISpanFormattable on {U}IntPtr (#44496)
Stephen Toub [Wed, 11 Nov 2020 03:33:05 +0000 (22:33 -0500)]
Implement internal ISpanFormattable on {U}IntPtr (#44496)

Allows nint and nuint to participate in the same optimizations in string building / formatting as do the other primitives.

3 years agoAdd libs.native subset when using the runtime helper target in the wasm makefile...
Zoltan Varga [Wed, 11 Nov 2020 01:08:07 +0000 (20:08 -0500)]
Add libs.native subset when using the runtime helper target in the wasm makefile (#44450)

Ensures libSystem.Native.a/libSystem.IO.Compression.Native.a end up in the runtime pack.

3 years agoRevert "Use Dictionary for underlying cache of ResourceSet (#44104)" (#44482)
Jan Kotas [Tue, 10 Nov 2020 22:40:57 +0000 (14:40 -0800)]
Revert "Use Dictionary for underlying cache of ResourceSet (#44104)" (#44482)

This reverts commit a6835438581730da23fb3d4eea7ea7c4af1b00a3.

3 years agoFix R2RDump test in CG2 pipelines (#44460)
Tomáš Rylek [Tue, 10 Nov 2020 20:35:47 +0000 (21:35 +0100)]
Fix R2RDump test in CG2 pipelines (#44460)

Our scripts normally assume that all test projects are at least
two nesting levels deep under $(TestBinDir); the r2rdump test was
violating that and, in doing so, it was triggering a failure in
CG2 compilation.

After I decided to fix this by moving the r2rdump folder under
"readytorun" I found out that there already is a r2rdump folder
there - apparently Amy during her initial R2RDump implementation
authored a basic test suite even though it's disabled right now.

I have resolved this by moving the original test under
"readytorun/r2rdump" to "readytorun/r2rdump/BasicTests" and I moved
Andrew's new test under "readytorun/r2rdump/FrameworkTests".
I'm not super happy about the naming but I don't have any better
ideas at the moment, I'll be happy to improve this based on PR
feedback.

Thanks

Tomas

3 years ago[mono][jit] Emit profiler enter after jit attach; leave before detach (#44345)
Aleksey Kliger (λgeek) [Tue, 10 Nov 2020 20:11:20 +0000 (15:11 -0500)]
[mono][jit] Emit profiler enter after jit attach; leave before detach (#44345)

* [jit] Emit profiler enter after jit attach; leave before detach

profiler enter code (such as mono_trace_enter_method) must not be
called before a thread attaches to the runtime - otherwise calls like
`mono_domain_get()` will return NULL unexpectedly and then crash.
When detaching, we should call the profiler leave code before the
detach, and suppress it on return.

Simple repro (that relies on pal_signal.c SignalHandlerLoop - which is
a background thread from System.Native that calls back into managed
when there's a SIGCHLD): compile and run this program with `MONO_ENV_OPTIONS=--trace`

```csharp
using System;
using System.Diagnostics;

namespace Repro
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            using (Process myProcess = new Process())
            {
                    myProcess.StartInfo.UseShellExecute = true;
                    myProcess.StartInfo.FileName = "echo";
                    myProcess.StartInfo.Arguments = "hello from shell";
                    myProcess.StartInfo.CreateNoWindow = true;
                    myProcess.Start();
                    myProcess.WaitForExit();
            }
            Console.ReadKey ();
        }
    }
}
```

3 years agoUpdate System.Drawing.Common stable versions to fix harvesting (#44481)
Santiago Fernandez Madero [Tue, 10 Nov 2020 19:57:49 +0000 (11:57 -0800)]
Update System.Drawing.Common stable versions to fix harvesting (#44481)

3 years agoBump Helix SDK so that iOS simulators don't get rebooted before/after every Helix...
Přemek Vysoký [Tue, 10 Nov 2020 18:59:41 +0000 (19:59 +0100)]
Bump Helix SDK so that iOS simulators don't get rebooted before/after every Helix job (#44455)

3 years agoUse commit parents instead of branch names to evaulate changed paths. (#44474)
Jeremy Koritzinsky [Tue, 10 Nov 2020 18:55:27 +0000 (10:55 -0800)]
Use commit parents instead of branch names to evaulate changed paths. (#44474)

3 years ago[runtime] Add some support for stack walks for AOT code on wasm. (#44431)
monojenkins [Tue, 10 Nov 2020 17:02:16 +0000 (12:02 -0500)]
[runtime] Add some support for stack walks for AOT code on wasm. (#44431)

For methods which need to show up during stack walks, push/pop an LMF
frame and have mono_arch_unwind_frame () handle it.

This is needed to be able to support methods which do stack walks like
Type.GetType () or Assembly.Load () in the future.

Co-authored-by: vargaz <vargaz@users.noreply.github.com>
3 years ago[RyuJIT] Fix get_ManagedThreadId(get_CurrentThread) optimization (convert to NI)...
Egor Bogatov [Tue, 10 Nov 2020 14:54:09 +0000 (17:54 +0300)]
[RyuJIT] Fix get_ManagedThreadId(get_CurrentThread) optimization (convert to NI) (#41213)

* Convert get_ManagedThreadId(get_CurrentThread) optimization to NamedIntrinsics

* drop CORINFO_HELP_INTERNALTHROW and CORINFO_HELP_SEC_UNMGDCODE_EXCPT

3 years ago[master] Update dependencies from mono/linker (#44408)
dotnet-maestro[bot] [Tue, 10 Nov 2020 14:06:59 +0000 (15:06 +0100)]
[master] Update dependencies from mono/linker (#44408)

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

Microsoft.NET.ILLink.Tasks
 From Version 6.0.0-alpha.1.20556.1 -> To Version 6.0.0-alpha.1.20559.1

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

Microsoft.NET.ILLink.Tasks
 From Version 6.0.0-alpha.1.20556.1 -> To Version 6.0.0-alpha.1.20559.2

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

Microsoft.NET.ILLink.Tasks
 From Version 6.0.0-alpha.1.20556.1 -> To Version 6.0.0-alpha.1.20559.3

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
3 years agoInitial changes to support Mac Catalyst (#44127)
monojenkins [Tue, 10 Nov 2020 10:51:38 +0000 (05:51 -0500)]
Initial changes to support Mac Catalyst (#44127)

Co-authored-by: praeclarum <praeclarum@users.noreply.github.com>
3 years agoMake internal API ThrowIfDeserializationInProgress internal (#44147)
Marek Safar [Tue, 10 Nov 2020 08:16:04 +0000 (09:16 +0100)]
Make internal API ThrowIfDeserializationInProgress internal (#44147)

* Make internal API ThrowIfDeserializationInProgress internal

also avoid doing costly argument checks

* Make methods public again

* Update src/libraries/System.Private.CoreLib/src/System/Runtime/Serialization/SerializationInfo.SerializationGuard.cs

Co-authored-by: Levi Broderick <GrabYourPitchforks@users.noreply.github.com>
Co-authored-by: Levi Broderick <GrabYourPitchforks@users.noreply.github.com>
3 years agoDisable 2 failing coreclr tests until they are fixed. (#44420)
Sergey Andreenko [Tue, 10 Nov 2020 05:27:52 +0000 (19:27 -1000)]
Disable 2 failing coreclr tests until they are fixed. (#44420)

* another failing test

* exclude another failure,

3 years agoResolve warnings for assignment or explicit cast of possibly null type parameter...
Charles Stoner [Tue, 10 Nov 2020 04:11:57 +0000 (20:11 -0800)]
Resolve warnings for assignment or explicit cast of possibly null type parameter value (#43925)

3 years agoNew event to track memory allocation for JIT code (#44030)
Kunal Pathak [Tue, 10 Nov 2020 03:27:39 +0000 (19:27 -0800)]
New event to track memory allocation for JIT code (#44030)

* Added MethodJitMemoryAllocatedForCode event

* Renane the event fields

* Include cold code size as well

* Replace methodName with methodId

* Update the condition that fires the event

3 years agoRemoving `g_hmodCoreCLR` and `g_hThisInst` (#43735)
Vladimir Sadov [Tue, 10 Nov 2020 00:19:44 +0000 (16:19 -0800)]
Removing `g_hmodCoreCLR` and `g_hThisInst`  (#43735)

* g_hmodCoreCLR is Windows-only

* Use 42 in MarkAsThrownByUsWorker()

* replaced GetCLRModule with GetClrModulePathName

* Addded PAL_GetPalHostModule to mscordac_unixexports

* replaced a few cases of g_hThisInst where used to get module path. We can uise `GetClrModulePathName` instead.

* more cases where used to get module path

* unused `GetModuleInst()`

* not using HMODULE in StressLog

* removed mscoree GetModuleInst

* Deleted both  `g_hThisInst` and `g_hmodCoreCLR`

* fix Linux build

* rename `GetModuleBase` ->` GetClrModuleBase`,  it was confusing with other `GetClrModuleBase`

* Fix Linux build

* PR feedback

* Removed hMod variables in Debugger areas

* standalone GC

* cache GetClrModuleBase

* Prevent double-read of `pImageBase`

* fix linker issue

* couple more link order fixes.

* Remove `g_thisModule` in daccess.cpp. Fix typos.

3 years agoImprove nullable annotation on Volatile.Read (#44410)
Stephen Toub [Tue, 10 Nov 2020 00:17:12 +0000 (19:17 -0500)]
Improve nullable annotation on Volatile.Read (#44410)

Make it clear to the compiler that Volatile.Read doesn't write to the ref argument, such that if the input was non-null before the call, it'll still be non-null after the call.

3 years agoFix genEventing.py to generate correct EventEnabled functions (#44384)
Sung Yoon Whang [Tue, 10 Nov 2020 00:14:50 +0000 (16:14 -0800)]
Fix genEventing.py to generate correct EventEnabled functions (#44384)

3 years ago[iOS] Fix build for Xcode 12.1 (#44311)
Egor Bogatov [Tue, 10 Nov 2020 00:02:06 +0000 (03:02 +0300)]
[iOS] Fix build for Xcode 12.1 (#44311)

3 years agoRemove unused project references (#44425)
Maryam Ariyan [Mon, 9 Nov 2020 22:30:28 +0000 (14:30 -0800)]
Remove unused project references (#44425)

3 years agoRemove some unnecessary GetTypeInfo usage (#44414)
Stephen Toub [Mon, 9 Nov 2020 21:11:41 +0000 (16:11 -0500)]
Remove some unnecessary GetTypeInfo usage (#44414)

3 years agoImprove crossgen2 comparison jobs (#44119)
David Wrighton [Mon, 9 Nov 2020 20:34:54 +0000 (12:34 -0800)]
Improve crossgen2 comparison jobs (#44119)

- Fix compilation on unix platforms
  - Wrap use of wildcard in quotes
- Print better display name into log
- Fix X86 constant comparison handling
- Add ability to compile specific overload via single method switches

3 years agoChange async void System.Text.Json test to be async Task (#44418)
Stephen Toub [Mon, 9 Nov 2020 20:11:30 +0000 (15:11 -0500)]
Change async void System.Text.Json test to be async Task (#44418)

3 years agoDisable a failing test. (#44404)
Sergey Andreenko [Mon, 9 Nov 2020 19:54:31 +0000 (09:54 -1000)]
Disable a failing test. (#44404)

3 years agoFix C++ build for mono/metadata/threads.c (#44413)
Alexander Köplinger [Mon, 9 Nov 2020 19:23:49 +0000 (20:23 +0100)]
Fix C++ build for mono/metadata/threads.c (#44413)

`throw` is a reserved keyword in C++.

3 years agoMove some more UnmanagedCallersOnly tests to IL now that they're invalid C# (#43366)
Jeremy Koritzinsky [Mon, 9 Nov 2020 18:35:33 +0000 (10:35 -0800)]
Move some more UnmanagedCallersOnly tests to IL now that they're invalid C# (#43366)

3 years agoAdd files need for wasm executable relinking/aot to the wasm runtime pack. (#43785)
Zoltan Varga [Mon, 9 Nov 2020 15:39:01 +0000 (10:39 -0500)]
Add files need for wasm executable relinking/aot to the wasm runtime pack. (#43785)

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
3 years agoUpdate glossary (#44274)
Jan Kotas [Mon, 9 Nov 2020 13:49:53 +0000 (05:49 -0800)]
Update glossary (#44274)

Co-authored-by: Juan Hoyos <juan.hoyos@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Günther Foidl <gue@korporal.at>
3 years agoFix/remove TODO-NULLABLEs (#44300)
Krzysztof Wicher [Mon, 9 Nov 2020 12:07:15 +0000 (13:07 +0100)]
Fix/remove TODO-NULLABLEs (#44300)

* Fix/remove TODO-NULLABLEs

* remove redundant !

* apply Jozkee's feedback

* address feedback

3 years agoDelete stale comment about dotnet/roslyn#30797
Stephen Toub [Mon, 9 Nov 2020 02:17:20 +0000 (21:17 -0500)]
Delete stale comment about dotnet/roslyn#30797

3 years agoUpdate dotnet/roslyn issue link
Stephen Toub [Mon, 9 Nov 2020 02:15:24 +0000 (21:15 -0500)]
Update dotnet/roslyn issue link

3 years agoClean up the samples (#44293)
Egor Bogatov [Sun, 8 Nov 2020 21:21:37 +0000 (00:21 +0300)]
Clean up the samples (#44293)

3 years agochange using in ConnectCallback_UseUnixDomainSocket_Success (#44366)
Tomas Weinfurt [Sun, 8 Nov 2020 15:14:14 +0000 (07:14 -0800)]
change using in ConnectCallback_UseUnixDomainSocket_Success (#44366)

3 years agoadd missing constructor overloads (#44380)
Geoff Kizer [Sun, 8 Nov 2020 15:12:08 +0000 (07:12 -0800)]
add missing constructor overloads (#44380)

Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
3 years agoLongProcessNamesAreSupported: make test work on distros where sleep is a symlink...
Tom Deseyn [Sun, 8 Nov 2020 14:29:46 +0000 (15:29 +0100)]
LongProcessNamesAreSupported: make test work on distros where sleep is a symlink/script (#44299)

* LongProcessNamesAreSupported: make test work on distros where sleep is a symlink/script

* PR feedback

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* fix compilation

Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoDisable RunThreadLocalTest8_Values on Mono (#44357)
Aleksey Kliger (λgeek) [Sun, 8 Nov 2020 10:37:43 +0000 (05:37 -0500)]
Disable RunThreadLocalTest8_Values on Mono (#44357)

* Disable RunThreadLocalTest8_Values on Mono

It's failing on SLES

* fix typo

3 years agoUpdate dependencies from https://github.com/mono/linker build 20201106.1 (#44367)
dotnet-maestro[bot] [Sun, 8 Nov 2020 10:36:15 +0000 (05:36 -0500)]
Update dependencies from https://github.com/mono/linker build 20201106.1 (#44367)

Microsoft.NET.ILLink.Tasks
 From Version 6.0.0-alpha.1.20555.2 -> To Version 6.0.0-alpha.1.20556.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
3 years agoclarify http version test (#44379)
Geoff Kizer [Sun, 8 Nov 2020 02:59:14 +0000 (18:59 -0800)]
clarify http version test (#44379)

Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
3 years agoImprove performance of Enum's generic IsDefined / GetName / GetNames (#44355)
Stephen Toub [Sat, 7 Nov 2020 14:06:22 +0000 (09:06 -0500)]
Improve performance of Enum's generic IsDefined / GetName / GetNames (#44355)

Eliminates the boxing in IsDefined/GetName/GetValues, and in GetNames avoids having to go through RuntimeType's GetEnumNames override.

3 years agoBootstrapping a test for R2RDump (#42150)
Andrew Au [Sat, 7 Nov 2020 01:41:16 +0000 (17:41 -0800)]
Bootstrapping a test for R2RDump (#42150)

3 years agoReflect test path changes in .gitattributes; remove nonexistent files (#44371)
Tomáš Rylek [Sat, 7 Nov 2020 01:29:05 +0000 (02:29 +0100)]
Reflect test path changes in .gitattributes; remove nonexistent files (#44371)

3 years agoAdd slash in Windows SoD tool build (#44359)
Drew Scoggins [Sat, 7 Nov 2020 01:17:10 +0000 (17:17 -0800)]
Add slash in Windows SoD tool build (#44359)

* Add slash in Windows SoD tool build

* Update SoD search path to match output dir

* Fixup dotnet version

* Remove merge commit headers

* Disable PRs

Co-authored-by: Drew Scoggins <andrew.g.scoggins@gmail>
3 years agoMatch CoreCLR behaviour on thread start failure (#44124)
Marek Safar [Fri, 6 Nov 2020 22:28:06 +0000 (23:28 +0100)]
Match CoreCLR behaviour on thread start failure (#44124)

Co-authored-by: Aleksey Kliger (λgeek) <akliger@gmail.com>
3 years agoFix Send_TimeoutResponseContent_Throws (#44356)
Stephen Toub [Fri, 6 Nov 2020 21:51:41 +0000 (16:51 -0500)]
Fix Send_TimeoutResponseContent_Throws (#44356)

If the client times out too quickly, the server may never have a connection to accept and will hang forever.

3 years ago[master] Update dependencies from dotnet/arcade dotnet/llvm-project dotnet/icu (...
dotnet-maestro[bot] [Fri, 6 Nov 2020 20:53:39 +0000 (20:53 +0000)]
[master] Update dependencies from dotnet/arcade dotnet/llvm-project dotnet/icu (#44336)

[master] Update dependencies from dotnet/arcade dotnet/llvm-project dotnet/icu

 - Merge branch 'master' into darc-master-2211df94-2a02-4c3c-abe1-e3534e896267

3 years agoFix ELT profiler tests (#44285)
David Mason [Fri, 6 Nov 2020 18:58:00 +0000 (10:58 -0800)]
Fix ELT profiler tests (#44285)

3 years agoAdd threshold on number of files / partition in SPMI collection (#44180)
Kunal Pathak [Fri, 6 Nov 2020 18:06:26 +0000 (10:06 -0800)]
Add threshold on number of files / partition in SPMI collection (#44180)

* Add check for files count

* Fix the OS check

* decrese file limit to 1500:

* misc fix

* Do not upload to azure if mch files are zero size

3 years agoTighten argument validation in StreamConformanceTests (#44326)
Stephen Toub [Fri, 6 Nov 2020 17:56:07 +0000 (12:56 -0500)]
Tighten argument validation in StreamConformanceTests (#44326)

3 years ago[master] Update dependencies from mono/linker (#44322)
dotnet-maestro[bot] [Fri, 6 Nov 2020 16:55:42 +0000 (11:55 -0500)]
[master] Update dependencies from mono/linker (#44322)

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

Microsoft.NET.ILLink.Tasks
 From Version 6.0.0-alpha.1.20527.2 -> To Version 6.0.0-alpha.1.20555.1

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

Microsoft.NET.ILLink.Tasks
 From Version 6.0.0-alpha.1.20527.2 -> To Version 6.0.0-alpha.1.20555.2

* Disable new optimization for libraries mode (it cannot work in this mode)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Marek Safar <marek.safar@gmail.com>
3 years agoSimple GT_NEG optimization for #13837 (#43921)
Julie Lee [Fri, 6 Nov 2020 15:04:07 +0000 (07:04 -0800)]
Simple GT_NEG optimization for #13837 (#43921)

* Simple arithmetic optimization with GT_NEG

* Skip GT_NEG optimization when an operand is constant. Revert bitwise rotation pattern

* Fixed Value Numbering assert

* Cleaned up code and comments for simple GT_NEG optimization

* Formatting

Co-authored-by: Julie Lee <jeonlee@microsoft.com>
3 years agoSimplify catch-rethrow logic in NetworkStream (#44246)
Anton Firszov [Fri, 6 Nov 2020 13:52:49 +0000 (14:52 +0100)]
Simplify catch-rethrow logic in NetworkStream (#44246)

A follow-up on #40772 (comment), simplifies and harmonizes the way we wrap exceptions into IOException. Having one catch block working with System.Exception seems to be enough here, no need for specific handling of SocketException.

3 years agoUse Dictionary for underlying cache of ResourceSet (#44104)
Marek Safar [Fri, 6 Nov 2020 10:39:36 +0000 (11:39 +0100)]
Use Dictionary for underlying cache of ResourceSet (#44104)

3 years agoTweak StreamConformanceTests for cancellation (#44342)
Stephen Toub [Fri, 6 Nov 2020 10:33:25 +0000 (05:33 -0500)]
Tweak StreamConformanceTests for cancellation (#44342)

- Avoid unnecessary timers
- Separate tests for precancellation, ReadAsync(byte[], ...) cancellation, and ReadAsync(Memory, ...) cancellation

3 years ago[mono] Change CMakelists.txt "python" -> Python3_EXECUTABLE (#44340)
Aleksey Kliger (λgeek) [Fri, 6 Nov 2020 08:15:38 +0000 (03:15 -0500)]
[mono] Change CMakelists.txt "python" -> Python3_EXECUTABLE (#44340)

Debian doesn't install a "python" binary for python3.

3 years agoAdd an implicit argument coercion check. (#43386)
Sergey Andreenko [Fri, 6 Nov 2020 05:32:40 +0000 (19:32 -1000)]
Add an implicit argument coercion check. (#43386)

* Add `impCheckImplicitArgumentCoercion`.

* Fix tests with type mismatch.

* Try to fix VM signature.

* Allow to pass byref as native int.

* another fix.

* Fix another IL test.

3 years ago[tests] Re-enable tests fixed by #44081 (#44212)
Aleksey Kliger (λgeek) [Fri, 6 Nov 2020 04:19:11 +0000 (23:19 -0500)]
[tests] Re-enable tests fixed by #44081 (#44212)

Fixes
https://github.com/mono/mono/issues/15030 and
fixes https://github.com/mono/mono/issues/15031 and
fixes https://github.com/mono/mono/issues/15032

3 years ago[sgen] Add Ward annotations to sgen_get_total_allocated_bytes (#43833)
monojenkins [Fri, 6 Nov 2020 04:18:21 +0000 (23:18 -0500)]
[sgen] Add Ward annotations to sgen_get_total_allocated_bytes (#43833)

Attempt to fix https://jenkins.mono-project.com/job/test-mono-mainline-staticanalysis/

Co-authored-by: lambdageek <lambdageek@users.noreply.github.com>
3 years agoUse targetPlatformMoniker for net5.0 and newer tfms (#43965)
Anirudh Agnihotry [Fri, 6 Nov 2020 03:54:19 +0000 (19:54 -0800)]
Use targetPlatformMoniker for net5.0 and newer tfms (#43965)

* Use targetPlatformMoniker for net5.0 and newer tfms

* disabling analyzer, update version to 0.0, and use new format.

* update the targetFramework.sdk

* removing supportedOS assembly level attribute

* fix linker errors and addressing feedback

* making _TargetFrameworkWithoutPlatform as private

3 years agoRemove silly ToString in GetCLRInstanceString (#44335)
Stephen Toub [Fri, 6 Nov 2020 01:18:06 +0000 (20:18 -0500)]
Remove silly ToString in GetCLRInstanceString (#44335)

3 years agoUpdate SharedPerformanceCounter assert (#44333)
Stephen Toub [Fri, 6 Nov 2020 01:07:37 +0000 (20:07 -0500)]
Update SharedPerformanceCounter assert (#44333)

3 years agoPick libmonosgen-2.0.so from cmake install directory instead of .libs (#44291)
Alexander Köplinger [Fri, 6 Nov 2020 00:34:26 +0000 (01:34 +0100)]
Pick libmonosgen-2.0.so from cmake install directory instead of .libs (#44291)

This aligns Linux with what we already do for all the other platforms.

3 years agoForbid `- byref cnst` -> `+ (byref -cnst)` transformation. (#44266)
Sergey Andreenko [Fri, 6 Nov 2020 00:17:58 +0000 (14:17 -1000)]
Forbid `- byref cnst` -> `+ (byref -cnst)` transformation. (#44266)

* Add a repro test.

* Forbid the transformation for byrefs.

* Update src/coreclr/src/jit/morph.cpp

Co-authored-by: Andy Ayers <andya@microsoft.com>
* Update src/coreclr/src/jit/morph.cpp

* Fix the test return value.

WriteLine is just to make sure we don't delete the value.

* improve the test.

avoid a possible overflow and don't waste time on printing.

Co-authored-by: Andy Ayers <andya@microsoft.com>
3 years agoUse the new async Run method from xharness and implement a test (#44046)
Larry Ewing [Thu, 5 Nov 2020 23:22:07 +0000 (17:22 -0600)]
Use the new async Run method from xharness and implement a test (#44046)

* Use the new async Run method from xharness and implement a test

* Remove PumpThreadPool as it is no longer used

* Update xharness for async support

3 years agoSet fgOptimizedFinally flag correctly (#44268)
David Wrighton [Thu, 5 Nov 2020 22:55:36 +0000 (14:55 -0800)]
Set fgOptimizedFinally flag correctly (#44268)

- Initialize to 0 at compiler startup
- Set flag when finally cloning optimization kicks in

Fixes non-deterministic generation of nop opcodes into ARM32 code

3 years agoImplementing support to Debugger::Break. (#44305)
Thays Grazia [Thu, 5 Nov 2020 22:06:58 +0000 (19:06 -0300)]
Implementing support to Debugger::Break. (#44305)

3 years ago[master][watchOS] Add simwatch64 support (#44303)
monojenkins [Thu, 5 Nov 2020 20:59:07 +0000 (15:59 -0500)]
[master][watchOS] Add simwatch64 support (#44303)

Xcode 12.2 removed 32 bits support for watchOS simulators, this PR helps to fix https://github.com/xamarin/xamarin-macios/issues/9949, we have tested the new binaries and they are working as expected

![unknown](https://user-images.githubusercontent.com/204671/98253709-64413200-1f49-11eb-9774-8c5aa416fc57.png)

Co-authored-by: dalexsoto <dalexsoto@users.noreply.github.com>
3 years agoFile.Exists() is not null when true (#44310)
Ilya [Thu, 5 Nov 2020 20:57:46 +0000 (01:57 +0500)]
File.Exists() is not null when true (#44310)

* File.Exists() is not null when true

* Fix compile

* Fix compile 2

3 years agoConcurrentQueueSegment allows spinning threads to sleep. (#44265)
Alex Covington [Thu, 5 Nov 2020 20:50:35 +0000 (12:50 -0800)]
ConcurrentQueueSegment allows spinning threads to sleep. (#44265)

* Allow threads to sleep when ConcurrentQueue has many enqueuers/dequeuers.

* Update src/libraries/System.Private.CoreLib/src/System/Collections/Concurrent/ConcurrentQueueSegment.cs

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

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: AMD DAYTONA EPYC <amd@amd-DAYTONA-X0.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoRemove unused QCall for WinRTSupported (#44278)
Elinor Fung [Thu, 5 Nov 2020 19:41:29 +0000 (11:41 -0800)]
Remove unused QCall for WinRTSupported (#44278)

3 years agoJIT: minor inliner refactoring (#44215)
Andy Ayers [Thu, 5 Nov 2020 18:37:09 +0000 (10:37 -0800)]
JIT: minor inliner refactoring (#44215)

Extract out the budget check logic so it can vary by inlining policy.
Use this to exempt the FullPolicy from budget checking.

Fix inline xml to dump the proper (full name) hash for inlinees.

Update range dumper to dump ranges in hex.

3 years agoAdd stream conformance tests for TranscodingStream (#44248)
Stephen Toub [Thu, 5 Nov 2020 18:32:44 +0000 (13:32 -0500)]
Add stream conformance tests for TranscodingStream (#44248)

* Add stream conformance tests for TranscodingStream

* Special-case 0-length input buffers to TranscodingStream.Write{Async}

The base implementation of Encoder.Convert doesn't like empty inputs.  Regardless, if the input is empty, we can avoid a whole bunch of unnecessary work.

3 years agoBump xharness workitem timeout for Android as well (#44301)
Alexander Köplinger [Thu, 5 Nov 2020 17:12:50 +0000 (18:12 +0100)]
Bump xharness workitem timeout for Android as well (#44301)

Previously we only did it for iOS/tvOS

3 years agoFix illumos native build (#44251)
Adeel Mujahid [Thu, 5 Nov 2020 16:33:32 +0000 (18:33 +0200)]
Fix illumos native build (#44251)

* Fix illumos native build

* Address PR feedback

3 years agoHttp version test cleanup (#44283)
Geoff Kizer [Thu, 5 Nov 2020 16:22:57 +0000 (08:22 -0800)]
Http version test cleanup (#44283)

* remove dead code

* simplification

* more

* fix to still use stream wrapper

* combine tests

* more

* get rid of ClientDisconnectOk overload

* fix

* simplify DribbleStream

Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
3 years agoCtor_SafeHandle_BasicPropertiesPropagate_Success: improve raw packet case. (#44294)
Tom Deseyn [Thu, 5 Nov 2020 16:21:53 +0000 (17:21 +0100)]
Ctor_SafeHandle_BasicPropertiesPropagate_Success: improve raw packet case. (#44294)

Fix expected value for ProtocolType when a new Socket is created from
an existing raw packet socket Handle. This assert isn't checked unless
the test runs as root.

And use a proper value for the ProtocolType when the Socket is created.

3 years agoWorkaround xunit bug for disabling FileStreamStandaloneConformanceTests (#44295)
Stephen Toub [Thu, 5 Nov 2020 16:20:50 +0000 (11:20 -0500)]
Workaround xunit bug for disabling FileStreamStandaloneConformanceTests (#44295)

3 years agoUncomment `pr: none` in perf.yml (#44302)
Stephen Toub [Thu, 5 Nov 2020 15:28:41 +0000 (10:28 -0500)]
Uncomment `pr: none` in perf.yml (#44302)

3 years agoCorrectly set dylib version for libmonosgen-2.0.dylib (#44290)
Alexander Köplinger [Thu, 5 Nov 2020 15:27:45 +0000 (16:27 +0100)]
Correctly set dylib version for libmonosgen-2.0.dylib (#44290)

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

3 years agofix stream conformance tests for mock provider (#44282)
Geoff Kizer [Thu, 5 Nov 2020 14:16:09 +0000 (06:16 -0800)]
fix stream conformance tests for mock provider (#44282)

Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
3 years agoMore consistent cache key validation in Remove (#44286)
Jody Donetti [Thu, 5 Nov 2020 14:05:43 +0000 (15:05 +0100)]
More consistent cache key validation in Remove (#44286)

3 years agoAdd R2RDump support for lazy GC info (#44261)
Tomáš Rylek [Thu, 5 Nov 2020 12:21:20 +0000 (13:21 +0100)]
Add R2RDump support for lazy GC info (#44261)

This change makes it such that GC info is not automatically parsed
for each method, we only store a delegate performing the parsing
that gets called on demand. In practice this also helps us with
working around a bug in GC info previously crashing R2RDump when
emitting PDB in ARM release build mode.

Thanks

Tomas

3 years agoOmit ErrorInformation from ManagementException binary serialization (#44112)
Fagner Nunes Carvalho [Thu, 5 Nov 2020 04:36:05 +0000 (01:36 -0300)]
Omit ErrorInformation from ManagementException binary serialization (#44112)

* Omit ErrorInformation from ManagementException binary serialization
Fixes #2116

* Serialize MgmtException.errorObject as NULL for .NET Framework compat

3 years agoAllow embedded nulls in the result of mono_wasm_invoke_js (). (#44237)
Zoltan Varga [Thu, 5 Nov 2020 02:01:37 +0000 (21:01 -0500)]
Allow embedded nulls in the result of mono_wasm_invoke_js (). (#44237)

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

3 years agoSplit SslStream stream conformance tests for TLS1.2/1.3 (#44245)
Stephen Toub [Thu, 5 Nov 2020 01:33:18 +0000 (20:33 -0500)]
Split SslStream stream conformance tests for TLS1.2/1.3 (#44245)

3 years agoMove dotnet version to hardcoded version to workaround TFM change (#44224)
Drew Scoggins [Thu, 5 Nov 2020 01:32:14 +0000 (17:32 -0800)]
Move dotnet version to hardcoded version to workaround TFM change (#44224)

* Move dotnet version to hardcoded version to workaround TFM change

* Change 'windows' -> 'Windows_NT'

* Move osGroup checks back to 'windows'

* Update scenario yml

* Add crossgen path for SoD tests

3 years agoDisable DOUBLY_LINKED_FL (#44262)
Jan Kotas [Thu, 5 Nov 2020 01:17:28 +0000 (17:17 -0800)]
Disable DOUBLY_LINKED_FL (#44262)

Fixes #44250

3 years ago Use shared lock for files opened without FileAccess.Write on Linux (#44185)
David Cantú [Thu, 5 Nov 2020 00:32:38 +0000 (16:32 -0800)]
 Use shared lock for files opened without FileAccess.Write on Linux (#44185)

* Use shared lock for readonly files on Linux

* Add suggested tests

* Exclude test from OSX

* Add RemoteExecutor.IsSupported condition to tests

3 years agoUpdate IpcStreamFactory state machine to handle being started on a thread that ends...
John Salem [Thu, 5 Nov 2020 00:21:59 +0000 (16:21 -0800)]
Update IpcStreamFactory state machine to handle being started on a thread that ends (#43711)

Handles the case on Windows where Async IO is cancelled due to the thread coreclr started on ending.

3 years agoRemove MNADeprecationWorkaround in host test assets (#44259)
Elinor Fung [Wed, 4 Nov 2020 23:36:35 +0000 (15:36 -0800)]
Remove MNADeprecationWorkaround in host test assets (#44259)

3 years agoJIT: simple redundant compare optimization (#43811)
Andy Ayers [Wed, 4 Nov 2020 22:57:15 +0000 (14:57 -0800)]
JIT: simple redundant compare optimization (#43811)

For a relop, walk up the dominator tree to see if any dominating
block has a similar compare. If so, and there's just one path from
that block to the relop, the relop's value is known.

Closes #11909.

3 years agoUse SetFileInformationByHandle on FileStream.SetLength (#44170)
David Cantú [Wed, 4 Nov 2020 22:27:24 +0000 (14:27 -0800)]
Use SetFileInformationByHandle on FileStream.SetLength (#44170)

* Use SetFileInformationByHandle on FileStream.SetLength

* Remove Interop.SetEndOfFile since is no longer used

* Add manual test

* Address feedback

3 years agoAdd debugging a ci dump documentation template and script to fill info and include...
Santiago Fernandez Madero [Wed, 4 Nov 2020 20:28:33 +0000 (12:28 -0800)]
Add debugging a ci dump documentation template and script to fill info and include it on azdo test tab (#43937)

* Add debugging a ci dump documentation template and script to generate it on helix

* PR Feedback and fix helix workitems

* Fix python script and -buildid argument

* Upload doc only if dumps were found

* Pass down templatedir

* PR feedback

3 years agoUpdate buildtriage.md (#44196)
Viktor Hofer [Wed, 4 Nov 2020 19:22:34 +0000 (20:22 +0100)]
Update buildtriage.md (#44196)

* Update buildtriage.md