platform/upstream/dotnet/runtime.git
2 years agoFix wrong property use in resolveContract.targets (#60868)
Viktor Hofer [Tue, 26 Oct 2021 17:18:49 +0000 (19:18 +0200)]
Fix wrong property use in resolveContract.targets (#60868)

Helps with https://github.com/dotnet/runtime/issues/59390

2 years agoAdd inline target (callsite/callee) to inline output messages (#60661)
Bruce Forstall [Tue, 26 Oct 2021 16:38:10 +0000 (09:38 -0700)]
Add inline target (callsite/callee) to inline output messages (#60661)

e.g.,
```
Inlines into 06000005 [via ExtendedDefaultPolicy] MainApp:Main():int
  [1 IL=0005 TR=000008 06000004] [callee: below ALWAYS_INLINE size] MainApp:TestNewInline_A_Inline(int):int
    [2 IL=0003 TR=000032 06000003] [call site: profitable inline] MainApp:TestNewInline_B_Inline(int):int
      [3 IL=0003 TR=000045 06000002] [call site: profitable inline] MainApp:TestNewInline_C_Inline(int):int
        [4 IL=0003 TR=000058 06000001] [callee: below ALWAYS_INLINE size] MainApp:TestNewInline_D_Inline(int):int
          [0 IL=0004 TR=000075 06000095] [FAILED: callee: noinline per IL/cached result] System.Console:WriteLine(int)
        [0 IL=0011 TR=000066 06000095] [FAILED: callee: noinline per IL/cached result] System.Console:WriteLine(int)
      [0 IL=0011 TR=000053 06000095] [FAILED: callee: noinline per IL/cached result] System.Console:WriteLine(int)
    [0 IL=0009 TR=000038 06000095] [FAILED: callee: noinline per IL/cached result] System.Console:WriteLine(int)
  [0 IL=0032 TR=000025 0600009A] [FAILED: call site: within catch region] System.Console:WriteLine(System.String)
  [0 IL=0027 TR=000024 06000454] [FAILED: call site: target not direct] System.Exception:get_Message():System.String:this
```

2 years agoDon't cache commandline in coreclr diagnostics server (#60275)
John Salem [Tue, 26 Oct 2021 16:37:55 +0000 (09:37 -0700)]
Don't cache commandline in coreclr diagnostics server (#60275)

2 years ago[DllImportGenerator] Stop flagging methods with well-known unsupported types for...
Elinor Fung [Tue, 26 Oct 2021 15:16:32 +0000 (08:16 -0700)]
[DllImportGenerator] Stop flagging methods with well-known unsupported types for conversion (#60841)

* Make analyzer stop flagging methods with well-known unsupported types for conversion
* Make fixer put attribute arguments in preferred order

2 years agoUpdate compatibility package and unpin compiler version (#60847)
Santiago Fernandez Madero [Tue, 26 Oct 2021 14:01:29 +0000 (07:01 -0700)]
Update compatibility package and unpin compiler version (#60847)

* Update compatibility package and unpin compiler version

2 years agoProcess: throw ArgumentNullException when ArgumentList contains a null. (#59562)
Tom Deseyn [Tue, 26 Oct 2021 12:42:57 +0000 (14:42 +0200)]
Process: throw ArgumentNullException when ArgumentList contains a null. (#59562)

* Process.Start: validate ArgumentList doesn't contain null.

* Add a custom message.

* PR feedback

2 years agoFix DGML debug tests for Regex NonBacktracking (#60853)
Stephen Toub [Tue, 26 Oct 2021 11:11:44 +0000 (07:11 -0400)]
Fix DGML debug tests for Regex NonBacktracking (#60853)

2 years agoUse preferred region from PAL for JIT reloc hints (#60747)
Jakob Botsch Nielsen [Tue, 26 Oct 2021 09:02:55 +0000 (11:02 +0200)]
Use preferred region from PAL for JIT reloc hints (#60747)

We currently have two schemes that try to ensure jitted code and statics
end up close to each other and close to coreclr. In Windows, we have
USE_UPPER_ADDRESS that lazily will reserve memory for loader heaps that
is close to coreclr. For PAL, we eagerly reserve a large chunk of memory
nearby during start up. However for PAL we were not using this region to
report back to the JIT that addresses in this range can use rip-relative
addressing. Add this support.

I have also cleaned up some of the code around USE_UPPER_ADDRESS: I have
renamed it to USE_LAZY_PREFERRED_RANGE and removed some dead code.

2 years ago[main] Update dependencies from dotnet/runtime dnceng/internal/dotnet-optimization...
dotnet-maestro[bot] [Tue, 26 Oct 2021 08:52:01 +0000 (10:52 +0200)]
[main] Update dependencies from dotnet/runtime dnceng/internal/dotnet-optimization dotnet/arcade dotnet/roslyn-analyzers dotnet/msquic dotnet/xharness (#60767)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
2 years agoUse SDK-selected runtime in IL SDK (#60400)
Adeel Mujahid [Tue, 26 Oct 2021 07:05:43 +0000 (10:05 +0300)]
Use SDK-selected runtime in IL SDK (#60400)

* Use SDK-selected runtime in IL SDK

* Disable ProduceReferenceAssembly in IL SDK

* Reorder to Import before the override

2 years agoUp retry for ETXTBSY (#60741)
Andy Gocke [Tue, 26 Oct 2021 05:00:31 +0000 (22:00 -0700)]
Up retry for ETXTBSY (#60741)

* Up retry for ETXTBSY

Still seeing occasional failure in Alpine
(https://dev.azure.com/dnceng/public/_build/results?buildId=1434759) so
raising the retry time.

* Linearly scale wait time

2 years ago[DllImportGenerator] Skip unit tests that hit exceptions due to roslyn-sdk#590 (...
Elinor Fung [Tue, 26 Oct 2021 03:15:01 +0000 (20:15 -0700)]
[DllImportGenerator] Skip unit tests that hit exceptions due to roslyn-sdk#590 (#60848)

2 years ago[metadata] Break up mono_metadata_parse_type_internal (#60725)
Aleksey Kliger (λgeek) [Tue, 26 Oct 2021 02:39:13 +0000 (22:39 -0400)]
[metadata] Break up mono_metadata_parse_type_internal (#60725)

* [metadata] Break up mono_metadata_parse_type_internal

Separate the type allocation and cleanup logic from the main decoding logic and
from the cached instance lookup.

Also free the allocated memory, if any, in case of decoding errors.

2 years agoImplement System.Array functions used by MD arrays as intrinsics (#60816)
Bruce Forstall [Tue, 26 Oct 2021 01:42:03 +0000 (18:42 -0700)]
Implement System.Array functions used by MD arrays as intrinsics (#60816)

Specifically, implement:
- GetLength
- GetLowerBound
- GetUpperBound

These are implemented as intrinsics for MD arrays only, when given
a constant dimension argument that is less than the array rank (that is,
in range).

Thus, exceptional cases fall back to the IL code which throws an exception
as appropriate.

Example x64 codegen for 2-D `int[,]` array (instead of call or inlined call):

GetLength(1):
```
mov      r9d, dword ptr [rcx+20]
```

GetLowerBound(1):
```
mov      r9d, dword ptr [rcx+28]
```

GetUpperBound(1):
```
mov      r9d, dword ptr [rcx+28]
mov      r10d, dword ptr [rcx+20]
lea      r10d, [r9+r10-1]
```

2 years agoRefactor Regex FindFirstChar (#60822)
Stephen Toub [Tue, 26 Oct 2021 00:49:58 +0000 (20:49 -0400)]
Refactor Regex FindFirstChar (#60822)

* Refactor Regexcompiler/Emitter.FindFirstChar

These have become unwieldy, with multiple large code blocks for finding the first character at which to perform a full match, and we'll be adding more soon.  This simply splits each of those out into their own method.  No functional changes.

* Use switch in RegexInterpreter.FindFirstChar

We don't need to re-evaluate which mechanism to use on every FindFirstChar call... we can do so once in the ctor and then just switch on that in the actual FindFirstChar call.

2 years agoUse SDK's .NETFramework refpack version (#60555)
Viktor Hofer [Mon, 25 Oct 2021 20:49:36 +0000 (22:49 +0200)]
Use SDK's .NETFramework refpack version (#60555)

Use the MicrosoftNETFrameworkReferenceAssembliesLatestPackageVersion property which is exposed by the SDK instead of the one exposed by Arcade to make sure that we are always targeting the latest version.

2 years agoSkip more failing DllImport tests (#60836)
Andy Gocke [Mon, 25 Oct 2021 20:06:50 +0000 (13:06 -0700)]
Skip more failing DllImport tests (#60836)

Follow-up on https://github.com/dotnet/runtime/pull/60773

2 years agoInitial support for partially jitted methods (#60791)
Andy Ayers [Mon, 25 Oct 2021 18:51:36 +0000 (11:51 -0700)]
Initial support for partially jitted methods (#60791)

Introduce a new form of patchpoint for rarely-executed blocks in a method
(typically, blocks with throws). Instead of jitting the code in those blocks,
add code to call a new patchpoint helper (similar to the existing one) which
finds or creates the jitted code for the method beyond this point, and then
transitions control to that code.

Suppressing codegen for exception throws in this way gives similar benefits
to the throw helper transformation, without needing to modify source. This
currently works only in Tier0, but in principle could be extended to handle
optimized code.

2 years agofix the summarize bug (#60834)
Kunal Pathak [Mon, 25 Oct 2021 17:20:19 +0000 (10:20 -0700)]
fix the summarize bug (#60834)

2 years agoDon't trim PNSE assemblies and enable trimming for inbox assets on all .NETCoreApp...
Viktor Hofer [Mon, 25 Oct 2021 17:00:31 +0000 (19:00 +0200)]
Don't trim PNSE assemblies and enable trimming for inbox assets on all .NETCoreApp versions (#58345)

* Don't trim PNSE assemblies

Don't trim platform not supported assemblies, since even in "library" trimming mode, the trimmer might remove some non-public members if they are not called within the assembly. In the case of PNSE assemblies this is most likely always the case.

2 years agoPrint "callsites by likely classes" chart in 'dotnet-pgo dump' command (#59306)
Egor Bogatov [Mon, 25 Oct 2021 15:12:03 +0000 (18:12 +0300)]
Print "callsites by likely classes" chart in 'dotnet-pgo dump' command (#59306)

2 years agoSwap using the provided indexes (#55331)
Paul Biggar [Mon, 25 Oct 2021 15:00:45 +0000 (11:00 -0400)]
Swap using the provided indexes (#55331)

SwapElements is passed two indexes, however, it ignored the second index
and instead used `index + 1`. It just so happened that the caller used
`index + 1` as the second index, but that might not have been the case.

2 years agoAdd HttpClient.PatchAsJsonAsync() apis (#60672)
沈星繁 [Mon, 25 Oct 2021 11:21:25 +0000 (19:21 +0800)]
Add HttpClient.PatchAsJsonAsync() apis (#60672)

* feat: add PatchAsJsonAsync methods

* fix: add new api to ref file

* feat: support net46 and netstandard2.0

* refactor: use preprocesser directives to switch between different PatchAsync implementations

* test: validate http method also when validating request

* refactor: implmente extension methods for netstandard that match netcoreapp implmentations

* Update src/libraries/System.Net.Http.Json/src/System/Net/Http/Json/HttpClientJsonExtensions.Patch.cs

Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
* refactor: split net standard PatchAsync implementation to another file

* docs: add xml docs for public PatchAsJsonAsync APIs

Co-authored-by: Eirik Tsarpalis <eirik.tsarpalis@gmail.com>
2 years ago[mono][interp] Allow interp->jit transitions for generic methods. (#60461)
Zoltan Varga [Mon, 25 Oct 2021 08:56:41 +0000 (10:56 +0200)]
[mono][interp] Allow interp->jit transitions for generic methods. (#60461)

2 years ago[mono][jit] Reorganize the creation of the initlocals bblock. (#60804)
Zoltan Varga [Mon, 25 Oct 2021 08:56:20 +0000 (10:56 +0200)]
[mono][jit] Reorganize the creation of the initlocals bblock. (#60804)

This is needed because the gsharedvt init code was emitted into it,
and that code might contain branches in llvmonly mode, so
emit_rgctx_fetch_inline () could not be enabled for it. This
caused gsharedvt methods to always emit a slow jit icall in
the gsharedvt init code.

2 years agoAdd ObjectDisposedException.Throw for object instance and type (#58684)
Bibletoon [Mon, 25 Oct 2021 06:15:40 +0000 (09:15 +0300)]
Add ObjectDisposedException.Throw for object instance and type (#58684)

2 years agoIntegrate changes in shared files from feature/NativeAOT (#60811)
Jan Kotas [Sun, 24 Oct 2021 22:23:42 +0000 (15:23 -0700)]
Integrate changes in shared files from feature/NativeAOT (#60811)

2 years agoOptimize PersianCalendar.AddMonths calculations (#60778)
ebraminio [Sun, 24 Oct 2021 18:50:57 +0000 (22:20 +0330)]
Optimize PersianCalendar.AddMonths calculations (#60778)

2 years agoMore stack overflow avoidance in regex NonBacktracking (#60786)
Olli Saarikivi [Sun, 24 Oct 2021 16:04:01 +0000 (09:04 -0700)]
More stack overflow avoidance in regex NonBacktracking (#60786)

* Add stackoverflow avoidance to SymbolicRegexNode

Remove unused Restrict methods instead of adding avoidance.

Co-authored-by: Stephen Toub <stoub@microsoft.com>
* Add more stack overflow avoidance in regex

This follows a full audit of the NonBacktracking code.

* Apply suggestions from code review

Co-authored-by: Stephen Toub <stoub@microsoft.com>
2 years agoAdd a COMPlus variable to throw runtime exception on JIT asserts (#60631)
Jakob Botsch Nielsen [Sun, 24 Oct 2021 00:19:42 +0000 (02:19 +0200)]
Add a COMPlus variable to throw runtime exception on JIT asserts (#60631)

Add COMPlus_JitThrowOnAssertionFailure: if nonzero, the runtime will
throw an InvalidProgramException with the assertion message if a JIT
assert is hit during compilation. Previously this would bring down the
process. Use this from the Fuzzlyn pipeline scripts to reduce examples
that hit JIT asserts automatically, since this can now be done much more
efficiently.

2 years agoJIT: some enhancements to redundant branch opts (#60732)
Andy Ayers [Sat, 23 Oct 2021 16:09:24 +0000 (09:09 -0700)]
JIT: some enhancements to redundant branch opts (#60732)

Handle cases where the dominating compare is the reverse of the compare
we're trying to optimize. For example, if `(x > y)` dominates `(y <= x)`
we may be able to optimize the dominated compare.

Addresses aspects of #48115.

2 years agoFix typo (#60797)
Jalitha [Sat, 23 Oct 2021 14:18:59 +0000 (01:18 +1100)]
Fix typo (#60797)

2 years agoUse XHarnessAppBundleToTest to create helix work items when runtime tests run on...
Fan Yang [Sat, 23 Oct 2021 11:18:06 +0000 (07:18 -0400)]
Use XHarnessAppBundleToTest to create helix work items when runtime tests run on iOSSimulator (#58870)

2709 runtime tests were enabled to run with iOSSimulator x64.

Co-authored-by: Přemek Vysoký <premek.vysoky@microsoft.com>
2 years agoFix typo in comment: NoPropogateInherit -> NoPropagateInherit (#60717)
Clément Notin [Sat, 23 Oct 2021 10:44:43 +0000 (12:44 +0200)]
Fix typo in comment: NoPropogateInherit -> NoPropagateInherit (#60717)

2 years agoMaui File location and target runtime updates (#60784)
Parker Bibus [Fri, 22 Oct 2021 22:55:43 +0000 (17:55 -0500)]
Maui File location and target runtime updates (#60784)

* Update the file location and android runtimes. The Maui android architecture targets are being updated to include all android targets.

* Updated the targets and props copy location.

* Add in the correct depends on for the maui build.

* The initial file move did not actually delete the folder being moved, delete it.

2 years agoUse Math.CopySign in CalendricalCalculationsHelper (#60776)
ebraminio [Fri, 22 Oct 2021 22:50:09 +0000 (02:20 +0330)]
Use Math.CopySign in CalendricalCalculationsHelper (#60776)

2 years agoAPI Implementation: Add Indexer to Vectors (#60517)
Robin Lindner [Fri, 22 Oct 2021 21:23:54 +0000 (23:23 +0200)]
API Implementation: Add Indexer to Vectors (#60517)

* Add indexer for Vector2

* Add indexer for Vector3

* Add indexer for Vector4

* Add indexer for Quaternion

* Add indexer for Matrix3x2

* Add indexer for Matrix4x4

* Add indexer for Vector64<T>, Vector128<T> and Vector256<T>

* Implement better codegen

* Replace switch-tree by if-else-construct and add add Debug.Assert call to indexer of Matrix3x2

* More performant indexer implementation for Vector64<T>

* Improve performance of Indexers for Vector64<T>, Vector128<T> and Vector256<T>

* Improve code readability

* Easier index implementation for Vector64<T>, Vector128<T> and Vector256<T>

* Implement slimmer index implementation for Matrix3x2<T> and Matrix4x4<T>

* Implement GetElement/SetElement on various types

* Usage of Vector2 instead of Vector4

* Implement GetElement/SetElement for Vector2 and Vector3

* Remove setters

* Made Count const in Vector2, Vector3 and Vector4

* Implement GetElement/WithElement Extensions for Quaternion, Vector2, Vector3 and Vector4

* Setter implementation for Matrix3x2 and Matrix4x4

* Fix Quaternion

* Clone vectors in WithElement of QuaternionExtensions, Vector2Extensions, Vector3Extensions, Vector4Extensions

* Make QuaternionExtensions, Vector2Extensions, Vector3Extensions and Vector4Extensions internal

* Replace Extension Methods with normal static methods in Quaternion, Vector2, Vector3 and Vector4

* Make WithElement public and SetElementUnsafe internal in Quaternion, Vector2, Vector3 and Vector4

* Add methods and indexers to references

* Fix Matrix3x2 and Matrix4x4

* Update that the setter of Quaternion, Vector2, Vector3 and Vector4 sets `this` to the result of WithElement

* Simplify SetElementUnsafe in Vector2, Vector3 and Vector4

* Simplify SetElementUnsafe in Quaternion

* Add test cases for Matrix3x2, Matrix4x4, Quaternion, Vector2, Vector3 and Vector4

* Add indexer to reference for Vector64<T>, Vector128<T> and Vector256<T>

* Fix solution file

* Make WithElement in Quaternion, Vector2, Vector3 and Vector4 internal

* Fix project file of System.Private.CoreLib.Shared

* Fix indentation in System.Numerics.Vectors reference

* Code improvements

* Fix solution file

* Remove unsafe from reference

* Add Tests for Vector64<T>, Vector128<T> and Vector256<T>

* Create Test project for System.Runtime.Intrinsics and move vector tests from System.Runtime to System.Runtime.Intrinsics

* Fix test cases

* recreate System.Runtime.sln

* Fix System.Runtime.sln and remove old Vector Tests

* Implement usage of ThrowHelper for Matrix3x2 and Matrix4x4

* Replace Assert.All over array by Assert.Equal in Vector128Tests

* Replace Assert.All over array by Assert.Equal in Vector256Tests

* Replace Assert.All over array by Assert.Equal in Vector64Tests

* Fix indexer tests for Vector64<T>

* Fix indexer tests for Vector128<T>

* Fix indexer tests for Vector256<T>

* Fix indexer of Matrix3x2

* Fix indexer of Matrix4x4

2 years agoImprove IndexOfAny(byte,byte,byte) (#40894)
Ben Adams [Fri, 22 Oct 2021 21:17:10 +0000 (22:17 +0100)]
Improve IndexOfAny(byte,byte,byte) (#40894)

Co-authored-by: Jeff Handley <jeff.handley@microsoft.com>
2 years agoDisable tests that are failing with JIT asserts on ARM64 (#60773)
Jeremy Koritzinsky [Fri, 22 Oct 2021 20:33:46 +0000 (13:33 -0700)]
Disable tests that are failing with JIT asserts on ARM64 (#60773)

2 years agoRemove xunit-performance dependency in tests (#60711)
Bruce Forstall [Fri, 22 Oct 2021 18:47:49 +0000 (11:47 -0700)]
Remove xunit-performance dependency in tests (#60711)

* Remove dependence on obsolete xunit-performance

We use BenchmarkDotNet in the dotnet/performance repo for
benchmarking now. These copies of the benchmarks are for
correctness testing, and for ease of debugging.

* Make benchmarks look more like the dotnet/performance versions

2 years ago[wasm][debugger] Fix loading a non wasm page and then returning to a wasm page. ...
Thays Grazia [Fri, 22 Oct 2021 18:25:33 +0000 (15:25 -0300)]
[wasm][debugger] Fix loading a non wasm page and then returning to a wasm page. (#60688)

* Fix loading a non wasm page and then returning to a wasm page.

* Adding non-wasm-page.html

* fixing other method

* addressing @radical comments

* adding last empty line

2 years agoRemove unnecessary initialization of variables in generated code (#60748)
Elinor Fung [Fri, 22 Oct 2021 17:50:58 +0000 (10:50 -0700)]
Remove unnecessary initialization of variables in generated code (#60748)

2 years agoTurn off reloc generation for handles (#60721)
Jakob Botsch Nielsen [Fri, 22 Oct 2021 16:00:00 +0000 (18:00 +0200)]
Turn off reloc generation for handles (#60721)

Due to #60712 we cannot unconditionally generate lea for handles, since
the runtime does not expect us to generate ask for reloc hints for
arbitrary constants. In addition, for many Intel CPUs it looks like
rip-relative lea has greater latency than mov with an 8-byte immediate.

Instead of reverting the change I'm just turning it off here, since the
change also unified a couple of functions to simplify the handling.

Fix #60626
Fix #60627
Fix #60629

2 years agoAdd general multi-dimensional array test (#60749)
Bruce Forstall [Fri, 22 Oct 2021 15:17:12 +0000 (08:17 -0700)]
Add general multi-dimensional array test (#60749)

This is similar to MDArray2, but uses the GetLowerBound/GetUpperBound
APIs, and has a test case that uses non-zero lower bounds.
It's in the benchmarks folder as it can be used as a benchmark
to compare against MDArray2 behavior.

2 years agoSimplify runtime test projects (#60724)
Bruce Forstall [Fri, 22 Oct 2021 15:08:13 +0000 (08:08 -0700)]
Simplify runtime test projects (#60724)

* CLRTestPriority of zero is the default, so don't specify it in test project files

* Remove default CLRTestKind of BuildAndRun from test project files

2 years ago[main] Update dependencies from 8 repositories (#60618)
dotnet-maestro[bot] [Fri, 22 Oct 2021 14:37:38 +0000 (14:37 +0000)]
[main] Update dependencies from 8 repositories (#60618)

[main] Update dependencies from 8 repositories

2 years agoDisable additional llvmfullaot Linux_arm64 CI lane (#60730)
Steve Pfister [Fri, 22 Oct 2021 10:56:25 +0000 (03:56 -0700)]
Disable additional llvmfullaot Linux_arm64 CI lane (#60730)

Missed excluding this configuration in https://github.com/dotnet/runtime/pull/60576

Co-authored-by: Steve Pfister <steve.pfister@microsoft.com>
2 years ago[wasm] Remove exclusions to bad paths (#60744)
Larry Ewing [Fri, 22 Oct 2021 08:12:16 +0000 (03:12 -0500)]
[wasm] Remove exclusions to bad paths (#60744)

2 years agoAdd limited support for backtracking Regex single char loops to simplified code gen...
Stephen Toub [Fri, 22 Oct 2021 04:34:18 +0000 (00:34 -0400)]
Add limited support for backtracking Regex single char loops to simplified code gen (#60385)

* Add limited support for backtracking Regex single char loops to simplified code gen

In .NET 5, we added simpler compiled code gen for regexes that didn't entail backtracking (or that had only very constrained backtracking, such as a top-level alternation).  In our corpus of ~90K regular expressions, that code generator is employed for ~40% of them.  The primary purpose of adding that code generator initially was performance, as it was able to avoid lots of the expense that original code generator had, especially for simple regexes.  However, with the source generator, it's much more valuable to use this code gen as the generated code is human-readable and really helps to understand how the regex is operating, is much more easily debugged, etc.

This change allows the simplified code gen to be used even if there are backtracking single-character loops in the regex, as long as those loops are in a top-level concatenation (or a simple grouping structure like a capture).  This increases the percentage of expressions in our corpus that will use the simplified code gen to ~65%.

Once we have the simplified loop code gen, it's also a lot easier to add in vectorization of searching for the next location to back off to based on a literal that comes immediately after the loop (e.g. "abc.*def").  This adds support into both RegexOptions.Compiled and the source generator to use LastIndexOf in that case.

The change also entailed adding/updating a few recursive functions.  The plan has been to adopt the same model as in System.Linq.Expressions, Roslyn, and elsewhere, where we fork processing to continue on a secondary thread, rather than trying to enforce some max depth or rewrite as iterative, so I've done that as part of this change as well.

* Address PR feedback

* Clean up partial classes in SourceGenRegexAsync test helper

2 years agoFix GCC warnings in test build (#60734)
David Mason [Fri, 22 Oct 2021 01:22:36 +0000 (18:22 -0700)]
Fix GCC warnings in test build (#60734)

* fix warnings

* Trigger GCC leg when src/tests is modified

* Add src/native in default paths

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
2 years agoUpdated tests regarding issue #48119 (#52994)
ayousuf23 [Fri, 22 Oct 2021 00:56:29 +0000 (20:56 -0400)]
Updated tests regarding issue #48119 (#52994)

* added tests for parsing decimal/double/half/single with . at different positions

* adjusted string length for testing . at or after max digit count for single/half

* Fix test cases with decimal separators to work in localized runs

Co-authored-by: Jeff Handley <jeff.handley@microsoft.com>
2 years agoDisable a couple of pen tests on Windows (#60746)
Santiago Fernandez Madero [Thu, 21 Oct 2021 23:30:52 +0000 (16:30 -0700)]
Disable a couple of pen tests on Windows (#60746)

2 years ago[llvmonly] Optimize delegate invocation. (#60593)
Zoltan Varga [Thu, 21 Oct 2021 23:07:16 +0000 (01:07 +0200)]
[llvmonly] Optimize delegate invocation. (#60593)

* [llvmonly] Optimize delegate invocation.

* Unify the initialization of delegates in llvmonly mode in mini_llvmonly_init_delegate ().
* Pass a MonoDelegateTrampInfo structure to init_delegate (), use it to
  cache various data.
* Invoke delegates similarly to the non-llvmonly case, by making an indirect
  call through del->invoke_impl, which is initialized in init_delegate ().
  This also fixes some special cases like bound delegates, since init_delegate ()
  has access to the delegate instance, so it can use the appropriate wrapper.

* Compute a cached MonoDelegateTrampInfo for delegates created from the interpreter as well.

* Fix interp execution of delegate invokes, the invoke wrapper depends on the delegate instance, so it needs to be created in interp_entry () not in transform_method ().

2 years agoAdd direct SDK installer links (#53061)
Daniel Cazzulino [Thu, 21 Oct 2021 22:45:20 +0000 (19:45 -0300)]
Add direct SDK installer links (#53061)

These are most of the time more useful than just the runtime ones.

I could not find the equivalent `.sha512` links for the checksums for the SDK installers, though :(

2 years agoFix intermittent failure in DllImportGenerator unit tests when resolving assemblies...
Elinor Fung [Thu, 21 Oct 2021 21:59:34 +0000 (14:59 -0700)]
Fix intermittent failure in DllImportGenerator unit tests when resolving assemblies (#60722)

2 years agoReduce time for Regex tests (#60660)
Stephen Toub [Thu, 21 Oct 2021 21:02:06 +0000 (17:02 -0400)]
Reduce time for Regex tests (#60660)

The introduction of the source generator tests significantly increased the time to execute the regex test suite.  A large chunk of this time is spent for each individual pattern creating an assembly load context, spinning up Roslyn to generate and then compile the code, and then tearing everything down.  We can significantly speed things up if, for the theories that generate a lot of individual tests, we instead batch the compilation to generate and compile the code for many expressions at the same time.

This PR does so and more than halves the execution time for the regex test suite on my machine.  I only added batching for the two largest theories that were contributing the most overhead; we can do so for others should it prove warranted, but it looks like there's diminishing returns here.

I also moved a couple of tests to outerloop.

2 years agoTemporarily Allow Use of OpenSSL 1.0.2 In Perf Pipelines (#60728)
Aaron Kunkle [Thu, 21 Oct 2021 20:38:06 +0000 (13:38 -0700)]
Temporarily Allow Use of OpenSSL 1.0.2 In Perf Pipelines (#60728)

* Set CRYPTOGRAPHY_ALLOW_OPENSSL_102

2 years agoUse getexepath in mono to deduplicate related code (#60449)
Adeel Mujahid [Thu, 21 Oct 2021 20:37:00 +0000 (23:37 +0300)]
Use getexepath in mono to deduplicate related code (#60449)

* Use getexepath in mono to deduplicate related code

* Strip trailing spaces in checked files

* Address CR feedback

2 years agoStop adding unnecessary variable when marshalling UTF-16 string by value (#60708)
Elinor Fung [Thu, 21 Oct 2021 19:47:27 +0000 (12:47 -0700)]
Stop adding unnecessary variable when marshalling UTF-16 string by value (#60708)

2 years agoDisable DllimportGenerator unit tests on ARM32 (#60718)
Jeremy Koritzinsky [Thu, 21 Oct 2021 19:22:14 +0000 (12:22 -0700)]
Disable DllimportGenerator unit tests on ARM32 (#60718)

They're crashing with JIT asserts on main, so disable them for now to get a clean rolling build.

2 years agoAdd copies of binarytrees-6 and fannkuch-redux-9 (#60700)
Bruce Forstall [Thu, 21 Oct 2021 17:56:59 +0000 (10:56 -0700)]
Add copies of binarytrees-6 and fannkuch-redux-9 (#60700)

* Add copies of binarytrees-6 and fannkuch-redux-9

https://github.com/dotnet/performance/pull/1453 added these to dotnet/performance.
Add copies to dotnet/runtime, configured to run and check output like
their neighbors.

Addresses #60578

* Disable binarytrees-6 on wasm

2 years agoSeveral tweaks to RegexGenerator (the tool, not the emitted code) (#60667)
Stephen Toub [Thu, 21 Oct 2021 17:04:21 +0000 (13:04 -0400)]
Several tweaks to RegexGenerator (the tool, not the emitted code) (#60667)

- Fixed a bunch of nullable reference types warnings (they're suppressed as a netstandard2.0 project, but I temporarily and locally compiled it for netcoreapp current to get clean)
- Fixed the comparer used to aid in avoiding recomputing regexes when typing
- Added a hook to start exploring code gen for NonBacktracking

2 years agoRerun mobile target jobs when it fails for 4 known scenarios (#60475)
Fan Yang [Thu, 21 Oct 2021 11:23:38 +0000 (07:23 -0400)]
Rerun mobile target jobs when it fails for 4 known scenarios (#60475)

* Rerun jobs when it fails for 4 known scenarios

* Add exitcode to retry files

* Add app name to retry files

* Fix callsite

2 years agoAvoid int[] allocation in ResourceReader when reading a decimal (#60408)
Stephen Toub [Thu, 21 Oct 2021 11:11:41 +0000 (07:11 -0400)]
Avoid int[] allocation in ResourceReader when reading a decimal (#60408)

2 years agoFix dependency of LLVM AOT jobs on CoreCLR product for CORE_ROOT (#60681)
Juan Hoyos [Thu, 21 Oct 2021 10:54:27 +0000 (03:54 -0700)]
Fix dependency of LLVM AOT jobs on CoreCLR product for CORE_ROOT (#60681)

There's a dependency in this job on CoreCLR's product for the coreroot creation. However, there was no explicit dep and it just raced sometimes.

2 years agoadd test for profiler inlining (#60225)
David Mason [Thu, 21 Oct 2021 08:53:36 +0000 (01:53 -0700)]
add test for profiler inlining (#60225)

2 years agoUpdate docs for PipeReader.TryRead (#52237)
Will Fuqua [Thu, 21 Oct 2021 05:53:26 +0000 (12:53 +0700)]
Update docs for PipeReader.TryRead (#52237)

* Update docs for PipeReader.TryRead

As per https://github.com/dotnet/runtime/issues/30161#issuecomment-831035626, add some documentation to `PipeReader.TryRead` to better document some unclear behavior.

The unclear behavior technically resides in the `StreamPipeReader.TryRead` implementation, which is internal, so I added this as a `<remark>` to the public `PipeReader.TryRead` method instead.

* remove doc reference to internal StreamPipeReader

The StreamPipeReader <see .. /> reference is an internal type, so it should not be mentioned in the public documentation.

* Format remarks as markdown and use !IMPORTANT

Co-authored-by: Jeff Handley <jeff.handley@microsoft.com>
2 years agoCleanup workloads for testing logic (#60652)
Santiago Fernandez Madero [Wed, 20 Oct 2021 23:08:17 +0000 (16:08 -0700)]
Cleanup workloads for testing logic (#60652)

* Cleanup workloads for testing logic

* PR Feedback

2 years agoDisable failing DllImportGenerator.Tests.BooleanTests.ValidateBoolIsMarshalledAsExpec...
Jeremy Koritzinsky [Wed, 20 Oct 2021 22:59:53 +0000 (15:59 -0700)]
Disable failing DllImportGenerator.Tests.BooleanTests.ValidateBoolIsMarshalledAsExpected test for Mono (#60692)

2 years agoSkip building interop test native assets for Windows-only tests on non-Windows (...
Elinor Fung [Wed, 20 Oct 2021 21:09:52 +0000 (14:09 -0700)]
Skip building interop test native assets for Windows-only tests on non-Windows (#60696)

2 years ago[wasm] Change dotnet.wasm link optimization (#60633)
Radek Doulik [Wed, 20 Oct 2021 20:30:53 +0000 (22:30 +0200)]
[wasm] Change dotnet.wasm link optimization (#60633)

* [wasm] Change dotnet.wasm link optimization

Context: #60349

When we switched to Emscripten 2.0.21, we stopped using deprecated
--llvm-opts 2 option. This caused unwanted performance degradation.
Switching to -O2 gets us similar performance as with --llvm-opts.

Blazor wasm test app Time to first UI benchmark times:

    branch/commit        link option    time    dotnet.wasm size  .br size
    --------------------+------------+--------+------------------+---------
    main f40247                  -Oz    484ms    2,430,259         849,844
    main f40247                  -O2    458ms    2,472,851         852,332
    main f40247                  -O3    445ms    2,556,188         856,617

* [wasm] Use '-O3' for link step, in WasmApp.Native.targets too

* Change to -O2

I left -O3 here by mistake after testing

Co-authored-by: Ankit Jain <radical@gmail.com>
2 years ago[Android] Skip/tweak some System.Runtime tests (#60569)
Steve Pfister [Wed, 20 Oct 2021 20:28:24 +0000 (16:28 -0400)]
[Android] Skip/tweak some System.Runtime tests (#60569)

Fixes #37088

Fixes #50925

2 years agoTweak workload build to use _GenerateMsiVersionString target (#60634)
Steve Pfister [Wed, 20 Oct 2021 20:26:50 +0000 (16:26 -0400)]
Tweak workload build to use _GenerateMsiVersionString target (#60634)

Replaces GenerateVersions that wasn't quite accurate enough for what we need

2 years agoFix setting creation date for OSX-like platforms (#49555)
Hamish Arblaster [Wed, 20 Oct 2021 18:04:40 +0000 (05:04 +1100)]
Fix setting creation date for OSX-like platforms (#49555)

* Fix setting creation date for OSX

Fix for #39132

* Fix setting creation date for OSX - fix for setattrlist

This commit adds a fallback for setattrlist failing.
It can sometimes fail on specific volume types, so this is a workaround to use the old behaviour on unsupported filesystems.

Fix for #39132

* Fix setting creation date for OSX - fix for caching when set time & possible stack overflow

This commit adds _fileStatusInitialized = -1; which resets the cache for the file status after setting a time value to the file using the setattrlist api version so that it will not simply return the last cached time.
It also fixes SetCreationTime_OtherUnix method so that it calls SetLastWriteTime_OtherUnix directly instead of SetLastWriteTime because otherwise you'll get stuck in an infinite loop on OSX when the fallback is theoretically needed.

Fix for #39132

* Fix setting creation date for OSX - changes for PR 1

Fix the behaviour of SetLastWriteTime (OSX) when setting lastwritetime before creationtime.
Use Invalidate() instead of _fileStatusInitialized = -1, and only when appropriate as per PR #49555.
Add SettingUpdatesPropertiesAfterAnother test to test things such as setting lastwritetime to before creationtime.
Rename the added _OtherUnix methods to _StandardUnixImpl, a more logical name given their purpose (#49555)

Fix for #39132 and issues in #49555.

* Fix setting creation date for OSX - changes for PR 2

Added a new test to test the behaviour of the file time functions on symlinks as per standard Windows behaviour, and also what I use in my code today. It makes sure that the times are set on the symlink itself, not the target. It is likely to fail on many unix platforms, so these will be given the [ActiveIssue] attribute when we discover which ones.
Make access time be set using setattrlist on OSX to fix following symlinks issue that would've failed the new test.
Fix and update wording of comment in SetAccessOrWriteTime.
Add T CreateSymlinkToItem(T item) to BaseGetSetTimes<T> (and implementation in inheritors) for the new test.
Made the SettingUpdatesPropertiesAfterAnother test skip on browser since it only, in effect, has one date attribute.

Fix for #39132 and issues in #49555.

* Fix setting creation date for OSX - changes for PR 3

Revert change in last commit: Make access time be set using setattrlist on OSX to fix following symlinks issue that would've failed the new test. It is now using the other API as otherwise some file watcher tests fail.
Set AT_SYMLINK_NOFOLLOW in pal_time.c to not follow symlinks for access time on OSX, or any times on other unix systems.

* Fix setting creation date for OSX - fix test for Windows and browser + update comments

Fix the SettingUpdatesPropertiesOnSymlink test for Windows by setting FILE_FLAG_OPEN_REPARSE_POINT in the CreateFile used for setting times.
Disable the SettingUpdatesPropertiesOnSymlink test for Browser as it can't use symlinks with the current API in the test project.
Update comments.
Add FILE_FLAG_OPEN_REPARSE_POINT.

Fix for #39132 and issues in #49555.

* Fix setting creation date for OSX - make modification time use normal unix APIs

Only implement creation time setting with setattrlist.
Here is why: eg. the old code doesn't account for setting creation time to 2002, then setting modification time to 2001, and then setting access time (since access time didn't have the creation date check).
I've split up SetAccessOrWriteTime into 3 parts - SetAccessOrWriteTime, SetAccessOrWriteTime_StandardUnixImpl, and SetAccessOrWriteTimeImpl (this last one contains the logic of the method without the things like refreshing the times so it's not called twice on OSX). In this process I replaced the _fileStatusInitialized = -1 calls with Invalidate() calls. And to make sure that if the creation time is needed to be set by SetAccessOrWriteTime, then we don't get in an infinite loop in case setattrlist fails, so we call SetAccessOrWriteTime_StandardUnixImpl.

* Fix setting creation date for OSX - hotfix: Remove ATTR_CMN_MODTIME

Adding this commit now to avoid 2x CI.
It was meant to be in the last one, but I forgot to save the file.

Fix for #39132 and issues in #49555.

* Fix setting creation date for OSX - revert windows changes & simplify code

Revert the changes for Windows & disable the SettingUpdatesPropertiesOnSymlink test on Windows.
Remove unnecessary setting to 0 on the attrList variable.
Remove the unnecessary MarshalAs attributes in the AttrList type.

Fix for #39132 and issues in #49555.

* Fix setting creation date for OSX - hotfix: change to CULong for marshalling with setattrlist

Use CULong as per https://github.com/dotnet/runtime/pull/49555#discussion_r599986776

Fix for #39132 and issues in #49555.

* Fix setting creation date for OSX - hotfix: change to CULong for marshalling with setattrlist 2

Use CULong as per #49555 (comment)
Forgot to save the other file's changes

Fix for #39132 and issues in #49555.

* Fix setting creation date for OSX - consolidate unix nanosecond calculation

Consolidate unix nanosecond calculation into UnixTimeSecondsToNanoseconds as per https://github.com/dotnet/runtime/pull/49555#discussion_r600004629.

Fix for #39132 and issues in #49555.

* Use InvalidateCaches instead of Invalidate and EnsureCachesInitialized instead of EnsureStatInitialized

* Fixes for reviews in PR #49555

Add an identifying field to the TimeFunction tuple and a function to get a TimeFunction from the name.
This function is then used so that SettingUpdatesPropertiesAfterAnother can be written as a Theory, and is a lot more readable.
Fix some comments that were incorrect.

* Hotfix for missing parameter

* Fix naming

* Revert changes re SettingUpdatesPropertiesAfterAnother (mainly) and revert using a Theory

Reversion as per https://github.com/dotnet/runtime/pull/49555#discussion_r633895912
This change can be unreverted if that's what's decided.

* Fix errors of #49555 due to missing variables

* Remove the parameters that were meant to be removed

* Finish merge

* Remove duplicate file

* Add custom error handling for setattrlist

Add custom error handling for setattrlist as per https://github.com/dotnet/runtime/pull/49555#discussion_r633788259.

ENOTDIR means it is not a directory, so directory not found seems logical to me, I think the other errors can be dealt with by an IOException, happy to change this.

* Remove symlink specific code from this PR

Removes the symlink specific code as per https://github.com/dotnet/runtime/pull/49555#issuecomment-904413721.
This will be reverted (and modified) as per https://github.com/dotnet/runtime/pull/49555#issuecomment-904413721 into #52639.

* Remove custom ENOTDIR handling, enable tests for other OSX-like platforms + move items in project file

• Removed ENOTDIR handling as per https://github.com/dotnet/runtime/pull/49555#discussion_r705012504
• Enabled tests for other OSX-like platforms since the code was included on them (IsOSXLike is presumably defined at src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs). If it fails on any of these platforms, they'll be fully explicitly excluded everywhere for this PR or fixed.
• Move item in project file (System.Private.CoreLib.Shared.projitems) as per https://github.com/dotnet/runtime/pull/49555#discussion_r705032218

* Rename files according to review

Rename files according to https://github.com/dotnet/runtime/pull/49555#discussion_r705073538 (and nearby comments).

* Change names of functions to improve readability and refactor code

This commit changes and refactors the core functions of this PR to have clearer names and to create a more logical flow of the code. It also updates some comments and fixes some oversights. Changes are based on the discussion https://github.com/dotnet/runtime/pull/49555#discussion_r705180391 (read whole conversation).

* Fix the wrongly named variable and add the missing 'unsafe' keyword

Fix the wrongly named variable and add the missing 'unsafe' keyword

* Better comments and minor improvements

Changes according to https://github.com/dotnet/runtime/pull/49555#pullrequestreview-753354257
• Use explicit type `IEnumerable<TimeFunction>` instead of var
• Use PlatformDetection rather than OperatingSystem
• Move the InvalidateCaches code for creation time setting to avoid unnecessary checks
• Update explanatory comments to be more useful

* Add additional tests and improvements

- Use tuple destruction to swap variables
- Add SettingOneTimeMaintainsOtherDefaultTimes and AllDefaultTimesAreSame test as per https://github.com/dotnet/runtime/pull/49555#discussion_r712787328
- Change TFM(/s) as per https://github.com/dotnet/runtime/pull/49555#discussion_r717042126
- Avoid unnecessary call to `UnixTimeToDateTimeOffset` as per https://github.com/dotnet/runtime/pull/49555#discussion_r712606875
- Use InvalidOperationException as per https://github.com/dotnet/runtime/pull/49555#discussion_r717040240

* Fix typos

* Revert to <TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser</TargetFrameworks>

Revert to using <TargetFrameworks>$(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser</TargetFrameworks> since <TargetFramework>$(NetCoreAppCurrent)</TargetFramework> failed; I wouldn't be surprised if this failed too.

* Remove SettingOneTimeMaintainsOtherDefaultTimes and AllDefaultTimesAreSame tests

Remove SettingOneTimeMaintainsOtherDefaultTimes and AllDefaultTimesAreSame tests since they don't work on windows because it is apparently an invalid time. Additionally, the function SettingOneTimeMaintainsOtherDefaultTimes wasn't working and needed to be fixed.

* Fix: setattrlist can only return 0 or -1

As per https://github.com/dotnet/runtime/pull/49555#discussion_r731451808, use GetLastErrorInfo to get the error when setattrlist indicates that there is one.

Co-authored-by: David Cantú <dacantu@microsoft.com>
* Update code comment for SettingUpdatesPropertiesAfterAnother test

The comment is now clearer and grammatically correct :)

* Update code comment for SettingUpdatesPropertiesAfterAnother test

Describe how utimensat change more dates than would be desired

* Update comment for SettingUpdatesPropertiesAfterAnother for consistency

Update for consistency with the comment in FileStatus.Unix.cs

* Fixes for compilation and update to comment

• Fix trailing spaces and incorrect capitalisation in FileStatus.SetTimes.OSX.cs
• Add more info to the comment in the SettingUpdatesPropertiesAfterAnother test

* Update FileStatus.SetTimes.OSX.cs

Use the Error property

* Move comments and add explicit types to SettingUpdatesPropertiesAfterAnother test

Move comments and add explicit types to SettingUpdatesPropertiesAfterAnother test

Co-authored-by: David Cantú <dacantu@microsoft.com>
2 years agoFallback to x64 directory if running x64 process on win-arm64 apphost (#59890)
Mateo Torres-Ruiz [Wed, 20 Oct 2021 18:00:30 +0000 (18:00 +0000)]
Fallback to x64 directory if running x64 process on win-arm64 apphost (#59890)

* Append x64 to simulations on win-arm64

* PR feedback

* Update trace and comments

* Use LoadLibraryExW
No need unloading kernel32 dll
Remove unnecessary variable
Remove unnecessary else-if branch

* Remove is_running_in_wow64 from unix pal

* Move is_emulating_x64 to pal
Use sysctlbyname on macOS

* Update ifdef condition

2 years agoDisable SetOut.SetOutReadToEnd (#60678)
Krzysztof Wicher [Wed, 20 Oct 2021 17:49:03 +0000 (19:49 +0200)]
Disable SetOut.SetOutReadToEnd (#60678)

2 years agoFix "fix rid processing on macOS" (#60668)
Austin Wise [Wed, 20 Oct 2021 17:31:31 +0000 (10:31 -0700)]
Fix "fix rid processing on macOS" (#60668)

The `else if (major == 12)` is dead code, since the previous if `if (major > 11)` would be true for `major == 12`. Judging by the comment and code, it looks like the intention of this `else if` statement was to match `major == 11`.

2 years agoissue 56835 make ordered dictionary kv collection implement i list (#60060)
LateApexEarlySpeed [Wed, 20 Oct 2021 16:12:00 +0000 (00:12 +0800)]
issue 56835 make ordered dictionary kv collection implement i list (#60060)

* issue-56835 Initial commit: make OrderedDictionaryKeyValueCollection implements IList.

* issue-56835 Use GetReadOnlyMessage() to give detailed (Keys/Values) readonly exception message.

* Fix comment: reuse existing wording to describe not supported error message.

* Add tests for IList implementation of KeyValueCollection.

* issue-56835: rename isKeysProperty to testKeysProperty.

* issue-56835: Fix comment: reduce code size; use Assert.IsAssignableFrom().

* Fix comment: remove small OrderedDictionaryKeyValueCollection ctor; Ensure initializing Hashtable field before construct keyed OrderedDictionaryKeyValueCollection.

* Fix comment: remove field '_isKeys'.

2 years agoMake unit tests for DllImportGenerator build/run in CI (#60598)
Elinor Fung [Wed, 20 Oct 2021 15:51:41 +0000 (08:51 -0700)]
Make unit tests for DllImportGenerator build/run in CI (#60598)

2 years ago[DllImportGenerator] Don't generate a full stub body when the body does nothing ...
Jeremy Koritzinsky [Wed, 20 Oct 2021 15:51:27 +0000 (08:51 -0700)]
[DllImportGenerator] Don't generate a full stub body when the body does nothing (#60601)

Co-authored-by: Jan Kotas <jkotas@microsoft.com>
2 years agoLoop Alignment support for Arm64 (#60135)
Kunal Pathak [Wed, 20 Oct 2021 15:11:55 +0000 (08:11 -0700)]
Loop Alignment support for Arm64 (#60135)

* Enable FEATURE_LOOP_ALIGN for Arm64

* basic loop alignment for arm64

* misc changes

* perf score should account for align

* some fixes

* updated some asserts

* jit format

* Fix test cases

* Misc changes

* jit format

* Review comments

2 years agoDelete AssemblyLoadContext30Extensions test (#60670)
Elinor Fung [Wed, 20 Oct 2021 14:37:51 +0000 (07:37 -0700)]
Delete AssemblyLoadContext30Extensions test (#60670)

2 years ago[tests] In test wrapper scripts if -debug is gdb or lldb, add separator before coreru...
Aleksey Kliger (λgeek) [Wed, 20 Oct 2021 14:17:54 +0000 (10:17 -0400)]
[tests] In test wrapper scripts if -debug is gdb or lldb, add separator before corerun and args (#60416)

* [tests] If -debug is LLDB, add separator before corerun and args

   For runtime test shell scripts, if a debugger is specified with `-debug=/usr/bin/lddb` or the like, add a separator so that `lldb` doesn't try to interpret `-p` as a PID argument.

   Also update mono workflow doc

* Also support gdb as the debugger

2 years agoPort InformationVersion fix to Mono corelib (#60614)
Alexander Köplinger [Wed, 20 Oct 2021 13:51:16 +0000 (15:51 +0200)]
Port InformationVersion fix to Mono corelib (#60614)

https://github.com/dotnet/runtime/pull/60572 for Mono's corelib.

2 years agoFix condition for dependOnEvaluatePaths for runtime-community pipeline (#60552)
Alexander Köplinger [Wed, 20 Oct 2021 13:50:58 +0000 (15:50 +0200)]
Fix condition for dependOnEvaluatePaths for runtime-community pipeline (#60552)

It was missed where we set a default value for that variable.
Also removed the "Evaluate paths" step from runtime-richnav.yml since it doesn't use changed path conditions (otherwise we'd need to add it to variables.yml too).

2 years ago[HTTP/3] Fixed stress (#60364)
Marie Píchová [Wed, 20 Oct 2021 13:12:02 +0000 (15:12 +0200)]
[HTTP/3] Fixed stress (#60364)

* Fixed stress

* update nanoserver docker image

* Revert "update nanoserver docker image"

This reverts commit 3b3fa4f67265c037646c1642dcd22b5e3231d1c2.

* always pull new image

* Latest msquic

* whitespace

* upper case

* removed image pull madness

2 years agoShare TypedReference managed code between CoreCLR and Mono (#60636)
Aleksey Kliger (λgeek) [Wed, 20 Oct 2021 13:11:43 +0000 (09:11 -0400)]
Share TypedReference managed code between CoreCLR and Mono  (#60636)

* [mono] Rename common TypedReference fields to the same names as CoreCLR

* Share TypedReference managed code between CoreCLR and Mono

The field layout is different. Although both have `_value` as a pointer to the
value (and this PR updates mono to use a `ByReference<byte>` for that pointer,
same as CoreCLR), and a `_type` which is a type handle (`MonoClass` in mono on
the native side), in addition, mono also has a RuntimeTypeHandle (`MonoType` in
mono on the native side) that is used to help the JIT.

But the managed code is identical and only uses `_value` and `_type`.

2 years agoFix Regex outerloop tests for RegexOptions.NonBacktracking (#60647)
Stephen Toub [Wed, 20 Oct 2021 12:29:03 +0000 (08:29 -0400)]
Fix Regex outerloop tests for RegexOptions.NonBacktracking (#60647)

* Fix Regex outerloop tests for RegexOptions.NonBacktracking

As part of this, fixes a thread-safety issue in SymbolicRegexRunner.  While the SymbolicRegexMatcher is thread-safe, the runner instance itself is not.

It also enables a bunch of outerloop tests for NonBacktracking and source generators that we'd previously missed enabling.

2 years agoAdd documentation on how VN numbers memory (#60476)
SingleAccretion [Wed, 20 Oct 2021 10:00:40 +0000 (13:00 +0300)]
Add documentation on how VN numbers memory (#60476)

2 years agoEnsure outgoing arg space for stack cookie fail fast (#60615)
Jakob Botsch Nielsen [Wed, 20 Oct 2021 09:53:12 +0000 (11:53 +0200)]
Ensure outgoing arg space for stack cookie fail fast (#60615)

The stack cookie check might call a fail fast helper, so make sure to
bump the outgoing arg size as otherwise the stack traces logged can be
corrupted.

2 years agoTry net7.0 (#60671)
Kunal Pathak [Wed, 20 Oct 2021 05:54:21 +0000 (22:54 -0700)]
Try net7.0 (#60671)

2 years agoFix a few more ASAN-exposed issues (#60262)
Jeremy Koritzinsky [Tue, 19 Oct 2021 22:22:04 +0000 (15:22 -0700)]
Fix a few more ASAN-exposed issues (#60262)

2 years agoRe-enable tests that are no longer failing (#60609)
David Cantú [Tue, 19 Oct 2021 22:10:36 +0000 (15:10 -0700)]
Re-enable tests that are no longer failing (#60609)

2 years ago[mono][llvmonly] Optimize virtual calls/rgctx fetches in gsharedvt methods. (#60491)
Zoltan Varga [Tue, 19 Oct 2021 21:54:03 +0000 (23:54 +0200)]
[mono][llvmonly] Optimize virtual calls/rgctx fetches in gsharedvt methods. (#60491)

* [mono][llvmonly] Optimize virtual calls in gsharedvt methods.

Previously, these were all implemented using a slowpath to a JIT
icall. Instead, use the normal calling sequence and add a gsharedvt
out wrapper at the end if needed.

* Optimize rgctx fetches made from gsharedvt methods.

* Implement a fastpath for mrgctx fetches.
* Load some entries from the gsharedvt info struct instead of doing an rgctx fetch.

2 years agoImprove FileProviders.Physical tests to reuse existing helper types (#58155)
David Cantú [Tue, 19 Oct 2021 20:54:24 +0000 (13:54 -0700)]
Improve FileProviders.Physical tests to reuse existing helper types (#58155)

* Replace DisposableFileSystem with FileCleanupTestBase and TestDirectory

* Fix get directory name

Co-authored-by: Jeff Handley <jeff.handley@microsoft.com>
2 years agoMove 2 Drawing APIs that are not implemented in netfx to netcoreapp (#60599)
Santiago Fernandez Madero [Tue, 19 Oct 2021 19:40:45 +0000 (12:40 -0700)]
Move 2 Drawing APIs that are not implemented in netfx to netcoreapp (#60599)

* Move 2 Drawing APIs that are not implemented in netfx to netcoreapp3.1 or later (#60371)

* Don't use ifdefs on ref file

2 years agoUpdate IntelliSense package (#60487)
Carlos Sanchez [Tue, 19 Oct 2021 18:53:26 +0000 (13:53 -0500)]
Update IntelliSense package (#60487)

* Update IntelliSense package

* Fixed package version

Co-authored-by: carlossanlop <carlossanlop@users.noreply.github.com>
2 years agoUnified request/response logging for H/2 and H/3 (#60418)
Marie Píchová [Tue, 19 Oct 2021 18:14:48 +0000 (20:14 +0200)]
Unified request/response logging for H/2 and H/3 (#60418)

2 years agoDotNetHost packages are not created during source-build (#60575)
Eric Erhardt [Tue, 19 Oct 2021 17:52:23 +0000 (12:52 -0500)]
DotNetHost packages are not created during source-build (#60575)

The subset `host.pkg` is not producing the DotNetHost* NuGet packages. This is because the "Pack" target is getting invoked on the pkgprojs, but pkgprojs expect the "Build" target to be called. Since the "Pack" target is overriden in the Directory.Build.targets to be empty, no one is calling the "Build" target on the pkgprojs.

In an official build, a later subset `packs.tests` comes through and builds `Microsoft.DotNet.CoreSetup.Packaging.Tests.csproj`, which explicitly calls "Build" on the pkgprojs. So official builds still get these packages produced.

In source-build, we are no longer building the `packs.tests` subset, so the packages are not produced.

2 years agoUpdate mac installers location string (#60499)
Sarah Oslund [Tue, 19 Oct 2021 17:08:57 +0000 (10:08 -0700)]
Update mac installers location string (#60499)