platform/upstream/dotnet/runtime.git
4 years agoRename Crossgen2 dependency graph ETW event source (#37731)
Simon Nattress [Thu, 11 Jun 2020 18:14:45 +0000 (11:14 -0700)]
Rename Crossgen2 dependency graph ETW event source (#37731)

When crossgen2 is run with `Microsoft-ILCompiler-Perf` provider enabled, events are not named properly in PerfView (`Microsoft-ILCompiler-Perf/EventID(1)` instead of `Compilation/Start`) and an error event indicating multiple EventSource instances with the same GUID are enabled:
```
    ERROR: Exception in Command Processing for EventSource Microsoft-ILCompiler-Perf: An instance of EventSource with Guid 607164a4-cacb-5f22-92fb-62a11541e285 already exists.
```

Name the dependency analysis EventSource `Microsoft-ILCompiler-Graph-Perf` to distinguish between the two.

4 years agoRemove CopyTo{Async} delegate overloads (#37750)
Stephen Toub [Thu, 11 Jun 2020 18:11:14 +0000 (14:11 -0400)]
Remove CopyTo{Async} delegate overloads (#37750)

We added these earlier in the .NET 5 cycle, but they're not providing the benefits we hoped, and are likely to cause confusion and actually result in de-optimizations in some cases.  We can re-add them in the future should a stronger need / impact present itself.

4 years agoAnnotate System.IO.Packaging for nullable reference types (#37654)
Stephen Toub [Thu, 11 Jun 2020 17:29:58 +0000 (13:29 -0400)]
Annotate System.IO.Packaging for nullable reference types (#37654)

* Annotate System.IO.Packaging for nullable reference types

* Address PR feedback

4 years agoRemove SocketAsyncEngine.Token (#36339)
Tom Deseyn [Thu, 11 Jun 2020 16:18:23 +0000 (18:18 +0200)]
Remove SocketAsyncEngine.Token (#36339)

* Remove SocketAsyncEngine.Token

This removes SocketAsyncEngine.Token. The token ensured each socket
has a unique key for receiving events on a poll thread.

These unique tokens were introduced to deal with fd recyling leading
to false events being delivered to the new socket (when the fd is used
as the key).

This is not an issue for most operations because they can be retried.
It is an issue specifically for the connect operation which is an
on-going operation for which the status must be read using SO_ERROR
socket option when the socket becomes writable.

The connect-case is solved by checking the socket is writable
before reading the SO_ERROR socket option.

By using the fd as handles we can remove the logic for generated
unique tokens, which includes spinning up additional poll threads
in case unique handles are exhausted.

* Remove handle from dictionary when TryChangeSocketEventRegistration fails

* Remove _isRegistered field

* Update after merge

* Remove double TryRemove

* Throw on duplicate handle add

* Add comment about thread-safety between Register and StopAndAbort

4 years agoRemove quirks for macOS Sierra. (#37688)
Kevin Jones [Thu, 11 Jun 2020 15:58:58 +0000 (11:58 -0400)]
Remove quirks for macOS Sierra. (#37688)

* Remove functional quirks for macOS Sierra.

* Fix other operating systems.

4 years agoEnregister multireg lclVars (#36862)
Carol Eidt [Thu, 11 Jun 2020 15:16:37 +0000 (08:16 -0700)]
Enregister multireg lclVars (#36862)

* Enregister multireg lclVars

Allow struct lclVars that are returned in multiple registers to be
enregistered, as long as the fields are a match for the registers.

Fix #34105

4 years ago[libraries] Add assembly level ActiveIssue for System.Globalization (#37715)
Mitchell Hwang [Thu, 11 Jun 2020 14:30:19 +0000 (10:30 -0400)]
[libraries] Add assembly level ActiveIssue for System.Globalization (#37715)

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
4 years ago[libraries] Extend PlatformDetection.IsOSX to include all Apple OS (#37707)
Mitchell Hwang [Thu, 11 Jun 2020 14:29:25 +0000 (10:29 -0400)]
[libraries] Extend PlatformDetection.IsOSX to include all Apple OS (#37707)

* [libraries] Replacee IsNotApple with IsApple

* [libraries] Extend PlatformDetection.IsOSX to include all Apple OS

* [libraries] Remove test case from DateTimeFormatInfoData

* [Libraries] Rename IsApple to IsOSXLike

* [libraries] Revert GdiplusTests condition from IsOSXLike to IsOSX

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
4 years agoImplement RID for SunOS-derived operating systems (#37016)
Adeel Mujahid [Thu, 11 Jun 2020 13:31:12 +0000 (16:31 +0300)]
Implement RID for SunOS-derived operating systems (#37016)

* Implement RID for SunOS-derived operating systems

* Use official capitalization  in all strings

* Compile get rid functions separately

4 years agoDisable System.Security.Cryptography.* tests for wasm. (#37723)
Steve Pfister [Thu, 11 Jun 2020 11:58:55 +0000 (07:58 -0400)]
Disable System.Security.Cryptography.* tests for wasm. (#37723)

Since we aren't shipping openssl and browser crypto interop requires sync over async, we need to disable the tests until a viable solution is found.

4 years agoFix libraries config for the R2R pipelines (#37737)
Tomáš Rylek [Thu, 11 Jun 2020 10:16:55 +0000 (12:16 +0200)]
Fix libraries config for the R2R pipelines (#37737)

4 years agoAnnotate LoadFrom/Load from byte array as linker unsafe (#37704)
Michal Strehovský [Thu, 11 Jun 2020 08:35:48 +0000 (10:35 +0200)]
Annotate LoadFrom/Load from byte array as linker unsafe (#37704)

4 years agoflush SslStream between messages (#37632)
Tomas Weinfurt [Thu, 11 Jun 2020 06:53:20 +0000 (23:53 -0700)]
flush SslStream between messages (#37632)

* flush SslStream between messages

* add flush when we create tls alert

Co-authored-by: Tomas Weinfurt <furt@Shining.local>
4 years agoClean up Latin1Encoding implementation and vectorize its logic (#32994)
Levi Broderick [Thu, 11 Jun 2020 06:44:27 +0000 (23:44 -0700)]
Clean up Latin1Encoding implementation and vectorize its logic (#32994)

* Clean up Latin1Encoding implementation
- Vectorizes Latin1 narrowing / widening code paths
- Re-plumbs Latin1Encoding to use refactored Encoding workhorses
- Removes unused EncodingNLS type
- Removes unused DecoderBestFitFallback type
- Uses "? replacement" behavior for all Encoding subclassed types by default, except Latin1Encoding which still uses best-fit
- Also includes perf improvements for vectorized ASCII transcoding logic

4 years agoUpdate dotnet SDK with MSBuild fix (#37726)
Santiago Fernandez Madero [Thu, 11 Jun 2020 03:46:25 +0000 (20:46 -0700)]
Update dotnet SDK with MSBuild fix (#37726)

4 years agoturn off composite scenario since it's flaky (#37728)
Olivia Chen [Thu, 11 Jun 2020 02:32:00 +0000 (19:32 -0700)]
turn off composite scenario since it's flaky (#37728)

* turn off composite scenario since it's flaky

* delete composite scenario

4 years agoAvoid checking per object heap limit if the commit is not related to a specific objec...
Andrew Au [Thu, 11 Jun 2020 02:07:10 +0000 (19:07 -0700)]
Avoid checking per object heap limit if the commit is not related to a specific object heap (#37725)

4 years agoAdd readme for DI project (#37729)
Maryam Ariyan [Thu, 11 Jun 2020 01:07:17 +0000 (18:07 -0700)]
Add readme for DI project (#37729)

4 years agoFix VeryLargeAmountOfEnumsToSerialize test (#37710)
Layomi Akinrinade [Wed, 10 Jun 2020 21:50:15 +0000 (14:50 -0700)]
Fix VeryLargeAmountOfEnumsToSerialize test (#37710)

* Fix VeryLargeAmountOfEnumsToSerialize test

* User Parallel.For and correct indices

4 years agoAdded fast path to BinaryWriter.Write(string) (#37705)
Benjamin Bartels [Wed, 10 Jun 2020 21:09:09 +0000 (22:09 +0100)]
Added fast path to BinaryWriter.Write(string) (#37705)

4 years agoMerge pull request #37708 from steveharter/FixAssert
Steve Harter [Wed, 10 Jun 2020 20:48:49 +0000 (15:48 -0500)]
Merge pull request #37708 from steveharter/FixAssert

Fix Debug.Assert when using ReflectionMemberAccessor

4 years agoAdded support for splitting on ReadOnlySpan<char> (#295)
Benjamin Bartels [Wed, 10 Jun 2020 20:39:15 +0000 (21:39 +0100)]
Added support for splitting on ReadOnlySpan<char> (#295)

* Added initial implementation of SpanSplitEnumerator

* Merged SpanSplitEnumerator and SpanSplitSequenceEnumerator

* Reordered .projitems entry

* Exposed System.Memory API additions

* Added SpanSplitEnumerator Tests

* Apply suggestions from code review

Co-authored-by: Layomi Akinrinade <layomia@gmail.com>
* Apply suggestions from code review

Co-authored-by: Layomi Akinrinade <layomia@gmail.com>
* Moved SpanSplitEnumerator to separate file

* Applied feedback to ReadOnlySpan.Split tests

* Renamed parameters/fields

* Removed mistaken compile include

* Fixed incorrect namespace on GetEnumeartor() return type

* Applied feedback for ReadOnlySpan.Split tests

* Added XML Documentation to public members

* Fixed cref reference to SpanSplitEnumerator in XML Documentation

* Fixed System.Memory.cs entries missing fully qualified identifier

* Apply suggestions from code review

Co-authored-by: Layomi Akinrinade <layomia@gmail.com>
* Moved SpanSplit Tests to correct file

* Applied review feedback

* Removed trailing whitespace

* Fixed Unit Tests

Co-authored-by: Layomi Akinrinade <layomia@gmail.com>
4 years agoCrossgen2 ARM64 runs & initial cross-targeting support (#37331)
Tomáš Rylek [Wed, 10 Jun 2020 19:15:24 +0000 (21:15 +0200)]
Crossgen2 ARM64 runs & initial cross-targeting support (#37331)

This change introduces initial provisions for dynamically loading
the native JIT based on the targeting OS and architecture; the change
expects the potentially multiple versions of clrjit to coexist with
Crossgen2 in the same folder, marked by a OS / arch suffix. Based
on these prerequisites the change adds ARM64 jobs to the Crossgen2
pipeline.

Thanks

Tomas

4 years ago[llvm] Emit a descriptive name for MONO_PATCH_INFO_JIT_ICALL_ADDR_NOCALL as well...
monojenkins [Wed, 10 Jun 2020 19:13:25 +0000 (15:13 -0400)]
[llvm] Emit a descriptive name for MONO_PATCH_INFO_JIT_ICALL_ADDR_NOCALL as well. (#37701)

Co-authored-by: vargaz <vargaz@users.noreply.github.com>
4 years agoimprove TLS frame parser (#36201)
Tomas Weinfurt [Wed, 10 Jun 2020 19:11:04 +0000 (12:11 -0700)]
improve TLS frame parser (#36201)

* improve TLS frame parser

* retire SniHelper.cs

* feedback from review

* feedback from review

* feedback from review

Co-authored-by: Tomas Weinfurt <furt@Shining.local>
4 years agoadd crossgen2 perf jobs (#37678)
Olivia Chen [Wed, 10 Jun 2020 17:25:05 +0000 (10:25 -0700)]
add crossgen2 perf jobs (#37678)

4 years ago[master] Update dependencies from mono/linker Microsoft/vstest dotnet/llvm-project...
dotnet-maestro[bot] [Wed, 10 Jun 2020 17:24:03 +0000 (19:24 +0200)]
[master] Update dependencies from mono/linker Microsoft/vstest dotnet/llvm-project dotnet/xharness (#37643)

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

Microsoft.NET.ILLink.Tasks
 From Version 5.0.0-preview.3.20306.1 -> To Version 5.0.0-preview.3.20309.1

* Update dependencies from https://github.com/microsoft/vstest build 20200609-09

Microsoft.NET.Test.Sdk
 From Version 16.7.0-preview-20200608-10 -> To Version 16.7.0-preview-20200609-09

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

runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools , runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk , runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk
 From Version 9.0.1-alpha.1.20301.1 -> To Version 9.0.1-alpha.1.20308.1

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

Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 1.0.0-prerelease.20305.1 -> To Version 1.0.0-prerelease.20308.1

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

Microsoft.NET.ILLink.Tasks
 From Version 5.0.0-preview.3.20306.1 -> To Version 5.0.0-preview.3.20309.3

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

Microsoft.NET.Test.Sdk
 From Version 16.7.0-preview-20200608-10 -> To Version 16.8.0-preview-20200610-06

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

Microsoft.DotNet.XHarness.TestRunners.Xunit
 From Version 1.0.0-prerelease.20305.1 -> To Version 1.0.0-prerelease.20309.4

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
4 years agoProfile driven method layout (#37469)
David Wrighton [Wed, 10 Jun 2020 17:20:36 +0000 (10:20 -0700)]
Profile driven method layout (#37469)

* Profile driven layout
- Update to mpgo file format to hold weighted call graph data, and exclusive hit sample data
- Implementation of call graph data capture from both jitted and R2R code
- Add mechanism for parsing entrypoints from R2R files into arbitrary type systems insetad of just strings
- Update command line parser in dotnet-pgo to use named properties on class instead of arguments to main method
- Update dotnet-pgo to be able to use a etl.zip file
- Implement infrastructure for performing layout of PE file based on profile guided information
- Implement various profile guided method ordering routines
  - There are a variety of possible algorithms, these are simple to
  implement. More capable ones will generally use the call graph data.
  - Sort by exclusive weight
  - Sort by Hot (known to be used) and cold (not known to be used)
  - Sort by Hot (known to be used for more than 128 sample) Warm (known
  to be used) and Cold (not known to be used)
- Since the BulkType logging lock seems to be losing some types, skip the lock for MethodDetails data

4 years agoMake invalid RSAParameters exception more informative.
Kevin Jones [Wed, 10 Jun 2020 17:00:44 +0000 (13:00 -0400)]
Make invalid RSAParameters exception more informative.

4 years agoAdd ILLink.Substitutions.xml files for System.Private.CoreLib. (#37615)
Eric Erhardt [Wed, 10 Jun 2020 16:24:42 +0000 (11:24 -0500)]
Add ILLink.Substitutions.xml files for System.Private.CoreLib. (#37615)

* Add ILLink.Substitutions.xml files for System.Private.CoreLib.

Ported the settings from https://github.com/mono/mono/blob/eaa32d13659f0a6b6b5e62ddb49af68b1f9efb6c/sdks/wasm/src/linker-subs.xml and split them out as appropriate to reduce duplication across the different platform builds.

Contributes to #31785

* Remove all Platforms other than wasm to workaround linker bug.

See https://github.com/mono/linker/issues/1260

4 years agoFix Debug.Assert when using ReflectionMemberAccessor
Steve Harter [Wed, 10 Jun 2020 16:21:21 +0000 (11:21 -0500)]
Fix Debug.Assert when using ReflectionMemberAccessor

4 years agoMoving the System.Runtime.Intrinsics.Arm namespace in box (#37656)
Tanner Gooding [Wed, 10 Jun 2020 15:30:39 +0000 (08:30 -0700)]
Moving the System.Runtime.Intrinsics.Arm namespace in box (#37656)

* Moving the System.Runtime.Intrinsics.Arm namespace in box

* Removing System.Runtime.Intrinsics.Experimental

4 years agoAdd (de)serialization test for ArraySegment<T> (#37684)
Layomi Akinrinade [Wed, 10 Jun 2020 15:14:00 +0000 (08:14 -0700)]
Add (de)serialization test for ArraySegment<T> (#37684)

4 years agoSync shared compiler file (#37700)
Michal Strehovský [Wed, 10 Jun 2020 14:00:34 +0000 (16:00 +0200)]
Sync shared compiler file (#37700)

4 years agoAdd dataflow annotations to System.Runtime (#37642)
Michal Strehovský [Wed, 10 Jun 2020 09:46:38 +0000 (11:46 +0200)]
Add dataflow annotations to System.Runtime (#37642)

4 years agoremove ClientAsyncAuthenticate_SslStreamClientServerNone_UseStrongCryptoSet (#37692)
Tomas Weinfurt [Wed, 10 Jun 2020 09:43:44 +0000 (02:43 -0700)]
remove ClientAsyncAuthenticate_SslStreamClientServerNone_UseStrongCryptoSet (#37692)

Co-authored-by: Tomas Weinfurt <furt@Shining.local>
4 years agoUse [SkipLocalsInit] & remove code for ILLink to strip locals init (#37541)
Layomi Akinrinade [Wed, 10 Jun 2020 02:18:49 +0000 (19:18 -0700)]
Use [SkipLocalsInit] & remove code for ILLink to strip locals init (#37541)

* Use [SkipLocalsInit] & remove code for ILLink to strip locals init

* Address review feedback

* Simply condition

* Clean up

* Fix condition

4 years ago[wasm] Testing improvements. (#37662)
Zoltan Varga [Wed, 10 Jun 2020 01:00:47 +0000 (21:00 -0400)]
[wasm] Testing improvements. (#37662)

* Add System.Security.Cryptography.Algorithms to the pinvoke generator.

* Fix a stack overflow in WasmAppBuilder.

* [wasm] Unset MONO_LOG_MASK when running tests.

Its set to 'gc' by default which causes extra log messages to be added to the testResult.xml file.

* Turn off GC logging by default.

4 years agoStrip the ILLinkTrim.xml from the System.Diagnostics.StackTrace assembly (#37659)
Layomi Akinrinade [Tue, 9 Jun 2020 22:49:49 +0000 (15:49 -0700)]
Strip the ILLinkTrim.xml from the System.Diagnostics.StackTrace assembly (#37659)

4 years agoadding the new version to avoid build failure (#37663)
Anirudh Agnihotry [Tue, 9 Jun 2020 22:13:51 +0000 (15:13 -0700)]
adding the new version to avoid build failure (#37663)

* adding the new version to avoid build failure

* update the assemblyin Pakcage version

4 years agoFix global-build official build arg evaluation (#37665)
Santiago Fernandez Madero [Tue, 9 Jun 2020 20:59:26 +0000 (13:59 -0700)]
Fix global-build official build arg evaluation (#37665)

4 years agoTrack promoted fields when struct local is no longer referenced. (#37280)
Eugene Rozenfeld [Tue, 9 Jun 2020 20:17:01 +0000 (13:17 -0700)]
Track promoted fields when struct local is no longer referenced. (#37280)

This is a follow-up to #36918. It addresses one of the examples in #1007
where we remove a struct zero initialization but fail to clean up a dead
field assignment.

The change is not to mark a dependently promoted field as untracked
if we know that the struct local is no longer referenced.

I also addressed a couple of late cosmetic review comments from #36918.

No diffs in framework and benchmarks.

4 years agoPreserve PlatformNotSupportedException in the linker. (#37657)
Zoltan Varga [Tue, 9 Jun 2020 19:31:36 +0000 (15:31 -0400)]
Preserve PlatformNotSupportedException in the linker. (#37657)

4 years agoARM64: fix the alignment for Vector64 to 8 bytes (#37649)
Kunal Pathak [Tue, 9 Jun 2020 19:02:51 +0000 (12:02 -0700)]
ARM64: fix the alignment for Vector64 to 8 bytes (#37649)

4 years ago[interp] Don't save ip twice in InterpFrame (#37416)
monojenkins [Tue, 9 Jun 2020 19:00:58 +0000 (15:00 -0400)]
[interp] Don't save ip twice in InterpFrame (#37416)

We had frame->ip used by EH and debugger and frame->state.ip used to save the ip of the next instruction to be executed when we return from the call. Since both represent more or less the same thing, unify them and avoid duplicate storing inside InterpFrame for each call. Because we use this ip with exception handling, we need to subtract 1 (similar to the jit) so the ip ends up being in the call instruction and not the next.

Co-authored-by: BrzVlad <BrzVlad@users.noreply.github.com>
4 years ago[libraries] Skip GetOpenSslVersion on Apple OS (#37646)
Mitchell Hwang [Tue, 9 Jun 2020 17:41:46 +0000 (13:41 -0400)]
[libraries] Skip GetOpenSslVersion on Apple OS (#37646)

Extend the `PlatformNotSupportedException` for `OpenSslVersion` from `OSX` to `OSX, iOS, and tvOS`, as none of these Apple OS support OpenSsl.

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
4 years ago[mono] Add back sys/types.h include for clockid_t (#37653)
Alexander Köplinger [Tue, 9 Jun 2020 17:06:46 +0000 (19:06 +0200)]
[mono] Add back sys/types.h include for clockid_t (#37653)

Looks like it was accidentally removed in https://github.com/dotnet/runtime/pull/37457

4 years agoOptimise MathF.CopySign and Math.CopySign using SSE intrinsics (#35456)
John Kelly [Tue, 9 Jun 2020 16:08:21 +0000 (17:08 +0100)]
Optimise MathF.CopySign and Math.CopySign using SSE intrinsics (#35456)

* Optimise MathF.CopySign and Math.CopySign

* Fix namespace error

* Clear up constant

* Remove x64 dependency for MathF method

* Remove unnecessary constant and unsafe from Math

* Remove unnecessary constant and unsafe from MathF

* Add ARM32/64 paths, and SSE41 path. Change integral constant to FP for perf and add integral constant for fallback

* Move conditional select to seperate helper methods, remove incorrect use of blendv

* Inline mask constants

* Correctly handle ISA not supported

* Remove old comment

* Fix syntax error

* Var -> explicit type

* Move helper method to sep class

As discussed w tanner

* move helper method

* Remove locals

* Fix namespace

* namespace

* Inline locals

* Change helper method to only accept float/double

* fix formatting

* fix sybntax

4 years agoCheck the existence of clocked_t (#37457)
Fan Yang [Tue, 9 Jun 2020 15:08:25 +0000 (11:08 -0400)]
Check the existence of clocked_t (#37457)

* Use a macro more widely used by unix platforms

* If time.h exists, clock_it must have been defined

* Check the existence of clockit_t

* Move type check to the location near other time checks

4 years ago[browser][wasm] Find the correct CoreLib (#37644)
Kenneth Pouncey [Tue, 9 Jun 2020 14:26:05 +0000 (16:26 +0200)]
[browser][wasm] Find the correct CoreLib (#37644)

Need to load `System.Private.Corlib`

closes: https://github.com/dotnet/runtime/issues/37636

4 years agoSocketAsyncContext.Unix: remove Lock from IsReady (#36705)
Tom Deseyn [Tue, 9 Jun 2020 13:27:27 +0000 (15:27 +0200)]
SocketAsyncContext.Unix: remove Lock from IsReady (#36705)

* SocketAsyncContext.Unix: remove Lock from IsReady

* Make QueueState an int

* Update comment

* cleanup comment

* Update for rebase

* Decrement sequenceNumber instead of using nullable int

* PR feedback

4 years agoDisable GetAsync_UnicodeHostName_SuccessStatusCodeInResponse (#37487)
Alexander Nikolaev [Tue, 9 Jun 2020 11:57:23 +0000 (13:57 +0200)]
Disable GetAsync_UnicodeHostName_SuccessStatusCodeInResponse (#37487)

SocketsHttpHandlerTest_HttpClientHandlerTest_Http2.GetAsync_UnicodeHostName_SuccessStatusCodeInResponse is periodically failing with TimeoutException. It seems to be caused by the target server unavailability, this PR disables the test until a new unicode test host is found.

4 years agoFix TestExited_SynchronizingObject test (#37639)
Stephen Toub [Tue, 9 Jun 2020 11:54:17 +0000 (07:54 -0400)]
Fix TestExited_SynchronizingObject test (#37639)

Fix race condition.

4 years agoEnable calling get_runtime_delegate from app context (#37473)
Sean Hall [Tue, 9 Jun 2020 11:48:19 +0000 (21:48 +1000)]
Enable calling get_runtime_delegate from app context (#37473)

* Add ability for hostfxr_get_runtime_delegate to block on invalid delegate types.

This is required so that the runtime isn't loaded if the request has no chance of succeeding.

Fix spelling of initialization_options_t.

Add context_contract_version_set flag to initialization_options_t.

This allows hostpolicy to know whether it can rely on the version field of corehost_context_contract to be valid.
Also always initialize corehost_context_contract to {}.

* Allow app-based context to call hostfxr_get_runtime_delegate.

Currently, it may only request the load_assembly_and_get_function_pointer delegate.

Fix discrepancy in design doc.

Add error code HostApiUnsupportedScenario for blocks that might be removed. This gives the native host better information on why the request failed.

Add tests for running a component from an app context.

4 years agoMore cleanups and optimizations for System.Runtime.InteropServices.JavaScript (#37613)
Marek Safar [Tue, 9 Jun 2020 11:03:18 +0000 (13:03 +0200)]
More cleanups and optimizations for System.Runtime.InteropServices.JavaScript (#37613)

4 years agoUse ConditionalFact/Theory for skipping RemoteExecutor on unsupported platforms ...
Alexander Köplinger [Tue, 9 Jun 2020 10:40:44 +0000 (12:40 +0200)]
Use ConditionalFact/Theory for skipping RemoteExecutor on unsupported platforms (#37479)

RemoteExecutor doesn't work on platforms that can't spawn processes like iOS/Android/WebAssembly.

4 years agoAnnotate System.ServiceProcess.ServiceController for nullable reference types (#37595)
Stephen Toub [Tue, 9 Jun 2020 10:40:01 +0000 (06:40 -0400)]
Annotate System.ServiceProcess.ServiceController for nullable reference types (#37595)

* Annotate System.ServiceProcess.ServiceController for nullable reference types

* Address PR feedback

4 years ago[mono] Delete culture/ directory files (#37565)
Aleksey Kliger (λgeek) [Tue, 9 Jun 2020 10:19:16 +0000 (06:19 -0400)]
[mono] Delete culture/ directory files (#37565)

Related to #37437 - we use libICU for culture information in`dotnet/runtime`, and now we don't sync `src/mono/mono/culture` back to the mono/mono repository, so we can delete all these files.

4 years agoCreate Microsoft.NetCore.App.Ref targeting pack for NetCoreAppCurrent in libraries...
Viktor Hofer [Tue, 9 Jun 2020 10:10:33 +0000 (12:10 +0200)]
Create Microsoft.NetCore.App.Ref targeting pack for NetCoreAppCurrent in libraries (#37600)

* Create Microsoft.NetCore.App.Ref

Binplace reference assemblies into a Microsoft.NetCore.App.Ref folder
and also copy data files like the RuntimeList.xml and the
PlatformManifest.txt there.

Rename the runtime pack to microsoft.netcore.app.runtime.$(RID)

Fixing a restore issue in the wasm builder (restore and build should
not happen in the same msbuild invocation).

4 years agoEnable nullable reference types for full facades (#37589)
Stephen Toub [Tue, 9 Jun 2020 10:00:01 +0000 (06:00 -0400)]
Enable nullable reference types for full facades (#37589)

Some of our full facades are missing `<Nullable>enable</Nullable>`.  I don't think the lack of these causes any issues, but having them makes it easy to confirm what ref assemblies remain to be annotated.

4 years agoAdd linker annotations to some of CoreLib (#36532)
Michal Strehovský [Tue, 9 Jun 2020 09:39:28 +0000 (11:39 +0200)]
Add linker annotations to some of CoreLib (#36532)

Some of these are handled as linker intrinsics, so they'll actually keep less than what the annotation declares. The annotation mostly serves to suppress warnings when linker analyzes the body of the method itself.

4 years agoUse [MemberNotNull] to reduce use of `= null!;` (#37490)
Stephen Toub [Tue, 9 Jun 2020 09:28:21 +0000 (05:28 -0400)]
Use [MemberNotNull] to reduce use of `= null!;` (#37490)

* Exclude MemberNotNull from various tools

* Use [MemberNotNull] to reduce use of `= null!;`

4 years agoReflection annotate more of CoreLib (#37418)
Michal Strehovský [Tue, 9 Jun 2020 07:30:54 +0000 (09:30 +0200)]
Reflection annotate more of CoreLib (#37418)

4 years agoallow access to crypto props from RemoteCertificateValidationCallback (#37580)
Tomas Weinfurt [Tue, 9 Jun 2020 06:56:41 +0000 (23:56 -0700)]
allow access to crypto props from RemoteCertificateValidationCallback (#37580)

4 years agoObsolete RuntimeHelpers.OffsetToStringData (#35722)
Levi Broderick [Tue, 9 Jun 2020 04:43:59 +0000 (21:43 -0700)]
Obsolete RuntimeHelpers.OffsetToStringData (#35722)

4 years agoMake System.Formats.Asn1 library public
Jeremy Barton [Tue, 9 Jun 2020 04:33:48 +0000 (21:33 -0700)]
Make System.Formats.Asn1 library public

* Move current ASN src and tests into new tree with no modifications

AsnReader partials are named AsnDecoder to better match the final name
for the core logic they contain.

* Make System.Formats.Asn1 package

* Apply changes from API review

Some additional tests were written to increase code coverage after the changes

* Move AsnReader consumers to public API

4 years agoAccept NativeCallableInternalAttribute to support legacy scenario (#37621)
Aaron Robinson [Tue, 9 Jun 2020 04:21:21 +0000 (21:21 -0700)]
Accept NativeCallableInternalAttribute to support legacy scenario (#37621)

* Accept NativeCallableInternalAttribute to support legacy scenario

* Feedback

4 years agoRevert "Update "LICENSE.txt" so that it's recognized as MIT" (#37626)
Stephen Toub [Tue, 9 Jun 2020 02:22:27 +0000 (22:22 -0400)]
Revert "Update "LICENSE.txt" so that it's recognized as MIT" (#37626)

* Revert "Update "LICENSE.txt" so that it's recognized as MIT"

* Add LICENSE.TXT to global build

Co-authored-by: Santiago Fernandez Madero <safern@microsoft.com>
4 years agoSupport the Encoding enumeration in the Encoding Providers (#37528)
Tarek Mahmoud Sayed [Tue, 9 Jun 2020 02:21:01 +0000 (19:21 -0700)]
Support the Encoding enumeration in the Encoding Providers (#37528)

* Support the Encoding enumeration in the Encoding Providers

* Fix build

* Fix netstandard build

* Address the feedback

* More Feedback

* More Feedback

4 years agoDon't produce windows runtime packs for mono (#37627)
Santiago Fernandez Madero [Tue, 9 Jun 2020 01:58:42 +0000 (18:58 -0700)]
Don't produce windows runtime packs for mono (#37627)

4 years agoMake build scripts' -help information more helpful (#37377)
Ivan Diaz Sanchez [Tue, 9 Jun 2020 00:58:50 +0000 (17:58 -0700)]
Make build scripts' -help information more helpful (#37377)

* Sorted the build scripts' help alphabetically, and made the subset error
message softer and without metrics.

* Added simple examples to the scripts' helps.

* Moved short flags to the flag column and rephrased a bit.

* Removed remains of old code.

* Added more examples and rephrased some things for better clarity.

* Added gcc example to build.sh.

* Corrected definition of the Checked configuration.

* Added --clangx to build.sh

4 years agoFix the remaining jitstress-isas-x86 failures (#37459)
Tanner Gooding [Tue, 9 Jun 2020 00:32:54 +0000 (17:32 -0700)]
Fix the remaining jitstress-isas-x86 failures (#37459)

* Ensure the right SIMD size is used for the AsVector256 AVX code

* Don't create GT_SIMD nodes if the baseline ISAs are not supported.

4 years agoRespect Process.SynchronizingObject in Process events (#37308)
Stephen Toub [Tue, 9 Jun 2020 00:14:18 +0000 (20:14 -0400)]
Respect Process.SynchronizingObject in Process events (#37308)

* Respect Process.SynchronizingObject in Process events

* Address PR feedback

4 years agoInitialize AsnEncodedData.RawData to empty array (#37598)
Stephen Toub [Tue, 9 Jun 2020 00:11:32 +0000 (20:11 -0400)]
Initialize AsnEncodedData.RawData to empty array (#37598)

Maintains nullable annotation on RawData.

4 years agoAnnotate System.Net.WebSockets.WebSocketProtocol for nullable reference types (#37593)
Stephen Toub [Tue, 9 Jun 2020 00:07:51 +0000 (20:07 -0400)]
Annotate System.Net.WebSockets.WebSocketProtocol for nullable reference types (#37593)

* Annotate System.Net.WebSockets.WebSocketProtocol for nullable reference types

This also helped find that the annotation of WebSocketReceiveResult(..., string closeDescription) was wrong in the ref (it was correct in the src), so I fixed that.

* Address PR feedback and suppress netcoreapp2.1 warnings

4 years agoNo retyping arm/arm64. (#36866)
Sergey Andreenko [Mon, 8 Jun 2020 23:45:48 +0000 (16:45 -0700)]
No retyping arm/arm64. (#36866)

* Enable for arm/arm64.

* Add more test cases specific to SIMD* handling.

* Support !compDoOldStructRetyping for arm/arm64.

* Review feedback.

* Return `JitDoOldStructRetyping`.

and disable failung tests with old retyping.

* a small workaround for default arm64 behaviour.

4 years ago[wasm] Throw PlatformNotSupportedException instead of NotSupportedException when...
monojenkins [Mon, 8 Jun 2020 23:41:10 +0000 (19:41 -0400)]
[wasm] Throw PlatformNotSupportedException instead of NotSupportedException when starting threads/waiting on monitors. (#37604)

<!--
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: vargaz <vargaz@users.noreply.github.com>
4 years agoMerge pull request #36744 from teo-tsirpanis/patch-1
Rich Lander [Mon, 8 Jun 2020 23:22:06 +0000 (16:22 -0700)]
Merge pull request #36744 from teo-tsirpanis/patch-1

Update "LICENSE.txt" so that it's recognized as MIT

4 years agoImplement ModuleBuilder.GetFieldToken (#37497)
Alexis Christoforides [Mon, 8 Jun 2020 22:08:08 +0000 (18:08 -0400)]
Implement ModuleBuilder.GetFieldToken (#37497)

Contributes to https://github.com/mono/mono/issues/14788

4 years ago[wasm] Pass more assemblies to the pinvoke table generator. (#37608)
Zoltan Varga [Mon, 8 Jun 2020 21:46:50 +0000 (17:46 -0400)]
[wasm] Pass more assemblies to the pinvoke table generator. (#37608)

4 years ago[Test] don't use process var in async readers (#37259)
John Salem [Mon, 8 Jun 2020 20:59:24 +0000 (13:59 -0700)]
[Test] don't use process var in async readers (#37259)

* don't use process var in async readers

* Add comment

4 years agoUpdate comments on GetCursorPosition (#37609)
Stephen Toub [Mon, 8 Jun 2020 20:52:19 +0000 (16:52 -0400)]
Update comments on GetCursorPosition (#37609)

4 years agoAllow MemoryMappedFile to work on character device (#2183)
Tomas Weinfurt [Mon, 8 Jun 2020 20:32:59 +0000 (13:32 -0700)]
Allow MemoryMappedFile to work on character device (#2183)

* allow MemoryMeppedFile to work on character device

* feedback from review

* feedback from review

* feedback from review

* roll-back write only access

* feedback from review

* fix windows

* avoid exception reordering

* feedback from review

Co-authored-by: Tomas Weinfurt <furt@Shining.local>
4 years agoAllow individual projects to override LangVersion (#37512)
Eric Erhardt [Mon, 8 Jun 2020 20:20:53 +0000 (15:20 -0500)]
Allow individual projects to override LangVersion (#37512)

Setting LangVersion in a .targets file makes it hard to override LangVersion in individual projects. Instead, move the default project setting back to the .props file and condition VB based on $(MSBuildProjectExtension), which is available in the .props file.

ILCompiler.Reflection.ReadyToRun needs to set LangVersion to 7.3 so it doesn't break ILSpy.

Fix #37498

4 years ago[master] Update dependencies from mono/linker Microsoft/vstest (#37562)
dotnet-maestro[bot] [Mon, 8 Jun 2020 20:10:46 +0000 (20:10 +0000)]
[master] Update dependencies from mono/linker Microsoft/vstest (#37562)

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

Microsoft.NET.ILLink.Tasks
 From Version 5.0.0-preview.3.20305.2 -> To Version 5.0.0-preview.3.20306.1

* Update dependencies from https://github.com/microsoft/vstest build 20200608-10

Microsoft.NET.Test.Sdk
 From Version 16.7.0-preview-20200605-01 -> To Version 16.7.0-preview-20200608-10

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
4 years agoAnnotate System.Resources.Extensions for nullable reference types (#37597)
Stephen Toub [Mon, 8 Jun 2020 20:00:11 +0000 (16:00 -0400)]
Annotate System.Resources.Extensions for nullable reference types (#37597)

4 years agoImprove R2RTest compile-serp (#37520)
Simon Nattress [Mon, 8 Jun 2020 18:43:32 +0000 (11:43 -0700)]
Improve R2RTest compile-serp (#37520)

* Improve the robustness and idempotence of compile-serp by backing up all MSIL assemblies that are compiled / referenced. Use those backups during compilations.
* Add `--composite-scenario` switch which currently supports two modes: each assembly is compiled separately, and another where the shared framework, Asp.Net, and Serp core each get a composite image.
* Added new `Crossgen2RunnerOptions` config class we can pass per-compile settings instead of relying on the process-wide `BuildOptions` object. This is needed to allow a single parallel batch of compilations where some are composite images and some are not.

4 years agoAdd Console.GetCursorPosition (#37559)
Stephen Toub [Mon, 8 Jun 2020 18:27:27 +0000 (14:27 -0400)]
Add Console.GetCursorPosition (#37559)

4 years agoAnnotate System.Reflection.Context for nullable reference types (#37592)
Stephen Toub [Mon, 8 Jun 2020 18:27:15 +0000 (14:27 -0400)]
Annotate System.Reflection.Context for nullable reference types (#37592)

4 years agoAnnotate System.Numerics.Tensors for nullable reference types (#37594)
Stephen Toub [Mon, 8 Jun 2020 18:27:02 +0000 (14:27 -0400)]
Annotate System.Numerics.Tensors for nullable reference types (#37594)

4 years agoAnnotate Microsoft.Win32.Registry.AccessControl for nullable reference types (#37596)
Stephen Toub [Mon, 8 Jun 2020 18:24:14 +0000 (14:24 -0400)]
Annotate Microsoft.Win32.Registry.AccessControl for nullable reference types (#37596)

Only a few methods defined, and none of their reference type inputs/outputs are nullable.

4 years agoCollapse mono runtime pack builds in official build (#37511)
Santiago Fernandez Madero [Mon, 8 Jun 2020 17:56:36 +0000 (10:56 -0700)]
Collapse mono runtime pack builds in official build (#37511)

* Collapse mono runtime pack builds in official build

* Minor cleanups

4 years ago[wasm] Bump emscripten to 1.39.17. (#37547)
monojenkins [Mon, 8 Jun 2020 17:08:25 +0000 (13:08 -0400)]
[wasm] Bump emscripten to 1.39.17. (#37547)

Co-authored-by: vargaz <vargaz@users.noreply.github.com>
4 years agoMono: Fix deadlock on Alpine (#37456)
monojenkins [Mon, 8 Jun 2020 16:58:27 +0000 (12:58 -0400)]
Mono: Fix deadlock on Alpine (#37456)

Fixes mono/mono#7167

The mono/mono commit 3e8108ea6576b07de2a64528be18674683879189 introduced a deadlock on Alpine, making it impossible to even build mono. This PR reverts the setting of PTHREAD_PRIO_INHERIT when on Alpine.
Since GCC on Alpine doesn't provide a builtin macro to detect Alpine, I also added a #define in configure.ac.

Co-authored-by: rickardp <rickardp@users.noreply.github.com>
4 years agoAdd Browser version of RuntimeInformation (#37256)
Marek Safar [Mon, 8 Jun 2020 16:32:00 +0000 (18:32 +0200)]
Add Browser version of RuntimeInformation (#37256)

4 years agoAdd initial doc about testing libraries on WebAssembly (#37478)
Maxim Lipnin [Mon, 8 Jun 2020 16:01:51 +0000 (19:01 +0300)]
Add initial doc about testing libraries on WebAssembly (#37478)

* Add initial doc about testing libraries on WebAssembly

* Address feedback

* Address feedback

4 years agoFix broken System.Console tests (#37558)
Stephen Toub [Mon, 8 Jun 2020 15:05:10 +0000 (11:05 -0400)]
Fix broken System.Console tests (#37558)

4 years agoImplement RandomNumberGeneratorImplementation for wasm. (#37408)
Zoltan Varga [Mon, 8 Jun 2020 14:41:01 +0000 (10:41 -0400)]
Implement RandomNumberGeneratorImplementation for wasm. (#37408)

* Implement RandomNumberGeneratorImplementation for wasm.

Simply read from /dev/random which is supported under WebAssembly.

* Address review comments.

* Update src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/RandomNumberGeneratorImplementation.WebAssembly.cs

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
* Call Read() in a loop.

* Rename to .Browser.cs.

* Add a SystemNative_GetCryptographicallySecureRandomBytes function and use it to read /dev/urandom.

* Error out instead of asserting.

* Make the non secure version depend on the secure version.

* Fix the build.

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
4 years agoUse new ucontext handling for glibc 2.26 (#37568)
monojenkins [Mon, 8 Jun 2020 14:36:34 +0000 (10:36 -0400)]
Use new ucontext handling for glibc 2.26 (#37568)

<!--
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: mgorse <mgorse@users.noreply.github.com>
4 years ago[crossgen2][arm] Fix assertion repro237932.cs (#37588)
t-mustafin [Mon, 8 Jun 2020 13:55:06 +0000 (16:55 +0300)]
[crossgen2][arm] Fix assertion repro237932.cs (#37588)

Fix assertion on crossgen2 Debug on ni-compile of 237932/repro237932.cs
test for arm architecture.

Signed-off-by: Timur <t.mustafin@partner.samsung.com>