platform/upstream/dotnet/runtime.git
4 years agoWASM: Fix System.Diagnostics.TraceSource tests (#39224)
Alexander Köplinger [Tue, 14 Jul 2020 09:58:11 +0000 (11:58 +0200)]
WASM: Fix System.Diagnostics.TraceSource tests (#39224)

* WASM: Fix System.Diagnostics.TraceSource tests

One test was using `Assembly.GetEntryAssembly()` which returns null on WebAssembly.
Others are testing that the output contains the stacktrace but it is empty on WASM right now.

* PR feedback

Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
4 years agoWASM: Disable tests in System.ComponentModel.Annotations that rely on globalization...
Alexander Köplinger [Tue, 14 Jul 2020 09:55:39 +0000 (11:55 +0200)]
WASM: Disable tests in System.ComponentModel.Annotations that rely on globalization (#39228)

Allows the test suite to pass on WebAssembly: `Tests run: 692, Errors: 0, Failures: 0, Skipped: 15. Time: 1.237011s`

4 years agoWASM: Disable thread related tests on System.IO.Compression (#39231)
Alexander Köplinger [Tue, 14 Jul 2020 09:54:20 +0000 (11:54 +0200)]
WASM: Disable thread related tests on System.IO.Compression (#39231)

They try to test various conditions that only work if you have multiple threads which is not the case on WebAssembly.

4 years agoAllow platform-specific attributes on Fields (#39214)
Jeff Handley [Tue, 14 Jul 2020 09:22:13 +0000 (02:22 -0700)]
Allow platform-specific attributes on Fields (#39214)

4 years agoRemove System.Reflection.DispatchProxy package (#39220)
Eric StJohn [Tue, 14 Jul 2020 07:54:22 +0000 (00:54 -0700)]
Remove System.Reflection.DispatchProxy package (#39220)

This library was added to .NETStandard2.1 and thus can no-longer be
changed.

4 years agoAdding LinkedListNode<T>.ValueRef (#39236)
Tanner Gooding [Tue, 14 Jul 2020 05:50:30 +0000 (22:50 -0700)]
Adding LinkedListNode<T>.ValueRef (#39236)

4 years agoPortable PDB support for ilasm (#37702)
Ivan Povazan [Tue, 14 Jul 2020 05:23:16 +0000 (07:23 +0200)]
Portable PDB support for ilasm (#37702)

Minimum viable support for portable pdb generation from ilasm.

Supporting the following features of the portable pdb format
- Portable PDB CodeView debug directory entry
- Document table
- MethodDebugInformation table
- Local scope table
- Local variable table

This change extends the metadata writer to be able to write the portable pdb format.
- All changes related to portable PDB metadata generation should be controlled with preprocessor directive FEATURE_METADATA_EMIT_PORT_PDB
- New metadata code is not included in the runtime, as the runtime uses a managed parser when it works with portable pdbs

Authored-by: Ivan Povazan <ivan@raincode.com>
4 years agoAdd NeutralResourcesLanguageAttribute to corefx libraries (#39135)
Tarek Mahmoud Sayed [Tue, 14 Jul 2020 05:09:24 +0000 (22:09 -0700)]
Add NeutralResourcesLanguageAttribute to corefx libraries (#39135)

4 years agoRun CoreCLR runtime tests using Mono with LLVM AOT. (#38547)
imhameed [Tue, 14 Jul 2020 04:05:44 +0000 (21:05 -0700)]
Run CoreCLR runtime tests using Mono with LLVM AOT. (#38547)

- coreclr/build-test.sh now has a new subcommand: 'mono_aot', which builds a
new target, named 'MonoAotCompileTests', added to
coreclr/tests/src/runtest.proj. This target compiles the runtime tests using
Mono LLVM AOT in a simple configuration where the host platform is identical to
the target platform. Parallel compilation happens via a hack: actual
compilation happens in mono/msbuild/aot-compile.proj, a single-target msbuild
file, and runtest.proj invokes this single-purpose project and target using
batching to create multiple parallelizable instances of this project. Future
work: use the MonoAOTCompiler custom task currently used to build the iOS
sample program.

- Avoid using the runtimeVariant string when defining
coreClrProductArtifactName in mono/templates/xplat-pipeline-job.yml. There are
no "runtime variants" of CoreCLR configured with this parameter; instead,
depend on a shared non-runtime-variant build of CoreCLR.

- Mark function DISubprograms as local definitions--this is an LLVM 9
compatibility fix.

- Use --tag=CXX when linking libmonosgen-2.0.so via libtool when LLVM is linked
into Mono.

  This makes libtool use the C++ compiler driver when linking Mono--which uses
whatever platform-specific flags are necessary to link against the C++ stdlib.
Previously, libtool would use the C compiler driver, which didn't do this and
would produce shared objects with no explicit dependency on libstdc++.

  This problem is normally masked because of the very lax dynamic linking
semantics on ELF, but Mono on our CI setup is built in a CentOS 7 image (which
does not contain a C++11 libstdc++) that has a GCC 7 compatibility package
installed, along with a clang 9 installation that detects headers from the GCC
7 compatibility package. This compatibility package includes a libstdc++ linker
script that links C++11 libstdc++ components statically into the target while
dynamically linking against components present in pre-C++11 libstdc++. The end
result of all of this is that Mono built with this configuration will
dynamically depend on C++11 libstdc++ symbols that should have been statically
linked into the library, and will outright fail to run on machines without a
newer version of libstdc++ available.

- Add tests that fail after LLVM AOT compilation to issues.targets.

4 years agoadd write queue to Http2Connection to optimize write handling (#39166)
Geoff Kizer [Tue, 14 Jul 2020 03:58:36 +0000 (20:58 -0700)]
add write queue to Http2Connection to optimize write handling (#39166)

* add write queue to Http2Connection to optimize write handling

* address feedback

* remove AsyncMutex

* remove AsyncMutex for real

* use Channel<T> instead of custom queue

* make channel options static

Co-authored-by: Geoffrey Kizer <geoffrek@windows.microsoft.com>
4 years agoFix ManagedWebSocket ordering of releasing send buffer and semaphore (#39199)
Stephen Toub [Tue, 14 Jul 2020 01:39:31 +0000 (21:39 -0400)]
Fix ManagedWebSocket ordering of releasing send buffer and semaphore (#39199)

Once we release the semaphore, we no longer have ownership over _sendBuffer, so we have to release the latter before not after releasing the semaphore.

4 years agoAdded field support to JSON serializer (#36986)
Yoh Deadfall [Tue, 14 Jul 2020 00:32:00 +0000 (03:32 +0300)]
Added field support to JSON serializer (#36986)

* Added field support to JSON serializer

* Addressed issues

* Added tests

* Addressed issues

4 years agoInlined GC Polls for call to methods with SuppressGCTransitionAttribute (#39111)
Eugene Rozenfeld [Tue, 14 Jul 2020 00:19:20 +0000 (17:19 -0700)]
Inlined GC Polls for call to methods with SuppressGCTransitionAttribute (#39111)

* Inlined GC Polls for call to methods with SuppressGCTransitionAttribute.

* Emit inlined GC Polls for methods with SuppressGCTransitionAttribute
  when possible and when optimizing.

* Emit only one GC poll per basic block.

* Move insertion of GC polls to a new phase `fgInsertGCPolls` that runs after
  most optimizations so that we don't insert unnecessary GC polls.

* I plan to delete `fgCreateGCPolls` phase that was previously used to insert
  GC polls for platforms that don't support hijacking in a subsequent PR.
  We currently don't support such platforms.

* Fix `fgCreateGCPoll` to be able to insert inlined GC polls for `BBJ_NONE` and
`BBJ_THROW` basic blocks.

4 years agoAdd documentation about libraries features switches (#39200)
Marek Safar [Mon, 13 Jul 2020 20:58:49 +0000 (22:58 +0200)]
Add documentation about libraries features switches (#39200)

* Add documentation about libraries features switches

* Review feedback

* Casing tweaks

4 years ago[wasm] Addressing System.Runtime.Extensions failures (#38996)
Mitchell Hwang [Mon, 13 Jul 2020 20:30:36 +0000 (16:30 -0400)]
[wasm] Addressing System.Runtime.Extensions failures (#38996)

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
4 years agoAdd space after "Other" in OperatingSystem.VersionString (#39180)
Alexander Köplinger [Mon, 13 Jul 2020 18:56:53 +0000 (20:56 +0200)]
Add space after "Other" in OperatingSystem.VersionString (#39180)

Follow-up to https://github.com/dotnet/runtime/pull/39130

4 years ago[Arm64] ASIMD DotProduct and Rounding Double Multiply Add/Subtract (#38957)
Egor Chesakov [Mon, 13 Jul 2020 18:49:35 +0000 (11:49 -0700)]
[Arm64] ASIMD DotProduct and Rounding Double Multiply Add/Subtract (#38957)

* DotProduct

* DotProductBySelectedQuadruplet

* MultiplyRoundedDoublingAndAddSaturateHigh

* MultiplyRoundedDoublingAndAddSaturateHighScalar

* MultiplyRoundedDoublingAndSubtractSaturateHigh

* MultiplyRoundedDoublingAndSubtractSaturateHighScalar

* MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh

* MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh

* MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh

* MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh

4 years agoSupport reseolve reference for typeof(object) on deserialize (#38979)
David Cantu [Mon, 13 Jul 2020 17:42:13 +0000 (10:42 -0700)]
Support reseolve reference for typeof(object) on deserialize (#38979)

4 years agoAdd always trimmed attributes list for browser config (#39000)
Marek Safar [Mon, 13 Jul 2020 17:12:58 +0000 (19:12 +0200)]
Add always trimmed attributes list for browser config (#39000)

* Add always trimmed attributes list for browser config

Example of size reduction on SPC with the most minimalistic Hello
World sample.

| System.Private.CoreLib | Size (kB) | Delta |
|-|-|-|
| Original | 1358 kB | - |
| Trimmed | 1271 kB | - 87 kB |

* Review feedback

* Combine and embed the ILLink.LinkAttributes.xml file into the assembly.

* Update linker command line to ignore attributes file.
Add ExcludeFromCodeCoverageAttribute.

* PR feedback.
Add note about Obsolete.
Only use assembly fullname="*" for compiler generated attributes.

* Update ILLink.LinkAttributes.wasm.xml

Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
4 years agoenable GS Cookie on OSX (#39143)
Vladimir Sadov [Mon, 13 Jul 2020 16:55:21 +0000 (09:55 -0700)]
enable GS Cookie on OSX (#39143)

* enable GS Cookie on OSX

* Actual fix

4 years agoAdd Enum generic overloads (#33589)
Hugh Bellamy [Mon, 13 Jul 2020 16:29:33 +0000 (17:29 +0100)]
Add Enum generic overloads (#33589)

4 years ago[browser][wasm][tests] JavaScript Interop Marshal tests (#38917)
Kenneth Pouncey [Mon, 13 Jul 2020 12:31:39 +0000 (14:31 +0200)]
[browser][wasm][tests] JavaScript Interop Marshal tests (#38917)

* [browser][wasm][tests] JavaScript Interop Marshal tests

* Add primitive and string marshal tests

* Add tests for object identity across marshaling calls for JS object and managed objects.

- Tests to make sure the objects stay the same and are not created new.

* Add tests and code cleanup

* Add marshal of js function tests

* Add delegate marshaling test

* Fix License text

* More tests

* Fix an error where `mono_method_resolve` is called before BINDING object was initialized

* Add more marshal tests

* Add more tests

* Address review comments

4 years agoAdd some edge case tests for Array.CreateInstance and fix Mono handling (#36604)
Hugh Bellamy [Mon, 13 Jul 2020 12:31:07 +0000 (13:31 +0100)]
Add some edge case tests for Array.CreateInstance and fix Mono handling (#36604)

4 years agoFix codepoint splitting in email headers (#39072)
Natalia Kondratyeva [Mon, 13 Jul 2020 12:15:24 +0000 (15:15 +0300)]
Fix codepoint splitting in email headers (#39072)

Added EncodeString method that accounts for codepoint boundaries to
Base64Stream and QEncodedStream. Used EncodeString instead of
EncodeBytes where strings were encoded. Refactored EncodeBytes while
its logic remained the same. Extracted encoding logic into ByteEncoder
class.

Fix #1485

4 years agoUpdate deep-dive-blog-posts.md
Stephen Toub [Mon, 13 Jul 2020 11:13:32 +0000 (07:13 -0400)]
Update deep-dive-blog-posts.md

4 years agoWinHttpHandler supports multiple HTTP/2 connections per server (#38758)
Alexander Nikolaev [Mon, 13 Jul 2020 09:44:42 +0000 (11:44 +0200)]
WinHttpHandler supports multiple HTTP/2 connections per server (#38758)

New property EnableMultipleHttp2Connections on WinHttpHandler enables multiple HTTP/2 connection to the same server.

Contributes to #35088

4 years agoFold "cns_str"[cns_index] to ushort constant (#37226)
Egor Bogatov [Mon, 13 Jul 2020 09:39:21 +0000 (12:39 +0300)]
Fold "cns_str"[cns_index] to ushort constant (#37226)

4 years ago[interp] Add intrinsics for some common operations (#38809)
Vlad Brezae [Mon, 13 Jul 2020 09:04:58 +0000 (12:04 +0300)]
[interp] Add intrinsics for some common operations (#38809)

* [interp] Add intrinsic for Marvin.Block

* [interp] Intrinsify ConvertAllAsciiCharsInUInt32ToUppercase

* [interp] Intrinisfy UInt32OrdinalIgnoreCaseAscii

* [interp] Intrinsify UInt64OrdinalIgnoreCaseAscii

* [interp] Add intrinsic for UInt32ToDecStr

* [interp] Add intrinsic opcode for WidenAsciiToUtf16

* [interp] Rename intrinsics to interp-intrins

There seem to be some build failures on windows. Probably because of conflict with intrinsics source files from mini.

* [interp] Add comments

To prevent bcl and interp intrinsics going out of sync.

4 years agoNullability annotations for System.Data (#38810)
Shay Rojansky [Mon, 13 Jul 2020 08:49:23 +0000 (11:49 +0300)]
Nullability annotations for System.Data (#38810)

Following ec73c56fb803b89f5e41b4c85c5be9f6bd1a5bab.
A few corners have been left annotated because of dependencies.

4 years ago[mono] Disable config dir lookups on netcore (#38818)
Ryan Lucia [Mon, 13 Jul 2020 05:39:57 +0000 (01:39 -0400)]
[mono] Disable config dir lookups on netcore (#38818)

4 years agoCleanup dead code under undefined constants (#39155)
Adeel Mujahid [Sun, 12 Jul 2020 20:29:15 +0000 (23:29 +0300)]
Cleanup dead code under undefined constants (#39155)

4 years agoAdd SqlState and IsTransient to DbException (#39157)
Shay Rojansky [Sun, 12 Jul 2020 19:34:44 +0000 (22:34 +0300)]
Add SqlState and IsTransient to DbException (#39157)

Closes #35601
Closes #34817

4 years agoSync shared compiled files (#39162)
Michal Strehovský [Sun, 12 Jul 2020 16:51:00 +0000 (18:51 +0200)]
Sync shared compiled files (#39162)

4 years agoAdd async System.Data resultset and database schema APIs (#39098)
Shay Rojansky [Sun, 12 Jul 2020 13:56:20 +0000 (16:56 +0300)]
Add async System.Data resultset and database schema APIs (#39098)

Closes #38028

4 years agoRemove unused DeviceIoControl P/Invoke declaration (#38877)
Frederik Carlier [Sun, 12 Jul 2020 03:09:37 +0000 (05:09 +0200)]
Remove unused DeviceIoControl P/Invoke declaration (#38877)

4 years agoRemove dead SUPPORT_THREAD_ABORT code in PLINQ (#39148)
Stephen Toub [Sun, 12 Jul 2020 03:03:25 +0000 (23:03 -0400)]
Remove dead SUPPORT_THREAD_ABORT code in PLINQ (#39148)

4 years agoRemove catch ThreadAbortException (#39136)
Edison Henrique Andreassy [Sat, 11 Jul 2020 19:41:52 +0000 (16:41 -0300)]
Remove catch ThreadAbortException (#39136)

4 years agoUpdate DacHeapWalker to know about POH in SVR mode (#39139)
David Mason [Sat, 11 Jul 2020 19:03:57 +0000 (12:03 -0700)]
Update DacHeapWalker to know about POH in SVR mode (#39139)

* add POH for svr

* Use the correct alignment for objects on the POH

4 years agoJIT: retype byrefs passed to unmanaged callers as native int (#39105)
Andy Ayers [Sat, 11 Jul 2020 17:37:06 +0000 (10:37 -0700)]
JIT: retype byrefs passed to unmanaged callers as native int (#39105)

Make the jit more robust in cases where the IL producer is passing a byref
to an unmanaged caller, by retyping the argument as native int.

Allows the jit to produce self-consistent GC info and avoid the issues
seen in #34279, at least for byrefs.

Closes #39040.

4 years agoAdd missing PAL_CS_NATIVE_DATA_SIZE & DAC_CS_NATIVE_DATA_SIZE defs for macOS ARM64...
Ilia [Sat, 11 Jul 2020 17:27:26 +0000 (20:27 +0300)]
Add missing PAL_CS_NATIVE_DATA_SIZE & DAC_CS_NATIVE_DATA_SIZE defs for macOS ARM64 (#39141)

Related issue: #39010

4 years agoFix build configs for macOS ARM64 on DTK (#39142)
Ilia [Sat, 11 Jul 2020 17:27:05 +0000 (20:27 +0300)]
Fix build configs for macOS ARM64 on DTK (#39142)

Related issue: #39010

4 years agoUpdate packaging verion (#39101)
Eric StJohn [Sat, 11 Jul 2020 16:33:01 +0000 (09:33 -0700)]
Update packaging verion (#39101)

4 years agoUpdate R2RTest to compile the Serp application in two composite images (#39138)
Simon Nattress [Sat, 11 Jul 2020 11:51:51 +0000 (04:51 -0700)]
Update R2RTest to compile the Serp application in two composite images (#39138)

4 years agoFix creating OperatingSystem with PlatformID.Other (#39130)
Alexander Köplinger [Sat, 11 Jul 2020 01:49:23 +0000 (03:49 +0200)]
Fix creating OperatingSystem with PlatformID.Other (#39130)

Creating an OperatingSystem with PlatformID.Other would result in an exception about an unexpected enum value.
https://github.com/dotnet/runtime/pull/38790 was missing some tests that verified this behavior.

4 years agoMove printf in PauseOnStart (#39095)
John Salem [Sat, 11 Jul 2020 01:14:32 +0000 (18:14 -0700)]
Move printf in PauseOnStart (#39095)

* Only print to the console from the runtime when PauseOnStart has waited long enough

* Fix typo

4 years agoWASM: Fix System.Formats.Asn1 tests (#39104)
Alexander Köplinger [Sat, 11 Jul 2020 00:20:10 +0000 (02:20 +0200)]
WASM: Fix System.Formats.Asn1 tests (#39104)

Disable tests that rely on crypto APIs which don't work on WebAssembly right now which allows the test suite to pass: `Tests run: 3406, Errors: 0, Failures: 0, Skipped: 0. Time: 5.296689s`

Also enables a few test suites in tests.proj.

4 years agoAdd GCStress testing for libraries tests on checked CoreCLR (#38235)
Bruce Forstall [Fri, 10 Jul 2020 23:59:10 +0000 (16:59 -0700)]
Add GCStress testing for libraries tests on checked CoreCLR (#38235)

* Add GCStress testing for libraries tests on checked CoreCLR

Disable GCStress0x3 for now, as that causes many timeouts in
these tests.

* Increase timeout for GCStress scenarios

* Disable scheduled runs for libraries gcstress runs

There are currently too many failures in these jobs
so we don't want to run them on a schedule yet.

* Add tracking issue for disabling GCStress=3

4 years agoFix STOREIND optimization. (#39066)
Sergey Andreenko [Fri, 10 Jul 2020 22:52:29 +0000 (15:52 -0700)]
Fix STOREIND optimization. (#39066)

* add 1 repro test.

* temporary disable the tranformation.

4 years agoUpdate Environment.OSVersion for browser platform (#38790)
Marek Safar [Fri, 10 Jul 2020 22:06:56 +0000 (00:06 +0200)]
Update Environment.OSVersion for browser platform (#38790)

* Update Environment.OSVersion for browser platform

* Reflect api review

4 years agoFix precondition on OSX 10.15 mutable store tests
Jeremy Barton [Fri, 10 Jul 2020 21:28:58 +0000 (14:28 -0700)]
Fix precondition on OSX 10.15 mutable store tests

4 years ago[Wasm] Enable System.IO.Compression.ZipFile tests (#39092)
Steve Pfister [Fri, 10 Jul 2020 20:54:48 +0000 (16:54 -0400)]
[Wasm] Enable System.IO.Compression.ZipFile tests (#39092)

Found that the emscripten VFS does not write user specified file attributes, so skip
part of ZipFile_Create.InvalidDates that expects this to be supported.

Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
4 years agoPreserve AsyncValueTaskMethodBuilder.ObjectIdForDebugger (#39084)
Eric Erhardt [Fri, 10 Jul 2020 20:53:12 +0000 (15:53 -0500)]
Preserve AsyncValueTaskMethodBuilder.ObjectIdForDebugger (#39084)

These internal properties are used by the debugger, so they should be preserved when debugging is supported.

4 years agoRemove type pattern from descriptor (#39047)
Mateo Torres-Ruiz [Fri, 10 Jul 2020 20:52:54 +0000 (13:52 -0700)]
Remove type pattern from descriptor (#39047)

* Remove type pattern from descriptor

* Use CLR type name

Co-authored-by: Layomi Akinrinade <layomia@gmail.com>
Co-authored-by: Layomi Akinrinade <layomia@gmail.com>
4 years agoWASM: Add PlatformNotSupportedException for System.Net.Ping (#39091)
Alexander Köplinger [Fri, 10 Jul 2020 20:45:11 +0000 (22:45 +0200)]
WASM: Add PlatformNotSupportedException for System.Net.Ping (#39091)

The library isn't supported on WebAssembly.

4 years agoRewrite System.Text.Json stream tests to be async friendly and enable on WASM (#38663)
Alexander Köplinger [Fri, 10 Jul 2020 20:43:16 +0000 (22:43 +0200)]
Rewrite System.Text.Json stream tests to be async friendly and enable on WASM (#38663)

The tests dealing are using a (De)SerializationWrapper so the same code can be used both for String and Stream types.
It does that by wrapping the async Stream serialization calls in `Task.Run().GetAwaiter().GetResult()` to turn them into sync calls.
However that doesn't work on WebAssembly since we can't wait on tasks as there's only a single thread.

To fix this inverse the wrapper so the synchronous String calls are turned into async and use normal awaits for the Stream calls.

This allows the test suite to pass on WebAssembly: `Tests run: 8349, Errors: 0, Failures: 0, Skipped: 11. Time: 475.528706s`

4 years agoWASM: Add PlatformNotSupportedException for System.IO.Pipes (#39089)
Alexander Köplinger [Fri, 10 Jul 2020 20:18:39 +0000 (22:18 +0200)]
WASM: Add PlatformNotSupportedException for System.IO.Pipes (#39089)

* WASM: Add PlatformNotSupportedException for System.IO.Pipes

The library isn't supported on WebAssembly.

* Make test TFMs match src TFMs

4 years agoSpan BasicSymmetricCipher and other symmetric crypto internals
Kevin Jones [Fri, 10 Jul 2020 19:46:39 +0000 (15:46 -0400)]
Span BasicSymmetricCipher and other symmetric crypto internals

4 years agoWASM: Disable tests for System.Diagnostics.Process and .FileVersionInfo (#39088)
Alexander Köplinger [Fri, 10 Jul 2020 19:10:03 +0000 (21:10 +0200)]
WASM: Disable tests for System.Diagnostics.Process and .FileVersionInfo (#39088)

Both of these libraries throw PNSE on WebAssembly.

4 years agoadd IsOSPlatformOrLater and IsOSPlatformEarlierThan methods (#39005)
Adam Sitnik [Fri, 10 Jul 2020 19:04:47 +0000 (21:04 +0200)]
add IsOSPlatformOrLater and IsOSPlatformEarlierThan methods (#39005)

* add tests for IsOSPlatformOrLater and IsOSPlatformEarlierThan methods

* add IsOSPlatformOrLater and IsOSPlatformEarlierThan methods

* add xml docs that explain what the API does and what input is supported

* address code review feedback

* numbers in the middle of the platform name are not supported

4 years agoTweak crossgen2 test compilation modes (#39025)
David Wrighton [Fri, 10 Jul 2020 18:56:38 +0000 (11:56 -0700)]
Tweak crossgen2 test compilation modes (#39025)

- Change crossgen2 test coverage to compile every assembly in the application, not just the primary assembly
- Disable by default compilation with the --inputbubble flag. Instead, only use it if LargeVersionBubble is set to 1
- Add a specific error return code from crossgen2 for the case where all input assemblies are determined to be native binaries. This is used to support this scripting change

4 years agoIntrinsics support for WidenFourAsciiBytesToUtf16AndWriteToBuffer (#38597)
Prashanth Govindarajan [Fri, 10 Jul 2020 18:20:26 +0000 (11:20 -0700)]
Intrinsics support for WidenFourAsciiBytesToUtf16AndWriteToBuffer (#38597)

4 years agoCleanup WASM ICU PackageReference usage to use generated property (#39053)
Santiago Fernandez Madero [Fri, 10 Jul 2020 18:19:05 +0000 (11:19 -0700)]
Cleanup WASM ICU PackageReference usage to use generated property (#39053)

4 years agoAdd X64/Arm64 nested classes to System.Runtime.Intrinsics where missing (#38460)
Tanner Gooding [Fri, 10 Jul 2020 17:58:28 +0000 (10:58 -0700)]
Add X64/Arm64 nested classes to System.Runtime.Intrinsics where missing (#38460)

* Ensure that Arm64 and X64 classes exist in the appropriate places for the HWIntrinsics

* Adding the new Arm64 and X64 instruction sets

* Add a new test validating the IsSupported heirarchy is correct

* Updating the JIT to support the new Arm64 and X64 instruction sets

* Add missing new keywords

* Fixing a member name

* Adding Runtime_34587 to the mono exclude list

4 years agoProduce arm64-native Mono LLVM runtime packs (#38562)
Jo Shields [Fri, 10 Jul 2020 17:37:37 +0000 (13:37 -0400)]
Produce arm64-native Mono LLVM runtime packs (#38562)

Produce arm64-native Mono LLVM runtime packs (i.e. for running the SDK on ARM64, not publishing to ARM64 from x64)

4 years ago[wasm] Addressing System.Runtime.InteropServices.RuntimeInformation.Tests failures...
Mitchell Hwang [Fri, 10 Jul 2020 17:28:03 +0000 (13:28 -0400)]
[wasm] Addressing System.Runtime.InteropServices.RuntimeInformation.Tests failures (#39073)

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
4 years agoBump version for Microsoft.DotNet.XunitExtensions again (#39080)
Alexander Köplinger [Fri, 10 Jul 2020 17:26:49 +0000 (19:26 +0200)]
Bump version for Microsoft.DotNet.XunitExtensions again (#39080)

The recent darc update from https://github.com/dotnet/runtime/commit/9dc660148121c128dc960bf090b83fe67af3bc6f removed my https://github.com/dotnet/runtime/commit/4aea0a14f930eff557bb6e4f30b99be8a583d475 which is necessary to correctly detect WASM/Browser as using the Mono interpreter.

4 years agoUpdate dependencies from https://github.com/mono/linker build 20200710.3 (#39076)
dotnet-maestro[bot] [Fri, 10 Jul 2020 17:01:29 +0000 (17:01 +0000)]
Update dependencies from https://github.com/mono/linker build 20200710.3 (#39076)

Microsoft.NET.ILLink.Tasks
 From Version 5.0.0-preview.3.20359.3 -> To Version 5.0.0-preview.3.20360.3

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
4 years agoUpdate IL tools (#39049)
Aaron Robinson [Fri, 10 Jul 2020 16:46:55 +0000 (09:46 -0700)]
Update IL tools (#39049)

* Update IL tools

Enable calling convention tests with updated IL tooling.

* Disable new calling convention tests on mono

4 years agofix which test should be Pri1. (#39062)
Sergey Andreenko [Fri, 10 Jul 2020 15:44:15 +0000 (08:44 -0700)]
fix which test should be Pri1. (#39062)

4 years agoFix g_TrapReturningThreads to be accessed as 32-bit in asm and JIT code on arm64...
Jan Kotas [Fri, 10 Jul 2020 15:36:28 +0000 (08:36 -0700)]
Fix g_TrapReturningThreads to be accessed as 32-bit in asm and JIT code on arm64 (#39058)

4 years agoPrerequisite work item for the CSE of GT_CNS_INT for ARM64 work item (#39021)
Brian Sullivan [Fri, 10 Jul 2020 15:33:25 +0000 (08:33 -0700)]
Prerequisite work item for the CSE of GT_CNS_INT for ARM64 work item  (#39021)

* Prerequisite work item for the CSE of GT_CNS_INT work item  (zero code diffs in the framework libraries)

Mark nodes that use the division by constant optimization with GTF_DIV_BY_CNS_OPT
Don't perform const prop on expressions marked with GTF_DONT_CSE, as this would undo a constant CSE
Fix for bug in AssertionProp where we assign the wrong value number when folding a conditional
When dumping the BasicBlocks print hascall when the block is marked with BBF_HAS_CALL
Call CheckDivideByConstOptimized when early prop inserts a constant node
added methods: UsesDivideByConstOptimized, CheckDivideByConstOptimized and MarkDivideByConstant
Propagate any side effect flags in the gtCallAddr field of an indirect call node
Call CheckDivideByConstOptimized when morphing a divide or remainder nodes
Don't allow changing a floating point GT_DIV into a GT_MUL in fgMorph after the global morph phase
In loop hoisting, set BBF_HAS_CALL if we hoist a tree that contains a call
When hoisting something that requires a physical register, clear that requirement in the hoisted copy

* Code review feedback

* Remove two asserts in lower because it will always make an optimization for UDIV and UMOD with a power of two divisor.

4 years agoCreate copies of mutable properties on X509Certificate2
Kevin Jones [Fri, 10 Jul 2020 15:26:54 +0000 (11:26 -0400)]
Create copies of mutable properties on X509Certificate2

Export(Cert) returned the original byte array from the PAL. If a
caller mutated the result of the export, they would be mutating the
underlying representation of RawData in the PAL. To be consistent
with Windows and Linux, we return a copy in the PAL.

Fix OpenSSL PAL to prevent side effects between mutable
SubjectName.RawData and Subject properties (similarly for Issuer)

4 years ago[wasm] Fix linker dependency in the pinvoke callback table. (#39070)
Zoltan Varga [Fri, 10 Jul 2020 14:26:46 +0000 (10:26 -0400)]
[wasm] Fix linker dependency in the pinvoke callback table. (#39070)

Encode methods as class name+method name instead of their token.

4 years agoSimplify IsWow64Process interop (#39059)
Jan Kotas [Fri, 10 Jul 2020 13:41:34 +0000 (06:41 -0700)]
Simplify IsWow64Process interop (#39059)

Fixes #38910

4 years agoPut back missing EditorBrowsableState.Nevers on PlatformID (#39065)
Stephen Toub [Fri, 10 Jul 2020 13:37:42 +0000 (09:37 -0400)]
Put back missing EditorBrowsableState.Nevers on PlatformID (#39065)

4 years agoDelete NetEventSource.Enter/Exit events (#38874)
Stephen Toub [Fri, 10 Jul 2020 13:31:21 +0000 (09:31 -0400)]
Delete NetEventSource.Enter/Exit events (#38874)

They're super verbose, very inconsistent, costly, and not helpful (they appear to be trying to provide tracing of the full flow of calls, but they fail to do even that).

4 years ago[wasm] Enable System.Threading.Channels.Tests (#38849)
Mitchell Hwang [Fri, 10 Jul 2020 12:41:06 +0000 (08:41 -0400)]
[wasm] Enable System.Threading.Channels.Tests (#38849)

* [wasm] Enable System.Threading.Channels.Tests and skip hangs

* [wasm] Skip failing tests in System.Threading.Channels.Tests

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
4 years ago[interp] Add debug option which reports the hottest methods (#39045)
Vlad Brezae [Fri, 10 Jul 2020 12:00:14 +0000 (15:00 +0300)]
[interp] Add debug option which reports the hottest methods (#39045)

* [interp] Reenable computed goto on desktop

Which I accidentaly removed recently.

* [interp] Add debug option which reports the hottest methods

4 years ago[wasm] Implement pinvoke callback support. (#38932)
Zoltan Varga [Fri, 10 Jul 2020 11:21:19 +0000 (07:21 -0400)]
[wasm] Implement pinvoke callback support. (#38932)

* [wasm] Implement pinvoke callback support.

* Allow void return types.

* Fix name mangling for assembly names.

* Handle MonoPInvokeCallbackAttribute as well for now.

4 years ago[wasm] Modify System.Net.NetworkInformation to throw PNSE (#38928)
Maxim Lipnin [Fri, 10 Jul 2020 11:18:05 +0000 (14:18 +0300)]
[wasm] Modify System.Net.NetworkInformation to throw PNSE (#38928)

4 years agoAdd OSPlatform entries for iOS/tvOS/watchOS/Android (#36704)
Alexander Köplinger [Fri, 10 Jul 2020 09:26:54 +0000 (11:26 +0200)]
Add OSPlatform entries for iOS/tvOS/watchOS/Android (#36704)

* Add OSPlatform entries for iOS/tvOS/watchOS/Android

Implements the non-controversial new OSPlatform members from https://github.com/dotnet/runtime/issues/33331

* Add tests for new OSPlatform entries

4 years ago[browser][wasm][tests] Deactivate Map tests due to CI failures (#39061)
Kenneth Pouncey [Fri, 10 Jul 2020 08:31:38 +0000 (10:31 +0200)]
[browser][wasm][tests] Deactivate Map tests due to CI failures (#39061)

4 years agoRemove cross targeting for TraceSource and TextWriterTraceListener (#39043)
Anirudh Agnihotry [Fri, 10 Jul 2020 07:36:13 +0000 (00:36 -0700)]
Remove cross targeting for TraceSource and TextWriterTraceListener (#39043)

* stop cross targeting

4 years agoAllow XmlSerializer.Generator to run on Core > 2.x (#39013)
Viktor Hofer [Fri, 10 Jul 2020 07:12:26 +0000 (09:12 +0200)]
Allow XmlSerializer.Generator to run on Core > 2.x (#39013)

* Allow XmlSerializer.Generator to run on Core > 2.x

* Use repo local dotnet toolchain to build Generator

Use the repo local dotnet toolchain to generate the sgen output.
Adding a test to verify that the repo local and the live built outputs
are identical by size.

4 years agoWASM enable System.Collections.NonGeneric.Tests (#39020)
Santiago Fernandez Madero [Fri, 10 Jul 2020 07:11:48 +0000 (00:11 -0700)]
WASM enable System.Collections.NonGeneric.Tests (#39020)

4 years agoDefine Debugger.IsSupported feature switch to allow trimming of debugger only code...
Eric Erhardt [Fri, 10 Jul 2020 07:04:36 +0000 (02:04 -0500)]
Define Debugger.IsSupported feature switch to allow trimming of debugger only code. (#37288)

4 years agoImplementations of new HttpContent sync methods. (#38635)
Marie Píchová [Fri, 10 Jul 2020 06:52:35 +0000 (08:52 +0200)]
Implementations of new HttpContent sync methods. (#38635)

4 years agoaddressing some missing feedback Relating to Browser (#38968)
Anirudh Agnihotry [Fri, 10 Jul 2020 06:45:40 +0000 (23:45 -0700)]
addressing some missing feedback Relating to Browser (#38968)

* addressing some missing feedback

* Apply suggestions from code review

Co-authored-by: Santiago Fernandez Madero <safern@microsoft.com>
* remove odbc32 from ref

* fix stuff

Co-authored-by: Santiago Fernandez Madero <safern@microsoft.com>
4 years agoWASM Re-enable Threading.Channels serialization tests (#39016)
Santiago Fernandez Madero [Fri, 10 Jul 2020 05:57:22 +0000 (22:57 -0700)]
WASM Re-enable Threading.Channels serialization tests (#39016)

* WASM Re-enable Threading.Channels serialization tests

* PR Feedback

* Use ConditionalFact

4 years agoDelete tools-local\scripts (#39051)
Jan Kotas [Fri, 10 Jul 2020 05:54:53 +0000 (22:54 -0700)]
Delete tools-local\scripts (#39051)

4 years agoRevert changes to test breaking outter loop build (#39046)
Juan Hoyos [Fri, 10 Jul 2020 04:30:41 +0000 (21:30 -0700)]
Revert changes to test breaking outter loop build (#39046)

4 years agoInclude member name when constructing ValidationResult in CompareAttribute (#38867)
Pranav K [Fri, 10 Jul 2020 03:40:15 +0000 (20:40 -0700)]
Include member name when constructing ValidationResult in CompareAttribute (#38867)

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

4 years agoFix mark overflow processing (#38969)
Jan Vorlicek [Fri, 10 Jul 2020 01:41:09 +0000 (03:41 +0200)]
Fix mark overflow processing (#38969)

A recent refactoring PR #1688 has regressed GC processing of mark overflow.
If GC heap segments in the segment linked list are not ordered in an ascending
order by their addresses, the mark overflow processing misses segments on
lower addresses if they follow segments on higher addresses.
This leads to some objects that are alive to not to be reported and freed.

This change fixes the problem by making sure the segment order doesn't matter.

4 years agoCleanup references to centos 6 (#39006)
Jarret Shook [Fri, 10 Jul 2020 01:34:06 +0000 (18:34 -0700)]
Cleanup references to centos 6 (#39006)

* Remove Dockerfile

* Remove references to dockerfiles in runtime. These exist in dotnet-buildtools-prereqs.

4 years agoMove tailcall dispatcher into corelib (#38938)
Jakob Botsch Nielsen [Fri, 10 Jul 2020 01:33:06 +0000 (03:33 +0200)]
Move tailcall dispatcher into corelib (#38938)

Fix #35559

4 years ago[mono] Add support for UnmanagedCallersOnlyAttribute (#38728)
Aleksey Kliger (λgeek) [Fri, 10 Jul 2020 00:37:36 +0000 (20:37 -0400)]
[mono] Add support for UnmanagedCallersOnlyAttribute (#38728)

* [marshal] Add mono_method_has_unmanaged_callers_only_attribute

* [marshal] Allow calls to mono_marshal_get_managed_wrapped without a delegate class

   In that case, create a wrapper based on the signature of the method itself.

* [aot] Allow decode_method_ref to decode NATIVE_TO_MANAGED wrappers without a delegate class

   Bump the AOT file format

* [interp] ldftn will return a native-to-managed wrapper to UnmanagedCallersOnly methods

* aot: emit byte when we don't expect a class

* jit: create wrapper creation for ldftn in method-to-ir

   Do it at IR generation of the caller, not every time the ldftn is executed

* jit: don't create a jump trampoline for ldftn of a native-to-managed wrapper

   The wrapper might be called from a thread that's not attached to the runtime, and the jump trampoline will look at TLS vars that are not initialized

* interp: transform LDFTN into LDC of a create_method_pointer for UnmanagedCallersOnly method

* marshal: throw invalid program exception for instance and generic methods

* Emit IPE throw instead of aborting JIT or interp compilation for bad UnmanagedCallersOnly methods

   Instead of throwing while JITing (or transforming), throw when the LDFTN is executed.

* disallow delegate constructor calls on UnmanagedCallersOnly methods

* throw IPE if UnmanagedCallersOnly method has non-blittable args

* disallow DllImport and UnmanagedCallersOnly together

   throw NotSupportedException

Co-authored-by: Ryan Lucia <ryan@luciaonline.net>
4 years agoWASM enable System.Collections.Specialized.Tests (#39012)
Santiago Fernandez Madero [Fri, 10 Jul 2020 00:26:59 +0000 (17:26 -0700)]
WASM enable System.Collections.Specialized.Tests (#39012)

4 years ago[wasm] Add beginnings of support for building with ICU. (#38977)
Zoltan Varga [Thu, 9 Jul 2020 23:06:22 +0000 (19:06 -0400)]
[wasm] Add beginnings of support for building with ICU. (#38977)

Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
4 years ago[wasm] Modify System.Drawing.Common to throw PNSE on Browser (#38999)
Maxim Lipnin [Thu, 9 Jul 2020 23:04:56 +0000 (02:04 +0300)]
[wasm] Modify System.Drawing.Common to throw PNSE on Browser (#38999)

Co-authored-by: Santiago Fernandez Madero <safern@microsoft.com>
4 years agoAdd a repro test for `IsCompatibleType(cseLclVarTyp, expTyp)` (#38972)
Sergey Andreenko [Thu, 9 Jul 2020 22:55:31 +0000 (15:55 -0700)]
Add a repro test for `IsCompatibleType(cseLclVarTyp, expTyp)` (#38972)

* Add a repro test for #35724

* move it to pri1.