Skip to content

Commit d195951

Browse files
committed
Merge branch 'main' of https://github.com/dotnet/runtime into unroll-startswith
# Conflicts: # src/libraries/System.Private.CoreLib/src/System/String.Comparison.cs
2 parents 8cc4dc2 + ee4640a commit d195951

File tree

1,647 files changed

+95671
-26270
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,647 files changed

+95671
-26270
lines changed

.config/dotnet-tools.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"coverlet.console": {
6-
"version": "3.1.0",
6+
"version": "3.1.2",
77
"commands": [
88
"coverlet"
99
]
@@ -15,7 +15,7 @@
1515
]
1616
},
1717
"microsoft.dotnet.xharness.cli": {
18-
"version": "1.0.0-prerelease.22101.2",
18+
"version": "1.0.0-prerelease.22108.1",
1919
"commands": [
2020
"xharness"
2121
]

.github/workflows/backport.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
if (context.eventName !== "issue_comment") throw "Error: This action only works on issue_comment events.";
2323
2424
// extract the target branch name from the trigger phrase containing these characters: a-z, A-Z, digits, forward slash, dot, hyphen, underscore
25-
const regex = /\/backport to ([a-zA-Z\d\/\.\-\_]+)/;
25+
const regex = /^\/backport to ([a-zA-Z\d\/\.\-\_]+)/;
2626
target_branch = regex.exec(context.payload.comment.body);
2727
if (target_branch == null) throw "Error: No backport branch found in the trigger phrase.";
2828

THIRD-PARTY-NOTICES.TXT

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,3 +1026,25 @@ a. No trademark or patent rights held by Affirmer are waived, abandoned, surrend
10261026
b. Affirmer offers the Work as-is and makes no representations or warranties of any kind concerning the Work, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law.
10271027
c. Affirmer disclaims responsibility for clearing rights of other persons that may apply to the Work or any use thereof, including without limitation any person's Copyright and Related Rights in the Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents, permissions or other rights required for any use of the Work.
10281028
d. Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work.
1029+
1030+
1031+
License notice for FastFloat algorithm
1032+
-------------------------------------
1033+
MIT License
1034+
Copyright (c) 2021 csFastFloat authors
1035+
Permission is hereby granted, free of charge, to any person obtaining a copy
1036+
of this software and associated documentation files (the "Software"), to deal
1037+
in the Software without restriction, including without limitation the rights
1038+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1039+
copies of the Software, and to permit persons to whom the Software is
1040+
furnished to do so, subject to the following conditions:
1041+
The above copyright notice and this permission notice shall be included in all
1042+
copies or substantial portions of the Software.
1043+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1044+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1045+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1046+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1047+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1048+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1049+
SOFTWARE.
1050+

docs/design/coreclr/botr/clr-abi.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,3 +752,43 @@ The return value is handled as follows:
752752
4. All other cases require the use of a return buffer, through which the value is returned.
753753

754754
In addition, there is a guarantee that if a return buffer is used a value is stored there only upon ordinary exit from the method. The buffer is not allowed to be used for temporary storage within the method and its contents will be unaltered if an exception occurs while executing the method.
755+
756+
# Control Flow Guard (CFG) support on Windows
757+
758+
Control Flow Guard (CFG) is a security mitigation available in Windows.
759+
When CFG is enabled, the operating system maintains data structures that can be used to verify whether an address is to be considered a valid indirect call target.
760+
This mechanism is exposed through two different helper functions, each with different characteristics.
761+
762+
The first mechanism is a validator that takes the target address as an argument and fails fast if the address is not an expected indirect call target; otherwise, it does nothing and returns.
763+
The second mechanism is a dispatcher that takes the target address in a non-standard register; on successful validation of the address, it jumps directly to the target function.
764+
Windows makes the dispatcher available only on ARM64 and x64, while the validator is available on all platforms.
765+
However, the JIT supports CFG only on ARM64 and x64, with CFG by default being disabled for these platforms.
766+
The expected use of the CFG feature is for NativeAOT scenarios that are running in constrained environments where CFG is required.
767+
768+
The helpers are exposed to the JIT as standard JIT helpers `CORINFO_HELP_VALIDATE_INDIRECT_CALL` and `CORINFO_HELP_DISPATCH_INDIRECT_CALL`.
769+
770+
To use the validator the JIT expands indirect calls into a call to the validator followed by a call to the validated address.
771+
For the dispatcher the JIT will transform calls to pass the target along but otherwise set up the call as normal.
772+
773+
Note that "indirect call" here refers to any call that is not to an immediate (in the instruction stream) address.
774+
For example, even direct calls may emit indirect call instructions in JIT codegen due to e.g. tiering or if they have not been compiled yet; these are expanded with the CFG mechanism as well.
775+
776+
The next sections describe the calling convention that the JIT expects from these helpers.
777+
778+
## CFG details for ARM64
779+
780+
On ARM64, `CORINFO_HELP_VALIDATE_INDIRECT_CALL` takes the call address in `x15`.
781+
In addition to the usual registers it preserves all float registers, `x0`-`x8` and `x15`.
782+
783+
`CORINFO_HELP_DISPATCH_INDIRECT_CALL` takes the call address in `x9`.
784+
The JIT does not use the dispatch helper by default due to worse branch predictor performance.
785+
Therefore it will expand all indirect calls via the validation helper and a manual call.
786+
787+
## CFG details for x64
788+
789+
On x64, `CORINFO_HELP_VALIDATE_INDIRECT_CALL` takes the call address in `rcx`.
790+
In addition to the usual registers it also preserves all float registers and `rcx` and `r10`; furthermore, shadow stack space is not required to be allocated.
791+
792+
`CORINFO_HELP_DISPATCH_INDIRECT_CALL` takes the call address in `rax` and it reserves the right to use and trash `r10` and `r11`.
793+
The JIT uses the dispatch helper on x64 whenever possible as it is expected that the code size benefits outweighs the less accurate branch prediction.
794+
However, note that the use of `r11` in the dispatcher makes it incompatible with VSD calls where the JIT must fall back to the validator and a manual call.

docs/design/coreclr/botr/readytorun-format.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ The limitations of the current format are:
6666

6767
# Structures
6868

69-
The structures and accompanying constants are defined in the [readytorun.h]
70-
(https://github.com/dotnet/runtime/blob/main/src/coreclr/inc/readytorun.h) header file.
69+
The structures and accompanying constants are defined in the
70+
[readytorun.h](https://github.com/dotnet/runtime/blob/main/src/coreclr/inc/readytorun.h)
71+
header file.
7172
Basically the entire R2R executable image is addressed through the READYTORUN_HEADER singleton
7273
pointed to by the well-known export RTR_HEADER in the export section of the native executable
7374
envelope.

docs/design/specs/Ecma-335-Augments.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ https://www.ecma-international.org/publications-and-standards/standards/ecma-335
453453

454454
(Add second paragraph)
455455

456-
Static interface methods may be marked as virtual. Valid object types implementing such interfaces shall provide implementations
456+
Static interface methods may be marked as virtual. Valid object types implementing such interfaces may provide implementations
457457
for these methods by means of Method Implementations (II.15.1.4). Polymorphic behavior of calls to these methods is facilitated
458458
by the constrained. call IL instruction where the constrained. prefix specifies the type to use for lookup of the static interface
459459
method.
@@ -531,7 +531,6 @@ or static method actually implemented directly on the type.
531531
(Add to the end of the 1st paragraph)
532532

533533
Interfaces may define static virtual methods that get resolved at runtime based on actual types involved.
534-
These static virtual methods must be marked as abstract in the defining interfaces.
535534

536535
### II.12.2 Implementing virtual methods on interfaces
537536

@@ -754,7 +753,7 @@ the call itself doesn't involve any instance or `this` pointer.
754753
(Edit bulleted section "This contains informative text only" starting at the bottom of page
755754
233):
756755

757-
Edit section *7.b*: Static | Virtual | !Abstract
756+
Remove section *7.b*: ~~Static | Virtual~~
758757

759758
(Add new section 41 after the last section 40:)
760759

docs/workflow/building/coreclr/nativeaot.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ The AOT compiler typically takes the app, core libraries, and framework librarie
1818

1919
The executable looks like a native executable, in the sense that it can be debugged with native debuggers and have full-fidelity access to locals, and stepping information.
2020

21+
The compiler also has a mode where each managed assembly can be compiled into a separate object file. The object files are later linked into a single executable using the platform linker. This mode is mostly used in testing (it's faster to compile this way because we don't need to recompiling the same code from e.g. CoreLib). It's not a shipping configuration and has many problems (requires exactly matching compilation settings, forfeits many optimizations, and has trouble around cross-module generic virtual method implementations).
22+
2123
## Building
2224

2325
- [Install pre-requisites](../../README.md#build-requirements)
24-
- Run `build[.cmd|.sh] clr+libs -rc [Debug|Release] -lc Release` from the repo root. This will restore nuget packages required for building and build the parts of the repo required for general CoreCLR development. Alternatively, instead of specifying `clr+libs`, you can specify `clr.jit+clr.tools+clr.nativeaotlibs+clr.nativeaotruntime+libs` which is more targeted and builds faster. Replace `clr.jit` with `clr.alljits` if you need to crosscompile.
26+
- Run `build[.cmd|.sh] clr+libs -rc [Debug|Release] -lc Release` from the repo root. This will restore nuget packages required for building and build the parts of the repo required for general CoreCLR development. Alternatively, instead of specifying `clr+libs`, you can specify `clr.alljits+clr.tools+clr.nativeaotlibs+clr.nativeaotruntime+libs` which is more targeted and builds faster.
2527
- [NOT PORTED OVER YET] The build will place the toolchain packages at `artifacts\packages\[Debug|Release]\Shipping`. To publish your project using these packages:
2628
- [NOT PORTED OVER YET] Add the package directory to your `nuget.config` file. For example, replace `dotnet-experimental` line in `samples\HelloWorld\nuget.config` with `<add key="local" value="C:\runtimelab\artifacts\packages\Debug\Shipping" />`
2729
- [NOT PORTED OVER YET] Run `dotnet publish --packages pkg -r [win-x64|linux-x64|osx-64] -c [Debug|Release]` to publish your project. `--packages pkg` option restores the package into a local directory that is easy to cleanup once you are done. It avoids polluting the global nuget cache with your locally built dev package.
@@ -65,15 +67,12 @@ To run all the tests that got built, run `src\tests\run.cmd runnativeaottests [D
6567

6668
To run an individual test (after it was built), navigate to the `artifacts\tests\coreclr\[Windows|Linux|OSX[.x64.[Debug|Release]\$path_to_test` directory. `$path_to_test` matches the subtree of `src\tests`. You should see a `[.cmd|.sh]` file there. This file is a script that will compile and launch the individual test for you. Before invoking the script, set the following environment variables:
6769

68-
* CORE_ROOT=$repo_root\artifacts\tests\coreclr\[Windows|Linux|OSX[.x64.[Debug|Release]\Tests\Core_Root
69-
* RunNativeAot=1
70-
* __TestDotNetCmd=$repo_root\dotnet[.cmd|.sh]
70+
* CORE_ROOT=$repo_root\artifacts\tests\coreclr\[Windows|Linux|OSX].x64.[Debug|Release]\Tests\Core_Root
71+
* CLRCustomTestLauncher=$repo_root\src\tests\Common\scripts\nativeaottest[.cmd|.sh]
7172

7273
`$repo_root` is the root of your clone of the repo.
7374

74-
By default the test suite will delete the build artifacts (Native AOT images and response files) if the test compiled successfully. If you want to keep these files instead of deleting them after test run, set the following environment variables and make sure you'll have enough disk space (tens of MB per test):
75-
76-
* CLRTestNoCleanup=1
75+
Sometimes it's handy to be able to rebuild the managed test manually or run the compilation under a debugger. A response file that was used to invoke the ahead of time compiler can be found in `$repo_root\artifacts\tests\coreclr\obj\[Windows|Linux|OSX].x64.[Debug|Release]\Managed`.
7776

7877
For more advanced scenarios, look for at [Building Test Subsets](../../testing/coreclr/windows-test-instructions.md#building-test-subsets) and [Generating Core_Root](../../testing/coreclr/windows-test-instructions.md#generating-core_root)
7978

docs/workflow/testing/libraries/testing-wasm.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ The following shows how to run tests for a specific library
9898
9999
### Passing arguments to xharness
100100
101-
- `$(WasmXHarnessArgs)` - xharness command arguments
101+
- `$(WasmXHarnessArgsCli)` - xharness command arguments
102102
103-
Example: `WasmXHarnessArgs="--set-web-server-http-env=DOTNET_TEST_WEBSOCKETHOST"` -> becomes `dotnet xharness wasm test --set-web-server-http-env=DOTNET_TEST_WEBSOCKETHOST`
103+
Example: `WasmXHarnessArgsCli="--set-web-server-http-env=DOTNET_TEST_WEBSOCKETHOST"` -> becomes `dotnet xharness wasm test --set-web-server-http-env=DOTNET_TEST_WEBSOCKETHOST`
104104
105105
- `$(WasmXHarnessMonoArgs)` - arguments and variables for mono
106106

eng/CodeAnalysis.src.globalconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,6 +1539,9 @@ dotnet_diagnostic.IDE0160.severity = silent
15391539
# IDE0161: Convert to file-scoped namespace
15401540
dotnet_diagnostic.IDE0161.severity = silent
15411541

1542+
# IDE0190: Null check can be simplified
1543+
dotnet_diagnostic.IDE0190.severity = suggestion
1544+
15421545
# IDE1005: Delegate invocation can be simplified.
15431546
dotnet_diagnostic.IDE1005.severity = suggestion
15441547

eng/CodeAnalysis.test.globalconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,6 +1536,9 @@ dotnet_diagnostic.IDE0160.severity = silent
15361536
# IDE0161: Convert to file-scoped namespace
15371537
dotnet_diagnostic.IDE0161.severity = silent
15381538

1539+
# IDE0190: Null check can be simplified
1540+
dotnet_diagnostic.IDE0190.severity = silent
1541+
15391542
# IDE1005: Delegate invocation can be simplified.
15401543
dotnet_diagnostic.IDE1005.severity = silent
15411544

0 commit comments

Comments
 (0)