Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Koritzinsky <jekoritz@microsoft.com>2022-03-24 21:29:13 +0300
committerGitHub <noreply@github.com>2022-03-24 21:29:13 +0300
commitece9556d4b1f96ea24b4035567131cb9097867de (patch)
tree4be8be1fb6f69cb4c7ae065cfff0e819204c57d7
parent2253593dbc81583e15992a49c983cb936b9cf44a (diff)
parent0d59046238d36178e8d1f60a6509fbd6b73fc697 (diff)
Merge branch 'main' into arm64-xarch-msiarm64-xarch-msi
-rw-r--r--.config/dotnet-tools.json2
-rw-r--r--.github/workflows/markdownlint.yml2
-rw-r--r--docs/coding-guidelines/coding-style.md1
-rw-r--r--eng/Version.Details.xml216
-rw-r--r--eng/Versions.props100
-rw-r--r--eng/pipelines/common/templates/runtimes/run-test-job.yml2
-rw-r--r--eng/pipelines/runtime.yml1
-rw-r--r--global.json8
-rw-r--r--src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs27
-rw-r--r--src/coreclr/jit/loopcloning.cpp5
-rw-r--r--src/coreclr/jit/optimizer.cpp15
-rw-r--r--src/libraries/Common/src/Interop/Windows/SspiCli/SecuritySafeHandles.cs4
-rw-r--r--src/libraries/Common/src/System/Net/Security/Unix/SafeFreeCredentials.cs6
-rw-r--r--src/libraries/Microsoft.Extensions.Caching.Memory/src/MemoryCache.cs2
-rw-r--r--src/libraries/Microsoft.Extensions.Logging.EventSource/src/EventSourceLogger.cs2
-rw-r--r--src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/LegacyPropagator.cs2
-rw-r--r--src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Winspool.cs2
-rw-r--r--src/libraries/System.Drawing.Common/tests/System/Drawing/ImageAnimator.ManualTests.cs2
-rw-r--r--src/libraries/System.IO.Packaging/src/System/IO/Packaging/ContentType.cs4
-rw-r--r--src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Interop/MsQuicNativeMethods.cs6
-rw-r--r--src/libraries/System.Net.Security/src/System/Net/Security/SecureChannel.cs63
-rw-r--r--src/libraries/System.Net.Security/src/System/Net/Security/SslSessionsCache.cs9
-rw-r--r--src/libraries/System.Net.WebSockets/tests/WebSocketDeflateTests.cs32
-rw-r--r--src/libraries/System.Private.CoreLib/src/System/Collections/Generic/ValueListBuilder.cs19
-rw-r--r--src/libraries/System.Private.CoreLib/src/System/DateTime.cs14
-rw-r--r--src/libraries/System.Private.CoreLib/src/System/Reflection/NullabilityInfoContext.cs4
-rw-r--r--src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/PosixSignalRegistration.Windows.cs2
-rw-r--r--src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs80
-rw-r--r--src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.IO.Windows.cs2
-rw-r--r--src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/TaskAsyncEnumerableExtensions.ToBlockingEnumerable.cs4
-rw-r--r--src/libraries/System.Private.Xml/src/System/Xml/Schema/XsdBuilder.cs24
-rw-r--r--src/libraries/System.Private.Xml/src/System/Xml/XmlQualifiedName.cs4
-rw-r--r--src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/NumberFormatter.cs4
-rw-r--r--src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.ComDisabled.UnitTests/System.Runtime.InteropServices.ComDisabled.Tests.csproj4
-rw-r--r--src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.ComDisabled.UnitTests/System/Runtime/InteropServices/Marshal/MarshalComDisabledTests.cs1
-rw-r--r--src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/CollectionsMarshalTests.cs54
-rw-r--r--src/libraries/System.Runtime/tests/System/DateTimeTests.cs2
-rw-r--r--src/libraries/System.Runtime/tests/System/Runtime/DependentHandleTests.cs8
-rw-r--r--src/libraries/System.Runtime/tests/System/String.SplitTests.cs2
-rw-r--r--src/libraries/System.Security.Cryptography.Cose/tests/CoseSign1MessageTests.Sign.cs2
-rw-r--r--src/libraries/System.Security.Cryptography.Cose/tests/CoseTestHelpers.cs2
-rw-r--r--src/libraries/System.Text.Json/src/System/Text/Json/Serialization/ConverterList.cs2
-rw-r--r--src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IAsyncEnumerableOfTConverter.cs2
-rw-r--r--src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonResumableConverterOfT.cs2
-rw-r--r--src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.HandleMetadata.cs5
-rw-r--r--src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Write.Helpers.cs2
-rw-r--r--src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Write.Stream.cs4
-rw-r--r--src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.Caching.cs2
-rw-r--r--src/libraries/System.Text.Json/src/System/Text/Json/Serialization/ReadStack.cs12
-rw-r--r--src/libraries/System.Text.Json/src/System/Text/Json/Serialization/WriteStack.cs26
-rw-r--r--src/libraries/System.Text.Json/tests/Common/CollectionTests/CollectionTests.AsyncEnumerable.cs28
-rw-r--r--src/libraries/System.Text.Json/tests/Common/CollectionTests/CollectionTests.Dictionary.NonStringKey.cs2
-rw-r--r--src/libraries/System.Text.Json/tests/Common/StreamingJsonSerializerWrapper.cs2
-rw-r--r--src/libraries/System.Text.Json/tests/Common/UnsupportedTypesTests.cs4
-rw-r--r--src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/Serialization/JsonSerializerWrapper.SourceGen.cs2
-rw-r--r--src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/System.Text.Json.SourceGeneration.Roslyn3.11.Unit.Tests.csproj1
-rw-r--r--src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/CollectionTests.cs6
-rw-r--r--src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/ContinuationTests.cs2
-rw-r--r--src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/JsonSerializerWrapper.Reflection.cs4
-rw-r--r--src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/NumberHandlingTests.cs6
-rw-r--r--src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/ReferenceHandlerTests.cs1
-rw-r--r--src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexFindOptimizations.cs5
-rw-r--r--src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexTreeAnalyzer.cs4
-rw-r--r--src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/RegexNodeConverter.cs4
-rw-r--r--src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexMatcher.cs4
-rw-r--r--src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexNode.cs4
-rw-r--r--src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/Parallel.ForEachAsync.cs12
-rw-r--r--src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForEachAsyncTests.cs30
-rw-r--r--src/mono/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Mono.cs5
-rw-r--r--src/mono/mono/eventpipe/ep-rt-mono.c6
-rw-r--r--src/mono/mono/metadata/cominterop.c148
-rw-r--r--src/mono/mono/metadata/components.c26
-rw-r--r--src/mono/mono/metadata/jit-icall-reg.h1
-rw-r--r--src/mono/mono/metadata/marshal-ilgen.c234
-rw-r--r--src/mono/mono/metadata/marshal-noilgen.c2
-rw-r--r--src/mono/mono/metadata/marshal.c45
-rw-r--r--src/mono/mono/metadata/marshal.h4
-rw-r--r--src/mono/mono/metadata/metadata.c7
-rw-r--r--src/mono/mono/metadata/native-library.c187
-rw-r--r--src/mono/mono/metadata/object-offsets.h2
-rw-r--r--src/mono/mono/metadata/profiler.c46
-rw-r--r--src/mono/mono/mini/aot-compiler.c38
-rw-r--r--src/mono/mono/mini/aot-runtime.c102
-rw-r--r--src/mono/mono/mini/driver.c15
-rw-r--r--src/mono/mono/mini/jit-icalls.c27
-rw-r--r--src/mono/mono/mini/jit-icalls.h2
-rw-r--r--src/mono/mono/mini/llvm-jit.cpp10
-rw-r--r--src/mono/mono/mini/method-to-ir.c234
-rw-r--r--src/mono/mono/mini/mini-exceptions.c9
-rw-r--r--src/mono/mono/mini/mini-generic-sharing.c88
-rw-r--r--src/mono/mono/mini/mini-llvm.c4
-rw-r--r--src/mono/mono/mini/mini-runtime.c67
-rw-r--r--src/mono/mono/mini/mini-runtime.h2
-rw-r--r--src/mono/mono/mini/mini-trampolines.c6
-rw-r--r--src/mono/mono/mini/mini.c16
-rw-r--r--src/mono/mono/mini/mini.h21
-rw-r--r--src/mono/mono/mini/patch-info.h3
-rw-r--r--src/mono/mono/utils/mono-dl-posix.c4
-rw-r--r--src/mono/mono/utils/mono-dl-wasm.c4
-rw-r--r--src/mono/mono/utils/mono-dl-windows.c19
-rw-r--r--src/mono/mono/utils/mono-dl.c137
-rw-r--r--src/mono/mono/utils/mono-dl.h17
-rw-r--r--src/mono/mono/utils/mono-error-internals.h12
-rw-r--r--src/mono/mono/utils/mono-mmap-windows.c5
-rw-r--r--src/mono/mono/utils/options-def.h1
-rw-r--r--src/mono/mono/utils/options.c2
-rw-r--r--src/tests/Interop/NativeLibrary/Callback/CallbackStressTest.cs14
-rw-r--r--src/tests/Interop/NativeLibrary/Callback/CallbackStressTest_TargetWindows.csproj1
-rw-r--r--src/tests/Interop/UnmanagedCallersOnly/UnmanagedCallersOnlyTest.cs4
-rw-r--r--src/tests/build.cmd6
-rw-r--r--src/tests/issues.targets172
111 files changed, 1812 insertions, 866 deletions
diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
index a9cab84ae0c..a26fb57dd9c 100644
--- a/.config/dotnet-tools.json
+++ b/.config/dotnet-tools.json
@@ -15,7 +15,7 @@
]
},
"microsoft.dotnet.xharness.cli": {
- "version": "1.0.0-prerelease.22164.2",
+ "version": "1.0.0-prerelease.22173.1",
"commands": [
"xharness"
]
diff --git a/.github/workflows/markdownlint.yml b/.github/workflows/markdownlint.yml
index eeb9eb6fefe..79a42573425 100644
--- a/.github/workflows/markdownlint.yml
+++ b/.github/workflows/markdownlint.yml
@@ -21,7 +21,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v1
with:
- node-version: 12.x
+ node-version: 16.x
- name: Run Markdownlint
run: |
echo "::add-matcher::.github/workflows/markdownlint-problem-matcher.json"
diff --git a/docs/coding-guidelines/coding-style.md b/docs/coding-guidelines/coding-style.md
index 709d4719d1c..ac12a6c69d4 100644
--- a/docs/coding-guidelines/coding-style.md
+++ b/docs/coding-guidelines/coding-style.md
@@ -24,6 +24,7 @@ The general rule we follow is "use Visual Studio defaults".
9. If a file happens to differ in style from these guidelines (e.g. private members are named `m_member`
rather than `_member`), the existing style in that file takes precedence.
10. We only use `var` when the type is explicitly named on the right-hand side, typically due to either `new` or an explicit cast, e.g. `var stream = new FileStream(...)` not `var stream = OpenStandardInput()`.
+ - Similarly, target-typed `new()` can only be used when the type is explicitly named on the left-hand side, in a variable definition statement or a field definition statement. e.g. `FileStream stream = new(...);`, but not `stream = new(...);` (where the type was specified on a previous line).
11. We use language keywords instead of BCL types (e.g. `int, string, float` instead of `Int32, String, Single`, etc) for both type references as well as method calls (e.g. `int.Parse` instead of `Int32.Parse`). See issue [#13976](https://github.com/dotnet/runtime/issues/13976) for examples.
12. We use PascalCasing to name all our constant local variables and fields. The only exception is for interop code where the constant value should exactly match the name and value of the code you are calling via interop.
13. We use PascalCasing for all method names, including local functions.
diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index 527ecb99f58..cfecec392c4 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -1,16 +1,16 @@
<Dependencies>
<ProductDependencies>
- <Dependency Name="Microsoft.NETCore.Runtime.ICU.Transport" Version="7.0.0-preview.3.22121.1">
+ <Dependency Name="Microsoft.NETCore.Runtime.ICU.Transport" Version="7.0.0-preview.4.22172.1">
<Uri>https://github.com/dotnet/icu</Uri>
- <Sha>d3c9d26f8e787253536d38504d3ac9e307573bfb</Sha>
+ <Sha>e7811491dea737579d531549d46591c0616e13b7</Sha>
</Dependency>
- <Dependency Name="System.Net.MsQuic.Transport" Version="7.0.0-alpha.1.22160.2">
+ <Dependency Name="System.Net.MsQuic.Transport" Version="7.0.0-alpha.1.22173.2">
<Uri>https://github.com/dotnet/msquic</Uri>
- <Sha>4fe73fcad4b0af91cc49fd1f5576f0111f15f6fd</Sha>
+ <Sha>03def3e4f051aa09f9642a6a839a0c806682536e</Sha>
</Dependency>
- <Dependency Name="Microsoft.NET.Workload.Emscripten.Manifest-7.0.100" Version="7.0.0-preview.3.22121.1">
+ <Dependency Name="Microsoft.NET.Workload.Emscripten.Manifest-7.0.100" Version="7.0.0-preview.4.22172.1">
<Uri>https://github.com/dotnet/emsdk</Uri>
- <Sha>b8e71431b3eaa024afad7886699f8ac6bca2ba01</Sha>
+ <Sha>ac8f3c57760f3414d58e9ea0562b8c3ab56ac845</Sha>
</Dependency>
<Dependency Name="System.ServiceModel.Primitives" Version="4.9.0-rc2.21473.1">
<Uri>https://github.com/dotnet/wcf</Uri>
@@ -54,205 +54,205 @@
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
- <Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="7.0.0-beta.22166.1">
+ <Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="7.0.0-beta.22171.2">
<Uri>https://github.com/dotnet/arcade</Uri>
- <Sha>c90e2d9f3d3e2b471a078f949f2a2fea6af2627d</Sha>
+ <Sha>c8a95297e2622251c125aa5c0ef7c822275a792d</Sha>
</Dependency>
- <Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="7.0.0-beta.22166.1">
+ <Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="7.0.0-beta.22171.2">
<Uri>https://github.com/dotnet/arcade</Uri>
- <Sha>c90e2d9f3d3e2b471a078f949f2a2fea6af2627d</Sha>
+ <Sha>c8a95297e2622251c125aa5c0ef7c822275a792d</Sha>
</Dependency>
- <Dependency Name="Microsoft.DotNet.ApiCompat" Version="7.0.0-beta.22166.1">
+ <Dependency Name="Microsoft.DotNet.ApiCompat" Version="7.0.0-beta.22171.2">
<Uri>https://github.com/dotnet/arcade</Uri>
- <Sha>c90e2d9f3d3e2b471a078f949f2a2fea6af2627d</Sha>
+ <Sha>c8a95297e2622251c125aa5c0ef7c822275a792d</Sha>
</Dependency>
- <Dependency Name="Microsoft.DotNet.GenAPI" Version="7.0.0-beta.22166.1">
+ <Dependency Name="Microsoft.DotNet.GenAPI" Version="7.0.0-beta.22171.2">
<Uri>https://github.com/dotnet/arcade</Uri>
- <Sha>c90e2d9f3d3e2b471a078f949f2a2fea6af2627d</Sha>
+ <Sha>c8a95297e2622251c125aa5c0ef7c822275a792d</Sha>
</Dependency>
- <Dependency Name="Microsoft.DotNet.GenFacades" Version="7.0.0-beta.22166.1">
+ <Dependency Name="Microsoft.DotNet.GenFacades" Version="7.0.0-beta.22171.2">
<Uri>https://github.com/dotnet/arcade</Uri>
- <Sha>c90e2d9f3d3e2b471a078f949f2a2fea6af2627d</Sha>
+ <Sha>c8a95297e2622251c125aa5c0ef7c822275a792d</Sha>
</Dependency>
- <Dependency Name="Microsoft.DotNet.XUnitExtensions" Version="7.0.0-beta.22166.1">
+ <Dependency Name="Microsoft.DotNet.XUnitExtensions" Version="7.0.0-beta.22171.2">
<Uri>https://github.com/dotnet/arcade</Uri>
- <Sha>c90e2d9f3d3e2b471a078f949f2a2fea6af2627d</Sha>
+ <Sha>c8a95297e2622251c125aa5c0ef7c822275a792d</Sha>
</Dependency>
- <Dependency Name="Microsoft.DotNet.XUnitConsoleRunner" Version="2.5.1-beta.22166.1">
+ <Dependency Name="Microsoft.DotNet.XUnitConsoleRunner" Version="2.5.1-beta.22171.2">
<Uri>https://github.com/dotnet/arcade</Uri>
- <Sha>c90e2d9f3d3e2b471a078f949f2a2fea6af2627d</Sha>
+ <Sha>c8a95297e2622251c125aa5c0ef7c822275a792d</Sha>
</Dependency>
- <Dependency Name="Microsoft.DotNet.Build.Tasks.Archives" Version="7.0.0-beta.22166.1">
+ <Dependency Name="Microsoft.DotNet.Build.Tasks.Archives" Version="7.0.0-beta.22171.2">
<Uri>https://github.com/dotnet/arcade</Uri>
- <Sha>c90e2d9f3d3e2b471a078f949f2a2fea6af2627d</Sha>
+ <Sha>c8a95297e2622251c125aa5c0ef7c822275a792d</Sha>
</Dependency>
- <Dependency Name="Microsoft.DotNet.Build.Tasks.Packaging" Version="7.0.0-beta.22166.1">
+ <Dependency Name="Microsoft.DotNet.Build.Tasks.Packaging" Version="7.0.0-beta.22171.2">
<Uri>https://github.com/dotnet/arcade</Uri>
- <Sha>c90e2d9f3d3e2b471a078f949f2a2fea6af2627d</Sha>
+ <Sha>c8a95297e2622251c125aa5c0ef7c822275a792d</Sha>
</Dependency>
- <Dependency Name="Microsoft.DotNet.Build.Tasks.Installers" Version="7.0.0-beta.22166.1">
+ <Dependency Name="Microsoft.DotNet.Build.Tasks.Installers" Version="7.0.0-beta.22171.2">
<Uri>https://github.com/dotnet/arcade</Uri>
- <Sha>c90e2d9f3d3e2b471a078f949f2a2fea6af2627d</Sha>
+ <Sha>c8a95297e2622251c125aa5c0ef7c822275a792d</Sha>
</Dependency>
- <Dependency Name="Microsoft.DotNet.Build.Tasks.Templating" Version="7.0.0-beta.22166.1">
+ <Dependency Name="Microsoft.DotNet.Build.Tasks.Templating" Version="7.0.0-beta.22171.2">
<Uri>https://github.com/dotnet/arcade</Uri>
- <Sha>c90e2d9f3d3e2b471a078f949f2a2fea6af2627d</Sha>
+ <Sha>c8a95297e2622251c125aa5c0ef7c822275a792d</Sha>
</Dependency>
- <Dependency Name="Microsoft.DotNet.Build.Tasks.Workloads" Version="7.0.0-beta.22166.1">
+ <Dependency Name="Microsoft.DotNet.Build.Tasks.Workloads" Version="7.0.0-beta.22171.2">
<Uri>https://github.com/dotnet/arcade</Uri>
- <Sha>c90e2d9f3d3e2b471a078f949f2a2fea6af2627d</Sha>
+ <Sha>c8a95297e2622251c125aa5c0ef7c822275a792d</Sha>
</Dependency>
- <Dependency Name="Microsoft.DotNet.CodeAnalysis" Version="7.0.0-beta.22166.1">
+ <Dependency Name="Microsoft.DotNet.CodeAnalysis" Version="7.0.0-beta.22171.2">
<Uri>https://github.com/dotnet/arcade</Uri>
- <Sha>c90e2d9f3d3e2b471a078f949f2a2fea6af2627d</Sha>
+ <Sha>c8a95297e2622251c125aa5c0ef7c822275a792d</Sha>
</Dependency>
- <Dependency Name="Microsoft.DotNet.Build.Tasks.TargetFramework" Version="7.0.0-beta.22166.1">
+ <Dependency Name="Microsoft.DotNet.Build.Tasks.TargetFramework" Version="7.0.0-beta.22171.2">
<Uri>https://github.com/dotnet/arcade</Uri>
- <Sha>c90e2d9f3d3e2b471a078f949f2a2fea6af2627d</Sha>
+ <Sha>c8a95297e2622251c125aa5c0ef7c822275a792d</Sha>
</Dependency>
- <Dependency Name="Microsoft.DotNet.RemoteExecutor" Version="7.0.0-beta.22166.1">
+ <Dependency Name="Microsoft.DotNet.RemoteExecutor" Version="7.0.0-beta.22171.2">
<Uri>https://github.com/dotnet/arcade</Uri>
- <Sha>c90e2d9f3d3e2b471a078f949f2a2fea6af2627d</Sha>
+ <Sha>c8a95297e2622251c125aa5c0ef7c822275a792d</Sha>
</Dependency>
- <Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="7.0.0-beta.22166.1">
+ <Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="7.0.0-beta.22171.2">
<Uri>https://github.com/dotnet/arcade</Uri>
- <Sha>c90e2d9f3d3e2b471a078f949f2a2fea6af2627d</Sha>
+ <Sha>c8a95297e2622251c125aa5c0ef7c822275a792d</Sha>
</Dependency>
- <Dependency Name="Microsoft.DotNet.VersionTools.Tasks" Version="7.0.0-beta.22166.1">
+ <Dependency Name="Microsoft.DotNet.VersionTools.Tasks" Version="7.0.0-beta.22171.2">
<Uri>https://github.com/dotnet/arcade</Uri>
- <Sha>c90e2d9f3d3e2b471a078f949f2a2fea6af2627d</Sha>
+ <Sha>c8a95297e2622251c125aa5c0ef7c822275a792d</Sha>
</Dependency>
- <Dependency Name="Microsoft.DotNet.SharedFramework.Sdk" Version="7.0.0-beta.22166.1">
+ <Dependency Name="Microsoft.DotNet.SharedFramework.Sdk" Version="7.0.0-beta.22171.2">
<Uri>https://github.com/dotnet/arcade</Uri>
- <Sha>c90e2d9f3d3e2b471a078f949f2a2fea6af2627d</Sha>
+ <Sha>c8a95297e2622251c125aa5c0ef7c822275a792d</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Test.Sdk" Version="16.9.0-preview-20201201-01">
<Uri>https://github.com/microsoft/vstest</Uri>
<Sha>140434f7109d357d0158ade9e5164a4861513965</Sha>
</Dependency>
- <Dependency Name="System.ComponentModel.TypeConverter.TestData" Version="7.0.0-beta.22166.2">
+ <Dependency Name="System.ComponentModel.TypeConverter.TestData" Version="7.0.0-beta.22171.1">
<Uri>https://github.com/dotnet/runtime-assets</Uri>
- <Sha>ffb68be1b7ee2dbf1d5b99caa7c76750cc01a620</Sha>
+ <Sha>26467cf6f83bcbe0993d2205f0ae13fe336b315d</Sha>
</Dependency>
- <Dependency Name="System.Drawing.Common.TestData" Version="7.0.0-beta.22166.2">
+ <Dependency Name="System.Drawing.Common.TestData" Version="7.0.0-beta.22171.1">
<Uri>https://github.com/dotnet/runtime-assets</Uri>
- <Sha>ffb68be1b7ee2dbf1d5b99caa7c76750cc01a620</Sha>
+ <Sha>26467cf6f83bcbe0993d2205f0ae13fe336b315d</Sha>
</Dependency>
- <Dependency Name="System.IO.Compression.TestData" Version="7.0.0-beta.22166.2">
+ <Dependency Name="System.IO.Compression.TestData" Version="7.0.0-beta.22171.1">
<Uri>https://github.com/dotnet/runtime-assets</Uri>
- <Sha>ffb68be1b7ee2dbf1d5b99caa7c76750cc01a620</Sha>
+ <Sha>26467cf6f83bcbe0993d2205f0ae13fe336b315d</Sha>
</Dependency>
- <Dependency Name="System.IO.Packaging.TestData" Version="7.0.0-beta.22166.2">
+ <Dependency Name="System.IO.Packaging.TestData" Version="7.0.0-beta.22171.1">
<Uri>https://github.com/dotnet/runtime-assets</Uri>
- <Sha>ffb68be1b7ee2dbf1d5b99caa7c76750cc01a620</Sha>
+ <Sha>26467cf6f83bcbe0993d2205f0ae13fe336b315d</Sha>
</Dependency>
- <Dependency Name="System.Net.TestData" Version="7.0.0-beta.22166.2">
+ <Dependency Name="System.Net.TestData" Version="7.0.0-beta.22171.1">
<Uri>https://github.com/dotnet/runtime-assets</Uri>
- <Sha>ffb68be1b7ee2dbf1d5b99caa7c76750cc01a620</Sha>
+ <Sha>26467cf6f83bcbe0993d2205f0ae13fe336b315d</Sha>
</Dependency>
- <Dependency Name="System.Private.Runtime.UnicodeData" Version="7.0.0-beta.22166.2">
+ <Dependency Name="System.Private.Runtime.UnicodeData" Version="7.0.0-beta.22171.1">
<Uri>https://github.com/dotnet/runtime-assets</Uri>
- <Sha>ffb68be1b7ee2dbf1d5b99caa7c76750cc01a620</Sha>
+ <Sha>26467cf6f83bcbe0993d2205f0ae13fe336b315d</Sha>
</Dependency>
- <Dependency Name="System.Runtime.TimeZoneData" Version="7.0.0-beta.22166.2">
+ <Dependency Name="System.Runtime.TimeZoneData" Version="7.0.0-beta.22171.1">
<Uri>https://github.com/dotnet/runtime-assets</Uri>
- <Sha>ffb68be1b7ee2dbf1d5b99caa7c76750cc01a620</Sha>
+ <Sha>26467cf6f83bcbe0993d2205f0ae13fe336b315d</Sha>
</Dependency>
- <Dependency Name="System.Security.Cryptography.X509Certificates.TestData" Version="7.0.0-beta.22166.2">
+ <Dependency Name="System.Security.Cryptography.X509Certificates.TestData" Version="7.0.0-beta.22171.1">
<Uri>https://github.com/dotnet/runtime-assets</Uri>
- <Sha>ffb68be1b7ee2dbf1d5b99caa7c76750cc01a620</Sha>
+ <Sha>26467cf6f83bcbe0993d2205f0ae13fe336b315d</Sha>
</Dependency>
- <Dependency Name="System.Text.RegularExpressions.TestData" Version="7.0.0-beta.22166.2">
+ <Dependency Name="System.Text.RegularExpressions.TestData" Version="7.0.0-beta.22171.1">
<Uri>https://github.com/dotnet/runtime-assets</Uri>
- <Sha>ffb68be1b7ee2dbf1d5b99caa7c76750cc01a620</Sha>
+ <Sha>26467cf6f83bcbe0993d2205f0ae13fe336b315d</Sha>
</Dependency>
- <Dependency Name="System.Windows.Extensions.TestData" Version="7.0.0-beta.22166.2">
+ <Dependency Name="System.Windows.Extensions.TestData" Version="7.0.0-beta.22171.1">
<Uri>https://github.com/dotnet/runtime-assets</Uri>
- <Sha>ffb68be1b7ee2dbf1d5b99caa7c76750cc01a620</Sha>
+ <Sha>26467cf6f83bcbe0993d2205f0ae13fe336b315d</Sha>
</Dependency>
- <Dependency Name="Microsoft.DotNet.CilStrip.Sources" Version="7.0.0-beta.22166.2">
+ <Dependency Name="Microsoft.DotNet.CilStrip.Sources" Version="7.0.0-beta.22171.1">
<Uri>https://github.com/dotnet/runtime-assets</Uri>
- <Sha>ffb68be1b7ee2dbf1d5b99caa7c76750cc01a620</Sha>
+ <Sha>26467cf6f83bcbe0993d2205f0ae13fe336b315d</Sha>
</Dependency>
- <Dependency Name="runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk" Version="11.1.0-alpha.1.22164.2">
+ <Dependency Name="runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk" Version="11.1.0-alpha.1.22171.2">
<Uri>https://github.com/dotnet/llvm-project</Uri>
- <Sha>3808d3fb07c92066ec3d58b6466add62051e1b32</Sha>
+ <Sha>7f00c63a4c31ae647c7fd0525d1dd2a72afb2e9b</Sha>
</Dependency>
- <Dependency Name="runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools" Version="11.1.0-alpha.1.22164.2">
+ <Dependency Name="runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools" Version="11.1.0-alpha.1.22171.2">
<Uri>https://github.com/dotnet/llvm-project</Uri>
- <Sha>3808d3fb07c92066ec3d58b6466add62051e1b32</Sha>
+ <Sha>7f00c63a4c31ae647c7fd0525d1dd2a72afb2e9b</Sha>
</Dependency>
- <Dependency Name="runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk" Version="11.1.0-alpha.1.22164.2">
+ <Dependency Name="runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk" Version="11.1.0-alpha.1.22171.2">
<Uri>https://github.com/dotnet/llvm-project</Uri>
- <Sha>3808d3fb07c92066ec3d58b6466add62051e1b32</Sha>
+ <Sha>7f00c63a4c31ae647c7fd0525d1dd2a72afb2e9b</Sha>
</Dependency>
- <Dependency Name="runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools" Version="11.1.0-alpha.1.22164.2">
+ <Dependency Name="runtime.linux-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools" Version="11.1.0-alpha.1.22171.2">
<Uri>https://github.com/dotnet/llvm-project</Uri>
- <Sha>3808d3fb07c92066ec3d58b6466add62051e1b32</Sha>
+ <Sha>7f00c63a4c31ae647c7fd0525d1dd2a72afb2e9b</Sha>
</Dependency>
- <Dependency Name="runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk" Version="11.1.0-alpha.1.22164.2">
+ <Dependency Name="runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk" Version="11.1.0-alpha.1.22171.2">
<Uri>https://github.com/dotnet/llvm-project</Uri>
- <Sha>3808d3fb07c92066ec3d58b6466add62051e1b32</Sha>
+ <Sha>7f00c63a4c31ae647c7fd0525d1dd2a72afb2e9b</Sha>
</Dependency>
- <Dependency Name="runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools" Version="11.1.0-alpha.1.22164.2">
+ <Dependency Name="runtime.win-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools" Version="11.1.0-alpha.1.22171.2">
<Uri>https://github.com/dotnet/llvm-project</Uri>
- <Sha>3808d3fb07c92066ec3d58b6466add62051e1b32</Sha>
+ <Sha>7f00c63a4c31ae647c7fd0525d1dd2a72afb2e9b</Sha>
</Dependency>
- <Dependency Name="runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk" Version="11.1.0-alpha.1.22164.2">
+ <Dependency Name="runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk" Version="11.1.0-alpha.1.22171.2">
<Uri>https://github.com/dotnet/llvm-project</Uri>
- <Sha>3808d3fb07c92066ec3d58b6466add62051e1b32</Sha>
+ <Sha>7f00c63a4c31ae647c7fd0525d1dd2a72afb2e9b</Sha>
</Dependency>
- <Dependency Name="runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools" Version="11.1.0-alpha.1.22164.2">
+ <Dependency Name="runtime.osx.10.12-x64.Microsoft.NETCore.Runtime.Mono.LLVM.Tools" Version="11.1.0-alpha.1.22171.2">
<Uri>https://github.com/dotnet/llvm-project</Uri>
- <Sha>3808d3fb07c92066ec3d58b6466add62051e1b32</Sha>
+ <Sha>7f00c63a4c31ae647c7fd0525d1dd2a72afb2e9b</Sha>
</Dependency>
- <Dependency Name="Microsoft.NETCore.App.Runtime.win-x64" Version="7.0.0-preview.3.22163.2">
+ <Dependency Name="Microsoft.NETCore.App.Runtime.win-x64" Version="7.0.0-preview.3.22171.1">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>accf6fb6bf18f822fbbd227b1b4e31c65001a4ff</Sha>
+ <Sha>eb51b02b158c3ff71a1ec7eac8a211d1d464c1a5</Sha>
</Dependency>
- <Dependency Name="Microsoft.NETCore.DotNetHost" Version="7.0.0-preview.3.22163.2">
+ <Dependency Name="Microsoft.NETCore.DotNetHost" Version="7.0.0-preview.3.22171.1">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>accf6fb6bf18f822fbbd227b1b4e31c65001a4ff</Sha>
+ <Sha>eb51b02b158c3ff71a1ec7eac8a211d1d464c1a5</Sha>
</Dependency>
- <Dependency Name="Microsoft.NETCore.DotNetHostPolicy" Version="7.0.0-preview.3.22163.2">
+ <Dependency Name="Microsoft.NETCore.DotNetHostPolicy" Version="7.0.0-preview.3.22171.1">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>accf6fb6bf18f822fbbd227b1b4e31c65001a4ff</Sha>
+ <Sha>eb51b02b158c3ff71a1ec7eac8a211d1d464c1a5</Sha>
</Dependency>
- <Dependency Name="runtime.native.System.IO.Ports" Version="7.0.0-preview.3.22163.2">
+ <Dependency Name="runtime.native.System.IO.Ports" Version="7.0.0-preview.3.22171.1">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>accf6fb6bf18f822fbbd227b1b4e31c65001a4ff</Sha>
+ <Sha>eb51b02b158c3ff71a1ec7eac8a211d1d464c1a5</Sha>
</Dependency>
- <Dependency Name="Microsoft.NETCore.ILAsm" Version="7.0.0-preview.3.22163.2">
+ <Dependency Name="Microsoft.NETCore.ILAsm" Version="7.0.0-preview.3.22171.1">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>accf6fb6bf18f822fbbd227b1b4e31c65001a4ff</Sha>
+ <Sha>eb51b02b158c3ff71a1ec7eac8a211d1d464c1a5</Sha>
</Dependency>
- <Dependency Name="Microsoft.NET.Sdk.IL" Version="7.0.0-preview.3.22163.2">
+ <Dependency Name="Microsoft.NET.Sdk.IL" Version="7.0.0-preview.3.22171.1">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>accf6fb6bf18f822fbbd227b1b4e31c65001a4ff</Sha>
+ <Sha>eb51b02b158c3ff71a1ec7eac8a211d1d464c1a5</Sha>
</Dependency>
- <Dependency Name="System.Text.Json" Version="7.0.0-preview.3.22163.2">
+ <Dependency Name="System.Text.Json" Version="7.0.0-preview.3.22171.1">
<Uri>https://github.com/dotnet/runtime</Uri>
- <Sha>accf6fb6bf18f822fbbd227b1b4e31c65001a4ff</Sha>
+ <Sha>eb51b02b158c3ff71a1ec7eac8a211d1d464c1a5</Sha>
</Dependency>
- <Dependency Name="Microsoft.NET.ILLink.Tasks" Version="7.0.100-1.22168.6">
+ <Dependency Name="Microsoft.NET.ILLink.Tasks" Version="7.0.100-1.22173.2">
<Uri>https://github.com/dotnet/linker</Uri>
- <Sha>5929598c16cd5d791eb33d4b5978f3140a136262</Sha>
+ <Sha>04c49c9d7c244d7c73d6dbb438c4885fa72e830b</Sha>
</Dependency>
- <Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Common" Version="1.0.0-prerelease.22164.2">
+ <Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Common" Version="1.0.0-prerelease.22173.1">
<Uri>https://github.com/dotnet/xharness</Uri>
- <Sha>7842fe3b43c21443de152b900fa3640c2893bc1c</Sha>
+ <Sha>c57d7c5ac2fa85f8d44a3549e7d6f553f124915d</Sha>
</Dependency>
- <Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="1.0.0-prerelease.22164.2">
+ <Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="1.0.0-prerelease.22173.1">
<Uri>https://github.com/dotnet/xharness</Uri>
- <Sha>7842fe3b43c21443de152b900fa3640c2893bc1c</Sha>
+ <Sha>c57d7c5ac2fa85f8d44a3549e7d6f553f124915d</Sha>
</Dependency>
- <Dependency Name="Microsoft.DotNet.XHarness.CLI" Version="1.0.0-prerelease.22164.2">
+ <Dependency Name="Microsoft.DotNet.XHarness.CLI" Version="1.0.0-prerelease.22173.1">
<Uri>https://github.com/dotnet/xharness</Uri>
- <Sha>7842fe3b43c21443de152b900fa3640c2893bc1c</Sha>
+ <Sha>c57d7c5ac2fa85f8d44a3549e7d6f553f124915d</Sha>
</Dependency>
- <Dependency Name="Microsoft.DotNet.PackageTesting" Version="7.0.0-beta.22166.1">
+ <Dependency Name="Microsoft.DotNet.PackageTesting" Version="7.0.0-beta.22171.2">
<Uri>https://github.com/dotnet/arcade</Uri>
- <Sha>c90e2d9f3d3e2b471a078f949f2a2fea6af2627d</Sha>
+ <Sha>c8a95297e2622251c125aa5c0ef7c822275a792d</Sha>
</Dependency>
<Dependency Name="optimization.windows_nt-x64.MIBC.Runtime" Version="1.0.0-prerelease.22121.2">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>
@@ -270,13 +270,13 @@
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>
<Sha>a44e13253c25ec42c4700d4d7ba6f84d9751a387</Sha>
</Dependency>
- <Dependency Name="Microsoft.DotNet.HotReload.Utils.Generator.BuildTool" Version="1.0.2-alpha.0.22164.2">
+ <Dependency Name="Microsoft.DotNet.HotReload.Utils.Generator.BuildTool" Version="1.0.2-alpha.0.22171.1">
<Uri>https://github.com/dotnet/hotreload-utils</Uri>
- <Sha>23913614540b029ba7769f0337498acae44fe164</Sha>
+ <Sha>dae38f65a11ae4a481dbb6f289d9a85520b85721</Sha>
</Dependency>
- <Dependency Name="System.Runtime.Numerics.TestData" Version="7.0.0-beta.22166.2">
+ <Dependency Name="System.Runtime.Numerics.TestData" Version="7.0.0-beta.22171.1">
<Uri>https://github.com/dotnet/runtime-assets</Uri>
- <Sha>ffb68be1b7ee2dbf1d5b99caa7c76750cc01a620</Sha>
+ <Sha>26467cf6f83bcbe0993d2205f0ae13fe336b315d</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.NetAnalyzers" Version="7.0.0-preview1.22166.1">
<Uri>https://github.com/dotnet/roslyn-analyzers</Uri>
diff --git a/eng/Versions.props b/eng/Versions.props
index a1fb1fb08fa..60880f942c3 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -46,31 +46,31 @@
<!-- SDK dependencies -->
<MicrosoftDotNetCompatibilityVersion>2.0.0-alpha.1.21525.11</MicrosoftDotNetCompatibilityVersion>
<!-- Arcade dependencies -->
- <MicrosoftDotNetApiCompatVersion>7.0.0-beta.22166.1</MicrosoftDotNetApiCompatVersion>
- <MicrosoftDotNetBuildTasksFeedVersion>7.0.0-beta.22166.1</MicrosoftDotNetBuildTasksFeedVersion>
- <MicrosoftDotNetCodeAnalysisVersion>7.0.0-beta.22166.1</MicrosoftDotNetCodeAnalysisVersion>
- <MicrosoftDotNetGenAPIVersion>7.0.0-beta.22166.1</MicrosoftDotNetGenAPIVersion>
- <MicrosoftDotNetGenFacadesVersion>7.0.0-beta.22166.1</MicrosoftDotNetGenFacadesVersion>
- <MicrosoftDotNetXUnitExtensionsVersion>7.0.0-beta.22166.1</MicrosoftDotNetXUnitExtensionsVersion>
- <MicrosoftDotNetXUnitConsoleRunnerVersion>2.5.1-beta.22166.1</MicrosoftDotNetXUnitConsoleRunnerVersion>
- <MicrosoftDotNetBuildTasksArchivesVersion>7.0.0-beta.22166.1</MicrosoftDotNetBuildTasksArchivesVersion>
- <MicrosoftDotNetBuildTasksInstallersVersion>7.0.0-beta.22166.1</MicrosoftDotNetBuildTasksInstallersVersion>
- <MicrosoftDotNetBuildTasksPackagingVersion>7.0.0-beta.22166.1</MicrosoftDotNetBuildTasksPackagingVersion>
- <MicrosoftDotNetBuildTasksTargetFrameworkVersion>7.0.0-beta.22166.1</MicrosoftDotNetBuildTasksTargetFrameworkVersion>
- <MicrosoftDotNetBuildTasksTemplatingVersion>7.0.0-beta.22166.1</MicrosoftDotNetBuildTasksTemplatingVersion>
- <MicrosoftDotNetBuildTasksWorkloadsPackageVersion>7.0.0-beta.22166.1</MicrosoftDotNetBuildTasksWorkloadsPackageVersion>
- <MicrosoftDotNetRemoteExecutorVersion>7.0.0-beta.22166.1</MicrosoftDotNetRemoteExecutorVersion>
- <MicrosoftDotNetVersionToolsTasksVersion>7.0.0-beta.22166.1</MicrosoftDotNetVersionToolsTasksVersion>
- <MicrosoftDotNetPackageTestingVersion>7.0.0-beta.22166.1</MicrosoftDotNetPackageTestingVersion>
+ <MicrosoftDotNetApiCompatVersion>7.0.0-beta.22171.2</MicrosoftDotNetApiCompatVersion>
+ <MicrosoftDotNetBuildTasksFeedVersion>7.0.0-beta.22171.2</MicrosoftDotNetBuildTasksFeedVersion>
+ <MicrosoftDotNetCodeAnalysisVersion>7.0.0-beta.22171.2</MicrosoftDotNetCodeAnalysisVersion>
+ <MicrosoftDotNetGenAPIVersion>7.0.0-beta.22171.2</MicrosoftDotNetGenAPIVersion>
+ <MicrosoftDotNetGenFacadesVersion>7.0.0-beta.22171.2</MicrosoftDotNetGenFacadesVersion>
+ <MicrosoftDotNetXUnitExtensionsVersion>7.0.0-beta.22171.2</MicrosoftDotNetXUnitExtensionsVersion>
+ <MicrosoftDotNetXUnitConsoleRunnerVersion>2.5.1-beta.22171.2</MicrosoftDotNetXUnitConsoleRunnerVersion>
+ <MicrosoftDotNetBuildTasksArchivesVersion>7.0.0-beta.22171.2</MicrosoftDotNetBuildTasksArchivesVersion>
+ <MicrosoftDotNetBuildTasksInstallersVersion>7.0.0-beta.22171.2</MicrosoftDotNetBuildTasksInstallersVersion>
+ <MicrosoftDotNetBuildTasksPackagingVersion>7.0.0-beta.22171.2</MicrosoftDotNetBuildTasksPackagingVersion>
+ <MicrosoftDotNetBuildTasksTargetFrameworkVersion>7.0.0-beta.22171.2</MicrosoftDotNetBuildTasksTargetFrameworkVersion>
+ <MicrosoftDotNetBuildTasksTemplatingVersion>7.0.0-beta.22171.2</MicrosoftDotNetBuildTasksTemplatingVersion>
+ <MicrosoftDotNetBuildTasksWorkloadsPackageVersion>7.0.0-beta.22171.2</MicrosoftDotNetBuildTasksWorkloadsPackageVersion>
+ <MicrosoftDotNetRemoteExecutorVersion>7.0.0-beta.22171.2</MicrosoftDotNetRemoteExecutorVersion>
+ <MicrosoftDotNetVersionToolsTasksVersion>7.0.0-beta.22171.2</MicrosoftDotNetVersionToolsTasksVersion>
+ <MicrosoftDotNetPackageTestingVersion>7.0.0-beta.22171.2</MicrosoftDotNetPackageTestingVersion>
<!-- NuGet dependencies -->
<NuGetBuildTasksPackVersion>6.0.0-preview.1.102</NuGetBuildTasksPackVersion>
<!-- Installer dependencies -->
- <MicrosoftNETCoreAppRuntimewinx64Version>7.0.0-preview.3.22163.2</MicrosoftNETCoreAppRuntimewinx64Version>
- <MicrosoftNETCoreDotNetHostVersion>7.0.0-preview.3.22163.2</MicrosoftNETCoreDotNetHostVersion>
- <MicrosoftNETCoreDotNetHostPolicyVersion>7.0.0-preview.3.22163.2</MicrosoftNETCoreDotNetHostPolicyVersion>
+ <MicrosoftNETCoreAppRuntimewinx64Version>7.0.0-preview.3.22171.1</MicrosoftNETCoreAppRuntimewinx64Version>
+ <MicrosoftNETCoreDotNetHostVersion>7.0.0-preview.3.22171.1</MicrosoftNETCoreDotNetHostVersion>
+ <MicrosoftNETCoreDotNetHostPolicyVersion>7.0.0-preview.3.22171.1</MicrosoftNETCoreDotNetHostPolicyVersion>
<MicrosoftExtensionsDependencyModelVersion>3.1.0</MicrosoftExtensionsDependencyModelVersion>
<!-- CoreClr dependencies -->
- <MicrosoftNETCoreILAsmVersion>7.0.0-preview.3.22163.2</MicrosoftNETCoreILAsmVersion>
+ <MicrosoftNETCoreILAsmVersion>7.0.0-preview.3.22171.1</MicrosoftNETCoreILAsmVersion>
<runtimelinuxarm64MicrosoftNETCoreRuntimeObjWriterVersion>1.0.0-alpha.1.22157.1</runtimelinuxarm64MicrosoftNETCoreRuntimeObjWriterVersion>
<runtimelinuxx64MicrosoftNETCoreRuntimeObjWriterVersion>1.0.0-alpha.1.22157.1</runtimelinuxx64MicrosoftNETCoreRuntimeObjWriterVersion>
<runtimelinuxmuslarm64MicrosoftNETCoreRuntimeObjWriterVersion>1.0.0-alpha.1.22157.1</runtimelinuxmuslarm64MicrosoftNETCoreRuntimeObjWriterVersion>
@@ -113,24 +113,24 @@
<SystemSecurityCryptographyOpenSslVersion>5.0.0</SystemSecurityCryptographyOpenSslVersion>
<SystemSecurityPrincipalWindowsVersion>5.0.0</SystemSecurityPrincipalWindowsVersion>
<SystemServiceModelPrimitivesVersion>4.9.0</SystemServiceModelPrimitivesVersion>
- <SystemTextJsonVersion>7.0.0-preview.3.22163.2</SystemTextJsonVersion>
+ <SystemTextJsonVersion>7.0.0-preview.3.22171.1</SystemTextJsonVersion>
<SystemRuntimeCompilerServicesUnsafeVersion>6.0.0</SystemRuntimeCompilerServicesUnsafeVersion>
<SystemThreadingTasksExtensionsVersion>4.5.4</SystemThreadingTasksExtensionsVersion>
<SystemValueTupleVersion>4.5.0</SystemValueTupleVersion>
- <runtimenativeSystemIOPortsVersion>7.0.0-preview.3.22163.2</runtimenativeSystemIOPortsVersion>
+ <runtimenativeSystemIOPortsVersion>7.0.0-preview.3.22171.1</runtimenativeSystemIOPortsVersion>
<!-- Runtime-Assets dependencies -->
- <SystemRuntimeNumericsTestDataVersion>7.0.0-beta.22166.2</SystemRuntimeNumericsTestDataVersion>
- <SystemComponentModelTypeConverterTestDataVersion>7.0.0-beta.22166.2</SystemComponentModelTypeConverterTestDataVersion>
- <SystemDrawingCommonTestDataVersion>7.0.0-beta.22166.2</SystemDrawingCommonTestDataVersion>
- <SystemIOCompressionTestDataVersion>7.0.0-beta.22166.2</SystemIOCompressionTestDataVersion>
- <SystemIOPackagingTestDataVersion>7.0.0-beta.22166.2</SystemIOPackagingTestDataVersion>
- <SystemNetTestDataVersion>7.0.0-beta.22166.2</SystemNetTestDataVersion>
- <SystemPrivateRuntimeUnicodeDataVersion>7.0.0-beta.22166.2</SystemPrivateRuntimeUnicodeDataVersion>
- <SystemRuntimeTimeZoneDataVersion>7.0.0-beta.22166.2</SystemRuntimeTimeZoneDataVersion>
- <SystemSecurityCryptographyX509CertificatesTestDataVersion>7.0.0-beta.22166.2</SystemSecurityCryptographyX509CertificatesTestDataVersion>
- <SystemTextRegularExpressionsTestDataVersion>7.0.0-beta.22166.2</SystemTextRegularExpressionsTestDataVersion>
- <SystemWindowsExtensionsTestDataVersion>7.0.0-beta.22166.2</SystemWindowsExtensionsTestDataVersion>
- <MicrosoftDotNetCilStripSourcesVersion>7.0.0-beta.22166.2</MicrosoftDotNetCilStripSourcesVersion>
+ <SystemRuntimeNumericsTestDataVersion>7.0.0-beta.22171.1</SystemRuntimeNumericsTestDataVersion>
+ <SystemComponentModelTypeConverterTestDataVersion>7.0.0-beta.22171.1</SystemComponentModelTypeConverterTestDataVersion>
+ <SystemDrawingCommonTestDataVersion>7.0.0-beta.22171.1</SystemDrawingCommonTestDataVersion>
+ <SystemIOCompressionTestDataVersion>7.0.0-beta.22171.1</SystemIOCompressionTestDataVersion>
+ <SystemIOPackagingTestDataVersion>7.0.0-beta.22171.1</SystemIOPackagingTestDataVersion>
+ <SystemNetTestDataVersion>7.0.0-beta.22171.1</SystemNetTestDataVersion>
+ <SystemPrivateRuntimeUnicodeDataVersion>7.0.0-beta.22171.1</SystemPrivateRuntimeUnicodeDataVersion>
+ <SystemRuntimeTimeZoneDataVersion>7.0.0-beta.22171.1</SystemRuntimeTimeZoneDataVersion>
+ <SystemSecurityCryptographyX509CertificatesTestDataVersion>7.0.0-beta.22171.1</SystemSecurityCryptographyX509CertificatesTestDataVersion>
+ <SystemTextRegularExpressionsTestDataVersion>7.0.0-beta.22171.1</SystemTextRegularExpressionsTestDataVersion>
+ <SystemWindowsExtensionsTestDataVersion>7.0.0-beta.22171.1</SystemWindowsExtensionsTestDataVersion>
+ <MicrosoftDotNetCilStripSourcesVersion>7.0.0-beta.22171.1</MicrosoftDotNetCilStripSourcesVersion>
<!-- dotnet-optimization dependencies -->
<optimizationwindows_ntx64MIBCRuntimeVersion>1.0.0-prerelease.22121.2</optimizationwindows_ntx64MIBCRuntimeVersion>
<optimizationwindows_ntx86MIBCRuntimeVersion>1.0.0-prerelease.22121.2</optimizationwindows_ntx86MIBCRuntimeVersion>
@@ -151,10 +151,10 @@
<!-- Testing -->
<MicrosoftNETCoreCoreDisToolsVersion>1.1.0</MicrosoftNETCoreCoreDisToolsVersion>
<MicrosoftNETTestSdkVersion>16.9.0-preview-20201201-01</MicrosoftNETTestSdkVersion>
- <MicrosoftDotNetXHarnessTestRunnersCommonVersion>1.0.0-prerelease.22164.2</MicrosoftDotNetXHarnessTestRunnersCommonVersion>
- <MicrosoftDotNetXHarnessTestRunnersXunitVersion>1.0.0-prerelease.22164.2</MicrosoftDotNetXHarnessTestRunnersXunitVersion>
- <MicrosoftDotNetXHarnessCLIVersion>1.0.0-prerelease.22164.2</MicrosoftDotNetXHarnessCLIVersion>
- <MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>1.0.2-alpha.0.22164.2</MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>
+ <MicrosoftDotNetXHarnessTestRunnersCommonVersion>1.0.0-prerelease.22173.1</MicrosoftDotNetXHarnessTestRunnersCommonVersion>
+ <MicrosoftDotNetXHarnessTestRunnersXunitVersion>1.0.0-prerelease.22173.1</MicrosoftDotNetXHarnessTestRunnersXunitVersion>
+ <MicrosoftDotNetXHarnessCLIVersion>1.0.0-prerelease.22173.1</MicrosoftDotNetXHarnessCLIVersion>
+ <MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>1.0.2-alpha.0.22171.1</MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>
<XUnitVersion>2.4.2-pre.22</XUnitVersion>
<XUnitAnalyzersVersion>0.12.0-pre.20</XUnitAnalyzersVersion>
<XUnitRunnerVisualStudioVersion>2.4.2</XUnitRunnerVisualStudioVersion>
@@ -168,23 +168,23 @@
<!-- Docs -->
<MicrosoftPrivateIntellisenseVersion>7.0.0-preview-20220316.2</MicrosoftPrivateIntellisenseVersion>
<!-- ILLink -->
- <MicrosoftNETILLinkTasksVersion>7.0.100-1.22168.6</MicrosoftNETILLinkTasksVersion>
+ <MicrosoftNETILLinkTasksVersion>7.0.100-1.22173.2</MicrosoftNETILLinkTasksVersion>
<MicrosoftNETILLinkAnalyzerPackageVersion>$(MicrosoftNETILLinkTasksVersion)</MicrosoftNETILLinkAnalyzerPackageVersion>
<!-- ICU -->
- <MicrosoftNETCoreRuntimeICUTransportVersion>7.0.0-preview.3.22121.1</MicrosoftNETCoreRuntimeICUTransportVersion>
+ <MicrosoftNETCoreRuntimeICUTransportVersion>7.0.0-preview.4.22172.1</MicrosoftNETCoreRuntimeICUTransportVersion>
<!-- MsQuic -->
- <SystemNetMsQuicTransportVersion>7.0.0-alpha.1.22160.2</SystemNetMsQuicTransportVersion>
+ <SystemNetMsQuicTransportVersion>7.0.0-alpha.1.22173.2</SystemNetMsQuicTransportVersion>
<!-- Mono LLVM -->
- <runtimelinuxarm64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion>11.1.0-alpha.1.22164.2</runtimelinuxarm64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion>
- <runtimelinuxarm64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion>11.1.0-alpha.1.22164.2</runtimelinuxarm64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion>
- <runtimelinuxx64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion>11.1.0-alpha.1.22164.2</runtimelinuxx64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion>
- <runtimelinuxx64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion>11.1.0-alpha.1.22164.2</runtimelinuxx64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion>
- <runtimewinx64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion>11.1.0-alpha.1.22164.2</runtimewinx64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion>
- <runtimewinx64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion>11.1.0-alpha.1.22164.2</runtimewinx64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion>
- <runtimeosx1012x64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion>11.1.0-alpha.1.22164.2</runtimeosx1012x64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion>
- <runtimeosx1012x64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion>11.1.0-alpha.1.22164.2</runtimeosx1012x64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion>
+ <runtimelinuxarm64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion>11.1.0-alpha.1.22171.2</runtimelinuxarm64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion>
+ <runtimelinuxarm64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion>11.1.0-alpha.1.22171.2</runtimelinuxarm64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion>
+ <runtimelinuxx64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion>11.1.0-alpha.1.22171.2</runtimelinuxx64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion>
+ <runtimelinuxx64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion>11.1.0-alpha.1.22171.2</runtimelinuxx64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion>
+ <runtimewinx64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion>11.1.0-alpha.1.22171.2</runtimewinx64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion>
+ <runtimewinx64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion>11.1.0-alpha.1.22171.2</runtimewinx64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion>
+ <runtimeosx1012x64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion>11.1.0-alpha.1.22171.2</runtimeosx1012x64MicrosoftNETCoreRuntimeMonoLLVMSdkVersion>
+ <runtimeosx1012x64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion>11.1.0-alpha.1.22171.2</runtimeosx1012x64MicrosoftNETCoreRuntimeMonoLLVMToolsVersion>
<!-- emscripten / Node -->
- <MicrosoftNETWorkloadEmscriptenManifest70100Version>7.0.0-preview.3.22121.1</MicrosoftNETWorkloadEmscriptenManifest70100Version>
+ <MicrosoftNETWorkloadEmscriptenManifest70100Version>7.0.0-preview.4.22172.1</MicrosoftNETWorkloadEmscriptenManifest70100Version>
<MicrosoftNETRuntimeEmscriptenVersion>$(MicrosoftNETWorkloadEmscriptenManifest70100Version)</MicrosoftNETRuntimeEmscriptenVersion>
<!-- workloads -->
<SwixPackageVersion>1.1.87-gba258badda</SwixPackageVersion>
diff --git a/eng/pipelines/common/templates/runtimes/run-test-job.yml b/eng/pipelines/common/templates/runtimes/run-test-job.yml
index f048888e17c..544e6c9ed29 100644
--- a/eng/pipelines/common/templates/runtimes/run-test-job.yml
+++ b/eng/pipelines/common/templates/runtimes/run-test-job.yml
@@ -293,7 +293,7 @@ jobs:
# Generate test wrappers. This is the step that examines issues.targets to exclude tests.
- - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) buildtestwrappersonly $(logRootNameArg)Wrappers $(runtimeFlavorArgs) $(runtimeVariantArg) $(crossgenArg) $(buildConfig) $(archType) $(crossArg) $(priorityArg) $(librariesOverrideArg)
+ - script: $(Build.SourcesDirectory)/src/tests/build$(scriptExt) buildtestwrappersonly $(logRootNameArg)Wrappers $(runtimeFlavorArgs) $(crossgenArg) $(buildConfig) $(archType) $(crossArg) $(priorityArg) $(librariesOverrideArg) $(runtimeVariantArg)
displayName: Generate test wrappers
diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml
index d69b0df7de6..2238f0c0482 100644
--- a/eng/pipelines/runtime.yml
+++ b/eng/pipelines/runtime.yml
@@ -940,6 +940,7 @@ jobs:
runtimeFlavor: mono
platforms:
- OSX_x64
+ - windows_x64
helixQueueGroup: pr
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
jobParameters:
diff --git a/global.json b/global.json
index f2f5dec650d..627391a999d 100644
--- a/global.json
+++ b/global.json
@@ -8,11 +8,11 @@
"dotnet": "6.0.100"
},
"msbuild-sdks": {
- "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22166.1",
- "Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.22166.1",
- "Microsoft.DotNet.SharedFramework.Sdk": "7.0.0-beta.22166.1",
+ "Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.22171.2",
+ "Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.22171.2",
+ "Microsoft.DotNet.SharedFramework.Sdk": "7.0.0-beta.22171.2",
"Microsoft.Build.NoTargets": "3.3.0",
"Microsoft.Build.Traversal": "3.1.6",
- "Microsoft.NET.Sdk.IL": "7.0.0-preview.3.22163.2"
+ "Microsoft.NET.Sdk.IL": "7.0.0-preview.3.22171.1"
}
}
diff --git a/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs
index 56589cf6b79..79ecdefc60c 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs
@@ -1252,20 +1252,30 @@ namespace System
Dictionary<string, List<RuntimePropertyInfo>>? csPropertyInfos = filter.CaseSensitive() ? null :
new Dictionary<string, List<RuntimePropertyInfo>>();
- // All elements automatically initialized to false.
- bool[] usedSlots = new bool[RuntimeTypeHandle.GetNumVirtuals(declaringType)];
+ // All elements initialized to false.
+ int numVirtuals = RuntimeTypeHandle.GetNumVirtuals(declaringType);
+ Span<bool> usedSlots = stackalloc bool[0];
+ if (numVirtuals <= 128) // arbitrary stack limit
+ {
+ usedSlots = stackalloc bool[numVirtuals];
+ usedSlots.Clear();
+ }
+ else
+ {
+ usedSlots = new bool[numVirtuals];
+ }
// Populate associates off of the class hierarchy
do
{
- PopulateProperties(filter, declaringType, csPropertyInfos, usedSlots, ref list);
+ PopulateProperties(filter, declaringType, csPropertyInfos, usedSlots, isInterface: false, ref list);
declaringType = RuntimeTypeHandle.GetBaseType(declaringType);
} while (declaringType != null);
}
else
{
// Populate associates for this interface
- PopulateProperties(filter, declaringType, null, null, ref list);
+ PopulateProperties(filter, declaringType, null, default, isInterface: true, ref list);
}
return list.ToArray();
@@ -1275,7 +1285,8 @@ namespace System
Filter filter,
RuntimeType declaringType,
Dictionary<string, List<RuntimePropertyInfo>>? csPropertyInfos,
- bool[]? usedSlots,
+ Span<bool> usedSlots,
+ bool isInterface,
ref ListBuilder<RuntimePropertyInfo> list)
{
int tkDeclaringType = RuntimeTypeHandle.GetToken(declaringType);
@@ -1290,8 +1301,8 @@ namespace System
int numVirtuals = RuntimeTypeHandle.GetNumVirtuals(declaringType);
- Debug.Assert((declaringType.IsInterface && usedSlots == null && csPropertyInfos == null) ||
- (!declaringType.IsInterface && usedSlots != null && usedSlots.Length >= numVirtuals));
+ Debug.Assert((declaringType.IsInterface && isInterface && csPropertyInfos == null) ||
+ (!declaringType.IsInterface && !isInterface && usedSlots.Length >= numVirtuals));
for (int i = 0; i < tkProperties.Length; i++)
{
@@ -1313,7 +1324,7 @@ namespace System
tkProperty, declaringType, m_runtimeTypeCache, out bool isPrivate);
// If this is a class, not an interface
- if (usedSlots != null)
+ if (!isInterface)
{
#region Remove Privates
if (declaringType != ReflectedType && isPrivate)
diff --git a/src/coreclr/jit/loopcloning.cpp b/src/coreclr/jit/loopcloning.cpp
index ab68249fd4c..3402a3e961e 100644
--- a/src/coreclr/jit/loopcloning.cpp
+++ b/src/coreclr/jit/loopcloning.cpp
@@ -1904,13 +1904,14 @@ void Compiler::optCloneLoop(unsigned loopInd, LoopCloneContext* context)
// so that "h" already falls through to "e" (e == t).
// It might look like this code is unreachable, since "h" must be a BBJ_ALWAYS, but
// later we will change "h" to a BBJ_COND along with a set of loop conditions.
- // TODO: it still might be unreachable, since cloning currently is restricted to "do-while" loop forms.
+ // Cloning is currently restricted to "do-while" loop forms, where this case won't occur.
+ // However, it can occur in OSR methods.
BasicBlock* h2 = nullptr;
if (h->bbNext != loop.lpEntry)
{
assert(h->bbJumpKind == BBJ_ALWAYS);
JITDUMP("Create branch to entry of optimized loop\n");
- BasicBlock* h2 = fgNewBBafter(BBJ_ALWAYS, h, /*extendRegion*/ true);
+ h2 = fgNewBBafter(BBJ_ALWAYS, h, /*extendRegion*/ true);
JITDUMP("Adding " FMT_BB " after " FMT_BB "\n", h2->bbNum, h->bbNum);
h2->bbWeight = h2->isRunRarely() ? BB_ZERO_WEIGHT : ambientWeight;
diff --git a/src/coreclr/jit/optimizer.cpp b/src/coreclr/jit/optimizer.cpp
index fe8a092a191..8815d1ae404 100644
--- a/src/coreclr/jit/optimizer.cpp
+++ b/src/coreclr/jit/optimizer.cpp
@@ -3023,12 +3023,23 @@ bool Compiler::optLoopContains(unsigned l1, unsigned l2) const
}
}
+//-----------------------------------------------------------------------------
+// optUpdateLoopHead: Replace the `head` block of a loop in the loop table.
+// Considers all child loops that might share the same head (recursively).
+//
+// Arguments:
+// loopInd -- loop num of loop
+// from -- current loop head block
+// to -- replacement loop head block
+//
void Compiler::optUpdateLoopHead(unsigned loopInd, BasicBlock* from, BasicBlock* to)
{
assert(optLoopTable[loopInd].lpHead == from);
+ JITDUMP("Replace " FMT_LP " head " FMT_BB " with " FMT_BB "\n", loopInd, from->bbNum, to->bbNum);
optLoopTable[loopInd].lpHead = to;
- for (unsigned char childLoop = optLoopTable[loopInd].lpChild; childLoop != BasicBlock::NOT_IN_LOOP;
- childLoop = optLoopTable[childLoop].lpSibling)
+ for (unsigned char childLoop = optLoopTable[loopInd].lpChild; //
+ childLoop != BasicBlock::NOT_IN_LOOP; //
+ childLoop = optLoopTable[childLoop].lpSibling)
{
if (optLoopTable[childLoop].lpHead == from)
{
diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/SecuritySafeHandles.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/SecuritySafeHandles.cs
index e0128ab0b99..3c5bbe53216 100644
--- a/src/libraries/Common/src/Interop/Windows/SspiCli/SecuritySafeHandles.cs
+++ b/src/libraries/Common/src/Interop/Windows/SspiCli/SecuritySafeHandles.cs
@@ -171,11 +171,13 @@ namespace System.Net.Security
{
#endif
+ internal DateTime _expiry;
internal Interop.SspiCli.CredHandle _handle; //should be always used as by ref in PInvokes parameters
protected SafeFreeCredentials() : base(IntPtr.Zero, true)
{
_handle = default;
+ _expiry = DateTime.MaxValue;
}
public override bool IsInvalid
@@ -183,6 +185,8 @@ namespace System.Net.Security
get { return IsClosed || _handle.IsZero; }
}
+ public DateTime Expiry => _expiry;
+
#if DEBUG
public new IntPtr DangerousGetHandle()
{
diff --git a/src/libraries/Common/src/System/Net/Security/Unix/SafeFreeCredentials.cs b/src/libraries/Common/src/System/Net/Security/Unix/SafeFreeCredentials.cs
index 7d26be95ab9..c2e0e0226ea 100644
--- a/src/libraries/Common/src/System/Net/Security/Unix/SafeFreeCredentials.cs
+++ b/src/libraries/Common/src/System/Net/Security/Unix/SafeFreeCredentials.cs
@@ -1,6 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+using System;
using System.Diagnostics;
using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices;
@@ -18,8 +19,13 @@ namespace System.Net.Security
internal abstract class SafeFreeCredentials : SafeHandle
{
#endif
+ internal DateTime _expiry;
+
+ public DateTime Expiry => _expiry;
+
protected SafeFreeCredentials(IntPtr handle, bool ownsHandle) : base(handle, ownsHandle)
{
+ _expiry = DateTime.MaxValue;
}
}
diff --git a/src/libraries/Microsoft.Extensions.Caching.Memory/src/MemoryCache.cs b/src/libraries/Microsoft.Extensions.Caching.Memory/src/MemoryCache.cs
index 7383ecf6324..182cea820b0 100644
--- a/src/libraries/Microsoft.Extensions.Caching.Memory/src/MemoryCache.cs
+++ b/src/libraries/Microsoft.Extensions.Caching.Memory/src/MemoryCache.cs
@@ -46,7 +46,7 @@ namespace Microsoft.Extensions.Caching.Memory
_options = optionsAccessor.Value;
_logger = loggerFactory.CreateLogger<MemoryCache>();
- _coherentState = new();
+ _coherentState = new CoherentState();
if (_options.Clock == null)
{
diff --git a/src/libraries/Microsoft.Extensions.Logging.EventSource/src/EventSourceLogger.cs b/src/libraries/Microsoft.Extensions.Logging.EventSource/src/EventSourceLogger.cs
index 66c920f9094..0794064b1a0 100644
--- a/src/libraries/Microsoft.Extensions.Logging.EventSource/src/EventSourceLogger.cs
+++ b/src/libraries/Microsoft.Extensions.Logging.EventSource/src/EventSourceLogger.cs
@@ -117,7 +117,7 @@ namespace Microsoft.Extensions.Logging.EventSource
}
}
- public IDisposable BeginScope<TState>(TState state)
+ public IDisposable BeginScope<TState>(TState state) where TState : notnull
{
if (!IsEnabled(LogLevel.Critical))
{
diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/LegacyPropagator.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/LegacyPropagator.cs
index 9a3c909bb17..3e24a95d376 100644
--- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/LegacyPropagator.cs
+++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/LegacyPropagator.cs
@@ -165,7 +165,7 @@ namespace System.Diagnostics
if (keyStart < keyEnd && valueStart < currentIndex)
{
- baggageList ??= new();
+ baggageList ??= new List<KeyValuePair<string, string?>>();
// Insert in reverse order for asp.net compatability.
baggageList.Insert(0, new KeyValuePair<string, string?>(
diff --git a/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Winspool.cs b/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Winspool.cs
index 5d059b69845..6623b0f888a 100644
--- a/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Winspool.cs
+++ b/src/libraries/System.Drawing.Common/src/Interop/Windows/Interop.Winspool.cs
@@ -40,7 +40,7 @@ internal static partial class Interop
#endif
HandleRef hPrinter, string pDeviceName, IntPtr /*DEVMODE*/ pDevModeOutput, IntPtr /*DEVMODE*/ pDevModeInput, int fMode);
- [LibraryImport(Libraries.Winspool, SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [LibraryImport(Libraries.Winspool, EntryPoint = "EnumPrintersW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
internal static partial int EnumPrinters(int flags, string? name, int level, IntPtr pPrinterEnum/*buffer*/, int cbBuf, out int pcbNeeded, out int pcReturned);
}
}
diff --git a/src/libraries/System.Drawing.Common/tests/System/Drawing/ImageAnimator.ManualTests.cs b/src/libraries/System.Drawing.Common/tests/System/Drawing/ImageAnimator.ManualTests.cs
index 84d9da6d2c1..a7abefdcb39 100644
--- a/src/libraries/System.Drawing.Common/tests/System/Drawing/ImageAnimator.ManualTests.cs
+++ b/src/libraries/System.Drawing.Common/tests/System/Drawing/ImageAnimator.ManualTests.cs
@@ -70,7 +70,7 @@ namespace System.Drawing.Tests
animation.Save(Path.Combine(testOutputFolder, $"{++frameIndexes[imageName]}_{timestamp}.jpg"), ImageFormat.Jpeg);
}));
- bitmaps[imageName] = new(Helpers.GetTestBitmapPath(imageName));
+ bitmaps[imageName] = new Bitmap(Helpers.GetTestBitmapPath(imageName));
ImageAnimator.Animate(bitmaps[imageName], handlers[imageName]);
}
diff --git a/src/libraries/System.IO.Packaging/src/System/IO/Packaging/ContentType.cs b/src/libraries/System.IO.Packaging/src/System/IO/Packaging/ContentType.cs
index d01c3db01a5..362242c6896 100644
--- a/src/libraries/System.IO.Packaging/src/System/IO/Packaging/ContentType.cs
+++ b/src/libraries/System.IO.Packaging/src/System/IO/Packaging/ContentType.cs
@@ -139,7 +139,7 @@ namespace System.IO.Packaging
/// This will return an enumerator over a dictionary of the parameter/value pairs.
/// </summary>
internal Dictionary<string, string>.Enumerator ParameterValuePairs =>
- (_parameterDictionary ??= new()).GetEnumerator();
+ (_parameterDictionary ??= new Dictionary<string, string>()).GetEnumerator();
#endregion Internal Properties
#region Internal Methods
@@ -330,7 +330,7 @@ namespace System.IO.Packaging
//Get length of the parameter value
int parameterValueLength = GetLengthOfParameterValue(parameterAndValue, parameterStartIndex);
- (_parameterDictionary ??= new()).Add(
+ (_parameterDictionary ??= new Dictionary<string, string>()).Add(
ValidateToken(parameterAndValue.Slice(0, equalSignIndex).ToString()),
ValidateQuotedStringOrToken(parameterAndValue.Slice(parameterStartIndex, parameterValueLength).ToString()));
diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Interop/MsQuicNativeMethods.cs b/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Interop/MsQuicNativeMethods.cs
index f19e664fa21..1327c5a1030 100644
--- a/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Interop/MsQuicNativeMethods.cs
+++ b/src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/Interop/MsQuicNativeMethods.cs
@@ -841,7 +841,7 @@ namespace System.Net.Quic.Implementations.MsQuic.Internal
//
handle.DangerousAddRef(ref handle__addRefd);
IntPtr __handle_gen_native = handle.DangerousGetHandle();
- __del_gen_native__marshaller = new(del);
+ __del_gen_native__marshaller = new AnyDelegateMarshaller(del);
IntPtr __del_gen_native = __del_gen_native__marshaller.Value;
((delegate* unmanaged[Cdecl]<IntPtr, IntPtr, IntPtr, void>)_functionPointer)(__handle_gen_native, __del_gen_native, context);
}
@@ -929,7 +929,7 @@ namespace System.Net.Quic.Implementations.MsQuic.Internal
//
// Marshal
//
- __config_gen_native = new(config);
+ __config_gen_native = new RegistrationConfig.Native(config);
__retVal = ((delegate* unmanaged[Cdecl]<RegistrationConfig.Native*, IntPtr*, uint>)_functionPointer)(&__config_gen_native, &__registrationContext_gen_native);
__invokeSucceeded = true;
//
@@ -1017,7 +1017,7 @@ namespace System.Net.Quic.Implementations.MsQuic.Internal
//
configuration.DangerousAddRef(ref configuration__addRefd);
IntPtr __configuration_gen_native = configuration.DangerousGetHandle();
- __credConfig_gen_native = new(credConfig);
+ __credConfig_gen_native = new CredentialConfig.Native(credConfig);
__retVal = ((delegate* unmanaged[Cdecl]<IntPtr, CredentialConfig.Native*, uint>)_functionPointer)(__configuration_gen_native, &__credConfig_gen_native);
//
// Unmarshal
diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/SecureChannel.cs b/src/libraries/System.Net.Security/src/System/Net/Security/SecureChannel.cs
index c9b67dda132..fbf29e0364c 100644
--- a/src/libraries/System.Net.Security/src/System/Net/Security/SecureChannel.cs
+++ b/src/libraries/System.Net.Security/src/System/Net/Security/SecureChannel.cs
@@ -171,8 +171,8 @@ namespace System.Net.Security
{
if (!_remoteCertificateExposed)
{
- _remoteCertificate?.Dispose();
- _remoteCertificate = null;
+ _remoteCertificate?.Dispose();
+ _remoteCertificate = null;
}
_securityContext?.Dispose();
@@ -607,9 +607,7 @@ namespace System.Net.Security
_sslAuthenticationOptions.CertificateContext = SslStreamCertificateContext.Create(selectedCert!);
}
- _credentialsHandle = SslStreamPal.AcquireCredentialsHandle(_sslAuthenticationOptions.CertificateContext,
- _sslAuthenticationOptions.EnabledSslProtocols, _sslAuthenticationOptions.EncryptionPolicy, _sslAuthenticationOptions.IsServer);
-
+ _credentialsHandle = AcquireCredentialsHandle(_sslAuthenticationOptions);
thumbPrint = guessedThumbPrint; // Delay until here in case something above threw.
}
}
@@ -713,14 +711,65 @@ namespace System.Net.Security
}
else
{
- _credentialsHandle = SslStreamPal.AcquireCredentialsHandle(_sslAuthenticationOptions.CertificateContext, _sslAuthenticationOptions.EnabledSslProtocols,
- _sslAuthenticationOptions.EncryptionPolicy, _sslAuthenticationOptions.IsServer);
+ _credentialsHandle = AcquireCredentialsHandle(_sslAuthenticationOptions);
thumbPrint = guessedThumbPrint;
}
return cachedCred;
}
+ private static SafeFreeCredentials AcquireCredentialsHandle(SslAuthenticationOptions sslAuthenticationOptions)
+ {
+ SafeFreeCredentials cred = SslStreamPal.AcquireCredentialsHandle(sslAuthenticationOptions.CertificateContext, sslAuthenticationOptions.EnabledSslProtocols,
+ sslAuthenticationOptions.EncryptionPolicy, sslAuthenticationOptions.IsServer);
+
+ if (sslAuthenticationOptions.CertificateContext != null)
+ {
+ //
+ // Since the SafeFreeCredentials can be cached and reused, it may happen on long running processes that some cert on
+ // the chain expires and all subsequent connections would send expired intermediate certificates. Find the earliest
+ // NotAfter timestamp on the chain and use it as expiration timestamp for the credentials.
+ // This provides an opportunity to recreate the credentials with an alternative (and still valid)
+ // certificate chain.
+ //
+ SslStreamCertificateContext certificateContext = sslAuthenticationOptions.CertificateContext;
+ cred._expiry = GetExpiryTimestamp(certificateContext);
+
+ if (cred._expiry < DateTime.UtcNow)
+ {
+ //
+ // The CertificateContext from auth options is recreated just before creating the SafeFreeCredentials. However, in case when
+ // it was provided by the user code, it may still contain the (now expired) certificate chain. Such expiration timestamp would
+ // effectively disable caching as it would lead to creating new credentials for each connection. We attempt to recover by creating
+ // a temporary certificate context (which builds a new chain with hopefully more recent chain).
+ //
+ certificateContext = SslStreamCertificateContext.Create(
+ certificateContext.Certificate,
+ new X509Certificate2Collection(certificateContext.IntermediateCertificates),
+ trust: certificateContext.Trust);
+
+ cred._expiry = GetExpiryTimestamp(certificateContext);
+ }
+
+ static DateTime GetExpiryTimestamp(SslStreamCertificateContext certificateContext)
+ {
+ DateTime expiry = certificateContext.Certificate.NotAfter;
+
+ foreach (X509Certificate2 cert in certificateContext.IntermediateCertificates)
+ {
+ if (cert.NotAfter < expiry)
+ {
+ expiry = cert.NotAfter;
+ }
+ }
+
+ return expiry.ToUniversalTime();
+ }
+ }
+
+ return cred;
+ }
+
//
internal ProtocolToken NextMessage(ReadOnlySpan<byte> incomingBuffer)
{
diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/SslSessionsCache.cs b/src/libraries/System.Net.Security/src/System/Net/Security/SslSessionsCache.cs
index f7b730c102c..59009e72b4c 100644
--- a/src/libraries/System.Net.Security/src/System/Net/Security/SslSessionsCache.cs
+++ b/src/libraries/System.Net.Security/src/System/Net/Security/SslSessionsCache.cs
@@ -134,9 +134,9 @@ namespace System.Net.Security
//SafeCredentialReference? cached;
SafeFreeCredentials? credentials = GetCachedCredential(key);
- if (credentials == null || credentials.IsClosed || credentials.IsInvalid)
+ if (credentials == null || credentials.IsClosed || credentials.IsInvalid || credentials.Expiry < DateTime.UtcNow)
{
- if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(null, $"Not found or invalid, Current Cache Coun = {s_cachedCreds.Count}");
+ if (NetEventSource.Log.IsEnabled()) NetEventSource.Info(null, $"Not found or invalid, Current Cache Count = {s_cachedCreds.Count}");
return null;
}
@@ -169,12 +169,13 @@ namespace System.Net.Security
SafeFreeCredentials? credentials = GetCachedCredential(key);
- if (credentials == null || credentials.IsClosed || credentials.IsInvalid)
+ DateTime utcNow = DateTime.UtcNow;
+ if (credentials == null || credentials.IsClosed || credentials.IsInvalid || credentials.Expiry < utcNow)
{
lock (s_cachedCreds)
{
credentials = GetCachedCredential(key);
- if (credentials == null || credentials.IsClosed || credentials.IsInvalid)
+ if (credentials == null || credentials.IsClosed || credentials.IsInvalid || credentials.Expiry < utcNow)
{
SafeCredentialReference? cached = SafeCredentialReference.CreateReference(creds);
diff --git a/src/libraries/System.Net.WebSockets/tests/WebSocketDeflateTests.cs b/src/libraries/System.Net.WebSockets/tests/WebSocketDeflateTests.cs
index 184c7e9089e..03ae5981c9b 100644
--- a/src/libraries/System.Net.WebSockets/tests/WebSocketDeflateTests.cs
+++ b/src/libraries/System.Net.WebSockets/tests/WebSocketDeflateTests.cs
@@ -44,7 +44,7 @@ namespace System.Net.WebSockets.Tests
stream.Enqueue(0xc1, 0x07, 0xf2, 0x48, 0xcd, 0xc9, 0xc9, 0x07, 0x00);
using WebSocket websocket = WebSocket.CreateFromStream(stream, new WebSocketCreationOptions
{
- DangerousDeflateOptions = new()
+ DangerousDeflateOptions = new WebSocketDeflateOptions()
});
Memory<byte> buffer = new byte[5];
@@ -74,7 +74,7 @@ namespace System.Net.WebSockets.Tests
using WebSocket websocket = WebSocket.CreateFromStream(stream.Remote, new WebSocketCreationOptions
{
IsServer = true,
- DangerousDeflateOptions = new()
+ DangerousDeflateOptions = new WebSocketDeflateOptions()
});
await websocket.SendAsync(Encoding.UTF8.GetBytes("Hello"), WebSocketMessageType.Text, true, CancellationToken);
@@ -95,7 +95,7 @@ namespace System.Net.WebSockets.Tests
using WebSocket websocket = WebSocket.CreateFromStream(stream.Remote, new WebSocketCreationOptions
{
IsServer = true,
- DangerousDeflateOptions = new()
+ DangerousDeflateOptions = new WebSocketDeflateOptions()
});
byte[] bytes = Encoding.UTF8.GetBytes("Hello");
@@ -113,7 +113,7 @@ namespace System.Net.WebSockets.Tests
using WebSocket websocket = WebSocket.CreateFromStream(stream.Remote, new WebSocketCreationOptions
{
IsServer = true,
- DangerousDeflateOptions = new()
+ DangerousDeflateOptions = new WebSocketDeflateOptions()
});
byte[] bytes = Encoding.UTF8.GetBytes("Hello");
@@ -123,7 +123,7 @@ namespace System.Net.WebSockets.Tests
using WebSocket client = WebSocket.CreateFromStream(stream, new WebSocketCreationOptions
{
IsServer = false,
- DangerousDeflateOptions = new()
+ DangerousDeflateOptions = new WebSocketDeflateOptions()
});
ValueWebSocketReceiveResult result = await client.ReceiveAsync(bytes.AsMemory(), CancellationToken);
@@ -141,7 +141,7 @@ namespace System.Net.WebSockets.Tests
WebSocketTestStream stream = new();
using WebSocket websocket = WebSocket.CreateFromStream(stream, new WebSocketCreationOptions
{
- DangerousDeflateOptions = new()
+ DangerousDeflateOptions = new WebSocketDeflateOptions()
{
ClientContextTakeover = false
}
@@ -171,7 +171,7 @@ namespace System.Net.WebSockets.Tests
using WebSocket websocket = WebSocket.CreateFromStream(stream.Remote, new WebSocketCreationOptions
{
IsServer = true,
- DangerousDeflateOptions = new()
+ DangerousDeflateOptions = new WebSocketDeflateOptions()
{
ServerContextTakeover = false
}
@@ -196,7 +196,7 @@ namespace System.Net.WebSockets.Tests
WebSocketTestStream stream = new();
using WebSocket websocket = WebSocket.CreateFromStream(stream, new WebSocketCreationOptions
{
- DangerousDeflateOptions = new()
+ DangerousDeflateOptions = new WebSocketDeflateOptions()
});
// The first 3 octets(0xf2 0x48 0x05) and the least significant two
// bits of the 4th octet(0x00) constitute one DEFLATE block with
@@ -285,14 +285,14 @@ namespace System.Net.WebSockets.Tests
using WebSocket server = WebSocket.CreateFromStream(stream, new WebSocketCreationOptions
{
IsServer = true,
- DangerousDeflateOptions = new()
+ DangerousDeflateOptions = new WebSocketDeflateOptions()
{
ClientMaxWindowBits = windowBits
}
});
using WebSocket client = WebSocket.CreateFromStream(stream.Remote, new WebSocketCreationOptions
{
- DangerousDeflateOptions = new()
+ DangerousDeflateOptions = new WebSocketDeflateOptions()
{
ClientMaxWindowBits = windowBits
}
@@ -466,7 +466,7 @@ namespace System.Net.WebSockets.Tests
using WebSocket server = WebSocket.CreateFromStream(stream, new WebSocketCreationOptions
{
IsServer = true,
- DangerousDeflateOptions = new()
+ DangerousDeflateOptions = new WebSocketDeflateOptions()
{
ClientContextTakeover = false,
ClientMaxWindowBits = clientWindowBits,
@@ -476,7 +476,7 @@ namespace System.Net.WebSockets.Tests
});
using WebSocket client = WebSocket.CreateFromStream(stream.Remote, new WebSocketCreationOptions
{
- DangerousDeflateOptions = new()
+ DangerousDeflateOptions = new WebSocketDeflateOptions()
{
ClientContextTakeover = false,
ClientMaxWindowBits = clientWindowBits,
@@ -568,7 +568,7 @@ namespace System.Net.WebSockets.Tests
{
IsServer = true,
KeepAliveInterval = TimeSpan.Zero,
- DangerousDeflateOptions = new()
+ DangerousDeflateOptions = new WebSocketDeflateOptions()
{
ClientMaxWindowBits = 9,
ServerMaxWindowBits = 9
@@ -577,7 +577,7 @@ namespace System.Net.WebSockets.Tests
using WebSocket client = WebSocket.CreateFromStream(stream.Remote, new WebSocketCreationOptions
{
KeepAliveInterval = TimeSpan.Zero,
- DangerousDeflateOptions = new()
+ DangerousDeflateOptions = new WebSocketDeflateOptions()
{
ClientMaxWindowBits = 9,
ServerMaxWindowBits = 9
@@ -609,7 +609,7 @@ namespace System.Net.WebSockets.Tests
{
IsServer = true,
KeepAliveInterval = TimeSpan.Zero,
- DangerousDeflateOptions = new()
+ DangerousDeflateOptions = new WebSocketDeflateOptions()
});
byte[] frame1 = new byte[1024];
@@ -626,7 +626,7 @@ namespace System.Net.WebSockets.Tests
{
IsServer = false,
KeepAliveInterval = TimeSpan.Zero,
- DangerousDeflateOptions = new()
+ DangerousDeflateOptions = new WebSocketDeflateOptions()
});
int messageSize = 0;
diff --git a/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/ValueListBuilder.cs b/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/ValueListBuilder.cs
index a82372b92b3..72b25bc2d9d 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/ValueListBuilder.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/ValueListBuilder.cs
@@ -44,9 +44,24 @@ namespace System.Collections.Generic
public void Append(T item)
{
int pos = _pos;
- if (pos >= _span.Length)
- Grow();
+ if ((uint)pos < (uint)_span.Length)
+ {
+ _span[pos] = item;
+ _pos = pos + 1;
+ }
+ else
+ {
+ AddWithResize(item);
+ }
+ }
+ // Hide uncommon path
+ [MethodImpl(MethodImplOptions.NoInlining)]
+ private void AddWithResize(T item)
+ {
+ Debug.Assert(_pos == _span.Length);
+ int pos = _pos;
+ Grow();
_span[pos] = item;
_pos = pos + 1;
}
diff --git a/src/libraries/System.Private.CoreLib/src/System/DateTime.cs b/src/libraries/System.Private.CoreLib/src/System/DateTime.cs
index bc543756cd8..c854be82fa5 100644
--- a/src/libraries/System.Private.CoreLib/src/System/DateTime.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/DateTime.cs
@@ -209,7 +209,7 @@ namespace System
else
{
// if we have a leap second, then we adjust it to 59 so that DateTime will consider it the last in the specified minute.
- this = new(year, month, day, hour, minute, 59);
+ this = new DateTime(year, month, day, hour, minute, 59);
ValidateLeapSecond();
}
}
@@ -226,7 +226,7 @@ namespace System
else
{
// if we have a leap second, then we adjust it to 59 so that DateTime will consider it the last in the specified minute.
- this = new(year, month, day, hour, minute, 59, kind);
+ this = new DateTime(year, month, day, hour, minute, 59, kind);
ValidateLeapSecond();
}
}
@@ -243,7 +243,7 @@ namespace System
else
{
// if we have a leap second, then we adjust it to 59 so that DateTime will consider it the last in the specified minute.
- this = new(year, month, day, hour, minute, 59, calendar);
+ this = new DateTime(year, month, day, hour, minute, 59, calendar);
ValidateLeapSecond();
}
}
@@ -265,7 +265,7 @@ namespace System
else
{
// if we have a leap second, then we adjust it to 59 so that DateTime will consider it the last in the specified minute.
- this = new(year, month, day, hour, minute, 59, millisecond);
+ this = new DateTime(year, month, day, hour, minute, 59, millisecond);
ValidateLeapSecond();
}
}
@@ -285,7 +285,7 @@ namespace System
else
{
// if we have a leap second, then we adjust it to 59 so that DateTime will consider it the last in the specified minute.
- this = new(year, month, day, hour, minute, 59, millisecond, kind);
+ this = new DateTime(year, month, day, hour, minute, 59, millisecond, kind);
ValidateLeapSecond();
}
}
@@ -302,7 +302,7 @@ namespace System
else
{
// if we have a leap second, then we adjust it to 59 so that DateTime will consider it the last in the specified minute.
- this = new(year, month, day, hour, minute, 59, millisecond, calendar);
+ this = new DateTime(year, month, day, hour, minute, 59, millisecond, calendar);
ValidateLeapSecond();
}
}
@@ -320,7 +320,7 @@ namespace System
else
{
// if we have a leap second, then we adjust it to 59 so that DateTime will consider it the last in the specified minute.
- this = new(year, month, day, hour, minute, 59, millisecond, calendar, kind);
+ this = new DateTime(year, month, day, hour, minute, 59, millisecond, calendar, kind);
ValidateLeapSecond();
}
}
diff --git a/src/libraries/System.Private.CoreLib/src/System/Reflection/NullabilityInfoContext.cs b/src/libraries/System.Private.CoreLib/src/System/Reflection/NullabilityInfoContext.cs
index 28a19024664..8721461f4e4 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Reflection/NullabilityInfoContext.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Reflection/NullabilityInfoContext.cs
@@ -389,11 +389,11 @@ namespace System.Reflection
attribute.AttributeType.Namespace == CompilerServicesNameSpace &&
attribute.ConstructorArguments.Count == 1)
{
- return new(attribute.ConstructorArguments[0].Value);
+ return new NullableAttributeStateParser(attribute.ConstructorArguments[0].Value);
}
}
- return new(null);
+ return new NullableAttributeStateParser(null);
}
private void TryLoadGenericMetaTypeNullability(MemberInfo memberInfo, NullabilityInfo nullability)
diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/PosixSignalRegistration.Windows.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/PosixSignalRegistration.Windows.cs
index 172d1743df8..5cb0579626a 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/PosixSignalRegistration.Windows.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/PosixSignalRegistration.Windows.cs
@@ -99,7 +99,7 @@ namespace System.Runtime.InteropServices
{
if (token.Signal == signal)
{
- (tokens ??= new()).Add(token);
+ (tokens ??= new List<Token>()).Add(token);
}
}
}
diff --git a/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs b/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs
index d18d4c729a8..d883782dbe5 100644
--- a/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/String.Manipulation.cs
@@ -1615,8 +1615,7 @@ namespace System
sep0 = separators[0];
sep1 = separators.Length > 1 ? separators[1] : sep0;
sep2 = separators.Length > 2 ? separators[2] : sep1;
-
- if (Length >= 16 && Sse41.IsSupported)
+ if (Vector128.IsHardwareAccelerated && Length >= Vector128<ushort>.Count * 2)
{
MakeSeparatorListVectorized(ref sepListBuilder, sep0, sep1, sep2);
return;
@@ -1659,75 +1658,54 @@ namespace System
private void MakeSeparatorListVectorized(ref ValueListBuilder<int> sepListBuilder, char c, char c2, char c3)
{
// Redundant test so we won't prejit remainder of this method
- // on platforms without SSE.
- if (!Sse41.IsSupported)
+ // on platforms where it is not supported
+ if (!Vector128.IsHardwareAccelerated)
{
throw new PlatformNotSupportedException();
}
- // Constant that allows for the truncation of 16-bit (FFFF/0000) values within a register to 4-bit (F/0)
- Vector128<byte> shuffleConstant = Vector128.Create(0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF);
+ Debug.Assert(Length >= Vector128<ushort>.Count);
+
+ nuint offset = 0;
+ nuint lengthToExamine = (nuint)(uint)Length;
+
+ ref ushort source = ref Unsafe.As<char, ushort>(ref _firstChar);
Vector128<ushort> v1 = Vector128.Create((ushort)c);
Vector128<ushort> v2 = Vector128.Create((ushort)c2);
Vector128<ushort> v3 = Vector128.Create((ushort)c3);
- ref char c0 = ref MemoryMarshal.GetReference(this.AsSpan());
- int cond = Length & -Vector128<ushort>.Count;
- int i = 0;
-
- for (; i < cond; i += Vector128<ushort>.Count)
+ do
{
- Vector128<ushort> charVector = ReadVector(ref c0, i);
- Vector128<ushort> cmp = Sse2.CompareEqual(charVector, v1);
-
- cmp = Sse2.Or(Sse2.CompareEqual(charVector, v2), cmp);
- cmp = Sse2.Or(Sse2.CompareEqual(charVector, v3), cmp);
+ Vector128<ushort> vector = Vector128.LoadUnsafe(ref source, offset);
+ Vector128<ushort> v1Eq = Vector128.Equals(vector, v1);
+ Vector128<ushort> v2Eq = Vector128.Equals(vector, v2);
+ Vector128<ushort> v3Eq = Vector128.Equals(vector, v3);
+ Vector128<byte> cmp = (v1Eq | v2Eq | v3Eq).AsByte();
- if (Sse41.TestZ(cmp, cmp)) { continue; }
-
- Vector128<byte> mask = Sse2.ShiftRightLogical(cmp.AsUInt64(), 4).AsByte();
- mask = Ssse3.Shuffle(mask, shuffleConstant);
-
- uint lowBits = Sse2.ConvertToUInt32(mask.AsUInt32());
- mask = Sse2.ShiftRightLogical(mask.AsUInt64(), 32).AsByte();
- uint highBits = Sse2.ConvertToUInt32(mask.AsUInt32());
-
- for (int idx = i; lowBits != 0; idx++)
+ if (cmp != Vector128<byte>.Zero)
{
- if ((lowBits & 0xF) != 0)
+ // Skip every other bit
+ uint mask = cmp.ExtractMostSignificantBits() & 0x5555;
+ do
{
- sepListBuilder.Append(idx);
- }
-
- lowBits >>= 8;
+ uint bitPos = (uint)BitOperations.TrailingZeroCount(mask) / sizeof(char);
+ sepListBuilder.Append((int)(offset + bitPos));
+ mask = BitOperations.ResetLowestSetBit(mask);
+ } while (mask != 0);
}
- for (int idx = i + 4; highBits != 0; idx++)
- {
- if ((highBits & 0xF) != 0)
- {
- sepListBuilder.Append(idx);
- }
-
- highBits >>= 8;
- }
- }
+ offset += (nuint)Vector128<ushort>.Count;
+ } while (offset <= lengthToExamine - (nuint)Vector128<ushort>.Count);
- for (; i < Length; i++)
+ while (offset < lengthToExamine)
{
- char curr = Unsafe.Add(ref c0, (IntPtr)(uint)i);
+ char curr = (char)Unsafe.Add(ref source, offset);
if (curr == c || curr == c2 || curr == c3)
{
- sepListBuilder.Append(i);
+ sepListBuilder.Append((int)offset);
}
- }
-
- static Vector128<ushort> ReadVector(ref char c0, int offset)
- {
- ref char ci = ref Unsafe.Add(ref c0, (IntPtr)(uint)offset);
- ref byte b = ref Unsafe.As<char, byte>(ref ci);
- return Unsafe.ReadUnaligned<Vector128<ushort>>(ref b);
+ offset++;
}
}
diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.IO.Windows.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.IO.Windows.cs
index 94e065a7b94..97b1f6b999d 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.IO.Windows.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.IO.Windows.cs
@@ -148,7 +148,7 @@ namespace System.Threading
_nativeEvents =
(Interop.Kernel32.OVERLAPPED_ENTRY*)
NativeMemory.Alloc(NativeEventCapacity, (nuint)sizeof(Interop.Kernel32.OVERLAPPED_ENTRY));
- _events = new(default);
+ _events = new ThreadPoolTypedWorkItemQueue<Event, Callback>(default);
// These threads don't run user code, use a smaller stack size
_thread = new Thread(Poll, SmallStackSizeBytes);
diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/TaskAsyncEnumerableExtensions.ToBlockingEnumerable.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/TaskAsyncEnumerableExtensions.ToBlockingEnumerable.cs
index bb0b436deca..4c165a91392 100644
--- a/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/TaskAsyncEnumerableExtensions.ToBlockingEnumerable.cs
+++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/TaskAsyncEnumerableExtensions.ToBlockingEnumerable.cs
@@ -41,7 +41,7 @@ namespace System.Threading.Tasks
if (!moveNextTask.IsCompleted)
{
- (mres ??= new()).Wait(moveNextTask.ConfigureAwait(false).GetAwaiter());
+ (mres ??= new ManualResetEventWithAwaiterSupport()).Wait(moveNextTask.ConfigureAwait(false).GetAwaiter());
Debug.Assert(moveNextTask.IsCompleted);
}
@@ -59,7 +59,7 @@ namespace System.Threading.Tasks
if (!disposeTask.IsCompleted)
{
- (mres ?? new()).Wait(disposeTask.ConfigureAwait(false).GetAwaiter());
+ (mres ?? new ManualResetEventWithAwaiterSupport()).Wait(disposeTask.ConfigureAwait(false).GetAwaiter());
Debug.Assert(disposeTask.IsCompleted);
}
diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Schema/XsdBuilder.cs b/src/libraries/System.Private.Xml/src/System/Xml/Schema/XsdBuilder.cs
index 6eb97a7f94d..85898fa27aa 100644
--- a/src/libraries/System.Private.Xml/src/System/Xml/Schema/XsdBuilder.cs
+++ b/src/libraries/System.Private.Xml/src/System/Xml/Schema/XsdBuilder.cs
@@ -703,8 +703,10 @@ namespace System.Xml.Schema
internal override bool ProcessElement(string prefix, string name, string ns)
{
- XmlQualifiedName qname = new XmlQualifiedName(name, ns);
- if (GetNextState(qname))
+ name ??= string.Empty;
+ ns ??= string.Empty;
+
+ if (GetNextState(name, ns))
{
Push();
Debug.Assert(_currentEntry.InitFunc != null);
@@ -715,9 +717,9 @@ namespace System.Xml.Schema
}
else
{
- if (!IsSkipableElement(qname))
+ if (!IsSkipableElement())
{
- SendValidationEvent(SR.Sch_UnsupportedElement, qname.ToString());
+ SendValidationEvent(SR.Sch_UnsupportedElement, XmlQualifiedName.ToString(name, ns));
}
return false;
}
@@ -726,13 +728,15 @@ namespace System.Xml.Schema
internal override void ProcessAttribute(string prefix, string name, string ns, string value)
{
- XmlQualifiedName qname = new XmlQualifiedName(name, ns);
+ name ??= string.Empty;
+ ns ??= string.Empty;
+
if (_currentEntry.Attributes != null)
{
for (int i = 0; i < _currentEntry.Attributes.Length; i++)
{
XsdAttributeEntry a = _currentEntry.Attributes[i];
- if (_schemaNames.TokenToQName[(int)a.Attribute].Equals(qname))
+ if (_schemaNames.TokenToQName[(int)a.Attribute].Equals(name, ns))
{
try
{
@@ -768,7 +772,7 @@ namespace System.Xml.Schema
}
else
{
- SendValidationEvent(SR.Sch_UnsupportedAttribute, qname.ToString());
+ SendValidationEvent(SR.Sch_UnsupportedAttribute, XmlQualifiedName.ToString(name, ns));
}
}
@@ -2433,14 +2437,14 @@ namespace System.Xml.Schema
}
}
- private bool GetNextState(XmlQualifiedName qname)
+ private bool GetNextState(string name, string ns)
{
if (_currentEntry.NextStates != null)
{
for (int i = 0; i < _currentEntry.NextStates.Length; ++i)
{
int state = (int)_currentEntry.NextStates[i];
- if (_schemaNames.TokenToQName[(int)s_schemaEntries[state].Name].Equals(qname))
+ if (_schemaNames.TokenToQName[(int)s_schemaEntries[state].Name].Equals(name, ns))
{
_nextEntry = s_schemaEntries[state];
return true;
@@ -2451,7 +2455,7 @@ namespace System.Xml.Schema
return false;
}
- private bool IsSkipableElement(XmlQualifiedName qname)
+ private bool IsSkipableElement()
{
return ((CurrentElement == SchemaNames.Token.XsdDocumentation) ||
(CurrentElement == SchemaNames.Token.XsdAppInfo));
diff --git a/src/libraries/System.Private.Xml/src/System/Xml/XmlQualifiedName.cs b/src/libraries/System.Private.Xml/src/System/Xml/XmlQualifiedName.cs
index e9041a344ab..55f27101c9a 100644
--- a/src/libraries/System.Private.Xml/src/System/Xml/XmlQualifiedName.cs
+++ b/src/libraries/System.Private.Xml/src/System/Xml/XmlQualifiedName.cs
@@ -78,9 +78,11 @@ namespace System.Xml
return true;
}
- return other is XmlQualifiedName qName && Name == qName.Name && Namespace == qName.Namespace;
+ return other is XmlQualifiedName qName && Equals(qName.Name, qName.Namespace);
}
+ internal bool Equals(string name, string ns) => Name == name && Namespace == ns;
+
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/NumberFormatter.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/NumberFormatter.cs
index f2f4c9b2aa7..f9b197ad0be 100644
--- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/NumberFormatter.cs
+++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/Runtime/NumberFormatter.cs
@@ -82,7 +82,7 @@ namespace System.Xml.Xsl.Runtime
Debug.Assert(1 <= val && val <= MaxAlphabeticValue);
Debug.Assert(Math.Pow(totalChars, MaxAlphabeticLength) >= MaxAlphabeticValue);
- char[] letters = new char[MaxAlphabeticLength];
+ Span<char> letters = stackalloc char[MaxAlphabeticLength];
int idx = MaxAlphabeticLength;
int number = (int)val;
@@ -93,7 +93,7 @@ namespace System.Xml.Xsl.Runtime
number = quot;
}
letters[--idx] = (char)(firstChar + --number);
- sb.Append(letters, idx, MaxAlphabeticLength - idx);
+ sb.Append(letters.Slice(idx, MaxAlphabeticLength - idx));
}
protected const int MaxRomanValue = 32767;
diff --git a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.ComDisabled.UnitTests/System.Runtime.InteropServices.ComDisabled.Tests.csproj b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.ComDisabled.UnitTests/System.Runtime.InteropServices.ComDisabled.Tests.csproj
index 700b6353360..7a2afe9fda6 100644
--- a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.ComDisabled.UnitTests/System.Runtime.InteropServices.ComDisabled.Tests.csproj
+++ b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.ComDisabled.UnitTests/System.Runtime.InteropServices.ComDisabled.Tests.csproj
@@ -3,8 +3,8 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TargetFramework>$(NetCoreAppCurrent)</TargetFramework>
<TestRuntime>true</TestRuntime>
- <!-- COM tests are currently only supported only in Windows on coreclr -->
- <IgnoreForCI Condition="'$(TargetOS)' != 'Windows' or '$(RuntimeFlavor)' != 'CoreCLR'">true</IgnoreForCI>
+ <!-- COM tests are currently only supported only in Windows -->
+ <IgnoreForCI Condition="'$(TargetOS)' != 'Windows'">true</IgnoreForCI>
</PropertyGroup>
<ItemGroup>
<Compile Include="System\Runtime\InteropServices\Marshal\MarshalComDisabledTests.cs" />
diff --git a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.ComDisabled.UnitTests/System/Runtime/InteropServices/Marshal/MarshalComDisabledTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.ComDisabled.UnitTests/System/Runtime/InteropServices/Marshal/MarshalComDisabledTests.cs
index 8511a4c5670..57a5887d4a2 100644
--- a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.ComDisabled.UnitTests/System/Runtime/InteropServices/Marshal/MarshalComDisabledTests.cs
+++ b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.ComDisabled.UnitTests/System/Runtime/InteropServices/Marshal/MarshalComDisabledTests.cs
@@ -6,6 +6,7 @@ using Xunit;
namespace System.Runtime.InteropServices.Tests
{
[PlatformSpecific(TestPlatforms.Windows)]
+ [SkipOnMono("COM Interop not supported on Mono")]
public partial class MarshalComDisabledTests
{
[Fact]
diff --git a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/CollectionsMarshalTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/CollectionsMarshalTests.cs
index 164d98287ad..876c0681bc6 100644
--- a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/CollectionsMarshalTests.cs
+++ b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/CollectionsMarshalTests.cs
@@ -158,7 +158,7 @@ namespace System.Runtime.InteropServices.Tests
Assert.Equal(0, dict[1].Value);
Assert.Equal(0, dict[1].Property);
- var itemVal = dict[1];
+ Struct itemVal = dict[1];
itemVal.Value = 1;
itemVal.Property = 2;
@@ -172,7 +172,7 @@ namespace System.Runtime.InteropServices.Tests
Assert.Equal(3, dict[1].Value);
Assert.Equal(4, dict[1].Property);
- ref var itemRef = ref CollectionsMarshal.GetValueRefOrNullRef(dict, 2);
+ ref Struct itemRef = ref CollectionsMarshal.GetValueRefOrNullRef(dict, 2);
Assert.Equal(0, itemRef.Value);
Assert.Equal(0, itemRef.Property);
@@ -185,7 +185,7 @@ namespace System.Runtime.InteropServices.Tests
Assert.Equal(dict[2].Value, itemRef.Value);
Assert.Equal(dict[2].Property, itemRef.Property);
- itemRef = new() { Value = 7, Property = 8 };
+ itemRef = new Struct() { Value = 7, Property = 8 };
Assert.Equal(7, itemRef.Value);
Assert.Equal(8, itemRef.Property);
@@ -205,8 +205,8 @@ namespace System.Runtime.InteropServices.Tests
{
var dict = new Dictionary<int, IntAsObject>
{
- { 1, new() },
- { 2, new() }
+ { 1, new IntAsObject() },
+ { 2, new IntAsObject() }
};
Assert.Equal(2, dict.Count);
@@ -214,7 +214,7 @@ namespace System.Runtime.InteropServices.Tests
Assert.Equal(0, dict[1].Value);
Assert.Equal(0, dict[1].Property);
- var itemVal = dict[1];
+ IntAsObject itemVal = dict[1];
itemVal.Value = 1;
itemVal.Property = 2;
@@ -228,7 +228,7 @@ namespace System.Runtime.InteropServices.Tests
Assert.Equal(3, dict[1].Value);
Assert.Equal(4, dict[1].Property);
- ref var itemRef = ref CollectionsMarshal.GetValueRefOrNullRef(dict, 2);
+ ref IntAsObject itemRef = ref CollectionsMarshal.GetValueRefOrNullRef(dict, 2);
Assert.Equal(0, itemRef.Value);
Assert.Equal(0, itemRef.Property);
@@ -241,7 +241,7 @@ namespace System.Runtime.InteropServices.Tests
Assert.Equal(dict[2].Value, itemRef.Value);
Assert.Equal(dict[2].Property, itemRef.Property);
- itemRef = new() { Value = 7, Property = 8 };
+ itemRef = new IntAsObject() { Value = 7, Property = 8 };
Assert.Equal(7, itemRef.Value);
Assert.Equal(8, itemRef.Property);
@@ -261,12 +261,12 @@ namespace System.Runtime.InteropServices.Tests
{
var dict = new Dictionary<int, Struct>
{
- { 1, new() }
+ { 1, new Struct() }
};
Assert.Equal(1, dict.Count);
- ref var itemRef = ref CollectionsMarshal.GetValueRefOrNullRef(dict, 1);
+ ref Struct itemRef = ref CollectionsMarshal.GetValueRefOrNullRef(dict, 1);
Assert.Equal(0, itemRef.Value);
Assert.Equal(0, itemRef.Property);
@@ -283,7 +283,7 @@ namespace System.Runtime.InteropServices.Tests
dict.EnsureCapacity(100);
for (int i = 2; i <= 50; i++)
{
- dict.Add(i, new());
+ dict.Add(i, new Struct());
}
itemRef.Value = 3;
@@ -316,7 +316,7 @@ namespace System.Runtime.InteropServices.Tests
Assert.Equal(0, dict[1].Value);
Assert.Equal(0, dict[1].Property);
- var itemVal = dict[1];
+ Struct itemVal = dict[1];
itemVal.Value = 1;
itemVal.Property = 2;
@@ -336,7 +336,7 @@ namespace System.Runtime.InteropServices.Tests
Assert.Equal(3, dict[1].Value);
Assert.Equal(4, dict[1].Property);
- ref var itemRef = ref CollectionsMarshal.GetValueRefOrAddDefault(dict, 2, out exists);
+ ref Struct itemRef = ref CollectionsMarshal.GetValueRefOrAddDefault(dict, 2, out exists);
Assert.True(exists);
Assert.Equal(2, dict.Count);
@@ -351,7 +351,7 @@ namespace System.Runtime.InteropServices.Tests
Assert.Equal(dict[2].Value, itemRef.Value);
Assert.Equal(dict[2].Property, itemRef.Property);
- itemRef = new() { Value = 7, Property = 8 };
+ itemRef = new Struct() { Value = 7, Property = 8 };
Assert.Equal(7, itemRef.Value);
Assert.Equal(8, itemRef.Property);
@@ -360,7 +360,7 @@ namespace System.Runtime.InteropServices.Tests
// Check for correct additions
- ref var entry3Ref = ref CollectionsMarshal.GetValueRefOrAddDefault(dict, 3, out exists);
+ ref Struct entry3Ref = ref CollectionsMarshal.GetValueRefOrAddDefault(dict, 3, out exists);
Assert.False(exists);
Assert.Equal(3, dict.Count);
@@ -370,7 +370,7 @@ namespace System.Runtime.InteropServices.Tests
entry3Ref.Property = 42;
entry3Ref.Value = 12345;
- var value3 = dict[3];
+ Struct value3 = dict[3];
Assert.Equal(42, value3.Property);
Assert.Equal(12345, value3.Value);
@@ -381,8 +381,8 @@ namespace System.Runtime.InteropServices.Tests
{
var dict = new Dictionary<int, IntAsObject>
{
- { 1, new() },
- { 2, new() }
+ { 1, new IntAsObject() },
+ { 2, new IntAsObject() }
};
Assert.Equal(2, dict.Count);
@@ -390,7 +390,7 @@ namespace System.Runtime.InteropServices.Tests
Assert.Equal(0, dict[1].Value);
Assert.Equal(0, dict[1].Property);
- var itemVal = dict[1];
+ IntAsObject itemVal = dict[1];
itemVal.Value = 1;
itemVal.Property = 2;
@@ -410,7 +410,7 @@ namespace System.Runtime.InteropServices.Tests
Assert.Equal(3, dict[1].Value);
Assert.Equal(4, dict[1].Property);
- ref var itemRef = ref CollectionsMarshal.GetValueRefOrAddDefault(dict, 2, out exists);
+ ref IntAsObject itemRef = ref CollectionsMarshal.GetValueRefOrAddDefault(dict, 2, out exists);
Assert.True(exists);
Assert.Equal(2, dict.Count);
@@ -425,7 +425,7 @@ namespace System.Runtime.InteropServices.Tests
Assert.Equal(dict[2].Value, itemRef.Value);
Assert.Equal(dict[2].Property, itemRef.Property);
- itemRef = new() { Value = 7, Property = 8 };
+ itemRef = new IntAsObject() { Value = 7, Property = 8 };
Assert.Equal(7, itemRef.Value);
Assert.Equal(8, itemRef.Property);
@@ -434,16 +434,16 @@ namespace System.Runtime.InteropServices.Tests
// Check for correct additions
- ref var entry3Ref = ref CollectionsMarshal.GetValueRefOrAddDefault(dict, 3, out exists);
+ ref IntAsObject entry3Ref = ref CollectionsMarshal.GetValueRefOrAddDefault(dict, 3, out exists);
Assert.False(exists);
Assert.Equal(3, dict.Count);
Assert.False(Unsafe.IsNullRef(ref entry3Ref));
Assert.Null(entry3Ref);
- entry3Ref = new() { Value = 12345, Property = 42 };
+ entry3Ref = new IntAsObject() { Value = 12345, Property = 42 };
- var value3 = dict[3];
+ IntAsObject value3 = dict[3];
Assert.Equal(42, value3.Property);
Assert.Equal(12345, value3.Value);
@@ -454,12 +454,12 @@ namespace System.Runtime.InteropServices.Tests
{
var dict = new Dictionary<int, Struct>
{
- { 1, new() }
+ { 1, new Struct() }
};
Assert.Equal(1, dict.Count);
- ref var itemRef = ref CollectionsMarshal.GetValueRefOrAddDefault(dict, 1, out bool exists);
+ ref Struct itemRef = ref CollectionsMarshal.GetValueRefOrAddDefault(dict, 1, out bool exists);
Assert.True(exists);
Assert.Equal(1, dict.Count);
@@ -478,7 +478,7 @@ namespace System.Runtime.InteropServices.Tests
dict.EnsureCapacity(100);
for (int i = 2; i <= 50; i++)
{
- dict.Add(i, new());
+ dict.Add(i, new Struct());
}
itemRef.Value = 3;
diff --git a/src/libraries/System.Runtime/tests/System/DateTimeTests.cs b/src/libraries/System.Runtime/tests/System/DateTimeTests.cs
index 0cbe26a005e..a004a43ae8d 100644
--- a/src/libraries/System.Runtime/tests/System/DateTimeTests.cs
+++ b/src/libraries/System.Runtime/tests/System/DateTimeTests.cs
@@ -1284,7 +1284,7 @@ namespace System.Tests
public static IEnumerable<object[]> ParseExact_TestData_R()
{
// Lowest, highest, and random DateTime in lower, upper, and normal casing
- var pairs = new(DateTime, string)[]
+ var pairs = new (DateTime, string)[]
{
(DateTime.MaxValue, "Fri, 31 Dec 9999 23:59:59"),
(DateTime.MinValue, "Mon, 01 Jan 0001 00:00:00"),
diff --git a/src/libraries/System.Runtime/tests/System/Runtime/DependentHandleTests.cs b/src/libraries/System.Runtime/tests/System/Runtime/DependentHandleTests.cs
index 2ee4eca51d4..3c798557d32 100644
--- a/src/libraries/System.Runtime/tests/System/Runtime/DependentHandleTests.cs
+++ b/src/libraries/System.Runtime/tests/System/Runtime/DependentHandleTests.cs
@@ -223,7 +223,7 @@ namespace System.Runtime.Tests
[MethodImpl(MethodImplOptions.NoInlining)]
static DependentHandle Initialize(out object target, out WeakReference weakDependent)
{
- target = new();
+ target = new object();
object dependent = new();
@@ -268,7 +268,7 @@ namespace System.Runtime.Tests
Assert.Throws<InvalidOperationException>(() =>
{
DependentHandle handle = default;
- handle.Target = new();
+ handle.Target = new object();
});
}
@@ -281,7 +281,7 @@ namespace System.Runtime.Tests
try
{
- handle.Target = new();
+ handle.Target = new object();
}
finally
{
@@ -296,7 +296,7 @@ namespace System.Runtime.Tests
Assert.Throws<InvalidOperationException>(() =>
{
DependentHandle handle = default;
- handle.Dependent = new();
+ handle.Dependent = new object();
});
}
diff --git a/src/libraries/System.Runtime/tests/System/String.SplitTests.cs b/src/libraries/System.Runtime/tests/System/String.SplitTests.cs
index 519efb7dec4..1785e9141ce 100644
--- a/src/libraries/System.Runtime/tests/System/String.SplitTests.cs
+++ b/src/libraries/System.Runtime/tests/System/String.SplitTests.cs
@@ -530,6 +530,7 @@ namespace System.Tests
[InlineData("this, is, a, string, with some spaces", new[] { ',', 's', 'a' }, M, StringSplitOptions.RemoveEmptyEntries, new[] { "thi", " i", " ", " ", "tring", " with ", "ome ", "p", "ce" })]
[InlineData("this, is, a, string, with some spaces", new[] { ',', 's', 'a' }, M, StringSplitOptions.TrimEntries, new[] { "thi", "", "i", "", "", "", "", "tring", "with", "ome", "p", "ce", "" })]
[InlineData("this, is, a, string, with some spaces", new[] { ',', 's', 'a' }, M, StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries, new[] { "thi", "i", "tring", "with", "ome", "p", "ce" })]
+ [InlineData("this, is, a, very long string, with some spaces, commas and more spaces", new[] { ',', 's' }, M, StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries, new[] { "thi", "i", "a", "very long", "tring", "with", "ome", "pace", "comma", "and more", "pace" })]
public static void SplitCharArraySeparator(string value, char[] separators, int count, StringSplitOptions options, string[] expected)
{
Assert.Equal(expected, value.Split(separators, count, options));
@@ -561,6 +562,7 @@ namespace System.Tests
[InlineData("this, is, a, string, with some spaces, ", new[] { ",", " s" }, M, StringSplitOptions.RemoveEmptyEntries, new[] { "this", " is", " a", "tring", " with", "ome", "paces", " " })]
[InlineData("this, is, a, string, with some spaces, ", new[] { ",", " s" }, M, StringSplitOptions.TrimEntries, new[] { "this", "is", "a", "", "tring", "with", "ome", "paces", "" })]
[InlineData("this, is, a, string, with some spaces, ", new[] { ",", " s" }, M, StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries, new[] { "this", "is", "a", "tring", "with", "ome", "paces" })]
+ [InlineData("this, is, a, very long string, with some spaces, commas and more spaces", new[] { ",", " s" }, M, StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries, new[] { "this", "is", "a", "very long", "tring", "with", "ome", "paces", "commas and more", "paces" })]
public static void SplitStringArraySeparator(string value, string[] separators, int count, StringSplitOptions options, string[] expected)
{
Assert.Equal(expected, value.Split(separators, count, options));
diff --git a/src/libraries/System.Security.Cryptography.Cose/tests/CoseSign1MessageTests.Sign.cs b/src/libraries/System.Security.Cryptography.Cose/tests/CoseSign1MessageTests.Sign.cs
index 696b7c2eee7..8a0c6a5edd1 100644
--- a/src/libraries/System.Security.Cryptography.Cose/tests/CoseSign1MessageTests.Sign.cs
+++ b/src/libraries/System.Security.Cryptography.Cose/tests/CoseSign1MessageTests.Sign.cs
@@ -285,7 +285,7 @@ namespace System.Security.Cryptography.Cose.Tests
mapForCustomHeader = useProtectedMap ? protectedHeaders : unprotectedHeaders;
expectedProtectedHeaders = GetExpectedProtectedHeaders();
- expectedUnprotectedHeaders = new();
+ expectedUnprotectedHeaders = new List<(CoseHeaderLabel, ReadOnlyMemory<byte>)>();
listForCustomHeader = useProtectedMap ? expectedProtectedHeaders : expectedUnprotectedHeaders;
}
}
diff --git a/src/libraries/System.Security.Cryptography.Cose/tests/CoseTestHelpers.cs b/src/libraries/System.Security.Cryptography.Cose/tests/CoseTestHelpers.cs
index 461382b715f..239c37cea83 100644
--- a/src/libraries/System.Security.Cryptography.Cose/tests/CoseTestHelpers.cs
+++ b/src/libraries/System.Security.Cryptography.Cose/tests/CoseTestHelpers.cs
@@ -235,7 +235,7 @@ namespace System.Security.Cryptography.Cose.Tests
private static ECParameters CreateECParameters(string curveFriendlyName, string base64UrlQx, string base64UrlQy, string base64UrlPrivateKey)
{
- return new()
+ return new ECParameters()
{
Curve = ECCurve.CreateFromFriendlyName(curveFriendlyName),
Q = new ECPoint
diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/ConverterList.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/ConverterList.cs
index da2391d4045..a2f65ff8fe8 100644
--- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/ConverterList.cs
+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/ConverterList.cs
@@ -17,7 +17,7 @@ namespace System.Text.Json.Serialization
public ConverterList(JsonSerializerOptions options)
{
_options = options;
- _list = new();
+ _list = new List<JsonConverter>();
}
public ConverterList(JsonSerializerOptions options, ConverterList source)
diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IAsyncEnumerableOfTConverter.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IAsyncEnumerableOfTConverter.cs
index 7466fbeb78e..868e94109a8 100644
--- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IAsyncEnumerableOfTConverter.cs
+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/Converters/Collection/IAsyncEnumerableOfTConverter.cs
@@ -34,7 +34,7 @@ namespace System.Text.Json.Serialization.Converters
internal override bool OnTryWrite(Utf8JsonWriter writer, TAsyncEnumerable value, JsonSerializerOptions options, ref WriteStack state)
{
- if (!state.SupportContinuation)
+ if (!state.SupportAsync)
{
ThrowHelper.ThrowNotSupportedException_TypeRequiresAsyncSerialization(TypeToConvert);
}
diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonResumableConverterOfT.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonResumableConverterOfT.cs
index 2036aaaae3f..898ed9a0304 100644
--- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonResumableConverterOfT.cs
+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonResumableConverterOfT.cs
@@ -25,7 +25,7 @@ namespace System.Text.Json.Serialization
// Bridge from resumable to value converters.
WriteStack state = default;
- state.Initialize(typeof(T), options, supportContinuation: false);
+ state.Initialize(typeof(T), options, supportContinuation: false, supportAsync: false);
try
{
TryWrite(writer, value, options, ref state);
diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.HandleMetadata.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.HandleMetadata.cs
index b34efae2572..e61b52c7c11 100644
--- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.HandleMetadata.cs
+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Read.HandleMetadata.cs
@@ -336,6 +336,11 @@ namespace System.Text.Json
if (state.Current.ObjectState == StackFrameObjectState.ReadValuesStartArray)
{
+ // Temporary workaround for the state machine accidentally
+ // erasing the JsonPropertyName property in certain async
+ // re-entrancy patterns.
+ state.Current.JsonPropertyName = s_valuesPropertyName;
+
if (reader.TokenType != JsonTokenType.StartArray)
{
ThrowHelper.ThrowJsonException_MetadataValuesInvalidToken(reader.TokenType);
diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Write.Helpers.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Write.Helpers.cs
index 607cb383cba..d756b546725 100644
--- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Write.Helpers.cs
+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Write.Helpers.cs
@@ -64,7 +64,7 @@ namespace System.Text.Json
"Incorrect method called. WriteUsingGeneratedSerializer() should have been called instead.");
WriteStack state = default;
- state.Initialize(jsonTypeInfo, supportContinuation: false);
+ state.Initialize(jsonTypeInfo, supportContinuation: false, supportAsync: false);
JsonConverter converter = jsonTypeInfo.PropertyInfoForTypeInfo.ConverterBase;
Debug.Assert(converter != null);
diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Write.Stream.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Write.Stream.cs
index bc71fa13dec..3690f85696a 100644
--- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Write.Stream.cs
+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializer.Write.Stream.cs
@@ -256,7 +256,7 @@ namespace System.Text.Json
using (var writer = new Utf8JsonWriter(bufferWriter, writerOptions))
{
WriteStack state = new WriteStack { CancellationToken = cancellationToken };
- JsonConverter converter = state.Initialize(jsonTypeInfo, supportContinuation: true);
+ JsonConverter converter = state.Initialize(jsonTypeInfo, supportContinuation: true, supportAsync: true);
bool isFinalBlock;
@@ -329,7 +329,7 @@ namespace System.Text.Json
using (var writer = new Utf8JsonWriter(bufferWriter, writerOptions))
{
WriteStack state = default;
- JsonConverter converter = state.Initialize(jsonTypeInfo, supportContinuation: true);
+ JsonConverter converter = state.Initialize(jsonTypeInfo, supportContinuation: true, supportAsync: false);
bool isFinalBlock;
diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.Caching.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.Caching.cs
index 75f7b9801a4..fd62229d44f 100644
--- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.Caching.cs
+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/JsonSerializerOptions.Caching.cs
@@ -172,7 +172,7 @@ namespace System.Text.Json
Debug.Assert(key._cachingContext == null);
ctx = new CachingContext(options);
- bool success = cache.TryAdd(key, new(ctx));
+ bool success = cache.TryAdd(key, new WeakReference<CachingContext>(ctx));
Debug.Assert(success);
return ctx;
diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/ReadStack.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/ReadStack.cs
index 1bdbba54e5f..c1a748ee440 100644
--- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/ReadStack.cs
+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/ReadStack.cs
@@ -208,15 +208,19 @@ namespace System.Text.Json
{
StringBuilder sb = new StringBuilder("$");
- // If a continuation, always report back full stack which does not use Current for the last frame.
- int count = Math.Max(_count, _continuationCount + 1);
+ (int frameCount, bool includeCurrentFrame) = _continuationCount switch
+ {
+ 0 => (_count - 1, true), // Not a countinuation, report previous frames and Current.
+ 1 => (0, true), // Continuation of depth 1, just report Current frame.
+ int c => (c, false) // Continuation of depth > 1, report the entire stack.
+ };
- for (int i = 0; i < count - 1; i++)
+ for (int i = 0; i < frameCount; i++)
{
AppendStackFrame(sb, ref _stack[i]);
}
- if (_continuationCount == 0)
+ if (includeCurrentFrame)
{
AppendStackFrame(sb, ref Current);
}
diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/WriteStack.cs b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/WriteStack.cs
index a73532d0187..7f085ac13fa 100644
--- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/WriteStack.cs
+++ b/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/WriteStack.cs
@@ -79,6 +79,11 @@ namespace System.Text.Json
public bool SupportContinuation;
/// <summary>
+ /// Internal flag indicating that async serialization is supported. Implies `SupportContinuation`.
+ /// </summary>
+ public bool SupportAsync;
+
+ /// <summary>
/// Stores a reference id that has been calculated for a newly serialized object.
/// </summary>
public string? NewReferenceId;
@@ -98,14 +103,16 @@ namespace System.Text.Json
/// <summary>
/// Initialize the state without delayed initialization of the JsonTypeInfo.
/// </summary>
- public JsonConverter Initialize(Type type, JsonSerializerOptions options, bool supportContinuation)
+ public JsonConverter Initialize(Type type, JsonSerializerOptions options, bool supportContinuation, bool supportAsync)
{
JsonTypeInfo jsonTypeInfo = options.GetOrAddJsonTypeInfoForRootType(type);
- return Initialize(jsonTypeInfo, supportContinuation);
+ return Initialize(jsonTypeInfo, supportContinuation, supportAsync);
}
- internal JsonConverter Initialize(JsonTypeInfo jsonTypeInfo, bool supportContinuation)
+ internal JsonConverter Initialize(JsonTypeInfo jsonTypeInfo, bool supportContinuation, bool supportAsync)
{
+ Debug.Assert(!supportAsync || supportContinuation, "supportAsync implies supportContinuation.");
+
Current.JsonTypeInfo = jsonTypeInfo;
Current.JsonPropertyInfo = jsonTypeInfo.PropertyInfoForTypeInfo;
Current.NumberHandling = Current.JsonPropertyInfo.NumberHandling;
@@ -118,6 +125,7 @@ namespace System.Text.Json
}
SupportContinuation = supportContinuation;
+ SupportAsync = supportAsync;
return jsonTypeInfo.PropertyInfoForTypeInfo.ConverterBase;
}
@@ -332,15 +340,19 @@ namespace System.Text.Json
{
StringBuilder sb = new StringBuilder("$");
- // If a continuation, always report back full stack which does not use Current for the last frame.
- int count = Math.Max(_count, _continuationCount + 1);
+ (int frameCount, bool includeCurrentFrame) = _continuationCount switch
+ {
+ 0 => (_count - 1, true), // Not a countinuation, report previous frames and Current.
+ 1 => (0, true), // Continuation of depth 1, just report Current frame.
+ int c => (c, false) // Continuation of depth > 1, report the entire stack.
+ };
- for (int i = 0; i < count - 1; i++)
+ for (int i = 0; i < frameCount; i++)
{
AppendStackFrame(sb, ref _stack[i]);
}
- if (_continuationCount == 0)
+ if (includeCurrentFrame)
{
AppendStackFrame(sb, ref Current);
}
diff --git a/src/libraries/System.Text.Json/tests/Common/CollectionTests/CollectionTests.AsyncEnumerable.cs b/src/libraries/System.Text.Json/tests/Common/CollectionTests/CollectionTests.AsyncEnumerable.cs
index 1f3fd1c159f..03677695967 100644
--- a/src/libraries/System.Text.Json/tests/Common/CollectionTests/CollectionTests.AsyncEnumerable.cs
+++ b/src/libraries/System.Text.Json/tests/Common/CollectionTests/CollectionTests.AsyncEnumerable.cs
@@ -18,7 +18,7 @@ namespace System.Text.Json.Serialization.Tests
[MemberData(nameof(GetAsyncEnumerableSources))]
public async Task WriteRootLevelAsyncEnumerable<TElement>(IEnumerable<TElement> source, int delayInterval, int bufferSize)
{
- if (StreamingSerializer is null)
+ if (StreamingSerializer?.IsAsyncSerializer != true)
{
return;
}
@@ -43,7 +43,7 @@ namespace System.Text.Json.Serialization.Tests
[MemberData(nameof(GetAsyncEnumerableSources))]
public async Task WriteNestedAsyncEnumerable<TElement>(IEnumerable<TElement> source, int delayInterval, int bufferSize)
{
- if (StreamingSerializer is null)
+ if (StreamingSerializer?.IsAsyncSerializer != true)
{
return;
}
@@ -68,7 +68,7 @@ namespace System.Text.Json.Serialization.Tests
[MemberData(nameof(GetAsyncEnumerableSources))]
public async Task WriteNestedAsyncEnumerable_DTO<TElement>(IEnumerable<TElement> source, int delayInterval, int bufferSize)
{
- if (StreamingSerializer is null)
+ if (StreamingSerializer?.IsAsyncSerializer != true)
{
return;
}
@@ -93,7 +93,7 @@ namespace System.Text.Json.Serialization.Tests
[MemberData(nameof(GetAsyncEnumerableSources))]
public async Task WriteNestedAsyncEnumerable_Nullable<TElement>(IEnumerable<TElement> source, int delayInterval, int bufferSize)
{
- if (StreamingSerializer is null)
+ if (StreamingSerializer?.IsAsyncSerializer != true)
{
return;
}
@@ -151,7 +151,7 @@ namespace System.Text.Json.Serialization.Tests
[MemberData(nameof(GetAsyncEnumerableSources))]
public async Task WriteSequentialNestedAsyncEnumerables<TElement>(IEnumerable<TElement> source, int delayInterval, int bufferSize)
{
- if (StreamingSerializer is null)
+ if (StreamingSerializer?.IsAsyncSerializer != true)
{
return;
}
@@ -176,7 +176,7 @@ namespace System.Text.Json.Serialization.Tests
[MemberData(nameof(GetAsyncEnumerableSources))]
public async Task WriteAsyncEnumerableOfAsyncEnumerables<TElement>(IEnumerable<TElement> source, int delayInterval, int bufferSize)
{
- if (StreamingSerializer is null)
+ if (StreamingSerializer?.IsAsyncSerializer != true)
{
return;
}
@@ -209,6 +209,7 @@ namespace System.Text.Json.Serialization.Tests
{
IAsyncEnumerable<int> asyncEnumerable = new MockedAsyncEnumerable<int>(Enumerable.Range(1, 10));
Assert.Throws<NotSupportedException>(() => JsonSerializer.Serialize(asyncEnumerable));
+ Assert.Throws<NotSupportedException>(() => JsonSerializer.Serialize(new MemoryStream(), asyncEnumerable));
}
[Fact]
@@ -216,12 +217,13 @@ namespace System.Text.Json.Serialization.Tests
{
IAsyncEnumerable<int> asyncEnumerable = new MockedAsyncEnumerable<int>(Enumerable.Range(1, 10));
Assert.Throws<NotSupportedException>(() => JsonSerializer.Serialize(new { Data = asyncEnumerable }));
+ Assert.Throws<NotSupportedException>(() => JsonSerializer.Serialize(new MemoryStream(), new { Data = asyncEnumerable }));
}
[Fact]
public async Task WriteAsyncEnumerable_ElementSerializationThrows_ShouldDisposeEnumerator()
{
- if (StreamingSerializer is null)
+ if (StreamingSerializer?.IsAsyncSerializer != true)
{
return;
}
@@ -243,7 +245,7 @@ namespace System.Text.Json.Serialization.Tests
[Fact]
public async Task ReadRootLevelAsyncEnumerable()
{
- if (StreamingSerializer is null)
+ if (StreamingSerializer?.IsAsyncSerializer != true)
{
return;
}
@@ -257,7 +259,7 @@ namespace System.Text.Json.Serialization.Tests
[Fact]
public async Task ReadNestedAsyncEnumerable()
{
- if (StreamingSerializer is null)
+ if (StreamingSerializer?.IsAsyncSerializer != true)
{
return;
}
@@ -271,7 +273,7 @@ namespace System.Text.Json.Serialization.Tests
[Fact]
public async Task ReadAsyncEnumerableOfAsyncEnumerables()
{
- if (StreamingSerializer is null)
+ if (StreamingSerializer?.IsAsyncSerializer != true)
{
return;
}
@@ -289,7 +291,7 @@ namespace System.Text.Json.Serialization.Tests
[Fact]
public async Task ReadRootLevelAsyncEnumerableDerivative_ThrowsNotSupportedException()
{
- if (StreamingSerializer is null)
+ if (StreamingSerializer?.IsAsyncSerializer != true)
{
return;
}
@@ -314,7 +316,7 @@ namespace System.Text.Json.Serialization.Tests
[Fact]
public async Task RegressionTest_DisposingEnumeratorOnPendingMoveNextAsyncOperation()
{
- if (StreamingSerializer is null)
+ if (StreamingSerializer?.IsAsyncSerializer != true)
{
return;
}
@@ -338,7 +340,7 @@ namespace System.Text.Json.Serialization.Tests
[Fact]
public async Task RegressionTest_ExceptionOnFirstMoveNextShouldNotFlushBuffer()
{
- if (StreamingSerializer is null)
+ if (StreamingSerializer?.IsAsyncSerializer != true)
{
return;
}
diff --git a/src/libraries/System.Text.Json/tests/Common/CollectionTests/CollectionTests.Dictionary.NonStringKey.cs b/src/libraries/System.Text.Json/tests/Common/CollectionTests/CollectionTests.Dictionary.NonStringKey.cs
index 2c2ee556fbb..eb050d1bb81 100644
--- a/src/libraries/System.Text.Json/tests/Common/CollectionTests/CollectionTests.Dictionary.NonStringKey.cs
+++ b/src/libraries/System.Text.Json/tests/Common/CollectionTests/CollectionTests.Dictionary.NonStringKey.cs
@@ -679,7 +679,7 @@ namespace System.Text.Json.Serialization.Tests
JsonTypeInfo<string> valueInfo = JsonMetadataServices.CreateValueInfo<string>(Options, JsonMetadataServices.StringConverter);
JsonCollectionInfoValues<Dictionary<int, string>> info = new()
{
- ObjectCreator = () => new(),
+ ObjectCreator = () => new Dictionary<int, string>(),
KeyInfo = keyInfo,
ElementInfo = valueInfo,
};
diff --git a/src/libraries/System.Text.Json/tests/Common/StreamingJsonSerializerWrapper.cs b/src/libraries/System.Text.Json/tests/Common/StreamingJsonSerializerWrapper.cs
index d450ca05c75..5b8f1c9ac39 100644
--- a/src/libraries/System.Text.Json/tests/Common/StreamingJsonSerializerWrapper.cs
+++ b/src/libraries/System.Text.Json/tests/Common/StreamingJsonSerializerWrapper.cs
@@ -15,7 +15,7 @@ namespace System.Text.Json.Serialization.Tests
/// <summary>
/// True if the serializer is streaming data synchronously.
/// </summary>
- public virtual bool IsBlockingSerializer => false;
+ public abstract bool IsAsyncSerializer { get; }
public abstract Task SerializeWrapper(Stream stream, object value, Type inputType, JsonSerializerOptions? options = null);
public abstract Task SerializeWrapper<T>(Stream stream, T value, JsonSerializerOptions? options = null);
diff --git a/src/libraries/System.Text.Json/tests/Common/UnsupportedTypesTests.cs b/src/libraries/System.Text.Json/tests/Common/UnsupportedTypesTests.cs
index 09a428b20b8..73d2a845275 100644
--- a/src/libraries/System.Text.Json/tests/Common/UnsupportedTypesTests.cs
+++ b/src/libraries/System.Text.Json/tests/Common/UnsupportedTypesTests.cs
@@ -237,7 +237,7 @@ namespace System.Text.Json.Serialization.Tests
Assert.Equal("Read", obj.Status);
ClassWithAsyncEnumerableConverter poco = new();
- poco.MyAsyncEnumerable = new();
+ poco.MyAsyncEnumerable = new ClassThatImplementsIAsyncEnumerable();
Assert.Equal("Created", poco.MyAsyncEnumerable.Status);
serialized = await Serializer.SerializeWrapper(poco, options);
Assert.Equal(Json, serialized);
@@ -252,7 +252,7 @@ namespace System.Text.Json.Serialization.Tests
const string Json = "{\"MyAsyncEnumerable\":[]}";
ClassWithAsyncEnumerableConverter obj = new();
- obj.MyAsyncEnumerable = new();
+ obj.MyAsyncEnumerable = new ClassThatImplementsIAsyncEnumerable();
Assert.Equal("Created", obj.MyAsyncEnumerable.Status);
string serialized = await Serializer.SerializeWrapper(obj);
diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/Serialization/JsonSerializerWrapper.SourceGen.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/Serialization/JsonSerializerWrapper.SourceGen.cs
index f7bd07a453d..9d02871c9dc 100644
--- a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/Serialization/JsonSerializerWrapper.SourceGen.cs
+++ b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Tests/Serialization/JsonSerializerWrapper.SourceGen.cs
@@ -84,6 +84,8 @@ namespace System.Text.Json.SourceGeneration.Tests
private readonly JsonSerializerContext _defaultContext;
private readonly Func<JsonSerializerOptions, JsonSerializerContext> _customContextCreator;
+ public override bool IsAsyncSerializer => true;
+
public AsyncStreamSerializerWrapper(JsonSerializerContext defaultContext!!, Func<JsonSerializerOptions, JsonSerializerContext> customContextCreator!!)
{
_defaultContext = defaultContext;
diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/System.Text.Json.SourceGeneration.Roslyn3.11.Unit.Tests.csproj b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/System.Text.Json.SourceGeneration.Roslyn3.11.Unit.Tests.csproj
index 9fec30cc1d6..6c89551e7dd 100644
--- a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/System.Text.Json.SourceGeneration.Roslyn3.11.Unit.Tests.csproj
+++ b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/System.Text.Json.SourceGeneration.Roslyn3.11.Unit.Tests.csproj
@@ -5,6 +5,7 @@
</PropertyGroup>
<ItemGroup>
+ <HighAotMemoryUsageAssembly Include="Microsoft.CodeAnalysis.dll" />
<HighAotMemoryUsageAssembly Include="Microsoft.CodeAnalysis.CSharp.dll" />
</ItemGroup>
diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/CollectionTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/CollectionTests.cs
index 52b4fbdefca..3b3d3ac1942 100644
--- a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/CollectionTests.cs
+++ b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/CollectionTests.cs
@@ -15,7 +15,11 @@ namespace System.Text.Json.Serialization.Tests
public CollectionTestsDynamic_AsyncStream() : base(JsonSerializerWrapper.AsyncStreamSerializer) { }
}
- [ActiveIssue("https://github.com/dotnet/runtime/issues/66687")]
+ public sealed partial class CollectionTestsDynamic_AsyncStreamWithSmallBuffer : CollectionTests
+ {
+ public CollectionTestsDynamic_AsyncStreamWithSmallBuffer() : base(JsonSerializerWrapper.AsyncStreamSerializerWithSmallBuffer) { }
+ }
+
public sealed partial class CollectionTestsDynamic_SyncStream : CollectionTests
{
public CollectionTestsDynamic_SyncStream() : base(JsonSerializerWrapper.SyncStreamSerializer) { }
diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/ContinuationTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/ContinuationTests.cs
index 3e3ae634725..8496254aaed 100644
--- a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/ContinuationTests.cs
+++ b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/ContinuationTests.cs
@@ -390,7 +390,7 @@ namespace System.Text.Json.Serialization.Tests
void ITestObject.Initialize(INestedObject nested)
{
nested.Initialize();
- A = new() { { "a", (TNested)nested }, { "b", (TNested)nested } };
+ A = new Dictionary<string, TNested>() { { "a", (TNested)nested }, { "b", (TNested)nested } };
}
void ITestObject.Verify()
diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/JsonSerializerWrapper.Reflection.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/JsonSerializerWrapper.Reflection.cs
index f14e594d635..2e3912a7572 100644
--- a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/JsonSerializerWrapper.Reflection.cs
+++ b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/JsonSerializerWrapper.Reflection.cs
@@ -122,6 +122,8 @@ namespace System.Text.Json.Serialization.Tests
{
private readonly bool _forceSmallBufferInOptions;
+ public override bool IsAsyncSerializer => true;
+
public AsyncStreamSerializerWrapper(bool forceSmallBufferInOptions = false)
{
_forceSmallBufferInOptions = forceSmallBufferInOptions;
@@ -183,7 +185,7 @@ namespace System.Text.Json.Serialization.Tests
private JsonSerializerOptions? ResolveOptionsInstance(JsonSerializerOptions? options)
=> _forceSmallBufferInOptions ? JsonSerializerOptionsSmallBufferMapper.ResolveOptionsInstanceWithSmallBuffer(options) : options;
- public override bool IsBlockingSerializer => true;
+ public override bool IsAsyncSerializer => false;
public override Task SerializeWrapper<T>(Stream utf8Json, T value, JsonSerializerOptions options = null)
{
diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/NumberHandlingTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/NumberHandlingTests.cs
index 8fed9581d4d..afc2a31e3ec 100644
--- a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/NumberHandlingTests.cs
+++ b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/NumberHandlingTests.cs
@@ -1767,7 +1767,7 @@ namespace System.Text.Json.Serialization.Tests
Converters = { new AdaptableInt32Converter() }
};
- obj = new() { Prop = new List<int>() { 1 } };
+ obj = new PlainClassWithList() { Prop = new List<int>() { 1 } };
json = JsonSerializer.Serialize(obj, options);
Assert.Equal("{\"Prop\":[101]}", json);
@@ -1775,13 +1775,13 @@ namespace System.Text.Json.Serialization.Tests
Assert.Equal(1, obj.Prop[0]);
// Then with strings
- options = new()
+ options = new JsonSerializerOptions()
{
NumberHandling = JsonNumberHandling.AllowReadingFromString | JsonNumberHandling.WriteAsString,
Converters = { new AdaptableInt32Converter() }
};
- obj = new() { Prop = new List<int>() { 1 } };
+ obj = new PlainClassWithList() { Prop = new List<int>() { 1 } };
json = JsonSerializer.Serialize(obj, options);
Assert.Equal("{\"Prop\":[\"101\"]}", json);
diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/ReferenceHandlerTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/ReferenceHandlerTests.cs
index a9257142a40..3cfcdbeff8d 100644
--- a/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/ReferenceHandlerTests.cs
+++ b/src/libraries/System.Text.Json/tests/System.Text.Json.Tests/Serialization/ReferenceHandlerTests.cs
@@ -15,7 +15,6 @@ namespace System.Text.Json.Serialization.Tests
public ReferenceHandlerTestsDynamic_AsyncStream() : base(JsonSerializerWrapper.AsyncStreamSerializer) { }
}
- [ActiveIssue("https://github.com/dotnet/runtime/issues/66727")]
public sealed class ReferenceHandlerTestsDynamic_AsyncStreamWithSmallBuffer : ReferenceHandlerTests
{
public ReferenceHandlerTestsDynamic_AsyncStreamWithSmallBuffer() : base(JsonSerializerWrapper.AsyncStreamSerializerWithSmallBuffer) { }
diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexFindOptimizations.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexFindOptimizations.cs
index 6a0b41a6c6c..5547039f053 100644
--- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexFindOptimizations.cs
+++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexFindOptimizations.cs
@@ -132,7 +132,10 @@ namespace System.Text.RegularExpressions
else
{
// The set may match multiple characters. Search for that.
- FixedDistanceSets = new() { (chars, set.CharClass, 0, set.CaseInsensitive) };
+ FixedDistanceSets = new List<(char[]? Chars, string Set, int Distance, bool CaseInsensitive)>()
+ {
+ (chars, set.CharClass, 0, set.CaseInsensitive)
+ };
FindMode = set.CaseInsensitive ?
FindNextStartingPositionMode.LeadingSet_RightToLeft_CaseInsensitive :
FindNextStartingPositionMode.LeadingSet_RightToLeft_CaseSensitive;
diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexTreeAnalyzer.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexTreeAnalyzer.cs
index 51c16ba651e..36f6887b0b3 100644
--- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexTreeAnalyzer.cs
+++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexTreeAnalyzer.cs
@@ -43,7 +43,7 @@ namespace System.Text.RegularExpressions
case RegexNodeKind.Alternate:
case RegexNodeKind.Loop or RegexNodeKind.Lazyloop when node.M != node.N:
case RegexNodeKind.Oneloop or RegexNodeKind.Notoneloop or RegexNodeKind.Setloop or RegexNodeKind.Onelazy or RegexNodeKind.Notonelazy or RegexNodeKind.Setlazy when node.M != node.N:
- (results._mayBacktrack ??= new()).Add(node);
+ (results._mayBacktrack ??= new HashSet<RegexNode>()).Add(node);
break;
}
}
@@ -120,7 +120,7 @@ namespace System.Text.RegularExpressions
// will be visible from this node to it.
if (!isAtomicBySelf && (results._mayBacktrack?.Contains(child) == true))
{
- (results._mayBacktrack ??= new()).Add(node);
+ (results._mayBacktrack ??= new HashSet<RegexNode>()).Add(node);
}
}
diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/RegexNodeConverter.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/RegexNodeConverter.cs
index 698f9fce3fa..a2571f10b71 100644
--- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/RegexNodeConverter.cs
+++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/RegexNodeConverter.cs
@@ -263,7 +263,7 @@ namespace System.Text.RegularExpressions.Symbolic
return false;
}
- conjuncts = new();
+ conjuncts = new List<RegexNode>();
conjuncts.Add(node.Child(0));
node = node.Child(1);
while (IsIntersect(node))
@@ -293,7 +293,7 @@ namespace System.Text.RegularExpressions.Symbolic
}
// Lazily-initialize the set cache on first use, since some expressions may not have character classes in them.
- _setBddCache ??= new();
+ _setBddCache ??= new Dictionary<(bool IgnoreCase, string Set), BDD>();
// Try to get the cached BDD for the combined ignoreCase+set key.
// If one doesn't yet exist, compute and populate it.
diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexMatcher.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexMatcher.cs
index 0d541be0a30..fac9e55c281 100644
--- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexMatcher.cs
+++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexMatcher.cs
@@ -1053,8 +1053,8 @@ namespace System.Text.RegularExpressions.Symbolic
// Only create data used for capturing mode if there are subcaptures
if (capsize > 1)
{
- Current = new();
- Next = new();
+ Current = new SparseIntMap<Registers>();
+ Next = new SparseIntMap<Registers>();
InitialRegisters = new Registers(new int[capsize], new int[capsize]);
}
}
diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexNode.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexNode.cs
index 59522b71116..800a42116a3 100644
--- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexNode.cs
+++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Symbolic/SymbolicRegexNode.cs
@@ -75,14 +75,14 @@ namespace System.Text.RegularExpressions.Symbolic
// Do not internalize top level Or-nodes or else NFA mode will become ineffective
if (kind == SymbolicRegexNodeKind.Or)
{
- node = new(builder, kind, left, right, lower, upper, set, alts, info);
+ node = new SymbolicRegexNode<S>(builder, kind, left, right, lower, upper, set, alts, info);
return node;
}
left = left == null || left._kind != SymbolicRegexNodeKind.Or || left._isInternalizedUnion ? left : Internalize(left);
right = right == null || right._kind != SymbolicRegexNodeKind.Or || right._isInternalizedUnion ? right : Internalize(right);
- node = new(builder, kind, left, right, lower, upper, set, alts, info);
+ node = new SymbolicRegexNode<S>(builder, kind, left, right, lower, upper, set, alts, info);
builder._nodeCache[key] = node;
}
diff --git a/src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/Parallel.ForEachAsync.cs b/src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/Parallel.ForEachAsync.cs
index 8ac0b38d0bf..1b2b328e0cd 100644
--- a/src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/Parallel.ForEachAsync.cs
+++ b/src/libraries/System.Threading.Tasks.Parallel/src/System/Threading/Tasks/Parallel.ForEachAsync.cs
@@ -229,7 +229,17 @@ namespace System.Threading.Tasks
{
// Get the next element from the enumerator. This requires asynchronously locking around MoveNextAsync/Current.
TSource element;
- await state.Lock.WaitAsync(state.Cancellation.Token);
+ try
+ {
+ // TODO https://github.com/dotnet/runtime/issues/22144:
+ // Use a no-throwing await if/when one is available built-in.
+ await state.Lock.WaitAsync(state.Cancellation.Token);
+ }
+ catch (OperationCanceledException)
+ {
+ break;
+ }
+
try
{
if (!await state.Enumerator.MoveNextAsync())
diff --git a/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForEachAsyncTests.cs b/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForEachAsyncTests.cs
index 97ac99bc159..304f144bad0 100644
--- a/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForEachAsyncTests.cs
+++ b/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForEachAsyncTests.cs
@@ -912,6 +912,36 @@ namespace System.Threading.Tasks.Tests
}));
}
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ public void Exception_LockWaitAsyncCancellationDoesntPropagate()
+ {
+ static async IAsyncEnumerable<int> Iterate(Task signal)
+ {
+ for (int i = 0; ; i++)
+ {
+ if (i != 0)
+ {
+ await signal;
+ }
+ yield return i;
+ }
+ }
+
+ var signal = new TaskCompletionSource(TaskContinuationOptions.RunContinuationsAsynchronously);
+ AggregateException ae = Assert.Throws<AggregateException>(() => Parallel.ForEachAsync(Iterate(signal.Task), new ParallelOptions { MaxDegreeOfParallelism = 3 }, async (item, cancellationToken) =>
+ {
+ if (item == 0)
+ {
+ signal.SetResult();
+ throw new FormatException();
+ }
+ await Task.CompletedTask;
+ }).Wait());
+
+ Assert.Equal(1, ae.InnerExceptions.Count);
+ Assert.IsType<FormatException>(ae.InnerException);
+ }
+
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[InlineData(false)]
[InlineData(true)]
diff --git a/src/mono/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Mono.cs b/src/mono/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Mono.cs
index 76cd06739c6..b066fd7c71a 100644
--- a/src/mono/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Mono.cs
+++ b/src/mono/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Mono.cs
@@ -162,6 +162,11 @@ namespace System.Runtime.InteropServices
throw new ApplicationException($"Custom marshaler '{type.FullName}' does not implement a static GetInstance method that takes a single string parameter and returns an ICustomMarshaler.");
}
+ if (getInstanceMethod.ContainsGenericParameters)
+ {
+ throw new System.TypeLoadException($"Custom marshaler '{type.FullName}' contains unassigned generic type parameter(s).");
+ }
+
Exception? exc;
try
{
diff --git a/src/mono/mono/eventpipe/ep-rt-mono.c b/src/mono/mono/eventpipe/ep-rt-mono.c
index 9758197d4b0..c29345098d8 100644
--- a/src/mono/mono/eventpipe/ep-rt-mono.c
+++ b/src/mono/mono/eventpipe/ep-rt-mono.c
@@ -3479,10 +3479,14 @@ ep_rt_mono_write_event_exception_thrown (MonoObject *obj)
flags |= EXCEPTION_THROWN_FLAGS_IS_CLS_COMPLIANT;
if (exception->inner_ex)
flags |= EXCEPTION_THROWN_FLAGS_HAS_INNER;
- exception_message = ep_rt_utf16_to_utf8_string (mono_string_chars_internal (exception->message), mono_string_length_internal (exception->message));
+ if (exception->message)
+ exception_message = ep_rt_utf16_to_utf8_string (mono_string_chars_internal (exception->message), mono_string_length_internal (exception->message));
hresult = exception->hresult;
}
+ if (exception_message == NULL)
+ exception_message = g_strdup ("");
+
if (mono_get_eh_callbacks ()->mono_walk_stack_with_ctx)
mono_get_eh_callbacks ()->mono_walk_stack_with_ctx (get_exception_ip_func, NULL, MONO_UNWIND_SIGNAL_SAFE, (void *)&ip);
diff --git a/src/mono/mono/metadata/cominterop.c b/src/mono/mono/metadata/cominterop.c
index f1de0bfb26f..c380c0a3fe0 100644
--- a/src/mono/mono/metadata/cominterop.c
+++ b/src/mono/mono/metadata/cominterop.c
@@ -182,6 +182,31 @@ typedef struct {
MonoCCW* ccw;
} MonoCCWInterface;
+/*
+ * COM Callable Wrappers
+ *
+ * CCWs may be called on threads that aren't attached to the runtime, they can
+ * then run managed code or the method implementations may use coop handles.
+ * Use the macros below to setup the thread state.
+ *
+ * For managed methods, the runtime marshaling wrappers handle attaching and
+ * coop state switching.
+ */
+
+#define MONO_CCW_CALL_ENTER do { \
+ gpointer dummy; \
+ gpointer orig_domain = mono_threads_attach_coop (mono_domain_get (), &dummy); \
+ MONO_ENTER_GC_UNSAFE; \
+ HANDLE_FUNCTION_ENTER (); \
+ do {} while (0)
+
+#define MONO_CCW_CALL_EXIT \
+ HANDLE_FUNCTION_RETURN (); \
+ MONO_EXIT_GC_UNSAFE; \
+ mono_threads_detach_coop (orig_domain, &dummy); \
+ } while (0)
+
+
/* IUnknown */
static int STDCALL cominterop_ccw_addref (MonoCCWInterface* ccwe);
@@ -2104,12 +2129,16 @@ cominterop_get_ccw_method (MonoClass *iface, MonoMethod *method, MonoError *erro
cominterop_setup_marshal_context (&m, adjust_method);
m.mb = mb;
m.runtime_marshalling_enabled = TRUE;
- mono_marshal_emit_managed_wrapper (mb, sig_adjusted, mspecs, &m, adjust_method, 0);
- mono_cominterop_lock ();
- wrapper_method = mono_mb_create_method (mb, m.csig, m.csig->param_count + 16);
- mono_cominterop_unlock ();
+ mono_marshal_emit_managed_wrapper (mb, sig_adjusted, mspecs, &m, adjust_method, 0, error);
- gpointer ret = mono_compile_method_checked (wrapper_method, error);
+ gpointer ret = NULL;
+ if (is_ok (error)) {
+ mono_cominterop_lock ();
+ wrapper_method = mono_mb_create_method (mb, m.csig, m.csig->param_count + 16);
+ mono_cominterop_unlock ();
+
+ ret = mono_compile_method_checked (wrapper_method, error);
+ }
mono_mb_free (mb);
for (param_index = sig_adjusted->param_count; param_index >= 0; param_index--)
@@ -2612,12 +2641,9 @@ static int STDCALL
cominterop_ccw_addref (MonoCCWInterface* ccwe)
{
int result;
- gpointer dummy;
- gpointer orig_domain = mono_threads_attach_coop (mono_domain_get (), &dummy);
- MONO_ENTER_GC_UNSAFE;
+ MONO_CCW_CALL_ENTER;
result = cominterop_ccw_addref_impl (ccwe);
- MONO_EXIT_GC_UNSAFE;
- mono_threads_detach_coop (orig_domain, &dummy);
+ MONO_CCW_CALL_EXIT;
return result;
}
@@ -2646,12 +2672,9 @@ static int STDCALL
cominterop_ccw_release (MonoCCWInterface* ccwe)
{
int result;
- gpointer dummy;
- gpointer orig_domain = mono_threads_attach_coop (mono_domain_get (), &dummy);
- MONO_ENTER_GC_UNSAFE;
+ MONO_CCW_CALL_ENTER;
result = cominterop_ccw_release_impl (ccwe);
- MONO_EXIT_GC_UNSAFE;
- mono_threads_detach_coop (orig_domain, &dummy);
+ MONO_CCW_CALL_EXIT;
return result;
}
@@ -2698,12 +2721,9 @@ static int STDCALL
cominterop_ccw_queryinterface (MonoCCWInterface* ccwe, const guint8* riid, gpointer* ppv)
{
int result;
- gpointer dummy;
- gpointer orig_domain = mono_threads_attach_coop (mono_domain_get (), &dummy);
- MONO_ENTER_GC_UNSAFE;
+ MONO_CCW_CALL_ENTER;
result = cominterop_ccw_queryinterface_impl (ccwe, riid, ppv);
- MONO_EXIT_GC_UNSAFE;
- mono_threads_detach_coop (orig_domain, &dummy);
+ MONO_CCW_CALL_EXIT;
return result;
}
@@ -2821,12 +2841,9 @@ cominterop_ccw_get_ids_of_names (MonoCCWInterface* ccwe, gpointer riid,
guint32 lcid, gint32 *rgDispId)
{
int result;
- gpointer dummy;
- gpointer orig_domain = mono_threads_attach_coop (mono_domain_get(), &dummy);
- MONO_ENTER_GC_UNSAFE;
+ MONO_CCW_CALL_ENTER;
result = cominterop_ccw_get_ids_of_names_impl (ccwe, riid, rgszNames, cNames, lcid, rgDispId);
- MONO_EXIT_GC_UNSAFE;
- mono_threads_detach_coop (orig_domain, &dummy);
+ MONO_CCW_CALL_EXIT;
return result;
}
@@ -2936,8 +2953,9 @@ static SafeArrayCreateFunc safe_array_create_ms = NULL;
static gboolean
init_com_provider_ms (void)
{
+ ERROR_DECL (error);
+
static gboolean initialized = FALSE;
- char *error_msg;
MonoDl *module = NULL;
const char* scope = "liboleaut32.so";
@@ -2948,78 +2966,90 @@ init_com_provider_ms (void)
return TRUE;
}
- module = mono_dl_open(scope, MONO_DL_LAZY, &error_msg);
- if (error_msg) {
- g_warning ("Error loading COM support library '%s': %s", scope, error_msg);
+ module = mono_dl_open (scope, MONO_DL_LAZY, error);
+ if (!module) {
+ g_warning ("Error loading COM support library '%s': %s", scope, mono_error_get_message_without_fields (error));
+ mono_error_cleanup (error);
g_assert_not_reached ();
return FALSE;
}
- error_msg = mono_dl_symbol (module, "SysAllocStringLen", (gpointer*)&sys_alloc_string_len_ms);
- if (error_msg) {
- g_warning ("Error loading entry point '%s' in COM support library '%s': %s", "SysAllocStringLen", scope, error_msg);
+
+ sys_alloc_string_len_ms = (SysAllocStringLenFunc)mono_dl_symbol (module, "SysAllocStringLen", error);
+ if (!sys_alloc_string_len_ms) {
+ g_warning ("Error loading entry point '%s' in COM support library '%s': %s", "SysAllocStringLen", scope, mono_error_get_message_without_fields (error));
+ mono_error_cleanup (error);
g_assert_not_reached ();
return FALSE;
}
- error_msg = mono_dl_symbol (module, "SysStringLen", (gpointer*)&sys_string_len_ms);
- if (error_msg) {
- g_warning ("Error loading entry point '%s' in COM support library '%s': %s", "SysStringLen", scope, error_msg);
+ sys_string_len_ms = (SysStringLenFunc)mono_dl_symbol (module, "SysStringLen", error);
+ if (!sys_string_len_ms) {
+ g_warning ("Error loading entry point '%s' in COM support library '%s': %s", "SysStringLen", scope, mono_error_get_message_without_fields (error));
+ mono_error_cleanup (error);
g_assert_not_reached ();
return FALSE;
}
- error_msg = mono_dl_symbol (module, "SysFreeString", (gpointer*)&sys_free_string_ms);
- if (error_msg) {
- g_warning ("Error loading entry point '%s' in COM support library '%s': %s", "SysFreeString", scope, error_msg);
+ sys_free_string_ms = (SysFreeStringFunc)mono_dl_symbol (module, "SysFreeString", error);
+ if (!sys_free_string_ms) {
+ g_warning ("Error loading entry point '%s' in COM support library '%s': %s", "SysFreeString", scope, mono_error_get_message_without_fields (error));
+ mono_error_cleanup (error);
g_assert_not_reached ();
return FALSE;
}
- error_msg = mono_dl_symbol (module, "SafeArrayGetDim", (gpointer*)&safe_array_get_dim_ms);
- if (error_msg) {
- g_warning ("Error loading entry point '%s' in COM support library '%s': %s", "SafeArrayGetDim", scope, error_msg);
+ safe_array_get_dim_ms = (SafeArrayGetDimFunc)mono_dl_symbol (module, "SafeArrayGetDim", error);
+ if (!safe_array_get_dim_ms) {
+ g_warning ("Error loading entry point '%s' in COM support library '%s': %s", "SafeArrayGetDim", scope, mono_error_get_message_without_fields (error));
+ mono_error_cleanup (error);
g_assert_not_reached ();
return FALSE;
}
- error_msg = mono_dl_symbol (module, "SafeArrayGetLBound", (gpointer*)&safe_array_get_lbound_ms);
- if (error_msg) {
- g_warning ("Error loading entry point '%s' in COM support library '%s': %s", "SafeArrayGetLBound", scope, error_msg);
+ safe_array_get_lbound_ms = (SafeArrayGetLBoundFunc)mono_dl_symbol (module, "SafeArrayGetLBound", error);
+ if (!safe_array_get_lbound_ms) {
+ g_warning ("Error loading entry point '%s' in COM support library '%s': %s", "SafeArrayGetLBound", scope, mono_error_get_message_without_fields (error));
+ mono_error_cleanup (error);
g_assert_not_reached ();
return FALSE;
}
- error_msg = mono_dl_symbol (module, "SafeArrayGetUBound", (gpointer*)&safe_array_get_ubound_ms);
- if (error_msg) {
- g_warning ("Error loading entry point '%s' in COM support library '%s': %s", "SafeArrayGetUBound", scope, error_msg);
+ safe_array_get_ubound_ms = (SafeArrayGetUBoundFunc)mono_dl_symbol (module, "SafeArrayGetUBound", error);
+ if (!safe_array_get_ubound_ms) {
+ g_warning ("Error loading entry point '%s' in COM support library '%s': %s", "SafeArrayGetUBound", scope, mono_error_get_message_without_fields (error));
+ mono_error_cleanup (error);
g_assert_not_reached ();
return FALSE;
}
- error_msg = mono_dl_symbol (module, "SafeArrayPtrOfIndex", (gpointer*)&safe_array_ptr_of_index_ms);
- if (error_msg) {
- g_warning ("Error loading entry point '%s' in COM support library '%s': %s", "SafeArrayPtrOfIndex", scope, error_msg);
+ safe_array_ptr_of_index_ms = (SafeArrayPtrOfIndexFunc)mono_dl_symbol (module, "SafeArrayPtrOfIndex", error);
+ if (!safe_array_ptr_of_index_ms) {
+ g_warning ("Error loading entry point '%s' in COM support library '%s': %s", "SafeArrayPtrOfIndex", scope, mono_error_get_message_without_fields (error));
+ mono_error_cleanup (error);
g_assert_not_reached ();
return FALSE;
}
- error_msg = mono_dl_symbol (module, "SafeArrayDestroy", (gpointer*)&safe_array_destroy_ms);
- if (error_msg) {
- g_warning ("Error loading entry point '%s' in COM support library '%s': %s", "SafeArrayDestroy", scope, error_msg);
+ safe_array_destroy_ms = (SafeArrayDestroyFunc)mono_dl_symbol (module, "SafeArrayDestroy", error);
+ if (!safe_array_destroy_ms) {
+ g_warning ("Error loading entry point '%s' in COM support library '%s': %s", "SafeArrayDestroy", scope, mono_error_get_message_without_fields (error));
+ mono_error_cleanup (error);
g_assert_not_reached ();
return FALSE;
}
- error_msg = mono_dl_symbol (module, "SafeArrayPutElement", (gpointer*)&safe_array_put_element_ms);
- if (error_msg) {
- g_warning ("Error loading entry point '%s' in COM support library '%s': %s", "SafeArrayPutElement", scope, error_msg);
+ safe_array_put_element_ms = (SafeArrayPutElementFunc)mono_dl_symbol (module, "SafeArrayPutElement", error);
+ if (!safe_array_put_element_ms) {
+ g_warning ("Error loading entry point '%s' in COM support library '%s': %s", "SafeArrayPutElement", scope, mono_error_get_message_without_fields (error));
+ mono_error_cleanup (error);
g_assert_not_reached ();
return FALSE;
}
- error_msg = mono_dl_symbol (module, "SafeArrayCreate", (gpointer*)&safe_array_create_ms);
- if (error_msg) {
- g_warning ("Error loading entry point '%s' in COM support library '%s': %s", "SafeArrayCreate", scope, error_msg);
+ safe_array_create_ms = (SafeArrayCreateFunc)mono_dl_symbol (module, "SafeArrayCreate", error);
+ if (!safe_array_create_ms) {
+ g_warning ("Error loading entry point '%s' in COM support library '%s': %s", "SafeArrayCreate", scope, mono_error_get_message_without_fields (error));
+ mono_error_cleanup (error);
g_assert_not_reached ();
return FALSE;
}
diff --git a/src/mono/mono/metadata/components.c b/src/mono/mono/metadata/components.c
index 3750bbf33b3..f6f94a0b507 100644
--- a/src/mono/mono/metadata/components.c
+++ b/src/mono/mono/metadata/components.c
@@ -120,13 +120,12 @@ load_component_entrypoint (MonoComponentLibrary *component_lib, const MonoCompon
{
char *component_init = component_init_name (component);
gpointer sym = NULL;
- char *error_msg = mono_dl_symbol (component_lib->lib, component_init, &sym);
- if (error_msg) {
- mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_DLLIMPORT, "Component %s library does not have symbol %s: %s", component->name, component_init, error_msg);
- g_free (error_msg);
- g_free (component_init);
- return NULL;
- }
+
+ ERROR_DECL (symbol_error);
+ sym = mono_dl_symbol (component_lib->lib, component_init, symbol_error);
+ if (!sym)
+ mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_DLLIMPORT, "Component %s library does not have symbol %s: %s", component->name, component_init, mono_error_get_message_without_fields (symbol_error));
+ mono_error_cleanup (symbol_error);
g_free (component_init);
return sym;
}
@@ -161,15 +160,14 @@ try_load (const char* dir, const MonoComponentEntry *component, const char* comp
void *iter = NULL;
while (lib == NULL && (path = mono_dl_build_platform_path (dir, component_base_lib, &iter))) {
- char *error_msg = NULL;
- lib = mono_dl_open (path, MONO_DL_EAGER | MONO_DL_LOCAL, &error_msg);
- if (!lib) {
- mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_DLLIMPORT, "Component library %s not found at %s: %s", component_base_lib, path, error_msg);
- g_free (error_msg);
- } else {
+ ERROR_DECL (load_error);
+ lib = mono_dl_open (path, MONO_DL_EAGER | MONO_DL_LOCAL, load_error);
+ if (!lib)
+ mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_DLLIMPORT, "Component library %s not found at %s: %s", component_base_lib, path, mono_error_get_message_without_fields (load_error));
+ else
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_DLLIMPORT, "Component library %s found at %s", component_base_lib, path);
- }
g_free (path);
+ mono_error_cleanup (load_error);
}
return lib;
diff --git a/src/mono/mono/metadata/jit-icall-reg.h b/src/mono/mono/metadata/jit-icall-reg.h
index 29f68ff092f..e5637404088 100644
--- a/src/mono/mono/metadata/jit-icall-reg.h
+++ b/src/mono/mono/metadata/jit-icall-reg.h
@@ -316,6 +316,7 @@ MONO_JIT_ICALL (mono_value_copy_internal) \
MONO_JIT_ICALL (mono_x86_start_gsharedvt_call) \
MONO_JIT_ICALL (mono_x86_throw_corlib_exception) \
MONO_JIT_ICALL (mono_x86_throw_exception) \
+MONO_JIT_ICALL (mini_init_method_rgctx) \
MONO_JIT_ICALL (native_to_interp_trampoline) \
MONO_JIT_ICALL (personality) \
MONO_JIT_ICALL (pthread_getspecific) \
diff --git a/src/mono/mono/metadata/marshal-ilgen.c b/src/mono/mono/metadata/marshal-ilgen.c
index c74ce991a80..061e8138155 100644
--- a/src/mono/mono/metadata/marshal-ilgen.c
+++ b/src/mono/mono/metadata/marshal-ilgen.c
@@ -1973,6 +1973,46 @@ gc_safe_transition_builder_cleanup (GCSafeTransitionBuilder *builder)
#endif
}
+static gboolean
+emit_native_wrapper_validate_signature (MonoMethodBuilder *mb, MonoMethodSignature* sig, MonoMarshalSpec** mspecs)
+{
+ if (mspecs) {
+ for (int i = 0; i < sig->param_count; i ++) {
+ if (mspecs [i + 1] && mspecs [i + 1]->native == MONO_NATIVE_CUSTOM) {
+ if (!mspecs [i + 1]->data.custom_data.custom_name || strlen (mspecs [i + 1]->data.custom_data.custom_name) == 0) {
+ mono_mb_emit_exception_full (mb, "System", "TypeLoadException", g_strdup ("Missing ICustomMarshaler type"));
+ return FALSE;
+ }
+
+ switch (sig->params[i]->type) {
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_VALUETYPE:
+ break;
+
+ default:
+ mono_mb_emit_exception_full (mb, "System.Runtime.InteropServices", "MarshalDirectiveException", g_strdup_printf ("custom marshalling of type %x is currently not supported", sig->params[i]->type));
+ return FALSE;
+ }
+ }
+ else if (sig->params[i]->type == MONO_TYPE_VALUETYPE) {
+ MonoMarshalType *marshal_type = mono_marshal_load_type_info (mono_class_from_mono_type_internal (sig->params [i]));
+ for (int field_idx = 0; field_idx < marshal_type->num_fields; ++field_idx) {
+ if (marshal_type->fields [field_idx].mspec && marshal_type->fields [field_idx].mspec->native == MONO_NATIVE_CUSTOM) {
+ mono_mb_emit_exception_full (mb, "System", "TypeLoadException", g_strdup ("Value type includes custom marshaled fields"));
+ return FALSE;
+ }
+ }
+ }
+ }
+ }
+
+ return TRUE;
+}
+
/**
* emit_native_wrapper_ilgen:
* \param image the image to use for looking up custom marshallers
@@ -2012,6 +2052,9 @@ emit_native_wrapper_ilgen (MonoImage *image, MonoMethodBuilder *mb, MonoMethodSi
m.sig = sig;
m.piinfo = piinfo;
+ if (!emit_native_wrapper_validate_signature (mb, sig, mspecs))
+ return;
+
if (!skip_gc_trans)
need_gc_safe = gc_safe_transition_builder_init (&gc_safe_transition_builder, mb, func_param);
@@ -4560,6 +4603,31 @@ emit_marshal_custom_get_instance (MonoMethodBuilder *mb, MonoClass *klass, MonoM
}
static int
+emit_marshal_custom_ilgen_throw_exception (MonoMethodBuilder *mb, const char *exc_nspace, const char *exc_name, const char *msg, MarshalAction action)
+{
+ /* Throw exception and emit compensation code, if neccesary */
+ switch (action) {
+ case MARSHAL_ACTION_CONV_IN:
+ case MARSHAL_ACTION_MANAGED_CONV_IN:
+ case MARSHAL_ACTION_CONV_RESULT:
+ case MARSHAL_ACTION_MANAGED_CONV_RESULT:
+ if ((action == MARSHAL_ACTION_CONV_RESULT) || (action == MARSHAL_ACTION_MANAGED_CONV_RESULT))
+ mono_mb_emit_byte (mb, CEE_POP);
+
+ mono_mb_emit_exception_full (mb, exc_nspace, exc_name, msg);
+
+ break;
+ case MARSHAL_ACTION_PUSH:
+ mono_mb_emit_byte (mb, CEE_LDNULL);
+ break;
+ default:
+ break;
+ }
+
+ return 0;
+}
+
+static int
emit_marshal_custom_ilgen (EmitMarshalContext *m, int argnum, MonoType *t,
MonoMarshalSpec *spec,
int conv_arg, MonoType **conv_arg_type,
@@ -4581,27 +4649,8 @@ emit_marshal_custom_ilgen (EmitMarshalContext *m, int argnum, MonoType *t,
if (!ICustomMarshaler) {
MonoClass *klass = mono_class_try_get_icustom_marshaler_class ();
- if (!klass) {
- char *exception_msg = g_strdup ("Current profile doesn't support ICustomMarshaler");
- /* Throw exception and emit compensation code if neccesary */
- switch (action) {
- case MARSHAL_ACTION_CONV_IN:
- case MARSHAL_ACTION_CONV_RESULT:
- case MARSHAL_ACTION_MANAGED_CONV_RESULT:
- if ((action == MARSHAL_ACTION_CONV_RESULT) || (action == MARSHAL_ACTION_MANAGED_CONV_RESULT))
- mono_mb_emit_byte (mb, CEE_POP);
-
- mono_mb_emit_exception_full (mb, "System", "ApplicationException", exception_msg);
-
- break;
- case MARSHAL_ACTION_PUSH:
- mono_mb_emit_byte (mb, CEE_LDNULL);
- break;
- default:
- break;
- }
- return 0;
- }
+ if (!klass)
+ return emit_marshal_custom_ilgen_throw_exception (mb, "System", "ApplicationException", g_strdup ("Current profile doesn't support ICustomMarshaler"), action);
cleanup_native = get_method_nofail (klass, "CleanUpNativeData", 1, 0);
g_assert (cleanup_native);
@@ -4624,8 +4673,9 @@ emit_marshal_custom_ilgen (EmitMarshalContext *m, int argnum, MonoType *t,
else
mtype = mono_reflection_type_from_name_checked (spec->data.custom_data.custom_name, alc, m->image, error);
- g_assert (mtype != NULL);
- mono_error_assert_ok (error);
+ if (!mtype)
+ return emit_marshal_custom_ilgen_throw_exception (mb, "System", "TypeLoadException", g_strdup ("Failed to load ICustomMarshaler type"), action);
+
mklass = mono_class_from_mono_type_internal (mtype);
g_assert (mklass != NULL);
@@ -4691,29 +4741,45 @@ emit_marshal_custom_ilgen (EmitMarshalContext *m, int argnum, MonoType *t,
mono_mb_emit_ldloc (mb, conv_arg);
pos2 = mono_mb_emit_branch (mb, CEE_BRFALSE);
- if (m_type_is_byref (t)) {
+ if (m_type_is_byref (t) && !(t->attrs & PARAM_ATTRIBUTE_OUT)) {
mono_mb_emit_ldarg (mb, argnum);
emit_marshal_custom_get_instance (mb, mklass, spec);
+ mono_mb_emit_byte (mb, CEE_DUP);
+
+ mono_mb_emit_ldarg (mb, argnum);
+ mono_mb_emit_byte (mb, CEE_LDIND_REF);
+ mono_mb_emit_op (mb, CEE_CALLVIRT, cleanup_managed);
mono_mb_emit_ldloc (mb, conv_arg);
mono_mb_emit_op (mb, CEE_CALLVIRT, marshal_native_to_managed);
mono_mb_emit_byte (mb, CEE_STIND_REF);
- } else if (t->attrs & PARAM_ATTRIBUTE_OUT) {
+ } else if (m_type_is_byref (t) && (t->attrs & PARAM_ATTRIBUTE_OUT)) {
+ mono_mb_emit_ldarg (mb, argnum);
+
emit_marshal_custom_get_instance (mb, mklass, spec);
mono_mb_emit_ldloc (mb, conv_arg);
mono_mb_emit_op (mb, CEE_CALLVIRT, marshal_native_to_managed);
+ mono_mb_emit_byte (mb, CEE_STIND_REF);
+ } else if (t->attrs & PARAM_ATTRIBUTE_OUT) {
+ emit_marshal_custom_get_instance (mb, mklass, spec);
+ mono_mb_emit_ldloc (mb, conv_arg);
+ mono_mb_emit_op (mb, CEE_CALLVIRT, marshal_native_to_managed);
/* We have nowhere to store the result */
mono_mb_emit_byte (mb, CEE_POP);
}
- emit_marshal_custom_get_instance (mb, mklass, spec);
+ // Only call cleanup_native if MARSHAL_ACTION_CONV_IN called marshal_managed_to_native.
+ if (!(m_type_is_byref (t) && (t->attrs & PARAM_ATTRIBUTE_OUT)) &&
+ !(!m_type_is_byref (t) && (t->attrs & PARAM_ATTRIBUTE_OUT) && !(t->attrs & PARAM_ATTRIBUTE_IN))) {
+ emit_marshal_custom_get_instance (mb, mklass, spec);
- mono_mb_emit_ldloc (mb, conv_arg);
+ mono_mb_emit_ldloc (mb, conv_arg);
- mono_mb_emit_op (mb, CEE_CALLVIRT, cleanup_native);
+ mono_mb_emit_op (mb, CEE_CALLVIRT, cleanup_native);
+ }
mono_mb_patch_branch (mb, pos2);
break;
@@ -4726,31 +4792,38 @@ emit_marshal_custom_ilgen (EmitMarshalContext *m, int argnum, MonoType *t,
break;
case MARSHAL_ACTION_CONV_RESULT:
- loc1 = mono_mb_add_local (mb, int_type);
-
mono_mb_emit_stloc (mb, 3);
- mono_mb_emit_ldloc (mb, 3);
- mono_mb_emit_stloc (mb, loc1);
-
/* Check for null */
mono_mb_emit_ldloc (mb, 3);
pos2 = mono_mb_emit_branch (mb, CEE_BRFALSE);
emit_marshal_custom_get_instance (mb, mklass, spec);
- mono_mb_emit_byte (mb, CEE_DUP);
mono_mb_emit_ldloc (mb, 3);
mono_mb_emit_op (mb, CEE_CALLVIRT, marshal_native_to_managed);
mono_mb_emit_stloc (mb, 3);
- mono_mb_emit_ldloc (mb, loc1);
- mono_mb_emit_op (mb, CEE_CALLVIRT, cleanup_native);
-
mono_mb_patch_branch (mb, pos2);
break;
case MARSHAL_ACTION_MANAGED_CONV_IN:
+ switch (t->type) {
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_VALUETYPE:
+ case MONO_TYPE_BOOLEAN:
+ break;
+
+ default:
+ g_warning ("custom marshalling of type %x is currently not supported", t->type);
+ g_assert_not_reached ();
+ break;
+ }
+
conv_arg = mono_mb_add_local (mb, object_type);
mono_mb_emit_byte (mb, CEE_LDNULL);
@@ -4820,11 +4893,12 @@ emit_marshal_custom_ilgen (EmitMarshalContext *m, int argnum, MonoType *t,
mono_mb_emit_byte (mb, CEE_STIND_I);
}
- /* Call CleanUpManagedData */
- emit_marshal_custom_get_instance (mb, mklass, spec);
-
- mono_mb_emit_ldloc (mb, conv_arg);
- mono_mb_emit_op (mb, CEE_CALLVIRT, cleanup_managed);
+ // Only call cleanup_managed if MARSHAL_ACTION_MANAGED_CONV_IN called marshal_native_to_managed.
+ if (!(m_type_is_byref (t) && (t->attrs & PARAM_ATTRIBUTE_OUT))) {
+ emit_marshal_custom_get_instance (mb, mklass, spec);
+ mono_mb_emit_ldloc (mb, conv_arg);
+ mono_mb_emit_op (mb, CEE_CALLVIRT, cleanup_managed);
+ }
mono_mb_patch_branch (mb, pos2);
break;
@@ -6202,8 +6276,48 @@ emit_marshal_variant_ilgen (EmitMarshalContext *m, int argnum, MonoType *t,
return conv_arg;
}
+static gboolean
+emit_managed_wrapper_validate_signature (MonoMethodSignature* sig, MonoMarshalSpec** mspecs, MonoError* error)
+{
+ if (mspecs) {
+ for (int i = 0; i < sig->param_count; i ++) {
+ if (mspecs [i + 1] && mspecs [i + 1]->native == MONO_NATIVE_CUSTOM) {
+ if (!mspecs [i + 1]->data.custom_data.custom_name || strlen (mspecs [i + 1]->data.custom_data.custom_name) == 0) {
+ mono_error_set_generic_error (error, "System", "TypeLoadException", "Missing ICustomMarshaler type");
+ return FALSE;
+ }
+
+ switch (sig->params[i]->type) {
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_VALUETYPE:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_BOOLEAN:
+ break;
+ default:
+ mono_error_set_generic_error (error, "System.Runtime.InteropServices", "MarshalDirectiveException", "custom marshalling of type %x is currently not supported", sig->params[i]->type);
+ return FALSE;
+ }
+ } else if (sig->params[i]->type == MONO_TYPE_VALUETYPE) {
+ MonoClass *klass = mono_class_from_mono_type_internal (sig->params [i]);
+ MonoMarshalType *marshal_type = mono_marshal_load_type_info (klass);
+ for (int field_idx = 0; field_idx < marshal_type->num_fields; ++field_idx) {
+ if (marshal_type->fields [field_idx].mspec && marshal_type->fields [field_idx].mspec->native == MONO_NATIVE_CUSTOM) {
+ mono_error_set_type_load_class (error, klass, "Value type includes custom marshaled fields");
+ return FALSE;
+ }
+ }
+ }
+ }
+ }
+
+ return TRUE;
+}
+
static void
-emit_managed_wrapper_ilgen (MonoMethodBuilder *mb, MonoMethodSignature *invoke_sig, MonoMarshalSpec **mspecs, EmitMarshalContext* m, MonoMethod *method, MonoGCHandle target_handle)
+emit_managed_wrapper_ilgen (MonoMethodBuilder *mb, MonoMethodSignature *invoke_sig, MonoMarshalSpec **mspecs, EmitMarshalContext* m, MonoMethod *method, MonoGCHandle target_handle, MonoError *error)
{
MonoMethodSignature *sig, *csig;
int i, *tmp_locals, orig_domain, attach_cookie;
@@ -6212,6 +6326,9 @@ emit_managed_wrapper_ilgen (MonoMethodBuilder *mb, MonoMethodSignature *invoke_s
sig = m->sig;
csig = m->csig;
+ if (!emit_managed_wrapper_validate_signature (sig, mspecs, error))
+ return;
+
MonoType *int_type = mono_get_int_type ();
MonoType *boolean_type = m_class_get_byval_arg (mono_defaults.boolean_class);
/* allocate local 0 (pointer) src_ptr */
@@ -6278,20 +6395,25 @@ emit_managed_wrapper_ilgen (MonoMethodBuilder *mb, MonoMethodSignature *invoke_s
tmp_locals = g_newa (int, sig->param_count);
for (i = 0; i < sig->param_count; i ++) {
MonoType *t = sig->params [i];
+ MonoMarshalSpec *spec = mspecs [i + 1];
- switch (t->type) {
- case MONO_TYPE_OBJECT:
- case MONO_TYPE_CLASS:
- case MONO_TYPE_VALUETYPE:
- case MONO_TYPE_ARRAY:
- case MONO_TYPE_SZARRAY:
- case MONO_TYPE_STRING:
- case MONO_TYPE_BOOLEAN:
- tmp_locals [i] = mono_emit_marshal (m, i, sig->params [i], mspecs [i + 1], 0, &csig->params [i], MARSHAL_ACTION_MANAGED_CONV_IN);
- break;
- default:
- tmp_locals [i] = 0;
- break;
+ if (spec && spec->native == MONO_NATIVE_CUSTOM) {
+ tmp_locals [i] = mono_emit_marshal (m, i, t, mspecs [i + 1], 0, &csig->params [i], MARSHAL_ACTION_MANAGED_CONV_IN);
+ } else {
+ switch (t->type) {
+ case MONO_TYPE_OBJECT:
+ case MONO_TYPE_CLASS:
+ case MONO_TYPE_VALUETYPE:
+ case MONO_TYPE_ARRAY:
+ case MONO_TYPE_SZARRAY:
+ case MONO_TYPE_STRING:
+ case MONO_TYPE_BOOLEAN:
+ tmp_locals [i] = mono_emit_marshal (m, i, t, mspecs [i + 1], 0, &csig->params [i], MARSHAL_ACTION_MANAGED_CONV_IN);
+ break;
+ default:
+ tmp_locals [i] = 0;
+ break;
+ }
}
}
diff --git a/src/mono/mono/metadata/marshal-noilgen.c b/src/mono/mono/metadata/marshal-noilgen.c
index 9aea7216fd7..67350404c28 100644
--- a/src/mono/mono/metadata/marshal-noilgen.c
+++ b/src/mono/mono/metadata/marshal-noilgen.c
@@ -174,7 +174,7 @@ emit_marshal_variant_noilgen (EmitMarshalContext *m, int argnum, MonoType *t,
#ifndef ENABLE_ILGEN
static void
-emit_managed_wrapper_noilgen (MonoMethodBuilder *mb, MonoMethodSignature *invoke_sig, MonoMarshalSpec **mspecs, EmitMarshalContext* m, MonoMethod *method, MonoGCHandle target_handle)
+emit_managed_wrapper_noilgen (MonoMethodBuilder *mb, MonoMethodSignature *invoke_sig, MonoMarshalSpec **mspecs, EmitMarshalContext* m, MonoMethod *method, MonoGCHandle target_handle, MonoError *error)
{
MonoMethodSignature *sig, *csig;
int i;
diff --git a/src/mono/mono/metadata/marshal.c b/src/mono/mono/metadata/marshal.c
index 9eda19e9c05..2aec43d6439 100644
--- a/src/mono/mono/metadata/marshal.c
+++ b/src/mono/mono/metadata/marshal.c
@@ -3837,9 +3837,9 @@ mono_marshal_get_native_func_wrapper_indirect (MonoClass *caller_class, MonoMeth
* THIS_LOC is the memory location where the target of the delegate is stored.
*/
void
-mono_marshal_emit_managed_wrapper (MonoMethodBuilder *mb, MonoMethodSignature *invoke_sig, MonoMarshalSpec **mspecs, EmitMarshalContext* m, MonoMethod *method, MonoGCHandle target_handle)
+mono_marshal_emit_managed_wrapper (MonoMethodBuilder *mb, MonoMethodSignature *invoke_sig, MonoMarshalSpec **mspecs, EmitMarshalContext* m, MonoMethod *method, MonoGCHandle target_handle, MonoError *error)
{
- get_marshal_cb ()->emit_managed_wrapper (mb, invoke_sig, mspecs, m, method, target_handle);
+ get_marshal_cb ()->emit_managed_wrapper (mb, invoke_sig, mspecs, m, method, target_handle, error);
}
static gboolean
@@ -4121,23 +4121,27 @@ mono_marshal_get_managed_wrapper (MonoMethod *method, MonoClass *delegate_klass,
mono_custom_attrs_free (cinfo);
}
- mono_marshal_emit_managed_wrapper (mb, invoke_sig, mspecs, &m, method, target_handle);
+ mono_marshal_emit_managed_wrapper (mb, invoke_sig, mspecs, &m, method, target_handle, error);
- if (!target_handle) {
- WrapperInfo *info;
+ res = NULL;
+ if (is_ok (error)) {
+ if (!target_handle) {
+ WrapperInfo *info;
- // FIXME: Associate it with the method+delegate_klass pair
- info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE);
- info->d.native_to_managed.method = method;
- info->d.native_to_managed.klass = delegate_klass;
+ // FIXME: Associate it with the method+delegate_klass pair
+ info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_NONE);
+ info->d.native_to_managed.method = method;
+ info->d.native_to_managed.klass = delegate_klass;
- res = mono_mb_create_and_cache_full (cache, method,
- mb, csig, sig->param_count + 16,
- info, NULL);
- } else {
- get_marshal_cb ()->mb_set_dynamic (mb);
- res = mono_mb_create (mb, csig, sig->param_count + 16, NULL);
+ res = mono_mb_create_and_cache_full (cache, method,
+ mb, csig, sig->param_count + 16,
+ info, NULL);
+ } else {
+ get_marshal_cb ()->mb_set_dynamic (mb);
+ res = mono_mb_create (mb, csig, sig->param_count + 16, NULL);
+ }
}
+
mono_mb_free (mb);
for (i = invoke_sig->param_count; i >= 0; i--)
@@ -4198,7 +4202,8 @@ mono_marshal_get_vtfixup_ftnptr (MonoImage *image, guint32 token, guint16 type)
/* FIXME: Implement VTFIXUP_TYPE_FROM_UNMANAGED_RETAIN_APPDOMAIN. */
- mono_marshal_emit_managed_wrapper (mb, sig, mspecs, &m, method, 0);
+ mono_marshal_emit_managed_wrapper (mb, sig, mspecs, &m, method, 0, error);
+ mono_error_assert_ok (error);
get_marshal_cb ()->mb_set_dynamic (mb);
method = mono_mb_create (mb, csig, sig->param_count + 16, NULL);
@@ -5333,6 +5338,12 @@ mono_struct_delete_old (MonoClass *klass, char *ptr)
info = mono_marshal_load_type_info (klass);
+ if (info->native_size == 0)
+ return;
+
+ if (m_class_is_blittable (klass))
+ return;
+
for (i = 0; i < info->num_fields; i++) {
MonoMarshalConv conv;
MonoType *ftype = info->fields [i].field->type;
@@ -5349,7 +5360,7 @@ mono_struct_delete_old (MonoClass *klass, char *ptr)
switch (conv) {
case MONO_MARSHAL_CONV_NONE:
if (MONO_TYPE_ISSTRUCT (ftype)) {
- mono_struct_delete_old (ftype->data.klass, cpos);
+ mono_struct_delete_old (mono_class_from_mono_type_internal (ftype), cpos);
continue;
}
break;
diff --git a/src/mono/mono/metadata/marshal.h b/src/mono/mono/metadata/marshal.h
index 91bab1c8978..3d8706d241a 100644
--- a/src/mono/mono/metadata/marshal.h
+++ b/src/mono/mono/metadata/marshal.h
@@ -335,7 +335,7 @@ typedef struct {
void (*emit_stelemref) (MonoMethodBuilder *mb);
void (*emit_array_address) (MonoMethodBuilder *mb, int rank, int elem_size);
void (*emit_native_wrapper) (MonoImage *image, MonoMethodBuilder *mb, MonoMethodSignature *sig, MonoMethodPInvoke *piinfo, MonoMarshalSpec **mspecs, gpointer func, MonoNativeWrapperFlags flags);
- void (*emit_managed_wrapper) (MonoMethodBuilder *mb, MonoMethodSignature *invoke_sig, MonoMarshalSpec **mspecs, EmitMarshalContext* m, MonoMethod *method, MonoGCHandle target_handle);
+ void (*emit_managed_wrapper) (MonoMethodBuilder *mb, MonoMethodSignature *invoke_sig, MonoMarshalSpec **mspecs, EmitMarshalContext* m, MonoMethod *method, MonoGCHandle target_handle, MonoError *error);
void (*emit_runtime_invoke_body) (MonoMethodBuilder *mb, const char **param_names, MonoImage *image, MonoMethod *method, MonoMethodSignature *sig, MonoMethodSignature *callsig, gboolean virtual_, gboolean need_direct_wrapper);
void (*emit_runtime_invoke_dynamic) (MonoMethodBuilder *mb);
void (*emit_delegate_begin_invoke) (MonoMethodBuilder *mb, MonoMethodSignature *sig);
@@ -677,7 +677,7 @@ void
mono_marshal_emit_native_wrapper (MonoImage *image, MonoMethodBuilder *mb, MonoMethodSignature *sig, MonoMethodPInvoke *piinfo, MonoMarshalSpec **mspecs, gpointer func, MonoNativeWrapperFlags flags);
void
-mono_marshal_emit_managed_wrapper (MonoMethodBuilder *mb, MonoMethodSignature *invoke_sig, MonoMarshalSpec **mspecs, EmitMarshalContext* m, MonoMethod *method, MonoGCHandle target_handle);
+mono_marshal_emit_managed_wrapper (MonoMethodBuilder *mb, MonoMethodSignature *invoke_sig, MonoMarshalSpec **mspecs, EmitMarshalContext* m, MonoMethod *method, MonoGCHandle target_handle, MonoError *error);
GHashTable*
mono_marshal_get_cache (GHashTable **var, GHashFunc hash_func, GCompareFunc equal_func);
diff --git a/src/mono/mono/metadata/metadata.c b/src/mono/mono/metadata/metadata.c
index 80b55fa08ce..08a01f1d239 100644
--- a/src/mono/mono/metadata/metadata.c
+++ b/src/mono/mono/metadata/metadata.c
@@ -6805,6 +6805,8 @@ handle_enum:
else
*conv = MONO_MARSHAL_CONV_STR_BYVALSTR;
return MONO_NATIVE_BYVALTSTR;
+ case MONO_NATIVE_CUSTOM:
+ return MONO_NATIVE_CUSTOM;
default:
g_error ("Can not marshal string to native type '%02x': Invalid managed/unmanaged type combination (String fields must be paired with LPStr, LPWStr, BStr or ByValTStr).", mspec->native);
}
@@ -6819,6 +6821,9 @@ handle_enum:
}
case MONO_TYPE_PTR: return MONO_NATIVE_UINT;
case MONO_TYPE_VALUETYPE: /*FIXME*/
+ if (mspec && mspec->native == MONO_NATIVE_CUSTOM)
+ return MONO_NATIVE_CUSTOM;
+
if (m_class_is_enumtype (type->data.klass)) {
t = mono_class_enum_basetype_internal (type->data.klass)->type;
goto handle_enum;
@@ -6844,6 +6849,8 @@ handle_enum:
case MONO_NATIVE_LPARRAY:
*conv = MONO_MARSHAL_CONV_ARRAY_LPARRAY;
return MONO_NATIVE_LPARRAY;
+ case MONO_NATIVE_CUSTOM:
+ return MONO_NATIVE_CUSTOM;
default:
g_error ("cant marshal array as native type %02x", mspec->native);
}
diff --git a/src/mono/mono/metadata/native-library.c b/src/mono/mono/metadata/native-library.c
index 68823483fb2..53841e67d1f 100644
--- a/src/mono/mono/metadata/native-library.c
+++ b/src/mono/mono/metadata/native-library.c
@@ -324,7 +324,9 @@ exit:
static void
remove_cached_module (gpointer key, gpointer value, gpointer user_data)
{
- mono_dl_close((MonoDl*)value);
+ ERROR_DECL (close_error);
+ mono_dl_close((MonoDl*)value, close_error);
+ mono_error_cleanup (close_error);
}
void
@@ -355,7 +357,7 @@ static gpointer
lookup_pinvoke_call_impl (MonoMethod *method, MonoLookupPInvokeStatus *status_out);
static gpointer
-pinvoke_probe_for_symbol (MonoDl *module, MonoMethodPInvoke *piinfo, const char *import, char **error_msg_out);
+pinvoke_probe_for_symbol (MonoDl *module, MonoMethodPInvoke *piinfo, const char *import);
static void
pinvoke_probe_convert_status_for_api (MonoLookupPInvokeStatus *status, const char **exc_class, const char **exc_arg)
@@ -490,27 +492,39 @@ convert_dllimport_flags (int flags)
}
static MonoDl *
-netcore_probe_for_module_variations (const char *mdirname, const char *file_name, int raw_flags)
+netcore_probe_for_module_variations (const char *mdirname, const char *file_name, int raw_flags, MonoError *error)
{
void *iter = NULL;
char *full_name = NULL;
MonoDl *module = NULL;
+ ERROR_DECL (bad_image_error);
+
while (module == NULL && (full_name = mono_dl_build_path (mdirname, file_name, &iter))) {
- char *error_msg = NULL;
- module = mono_dl_open_full (full_name, MONO_DL_LAZY, raw_flags, &error_msg);
- if (!module) {
- mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_DLLIMPORT, "DllImport error loading library '%s': '%s'.", full_name, error_msg);
- g_free (error_msg);
- }
+ mono_error_cleanup (error);
+ error_init_reuse (error);
+ module = mono_dl_open_full (full_name, MONO_DL_LAZY, raw_flags, error);
+ if (!module)
+ mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_DLLIMPORT, "DllImport error loading library '%s': '%s'.", full_name, mono_error_get_message_without_fields (error));
g_free (full_name);
+ if (!module && !is_ok (error) && mono_error_get_error_code (error) == MONO_ERROR_BAD_IMAGE) {
+ mono_error_cleanup (bad_image_error);
+ mono_error_move (bad_image_error, error);
+ }
+ }
+
+ if (!module && !is_ok (bad_image_error)) {
+ mono_error_cleanup (error);
+ mono_error_move (error, bad_image_error);
}
+ mono_error_cleanup (bad_image_error);
+
return module;
}
static MonoDl *
-netcore_probe_for_module (MonoImage *image, const char *file_name, int flags)
+netcore_probe_for_module (MonoImage *image, const char *file_name, int flags, MonoError *error)
{
MonoDl *module = NULL;
int lflags = convert_dllimport_flags (flags);
@@ -518,28 +532,60 @@ netcore_probe_for_module (MonoImage *image, const char *file_name, int flags)
// TODO: this algorithm doesn't quite match CoreCLR, so respecting DLLIMPORTSEARCHPATH_LEGACY_BEHAVIOR makes little sense
// If the difference becomes a problem, overhaul this algorithm to match theirs exactly
+ ERROR_DECL (bad_image_error);
+
// Try without any path additions
- module = netcore_probe_for_module_variations (NULL, file_name, lflags);
+ module = netcore_probe_for_module_variations (NULL, file_name, lflags, error);
+ if (!module && !is_ok (error) && mono_error_get_error_code (error) == MONO_ERROR_BAD_IMAGE)
+ mono_error_move (bad_image_error, error);
// Check the NATIVE_DLL_SEARCH_DIRECTORIES
- for (int i = 0; i < pinvoke_search_directories_count && module == NULL; ++i)
- module = netcore_probe_for_module_variations (pinvoke_search_directories[i], file_name, lflags);
+ for (int i = 0; i < pinvoke_search_directories_count && module == NULL; ++i) {
+ mono_error_cleanup (error);
+ error_init_reuse (error);
+ module = netcore_probe_for_module_variations (pinvoke_search_directories[i], file_name, lflags, error);
+ if (!module && !is_ok (error) && mono_error_get_error_code (error) == MONO_ERROR_BAD_IMAGE) {
+ mono_error_cleanup (bad_image_error);
+ mono_error_move (bad_image_error, error);
+ }
+ }
// Check the assembly directory if the search flag is set and the image exists
if ((flags & DLLIMPORTSEARCHPATH_ASSEMBLY_DIRECTORY) != 0 && image != NULL &&
module == NULL && (image->filename != NULL)) {
+ mono_error_cleanup (error);
+ error_init_reuse (error);
char *mdirname = g_path_get_dirname (image->filename);
if (mdirname)
- module = netcore_probe_for_module_variations (mdirname, file_name, lflags);
+ module = netcore_probe_for_module_variations (mdirname, file_name, lflags, error);
g_free (mdirname);
}
// TODO: Pass remaining flags on to LoadLibraryEx on Windows where appropriate, see https://docs.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.dllimportsearchpath?view=netcore-3.1
+ if (!module && !is_ok (bad_image_error)) {
+ mono_error_cleanup (error);
+ mono_error_move (error, bad_image_error);
+ }
+
+ mono_error_cleanup (bad_image_error);
+
return module;
}
static MonoDl *
+netcore_probe_for_module_nofail (MonoImage *image, const char *file_name, int flags)
+{
+ MonoDl *result = NULL;
+
+ ERROR_DECL (error);
+ result = netcore_probe_for_module (image, file_name, flags, error);
+ mono_error_cleanup (error);
+
+ return result;
+}
+
+static MonoDl *
netcore_resolve_with_dll_import_resolver (MonoAssemblyLoadContext *alc, MonoAssembly *assembly, const char *scope, guint32 flags, MonoError *error)
{
MonoDl *result = NULL;
@@ -760,15 +806,16 @@ netcore_check_alc_cache (MonoAssemblyLoadContext *alc, const char *scope)
static MonoDl*
netcore_lookup_self_native_handle()
{
- char *error_msg = NULL;
+ ERROR_DECL (load_error);
if (!internal_module)
- internal_module = mono_dl_open_self (&error_msg);
+ internal_module = mono_dl_open_self (load_error);
+
+ if (!internal_module)
+ mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_DLLIMPORT, "DllImport error loading library '__Internal': '%s'.", mono_error_get_message_without_fields (load_error));
- if (!internal_module) {
- mono_trace (G_LOG_LEVEL_INFO, MONO_TRACE_DLLIMPORT, "DllImport error loading library '__Internal': '%s'.", error_msg);
- g_free (error_msg);
- }
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_DLLIMPORT, "Native library found via __Internal.");
+ mono_error_cleanup (load_error);
+
return internal_module;
}
@@ -838,7 +885,7 @@ netcore_lookup_native_library (MonoAssemblyLoadContext *alc, MonoImage *image, c
goto add_to_alc_cache;
}
- module = netcore_probe_for_module (image, scope, flags);
+ module = netcore_probe_for_module_nofail (image, scope, flags);
if (module) {
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_DLLIMPORT, "Native library found via filesystem probing: '%s'.", scope);
goto add_to_global_cache;
@@ -956,7 +1003,6 @@ lookup_pinvoke_call_impl (MonoMethod *method, MonoLookupPInvokeStatus *status_ou
const char *orig_scope = NULL;
const char *new_scope = NULL;
const char *error_scope = NULL;
- char *error_msg = NULL;
MonoDl *module = NULL;
gpointer addr = NULL;
@@ -1068,7 +1114,8 @@ retry_with_libcoreclr:
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_DLLIMPORT,
"DllImport searching in: '%s' ('%s').", new_scope, module->full_name);
- addr = pinvoke_probe_for_symbol (module, piinfo, new_import, &error_msg);
+
+ addr = pinvoke_probe_for_symbol (module, piinfo, new_import);
if (!addr) {
#ifndef HOST_WIN32
@@ -1090,24 +1137,22 @@ exit:
}
g_free ((char *)new_import);
g_free ((char *)new_scope);
- g_free (error_msg);
return addr;
}
static gpointer
-pinvoke_probe_for_symbol (MonoDl *module, MonoMethodPInvoke *piinfo, const char *import, char **error_msg_out)
+pinvoke_probe_for_symbol (MonoDl *module, MonoMethodPInvoke *piinfo, const char *import)
{
- char *error_msg = NULL;
gpointer addr = NULL;
- g_assert (error_msg_out);
+ ERROR_DECL (symbol_error);
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_DLLIMPORT,
"Searching for '%s'.", import);
#ifdef HOST_WIN32 // For netcore, name mangling is Windows-exclusive
if (piinfo->piflags & PINVOKE_ATTRIBUTE_NO_MANGLE)
- error_msg = mono_dl_symbol (module, import, &addr);
+ addr = mono_dl_symbol (module, import, symbol_error);
else {
/*
* Search using a variety of mangled names
@@ -1172,17 +1217,17 @@ pinvoke_probe_for_symbol (MonoDl *module, MonoMethodPInvoke *piinfo, const char
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_DLLIMPORT,
"Probing '%s'.", mangled_name);
- error_msg = mono_dl_symbol (module, mangled_name, &addr);
+ error_init_reuse (symbol_error);
+ addr = mono_dl_symbol (module, mangled_name, symbol_error);
if (addr)
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_DLLIMPORT,
"Found as '%s'.", mangled_name);
else
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_DLLIMPORT,
- "Could not find '%s' due to '%s'.", mangled_name, error_msg);
+ "Could not find '%s' due to '%s'.", mangled_name, mono_error_get_message_without_fields (symbol_error));
- g_free (error_msg);
- error_msg = NULL;
+ mono_error_cleanup (symbol_error);
if (mangled_name != import)
g_free (mangled_name);
@@ -1191,16 +1236,18 @@ pinvoke_probe_for_symbol (MonoDl *module, MonoMethodPInvoke *piinfo, const char
}
}
#else
- error_msg = mono_dl_symbol (module, import, &addr);
+ addr = mono_dl_symbol (module, import, symbol_error);
+ mono_error_cleanup (symbol_error);
#endif
- *error_msg_out = error_msg;
return addr;
}
void
ves_icall_System_Runtime_InteropServices_NativeLibrary_FreeLib (gpointer lib, MonoError *error)
{
+ ERROR_DECL (close_error);
+
MonoDl *module;
guint32 ref_count;
@@ -1220,14 +1267,22 @@ ves_icall_System_Runtime_InteropServices_NativeLibrary_FreeLib (gpointer lib, Mo
g_hash_table_remove (native_library_module_map, module->handle);
g_hash_table_add (native_library_module_blocklist, module);
- mono_dl_close (module);
+ mono_dl_close (module, close_error);
} else {
- MonoDl* raw_module = g_new0(MonoDl, 1);
- raw_module->handle = lib;
- mono_dl_close (raw_module);
+ MonoDl *raw_module = (MonoDl *) g_malloc0 (sizeof (MonoDl));
+ if (raw_module) {
+ raw_module->handle = lib;
+ mono_dl_close (raw_module, close_error);
+ }
}
leave:
+
+ if (!is_ok (close_error)) {
+ mono_error_set_invalid_operation (error, NULL);
+ mono_error_cleanup (close_error);
+ }
+
native_library_unlock ();
}
@@ -1249,15 +1304,21 @@ ves_icall_System_Runtime_InteropServices_NativeLibrary_GetSymbol (gpointer lib,
module = netcore_handle_lookup (lib);
if (module) {
- mono_dl_symbol (module, symbol_name, &symbol);
- if (!symbol)
+ symbol = mono_dl_symbol (module, symbol_name, error);
+ if (!symbol) {
+ mono_error_cleanup (error);
+ error_init_reuse (error);
mono_error_set_generic_error (error, "System", "EntryPointNotFoundException", "%s: %s", module->full_name, symbol_name);
+ }
} else {
MonoDl raw_module = { { 0 } };
raw_module.handle = lib;
- mono_dl_symbol (&raw_module, symbol_name, &symbol);
- if (!symbol)
+ symbol = mono_dl_symbol (&raw_module, symbol_name, error);
+ if (!symbol) {
+ mono_error_cleanup (error);
+ error_init_reuse (error);
mono_error_set_generic_error (error, "System", "EntryPointNotFoundException", "%p: %s", lib, symbol_name);
+ }
}
native_library_unlock ();
@@ -1302,9 +1363,18 @@ ves_icall_System_Runtime_InteropServices_NativeLibrary_LoadByName (MonoStringHan
goto_if_nok (error, leave);
// FIXME: implement search flag defaults properly
- module = netcore_probe_for_module (image, lib_name, has_search_flag ? search_flag : DLLIMPORTSEARCHPATH_ASSEMBLY_DIRECTORY);
- if (!module)
- mono_error_set_generic_error (error, "System", "DllNotFoundException", "%s", lib_name);
+ {
+ ERROR_DECL (load_error);
+ module = netcore_probe_for_module (image, lib_name, has_search_flag ? search_flag : DLLIMPORTSEARCHPATH_ASSEMBLY_DIRECTORY, load_error);
+ if (!module) {
+ if (mono_error_get_error_code (load_error) == MONO_ERROR_BAD_IMAGE)
+ mono_error_set_generic_error (error, "System", "BadImageFormatException", "%s", lib_name);
+ else
+ mono_error_set_generic_error (error, "System", "DllNotFoundException", "%s", lib_name);
+ }
+ mono_error_cleanup (load_error);
+ }
+
goto_if_nok (error, leave);
native_library_lock ();
@@ -1325,7 +1395,6 @@ ves_icall_System_Runtime_InteropServices_NativeLibrary_LoadFromPath (MonoStringH
{
MonoDl *module;
gpointer handle = NULL;
- char *error_msg = NULL;
char *lib_path;
ERROR_LOCAL_BEGIN (local_error, error, throw_on_error)
@@ -1333,12 +1402,20 @@ ves_icall_System_Runtime_InteropServices_NativeLibrary_LoadFromPath (MonoStringH
lib_path = mono_string_handle_to_utf8 (lib_path_handle, error);
goto_if_nok (error, leave);
- module = mono_dl_open (lib_path, MONO_DL_LAZY, &error_msg);
+ ERROR_DECL (load_error);
+ module = mono_dl_open (lib_path, MONO_DL_LAZY, load_error);
if (!module) {
+ const char *error_msg = mono_error_get_message_without_fields (load_error);
+ guint16 error_code = mono_error_get_error_code (load_error);
+
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_DLLIMPORT, "DllImport error loading library '%s': '%s'.", lib_path, error_msg);
- mono_error_set_generic_error (error, "System", "DllNotFoundException", "'%s': '%s'", lib_path, error_msg);
- g_free (error_msg);
+
+ if (error_code == MONO_ERROR_BAD_IMAGE)
+ mono_error_set_generic_error (error, "System", "BadImageFormatException", "'%s': '%s'", lib_path, error_msg);
+ else
+ mono_error_set_generic_error (error, "System", "DllNotFoundException", "'%s': '%s'", lib_path, error_msg);
}
+ mono_error_cleanup (load_error);
goto_if_nok (error, leave);
native_library_lock ();
@@ -1385,7 +1462,7 @@ void
mono_loader_save_bundled_library (int fd, uint64_t offset, uint64_t size, const char *destfname)
{
MonoDl *lib;
- char *file, *buffer, *err, *internal_path;
+ char *file, *buffer, *internal_path;
if (!bundle_save_library_initialized)
bundle_save_library_initialize ();
@@ -1393,11 +1470,15 @@ mono_loader_save_bundled_library (int fd, uint64_t offset, uint64_t size, const
buffer = g_str_from_file_region (fd, offset, size);
g_file_set_contents (file, buffer, size, NULL);
- lib = mono_dl_open (file, MONO_DL_LAZY, &err);
- if (lib == NULL){
- fprintf (stderr, "Error loading shared library: %s %s\n", file, err);
+ ERROR_DECL (load_error);
+ lib = mono_dl_open (file, MONO_DL_LAZY, load_error);
+ if (!lib) {
+ fprintf (stderr, "Error loading shared library: %s %s\n", file, mono_error_get_message_without_fields (load_error));
+ mono_error_cleanup (load_error);
exit (1);
}
+ mono_error_assert_ok (load_error);
+
// Register the name with "." as this is how it will be found when embedded
internal_path = g_build_filename (".", destfname, (const char*)NULL);
mono_loader_register_module (internal_path, lib);
diff --git a/src/mono/mono/metadata/object-offsets.h b/src/mono/mono/metadata/object-offsets.h
index 3c4e158b8de..26d65e75143 100644
--- a/src/mono/mono/metadata/object-offsets.h
+++ b/src/mono/mono/metadata/object-offsets.h
@@ -163,6 +163,8 @@ DECL_OFFSET(MonoMethodILState, il_offset)
DECL_OFFSET(MonoMethodILState, data)
DECL_OFFSET(MonoMethodRuntimeGenericContext, class_vtable)
+DECL_OFFSET(MonoMethodRuntimeGenericContext, entries)
+DECL_OFFSET(MonoMethodRuntimeGenericContext, infos)
DECL_OFFSET(MonoJitTlsData, lmf)
DECL_OFFSET(MonoJitTlsData, class_cast_from)
diff --git a/src/mono/mono/metadata/profiler.c b/src/mono/mono/metadata/profiler.c
index 9c3ff570bff..c6ca60d5270 100644
--- a/src/mono/mono/metadata/profiler.c
+++ b/src/mono/mono/metadata/profiler.c
@@ -28,22 +28,28 @@ load_profiler (MonoDl *module, const char *name, const char *desc)
{
g_assert (module);
- char *err, *old_name = g_strdup_printf (OLD_INITIALIZER_NAME);
+ char *old_name = g_strdup_printf (OLD_INITIALIZER_NAME);
MonoProfilerInitializer func;
- if (!(err = mono_dl_symbol (module, old_name, (gpointer*) &func))) {
+ ERROR_DECL (symbol_error);
+ func = (MonoProfilerInitializer)mono_dl_symbol (module, old_name, symbol_error);
+ mono_error_cleanup (symbol_error);
+
+ if (func) {
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_PROFILER, "Found old-style startup symbol '%s' for the '%s' profiler; it has not been migrated to the new API.", old_name, name);
g_free (old_name);
return FALSE;
}
- g_free (err);
g_free (old_name);
char *new_name = g_strdup_printf (NEW_INITIALIZER_NAME "_%s", name);
- if ((err = mono_dl_symbol (module, new_name, (gpointer *) &func))) {
- g_free (err);
+ error_init_reuse (symbol_error);
+ func = (MonoProfilerInitializer)mono_dl_symbol (module, new_name, symbol_error);
+ mono_error_cleanup (symbol_error);
+
+ if (!func) {
g_free (new_name);
return FALSE;
}
@@ -58,7 +64,7 @@ load_profiler (MonoDl *module, const char *name, const char *desc)
static gboolean
load_profiler_from_executable (const char *name, const char *desc)
{
- char *err;
+ ERROR_DECL (load_error);
/*
* Some profilers (such as ours) may need to call back into the runtime
@@ -68,35 +74,37 @@ load_profiler_from_executable (const char *name, const char *desc)
* invoking the dynamic linker which is not async-signal-safe. Passing
* MONO_DL_EAGER will ask the dynamic linker to resolve everything upfront.
*/
- MonoDl *module = mono_dl_open (NULL, MONO_DL_EAGER, &err);
+ MonoDl *module = mono_dl_open (NULL, MONO_DL_EAGER, load_error);
if (!module) {
- mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_PROFILER, "Could not open main executable: %s", err);
- g_free (err);
+ mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_PROFILER, "Could not open main executable: %s", mono_error_get_message_without_fields (load_error));
+ mono_error_cleanup (load_error);
return FALSE;
}
+ mono_error_assert_ok (load_error);
return load_profiler (module, name, desc);
}
static gboolean
load_profiler_from_directory (const char *directory, const char *libname, const char *name, const char *desc)
{
- char *path, *err;
+ char *path;
void *iter = NULL;
while ((path = mono_dl_build_path (directory, libname, &iter))) {
- MonoDl *module = mono_dl_open (path, MONO_DL_EAGER, &err);
+ ERROR_DECL (load_error);
+ MonoDl *module = mono_dl_open (path, MONO_DL_EAGER, load_error);
if (!module) {
- mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_PROFILER, "Could not open from directory \"%s\": %s", path, err);
- g_free (err);
+ mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_PROFILER, "Could not open from directory \"%s\": %s", path, mono_error_get_message_without_fields (load_error));
+ mono_error_cleanup (load_error);
g_free (path);
continue;
}
+ mono_error_assert_ok (load_error);
g_free (path);
-
return load_profiler (module, name, desc);
}
@@ -106,15 +114,17 @@ load_profiler_from_directory (const char *directory, const char *libname, const
static gboolean
load_profiler_from_installation (const char *libname, const char *name, const char *desc)
{
- char *err;
- MonoDl *module = mono_dl_open_runtime_lib (libname, MONO_DL_EAGER, &err);
+ ERROR_DECL (load_error);
+
+ MonoDl *module = mono_dl_open_runtime_lib (libname, MONO_DL_EAGER, load_error);
if (!module) {
- mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_PROFILER, "Could not open from installation: %s", err);
- g_free (err);
+ mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_PROFILER, "Could not open from installation: %s", mono_error_get_message_without_fields (load_error));
+ mono_error_cleanup (load_error);
return FALSE;
}
+ mono_error_assert_ok (load_error);
return load_profiler (module, name, desc);
}
diff --git a/src/mono/mono/mini/aot-compiler.c b/src/mono/mono/mini/aot-compiler.c
index 1b11c31edbe..114e3b2f627 100644
--- a/src/mono/mono/mini/aot-compiler.c
+++ b/src/mono/mono/mini/aot-compiler.c
@@ -6953,6 +6953,44 @@ encode_patch (MonoAotCompile *acfg, MonoJumpInfo *patch_info, guint8 *buf, guint
}
break;
}
+ case MONO_PATCH_INFO_GSHARED_METHOD_INFO: {
+ MonoGSharedMethodInfo *info = (MonoGSharedMethodInfo*)patch_info->data.target;
+
+ encode_method_ref (acfg, info->method, p, &p);
+ encode_value (info->num_entries, p, &p);
+
+ for (int i = 0; i < info->num_entries; ++i) {
+ MonoRuntimeGenericContextInfoTemplate *entry = &info->entries [i];
+ MonoRgctxInfoType info_type = entry->info_type;
+ gpointer data = entry->data;
+ MonoJumpInfo tmp;
+ MonoJumpInfoType patch_type;
+
+ encode_value (info_type, p, &p);
+
+ patch_type = mini_rgctx_info_type_to_patch_info_type (info_type);
+ switch (patch_type) {
+ case MONO_PATCH_INFO_CLASS:
+ encode_klass_ref (acfg, mono_class_from_mono_type_internal ((MonoType*)data), p, &p);
+ break;
+ case MONO_PATCH_INFO_FIELD:
+ case MONO_PATCH_INFO_METHOD:
+ case MONO_PATCH_INFO_DELEGATE_TRAMPOLINE:
+ case MONO_PATCH_INFO_VIRT_METHOD:
+ case MONO_PATCH_INFO_GSHAREDVT_METHOD:
+ case MONO_PATCH_INFO_GSHAREDVT_CALL: {
+ tmp.type = patch_type;
+ tmp.data.target = data;
+ encode_patch (acfg, &tmp, p, &p);
+ break;
+ }
+ default:
+ g_assert_not_reached ();
+ break;
+ }
+ }
+ break;
+ }
case MONO_PATCH_INFO_VIRT_METHOD:
encode_klass_ref (acfg, patch_info->data.virt_method->klass, p, &p);
encode_method_ref (acfg, patch_info->data.virt_method->method, p, &p);
diff --git a/src/mono/mono/mini/aot-runtime.c b/src/mono/mono/mini/aot-runtime.c
index 89c8ad90119..f23c02730c8 100644
--- a/src/mono/mono/mini/aot-runtime.c
+++ b/src/mono/mono/mini/aot-runtime.c
@@ -62,6 +62,7 @@
#include <mono/utils/mono-threads-coop.h>
#include <mono/utils/bsearch.h>
#include <mono/utils/mono-tls-inline.h>
+#include <mono/utils/options.h>
#include "mini.h"
#include "seq-points.h"
@@ -1505,10 +1506,9 @@ find_symbol (MonoDl *module, gpointer *globals, const char *name, gpointer *valu
if (symbol != name)
g_free (symbol);
} else {
- char *err = mono_dl_symbol (module, name, value);
-
- if (err)
- g_free (err);
+ ERROR_DECL (symbol_error);
+ *value = mono_dl_symbol (module, name, symbol_error);
+ mono_error_cleanup (symbol_error);
}
}
@@ -1905,7 +1905,6 @@ load_aot_module (MonoAssemblyLoadContext *alc, MonoAssembly *assembly, gpointer
gpointer *globals = NULL;
MonoAotFileInfo *info = NULL;
int i, version;
- gboolean do_load_image = TRUE;
int align_double, align_int64;
guint8 *aot_data = NULL;
@@ -1963,17 +1962,18 @@ load_aot_module (MonoAssemblyLoadContext *alc, MonoAssembly *assembly, gpointer
}
found_aot_name = g_strdup (aot_name);
} else {
- char *err;
-
aot_name = g_strdup_printf ("%s%s", assembly->image->name, MONO_SOLIB_EXT);
- sofile = mono_dl_open (aot_name, MONO_DL_LAZY, &err);
- if (sofile) {
- found_aot_name = g_strdup (aot_name);
- } else {
- mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_AOT, "AOT: image '%s' not found: %s", aot_name, err);
- g_free (err);
+ {
+ ERROR_DECL (load_error);
+ sofile = mono_dl_open (aot_name, MONO_DL_LAZY, load_error);
+ if (sofile)
+ found_aot_name = g_strdup (aot_name);
+ else
+ mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_AOT, "AOT: image '%s' not found: %s", aot_name, mono_error_get_message_without_fields (load_error));
+ mono_error_cleanup (load_error);
}
+
g_free (aot_name);
if (!sofile) {
GList *l;
@@ -1983,19 +1983,22 @@ load_aot_module (MonoAssemblyLoadContext *alc, MonoAssembly *assembly, gpointer
char *basename = g_path_get_basename (assembly->image->name);
aot_name = g_strdup_printf ("%s/%s%s", path, basename, MONO_SOLIB_EXT);
- sofile = mono_dl_open (aot_name, MONO_DL_LAZY, &err);
- if (sofile) {
+
+ ERROR_DECL (load_error);
+ sofile = mono_dl_open (aot_name, MONO_DL_LAZY, load_error);
+ if (sofile)
found_aot_name = g_strdup (aot_name);
- } else {
- mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_AOT, "AOT: image '%s' not found: %s", aot_name, err);
- g_free (err);
- }
+ else
+ mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_AOT, "AOT: image '%s' not found: %s", aot_name, mono_error_get_message_without_fields (load_error));
+ mono_error_cleanup (load_error);
+
g_free (basename);
g_free (aot_name);
if (sofile)
break;
}
}
+
if (!sofile) {
// Maybe do these on more platforms ?
#ifndef HOST_WASM
@@ -2051,8 +2054,11 @@ load_aot_module (MonoAssemblyLoadContext *alc, MonoAssembly *assembly, gpointer
}
g_free (msg);
g_free (found_aot_name);
- if (sofile)
- mono_dl_close (sofile);
+ if (sofile) {
+ ERROR_DECL (close_error);
+ mono_dl_close (sofile, close_error);
+ mono_error_cleanup (close_error);
+ }
assembly->image->aot_module = NULL;
return;
}
@@ -2299,7 +2305,7 @@ load_aot_module (MonoAssemblyLoadContext *alc, MonoAssembly *assembly, gpointer
* non-lazily, since we can't handle out-of-date errors later.
* The cached class info also depends on the exact assemblies.
*/
- if (do_load_image) {
+ if (!mono_opt_aot_lazy_assembly_load) {
for (i = 0; i < amodule->image_table_len; ++i) {
ERROR_DECL (error);
load_image (amodule, i, error);
@@ -3930,6 +3936,58 @@ decode_patch (MonoAotModule *aot_module, MonoMemPool *mp, MonoJumpInfo *ji, guin
ji->data.target = info;
break;
}
+ case MONO_PATCH_INFO_GSHARED_METHOD_INFO: {
+ MonoGSharedMethodInfo *info = (MonoGSharedMethodInfo *)mono_mempool_alloc0 (mp, sizeof (MonoGSharedMethodInfo));
+
+ info->method = decode_resolve_method_ref (aot_module, p, &p, error);
+ mono_error_assert_ok (error);
+
+ info->num_entries = decode_value (p, &p);
+ info->count_entries = info->num_entries;
+ info->entries = (MonoRuntimeGenericContextInfoTemplate *)mono_mempool_alloc0 (mp, sizeof (MonoRuntimeGenericContextInfoTemplate) * info->num_entries);
+ for (int i = 0; i < info->num_entries; ++i) {
+ MonoRuntimeGenericContextInfoTemplate *entry = &info->entries [i];
+ MonoJumpInfoType patch_type;
+
+ entry->info_type = (MonoRgctxInfoType)decode_value (p, &p);
+ patch_type = mini_rgctx_info_type_to_patch_info_type (entry->info_type);
+ switch (patch_type) {
+ case MONO_PATCH_INFO_CLASS: {
+ MonoClass *klass = decode_klass_ref (aot_module, p, &p, error);
+ mono_error_cleanup (error); /* FIXME don't swallow the error */
+ if (!klass)
+ goto cleanup;
+ entry->data = m_class_get_byval_arg (klass);
+ break;
+ }
+ case MONO_PATCH_INFO_FIELD:
+ entry->data = decode_field_info (aot_module, p, &p);
+ if (!entry->data)
+ goto cleanup;
+ break;
+ case MONO_PATCH_INFO_METHOD:
+ entry->data = decode_resolve_method_ref (aot_module, p, &p, error);
+ mono_error_assert_ok (error);
+ break;
+ case MONO_PATCH_INFO_DELEGATE_TRAMPOLINE:
+ case MONO_PATCH_INFO_VIRT_METHOD:
+ case MONO_PATCH_INFO_GSHAREDVT_METHOD:
+ case MONO_PATCH_INFO_GSHAREDVT_CALL: {
+ MonoJumpInfo tmp;
+ tmp.type = patch_type;
+ if (!decode_patch (aot_module, mp, &tmp, p, &p))
+ goto cleanup;
+ entry->data = (gpointer)tmp.data.target;
+ break;
+ }
+ default:
+ g_assert_not_reached ();
+ break;
+ }
+ }
+ ji->data.target = info;
+ break;
+ }
case MONO_PATCH_INFO_VIRT_METHOD: {
MonoJumpInfoVirtMethod *info = (MonoJumpInfoVirtMethod *)mono_mempool_alloc0 (mp, sizeof (MonoJumpInfoVirtMethod));
diff --git a/src/mono/mono/mini/driver.c b/src/mono/mono/mini/driver.c
index 8d1e6bc217d..e68b33bc035 100644
--- a/src/mono/mono/mini/driver.c
+++ b/src/mono/mono/mini/driver.c
@@ -1771,11 +1771,23 @@ parse_qualified_method_name (char *method_name)
void
mono_jit_parse_options (int argc, char * argv[])
{
+ ERROR_DECL (error);
int i;
char *trace_options = NULL;
int mini_verbose_level = 0;
guint32 opt;
+ /* Make a copy since mono_options_parse_options () modifies argv */
+ char **copy_argv = g_new0 (char*, argc);
+ memcpy (copy_argv, argv, sizeof (char*) * argc);
+ argv = copy_argv;
+
+ mono_options_parse_options ((const char**)argv, argc, &argc, error);
+ if (!is_ok (error)) {
+ g_printerr ("%s", mono_error_get_message (error));
+ mono_error_cleanup (error);
+ }
+
/*
* Some options have no effect here, since they influence the behavior of
* mono_main ().
@@ -1864,6 +1876,9 @@ mono_jit_parse_options (int argc, char * argv[])
if (mini_verbose_level)
mono_set_verbose_level (mini_verbose_level);
+
+ /* Free the copy */
+ g_free (argv);
}
static void
diff --git a/src/mono/mono/mini/jit-icalls.c b/src/mono/mono/mini/jit-icalls.c
index 625b03ab911..448f0601437 100644
--- a/src/mono/mono/mini/jit-icalls.c
+++ b/src/mono/mono/mini/jit-icalls.c
@@ -1658,3 +1658,30 @@ void
mono_dummy_jit_icall_val (gpointer val)
{
}
+
+void
+mini_init_method_rgctx (MonoMethodRuntimeGenericContext *mrgctx, MonoGSharedMethodInfo *info)
+{
+ if (G_LIKELY (mrgctx->entries))
+ return;
+
+ MonoMethod *m = mrgctx->method;
+ int ninline = mono_class_rgctx_get_array_size (0, TRUE);
+
+ // The +1 is for the NULL check at the beginning
+ // FIXME: memory management
+ gpointer *entries = mono_mem_manager_alloc0 (get_default_mem_manager (), (sizeof (gpointer) * (info->num_entries + 1)));
+ for (int i = 0; i < info->num_entries; ++i) {
+ gpointer data = mini_instantiate_gshared_info (&info->entries [i],
+ mono_method_get_context (m), m->klass);
+ g_assert (data);
+
+ /* The first few entries are stored inline, the rest are stored in mrgctx->entries */
+ if (i < ninline)
+ mrgctx->infos [i] = data;
+ else
+ entries [i - ninline] = data;
+ }
+ mono_memory_barrier ();
+ mrgctx->entries = entries;
+}
diff --git a/src/mono/mono/mini/jit-icalls.h b/src/mono/mono/mini/jit-icalls.h
index be547267285..7f5e3a3f1ab 100644
--- a/src/mono/mono/mini/jit-icalls.h
+++ b/src/mono/mono/mini/jit-icalls.h
@@ -233,4 +233,6 @@ ICALL_EXPORT void mono_dummy_jit_icall (void);
ICALL_EXPORT void mono_dummy_jit_icall_val (gpointer ptr);
+ICALL_EXPORT void mini_init_method_rgctx (MonoMethodRuntimeGenericContext *mrgctx, MonoGSharedMethodInfo *info);
+
#endif /* __MONO_JIT_ICALLS_H__ */
diff --git a/src/mono/mono/mini/llvm-jit.cpp b/src/mono/mono/mini/llvm-jit.cpp
index 2928d4bc5cb..1a4ca203eb7 100644
--- a/src/mono/mono/mini/llvm-jit.cpp
+++ b/src/mono/mono/mini/llvm-jit.cpp
@@ -247,15 +247,19 @@ struct MonoLLVMJIT {
if (namestr == "___bzero") {
return JITSymbol{(uint64_t)(gssize)(void*)bzero, flags};
}
+ ERROR_DECL (error);
auto namebuf = namestr.c_str ();
- auto current = mono_dl_open (NULL, 0, NULL);
+ auto current = mono_dl_open (NULL, 0, error);
+ mono_error_cleanup (error);
g_assert (current);
auto name = namebuf[0] == '_' ? namebuf + 1 : namebuf;
void *sym = nullptr;
- auto err = mono_dl_symbol (current, name, &sym);
+ error_init_reuse (error);
+ sym = mono_dl_symbol (current, name, error);
if (!sym) {
- outs () << "R: " << namestr << " " << err << "\n";
+ outs () << "R: " << namestr << " " << mono_error_get_message_without_fields (error) << "\n";
}
+ mono_error_cleanup (error);
assert (sym);
return JITSymbol{(uint64_t)(gssize)sym, flags};
};
diff --git a/src/mono/mono/mini/method-to-ir.c b/src/mono/mono/mini/method-to-ir.c
index 617be20a712..32e24d99f27 100644
--- a/src/mono/mono/mini/method-to-ir.c
+++ b/src/mono/mono/mini/method-to-ir.c
@@ -2143,14 +2143,13 @@ mini_method_check_context_used (MonoCompile *cfg, MonoMethod *method)
}
/*
- * check_method_sharing:
+ * need_mrgctx_arg:
*
- * Check whenever the vtable or an mrgctx needs to be passed when calling CMETHOD.
+ * Check whenever the mrgctx needs to be passed when calling CMETHOD.
*/
-static void
-check_method_sharing (MonoCompile *cfg, MonoMethod *cmethod, gboolean *out_pass_vtable, gboolean *out_pass_mrgctx)
+static gboolean
+need_mrgctx_arg (MonoCompile *cfg, MonoMethod *cmethod)
{
- gboolean pass_vtable = FALSE;
gboolean pass_mrgctx = FALSE;
if (((cmethod->flags & METHOD_ATTRIBUTE_STATIC) || m_class_is_valuetype (cmethod->klass)) &&
@@ -2161,22 +2160,17 @@ check_method_sharing (MonoCompile *cfg, MonoMethod *cmethod, gboolean *out_pass_
sharable = TRUE;
/*
- * Pass vtable iff target method might
+ * Pass mrgctx iff target method might
* be shared, which means that sharing
* is enabled for its class and its
* context is sharable (and it's not a
* generic method).
*/
if (sharable && !(mini_method_get_context (cmethod) && mini_method_get_context (cmethod)->method_inst))
- pass_vtable = TRUE;
+ pass_mrgctx = TRUE;
}
if (mini_method_needs_mrgctx (cmethod)) {
- if (mini_method_is_default_method (cmethod))
- pass_vtable = FALSE;
- else
- g_assert (!pass_vtable);
-
if (mono_method_is_generic_sharable_full (cmethod, TRUE, TRUE, TRUE)) {
pass_mrgctx = TRUE;
} else {
@@ -2185,10 +2179,7 @@ check_method_sharing (MonoCompile *cfg, MonoMethod *cmethod, gboolean *out_pass_
}
}
- if (out_pass_vtable)
- *out_pass_vtable = pass_vtable;
- if (out_pass_mrgctx)
- *out_pass_mrgctx = pass_mrgctx;
+ return pass_mrgctx;
}
static gboolean
@@ -2490,18 +2481,18 @@ context_used_is_mrgctx (MonoCompile *cfg, int context_used)
static MonoInst*
emit_get_rgctx (MonoCompile *cfg, int context_used)
{
- MonoMethod *method = cfg->method;
-
g_assert (cfg->gshared);
/* Data whose context contains method type vars is stored in the mrgctx */
- if (context_used_is_mrgctx (cfg, context_used)) {
+ if (context_used_is_mrgctx (cfg, context_used) || cfg->gshared_info) {
MonoInst *mrgctx_loc, *mrgctx_var;
g_assert (cfg->rgctx_access == MONO_RGCTX_ACCESS_MRGCTX);
+ /*
if (!mini_method_is_default_method (method))
g_assert (method->is_inflated && mono_method_get_context (method)->method_inst);
+ */
if (cfg->llvm_only) {
mrgctx_var = mono_get_mrgctx_var (cfg);
@@ -2536,20 +2527,6 @@ emit_get_rgctx (MonoCompile *cfg, int context_used)
EMIT_NEW_LOAD_MEMBASE (cfg, vtable_var, OP_LOAD_MEMBASE, vtable_reg, mrgctx_var->dreg, MONO_STRUCT_OFFSET (MonoMethodRuntimeGenericContext, class_vtable));
vtable_var->type = STACK_PTR;
return vtable_var;
- } else if (cfg->rgctx_access == MONO_RGCTX_ACCESS_VTABLE) {
- MonoInst *vtable_loc, *vtable_var;
-
- /* We are passed a vtable, return it */
-
- if (cfg->llvm_only) {
- vtable_var = mono_get_vtable_var (cfg);
- } else {
- vtable_loc = mono_get_vtable_var (cfg);
- g_assert (vtable_loc->flags & MONO_INST_VOLATILE);
- EMIT_NEW_TEMPLOAD (cfg, vtable_var, vtable_loc->inst_c0);
- }
- vtable_var->type = STACK_PTR;
- return vtable_var;
} else {
MonoInst *ins, *this_ins;
int vtable_reg;
@@ -2584,6 +2561,70 @@ mono_patch_info_rgctx_entry_new (MonoMemPool *mp, MonoMethod *method, gboolean i
static MonoInst*
emit_get_gsharedvt_info (MonoCompile *cfg, gpointer data, MonoRgctxInfoType rgctx_type);
+/*
+ * get_gshared_info_slot:
+ *
+ * Return a slot index in the mrgctx. PATCH_INFO describes a runtime structure, while
+ * RGCTX_TYPE is a property of that structure.
+ */
+static int
+get_gshared_info_slot (MonoCompile *cfg, MonoJumpInfo *patch_info, MonoRgctxInfoType rgctx_type)
+{
+ MonoGSharedMethodInfo *info = cfg->gshared_info;
+ int idx;
+ gpointer data;
+
+ // Check that this is not called after the init call is eliminated
+ g_assert (cfg->init_method_rgctx_ins);
+
+ g_assert (info);
+
+ /* The MonoRuntimeGenericContextInfoTemplate structure contains the 'resolved' patch_info, i.e. a MonoClass pointer etc. */
+ // FIXME: Use another type instead, but mini-generic-sharing.c uses it to resolve information
+ switch (patch_info->type) {
+ case MONO_PATCH_INFO_CLASS:
+ data = m_class_get_byval_arg (patch_info->data.klass);
+ break;
+ case MONO_PATCH_INFO_METHODCONST:
+ case MONO_PATCH_INFO_FIELD:
+ case MONO_PATCH_INFO_VIRT_METHOD:
+ case MONO_PATCH_INFO_DELEGATE_TRAMPOLINE:
+ case MONO_PATCH_INFO_GSHAREDVT_METHOD:
+ case MONO_PATCH_INFO_GSHAREDVT_CALL:
+ data = (gpointer)patch_info->data.target;
+ break;
+ default:
+ g_assert_not_reached ();
+ break;
+ }
+ g_assert (data);
+
+ for (int i = 0; i < info->num_entries; ++i) {
+ // FIXME: Make it work with VIRT_METHOD etc. as well
+ if (info->entries [i].info_type == rgctx_type && info->entries [i].data == data && rgctx_type != MONO_RGCTX_INFO_LOCAL_OFFSET)
+ return i;
+ }
+
+ if (info->num_entries == info->count_entries) {
+ MonoRuntimeGenericContextInfoTemplate *new_entries;
+ int new_count_entries = info->count_entries ? info->count_entries * 2 : 16;
+
+ new_entries = (MonoRuntimeGenericContextInfoTemplate *)mono_mempool_alloc0 (cfg->mempool, sizeof (MonoRuntimeGenericContextInfoTemplate) * new_count_entries);
+
+ memcpy (new_entries, info->entries, sizeof (MonoRuntimeGenericContextInfoTemplate) * info->count_entries);
+ info->entries = new_entries;
+ info->count_entries = new_count_entries;
+ }
+
+ idx = info->num_entries;
+ info->entries [idx].info_type = rgctx_type;
+ info->entries [idx].data = data;
+
+ info->num_entries++;
+
+ return idx;
+}
+
static MonoInst*
emit_rgctx_fetch_inline (MonoCompile *cfg, MonoInst *rgctx, MonoJumpInfoRgctxEntry *entry)
{
@@ -2677,6 +2718,28 @@ emit_rgctx_fetch (MonoCompile *cfg, int context_used, MonoJumpInfoRgctxEntry *en
{
MonoInst *rgctx = emit_get_rgctx (cfg, context_used);
+ if (cfg->gshared_info) {
+ MonoInst *ins;
+ int dreg, entries_reg, idx;
+ int ninlines = mono_class_rgctx_get_array_size (0, TRUE);
+
+ idx = get_gshared_info_slot (cfg, entry->data, entry->info_type);
+
+ /* The first few entries are stored inline, the rest are stored in mrgctx->entries */
+ if (idx < ninlines) {
+ /* Load mrgctx->infos [idx] */
+ dreg = alloc_preg (cfg);
+ EMIT_NEW_LOAD_MEMBASE (cfg, ins, OP_LOAD_MEMBASE, dreg, rgctx->dreg, MONO_STRUCT_OFFSET (MonoMethodRuntimeGenericContext, infos) + idx * TARGET_SIZEOF_VOID_P);
+ } else {
+ /* Load mrgctx->entries [idx - ninlines] */
+ entries_reg = alloc_preg (cfg);
+ EMIT_NEW_LOAD_MEMBASE (cfg, ins, OP_LOAD_MEMBASE, entries_reg, rgctx->dreg, MONO_STRUCT_OFFSET (MonoMethodRuntimeGenericContext, entries));
+ dreg = alloc_preg (cfg);
+ EMIT_NEW_LOAD_MEMBASE (cfg, ins, OP_LOAD_MEMBASE, dreg, entries_reg, (idx - ninlines) * TARGET_SIZEOF_VOID_P);
+ }
+ return ins;
+ }
+
if (cfg->llvm_only)
return emit_rgctx_fetch_inline (cfg, rgctx, entry);
else
@@ -2712,7 +2775,7 @@ mini_emit_get_rgctx_klass (MonoCompile *cfg, int context_used,
}
// Its cheaper to load these from the gsharedvt info struct
- if (cfg->llvm_only && cfg->gsharedvt)
+ if (cfg->llvm_only && cfg->gsharedvt && !cfg->gshared_info)
return mini_emit_get_gsharedvt_info_klass (cfg, klass, rgctx_type);
MonoJumpInfoRgctxEntry *entry = mono_patch_info_rgctx_entry_new (cfg->mempool, cfg->method, context_used_is_mrgctx (cfg, context_used), MONO_PATCH_INFO_CLASS, klass, rgctx_type);
@@ -2817,7 +2880,7 @@ emit_get_rgctx_method (MonoCompile *cfg, int context_used,
}
} else {
// Its cheaper to load these from the gsharedvt info struct
- if (cfg->llvm_only && cfg->gsharedvt)
+ if (cfg->llvm_only && cfg->gsharedvt && !cfg->gshared_info)
return emit_get_gsharedvt_info (cfg, cmethod, rgctx_type);
MonoJumpInfoRgctxEntry *entry = mono_patch_info_rgctx_entry_new (cfg->mempool, cfg->method, context_used_is_mrgctx (cfg, context_used), MONO_PATCH_INFO_METHODCONST, cmethod, rgctx_type);
@@ -2831,7 +2894,7 @@ emit_get_rgctx_field (MonoCompile *cfg, int context_used,
MonoClassField *field, MonoRgctxInfoType rgctx_type)
{
// Its cheaper to load these from the gsharedvt info struct
- if (cfg->llvm_only && cfg->gsharedvt)
+ if (cfg->llvm_only && cfg->gsharedvt && !cfg->gshared_info)
return emit_get_gsharedvt_info (cfg, field, rgctx_type);
MonoJumpInfoRgctxEntry *entry = mono_patch_info_rgctx_entry_new (cfg->mempool, cfg->method, context_used_is_mrgctx (cfg, context_used), MONO_PATCH_INFO_FIELD, field, rgctx_type);
@@ -3103,18 +3166,11 @@ handle_unbox_nullable (MonoCompile* cfg, MonoInst* val, MonoClass* klass, int co
return mini_emit_calli (cfg, mono_method_signature_internal (method), &val, addr, NULL, rgctx);
}
} else {
- gboolean pass_vtable, pass_mrgctx;
MonoInst *rgctx_arg = NULL;
- check_method_sharing (cfg, method, &pass_vtable, &pass_mrgctx);
- g_assert (!pass_mrgctx);
-
- if (pass_vtable) {
- MonoVTable *vtable = mono_class_vtable_checked (method->klass, cfg->error);
-
- mono_error_assert_ok (cfg->error);
- EMIT_NEW_VTABLECONST (cfg, rgctx_arg, vtable);
- }
+ if (need_mrgctx_arg (cfg, method))
+ rgctx_arg = emit_get_rgctx_method (cfg, context_used, method,
+ MONO_RGCTX_INFO_METHOD_RGCTX);
return mini_emit_method_call_full (cfg, method, NULL, FALSE, &val, NULL, NULL, rgctx_arg);
}
@@ -3355,18 +3411,11 @@ mini_emit_box (MonoCompile *cfg, MonoInst *val, MonoClass *klass, int context_us
return mini_emit_calli (cfg, mono_method_signature_internal (method), &val, addr, NULL, rgctx);
}
} else {
- gboolean pass_vtable, pass_mrgctx;
MonoInst *rgctx_arg = NULL;
- check_method_sharing (cfg, method, &pass_vtable, &pass_mrgctx);
- g_assert (!pass_mrgctx);
-
- if (pass_vtable) {
- MonoVTable *vtable = mono_class_vtable_checked (method->klass, cfg->error);
-
- mono_error_assert_ok (cfg->error);
- EMIT_NEW_VTABLECONST (cfg, rgctx_arg, vtable);
- }
+ if (need_mrgctx_arg (cfg, method))
+ rgctx_arg = emit_get_rgctx_method (cfg, context_used, method,
+ MONO_RGCTX_INFO_METHOD_RGCTX);
return mini_emit_method_call_full (cfg, method, NULL, FALSE, &val, NULL, NULL, rgctx_arg);
}
@@ -5611,7 +5660,7 @@ static void
handle_ctor_call (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, int context_used,
MonoInst **sp, guint8 *ip, int *inline_costs)
{
- MonoInst *vtable_arg = NULL, *callvirt_this_arg = NULL, *ins;
+ MonoInst *rgctx_arg = NULL, *callvirt_this_arg = NULL, *ins;
if (cmethod && (ins = mini_emit_inst_for_ctor (cfg, cmethod, fsig, sp))) {
g_assert (MONO_TYPE_IS_VOID (fsig->ret));
@@ -5623,24 +5672,15 @@ handle_ctor_call (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fs
MonoRgctxAccess access = mini_get_rgctx_access_for_method (cmethod);
if (access == MONO_RGCTX_ACCESS_MRGCTX) {
- mono_class_vtable_checked (cmethod->klass, cfg->error);
- CHECK_CFG_ERROR;
- CHECK_TYPELOAD (cmethod->klass);
-
- vtable_arg = emit_get_rgctx_method (cfg, context_used,
+ rgctx_arg = emit_get_rgctx_method (cfg, context_used,
cmethod, MONO_RGCTX_INFO_METHOD_RGCTX);
- } else if (access == MONO_RGCTX_ACCESS_VTABLE) {
- vtable_arg = mini_emit_get_rgctx_klass (cfg, context_used,
- cmethod->klass, MONO_RGCTX_INFO_VTABLE);
- CHECK_CFG_ERROR;
- CHECK_TYPELOAD (cmethod->klass);
} else {
g_assert (access == MONO_RGCTX_ACCESS_THIS);
}
}
/* Avoid virtual calls to ctors if possible */
- if ((cfg->opt & MONO_OPT_INLINE) && cmethod && !context_used && !vtable_arg &&
+ if ((cfg->opt & MONO_OPT_INLINE) && cmethod && !context_used && !rgctx_arg &&
mono_method_check_inlining (cfg, cmethod) &&
!mono_class_is_subclass_of_internal (cmethod->klass, mono_defaults.exception_class, FALSE)) {
int costs;
@@ -5662,10 +5702,10 @@ handle_ctor_call (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fs
addr = emit_get_rgctx_gsharedvt_call (cfg, context_used, fsig, cmethod, MONO_RGCTX_INFO_METHOD_GSHAREDVT_OUT_TRAMPOLINE);
if (cfg->llvm_only) {
- // FIXME: Avoid initializing vtable_arg
+ // FIXME: Avoid initializing rgctx_arg
mini_emit_llvmonly_calli (cfg, fsig, sp, addr);
} else {
- mini_emit_calli (cfg, fsig, sp, addr, NULL, vtable_arg);
+ mini_emit_calli (cfg, fsig, sp, addr, NULL, rgctx_arg);
}
} else if (context_used &&
((!mono_method_is_generic_sharable_full (cmethod, TRUE, FALSE, FALSE) ||
@@ -5677,20 +5717,23 @@ handle_ctor_call (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fs
if (cfg->llvm_only) {
MonoInst *addr = emit_get_rgctx_method (cfg, context_used, cmethod,
MONO_RGCTX_INFO_METHOD_FTNDESC);
+
+ /* Need wrappers for this signature to be able to enter interpreter */
+ cfg->interp_in_signatures = g_slist_prepend_mempool (cfg->mempool, cfg->interp_in_signatures, fsig);
+
mini_emit_llvmonly_calli (cfg, fsig, sp, addr);
} else {
cmethod_addr = emit_get_rgctx_method (cfg, context_used,
cmethod, MONO_RGCTX_INFO_GENERIC_METHOD_CODE);
- mini_emit_calli (cfg, fsig, sp, cmethod_addr, NULL, vtable_arg);
+ mini_emit_calli (cfg, fsig, sp, cmethod_addr, NULL, rgctx_arg);
}
} else {
INLINE_FAILURE ("ctor call");
ins = mini_emit_method_call_full (cfg, cmethod, fsig, FALSE, sp,
- callvirt_this_arg, NULL, vtable_arg);
+ callvirt_this_arg, NULL, rgctx_arg);
}
exception_exit:
- mono_error_exit:
return;
}
@@ -6509,6 +6552,34 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
init_localsbb2 = init_localsbb;
cfg->cbb = init_localsbb;
+ /*
+ * If the method receives an mrgctx, store all rgctx entries in mrgctx->entries instead of in the
+ * class rgctx.
+ * Disable for gsharedvt for now since the handling of gsharedvt related rgctx entries for
+ * MONO_PATCH_INFO_GSHARED_METHOD_INFO is not implemented yet.
+ */
+ if (cfg->gshared && cfg->method == method && cfg->rgctx_access == MONO_RGCTX_ACCESS_MRGCTX) {
+ MonoGSharedMethodInfo *info;
+ MonoInst *args [2];
+
+ /* Allocate into permanent memory since its the key in MonoJumpInfo */
+ info = (MonoGSharedMethodInfo *)mono_mem_manager_alloc0 (cfg->mem_manager, sizeof (MonoGSharedMethodInfo));
+ /* Will be copied into permanent memory in mini_method_compile () */
+ info->method = cfg->method;
+ info->count_entries = 16;
+ info->entries = (MonoRuntimeGenericContextInfoTemplate *)mono_mempool_alloc0 (cfg->mempool, sizeof (MonoRuntimeGenericContextInfoTemplate) * info->count_entries);
+ cfg->gshared_info = info;
+
+ // FIXME: Optimize this ?
+ args [0] = mono_get_mrgctx_var (cfg);
+ if (cfg->compile_aot)
+ args [1] = mini_emit_runtime_constant (cfg, MONO_PATCH_INFO_GSHARED_METHOD_INFO, info);
+ else
+ EMIT_NEW_PCONST (cfg, args [1], info);
+
+ cfg->init_method_rgctx_ins = mono_emit_jit_icall (cfg, mini_init_method_rgctx, args);
+ }
+
if (cfg->gsharedvt && cfg->method == method) {
MonoGSharedVtMethodInfo *info;
MonoInst *var, *locals_var;
@@ -7321,7 +7392,6 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
gboolean virtual_; virtual_ = il_op == MONO_CEE_CALLVIRT;
gboolean pass_imt_from_rgctx; pass_imt_from_rgctx = FALSE;
MonoInst *imt_arg; imt_arg = NULL;
- gboolean pass_vtable; pass_vtable = FALSE;
gboolean pass_mrgctx; pass_mrgctx = FALSE;
MonoInst *vtable_arg; vtable_arg = NULL;
gboolean check_this; check_this = FALSE;
@@ -7633,7 +7703,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
}
}
- check_method_sharing (cfg, cmethod, &pass_vtable, &pass_mrgctx);
+ pass_mrgctx = need_mrgctx_arg (cfg, cmethod);
if (cfg->gshared) {
MonoGenericContext *cmethod_context = mono_method_get_context (cmethod);
@@ -7667,18 +7737,6 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
mono_get_vtable_var (cfg);
}
- if (pass_vtable) {
- if (context_used) {
- vtable_arg = mini_emit_get_rgctx_klass (cfg, context_used, cmethod->klass, MONO_RGCTX_INFO_VTABLE);
- } else {
- MonoVTable *vtable = mono_class_vtable_checked (cmethod->klass, cfg->error);
- CHECK_CFG_ERROR;
-
- CHECK_TYPELOAD (cmethod->klass);
- EMIT_NEW_VTABLECONST (cfg, vtable_arg, vtable);
- }
- }
-
if (pass_mrgctx) {
g_assert (!vtable_arg);
@@ -7701,8 +7759,6 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b
}
if (pass_imt_from_rgctx) {
- g_assert (!pass_vtable);
-
imt_arg = emit_get_rgctx_method (cfg, context_used,
cmethod, MONO_RGCTX_INFO_METHOD);
g_assert (imt_arg);
diff --git a/src/mono/mono/mini/mini-exceptions.c b/src/mono/mono/mini/mini-exceptions.c
index d65c0a17596..fb6a7ca7ec1 100644
--- a/src/mono/mono/mini/mini-exceptions.c
+++ b/src/mono/mono/mini/mini-exceptions.c
@@ -853,12 +853,9 @@ mono_get_generic_info_from_stack_frame (MonoJitInfo *ji, MonoContext *ctx)
}
method = jinfo_get_method (ji);
- if (mono_method_get_context (method)->method_inst || mini_method_is_default_method (method)) {
+ if (mono_method_get_context (method)->method_inst || m_method_is_static (method) || m_class_is_valuetype (method->klass) || mini_method_is_default_method (method)) {
/* A MonoMethodRuntimeGenericContext* */
return info;
- } else if ((method->flags & METHOD_ATTRIBUTE_STATIC) || m_class_is_valuetype (method->klass)) {
- /* A MonoVTable* */
- return info;
} else {
/* Avoid returning a managed object */
MonoObject *this_obj = (MonoObject *)info;
@@ -881,13 +878,11 @@ mono_get_generic_context_from_stack_frame (MonoJitInfo *ji, gpointer generic_inf
method = jinfo_get_method (ji);
g_assert (method->is_inflated);
- if (mono_method_get_context (method)->method_inst || mini_method_is_default_method (method)) {
+ if (mono_method_get_context (method)->method_inst || mini_method_is_default_method (method) || m_method_is_static (method) || m_class_is_valuetype (method->klass)) {
MonoMethodRuntimeGenericContext *mrgctx = (MonoMethodRuntimeGenericContext *)generic_info;
klass = mrgctx->class_vtable->klass;
context.method_inst = mrgctx->method_inst;
- if (!mini_method_is_default_method (method))
- g_assert (context.method_inst);
} else {
MonoVTable *vtable = (MonoVTable *)generic_info;
diff --git a/src/mono/mono/mini/mini-generic-sharing.c b/src/mono/mono/mini/mini-generic-sharing.c
index 9c65a022fe3..754e9bf8a4d 100644
--- a/src/mono/mono/mini/mini-generic-sharing.c
+++ b/src/mono/mono/mini/mini-generic-sharing.c
@@ -2586,6 +2586,19 @@ instantiate_info (MonoMemoryManager *mem_manager, MonoRuntimeGenericContextInfoT
return NULL;
}
+gpointer
+mini_instantiate_gshared_info (MonoRuntimeGenericContextInfoTemplate *oti,
+ MonoGenericContext *context, MonoClass *klass)
+{
+ ERROR_DECL (error);
+ // FIXME:
+ MonoJitMemoryManager *jit_mm = jit_mm_for_class (klass);
+
+ gpointer res = instantiate_info (jit_mm->mem_manager, oti, context, klass, error);
+ mono_error_assert_ok (error);
+ return res;
+}
+
/*
* LOCKING: loader lock
*/
@@ -2784,6 +2797,7 @@ info_equal (gpointer data1, gpointer data2, MonoRgctxInfoType info_type)
* mini_rgctx_info_type_to_patch_info_type:
*
* Return the type of the runtime object referred to by INFO_TYPE.
+ * The types are identified by MONO_PATCH_INFO_ values.
*/
MonoJumpInfoType
mini_rgctx_info_type_to_patch_info_type (MonoRgctxInfoType info_type)
@@ -2816,7 +2830,19 @@ mini_rgctx_info_type_to_patch_info_type (MonoRgctxInfoType info_type)
case MONO_RGCTX_INFO_GSHAREDVT_OUT_WRAPPER:
case MONO_RGCTX_INFO_INTERP_METHOD:
case MONO_RGCTX_INFO_LLVMONLY_INTERP_ENTRY:
+ case MONO_RGCTX_INFO_GENERIC_METHOD_CODE:
+ case MONO_RGCTX_INFO_METHOD_DELEGATE_CODE:
return MONO_PATCH_INFO_METHOD;
+ case MONO_RGCTX_INFO_DELEGATE_TRAMP_INFO:
+ return MONO_PATCH_INFO_DELEGATE_TRAMPOLINE;
+ case MONO_RGCTX_INFO_VIRT_METHOD_CODE:
+ case MONO_RGCTX_INFO_VIRT_METHOD_BOX_TYPE:
+ return MONO_PATCH_INFO_VIRT_METHOD;
+ case MONO_RGCTX_INFO_METHOD_GSHAREDVT_INFO:
+ return MONO_PATCH_INFO_GSHAREDVT_METHOD;
+ case MONO_RGCTX_INFO_METHOD_GSHAREDVT_OUT_TRAMPOLINE:
+ case MONO_RGCTX_INFO_METHOD_GSHAREDVT_OUT_TRAMPOLINE_VIRT:
+ return MONO_PATCH_INFO_GSHAREDVT_CALL;
default:
printf ("%d\n", info_type);
g_assert_not_reached ();
@@ -2941,7 +2967,12 @@ mono_class_rgctx_get_array_size (int n, gboolean mrgctx)
static gpointer*
alloc_rgctx_array (MonoMemoryManager *mem_manager, int n, gboolean is_mrgctx)
{
- gint32 size = mono_class_rgctx_get_array_size (n, is_mrgctx) * sizeof (gpointer);
+ int size;
+
+ if (is_mrgctx && n == 0)
+ size = sizeof (MonoMethodRuntimeGenericContext) + (mono_class_rgctx_get_array_size (n, is_mrgctx) * sizeof (gpointer));
+ else
+ size = mono_class_rgctx_get_array_size (n, is_mrgctx) * sizeof (gpointer);
gpointer *array = (gpointer *)mono_mem_manager_alloc0 (mem_manager, size);
if (is_mrgctx) {
@@ -3153,24 +3184,6 @@ mono_method_fill_runtime_generic_context (MonoMethodRuntimeGenericContext *mrgct
return info;
}
-static guint
-mrgctx_hash_func (gconstpointer key)
-{
- const MonoMethodRuntimeGenericContext *mrgctx = (const MonoMethodRuntimeGenericContext *)key;
-
- return mono_aligned_addr_hash (mrgctx->class_vtable) ^ mono_metadata_generic_inst_hash (mrgctx->method_inst);
-}
-
-static gboolean
-mrgctx_equal_func (gconstpointer a, gconstpointer b)
-{
- const MonoMethodRuntimeGenericContext *mrgctx1 = (const MonoMethodRuntimeGenericContext *)a;
- const MonoMethodRuntimeGenericContext *mrgctx2 = (const MonoMethodRuntimeGenericContext *)b;
-
- return mrgctx1->class_vtable == mrgctx2->class_vtable &&
- mono_metadata_generic_inst_equal (mrgctx1->method_inst, mrgctx2->method_inst);
-}
-
/*
* mini_method_get_mrgctx:
* @class_vtable: a vtable
@@ -3183,7 +3196,6 @@ static MonoMethodRuntimeGenericContext*
mini_method_get_mrgctx (MonoVTable *class_vtable, MonoMethod *method)
{
MonoMethodRuntimeGenericContext *mrgctx;
- MonoMethodRuntimeGenericContext key;
MonoGenericInst *method_inst = mini_method_get_context (method)->method_inst;
MonoJitMemoryManager *jit_mm;
@@ -3191,38 +3203,22 @@ mini_method_get_mrgctx (MonoVTable *class_vtable, MonoMethod *method)
jit_mm = jit_mm_for_method (method);
- if (!method_inst) {
- g_assert (mini_method_is_default_method (method));
-
- jit_mm_lock (jit_mm);
- if (!jit_mm->mrgctx_hash)
- jit_mm->mrgctx_hash = g_hash_table_new (NULL, NULL);
- mrgctx = (MonoMethodRuntimeGenericContext*)g_hash_table_lookup (jit_mm->mrgctx_hash, method);
- jit_mm_unlock (jit_mm);
- } else {
- g_assert (!method_inst->is_open);
-
- jit_mm_lock (jit_mm);
- if (!jit_mm->method_rgctx_hash)
- jit_mm->method_rgctx_hash = g_hash_table_new (mrgctx_hash_func, mrgctx_equal_func);
-
- key.class_vtable = class_vtable;
- key.method_inst = method_inst;
-
- mrgctx = (MonoMethodRuntimeGenericContext *)g_hash_table_lookup (jit_mm->method_rgctx_hash, &key);
- jit_mm_unlock (jit_mm);
- }
+ jit_mm_lock (jit_mm);
+ if (!jit_mm->mrgctx_hash)
+ jit_mm->mrgctx_hash = g_hash_table_new (NULL, NULL);
+ mrgctx = (MonoMethodRuntimeGenericContext*)g_hash_table_lookup (jit_mm->mrgctx_hash, method);
+ jit_mm_unlock (jit_mm);
if (!mrgctx) {
mrgctx = (MonoMethodRuntimeGenericContext*)alloc_rgctx_array (jit_mm->mem_manager, 0, TRUE);
mrgctx->class_vtable = class_vtable;
mrgctx->method_inst = method_inst;
+ mrgctx->method = method;
+
+ //printf ("MRGCTX: %s -> %p\n", mono_method_get_full_name (method), mrgctx);
jit_mm_lock (jit_mm);
- if (!method_inst)
- g_hash_table_insert (jit_mm->mrgctx_hash, method, mrgctx);
- else
- g_hash_table_insert (jit_mm->method_rgctx_hash, mrgctx, mrgctx);
+ g_hash_table_insert (jit_mm->mrgctx_hash, method, mrgctx);
jit_mm_unlock (jit_mm);
/*
@@ -3966,6 +3962,8 @@ mini_method_needs_mrgctx (MonoMethod *m)
{
if (mono_class_is_ginst (m->klass) && mini_method_is_default_method (m))
return TRUE;
+ if (m->flags & METHOD_ATTRIBUTE_STATIC || m_class_is_valuetype (m->klass))
+ return TRUE;
return (mini_method_get_context (m) && mini_method_get_context (m)->method_inst);
}
diff --git a/src/mono/mono/mini/mini-llvm.c b/src/mono/mono/mini/mini-llvm.c
index fdc97539f26..e0f5988e99b 100644
--- a/src/mono/mono/mini/mini-llvm.c
+++ b/src/mono/mono/mini/mini-llvm.c
@@ -3660,10 +3660,6 @@ emit_method_init (EmitContext *ctx)
subtype = AOT_INIT_METHOD_GSHARED_THIS;
}
break;
- case MONO_RGCTX_ACCESS_VTABLE:
- args [nargs ++] = convert (ctx, ctx->rgctx_arg, IntPtrType ());
- subtype = AOT_INIT_METHOD_GSHARED_VTABLE;
- break;
case MONO_RGCTX_ACCESS_THIS:
args [nargs ++] = convert (ctx, ctx->this_arg, ObjRefType ());
subtype = AOT_INIT_METHOD_GSHARED_THIS;
diff --git a/src/mono/mono/mini/mini-runtime.c b/src/mono/mono/mini/mini-runtime.c
index c61c42903ae..56c53ba6eed 100644
--- a/src/mono/mono/mini/mini-runtime.c
+++ b/src/mono/mono/mini/mini-runtime.c
@@ -1229,6 +1229,7 @@ mono_patch_info_hash (gconstpointer data)
case MONO_PATCH_INFO_METHOD_CODE_SLOT:
case MONO_PATCH_INFO_AOT_JIT_INFO:
case MONO_PATCH_INFO_METHOD_PINVOKE_ADDR_CACHE:
+ case MONO_PATCH_INFO_GSHARED_METHOD_INFO:
return hash | (gssize)ji->data.target;
case MONO_PATCH_INFO_GSHAREDVT_CALL:
return hash | (gssize)ji->data.gsharedvt->method;
@@ -1359,6 +1360,63 @@ mono_patch_info_equal (gconstpointer ka, gconstpointer kb)
return ji1->data.target == ji2->data.target;
}
+/* Make a copy of MonoGSharedMethodInfo and all its nested data into MEM_MANAGER */
+MonoGSharedMethodInfo *
+mini_gshared_method_info_dup (MonoMemoryManager *mem_manager, MonoGSharedMethodInfo *info)
+{
+ MonoGSharedMethodInfo *res = (MonoGSharedMethodInfo *)mono_mem_manager_alloc0 (mem_manager, sizeof (MonoGSharedMethodInfo));
+ memcpy (res, info, sizeof (MonoGSharedMethodInfo));
+
+ MonoRuntimeGenericContextInfoTemplate *oentries = info->entries;
+ res->entries = (MonoRuntimeGenericContextInfoTemplate *)mono_mem_manager_alloc0 (mem_manager, sizeof (MonoRuntimeGenericContextInfoTemplate) * info->num_entries);
+ memcpy (res->entries, oentries, sizeof (MonoRuntimeGenericContextInfoTemplate) * info->num_entries);
+
+ for (int i = 0; i < info->num_entries; ++i) {
+ MonoRuntimeGenericContextInfoTemplate *entry = &info->entries [i];
+ MonoRuntimeGenericContextInfoTemplate *new_entry = &res->entries [i];
+ switch (mini_rgctx_info_type_to_patch_info_type (entry->info_type)) {
+ case MONO_PATCH_INFO_DELEGATE_TRAMPOLINE: {
+ MonoDelegateClassMethodPair *old_info = (MonoDelegateClassMethodPair*)entry->data;
+ MonoDelegateClassMethodPair *new_info = mono_mem_manager_alloc0 (mem_manager, sizeof (MonoDelegateClassMethodPair));
+ memcpy (new_info, old_info, sizeof (MonoDelegateClassMethodPair));
+ new_entry->data = new_info;
+ break;
+ }
+ case MONO_PATCH_INFO_VIRT_METHOD: {
+ MonoJumpInfoVirtMethod *old_info = (MonoJumpInfoVirtMethod *)entry->data;
+ MonoJumpInfoVirtMethod *new_info = (MonoJumpInfoVirtMethod *)mono_mem_manager_alloc0 (mem_manager, sizeof (MonoJumpInfoVirtMethod));
+ memcpy (new_info, old_info, sizeof (MonoJumpInfoVirtMethod));
+ new_entry->data = new_info;
+ break;
+ }
+ case MONO_PATCH_INFO_GSHAREDVT_METHOD: {
+ MonoGSharedVtMethodInfo *old_info = (MonoGSharedVtMethodInfo*)entry->data;
+ MonoGSharedVtMethodInfo *new_info = (MonoGSharedVtMethodInfo*)mono_mem_manager_alloc0 (mem_manager, sizeof (MonoGSharedVtMethodInfo));
+ memcpy (new_info, old_info, sizeof (MonoGSharedVtMethodInfo));
+
+ MonoRuntimeGenericContextInfoTemplate *old_entries = old_info->entries;
+ MonoRuntimeGenericContextInfoTemplate *new_entries = (MonoRuntimeGenericContextInfoTemplate *)mono_mem_manager_alloc0 (mem_manager, sizeof (MonoRuntimeGenericContextInfoTemplate) * old_info->count_entries);
+ memcpy (new_entries, old_entries, sizeof (MonoRuntimeGenericContextInfoTemplate) * old_info->count_entries);
+ new_info->entries = new_entries;
+
+ new_entry->data = new_info;
+ break;
+ }
+ case MONO_PATCH_INFO_GSHAREDVT_CALL: {
+ MonoJumpInfoGSharedVtCall *old_info = (MonoJumpInfoGSharedVtCall*)entry->data;
+ MonoJumpInfoGSharedVtCall *new_info = (MonoJumpInfoGSharedVtCall*)mono_mem_manager_alloc0 (mem_manager, sizeof (MonoJumpInfoGSharedVtCall));
+ memcpy (new_info, old_info, sizeof (MonoJumpInfoGSharedVtCall));
+ new_entry->data = new_info;
+ break;
+ }
+ default:
+ break;
+ }
+ }
+
+ return res;
+}
+
gpointer
mono_resolve_patch_target_ext (MonoMemoryManager *mem_manager, MonoMethod *method, guint8 *code, MonoJumpInfo *patch_info, gboolean run_cctors, MonoError *error)
{
@@ -1694,6 +1752,9 @@ mono_resolve_patch_target_ext (MonoMemoryManager *mem_manager, MonoMethod *metho
target = NULL;
break;
}
+ case MONO_PATCH_INFO_GSHARED_METHOD_INFO:
+ target = mini_gshared_method_info_dup (mem_manager, (MonoGSharedMethodInfo*)patch_info->data.target);
+ break;
default:
g_assert_not_reached ();
}
@@ -2770,7 +2831,9 @@ static gpointer
get_ftnptr_for_method (MonoMethod *method, MonoError *error)
{
if (!mono_llvm_only) {
- return mono_jit_compile_method (method, error);
+ gpointer res = mono_jit_compile_method (method, error);
+ res = mini_add_method_trampoline (method, res, mono_method_needs_static_rgctx_invoke (method, TRUE), FALSE);
+ return res;
} else {
return mini_llvmonly_load_method_ftndesc (method, FALSE, FALSE, error);
}
@@ -4265,7 +4328,6 @@ free_jit_mem_manager (MonoMemoryManager *mem_manager)
g_hash_table_destroy (info->delegate_trampoline_hash);
g_hash_table_destroy (info->static_rgctx_trampoline_hash);
g_hash_table_destroy (info->mrgctx_hash);
- g_hash_table_destroy (info->method_rgctx_hash);
g_hash_table_destroy (info->interp_method_pointer_hash);
mono_conc_hashtable_destroy (info->runtime_invoke_hash);
g_hash_table_destroy (info->seq_points);
@@ -4902,6 +4964,7 @@ register_icalls (void)
register_icall (mono_throw_invalid_program, mono_icall_sig_void_ptr, FALSE);
register_icall_no_wrapper (mono_dummy_jit_icall, mono_icall_sig_void);
//register_icall_no_wrapper (mono_dummy_jit_icall_val, mono_icall_sig_void_ptr);
+ register_icall_no_wrapper (mini_init_method_rgctx, mono_icall_sig_void_ptr_ptr);
register_icall_with_wrapper (mono_monitor_enter_internal, mono_icall_sig_int32_obj);
register_icall_with_wrapper (mono_monitor_enter_v4_internal, mono_icall_sig_void_obj_ptr);
diff --git a/src/mono/mono/mini/mini-runtime.h b/src/mono/mono/mini/mini-runtime.h
index a87d5381d8b..b4c6888d41b 100644
--- a/src/mono/mono/mini/mini-runtime.h
+++ b/src/mono/mono/mini/mini-runtime.h
@@ -54,7 +54,6 @@ typedef struct {
MonoInternalHashTable interp_code_hash;
/* Maps MonoMethod -> MonoMethodRuntimeGenericContext */
GHashTable *mrgctx_hash;
- GHashTable *method_rgctx_hash;
/* Maps gpointer -> InterpMethod */
GHashTable *interp_method_pointer_hash;
/* Protected by 'jit_code_hash_lock' */
@@ -567,6 +566,7 @@ gint mono_patch_info_equal (gconstpointer ka, gconstpointer kb);
MonoJumpInfo *mono_patch_info_list_prepend (MonoJumpInfo *list, int ip, MonoJumpInfoType type, gconstpointer target);
MonoJumpInfoToken* mono_jump_info_token_new (MonoMemPool *mp, MonoImage *image, guint32 token);
MonoJumpInfoToken* mono_jump_info_token_new2 (MonoMemPool *mp, MonoImage *image, guint32 token, MonoGenericContext *context);
+MonoGSharedMethodInfo* mini_gshared_method_info_dup (MonoMemoryManager *mem_manager, MonoGSharedMethodInfo *info);
gpointer mono_resolve_patch_target (MonoMethod *method, guint8 *code, MonoJumpInfo *patch_info, gboolean run_cctors, MonoError *error);
gpointer mono_resolve_patch_target_ext (MonoMemoryManager *mem_manager, MonoMethod *method, guint8 *code, MonoJumpInfo *patch_info, gboolean run_cctors, MonoError *error);
void mini_register_jump_site (MonoMethod *method, gpointer ip);
diff --git a/src/mono/mono/mini/mini-trampolines.c b/src/mono/mono/mini/mini-trampolines.c
index 2b87e4bce2c..81b597cc49f 100644
--- a/src/mono/mono/mini/mini-trampolines.c
+++ b/src/mono/mono/mini/mini-trampolines.c
@@ -558,9 +558,15 @@ common_call_trampoline (host_mgreg_t *regs, guint8 *code, MonoMethod *m, MonoVTa
klass = mrgctx->class_vtable->klass;
method_inst = mrgctx->method_inst;
} else if ((m->flags & METHOD_ATTRIBUTE_STATIC) || m_class_is_valuetype (m->klass)) {
+ MonoMethodRuntimeGenericContext *mrgctx = (MonoMethodRuntimeGenericContext*)mono_arch_find_static_call_vtable (regs, code);
+
+ klass = mrgctx->class_vtable->klass;
+ method_inst = mrgctx->method_inst;
+ /*
MonoVTable *vtable = mono_arch_find_static_call_vtable (regs, code);
klass = vtable->klass;
+ */
} else {
MonoObject *this_argument = (MonoObject *)mono_arch_get_this_arg_from_call (regs, code);
diff --git a/src/mono/mono/mini/mini.c b/src/mono/mono/mini/mini.c
index 346ccb5bce7..cf47f73ff34 100644
--- a/src/mono/mono/mini/mini.c
+++ b/src/mono/mono/mini/mini.c
@@ -3055,7 +3055,7 @@ mini_get_rgctx_access_for_method (MonoMethod *method)
return MONO_RGCTX_ACCESS_MRGCTX;
if (method->flags & METHOD_ATTRIBUTE_STATIC || m_class_is_valuetype (method->klass))
- return MONO_RGCTX_ACCESS_VTABLE;
+ return MONO_RGCTX_ACCESS_MRGCTX;
return MONO_RGCTX_ACCESS_THIS;
}
@@ -3752,6 +3752,13 @@ mini_method_compile (MonoMethod *method, guint32 opts, JitFlags flags, int parts
mono_cfg_dump_ir (cfg, "decompose_array_access_opts");
}
+ /* Eliminate the mrgctx init call if the method has no mrgctx entries */
+ if (cfg->gshared_info && !cfg->gshared_info->num_entries) {
+ NULLIFY_INS (cfg->init_method_rgctx_ins);
+ /* Needed by the assert in get_gshared_info_slot () */
+ cfg->init_method_rgctx_ins = NULL;
+ }
+
if (cfg->got_var) {
#ifndef MONO_ARCH_GOT_REG
GList *regs;
@@ -3840,6 +3847,13 @@ mini_method_compile (MonoMethod *method, guint32 opts, JitFlags flags, int parts
mono_insert_branches_between_bblocks (cfg);
+ if (cfg->gshared_info) {
+ MonoGSharedMethodInfo *info = mini_gshared_method_info_dup (cfg->mem_manager, cfg->gshared_info);
+
+ /* cfg->gshared_info is already allocated from permanent memory, so change only the entries */
+ cfg->gshared_info->entries = info->entries;
+ }
+
if (COMPILE_LLVM (cfg)) {
#ifdef ENABLE_LLVM
char *nm;
diff --git a/src/mono/mono/mini/mini.h b/src/mono/mono/mini/mini.h
index d7c919d62a7..b759b4222d1 100644
--- a/src/mono/mono/mini/mini.h
+++ b/src/mono/mono/mini/mini.h
@@ -1086,8 +1086,6 @@ typedef enum {
MONO_RGCTX_ACCESS_THIS = 1,
/* Loaded from an additional mrgctx argument */
MONO_RGCTX_ACCESS_MRGCTX = 2,
- /* Loaded from an additional vtable argument */
- MONO_RGCTX_ACCESS_VTABLE = 3
} MonoRgctxAccess;
typedef struct _MonoRuntimeGenericContextInfoTemplate {
@@ -1104,12 +1102,14 @@ typedef struct {
typedef struct {
MonoVTable *class_vtable; /* must be the first element */
+ MonoMethod *method;
MonoGenericInst *method_inst;
+ gpointer *entries;
gpointer infos [MONO_ZERO_LEN_ARRAY];
} MonoMethodRuntimeGenericContext;
/* MONO_ABI_SIZEOF () would include the 'infos' field as well */
-#define MONO_SIZEOF_METHOD_RUNTIME_GENERIC_CONTEXT (TARGET_SIZEOF_VOID_P * 2)
+#define MONO_SIZEOF_METHOD_RUNTIME_GENERIC_CONTEXT (TARGET_SIZEOF_VOID_P * 4)
#define MONO_RGCTX_SLOT_MAKE_RGCTX(i) (i)
#define MONO_RGCTX_SLOT_MAKE_MRGCTX(i) ((i) | 0x80000000)
@@ -1124,6 +1124,12 @@ typedef struct {
int num_entries, count_entries;
} MonoGSharedVtMethodInfo;
+typedef struct {
+ MonoMethod *method;
+ MonoRuntimeGenericContextInfoTemplate *entries;
+ int num_entries, count_entries;
+} MonoGSharedMethodInfo;
+
/* This is used by gsharedvt methods to allocate locals and compute local offsets */
typedef struct {
int locals_size;
@@ -1379,6 +1385,8 @@ typedef struct {
MonoGenericSharingContext gsctx;
MonoGenericContext *gsctx_context;
+ MonoGSharedMethodInfo *gshared_info;
+
MonoGSharedVtMethodInfo *gsharedvt_info;
gpointer jit_mm;
@@ -1393,8 +1401,8 @@ typedef struct {
/* Points to a MonoGSharedVtMethodRuntimeInfo at runtime */
MonoInst *gsharedvt_info_var;
- /* For native-to-managed wrappers, CEE_MONO_JIT_(AT|DE)TACH opcodes */
- MonoInst *orig_domain_var;
+ /* Points to the call to mini_init_method_rgctx () */
+ MonoInst *init_method_rgctx_ins;
MonoInst *lmf_var;
MonoInst *lmf_addr_var;
@@ -2817,6 +2825,9 @@ MonoMethod* mini_get_gsharedvt_in_sig_wrapper (MonoMethodSignature *sig);
MonoMethod* mini_get_gsharedvt_out_sig_wrapper (MonoMethodSignature *sig);
MonoMethodSignature* mini_get_gsharedvt_out_sig_wrapper_signature (gboolean has_this, gboolean has_ret, int param_count);
gboolean mini_gsharedvt_runtime_invoke_supported (MonoMethodSignature *sig);
+gpointer mini_instantiate_gshared_info (MonoRuntimeGenericContextInfoTemplate *oti,
+ MonoGenericContext *context, MonoClass *klass);
+
G_EXTERN_C void mono_interp_entry_from_trampoline (gpointer ccontext, gpointer imethod);
G_EXTERN_C void mono_interp_to_native_trampoline (gpointer addr, gpointer ccontext);
MonoMethod* mini_get_interp_in_wrapper (MonoMethodSignature *sig);
diff --git a/src/mono/mono/mini/patch-info.h b/src/mono/mono/mini/patch-info.h
index 19c1ae29c19..62d1e6ab970 100644
--- a/src/mono/mono/mini/patch-info.h
+++ b/src/mono/mono/mini/patch-info.h
@@ -88,3 +88,6 @@ PATCH_INFO(METHOD_PINVOKE_ADDR_CACHE, "pinvoke_addr_cache")
/* MonoMethod* -> llvmonly interp entry */
PATCH_INFO(LLVMONLY_INTERP_ENTRY, "llvmonly_interp_entry")
+
+/* A MonoGSharedMethodInfo structure */
+PATCH_INFO(GSHARED_METHOD_INFO, "gshared_method_info")
diff --git a/src/mono/mono/utils/mono-dl-posix.c b/src/mono/mono/utils/mono-dl-posix.c
index 16a65399786..1d2a4106650 100644
--- a/src/mono/mono/utils/mono-dl-posix.c
+++ b/src/mono/mono/utils/mono-dl-posix.c
@@ -74,7 +74,7 @@ mono_dl_get_system_dir (void)
#endif
void *
-mono_dl_open_file (const char *file, int flags)
+mono_dl_open_file (const char *file, int flags, MonoError *error)
{
#ifdef HOST_ANDROID
/* Bionic doesn't support NULL filenames */
@@ -108,7 +108,7 @@ mono_dl_open_file (const char *file, int flags)
}
void
-mono_dl_close_handle (MonoDl *module)
+mono_dl_close_handle (MonoDl *module, MonoError *error)
{
dlclose (module->handle);
}
diff --git a/src/mono/mono/utils/mono-dl-wasm.c b/src/mono/mono/utils/mono-dl-wasm.c
index 4d5529926d8..15189fe9db0 100644
--- a/src/mono/mono/utils/mono-dl-wasm.c
+++ b/src/mono/mono/utils/mono-dl-wasm.c
@@ -77,14 +77,14 @@ mono_dl_convert_flags (int mono_flags, int native_flags)
}
void *
-mono_dl_open_file (const char *file, int flags)
+mono_dl_open_file (const char *file, int flags, MonoError *error)
{
// Actual dlopen is done in driver.c:wasm_dl_load()
return NULL;
}
void
-mono_dl_close_handle (MonoDl *module)
+mono_dl_close_handle (MonoDl *module, MonoError *error)
{
}
diff --git a/src/mono/mono/utils/mono-dl-windows.c b/src/mono/mono/utils/mono-dl-windows.c
index a21e03725c7..ea0d7e0dee9 100644
--- a/src/mono/mono/utils/mono-dl-windows.c
+++ b/src/mono/mono/utils/mono-dl-windows.c
@@ -14,6 +14,7 @@
#if defined(HOST_WIN32)
#include <mono/utils/mono-dl.h>
+#include <mono/utils/mono-error-internals.h>
#include <mono/utils/mono-dl-windows-internals.h>
#include <mono/utils/mono-embed.h>
#include <mono/utils/mono-path.h>
@@ -46,7 +47,7 @@ mono_dl_get_so_suffixes (void)
}
void*
-mono_dl_open_file (const char *file, int flags)
+mono_dl_open_file (const char *file, int flags, MonoError *error)
{
gpointer hModule = NULL;
if (file) {
@@ -73,8 +74,13 @@ mono_dl_open_file (const char *file, int flags)
g_free (file_utf16);
- if (!hModule)
+ if (!hModule) {
+ if (last_error == ERROR_BAD_EXE_FORMAT || last_error == ERROR_BAD_FORMAT)
+ mono_error_set_error (error, MONO_ERROR_BAD_IMAGE, NULL);
+ else
+ mono_error_set_error (error, MONO_ERROR_FILE_NOT_FOUND, NULL);
SetLastError (last_error);
+ }
} else {
#if HAVE_API_SUPPORT_WIN32_GET_MODULE_HANDLE
hModule = GetModuleHandleW (NULL);
@@ -86,10 +92,13 @@ mono_dl_open_file (const char *file, int flags)
}
void
-mono_dl_close_handle (MonoDl *module)
+mono_dl_close_handle (MonoDl *module, MonoError *error)
{
- if (!module->main_module)
- FreeLibrary ((HMODULE)module->handle);
+ if (!module->main_module) {
+ if (FreeLibrary ((HMODULE)module->handle) == FALSE) {
+ mono_error_set_invalid_operation (error, NULL);
+ }
+ }
}
#if HAVE_API_SUPPORT_WIN32_ENUM_PROCESS_MODULES
diff --git a/src/mono/mono/utils/mono-dl.c b/src/mono/mono/utils/mono-dl.c
index 3b4171dcae3..19b6d9452a5 100644
--- a/src/mono/mono/utils/mono-dl.c
+++ b/src/mono/mono/utils/mono-dl.c
@@ -15,6 +15,7 @@
#include "mono/utils/mono-embed.h"
#include "mono/utils/mono-path.h"
#include "mono/utils/mono-threads-api.h"
+#include "mono/utils/mono-error-internals.h"
#include <stdlib.h>
#include <stdio.h>
@@ -173,24 +174,24 @@ fix_libc_name (const char *name)
/**
* mono_dl_open_self:
- * \param error_msg pointer for error message on failure
+ * \param error pointer to MonoError
*
* Returns a handle to the main program, on android x86 it's not possible to
* call dl_open(null), it returns a null handle, so this function returns RTLD_DEFAULT
* handle in this platform.
+ * \p error points to MonoError where an error will be stored in
+ * case of failure. The error needs to be cleared when done using it, \c mono_error_cleanup.
+ * \returns a \c MonoDl pointer on success, NULL on failure.
*/
MonoDl*
-mono_dl_open_self (char **error_msg)
+mono_dl_open_self (MonoError *error)
{
#if defined(TARGET_ANDROID) && !defined(WIN32)
MonoDl *module;
- if (error_msg)
- *error_msg = NULL;
module = (MonoDl *) g_malloc (sizeof (MonoDl));
if (!module) {
- if (error_msg)
- *error_msg = g_strdup ("Out of memory");
+ mono_error_set_out_of_memory (error, NULL);
return NULL;
}
mono_refcount_init (module, NULL);
@@ -199,7 +200,7 @@ mono_dl_open_self (char **error_msg)
module->full_name = NULL;
return module;
#else
- return mono_dl_open (NULL, MONO_DL_LAZY, error_msg);
+ return mono_dl_open (NULL, MONO_DL_LAZY, error);
#endif
}
@@ -207,7 +208,7 @@ mono_dl_open_self (char **error_msg)
* mono_dl_open:
* \param name name of file containing shared module
* \param flags flags
- * \param error_msg pointer for error message on failure
+ * \param error pointer to MonoError
*
* Load the given file \p name as a shared library or dynamically loadable
* module. \p name can be NULL to indicate loading the currently executing
@@ -215,18 +216,18 @@ mono_dl_open_self (char **error_msg)
* \p flags can have the \c MONO_DL_LOCAL bit set to avoid exporting symbols
* from the module to the shared namespace. The \c MONO_DL_LAZY bit can be set
* to lazily load the symbols instead of resolving everything at load time.
- * \p error_msg points to a string where an error message will be stored in
- * case of failure. The error must be released with \c g_free.
+ * \p error points to MonoError where an error will be stored in
+ * case of failure. The error needs to be cleared when done using it, \c mono_error_cleanup.
* \returns a \c MonoDl pointer on success, NULL on failure.
*/
MonoDl*
-mono_dl_open (const char *name, int flags, char **error_msg)
+mono_dl_open (const char *name, int flags, MonoError *error)
{
- return mono_dl_open_full (name, flags, 0, error_msg);
+ return mono_dl_open_full (name, flags, 0, error);
}
MonoDl *
-mono_dl_open_full (const char *name, int mono_flags, int native_flags, char **error_msg)
+mono_dl_open_full (const char *name, int mono_flags, int native_flags, MonoError *error)
{
MonoDl *module;
void *lib;
@@ -234,21 +235,30 @@ mono_dl_open_full (const char *name, int mono_flags, int native_flags, char **er
int lflags = mono_dl_convert_flags (mono_flags, native_flags);
char *found_name = NULL;
- if (error_msg)
- *error_msg = NULL;
-
module = (MonoDl *) g_malloc (sizeof (MonoDl));
if (!module) {
- if (error_msg)
- *error_msg = g_strdup ("Out of memory");
+ mono_error_set_out_of_memory (error, NULL);
return NULL;
}
module->main_module = name == NULL? TRUE: FALSE;
name = fix_libc_name (name);
+ ERROR_DECL (load_error);
+
// No GC safe transition because this is called early in main.c
- lib = mono_dl_open_file (name, lflags);
+ lib = mono_dl_open_file (name, lflags, load_error);
+
+ if (!lib && !is_ok (load_error) && mono_error_get_error_code (load_error) == MONO_ERROR_BAD_IMAGE) {
+ char *error_msg = mono_dl_current_error_string ();
+ mono_error_set_error (error, MONO_ERROR_BAD_IMAGE, "%s", error_msg);
+ g_free (error_msg);
+ mono_error_cleanup (load_error);
+ return NULL;
+ }
+
+ mono_error_cleanup (load_error);
+
if (lib)
found_name = g_strdup (name);
@@ -256,12 +266,9 @@ mono_dl_open_full (const char *name, int mono_flags, int native_flags, char **er
GSList *node;
for (node = fallback_handlers; node != NULL; node = node->next){
MonoDlFallbackHandler *handler = (MonoDlFallbackHandler *) node->data;
- if (error_msg)
- *error_msg = NULL;
-
- lib = handler->load_func (name, lflags, error_msg, handler->user_data);
- if (error_msg && *error_msg != NULL)
- g_free (*error_msg);
+ char *error_msg = NULL;
+ lib = handler->load_func (name, lflags, &error_msg, handler->user_data);
+ g_free (error_msg);
if (lib != NULL){
dl_fallback = handler;
@@ -278,6 +285,7 @@ mono_dl_open_full (const char *name, int mono_flags, int native_flags, char **er
/* This platform does not support dlopen */
if (name == NULL) {
g_free (module);
+ mono_error_set_not_supported (error, NULL);
return NULL;
}
@@ -289,7 +297,10 @@ mono_dl_open_full (const char *name, int mono_flags, int native_flags, char **er
llname = get_dl_name_from_libtool (lname);
g_free (lname);
if (llname) {
- lib = mono_dl_open_file (llname, lflags);
+ error_init_reuse (load_error);
+ lib = mono_dl_open_file (llname, lflags, load_error);
+ mono_error_cleanup (load_error);
+
if (lib)
found_name = g_strdup (llname);
#if defined (_AIX)
@@ -304,7 +315,9 @@ mono_dl_open_full (const char *name, int mono_flags, int native_flags, char **er
/* try common suffix */
char *llaixname;
llaixname = g_strconcat (llname, "(shr_64.o)", (const char*)NULL);
- lib = mono_dl_open_file (llaixname, lflags);
+ error_init_reuse (load_error);
+ lib = mono_dl_open_file (llaixname, lflags, load_error);
+ mono_error_cleanup (load_error);
if (lib)
found_name = g_strdup (llaixname);
/* XXX: try another suffix like (shr.o)? */
@@ -314,9 +327,9 @@ mono_dl_open_full (const char *name, int mono_flags, int native_flags, char **er
g_free (llname);
}
if (!lib) {
- if (error_msg) {
- *error_msg = mono_dl_current_error_string ();
- }
+ char *error_msg = mono_dl_current_error_string ();
+ mono_error_set_error (error, MONO_ERROR_FILE_NOT_FOUND, "%s", error_msg);
+ g_free (error_msg);
g_free (module);
return NULL;
}
@@ -332,13 +345,14 @@ mono_dl_open_full (const char *name, int mono_flags, int native_flags, char **er
* mono_dl_symbol:
* \param module a MonoDl pointer
* \param name symbol name
- * \param symbol pointer for the result value
+ * \param error pointer to MonoError
* Load the address of symbol \p name from the given \p module.
- * The address is stored in the pointer pointed to by \p symbol.
- * \returns NULL on success, an error message on failure
+ * \p error points to MonoError where an error will be stored in
+ * case of failure. The error needs to be cleared when done using it, \c mono_error_cleanup.
+ * \returns address to symbol on success, NULL on failure
*/
-char*
-mono_dl_symbol (MonoDl *module, const char *name, void **symbol)
+void*
+mono_dl_symbol (MonoDl *module, const char *name, MonoError *error)
{
void *sym;
char *err = NULL;
@@ -350,23 +364,28 @@ mono_dl_symbol (MonoDl *module, const char *name, void **symbol)
}
if (sym) {
- if (symbol)
- *symbol = sym;
- return NULL;
+ mono_error_assert_ok (error);
+ return sym;
}
- if (symbol)
- *symbol = NULL;
- return (module->dl_fallback != NULL) ? err : mono_dl_current_error_string ();
+
+ err = (module->dl_fallback != NULL) ? err : mono_dl_current_error_string ();
+ mono_error_set_generic_error (error, "System", "EntryPointNotFoundException", "%s", err);
+ g_free (err);
+
+ return NULL;
}
/**
* mono_dl_close:
* \param module a \c MonoDl pointer
+ * \param error pointer to a MonoError.
* Unload the given module and free the module memory.
+ * \p error points to a MonoError where an error will be stored in
+ * case of failure. The error needs to be cleared when done using it, \c mono_error_cleanup.
* \returns \c 0 on success.
*/
void
-mono_dl_close (MonoDl *module)
+mono_dl_close (MonoDl *module, MonoError *error)
{
MonoDlFallbackHandler *dl_fallback = module->dl_fallback;
@@ -374,7 +393,7 @@ mono_dl_close (MonoDl *module)
if (dl_fallback->close_func != NULL)
dl_fallback->close_func (module->handle, dl_fallback->user_data);
} else
- mono_dl_close_handle (module);
+ mono_dl_close_handle (module, error);
g_free (module->full_name);
g_free (module);
@@ -581,16 +600,16 @@ mono_dl_fallback_unregister (MonoDlFallbackHandler *handler)
}
static MonoDl*
-try_load (const char *lib_name, char *dir, int flags, char **err)
+try_load (const char *lib_name, char *dir, int flags, MonoError *error)
{
gpointer iter;
MonoDl *runtime_lib;
char *path;
iter = NULL;
- *err = NULL;
while ((path = mono_dl_build_path (dir, lib_name, &iter))) {
- g_free (*err);
- runtime_lib = mono_dl_open (path, flags, err);
+ mono_error_cleanup (error);
+ error_init_reuse (error);
+ runtime_lib = mono_dl_open (path, flags, error);
g_free (path);
if (runtime_lib)
return runtime_lib;
@@ -599,10 +618,9 @@ try_load (const char *lib_name, char *dir, int flags, char **err)
}
MonoDl*
-mono_dl_open_runtime_lib (const char* lib_name, int flags, char **error_msg)
+mono_dl_open_runtime_lib (const char* lib_name, int flags, MonoError *error)
{
MonoDl *runtime_lib = NULL;
- *error_msg = NULL;
char *resolvedname = minipal_getexepath();
@@ -612,33 +630,42 @@ mono_dl_open_runtime_lib (const char* lib_name, int flags, char **error_msg)
char *baseparent = NULL;
base = g_path_get_dirname (resolvedname);
name = g_strdup_printf ("%s/.libs", base);
- runtime_lib = try_load (lib_name, name, flags, error_msg);
+ runtime_lib = try_load (lib_name, name, flags, error);
g_free (name);
if (!runtime_lib)
baseparent = g_path_get_dirname (base);
if (!runtime_lib) {
+ mono_error_cleanup (error);
+ error_init_reuse (error);
name = g_strdup_printf ("%s/lib", baseparent);
- runtime_lib = try_load (lib_name, name, flags, error_msg);
+ runtime_lib = try_load (lib_name, name, flags, error);
g_free (name);
}
#ifdef __MACH__
if (!runtime_lib) {
+ mono_error_cleanup (error);
+ error_init_reuse (error);
name = g_strdup_printf ("%s/Libraries", baseparent);
- runtime_lib = try_load (lib_name, name, flags, error_msg);
+ runtime_lib = try_load (lib_name, name, flags, error);
g_free (name);
}
#endif
if (!runtime_lib) {
+ mono_error_cleanup (error);
+ error_init_reuse (error);
name = g_strdup_printf ("%s/profiler/.libs", baseparent);
- runtime_lib = try_load (lib_name, name, flags, error_msg);
+ runtime_lib = try_load (lib_name, name, flags, error);
g_free (name);
}
g_free (base);
g_free (resolvedname);
g_free (baseparent);
}
- if (!runtime_lib)
- runtime_lib = try_load (lib_name, NULL, flags, error_msg);
+ if (!runtime_lib) {
+ mono_error_cleanup (error);
+ error_init_reuse (error);
+ runtime_lib = try_load (lib_name, NULL, flags, error);
+ }
return runtime_lib;
}
diff --git a/src/mono/mono/utils/mono-dl.h b/src/mono/mono/utils/mono-dl.h
index a0a2c4ec7e4..40d5fff11d0 100644
--- a/src/mono/mono/utils/mono-dl.h
+++ b/src/mono/mono/utils/mono-dl.h
@@ -8,6 +8,7 @@
#include "mono/utils/mono-compiler.h"
#include "mono/utils/mono-dl-fallback.h"
#include "mono/utils/refcount.h"
+#include "mono/utils/mono-error.h"
#ifdef TARGET_WIN32
#define MONO_SOLIB_EXT ".dll"
@@ -29,29 +30,29 @@ typedef struct {
} MonoDl;
MONO_EXTERN_C
-MonoDl* mono_dl_open (const char *name, int flags, char **error_msg);
+MonoDl* mono_dl_open (const char *name, int flags, MonoError *error);
MONO_EXTERN_C
-char* mono_dl_symbol (MonoDl *module, const char *name, void **symbol);
+void* mono_dl_symbol (MonoDl *module, const char *name, MonoError *error);
MONO_EXTERN_C
-void mono_dl_close (MonoDl *module);
+void mono_dl_close (MonoDl *module, MonoError *error);
char* mono_dl_build_path (const char *directory, const char *name, void **iter);
char* mono_dl_build_platform_path (const char *directory, const char *name, void **iter);
-MonoDl* mono_dl_open_runtime_lib (const char *lib_name, int flags, char **error_msg);
+MonoDl* mono_dl_open_runtime_lib (const char *lib_name, int flags, MonoError *error);
MonoDl *
-mono_dl_open_self (char **error_msg);
+mono_dl_open_self (MonoError *error);
// This converts the MONO_DL_* enum to native flags, combines it with the other flags passed, and resolves some inconsistencies
MonoDl *
-mono_dl_open_full (const char *name, int mono_flags, int native_flags, char **error_msg);
+mono_dl_open_full (const char *name, int mono_flags, int native_flags, MonoError *error);
//Platform API for mono_dl
const char* mono_dl_get_so_prefix (void);
const char** mono_dl_get_so_suffixes (void);
-void* mono_dl_open_file (const char *file, int flags);
-void mono_dl_close_handle (MonoDl *module);
+void* mono_dl_open_file (const char *file, int flags, MonoError *error);
+void mono_dl_close_handle (MonoDl *module, MonoError *error);
void* mono_dl_lookup_symbol (MonoDl *module, const char *name);
int mono_dl_convert_flags (int mono_flags, int native_flags);
char* mono_dl_current_error_string (void);
diff --git a/src/mono/mono/utils/mono-error-internals.h b/src/mono/mono/utils/mono-error-internals.h
index 6d55b5a7f81..48548ad6001 100644
--- a/src/mono/mono/utils/mono-error-internals.h
+++ b/src/mono/mono/utils/mono-error-internals.h
@@ -160,6 +160,18 @@ do { \
#define mono_error_assert_msg_ok(error, msg) g_assertf (is_ok (error), msg ", due to %s", mono_error_get_message (error))
#define mono_error_assertf_ok(error, fmt, ...) g_assertf (is_ok (error), fmt ", due to %s", __VA_ARGS__, mono_error_get_message (error))
+/*
+* Returns a pointer to the error message, wihtout fields, empty string if no message is available.
+* Caller should NOT release returned pointer, owned by MonoError.
+*/
+static inline
+const char *
+mono_error_get_message_without_fields (MonoError *oerror)
+{
+ MonoErrorInternal *error = (MonoErrorInternal*)oerror;
+ return error->full_message ? error->full_message : "";
+}
+
void
mono_error_dup_strings (MonoError *error, gboolean dup_strings);
diff --git a/src/mono/mono/utils/mono-mmap-windows.c b/src/mono/mono/utils/mono-mmap-windows.c
index e6945440363..47854cd445e 100644
--- a/src/mono/mono/utils/mono-mmap-windows.c
+++ b/src/mono/mono/utils/mono-mmap-windows.c
@@ -113,7 +113,10 @@ mono_valloc_aligned (size_t length, size_t alignment, int flags, MonoMemAccountT
aligned = mono_aligned_address (mem, length, alignment);
aligned = (char*)VirtualAlloc (aligned, length, MEM_COMMIT, prot);
- g_assert (aligned);
+ if (!aligned) {
+ VirtualFree (mem, 0, MEM_RELEASE);
+ return NULL;
+ }
mono_account_mem (type, (ssize_t)length);
diff --git a/src/mono/mono/utils/options-def.h b/src/mono/mono/utils/options-def.h
index 748d095ce3a..42d890f3816 100644
--- a/src/mono/mono/utils/options-def.h
+++ b/src/mono/mono/utils/options-def.h
@@ -58,6 +58,7 @@ DEFINE_BOOL_READONLY(readonly_flag, "readonly-flag", FALSE, "Example")
*/
DEFINE_BOOL(wasm_exceptions, "wasm-exceptions", FALSE, "Enable codegen for wasm exceptions")
+DEFINE_BOOL(aot_lazy_assembly_load, "aot-lazy-assembly-load", FALSE, "Load assemblies referenced by AOT images lazily")
/* Cleanup */
#undef DEFINE_OPTION_FULL
diff --git a/src/mono/mono/utils/options.c b/src/mono/mono/utils/options.c
index f8c4e82e37e..044ab3cbdf4 100644
--- a/src/mono/mono/utils/options.c
+++ b/src/mono/mono/utils/options.c
@@ -86,7 +86,7 @@ mono_options_print_usage (void)
}
/*
- * mono_optiond_parse_options:
+ * mono_options_parse_options:
*
* Set options based on the command line arguments in ARGV/ARGC.
* Remove processed arguments from ARGV and set *OUT_ARGC to the
diff --git a/src/tests/Interop/NativeLibrary/Callback/CallbackStressTest.cs b/src/tests/Interop/NativeLibrary/Callback/CallbackStressTest.cs
index 7cca247cfd0..e436304ddf7 100644
--- a/src/tests/Interop/NativeLibrary/Callback/CallbackStressTest.cs
+++ b/src/tests/Interop/NativeLibrary/Callback/CallbackStressTest.cs
@@ -106,11 +106,19 @@ public class CallbackStressTest
public static void ManualRaiseException()
{
#if WINDOWS
- try
+ if (!TestLibrary.Utilities.IsMonoRuntime)
+ {
+ try
+ {
+ RaiseException(5, 0, 0, IntPtr.Zero);
+ }
+ catch(SEHException ex) { GC.Collect(); s_SEHExceptionCatchCalled++; }
+ }
+ else
{
- RaiseException(5, 0, 0, IntPtr.Zero);
+ // SEH exception handling not supported on Mono.
+ s_SEHExceptionCatchCalled++;
}
- catch(SEHException ex) { GC.Collect(); s_SEHExceptionCatchCalled++; }
#else
// TODO: test on Unix when implementing pinvoke inlining
s_SEHExceptionCatchCalled++;
diff --git a/src/tests/Interop/NativeLibrary/Callback/CallbackStressTest_TargetWindows.csproj b/src/tests/Interop/NativeLibrary/Callback/CallbackStressTest_TargetWindows.csproj
index 25cc1e64109..6a222191877 100644
--- a/src/tests/Interop/NativeLibrary/Callback/CallbackStressTest_TargetWindows.csproj
+++ b/src/tests/Interop/NativeLibrary/Callback/CallbackStressTest_TargetWindows.csproj
@@ -12,5 +12,6 @@
</ItemGroup>
<ItemGroup>
<CMakeProjectReference Include="../NativeLibraryToLoad/CMakeLists.txt" />
+ <ProjectReference Include="$(TestSourceDir)Common/CoreCLRTestLibrary/CoreCLRTestLibrary.csproj" />
</ItemGroup>
</Project>
diff --git a/src/tests/Interop/UnmanagedCallersOnly/UnmanagedCallersOnlyTest.cs b/src/tests/Interop/UnmanagedCallersOnly/UnmanagedCallersOnlyTest.cs
index f67c8b67270..4c1a2e4184a 100644
--- a/src/tests/Interop/UnmanagedCallersOnly/UnmanagedCallersOnlyTest.cs
+++ b/src/tests/Interop/UnmanagedCallersOnly/UnmanagedCallersOnlyTest.cs
@@ -51,8 +51,8 @@ public unsafe class Program
TestUnmanagedCallersOnlyViaUnmanagedCalli();
TestPInvokeMarkedWithUnmanagedCallersOnly();
- // Exception handling is only supported on Windows.
- if (TestLibrary.Utilities.IsWindows)
+ // Exception handling is only supported on CoreCLR Windows.
+ if (TestLibrary.Utilities.IsWindows && !TestLibrary.Utilities.IsMonoRuntime)
{
TestUnmanagedCallersOnlyValid_ThrowException();
TestUnmanagedCallersOnlyViaUnmanagedCalli_ThrowException();
diff --git a/src/tests/build.cmd b/src/tests/build.cmd
index c8df0dc64cc..7c72558ac4b 100644
--- a/src/tests/build.cmd
+++ b/src/tests/build.cmd
@@ -115,9 +115,9 @@ if /i "%1" == "perfmap" (set __CreatePerfmap=1&set processedArgs=!
if /i "%1" == "Exclude" (set __Exclude=%2&set processedArgs=!processedArgs! %1 %2&shift&shift&goto Arg_Loop)
if /i "%1" == "-priority" (set __Priority=%2&shift&set processedArgs=!processedArgs! %1=%2&shift&goto Arg_Loop)
if /i "%1" == "allTargets" (set "__BuildNeedTargetArg=/p:CLRTestBuildAllTargets=%1"&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
-if /i "%1" == "-excludemonofailures" (set __Mono=1&set processedArgs=!processedArgs!&shift&goto Arg_Loop)
-if /i "%1" == "-mono" (set __Mono=1&set processedArgs=!processedArgs!&shift&goto Arg_Loop)
-if /i "%1" == "mono" (set __Mono=1&set processedArgs=!processedArgs!&shift&goto Arg_Loop)
+if /i "%1" == "-excludemonofailures" (set __Mono=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
+if /i "%1" == "-mono" (set __Mono=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
+if /i "%1" == "mono" (set __Mono=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "--" (set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if [!processedArgs!]==[] (
diff --git a/src/tests/issues.targets b/src/tests/issues.targets
index 4cf3567dc91..820103fd248 100644
--- a/src/tests/issues.targets
+++ b/src/tests/issues.targets
@@ -2061,6 +2061,175 @@
<ExcludeList Include = "$(XunitTestBinBase)/Interop/DisabledRuntimeMarshalling/**">
<Issue>https://github.com/dotnet/runtime/issues/64127</Issue>
</ExcludeList>
+ <ExcludeList Include = "$(XunitTestBinBase)/Interop/IJW/FixupCallsHostWhenLoaded/FixupCallsHostWhenLoaded/*">
+ <Issue>C++/CLI, IJW not supported on Mono</Issue>
+ </ExcludeList>
+ <ExcludeList Include = "$(XunitTestBinBase)/Interop/IJW/CopyConstructorMarshaler/CopyConstructorMarshaler/*">
+ <Issue>C++/CLI, IJW not supported on Mono</Issue>
+ </ExcludeList>
+ <ExcludeList Include = "$(XunitTestBinBase)/Interop/IJW/ManagedCallingNative/ManagedCallingNative/*">
+ <Issue>C++/CLI, IJW not supported on Mono</Issue>
+ </ExcludeList>
+ <ExcludeList Include = "$(XunitTestBinBase)/Interop/IJW/NativeCallingManaged/NativeCallingManaged/*">
+ <Issue>C++/CLI, IJW not supported on Mono</Issue>
+ </ExcludeList>
+ <ExcludeList Include = "$(XunitTestBinBase)/Interop/IJW/NativeVarargs/NativeVarargsTest/*">
+ <Issue>C++/CLI, IJW not supported on Mono</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/baseservices/typeequivalence/simple/Simple/*">
+ <Issue>Mono doesn't support type equivalence on types implemented in different assemblies</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/Interop/ArrayMarshalling/SafeArray/SafeArrayTest/*">
+ <Issue>Requires COM support, disabled on all Mono platforms.</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/Interop/ExecInDefAppDom/ExecInDefAppDom/*">
+ <Issue>CLR Runtime Host API not supported on Mono</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/Interop/MarshalAPI/IUnknown/IUnknownTest/*">
+ <Issue>Requires COM support, disabled on all Mono platforms</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/Interop/MarshalAPI/IUnknown/IUnknownTestInALC/*">
+ <Issue>Requires COM support, disabled on all Mono platforms</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/Interop/PInvoke/Varargs/VarargsTest/*">
+ <Issue>PInvoke Varargs/ArgIterator marshalling not supported on Mono</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/Interop/PInvoke/Attributes/LCID/LCIDTest/*">
+ <Issue>PInvoke LCIDConversionAttribute not supported on Mono</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest/*">
+ <Issue>Requires COM support, disabled on all Mono platforms</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTestInALC/*">
+ <Issue>PInvoke object marshalling not supported on Mono</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/Interop/PInvoke/NativeCallManagedComVisible/AssemblyWithoutComVisible/AssemblyWithoutComVisibleTest/*">
+ <Issue>PInvoke object marshalling not supported on Mono</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/Interop/PInvoke/NativeCallManagedComVisible/AssemblyTrue/AssemblyTrueTest/*">
+ <Issue>PInvoke object marshalling not supported on Mono</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/Interop/PInvoke/Variant/VariantTest/*">
+ <Issue>PInvoke object marshalling not supported on Mono</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/Interop/PInvoke/Variant/VariantTestBuiltInComDisabled/*">
+ <Issue>PInvoke object marshalling not supported on Mono</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/Interop/PInvoke/Variant/VariantTestComWrappers/*">
+ <Issue>Requires COM support, disabled on all Mono platforms</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/Interop/PInvoke/IEnumerator/IEnumeratorTest/*">
+ <Issue>PInvoke IEnumerator/IEnumarable marshalling not supported on Mono</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/Interop/StructMarshalling/ReversePInvoke/MarshalExpStruct/DelegatePInvoke/DelegatePInvokeTest/*">
+ <Issue>https://github.com/dotnet/runtime/issues/65695</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/Interop/StructMarshalling/ReversePInvoke/MarshalExpStruct/ReversePInvokeManaged/ReversePInvokeTest/*">
+ <Issue>https://github.com/dotnet/runtime/issues/65695</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/Interop/WinRT/WinRT/*">
+ <Issue>WinRT not supported on Mono</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/JIT/Regression/JitBlue/GitHub_22583/GitHub_22583/*">
+ <Issue>Mono doesn't support type equivalence on types implemented in different assemblies</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/Interop/PInvoke/CustomMarshalers/CustomMarshalersTest/*">
+ <Issue>Requires COM support, disabled on all Mono platforms</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/JIT/opt/Tailcall/TailcallVerifyWithPrefix/*">
+ <Issue>Fails on Windows Mono, test doesn't execute on none Windows platforms</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/Interop/PInvoke/BestFitMapping/Assembly_False_True/Assembly_False_True/*">
+ <Issue>Mono doesn't support interop BestFitMapping and ThrowOnUnmappableChar attributes</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/Interop/PInvoke/BestFitMapping/Assembly_True_True/Assembly_True_True/*">
+ <Issue>Mono doesn't support interop BestFitMapping and ThrowOnUnmappableChar attributes</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/Interop/PInvoke/BestFitMapping/Assembly_Default/Assembly_Default/*">
+ <Issue>Mono doesn't support interop BestFitMapping and ThrowOnUnmappableChar attributes</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/Interop/PInvoke/BestFitMapping/Assembly_False_False/Assembly_False_False/*">
+ <Issue>Mono doesn't support interop BestFitMapping and ThrowOnUnmappableChar attributes</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/Interop/PInvoke/BestFitMapping/Assembly_True_False/Assembly_True_False/*">
+ <Issue>Mono doesn't support interop BestFitMapping and ThrowOnUnmappableChar attributes</Issue>
+ </ExcludeList>
+ </ItemGroup>
+
+ <!-- Known failures for mono runtime on Windows -->
+ <ItemGroup Condition="'$(RuntimeFlavor)' == 'mono' and '$(TargetsWindows)' == 'true'" >
+ <ExcludeList Include = "$(XunitTestBinBase)/GC/Scenarios/Dynamo/dynamo/*">
+ <Issue>needs triage</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/Interop/StringMarshalling/VBByRefStr/VBByRefStrTest/*">
+ <Issue>https://github.com/dotnet/runtime/issues/65698</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/JIT/Directed/callconv/PlatformDefaultMemberFunction/PlatformDefaultMemberFunctionTest/*">
+ <Issue>https://github.com/dotnet/runtime/issues/50440</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XUnitTestBinBase)/JIT/Directed/callconv/CdeclMemberFunction/CdeclMemberFunctionTest/*">
+ <Issue>https://github.com/dotnet/runtime/issues/50440</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XUnitTestBinBase)/JIT/Directed/callconv/StdCallMemberFunction/StdCallMemberFunctionTest/*">
+ <Issue>https://github.com/dotnet/runtime/issues/50440</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XUnitTestBinBase)/JIT/Directed/callconv/ThisCall/ThisCallTest/*">
+ <Issue>https://github.com/dotnet/runtime/issues/50440</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/JIT/Directed/arglist/vararg_TargetWindows/*">
+ <Issue>https://github.com/dotnet/runtime/issues/10478</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/JIT/Directed/pinvoke/calli_excep/*">
+ <Issue>Mono doesn't support SEH exceptions in Mono Windows runtime exception handler (AddVectoredExceptionHandler)</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/JIT/jit64/mcc/interop/mcc_i37/*">
+ <Issue>https://github.com/dotnet/runtime/issues/65702</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/JIT/jit64/mcc/interop/mcc_i57/*">
+ <Issue>https://github.com/dotnet/runtime/issues/65702</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/JIT/jit64/mcc/interop/mcc_i67/*">
+ <Issue>https://github.com/dotnet/runtime/issues/65702</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/JIT/jit64/mcc/interop/mcc_i77/*">
+ <Issue>https://github.com/dotnet/runtime/issues/65702</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/JIT/jit64/mcc/interop/mcc_i87/*">
+ <Issue>https://github.com/dotnet/runtime/issues/65702</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/JIT/Methodical/eh/finallyexec/loopinfinally_do/*">
+ <Issue>https://github.com/dotnet/runtime/issues/65704</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/JIT/Methodical/eh/finallyexec/loopinfinally_ro/*">
+ <Issue>https://github.com/dotnet/runtime/issues/65704</Issue>
+ </ExcludeList>
+ <ExcludeList Include="$(XunitTestBinBase)/GC/Regressions/v2.0-beta1/149926/149926/*">
+ <Issue>Triggers OOM issue on CI, pass on local test run</Issue>
+ </ExcludeList>
+ <ExcludeList Include = "$(XunitTestBinBase)/baseservices/TieredCompilation/BasicTest_DefaultMode_R2r/*">
+ <Issue>missing assembly</Issue>
+ </ExcludeList>
+ <ExcludeList Include = "$(XunitTestBinBase)/baseservices/TieredCompilation/BasicTest_QuickJitForLoopsOff_R2r/*">
+ <Issue>missing assembly</Issue>
+ </ExcludeList>
+ <ExcludeList Include = "$(XunitTestBinBase)/baseservices/TieredCompilation/BasicTest_QuickJitForLoopsOn_R2r/*">
+ <Issue>missing assembly</Issue>
+ </ExcludeList>
+ <ExcludeList Include = "$(XunitTestBinBase)/baseservices/TieredCompilation/BasicTest_QuickJitOff_R2r/*">
+ <Issue>missing assembly</Issue>
+ </ExcludeList>
+ <ExcludeList Include = "$(XunitTestBinBase)/baseservices/TieredCompilation/BasicTest_QuickJitOn_R2r/*">
+ <Issue>missing assembly</Issue>
+ </ExcludeList>
+ <ExcludeList Include = "$(XunitTestBinBase)Interop/MonoAPI/MonoMono/PInvokeDetach/*">
+ <Issue>https://github.com/dotnet/runtime/issues/67047</Issue>
+ </ExcludeList>
+ <ExcludeList Include = "$(XunitTestBinBase)Interop/MonoAPI/MonoMono/Thunks/*">
+ <Issue>https://github.com/dotnet/runtime/issues/67047</Issue>
+ </ExcludeList>
+ <ExcludeList Include = "$(XunitTestBinBase)Interop/MonoAPI/MonoMono/InstallEHCallback/*">
+ <Issue>https://github.com/dotnet/runtime/issues/67047</Issue>
+ </ExcludeList>
</ItemGroup>
<!-- Known failures for mono runtime on *all* architectures/operating systems in interpreter runtime mode -->
@@ -3780,9 +3949,6 @@
<Issue>needs triage</Issue>
</ExcludeList>
<ExcludeList Include = "$(XunitTestBinBase)/baseservices/TieredCompilation/BasicTest_DefaultMode_R2r/*">
- <Issue>needs triage</Issue>
- </ExcludeList>
- <ExcludeList Include = "$(XunitTestBinBase)/baseservices/TieredCompilation/BasicTest_DefaultMode_R2r/*">
<Issue>missing assembly</Issue>
</ExcludeList>
<ExcludeList Include = "$(XunitTestBinBase)/baseservices/TieredCompilation/BasicTest_QuickJitForLoopsOff_R2r/*">