platform/upstream/dotnet/runtime.git
3 years agoUpdate WCF dependencies on the compat pack (#59764)
Santiago Fernandez Madero [Thu, 30 Sep 2021 17:46:24 +0000 (10:46 -0700)]
Update WCF dependencies on the compat pack (#59764)

3 years agoFix retry when downloading clang tools (#59806)
Jakob Botsch Nielsen [Thu, 30 Sep 2021 17:14:24 +0000 (19:14 +0200)]
Fix retry when downloading clang tools (#59806)

Invoke-WebRequest throws an exception when the download fails, so we
should use try-catch instead of status code to check failure. We can use
the generic Retry function from tools.ps1 to do this.

In addition pass -PassThru to avoid leaving a corrupted download file in
case the download fails. This will buffer the download and write it once
at the end.

Fix #57196

3 years agoSeveral improvements to regex source generator (#59660)
Stephen Toub [Thu, 30 Sep 2021 16:54:11 +0000 (12:54 -0400)]
Several improvements to regex source generator (#59660)

* Fix comparison in EmitMultiChar

For strings of length 2 we weren't using the optimized path of reading/comparing a single uint.

* Remove duplicative length checks for some concatenations

When we have a sequence like `abc[def]ghi`, today we'll emit a length check of 3 for the `abc` multi, a length check of 1 for the `[def]` set, and a length check of 3 for the `ghi`, but we can instead emit a single length check for 7.

This also fixes a small bug where I used a > instead of a >= in a length comparison, the net effect of which was using two comparisons instead of getting away with one for a two character string.

And added some debug-only output that helped me diagnosing why things were working the way they were.

* Special-case regexes where Go can be a nop

For an expression like "abc", if FindFirstChar returns true, it's found and fully validated the match.  There's no benefit to comparing it again in Go; instead, Go can simply perform the capture.

* Clean up generated Boyer-Moore code

3 years agoFix NRT warnings in source generated code (#59755)
Eirik Tsarpalis [Thu, 30 Sep 2021 16:51:48 +0000 (17:51 +0100)]
Fix NRT warnings in source generated code (#59755)

* Fix NRT warnings in source generated code

* address feedback

* address style

3 years agoIncrease timeout for ConsoleLifetimeExitTests.EnsureEnvironmentExitDoesntHang (#59811)
Krzysztof Wicher [Thu, 30 Sep 2021 16:49:18 +0000 (18:49 +0200)]
Increase timeout for ConsoleLifetimeExitTests.EnsureEnvironmentExitDoesntHang (#59811)

* Increase timeout for ConsoleLifetimeExitTests.EnsureEnvironmentExitDoesntHang

* missed the comment

3 years agofixes to get Quic working on macOS (#59728)
Tomas Weinfurt [Thu, 30 Sep 2021 16:43:22 +0000 (09:43 -0700)]
fixes to get Quic working on macOS (#59728)

* fixes to get Quic working on macOS

* Apply suggestions from code review

Co-authored-by: Marie Píchová <11718369+ManickaP@users.noreply.github.com>
Co-authored-by: Marie Píchová <11718369+ManickaP@users.noreply.github.com>
3 years agoFix regression in Regex lowercasing in parser (#59434)
Stephen Toub [Thu, 30 Sep 2021 16:36:39 +0000 (12:36 -0400)]
Fix regression in Regex lowercasing in parser (#59434)

For better or worse, Regex matches char by char, without any attention paid to surrogate pairs and the like.  In .NET Core 3.0, a change was made to the regex parser that used ToLower on a whole string rather than calling ToLower on each individual char, but this then leads to inconsistencies with how the matching is performed, making it so that things that used to match no longer do.

3 years agoLeverage `cwde` and `cdqe` for sign extensions on xarch (#56172)
SingleAccretion [Thu, 30 Sep 2021 16:34:37 +0000 (19:34 +0300)]
Leverage `cwde` and `cdqe` for sign extensions on xarch (#56172)

* Add CWDE support to the emitter and codegen

It is a shorter form of a sign extending mov from eax to eax.
Use it in codegen for casts.

* Fix printing for CWDE and CDQ

Their size determines what they do.

* Move the optimization to emit_Mov

This allows us to catch more cases.

3 years ago[wasm][debugger] Fix reusing buffer for debugger (#59773)
Thays Grazia [Thu, 30 Sep 2021 15:46:13 +0000 (12:46 -0300)]
[wasm][debugger] Fix reusing buffer for debugger (#59773)

* Fixing resuing buffer on main

* Adding comment as suggested by @lambdageek

3 years agoBuild one MonoTargetsTasks assembly for Microsoft.NET.Runtime.MonoTargets.Sdk pack...
Aleksey Kliger (λgeek) [Thu, 30 Sep 2021 15:13:26 +0000 (11:13 -0400)]
Build one MonoTargetsTasks assembly for Microsoft.NET.Runtime.MonoTargets.Sdk pack (#59720)

* Build one MonoTargetsTasks assembly for Mono.NET.Runtime.MonoTargets.Sdk pack

   Instead of 3 assemblies for some tiny tasks.

   Building a single assembly also ensures that everything in the pack depends on and bundles identical versions of dependent assemblies.  For example on net472, a single version of System.Text.Json with a single fixed version shared by both the JsonToItemsTaskFactory task factory and the RuntimeConfigParser task.

   Related to https://github.com/dotnet/runtime/issues/59619

* Update testing and wasm to use MonoTargetsTasks.dll

* Move assembly stripper to a separate assembly

   Build it with nullability checking disabled.

   Build the main MonoTargetsTasks assembly with nullability enabled

* Don't include msbuild assemblies in MonoTargets package

* re-enable analyzers for the MonoTargetsTasks assembly

* Include *.dll in the MonoTargetsTasks nupkg

   In particular, pick up all the dependent assemblies for the net472 build

* Update various READMEs

* remove unneeded target

* Switch ILStrip to use the same Parallel.ForEach logic as MonoAOTCompiler

* Remove unneeded NoWarn warnings

* rearrange package references in MonoTargetsTask.csproj for readabilty

* More ItemGroup reformatting

* fix nits

* Use SystemThreadingTasksExtensionsVersion instead of hardcoding

Co-authored-by: Ankit Jain <radical@gmail.com>
3 years agoRemove ILStrip temporarily to retain ActiveIssue attributes in release mobile device...
Mitchell Hwang [Thu, 30 Sep 2021 14:30:00 +0000 (10:30 -0400)]
Remove ILStrip temporarily to retain ActiveIssue attributes in release mobile device configuration (#59762)

* Remove ILStrip temporarily to retain ActiveIssue attributes in release mobile device configuration

* Add Android Active Issue

Co-authored-by: Mitchell Hwang <mitchell.hwang@microsoft.com>
3 years agoCI matrix update: add Ubuntu 21.04 (#59578)
Jan Jahoda [Thu, 30 Sep 2021 14:05:11 +0000 (16:05 +0200)]
CI matrix update: add Ubuntu 21.04 (#59578)

3 years agoCI matrix: add openSUSE 15.2 (#59574)
Jan Jahoda [Thu, 30 Sep 2021 14:04:29 +0000 (16:04 +0200)]
CI matrix: add openSUSE 15.2 (#59574)

3 years agoCI matrix change: add Windows.Server.Core.20H2 (#59572)
Jan Jahoda [Thu, 30 Sep 2021 13:59:39 +0000 (15:59 +0200)]
CI matrix change: add Windows.Server.Core.20H2 (#59572)

* Add Windows.Server.Core.20H2 to CI matrix

* add windows server 20H2

* Remove 20H2 from PR

* Remove 20H2 from PR run

3 years agoFix assert for chain of ASG nodes after tail-calls (#59708)
Egor Bogatov [Thu, 30 Sep 2021 13:47:54 +0000 (16:47 +0300)]
Fix assert for chain of ASG nodes after tail-calls (#59708)

3 years agoFix debugger-tests that were broken after https://github.com/dotnet/runtime/pull...
Thays Grazia [Thu, 30 Sep 2021 13:13:56 +0000 (10:13 -0300)]
Fix debugger-tests that were broken after https://github.com/dotnet/runtime/pull/59153 (#59795)

3 years agoUpdate how-to-debug-dump template (#59798)
Adeel Mujahid [Thu, 30 Sep 2021 13:13:07 +0000 (16:13 +0300)]
Update how-to-debug-dump template (#59798)

* Update how-to-debug-dump template

* Address CR feedback

* Update windows instructions

* Use backslashes on Windows

3 years agoRev Alpine WithNode from 3.9 to 3.13 (#57324)
Adeel Mujahid [Thu, 30 Sep 2021 09:36:23 +0000 (12:36 +0300)]
Rev Alpine WithNode from 3.9 to 3.13 (#57324)

* Rev Alpine WithNode from 3.9 to 3.13
Also,
* update helix queues from 3.12 to 3.13
* add 3.14 helix queues
* update performance job to install cargo from main branch

* Add Alpine 3.13 in rolling CI

* Add missing closing paren

3 years ago[interp] Fix unboxing during delegate invoke (#59749)
Vlad Brezae [Thu, 30 Sep 2021 09:19:48 +0000 (12:19 +0300)]
[interp] Fix unboxing during delegate invoke (#59749)

We need to unbox only if the called method is defined on a valuetype

3 years agoCI matrix change: debian+centos+sles (#58988)
Jan Jahoda [Thu, 30 Sep 2021 07:53:52 +0000 (09:53 +0200)]
CI matrix change: debian+centos+sles (#58988)

* CI matrix change: debian+centos+sles

* Adjust the CI matrix based on latest comments

3 years agoFix hfa field count to handle more cases under LLVM. (#59751)
Johan Lorensson [Thu, 30 Sep 2021 07:20:06 +0000 (09:20 +0200)]
Fix hfa field count to handle more cases under LLVM. (#59751)

Current way of calculating fields for hfa types was not correct,
incorrectly describe some hfa types in LLVM.

One scenario where it breaks is when using explicit struct layout
having several fields starting at the same offset. Our current
implementation would count each field meaning that the struct
of floats or doubles described to LLVM would not match the size
of allocated object, since it would count fields starting
on the same offset twice, causing issue in p/invokes on platforms
where the platform ABI push value types on to callers stack.

An example:

StructLayout(LayoutKind.Explicit)]
public struct Vector2
{
  private unsafe struct F2
  {
    public fixed float data[2];
  }

  [FieldOffset(0)]
  private F2 V;

  [FieldOffset(0)]
  public float V1;

  [FieldOffset(4)]
  public float V2;
}

The old implementation would describe the above struct like this to LLVM:

type { float, float, float }

incorrectly adding an additional float, creating a 12 byte struct instead
of 8 bytes.

Any construction using

private fixed float x[12];

would also incorrectly be calcualted as one field instead of 12.

The way mini_type_is_hfa works is that it will make sure the type is
only made up of floats or doubles and not a combination of them or any
other type. Instead of using the field count calculated through this
schema (that sees all field types, but inaccurately count them in some
scenarios), we could use types value size (since its all floats or
all doubles) and then get number of fields based on type size
(float or double). Implementation of mono_class_value_size will correctly
handle size in cases where we have explicit layout as above and shared
with how none LLVM AOT:ed code views the same type.

3 years ago[main] Update dependencies from dotnet/linker (#59257)
dotnet-maestro[bot] [Thu, 30 Sep 2021 06:48:46 +0000 (08:48 +0200)]
[main] Update dependencies from dotnet/linker (#59257)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: vitek-karas <vitek.karas@microsoft.com>
3 years ago[wasm] Build improvements based on feedback (#59391)
Ankit Jain [Thu, 30 Sep 2021 04:53:21 +0000 (04:53 +0000)]
[wasm] Build improvements based on feedback (#59391)

- Fix for a incremental build issue
- Change native build defaults for `Debug` config, to make it faster (thanks @SteveSandersonMS, @mattleibow)

- MonoAOTCompiler:
  - Skip unmanaged assemblies, and emit a warning
- PInvokeTableGenerator:
  - Fix to not fail in presence of native variadic functions, and pinvokes with function pointers (eg. used by sqlite)

Co-authored-by: Larry Ewing <lewing@microsoft.com>
3 years agoFix an occasional small perf issue in `ThreadLocal` constructor/dispose (#59300)
Koundinya Veluri [Thu, 30 Sep 2021 04:36:10 +0000 (21:36 -0700)]
Fix an occasional small perf issue in `ThreadLocal` constructor/dispose (#59300)

- Replaced the linear search for a free ID with a pair of collections that operate in O(1) time for insertion and removal
- See https://github.com/dotnet/runtime/issues/59145#issuecomment-922162343 for more information
- Fixes https://github.com/dotnet/runtime/issues/59145

3 years agoAdd new analyzers to CodeAnalysis.globalconfig files (#59763)
Stephen Toub [Thu, 30 Sep 2021 02:08:35 +0000 (22:08 -0400)]
Add new analyzers to CodeAnalysis.globalconfig files (#59763)

3 years agoFix issue with incorrect handling of optimized method layouts (#59781)
David Wrighton [Thu, 30 Sep 2021 00:58:12 +0000 (17:58 -0700)]
Fix issue with incorrect handling of optimized method layouts (#59781)

- The sort order of the RuntimeFunctions table (among others) was not properly handled when an optimized method layout was applied
  - While this bug applied to non-composite builds, it was easily reproduced with a composite build
- Fix lack of test infrastructure around non-standard method layouts.
  - Add new random method sorting order
  - Use new random sorting order in crossgen2 test passes

Fixes #59089

3 years agoPartially disable test (#59760)
Dan Moseley [Thu, 30 Sep 2021 00:30:59 +0000 (18:30 -0600)]
Partially disable test (#59760)

3 years agoFix for GitHub issue #59432 and the corresponding regression test (#59663)
Tomáš Rylek [Thu, 30 Sep 2021 00:15:19 +0000 (02:15 +0200)]
Fix for GitHub issue #59432 and the corresponding regression test (#59663)

Turns out there was a subtle bug in the interface slot map population
that got triggered by a suitable combination of non-virtual and
virtual interface methods.

Thanks

Tomas

3 years agoAvoid resetting gen0 bricks for background_sweep (#59106)
Andrew Au [Wed, 29 Sep 2021 23:44:28 +0000 (16:44 -0700)]
Avoid resetting gen0 bricks for background_sweep (#59106)

3 years agoDo not enregister Return SP check (#59759)
Kunal Pathak [Wed, 29 Sep 2021 23:41:53 +0000 (16:41 -0700)]
Do not enregister Return SP check (#59759)

3 years agoRetry installer Process.Start if ETXTBSY (#59765)
Andy Gocke [Wed, 29 Sep 2021 23:22:37 +0000 (16:22 -0700)]
Retry installer Process.Start if ETXTBSY (#59765)

Caused by #58964

Fixes #53587

3 years agoFix several issues with ELT profiler hooks and tests to cover these cases (#54912)
Egor Chesakov [Wed, 29 Sep 2021 21:35:54 +0000 (14:35 -0700)]
Fix several issues with ELT profiler hooks and tests to cover these cases (#54912)

* Add ELT profiler tests for HFA/HVA arguments/return values on Arm64.

* Fix an issue with `ProfileArgIterator::GetNextArgAddr` and `ProfileArgIterator::GetReturnBufferAddr` not properly handling HFA/HVAs on Arm64.

* Add tests to cover different ways of returning a struct on Linux x64 and macOS x64 (i.e. one register, two registers, stack).

* Fix an issue with `ProfileArgIterator::GetReturnBufferAddr` not properly handling struct returned in registers on Linux x64 and macOS x64.

* Fix an issue with not passing an actual value of `rdx` down to a callback in `ProfileLeaveNaked` and `ProfileTailcallNaked` helpers.

3 years agofix few more QUIC tests that can hang (#59682)
Tomas Weinfurt [Wed, 29 Sep 2021 19:13:49 +0000 (12:13 -0700)]
fix few more QUIC tests that can hang  (#59682)

* fix few more tests that can hang

* update

3 years agoTreat 'abstract' properties the same as 'virtual' for src-gen (#59707)
Steve Harter [Wed, 29 Sep 2021 18:54:07 +0000 (13:54 -0500)]
Treat 'abstract' properties the same as 'virtual' for src-gen (#59707)

3 years agoSrc gen: use GetBestTypeByMetadataName instead of GetTypeByMetadataName (#59092)
Steve Harter [Wed, 29 Sep 2021 18:42:09 +0000 (13:42 -0500)]
Src gen: use GetBestTypeByMetadataName instead of GetTypeByMetadataName (#59092)

3 years agoUse cmakedefine in eglib config (#59623)
Adeel Mujahid [Wed, 29 Sep 2021 18:29:36 +0000 (21:29 +0300)]
Use cmakedefine in eglib config (#59623)

Both `config.h.in` and `eglib-config.h.cmake.in` are now configured via
cmake. However, only `config.h.in` is using `cmakedefine*` and
`eglib-config.h` was having no effect on introspection result.

3 years ago[wasm][debugger] Fix debugger after ts changes (#59702)
Thays Grazia [Wed, 29 Sep 2021 18:01:48 +0000 (15:01 -0300)]
[wasm][debugger] Fix debugger after ts changes (#59702)

* Debugger was broken.

* Reverting usage of local_eval.

* Addressing @lambdageek suggestion.

* Addressing @kg comment.

* Fix spacing before parentheses.

3 years agoAdd initial codespaces support for dotnet/runtime (#59723)
Eric Erhardt [Wed, 29 Sep 2021 16:41:36 +0000 (11:41 -0500)]
Add initial codespaces support for dotnet/runtime (#59723)

* Add initial codespaces support for dotnet/runtime

* Enable codespaces-prebuild

3 years ago[mono] Increase the number of preallocated trampolines for Mono FullAOT runtime test...
imhameed [Wed, 29 Sep 2021 16:41:21 +0000 (12:41 -0400)]
[mono] Increase the number of preallocated trampolines for Mono FullAOT runtime test runs (#59737)

I have no justification for these numbers; they were pulled from
MonoAOTCompiler.props. It might be a good idea to port the "infinite
trampoline" hack to non-Apple platforms.

3 years agoAdd PEM export methods to certificates
Kevin Jones [Wed, 29 Sep 2021 16:11:47 +0000 (12:11 -0400)]
Add PEM export methods to certificates

This allows exporting a certificate directly to a X.509 PEM string
(`-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----`), and cert collections
to either a PKCS#7 SignedData with no signers PEM ("BEGIN PKCS7"), or to a X.509
multi-PEM (including the empty string and a single PEM for the 0 and 1 length collections).

3 years agoAcknowledge community triagers in area-owners.md (#59748)
Eirik Tsarpalis [Wed, 29 Sep 2021 15:17:48 +0000 (16:17 +0100)]
Acknowledge community triagers in area-owners.md (#59748)

* Update area-owners.md

* address feedback

* Update docs/area-owners.md

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Update area-owners.md

Co-authored-by: Stephen Toub <stoub@microsoft.com>
3 years agoArm: Include BBJ_ALWAYS blocks in dominance calculation (#59376)
Kunal Pathak [Wed, 29 Sep 2021 14:49:55 +0000 (07:49 -0700)]
Arm: Include BBJ_ALWAYS blocks in dominance calculation (#59376)

* Include BBJ_ALWAYS in inverse post ordering for computing reachability

* Add test case

* Add BBJ_ALWAYS in fgAlways list

* jit format

3 years agoPrefer readonlyspan properties over readonly array fields (#59670)
Newell Clark [Wed, 29 Sep 2021 13:42:02 +0000 (09:42 -0400)]
Prefer readonlyspan properties over readonly array fields (#59670)

* Fix violations in System.IO.Compression

* Fix System.Private.DataContractSerialization

* Fix System.Net.HttpListener

* Fix System.Text.Encoding.CodePages

* Revert changes to .editorconfig

* Apply suggestions from code review

Co-authored-by: Günther Foidl <gue@korporal.at>
Co-authored-by: Günther Foidl <gue@korporal.at>
3 years agodelay locking in `ConcurrentDictionary.GrowTable` until necessary (#59656)
Ibraheem Ahmed [Wed, 29 Sep 2021 13:38:34 +0000 (09:38 -0400)]
delay locking in `ConcurrentDictionary.GrowTable` until necessary (#59656)

3 years ago[wasm][debugger] Reusing buffer to avoid allocate every debugger message (#59480)
Thays Grazia [Wed, 29 Sep 2021 12:34:19 +0000 (09:34 -0300)]
[wasm][debugger] Reusing buffer to avoid allocate every debugger message (#59480)

* Reusing buffer to avoid allocate every debugger message.

* Fixing what was suggested by @radical.

* cleaning code.

* Changing what was suggested by @radical

* Implementing again after merge

* Fix spacing before parentheses.

* Addressing @pavelsavara comments.

* Fix _debugger_buffer type.

3 years agoRevise descriptions of VS workloads, and add missing ones (#59698)
Jo Shields [Wed, 29 Sep 2021 12:33:23 +0000 (08:33 -0400)]
Revise descriptions of VS workloads, and add missing ones (#59698)

Revise descriptions of VS workloads, and add missing ones

3 years agoUse new cross-build images for arm/arm64 builds (#59534)
Adeel Mujahid [Wed, 29 Sep 2021 08:43:21 +0000 (11:43 +0300)]
Use new cross-build images for arm/arm64 builds (#59534)

3 years agoAppend _FILE_OFFSET_BITS=64 to CMAKE_REQUIRED_DEFINITIONS (#59504)
Adeel Mujahid [Wed, 29 Sep 2021 08:42:35 +0000 (11:42 +0300)]
Append _FILE_OFFSET_BITS=64 to CMAKE_REQUIRED_DEFINITIONS (#59504)

After setting CMAKE_REQUIRED_DEFINITIONS in PAL introspection, we need
to append this definition.

3 years agoIntegrate changes from NativeAOT branch (#59510)
Michal Strehovský [Wed, 29 Sep 2021 06:10:44 +0000 (15:10 +0900)]
Integrate changes from NativeAOT branch (#59510)

* Move TryResolveConstraintMethodApprox to compiler

* Integrate changes from NativeAOT branch

3 years ago[mono][jit] Eliminate some AOTCONST instructions if they are not used. (#59699)
Zoltan Varga [Wed, 29 Sep 2021 04:04:18 +0000 (06:04 +0200)]
[mono][jit] Eliminate some AOTCONST instructions if they are not used. (#59699)

3 years agoAntigen: Change Antigen's helixqueue to public (#59657)
Kunal Pathak [Wed, 29 Sep 2021 02:51:48 +0000 (19:51 -0700)]
Antigen: Change Antigen's helixqueue to public (#59657)

* Use public helix queue

* Remove helix queue setup from python

* Remove unnecessary comments

* TOREVERT: Download specific artifacts

* change creator to dotnet-bot

* set Creator

* run only for windows x64

* Publish antigen build logs

* put in quotes

* use correct script for helix queue

* Set some helix variables:

* Use Helix properties in proj

* Include the display name

* Revert specific build

* Add continueOnError to display warnings

3 years agoDeduplicate epilogs in Type.operator== (#59711)
Jan Kotas [Wed, 29 Sep 2021 00:35:07 +0000 (17:35 -0700)]
Deduplicate epilogs in Type.operator== (#59711)

3 years agoOnly run source-index on main branch. (#59725)
Alex Perovich [Wed, 29 Sep 2021 00:28:52 +0000 (17:28 -0700)]
Only run source-index on main branch. (#59725)

3 years agoUniversal arm crossgen compiler (#58279)
David Wrighton [Tue, 28 Sep 2021 23:52:10 +0000 (16:52 -0700)]
Universal arm crossgen compiler (#58279)

Stop generating OS specific compilers for the arm and arm64 architectures for use in crossgen2
- As it turns out the OS differences here are relatively minor and fairly easy to handle with runtime switches.
- However, when an exact target is known we can generate better code by having the various if statements evaluate to a constant true/false. (This is done for all runtime jit builds)
- This has been validated to produce binary identical output for generating System.Private.CoreLib.dll on the various architectures.
- This work reduces the distribution size of crossgen2, and also reduces the amount of time it takes to build everything (Most notably, the Mac build times in PR's are reduced by 5-7 minutes, but improvements are visible across all of/architecture pairs)

3 years agoRevert bind single elements to array in configuration binder (#59716)
Santiago Fernandez Madero [Tue, 28 Sep 2021 23:51:31 +0000 (16:51 -0700)]
Revert bind single elements to array in configuration binder (#59716)

3 years agoUpdate HttpConnectionBase.cs (#59722)
Rikki Gibson [Tue, 28 Sep 2021 23:43:25 +0000 (16:43 -0700)]
Update HttpConnectionBase.cs (#59722)

3 years agoTurn on XHarness telemetry for mono runtime tests (#59646)
Přemek Vysoký [Tue, 28 Sep 2021 22:21:29 +0000 (00:21 +0200)]
Turn on XHarness telemetry for mono runtime tests (#59646)

3 years agoFix Time Zone when running with Globalization Invariant Mode (#59710)
Tarek Mahmoud Sayed [Tue, 28 Sep 2021 21:42:16 +0000 (14:42 -0700)]
Fix Time Zone when running with Globalization Invariant Mode (#59710)

3 years agoAdd Compiler record to PDB files in Crossgen2 (#59686)
David Wrighton [Tue, 28 Sep 2021 20:51:45 +0000 (13:51 -0700)]
Add Compiler record to PDB files in Crossgen2 (#59686)

3 years agoFix incorrect tracking of sign bit (#59525)
Wei Zheng [Tue, 28 Sep 2021 17:26:33 +0000 (01:26 +0800)]
Fix incorrect tracking of sign bit (#59525)

* Fix incorrect tracking of sign bit

* Perform the 1 check earlier

* Add comment on checking special pattern

* Simplify fix

* Update the test to target 32 bit right shift
as the logic has been restricted to that

* Remove stray newline

3 years agoCheck Options validations length instead of null (#58157)
Christopher Warrington [Tue, 28 Sep 2021 16:22:54 +0000 (09:22 -0700)]
Check Options validations length instead of null (#58157)

The `OptionsFactory` constructors ensure that the member variable
`_validations` is never null. Yet, the `Create` method checks whether
`_validations` is null before running them.

Check that the length of `_validations` is larger than zero instead of
checking for null. This eliminates a `List<>` allocation when there are
no validations.

3 years agoJIT: allow suppressing some dumps or parts of dumps (#59299)
Andy Ayers [Tue, 28 Sep 2021 16:16:42 +0000 (09:16 -0700)]
JIT: allow suppressing some dumps or parts of dumps (#59299)

Another bit of code that I've had lying around that might be generally useful.
* Optionally suppress Tier0 compilation dumps
* Optionally suppress dumps from inline compiler phases

Setting `JitDumpTier0=0` prevents you from getting two dumps when you specify
dumping a method by name or hash, when TC is enabled.

3 years agoDependency Injection SAVE_ASSEMBLIES code clean up (#59684)
Allan Targino [Tue, 28 Sep 2021 15:57:24 +0000 (12:57 -0300)]
Dependency Injection SAVE_ASSEMBLIES code clean up (#59684)

A simple clean up of the SAVE_ASSEMBLIES symbol code in DI.
I am also adding the service type name to the class name because
it helps a lot when manual inspecting MSIL code for large service trees.

3 years agoRemoving unused CallSiteKind items from Dependency Injection (#59687)
Allan Targino [Tue, 28 Sep 2021 15:56:47 +0000 (12:56 -0300)]
Removing unused CallSiteKind items from Dependency Injection (#59687)

Removing Scope, Transient and Singleton from enum CallSiteKind.
Their CallSites were removed by 8e8650f9

3 years agoPrevent cache from being resized (#59607)
Pavel Ivanov [Tue, 28 Sep 2021 15:56:20 +0000 (20:56 +0500)]
Prevent cache from being resized (#59607)

3 years agoFix race condition in ServiceProcess tests (#59676)
Eric StJohn [Tue, 28 Sep 2021 15:43:00 +0000 (08:43 -0700)]
Fix race condition in ServiceProcess tests (#59676)

3 years agoReduce allocations in VersionConverter (#55564)
N0D4N [Tue, 28 Sep 2021 15:29:58 +0000 (18:29 +0300)]
Reduce allocations in VersionConverter (#55564)

* Add more test cases for VersionConverter

* Reduce allocations in VersionConverter.Read method

* Remove allocations from VersionConverter.Write method

* Parse Version from chars, instead of parsing individual components. Assert successful formatting on write.

* Allow escaping, disallow leading and trailing whitespaces

* Hopefully fix tests for .NET Framework, add few more test cases that should fail

* Assume whitespaces can be only on the start, or only at the end, add one more test case that should fail

* Remove redundant return statements

* Elaborate on comment regarding leading and trailing whitespaces. Copy it to .NetStandard2.0 target.

* Add another test case.

3 years agoUpdate MonoVM diagnostics-tracing doc with new features and scenarios. (#58620)
Johan Lorensson [Tue, 28 Sep 2021 15:25:32 +0000 (17:25 +0200)]
Update MonoVM diagnostics-tracing doc with new features and scenarios. (#58620)

3 years agoRemove redundant checks (#59310)
Pavel Ivanov [Tue, 28 Sep 2021 15:16:47 +0000 (20:16 +0500)]
Remove redundant checks (#59310)

* Remove useless if-else branch

* Try to change the absolute expiration only if the relative has value

3 years agoDependency Injection support for ValueTypes as Services (#59625)
Allan Targino [Tue, 28 Sep 2021 15:14:15 +0000 (12:14 -0300)]
Dependency Injection support for ValueTypes as Services (#59625)

* Dependency Injection support for ValueTypes as Services

The only that was thing missing to support ValueTypes as Services
was box the result when visiting constructors call sites.

I am also fixing several tests that were building the ServiceProvider
using the default engine, instead of relying on each specific engine.

fix #42160

* addressing pr feedback regarding tests

3 years agoUsing optimized ILGenerator.Emit function in Dependency Injection (#59680)
Allan Targino [Tue, 28 Sep 2021 15:01:15 +0000 (12:01 -0300)]
Using optimized ILGenerator.Emit function in Dependency Injection (#59680)

We were doing some local optimizations with MSIL’s Stloc and Ldloc,
but the very same ones are already present in an override of the
ILGenerator.Emit function, so we can remove them.

This PR also fixes the use of Ldloca that was generating additional
nop operations.

fix #59624

3 years ago[mono][jit] Eliminate some type comparisons in gshared methods. (#59543)
Zoltan Varga [Tue, 28 Sep 2021 14:08:52 +0000 (16:08 +0200)]
[mono][jit] Eliminate some type comparisons in gshared methods. (#59543)

* [mono][jit] Make MONO_INS_HAS_NO_SIDE_EFFECT () into a function.

* [mono][jit] Eliminate some type comparisons in gshared methods.

Comparisons of the form
```
        internal static void ThrowForUnsupportedIntrinsicsVectorBaseType<T>() where T : struct
        {
            if (typeof(T) != typeof(byte) && typeof(T) != typeof(sbyte) &&
            ...
        }
```
are very common in BCL code. They are compiled to:
```
    IL_0001:  ldtoken    !!T
    IL_0006:  call       [System.Runtime]System.Type [System.Runtime]System.Type::GetTypeFromHandle([System.Runtime]System.RuntimeTypeHandle)
    IL_000b:  ldtoken    [System.Runtime]System.Byte
    IL_0010:  call       [System.Runtime]System.Type [System.Runtime]System.Type::GetTypeFromHandle([System.Runtime]System.RuntimeTypeHandle)
    IL_0015:  call       bool [System.Runtime]System.Type::op_Inequality([System.Runtime]System.Type,
                                                                         [System.Runtime]System.Type)
    IL_001a:  brfalse    IL_015a
```

In gshared code, !!T is usually constrained to be a reference, or to have a primitive base type.
Use this fact to eliminate some of the Type::op_Equality/op_Inequality () calls.

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

3 years agoDisabling Match_ExcessPrefix until the attribute is fixed
Stephen Toub [Tue, 28 Sep 2021 13:28:27 +0000 (09:28 -0400)]
Disabling Match_ExcessPrefix until the attribute is fixed

3 years agoFewer AddressExposedReason::TOO_CONSERVATIVE (#59429)
Sergey Andreenko [Tue, 28 Sep 2021 12:45:36 +0000 (05:45 -0700)]
Fewer AddressExposedReason::TOO_CONSERVATIVE  (#59429)

Delete some too_conservative addrExposed reasons.

3 years agoRemove log message when closing browser while debugging. (#59664)
Thays Grazia [Tue, 28 Sep 2021 00:14:07 +0000 (21:14 -0300)]
Remove log message when closing browser while debugging. (#59664)

3 years agoSkip ExportPkcs7_Empty test on mobile platforms
Steve Pfister [Mon, 27 Sep 2021 23:06:01 +0000 (19:06 -0400)]
Skip ExportPkcs7_Empty test on mobile platforms

* Skip ExportPkcs7_Empty test on mobile platforms

The test made it through and was failing on CI.  PKCS#7 export is not supported on mobile platforms.

* PKCS7_Empty was failing on android b/c 0 length was not allowed.

Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
3 years agoLocalized file check-in by OneLocBuild Task (#59662)
dotnet bot [Mon, 27 Sep 2021 21:28:48 +0000 (14:28 -0700)]
Localized file check-in by OneLocBuild Task (#59662)

3 years agoAdd checking SpeechRecognitionEngine Culture to GrammarBuilder test (#59516)
Alexander Radchenko [Mon, 27 Sep 2021 19:24:18 +0000 (02:24 +0700)]
Add checking SpeechRecognitionEngine Culture to GrammarBuilder test (#59516)

* Add checking SpeechRecognitionEngine Culture to GrammarBuilder test.

* Update GrammarTests.cs

Co-authored-by: Dan Moseley <danmose@microsoft.com>
3 years agoforward-port from `release/6.0-rc2`: MonoAOTCompiler: detect when nothing has changed...
Ankit Jain [Mon, 27 Sep 2021 18:10:07 +0000 (18:10 +0000)]
forward-port from `release/6.0-rc2`: MonoAOTCompiler: detect when nothing has changed, a… (#59597)

…nd skip any precompiling (#58979)

Refactor to allow fast-path

implement fast-path for MonoAOTCompiler when nothing has changed

re-enable some tests that got disabled by mistake

(cherry picked from commit 9fd17b1)

3 years agoChange loop cloning condition blocks flow graph (#59233)
Bruce Forstall [Mon, 27 Sep 2021 17:50:04 +0000 (10:50 -0700)]
Change loop cloning condition blocks flow graph (#59233)

Currently, the loop choice condition blocks are created in a way that creates
a confusing flow graph. Restructure them to be simpler, and lay the path for
future work.

The simpler layout (and, hopefully, code and logic to create them) also
lays the groundwork to potentially put the slow path loop in the loop table,
if desired, as it creates a "standard" loop header layout.

While the flow graph has an extra block or two, there are almost no diffs,
as subsequent phases clean up any extras.

There are a few diffs where the new layout enables some downstream optimization
phases that were stymied by the old layout, but mostly in cases where we leave
around dead code slow cloned blocks (a known issue). Also, there are a couple
trivial CSE changes.

3 years agoAdd superpmi.exe option to break to the debugger on exception. (#59234)
Bruce Forstall [Mon, 27 Sep 2021 17:47:14 +0000 (10:47 -0700)]
Add superpmi.exe option to break to the debugger on exception. (#59234)

If you use `-box` (similar to pre-existing `-boa`, `-boe`), then
an exception with invoke a `DebugBreak`, which will stop in the
debugger when an exception is thrown during replay. This is helpful
when debugging (without needing to configure the debugger to catch
a specific exception).

3 years agoAdd InstallLocation component to host (#59537)
Eric StJohn [Mon, 27 Sep 2021 15:59:51 +0000 (08:59 -0700)]
Add InstallLocation component to host (#59537)

3 years agoWrite SPMI download progress in MB (#59647)
Jakob Botsch Nielsen [Mon, 27 Sep 2021 15:39:34 +0000 (17:39 +0200)]
Write SPMI download progress in MB (#59647)

3 years agoAdd argument check (#59634)
Maxim Lipnin [Mon, 27 Sep 2021 14:55:54 +0000 (17:55 +0300)]
Add argument check (#59634)

3 years agoupdate area-owners to account for pod change (#59635)
Krzysztof Wicher [Mon, 27 Sep 2021 13:41:32 +0000 (15:41 +0200)]
update area-owners to account for pod change (#59635)

3 years ago[mono] Improve Makefile's dotnet.js dependencies (#59603)
Radek Doulik [Mon, 27 Sep 2021 13:33:09 +0000 (15:33 +0200)]
[mono] Improve Makefile's dotnet.js dependencies (#59603)

* [mono] Improve Makefile's dotnet.js dependencies

* Pass _MSBUILD_WASM_BUILD_ARGS properly

* And add $(MSBUILD_ARGS) as well

3 years ago[wasm] windows: Fail the build if provisioning fails (#59560)
Ankit Jain [Mon, 27 Sep 2021 09:47:26 +0000 (09:47 +0000)]
[wasm] windows: Fail the build if provisioning fails (#59560)

3 years ago[draft][wasm] introduce typescript modules (#59392)
Pavel Savara [Mon, 27 Sep 2021 07:45:23 +0000 (09:45 +0200)]
[draft][wasm] introduce typescript modules (#59392)

- refactor wasm javascript as typescript
- use nodeJs from EMSDK
- use rollup.js for packing code as ES6 IFFE for emcc consumption
- incremental build:
Co-authored-by: Radek Doulik <radekdoulik@gmail.com>
- types:
Co-authored-by: Daniel Genkin <genkind@gmail.com>
* linker feedback

3 years agoPipeline to run Exploratory fuzzing tool to catch codegen issues (#59489)
Kunal Pathak [Mon, 27 Sep 2021 04:57:36 +0000 (21:57 -0700)]
Pipeline to run Exploratory fuzzing tool to catch codegen issues (#59489)

* Exploratory tool pipeline

Add pipeline to run exploratory tools and return back the result

* Use public Antigen repo

* Add RunDuration

* Rename some of the files to antigen

* TOREVERT: download specific artifacts

* Trigger nightly and on PRs

* Adjust the duration

* Exit on fail for Antigen

* Rename yml files

* Add Antigen.md

* Temporarily run for 10 minutes

* Remove non-x64 build download and helix workaround

* Add back HelixResultsDestinationDir

* Change to net6.0

* extra ,

* Antigen is still on net5.0

* Default framework net6.0

* Run for 3 hours

* Run full build

* fix space

* Make the schedule weekly Sun@6am

* Reduce duration to 2 hours

3 years agoRemove invalid test exclusions. (#59608)
Eric Erhardt [Mon, 27 Sep 2021 03:15:51 +0000 (22:15 -0500)]
Remove invalid test exclusions. (#59608)

These exclusions are pointing to non-existing files. So they are not doing anything.

3 years agoFreeBSD12 version cleanup and process and thread enhancements (#59339)
Jason Pugsley [Sun, 26 Sep 2021 05:37:11 +0000 (15:37 +1000)]
FreeBSD12 version cleanup and process and thread enhancements (#59339)

* Set FreeBSD 12 as minimum version

This is a small clean-up to remove reliance on FreeBSD versions
prior to 12 and more specifically 12.2 which is the lowest currently
supported version of FreeBSD. 11.4 becomes unsupported as of
October 2021. See https://www.freebsd.org/releases/

* Add functionality for FreeBSD process and threads

Added support for naming native threads, the process disambiguation
key and detecting if the process is running under a debugger.

Changed references to thr_self to pthread_getthreadid_np already
used elsewhere - it returns the same value.

3 years agoJIT: Convert Interlocked intrinsics to NamedIntrinsics (#55170)
Egor Bogatov [Sat, 25 Sep 2021 22:54:28 +0000 (01:54 +0300)]
JIT: Convert Interlocked intrinsics to NamedIntrinsics (#55170)

3 years ago[tests] Fix PlatformDetection.IsMonoInterpreter for mobile (#59587)
Aleksey Kliger (λgeek) [Sat, 25 Sep 2021 13:55:34 +0000 (09:55 -0400)]
[tests] Fix PlatformDetection.IsMonoInterpreter for mobile (#59587)

* [tests] Correctly detect the Mono interpreter

Checking for MONO_ENV_OPTIONS is not reliable for the mobile test runners
because they use the embedding API to enable the interpreter, rather than
setting an environment option.

Instead detect the interpreter by checking the values of the
IsDynamicCodeSupported and IsDynamicCodeCompiled runtime features.

* [tests] Run System.Threading.Tasks.Dataflow.Tests on Apple platforms

* Only check RuntimeFeature on netcoreapp.  Otherwise return false

these tests are not running on mono if they're running on .NET Framework

3 years agoenable client certificate test for QUIC on Linux (#59544)
Tomas Weinfurt [Fri, 24 Sep 2021 23:12:27 +0000 (16:12 -0700)]
enable client certificate test for QUIC on Linux (#59544)

3 years ago[main] [Release/6.0] Throw error if assembly version for ref pack assemblies doesnot...
github-actions[bot] [Fri, 24 Sep 2021 22:52:40 +0000 (15:52 -0700)]
[main] [Release/6.0] Throw error if assembly version for ref pack assemblies  doesnot match assembly version shipped in 6.0.0 (#59583)

* throw errow if assembly version in the ref pack doesnot match last released version

* Fix the condition

* Update eng/Versions.props

Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
Co-authored-by: Anirudh Agnihotry <anagniho@microsoft.com>
Co-authored-by: Anirudh Agnihotry <anirudhagnihotry098@gmail.com>
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
3 years agoDelete unused file (#59585)
Jan Kotas [Fri, 24 Sep 2021 22:02:33 +0000 (15:02 -0700)]
Delete unused file (#59585)

3 years agoSome more cleanups in Assembly/Binder area (#59288)
Vladimir Sadov [Fri, 24 Sep 2021 21:36:13 +0000 (14:36 -0700)]
Some more cleanups in Assembly/Binder area (#59288)

* Reducing BINDER_SPACE::Assembly closer to what it represents

* make GCC happy

* Removed `Binder[AddRef/Release]PEImage`. Can just use `AddRef/Release`

* moved IsValidArchitecture helper to bindercommon

* Removed the notion of PEModule - it does not exist

* some more unused code

* fix for GCC

* associate System lib with DefaultBinder - makes things simpler

* PR feedback

3 years agoAdd a note about rerunning the license/cla check (#59440)
Jeff Handley [Fri, 24 Sep 2021 21:21:21 +0000 (17:21 -0400)]
Add a note about rerunning the license/cla check (#59440)

3 years agoFix behavior ObjectCollection for single item contains (#59547)
Juan Hoyos [Fri, 24 Sep 2021 20:35:09 +0000 (13:35 -0700)]
Fix behavior ObjectCollection for single item contains (#59547)

* Fix behavior ObjectCollection for single item contains
* Address PR feedback

3 years agoFix ArrayPool leak with JsonDocument (#59540)
Steve Harter [Fri, 24 Sep 2021 20:06:33 +0000 (15:06 -0500)]
Fix ArrayPool leak with JsonDocument (#59540)