* Add support for new startup handshake protocol over pipes instead of sempahores.
* Remove NonBlocking runtime support.
* Renames, logging and simplification.
* Improve tracing.
* Make open check non blocking.
* Fold access into open calls and track ENOENT | ENOACCES
* Review feedback.
* Adjust test timeout to handle deviation due to lowres timers.
* Acceept 500 ms deviation on wait time.
* Reenable test.
* Adjust wait time calculation.
* Reduce wait delta to 20ms to account for low vs high res timers.
When we start the child process, we clear all signal handlers. This operations ends up clearing the signal handlers also for the parent process. Revert to just using fork for simplicity.
* When encountering a must expand intrinsic self-call in an interpreted method, always expand it even if intrinsics are turned off.
* Clean up a minor edge case in the 'is reference or contains references' intrinsic
* Remove an alignment assert that is causing failures in the startup path
* Replace DataTable with PinnedVector class
* Add functions for generating random Vectors
* Add functions for converting between Vector and Array types
* Generate an expected Vector for comparison and log to terminal
* Simplify validation functions
* Remove RetVectorType and Op1VectorType template variables
* Enable lookarounds to influence atomicity
As part of our auto-atomicity handling, today we give up when the subsequent node is a lookaround. This improves it to support the case when the subsequent node is a positive lookahead.
* Update src/libraries/System.Text.RegularExpressions/tests/UnitTests/RegexReductionTests.cs
This lets the logic from the ILLink targets add
`AssemblyMetadata("IsTrimmable", "true")` to ref projects which have
trimming enabled.
Also moves the trimming opt-out into `Directory.Build.props` when it
should be shared between src and corresponding ref projects.
This will be used to enable the Roslyn analyzer to produce a warning
for references to assemblies that aren't marked "IsTrimmable".
Addresses some of the regressions in #116486. If a loop has bounds checks in it, it might benefit from cloning, so perhaps we ought to tolerate going a bit over the inversion size limit to enable downstream optimizations. I ought to do something for GDV checks; perhaps as a follow-up, I'll move the checks in loop cloning to something I can reuse here. The 1.25x figure isn't all that scientific -- I found it to be the smallest factor necessary to make a dent in the regressions from less cloning I looked at, and despite the size increases, it's a net PerfScore win across collections.
Removes the IL2109 warning about a type without RUC derived from a type with
RUC. This existed for RequiresUnreferencedCode but not RequiresDynamicCode.
The warning on the class should not be necessary because there will be a warning
for the base ctor call.
An alternation with two branches where the second is empty is the same as the first branch just being an optional loop; similarly, when the first branch is empty, it's a lazy optional loop of the second branch. Expressing as an optional is better optimized elsewhere in the regex transforms, e.g. with loop coalescing, so we're better off with the optional representation.
This doesn't help with perf, it just makes the generated code a bit cleaner. Instead of e.g.
```C#
if ((uint)slice.Length < 20)
{
return false; // The input didn't match.
}
if (slice.Slice(0, 20).ContainsAnyExceptInRange('a', 'c'))
{
return false; // The input didn't match.
}
```
we'll now get:
```C#
if ((uint)slice.Length < 20 || slice.Slice(0, 20).ContainsAnyExceptInRange('a', 'c'))
{
return false; // The input didn't match.
}
```
* Avoid extra boundary checks when preceeded/succeeded char set is known
If we statically know by construction that what comes before or after a \b is guaranteed to be a word char, then we can avoid half the run-time checks.
This also tweaks the source-generated implementation of IsBoundaryWordChar in order to avoid an extra branch on every check. It's currently delegating to IsWordChar and then if that returns false, checking whether it's one of the other two joiner characters that are considered as part of the boundary set. Instead, this duplicates the IsWordChar implementation (which is just a couple of lines once the helpers are separated out into their own members), such that for ASCII, the additional check isn't necessary. The implementation used by the interpreter and RegexCompiler already do this.
* Address PR feedback
* fix the issue that the test exits with cannot find Microsoft.Win32.Primitives.dll
* Update src/tests/GC/Stress/Framework/ReliabilityFramework.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Further reduce loops around zero-width assertions
In addition to replacing the loop with an empty when it contains only a zero-width assertion and has a lower bound of 0, if it doesn't have a lower bound of 0, we can just remove the loop layer, replacing it with its child directly, since any additional iterations beyond one is redundant.
Today, given an alternation like `a|b|[cd]|efg`, that gets reduced to `[abcd]|efg`, supporting One and Set nodes. But it doesn't support Notone nodes. That means the semi-common idiom `.|\n` that folks use to express any character when not using Singleline doesn't get reduced and remains an alternation. This extends the existing reduction pass to also recognize Notones, just by treating them as one or two ranges.
* Add placeholders for setting AppContext keys and values
* For CoreCLR, add runtimeconfig.json parsing and set AppContext keys and values by replacing the template placeholders
* Setting the env variables is now redundant
* Enable newly fixed tests
* Enable the test
* Add a null check instead of using the null-forgiving operator
* Refactoring: rename method and variables and add comments
* Rename variable
Some folks end up writing sets like `[^\d]` instead of `\D`, `[^\w]` instead of `\W`, or `[^\s]` instead of `\S`. This defeats some special recognition of the common \D, \W, and \S sets. Normalize them.
Any captures performed inside of negative lookarounds do not persist to outside of the lookaround. As such, as long as there are no backreferences inside of the lookaround that would read on those captures, we can eliminate the capturing.
When loop bodies end up containing zero-width assertions and the loop has a min bound of 0, the whole loop can be removed, as the zero-width assertion may or may not apply.
Sometimes you see patterns where folks have put the same anchor multiple times in a row, e.g. `\b\b`. The subsequent anchors are nops and can just be removed.
Replaced `Volatile.Read` with plain field reads. The memory barriers provided by `CompareExchange` are
sufficient to ensure thread safety and visibility, making `Volatile.Read`
unnecessary.
Follow-up to https://github.com/dotnet/runtime/pull/117817
Related: https://github.com/dotnet/runtime/pull/100969
cc: @stephentoub
Co-authored-by: Tanner Gooding <tagoo@outlook.com>