platform/upstream/dotnet/runtime.git
4 years agoAdvSimd support for System.Text.Unicode.Utf8Utility.GetPointerToFirstInvalidByte...
Carlos Sanchez Lopez [Mon, 20 Jul 2020 22:26:22 +0000 (15:26 -0700)]
AdvSimd support for System.Text.Unicode.Utf8Utility.GetPointerToFirstInvalidByte (#38653)

* AdvSimd support for System.Text.Unicode.Utf8Utility.GetPointerToFirstInvalidByte

* Move comment to the top, add shims.

* Little endian checks

* Use custom MoveMask method for AdvSimd

* Address suggestions to improve the AdvSimdMoveMask method

* Define initialMask outside MoveMask method

* UInt64 in Arm64MoveMask

* Add unit test case to verify intrinsics improvement

* Avoid casting to smaller integer type

* Typo and comment

* Use ShiftRightArithmetic instead of CompareEqual + And.
Remove test case causing other unit tests to fail.

* Use AddPairwise version of GetNotAsciiBytes

* Add missing shims causing Linux build to fail

* Simplify GetNonAsciiBytes to only one AddPairwise call, shorter bitmask

* Respect data type returned by masking method

* Address suggestions - assert trailingzerocount and bring back uint mask

* Trailing zeroes in AdvSimd need to be divided by 4, and total number should not be larger than 16

* Avoid declaring static field which causes PNSE in Utf8String.Experimental (S.P.Corelib code is used for being NetStandard)

* Prefer using nuint for BitConverter.TrailingZeroCount

4 years agoAdvSimd support for System.Text.Unicode.Utf8Utility.TranscodeToUtf8 (#39041)
Carlos Sanchez Lopez [Mon, 20 Jul 2020 22:04:40 +0000 (15:04 -0700)]
AdvSimd support for System.Text.Unicode.Utf8Utility.TranscodeToUtf8 (#39041)

* AdvSimd support for System.Text.Unicode.Utf8Utility.TranscodeToUtf8

* Readd using to prevent build failure.
Add AdvSimd equivalent operation to TestZ.

* Inverted condition

* Address IsSupported order, improve use ExtractNarrowingSaturated usage

* Rename source to result, second argument utf16Data

* Improve CompareTest

* Add shims causing failures in Linux

* Use unsigned version of ExtractNarrowingSaturate, avoid using MinAcross and use MaxPairwise instead

* Missing support check for Sse2.X64

* Add missing case for AdvSimd

* Use MinPairwise for short

4 years agoRevert "Fix resx test name mangling logic" (#39644)
Levi Broderick [Mon, 20 Jul 2020 22:02:34 +0000 (15:02 -0700)]
Revert "Fix resx test name mangling logic" (#39644)

* Revert "Fix resx test name mangling logic"

This reverts commit 6af0d0e09a3b00a3a79033f7d26670b2563405fa.

* Add comment warning not to change this code

4 years agoFix tiering assertion failures from concurrent or reentering JIT of the same native...
Koundinya Veluri [Mon, 20 Jul 2020 22:00:19 +0000 (18:00 -0400)]
Fix tiering assertion failures from concurrent or reentering JIT of the same native code version (#39643)

Fix tiering assertion failures from concurrent or reentering JIT of the same native code version

Allowed disabling call counting multiple times.

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

4 years agoDeclare AllowReversePInvokeCallsAttribute as Obsolete. (#39636)
Aaron Robinson [Mon, 20 Jul 2020 21:24:50 +0000 (14:24 -0700)]
Declare AllowReversePInvokeCallsAttribute as Obsolete. (#39636)

4 years agoAllow Debugger attributes to be trimmed in Mono (#39479)
Eric Erhardt [Mon, 20 Jul 2020 20:42:22 +0000 (15:42 -0500)]
Allow Debugger attributes to be trimmed in Mono (#39479)

* Allow Debugger attributes to be trimmed in Mono.

Changed debugger-agent to allow for the Debugger Attributes to not exist.
Removed the Debugger Attributes entries from the Descriptors.xml file.

Fix https://github.com/mono/linker/issues/1355

* Use GENERATE_TRY_GET_CLASS_WITH_CACHE to initialize Debugger attribute pointers.

4 years agoApply missing obsolete attributes in src; fix attribute ordering (#39607)
Jeff Handley [Mon, 20 Jul 2020 20:34:18 +0000 (13:34 -0700)]
Apply missing obsolete attributes in src; fix attribute ordering (#39607)

* Apply missing obsolete attributes in src; fix attribute ordering

* Only obsolete the constructors of PolicyStatement

4 years agoAdd ProcessInfo command to Diagnostics Server (#38967)
John Salem [Mon, 20 Jul 2020 20:31:42 +0000 (13:31 -0700)]
Add ProcessInfo command to Diagnostics Server (#38967)

4 years agoFix fd leak in Diagnostics Server and add better error handling (#39129)
John Salem [Mon, 20 Jul 2020 20:25:26 +0000 (13:25 -0700)]
Fix fd leak in Diagnostics Server and add better error handling (#39129)

4 years ago[wasm] Address System.Text.RegularExpressions.Tests Failures (#39470)
Mitchell Hwang [Mon, 20 Jul 2020 19:59:59 +0000 (15:59 -0400)]
[wasm] Address System.Text.RegularExpressions.Tests Failures (#39470)

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
4 years agoUnify resource strings used for Browser PNSE (#39637)
Alexander Köplinger [Mon, 20 Jul 2020 19:22:55 +0000 (21:22 +0200)]
Unify resource strings used for Browser PNSE (#39637)

We sometimes used `... is not supported on Browser.` and elsewhere `... is not supported on this platform.`

Standardize on the latter one as it can potentially be reused for other targets.

4 years ago[wasm] Enable System.CodeDom.Tests test suite (#39626)
Maxim Lipnin [Mon, 20 Jul 2020 19:11:37 +0000 (22:11 +0300)]
[wasm] Enable System.CodeDom.Tests test suite (#39626)

Part of https://github.com/dotnet/runtime/issues/38422.

4 years agoAdd PNSE on non-Browser for S.R.I.JavaScript and clean up references (#39629)
Alexander Köplinger [Mon, 20 Jul 2020 18:53:20 +0000 (20:53 +0200)]
Add PNSE on non-Browser for S.R.I.JavaScript and clean up references (#39629)

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

4 years agoCreate and add instance reference inside ResolveMetadata* (#39330)
David Cantu [Mon, 20 Jul 2020 18:39:32 +0000 (11:39 -0700)]
Create and add instance reference inside ResolveMetadata* (#39330)

* Create and add instance reference on ResolveMetadata

* Address suggestions

4 years ago[mono] Update ICU version, disable some tests for Browser (#39596)
Egor Bogatov [Mon, 20 Jul 2020 18:38:01 +0000 (21:38 +0300)]
[mono] Update ICU version, disable some tests for Browser (#39596)

4 years ago[wasm] Sort Assembly List in WASM Apps (#39374)
Mitchell Hwang [Mon, 20 Jul 2020 16:52:02 +0000 (12:52 -0400)]
[wasm] Sort Assembly List in WASM Apps (#39374)

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
4 years ago[wasm] Include data archives and timezone data by default (#39586)
Larry Ewing [Mon, 20 Jul 2020 16:40:17 +0000 (11:40 -0500)]
[wasm] Include data archives and timezone data by default (#39586)

* Add data archive loading to the generic loading logic

4 years ago[wasm][debugger] Don't download unnecessary assemblies to DebugProxy (#39530)
Thays Grazia [Mon, 20 Jul 2020 14:22:56 +0000 (11:22 -0300)]
[wasm][debugger] Don't download unnecessary assemblies to DebugProxy (#39530)

Don't download unnecessary assemblies to DebugProxy

4 years agoProperly map exceptions from NetworkStream ctor. (#39514)
Marie Píchová [Mon, 20 Jul 2020 13:57:16 +0000 (15:57 +0200)]
Properly map exceptions from NetworkStream ctor. (#39514)

4 years agoSync shared compiler file (#39164)
Michal Strehovský [Mon, 20 Jul 2020 12:57:09 +0000 (14:57 +0200)]
Sync shared compiler file (#39164)

4 years agoSynchronize dataflow annotations accross virtual methods (#39458)
Michal Strehovský [Mon, 20 Jul 2020 12:51:46 +0000 (14:51 +0200)]
Synchronize dataflow annotations accross virtual methods (#39458)

4 years agoReenable gcdump test (#39555)
David Mason [Mon, 20 Jul 2020 09:41:26 +0000 (02:41 -0700)]
Reenable gcdump test (#39555)

lower gcdump thresholds to make test pass on all platforms/architectures

4 years agoadd SupportsTls11 and SupportsTls12 to PlatformDetection avoid OS versions in tests...
Tomas Weinfurt [Mon, 20 Jul 2020 07:59:22 +0000 (00:59 -0700)]
add SupportsTls11 and SupportsTls12 to PlatformDetection avoid OS versions in tests (#39482)

* add SupportsTls11 and SupportsTls12 to avoid OS versions in tests

* feedback from review

* fix condition

4 years agoTest EmbeddedSignatureData api (#39329)
David Wrighton [Sat, 18 Jul 2020 22:20:42 +0000 (15:20 -0700)]
Test EmbeddedSignatureData api (#39329)

- Add test to provide clarity about the behavior of the EmbeddedSignatureData api when examining the start of the signature for custom modifiers

4 years ago[wasm] Trim down size of dotnet.wasm (#39549)
Vlad Brezae [Sat, 18 Jul 2020 21:40:04 +0000 (00:40 +0300)]
[wasm] Trim down size of dotnet.wasm (#39549)

* [interp] Use constant for concurrent collection in progress

Saves 4k on wasm.

* [sgen] Use constant for concurrent sweep

Saves 0.5k on wasm

* [sgen] Remove code from threadpool when not using concurrent mode

Saves 2.5k on wasm

* [sgen] Avoid keeping some callbacks alive

Saves 0.5k on wasm

* [sgen] Avoid registering callback if not used

* [sgen] Add option to remove binary protocol from build

Saves 5k on wasm

* [sgen] Add option to disable togglerefs

Saves 1k on wasm

* [sgen] We never need to wait for sweep if serial

Saves 0.5k on wasm

* [sgen] Disable also canaries if debug helpers are disabled

Saves 1k on wasm

* [sgen] Disable also pinning_stats if debug features are disabled

Saves 2k on wasm

* [sgen] Disable also gchandle stats if debug is disabled

Saves 1k on wasm

* [sgen] Disable also sgen logging if debugging is disabled

Saves 6k on wasm

* [runtime] Disable log messages if assert messages is disabled

This is mainly beneficial do to very common calls of g_error.

Saves 35k on wasm

4 years agoAnnotate and adjust more of CoreLib for trimming (#38865)
Michal Strehovský [Sat, 18 Jul 2020 17:07:43 +0000 (19:07 +0200)]
Annotate and adjust more of CoreLib for trimming (#38865)

* Annotate and adjust more of CoreLib for trimming

* Update CustomAttribute.cs

* Update TypeBuilder.Mono.cs

4 years agoFix resx test name mangling logic (#39569)
Levi Broderick [Sat, 18 Jul 2020 17:02:55 +0000 (10:02 -0700)]
Fix resx test name mangling logic (#39569)

4 years agoFix il verification tests (#39538)
David Wrighton [Sat, 18 Jul 2020 14:01:47 +0000 (07:01 -0700)]
Fix il verification tests (#39538)

* Revert "delete test project. (#39501)"

This reverts commit ecb231cb3d962d332d00344358b0559043d29f88.

* Fix ILVerification tests
- Re-enable the test project build
- Change string resources in type system to directly use ResourceManager instead of SR abstraction which is unavaliable in the test build tree
- Add test to verify that all ExceptionStringID values have associated strings
- Use ToolsCommonPath property to successfully reference the correct resource file

* Address feedback and allow the strings to be handled with a runtime implementation

4 years agoRemove unused locals in System.Management (#39570)
Matt Kotsenas [Sat, 18 Jul 2020 13:43:57 +0000 (06:43 -0700)]
Remove unused locals in System.Management (#39570)

4 years agoMake Comments In SortedList Match Code Bahaviour (#39595)
Huang, Zhaoquan [Sat, 18 Jul 2020 13:35:48 +0000 (21:35 +0800)]
Make Comments In SortedList Match Code Bahaviour (#39595)

The method "EnsureCapacity" does not check whether resizing
is necessary, thus the comments should not contain the conditional
clause.

Fix #39526

4 years agoRemove SELECTANY usage (#39532)
Jan Vorlicek [Sat, 18 Jul 2020 12:58:02 +0000 (14:58 +0200)]
Remove SELECTANY usage (#39532)

This change replaces SELECTANY by using constexpr. It results in major
reduction of the native binaries size (3.2MB in the libcoreclr.so case)

4 years agoCorrect TryReadTo ref assembly parameter name (#39594)
Ben Adams [Sat, 18 Jul 2020 12:54:41 +0000 (13:54 +0100)]
Correct TryReadTo ref assembly parameter name (#39594)

4 years agoReplace USE_INTERNAL_ACCESSIBILITY with SYSTEM_PRIVATE_CORELIB (#39588)
Jan Kotas [Sat, 18 Jul 2020 12:45:18 +0000 (05:45 -0700)]
Replace USE_INTERNAL_ACCESSIBILITY with SYSTEM_PRIVATE_CORELIB (#39588)

Follow pattern used everywhere else

4 years agoUse static lambdas in several libraries (#39273)
Stephen Toub [Sat, 18 Jul 2020 11:03:24 +0000 (07:03 -0400)]
Use static lambdas in several libraries (#39273)

* Use static lambdas in System.Net.Http

This caught one bug that was causing an unexpected/undesirable closure.

* Use static lambdas in System.Private.CoreLib

* Use static lambdas in System.Net.WebSockets

* Use static lambdas in System.Threading.Channels

4 years agoRemove unused locals in System.Configuration.ConfigurationManager (#39544)
Matt Kotsenas [Sat, 18 Jul 2020 06:29:30 +0000 (23:29 -0700)]
Remove unused locals in System.Configuration.ConfigurationManager (#39544)

* Remove unused locals in System.Configuration.ConfigurationManager

Removed unused locals, and where needed updated tests in
System.Configuration.ConfigurationManager.

* Update GetHashCode test

4 years agoDisable Interop\COM\Dynamic\Dynamic under GCStress (#39585)
Bruce Forstall [Sat, 18 Jul 2020 05:58:06 +0000 (22:58 -0700)]
Disable Interop\COM\Dynamic\Dynamic under GCStress (#39585)

Issue: https://github.com/dotnet/runtime/issues/39584

4 years agoFix GC poll insertion for `BBJ_CALLFINALLY` basic blocks. (#39564)
Eugene Rozenfeld [Sat, 18 Jul 2020 05:07:35 +0000 (22:07 -0700)]
Fix GC poll insertion for `BBJ_CALLFINALLY` basic blocks. (#39564)

Fixes #39472.

4 years agoRemove unused locals in System.IO.Ports (#39557)
Matt Kotsenas [Sat, 18 Jul 2020 04:48:32 +0000 (21:48 -0700)]
Remove unused locals in System.IO.Ports (#39557)

Also changed visibility in some tests from `private` to `public` to
follow the other code in the project and prevent the compiler from
thinking the tests are unused.

4 years agoDisable Vector tests failing under GCStress (#39580)
Bruce Forstall [Sat, 18 Jul 2020 04:27:50 +0000 (21:27 -0700)]
Disable Vector tests failing under GCStress (#39580)

* Disable Vector tests failing under GCStress

Issues:
https://github.com/dotnet/runtime/issues/39576
https://github.com/dotnet/runtime/issues/39579

* Also disable Vector256_1_r/Vector_1_ro tests

Issue: https://github.com/dotnet/runtime/issues/39581

4 years agoAdd more information to test timeout message (#39558)
Bruce Forstall [Sat, 18 Jul 2020 04:26:22 +0000 (21:26 -0700)]
Add more information to test timeout message (#39558)

This is to help validate that timeouts are what we think.

4 years agoRemove unused locals in System.IO.FileSystem.* (#39552)
Matt Kotsenas [Sat, 18 Jul 2020 04:26:06 +0000 (21:26 -0700)]
Remove unused locals in System.IO.FileSystem.* (#39552)

* Remove unused locals in System.IO.FileSystem.AccessControl

* Removed unused locals in System.IO.FileSystem.DriveInfo

* Remove unused locals and methods in System.IO.FileSystem

4 years agoRemove unused local variables and methods from System.Drawing.Common (#39551)
Matt Kotsenas [Sat, 18 Jul 2020 04:22:36 +0000 (21:22 -0700)]
Remove unused local variables and methods from System.Drawing.Common (#39551)

* Remove unused local variables and methods from System.Drawing.Common

Remove unused locals, and update a few unit tests that has no asserts.

* Revert adding asserts in tests

Since the tests run across different printer hardware they can't take a
dependency on the default printer settings. Revert adding asserts in
these cases so the tests still verify that the properties don't throw.

4 years agoImplement IComparable on Rune (#39541)
Levi Broderick [Sat, 18 Jul 2020 04:18:59 +0000 (21:18 -0700)]
Implement IComparable on Rune (#39541)

4 years agoRemove some non-unicode characters from source code (#39527)
monojenkins [Sat, 18 Jul 2020 04:15:55 +0000 (00:15 -0400)]
Remove some non-unicode characters from source code (#39527)

<!--
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
-->

I've been noticing some C compiler warnings during build of dotnet/runtime.
```
  C:\Users\gotos\source\repos\runtime\src\mono\mono\mini\mini-runtime.c(1920,1): warning C4819: The file contains a character that cannot be represented in the current code page (949). Save the file in Unicode format to prevent data loss [C:\Users\gotos\source\repos\runtime\src\mono\msvc\libmono-dynamic.vcxproj]
  C:\Users\gotos\source\repos\runtime\src\mono\mono\mini\method-to-ir.c(5337,1): warning C4819: The file contains a character that cannot be represented in the current code page (949). Save the file in Unicode format to prevent data loss [C:\Users\gotos\source\repos\runtime\src\mono\msvc\libmono-dynamic.vcxproj]
```
Apparently there are some smart quotes and a zero-width space (Why?!) in some of Mono's source code. This PR removes those needless unicode characters.

I hope that opening a PR here will result in the changed code being mirrored to dotnet/runtime repo as well?

Co-authored-by: Gnbrkm41 <Gnbrkm41@users.noreply.github.com>
4 years agoAdd breaking change version DAC API (ISOSDacInterface9 interface) (#39567)
Mike McLaughlin [Sat, 18 Jul 2020 02:40:55 +0000 (19:40 -0700)]
Add breaking change version DAC API (ISOSDacInterface9 interface) (#39567)

GetBreakingChangeVersion(int* version)

Used in SOS to check if any of the runtime data structures it depends on has changed.

Issue: https://github.com/dotnet/runtime/issues/27309

4 years agoCorrect test to account for PLINQ Zip unordered behavior (#39553)
Stephen A. Imhoff [Sat, 18 Jul 2020 01:58:35 +0000 (18:58 -0700)]
Correct test to account for PLINQ Zip unordered behavior (#39553)

4 years agoAdd Convert.ToHexString/FromHexString
Nicolas Portmann [Sat, 18 Jul 2020 00:12:21 +0000 (02:12 +0200)]
Add Convert.ToHexString/FromHexString

Add methods to convert between hexadecimal strings and bytes, and converts internal usage to use those APIs when possible, or reuse the shared code as helpers otherwise.

4 years agoDisable slow tests under GCStress (#39545)
Bruce Forstall [Sat, 18 Jul 2020 00:11:46 +0000 (17:11 -0700)]
Disable slow tests under GCStress (#39545)

Some tests are very slow under GCStress for some platforms, especially
Linux arm32 and for GCStress=3. Disable these tests under GCStress.

https://github.com/dotnet/runtime/issues/2231

4 years agoMark Obsoletions for .NET 5 (#39269)
Jeff Handley [Sat, 18 Jul 2020 00:09:29 +0000 (17:09 -0700)]
Mark Obsoletions for .NET 5 (#39269)

* Mark new obsoletions for .NET 5; update existing obsoletions

* Exclude DirectoryServicesPermission/DirectoryServicesPermissionAttribute from obsoletions for now

* No need to restore SYSLIB0003 at end of Forwards files

* Use a common Obsoletions.cs file for all SYSLIB obsoletions

* Resurrect CER code behind #ifdef in EventSource

* Mark GlobalAssemblyCache overrides as Obsolete

* Suppress Thread.Abort() error in ImageAnimator.Unix.cs

* Unconditionally mark RoAssembly.GlobalAssemblyCache as obsolete

* Rename MSLIB0001 to SYSLIB0001 in ref assembly

* Suppress obsoletion warnings in tests

* Adopt a uniform #ifdef for NET50_OBSOLETIONS

* Fix BinaryFormatter obsoletion message after the rebase

* Use SYSTEM_PRIVATE_CORELIB constant instead of NETCOREAPP

* Remove the code comment on the ifdef

* Apply feedback related to CER obsoletions

* Apply feedback related to CAS

* Update ref assembly to reflect SecurityManager obsoletion

* Fix regression in System.IO.Pipes.NamedPipeServerStream.Windows.RunAsClient

4 years agoRevert "Kill REG_PROFILER_RET_SCRATCH (#37679)" (#39335)
Andy Ayers [Fri, 17 Jul 2020 23:21:27 +0000 (16:21 -0700)]
Revert "Kill REG_PROFILER_RET_SCRATCH (#37679)" (#39335)

This reverts commit b179e198403adbfbf275a40741cef7b252cda186.

4 years agoFix liveness of FrameListRoot (#39452)
Carol Eidt [Fri, 17 Jul 2020 23:19:57 +0000 (16:19 -0700)]
Fix liveness of FrameListRoot (#39452)

* Fix liveness of FrameListRoot

The FrameListRoot variable isn't used if `call->IsSuppressGCTransition()`, but liveness wasn't checking this.

Fix #39221

4 years agoGuard SseImpl method body with IsSupported check (#39246)
Andy Ayers [Fri, 17 Jul 2020 23:18:52 +0000 (16:18 -0700)]
Guard SseImpl method body with IsSupported check (#39246)

Though this method is only ever callable by code that's already done the right
IsSupported check, add a redundant check to the method itself, so that when
crossgenning SPC on non-xarch platforms we won't try and compile the xarch
specific parts of this method.  This should save some time and a bit of file
size for non-xarch SPCs.

See notes on #38894 for context.

4 years agoEnable FEATURE_METADATA_VERIFY_LAYOUTS (#39451)
Steve MacLean [Fri, 17 Jul 2020 20:38:54 +0000 (16:38 -0400)]
Enable FEATURE_METADATA_VERIFY_LAYOUTS (#39451)

* Enable FEATURE_METADATA_VERIFY_LAYOUTS

Feature was apparently disabled due to use of MSVC specific
preprocessor macros.

Rewrite macros to be standards compliant.

Remove *_ESCAPED macros

Add USING_ALIAS(aliasName, typeName)

Fix friend class declaration

* Fix DataTargetReader::AlignBase()

DAC_ALIGNAS macro was used to force MSVC and clang/gcc
compilers layouts to match.  Update DataTargetReader::AlignBase()
assumptions based on new layouts

4 years ago[mono] Fix an assert which happens when marshalling ftnptr types. (#39517)
Zoltan Varga [Fri, 17 Jul 2020 20:02:55 +0000 (16:02 -0400)]
[mono] Fix an assert which happens when marshalling ftnptr types. (#39517)

MonoClass-es created for ftnptr types have an implicit pointer field so their size is not
the same as the computed size.

4 years agoFix libraries run-test-job dependencies (#39536)
Santiago Fernandez Madero [Fri, 17 Jul 2020 20:02:34 +0000 (13:02 -0700)]
Fix libraries run-test-job dependencies (#39536)

4 years ago Add telemetry to System.Net.NameResolution (#38409)
Miha Zupan [Fri, 17 Jul 2020 19:05:41 +0000 (21:05 +0200)]
 Add telemetry to System.Net.NameResolution (#38409)

* Add telemetry to System.Net.NameResolution

* Rename hostName to hostNameOrAddress

* Use constants for event IDs

* Address PR feedback

* Reduce overhead when only the counter is needed

* Make NameResolution Telemetry an activity

* Remove redundant check

* Fix indentation

* Check IsEnabled before AfterResolution to help linker

* Add Telemetry tests

* Throws => ThrowsAny

4 years agoDisable Add_TakeFromAnotherThread_ExpectedItemsTaken for TailcallStress (#39399)
Bruce Forstall [Fri, 17 Jul 2020 18:19:42 +0000 (11:19 -0700)]
Disable Add_TakeFromAnotherThread_ExpectedItemsTaken for TailcallStress (#39399)

Issue: https://github.com/dotnet/runtime/issues/39398

4 years agoSmall performance improvment (#38485)
Youssef Victor [Fri, 17 Jul 2020 16:53:20 +0000 (18:53 +0200)]
Small performance improvment (#38485)

* Small performance improvment

* Update Matrix3x2 as well

4 years agoAdd a --enable-minimal=eventpipe configure option. Disable eventpipe on wasm. (#38991)
Zoltan Varga [Fri, 17 Jul 2020 16:28:21 +0000 (12:28 -0400)]
Add a --enable-minimal=eventpipe configure option. Disable eventpipe on wasm. (#38991)

* Add a --enable-minimal=eventpipe configure option. Disable eventpipe on wasm.

* Address review comments.

* Disable FeaturePerfTracing for wasm.

* Disable calls to ep_init()/ep_cleanup() as well.

4 years ago[wasm] Enable System.Resources.Extensions.Tests and System.Resources.ResourceManager...
Maxim Lipnin [Fri, 17 Jul 2020 15:55:41 +0000 (18:55 +0300)]
[wasm] Enable System.Resources.Extensions.Tests and System.Resources.ResourceManager.Tests test suites (#39513)

4 years agoStop gating HelixPreCommands behind an always-false conditional. (#38642)
Jo Shields [Fri, 17 Jul 2020 15:08:47 +0000 (11:08 -0400)]
Stop gating HelixPreCommands behind an always-false conditional. (#38642)

Fixes interpreter test lane not running on interpreter

4 years ago[Wasm] Additional signatures for SkiaSharp interop + More (#39494)
monojenkins [Fri, 17 Jul 2020 14:48:51 +0000 (10:48 -0400)]
[Wasm] Additional signatures for SkiaSharp interop + More (#39494)

This change adds the set of signatures required for SkiaSharp to work untouched using the signatures already provided for the existing platform.

Co-authored-by: mattleibow <mattleibow@users.noreply.github.com>
4 years agoAdd Record tests to NetFx (#39477)
Steve Harter [Fri, 17 Jul 2020 14:06:18 +0000 (09:06 -0500)]
Add Record tests to NetFx (#39477)

4 years agoFix Mono RuntimeType to handle conversion between enums of same underlying type....
Johan Lorensson [Fri, 17 Jul 2020 13:32:21 +0000 (15:32 +0200)]
Fix Mono RuntimeType to handle conversion between enums of same underlying type. (#39207)

runtime\src\tests\tracing\common\TraceConfiguration.cs tries to call
a constructor of using type System.Diagnostics.Tracing.EventPipeSerializationFormat
with a different (but compatbile) enum type using reflection. Both enums
are of underlying type, Int32, but the call fails on Mono since it fails
to recognize that the two enums are compatible in CheckValue.

Fix will make sure call to IsConvertibleToPrimitiveType uses underlying
type as target type when checking if current value is convertible to a
compatible value.

4 years agomark Windows-specific APIs as such (#39265)
Adam Sitnik [Fri, 17 Jul 2020 13:11:50 +0000 (15:11 +0200)]
mark Windows-specific APIs as such (#39265)

* move all OSPlatformAttributes to a single file so they can be easily referenced in < .NET 5 libraries

* Adds System.Runtime.Versioning*Platform* annotation attributes to < .NET 5 builds

* introduce MinimiumSupportedWindowsPlatform

* introduce IsWindowsSpecific setting that adds MinimumOSPlatform attribute for Windows Specific libraries

* mark all Windows-specific libraries as such

* annotate Windows-specific System.Console methods and properites

* annotate Windows-specific DpapiProtectedConfigurationProvider type

* annotate throwing Windows-specific APIs from System.Diagnostics.Process namespace

* annotate throwing Windows-specific APIs from System.IO.MemoryMappedFiles namespace

* annotate Windows-specific APIs from System.IO.Pipes namespace

* the new attributes should support enums

* annotate Windows-specific APIs from HttpListenerTimeoutManager class

* annotate Windows-specific APIs from System.Net.Sockets namespace

* annotate Windows-specific APIs from System.Runtime.InteropServices namespace

* annotate Windows-specific APIs from System.Security.Cryptography.Csp namespace

* annotate Windows-specific APIs from System.Security.Cryptography.X509Certificates namespace

* annotate Windows-specific APIs from System.Threading namespace

* address code review feedback: dont introduce new constants, reuse existing SYSTEM_PRIVATE_CORELIB

* code review: import the namespace, simplify the attribute name

* add missing Socket.DuplicateAndClose and Socket(SocketInformation)

* fix the test name (it does not throw)

* add missing DriveInfo.set_VolumeLabel

* add System.IO.FileSystem File Encrypt and Descrypt methods

* simplify the < .NET 5 check

* enable nullable in explicit way as it's not enabled in all the projects where this file is included

* include platform attributes in projects that ask for it in explicit way

* set IncludePlatformAttributes to true for projects that include files from other projects

* use suggestions from Viktor and Santi

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
4 years agoFix IsPrerelease condition to be aligned with rest of utf8string code (#39511)
Jan Jahoda [Fri, 17 Jul 2020 12:10:15 +0000 (14:10 +0200)]
Fix IsPrerelease condition to be aligned with rest of utf8string code (#39511)

Co-authored-by: Jan Jahoda <jajahoda@.microsoft.com>
4 years agodelete test project. (#39501)
Sergey Andreenko [Fri, 17 Jul 2020 08:00:49 +0000 (01:00 -0700)]
delete test project. (#39501)

4 years agofix build for netcoreapp3.0 (#39447)
Eirik Tsarpalis [Fri, 17 Jul 2020 07:01:25 +0000 (08:01 +0100)]
fix build for netcoreapp3.0 (#39447)

4 years agomark them as extensions methods in the src (#39498)
Anirudh Agnihotry [Fri, 17 Jul 2020 06:48:27 +0000 (23:48 -0700)]
mark them as extensions methods in the src (#39498)

* use static method calls

* remove unnecessary helpers calls

4 years agoRevert "Adding support for constrained open generics to DI (#34393)" (#39486)
Maryam Ariyan [Fri, 17 Jul 2020 05:08:55 +0000 (22:08 -0700)]
Revert "Adding support for constrained open generics to DI (#34393)" (#39486)

This reverts commit 211bc884dbadb8765699554257699f5c82d21f6d.

4 years agoFix license header in gcpriv.h (#39496)
Jan Kotas [Fri, 17 Jul 2020 04:21:55 +0000 (21:21 -0700)]
Fix license header in gcpriv.h (#39496)

4 years agoremove ignored reference (#39459)
Anirudh Agnihotry [Fri, 17 Jul 2020 03:20:04 +0000 (20:20 -0700)]
remove ignored reference (#39459)

4 years agoAddress late feedback for #39320. (#39387)
Eugene Rozenfeld [Fri, 17 Jul 2020 02:50:57 +0000 (19:50 -0700)]
Address late feedback for #39320. (#39387)

4 years agoEnsure Firing Activity Stop event before setting the current Activity (#39400)
Tarek Mahmoud Sayed [Fri, 17 Jul 2020 02:10:41 +0000 (19:10 -0700)]
Ensure Firing Activity Stop event before setting the current Activity (#39400)

4 years agoUpdate MSBuild Traversal SDK that contains StopOnFirstFailure support (#39481)
Santiago Fernandez Madero [Fri, 17 Jul 2020 02:02:43 +0000 (19:02 -0700)]
Update MSBuild Traversal SDK that contains StopOnFirstFailure support (#39481)

4 years agoFix Crossgen2 compilation in case input files are on different drives (#39441)
Anton Lapounov [Fri, 17 Jul 2020 01:29:38 +0000 (18:29 -0700)]
Fix Crossgen2 compilation in case input files are on different drives (#39441)

Crossgen2 would try to override input files if they are on a different drive or a share with respect to _compositeRootPath.

4 years agofix exception strings. (#39491)
Manish Godse [Fri, 17 Jul 2020 01:18:35 +0000 (18:18 -0700)]
fix exception strings. (#39491)

4 years agoFix rare case of 'Reading is already in progress' after canceling another Read (...
Brennan [Fri, 17 Jul 2020 01:12:39 +0000 (18:12 -0700)]
Fix rare case of 'Reading is already in progress' after canceling another Read (#39336)

4 years agoDisable System.Runtime tests that use binary formatter on wasm (#39487)
Santiago Fernandez Madero [Fri, 17 Jul 2020 01:03:50 +0000 (18:03 -0700)]
Disable System.Runtime tests that use binary formatter on wasm (#39487)

4 years agoUse one-shot hash functions where possible. (#39455)
Kevin Jones [Fri, 17 Jul 2020 00:18:40 +0000 (20:18 -0400)]
Use one-shot hash functions where possible. (#39455)

4 years agoLinking native libraries into superhost (#38684)
Vladimir Sadov [Thu, 16 Jul 2020 23:29:12 +0000 (16:29 -0700)]
Linking native libraries into superhost (#38684)

* native libs location

* pass artifacts locations as CMake variables.

* Link native libs

* use LibrariesConfiguration to discover libraries artifacts

* redirect to current exe

* remove bundled binaries from the  netcoreapp/pkg

* delete exports file

* no bundling of native libs on OSX

* only link native libs on Linux

* Support linking of coreclr on Linux only

* PR feedback

* move the shim to dllimport.cpp

* Use library names vs. file names

* removed ShouldRedirectToCurrentLibrary. NULL library name in PAL_LoadLibrary will be always considered self-referring.

4 years agoRemoving unused Resources from System.Threading.Overlapped (#39395)
Jose Perez Rodriguez [Thu, 16 Jul 2020 23:10:57 +0000 (16:10 -0700)]
Removing unused Resources from System.Threading.Overlapped (#39395)

* Removing unused Resources from System.Threading.Overlapped

* Removing unused code from S.T.O.csproj and add Resources check to test

4 years agoAdding support for constrained open generics to DI (#34393)
Jimmy Bogard [Thu, 16 Jul 2020 23:08:35 +0000 (18:08 -0500)]
Adding support for constrained open generics to DI (#34393)

4 years agoICU integration and asset loading overhaul (#37971)
Katelyn Gadd [Thu, 16 Jul 2020 23:02:10 +0000 (16:02 -0700)]
ICU integration and asset loading overhaul (#37971)

This PR overhauls runtime startup/asset loading and adds support for ICU integration.

The mono-config.js format is reworked and simplified, with new functionality added:

    Individual assets can be loaded from one or more remote sources with configurable fallback behavior
    In addition to the existing support for loading assemblies, you can now pre-load arbitrary files into the native heap or into emscripten's virtual file system. VFS support previously only existed in runtime-test.js but now is available to any consumer of dotnet.js.
    Assets can have a virtual path set so that their application-facing path does not necessarily have to match their path on the server.
    One or more ICU data archives can be added to the assets list and will be automatically loaded and used to enable ICU-based globalization support.
    Many configuration knobs that previously required API calls can now be set declaratively in the configuration file (environment variables, etc.)

WasmAppBuilder is updated to add ICUDataFiles and RemoteSources parameters that can be used to add the associated information to the config file declaratively from a msbuild project.

Various adjustments are made to existing tests and test cases so that they will pass with the addition of ICU integration.

Co-authored-by: EgorBo <egorbo@gmail.com>
Co-authored-by: Alexander Köplinger <alex.koeplinger@outlook.com>
Co-authored-by: Larry Ewing <lewing@microsoft.com>
4 years agoAdvSimd support for System.Text.Unicode.Utf16Utility.GetPointerToFirstInvalidChar...
Carlos Sanchez Lopez [Thu, 16 Jul 2020 22:57:39 +0000 (15:57 -0700)]
AdvSimd support for System.Text.Unicode.Utf16Utility.GetPointerToFirstInvalidChar (#39050)

* AdvSimd support for System.Text.Unicode.Utf16Utility.GetPointerToFirstInvalidChar

* Move using directive outside #if.
Improve Arm64MoveMask.

* Change overloads

* UIn64 in Arm64MoveMask

* Build error implicit conversion fix

* Rename method and use simpler version

* Use ShiftRightArithmetic instead of CompareEqual + And.

* Remove unnecessary comment

* Add missing shims causing Linux build to fail

4 years agoMove libraries test build to product build (#39402)
Santiago Fernandez Madero [Thu, 16 Jul 2020 22:02:32 +0000 (15:02 -0700)]
Move libraries test build to product build (#39402)

* Move libraries test build to product build

* Publish artifacts needed by coreclr tests

* Don't build corelib anymore since it is a P2P from libraries now

4 years agoAdd tests for runtimepack type RuntimeLibraries. (#37397)
Sean Hall [Thu, 16 Jul 2020 22:01:55 +0000 (08:01 +1000)]
Add tests for runtimepack type RuntimeLibraries. (#37397)

Add documentation to contructor in RuntimeLibrary.

4 years agoThrow when Rfc2898DeriveBytes extract limit has been exceeded
Kevin Jones [Thu, 16 Jul 2020 21:08:53 +0000 (17:08 -0400)]
Throw when Rfc2898DeriveBytes extract limit has been exceeded

4 years agoFix inadvertently case sensitive Boyer-Moore (#39420)
Dan Moseley [Thu, 16 Jul 2020 20:58:01 +0000 (13:58 -0700)]
Fix inadvertently case sensitive Boyer-Moore (#39420)

* Unit test

* Fix

* Typo

* CR feedback

4 years agoWASM: enable System.Runtime.Tests (#39344)
Santiago Fernandez Madero [Thu, 16 Jul 2020 20:46:03 +0000 (13:46 -0700)]
WASM: enable System.Runtime.Tests (#39344)

* WASM: fix System.Runtime.Tests

* Enable System.Runtime.Tests

* Disable test and don't strip link attributes on all product assemblies

* PR feedback

4 years agoUpdate API doc on AddSimpleConsole (#39426)
Sourabh Shirhatti [Thu, 16 Jul 2020 19:37:56 +0000 (12:37 -0700)]
Update API doc on AddSimpleConsole (#39426)

4 years agoMake "services.ConfigureOptions" register validations (#38513)
Loïc Sharma [Thu, 16 Jul 2020 18:56:40 +0000 (11:56 -0700)]
Make "services.ConfigureOptions" register validations (#38513)

* Add validation to ConfigureOptions

* Improve comments

4 years agoFix issue with Trimming tests on Windows (#39307)
Jose Perez Rodriguez [Thu, 16 Jul 2020 18:52:59 +0000 (11:52 -0700)]
Fix issue with Trimming tests on Windows (#39307)

* Fix issue with Trimming tests on Windows

* Update the IsSymbolFile metadata calculation

4 years agoAdd tests to ensure the right exception is thrown for an invalid token after metadata...
David Cantu [Thu, 16 Jul 2020 18:39:46 +0000 (11:39 -0700)]
Add tests to ensure the right exception is thrown for an invalid token after metadata properties (#39254)

4 years agoAdd logic for non-generic Stack/Queue to share add-method delegates (#39151)
Layomi Akinrinade [Thu, 16 Jul 2020 18:15:01 +0000 (11:15 -0700)]
Add logic for non-generic Stack/Queue to share add-method delegates (#39151)

4 years agoForce bindingRedirect for System.Resources.Extensions (#39386)
Eric StJohn [Thu, 16 Jul 2020 17:48:45 +0000 (10:48 -0700)]
Force bindingRedirect for System.Resources.Extensions (#39386)

System.Resources.Extensions writes a type-reference into the .resources
file it writes but RAR will never see this when considering conflicts
for bindingRedirects.

Force a bindingRedirect whenever this package is used.

4 years agoEnable logging for CI runs (#39381)
Bill Wert [Thu, 16 Jul 2020 17:33:46 +0000 (10:33 -0700)]
Enable logging for CI runs (#39381)

* Enable logging for CI runs

* mistaken variable name

* realized I was fixing the wrong thing. This should just set logging params for CI jobs.

* fix indent

* mistakenly moved variable groups to the wrong block.

* remove newline

* remove newline

4 years agoMmap R2R images at and non-page-boundary (#38951)
Vladimir Sadov [Thu, 16 Jul 2020 17:32:45 +0000 (10:32 -0700)]
Mmap R2R images at and non-page-boundary (#38951)

* Mmap R2R images at and non-page-boundary

Assemblies embedded within a single-file are aligned at 16 byte boundaries.

However, currently MappedImageLayout assumes that assemblies are mapped at 4K offsets.
This results in map failure and subsequent failure to load the image in a mapped layout.
Subsequently, the image was loaded as IL as a fallback.

The change fixes this problem by:

mmap() pages containing sections/headers using appropriate ROUND_DOWN and ROUND_UP operations
Load sections at unaligned offsets in MAPMapPEFile.

Fixes: #38061

* Relaxing map alignment check to 16 bytes

* do not round up header size

* asserts

* reject sections where data and VA hint have different page alignment

* PR feedback

* revert init of loadedHeaderBase and add a comment

Co-authored-by: Swaroop Sridhar <swaroop.sridhar@microsoft.com>
4 years agoRemaining cleanup work on Microsoft.Extensions.Logging.Console (#39407)
Maryam Ariyan [Thu, 16 Jul 2020 17:30:41 +0000 (10:30 -0700)]
Remaining cleanup work on Microsoft.Extensions.Logging.Console (#39407)

* Remove and sort usings

* Remove AnsiSystemConsole

* Remove and sort usings on tests

* flip ifdefs

* Add missing xml docs

* PR feedback

4 years agoBump Intellisense nupkg version to Prev7 (#39383)
Carlos Sanchez Lopez [Thu, 16 Jul 2020 17:28:49 +0000 (10:28 -0700)]
Bump Intellisense nupkg version to Prev7 (#39383)