platform/upstream/dotnet/runtime.git
4 years agoChanged triggered by the StringBuilder analyzer (#34574)
Prashanth Govindarajan [Mon, 6 Apr 2020 15:22:34 +0000 (08:22 -0700)]
Changed triggered by the StringBuilder analyzer (#34574)

4 years agoRemove entry point helper scripts (#33756)
Viktor Hofer [Mon, 6 Apr 2020 13:38:04 +0000 (15:38 +0200)]
Remove entry point helper scripts (#33756)

* Remove entry point helper scripts

The entry point helper scripts were useful during the consolidation of
the repositories. This work is mostly done and the build.cmd/sh script
should be used, going forward.

4 years agoEnable restore for ref and src projects in libs (#33553)
Viktor Hofer [Mon, 6 Apr 2020 09:54:10 +0000 (11:54 +0200)]
Enable restore for ref and src projects in libs (#33553)

- Use RestoreUseStaticGraphEvaluation which improves no-op restore by 10-15x down to 10-20 seconds.
- .builds msbuild files renamed to .proj as RestoreUseStaticGraphEvaluation throws for non .proj files without an env var set.
- Introducing subsets for libraries and mono and replacing -buildtests switch which was only working for libraries in favor of the subset switch -subset tests which works consistently.
- Fixing the Microsoft.DotNet.CodeAnalysis analyzer which wasn't running and adding missing exclusions.
- Separating restore and build phases in different parts in the repo (ie for installer.tasks) as generated props and targets need to be imported which requires a reevaluation in the build phase.
- Fix eng/docker/build-docker-sdk.ps1 by using the official build entrypoints (cc @alnikola)
- Remove a few depprojs in favor of project restore (faster restore :))
- Fix root code coverage measurement not working correctly
- Traversal support instead of dir.traversal.targets or manual build target defines.
- Introduce a root Build.proj entrypoint which is responsible for building and restoring the repository. This is necessary to enable the new NuGet fast restore which works best and fastest with a single entrypoint.
- Avoid binclashes in libraries and between libraries and installer (netstandard.depproj vs netstandard.csproj)
- Upgrading the SDK to 5.0 latest
- Code cleanup

4 years agoFix incorrect assumption around the presence of ICF frames in EH codebase for 64...
Fadi Hanna [Mon, 6 Apr 2020 03:04:38 +0000 (20:04 -0700)]
Fix incorrect assumption around the presence of ICF frames in EH codebase for 64-bit targets (#34526)

4 years agoSupport ECParameters that contain only D on Windows and Linux
Kevin Jones [Sun, 5 Apr 2020 19:11:43 +0000 (15:11 -0400)]
Support ECParameters that contain only D on Windows and Linux

If D (private key) is supplied but not the public key (Q), permit
this and allow the platform to re-calculate the public key from
the private key.

* Windows uses CNG blobs with the Q.X and Q.Y values set to (0,0).
* LInux uses the ECC math module to recompute Q from D and G.
* macOS is TBD.

4 years ago[llvm] Enable optimizations for LLVM 9 JIT. (#34555)
monojenkins [Sun, 5 Apr 2020 19:09:04 +0000 (15:09 -0400)]
[llvm] Enable optimizations for LLVM 9 JIT. (#34555)

Share more code between LLVM 6 and LLVM 9.

Mangler::getNameWithPrefix takes a Twine, not a std::string, so use a
StringRef to avoid an unnecessary allocation.

InstructionCombiningPass grew a dependency on
ProfileSummaryInfoWrapperPass in
https://github.com/dotnet/llvm-project/commit/09e539fcaebb6362795d352cdcf4a818cf4d0d6a,
which depends on the enclosing FunctionPassManager having a valid
reference to a module. This commit adds a dummy module to satisfy this,
instead of recreating a new FunctionPassManager on every compilation.
(See also
http://lists.llvm.org/pipermail/llvm-dev/2019-March/130690.html.)

Co-authored-by: imhameed <imhameed@users.noreply.github.com>
4 years agoFix memory leak in SuperPMI (#34523)
Bruce Forstall [Sun, 5 Apr 2020 17:10:46 +0000 (10:10 -0700)]
Fix memory leak in SuperPMI (#34523)

Introduced by change to Heap APIs. Also fixes a long-existing
memory leak on Linux.

Introduce a small, simple class to keep track of memory allocations
associated with the CompileResult that we need to free. In the replay
case, SuperPMI allocates these (such as for the JIT calling allocMem).
In the case of collection, the VM allocates memory for allocMem (and related),
so that memory doesn't need to be tracked.

4 years ago[WIP] LLVM changes (#33847)
monojenkins [Sun, 5 Apr 2020 14:20:58 +0000 (10:20 -0400)]
[WIP] LLVM changes (#33847)

<!--
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 agoRemove a few string allocations from System.IO.FileSystem (#34551)
Stephen Toub [Sun, 5 Apr 2020 11:41:49 +0000 (07:41 -0400)]
Remove a few string allocations from System.IO.FileSystem (#34551)

4 years agoFix host linker options to have -Bsymbolic (#34534)
Elinor Fung [Sun, 5 Apr 2020 08:34:03 +0000 (01:34 -0700)]
Fix host linker options to have -Bsymbolic (#34534)

* Fix host linker options to have -Bsymbolic

* Remove -Bsymbolic-functions

4 years agoAdds scripting guide doc (#34539)
Marcus Turewicz [Sun, 5 Apr 2020 03:13:17 +0000 (13:13 +1000)]
Adds scripting guide doc (#34539)

Scripting guide for Shell, PowerShell and CMD files for styling or other guidance.

Fixes #9317

4 years ago[debugger] Bump protocol for multi threaded single step implementation (#34531)
monojenkins [Sat, 4 Apr 2020 23:57:56 +0000 (19:57 -0400)]
[debugger] Bump protocol for  multi threaded single step implementation (#34531)

As suggested by @jbevain we should bump the protocol to implement multi threaded single step.

Co-authored-by: thaystg <thaystg@users.noreply.github.com>
4 years agoAdd test for max depth in exception message (#34528)
Thomas Levesque [Sat, 4 Apr 2020 21:50:31 +0000 (23:50 +0200)]
Add test for max depth in exception message (#34528)

Co-authored-by: Thomas Levesque <thomaslevesque@users.noreply.github.com>
4 years agoDisable test DnsGetHostEntry_LocalHost_ReturnsFqdnAndLoopbackIPs (#34527)
Karel Zikmund [Sat, 4 Apr 2020 21:17:51 +0000 (14:17 -0700)]
Disable test DnsGetHostEntry_LocalHost_ReturnsFqdnAndLoopbackIPs (#34527)

4 years agoMemory leak during marshal failure. (#34533)
Aaron Robinson [Sat, 4 Apr 2020 16:48:45 +0000 (09:48 -0700)]
Memory leak during marshal failure. (#34533)

Minor code cleanup to make the logic clearer.

4 years agoUpdate formatting (#34538)
Borislav Ivanov [Sat, 4 Apr 2020 16:28:45 +0000 (19:28 +0300)]
Update formatting (#34538)

4 years agoAdded links to issues in issues.targets. (#34530)
Nathan Ricci [Sat, 4 Apr 2020 16:28:03 +0000 (12:28 -0400)]
Added links to issues in issues.targets. (#34530)

4 years agoDefine dirent d_type for Solaris based OS (#34263)
Adeel Mujahid [Sat, 4 Apr 2020 16:27:01 +0000 (19:27 +0300)]
Define dirent d_type for Solaris based OS (#34263)

4 years agoFixup more package dependencies for Microsoft.Windows.Compatibility (#34479)
Matt Mitchell [Sat, 4 Apr 2020 14:19:06 +0000 (07:19 -0700)]
Fixup more package dependencies for Microsoft.Windows.Compatibility (#34479)

A few more dependencies on removed packages. System.Reflection.Emit*

4 years ago[wasm] Wasm TimeZoneInfo implementation VFS (#34186)
monojenkins [Sat, 4 Apr 2020 11:37:03 +0000 (07:37 -0400)]
[wasm] Wasm TimeZoneInfo implementation VFS (#34186)

Right now WebAssembly does not have an implementation for TimeZoneInfo and instead throws exceptions.

This is an alternate implementation of https://github.com/mono/mono/pull/17617 that loads the zone information into the webassembly virtual file system using a pre-loaded file package.

__BCL Changes__
TimeZoneInfo implementation for WebAssembly to read from WASM VFS `/zoneinfo`.
- Remove `TimeZoneInfo.WebAssembly.cs` file
- Remove source dependencies on `TimeZoneInfo.WebAssembly.cs`.
- Modify TimeZoneInfo for specific WASM functionality
   - Default root directory is `zoneinfo`
   -  Add icall `mono_timezone_get_local_name` for WASM in CreateLocal
- Add icall implementation
   - ves_icall_System_TimeZoneInfo_mono_timezone_get_local_name

__WASM Runtime Build__

- Add `-s FORCE_FILESYSTEM=1` to mono wasm runtime build
   - Required so that it includes support for loading pre preload packages
   * Message when generating the zoneinfo data.
   > Remember to build the main file with  -s FORCE_FILESYSTEM=1  so that it includes support for loading this file package
- Add targets to run time zone tests.
   - make run-tzd-sample
   - make run-tzd-interp-sample
   - make run-tzd-aot-sample
- Modify `runtime-tests.js` to load and parse the zoneinfo data manually to load into the VFS.

__WASM Driver - aka `driver.c`__

- Add implementations of the following:
   - mono_timezone_get_local_name

These will be called from the managed bcl module `TimeZoneInfo.cs` module.

__packager.exe__
- Add `-s FORCE_FILESYSTEM=1`
   - Required so that it includes support for loading pre preload packages
   * Message when generating the zoneinfo data.
   > Remember to build the main file with  -s FORCE_FILESYSTEM=1  so that it includes support for

__Zone Info data and support files__

- Three files for zoneinfo VFS support.
   - `mono-webassembly-zoneinfo-fs-smd.js.metadata` - This is the separate metadata output by emscripten file-packager.  Used to parse the zoneinfo data in non browser environments.  See `runtime-tests.js`
   - `mono-webassembly-zoneinfo-fs.js` - Output by emscripten file-packager that will be referenced by browser environments to load the zoneinfo data into the VFS at `/zoneinfo`
   - `zoneinfo.data` - The binary file output by emscripten file-packager.  The file contains the actual zoneinfo data loaded into the VFS and parsed by `TimeZoneInfo`.

The packages are generated automatically and the repo is temporarily at:  https://github.com/kjpou1/mono-webassembly-zoneinfo

There are some limitations to this method where the file packages generated by the emscripten [file_packager](https://emscripten.org/docs/porting/files/packaging_files.html#packaging-using-the-file-packager-tool) only runs within a web browser.

Special consideration is needed to load the VFS with the data outside of browser.  See modification for `runtime-tests.js` where the zoneinfo data is parsed manually and loaded into the VFS.  We may need to create our own file packager to handle some of the other cases.

Co-authored-by: kjpou1 <kjpou1@users.noreply.github.com>
4 years agoFix testhost publish condition and omptimize assets we publish in official builds...
Santiago Fernandez Madero [Sat, 4 Apr 2020 10:04:36 +0000 (03:04 -0700)]
Fix testhost publish condition and omptimize assets we publish in official builds (#34469)

* Fix testhost publish condition and omptimize assets we publish in official builds

* Publish ref/ folder in official builds as it is needed for the installer build

* Just validate all assets paths when IncludeOOB* is true

4 years ago[wasm][debugger] Improve array visualization (#34482)
monojenkins [Sat, 4 Apr 2020 08:08:12 +0000 (04:08 -0400)]
[wasm][debugger] Improve array visualization (#34482)

TODO: viz for multidim arrays

Co-authored-by: radical <radical@users.noreply.github.com>
4 years agoUpdate Dotnet host for testing and other runtime => runtime dependencies (#34516)
Eric Erhardt [Sat, 4 Apr 2020 02:26:04 +0000 (21:26 -0500)]
Update Dotnet host for testing and other runtime => runtime dependencies (#34516)

4 years agoMove DependencyModel to libraries (#34296)
Eric Erhardt [Sat, 4 Apr 2020 01:47:17 +0000 (20:47 -0500)]
Move DependencyModel to libraries (#34296)

* Move DependencyModel to libraries

Moving DependencyModel to the same folder and infrastructure as the rest of our libraries, and out of the installer folder.

I also dropped support for anything below netstandard2.0 at this time.

Contributes to #3470
Fix #3425

* Exclude DependencyModel in shims and package checks since it has a duplicated type with System.Collections.

* Harvest previous TFM assets from the previously shipped package.

This also means we start building DependencyModel for net461 to ensure full framework support works correctly, and doesn't pick up the old net451 asset.

* Fix unit tests to consistently pass on core and netfx.

* Add back HashCodeCombiner as obsolete.

* Fix DependencyModel pkg build to reference the correct version of Newtonsoft.Json for the harvested package assets.

* Adding IgnoredTypes for Serialization.Primitives in netcoreapp1.0 and netcoreapp1.1

Co-authored-by: Jose Perez Rodriguez <joperezr@microsoft.com>
4 years agoBitOperations arm64 intrinsic for LeadingZeroCount, TrailingZeroCount and Log2 (...
Kunal Pathak [Sat, 4 Apr 2020 00:26:57 +0000 (17:26 -0700)]
BitOperations arm64 intrinsic for LeadingZeroCount, TrailingZeroCount and Log2 (#34486)

ARM64 intrinsic for:
- LeadingZeroCount
- Log2
- TrailingZeroCount

4 years agoFix building WinRT tests on new Windows SDK (with new cppwinrt). (#34513)
Jeremy Koritzinsky [Sat, 4 Apr 2020 00:24:12 +0000 (17:24 -0700)]
Fix building WinRT tests on new Windows SDK (with new cppwinrt). (#34513)

4 years agoMoving more Tfm specific properties to the targetFramework.props file (#34349)
Anirudh Agnihotry [Fri, 3 Apr 2020 23:09:55 +0000 (16:09 -0700)]
Moving more Tfm specific properties to the targetFramework.props file (#34349)

* follow up

* other occurences

* fixing compiler services failure

4 years agoHardware instruction set support for crossgen2 (#33274)
David Wrighton [Fri, 3 Apr 2020 23:02:12 +0000 (16:02 -0700)]
Hardware instruction set support for crossgen2 (#33274)

- Add support for the --instruction-set parameter as described in #226 .
NOTE: As the abi for Vector parameters is not yet stable, support for the --instruction-set parameter is only enabled if --inputbubble is also enabled. Parallel work to stabilize the abi is in progress, but is not complete.
ALSO NOTE: The names of the instruction sets are shared with mono, and don't follow the names in issue #226
- Add concept of baseline instruction set support to R2R file format
- Can be applied at a per method level or at the entire R2R file level
  - R2RDump support for dumping the extra data
- Refactor how support for hardware intrinsics beyond SSE2 support are handled in crossgen2
- Add feature to the JIT to detect which hardware features are actually used
  - Tell the JIT unconditionally that SSE42+Lzcnt+Popcnt+Pclmulqdq are supported
  - But if support beyond the --instruction-set specified baseline is used, notate the method with a per-method instruction set support fixup.
  - This enables usage of many intrinsics in corelib with greater efficiency than today
  - This enables usage of SSE42 and below intrinsics safely in non-CoreLib code. Use of higher level intrinsics in non CoreLib code will generate code which does not use the higher level intrinsic, and note that the method's code should not be used in the presence of hardware which does support greater CPU capabilities.
  - In the future a logical enhancement of this work would be to generate multiple bodies of code to handle these more complex cases.
  - In combination with the --instruction-set argument, if Avx2 is enabled, then the logic gracefully adds a dependency on Avx2 capability and Vector<T> becomes useable by crossgen'd code.

4 years agoAdd profiler tests to the runtime repo (#34411)
David Mason [Fri, 3 Apr 2020 22:10:18 +0000 (15:10 -0700)]
Add profiler tests to the runtime repo (#34411)

Ports GCBasic, ReJIT, and EventPipe tests as well as adds a test that verifies profilers can call MetaDataGetDispenser.

4 years agoEnable nullable reference types for mono's Corelib (#34400)
Stephen Toub [Fri, 3 Apr 2020 21:18:30 +0000 (17:18 -0400)]
Enable nullable reference types for mono's Corelib (#34400)

* Enable nullable reference types for mono's Corelib

Corelib had nullable reference types enabled, but all warnings were suppressed.  This fixes the thousands of warnings that were being hidden and fully enables nullable reference types for mono's corelib, as it is for coreclr's corelib.

I copied over the public API annotations from coreclr's corelib and tried to annotate the mono source as accurately as possible.  However, I'm 100% sure there are issues, both places I misexpressed the contract of an internal API and places where I suppresed warnings with `!` where it likely could actually null ref.  Along the way, when there was an obvious null ref where coreclr was doing a null check and providing different behavior, I fixed it or at least added a comment, but I expect there are more issues lurking.

* Fix iOS build for GetSpecialFolder

* Address PR feedback

4 years agoSocket.Windows: support ConnectAsync(SocketAsyncEventArgs) for UDP, and Unix sockets...
Tom Deseyn [Fri, 3 Apr 2020 18:42:52 +0000 (20:42 +0200)]
Socket.Windows: support ConnectAsync(SocketAsyncEventArgs) for UDP, and Unix sockets (#33674)

Socket.Windows: support ConnectAsync(SocketAsyncEventArgs) for non-stream protocols

4 years ago[CBOR] Add a CborReader.SkipValue() method (#34477)
Eirik Tsarpalis [Fri, 3 Apr 2020 18:28:19 +0000 (19:28 +0100)]
[CBOR] Add a CborReader.SkipValue() method (#34477)

* Add a CborReader.SkipValue() method

* revert reader state format error changes

* refactor skip from recursive to imperative

* use non-allocating skips for string data items

* add a test for extremely nested values

* remove blank line

* consolidate SkipString() methods

4 years agoDisable iOS_arm builds on official builds too (#34504)
Alexander Köplinger [Fri, 3 Apr 2020 18:24:35 +0000 (20:24 +0200)]
Disable iOS_arm builds on official builds too (#34504)

It started failing with the same issue as https://github.com/dotnet/runtime/issues/34465

4 years agoCrossgen2 fixes to enable composite build with shared framework (#34431)
Tomáš Rylek [Fri, 3 Apr 2020 17:48:08 +0000 (19:48 +0200)]
Crossgen2 fixes to enable composite build with shared framework (#34431)

These changes involve targeted fixes to issues seen due to the new
build mode and generic signature encoding fixes identified in
my offline investigation with JanV. While I locally see the tests
passing with just a handful of failures, I still seem unable to
make the tests run in the lab; I keep investigating that but
I believe it's useful to merge this delta in to let us parallelize
follow-up efforts.

Thanks

Tomas

4 years agoParallel Builds PRv2 (#34460)
Manish Godse [Fri, 3 Apr 2020 17:37:09 +0000 (10:37 -0700)]
Parallel Builds PRv2 (#34460)

* simplify libraries build dependencies.

* FIx depends for tests

* Fix artifact name for webAssembly

4 years agoAdd armel arch in help message (#34491)
Gleb Balykov [Fri, 3 Apr 2020 16:22:56 +0000 (19:22 +0300)]
Add armel arch in help message (#34491)

4 years agoDelete stale CPU cache size detection (#34488)
Jan Kotas [Fri, 3 Apr 2020 16:21:48 +0000 (09:21 -0700)]
Delete stale CPU cache size detection (#34488)

Fixes #34478

4 years agoPort CoreCLR's TypeNameBuilder to C#, and use it in Mono too (#33701)
Alexis Christoforides [Fri, 3 Apr 2020 14:28:23 +0000 (10:28 -0400)]
Port CoreCLR's TypeNameBuilder to C#, and use it in Mono too (#33701)

* Port CoreCLR's TypeNameBuilder to C#, and use it in Mono too

Mono's System.Reflection.Emit creates type names that fail to be normalized or shaped in all ways that CoreCLR does.

Port CoreCLR's mixed-mode thread-unsafe implementation to thread-safe C#, and start using it in Mono for names in TypeBuilder.

Fixes issues with e.g. null-delimited type names being passed to different Reflection.Emit builders. Contributes to https://github.com/dotnet/runtime/issues/2389.

4 years agoFix WriteLargeJsonToStreamWithoutFlushing test (#34489)
Layomi Akinrinade [Fri, 3 Apr 2020 13:27:27 +0000 (09:27 -0400)]
Fix WriteLargeJsonToStreamWithoutFlushing test (#34489)

4 years agoDon't build `System.Utf8String.Experimental.Tests.csproj` tests for mono (#34445)
Egor Bogatov [Fri, 3 Apr 2020 13:24:55 +0000 (16:24 +0300)]
Don't build `System.Utf8String.Experimental.Tests.csproj` tests for mono (#34445)

4 years agoFix subsetCategory is just one `-` not two `--` (#34498)
nietras [Fri, 3 Apr 2020 13:20:10 +0000 (15:20 +0200)]
Fix subsetCategory is just one `-` not two `--` (#34498)

Otherwise fails with:
```
MSBUILD : error MSB1001: Unknown switch.
Switch: --subsetCategory
```
on Windows

4 years ago[sgen] Implement api for allocating pinned arrays (#34398)
Vlad Brezae [Fri, 3 Apr 2020 12:49:06 +0000 (15:49 +0300)]
[sgen] Implement api for allocating pinned arrays (#34398)

* [sgen] Add support for allocating pinned array

These objects will end up allocated either in LOS (which is by design not moved around) or into special major blocks where compaction doesn't take place.

* [sgen] Be consistent with coreclr on GC api

* Enable GC tests for pinned array allocation

* Skip large array allocation test on mono

4 years ago[mono][sre] Add an expected attribute on underlying fields of enum classes (#34212)
Alexis Christoforides [Fri, 3 Apr 2020 12:48:12 +0000 (08:48 -0400)]
[mono][sre] Add an expected attribute on underlying fields of enum classes (#34212)

Follow CoreCLR's example and add the RTSpecialName type attribute to any class field with the 'value__' name when , used as the value store for enumeration class instances.

Second part of the "RTSpecialName fix" that started with https://github.com/dotnet/runtime/pull/33389 - before, our behavior was to add the RTSpecialName immediately, as soon as the EnumBuilder was constructed.
Contributes to https://github.com/dotnet/runtime/issues/2389

4 years agoFix two issues detected by Valgrind (#34462)
Jan Vorlicek [Fri, 3 Apr 2020 11:39:35 +0000 (13:39 +0200)]
Fix two issues detected by Valgrind (#34462)

* Fix two issues detected by Valgrind

When I have used Valgrind to investigate a memory corruption issue recently,
I've noticed that it has also reported two cases when a conditional jump
was using an uninitialized variable as one of the inputs to the condition.

This change fixes these.

4 years agoDisable iOS arm PR builds (#34467)
Alexander Köplinger [Fri, 3 Apr 2020 06:04:07 +0000 (08:04 +0200)]
Disable iOS arm PR builds (#34467)

* Disable iOS arm PR builds

Infrastructure issue: https://github.com/dotnet/runtime/issues/34465

* Add tracking issue and disable installer iOS arm build too

4 years agoRemove -runtime version suffix hack for M.E. (#34464)
Maryam Ariyan [Fri, 3 Apr 2020 01:51:21 +0000 (18:51 -0700)]
Remove -runtime version suffix hack for M.E. (#34464)

4 years agoArm64: Add xtn and xtn2 intrinsics codegen, api and tests. (#33108)
Tamar Christina [Fri, 3 Apr 2020 01:19:15 +0000 (02:19 +0100)]
Arm64: Add xtn and xtn2 intrinsics codegen, api and tests. (#33108)

4 years agoRemove @jeremykuhne from area owners (#34483)
Dan Moseley [Fri, 3 Apr 2020 01:11:08 +0000 (18:11 -0700)]
Remove @jeremykuhne from area owners (#34483)

cc @ericstj

4 years agoEnable warn as error for libraries (#34457)
Jared Parsons [Thu, 2 Apr 2020 22:59:51 +0000 (15:59 -0700)]
Enable warn as error for libraries (#34457)

This enables warn as error for the libraries jobs now that our builds
are warning free.

4 years agoSync changes from ASP.NET Core dynamic HPack (#34247)
James Newton-King [Thu, 2 Apr 2020 20:21:24 +0000 (09:21 +1300)]
Sync changes from ASP.NET Core dynamic HPack (#34247)

4 years agoExperimental pgo tool (#34433)
David Wrighton [Thu, 2 Apr 2020 18:35:24 +0000 (11:35 -0700)]
Experimental pgo tool (#34433)

* Experimental pgo tool
- Experiment and rough design going forward for providing profile data to the compiler

* Update build so dotnet-pgo is built

4 years agoAdd build configuration to generate runtime packs for iOS (#34050)
Steve Pfister [Thu, 2 Apr 2020 17:42:08 +0000 (13:42 -0400)]
Add build configuration to generate runtime packs for iOS (#34050)

This adds support for generating Microsoft.NETCore.App.Runtime packs for ios-x64, ios-arm, and ios-arm64.

4 years ago[meta] Add mono_type_get_name_full to public API (#34436)
Ryan Lucia [Thu, 2 Apr 2020 16:45:42 +0000 (12:45 -0400)]
[meta] Add mono_type_get_name_full to public API (#34436)

This is needed by Xamarin.Android to be able to round-trip with names fetched via reflection, as the only public API for this (mono_type_get_name) uses the IL format instead.

4 years agofix iOS sample build (#34455)
Egor Bogatov [Thu, 2 Apr 2020 16:32:31 +0000 (19:32 +0300)]
fix iOS sample build (#34455)

4 years ago[loader] Add append option to loader hook installation functions (#34284)
Ryan Lucia [Thu, 2 Apr 2020 16:19:22 +0000 (12:19 -0400)]
[loader] Add append option to loader hook installation functions (#34284)

4 years ago[wasm][debugger] Add support for visualizing valuetypes (#33604)
monojenkins [Thu, 2 Apr 2020 15:36:54 +0000 (11:36 -0400)]
[wasm][debugger] Add support for visualizing valuetypes (#33604)

Co-authored-by: radical <radical@users.noreply.github.com>
4 years agoMerge pull request #34166 from mangod9/master
Manish Godse [Thu, 2 Apr 2020 14:25:28 +0000 (07:25 -0700)]
Merge pull request #34166 from mangod9/master

Add support for building S.P.CoreLib in a separate job

4 years agoUpdate WASM image (#34421)
Jared Parsons [Thu, 2 Apr 2020 13:44:05 +0000 (06:44 -0700)]
Update WASM image (#34421)

Move to an Ubuntu image which has the `en_US.UTF-8` locale available.
This should remove the spurious warning that we're seeing during
PR / CI

closes #34280

4 years agoFix large version bubble field offset computation (#34401)
Jan Vorlicek [Thu, 2 Apr 2020 13:11:13 +0000 (15:11 +0200)]
Fix large version bubble field offset computation (#34401)

This change fixes two bugs in field offset computation where the results
that crossgen2 was getting was different from what runtime computes. In
both cases, the problem was caused by alignment of a derived class being
done differently.
The first issue was happening for the case when the base and derived
classes are in different assemblies. Runtime detect if two assemblies
are in the same version bubble using the native manifest metadata table
containing a list of assemblies that was supposed to contain all
assemblies that the assembly being compiled was found to reference.
However, it contained only assemblies that were not in the original
assembly reference list, e.g. ones pulled in by inlining. So runtime
wasn't getting the same view on what's in the bubble.
The second issue happened for the case when both the base and derived
class were from the same assembly, but one of the ancestor classes had a
field of a value class type that was from another assembly and could be
transitively decomposed to fields of types from the same assembly or types
like primitive types, object, pointer or enums. The alignment of a derived
class members is determined based on that and runtime decision is to
align if there is any type from another assembly in the type hierarchy
of a class or in fields of any ancestors.
For example, the decision would be different for the following scenario:
Assembly A:
struct AA
{
    int a;
}
Assembly B:
class B1
{
    AA aa;
}
class B2 : B1
{
    int x;
}
Here crossgen2 would not align the first member but runtime would. So the
layout of B2 produced by crossgen2 would be:
```
Offset  Field
0       MethodTable
8       a
12      x
```
Layout produced by the runtime would be
```
Offset  Field
0       MethodTable
8       a
16      x
```

The fix for the first issue is to put all referenced assemblies into the
native manifest metadata.
The fix for the second issue is to stop decomposing members of value
classes once we hit a value class that's from another module.

4 years agoR2RDump fixes for parsing composite images (#34429)
Tomáš Rylek [Thu, 2 Apr 2020 12:52:48 +0000 (14:52 +0200)]
R2RDump fixes for parsing composite images (#34429)

1. Fixed several inconsistencies w.r.t. signature context in
recursive descent into generic signatures based on offline
investigation with JanV.

2. Don't crash the dump upon invalid UTF8 characters.

Thanks

Tomas

4 years agoFix ordering of the instructions (#34447)
Andrey Kurdyumov [Thu, 2 Apr 2020 11:55:41 +0000 (17:55 +0600)]
Fix ordering of the instructions (#34447)

Command for opening Visual Studio works from root folder,
but not inside library folder as was implied by ordering in the instructions.

4 years agoEnhance PAL initialization order (#34308)
Jan Vorlicek [Thu, 2 Apr 2020 10:37:58 +0000 (12:37 +0200)]
Enhance PAL initialization order (#34308)

* Enhance PAL initialization order

The CGroups initialization has _ASSERTE that is not asserting because
debugging support was being initialized after the CGroups initialization.

This change moves the debugging support initialization to the earliest
possible point. It also modifies it so that it doesn't depend on the
PAL env functions and uses getenv instead. And finally, initialization
of the critical section for debug printf is moved to the very end
of DBG_init_channels just as a little cleanup.

4 years agoFix crossgen2 delegates to static generic methods (#34370)
Jan Vorlicek [Thu, 2 Apr 2020 10:19:59 +0000 (12:19 +0200)]
Fix crossgen2 delegates to static generic methods (#34370)

In crossgen2 we convert all methods to their canon versions in
CreateMethodEntrypointNodeHelper, which causes a problem for
delegates set to generic static methods. When these methods are called
via a delegate, at runtime it gets a hidden generic argument that
is a MethodDesc of a canon version of the static method instead of the
specific instantiation.

I've investigated why we convert all methods to their canon versions in
the CreateMethodEntrypointNodeHelper and I've found a PR by @trylek
in CoreRT repo that has introduced it. I've discussed that with him, but
he wasn't able to figure out why the change was made and it seems like
it was mostly accidental or fixing some problem that no longer exists.

Removing this conversion fixes the problem and I have verified that it
doesn't introduce new ones by running both pri 1 CoreCLR tests and the
libraries tests. It has also made the diff between code generated by
crossgen1 and crossgen2 e.g. for System.Private.CoreLib.dll smaller.

4 years agoInitial Mono Android CI (#34125)
Jo Shields [Thu, 2 Apr 2020 08:29:42 +0000 (04:29 -0400)]
Initial Mono Android CI (#34125)

4 years agoremoved some unused corelib configs.
Manish Godse [Thu, 2 Apr 2020 06:36:10 +0000 (23:36 -0700)]
removed some unused corelib configs.

4 years agoMove StrongNameKeyId=Open default value down after arcade is imported (#34428)
Santiago Fernandez Madero [Thu, 2 Apr 2020 05:37:52 +0000 (22:37 -0700)]
Move StrongNameKeyId=Open default value down after arcade is imported (#34428)

4 years agoAdd test for native library load through AssemblyLoadContext.LoadUnmanagedDll (#34425)
Elinor Fung [Thu, 2 Apr 2020 03:00:11 +0000 (20:00 -0700)]
Add test for native library load through AssemblyLoadContext.LoadUnmanagedDll (#34425)

* Reorganize the NativeLibrary tests to be in one root folder and build/use the same native library for testing

* Add test for AssemblyLoadContext.LoadUnmanagedDll

4 years agoDelete Ubuntu 14.04 conditions (#34361)
Jan Kotas [Thu, 2 Apr 2020 02:38:22 +0000 (19:38 -0700)]
Delete Ubuntu 14.04 conditions (#34361)

Ubuntu 14.04 is no longer supported.

4 years agoEliminate dead configuration code (#34285)
Andrew Au [Thu, 2 Apr 2020 02:27:21 +0000 (19:27 -0700)]
Eliminate dead configuration code (#34285)

* Eliminate dead configuration code

* Remove more dead code

* Eliminating EEConfig::GetConfiguration_DontUse_

* Eliminate EEConfig::GetConfigValueCallback

* Eliminate ConfigSearch

4 years agoFix run-test-job pretest build
Manish Godse [Thu, 2 Apr 2020 01:02:00 +0000 (18:02 -0700)]
Fix run-test-job pretest build

4 years agoFix write behind allocated memory in thread name setting (#34424)
Jan Vorlicek [Thu, 2 Apr 2020 00:57:02 +0000 (02:57 +0200)]
Fix write behind allocated memory in thread name setting (#34424)

The code in CorUnix::InternalSetThreadDescription is writing behind
the end of the allocated memory in case the name is shorter than 16
characters. That is causing memory heap corruption.

4 years agotypo fix :(
Manish Godse [Wed, 1 Apr 2020 23:05:05 +0000 (16:05 -0700)]
typo fix :(

4 years agoPR Comments
Manish Godse [Wed, 1 Apr 2020 22:58:14 +0000 (15:58 -0700)]
PR Comments

4 years agoBuild managed part of crossgen2 as platform independent (AnyCPU) (#33041)
Gleb Balykov [Wed, 1 Apr 2020 21:33:32 +0000 (00:33 +0300)]
Build managed part of crossgen2 as platform independent (AnyCPU) (#33041)

4 years agoReport correct max depth in exception message (#34410)
Thomas Levesque [Wed, 1 Apr 2020 20:49:39 +0000 (22:49 +0200)]
Report correct max depth in exception message (#34410)

Co-authored-by: Thomas Levesque <thomaslevesque@users.noreply.github.com>
4 years agoupdate perf jitdump for ppc64/ppc64le and s390x (#34373)
monojenkins [Wed, 1 Apr 2020 20:09:37 +0000 (16:09 -0400)]
update perf jitdump for ppc64/ppc64le and s390x (#34373)

Add missing constants to handle ppc64/ppc64le and s390x platforms.

Related: https://github.com/mono/mono/commit/68a8b9290958ee5e9b21d8ff6b73a707e2504d39
Fixes: https://github.com/mono/mono/issues/19402

Co-authored-by: sharkcz <sharkcz@users.noreply.github.com>
4 years agoPerf followup for Pinned Object Heap (#34215)
Vladimir Sadov [Wed, 1 Apr 2020 20:08:53 +0000 (13:08 -0700)]
Perf followup for Pinned Object Heap (#34215)

* free list bucket skipping

* couple more tweaks

* More size buckets in POH free lists

* static_data_table

* PR feedback

* off-by-one error in BASE_LOH_ALIST_BITS

4 years agoEnsure generic parameter constraint type is included when building image (#34346)
monojenkins [Wed, 1 Apr 2020 20:01:28 +0000 (16:01 -0400)]
Ensure generic parameter constraint type is included when building image (#34346)

sets.

This fixes: https://issuetracker.unity3d.com/issues/editor-crash-when-entering-and-exiting-playmode-for-a-few-times-with-microsoft-maps-sdk

@joncham and I were working on this we hit the two asserts that I've removed. We were wondering if they were still needed?

<!--
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: UnityAlex <UnityAlex@users.noreply.github.com>
4 years ago[wasm] Throw an exception when trying to start a thread instead of asserting. (#34347)
monojenkins [Wed, 1 Apr 2020 19:13:10 +0000 (15:13 -0400)]
[wasm] Throw an exception when trying to start a thread instead of asserting. (#34347)

<!--
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 ago[mono] Fix finalizer thread init in iOS sample (#34405)
Alexis Christoforides [Wed, 1 Apr 2020 19:05:19 +0000 (15:05 -0400)]
[mono] Fix finalizer thread init in iOS sample (#34405)

Starting with https://github.com/mono/mono/pull/16907 , the runtime ends in GC-Safe state (mode) after mono_jit_init_version() is called. mono_gc_init_finalizer_thread() expects the GC to not already be in safe mode.

4 years agoUpdate ownership of area-System.ServiceModel (#34408)
Stephen Bonikowsky [Wed, 1 Apr 2020 17:14:43 +0000 (10:14 -0700)]
Update ownership of area-System.ServiceModel (#34408)

Stephen Bonikowsky is no longer on the WCF team, updating ownership.

4 years agoRevert "Revert "Switch reverse PInvoke to the NativeCallable plan (#34251)" (#34306...
Jan Kotas [Wed, 1 Apr 2020 16:28:04 +0000 (09:28 -0700)]
Revert "Revert "Switch reverse PInvoke to the NativeCallable plan (#34251)" (#34306)" (#34315)

This reverts commit 94c4b5248bbf7f3219ca4af7960832d9acf218da.

4 years agoDisable test on windows and enable on other platforms (#34331)
Jan Jahoda [Wed, 1 Apr 2020 15:11:59 +0000 (17:11 +0200)]
Disable test on windows and enable on other platforms (#34331)

* Disable test on windows and enable on other platforms

* Remove mac from test

4 years agoCall into ETW methods in ConcurrentBag only when logging is enabled (#34392)
Marek Safar [Wed, 1 Apr 2020 15:08:58 +0000 (17:08 +0200)]
Call into ETW methods in ConcurrentBag only when logging is enabled (#34392)

4 years agoMerge remote-tracking branch 'upstream/master'
Manish Godse [Wed, 1 Apr 2020 14:53:00 +0000 (07:53 -0700)]
Merge remote-tracking branch 'upstream/master'

4 years ago[mono] Fix setMArch, getArchName() doesn't work as expected (#34368)
Egor Bogatov [Wed, 1 Apr 2020 12:23:24 +0000 (15:23 +0300)]
[mono] Fix setMArch, getArchName() doesn't work as expected (#34368)

Turns out `llvm::Triple(llvm::sys::getDefaultTargetTriple()).getArchName()` doesn't work as expected on all targets so the only option is to set arch via defines.

NOTE: it accepts "x86-64", not "x86_64

4 years agoRemove duplicated .gitignore patterns (#34281)
pi1024e [Wed, 1 Apr 2020 09:46:37 +0000 (05:46 -0400)]
Remove duplicated .gitignore patterns (#34281)

4 years agoFix build break in coreclr where -os is not supported in Windows (#34358)
Santiago Fernandez Madero [Wed, 1 Apr 2020 08:33:17 +0000 (01:33 -0700)]
Fix build break in coreclr where -os is not supported in Windows (#34358)

4 years ago[mono] fix SIMD instructions' availability (#34319)
Egor Bogatov [Wed, 1 Apr 2020 08:26:02 +0000 (11:26 +0300)]
[mono] fix SIMD instructions' availability (#34319)

4 years ago[mono] Fix LLVM JIT build on arm64 host (#34332)
Egor Bogatov [Wed, 1 Apr 2020 08:25:08 +0000 (11:25 +0300)]
[mono] Fix LLVM JIT build on arm64 host (#34332)

4 years ago[mono] Set MArch in llvm-jit (#34350)
Egor Bogatov [Wed, 1 Apr 2020 08:24:30 +0000 (11:24 +0300)]
[mono] Set MArch in llvm-jit (#34350)

4 years agoDisable Bitmap round-tripping tests for old libgdiplus versions (#34354)
Jan Kotas [Wed, 1 Apr 2020 06:37:57 +0000 (23:37 -0700)]
Disable Bitmap round-tripping tests for old libgdiplus versions (#34354)

* Fix filename typo

* Disable Bitmap round-tripping tests for old libgdiplus versions

Old libgdiplus versions have uninitialized stack variable bug that makes Bitmap round-tripping unreliable. The bug causes Bitmap.Flags, Bitmap.HorizontalResolution and Bitmap.VerticalResolution properties to be set to bogus values if the stack happens to contain certain bit patterns. This bug was fixed for libgdiplus 6 by https://github.com/mono/libgdiplus/commit/81e45a1d5a3ac3cf035bcc3fabb2859818b6cc04#diff-c96a8261ecb168c12b44248208da21c0R118.

* Fix and simplify gdiplus library loading

4 years agoFix System.Data.SqlClient baseline (#34352)
Matt Mitchell [Wed, 1 Apr 2020 05:57:40 +0000 (22:57 -0700)]
Fix System.Data.SqlClient baseline (#34352)

* Fix System.Data.SqlClient version

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

* Update Microsoft.Windows.Compatibility.pkgproj

4 years agoDisable test based on 34178 (#34179)
Jarret Shook [Wed, 1 Apr 2020 01:55:42 +0000 (18:55 -0700)]
Disable test based on 34178 (#34179)

* Disable test based on 34178

* Try with */*

* Fix diff

4 years agoremove upload unsigned artifacts step from official build
Manish Godse [Tue, 31 Mar 2020 23:07:12 +0000 (16:07 -0700)]
remove upload unsigned artifacts step from official build

4 years agoFixing intellisense in vscode for src and ref projects (#34025)
Anirudh Agnihotry [Tue, 31 Mar 2020 22:30:00 +0000 (15:30 -0700)]
Fixing intellisense in vscode for src and ref projects (#34025)

* fixing intel for ref and src

* fixing ref and src intell

* renaming props file

* remove extra property

* fixing the intellisense in tests

* add extra line

* addressing feedback

* revert shim path

* fix allconfig restore

* adding comment

4 years ago[FileSystem] ReAdd check for same device (#34343)
Mitchell Hwang [Tue, 31 Mar 2020 21:47:34 +0000 (17:47 -0400)]
[FileSystem] ReAdd check for same device (#34343)

Co-authored-by: Mitchell Hwang <mihw@microsoft.com>
4 years agolibraries test should depend on full product
Manish Godse [Tue, 31 Mar 2020 21:20:16 +0000 (14:20 -0700)]
libraries test should depend on full product

This fix is similar to artifact download logic done in build-base.yml

4 years agoFix ProfileTailCallNaked so it doesn't write xmm1 past the end of its stack (#33908)
David Mason [Tue, 31 Mar 2020 20:59:51 +0000 (13:59 -0700)]
Fix ProfileTailCallNaked so it doesn't write xmm1 past the end of its stack (#33908)

* Fix ProfileTailCallNaked so it doesn't write xmm1 past the end of its stack, and do some documentation/refactoring.

* code review feedback

4 years agoadd support for FreeBSD cross-compilation (#34000)
Tomas Weinfurt [Tue, 31 Mar 2020 20:36:32 +0000 (13:36 -0700)]
add support for FreeBSD cross-compilation (#34000)

* add support for FreeBSD cross-compilation

* feedback from review

* update detection

* add openssl to docs

* feedback from reviews

* feedback from reviews

* final cleanup

* feedback from reviews

* simplify detection of route.h

* correct __CrossBuild detection

* use TargetOS for installer