platform/upstream/dotnet/runtime.git
4 years agoBetter codegen / perf form Math.Max and Math.Min (#33851)
Günther Foidl [Tue, 14 Apr 2020 14:58:39 +0000 (16:58 +0200)]
Better codegen / perf form Math.Max and Math.Min (#33851)

* Forced inline of Math.Min/Max double/float

* Math.Min split in fast and slow

* Math.Min another try

* Added more tests to Math

* Picked variant "MinReorder"

4 years ago[mono] Add iOS app builder project (#34563)
Egor Bogatov [Tue, 14 Apr 2020 12:37:11 +0000 (15:37 +0300)]
[mono] Add iOS app builder project (#34563)

* Add iosAppBuilderTasks project

* Escape spaces in ProjectName

* Remove add_definitions(-DDEVICE)

* Fix typoe Buillder -> Builder, also build the task as part of mono runtime

* Rewrite HelloiOS sample (to use the task)

* Fix build

* Clean up

* Add license headers

* Clean up

* dont build app if provisionig is not set

* Add ExcludeFromAppDir input argument, remove stopwatch

* Drop DOTNET_SYSTEM_GLOBALIZATION_INVARIANT

* Address feedback

* Validate input

* fix build

* Disable GenerateXcodeProject by default

* move to mono/msbuild

* Add OutputDirectory property

* Fix sample

* Minor improvements

* fix build issues

4 years agoFix infrequent/random crashes on Windows x64 due to use of GC forwarded objects....
monojenkins [Tue, 14 Apr 2020 11:46:55 +0000 (07:46 -0400)]
Fix infrequent/random crashes on Windows x64 due to use of GC forwarded objects. (#34694)

Hard to repro and very infrequent crash. Have been analyzing a couple of crash dumps from retail devices getting different crashes related to vtable "corruption" on Windows x64. After some deeper analysis it turns out the object instance has been forwarded by GC (object vtable pointers lowest bit set to 1), but object still holds tagged vtable. This will then cause misaligned reads, getting back random values and pointers from vtable on next object access.

After some further analyzing it turns out that LLVM codegen and some specific generic vt arrays lowering can cause optimized mem copies using XMM registers. I have also identified scenarios where vt copies gets lowered into a c-runtime memcpy that in turn uses XMM registers as an optimization. Since Windows x64 currently don't include XMM registers in context, any references in XMM registers will not be visible and pinned by GC, meaning that they will point to potentially
forwarded objects after completing GC, restarting threads, leading to these infrequent random crashes.

Fix includes xmm0-xmm15 into MonoContext on Windows x64, making sure GC will see all references that could be held in those registers, regardless if getting into those registers due to LLVM optimization or other native code, like memcpy.

Co-authored-by: lateralusX <lateralusX@users.noreply.github.com>
4 years agoMerge pull request #34754 from monojenkins/sync-pr-19490-from-mono
Ankit Jain [Tue, 14 Apr 2020 05:21:40 +0000 (01:21 -0400)]
Merge pull request #34754 from monojenkins/sync-pr-19490-from-mono

[wasm][debugger] Improve some valuetype visualization

4 years ago[wasm] Disable the AOT cache check on wasm as well. (#34880)
Zoltan Varga [Tue, 14 Apr 2020 04:55:15 +0000 (00:55 -0400)]
[wasm] Disable the AOT cache check on wasm as well. (#34880)

4 years ago[runtime] Try to load assemblies from bundles on netcore before trying other methods...
Zoltan Varga [Tue, 14 Apr 2020 02:23:38 +0000 (22:23 -0400)]
[runtime] Try to load assemblies from bundles on netcore before trying other methods, the ALC might not be initialized yet. (#34877)

4 years agoPort Native libraries to SunOS (#34867)
Adeel Mujahid [Tue, 14 Apr 2020 01:20:44 +0000 (04:20 +0300)]
Port Native libraries to SunOS (#34867)

4 years agoUpdate ownership of Buffers and Drawing (#34928)
Jeff Handley [Tue, 14 Apr 2020 00:31:36 +0000 (17:31 -0700)]
Update ownership of Buffers and Drawing (#34928)

4 years agoUpdate ELT Hooks - tail calls.md (#34926)
David Mason [Tue, 14 Apr 2020 00:31:19 +0000 (17:31 -0700)]
Update ELT Hooks - tail calls.md (#34926)

4 years agoIssue incorrect exception message (#34416)
mrj001 [Mon, 13 Apr 2020 23:26:38 +0000 (17:26 -0600)]
Issue incorrect exception message (#34416)

* Created unit test to trigger incorrect error message.  This also covers a previously uncovered branch.

* Added string resource for the fractionDigits error, and changed the error message being thrown when the derived type has a larger fractionDigits value than the parent type.

4 years agoenables test (#34911)
Anirudh Agnihotry [Mon, 13 Apr 2020 22:34:41 +0000 (15:34 -0700)]
enables test (#34911)

4 years ago[mono] Implement Sse41, Pclmulqdq, Aes and enable Sse41 intrinsics (#34866)
Egor Bogatov [Mon, 13 Apr 2020 21:37:05 +0000 (00:37 +0300)]
[mono] Implement Sse41, Pclmulqdq, Aes and enable Sse41 intrinsics  (#34866)

* Implement Sse41, Pclmulqdq and Aes, enable Sse42.

4 years agoReimplement System.Net.Http's ObjectCollection<T> to reduce allocation / interface...
Stephen Toub [Mon, 13 Apr 2020 21:19:41 +0000 (17:19 -0400)]
Reimplement System.Net.Http's ObjectCollection<T> to reduce allocation / interface dispatch (#34902)

The current implementation of `ObjectCollection<T>` wraps a `List<T>` and derives from `Collection<T>`.  This means that every `ObjectCollection<T>` allocated also involves an extra `List<T>` object (and its array if items are added to it) as well as multiple levels of indirection on each operation.

We can instead just implement `ObjectCollection<T>` directly.  Since most uses end up with just a single object contained (e.g. for a `MedaTypeHeaderValue`'s `CharSet`), and since it only ever stores `T`s that are non-null classes, we can use the items field to be either a `T` or a `T[]`, optimizing for the case where a single element is stored.  In implementing it directly, we then also avoid the extra `List<T>` object allocation, as well as the interface dispatch that results from going through the `IList<T>` interface.

4 years agoCode cleanup (#34862)
Maoni Stephens [Mon, 13 Apr 2020 21:05:41 +0000 (14:05 -0700)]
Code cleanup (#34862)

made these #define's always defined -

INTERIOR_POINTERS
MARK_ARRAY (replace it with BACKGROUND_GC)
SEG_MAPPING_TABLE
GROWABLE_SEG_MAPPING_TABLE

got rid of code associated with GC_STATS, recursive_gc_sync and the following configs:
GCStressMix, GCStressStep, GCStressMaxFGCsPerBGC, GCMixLog, GCStressStart and GCStressStartAtJit.

got rid of all the unnecessary UNREFERENCED_PARAMETER
got rid of MAYBE_UNUSED_VAR

for joins, got rid of all the extra pairs of checking for #ifdef MULTIPLE_HEAPS and made code styling consistent

got rid of various other pieces of unused code and completely pointless comments.

note there is one functional change: fixed a memory leak by actually doing seg_table->delete_old_slots
when FEATURE_BASICFREEZE is defined; previously this could be leaking memory if there were more than 600
segments (which is very rare for ro segs) and it only leaks a small amount memory in that case.

Co-authored-by: Maoni Stephens <maonis@ntdev.microsoft.com>
4 years agoFix HostPolicyMock (corehost_error_writer_fn was moved) (#34903)
Egor Bogatov [Mon, 13 Apr 2020 20:33:02 +0000 (23:33 +0300)]
Fix HostPolicyMock (corehost_error_writer_fn was moved) (#34903)

4 years agofix: distinct from streams (#34918)
Bruno Garcia [Mon, 13 Apr 2020 20:32:24 +0000 (17:32 -0300)]
fix: distinct from streams (#34918)

4 years agoAdd logic for JsonIgnoreCondition[Never|WhenNull] on properties to win over global...
Layomi Akinrinade [Mon, 13 Apr 2020 19:30:00 +0000 (15:30 -0400)]
Add logic for JsonIgnoreCondition[Never|WhenNull] on properties to win over global IgnoreReadOnlyValues (#34672)

4 years agoAdd support to pass subset without arg specifier in Unix (#34844)
Santiago Fernandez Madero [Mon, 13 Apr 2020 19:22:34 +0000 (12:22 -0700)]
Add support to pass subset without arg specifier in Unix (#34844)

* Add support to pass subset without arg specifier in Unix

* PR Feedback

* Fix regex expression to match whole word

4 years agoFix bug in test regarding GC'd delegate instance. (#34901)
Aaron Robinson [Mon, 13 Apr 2020 18:22:12 +0000 (11:22 -0700)]
Fix bug in test regarding GC'd delegate instance. (#34901)

4 years agoConsole.Unix: avoid deadlock between LazyInitializer and Console.Out (#34297)
Tom Deseyn [Mon, 13 Apr 2020 17:14:12 +0000 (19:14 +0200)]
Console.Unix: avoid deadlock between LazyInitializer and Console.Out (#34297)

* Console.Unix: avoid deadlock between LazyInitializer and Console.Out

* Add assert for InternalSyncObject

* Console: use Interlocked for lazy initialization

* Cleanup unused 'using'

* Limit locking to event handlers

* Fix AllowNull -> NotNull

* Localize LazyInitializer.EnsureInitialized logic

* Remove lazy initialize delegates

* Use static local functions for initializing

* Remove unused EnsureInitializedDisposableCore

* Remove unused arg from EnsureInitializedStdInReader

* Also EnsureInitialize when not redirected

* Dispose Console Streams with their Reader/Writer

* Fix s_out -> s_error

* leaveOpen streams, fix Encoding set race

* Fix races between Encoding en initializers of In/Out/Error

* Remove EnsureInitialized

* Cleanup

* Rename static local initializer functions to EnsureInitialized

* Use lock in Input/OutputEncoding

* Rename InternalSyncObject to s_syncObject

* Cleanup space

* Fix _isStdErrRedirected -> _isStdInRedirected

* Remove space

* Improve comments

* Fix potential CancelKeyPress deadlock

* Apply suggestions from code review

Co-Authored-By: Stephen Toub <stoub@microsoft.com>
* Remove unnecessary null forgiving

* Add comment about why we're not Disposing StdInReader

* Add Volatile.Writes for Volatile.Read fields

* More Volatile.Writes

* Add back lock to SetIn

Co-authored-by: Stephen Toub <stoub@microsoft.com>
4 years agoAppend TryGetValue to ImmutableHashSet`1.Builder and ImmutableSortedSet`1.Builder...
GeorgeAlexandria [Mon, 13 Apr 2020 16:55:40 +0000 (19:55 +0300)]
Append TryGetValue to ImmutableHashSet`1.Builder and ImmutableSortedSet`1.Builder (#34869)

* Append TryGetValue method.

Append method to builder of ImmutableHashSet and ImmutableSortedSet.

Implements #28160.

* Small cleanup.

4 years agoUse 3-arg Array.Copy in ImmutableArray.CopyTo (#32387)
Marius Ungureanu [Mon, 13 Apr 2020 16:22:28 +0000 (19:22 +0300)]
Use 3-arg Array.Copy in ImmutableArray.CopyTo (#32387)

4 years ago[wasm] Configure the wasm target runtime using --with-lazy-gc-… (#34878)
Zoltan Varga [Mon, 13 Apr 2020 07:18:50 +0000 (03:18 -0400)]
[wasm] Configure the wasm target runtime using --with-lazy-gc-… (#34878)

This flag got lost in the move to mono.proj.

4 years agoLoopbackServer.ReadAsync: Fixed data corruption bug (#34875)
TalAloni [Mon, 13 Apr 2020 00:34:31 +0000 (03:34 +0300)]
LoopbackServer.ReadAsync: Fixed data corruption bug (#34875)

This caused the unused parts of the temp buffer to be copied to buffer, returning 0 to the caller instead of the actual data.
This caused several tests to fail when targeting .NET Standard 2.0

4 years agoFix corlib and runtime rules in Makefile (#34868)
Egor Bogatov [Sun, 12 Apr 2020 18:25:58 +0000 (21:25 +0300)]
Fix corlib and runtime rules in Makefile (#34868)

4 years agoRename CoreFx.Private.TestUtilities.Unicode to TestUtilities.Unicode (#34836)
Levi Broderick [Sun, 12 Apr 2020 17:36:36 +0000 (10:36 -0700)]
Rename CoreFx.Private.TestUtilities.Unicode to TestUtilities.Unicode (#34836)

And explicitly reference it from solutions which consume it

4 years agoFix System.Runtime version referenced by S.R.CS.Unsafe (#34870)
Jan Kotas [Sun, 12 Apr 2020 17:21:31 +0000 (10:21 -0700)]
Fix System.Runtime version referenced by S.R.CS.Unsafe (#34870)

* Fix System.Runtime version referenced by S.R.CS.Unsafe

* Feedback

4 years agoremove unused local of genId in BinaryObjectReader (#34865)
Eriawan Kusumawardhono [Sun, 12 Apr 2020 14:27:19 +0000 (21:27 +0700)]
remove unused local of genId in BinaryObjectReader (#34865)

4 years agoMove "hostpolicy" pinvokes to Interop.HostPolicy.cs (#34813)
Egor Bogatov [Sun, 12 Apr 2020 13:03:23 +0000 (16:03 +0300)]
Move "hostpolicy" pinvokes to Interop.HostPolicy.cs (#34813)

4 years agoOptimize HttpDateParser.TryStringToDate (#34860)
Stephen Toub [Sun, 12 Apr 2020 12:12:33 +0000 (08:12 -0400)]
Optimize HttpDateParser.TryStringToDate (#34860)

* Optimize HttpDateParser.TryStringToDate

When HttpResponseMessage headers are enumerated, even though SocketsHttpHandler adds headers with TryAddWithoutValidation, the enumeration ends up validating them (that's something to be discussed and follow-up on separately).  As part of that, it validates the Date header that's required of most responses. It does so using DateTimeOffset.TryParseExact, but using a long list of allowed formats as well as options that knock TryParseExact's processing off the fast path.  Since most responses are going to contain a date using RFC1123 format (aka "r"), we just try that first, in a way that will generally result in hitting the optimized "r" code path which is much faster.

* Address PR feedback

4 years agoReduce libraries build matrix with mono (#34835)
Santiago Fernandez Madero [Sun, 12 Apr 2020 12:12:02 +0000 (05:12 -0700)]
Reduce libraries build matrix with mono (#34835)

4 years agoFix incorrect behavior noted while compiling large aspnet application with debug...
David Wrighton [Sun, 12 Apr 2020 10:20:01 +0000 (03:20 -0700)]
Fix incorrect behavior noted while compiling large aspnet application with debug build of compiler (#34842)

- Multi-thread handling of UnboxingMethodDesc was incorrect. It would result in incorrect caching of fixups to unboxing methods
- ldtoken of a static method on a valuetype should not refer to an unboxing stub

4 years agoSeveral allocation reductions in SocketsHttpHandler (#34724)
Stephen Toub [Sat, 11 Apr 2020 18:21:37 +0000 (14:21 -0400)]
Several allocation reductions in SocketsHttpHandler (#34724)

* Remove state machine allocation for SendWithNtConnectionAuthAsync

Just manually inline the tiny helper that's only used from one call site.

* Remove unnecessary HeaderStoreItemInfo allocations

For the common case of a raw string, let the dictionary store the raw string directly rather than always wrapping it in a HeaderStoreItemInfo.

* Cache Date and Server response header values

For Server, we expect it to be the same for every request on the same connection.

For Date, if we're making lots of requests in a high-throughput fashion, we expect many responses on the same connection to have the same value.

In both cases, we compare the received value against the last one received, and if it's the same, reuse the same string.

4 years agoMore analyzer changes (#34843)
Prashanth Govindarajan [Sat, 11 Apr 2020 17:33:54 +0000 (10:33 -0700)]
More analyzer changes (#34843)

4 years agoUpdate dependencies from https://github.com/mono/linker build 20200410.1 (#34851)
dotnet-maestro[bot] [Sat, 11 Apr 2020 16:58:05 +0000 (16:58 +0000)]
Update dependencies from https://github.com/mono/linker build 20200410.1 (#34851)

- ILLink.Tasks: 5.0.0-preview.3.20209.2 -> 5.0.0-preview.3.20210.1

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
4 years agoAdd native configurations for SunOS (#34756)
Adeel Mujahid [Sat, 11 Apr 2020 16:03:18 +0000 (19:03 +0300)]
Add native configurations for SunOS (#34756)

4 years agoHttpWebRequest allow returning redirect response (#34560)
Matthew R Johnson [Sat, 11 Apr 2020 15:55:51 +0000 (16:55 +0100)]
HttpWebRequest allow returning redirect response (#34560)

* HttpWebRequest allow returning redirect response

Throw WebException for 3xx responses only when `AllowAutoRedirect = true`

Fixes #1074

* Simplify status code check

4 years agoFixed a typo in ValueType.cs (#34854)
Sergio Pedri [Sat, 11 Apr 2020 15:44:34 +0000 (17:44 +0200)]
Fixed a typo in ValueType.cs (#34854)

4 years agoReduce allocations in UriHelper.StripBidiControlCharacters (#34794)
Miha Zupan [Sat, 11 Apr 2020 14:43:15 +0000 (16:43 +0200)]
Reduce allocations in UriHelper.StripBidiControlCharacters (#34794)

* Reduce allocations in UriHelper.StripBidiControlCharacters

* Use Span in StripBidiControlCharacters

* Span > char*

4 years agoAdd test for DOTNET_SYSTEM_THREADING_POOLASYNCVALUETASKS (#34818)
Stephen Toub [Sat, 11 Apr 2020 13:40:31 +0000 (09:40 -0400)]
Add test for DOTNET_SYSTEM_THREADING_POOLASYNCVALUETASKS (#34818)

4 years agoFix System.Private.Uri.sln hang on load (#34848)
Miha Zupan [Sat, 11 Apr 2020 13:39:52 +0000 (15:39 +0200)]
Fix System.Private.Uri.sln hang on load (#34848)

4 years agoEnable test in System.Reflection.Extensions (#6445) (#34815)
Thorsten Reichert [Sat, 11 Apr 2020 09:48:57 +0000 (11:48 +0200)]
Enable test in System.Reflection.Extensions (#6445) (#34815)

Fixes #6445.

Enabled GetCustom_Attribute_On_Return_Parameter_On_Parent_Method in System.Reflection.Extension Tests.

Note: had to change the attribute to inherit true on the parent class, so that the attribute could actually be retrieved from the derived class

* port CoreClr fix (https://github.com/dotnet/coreclr/pull/6745) to Mono

apply the same check for parameter position = -1 in Mono as is done in CoreClr

4 years ago[wasm][bcl] Handle correctly backslash in file name (#34746)
monojenkins [Sat, 11 Apr 2020 07:41:22 +0000 (03:41 -0400)]
[wasm][bcl] Handle correctly backslash in file name (#34746)

- Modify IO file to assign backslash to alternate directory separator by default
- Add tests for issue https://github.com/mono/mono/issues/18933

closes: https://github.com/mono/mono/issues/18933

<!--
Thank you for your Pull Request!

If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.

Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->

Co-authored-by: kjpou1 <kjpou1@users.noreply.github.com>
4 years ago[R2RDump] Fix x86 gcinfo formatting (#34847)
Jan Kotas [Sat, 11 Apr 2020 05:06:21 +0000 (22:06 -0700)]
[R2RDump] Fix x86 gcinfo formatting (#34847)

4 years agoUse canonical method in TransitionFrames whenever we parse signatures (#33733)
Fadi Hanna [Sat, 11 Apr 2020 05:04:42 +0000 (22:04 -0700)]
Use canonical method in TransitionFrames whenever we parse signatures (#33733)

* Canonicalize arguments before loading instantiation when dropGenericArgumentLevel is TRUE

* Fix casing in COMPlus_GCStress env variable and remove COMPlus_gcServer

Also changing a bunch of assert() calls to _ASSERTE. Usually when _ASSERTE fails in CI lab runs, we tend to get crash dumps associated with test results, unlike assert() which shows a GUI dialog that DHandler dismisses by clicking on the Abort button.

* Remove gcstress switch.

The test will run with gcstress as part of the gcstress lab runs

4 years agoFixAcceleratedCompiledMethodEnum (#34841)
David Wrighton [Sat, 11 Apr 2020 05:03:41 +0000 (22:03 -0700)]
FixAcceleratedCompiledMethodEnum (#34841)

- Implementation checked in earlier today resulted in a non-sorted RUNTIMEFUNCTION list which caused unpredictable runtime failures
- Assertions around MethodCodeNode handling in EnumerateCompiledMethods were wrong

4 years agoRemove ActiveIssue from tests. (#34719)
Aaron Robinson [Sat, 11 Apr 2020 03:33:29 +0000 (20:33 -0700)]
Remove ActiveIssue from tests. (#34719)

* Remove ActiveIssue from tests.
Update tests to pass since issues are being marked "Won't Fix".

4 years agoBuild corelib as part of libraries build. (#34664)
Manish Godse [Sat, 11 Apr 2020 03:26:51 +0000 (20:26 -0700)]
Build corelib as part of libraries build.  (#34664)

* simplify libraries build dependencies.

* FIx depends for tests

* Fix artifact name for webAssembly

* try building corelib during libraries build.

* small typo

* Merge coreclr+libraries build scripts

* update scripts based on new refactor

* fix script error

* dont build corelib for mono or testbuilds

* Handle webassembly case

* fix allconfigurations build

* remove separate corelib job

* remove corelib jobs from pipelines

* delete build-corelib-job

* PR feedback

* remove special case for webassembly

now that its dependent on the mono runtimeFlavor

4 years agoAdd Socket(SocketSafeHandle) ctor (#34727)
Stephen Toub [Fri, 10 Apr 2020 23:54:09 +0000 (19:54 -0400)]
Add Socket(SocketSafeHandle) ctor (#34727)

4 years agoMerge pinvoke guidelines into interop guidelines (#34833)
Dan Moseley [Fri, 10 Apr 2020 23:46:56 +0000 (16:46 -0700)]
Merge pinvoke guidelines into interop guidelines (#34833)

4 years agoremoved unused vars from System.DirectoryServices.AccountManagement (#34159)
Stefan Nikolei [Fri, 10 Apr 2020 23:34:21 +0000 (01:34 +0200)]
removed unused vars from System.DirectoryServices.AccountManagement (#34159)

* removed unused vars from System.DirectoryServices.AccountManagement

removed all unused locals and class variables. also added some _ to out vars

* fix build errors.

removed assignments to non existent vars
added one var back because it was used

* remove trailing whitespace

4 years agoUse repo build script to restore internal tools (#34830)
Santiago Fernandez Madero [Fri, 10 Apr 2020 23:05:39 +0000 (16:05 -0700)]
Use repo build script to restore internal tools (#34830)

4 years agoComWrappers: Add support for ICustomQueryInterface (#34733)
Aaron Robinson [Fri, 10 Apr 2020 22:31:50 +0000 (15:31 -0700)]
ComWrappers: Add support for ICustomQueryInterface  (#34733)

* Add support for falling back to ICustomQueryInterface if the managed object wrapper
 doesn't know about the IID but implements the interface.

* The QI on the managed object wrapper is now callable from within the runtime.
This means we can no longer assume we are in preemptive mode during the QI.
Update the ICustomQueryInterface dispatch to be okay with ANY mode.

4 years agosubsets help (#34673)
Dan Moseley [Fri, 10 Apr 2020 21:42:43 +0000 (14:42 -0700)]
subsets help (#34673)

4 years agoFix GenerateCoverageReport target in tests.proj (#34829)
Santiago Fernandez Madero [Fri, 10 Apr 2020 21:30:36 +0000 (14:30 -0700)]
Fix GenerateCoverageReport target in tests.proj (#34829)

4 years agoFix installer CI job warnings for iOS/tvOS/Android (#34763)
Alexander Köplinger [Fri, 10 Apr 2020 21:09:50 +0000 (23:09 +0200)]
Fix installer CI job warnings for iOS/tvOS/Android (#34763)

We don't run tests in the installer for these OSes so the PublishTestResults task complains about missing *.xml result files.

4 years ago[master] Update dependencies from mono/linker Microsoft/vstest (#34760)
dotnet-maestro[bot] [Fri, 10 Apr 2020 21:06:34 +0000 (17:06 -0400)]
[master] Update dependencies from mono/linker Microsoft/vstest (#34760)

* Update dependencies from https://github.com/microsoft/vstest build 20200408-06

- Microsoft.NET.Test.Sdk: 16.6.0 -> 16.7.0-preview-20200408-06

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

- ILLink.Tasks: 5.0.0-preview.3.20207.1 -> 5.0.0-preview.3.20209.2

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
4 years agoRemove gcstress switch.
Fadi Hanna [Fri, 10 Apr 2020 19:39:49 +0000 (12:39 -0700)]
Remove gcstress switch.

The test will run with gcstress as part of the gcstress lab runs

4 years agoAdd check for unloaded types in GetAppDomainStaticAddress (#34677)
David Mason [Fri, 10 Apr 2020 18:26:00 +0000 (11:26 -0700)]
Add check for unloaded types in GetAppDomainStaticAddress (#34677)

Fixes #33367

When a module is unloaded, the managed objectref is collected during a GC before the profiler is notified that the module is unloading. That means if you call in to GetAppDomainStaticAddress between when the object is collected and when you are notified about the module unload (GarbageCollectionFinished is a place that will hit this every time) it will cause an AV from trying to use the null objectref.

This fix prevents this AV by checking to see if the object's loaderheap or managed loaderheap object ref are invalid first.

4 years agoEnumerate compiled methods faster (#34729)
David Wrighton [Fri, 10 Apr 2020 18:01:59 +0000 (11:01 -0700)]
Enumerate compiled methods faster (#34729)

* Enumerate compiled methods faster
- Split up the data structure that holds the list of compiled methods into per module, generic and non-generic method lists.
- Hold IMethodNodes in the data structure instead of MethodDescs
- This delivers a *significant* improvement to compile times for composite image build
  - A sample application went from 456 seconds to compile down to 100 seconds in wall clock time

4 years agoSingle-file diagnostic support for SOS. (#34697)
Mike McLaughlin [Fri, 10 Apr 2020 17:22:01 +0000 (10:22 -0700)]
Single-file diagnostic support for SOS. (#34697)

Single-file diagnostic support.

This will allow SOS, dotnet-dump, etc. to work for single-file programs on Linux. An library called runtimeinfo_lib is generated that is to be linked into the single-file superhost containing coreclr.

Added "DotNetRuntimeInfo" export/block containing the symbol index/build ids needed by the diagnostic tools.

Added ICLRRuntimeLocator DAC interface for SOS and other DAC clients so their data targets can provide the single-file runtime base address.

Added the GetModuleIndex tool to get build ids.

PAL fix for single-file superhost.

Fix elfreader allocation assert in debug. The 'new' did not use utilcode overrides but the 'delete' did.

Added a line to the build-job.yml pipeline to build the new clr.diagtools subset before the native coreclr runtime build because it uses the build-runtime scripts directly.

Added a Versions.props property for the Microsoft.FileFormats version and updated it to the latest.

Changed the GetModuleIndex to take an input and output file instead of using output redirection to write it because some messages from the dotnet.cmd script used to run it got written to the output h file.

Added FEATURE_SINGLE_FILE_DIAGNOSTICS cmake flag so build-runtime.sh can work without clr.buildtools subset

4 years agoRemove most [Fact(Skip = "...")] in library tests (#34772)
Stephen Toub [Fri, 10 Apr 2020 16:51:48 +0000 (12:51 -0400)]
Remove most [Fact(Skip = "...")] in library tests (#34772)

4 years ago[wasm][debugger] Improve some valuetype visualization
radical [Fri, 10 Apr 2020 16:50:40 +0000 (16:50 +0000)]
[wasm][debugger] Improve some valuetype visualization

- Invoke getters for certain types that we know are safe, like `System.DateTime`
- Use `.ToString()` to show as description for some types, like `System.DateTime`
- Show char symbol along with the code

Fixes:
https://github.com/mono/mono/issues/19380
https://github.com/mono/mono/issues/19381
https://github.com/mono/mono/issues/19411

4 years agoReduce allocations in string.Normalize (#34774)
Miha Zupan [Fri, 10 Apr 2020 16:49:58 +0000 (18:49 +0200)]
Reduce allocations in string.Normalize (#34774)

* Reduce allocations in string.Normalize

* Move stackalloc out of the loop

* Use char* instead of ref char, pin manually

* Mark methods unsafe instead of using unsafe blocks

* Return the original string if unchanged

* Use const for StackallocThreshold

4 years agoInvalidate FileInfo and DirectoryInfo upon create and delete (#34229)
Jacob Lalonde [Fri, 10 Apr 2020 16:41:49 +0000 (12:41 -0400)]
Invalidate FileInfo and DirectoryInfo upon create and delete (#34229)

* Invalidate upon delete and create for fileinfo and directoryinfo

* Add tests, remove directory info test that tested removed behavior

* Add delete test

* Fix typoe in directoryinfo

* Remove new line, and refactor away private method into delete method with paramter

* Change set time tests

* Code review linting as well as test change

* Modify other test that tested prior behavior

* Rework Reset test

* Edits for comments in tests

* Slight method refactor

* Minor test cleanup

4 years agoFix condition for building runtime.native.System.IO.Ports (#34738)
Eric StJohn [Fri, 10 Apr 2020 16:32:01 +0000 (09:32 -0700)]
Fix condition for building runtime.native.System.IO.Ports (#34738)

4 years agoRemove mono/btls directory from source mirror (#34819)
Alexander Köplinger [Fri, 10 Apr 2020 16:16:16 +0000 (18:16 +0200)]
Remove mono/btls directory from source mirror (#34819)

We won't use btls in the netcore mono.

4 years agouse localSystem to start the service (#34802)
Anirudh Agnihotry [Fri, 10 Apr 2020 15:41:45 +0000 (08:41 -0700)]
use localSystem to start the service (#34802)

4 years agoDon't swap base and index if index is float reg (#34771)
Carol Eidt [Fri, 10 Apr 2020 14:56:49 +0000 (07:56 -0700)]
Don't swap base and index if index is float reg (#34771)

* Don't swap base and index if index is float reg

Fix #33363

4 years agoAdd copy constructor to JsonSerializerOptions (#34725)
Layomi Akinrinade [Fri, 10 Apr 2020 14:41:51 +0000 (10:41 -0400)]
Add copy constructor to JsonSerializerOptions (#34725)

* Add copy constructor to JsonSerializerOptions

* Address review comments

* Address review feedback - null check and reflection based test

4 years agoRemoved ENABLE_FAST_GCPOLL_HELPER (#34796)
Vladimir Sadov [Fri, 10 Apr 2020 14:06:54 +0000 (07:06 -0700)]
Removed ENABLE_FAST_GCPOLL_HELPER (#34796)

* Removed ENABLE_FAST_GCPOLL_HELPER

* check trap flag in JIT_PollGC

* JIT_PollGC_Framed

4 years agoEnable System.Runtime.Serialization.Xml test assembly for Mono on Windows (#34816)
Maxim Lipnin [Fri, 10 Apr 2020 13:26:35 +0000 (16:26 +0300)]
Enable System.Runtime.Serialization.Xml test assembly for Mono on Windows (#34816)

Follow-up to https://github.com/dotnet/runtime/pull/32592#pullrequestreview-391381885.

4 years ago Include key when throwing KeyNotFoundException in indexer (#34759)
Lennart Brüggemann [Fri, 10 Apr 2020 12:35:59 +0000 (14:35 +0200)]
 Include key when throwing KeyNotFoundException in indexer (#34759)

* Include key when throwing KeyNotFoundException in indexer

* Add quotes around replacement markers to be consistent with other strings

4 years ago[mono] Remove CoreFX.issues_windows.rsp file (#32592)
Maxim Lipnin [Fri, 10 Apr 2020 10:41:57 +0000 (13:41 +0300)]
[mono] Remove CoreFX.issues_windows.rsp file (#32592)

Changes:
- enabled `runtime (Libraries Test Run release mono Windows_NT x64 Debug)` CI lane (Windows Nano Server CI leg is disabled);
- enabled the tests that pass;
- marked failing test assemblies/classes/methods with `ActiveIssue` attribute using respective GH issues;
- removed CoreFX.issues_windows.rsp file and related mono rsp arguments.

Fixes #1980

4 years agoAdd beginnings of WebAssembly build support for mono. (#33551)
Zoltan Varga [Fri, 10 Apr 2020 10:17:58 +0000 (06:17 -0400)]
Add beginnings of WebAssembly build support for mono. (#33551)

* Set emcc as the compiler for libraries build

* Add default subsets for webassembly build

* Fix various problems in the build

* Use WebAssembly Docker image

* Use Mono runtime for webassembly builds

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
4 years agoRemove warning suppression for wrappers no longer marked obsolete (#34792)
Elinor Fung [Fri, 10 Apr 2020 06:16:41 +0000 (23:16 -0700)]
Remove warning suppression for wrappers no longer marked obsolete (#34792)

4 years ago[wasm][bcl][zoneinfo] Fix local zone info marshaling (#34762)
monojenkins [Fri, 10 Apr 2020 03:41:55 +0000 (23:41 -0400)]
[wasm][bcl][zoneinfo] Fix local zone info marshaling (#34762)

- Correctly marshal Intl.DateTimeFormat().resolvedOptions().timeZone information

/cc @pranavkm

Thanks for the report and testing Pranav

<!--
Thank you for your Pull Request!

If you are new to contributing to Mono, please try to do your best at conforming to our coding guidelines http://www.mono-project.com/community/contributing/coding-guidelines/ but don't worry if you get something wrong. One of the project members will help you to get things landed.

Does your pull request fix any of the existing issues? Please use the following format: Fixes #issue-number
-->

Co-authored-by: kjpou1 <kjpou1@users.noreply.github.com>
4 years agoChange policheck words (#34775)
Anirudh Agnihotry [Fri, 10 Apr 2020 02:41:51 +0000 (19:41 -0700)]
Change policheck words (#34775)

* change policheck words

* Apply suggestions from code review

Co-Authored-By: Eric StJohn <ericstj@microsoft.com>
Co-authored-by: Dan Moseley <danmose@microsoft.com>
Co-authored-by: Eric StJohn <ericstj@microsoft.com>
4 years agoAdd arg aliases for runtimeConfiguration and librariesConfiguration (#34743)
Santiago Fernandez Madero [Fri, 10 Apr 2020 01:09:26 +0000 (18:09 -0700)]
Add arg aliases for runtimeConfiguration and librariesConfiguration (#34743)

* Add arg aliases for runtimeConfiguration and librariesConfiguration

* Add subset alias

4 years ago[llvm] Fix a crash in JIT mode. (#34766)
monojenkins [Thu, 9 Apr 2020 21:07:33 +0000 (17:07 -0400)]
[llvm] Fix a crash in JIT mode. (#34766)

Co-authored-by: vargaz <vargaz@users.noreply.github.com>
4 years agoFix casing in COMPlus_GCStress env variable and remove COMPlus_gcServer
Fadi Hanna [Tue, 7 Apr 2020 19:19:26 +0000 (12:19 -0700)]
Fix casing in COMPlus_GCStress env variable and remove COMPlus_gcServer

Also changing a bunch of assert() calls to _ASSERTE. Usually when _ASSERTE fails in CI lab runs, we tend to get crash dumps associated with test results, unlike assert() which shows a GUI dialog that DHandler dismisses by clicking on the Abort button.

4 years agoReenable some disabled warnings in CoreCLR (#34659)
Ivan Diaz Sanchez [Thu, 9 Apr 2020 20:57:52 +0000 (13:57 -0700)]
Reenable some disabled warnings in CoreCLR (#34659)

* First fixes to print hex without silencing warning 4477.

* After the previous commit, dasm.cpp started showing abnormalities.

* Warning 4302 reenable iteration 1

* Warning 4302 reenable iteration 2

* Warning 4312 reenable: Iteration 1

* Warning 4312 reenable: Iteration 2

* Updated configurecompiler.cmake comments with newly reenabled warnings.

* Fixed a comment.

* Fixed a 32-bit issue with printing formats as well as a scope issue on Linux.

* Warning 4302/4311/4477 reenable: Fixed Checked Builds.

* Warning 4302/4311/4477 iteration 3

* Warning 4477 reenable iteration 4: ToString of bits.

* Fixed an unsigned long long for x86.

* Fixed 4477 on x86 for real this time.

* Changed two bitness checks for size_t usage instead.

4 years agoMerge pull request #34710 from am11/feature/docs
Jan Vorlicek [Thu, 9 Apr 2020 19:12:50 +0000 (21:12 +0200)]
Merge pull request #34710 from am11/feature/docs

Add note about building PAL tests in docs

4 years agoAdd note about building PAL tests in docs
Adeel [Thu, 9 Apr 2020 19:11:35 +0000 (22:11 +0300)]
Add note about building PAL tests in docs

4 years agoAdd Task.WhenAny(task, task) overload (#34288)
Stephen Toub [Thu, 9 Apr 2020 18:28:14 +0000 (14:28 -0400)]
Add Task.WhenAny(task, task) overload (#34288)

Currently internal and used as an implementation detail under Task.WhenAny(params Task[]) as well as from SemaphoreSlim.  Once API reviewed, it can be made public.

4 years agoMerge pull request #34079 from NikolaMilosavljevic/libicu66
Nikola Milosavljevic [Thu, 9 Apr 2020 18:25:18 +0000 (11:25 -0700)]
Merge pull request #34079 from NikolaMilosavljevic/libicu66

Add libicu66 dependency

4 years ago[Arm64] Change uint to Vector64<uint> in Sha1 intrinsics (#34730)
Egor Chesakov [Thu, 9 Apr 2020 17:58:44 +0000 (10:58 -0700)]
[Arm64] Change uint to Vector64<uint> in Sha1 intrinsics (#34730)

* Change "uint hash_e" to "Vector64<uint> hash_e" since the value must be in a SIMD & FP register in Sha1.cs Sha1.PlatformNotSupported.cs

* Update System.Runtime.Intrinsics.Experimental.cs

* Update hwintrinsiclistarm64.h

* Fix formatting in GenerateTests.csx

* Rename IF_DR_2J -> IF_DV_2U since sha1h operates on SIMD&FP registers in emitarm64.cpp emitfmtsarm64.h instrsarm64.h

* Add Sha256 in GenerateTests.csx

* Add Sha256/

* Add Sha1/

* Add Sha1 in GenerateTests.csx

4 years agoRemove dead COM slot code. (#34702)
Aaron Robinson [Thu, 9 Apr 2020 17:05:04 +0000 (10:05 -0700)]
Remove dead COM slot code. (#34702)

4 years agoinclude POH in diagnostic APIs like walk_survivors. (#34567)
Vladimir Sadov [Thu, 9 Apr 2020 16:52:48 +0000 (09:52 -0700)]
include POH in diagnostic APIs like walk_survivors. (#34567)

* include POH in diagnostic APIs like walk_survivors.

* PR feedback

4 years agoOptimize newline handling for RegexOptions.Multiline (#34566)
Stephen Toub [Thu, 9 Apr 2020 16:36:10 +0000 (12:36 -0400)]
Optimize newline handling for RegexOptions.Multiline (#34566)

* Optimize newline handling for RegexOptions.Multiline

We previously didn't do any special handling of beginning-of-line anchors (^ when RegexOptions.Multiline is specified).  This PR adds special handling for the anchor so that FindFirstChar will jump to the next newline as part of its processing.

As part of this, I also cleaned up some of the anchor handling code.  The RegexPrefixAnalyzer only ever returns a single anchor, but the rest of the code was written such that it was expecting multiple anchors.

* Addres PR feedback

Also factor out a few lines of duplication.

4 years agoEnable importing PEM-formatted keys into AsymmetricAlgorithm values
Kevin Jones [Thu, 9 Apr 2020 16:23:17 +0000 (12:23 -0400)]
Enable importing PEM-formatted keys into AsymmetricAlgorithm values

4 years agofixed typo @SerializerCycleDetected (#34700)
Nico Kranz [Thu, 9 Apr 2020 16:13:48 +0000 (16:13 +0000)]
fixed typo @SerializerCycleDetected (#34700)

ReferenceHanlding -> Reference Handling

4 years agoAllow Dictionary overwrites during enumeration (#34667)
Stephen Toub [Thu, 9 Apr 2020 15:54:15 +0000 (11:54 -0400)]
Allow Dictionary overwrites during enumeration (#34667)

4 years agoFixes intellisense for vscode and VS, it also enables testing in Test Explorer (...
Anirudh Agnihotry [Thu, 9 Apr 2020 15:06:50 +0000 (08:06 -0700)]
Fixes intellisense for vscode and VS, it also enables testing in Test Explorer (#34721)

* fixes vscode and test explorer

* adding comment

4 years agoReport POH in ETW events (#34549)
Vladimir Sadov [Thu, 9 Apr 2020 09:34:03 +0000 (02:34 -0700)]
Report POH in ETW events (#34549)

* Report POH in existing events, when fitting.

* GCGenerationRange (descr_generations_to_profiler)

* GCBasicProfiler::GarbageCollectionStarted    tolerate gen 4

* More profiler fixes

* BGCOverflow_V1

* GCHeapStats_V1

* PR feedback

4 years agoWasm debug log level (#34723)
monojenkins [Thu, 9 Apr 2020 07:58:26 +0000 (03:58 -0400)]
Wasm debug log level (#34723)

enable_debugging was already an int, with this change log_level
    will remain at 1 by default but passing -1 will disable the log
    spew

Co-authored-by: lewing <lewing@users.noreply.github.com>
4 years agoCanonicalize arguments before loading instantiation when dropGenericArgumentLevel...
Fadi Hanna [Wed, 18 Mar 2020 20:03:29 +0000 (13:03 -0700)]
Canonicalize arguments before loading instantiation when dropGenericArgumentLevel is TRUE

4 years agoRemove -Bsymbolic-functions option as -Bsymbolic is already set (#34705)
Elinor Fung [Thu, 9 Apr 2020 05:38:27 +0000 (22:38 -0700)]
Remove -Bsymbolic-functions option as -Bsymbolic is already set (#34705)

4 years agoAdd EccSecurityTransforms to credscan suppresions to unblock code-mirror (#34735)
Santiago Fernandez Madero [Thu, 9 Apr 2020 05:22:37 +0000 (22:22 -0700)]
Add EccSecurityTransforms to credscan suppresions to unblock code-mirror (#34735)

4 years agoRemove Obsolete attribute from some COM related types. (#34692)
Aaron Robinson [Thu, 9 Apr 2020 03:20:53 +0000 (20:20 -0700)]
Remove Obsolete attribute from some COM related types. (#34692)