From def6a45e537b59481a096f9c8595c3dac4b73cc7 Mon Sep 17 00:00:00 2001 From: pavelsavara Date: Fri, 27 Oct 2023 10:52:20 +0200 Subject: [PATCH 01/47] wip --- .../runtime-extra-platforms-wasm.yml | 8 ++++---- eng/pipelines/runtime.yml | 4 ++-- .../System.Net.Http.Functional.Tests.csproj | 1 - .../System.Net.WebSockets.Client.Tests.csproj | 1 - .../tests/debugger-test/debugger-test.csproj | 1 - src/mono/wasm/runtime/loader/config.ts | 7 +++++++ .../wasm/runtime/pthreads/browser/index.ts | 18 +++--------------- src/mono/wasm/runtime/startup.ts | 6 ++---- 8 files changed, 18 insertions(+), 28 deletions(-) diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml index c641821da3855a..0efe765230720f 100644 --- a/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml +++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-wasm.yml @@ -112,14 +112,14 @@ jobs: - browser_wasm #- browser_wasm_win nameSuffix: _Threading - extraBuildArgs: /p:MonoWasmBuildVariant=multithread /p:WasmEnableThreads=true /p:_WasmPThreadPoolSize=8 /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) + extraBuildArgs: /p:MonoWasmBuildVariant=multithread /p:WasmEnableThreads=true /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) isExtraPlatformsBuild: ${{ parameters.isExtraPlatformsBuild }} isWasmOnlyBuild: ${{ parameters.isWasmOnlyBuild }} # Always run for runtime-wasm because tests are not run in runtime alwaysRun: ${{ parameters.isWasmOnlyBuild }} - # NOTE - Since threading is experimental, we don't want to block mainline work - shouldContinueOnError: true + # NOTE - Since threading is experimental, we don't want to block mainline work + # TODO put back shouldContinueOnError: true scenarios: - WasmTestOnBrowser #- WasmTestOnNodeJS - this is not supported yet, https://github.com/dotnet/runtime/issues/85592 @@ -198,7 +198,7 @@ jobs: - browser_wasm - browser_wasm_win nameSuffix: MultiThreaded - extraBuildArgs: /p:MonoWasmBuildVariant=multithread /p:WasmEnableThreads=true /p:_WasmPThreadPoolSize=8 /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) + extraBuildArgs: /p:MonoWasmBuildVariant=multithread /p:WasmEnableThreads=true /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) condition: ne(variables['wasmMultiThreadedBuildOnlyNeededOnDefaultPipeline'], true) publishArtifactsForWorkload: true publishWBT: false diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml index fc8b0ad617ebc1..d06566403f3ed1 100644 --- a/eng/pipelines/runtime.yml +++ b/eng/pipelines/runtime.yml @@ -566,7 +566,7 @@ extends: - browser_wasm_win condition: or(eq(variables.isRollingBuild, true), eq(variables.wasmSingleThreadedBuildOnlyNeededOnDefaultPipeline, true)) nameSuffix: MultiThreaded - extraBuildArgs: /p:MonoWasmBuildVariant=multithread /p:WasmEnableThreads=true /p:_WasmPThreadPoolSize=8 /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) + extraBuildArgs: /p:MonoWasmBuildVariant=multithread /p:WasmEnableThreads=true /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) publishArtifactsForWorkload: true publishWBT: false @@ -602,7 +602,7 @@ extends: platforms: - browser_wasm nameSuffix: _Threading_Smoke - extraBuildArgs: /p:MonoWasmBuildVariant=multithread /p:_WasmPThreadPoolSize=8 /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) + extraBuildArgs: /p:MonoWasmBuildVariant=multithread /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) shouldRunSmokeOnly: true alwaysRun: ${{ variables.isRollingBuild }} scenarios: diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj b/src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj index fdb94e9caff24d..d0283202019b22 100644 --- a/src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj +++ b/src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj @@ -25,7 +25,6 @@ $(TestArchiveTestsRoot)$(OSPlatformConfig)/ $(DefineConstants);TARGET_BROWSER --setenv=XHARNESS_LOG_TEST_START=true --no-memory-snapshot - <_WasmPThreadPoolSize Condition="'$(MonoWasmBuildVariant)' == 'multithread'">10 01:15:00 diff --git a/src/libraries/System.Net.WebSockets.Client/tests/System.Net.WebSockets.Client.Tests.csproj b/src/libraries/System.Net.WebSockets.Client/tests/System.Net.WebSockets.Client.Tests.csproj index f683a4bcf3d949..fe0d13c9526231 100644 --- a/src/libraries/System.Net.WebSockets.Client/tests/System.Net.WebSockets.Client.Tests.csproj +++ b/src/libraries/System.Net.WebSockets.Client/tests/System.Net.WebSockets.Client.Tests.csproj @@ -14,7 +14,6 @@ $(TestArchiveTestsRoot)$(OSPlatformConfig)/ $(DefineConstants);TARGET_BROWSER --setenv=XHARNESS_LOG_TEST_START=true --no-memory-snapshot - <_WasmPThreadPoolSize Condition="'$(MonoWasmBuildVariant)' == 'multithread'">10 01:15:00 diff --git a/src/mono/wasm/debugger/tests/debugger-test/debugger-test.csproj b/src/mono/wasm/debugger/tests/debugger-test/debugger-test.csproj index 4bd104e189426f..6a39c840002c84 100644 --- a/src/mono/wasm/debugger/tests/debugger-test/debugger-test.csproj +++ b/src/mono/wasm/debugger/tests/debugger-test/debugger-test.csproj @@ -8,7 +8,6 @@ true library true - <_WasmPThreadPoolSize Condition="'$(MonoWasmBuildVariant)' == 'multithread'">10 true diff --git a/src/mono/wasm/runtime/loader/config.ts b/src/mono/wasm/runtime/loader/config.ts index 097f6d1ca2cb15..14122cb581e855 100644 --- a/src/mono/wasm/runtime/loader/config.ts +++ b/src/mono/wasm/runtime/loader/config.ts @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. import BuildConfiguration from "consts:configuration"; +import MonoWasmThreads from "consts:monoWasmThreads"; + import type { DotnetModuleInternal, MonoConfigInternal } from "../types/internal"; import type { DotnetModuleConfig, MonoConfig, ResourceGroups, ResourceList } from "../types"; import { ENVIRONMENT_IS_WEB, exportedRuntimeAPI, loaderHelpers, runtimeHelpers } from "./globals"; @@ -186,6 +188,11 @@ export function normalizeConfig() { config.cachedResourcesPurgeDelay = 10000; } + if (MonoWasmThreads && !Number.isInteger(config.pthreadPoolSize)) { + // ActiveIssue https://github.com/dotnet/runtime/issues/91538 + config.pthreadPoolSize = 32; + } + // Default values (when WasmDebugLevel is not set) // - Build (debug) => debugBuild=true & debugLevel=-1 => -1 // - Build (release) => debugBuild=true & debugLevel=0 => 0 diff --git a/src/mono/wasm/runtime/pthreads/browser/index.ts b/src/mono/wasm/runtime/pthreads/browser/index.ts index a4e0428812d9f9..89c84baf78836e 100644 --- a/src/mono/wasm/runtime/pthreads/browser/index.ts +++ b/src/mono/wasm/runtime/pthreads/browser/index.ts @@ -5,9 +5,8 @@ import { isMonoWorkerMessageChannelCreated, monoSymbol, makeMonoThreadMessageApp import { pthreadPtr } from "../shared/types"; import { MonoThreadMessage } from "../shared"; import Internals from "../shared/emscripten-internals"; -import { createPromiseController, mono_assert, runtimeHelpers } from "../../globals"; +import { createPromiseController, runtimeHelpers } from "../../globals"; import { PromiseController } from "../../types/internal"; -import { MonoConfig } from "../../types"; import { mono_log_debug } from "../../logging"; const threads: Map = new Map(); @@ -114,19 +113,8 @@ export function afterLoadWasmModuleToWorker(worker: Worker): void { /// We call on the main thread this during startup to pre-allocate a pool of pthread workers. /// At this point asset resolution needs to be working (ie we loaded MonoConfig). /// This is used instead of the Emscripten PThread.initMainThread because we call it later. -export function preAllocatePThreadWorkerPool(defaultPthreadPoolSize: number, config: MonoConfig): void { - const poolSizeSpec = config?.pthreadPoolSize; - let n: number; - if (poolSizeSpec === undefined || poolSizeSpec === null) { - n = defaultPthreadPoolSize; - } else { - mono_assert(typeof poolSizeSpec === "number", "pthreadPoolSize must be a number"); - if (poolSizeSpec < 0) - n = defaultPthreadPoolSize; - else - n = poolSizeSpec; - } - for (let i = 0; i < n; i++) { +export function preAllocatePThreadWorkerPool(pthreadPoolSize: number): void { + for (let i = 0; i < pthreadPoolSize; i++) { Internals.allocateUnusedWorker(); } } diff --git a/src/mono/wasm/runtime/startup.ts b/src/mono/wasm/runtime/startup.ts index 4b209c8f1fa3a1..237ffb323f5e48 100644 --- a/src/mono/wasm/runtime/startup.ts +++ b/src/mono/wasm/runtime/startup.ts @@ -37,9 +37,6 @@ import { BINDING, MONO } from "./net6-legacy/globals"; import { localHeapViewU8 } from "./memory"; import { assertNoProxies } from "./gc-handles"; -// default size if MonoConfig.pthreadPoolSize is undefined -const MONO_PTHREAD_POOL_SIZE = 4; - export async function configureRuntimeStartup(): Promise { await init_polyfills_async(); await checkMemorySnapshotSize(); @@ -191,6 +188,7 @@ async function preInitWorkerAsync() { mono_log_debug("preInitWorker"); runtimeHelpers.beforePreInit.promise_control.resolve(); mono_wasm_pre_init_essential(true); + await ensureUsedWasmFeatures(); await init_polyfills_async(); runtimeHelpers.afterPreInit.promise_control.resolve(); endMeasure(mark, MeasuredBlock.preInitWorker); @@ -387,7 +385,7 @@ async function mono_wasm_pre_init_essential_async(): Promise { Module.addRunDependency("mono_wasm_pre_init_essential_async"); if (MonoWasmThreads) { - preAllocatePThreadWorkerPool(MONO_PTHREAD_POOL_SIZE, runtimeHelpers.config); + preAllocatePThreadWorkerPool(runtimeHelpers.config.pthreadPoolSize!); } Module.removeRunDependency("mono_wasm_pre_init_essential_async"); From 568ed4125d0ae62c0d82d8f3703854fcc04bf32d Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 27 Oct 2023 13:22:10 +0200 Subject: [PATCH 02/47] [main] Update dependencies from dotnet/arcade dotnet/xharness dotnet/sdk (#93929) * Update dependencies from https://github.com/dotnet/arcade build 20231023.2 Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitAssert , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions From Version 9.0.0-beta.23518.2 -> To Version 9.0.0-beta.23523.2 * Update dependencies from https://github.com/dotnet/arcade build 20231024.1 Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitAssert , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions From Version 9.0.0-beta.23518.2 -> To Version 9.0.0-beta.23524.1 Dependency coherency updates Microsoft.DotNet.XliffTasks From Version 1.0.0-beta.23516.1 -> To Version 1.0.0-beta.23523.1 (parent: Microsoft.DotNet.Helix.Sdk * Update dependencies from https://github.com/dotnet/arcade build 20231024.1 Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitAssert , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions From Version 9.0.0-beta.23518.2 -> To Version 9.0.0-beta.23524.1 Dependency coherency updates Microsoft.DotNet.XliffTasks From Version 1.0.0-beta.23516.1 -> To Version 1.0.0-beta.23523.1 (parent: Microsoft.DotNet.Helix.Sdk * Update dependencies from https://github.com/dotnet/xharness build 20231025.2 Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit From Version 8.0.0-prerelease.23523.1 -> To Version 8.0.0-prerelease.23525.2 * Update dependencies from https://github.com/dotnet/sdk build 20231025.7 Microsoft.DotNet.ApiCompat.Task From Version 9.0.100-alpha.1.23524.12 -> To Version 9.0.100-alpha.1.23525.7 * Update dependencies from https://github.com/dotnet/arcade build 20231025.2 Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitAssert , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions From Version 9.0.0-beta.23518.2 -> To Version 9.0.0-beta.23525.2 Dependency coherency updates Microsoft.DotNet.XliffTasks From Version 1.0.0-beta.23516.1 -> To Version 1.0.0-beta.23523.1 (parent: Microsoft.DotNet.Helix.Sdk * Update dependencies from https://github.com/dotnet/xharness build 20231026.1 Microsoft.DotNet.XHarness.CLI , Microsoft.DotNet.XHarness.TestRunners.Common , Microsoft.DotNet.XHarness.TestRunners.Xunit From Version 8.0.0-prerelease.23523.1 -> To Version 9.0.0-prerelease.23526.1 * Update dependencies from https://github.com/dotnet/sdk build 20231025.29 Microsoft.DotNet.ApiCompat.Task From Version 9.0.100-alpha.1.23524.12 -> To Version 9.0.100-alpha.1.23525.29 * Try inheriting from LongLivedMarshalByRefObject * Resolve XUnit ambiguity * Just disable the warning --------- Co-authored-by: dotnet-maestro[bot] Co-authored-by: Andy Gocke --- .config/dotnet-tools.json | 2 +- eng/Version.Details.xml | 96 +++++++++---------- eng/Versions.props | 40 ++++---- eng/common/cross/toolchain.cmake | 8 +- eng/common/tools.ps1 | 4 +- eng/common/tools.sh | 4 +- global.json | 6 +- .../SingleFileTestRunner.cs | 9 +- 8 files changed, 86 insertions(+), 83 deletions(-) diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 5dbf8980ea1637..968403269807c5 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -15,7 +15,7 @@ ] }, "microsoft.dotnet.xharness.cli": { - "version": "8.0.0-prerelease.23523.1", + "version": "9.0.0-prerelease.23526.1", "commands": [ "xharness" ] diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index dc9cae22c8913a..66b1f409480b1c 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -107,83 +107,83 @@ - + https://github.com/dotnet/arcade - 6a5ca678aef84f34a1fccc46f76623f41da56553 + 36d11a863c7ffc41e3730c806b0e98d32d1795ae - + https://github.com/dotnet/xliff-tasks - d66a09c8b11e1235273c8e6cd946e5c8e247f189 + 83531fff1a39abe38de53e2e6b702bc1bb9c3bb4 - + https://github.com/dotnet/arcade - 6a5ca678aef84f34a1fccc46f76623f41da56553 + 36d11a863c7ffc41e3730c806b0e98d32d1795ae - + https://github.com/dotnet/arcade - 6a5ca678aef84f34a1fccc46f76623f41da56553 + 36d11a863c7ffc41e3730c806b0e98d32d1795ae - + https://github.com/dotnet/arcade - 6a5ca678aef84f34a1fccc46f76623f41da56553 + 36d11a863c7ffc41e3730c806b0e98d32d1795ae - + https://github.com/dotnet/arcade - 6a5ca678aef84f34a1fccc46f76623f41da56553 + 36d11a863c7ffc41e3730c806b0e98d32d1795ae - + https://github.com/dotnet/arcade - 6a5ca678aef84f34a1fccc46f76623f41da56553 + 36d11a863c7ffc41e3730c806b0e98d32d1795ae - + https://github.com/dotnet/arcade - 6a5ca678aef84f34a1fccc46f76623f41da56553 + 36d11a863c7ffc41e3730c806b0e98d32d1795ae - + https://github.com/dotnet/arcade - 6a5ca678aef84f34a1fccc46f76623f41da56553 + 36d11a863c7ffc41e3730c806b0e98d32d1795ae - + https://github.com/dotnet/arcade - 6a5ca678aef84f34a1fccc46f76623f41da56553 + 36d11a863c7ffc41e3730c806b0e98d32d1795ae - + https://github.com/dotnet/arcade - 6a5ca678aef84f34a1fccc46f76623f41da56553 + 36d11a863c7ffc41e3730c806b0e98d32d1795ae - + https://github.com/dotnet/arcade - 6a5ca678aef84f34a1fccc46f76623f41da56553 + 36d11a863c7ffc41e3730c806b0e98d32d1795ae - + https://github.com/dotnet/arcade - 6a5ca678aef84f34a1fccc46f76623f41da56553 + 36d11a863c7ffc41e3730c806b0e98d32d1795ae - + https://github.com/dotnet/arcade - 6a5ca678aef84f34a1fccc46f76623f41da56553 + 36d11a863c7ffc41e3730c806b0e98d32d1795ae - + https://github.com/dotnet/arcade - 6a5ca678aef84f34a1fccc46f76623f41da56553 + 36d11a863c7ffc41e3730c806b0e98d32d1795ae - + https://github.com/dotnet/arcade - 6a5ca678aef84f34a1fccc46f76623f41da56553 + 36d11a863c7ffc41e3730c806b0e98d32d1795ae - + https://github.com/dotnet/arcade - 6a5ca678aef84f34a1fccc46f76623f41da56553 + 36d11a863c7ffc41e3730c806b0e98d32d1795ae - + https://github.com/dotnet/arcade - 6a5ca678aef84f34a1fccc46f76623f41da56553 + 36d11a863c7ffc41e3730c806b0e98d32d1795ae - + https://github.com/dotnet/arcade - 6a5ca678aef84f34a1fccc46f76623f41da56553 + 36d11a863c7ffc41e3730c806b0e98d32d1795ae https://github.com/dotnet/runtime-assets @@ -318,21 +318,21 @@ https://github.com/dotnet/runtime 2959e1acd09aec0f1e59db9cbe41f3701b0bd4dd - + https://github.com/dotnet/xharness - 3fc757d9b48e116713d1e0e3a3bd111a588905cb + ab9528860ac51bb0aa6112fa2605b18c926594ef - + https://github.com/dotnet/xharness - 3fc757d9b48e116713d1e0e3a3bd111a588905cb + ab9528860ac51bb0aa6112fa2605b18c926594ef - + https://github.com/dotnet/xharness - 3fc757d9b48e116713d1e0e3a3bd111a588905cb + ab9528860ac51bb0aa6112fa2605b18c926594ef - + https://github.com/dotnet/arcade - 6a5ca678aef84f34a1fccc46f76623f41da56553 + 36d11a863c7ffc41e3730c806b0e98d32d1795ae https://dev.azure.com/dnceng/internal/_git/dotnet-optimization @@ -379,9 +379,9 @@ https://github.com/dotnet/roslyn-analyzers b4ed6a3093cfd3c8d353214ce97aaa7d24cf2df1 - + https://github.com/dotnet/sdk - 520797bdd9cf4ea016f28b14fa810aa295c931d6 + 92a2dbef8611cf00d92317e66611848143cdbfed diff --git a/eng/Versions.props b/eng/Versions.props index 0e554925a88b10..551732ef8036fb 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -80,24 +80,24 @@ 0.2.0 - 9.0.100-alpha.1.23524.12 + 9.0.100-alpha.1.23525.29 - 9.0.0-beta.23518.2 - 9.0.0-beta.23518.2 - 9.0.0-beta.23518.2 - 9.0.0-beta.23518.2 - 9.0.0-beta.23518.2 - 9.0.0-beta.23518.2 - 2.5.1-beta.23518.2 - 9.0.0-beta.23518.2 - 9.0.0-beta.23518.2 - 9.0.0-beta.23518.2 - 9.0.0-beta.23518.2 - 9.0.0-beta.23518.2 - 9.0.0-beta.23518.2 - 9.0.0-beta.23518.2 - 9.0.0-beta.23518.2 - 9.0.0-beta.23518.2 + 9.0.0-beta.23525.2 + 9.0.0-beta.23525.2 + 9.0.0-beta.23525.2 + 9.0.0-beta.23525.2 + 9.0.0-beta.23525.2 + 9.0.0-beta.23525.2 + 2.5.3-beta.23525.2 + 9.0.0-beta.23525.2 + 9.0.0-beta.23525.2 + 9.0.0-beta.23525.2 + 9.0.0-beta.23525.2 + 9.0.0-beta.23525.2 + 9.0.0-beta.23525.2 + 9.0.0-beta.23525.2 + 9.0.0-beta.23525.2 + 9.0.0-beta.23525.2 6.0.0-preview.1.102 @@ -178,9 +178,9 @@ 1.1.0 17.4.0-preview-20220707-01 - 8.0.0-prerelease.23523.1 - 8.0.0-prerelease.23523.1 - 8.0.0-prerelease.23523.1 + 9.0.0-prerelease.23526.1 + 9.0.0-prerelease.23526.1 + 9.0.0-prerelease.23526.1 9.0.0-alpha.0.23523.3 3.12.0 4.1.0 diff --git a/eng/common/cross/toolchain.cmake b/eng/common/cross/toolchain.cmake index cb0aaa76063453..00288a300653a0 100644 --- a/eng/common/cross/toolchain.cmake +++ b/eng/common/cross/toolchain.cmake @@ -40,7 +40,7 @@ if(TARGET_ARCH_NAME STREQUAL "arm") set(TOOLCHAIN "arm-linux-gnueabihf") endif() if(TIZEN) - set(TIZEN_TOOLCHAIN "armv7hl-tizen-linux-gnueabihf/13.1.0") + set(TIZEN_TOOLCHAIN "armv7hl-tizen-linux-gnueabihf/9.2.0") endif() elseif(TARGET_ARCH_NAME STREQUAL "arm64") set(CMAKE_SYSTEM_PROCESSOR aarch64) @@ -49,7 +49,7 @@ elseif(TARGET_ARCH_NAME STREQUAL "arm64") elseif(LINUX) set(TOOLCHAIN "aarch64-linux-gnu") if(TIZEN) - set(TIZEN_TOOLCHAIN "aarch64-tizen-linux-gnu/13.1.0") + set(TIZEN_TOOLCHAIN "aarch64-tizen-linux-gnu/9.2.0") endif() elseif(FREEBSD) set(triple "aarch64-unknown-freebsd12") @@ -98,7 +98,7 @@ elseif(TARGET_ARCH_NAME STREQUAL "x64") elseif(LINUX) set(TOOLCHAIN "x86_64-linux-gnu") if(TIZEN) - set(TIZEN_TOOLCHAIN "x86_64-tizen-linux-gnu/13.1.0") + set(TIZEN_TOOLCHAIN "x86_64-tizen-linux-gnu/9.2.0") endif() elseif(FREEBSD) set(triple "x86_64-unknown-freebsd12") @@ -115,7 +115,7 @@ elseif(TARGET_ARCH_NAME STREQUAL "x86") set(TOOLCHAIN "i686-linux-gnu") endif() if(TIZEN) - set(TIZEN_TOOLCHAIN "i586-tizen-linux-gnu/13.1.0") + set(TIZEN_TOOLCHAIN "i586-tizen-linux-gnu/9.2.0") endif() else() message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only arm, arm64, armel, armv6, ppc64le, riscv64, s390x, x64 and x86 are supported!") diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1 index fdd0cbb91f8596..e8def7e6a85f21 100644 --- a/eng/common/tools.ps1 +++ b/eng/common/tools.ps1 @@ -158,7 +158,7 @@ function InitializeDotNetCli([bool]$install, [bool]$createSdkLocationFile) { $env:DOTNET_MULTILEVEL_LOOKUP=0 # Disable first run since we do not need all ASP.NET packages restored. - $env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 + $env:DOTNET_NOLOGO=1 # Disable telemetry on CI. if ($ci) { @@ -228,7 +228,7 @@ function InitializeDotNetCli([bool]$install, [bool]$createSdkLocationFile) { Write-PipelinePrependPath -Path $dotnetRoot Write-PipelineSetVariable -Name 'DOTNET_MULTILEVEL_LOOKUP' -Value '0' - Write-PipelineSetVariable -Name 'DOTNET_SKIP_FIRST_TIME_EXPERIENCE' -Value '1' + Write-PipelineSetVariable -Name 'DOTNET_NOLOGO' -Value '1' return $global:_DotNetInstallDir = $dotnetRoot } diff --git a/eng/common/tools.sh b/eng/common/tools.sh index e8d478943341df..710e64df967fd7 100755 --- a/eng/common/tools.sh +++ b/eng/common/tools.sh @@ -112,7 +112,7 @@ function InitializeDotNetCli { export DOTNET_MULTILEVEL_LOOKUP=0 # Disable first run since we want to control all package sources - export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 + export DOTNET_NOLOGO=1 # Disable telemetry on CI if [[ $ci == true ]]; then @@ -165,7 +165,7 @@ function InitializeDotNetCli { Write-PipelinePrependPath -path "$dotnet_root" Write-PipelineSetVariable -name "DOTNET_MULTILEVEL_LOOKUP" -value "0" - Write-PipelineSetVariable -name "DOTNET_SKIP_FIRST_TIME_EXPERIENCE" -value "1" + Write-PipelineSetVariable -name "DOTNET_NOLOGO" -value "1" # return value _InitializeDotNetCli="$dotnet_root" diff --git a/global.json b/global.json index a473434ed1a1db..b9ab9626f23618 100644 --- a/global.json +++ b/global.json @@ -8,9 +8,9 @@ "dotnet": "8.0.100-rtm.23506.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.23518.2", - "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.23518.2", - "Microsoft.DotNet.SharedFramework.Sdk": "9.0.0-beta.23518.2", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.23525.2", + "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.23525.2", + "Microsoft.DotNet.SharedFramework.Sdk": "9.0.0-beta.23525.2", "Microsoft.Build.NoTargets": "3.7.0", "Microsoft.Build.Traversal": "3.4.0", "Microsoft.NET.Sdk.IL": "9.0.0-alpha.1.23523.1" diff --git a/src/libraries/Common/tests/SingleFileTestRunner/SingleFileTestRunner.cs b/src/libraries/Common/tests/SingleFileTestRunner/SingleFileTestRunner.cs index 4f99005491b79c..8afbf22547dddd 100644 --- a/src/libraries/Common/tests/SingleFileTestRunner/SingleFileTestRunner.cs +++ b/src/libraries/Common/tests/SingleFileTestRunner/SingleFileTestRunner.cs @@ -72,16 +72,16 @@ public static int Main(string[] args) if (args[i].Equals("-notrait", StringComparison.OrdinalIgnoreCase)) { var traitKeyValue = args[i + 1].Split("=", StringSplitOptions.TrimEntries); - + if (!noTraits.TryGetValue(traitKeyValue[0], out List values)) { noTraits.Add(traitKeyValue[0], values = new List()); } - + values.Add(traitKeyValue[1]); i++; } - + if (args[i].Equals("-xml", StringComparison.OrdinalIgnoreCase)) { xmlResultFileName = args[i + 1].Trim(); @@ -167,6 +167,8 @@ public static int Main(string[] args) } } +// This is about running on desktop FX, which we don't do +#pragma warning disable xUnit3000 internal class ConsoleDiagnosticMessageSink : IMessageSink { public bool OnMessage(IMessageSinkMessage message) @@ -178,3 +180,4 @@ public bool OnMessage(IMessageSinkMessage message) return false; } } +#pragma warning restore xUnit3000 From 2dc7c31b6b1ef1ebe5c3914aa4a03b8348a12873 Mon Sep 17 00:00:00 2001 From: Kunal Pathak Date: Fri, 27 Oct 2023 06:29:13 -0700 Subject: [PATCH 03/47] Revert "[arm64] Addressing modes for SIMD (#67490)" (#93981) This reverts commit fa294c0494adbcb55f22411c9e8b0ba11a88af4b. --- src/coreclr/jit/hwintrinsiccodegenarm64.cpp | 16 +--------------- src/coreclr/jit/lower.cpp | 6 ------ 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp index bcdf6ba8bb1b96..57df941c5fe685 100644 --- a/src/coreclr/jit/hwintrinsiccodegenarm64.cpp +++ b/src/coreclr/jit/hwintrinsiccodegenarm64.cpp @@ -379,21 +379,7 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node) switch (intrin.numOperands) { case 1: - if (intrin.op1->isContained()) - { - assert(ins == INS_ld1); - - // Emit 'ldr target, [base, index]' - GenTreeAddrMode* lea = intrin.op1->AsAddrMode(); - assert(lea->GetScale() == 1); - assert(lea->Offset() == 0); - GetEmitter()->emitIns_R_R_R(INS_ldr, emitSize, targetReg, lea->Base()->GetRegNum(), - lea->Index()->GetRegNum()); - } - else - { - GetEmitter()->emitIns_R_R(ins, emitSize, targetReg, op1Reg, opt); - } + GetEmitter()->emitIns_R_R(ins, emitSize, targetReg, op1Reg, opt); break; case 2: diff --git a/src/coreclr/jit/lower.cpp b/src/coreclr/jit/lower.cpp index 75d999271d758e..8a810c65d5cdcf 100644 --- a/src/coreclr/jit/lower.cpp +++ b/src/coreclr/jit/lower.cpp @@ -6175,12 +6175,6 @@ bool Lowering::TryCreateAddrMode(GenTree* addr, bool isContainable, GenTree* par { return false; } - - if (((scale | offset) != 0) && parent->OperIsHWIntrinsic()) - { - // For now we only support unscaled indices for SIMD loads - return false; - } #endif if (scale == 0) From f13473456ae93037c67f4e70ce5f20757464b78a Mon Sep 17 00:00:00 2001 From: pavelsavara Date: Fri, 27 Oct 2023 15:49:14 +0200 Subject: [PATCH 04/47] managed pool max threads --- .../src/System/Threading/PortableThreadPool.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.cs index db49ea2c5a5a92..876f7283034ef1 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/PortableThreadPool.cs @@ -17,7 +17,9 @@ internal sealed partial class PortableThreadPool private const short MaxPossibleThreadCount = short.MaxValue; -#if TARGET_64BIT +#if TARGET_BROWSER + private const short DefaultMaxWorkerThreadCount = 16; +#elif TARGET_64BIT private const short DefaultMaxWorkerThreadCount = MaxPossibleThreadCount; #elif TARGET_32BIT private const short DefaultMaxWorkerThreadCount = 1023; From 6f9b06a1ddbeef02be1fb70d5c127e2b58f37c9b Mon Sep 17 00:00:00 2001 From: pavelsavara Date: Fri, 27 Oct 2023 17:37:14 +0200 Subject: [PATCH 05/47] Revert "[browser][MT] enable all MT library tests on the runtime CI pipeline (#91536)" --- .../Common/tests/System/TimeProviderTests.cs | 2 - .../tests/EnvironmentVariablesTest.cs | 1 - .../FunctionalTests/ConfigurationTests.cs | 2 - .../tests/HostFactoryResolverTests.cs | 7 ++- ...tFactoryServiceCollectionExtensionsTest.cs | 2 - .../ConsoleFormatterTests.cs | 4 -- .../ConsoleLoggerExtensionsTests.cs | 13 ------ .../ConsoleLoggerProcessorTests.cs | 2 - .../ConsoleLoggerTest.cs | 41 ----------------- .../JsonConsoleFormatterTests.cs | 9 ---- .../SimpleConsoleFormatterTests.cs | 3 -- .../tests/QueueTests.cs | 1 - .../tests/TimerTests.cs | 1 - .../tests/ConcurrencyTests.cs | 1 - .../tests/CultureInfo/CultureInfoAsync.cs | 1 - .../tests/PipeWriterTests.cs | 1 - .../tests/SchedulerFacts.cs | 5 --- .../tests/ExchangeTests.cs | 3 -- .../tests/PlinqModesTests.cs | 1 - .../QueryOperators/GetEnumeratorTests.cs | 1 - .../QueryOperators/OrderByThenByTests.cs | 1 - .../Tests/AsyncReaderLateInitTests.cs | 3 -- .../XslTransformMultith.cs | 24 ---------- .../XsltArgumentListMultith.cs | 5 --- .../XslTransformApi/CXslTransformMultith.cs | 1 - .../CXsltArgumentListMultith.cs | 5 --- .../tests/System/EnvironmentTests.cs | 1 - .../tests/System/Progress.cs | 1 - .../tests/System/Random.cs | 1 - .../tests/XmlDictionaryWriterTest.cs | 5 +-- .../System.Runtime/tests/System/Attributes.cs | 1 - .../tests/ParallelForEachAsyncTests.cs | 44 ------------------- .../tests/ParallelForTests.cs | 16 ------- .../tests/ParallelLoopResultTests.cs | 1 - .../tests/RangePartitioner1Chunk.cs | 2 - .../tests/RangePartitionerTests.cs | 1 - .../tests/TimerChangeTests.cs | 1 - .../tests/TimerDisposeTests.cs | 5 --- .../tests/TimerFiringTests.cs | 10 ----- .../tests/AutoResetEventTests.cs | 1 - .../System.Threading/tests/BarrierTests.cs | 1 - .../tests/ExecutionContextTests.cs | 4 -- .../tests/HostExecutionContextManagerTests.cs | 1 - .../tests/InterlockedTests.cs | 4 -- .../tests/ManualResetEventTests.cs | 1 - .../System.Threading/tests/MonitorTests.cs | 5 --- .../System.Threading/tests/MutexTests.cs | 5 --- .../tests/ReaderWriterLockSlimTests.cs | 4 -- .../tests/ReaderWriterLockTests.cs | 9 ---- .../tests/SemaphoreSlimTests.cs | 4 -- .../System.Threading/tests/SemaphoreTests.cs | 1 - .../System.Threading/tests/SpinLockTests.cs | 1 - .../tests/ThreadLocalTests.cs | 3 -- .../tests/AsyncTransactionScopeTests.cs | 3 -- 54 files changed, 7 insertions(+), 269 deletions(-) diff --git a/src/libraries/Common/tests/System/TimeProviderTests.cs b/src/libraries/Common/tests/System/TimeProviderTests.cs index 5b381d190946de..269ed251b3785d 100644 --- a/src/libraries/Common/tests/System/TimeProviderTests.cs +++ b/src/libraries/Common/tests/System/TimeProviderTests.cs @@ -109,7 +109,6 @@ public static IEnumerable TimersProvidersData() } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [MemberData(nameof(TimersProvidersData))] public void TestProviderTimer(TimeProvider provider, int MaxMilliseconds) { @@ -216,7 +215,6 @@ private static void CancelAfter(TimeProvider provider, CancellationTokenSource c #endif // NETFRAMEWORK [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [MemberData(nameof(TimersProvidersListData))] public static void CancellationTokenSourceWithTimer(TimeProvider provider) { diff --git a/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/tests/EnvironmentVariablesTest.cs b/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/tests/EnvironmentVariablesTest.cs index cd03e816fb6568..bf74d11775dcfe 100644 --- a/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/tests/EnvironmentVariablesTest.cs +++ b/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/tests/EnvironmentVariablesTest.cs @@ -284,7 +284,6 @@ public void AddEnvironmentVariablesUsingPrefixWithDoubleUnderscores_Bind_PrefixM } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void BindingDoesNotThrowIfReloadedDuringBinding() { var dic = new Dictionary diff --git a/src/libraries/Microsoft.Extensions.Configuration/tests/FunctionalTests/ConfigurationTests.cs b/src/libraries/Microsoft.Extensions.Configuration/tests/FunctionalTests/ConfigurationTests.cs index cc5a7df5421417..ced9dd64c3007a 100644 --- a/src/libraries/Microsoft.Extensions.Configuration/tests/FunctionalTests/ConfigurationTests.cs +++ b/src/libraries/Microsoft.Extensions.Configuration/tests/FunctionalTests/ConfigurationTests.cs @@ -286,7 +286,6 @@ public void LoadAndCombineKeyValuePairsFromDifferentConfigurationProvidersWithAb } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void CanOverrideValuesWithNewConfigurationProvider() { WriteTestFiles(); @@ -941,7 +940,6 @@ await WaitForChange( } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void BindingDoesNotThrowIfReloadedDuringBinding() { WriteTestFiles(); diff --git a/src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/HostFactoryResolverTests.cs b/src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/HostFactoryResolverTests.cs index fee56f79fb003e..b35db51ec0da2d 100644 --- a/src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/HostFactoryResolverTests.cs +++ b/src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/HostFactoryResolverTests.cs @@ -108,6 +108,7 @@ public void CreateHostBuilderPattern_CanFindHostBuilder() [Fact] [DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(CreateHostBuilderPatternTestSite.Program))] [DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(Host))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/73420", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] public void CreateHostBuilderPattern_CanFindServiceProvider() { var factory = HostFactoryResolver.ResolveServiceProviderFactory(typeof(CreateHostBuilderPatternTestSite.Program).Assembly); @@ -137,6 +138,7 @@ public void CreateHostBuilderPattern__Invalid_CantFindServiceProvider() [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] [DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(NoSpecialEntryPointPattern.Program))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/73420", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] public void NoSpecialEntryPointPattern() { var factory = HostFactoryResolver.ResolveServiceProviderFactory(typeof(NoSpecialEntryPointPattern.Program).Assembly, s_WaitTimeout); @@ -235,6 +237,7 @@ public void NoSpecialEntryPointPatternHangs() [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] [DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(NoSpecialEntryPointPatternMainNoArgs.Program))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/73420", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] public void NoSpecialEntryPointPatternMainNoArgs() { var factory = HostFactoryResolver.ResolveServiceProviderFactory(typeof(NoSpecialEntryPointPatternMainNoArgs.Program).Assembly, s_WaitTimeout); @@ -245,6 +248,7 @@ public void NoSpecialEntryPointPatternMainNoArgs() [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] [DynamicDependency(DynamicallyAccessedMemberTypes.All, "Program", "TopLevelStatements")] + [ActiveIssue("https://github.com/dotnet/runtime/issues/73420", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] public void TopLevelStatements() { var assembly = Assembly.Load("TopLevelStatements"); @@ -266,6 +270,7 @@ public void TopLevelStatementsTestsTimeout() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/73420", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] [DynamicDependency(DynamicallyAccessedMemberTypes.All, "Program", "ApplicationNameSetFromArgument")] public void ApplicationNameSetFromArgument() { @@ -279,7 +284,7 @@ public void ApplicationNameSetFromArgument() [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] [DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(NoSpecialEntryPointPattern.Program))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/73420", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] public void NoSpecialEntryPointPatternCanRunInParallel() { var factory = HostFactoryResolver.ResolveServiceProviderFactory(typeof(NoSpecialEntryPointPattern.Program).Assembly, s_WaitTimeout); diff --git a/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DependencyInjection/HttpClientFactoryServiceCollectionExtensionsTest.cs b/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DependencyInjection/HttpClientFactoryServiceCollectionExtensionsTest.cs index fab5ad4fc1fdc9..f537d8ca617f6f 100644 --- a/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DependencyInjection/HttpClientFactoryServiceCollectionExtensionsTest.cs +++ b/src/libraries/Microsoft.Extensions.Http/tests/Microsoft.Extensions.Http.Tests/DependencyInjection/HttpClientFactoryServiceCollectionExtensionsTest.cs @@ -1204,7 +1204,6 @@ public async Task AddHttpClient_MessageHandler_Scope_TransientDependency() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported), nameof(PlatformDetection.IsReflectionEmitSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void AddHttpClient_GetAwaiterAndResult_InSingleThreadedSynchronizationContext_ShouldNotHangs() { // Arrange @@ -1368,7 +1367,6 @@ public void SuppressScope_True_InScope_DoesNotCreateScope() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91673", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void AddHttpClient_ConfigurePrimaryHttpMessageHandler_ApplyChangesPrimaryHandler() { // Arrange diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleFormatterTests.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleFormatterTests.cs index 573006673d8889..6da081c4e86ab0 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleFormatterTests.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleFormatterTests.cs @@ -74,7 +74,6 @@ internal static (ConsoleLogger Logger, ConsoleSink Sink, ConsoleSink ErrorSink, } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void ConsoleLoggerOptions_TimeStampFormat_IsReloaded() { // Arrange @@ -88,7 +87,6 @@ public void ConsoleLoggerOptions_TimeStampFormat_IsReloaded() } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [MemberData(nameof(FormatterNames))] public void InvalidLogLevel_Throws(string formatterName) { @@ -103,7 +101,6 @@ public void InvalidLogLevel_Throws(string formatterName) } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [MemberData(nameof(FormatterNamesAndLevels))] public void NoMessageOrException_Noop(string formatterName, LogLevel level) { @@ -123,7 +120,6 @@ public void NoMessageOrException_Noop(string formatterName, LogLevel level) } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [MemberData(nameof(FormatterNamesAndLevels))] public void Log_LogsCorrectTimestamp(string formatterName, LogLevel level) { diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleLoggerExtensionsTests.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleLoggerExtensionsTests.cs index 945f00905c8e36..99b49170ed8e1d 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleLoggerExtensionsTests.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleLoggerExtensionsTests.cs @@ -76,7 +76,6 @@ public void AddConsoleFormatter_NullConfigure_Throws() } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [MemberData(nameof(FormatterNames))] public void AddConsole_ConsoleLoggerOptionsFromConfigFile_IsReadFromLoggingConfiguration(string formatterName) { @@ -156,7 +155,6 @@ private class CustomOptions : ConsoleFormatterOptions } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void AddSimpleConsole_ChangeProperties_IsReadFromLoggingConfiguration() { var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { @@ -187,7 +185,6 @@ public void AddSimpleConsole_ChangeProperties_IsReadFromLoggingConfiguration() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void AddSimpleConsole_OutsideConfig_TakesProperty() { var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { @@ -218,7 +215,6 @@ public void AddSimpleConsole_OutsideConfig_TakesProperty() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void AddSystemdConsole_ChangeProperties_IsReadFromLoggingConfiguration() { var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { @@ -245,7 +241,6 @@ public void AddSystemdConsole_ChangeProperties_IsReadFromLoggingConfiguration() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void AddSystemdConsole_OutsideConfig_TakesProperty() { var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { @@ -276,7 +271,6 @@ public void AddSystemdConsole_OutsideConfig_TakesProperty() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void AddJsonConsole_ChangeProperties_IsReadFromLoggingConfiguration() { var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { @@ -305,7 +299,6 @@ public void AddJsonConsole_ChangeProperties_IsReadFromLoggingConfiguration() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void AddJsonConsole_OutsideConfig_TakesProperty() { var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { @@ -340,7 +333,6 @@ public void AddJsonConsole_OutsideConfig_TakesProperty() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void AddConsole_NullFormatterNameUsingSystemdFormat_AnyDeprecatedPropertiesOverwriteFormatterOptions() { var configs = new[] { @@ -386,7 +378,6 @@ public void AddConsole_MaxQueueLengthSetToNegativeOrZero_Throws(int invalidMaxQu } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void AddConsole_MaxQueueLengthLargerThanZero_ConfiguredProperly() { var configs = new[] { @@ -408,7 +399,6 @@ public void AddConsole_MaxQueueLengthLargerThanZero_ConfiguredProperly() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void AddConsole_NullFormatterName_UsingSystemdFormat_IgnoreFormatterOptionsAndUseDeprecatedInstead() { var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { @@ -441,7 +431,6 @@ public void AddConsole_NullFormatterName_UsingSystemdFormat_IgnoreFormatterOptio } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void AddConsole_NullFormatterName_UsingDefaultFormat_IgnoreFormatterOptionsAndUseDeprecatedInstead() { var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { @@ -481,7 +470,6 @@ public void AddConsole_NullFormatterName_UsingDefaultFormat_IgnoreFormatterOptio } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData("missingFormatter")] [InlineData("simple")] [InlineData("Simple")] @@ -525,7 +513,6 @@ public void AddConsole_FormatterNameIsSet_UsingDefaultFormat_IgnoreDeprecatedAnd } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData("missingFormatter")] [InlineData("systemd")] [InlineData("Systemd")] diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleLoggerProcessorTests.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleLoggerProcessorTests.cs index 618d4cc9fb84f7..dfc7eaae8fe24c 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleLoggerProcessorTests.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleLoggerProcessorTests.cs @@ -15,7 +15,6 @@ public class ConsoleLoggerProcessorTests private const string _loggerName = "test"; [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void LogAfterDisposeWritesLog() { // Arrange @@ -64,7 +63,6 @@ public void LogsFlushedAfterDispose() } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(-1)] [InlineData(0)] public static void MaxQueueLength_SetInvalid_Throws(int invalidMaxQueueLength) diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleLoggerTest.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleLoggerTest.cs index f0ef3d6cd7e1d1..0994980590122b 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleLoggerTest.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/ConsoleLoggerTest.cs @@ -174,7 +174,6 @@ internal static string GetJsonLogLevelString(LogLevel logLevel) } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void LogsWhenMessageIsNotProvided() { // Arrange @@ -207,7 +206,6 @@ public void LogsWhenMessageIsNotProvided() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void DoesNotLog_NewLine_WhenNoExceptionIsProvided() { // Arrange @@ -236,7 +234,6 @@ public void DoesNotLog_NewLine_WhenNoExceptionIsProvided() } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(null, 0)] [InlineData(null, 1)] [InlineData("missingFormatter", 0)] @@ -279,7 +276,6 @@ public void Options_FormatterNameNull_UsesDeprecatedProperties(string formatterN } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData("Route with name 'Simple' was not found.")] public void Writes_NewLine_WhenExceptionIsProvided(string message) { @@ -304,7 +300,6 @@ public void Writes_NewLine_WhenExceptionIsProvided(string message) } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void ThrowsException_WhenNoFormatterIsProvided() { // Arrange @@ -316,7 +311,6 @@ public void ThrowsException_WhenNoFormatterIsProvided() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void LogsWhenNullFilterGiven() { // Arrange @@ -338,7 +332,6 @@ public void LogsWhenNullFilterGiven() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void WriteCritical_LogsCorrectColors() { // Arrange @@ -360,7 +353,6 @@ public void WriteCritical_LogsCorrectColors() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void WriteError_LogsCorrectColors() { // Arrange @@ -382,7 +374,6 @@ public void WriteError_LogsCorrectColors() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void WriteWarning_LogsCorrectColors() { // Arrange @@ -404,7 +395,6 @@ public void WriteWarning_LogsCorrectColors() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void WriteInformation_LogsCorrectColors() { // Arrange @@ -456,7 +446,6 @@ public void AddConsole_IsOutputRedirected_ColorDisabled() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void WriteDebug_LogsCorrectColors() { // Arrange @@ -478,7 +467,6 @@ public void WriteDebug_LogsCorrectColors() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void WriteTrace_LogsCorrectColors() { // Arrange @@ -500,7 +488,6 @@ public void WriteTrace_LogsCorrectColors() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void WriteAllLevelsDisabledColors_LogsNoColors() { // Arrange @@ -525,7 +512,6 @@ public void WriteAllLevelsDisabledColors_LogsNoColors() } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [MemberData(nameof(FormatsAndLevels))] public void Log_LogsCorrectTimestamp(ConsoleLoggerFormat format, LogLevel level) { @@ -567,7 +553,6 @@ public void Log_LogsCorrectTimestamp(ConsoleLoggerFormat format, LogLevel level) } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [MemberData(nameof(FormatsAndLevels))] public void WriteCore_LogsCorrectTimestampInUtc(ConsoleLoggerFormat format, LogLevel level) { @@ -609,7 +594,6 @@ public void WriteCore_LogsCorrectTimestampInUtc(ConsoleLoggerFormat format, LogL } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [MemberData(nameof(FormatsAndLevels))] public void WriteCore_LogsCorrectMessages(ConsoleLoggerFormat format, LogLevel level) { @@ -654,7 +638,6 @@ public void WriteCore_LogsCorrectMessages(ConsoleLoggerFormat format, LogLevel l } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void NoLogScope_DoesNotWriteAnyScopeContentToOutput() { // Arrange @@ -676,7 +659,6 @@ public void NoLogScope_DoesNotWriteAnyScopeContentToOutput() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void WritingScopes_LogsWithCorrectColors() { // Arrange @@ -703,7 +685,6 @@ public void WritingScopes_LogsWithCorrectColors() } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [MemberData(nameof(Formats))] public void WritingScopes_LogsExpectedMessage(ConsoleLoggerFormat format) { @@ -755,7 +736,6 @@ public void WritingScopes_LogsExpectedMessage(ConsoleLoggerFormat format) } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [MemberData(nameof(Formats))] public void WritingNestedScope_LogsNullScopeName(ConsoleLoggerFormat format) { @@ -805,7 +785,6 @@ public void WritingNestedScope_LogsNullScopeName(ConsoleLoggerFormat format) } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [MemberData(nameof(Formats))] public void WritingNestedScopes_LogsExpectedMessage(ConsoleLoggerFormat format) { @@ -864,7 +843,6 @@ public void WritingNestedScopes_LogsExpectedMessage(ConsoleLoggerFormat format) } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [MemberData(nameof(Formats))] public void WritingMultipleScopes_LogsExpectedMessage(ConsoleLoggerFormat format) { @@ -934,7 +912,6 @@ public void WritingMultipleScopes_LogsExpectedMessage(ConsoleLoggerFormat format } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void CallingBeginScopeOnLogger_AlwaysReturnsNewDisposableInstance() { // Arrange @@ -953,7 +930,6 @@ public void CallingBeginScopeOnLogger_AlwaysReturnsNewDisposableInstance() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void CallingBeginScopeOnLogger_ReturnsNonNullableInstance() { // Arrange @@ -969,7 +945,6 @@ public void CallingBeginScopeOnLogger_ReturnsNonNullableInstance() } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [MemberData(nameof(Formats))] public void ConsoleLoggerLogsToError_WhenOverErrorLevel(ConsoleLoggerFormat format) { @@ -1020,7 +995,6 @@ public void ConsoleLoggerLogsToError_WhenOverErrorLevel(ConsoleLoggerFormat form } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [MemberData(nameof(FormatsAndLevels))] public void WriteCore_NullMessageWithException(ConsoleLoggerFormat format, LogLevel level) { @@ -1065,7 +1039,6 @@ public void WriteCore_NullMessageWithException(ConsoleLoggerFormat format, LogLe } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [MemberData(nameof(FormatsAndLevels))] public void WriteCore_EmptyMessageWithException(ConsoleLoggerFormat format, LogLevel level) { @@ -1109,7 +1082,6 @@ public void WriteCore_EmptyMessageWithException(ConsoleLoggerFormat format, LogL } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [MemberData(nameof(FormatsAndLevels))] public void WriteCore_MessageWithNullException(ConsoleLoggerFormat format, LogLevel level) { @@ -1150,7 +1122,6 @@ public void WriteCore_MessageWithNullException(ConsoleLoggerFormat format, LogLe } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [MemberData(nameof(Levels))] public void WriteCore_NullMessageWithNullException(LogLevel level) { @@ -1169,7 +1140,6 @@ public void WriteCore_NullMessageWithNullException(LogLevel level) } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void IsEnabledReturnsCorrectValue() { var logger = SetUp().Logger; @@ -1184,7 +1154,6 @@ public static void IsEnabledReturnsCorrectValue() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void ConsoleLoggerOptions_DisableColors_IsAppliedToLoggers() { // Arrange @@ -1219,7 +1188,6 @@ public void ConsoleLoggerOptions_SetInvalidBufferMode_Throws() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void ConsoleLoggerOptions_DisableColors_IsReadFromLoggingConfiguration() { var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { new KeyValuePair("Console:DisableColors", "true") }).Build(); @@ -1237,7 +1205,6 @@ public void ConsoleLoggerOptions_DisableColors_IsReadFromLoggingConfiguration() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void ConsoleLoggerOptions_TimeStampFormat_IsReloaded() { // Arrange @@ -1252,7 +1219,6 @@ public void ConsoleLoggerOptions_TimeStampFormat_IsReloaded() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void ConsoleLoggerOptions_TimeStampFormat_IsReadFromLoggingConfiguration() { var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { new KeyValuePair("Console:TimeStampFormat", "yyyyMMddHHmmss") }).Build(); @@ -1270,7 +1236,6 @@ public void ConsoleLoggerOptions_TimeStampFormat_IsReadFromLoggingConfiguration( } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void ConsoleLoggerOptions_TimeStampFormat_MultipleReloads() { var monitor = new TestOptionsMonitor(new ConsoleLoggerOptions()); @@ -1285,7 +1250,6 @@ public void ConsoleLoggerOptions_TimeStampFormat_MultipleReloads() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void ConsoleLoggerOptions_IncludeScopes_IsAppliedToLoggers() { // Arrange @@ -1300,7 +1264,6 @@ public void ConsoleLoggerOptions_IncludeScopes_IsAppliedToLoggers() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void ConsoleLoggerOptions_LogAsErrorLevel_IsReadFromLoggingConfiguration() { var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { new KeyValuePair("Console:LogToStandardErrorThreshold", "Warning") }).Build(); @@ -1318,7 +1281,6 @@ public void ConsoleLoggerOptions_LogAsErrorLevel_IsReadFromLoggingConfiguration( } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void ConsoleLoggerOptions_LogAsErrorLevel_IsAppliedToLoggers() { // Arrange @@ -1333,7 +1295,6 @@ public void ConsoleLoggerOptions_LogAsErrorLevel_IsAppliedToLoggers() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void ConsoleLoggerOptions_UpdateQueueOptions_UpdatesConsoleLoggerProcessorProperties() { // Arrange @@ -1353,7 +1314,6 @@ public void ConsoleLoggerOptions_UpdateQueueOptions_UpdatesConsoleLoggerProcesso } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void ConsoleLoggerOptions_UseUtcTimestamp_IsAppliedToLoggers() { // Arrange @@ -1368,7 +1328,6 @@ public void ConsoleLoggerOptions_UseUtcTimestamp_IsAppliedToLoggers() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void ConsoleLoggerOptions_IncludeScopes_IsReadFromLoggingConfiguration() { var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { new KeyValuePair("Console:IncludeScopes", "true") }).Build(); diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/JsonConsoleFormatterTests.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/JsonConsoleFormatterTests.cs index 153ba5503eeb47..0ef491abbc1723 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/JsonConsoleFormatterTests.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/JsonConsoleFormatterTests.cs @@ -18,7 +18,6 @@ namespace Microsoft.Extensions.Logging.Console.Test public class JsonConsoleFormatterTests : ConsoleFormatterTests { [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void NoLogScope_DoesNotWriteAnyScopeContentToOutput_Json() { // Arrange @@ -80,7 +79,6 @@ public void Log_TimestampFormatSet_ContainsTimestamp() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void Log_NullMessage_LogsWhenMessageIsNotProvided() { // Arrange @@ -125,7 +123,6 @@ public void Log_NullMessage_LogsWhenMessageIsNotProvided() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void Log_ExceptionWithMessage_ExtractsInfo() { // Arrange @@ -180,7 +177,6 @@ public void Log_ExceptionWithMessage_ExtractsInfo() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void Log_IncludeScopes_ContainsDuplicateNamedPropertiesInScope_AcceptableJson() { // Arrange @@ -214,7 +210,6 @@ public void Log_IncludeScopes_ContainsDuplicateNamedPropertiesInScope_Acceptable } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void Log_StateAndScopeAreCollections_IncludesMessageAndCollectionValues() { // Arrange @@ -250,7 +245,6 @@ public void Log_StateAndScopeAreCollections_IncludesMessageAndCollectionValues() } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [MemberData(nameof(SpecialCaseValues))] public void Log_StateAndScopeContainsSpecialCaseValue_SerializesValueAsExpected(object value, string expectedJsonValue) { @@ -281,7 +275,6 @@ public void Log_StateAndScopeContainsSpecialCaseValue_SerializesValueAsExpected( } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [MemberData(nameof(FloatingPointValues))] public void Log_StateAndScopeContainsFloatingPointType_SerializesValue(object value) { @@ -321,7 +314,6 @@ static void AssertMessageValue(string message, string propertyName) } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void Log_StateAndScopeContainsNullValue_SerializesNull() { // Arrange @@ -351,7 +343,6 @@ public void Log_StateAndScopeContainsNullValue_SerializesNull() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void Log_ScopeIsIEnumerable_SerializesKeyValuePair() { // Arrange diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/SimpleConsoleFormatterTests.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/SimpleConsoleFormatterTests.cs index 26bd40775bb371..3bb1fa491ecea0 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/SimpleConsoleFormatterTests.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests/SimpleConsoleFormatterTests.cs @@ -10,7 +10,6 @@ namespace Microsoft.Extensions.Logging.Console.Test public class SimpleConsoleFormatterTests : ConsoleFormatterTests { [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(LoggerColorBehavior.Default)] [InlineData(LoggerColorBehavior.Enabled)] [InlineData(LoggerColorBehavior.Disabled)] @@ -55,7 +54,6 @@ public void Log_WritingScopes_LogsWithCorrectColorsWhenColorEnabled(LoggerColorB } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void Log_NoLogScope_DoesNotWriteAnyScopeContentToOutput() { // Arrange @@ -111,7 +109,6 @@ public void Log_SingleLine_LogsWhenMessageIsNotProvided() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void Log_SingleLine_LogsWhenBothMessageAndExceptionProvided() { // Arrange diff --git a/src/libraries/System.Collections.NonGeneric/tests/QueueTests.cs b/src/libraries/System.Collections.NonGeneric/tests/QueueTests.cs index 69a09d473bedc1..56b509470e8224 100644 --- a/src/libraries/System.Collections.NonGeneric/tests/QueueTests.cs +++ b/src/libraries/System.Collections.NonGeneric/tests/QueueTests.cs @@ -913,7 +913,6 @@ public static void Synchronized() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void SynchronizedEnqueue() { // Enqueue diff --git a/src/libraries/System.ComponentModel.TypeConverter/tests/TimerTests.cs b/src/libraries/System.ComponentModel.TypeConverter/tests/TimerTests.cs index ff4138d6cc6f0a..0904d7145912ea 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/tests/TimerTests.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/tests/TimerTests.cs @@ -36,7 +36,6 @@ public void Ctor_PropertiesMatchExpectedDefaults() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void TestTimerStartAutoReset() { using (var timer = new TestTimer(1)) diff --git a/src/libraries/System.Composition/tests/ConcurrencyTests.cs b/src/libraries/System.Composition/tests/ConcurrencyTests.cs index e015c15cb23308..6801f55a57d32e 100644 --- a/src/libraries/System.Composition/tests/ConcurrencyTests.cs +++ b/src/libraries/System.Composition/tests/ConcurrencyTests.cs @@ -28,7 +28,6 @@ public void OnImportsSatisfied() // This does not test the desired behaviour deterministically, // but is close enough to be repeatable at least on my machine :) [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void SharedInstancesAreNotVisibleUntilActivationCompletes() { var c = CreateContainer(typeof(PausesDuringActivation)); diff --git a/src/libraries/System.Globalization/tests/CultureInfo/CultureInfoAsync.cs b/src/libraries/System.Globalization/tests/CultureInfo/CultureInfoAsync.cs index 3f7131ad8db332..1e9eb7b7555bc8 100644 --- a/src/libraries/System.Globalization/tests/CultureInfo/CultureInfoAsync.cs +++ b/src/libraries/System.Globalization/tests/CultureInfo/CultureInfoAsync.cs @@ -30,7 +30,6 @@ public void TestCurrentCulturesAsync() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void TestCurrentCulturesWithAwait() { var newCurrentCulture = new CultureInfo(CultureInfo.CurrentCulture.Name.Equals("ja-JP", StringComparison.OrdinalIgnoreCase) ? "en-US" : "ja-JP"); diff --git a/src/libraries/System.IO.Pipelines/tests/PipeWriterTests.cs b/src/libraries/System.IO.Pipelines/tests/PipeWriterTests.cs index 2913efbe3cdf6c..85070e1534a8ee 100644 --- a/src/libraries/System.IO.Pipelines/tests/PipeWriterTests.cs +++ b/src/libraries/System.IO.Pipelines/tests/PipeWriterTests.cs @@ -294,7 +294,6 @@ public async Task WritesUsingGetMemoryWorks() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91547", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task CompleteWithLargeWriteThrows() { var completeDelay = TimeSpan.FromMilliseconds(10); diff --git a/src/libraries/System.IO.Pipelines/tests/SchedulerFacts.cs b/src/libraries/System.IO.Pipelines/tests/SchedulerFacts.cs index 42b92efbc1369c..ba558339b0a057 100644 --- a/src/libraries/System.IO.Pipelines/tests/SchedulerFacts.cs +++ b/src/libraries/System.IO.Pipelines/tests/SchedulerFacts.cs @@ -181,7 +181,6 @@ public async Task DefaultReaderSchedulerIgnoresSyncContextIfConfigureAwaitFalse( } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task DefaultReaderSchedulerRunsOnThreadPool() { var pipe = new Pipe(new PipeOptions(useSynchronizationContext: false)); @@ -211,7 +210,6 @@ public async Task DefaultReaderSchedulerRunsOnThreadPool() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task DefaultWriterSchedulerRunsOnThreadPool() { using (var pool = new TestMemoryPool()) @@ -413,7 +411,6 @@ public async Task DefaultWriterSchedulerIgnoresSynchronizationContext() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task FlushCallbackRunsOnWriterScheduler() { using (var pool = new TestMemoryPool()) @@ -459,7 +456,6 @@ public async Task FlushCallbackRunsOnWriterScheduler() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task ReadAsyncCallbackRunsOnReaderScheduler() { using (var pool = new TestMemoryPool()) @@ -493,7 +489,6 @@ public async Task ReadAsyncCallbackRunsOnReaderScheduler() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task ThreadPoolScheduler_SchedulesOnThreadPool() { var pipe = new Pipe(new PipeOptions(readerScheduler: PipeScheduler.ThreadPool, writerScheduler: PipeScheduler.Inline, useSynchronizationContext: false)); diff --git a/src/libraries/System.Linq.Parallel/tests/ExchangeTests.cs b/src/libraries/System.Linq.Parallel/tests/ExchangeTests.cs index 3f12e3e34c0027..6dcaffbf60a5a5 100644 --- a/src/libraries/System.Linq.Parallel/tests/ExchangeTests.cs +++ b/src/libraries/System.Linq.Parallel/tests/ExchangeTests.cs @@ -89,7 +89,6 @@ public static IEnumerable AllMergeOptions_Multiple() // or WithMergeOptions [ConditionalTheory] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [MemberData(nameof(PartitioningData), new[] { 0, 1, 2, 16, 1024 })] public static void Partitioning_Default(Labeled> labeled, int count, int partitions) { @@ -159,7 +158,6 @@ public static void Merge_Ordered_Longrunning(Labeled> labeled } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [MemberData(nameof(ThrowOnCount_AllMergeOptions_MemberData), new[] { 4, 8 })] // FailingMergeData has enumerables that throw errors when attempting to perform the nth enumeration. // This test checks whether the query runs in a pipelined or buffered fashion. @@ -169,7 +167,6 @@ public static void Merge_Ordered_Pipelining(Labeled> labeled, } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [MemberData(nameof(MergeData), new[] { 4, 8 })] // This test checks whether the query runs in a pipelined or buffered fashion. public static void Merge_Ordered_Pipelining_Select(Labeled> labeled, int count, ParallelMergeOptions options) diff --git a/src/libraries/System.Linq.Parallel/tests/PlinqModesTests.cs b/src/libraries/System.Linq.Parallel/tests/PlinqModesTests.cs index 85db2d3805bf48..b6b8b626c51588 100644 --- a/src/libraries/System.Linq.Parallel/tests/PlinqModesTests.cs +++ b/src/libraries/System.Linq.Parallel/tests/PlinqModesTests.cs @@ -136,7 +136,6 @@ public static IEnumerable AllExecutionModes_Multiple() // Check that some queries run in parallel by default, and some require forcing. [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91661", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [MemberData(nameof(WithExecutionModeQueryData), new[] { 1, 4 })] // DOP of 1 to verify sequential and 4 to verify parallel public static void WithExecutionMode( Labeled> labeled, diff --git a/src/libraries/System.Linq.Parallel/tests/QueryOperators/GetEnumeratorTests.cs b/src/libraries/System.Linq.Parallel/tests/QueryOperators/GetEnumeratorTests.cs index 652c72897980da..d34cc6e903bc9c 100644 --- a/src/libraries/System.Linq.Parallel/tests/QueryOperators/GetEnumeratorTests.cs +++ b/src/libraries/System.Linq.Parallel/tests/QueryOperators/GetEnumeratorTests.cs @@ -165,7 +165,6 @@ public static void GetEnumerator_MoveNextAfterEnd(Labeled> la } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void GetEnumerator_LargeQuery_PauseAfterOpening() { using (IEnumerator e = Enumerable.Range(0, 8192).AsParallel().SkipWhile(i => true).GetEnumerator()) diff --git a/src/libraries/System.Linq.Parallel/tests/QueryOperators/OrderByThenByTests.cs b/src/libraries/System.Linq.Parallel/tests/QueryOperators/OrderByThenByTests.cs index 931333fd69b536..0d920b5d13f782 100644 --- a/src/libraries/System.Linq.Parallel/tests/QueryOperators/OrderByThenByTests.cs +++ b/src/libraries/System.Linq.Parallel/tests/QueryOperators/OrderByThenByTests.cs @@ -517,7 +517,6 @@ public static void OrderBy_ThreadedDeadlock(Labeled> labeled, // Heavily exercises OrderBy, but only throws one user delegate exception to simulate an occasional failure. [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] [MemberData(nameof(OrderByThreadedData), new[] { 1, 2, 16, 128, 1024 }, new[] { 1, 2, 4, 7, 8, 31, 32 })] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void OrderBy_ThreadedDeadlock_SingleException(Labeled> labeled, int count, int degree) { int countdown = Math.Min(count / 2, degree) + 1; diff --git a/src/libraries/System.Private.Xml/tests/XmlReader/Tests/AsyncReaderLateInitTests.cs b/src/libraries/System.Private.Xml/tests/XmlReader/Tests/AsyncReaderLateInitTests.cs index 05fd83798861d7..85f2fd9fdf7f10 100644 --- a/src/libraries/System.Private.Xml/tests/XmlReader/Tests/AsyncReaderLateInitTests.cs +++ b/src/libraries/System.Private.Xml/tests/XmlReader/Tests/AsyncReaderLateInitTests.cs @@ -69,7 +69,6 @@ public static void ReadAfterInitializationWithTextReaderOnAsyncReaderDoesNotThro } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void ReadAsyncAfterInitializationWithUriThrows() { using (XmlReader reader = XmlReader.Create("http://test.test/test.html", new XmlReaderSettings() { Async = true })) @@ -79,7 +78,6 @@ public static void ReadAsyncAfterInitializationWithUriThrows() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void ReadAfterInitializationWithUriOnAsyncReaderTrows() { using (XmlReader reader = XmlReader.Create("http://test.test/test.html", new XmlReaderSettings() { Async = true })) @@ -89,7 +87,6 @@ public static void ReadAfterInitializationWithUriOnAsyncReaderTrows() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void InitializationWithUriOnNonAsyncReaderThrows() { Assert.Throws(() => XmlReader.Create("http://test.test/test.html", new XmlReaderSettings() { Async = false })); diff --git a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslTransformMultith.cs b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslTransformMultith.cs index f8d12d5dec8acf..5699868c280638 100644 --- a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslTransformMultith.cs +++ b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XslTransformMultith.cs @@ -78,7 +78,6 @@ public int Transform(object args) //[Variation("Multiple Transform(): Reader - Basic Test")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc1() { Load("xslt_multithreading_test.xsl", "foo.xml"); @@ -99,7 +98,6 @@ public void proc1() //[Variation("Multiple Transform(): Reader - QFE 505 Repro")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc2() { using (new AllowDefaultResolverContext()) @@ -121,7 +119,6 @@ public void proc2() //[Variation("Multiple Transform(): Reader - AVTs")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc3() { Load("xslt_multith_AVTs.xsl", "xslt_multith_AVTs.xml"); @@ -142,7 +139,6 @@ public void proc3() //[Variation("Multiple Transform(): Reader - xsl:key")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc4() { Load("xslt_multith_keytest.xsl", "xslt_multith_keytest.xml"); @@ -163,7 +159,6 @@ public void proc4() //[Variation("Multiple Transform(): Reader - xsl:sort")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc5() { Load("xslt_multith_sorting.xsl", "xslt_multith_sorting.xml"); @@ -184,7 +179,6 @@ public void proc5() //[Variation("Multiple Transform(): Reader - Attribute Sets")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc6() { Load("xslt_mutith_attribute_sets.xsl", "xslt_mutith_attribute_sets.xml"); @@ -205,7 +199,6 @@ public void proc6() //[Variation("Multiple Transform(): Reader - Boolean Expression AND")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc7() { Load("xslt_mutith_boolean_expr_and.xsl", "xslt_mutith_boolean_expr_and.xml"); @@ -226,7 +219,6 @@ public void proc7() //[Variation("Multiple Transform(): Reader - Boolean Expression OR")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc8() { Load("xslt_mutith_boolean_expr_or.xsl", "xslt_mutith_boolean_expr_or.xml"); @@ -247,7 +239,6 @@ public void proc8() //[Variation("Multiple Transform(): Reader - FormatNumber function")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc9() { Load("xslt_mutith_format_number.xsl", "xslt_mutith_format_number.xml"); @@ -268,7 +259,6 @@ public void proc9() //[Variation("Multiple Transform(): Reader - Position() function")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc10() { Load("xslt_mutith_position_func.xsl", "xslt_mutith_position_func.xml"); @@ -289,7 +279,6 @@ public void proc10() //[Variation("Multiple Transform(): Reader - preserve space")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc11() { Load("xslt_mutith_preserve_space.xsl", "xslt_mutith_preserve_space.xml"); @@ -310,7 +299,6 @@ public void proc11() //[Variation("Multiple Transform(): Reader - Variable nodeset")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc12() { Load("xslt_mutith_variable_nodeset.xsl", "xslt_mutith_variable_nodeset.xml"); @@ -377,7 +365,6 @@ private void Load(string _strXslFile, string _strXmlFile) //[Variation("Multiple Transform(): TextWriter - Basic Test")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc1() { Load("xslt_multithreading_test.xsl", "foo.xml"); @@ -398,7 +385,6 @@ public void proc1() //[Variation("Multiple Transform(): TextWriter - QFE 505 Repro")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc2() { using (new AllowDefaultResolverContext()) @@ -420,7 +406,6 @@ public void proc2() //[Variation("Multiple Transform(): TextWriter - AVTs")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc3() { Load("xslt_multith_AVTs.xsl", "xslt_multith_AVTs.xml"); @@ -441,7 +426,6 @@ public void proc3() //[Variation("Multiple Transform(): TextWriter - xsl:key")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc4() { Load("xslt_multith_keytest.xsl", "xslt_multith_keytest.xml"); @@ -462,7 +446,6 @@ public void proc4() //[Variation("Multiple Transform(): TextWriter - xsl:sort")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc5() { Load("xslt_multith_sorting.xsl", "xslt_multith_sorting.xml"); @@ -483,7 +466,6 @@ public void proc5() //[Variation("Multiple Transform(): TextWriter - Attribute Sets")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc6() { Load("xslt_mutith_attribute_sets.xsl", "xslt_mutith_attribute_sets.xml"); @@ -504,7 +486,6 @@ public void proc6() //[Variation("Multiple Transform(): TextWriter - Boolean Expression AND")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc7() { Load("xslt_mutith_boolean_expr_and.xsl", "xslt_mutith_boolean_expr_and.xml"); @@ -525,7 +506,6 @@ public void proc7() //[Variation("Multiple Transform(): TextWriter - Boolean Expression OR")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc8() { Load("xslt_mutith_boolean_expr_or.xsl", "xslt_mutith_boolean_expr_or.xml"); @@ -546,7 +526,6 @@ public void proc8() //[Variation("Multiple Transform(): TextWriter - FormatNumber function")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc9() { Load("xslt_mutith_format_number.xsl", "xslt_mutith_format_number.xml"); @@ -567,7 +546,6 @@ public void proc9() //[Variation("Multiple Transform(): TextWriter - Position() function")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc10() { Load("xslt_mutith_position_func.xsl", "xslt_mutith_position_func.xml"); @@ -588,7 +566,6 @@ public void proc10() //[Variation("Multiple Transform(): TextWriter - preserve space")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc11() { Load("xslt_mutith_preserve_space.xsl", "xslt_mutith_preserve_space.xml"); @@ -609,7 +586,6 @@ public void proc11() //[Variation("Multiple Transform(): TextWriter - Variable nodeset")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc12() { Load("xslt_mutith_variable_nodeset.xsl", "xslt_mutith_variable_nodeset.xml"); diff --git a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltArgumentListMultith.cs b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltArgumentListMultith.cs index 920cf4a1d01453..bfa3788d0c9072 100644 --- a/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltArgumentListMultith.cs +++ b/src/libraries/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/XsltArgumentListMultith.cs @@ -105,7 +105,6 @@ public int GetParam2(object args) //[Variation("Multiple GetParam for same parameter name")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc1() { CThreads rThreads = new CThreads(_output); @@ -124,7 +123,6 @@ public void proc1() //[Variation("Multiple GetParam for different parameter name")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc2() { CThreads rThreads = new CThreads(_output); @@ -192,7 +190,6 @@ public int GetExtnObject2(object args) //[Variation("Multiple GetExtensionObject for same namespace System.Xml.Tests")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc1() { CThreads rThreads = new CThreads(_output); @@ -211,7 +208,6 @@ public void proc1() //[Variation("Multiple GetExtensionObject for different namespace System.Xml.Tests")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc2() { CThreads rThreads = new CThreads(_output); @@ -280,7 +276,6 @@ public int SharedArgList(object args) //////////////////////////////////////////////////////////////// //[Variation("Multiple transforms using shared ArgumentList")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc1() { CThreads rThreads = new CThreads(_output); diff --git a/src/libraries/System.Private.Xml/tests/Xslt/XslTransformApi/CXslTransformMultith.cs b/src/libraries/System.Private.Xml/tests/Xslt/XslTransformApi/CXslTransformMultith.cs index f81bf6240c84d0..7caf4550a068e8 100644 --- a/src/libraries/System.Private.Xml/tests/Xslt/XslTransformApi/CXslTransformMultith.cs +++ b/src/libraries/System.Private.Xml/tests/Xslt/XslTransformApi/CXslTransformMultith.cs @@ -76,7 +76,6 @@ public virtual int Transform(object args) [InlineData("xslt_mutith_variable_global_forward_ref_deep.xsl", "xslt_mutith_variable_nodeset.xml")] //[Variation("Local and global variables", Params = new object[] { "xslt_mutith_variable_local_and_global.xsl", "xslt_mutith_variable_local_and_global.xsl" })] [InlineData("xslt_mutith_variable_local_and_global.xsl", "xslt_mutith_variable_local_and_global.xsl")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] public void Variations(object param0, object param1) { diff --git a/src/libraries/System.Private.Xml/tests/Xslt/XslTransformApi/CXsltArgumentListMultith.cs b/src/libraries/System.Private.Xml/tests/Xslt/XslTransformApi/CXsltArgumentListMultith.cs index d6b6e6e0a26614..ae2927e4308696 100644 --- a/src/libraries/System.Private.Xml/tests/Xslt/XslTransformApi/CXsltArgumentListMultith.cs +++ b/src/libraries/System.Private.Xml/tests/Xslt/XslTransformApi/CXsltArgumentListMultith.cs @@ -105,7 +105,6 @@ public int GetParam2(object args) //[Variation("Multiple GetParam for same parameter name")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc1() { CThreads rThreads = new CThreads(_output); @@ -124,7 +123,6 @@ public void proc1() //[Variation("Multiple GetParam for different parameter name")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc2() { CThreads rThreads = new CThreads(_output); @@ -191,7 +189,6 @@ public int GetExtnObject2(object args) //[Variation("Multiple GetExtensionObject for same namespace System.Xml.Tests")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc1() { CThreads rThreads = new CThreads(_output); @@ -210,7 +207,6 @@ public void proc1() //[Variation("Multiple GetExtensionObject for different namespace System.Xml.Tests")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc2() { CThreads rThreads = new CThreads(_output); @@ -279,7 +275,6 @@ public int SharedArgList(object args) //////////////////////////////////////////////////////////////// //[Variation("Multiple transforms using shared ArgumentList")] [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void proc1() { CThreads rThreads = new CThreads(_output); diff --git a/src/libraries/System.Runtime.Extensions/tests/System/EnvironmentTests.cs b/src/libraries/System.Runtime.Extensions/tests/System/EnvironmentTests.cs index b797d36ea92b11..4f30dfd0a09b0d 100644 --- a/src/libraries/System.Runtime.Extensions/tests/System/EnvironmentTests.cs +++ b/src/libraries/System.Runtime.Extensions/tests/System/EnvironmentTests.cs @@ -59,7 +59,6 @@ public void CurrentManagedThreadId_Idempotent() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void CurrentManagedThreadId_DifferentForActiveThreads() { var ids = new HashSet(); diff --git a/src/libraries/System.Runtime.Extensions/tests/System/Progress.cs b/src/libraries/System.Runtime.Extensions/tests/System/Progress.cs index 531b1b2729e349..8fd7a61603ecea 100644 --- a/src/libraries/System.Runtime.Extensions/tests/System/Progress.cs +++ b/src/libraries/System.Runtime.Extensions/tests/System/Progress.cs @@ -18,7 +18,6 @@ public void Ctor() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void NoWorkQueuedIfNoHandlers() { RunWithoutSyncCtx(() => diff --git a/src/libraries/System.Runtime.Extensions/tests/System/Random.cs b/src/libraries/System.Runtime.Extensions/tests/System/Random.cs index 648a85ae8fc2cf..16c3a9a2353b7e 100644 --- a/src/libraries/System.Runtime.Extensions/tests/System/Random.cs +++ b/src/libraries/System.Runtime.Extensions/tests/System/Random.cs @@ -516,7 +516,6 @@ public void Shared_IsSingleton() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void Shared_ParallelUsage() { using var barrier = new Barrier(2); diff --git a/src/libraries/System.Runtime.Serialization.Xml/tests/XmlDictionaryWriterTest.cs b/src/libraries/System.Runtime.Serialization.Xml/tests/XmlDictionaryWriterTest.cs index a7ba064e1fa007..72f956bcc2cdd6 100644 --- a/src/libraries/System.Runtime.Serialization.Xml/tests/XmlDictionaryWriterTest.cs +++ b/src/libraries/System.Runtime.Serialization.Xml/tests/XmlDictionaryWriterTest.cs @@ -16,7 +16,6 @@ public static class XmlDictionaryWriterTest { [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void XmlBaseWriter_WriteBase64Async() { string actual; @@ -64,7 +63,6 @@ public static void XmlBaseWriter_WriteBinHex() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void XmlBaseWriter_FlushAsync() { string actual = null; @@ -145,7 +143,6 @@ public static void XmlBaseWriter_WriteStartEndElementAsync() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void XmlBaseWriter_CheckAsync_ThrowInvalidOperationException() { int byteSize = 1024; @@ -521,7 +518,7 @@ public static void XmlBaseWriter_WriteString() { for (int i = 0; i < chars.Length; ++i) chars[i] = (char)(i % 128); - chars[^1] = '\u00E4'; // '�' - Latin Small Letter a with Diaeresis. Latin-1 Supplement. + chars[^1] = '\u00E4'; // '�' - Latin Small Letter a with Diaeresis. Latin-1 Supplement. }); int numBytes = Encoding.UTF8.GetBytes(allAscii, buffer); diff --git a/src/libraries/System.Runtime/tests/System/Attributes.cs b/src/libraries/System.Runtime/tests/System/Attributes.cs index bbf2705098083f..0b75b48ea133e7 100644 --- a/src/libraries/System.Runtime/tests/System/Attributes.cs +++ b/src/libraries/System.Runtime/tests/System/Attributes.cs @@ -327,7 +327,6 @@ public static class GetCustomAttribute { [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91597", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void customAttributeCount() { List customAttributes = typeof(GetCustomAttribute).Module.CustomAttributes.ToList(); diff --git a/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForEachAsyncTests.cs b/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForEachAsyncTests.cs index fbcbdc87f1931c..77c16ddd72c928 100644 --- a/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForEachAsyncTests.cs +++ b/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForEachAsyncTests.cs @@ -293,7 +293,6 @@ static IEnumerable IterateUntilSet(StrongBox box) } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Dop_NegativeTaskSchedulerLimitTreatedAsDefault_Async() { static async IAsyncEnumerable IterateUntilSet(StrongBox box) @@ -328,7 +327,6 @@ static async IAsyncEnumerable IterateUntilSet(StrongBox box) } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task RunsAsynchronously_For() { var cts = new CancellationTokenSource(); @@ -342,7 +340,6 @@ public async Task RunsAsynchronously_For() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task RunsAsynchronously_EvenForEntirelySynchronousWork_Sync() { static IEnumerable Iterate() @@ -361,7 +358,6 @@ static IEnumerable Iterate() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task RunsAsynchronously_EvenForEntirelySynchronousWork_Async() { #pragma warning disable CS1998 // Async method lacks 'await' operators and will run synchronously @@ -382,7 +378,6 @@ static async IAsyncEnumerable IterateAsync() } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(-1)] [InlineData(1)] [InlineData(2)] @@ -422,7 +417,6 @@ static async IAsyncEnumerable IterateUntilSetAsync(StrongBox box) } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void EmptyRange_For() { int counter = 0; @@ -437,7 +431,6 @@ public void EmptyRange_For() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task EmptySource_Sync() { int counter = 0; @@ -451,7 +444,6 @@ await Parallel.ForEachAsync(Enumerable.Range(0, 0), (item, cancellationToken) => } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task EmptySource_Async() { int counter = 0; @@ -465,7 +457,6 @@ await Parallel.ForEachAsync(EnumerableRangeAsync(0, 0), (item, cancellationToken } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task AllItemsEnumeratedOnce_For(bool yield) @@ -511,7 +502,6 @@ await Parallel.ForAsync(T.CreateTruncating(Start), T.CreateTruncating(Start + Co } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task AllItemsEnumeratedOnce_Sync(bool yield) @@ -542,7 +532,6 @@ await Parallel.ForEachAsync(Enumerable.Range(Start, Count), async (item, cancell } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task AllItemsEnumeratedOnce_Async(bool yield) @@ -573,7 +562,6 @@ await Parallel.ForEachAsync(EnumerableRangeAsync(Start, Count, yield), async (it } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task TaskScheduler_AllCodeExecutedOnCorrectScheduler_For(bool defaultScheduler) @@ -602,7 +590,6 @@ public async Task TaskScheduler_AllCodeExecutedOnCorrectScheduler_For(bool defau } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task TaskScheduler_AllCodeExecutedOnCorrectScheduler_Sync(bool defaultScheduler) @@ -641,7 +628,6 @@ IEnumerable Iterate() } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task TaskScheduler_AllCodeExecutedOnCorrectScheduler_Async(bool defaultScheduler) @@ -681,7 +667,6 @@ async IAsyncEnumerable Iterate() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Cancellation_CancelsIterationAndReturnsCanceledTask_For() { using var cts = new CancellationTokenSource(10); @@ -714,7 +699,6 @@ static async IAsyncEnumerable Infinite() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Cancellation_CancelsIterationAndReturnsCanceledTask_Async() { static async IAsyncEnumerable InfiniteAsync() @@ -736,7 +720,6 @@ static async IAsyncEnumerable InfiniteAsync() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Cancellation_CorrectTokenPassedToAsyncEnumerator() { static async IAsyncEnumerable YieldTokenAsync([EnumeratorCancellation] CancellationToken cancellationToken) @@ -753,7 +736,6 @@ await Parallel.ForEachAsync(YieldTokenAsync(default), (item, cancellationToken) } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Cancellation_SameTokenPassedToEveryInvocation_For() { var cq = new ConcurrentQueue(); @@ -769,7 +751,6 @@ await Parallel.ForAsync(1, 101, async (item, cancellationToken) => } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Cancellation_SameTokenPassedToEveryInvocation_Sync() { var cq = new ConcurrentQueue(); @@ -785,7 +766,6 @@ await Parallel.ForEachAsync(Enumerable.Range(1, 100), async (item, cancellationT } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Cancellation_SameTokenPassedToEveryInvocation_Async() { var cq = new ConcurrentQueue(); @@ -801,7 +781,6 @@ await Parallel.ForEachAsync(EnumerableRangeAsync(1, 100), async (item, cancellat } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Cancellation_HasPriorityOverExceptions_For() { var tcs = new TaskCompletionSource(); @@ -828,7 +807,6 @@ public async Task Cancellation_HasPriorityOverExceptions_For() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Cancellation_HasPriorityOverExceptions_Sync() { static IEnumerable Iterate() @@ -861,7 +839,6 @@ static IEnumerable Iterate() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Cancellation_HasPriorityOverExceptions_Async() { static async IAsyncEnumerable Iterate() @@ -898,7 +875,6 @@ static async IAsyncEnumerable Iterate() } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task Cancellation_FaultsForOceForNonCancellation_For(bool internalToken) @@ -915,7 +891,6 @@ public async Task Cancellation_FaultsForOceForNonCancellation_For(bool internalT } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task Cancellation_FaultsForOceForNonCancellation(bool internalToken) @@ -942,7 +917,6 @@ static async IAsyncEnumerable Iterate() } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(0, 4)] [InlineData(1, 4)] [InlineData(2, 4)] @@ -975,7 +949,6 @@ public async Task Cancellation_InternalCancellationExceptionsArentFilteredOut_Fo } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(0, 4)] [InlineData(1, 4)] [InlineData(2, 4)] @@ -1008,7 +981,6 @@ public async Task Cancellation_InternalCancellationExceptionsArentFilteredOut(in } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void Exception_FromGetEnumerator_Sync() { Task t = Parallel.ForEachAsync((IEnumerable)new ThrowsFromGetEnumerator(), (item, cancellationToken) => default); @@ -1018,7 +990,6 @@ public void Exception_FromGetEnumerator_Sync() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void Exception_FromGetEnumerator_Async() { Task t = Parallel.ForEachAsync((IAsyncEnumerable)new ThrowsFromGetEnumerator(), (item, cancellationToken) => default); @@ -1028,7 +999,6 @@ public void Exception_FromGetEnumerator_Async() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void Exception_NullFromGetEnumerator_Sync() { Task t = Parallel.ForEachAsync((IEnumerable)new ReturnsNullFromGetEnumerator(), (item, cancellationToken) => default); @@ -1038,7 +1008,6 @@ public void Exception_NullFromGetEnumerator_Sync() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void Exception_NullFromGetEnumerator_Async() { Task t = Parallel.ForEachAsync((IAsyncEnumerable)new ReturnsNullFromGetEnumerator(), (item, cancellationToken) => default); @@ -1048,7 +1017,6 @@ public void Exception_NullFromGetEnumerator_Async() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Exception_FromMoveNext_Sync() { static IEnumerable Iterate() @@ -1069,7 +1037,6 @@ static IEnumerable Iterate() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Exception_FromMoveNext_Async() { static async IAsyncEnumerable Iterate() @@ -1091,7 +1058,6 @@ static async IAsyncEnumerable Iterate() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Exception_FromLoopBody_For() { var barrier = new Barrier(2); @@ -1113,7 +1079,6 @@ public async Task Exception_FromLoopBody_For() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Exception_FromLoopBody_Sync() { static IEnumerable Iterate() @@ -1141,7 +1106,6 @@ static IEnumerable Iterate() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Exception_FromLoopBody_Async() { static async IAsyncEnumerable Iterate() @@ -1183,7 +1147,6 @@ static async IAsyncEnumerable Iterate() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Exception_FromDispose_Sync() { Task t = Parallel.ForEachAsync((IEnumerable)new ThrowsExceptionFromDispose(), (item, cancellationToken) => default); @@ -1192,7 +1155,6 @@ public async Task Exception_FromDispose_Sync() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Exception_FromDispose_Async() { Task t = Parallel.ForEachAsync((IAsyncEnumerable)new ThrowsExceptionFromDispose(), (item, cancellationToken) => default); @@ -1201,7 +1163,6 @@ public async Task Exception_FromDispose_Async() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Exception_FromDisposeAndCancellationCallback_Sync() { Task t = Parallel.ForEachAsync((IEnumerable)new ThrowsExceptionFromDisposeAndCancellationCallback(), (item, cancellationToken) => default); @@ -1211,7 +1172,6 @@ public async Task Exception_FromDisposeAndCancellationCallback_Sync() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Exception_FromDisposeAndCancellationCallback_Async() { Task t = Parallel.ForEachAsync((IAsyncEnumerable)new ThrowsExceptionFromDisposeAndCancellationCallback(), (item, cancellationToken) => default); @@ -1221,7 +1181,6 @@ public async Task Exception_FromDisposeAndCancellationCallback_Async() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Exception_ImplicitlyCancelsOtherWorkers_For() { await Assert.ThrowsAsync(() => Parallel.ForAsync(0, long.MaxValue, async (item, cancellationToken) => @@ -1250,7 +1209,6 @@ await Assert.ThrowsAsync(() => Parallel.ForAsync(0, long.MaxValue, as } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task Exception_ImplicitlyCancelsOtherWorkers_Sync() { static IEnumerable Iterate() @@ -1356,7 +1314,6 @@ static async IAsyncEnumerable Iterate(Task signal) } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task ExecutionContext_FlowsToWorkerBodies_For(bool defaultScheduler) @@ -1375,7 +1332,6 @@ await Parallel.ForAsync(0, 100, async (item, cancellationToken) => } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(false)] [InlineData(true)] public async Task ExecutionContext_FlowsToWorkerBodies_Sync(bool defaultScheduler) diff --git a/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForTests.cs b/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForTests.cs index 39f1e2bb49822d..399ba8c63f5e27 100644 --- a/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForTests.cs +++ b/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelForTests.cs @@ -289,7 +289,6 @@ public static void RunSimpleParallelDoTest(int increms) [InlineData(1024)] [InlineData(1024 * 1024)] [InlineData(1024 * 1024 * 16)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void RunSimpleParallelForIncrementTest(int increms) { // Just increments a shared counter in a loop. @@ -320,7 +319,6 @@ public static void RunSimpleParallelForIncrementTest(int increms) } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(-1)] [InlineData(0)] [InlineData(1)] @@ -454,7 +452,6 @@ public static void SequentialFor64ParityTest(long inclusiveFrom, long exclusiveT } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(0)] [InlineData(1)] [InlineData(1024)] @@ -484,7 +481,6 @@ public static void RunSimpleParallelForeachAddTest_Enumerable(int count) } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(0)] [InlineData(1)] [InlineData(1024)] @@ -515,7 +511,6 @@ public static void RunSimpleParallelForeachAddTest_List(int count) } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(0)] [InlineData(1)] [InlineData(1024)] @@ -546,7 +541,6 @@ public static void RunSimpleParallelForeachAddTest_Array(int count) } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(0)] [InlineData(1)] [InlineData(1024)] @@ -578,7 +572,6 @@ public static void RunSimpleParallelForAverageAggregation(int count) } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(0)] [InlineData(1)] [InlineData(1024)] @@ -718,7 +711,6 @@ public static void TestParallelForDOP() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void TestParallelForPaths() { int loopsize = 1000; @@ -880,7 +872,6 @@ public static void TestParallelForPaths() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void TestParallelForPaths_Exceptions() { int loopsize = 1000; @@ -894,7 +885,6 @@ public static void TestParallelForPaths_Exceptions() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91582", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void TestParallelScheduler() { ParallelOptions parallelOptions = new ParallelOptions(); @@ -1002,7 +992,6 @@ public static void TestParallelScheduler() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void TestInvokeDOPAndCancel() { ParallelOptions parallelOptions = null; @@ -1120,7 +1109,6 @@ public static void TestInvokeDOPAndCancel() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void RunParallelLoopCancellationTests() { int counter = 0; // Counts the actual number of iterations @@ -1223,7 +1211,6 @@ public static void RunParallelLoopCancellationTests() /// Test to ensure that the task ID can be accessed from inside the task /// [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91583", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void TaskIDFromExternalContextTest() { int? withinTaskId = int.MinValue; @@ -1255,7 +1242,6 @@ private static void VerifyCancelTestState( } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void CancelForIntTest() { for (int i = 0; i < 100; ++i) @@ -1290,7 +1276,6 @@ public static void CancelForIntTest() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void CancelForLongTest() { for (int i = 0; i < 100; ++i) @@ -1332,7 +1317,6 @@ public static IEnumerable CancelForEachTest_MemberData() } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [MemberData(nameof(CancelForEachTest_MemberData))] public static void CancelForEachTest(IEnumerable enumerable) { diff --git a/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelLoopResultTests.cs b/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelLoopResultTests.cs index 9006ee9469fc6e..430eabdfa01bb7 100644 --- a/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelLoopResultTests.cs +++ b/src/libraries/System.Threading.Tasks.Parallel/tests/ParallelLoopResultTests.cs @@ -373,7 +373,6 @@ private static void OrderablePartitionerForEachPLRTest( // Perform tests on various combinations of Stop()/Break() [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91579", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void SimultaneousStopBreakTests() { // diff --git a/src/libraries/System.Threading.Tasks.Parallel/tests/RangePartitioner1Chunk.cs b/src/libraries/System.Threading.Tasks.Parallel/tests/RangePartitioner1Chunk.cs index 02695b75242409..b7eece1c2de61d 100644 --- a/src/libraries/System.Threading.Tasks.Parallel/tests/RangePartitioner1Chunk.cs +++ b/src/libraries/System.Threading.Tasks.Parallel/tests/RangePartitioner1Chunk.cs @@ -101,7 +101,6 @@ static void oneMoveNext(int length, bool isOrderable) /// /// [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void IterationsWithDependency() { static void iterationsWithDependency(int length, int dependencyIndex) @@ -167,7 +166,6 @@ public static void PFEDisposeEnum() /// Exception is expected and the enumerators are disposed /// [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91581", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void ExceptionOnMoveNext() { static void exceptionOnMoveNext(int length, int indexToThrow, bool isOrderable) diff --git a/src/libraries/System.Threading.Tasks.Parallel/tests/RangePartitionerTests.cs b/src/libraries/System.Threading.Tasks.Parallel/tests/RangePartitionerTests.cs index 3302c9b3b73831..87e427d0837ece 100644 --- a/src/libraries/System.Threading.Tasks.Parallel/tests/RangePartitionerTests.cs +++ b/src/libraries/System.Threading.Tasks.Parallel/tests/RangePartitionerTests.cs @@ -10,7 +10,6 @@ namespace System.Threading.Tasks.Tests public static class RangePartitionerTests { [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void RunPartitionerStaticTest_SingleChunking() { CountdownEvent cde = new CountdownEvent(2); diff --git a/src/libraries/System.Threading.Timer/tests/TimerChangeTests.cs b/src/libraries/System.Threading.Timer/tests/TimerChangeTests.cs index b165796005b948..fdd62265a1680d 100644 --- a/src/libraries/System.Threading.Timer/tests/TimerChangeTests.cs +++ b/src/libraries/System.Threading.Timer/tests/TimerChangeTests.cs @@ -50,7 +50,6 @@ public void Timer_Change_AfterDispose_Test() } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91545", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(0)] [InlineData(1)] [InlineData(2)] diff --git a/src/libraries/System.Threading.Timer/tests/TimerDisposeTests.cs b/src/libraries/System.Threading.Timer/tests/TimerDisposeTests.cs index 0e00bd468563ce..81cf68b4f2c6d8 100644 --- a/src/libraries/System.Threading.Timer/tests/TimerDisposeTests.cs +++ b/src/libraries/System.Threading.Timer/tests/TimerDisposeTests.cs @@ -50,7 +50,6 @@ public void DisposeAsync_SignalsImmediatelyWhenTaskNotRunning() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91545", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task DisposeAsync_DisposeDelayedUntilCallbacksComplete() { using (var b = new Barrier(2)) @@ -73,7 +72,6 @@ public async Task DisposeAsync_DisposeDelayedUntilCallbacksComplete() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91545", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task DisposeAsync_MultipleDisposesBeforeCompletionReturnSameTask() { using (var b = new Barrier(2)) @@ -99,7 +97,6 @@ public async Task DisposeAsync_MultipleDisposesBeforeCompletionReturnSameTask() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91545", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task DisposeAsync_AfterDisposeWorks() { using (var b = new Barrier(2)) @@ -123,7 +120,6 @@ public async Task DisposeAsync_AfterDisposeWorks() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91545", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task DisposeAsync_AfterDisposeWaitHandleThrows() { using (var b = new Barrier(2)) @@ -146,7 +142,6 @@ public async Task DisposeAsync_AfterDisposeWaitHandleThrows() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91545", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public async Task DisposeAsync_ThenDisposeWaitHandleReturnsFalse() { using (var b = new Barrier(2)) diff --git a/src/libraries/System.Threading.Timer/tests/TimerFiringTests.cs b/src/libraries/System.Threading.Timer/tests/TimerFiringTests.cs index b9d6f3cee554a9..046de9ad6fb1d4 100644 --- a/src/libraries/System.Threading.Timer/tests/TimerFiringTests.cs +++ b/src/libraries/System.Threading.Timer/tests/TimerFiringTests.cs @@ -17,7 +17,6 @@ public class TimerFiringTests internal const int MaxPositiveTimeoutInMs = 30000; [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91545", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void Timer_Fires_After_DueTime_Ellapses() { AutoResetEvent are = new AutoResetEvent(false); @@ -32,7 +31,6 @@ public void Timer_Fires_After_DueTime_Ellapses() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91545", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void Timer_Fires_AndPassesStateThroughCallback() { AutoResetEvent are = new AutoResetEvent(false); @@ -49,7 +47,6 @@ public void Timer_Fires_AndPassesStateThroughCallback() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91545", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void Timer_Fires_AndPassesNullStateThroughCallback() { AutoResetEvent are = new AutoResetEvent(false); @@ -125,7 +122,6 @@ public void Timer_ChangeToDelete_DoesntFire() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91545", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void Timer_CanDisposeSelfInCallback() { Timer t = null; @@ -153,7 +149,6 @@ public void Timer_CanBeDisposedMultipleTimes() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91545", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void NonRepeatingTimer_ThatHasAlreadyFired_CanChangeAndFireAgain() { AutoResetEvent are = new AutoResetEvent(false); @@ -168,7 +163,6 @@ public void NonRepeatingTimer_ThatHasAlreadyFired_CanChangeAndFireAgain() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91545", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void MultpleTimers_PeriodicTimerIsntBlockedByBlockedCallback() { int callbacks = 2; @@ -189,7 +183,6 @@ public void MultpleTimers_PeriodicTimerIsntBlockedByBlockedCallback() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91545", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void ManyTimers_EachTimerDoesFire() { int maxTimers = 10000; @@ -207,7 +200,6 @@ public void ManyTimers_EachTimerDoesFire() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91545", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void Timer_Constructor_CallbackOnly_Change() { var e = new ManualResetEvent(false); @@ -225,7 +217,6 @@ public void Timer_Dispose_WaitHandle_Negative() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91545", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void Timer_Dispose_WaitHandle() { int tickCount = 0; @@ -371,7 +362,6 @@ orderby groupedByDueTime.Key } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91545", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void TimersCreatedConcurrentlyOnDifferentThreadsAllFire() { int processorCount = Environment.ProcessorCount; diff --git a/src/libraries/System.Threading/tests/AutoResetEventTests.cs b/src/libraries/System.Threading/tests/AutoResetEventTests.cs index 7a9ea944d79023..e79a5719664acc 100644 --- a/src/libraries/System.Threading/tests/AutoResetEventTests.cs +++ b/src/libraries/System.Threading/tests/AutoResetEventTests.cs @@ -205,7 +205,6 @@ public void WaitHandleWaitAny() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void PingPong() { using (AutoResetEvent are1 = new AutoResetEvent(true), are2 = new AutoResetEvent(false)) diff --git a/src/libraries/System.Threading/tests/BarrierTests.cs b/src/libraries/System.Threading/tests/BarrierTests.cs index 438c1115c997ae..c6b8640cb58d29 100644 --- a/src/libraries/System.Threading/tests/BarrierTests.cs +++ b/src/libraries/System.Threading/tests/BarrierTests.cs @@ -292,7 +292,6 @@ public static void RunBarrierTest7a() /// /// True if the test succeeded, false otherwise [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void RunBarrierTest8_PostPhaseException() { bool shouldThrow = true; diff --git a/src/libraries/System.Threading/tests/ExecutionContextTests.cs b/src/libraries/System.Threading/tests/ExecutionContextTests.cs index b5f097ed88dead..178a6dc1794170 100644 --- a/src/libraries/System.Threading/tests/ExecutionContextTests.cs +++ b/src/libraries/System.Threading/tests/ExecutionContextTests.cs @@ -11,7 +11,6 @@ namespace System.Threading.Tests public static class ExecutionContextTests { [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void CreateCopyTest() { ThreadTestHelpers.RunTestInBackgroundThread(() => @@ -63,7 +62,6 @@ public static void DisposeTest() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void FlowTest() { ThreadTestHelpers.RunTestInBackgroundThread(() => @@ -181,7 +179,6 @@ public static void FlowTest() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void CaptureThenSuppressThenRunFlowTest() { ThreadTestHelpers.RunTestInBackgroundThread(() => @@ -268,7 +265,6 @@ private static void VerifyExecutionContextFlow(AsyncLocal asyncLocal, int e } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void AsyncFlowControlTest() { ThreadTestHelpers.RunTestInBackgroundThread(() => diff --git a/src/libraries/System.Threading/tests/HostExecutionContextManagerTests.cs b/src/libraries/System.Threading/tests/HostExecutionContextManagerTests.cs index 64473b11bbb668..def163c73e6089 100644 --- a/src/libraries/System.Threading/tests/HostExecutionContextManagerTests.cs +++ b/src/libraries/System.Threading/tests/HostExecutionContextManagerTests.cs @@ -8,7 +8,6 @@ namespace System.Threading.Tests public static class HostExecutionContextManagerTests { [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void BasicTest() { ThreadTestHelpers.RunTestInBackgroundThread(() => diff --git a/src/libraries/System.Threading/tests/InterlockedTests.cs b/src/libraries/System.Threading/tests/InterlockedTests.cs index 6e2d4c99cacc8d..933404fdbfd76f 100644 --- a/src/libraries/System.Threading/tests/InterlockedTests.cs +++ b/src/libraries/System.Threading/tests/InterlockedTests.cs @@ -461,7 +461,6 @@ public void InterlockedOr_UInt64() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void InterlockedIncrement_Multithreaded_Int32() { const int ThreadCount = 10; @@ -499,7 +498,6 @@ public void InterlockedIncrement_Multithreaded_Int32() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void InterlockedCompareExchange_Multithreaded_Double() { const int ThreadCount = 10; @@ -548,7 +546,6 @@ public void InterlockedCompareExchange_Multithreaded_Double() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void InterlockedAddAndRead_Multithreaded_Int64() { const int ThreadCount = 10; @@ -624,7 +621,6 @@ public void MemoryBarrierIntrinsic() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void MemoryBarrierProcessWide() { // Stress MemoryBarrierProcessWide correctness using a simple AsymmetricLock diff --git a/src/libraries/System.Threading/tests/ManualResetEventTests.cs b/src/libraries/System.Threading/tests/ManualResetEventTests.cs index 67667605c9e089..d75930ae5d3b35 100644 --- a/src/libraries/System.Threading/tests/ManualResetEventTests.cs +++ b/src/libraries/System.Threading/tests/ManualResetEventTests.cs @@ -148,7 +148,6 @@ public void WaitHandleWaitAny() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void PingPong() { using (ManualResetEvent mre1 = new ManualResetEvent(true), mre2 = new ManualResetEvent(false)) diff --git a/src/libraries/System.Threading/tests/MonitorTests.cs b/src/libraries/System.Threading/tests/MonitorTests.cs index 50074a1e241096..b596522385e73b 100644 --- a/src/libraries/System.Threading/tests/MonitorTests.cs +++ b/src/libraries/System.Threading/tests/MonitorTests.cs @@ -65,7 +65,6 @@ public static void IsEntered() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void IsEntered_WhenHeldBySomeoneElse_ThrowsSynchronizationLockException() { var obj = new object(); @@ -217,7 +216,6 @@ public static void TryEnter_Invalid() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void Enter_HasToWait() { var thinLock = new object(); @@ -416,7 +414,6 @@ public static void Wait_Invalid() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void WaitTest() { var obj = new object(); @@ -453,7 +450,6 @@ public static void WaitTest() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void Enter_HasToWait_LockContentionCountTest() { long initialLockContentionCount = Monitor.LockContentionCount; @@ -462,7 +458,6 @@ public static void Enter_HasToWait_LockContentionCountTest() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void ObjectHeaderSyncBlockTransitionTryEnterRaceTest() { var threadStarted = new AutoResetEvent(false); diff --git a/src/libraries/System.Threading/tests/MutexTests.cs b/src/libraries/System.Threading/tests/MutexTests.cs index cba95a622af7a4..6b06baeb760344 100644 --- a/src/libraries/System.Threading/tests/MutexTests.cs +++ b/src/libraries/System.Threading/tests/MutexTests.cs @@ -202,7 +202,6 @@ public void MultiWaitWithAllIndexesLockedTest() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void MutualExclusionTest() { var threadLocked = new AutoResetEvent(false); @@ -287,7 +286,6 @@ public void Ctor_TryCreateGlobalMutexTest_Uwp() } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [MemberData(nameof(GetValidNames))] public void OpenExisting(string name) { @@ -423,7 +421,6 @@ public static IEnumerable AbandonExisting_MemberData() } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91547", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [MemberData(nameof(AbandonExisting_MemberData))] public void AbandonExisting( string name, @@ -664,7 +661,6 @@ private static void IncrementValueInFileNTimes(Mutex mutex, string fileName, int } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void NamedMutex_ThreadExitDisposeRaceTest() { var mutexName = Guid.NewGuid().ToString("N"); @@ -725,7 +721,6 @@ public void NamedMutex_ThreadExitDisposeRaceTest() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void NamedMutex_DisposeWhenLockedRaceTest() { var mutexName = Guid.NewGuid().ToString("N"); diff --git a/src/libraries/System.Threading/tests/ReaderWriterLockSlimTests.cs b/src/libraries/System.Threading/tests/ReaderWriterLockSlimTests.cs index efd4abafc19c0d..d4569737e35078 100644 --- a/src/libraries/System.Threading/tests/ReaderWriterLockSlimTests.cs +++ b/src/libraries/System.Threading/tests/ReaderWriterLockSlimTests.cs @@ -177,7 +177,6 @@ public static void DeadlockAvoidance() } [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(LockRecursionPolicy.NoRecursion)] [InlineData(LockRecursionPolicy.SupportsRecursion)] public static void InvalidExits(LockRecursionPolicy policy) @@ -322,7 +321,6 @@ public static void ReadersMayBeConcurrent() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void WriterToWriterChain() { using (AutoResetEvent are = new AutoResetEvent(false)) @@ -343,7 +341,6 @@ public static void WriterToWriterChain() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void WriterToReaderChain() { using (AutoResetEvent are = new AutoResetEvent(false)) @@ -364,7 +361,6 @@ public static void WriterToReaderChain() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void WriterToUpgradeableReaderChain() { using (AutoResetEvent are = new AutoResetEvent(false)) diff --git a/src/libraries/System.Threading/tests/ReaderWriterLockTests.cs b/src/libraries/System.Threading/tests/ReaderWriterLockTests.cs index 2775fccde7042c..3ee587edc6318c 100644 --- a/src/libraries/System.Threading/tests/ReaderWriterLockTests.cs +++ b/src/libraries/System.Threading/tests/ReaderWriterLockTests.cs @@ -87,7 +87,6 @@ public static void ShouldNotBeOwnerForRestoreLockTest() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void InvalidLockCookieTest() { // Invalid lock cookie created by using one up with Upgrade/Downgrade @@ -123,7 +122,6 @@ public static void InvalidLockCookieTest() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void BasicLockTest() { var trwl = new TestReaderWriterLock(); @@ -501,7 +499,6 @@ public static void DowngradeQuirks_ChangedInDotNetCore() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void WaitingReadersTest() { var trwl = new TestReaderWriterLock(); @@ -532,7 +529,6 @@ public static void WaitingReadersTest() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void WaitingWritersTest() { var trwl = new TestReaderWriterLock(); @@ -564,7 +560,6 @@ public static void WaitingWritersTest() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void ReadersWaitingOnWaitingWriterTest() { var trwl = new TestReaderWriterLock(); @@ -615,7 +610,6 @@ public static void ReadersWaitingOnWaitingWriterTest() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void ReadersWaitingOnWaitingUpgraderTest() { var trwl = new TestReaderWriterLock(); @@ -669,7 +663,6 @@ public static void ReadersWaitingOnWaitingUpgraderTest() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void WaitingUpgradersTest() { var trwl = new TestReaderWriterLock(); @@ -715,7 +708,6 @@ public static void WaitingUpgradersTest() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void AtomicRecursiveReaderTest() { var trwl = new TestReaderWriterLock(); @@ -742,7 +734,6 @@ public static void AtomicRecursiveReaderTest() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void AtomicDowngradeTest() { var trwl = new TestReaderWriterLock(); diff --git a/src/libraries/System.Threading/tests/SemaphoreSlimTests.cs b/src/libraries/System.Threading/tests/SemaphoreSlimTests.cs index 4c2c5cc53a5249..7aabd01c39f1e2 100644 --- a/src/libraries/System.Threading/tests/SemaphoreSlimTests.cs +++ b/src/libraries/System.Threading/tests/SemaphoreSlimTests.cs @@ -72,7 +72,6 @@ public static void RunSemaphoreSlimTest1_Wait_NegativeCases() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void RunSemaphoreSlimTest1_WaitAsync() { // Infinite timeout @@ -91,7 +90,6 @@ public static void RunSemaphoreSlimTest1_WaitAsync() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void RunSemaphoreSlimTest1_WaitAsync_NegativeCases() { // Invalid timeout @@ -464,7 +462,6 @@ private static void RunSemaphoreSlimTest7_AvailableWaitHandle_Helper(int initial /// The final semaphore count /// True if the test succeeded, false otherwise [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(5, 1000, 50, 50, 50, 0, 5, 1000)] [InlineData(0, 1000, 50, 25, 25, 25, 0, 500)] [InlineData(0, 1000, 50, 0, 0, 50, 0, 100)] @@ -531,7 +528,6 @@ public static void RunSemaphoreSlimTest8_ConcWaitAndRelease(int initial, int max /// The final semaphore count /// True if the test succeeded, false otherwise [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [InlineData(5, 1000, 50, 50, 50, 0, 5, 500)] [InlineData(0, 1000, 50, 25, 25, 25, 0, 500)] [InlineData(0, 1000, 50, 0, 0, 50, 0, 100)] diff --git a/src/libraries/System.Threading/tests/SemaphoreTests.cs b/src/libraries/System.Threading/tests/SemaphoreTests.cs index 3c1fd77c54e239..200728cfb9406f 100644 --- a/src/libraries/System.Threading/tests/SemaphoreTests.cs +++ b/src/libraries/System.Threading/tests/SemaphoreTests.cs @@ -278,7 +278,6 @@ public void CanWaitWithoutBlockingForReleasedCount() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/49890", TestPlatforms.Android)] public void AnonymousProducerConsumer() { diff --git a/src/libraries/System.Threading/tests/SpinLockTests.cs b/src/libraries/System.Threading/tests/SpinLockTests.cs index f07d4edcdf5480..5b027b32a58430 100644 --- a/src/libraries/System.Threading/tests/SpinLockTests.cs +++ b/src/libraries/System.Threading/tests/SpinLockTests.cs @@ -13,7 +13,6 @@ namespace System.Threading.Tests public class SpinLockTests { [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void EnterExit() { var sl = new SpinLock(); diff --git a/src/libraries/System.Threading/tests/ThreadLocalTests.cs b/src/libraries/System.Threading/tests/ThreadLocalTests.cs index 323686f736554b..1327d768e1babf 100644 --- a/src/libraries/System.Threading/tests/ThreadLocalTests.cs +++ b/src/libraries/System.Threading/tests/ThreadLocalTests.cs @@ -60,7 +60,6 @@ public static void RunThreadLocalTest3_IsValueCreated() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void RunThreadLocalTest4_Value() { ThreadLocal tlocal = null; @@ -357,7 +356,6 @@ public static void RunThreadLocalTest8_Values_NegativeCases() } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void RunThreadLocalTest9_Uninitialized() { for (int iter = 0; iter < 10; iter++) @@ -440,7 +438,6 @@ public static void ValuesGetterDoesNotThrowUnexpectedExceptionWhenDisposed() private enum UniqueEnumUsedOnlyWithNonInterferenceTest { True, False } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public static void TestUnrelatedThreadLocalDoesNotInterfereWithTrackAllValues() { ThreadLocal localThatDoesNotTrackValues = new ThreadLocal(false); diff --git a/src/libraries/System.Transactions.Local/tests/AsyncTransactionScopeTests.cs b/src/libraries/System.Transactions.Local/tests/AsyncTransactionScopeTests.cs index ac8feb13d492cf..ff5c050292fcff 100644 --- a/src/libraries/System.Transactions.Local/tests/AsyncTransactionScopeTests.cs +++ b/src/libraries/System.Transactions.Local/tests/AsyncTransactionScopeTests.cs @@ -437,7 +437,6 @@ public void AsyncTSTest(int variation) [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] [InlineData(true, false, null)] [InlineData(true, true, null)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void AsyncTSAndDependantClone(bool requiresNew, bool synchronizeScope, string txId) { string txId1 = null; @@ -528,7 +527,6 @@ public void AsyncTSAndDependantClone(bool requiresNew, bool synchronizeScope, st [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] [InlineData(true, false, null)] [InlineData(true, true, null)] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91541", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void NestedAsyncTSAndDependantClone(bool parentrequiresNew, bool childRequiresNew, string txId) { string txId1; @@ -1109,7 +1107,6 @@ public void VerifyBYOT(TransactionScopeAsyncFlowOption asyncFlowOption) } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] public void VerifyBYOTOpenConnSimulationTest() { // Create threads to do work From ce1264c3cc94e678ebdb52e1357fcda7b0ed58f1 Mon Sep 17 00:00:00 2001 From: Buyaa Namnan Date: Fri, 27 Oct 2023 08:38:21 -0700 Subject: [PATCH 06/47] Abstract out LocalBuilder, emit Locals with new ILGenerator (#93809) * Abstract LocalBuilder, emit LocalBuilder in ILGenerator * Apply suggestions from code review Co-authored-by: Aaron Robinson * Remove public LocalBuilder.Method, and apply other feedback * Avoid invalid cast exception. Co-authored-by: Jan Kotas --------- Co-authored-by: Aaron Robinson Co-authored-by: Jan Kotas --- .../System.Private.CoreLib.csproj | 2 +- .../Reflection/Emit/DynamicILGenerator.cs | 4 +- .../Reflection/Emit/RuntimeILGenerator.cs | 6 +- ...LocalBuilder.cs => RuntimeLocalBuilder.cs} | 15 +- .../src/System.Private.CoreLib.csproj | 1 - .../System/Reflection/Emit/LocalBuilder.cs | 37 ---- .../System.Private.CoreLib.Shared.projitems | 3 +- .../System/Reflection/Emit/LocalBuilder.cs | 16 ++ .../System.Reflection.Emit.ILGeneration.cs | 4 +- .../src/Resources/Strings.resx | 3 + .../src/System.Reflection.Emit.csproj | 1 + .../System/Reflection/Emit/ILGeneratorImpl.cs | 46 ++++- .../Reflection/Emit/LocalBuilderImpl.cs | 35 ++++ .../Reflection/Emit/ModuleBuilderImpl.cs | 10 +- .../System/Reflection/Emit/SignatureHelper.cs | 15 ++ .../AssemblySaveILGeneratorTests.cs | 185 +++++++++++++++++- .../System.Private.CoreLib.csproj | 2 +- .../Emit/RuntimeILGenerator.Mono.cs | 12 +- ...er.Mono.cs => RuntimeLocalBuilder.Mono.cs} | 6 +- 19 files changed, 326 insertions(+), 77 deletions(-) rename src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/{LocalBuilder.cs => RuntimeLocalBuilder.cs} (69%) delete mode 100644 src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Emit/LocalBuilder.cs create mode 100644 src/libraries/System.Private.CoreLib/src/System/Reflection/Emit/LocalBuilder.cs create mode 100644 src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/LocalBuilderImpl.cs rename src/mono/System.Private.CoreLib/src/System/Reflection/Emit/{LocalBuilder.Mono.cs => RuntimeLocalBuilder.Mono.cs} (93%) diff --git a/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj index 20073739b2bbd0..377157b7091670 100644 --- a/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj +++ b/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj @@ -162,7 +162,6 @@ - @@ -170,6 +169,7 @@ + diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/DynamicILGenerator.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/DynamicILGenerator.cs index 81372c76ce2ec8..0c920d1ea12bdc 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/DynamicILGenerator.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/DynamicILGenerator.cs @@ -36,14 +36,14 @@ public override LocalBuilder DeclareLocal(Type localType, bool pinned) { ArgumentNullException.ThrowIfNull(localType); - LocalBuilder localBuilder; + RuntimeLocalBuilder localBuilder; RuntimeType? rtType = localType as RuntimeType; if (rtType == null) throw new ArgumentException(SR.Argument_MustBeRuntimeType); - localBuilder = new LocalBuilder(m_localCount, localType, m_methodBuilder, pinned); + localBuilder = new RuntimeLocalBuilder(m_localCount, localType, m_methodBuilder, pinned); // add the localType to local signature m_localSignature.AddArgument(localType, pinned); m_localCount++; diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeILGenerator.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeILGenerator.cs index e176ac2cf0e894..b8992dbe5d29b3 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeILGenerator.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeILGenerator.cs @@ -819,8 +819,8 @@ public override void Emit(OpCode opcode, LocalBuilder local) ArgumentNullException.ThrowIfNull(local); // Puts the opcode onto the IL stream followed by the information for local variable local. - int tempVal = local.GetLocalIndex(); - if (local.GetMethodBuilder() != m_methodBuilder) + int tempVal = local.LocalIndex; + if (local is not RuntimeLocalBuilder localBuilder || localBuilder.GetMethodBuilder() != m_methodBuilder) { throw new ArgumentException(SR.Argument_UnmatchedMethodForLocal, nameof(local)); } @@ -1185,7 +1185,7 @@ public override LocalBuilder DeclareLocal(Type localType, bool pinned) // add the localType to local signature m_localSignature.AddArgument(localType, pinned); - return new LocalBuilder(m_localCount++, localType, methodBuilder, pinned); + return new RuntimeLocalBuilder(m_localCount++, localType, methodBuilder, pinned); } public override void UsingNamespace(string usingNamespace) diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/LocalBuilder.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeLocalBuilder.cs similarity index 69% rename from src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/LocalBuilder.cs rename to src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeLocalBuilder.cs index 9dd4d6d5c2cfd9..e85c08daabefbe 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/LocalBuilder.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeLocalBuilder.cs @@ -3,7 +3,7 @@ namespace System.Reflection.Emit { - public sealed class LocalBuilder : LocalVariableInfo + internal sealed class RuntimeLocalBuilder : LocalBuilder { #region Private Data Members private readonly int m_localIndex; @@ -13,9 +13,9 @@ public sealed class LocalBuilder : LocalVariableInfo #endregion #region Constructor - internal LocalBuilder(int localIndex, Type localType, MethodInfo methodBuilder) + internal RuntimeLocalBuilder(int localIndex, Type localType, MethodInfo methodBuilder) : this(localIndex, localType, methodBuilder, false) { } - internal LocalBuilder(int localIndex, Type localType, MethodInfo methodBuilder, bool isPinned) + internal RuntimeLocalBuilder(int localIndex, Type localType, MethodInfo methodBuilder, bool isPinned) { m_isPinned = isPinned; m_localIndex = localIndex; @@ -25,14 +25,7 @@ internal LocalBuilder(int localIndex, Type localType, MethodInfo methodBuilder, #endregion #region Internal Members - internal int GetLocalIndex() - { - return m_localIndex; - } - internal MethodInfo GetMethodBuilder() - { - return m_methodBuilder; - } + internal MethodInfo GetMethodBuilder() => m_methodBuilder; #endregion #region LocalVariableInfo Override diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System.Private.CoreLib.csproj b/src/coreclr/nativeaot/System.Private.CoreLib/src/System.Private.CoreLib.csproj index a007a3ed7fbba5..ec3a3363a511a7 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System.Private.CoreLib.csproj +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System.Private.CoreLib.csproj @@ -144,7 +144,6 @@ - diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Emit/LocalBuilder.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Emit/LocalBuilder.cs deleted file mode 100644 index 2d1afc04d5b730..00000000000000 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Emit/LocalBuilder.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -namespace System.Reflection.Emit -{ - public sealed class LocalBuilder : LocalVariableInfo - { - internal LocalBuilder() - { - // Prevent generating a default constructor - } - - public override bool IsPinned - { - get - { - return default; - } - } - - public override int LocalIndex - { - get - { - return default; - } - } - - public override Type LocalType - { - get - { - return default; - } - } - } -} diff --git a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems index ed3325afbec528..b27a43992e2ce7 100644 --- a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems +++ b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems @@ -418,7 +418,6 @@ - @@ -674,7 +673,9 @@ + + diff --git a/src/libraries/System.Private.CoreLib/src/System/Reflection/Emit/LocalBuilder.cs b/src/libraries/System.Private.CoreLib/src/System/Reflection/Emit/LocalBuilder.cs new file mode 100644 index 00000000000000..7c38c287bf22b5 --- /dev/null +++ b/src/libraries/System.Private.CoreLib/src/System/Reflection/Emit/LocalBuilder.cs @@ -0,0 +1,16 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace System.Reflection.Emit +{ + public abstract class LocalBuilder : LocalVariableInfo + { + /// + /// Initializes a new instance of the class. + /// + /// + /// This constructor is invoked by derived classes. + /// + protected LocalBuilder() { } + } +} diff --git a/src/libraries/System.Reflection.Emit.ILGeneration/ref/System.Reflection.Emit.ILGeneration.cs b/src/libraries/System.Reflection.Emit.ILGeneration/ref/System.Reflection.Emit.ILGeneration.cs index e549331571dba1..f79ee4288df6ce 100644 --- a/src/libraries/System.Reflection.Emit.ILGeneration/ref/System.Reflection.Emit.ILGeneration.cs +++ b/src/libraries/System.Reflection.Emit.ILGeneration/ref/System.Reflection.Emit.ILGeneration.cs @@ -67,9 +67,9 @@ public virtual void ThrowException([System.Diagnostics.CodeAnalysis.DynamicallyA public static bool operator ==(System.Reflection.Emit.Label a, System.Reflection.Emit.Label b) { throw null; } public static bool operator !=(System.Reflection.Emit.Label a, System.Reflection.Emit.Label b) { throw null; } } - public sealed partial class LocalBuilder : System.Reflection.LocalVariableInfo + public abstract class LocalBuilder : System.Reflection.LocalVariableInfo { - internal LocalBuilder() { } + protected LocalBuilder() { } public override bool IsPinned { get { throw null; } } public override int LocalIndex { get { throw null; } } public override System.Type LocalType { get { throw null; } } diff --git a/src/libraries/System.Reflection.Emit/src/Resources/Strings.resx b/src/libraries/System.Reflection.Emit/src/Resources/Strings.resx index cc67be68a05b95..e425a272ac097f 100644 --- a/src/libraries/System.Reflection.Emit/src/Resources/Strings.resx +++ b/src/libraries/System.Reflection.Emit/src/Resources/Strings.resx @@ -186,6 +186,9 @@ Method body should not exist. + + Local passed in does not belong to this ILGenerator. + Invalid Label. diff --git a/src/libraries/System.Reflection.Emit/src/System.Reflection.Emit.csproj b/src/libraries/System.Reflection.Emit/src/System.Reflection.Emit.csproj index 3c6273439966ac..03b448b163bc71 100644 --- a/src/libraries/System.Reflection.Emit/src/System.Reflection.Emit.csproj +++ b/src/libraries/System.Reflection.Emit/src/System.Reflection.Emit.csproj @@ -12,6 +12,7 @@ + diff --git a/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/ILGeneratorImpl.cs b/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/ILGeneratorImpl.cs index eb9d5f70a81dc7..e7331233adb3dc 100644 --- a/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/ILGeneratorImpl.cs +++ b/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/ILGeneratorImpl.cs @@ -17,6 +17,7 @@ internal sealed class ILGeneratorImpl : ILGenerator private bool _hasDynamicStackAllocation; private int _maxStackSize; private int _currentStack; + private List _locals = new(); private Dictionary _labelTable = new(2); internal ILGeneratorImpl(MethodBuilder methodBuilder, int size) @@ -28,9 +29,9 @@ internal ILGeneratorImpl(MethodBuilder methodBuilder, int size) } internal int GetMaxStackSize() => _maxStackSize; - internal InstructionEncoder Instructions => _il; internal bool HasDynamicStackAllocation => _hasDynamicStackAllocation; + internal List Locals => _locals; public override int ILOffset => _il.Offset; @@ -40,7 +41,19 @@ internal ILGeneratorImpl(MethodBuilder methodBuilder, int size) public override void BeginFaultBlock() => throw new NotImplementedException(); public override void BeginFinallyBlock() => throw new NotImplementedException(); public override void BeginScope() => throw new NotImplementedException(); - public override LocalBuilder DeclareLocal(Type localType, bool pinned) => throw new NotImplementedException(); + + public override LocalBuilder DeclareLocal(Type localType, bool pinned) + { + if (_methodBuilder is not MethodBuilderImpl methodBuilder) + throw new NotSupportedException(); + + ArgumentNullException.ThrowIfNull(localType); + + LocalBuilder local = new LocalBuilderImpl(_locals.Count, localType, methodBuilder, pinned); + _locals.Add(local); + + return local; + } public override Label DefineLabel() { @@ -228,7 +241,34 @@ public override void Emit(OpCode opcode, Label[] labels) } } - public override void Emit(OpCode opcode, LocalBuilder local) => throw new NotImplementedException(); + public override void Emit(OpCode opcode, LocalBuilder local) + { + ArgumentNullException.ThrowIfNull(local); + + if (local is not LocalBuilderImpl localBuilder || localBuilder.GetMethodBuilder() != _methodBuilder) + { + throw new ArgumentException(SR.Argument_UnmatchedMethodForLocal, nameof(local)); + } + + int tempVal = local.LocalIndex; + string name = opcode.Name!; + + if (name.StartsWith("ldloca")) + { + _il.LoadLocalAddress(tempVal); + } + else if (name.StartsWith("ldloc")) + { + _il.LoadLocal(tempVal); + } + else if (name.StartsWith("stloc")) + { + _il.StoreLocal(tempVal); + } + + UpdateStackSize(opcode); + } + public override void Emit(OpCode opcode, SignatureHelper signature) => throw new NotImplementedException(); public override void Emit(OpCode opcode, FieldInfo field) => throw new NotImplementedException(); public override void Emit(OpCode opcode, MethodInfo meth) => throw new NotImplementedException(); diff --git a/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/LocalBuilderImpl.cs b/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/LocalBuilderImpl.cs new file mode 100644 index 00000000000000..fa9bffbec4345c --- /dev/null +++ b/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/LocalBuilderImpl.cs @@ -0,0 +1,35 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace System.Reflection.Emit +{ + internal sealed class LocalBuilderImpl : LocalBuilder + { + #region Private Data Members + private readonly int _localIndex; + private readonly Type _localType; + private readonly MethodInfo _method; + private readonly bool _isPinned; + #endregion + + #region Constructor + internal LocalBuilderImpl(int index, Type type, MethodInfo method, bool isPinned) + { + _isPinned = isPinned; + _localIndex = index; + _localType = type; + _method = method; + } + #endregion + + #region Internal Members + internal MethodInfo GetMethodBuilder() => _method; + #endregion + + #region LocalVariableInfo Override + public override bool IsPinned => _isPinned; + public override Type LocalType => _localType; + public override int LocalIndex => _localIndex; + #endregion + } +} diff --git a/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/ModuleBuilderImpl.cs b/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/ModuleBuilderImpl.cs index c30398046ab60e..0dde640eae2694 100644 --- a/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/ModuleBuilderImpl.cs +++ b/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/ModuleBuilderImpl.cs @@ -188,7 +188,9 @@ private void WriteMethods(TypeBuilderImpl typeBuilder, List - methodBodyEncoder.AddMethodBody( + private static int AddMethodBody(MethodBuilderImpl method, ILGeneratorImpl il, StandaloneSignatureHandle signature, MethodBodyStreamEncoder bodyEncoder) => + bodyEncoder.AddMethodBody( instructionEncoder: il.Instructions, maxStack: il.GetMaxStackSize(), - localVariablesSignature: default, // TODO + localVariablesSignature: signature, attributes: method.InitLocals ? MethodBodyAttributes.InitLocals : MethodBodyAttributes.None, hasDynamicStackAllocation: il.HasDynamicStackAllocation); diff --git a/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/SignatureHelper.cs b/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/SignatureHelper.cs index 5e00821235d997..8a165f306fbe9c 100644 --- a/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/SignatureHelper.cs +++ b/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/SignatureHelper.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.Collections.Generic; using System.Collections.Immutable; using System.Reflection.Metadata; using System.Reflection.Metadata.Ecma335; @@ -10,6 +11,20 @@ namespace System.Reflection.Emit // TODO: Only support simple signatures. More complex signatures (generics, array, byref, pointers etc) will be added. internal static class MetadataSignatureHelper { + internal static BlobBuilder LocalSignatureEncoder(List locals, ModuleBuilderImpl module) + { + BlobBuilder localSignature = new(); + LocalVariablesEncoder encoder = new BlobEncoder(localSignature).LocalVariableSignature(locals.Count); + + foreach(LocalBuilder local in locals) + { + WriteSignatureForType(encoder.AddVariable().Type(local.LocalType.IsByRef, local.IsPinned), + local.LocalType.IsByRef ? local.LocalType.GetElementType()! : local.LocalType, module); + } + + return localSignature; + } + internal static BlobBuilder FieldSignatureEncoder(Type fieldType, ModuleBuilderImpl module) { BlobBuilder fieldSignature = new(); diff --git a/src/libraries/System.Reflection.Emit/tests/PersistableAssemblyBuilder/AssemblySaveILGeneratorTests.cs b/src/libraries/System.Reflection.Emit/tests/PersistableAssemblyBuilder/AssemblySaveILGeneratorTests.cs index 31af05ed611e3a..5c5141f544c14c 100644 --- a/src/libraries/System.Reflection.Emit/tests/PersistableAssemblyBuilder/AssemblySaveILGeneratorTests.cs +++ b/src/libraries/System.Reflection.Emit/tests/PersistableAssemblyBuilder/AssemblySaveILGeneratorTests.cs @@ -3,7 +3,6 @@ using System.IO; using System.Linq; -using System.Text; using Xunit; namespace System.Reflection.Emit.Tests @@ -307,7 +306,7 @@ public void Label_SwitchCase() ILGenerator il = methodBuilder.GetILGenerator(); Label defaultCase = il.DefineLabel(); Label endOfMethod = il.DefineLabel(); - Label[] jumpTable = [ il.DefineLabel(), il.DefineLabel(), il.DefineLabel(), il.DefineLabel(), il.DefineLabel() ]; + Label[] jumpTable = [il.DefineLabel(), il.DefineLabel(), il.DefineLabel(), il.DefineLabel(), il.DefineLabel()]; // public string Method1(int P_0) => P_0 switch ... il.Emit(OpCodes.Ldarg_1); @@ -361,5 +360,187 @@ public void Label_SwitchCase() Assert.Equal(69, bodyBytes.Length); } } + + [Fact] + public void LocalBuilderMultipleLocalsUsage() + { + using (TempFile file = TempFile.Create()) + { + AssemblyBuilder ab = AssemblySaveTools.PopulateAssemblyBuilderTypeBuilderAndSaveMethod(out TypeBuilder type, out MethodInfo saveMethod); + MethodBuilder methodBuilder = type.DefineMethod("Method1", MethodAttributes.Public | MethodAttributes.Static, typeof(int), new[] { typeof(int), typeof(string) }); + ILGenerator il = methodBuilder.GetILGenerator(); + LocalBuilder intLocal = il.DeclareLocal(typeof(int)); + LocalBuilder stringLocal = il.DeclareLocal(typeof(string)); + LocalBuilder shortLocal = il.DeclareLocal(typeof(short), pinned: true); ; + LocalBuilder int2Local = il.DeclareLocal(typeof(int), pinned: false); + il.Emit(OpCodes.Ldarg, 1); + il.Emit(OpCodes.Stloc_1); + il.Emit(OpCodes.Ldstr, "string value"); + il.Emit(OpCodes.Stloc, stringLocal); + il.Emit(OpCodes.Ldloc, stringLocal); + il.Emit(OpCodes.Starg, 1); + il.Emit(OpCodes.Ldarg_0); + il.Emit(OpCodes.Stloc_0); + il.Emit(OpCodes.Ldc_I4_S, 120); + il.Emit(OpCodes.Stloc, 2); + il.Emit(OpCodes.Ldloc, shortLocal); + il.Emit(OpCodes.Ldloc, 0); + il.Emit(OpCodes.Add); + il.Emit(OpCodes.Stloc, intLocal); + il.Emit(OpCodes.Ldloca, intLocal); + il.Emit(OpCodes.Ldind_I); + il.Emit(OpCodes.Stloc, int2Local); + il.Emit(OpCodes.Ldloc_3); + il.Emit(OpCodes.Ret); + + MethodInfo getMaxStackSizeMethod = LoadILGenerator_GetMaxStackSizeMethod(); + Assert.Equal(2, getMaxStackSizeMethod.Invoke(il, new object[0])); + saveMethod.Invoke(ab, new object[] { file.Path }); + + Assembly assemblyFromDisk = AssemblySaveTools.LoadAssemblyFromPath(file.Path); + Type typeFromDisk = assemblyFromDisk.Modules.First().GetType("MyType"); + MethodBody body = typeFromDisk.GetMethod("Method1").GetMethodBody(); + Assert.Equal(4, body.LocalVariables.Count); + Assert.Equal(intLocal.LocalIndex, body.LocalVariables[0].LocalIndex); + Assert.Equal(intLocal.LocalType.FullName, body.LocalVariables[0].LocalType.FullName); + Assert.Equal(intLocal.IsPinned, body.LocalVariables[0].IsPinned); + Assert.Equal(stringLocal.LocalIndex, body.LocalVariables[1].LocalIndex); + Assert.Equal(stringLocal.LocalType.FullName, body.LocalVariables[1].LocalType.FullName); + Assert.Equal(stringLocal.IsPinned, body.LocalVariables[1].IsPinned); + Assert.Equal(shortLocal.LocalIndex, body.LocalVariables[2].LocalIndex); + Assert.Equal(shortLocal.LocalType.FullName, body.LocalVariables[2].LocalType.FullName); + Assert.Equal(shortLocal.IsPinned, body.LocalVariables[2].IsPinned); + Assert.Equal(int2Local.LocalIndex, body.LocalVariables[3].LocalIndex); + Assert.Equal(int2Local.LocalType.FullName, body.LocalVariables[3].LocalType.FullName); + Assert.Equal(int2Local.IsPinned, body.LocalVariables[3].IsPinned); + byte[]? bodyBytes = body.GetILAsByteArray(); + Assert.Equal((byte)OpCodes.Ldarg_1.Value, bodyBytes[0]); + Assert.Equal((byte)OpCodes.Stloc_1.Value, bodyBytes[1]); + Assert.Equal((byte)OpCodes.Ldstr.Value, bodyBytes[2]); + Assert.Equal((byte)OpCodes.Stloc_1.Value, bodyBytes[7]); + Assert.Equal((byte)OpCodes.Ldloc_1.Value, bodyBytes[8]); + Assert.Equal((byte)OpCodes.Starg_S.Value, bodyBytes[9]); + Assert.Equal((byte)OpCodes.Ldarg_0.Value, bodyBytes[11]); + Assert.Equal((byte)OpCodes.Stloc_0.Value, bodyBytes[12]); + Assert.Equal((byte)OpCodes.Ldc_I4_S.Value, bodyBytes[13]); + Assert.Equal(120, BitConverter.ToInt32(bodyBytes.AsSpan().Slice(14, 4))); + Assert.Equal(0xFE, bodyBytes[18]); // Stloc instruction occupies 2 bytes 0xfe0e + Assert.Equal(0x0E, bodyBytes[19]); + Assert.Equal(2, BitConverter.ToInt32(bodyBytes.AsSpan().Slice(20, 4))); // index 2 of 'il.Emit(OpCodes.Stloc, 2);' instruction + Assert.Equal((byte)OpCodes.Ldloc_2.Value, bodyBytes[24]); + Assert.Equal(0xFE, bodyBytes[25]); // Ldloc = 0xfe0c + Assert.Equal(0x0C, bodyBytes[26]); + Assert.Equal(0, BitConverter.ToInt32(bodyBytes.AsSpan().Slice(27, 4))); // index 0 of 'il.Emit(OpCodes.Ldloc, 0);' instruction + Assert.Equal((byte)OpCodes.Add.Value, bodyBytes[31]); + Assert.Equal((byte)OpCodes.Stloc_0.Value, bodyBytes[32]); + Assert.Equal((byte)OpCodes.Ldloca_S.Value, bodyBytes[33]); + Assert.Equal(0, bodyBytes[34]); // intLocal index is 0 for 'il.Emit(OpCodes.Ldloca, intLocal);' instruction + Assert.Equal((byte)OpCodes.Ldind_I.Value, bodyBytes[35]); + Assert.Equal((byte)OpCodes.Stloc_3.Value, bodyBytes[36]); + Assert.Equal((byte)OpCodes.Ldloc_3.Value, bodyBytes[37]); + Assert.Equal(OpCodes.Ret.Value, bodyBytes[38]); + } + } + + [Fact] + public void LocalBuilderMultipleTypesWithMultipleMethodsWithLocals() + { + using (TempFile file = TempFile.Create()) + { + AssemblyBuilder ab = AssemblySaveTools.PopulateAssemblyBuilderTypeBuilderAndSaveMethod(out TypeBuilder type, out MethodInfo saveMethod); + MethodBuilder methodBuilder = type.DefineMethod("Method1", MethodAttributes.Public | MethodAttributes.Static, typeof(string), new[] { typeof(int), typeof(string) }); + ILGenerator il = methodBuilder.GetILGenerator(); + LocalBuilder intLocal = il.DeclareLocal(typeof(int)); + LocalBuilder stringLocal = il.DeclareLocal(typeof(string)); + LocalBuilder shortLocal = il.DeclareLocal(typeof(short)); + il.Emit(OpCodes.Ldstr, "string value"); + il.Emit(OpCodes.Stloc, stringLocal); + il.Emit(OpCodes.Ldloc, stringLocal); + il.Emit(OpCodes.Starg, 1); + il.Emit(OpCodes.Ldarg_0); + il.Emit(OpCodes.Stloc_0); + il.Emit(OpCodes.Ldc_I4_S, 120); + il.Emit(OpCodes.Stloc, 2); + il.Emit(OpCodes.Ldloc, shortLocal); + il.Emit(OpCodes.Ldloc, 0); + il.Emit(OpCodes.Add); + il.Emit(OpCodes.Stloc, intLocal); + il.Emit(OpCodes.Ldloc, stringLocal); + il.Emit(OpCodes.Ret); + MethodBuilder multiplyMethod = type.DefineMethod("MultiplyMethod", MethodAttributes.Public, typeof(int), new[] { typeof(int) }); + ILGenerator multiplyMethodIL = multiplyMethod.GetILGenerator(); + LocalBuilder iLocal = multiplyMethodIL.DeclareLocal(typeof(int)); + LocalBuilder shLocal = multiplyMethodIL.DeclareLocal(typeof(short)); + multiplyMethodIL.Emit(OpCodes.Ldarg, 1); + multiplyMethodIL.Emit(OpCodes.Stloc, iLocal); + multiplyMethodIL.Emit(OpCodes.Ldloc, iLocal); + multiplyMethodIL.Emit(OpCodes.Ldc_I4_S, 11); + multiplyMethodIL.Emit(OpCodes.Stloc, shLocal); + multiplyMethodIL.Emit(OpCodes.Ldloc, shLocal); + multiplyMethodIL.Emit(OpCodes.Mul); + multiplyMethodIL.Emit(OpCodes.Stloc, iLocal); + multiplyMethodIL.Emit(OpCodes.Ldloc, iLocal); + multiplyMethodIL.Emit(OpCodes.Ret); + + TypeBuilder anotherType = ab.GetDynamicModule("MyModule").DefineType("AnotherType", TypeAttributes.NotPublic, type); + MethodBuilder stringMethod = anotherType.DefineMethod("StringMethod", MethodAttributes.FamORAssem, typeof(string), Type.EmptyTypes); + ILGenerator stringMethodIL = stringMethod.GetILGenerator(); + LocalBuilder strLocal = stringMethodIL.DeclareLocal(typeof(string)); + stringMethodIL.Emit(OpCodes.Ldstr, "Hello world!"); + stringMethodIL.Emit(OpCodes.Stloc, strLocal); + stringMethodIL.Emit(OpCodes.Ldloc, strLocal); + stringMethodIL.Emit(OpCodes.Ret); + MethodBuilder typeMethod = anotherType.DefineMethod("TypeMethod", MethodAttributes.Family, type, new[] { anotherType, type }); + ILGenerator typeMethodIL = typeMethod.GetILGenerator(); + typeMethodIL.Emit(OpCodes.Ldarg, 1); + LocalBuilder typeLocal = typeMethodIL.DeclareLocal(type); + LocalBuilder anotherTypeLocal = typeMethodIL.DeclareLocal(anotherType); + typeMethodIL.Emit(OpCodes.Stloc, anotherTypeLocal); + typeMethodIL.Emit(OpCodes.Ldloc, anotherTypeLocal); + typeMethodIL.Emit(OpCodes.Stloc, typeLocal); + typeMethodIL.Emit(OpCodes.Ldloc, typeLocal); + typeMethodIL.Emit(OpCodes.Ret); + MethodBuilder longMethod = anotherType.DefineMethod("LongMethod", MethodAttributes.Static, typeof(long), Type.EmptyTypes); + ILGenerator longMethodIL = longMethod.GetILGenerator(); + longMethodIL.Emit(OpCodes.Ldc_I8, 1234567L); + LocalBuilder longLocal = longMethodIL.DeclareLocal(typeof(long)); + LocalBuilder shiftLocal = longMethodIL.DeclareLocal(typeof(int)); + longMethodIL.Emit(OpCodes.Stloc, longLocal); + longMethodIL.Emit(OpCodes.Ldc_I4_5); + longMethodIL.Emit(OpCodes.Stloc, shiftLocal); + longMethodIL.Emit(OpCodes.Ldloc, longLocal); + longMethodIL.Emit(OpCodes.Ldloc, shiftLocal); + longMethodIL.Emit(OpCodes.Shl); + longMethodIL.Emit(OpCodes.Stloc, longLocal); + longMethodIL.Emit(OpCodes.Ldloc, longLocal); + longMethodIL.Emit(OpCodes.Ret); + + saveMethod.Invoke(ab, new object[] { file.Path }); + + Assembly assemblyFromDisk = AssemblySaveTools.LoadAssemblyFromPath(file.Path); + Module moduleFromFile = assemblyFromDisk.Modules.First(); + Type typeFromDisk = moduleFromFile.GetType("MyType"); + Assert.Equal(2, typeFromDisk.GetMethod("MultiplyMethod").GetMethodBody().LocalVariables.Count); + Assert.Equal(3, typeFromDisk.GetMethod("Method1").GetMethodBody().LocalVariables.Count); + Type anotherTypeFromDisk = moduleFromFile.GetType("AnotherType"); + Assert.Equal(1, anotherTypeFromDisk.GetMethod("StringMethod", BindingFlags.NonPublic | BindingFlags.Instance).GetMethodBody().LocalVariables.Count); + Assert.Equal(2, anotherTypeFromDisk.GetMethod("TypeMethod", BindingFlags.NonPublic | BindingFlags.Instance).GetMethodBody().LocalVariables.Count); + Assert.Equal(2, anotherTypeFromDisk.GetMethod("LongMethod", BindingFlags.NonPublic | BindingFlags.Static).GetMethodBody().LocalVariables.Count); + } + } + + [Fact] + public void LocalBuilderExceptions() + { + AssemblyBuilder ab = AssemblySaveTools.PopulateAssemblyBuilderTypeBuilderAndSaveMethod(out TypeBuilder type, out MethodInfo saveMethod); + ILGenerator il = type.DefineMethod("Method1", MethodAttributes.Public).GetILGenerator(); + ILGenerator anotherIL = type.DefineMethod("AnotherMethod", MethodAttributes.Public).GetILGenerator(); + LocalBuilder stringLocal = il.DeclareLocal(typeof(string)); + LocalBuilder nullBuilder = null; + + Assert.Throws(() => il.DeclareLocal(null!)); + Assert.Throws(() => il.Emit(OpCodes.Ldloc, nullBuilder)); + Assert.Throws(() => anotherIL.Emit(OpCodes.Ldloc, stringLocal)); + } } } diff --git a/src/mono/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/mono/System.Private.CoreLib/System.Private.CoreLib.csproj index d1f463b24c58bc..fd9cbe151fbe80 100644 --- a/src/mono/System.Private.CoreLib/System.Private.CoreLib.csproj +++ b/src/mono/System.Private.CoreLib/System.Private.CoreLib.csproj @@ -221,7 +221,6 @@ - @@ -231,6 +230,7 @@ + diff --git a/src/mono/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeILGenerator.Mono.cs b/src/mono/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeILGenerator.Mono.cs index 755c552a67b85a..ae834947bc078b 100644 --- a/src/mono/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeILGenerator.Mono.cs +++ b/src/mono/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeILGenerator.Mono.cs @@ -207,7 +207,7 @@ public LabelData(int addr, int maxStack) private int code_len; private int max_stack; private int cur_stack; - private LocalBuilder[]? locals; + private RuntimeLocalBuilder[]? locals; private ILExceptionInfo[]? ex_handlers; private int num_token_fixups; private object? token_fixups; @@ -441,19 +441,19 @@ public override LocalBuilder DeclareLocal(Type localType, bool pinned) ArgumentNullException.ThrowIfNull(localType); if (localType.IsUserType) throw new NotSupportedException(SR.PlatformNotSupported_UserDefinedSubclassesOfType); - LocalBuilder res = new LocalBuilder(localType, this); + RuntimeLocalBuilder res = new RuntimeLocalBuilder(localType, this); res.is_pinned = pinned; if (locals != null) { - LocalBuilder[] new_l = new LocalBuilder[locals.Length + 1]; + RuntimeLocalBuilder[] new_l = new RuntimeLocalBuilder[locals.Length + 1]; Array.Copy(locals, new_l, locals.Length); new_l[locals.Length] = res; locals = new_l; } else { - locals = new LocalBuilder[1]; + locals = new RuntimeLocalBuilder[1]; locals[0] = res; } res.position = (ushort)(locals.Length - 1); @@ -619,10 +619,10 @@ public override void Emit(OpCode opcode, Label[] labels) public override void Emit(OpCode opcode, LocalBuilder local) { ArgumentNullException.ThrowIfNull(local); - if (local.ilgen != this) + if (local is not RuntimeLocalBuilder localBuilder || localBuilder.ilgen != this) throw new ArgumentException(SR.Argument_UnmatchedMethodForLocal, nameof(local)); - uint pos = local.position; + uint pos = localBuilder.position; if ((opcode == OpCodes.Ldloca_S || opcode == OpCodes.Ldloc_S || opcode == OpCodes.Stloc_S) && pos > 255) throw new InvalidOperationException(SR.InvalidOperation_BadInstructionOrIndexOutOfBound); diff --git a/src/mono/System.Private.CoreLib/src/System/Reflection/Emit/LocalBuilder.Mono.cs b/src/mono/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeLocalBuilder.Mono.cs similarity index 93% rename from src/mono/System.Private.CoreLib/src/System/Reflection/Emit/LocalBuilder.Mono.cs rename to src/mono/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeLocalBuilder.Mono.cs index 017e072f7bb725..e178376470ddc7 100644 --- a/src/mono/System.Private.CoreLib/src/System/Reflection/Emit/LocalBuilder.Mono.cs +++ b/src/mono/System.Private.CoreLib/src/System/Reflection/Emit/RuntimeLocalBuilder.Mono.cs @@ -25,7 +25,7 @@ // // -// System.Reflection.Emit/LocalBuilder.cs +// System.Reflection.Emit/RuntimeLocalBuilder.cs // // Authors: // Paolo Molaro (lupus@ximian.com) @@ -41,7 +41,7 @@ namespace System.Reflection.Emit { [StructLayout(LayoutKind.Sequential)] - public sealed partial class LocalBuilder : LocalVariableInfo + internal sealed partial class RuntimeLocalBuilder : LocalBuilder { #region Sync with MonoReflectionLocalBuilder in object-internals.h internal Type type; @@ -55,7 +55,7 @@ public sealed partial class LocalBuilder : LocalVariableInfo private int endOffset; [DynamicDependency(nameof(name))] // Automatically keeps all previous fields too due to StructLayout - internal LocalBuilder(Type t, ILGenerator ilgen) + internal RuntimeLocalBuilder(Type t, ILGenerator ilgen) { this.type = t; this.ilgen = ilgen; From aae94978b78531c5155df1cef3d70b0c36bc96c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Petryka?= <35800402+MichalPetryka@users.noreply.github.com> Date: Fri, 27 Oct 2023 18:09:41 +0200 Subject: [PATCH 07/47] Interlocked intrinsic improvements (#93821) * Interlocked intrinsic improvements * Format --- .../System/Threading/Interlocked.CoreCLR.cs | 6 ++++-- src/coreclr/jit/importercalls.cpp | 20 +++++++++++-------- .../src/System/Threading/Interlocked.cs | 4 ++-- .../src/System/Threading/Interlocked.cs | 8 ++++++++ 4 files changed, 26 insertions(+), 12 deletions(-) diff --git a/src/coreclr/System.Private.CoreLib/src/System/Threading/Interlocked.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Threading/Interlocked.CoreCLR.cs index f4551e01beadaf..1bce1b45748c9d 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Threading/Interlocked.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Threading/Interlocked.CoreCLR.cs @@ -79,8 +79,9 @@ public static long Decrement(ref long location) => /// The original value of . /// The address of location1 is a null pointer. /// The type to be used for and . This type must be a reference type. - [MethodImpl(MethodImplOptions.AggressiveInlining)] + [Intrinsic] [return: NotNullIfNotNull(nameof(location1))] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T Exchange([NotNullIfNotNull(nameof(value))] ref T location1, T value) where T : class? => Unsafe.As(Exchange(ref Unsafe.As(ref location1), value)); #endregion @@ -134,8 +135,9 @@ public static T Exchange([NotNullIfNotNull(nameof(value))] ref T location1, T /// The original value in . /// The address of is a null pointer. /// The type to be used for , , and . This type must be a reference type. - [return: NotNullIfNotNull(nameof(location1))] [Intrinsic] + [return: NotNullIfNotNull(nameof(location1))] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T CompareExchange(ref T location1, T value, T comparand) where T : class? => Unsafe.As(CompareExchange(ref Unsafe.As(ref location1), value, comparand)); #endregion diff --git a/src/coreclr/jit/importercalls.cpp b/src/coreclr/jit/importercalls.cpp index ac8885aff9ec67..538c55f9fbbc05 100644 --- a/src/coreclr/jit/importercalls.cpp +++ b/src/coreclr/jit/importercalls.cpp @@ -3245,16 +3245,18 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis, case NI_System_Threading_Interlocked_CompareExchange: { var_types retType = JITtype2varType(sig->retType); - if ((retType == TYP_LONG) && (TARGET_POINTER_SIZE == 4)) + if (genTypeSize(retType) > TARGET_POINTER_SIZE) { break; } - if ((retType == TYP_REF) && impStackTop(1).val->IsIntegralConst(0)) + + if ((retType == TYP_REF) && + (impStackTop(1).val->IsIntegralConst(0) || impStackTop(1).val->IsIconHandle(GTF_ICON_OBJ_HDL))) { // Intrinsify "object" overload in case of null assignment // since we don't need the write barrier. } - else if ((retType != TYP_INT) && (retType != TYP_LONG)) + else if (!varTypeIsIntegral(retType)) { break; } @@ -3265,7 +3267,7 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis, GenTree* op3 = impPopStack().val; // comparand GenTree* op2 = impPopStack().val; // value GenTree* op1 = impPopStack().val; // location - retNode = gtNewAtomicNode(GT_CMPXCHG, genActualType(callType), op1, op2, op3); + retNode = gtNewAtomicNode(GT_CMPXCHG, callType, op1, op2, op3); break; } @@ -3276,17 +3278,19 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis, assert(sig->numArgs == 2); var_types retType = JITtype2varType(sig->retType); - if ((retType == TYP_LONG) && (TARGET_POINTER_SIZE == 4)) + if (genTypeSize(retType) > TARGET_POINTER_SIZE) { break; } - if ((retType == TYP_REF) && impStackTop().val->IsIntegralConst(0)) + + if ((retType == TYP_REF) && + (impStackTop().val->IsIntegralConst(0) || impStackTop().val->IsIconHandle(GTF_ICON_OBJ_HDL))) { // Intrinsify "object" overload in case of null assignment // since we don't need the write barrier. assert(ni == NI_System_Threading_Interlocked_Exchange); } - else if ((retType != TYP_INT) && (retType != TYP_LONG)) + else if (!varTypeIsIntegral(retType)) { break; } @@ -3300,7 +3304,7 @@ GenTree* Compiler::impIntrinsic(GenTree* newobjThis, // field_addr (for example) // retNode = gtNewAtomicNode(ni == NI_System_Threading_Interlocked_ExchangeAdd ? GT_XADD : GT_XCHG, - genActualType(callType), op1, op2); + callType, op1, op2); break; } #endif // defined(TARGET_XARCH) || defined(TARGET_ARM64) || defined(TARGET_RISCV64) diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Interlocked.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Interlocked.cs index f8a5e61ecbb65c..a81051a58ba17e 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Interlocked.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Interlocked.cs @@ -24,8 +24,8 @@ public static long CompareExchange(ref long location1, long value, long comparan } [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] [return: NotNullIfNotNull(nameof(location1))] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T CompareExchange(ref T location1, T value, T comparand) where T : class? { return Unsafe.As(RuntimeImports.InterlockedCompareExchange(ref Unsafe.As(ref location1), value, comparand)); @@ -69,8 +69,8 @@ public static long Exchange(ref long location1, long value) } [Intrinsic] - [MethodImpl(MethodImplOptions.AggressiveInlining)] [return: NotNullIfNotNull(nameof(location1))] + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T Exchange([NotNullIfNotNull(nameof(value))] ref T location1, T value) where T : class? { return Unsafe.As(RuntimeImports.InterlockedExchange(ref Unsafe.As(ref location1), value)); diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Interlocked.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Interlocked.cs index 465d7d70a35d15..c125443f2a97e4 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Interlocked.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Interlocked.cs @@ -54,6 +54,7 @@ public static ulong Decrement(ref ulong location) => /// The value to which the parameter is set. /// The original value of . /// The address of location1 is a null pointer. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static uint Exchange(ref uint location1, uint value) => @@ -64,6 +65,7 @@ public static uint Exchange(ref uint location1, uint value) => /// The value to which the parameter is set. /// The original value of . /// The address of location1 is a null pointer. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static ulong Exchange(ref ulong location1, ulong value) => @@ -92,6 +94,7 @@ public static double Exchange(ref double location1, double value) /// The value to which the parameter is set. /// The original value of . /// The address of location1 is a null pointer. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IntPtr Exchange(ref IntPtr location1, IntPtr value) { @@ -109,6 +112,7 @@ public static IntPtr Exchange(ref IntPtr location1, IntPtr value) /// The value to which the parameter is set. /// The original value of . /// The address of location1 is a null pointer. + [Intrinsic] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static UIntPtr Exchange(ref UIntPtr location1, UIntPtr value) @@ -128,6 +132,7 @@ public static UIntPtr Exchange(ref UIntPtr location1, UIntPtr value) /// The value that is compared to the value at . /// The original value in . /// The address of is a null pointer. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static uint CompareExchange(ref uint location1, uint value, uint comparand) => @@ -139,6 +144,7 @@ public static uint CompareExchange(ref uint location1, uint value, uint comparan /// The value that is compared to the value at . /// The original value in . /// The address of is a null pointer. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static ulong CompareExchange(ref ulong location1, ulong value, ulong comparand) => @@ -170,6 +176,7 @@ public static double CompareExchange(ref double location1, double value, double /// The that is compared to the value at . /// The original value in . /// The address of is a null pointer. + [Intrinsic] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static IntPtr CompareExchange(ref IntPtr location1, IntPtr value, IntPtr comparand) { @@ -188,6 +195,7 @@ public static IntPtr CompareExchange(ref IntPtr location1, IntPtr value, IntPtr /// The that is compared to the value at . /// The original value in . /// The address of is a null pointer. + [Intrinsic] [CLSCompliant(false)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static UIntPtr CompareExchange(ref UIntPtr location1, UIntPtr value, UIntPtr comparand) From 910fb046233fb2cd02ca6a81e8eacda0f9c33296 Mon Sep 17 00:00:00 2001 From: Egor Bogatov Date: Fri, 27 Oct 2023 18:10:17 +0200 Subject: [PATCH 08/47] Fold "X >= 0 && X < NN" to "X u< NN" (#93834) * Fold "X >= 0 && X < NN" to "X u< NN" * Relax to GTF_SIDE_EFFECT --- src/coreclr/jit/optimizebools.cpp | 95 ++++++++++++++++++- .../RedundantBranchUnsigned2.cs | 85 +++++++++++++++++ .../RedundantBranchUnsigned2.csproj | 8 ++ 3 files changed, 185 insertions(+), 3 deletions(-) create mode 100644 src/tests/JIT/opt/RedundantBranch/RedundantBranchUnsigned2.cs create mode 100644 src/tests/JIT/opt/RedundantBranch/RedundantBranchUnsigned2.csproj diff --git a/src/coreclr/jit/optimizebools.cpp b/src/coreclr/jit/optimizebools.cpp index 3c55cef198ab52..b587fd8fb98cd5 100644 --- a/src/coreclr/jit/optimizebools.cpp +++ b/src/coreclr/jit/optimizebools.cpp @@ -532,6 +532,96 @@ bool IsConstantRangeTest(GenTreeOp* tree, GenTree** varNode, GenTreeIntCon** cns return false; } +//------------------------------------------------------------------------------ +// FoldRangeTests: Given two compare nodes (cmp1 && cmp2) where cmp1 is X >= 0 +// and cmp2 is X < NN (NeverNegative), try to fold the range test into a single +// X u< NN (unsigned) compare node. +// +// Arguments: +// compiler - compiler instance +// cmp1 - first compare node +// cmp1IsReversed - true if cmp1 is in fact reversed +// cmp2 - second compare node +// cmp2IsReversed - true if cmp2 is in fact reversed +// +// Returns: +// true if cmp1 now represents the folded range check and cmp2 can be removed. +// +bool FoldNeverNegativeRangeTest( + Compiler* comp, GenTreeOp* cmp1, bool cmp1IsReversed, GenTreeOp* cmp2, bool cmp2IsReversed) +{ + GenTree* var1Node; + GenTreeIntCon* cns1Node; + genTreeOps cmp1Op; + + // First cmp has to be "X >= 0" (or "0 <= X") + // TODO: handle "X < NN && X >= 0" (where the 2nd comparison is the lower bound) + // It seems to be a rare case, so we don't handle it for now. + if (!IsConstantRangeTest(cmp1, &var1Node, &cns1Node, &cmp1Op)) + { + return false; + } + + // Now, reverse the comparison if necessary depending on cmp1IsReversed and cmp2IsReversed + // so we'll get a canonical form of "X >= 0 && X OperGet()) : cmp2->OperGet(); + + if ((cmp1Op != GT_GE) || (!cns1Node->IsIntegralConst(0))) + { + // Lower bound check has to be "X >= 0". + // We already re-ordered the comparison so that the constant is always on the right side. + return false; + } + + // Upper bound check has to be "X relop NN" or "NN relop X" (NN = NeverNegative) + // We allow var1Node to be a GT_COMMA node, so we need to call gtEffectiveVal() to get the actual variable + // since it's guaranteed to be evaluated first. + GenTree* upperBound; + if (cmp2->gtGetOp1()->OperIs(GT_LCL_VAR, GT_LCL_FLD) && + GenTree::Compare(var1Node->gtEffectiveVal(), cmp2->gtGetOp1())) + { + // "X relop NN" + upperBound = cmp2->gtGetOp2(); + } + else if (cmp2->gtGetOp2()->OperIs(GT_LCL_VAR, GT_LCL_FLD) && + GenTree::Compare(var1Node->gtEffectiveVal(), cmp2->gtGetOp2())) + { + // "NN relop X" + upperBound = cmp2->gtGetOp1(); + // Normalize to "X relop NN" + cmp2Op = GenTree::SwapRelop(cmp2Op); + } + else + { + return false; + } + + // Check that our upper bound is known to be never negative (e.g. GT_ARR_LENGTH or Span.Length, etc.) + if (!upperBound->IsNeverNegative(comp) || !upperBound->TypeIs(var1Node->TypeGet())) + { + return false; + } + + if ((upperBound->gtFlags & GTF_SIDE_EFFECT) != 0) + { + // We can't fold "X >= 0 && X < NN" to "X u< NN" if NN has side effects. + return false; + } + + if ((cmp2Op != GT_LT) && (cmp2Op != GT_LE)) + { + // Upper bound check has to be "X < NN" or "X <= NN" (normalized form). + return false; + } + + cmp1->gtOp1 = var1Node; + cmp1->gtOp2 = upperBound; + cmp1->SetOper(cmp2IsReversed ? GenTree::ReverseRelop(cmp2Op) : cmp2Op); + cmp1->SetUnsigned(); + return true; +} + //------------------------------------------------------------------------------ // FoldRangeTests: Given two compare nodes (cmp1 && cmp2) that represent a range check, // fold them into a single compare node if possible, e.g.: @@ -560,12 +650,11 @@ bool FoldRangeTests(Compiler* comp, GenTreeOp* cmp1, bool cmp1IsReversed, GenTre genTreeOps cmp2Op; // Make sure both conditions are constant range checks, e.g. "X > CNS" - // TODO: support more cases, e.g. "X >= 0 && X < array.Length" -> "(uint)X < array.Length" - // Basically, we can use GenTree::IsNeverNegative() for it. if (!IsConstantRangeTest(cmp1, &var1Node, &cns1Node, &cmp1Op) || !IsConstantRangeTest(cmp2, &var2Node, &cns2Node, &cmp2Op)) { - return false; + // Give FoldNeverNegativeRangeTest a try if both conditions are not constant range checks. + return FoldNeverNegativeRangeTest(comp, cmp1, cmp1IsReversed, cmp2, cmp2IsReversed); } // Reverse the comparisons if necessary so we'll get a canonical form "cond1 == true && cond2 == true" -> InRange. diff --git a/src/tests/JIT/opt/RedundantBranch/RedundantBranchUnsigned2.cs b/src/tests/JIT/opt/RedundantBranch/RedundantBranchUnsigned2.cs new file mode 100644 index 00000000000000..7612414e4d1a58 --- /dev/null +++ b/src/tests/JIT/opt/RedundantBranch/RedundantBranchUnsigned2.cs @@ -0,0 +1,85 @@ +// 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.Linq; +using System.Runtime.CompilerServices; +using Xunit; + +public class RedundantBranchUnsigned2 +{ + [Fact] + public static int TestEntryPoint() + { + int[] arr1 = new int[2]; + Test_Span1(arr1, -1); + Test_Span1(arr1, 0); + Test_Span1(arr1, 1); + Test_Span1(arr1, 2); + if (!arr1.SequenceEqual(new[] {42, 42})) + throw new Exception("Test_Span1 failed"); + + int[] arr2 = new int[2]; + Test_Span2(arr2, -1); + Test_Span2(arr2, 0); + Test_Span2(arr2, 1); + Test_Span2(arr2, 2); + if (!arr2.SequenceEqual(new[] { 0, 42 })) + throw new Exception("Test_Span1 failed"); + + int[] arr3 = new int[2]; + Test_Span3(arr3, -1); + Test_Span3(arr3, 0); + Test_Span3(arr3, 1); + Throws(() => Test_Span3(arr3, 2)); + if (!arr3.SequenceEqual(new[] { 0, 42 })) + throw new Exception("Test_Span1 failed"); + + // Should not throw NRE + Test_Array(arr3, -1); + return 100; + } + + private static void Throws(Action action) where T : Exception + { + try + { + action(); + } + catch (T) + { + return; + } + throw new Exception($"Expected {typeof(T)} to be thrown"); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + private static void Test_Span1(Span arr, int i) + { + if (i >= 0 && i < arr.Length) + arr[i] = 42; + } + + [MethodImpl(MethodImplOptions.NoInlining)] + private static void Test_Span2(Span arr, int i) + { + if (i > 0 && i < arr.Length) + arr[i] = 42; + } + + [MethodImpl(MethodImplOptions.NoInlining)] + private static void Test_Span3(Span arr, int i) + { + if (i > 0 && i <= arr.Length) + arr[i] = 42; + } + + [MethodImpl(MethodImplOptions.NoInlining)] + private static void Test_Array(Span arr, int i) + { + // Can't be folded into "(uint)i < arr.Length" + // because arr can be null + if (i >= 0 && i < arr.Length) + arr[i] = 42; + } +} diff --git a/src/tests/JIT/opt/RedundantBranch/RedundantBranchUnsigned2.csproj b/src/tests/JIT/opt/RedundantBranch/RedundantBranchUnsigned2.csproj new file mode 100644 index 00000000000000..de6d5e08882e86 --- /dev/null +++ b/src/tests/JIT/opt/RedundantBranch/RedundantBranchUnsigned2.csproj @@ -0,0 +1,8 @@ + + + True + + + + + From c7479b9ab66c68af74b2c2a27c2543ba2d47c569 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 27 Oct 2023 12:01:38 -0500 Subject: [PATCH 09/47] [main] Update dependencies from dotnet/arcade dotnet/sdk (#94083) * Update dependencies from https://github.com/dotnet/arcade build 20231027.1 Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitAssert , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions From Version 9.0.0-beta.23525.2 -> To Version 9.0.0-beta.23527.1 Dependency coherency updates Microsoft.DotNet.XliffTasks From Version 1.0.0-beta.23523.1 -> To Version 1.0.0-beta.23525.5 (parent: Microsoft.DotNet.Helix.Sdk * Update dependencies from https://github.com/dotnet/sdk build 20231027.4 Microsoft.DotNet.ApiCompat.Task From Version 9.0.100-alpha.1.23525.29 -> To Version 9.0.100-alpha.1.23527.4 --------- Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 84 ++++++++++++++++++++--------------------- eng/Versions.props | 34 ++++++++--------- global.json | 6 +-- 3 files changed, 62 insertions(+), 62 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 66b1f409480b1c..9345c7dfa37b8d 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -107,83 +107,83 @@ - + https://github.com/dotnet/arcade - 36d11a863c7ffc41e3730c806b0e98d32d1795ae + 30d512ae84149b306b6c160ed83dc433fc9f9cae - + https://github.com/dotnet/xliff-tasks - 83531fff1a39abe38de53e2e6b702bc1bb9c3bb4 + 0140d3d4a520d602a0721422eb656b78f16b5fba - + https://github.com/dotnet/arcade - 36d11a863c7ffc41e3730c806b0e98d32d1795ae + 30d512ae84149b306b6c160ed83dc433fc9f9cae - + https://github.com/dotnet/arcade - 36d11a863c7ffc41e3730c806b0e98d32d1795ae + 30d512ae84149b306b6c160ed83dc433fc9f9cae - + https://github.com/dotnet/arcade - 36d11a863c7ffc41e3730c806b0e98d32d1795ae + 30d512ae84149b306b6c160ed83dc433fc9f9cae - + https://github.com/dotnet/arcade - 36d11a863c7ffc41e3730c806b0e98d32d1795ae + 30d512ae84149b306b6c160ed83dc433fc9f9cae - + https://github.com/dotnet/arcade - 36d11a863c7ffc41e3730c806b0e98d32d1795ae + 30d512ae84149b306b6c160ed83dc433fc9f9cae - + https://github.com/dotnet/arcade - 36d11a863c7ffc41e3730c806b0e98d32d1795ae + 30d512ae84149b306b6c160ed83dc433fc9f9cae - + https://github.com/dotnet/arcade - 36d11a863c7ffc41e3730c806b0e98d32d1795ae + 30d512ae84149b306b6c160ed83dc433fc9f9cae - + https://github.com/dotnet/arcade - 36d11a863c7ffc41e3730c806b0e98d32d1795ae + 30d512ae84149b306b6c160ed83dc433fc9f9cae - + https://github.com/dotnet/arcade - 36d11a863c7ffc41e3730c806b0e98d32d1795ae + 30d512ae84149b306b6c160ed83dc433fc9f9cae - + https://github.com/dotnet/arcade - 36d11a863c7ffc41e3730c806b0e98d32d1795ae + 30d512ae84149b306b6c160ed83dc433fc9f9cae - + https://github.com/dotnet/arcade - 36d11a863c7ffc41e3730c806b0e98d32d1795ae + 30d512ae84149b306b6c160ed83dc433fc9f9cae - + https://github.com/dotnet/arcade - 36d11a863c7ffc41e3730c806b0e98d32d1795ae + 30d512ae84149b306b6c160ed83dc433fc9f9cae - + https://github.com/dotnet/arcade - 36d11a863c7ffc41e3730c806b0e98d32d1795ae + 30d512ae84149b306b6c160ed83dc433fc9f9cae - + https://github.com/dotnet/arcade - 36d11a863c7ffc41e3730c806b0e98d32d1795ae + 30d512ae84149b306b6c160ed83dc433fc9f9cae - + https://github.com/dotnet/arcade - 36d11a863c7ffc41e3730c806b0e98d32d1795ae + 30d512ae84149b306b6c160ed83dc433fc9f9cae - + https://github.com/dotnet/arcade - 36d11a863c7ffc41e3730c806b0e98d32d1795ae + 30d512ae84149b306b6c160ed83dc433fc9f9cae - + https://github.com/dotnet/arcade - 36d11a863c7ffc41e3730c806b0e98d32d1795ae + 30d512ae84149b306b6c160ed83dc433fc9f9cae https://github.com/dotnet/runtime-assets @@ -330,9 +330,9 @@ https://github.com/dotnet/xharness ab9528860ac51bb0aa6112fa2605b18c926594ef - + https://github.com/dotnet/arcade - 36d11a863c7ffc41e3730c806b0e98d32d1795ae + 30d512ae84149b306b6c160ed83dc433fc9f9cae https://dev.azure.com/dnceng/internal/_git/dotnet-optimization @@ -379,9 +379,9 @@ https://github.com/dotnet/roslyn-analyzers b4ed6a3093cfd3c8d353214ce97aaa7d24cf2df1 - + https://github.com/dotnet/sdk - 92a2dbef8611cf00d92317e66611848143cdbfed + c613f005ed115f90c3ec79253bfe1870e4c7cdb2 diff --git a/eng/Versions.props b/eng/Versions.props index 551732ef8036fb..203a1b0e5f9857 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -80,24 +80,24 @@ 0.2.0 - 9.0.100-alpha.1.23525.29 + 9.0.100-alpha.1.23527.4 - 9.0.0-beta.23525.2 - 9.0.0-beta.23525.2 - 9.0.0-beta.23525.2 - 9.0.0-beta.23525.2 - 9.0.0-beta.23525.2 - 9.0.0-beta.23525.2 - 2.5.3-beta.23525.2 - 9.0.0-beta.23525.2 - 9.0.0-beta.23525.2 - 9.0.0-beta.23525.2 - 9.0.0-beta.23525.2 - 9.0.0-beta.23525.2 - 9.0.0-beta.23525.2 - 9.0.0-beta.23525.2 - 9.0.0-beta.23525.2 - 9.0.0-beta.23525.2 + 9.0.0-beta.23527.1 + 9.0.0-beta.23527.1 + 9.0.0-beta.23527.1 + 9.0.0-beta.23527.1 + 9.0.0-beta.23527.1 + 9.0.0-beta.23527.1 + 2.5.3-beta.23527.1 + 9.0.0-beta.23527.1 + 9.0.0-beta.23527.1 + 9.0.0-beta.23527.1 + 9.0.0-beta.23527.1 + 9.0.0-beta.23527.1 + 9.0.0-beta.23527.1 + 9.0.0-beta.23527.1 + 9.0.0-beta.23527.1 + 9.0.0-beta.23527.1 6.0.0-preview.1.102 diff --git a/global.json b/global.json index b9ab9626f23618..c9c3aec875b1cb 100644 --- a/global.json +++ b/global.json @@ -8,9 +8,9 @@ "dotnet": "8.0.100-rtm.23506.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.23525.2", - "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.23525.2", - "Microsoft.DotNet.SharedFramework.Sdk": "9.0.0-beta.23525.2", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.23527.1", + "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.23527.1", + "Microsoft.DotNet.SharedFramework.Sdk": "9.0.0-beta.23527.1", "Microsoft.Build.NoTargets": "3.7.0", "Microsoft.Build.Traversal": "3.4.0", "Microsoft.NET.Sdk.IL": "9.0.0-alpha.1.23523.1" From 6936887402544cb4edab71fe2e21273974c05620 Mon Sep 17 00:00:00 2001 From: Vitek Karas <10670590+vitek-karas@users.noreply.github.com> Date: Fri, 27 Oct 2023 11:18:05 -0700 Subject: [PATCH 10/47] ILLink: Allow interface methods to not have newslot (#93662) Fixes https://github.com/dotnet/runtime/issues/93008 This comes from F#, where interface method defined in F# doesn't have `newslot` flag in its metadata. Trimmer gets confused and doesn't recognize such method as a "base" method for its implementation in the type which implements the interface. As a result, the implementation method is removed from the program because there doesn't seem to be a use for it anywhere. The fix is to basically ignore the `newslot` flag for interface instance methods. The existing behavior must be kept for static interface methods though - as a redefinition of a method with the `new` C# keyword will produce an interface method definition without the `newslot` flag as well. The change adds a new test and modifies the AOT/analyzer infra to run the test as well. --- .../TestCases/TestDatabase.cs | 5 ++ .../TestCases/TestSuites.cs | 14 ++++ .../illink/src/linker/Linker/TypeMapInfo.cs | 5 +- .../Inheritance.InterfacesTests.g.cs | 6 ++ .../Dependencies/InterfaceWithoutNewSlot.il | 53 +++++++++++++ .../InterfaceWithoutNewSlot.cs | 79 +++++++++++++++++++ 6 files changed, 161 insertions(+), 1 deletion(-) create mode 100644 src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/Dependencies/InterfaceWithoutNewSlot.il create mode 100644 src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/InterfaceWithoutNewSlot.cs diff --git a/src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCases/TestDatabase.cs b/src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCases/TestDatabase.cs index 57c3de36dd7574..488a283b043db2 100644 --- a/src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCases/TestDatabase.cs +++ b/src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCases/TestDatabase.cs @@ -34,6 +34,11 @@ public static IEnumerable InlineArrays () return TestNamesBySuiteName(); } + public static IEnumerable Inheritance_Interaces() + { + return TestNamesBySuiteName("Inheritance.Interfaces"); + } + public static IEnumerable Libraries() { return TestNamesBySuiteName(); diff --git a/src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCases/TestSuites.cs b/src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCases/TestSuites.cs index f8d7fb5c69d02b..86b5bb49b4f3d2 100644 --- a/src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCases/TestSuites.cs +++ b/src/coreclr/tools/aot/ILCompiler.Trimming.Tests/TestCases/TestSuites.cs @@ -37,6 +37,20 @@ public void InlineArrays(string t) Run(t); } + [Theory] + [MemberData(nameof(TestDatabase.Inheritance_Interaces), MemberType = typeof(TestDatabase))] + public void Inheritance_Interfaces(string t) + { + switch (t) { + case ".InterfaceWithoutNewSlot": + Run (t); + break; + default: + // Skip the rest for now + break; + } + } + [Theory] [MemberData(nameof(TestDatabase.Libraries), MemberType = typeof(TestDatabase))] public void Libraries(string t) diff --git a/src/tools/illink/src/linker/Linker/TypeMapInfo.cs b/src/tools/illink/src/linker/Linker/TypeMapInfo.cs index 79b55dbb613792..5fd38844180787 100644 --- a/src/tools/illink/src/linker/Linker/TypeMapInfo.cs +++ b/src/tools/illink/src/linker/Linker/TypeMapInfo.cs @@ -149,9 +149,12 @@ void MapInterfaceMethodsInTypeHierarchy (TypeDefinition type) // we shouldn't need to run the below logic. This results in ILLink potentially // keeping more methods than needed. + // Static methods on interfaces must be implemented only via explicit method-impl record + // not by a signature match. So there's no point in running the logic below for static methods. + if (!resolvedInterfaceMethod.IsVirtual || resolvedInterfaceMethod.IsFinal - || !resolvedInterfaceMethod.IsNewSlot) + || resolvedInterfaceMethod.IsStatic) continue; // Try to find an implementation with a name/sig match on the current type diff --git a/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/Inheritance.InterfacesTests.g.cs b/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/Inheritance.InterfacesTests.g.cs index 3ea7c024baf6e6..2e1a2bbcb3454d 100644 --- a/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/Inheritance.InterfacesTests.g.cs +++ b/src/tools/illink/test/ILLink.RoslynAnalyzer.Tests/generated/ILLink.RoslynAnalyzer.Tests.Generator/ILLink.RoslynAnalyzer.Tests.TestCaseGenerator/Inheritance.InterfacesTests.g.cs @@ -27,5 +27,11 @@ public Task InterfaceVariants () return RunTest (allowMissingWarnings: true); } + [Fact] + public Task InterfaceWithoutNewSlot () + { + return RunTest (allowMissingWarnings: true); + } + } } diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/Dependencies/InterfaceWithoutNewSlot.il b/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/Dependencies/InterfaceWithoutNewSlot.il new file mode 100644 index 00000000000000..d31d535fc70e13 --- /dev/null +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/Dependencies/InterfaceWithoutNewSlot.il @@ -0,0 +1,53 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +.assembly extern mscorlib { } + +.assembly 'library' { } + +.class interface public auto ansi abstract IInterfaceWithoutNewSlot +{ + .method public hidebysig abstract virtual + instance void AbstractNoNewSlot () cil managed + { + } + + .method public hidebysig abstract virtual + instance void AbstractNoNewSlotUnused () cil managed + { + } + + .method public hidebysig newslot abstract virtual + instance void AbstractNewSlot () cil managed + { + } + + .method public hidebysig newslot abstract virtual + instance void AbstractNewSlotUnused () cil managed + { + } + + .method public hidebysig virtual + instance void ImplementedNoNewSlot () cil managed + { + ret; + } + + .method public hidebysig virtual + instance void ImplementedNoNewSlotUnused () cil managed + { + ret; + } + + .method public hidebysig newslot virtual + instance void ImplementedNewSlot () cil managed + { + ret; + } + + .method public hidebysig newslot virtual + instance void ImplementedNewSlotUnused () cil managed + { + ret; + } +} diff --git a/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/InterfaceWithoutNewSlot.cs b/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/InterfaceWithoutNewSlot.cs new file mode 100644 index 00000000000000..1717e08aba80db --- /dev/null +++ b/src/tools/illink/test/Mono.Linker.Tests.Cases/Inheritance.Interfaces/InterfaceWithoutNewSlot.cs @@ -0,0 +1,79 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Mono.Linker.Tests.Cases.Expectations.Assertions; +using Mono.Linker.Tests.Cases.Expectations.Metadata; + +namespace Mono.Linker.Tests.Cases.Inheritance.Interfaces +{ + // Tests the case where the interface method doesn't have 'newslot' flag set + [TestCaseRequirements (TestRunCharacteristics.SupportsDefaultInterfaceMethods, "Requires support for default interface methods")] + [Define ("IL_ASSEMBLY_AVAILABLE")] + [SetupCompileBefore ("library.dll", new[] { "Dependencies/InterfaceWithoutNewSlot.il" })] + class InterfaceWithoutNewSlot + { + public static void Main () + { + ImplementationType.Test (); + } + +#if !IL_ASSEMBLY_AVAILABLE + // Declaration for the build of the test suite + // When compiled for actual run the IL version is used instead + // This is because there's no way to express the newslot/no-newslot in C# + interface IInterfaceWithoutNewSlot + { + void AbstractNoNewSlot (); + void AbstractNoNewSlotUnused (); + void AbstractNewSlot (); + void AbstractNewSlotUnused (); + void ImplementedNoNewSlot () { } + void ImplementedNoNewSlotUnused () { } + void ImplementedNewSlot () { } + void ImplementedNewSlotUnused () { } + } +#endif + + [Kept] + [KeptInterface (typeof (IInterfaceWithoutNewSlot))] + [KeptMember (".ctor()")] + class ImplementationType : IInterfaceWithoutNewSlot + { + [Kept] + public void AbstractNoNewSlot () { } + + public void AbstractNoNewSlotUnused () { } + + [Kept] + public void AbstractNewSlot () { } + + public void AbstractNewSlotUnused () { } + + // This is not considered an implementation of the interface method + // CoreCLR doesn't treat it that way either. + public void ImplementedNoNewSlot () { } + + public void ImplementedNoNewSlotUnused () { } + + [Kept] + public void ImplementedNewSlot () { } + + public void ImplementedNewSlotUnused () { } + + [Kept] + public static void Test () + { + IInterfaceWithoutNewSlot instance = new ImplementationType (); + instance.AbstractNoNewSlot (); + instance.AbstractNewSlot (); + instance.ImplementedNoNewSlot (); + instance.ImplementedNewSlot (); + } + } + } +} From 5200266e0daafc965eb0be8345be840d8ebc03d3 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Fri, 27 Oct 2023 11:54:01 -0700 Subject: [PATCH 11/47] Implement the ComVariant struct, the ComVariantMarshaller type, and generator integration (#93635) --- .../System.Private.CoreLib.csproj | 4 +- .../EnumerableViewOfDispatch.cs | 5 +- .../Runtime/CompilerHelpers/InteropHelpers.cs | 5 +- .../src/System.Private.CoreLib.csproj | 4 +- .../Runtime/InteropServices/Marshal.Com.cs | 138 ++-- .../Common/TypeSystem/Interop/InteropTypes.cs | 2 +- .../BuiltInVariantExtensions.cs | 172 +++++ .../Runtime/InteropServices/ComEventsSink.cs | 23 +- .../System/Runtime/InteropServices/Variant.cs | 715 ------------------ .../Microsoft.CSharp/Microsoft.CSharp.sln | 26 +- .../src/Microsoft.CSharp.csproj | 24 +- .../ComInterop/ComInvokeBinder.cs | 9 +- .../ComInterop/ComRuntimeHelpers.cs | 19 +- .../ComInterop/DynamicVariantExtensions.cs | 446 +++++++++++ .../ComInterop/VarEnumSelector.cs | 8 +- .../ComInterop/Variant.Extended.cs | 319 -------- .../RuntimeBinder/ComInterop/VariantArray.cs | 17 +- .../ComInterop/VariantBuilder.cs | 33 +- .../src/Resources/Strings.resx | 85 ++- .../System.Private.CoreLib.Shared.projitems | 4 + .../InteropServices/Marshalling/ComVariant.cs | 569 ++++++++++++++ .../System.Runtime.InteropServices.sln | 387 +++++----- .../ComInterfaceGeneratorHelpers.cs | 1 + .../VtableIndexStubGeneratorHelpers.cs | 1 + .../gen/Common/Resources/Strings.resx | 59 +- .../gen/Common/Resources/xlf/Strings.cs.xlf | 5 + .../gen/Common/Resources/xlf/Strings.de.xlf | 5 + .../gen/Common/Resources/xlf/Strings.es.xlf | 5 + .../gen/Common/Resources/xlf/Strings.fr.xlf | 5 + .../gen/Common/Resources/xlf/Strings.it.xlf | 5 + .../gen/Common/Resources/xlf/Strings.ja.xlf | 5 + .../gen/Common/Resources/xlf/Strings.ko.xlf | 5 + .../gen/Common/Resources/xlf/Strings.pl.xlf | 5 + .../Common/Resources/xlf/Strings.pt-BR.xlf | 5 + .../gen/Common/Resources/xlf/Strings.ru.xlf | 5 + .../gen/Common/Resources/xlf/Strings.tr.xlf | 5 + .../Common/Resources/xlf/Strings.zh-Hans.xlf | 5 + .../Common/Resources/xlf/Strings.zh-Hant.xlf | 5 + .../LibraryImportGeneratorHelpers.cs | 1 + .../CustomMarshallingInfoHelper.cs | 23 + .../MarshalAsWithCustomMarshallersParser.cs | 7 +- .../Marshalling/BreakingChangeDetector.cs | 41 + .../StringMarshallingInfoProvider.cs | 26 +- .../TypeNames.cs | 1 + .../ref/System.Runtime.InteropServices.cs | 30 + .../src/Resources/Strings.resx | 70 +- .../src/System.Runtime.InteropServices.csproj | 1 + .../Marshalling/ComVariantMarshaller.cs | 333 ++++++++ .../CodeSnippets.cs | 25 + .../CompileFails.cs | 19 + .../Compiles.cs | 9 + .../VariantTests.cs | 28 + ...ystem.Runtime.InteropServices.Tests.csproj | 2 + .../ComVariantMarshallerTests.cs | 295 ++++++++ .../InteropServices/ComVariantTests.cs | 493 ++++++++++++ .../tests/TestAssets/NativeExports/Variant.cs | 23 + 56 files changed, 3099 insertions(+), 1468 deletions(-) create mode 100644 src/libraries/Common/src/System/Runtime/InteropServices/BuiltInVariantExtensions.cs delete mode 100644 src/libraries/Common/src/System/Runtime/InteropServices/Variant.cs create mode 100644 src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/DynamicVariantExtensions.cs delete mode 100644 src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/Variant.Extended.cs create mode 100644 src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/ComVariant.cs create mode 100644 src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/BreakingChangeDetector.cs create mode 100644 src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/Marshalling/ComVariantMarshaller.cs create mode 100644 src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/VariantTests.cs create mode 100644 src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/ComVariantMarshallerTests.cs create mode 100644 src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/ComVariantTests.cs create mode 100644 src/libraries/System.Runtime.InteropServices/tests/TestAssets/NativeExports/Variant.cs diff --git a/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj index 377157b7091670..4531c27a2f6e6d 100644 --- a/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj +++ b/src/coreclr/System.Private.CoreLib/System.Private.CoreLib.csproj @@ -264,8 +264,8 @@ Common\System\Runtime\InteropServices\ComEventsSink.cs - - Common\System\Runtime\InteropServices\Variant.cs + + Common\System\Runtime\InteropServices\BuiltInVariantExtensions.cs diff --git a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumerableViewOfDispatch.cs b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumerableViewOfDispatch.cs index fa94eefcfb6a8d..3c152d5a3a7d36 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumerableViewOfDispatch.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Runtime/InteropServices/CustomMarshalers/EnumerableViewOfDispatch.cs @@ -3,6 +3,7 @@ using System.Diagnostics; using System.Runtime.InteropServices.ComTypes; +using System.Runtime.InteropServices.Marshalling; namespace System.Runtime.InteropServices.CustomMarshalers { @@ -22,7 +23,7 @@ public EnumerableViewOfDispatch(object dispatch) public Collections.IEnumerator GetEnumerator() { - Variant result; + ComVariant result; unsafe { void* resultLocal = &result; @@ -54,7 +55,7 @@ public Collections.IEnumerator GetEnumerator() } finally { - result.Clear(); + result.Dispose(); if (enumVariantPtr != IntPtr.Zero) Marshal.Release(enumVariantPtr); diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Runtime/CompilerHelpers/InteropHelpers.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Runtime/CompilerHelpers/InteropHelpers.cs index faacce2ea5d14b..2beac031c78648 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Runtime/CompilerHelpers/InteropHelpers.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Runtime/CompilerHelpers/InteropHelpers.cs @@ -9,6 +9,7 @@ using System.Runtime; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using System.Runtime.InteropServices.Marshalling; using System.Runtime.InteropServices.ObjectiveC; using System.Runtime.Loader; using System.Text; @@ -576,8 +577,8 @@ internal static unsafe void CleanupVariant(IntPtr pDstNativeVariant) { #if TARGET_WINDOWS #pragma warning disable CA1416 - Variant* data = (Variant*)pDstNativeVariant; - data->Clear(); + ComVariant* data = (ComVariant*)pDstNativeVariant; + data->Dispose(); #pragma warning restore CA1416 #else throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop); diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System.Private.CoreLib.csproj b/src/coreclr/nativeaot/System.Private.CoreLib/src/System.Private.CoreLib.csproj index ec3a3363a511a7..e1f1b75afc3175 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System.Private.CoreLib.csproj +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System.Private.CoreLib.csproj @@ -256,8 +256,8 @@ - - System\Runtime\InteropServices\Variant.cs + + System\Runtime\InteropServices\BuiltInVariantExtensions.cs Interop\Windows\Kernel32\Interop.IsDebuggerPresent.cs diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Com.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Com.cs index 18828c7ad17f78..97694ca5d66756 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Com.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Com.cs @@ -5,6 +5,7 @@ using System.Diagnostics.CodeAnalysis; using System.Reflection; using System.Runtime.InteropServices.ComTypes; +using System.Runtime.InteropServices.Marshalling; using System.Runtime.Versioning; namespace System.Runtime.InteropServices @@ -121,10 +122,10 @@ public static unsafe void GetNativeVariantForObject(object? obj, IntPtr pDstNati { ArgumentNullException.ThrowIfNull(pDstNativeVariant); - Variant* data = (Variant*)pDstNativeVariant; + ComVariant* data = (ComVariant*)pDstNativeVariant; if (obj == null) { - data->VariantType = VarEnum.VT_EMPTY; + *data = default; return; } @@ -132,132 +133,132 @@ public static unsafe void GetNativeVariantForObject(object? obj, IntPtr pDstNati { // Int and String most used types. case int value: - data->AsI4 = value; + *data = ComVariant.Create(value); break; case string value: - data->AsBstr = value; + *data = ComVariant.Create(new BStrWrapper(value)); break; case bool value: - data->AsBool = value; + *data = ComVariant.Create(value); break; case byte value: - data->AsUi1 = value; + *data = ComVariant.Create(value); break; case sbyte value: - data->AsI1 = value; + *data = ComVariant.Create(value); break; case short value: - data->AsI2 = value; + *data = ComVariant.Create(value); break; case ushort value: - data->AsUi2 = value; + *data = ComVariant.Create(value); break; case uint value: - data->AsUi4 = value; + *data = ComVariant.Create(value); break; case long value: - data->AsI8 = value; + *data = ComVariant.Create(value); break; case ulong value: - data->AsUi8 = value; + *data = ComVariant.Create(value); break; case float value: - data->AsR4 = value; + *data = ComVariant.Create(value); break; case double value: - data->AsR8 = value; + *data = ComVariant.Create(value); break; case DateTime value: - data->AsDate = value; + *data = ComVariant.Create(value); break; case decimal value: - data->AsDecimal = value; + *data = ComVariant.Create(value); break; case char value: - data->AsUi2 = value; + *data = ComVariant.Create(value); break; case BStrWrapper value: - data->AsBstr = value.WrappedObject; + *data = ComVariant.Create(value); break; #pragma warning disable 0618 // CurrencyWrapper is obsolete case CurrencyWrapper value: - data->AsCy = value.WrappedObject; + *data = ComVariant.Create(value); break; #pragma warning restore 0618 case UnknownWrapper value: - data->AsUnknown = value.WrappedObject; + *data = ComVariant.CreateRaw(VarEnum.VT_UNKNOWN, GetIUnknownForObject(value.WrappedObject)); break; case DispatchWrapper value: - data->AsDispatch = value.WrappedObject; + *data = ComVariant.CreateRaw(VarEnum.VT_DISPATCH, GetIDispatchForObject(value.WrappedObject)); break; case ErrorWrapper value: - data->AsError = value.ErrorCode; + *data = ComVariant.Create(value); break; case VariantWrapper value: throw new ArgumentException(); case DBNull value: - data->SetAsNULL(); + *data = ComVariant.Null; break; case Missing value: - data->AsError = DISP_E_PARAMNOTFOUND; + *data = ComVariant.CreateRaw(VarEnum.VT_ERROR, DISP_E_PARAMNOTFOUND); break; case IConvertible value: switch (value.GetTypeCode()) { case TypeCode.Empty: - data->VariantType = VarEnum.VT_EMPTY; + *data = default; break; case TypeCode.Object: - data->AsUnknown = value; + *data = ComVariant.CreateRaw(VarEnum.VT_UNKNOWN, GetIUnknownForObject(value)); break; case TypeCode.DBNull: - data->SetAsNULL(); + *data = ComVariant.Null; break; case TypeCode.Boolean: - data->AsBool = value.ToBoolean(null); + *data = ComVariant.Create(value.ToBoolean(null)); break; case TypeCode.Char: - data->AsUi2 = value.ToChar(null); + *data = ComVariant.Create(value.ToChar(null)); break; case TypeCode.SByte: - data->AsI1 = value.ToSByte(null); + *data = ComVariant.Create(value.ToSByte(null)); break; case TypeCode.Byte: - data->AsUi1 = value.ToByte(null); + *data = ComVariant.Create(value.ToByte(null)); break; case TypeCode.Int16: - data->AsI2 = value.ToInt16(null); + *data = ComVariant.Create(value.ToInt16(null)); break; case TypeCode.UInt16: - data->AsUi2 = value.ToUInt16(null); + *data = ComVariant.Create(value.ToUInt16(null)); break; case TypeCode.Int32: - data->AsI4 = value.ToInt32(null); + *data = ComVariant.Create(value.ToInt32(null)); break; case TypeCode.UInt32: - data->AsUi4 = value.ToUInt32(null); + *data = ComVariant.Create(value.ToUInt32(null)); break; case TypeCode.Int64: - data->AsI8 = value.ToInt64(null); + *data = ComVariant.Create(value.ToInt64(null)); break; case TypeCode.UInt64: - data->AsUi8 = value.ToUInt64(null); + *data = ComVariant.Create(value.ToUInt64(null)); break; case TypeCode.Single: - data->AsR4 = value.ToSingle(null); + *data = ComVariant.Create(value.ToSingle(null)); break; case TypeCode.Double: - data->AsR8 = value.ToDouble(null); + *data = ComVariant.Create(value.ToDouble(null)); break; case TypeCode.Decimal: - data->AsDecimal = value.ToDecimal(null); + *data = ComVariant.Create(value.ToDecimal(null)); break; case TypeCode.DateTime: - data->AsDate = value.ToDateTime(null); + *data = ComVariant.Create(value.ToDateTime(null)); break; case TypeCode.String: - data->AsBstr = value.ToString(); + *data = ComVariant.Create(new BStrWrapper(value.ToString(null))); break; default: throw new NotSupportedException(); @@ -273,7 +274,7 @@ public static unsafe void GetNativeVariantForObject(object? obj, IntPtr pDstNati case ValueType: throw new NotSupportedException("VT_RECORD"); default: - data->AsDispatch = obj; + *data = ComVariant.CreateRaw(VarEnum.VT_UNKNOWN, GetIDispatchForObject(obj)); break; } } @@ -303,38 +304,35 @@ public static object GetObjectForIUnknown(IntPtr pUnk) { ArgumentNullException.ThrowIfNull(pSrcNativeVariant); - Variant* data = (Variant*)pSrcNativeVariant; + ComVariant* data = (ComVariant*)pSrcNativeVariant; - if (data->IsEmpty) - { - return null; - } - - switch (data->VariantType) + switch (data->VarType) { + case VarEnum.VT_EMPTY: + return null; case VarEnum.VT_NULL: return DBNull.Value; - case VarEnum.VT_I1: return data->AsI1; - case VarEnum.VT_I2: return data->AsI2; - case VarEnum.VT_I4: return data->AsI4; - case VarEnum.VT_I8: return data->AsI8; - case VarEnum.VT_UI1: return data->AsUi1; - case VarEnum.VT_UI2: return data->AsUi2; - case VarEnum.VT_UI4: return data->AsUi4; - case VarEnum.VT_UI8: return data->AsUi8; - case VarEnum.VT_INT: return data->AsInt; - case VarEnum.VT_UINT: return data->AsUint; - case VarEnum.VT_BOOL: return data->AsBool; - case VarEnum.VT_ERROR: return data->AsError; - case VarEnum.VT_R4: return data->AsR4; - case VarEnum.VT_R8: return data->AsR8; - case VarEnum.VT_DECIMAL: return data->AsDecimal; - case VarEnum.VT_CY: return data->AsCy; - case VarEnum.VT_DATE: return data->AsDate; - case VarEnum.VT_BSTR: return data->AsBstr; - case VarEnum.VT_UNKNOWN: return data->AsUnknown; - case VarEnum.VT_DISPATCH: return data->AsDispatch; + case VarEnum.VT_I1: return data->As(); + case VarEnum.VT_I2: return data->As(); + case VarEnum.VT_I4: return data->As(); + case VarEnum.VT_I8: return data->As(); + case VarEnum.VT_UI1: return data->As(); + case VarEnum.VT_UI2: return data->As(); + case VarEnum.VT_UI4: return data->As(); + case VarEnum.VT_UI8: return data->As(); + case VarEnum.VT_INT: return data->As(); + case VarEnum.VT_UINT: return data->As(); + case VarEnum.VT_BOOL: return data->As() != -1; + case VarEnum.VT_ERROR: return data->As(); + case VarEnum.VT_R4: return data->As(); + case VarEnum.VT_R8: return data->As(); + case VarEnum.VT_DECIMAL: return data->As(); + case VarEnum.VT_CY: return decimal.FromOACurrency(data->GetRawDataRef()); + case VarEnum.VT_DATE: return data->As(); + case VarEnum.VT_BSTR: return PtrToStringBSTR(data->GetRawDataRef()); + case VarEnum.VT_UNKNOWN: return GetObjectForIUnknown(data->GetRawDataRef()); + case VarEnum.VT_DISPATCH: return GetObjectForIUnknown(data->GetRawDataRef()); default: // Other VARIANT types not supported yet. diff --git a/src/coreclr/tools/Common/TypeSystem/Interop/InteropTypes.cs b/src/coreclr/tools/Common/TypeSystem/Interop/InteropTypes.cs index 3beeb5f187a89e..7fdd0f06596209 100644 --- a/src/coreclr/tools/Common/TypeSystem/Interop/InteropTypes.cs +++ b/src/coreclr/tools/Common/TypeSystem/Interop/InteropTypes.cs @@ -54,7 +54,7 @@ public static MetadataType GetMarshalDirectiveException(TypeSystemContext contex public static MetadataType GetVariant(TypeSystemContext context) { - return context.SystemModule.GetKnownType("System.Runtime.InteropServices", "Variant"); + return context.SystemModule.GetKnownType("System.Runtime.InteropServices.Marshalling", "ComVariant"); } public static bool IsSafeHandle(TypeSystemContext context, TypeDesc type) diff --git a/src/libraries/Common/src/System/Runtime/InteropServices/BuiltInVariantExtensions.cs b/src/libraries/Common/src/System/Runtime/InteropServices/BuiltInVariantExtensions.cs new file mode 100644 index 00000000000000..777a1c03b0a7a2 --- /dev/null +++ b/src/libraries/Common/src/System/Runtime/InteropServices/BuiltInVariantExtensions.cs @@ -0,0 +1,172 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Diagnostics; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices.Marshalling; +using System.Runtime.Versioning; + +namespace System.Runtime.InteropServices +{ + [SupportedOSPlatform("windows")] + internal static class BuiltInInteropVariantExtensions + { + // VARIANT_BOOL constants. + internal const short VARIANT_TRUE = -1; + internal const short VARIANT_FALSE = 0; + private static unsafe ref T GetByRefDataRef(this ref ComVariant variant) + where T : unmanaged + { + Debug.Assert(variant.VarType.HasFlag(VarEnum.VT_BYREF)); + return ref Unsafe.AsRef((void*)variant.GetRawDataRef()); + } + + public static unsafe void CopyFromIndirect(this ref ComVariant variant, object value) + { + VarEnum vt = (VarEnum)(((int)variant.VarType) & ~((int)VarEnum.VT_BYREF)); + + if (value == null) + { + if (vt == VarEnum.VT_DISPATCH || vt == VarEnum.VT_UNKNOWN || vt == VarEnum.VT_BSTR) + { + variant.GetRawDataRef() = IntPtr.Zero; + } + return; + } + + if ((vt & VarEnum.VT_ARRAY) != 0) + { + ComVariant vArray; + Marshal.GetNativeVariantForObject(value, (IntPtr)(void*)&vArray); + variant.GetRawDataRef() = vArray.GetRawDataRef(); + return; + } + + switch (vt) + { + case VarEnum.VT_I1: + variant.GetByRefDataRef() = (sbyte)value; + break; + + case VarEnum.VT_UI1: + variant.GetByRefDataRef() = (byte)value; + break; + + case VarEnum.VT_I2: + variant.GetByRefDataRef() = (short)value; + break; + + case VarEnum.VT_UI2: + variant.GetByRefDataRef() = (ushort)value; + break; + + case VarEnum.VT_BOOL: + variant.GetByRefDataRef() = (bool)value ? VARIANT_TRUE : VARIANT_FALSE; + break; + + case VarEnum.VT_I4: + case VarEnum.VT_INT: + variant.GetByRefDataRef() = (int)value; + break; + + case VarEnum.VT_UI4: + case VarEnum.VT_UINT: + variant.GetByRefDataRef() = (uint)value; + break; + + case VarEnum.VT_ERROR: + variant.GetByRefDataRef() = ((ErrorWrapper)value).ErrorCode; + break; + + case VarEnum.VT_I8: + variant.GetByRefDataRef() = (long)value; + break; + + case VarEnum.VT_UI8: + variant.GetByRefDataRef() = (ulong)value; + break; + + case VarEnum.VT_R4: + variant.GetByRefDataRef() = (float)value; + break; + + case VarEnum.VT_R8: + variant.GetByRefDataRef() = (double)value; + break; + + case VarEnum.VT_DATE: + variant.GetByRefDataRef() = ((DateTime)value).ToOADate(); + break; + + case VarEnum.VT_UNKNOWN: + variant.GetByRefDataRef() = Marshal.GetIUnknownForObject(value); + break; + + case VarEnum.VT_DISPATCH: + variant.GetByRefDataRef() = Marshal.GetIDispatchForObject(value); + break; + + case VarEnum.VT_BSTR: + variant.GetByRefDataRef() = Marshal.StringToBSTR((string)value); + break; + + case VarEnum.VT_CY: + variant.GetByRefDataRef() = decimal.ToOACurrency((decimal)value); + break; + + case VarEnum.VT_DECIMAL: + variant.GetByRefDataRef() = (decimal)value; + break; + + case VarEnum.VT_VARIANT: + Marshal.GetNativeVariantForObject(value, variant.GetRawDataRef()); + break; + + default: + throw new ArgumentException(); + } + } + + /// + /// Get the managed object representing the Variant. + /// + /// + public static object? ToObject(this ref ComVariant variant) + { + return variant.VarType switch + { + VarEnum.VT_EMPTY => null, + VarEnum.VT_NULL => DBNull.Value, + VarEnum.VT_I1 => variant.As(), + VarEnum.VT_I2 => variant.As(), + VarEnum.VT_I4 => variant.As(), + VarEnum.VT_I8 => variant.As(), + VarEnum.VT_UI1 => variant.As(), + VarEnum.VT_UI2 => variant.As(), + VarEnum.VT_UI4 => variant.As(), + VarEnum.VT_UI8 => variant.As(), + VarEnum.VT_INT => variant.As(), + VarEnum.VT_UINT => variant.As(), + VarEnum.VT_BOOL => variant.As(), + VarEnum.VT_ERROR => variant.As(), + VarEnum.VT_R4 => variant.As(), + VarEnum.VT_R8 => variant.As(), + VarEnum.VT_DECIMAL => variant.As(), + VarEnum.VT_CY => decimal.FromOACurrency(variant.GetRawDataRef()), + VarEnum.VT_DATE => variant.As(), + VarEnum.VT_BSTR => Marshal.PtrToStringBSTR(variant.GetRawDataRef()), + VarEnum.VT_UNKNOWN => Marshal.GetObjectForIUnknown(variant.GetRawDataRef()), + VarEnum.VT_DISPATCH => Marshal.GetObjectForIUnknown(variant.GetRawDataRef()), + _ => GetObjectFromNativeVariant(ref variant), + }; + } + + private static unsafe object? GetObjectFromNativeVariant(ref ComVariant variant) + { + fixed (void* pVariant = &variant) + { + return Marshal.GetObjectForNativeVariant((nint)pVariant); + } + } + } +} diff --git a/src/libraries/Common/src/System/Runtime/InteropServices/ComEventsSink.cs b/src/libraries/Common/src/System/Runtime/InteropServices/ComEventsSink.cs index 3747e2f331b4b4..5155bea123ce01 100644 --- a/src/libraries/Common/src/System/Runtime/InteropServices/ComEventsSink.cs +++ b/src/libraries/Common/src/System/Runtime/InteropServices/ComEventsSink.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Diagnostics; +using System.Runtime.InteropServices.Marshalling; using System.Runtime.Versioning; namespace System.Runtime.InteropServices @@ -120,18 +121,18 @@ void IDispatch.GetIDsOfNames(ref Guid iid, string[] names, int cNames, int lcid, private const VarEnum VT_TYPEMASK = (VarEnum)0x0fff; private const VarEnum VT_BYREF_TYPEMASK = VT_TYPEMASK | VarEnum.VT_BYREF; - private static unsafe ref Variant GetVariant(ref Variant pSrc) + private static unsafe ref ComVariant GetVariant(ref ComVariant pSrc) { - if (pSrc.VariantType == VT_BYREF_VARIANT) + if (pSrc.VarType == VT_BYREF_VARIANT) { // For VB6 compatibility reasons, if the VARIANT is a VT_BYREF | VT_VARIANT that // contains another VARIANT with VT_BYREF | VT_VARIANT, then we need to extract the // inner VARIANT and use it instead of the outer one. Note that if the inner VARIANT // is VT_BYREF | VT_VARIANT | VT_ARRAY, it will pass the below test too. - Span pByRefVariant = new Span(pSrc.AsByRefVariant.ToPointer(), 1); - if ((pByRefVariant[0].VariantType & VT_BYREF_TYPEMASK) == VT_BYREF_VARIANT) + ref ComVariant pByRefVariant = ref *(ComVariant*)(pSrc.GetRawDataRef().ToPointer()); + if ((pByRefVariant.VarType & VT_BYREF_TYPEMASK) == VT_BYREF_VARIANT) { - return ref pByRefVariant[0]; + return ref pByRefVariant; } } @@ -163,7 +164,7 @@ unsafe void IDispatch.Invoke( bool[] usedArgs = new bool[pDispParams.cArgs]; int totalCount = pDispParams.cNamedArgs + pDispParams.cArgs; - var vars = new Span(pDispParams.rgvarg.ToPointer(), totalCount); + var vars = new Span(pDispParams.rgvarg.ToPointer(), totalCount); var namedArgs = new Span(pDispParams.rgdispidNamedArgs.ToPointer(), totalCount); // copy the named args (positional) as specified @@ -172,12 +173,12 @@ unsafe void IDispatch.Invoke( for (i = 0; i < pDispParams.cNamedArgs; i++) { pos = namedArgs[i]; - ref Variant pvar = ref GetVariant(ref vars[i]); + ref ComVariant pvar = ref GetVariant(ref vars[i]); args[pos] = pvar.ToObject()!; usedArgs[pos] = true; int byrefIdx = InvalidIdx; - if (pvar.IsByRef) + if (pvar.VarType.HasFlag(VarEnum.VT_BYREF)) { byrefIdx = i; } @@ -195,11 +196,11 @@ unsafe void IDispatch.Invoke( pos++; } - ref Variant pvar = ref GetVariant(ref vars[pDispParams.cArgs - 1 - i]); + ref ComVariant pvar = ref GetVariant(ref vars[pDispParams.cArgs - 1 - i]); args[pos] = pvar.ToObject()!; int byrefIdx = InvalidIdx; - if (pvar.IsByRef) + if (pvar.VarType.HasFlag(VarEnum.VT_BYREF)) { byrefIdx = pDispParams.cArgs - 1 - i; } @@ -227,7 +228,7 @@ unsafe void IDispatch.Invoke( continue; } - ref Variant pvar = ref GetVariant(ref vars[idxToPos]); + ref ComVariant pvar = ref GetVariant(ref vars[idxToPos]); pvar.CopyFromIndirect(args[i]); } } diff --git a/src/libraries/Common/src/System/Runtime/InteropServices/Variant.cs b/src/libraries/Common/src/System/Runtime/InteropServices/Variant.cs deleted file mode 100644 index 2af1f942acee68..00000000000000 --- a/src/libraries/Common/src/System/Runtime/InteropServices/Variant.cs +++ /dev/null @@ -1,715 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Diagnostics; -using System.Runtime.Versioning; - -namespace System.Runtime.InteropServices -{ - /// - /// Variant is the basic COM type for late-binding. It can contain any other COM data type. - /// This type definition precisely matches the unmanaged data layout so that the struct can be passed - /// to and from COM calls. - /// - [StructLayout(LayoutKind.Explicit)] - [SupportedOSPlatform("windows")] - internal partial struct Variant - { -#if DEBUG - static Variant() - { - // Variant size is the size of 4 pointers (16 bytes) on a 32-bit processor, - // and 3 pointers (24 bytes) on a 64-bit processor. - int variantSize = Marshal.SizeOf(); - if (IntPtr.Size == 4) - { - Debug.Assert(variantSize == (4 * IntPtr.Size)); - } - else - { - Debug.Assert(IntPtr.Size == 8); - Debug.Assert(variantSize == (3 * IntPtr.Size)); - } - } -#endif - - // Most of the data types in the Variant are carried in _typeUnion - [FieldOffset(0)] private TypeUnion _typeUnion; - - // Decimal is the largest data type and it needs to use the space that is normally unused in TypeUnion._wReserved1, etc. - // Hence, it is declared to completely overlap with TypeUnion. A Decimal does not use the first two bytes, and so - // TypeUnion._vt can still be used to encode the type. - [FieldOffset(0)] private decimal _decimal; - - [StructLayout(LayoutKind.Sequential)] - private struct TypeUnion - { - public ushort _vt; - public ushort _wReserved1; - public ushort _wReserved2; - public ushort _wReserved3; - - public UnionTypes _unionTypes; - } - - [StructLayout(LayoutKind.Sequential)] - private struct Record - { - public IntPtr _record; - public IntPtr _recordInfo; - } - - [StructLayout(LayoutKind.Explicit)] - private struct UnionTypes - { - [FieldOffset(0)] public sbyte _i1; - [FieldOffset(0)] public short _i2; - [FieldOffset(0)] public int _i4; - [FieldOffset(0)] public long _i8; - [FieldOffset(0)] public byte _ui1; - [FieldOffset(0)] public ushort _ui2; - [FieldOffset(0)] public uint _ui4; - [FieldOffset(0)] public ulong _ui8; - [FieldOffset(0)] public int _int; - [FieldOffset(0)] public uint _uint; - [FieldOffset(0)] public short _bool; - [FieldOffset(0)] public int _error; - [FieldOffset(0)] public float _r4; - [FieldOffset(0)] public double _r8; - [FieldOffset(0)] public long _cy; - [FieldOffset(0)] public double _date; - [FieldOffset(0)] public IntPtr _bstr; - [FieldOffset(0)] public IntPtr _unknown; - [FieldOffset(0)] public IntPtr _dispatch; - [FieldOffset(0)] public IntPtr _pvarVal; - [FieldOffset(0)] public IntPtr _byref; - [FieldOffset(0)] public Record _record; - } - - /// - /// Primitive types are the basic COM types. It includes valuetypes like ints, but also reference types - /// like BStrs. It does not include composite types like arrays and user-defined COM types (IUnknown/IDispatch). - /// - public static bool IsPrimitiveType(VarEnum varEnum) - { - switch (varEnum) - { - case VarEnum.VT_I1: - case VarEnum.VT_I2: - case VarEnum.VT_I4: - case VarEnum.VT_I8: - case VarEnum.VT_UI1: - case VarEnum.VT_UI2: - case VarEnum.VT_UI4: - case VarEnum.VT_UI8: - case VarEnum.VT_INT: - case VarEnum.VT_UINT: - case VarEnum.VT_BOOL: - case VarEnum.VT_ERROR: - case VarEnum.VT_R4: - case VarEnum.VT_R8: - case VarEnum.VT_DECIMAL: - case VarEnum.VT_CY: - case VarEnum.VT_DATE: - case VarEnum.VT_BSTR: - return true; - } - - return false; - } - - public unsafe void CopyFromIndirect(object value) - { - VarEnum vt = (VarEnum)(((int)this.VariantType) & ~((int)VarEnum.VT_BYREF)); - - if (value == null) - { - if (vt == VarEnum.VT_DISPATCH || vt == VarEnum.VT_UNKNOWN || vt == VarEnum.VT_BSTR) - { - *(IntPtr*)this._typeUnion._unionTypes._byref = IntPtr.Zero; - } - return; - } - - if ((vt & VarEnum.VT_ARRAY) != 0) - { - Variant vArray; - Marshal.GetNativeVariantForObject(value, (IntPtr)(void*)&vArray); - *(IntPtr*)this._typeUnion._unionTypes._byref = vArray._typeUnion._unionTypes._byref; - return; - } - - switch (vt) - { - case VarEnum.VT_I1: - *(sbyte*)this._typeUnion._unionTypes._byref = (sbyte)value; - break; - - case VarEnum.VT_UI1: - *(byte*)this._typeUnion._unionTypes._byref = (byte)value; - break; - - case VarEnum.VT_I2: - *(short*)this._typeUnion._unionTypes._byref = (short)value; - break; - - case VarEnum.VT_UI2: - *(ushort*)this._typeUnion._unionTypes._byref = (ushort)value; - break; - - case VarEnum.VT_BOOL: - // VARIANT_TRUE = -1 - // VARIANT_FALSE = 0 - *(short*)this._typeUnion._unionTypes._byref = (bool)value ? (short)-1 : (short)0; - break; - - case VarEnum.VT_I4: - case VarEnum.VT_INT: - *(int*)this._typeUnion._unionTypes._byref = (int)value; - break; - - case VarEnum.VT_UI4: - case VarEnum.VT_UINT: - *(uint*)this._typeUnion._unionTypes._byref = (uint)value; - break; - - case VarEnum.VT_ERROR: - *(int*)this._typeUnion._unionTypes._byref = ((ErrorWrapper)value).ErrorCode; - break; - - case VarEnum.VT_I8: - *(long*)this._typeUnion._unionTypes._byref = (long)value; - break; - - case VarEnum.VT_UI8: - *(ulong*)this._typeUnion._unionTypes._byref = (ulong)value; - break; - - case VarEnum.VT_R4: - *(float*)this._typeUnion._unionTypes._byref = (float)value; - break; - - case VarEnum.VT_R8: - *(double*)this._typeUnion._unionTypes._byref = (double)value; - break; - - case VarEnum.VT_DATE: - *(double*)this._typeUnion._unionTypes._byref = ((DateTime)value).ToOADate(); - break; - - case VarEnum.VT_UNKNOWN: - *(IntPtr*)this._typeUnion._unionTypes._byref = Marshal.GetIUnknownForObject(value); - break; - - case VarEnum.VT_DISPATCH: - *(IntPtr*)this._typeUnion._unionTypes._byref = Marshal.GetIDispatchForObject(value); - break; - - case VarEnum.VT_BSTR: - *(IntPtr*)this._typeUnion._unionTypes._byref = Marshal.StringToBSTR((string)value); - break; - - case VarEnum.VT_CY: - *(long*)this._typeUnion._unionTypes._byref = decimal.ToOACurrency((decimal)value); - break; - - case VarEnum.VT_DECIMAL: - *(decimal*)this._typeUnion._unionTypes._byref = (decimal)value; - break; - - case VarEnum.VT_VARIANT: - Marshal.GetNativeVariantForObject(value, this._typeUnion._unionTypes._byref); - break; - - default: - throw new ArgumentException(); - } - } - - /// - /// Get the managed object representing the Variant. - /// - /// - public object? ToObject() - { - // Check the simple case upfront - if (IsEmpty) - { - return null; - } - - switch (VariantType) - { - case VarEnum.VT_NULL: - return DBNull.Value; - - case VarEnum.VT_I1: return AsI1; - case VarEnum.VT_I2: return AsI2; - case VarEnum.VT_I4: return AsI4; - case VarEnum.VT_I8: return AsI8; - case VarEnum.VT_UI1: return AsUi1; - case VarEnum.VT_UI2: return AsUi2; - case VarEnum.VT_UI4: return AsUi4; - case VarEnum.VT_UI8: return AsUi8; - case VarEnum.VT_INT: return AsInt; - case VarEnum.VT_UINT: return AsUint; - case VarEnum.VT_BOOL: return AsBool; - case VarEnum.VT_ERROR: return AsError; - case VarEnum.VT_R4: return AsR4; - case VarEnum.VT_R8: return AsR8; - case VarEnum.VT_DECIMAL: return AsDecimal; - case VarEnum.VT_CY: return AsCy; - case VarEnum.VT_DATE: return AsDate; - case VarEnum.VT_BSTR: return AsBstr; - case VarEnum.VT_UNKNOWN: return AsUnknown; - case VarEnum.VT_DISPATCH: return AsDispatch; - - default: - unsafe - { - fixed (void* pThis = &this) - { - return Marshal.GetObjectForNativeVariant((System.IntPtr)pThis); - } - } - } - } - - /// - /// Release any unmanaged memory associated with the Variant - /// - public void Clear() - { - // We do not need to call OLE32's VariantClear for primitive types or ByRefs - // to save ourselves the cost of interop transition. - // ByRef indicates the memory is not owned by the VARIANT itself while - // primitive types do not have any resources to free up. - // Hence, only safearrays, BSTRs, interfaces and user types are - // handled differently. - VarEnum vt = VariantType; - if ((vt & VarEnum.VT_BYREF) != 0) - { - VariantType = VarEnum.VT_EMPTY; - } - else if (((vt & VarEnum.VT_ARRAY) != 0) - || (vt == VarEnum.VT_BSTR) - || (vt == VarEnum.VT_UNKNOWN) - || (vt == VarEnum.VT_DISPATCH) - || (vt == VarEnum.VT_VARIANT) - || (vt == VarEnum.VT_RECORD)) - { - unsafe - { - fixed (void* pThis = &this) - { - Interop.OleAut32.VariantClear((IntPtr)pThis); - } - } - - Debug.Assert(IsEmpty); - } - else - { - VariantType = VarEnum.VT_EMPTY; - } - } - - public VarEnum VariantType - { - get => (VarEnum)_typeUnion._vt; - set => _typeUnion._vt = (ushort)value; - } - - public bool IsEmpty => _typeUnion._vt == ((ushort)VarEnum.VT_EMPTY); - - public bool IsByRef => (_typeUnion._vt & ((ushort)VarEnum.VT_BYREF)) != 0; - - public void SetAsNULL() - { - Debug.Assert(IsEmpty); - VariantType = VarEnum.VT_NULL; - } - - // VT_I1 - - public sbyte AsI1 - { - get - { - Debug.Assert(VariantType == VarEnum.VT_I1); - return _typeUnion._unionTypes._i1; - } - set - { - Debug.Assert(IsEmpty); - VariantType = VarEnum.VT_I1; - _typeUnion._unionTypes._i1 = value; - } - } - - // VT_I2 - - public short AsI2 - { - get - { - Debug.Assert(VariantType == VarEnum.VT_I2); - return _typeUnion._unionTypes._i2; - } - set - { - Debug.Assert(IsEmpty); - VariantType = VarEnum.VT_I2; - _typeUnion._unionTypes._i2 = value; - } - } - - // VT_I4 - - public int AsI4 - { - get - { - Debug.Assert(VariantType == VarEnum.VT_I4); - return _typeUnion._unionTypes._i4; - } - set - { - Debug.Assert(IsEmpty); - VariantType = VarEnum.VT_I4; - _typeUnion._unionTypes._i4 = value; - } - } - - // VT_I8 - - public long AsI8 - { - get - { - Debug.Assert(VariantType == VarEnum.VT_I8); - return _typeUnion._unionTypes._i8; - } - set - { - Debug.Assert(IsEmpty); - VariantType = VarEnum.VT_I8; - _typeUnion._unionTypes._i8 = value; - } - } - - // VT_UI1 - - public byte AsUi1 - { - get - { - Debug.Assert(VariantType == VarEnum.VT_UI1); - return _typeUnion._unionTypes._ui1; - } - set - { - Debug.Assert(IsEmpty); - VariantType = VarEnum.VT_UI1; - _typeUnion._unionTypes._ui1 = value; - } - } - - // VT_UI2 - - public ushort AsUi2 - { - get - { - Debug.Assert(VariantType == VarEnum.VT_UI2); - return _typeUnion._unionTypes._ui2; - } - set - { - Debug.Assert(IsEmpty); - VariantType = VarEnum.VT_UI2; - _typeUnion._unionTypes._ui2 = value; - } - } - - // VT_UI4 - - public uint AsUi4 - { - get - { - Debug.Assert(VariantType == VarEnum.VT_UI4); - return _typeUnion._unionTypes._ui4; - } - set - { - Debug.Assert(IsEmpty); - VariantType = VarEnum.VT_UI4; - _typeUnion._unionTypes._ui4 = value; - } - } - - // VT_UI8 - - public ulong AsUi8 - { - get - { - Debug.Assert(VariantType == VarEnum.VT_UI8); - return _typeUnion._unionTypes._ui8; - } - set - { - Debug.Assert(IsEmpty); - VariantType = VarEnum.VT_UI8; - _typeUnion._unionTypes._ui8 = value; - } - } - - // VT_INT - - public int AsInt - { - get - { - Debug.Assert(VariantType == VarEnum.VT_INT); - return _typeUnion._unionTypes._int; - } - set - { - Debug.Assert(IsEmpty); - VariantType = VarEnum.VT_INT; - _typeUnion._unionTypes._int = value; - } - } - - // VT_UINT - - public uint AsUint - { - get - { - Debug.Assert(VariantType == VarEnum.VT_UINT); - return _typeUnion._unionTypes._uint; - } - set - { - Debug.Assert(IsEmpty); - VariantType = VarEnum.VT_UINT; - _typeUnion._unionTypes._uint = value; - } - } - - // VT_BOOL - - public bool AsBool - { - get - { - Debug.Assert(VariantType == VarEnum.VT_BOOL); - return _typeUnion._unionTypes._bool != 0; - } - set - { - Debug.Assert(IsEmpty); - // VARIANT_TRUE = -1 - // VARIANT_FALSE = 0 - VariantType = VarEnum.VT_BOOL; - _typeUnion._unionTypes._bool = value ? (short)-1 : (short)0; - } - } - - // VT_ERROR - - public int AsError - { - get - { - Debug.Assert(VariantType == VarEnum.VT_ERROR); - return _typeUnion._unionTypes._error; - } - set - { - Debug.Assert(IsEmpty); - VariantType = VarEnum.VT_ERROR; - _typeUnion._unionTypes._error = value; - } - } - - // VT_R4 - - public float AsR4 - { - get - { - Debug.Assert(VariantType == VarEnum.VT_R4); - return _typeUnion._unionTypes._r4; - } - set - { - Debug.Assert(IsEmpty); - VariantType = VarEnum.VT_R4; - _typeUnion._unionTypes._r4 = value; - } - } - - // VT_R8 - - public double AsR8 - { - get - { - Debug.Assert(VariantType == VarEnum.VT_R8); - return _typeUnion._unionTypes._r8; - } - set - { - Debug.Assert(IsEmpty); - VariantType = VarEnum.VT_R8; - _typeUnion._unionTypes._r8 = value; - } - } - - // VT_DECIMAL - - public decimal AsDecimal - { - get - { - Debug.Assert(VariantType == VarEnum.VT_DECIMAL); - // The first byte of Decimal is unused, but usually set to 0 - Variant v = this; - v._typeUnion._vt = 0; - return v._decimal; - } - set - { - Debug.Assert(IsEmpty); - VariantType = VarEnum.VT_DECIMAL; - _decimal = value; - // _vt overlaps with _decimal, and should be set after setting _decimal - _typeUnion._vt = (ushort)VarEnum.VT_DECIMAL; - } - } - - // VT_CY - - public decimal AsCy - { - get - { - Debug.Assert(VariantType == VarEnum.VT_CY); - return decimal.FromOACurrency(_typeUnion._unionTypes._cy); - } - set - { - Debug.Assert(IsEmpty); - VariantType = VarEnum.VT_CY; - _typeUnion._unionTypes._cy = decimal.ToOACurrency(value); - } - } - - // VT_DATE - - public DateTime AsDate - { - get - { - Debug.Assert(VariantType == VarEnum.VT_DATE); - return DateTime.FromOADate(_typeUnion._unionTypes._date); - } - set - { - Debug.Assert(IsEmpty); - VariantType = VarEnum.VT_DATE; - _typeUnion._unionTypes._date = value.ToOADate(); - } - } - - // VT_BSTR - - public string? AsBstr - { - get - { - Debug.Assert(VariantType == VarEnum.VT_BSTR); - if (_typeUnion._unionTypes._bstr == IntPtr.Zero) - { - return null; - } - return (string)Marshal.PtrToStringBSTR(this._typeUnion._unionTypes._bstr); - } - set - { - Debug.Assert(IsEmpty); - VariantType = VarEnum.VT_BSTR; - this._typeUnion._unionTypes._bstr = Marshal.StringToBSTR(value); - } - } - - // VT_UNKNOWN - - public object? AsUnknown - { - get - { - Debug.Assert(VariantType == VarEnum.VT_UNKNOWN); - if (_typeUnion._unionTypes._unknown == IntPtr.Zero) - { - return null; - } - return Marshal.GetObjectForIUnknown(_typeUnion._unionTypes._unknown); - } - set - { - Debug.Assert(IsEmpty); - VariantType = VarEnum.VT_UNKNOWN; - if (value == null) - { - _typeUnion._unionTypes._unknown = IntPtr.Zero; - } - else - { - _typeUnion._unionTypes._unknown = Marshal.GetIUnknownForObject(value); - } - } - } - - // VT_DISPATCH - - public object? AsDispatch - { - get - { - Debug.Assert(VariantType == VarEnum.VT_DISPATCH); - if (_typeUnion._unionTypes._dispatch == IntPtr.Zero) - { - return null; - } - return Marshal.GetObjectForIUnknown(_typeUnion._unionTypes._dispatch); - } - set - { - Debug.Assert(IsEmpty); - VariantType = VarEnum.VT_DISPATCH; - if (value == null) - { - _typeUnion._unionTypes._dispatch = IntPtr.Zero; - } - else - { - _typeUnion._unionTypes._dispatch = Marshal.GetIDispatchForObject(value); - } - } - } - - public IntPtr AsByRefVariant - { - get - { - Debug.Assert(VariantType == (VarEnum.VT_BYREF | VarEnum.VT_VARIANT)); - return _typeUnion._unionTypes._pvarVal; - } - } - } -} diff --git a/src/libraries/Microsoft.CSharp/Microsoft.CSharp.sln b/src/libraries/Microsoft.CSharp/Microsoft.CSharp.sln index 7207dd4e74f6f1..7c0e1c47b0f584 100644 --- a/src/libraries/Microsoft.CSharp/Microsoft.CSharp.sln +++ b/src/libraries/Microsoft.CSharp/Microsoft.CSharp.sln @@ -1,4 +1,8 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.8.34117.57 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestUtilities", "..\Common\tests\TestUtilities\TestUtilities.csproj", "{A18337A4-46D6-470C-A995-CA70E5311F19}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CSharp", "ref\Microsoft.CSharp.csproj", "{BF947490-D7AE-46E1-B4E0-D8A6D1EA8E5A}" @@ -39,11 +43,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{E4FC7A8F-502 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gen", "gen", "{9C11B257-64B7-4EC9-BF3E-4859FB66281D}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gen", "tools\gen", "{D293C8E5-5C86-4096-9F9D-0129396A1AD7}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gen", "gen", "{D293C8E5-5C86-4096-9F9D-0129396A1AD7}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "tools\src", "{ABC2DBF6-FE78-44B1-86B8-D759660B5462}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{ABC2DBF6-FE78-44B1-86B8-D759660B5462}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "tools\ref", "{8C230199-AEBC-4299-A612-5025FC987A41}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "ref", "{8C230199-AEBC-4299-A612-5025FC987A41}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{1725BEE8-1704-4D2D-BD98-CFEC326A5DEA}" EndProject @@ -123,26 +127,30 @@ Global EndGlobalSection GlobalSection(NestedProjects) = preSolution {A18337A4-46D6-470C-A995-CA70E5311F19} = {E6224881-0E5B-4FDC-99C4-DDE6E59F806B} - {7AEDFF97-79E2-441E-8B3F-5C8EC9C1E8FA} = {E6224881-0E5B-4FDC-99C4-DDE6E59F806B} {BF947490-D7AE-46E1-B4E0-D8A6D1EA8E5A} = {85A4D137-FEEC-4F3C-9358-F2BFFFF6D2DE} + {78073F44-8382-473D-8B24-90D54B57129E} = {E4FC7A8F-5024-4D51-9753-C2C61CF9DAD0} + {7AEDFF97-79E2-441E-8B3F-5C8EC9C1E8FA} = {E6224881-0E5B-4FDC-99C4-DDE6E59F806B} {629BA969-ADCA-47E9-9654-75B7411C5606} = {85A4D137-FEEC-4F3C-9358-F2BFFFF6D2DE} {B783B886-07DB-46B8-B02D-1C9259C767E9} = {85A4D137-FEEC-4F3C-9358-F2BFFFF6D2DE} {8E91F13C-8E06-431B-A4C9-0A9906B1DCD6} = {85A4D137-FEEC-4F3C-9358-F2BFFFF6D2DE} - {C89FC14C-795C-469E-A053-A2844C0B7AA8} = {85A4D137-FEEC-4F3C-9358-F2BFFFF6D2DE} - {78073F44-8382-473D-8B24-90D54B57129E} = {E4FC7A8F-5024-4D51-9753-C2C61CF9DAD0} {BB30502C-6FBE-467E-AE6B-380EC60BD666} = {9C11B257-64B7-4EC9-BF3E-4859FB66281D} {B78B9BD0-6D82-400A-A373-C42051D9C3D8} = {9C11B257-64B7-4EC9-BF3E-4859FB66281D} {7223E4B2-40ED-48FB-9BFA-07002AD674DB} = {9C11B257-64B7-4EC9-BF3E-4859FB66281D} + {C89FC14C-795C-469E-A053-A2844C0B7AA8} = {85A4D137-FEEC-4F3C-9358-F2BFFFF6D2DE} {780BF284-2765-4B96-A817-CE9AEB1BC979} = {D293C8E5-5C86-4096-9F9D-0129396A1AD7} {84957D3F-C9E3-4191-8BD1-D0492F5D0B69} = {D293C8E5-5C86-4096-9F9D-0129396A1AD7} - {D293C8E5-5C86-4096-9F9D-0129396A1AD7} = {1725BEE8-1704-4D2D-BD98-CFEC326A5DEA} {465840D4-5267-4DC2-A675-A32BE9584745} = {ABC2DBF6-FE78-44B1-86B8-D759660B5462} {DB79B0FC-557E-4FCE-871B-F53F790DBD60} = {ABC2DBF6-FE78-44B1-86B8-D759660B5462} - {ABC2DBF6-FE78-44B1-86B8-D759660B5462} = {1725BEE8-1704-4D2D-BD98-CFEC326A5DEA} {54EA706E-28CA-4CCF-82CC-6B211E683C2E} = {8C230199-AEBC-4299-A612-5025FC987A41} + {D293C8E5-5C86-4096-9F9D-0129396A1AD7} = {1725BEE8-1704-4D2D-BD98-CFEC326A5DEA} + {ABC2DBF6-FE78-44B1-86B8-D759660B5462} = {1725BEE8-1704-4D2D-BD98-CFEC326A5DEA} {8C230199-AEBC-4299-A612-5025FC987A41} = {1725BEE8-1704-4D2D-BD98-CFEC326A5DEA} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {A1ECF510-F5DB-4E7F-853E-DD3C0CE04C12} EndGlobalSection + GlobalSection(SharedMSBuildProjectFiles) = preSolution + ..\..\tools\illink\src\ILLink.Shared\ILLink.Shared.projitems*{84957d3f-c9e3-4191-8bd1-d0492f5d0b69}*SharedItemsImports = 5 + ..\..\tools\illink\src\ILLink.Shared\ILLink.Shared.projitems*{db79b0fc-557e-4fce-871b-f53f790dbd60}*SharedItemsImports = 5 + EndGlobalSection EndGlobal diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft.CSharp.csproj b/src/libraries/Microsoft.CSharp/src/Microsoft.CSharp.csproj index 3be4e969da5a7d..9388bfa98b91e7 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft.CSharp.csproj +++ b/src/libraries/Microsoft.CSharp/src/Microsoft.CSharp.csproj @@ -167,25 +167,19 @@ - - + + - - - - + + + + Common\System\Runtime\InteropServices\IDispatch.cs - - Common\System\Runtime\InteropServices\Variant.cs + + Common\System\Runtime\InteropServices\BuiltInVariantExtensions.cs @@ -234,7 +228,7 @@ - + diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComInvokeBinder.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComInvokeBinder.cs index 9052ad6d7a0afb..ff356ef08c96c8 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComInvokeBinder.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComInvokeBinder.cs @@ -8,6 +8,7 @@ using System.Dynamic; using System.Linq.Expressions; using System.Runtime.InteropServices; +using System.Runtime.InteropServices.Marshalling; using ComTypes = System.Runtime.InteropServices.ComTypes; namespace Microsoft.CSharp.RuntimeBinder.ComInterop @@ -92,7 +93,7 @@ private ParameterExpression DispParamsVariable private ParameterExpression InvokeResultVariable { - get { return EnsureVariable(ref _invokeResult, typeof(Variant), "invokeResult"); } + get { return EnsureVariable(ref _invokeResult, typeof(ComVariant), "invokeResult"); } } private ParameterExpression ReturnValueVariable @@ -306,8 +307,8 @@ private Expression GenerateTryBlock() // Expression invokeResultObject = Expression.Call( - InvokeResultVariable, - typeof(Variant).GetMethod(nameof(Variant.ToObject))); + typeof(BuiltInInteropVariantExtensions).GetMethod(nameof(BuiltInInteropVariantExtensions.ToObject)), + InvokeResultVariable); VariantBuilder[] variants = _varEnumSelector.VariantBuilders; @@ -360,7 +361,7 @@ private Expression GenerateFinallyBlock() finallyStatements.Add( Expression.Call( InvokeResultVariable, - typeof(Variant).GetMethod(nameof(Variant.Clear)) + typeof(ComVariant).GetMethod(nameof(ComVariant.Dispose)) ) ); diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComRuntimeHelpers.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComRuntimeHelpers.cs index 114b869124aff7..d090f3300cdb29 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComRuntimeHelpers.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/ComRuntimeHelpers.cs @@ -8,6 +8,7 @@ using System.Reflection; using System.Reflection.Emit; using System.Runtime.InteropServices; +using System.Runtime.InteropServices.Marshalling; using System.Security; using ComTypes = System.Runtime.InteropServices.ComTypes; @@ -230,11 +231,11 @@ internal static class UnsafeMethods #region public members public static unsafe IntPtr ConvertInt32ByrefToPtr(ref int value) { return (IntPtr)System.Runtime.CompilerServices.Unsafe.AsPointer(ref value); } - public static unsafe IntPtr ConvertVariantByrefToPtr(ref Variant value) { return (IntPtr)System.Runtime.CompilerServices.Unsafe.AsPointer(ref value); } + public static unsafe IntPtr ConvertVariantByrefToPtr(ref ComVariant value) { return (IntPtr)System.Runtime.CompilerServices.Unsafe.AsPointer(ref value); } - internal static Variant GetVariantForObject(object obj) + internal static ComVariant GetVariantForObject(object obj) { - Variant variant = default; + ComVariant variant = default; if (obj == null) { return variant; @@ -243,7 +244,7 @@ internal static Variant GetVariantForObject(object obj) return variant; } - internal static void InitVariantForObject(object obj, ref Variant variant) + internal static void InitVariantForObject(object obj, ref ComVariant variant) { Debug.Assert(obj != null); @@ -252,7 +253,7 @@ internal static void InitVariantForObject(object obj, ref Variant variant) // Therefore we are going to test for IDispatch before defaulting to GetNativeVariantForObject. if (obj is IDispatch) { - variant.AsDispatch = obj; + variant = ComVariant.CreateRaw(VarEnum.VT_DISPATCH, obj is not null ? Marshal.GetIDispatchForObject(obj) : 0); return; } @@ -260,7 +261,7 @@ internal static void InitVariantForObject(object obj, ref Variant variant) } // This method is intended for use through reflection and should not be used directly - public static object GetObjectForVariant(Variant variant) + public static object GetObjectForVariant(ComVariant variant) { IntPtr ptr = UnsafeMethods.ConvertVariantByrefToPtr(ref variant); return Marshal.GetObjectForNativeVariant(ptr); @@ -287,18 +288,18 @@ public static unsafe int IDispatchInvoke( int memberDispId, ComTypes.INVOKEKIND flags, ref ComTypes.DISPPARAMS dispParams, - out Variant result, + out ComVariant result, out ExcepInfo excepInfo, out uint argErr) { Guid IID_NULL = default; fixed (ComTypes.DISPPARAMS* pDispParams = &dispParams) - fixed (Variant* pResult = &result) + fixed (ComVariant* pResult = &result) fixed (ExcepInfo* pExcepInfo = &excepInfo) fixed (uint* pArgErr = &argErr) { - var pfnIDispatchInvoke = (delegate* unmanaged) + var pfnIDispatchInvoke = (delegate* unmanaged) (*(*(void***)dispatchPointer + 6 /* IDispatch.Invoke slot */)); int hresult = pfnIDispatchInvoke(dispatchPointer, diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/DynamicVariantExtensions.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/DynamicVariantExtensions.cs new file mode 100644 index 00000000000000..27647ed388f28e --- /dev/null +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/DynamicVariantExtensions.cs @@ -0,0 +1,446 @@ +// 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.Globalization; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Runtime.InteropServices.Marshalling; +using Microsoft.CSharp.RuntimeBinder.ComInterop; + +namespace Microsoft.CSharp.RuntimeBinder.ComInterop +{ + internal static class DynamicVariantExtensions + { + /// + /// Primitive types are the basic COM types. It includes valuetypes like ints, but also reference types + /// like BStrs. It does not include composite types like arrays and user-defined COM types (IUnknown/IDispatch). + /// + public static bool IsPrimitiveType(this VarEnum varEnum) + { + switch (varEnum) + { + case VarEnum.VT_I1: + case VarEnum.VT_I2: + case VarEnum.VT_I4: + case VarEnum.VT_I8: + case VarEnum.VT_UI1: + case VarEnum.VT_UI2: + case VarEnum.VT_UI4: + case VarEnum.VT_UI8: + case VarEnum.VT_INT: + case VarEnum.VT_UINT: + case VarEnum.VT_BOOL: + case VarEnum.VT_ERROR: + case VarEnum.VT_R4: + case VarEnum.VT_R8: + case VarEnum.VT_DECIMAL: + case VarEnum.VT_CY: + case VarEnum.VT_DATE: + case VarEnum.VT_BSTR: + return true; + } + + return false; + } + + public static void SetAsIConvertible(this ref ComVariant variant, IConvertible value) + { + Debug.Assert(variant.VarType == VarEnum.VT_EMPTY); // The setter can only be called once as VariantClear might be needed otherwise + + TypeCode tc = value.GetTypeCode(); + CultureInfo ci = CultureInfo.CurrentCulture; + + switch (tc) + { + case TypeCode.Empty: break; + case TypeCode.Object: variant = ComVariant.CreateRaw(VarEnum.VT_UNKNOWN, Marshal.GetIUnknownForObject(value)); break; + case TypeCode.DBNull: variant = ComVariant.Null; break; + case TypeCode.Boolean: variant = ComVariant.Create(value.ToBoolean(ci)); break; + case TypeCode.Char: variant = ComVariant.Create(value.ToChar(ci)); break; + case TypeCode.SByte: variant = ComVariant.Create(value.ToSByte(ci)); break; + case TypeCode.Byte: variant = ComVariant.Create(value.ToByte(ci)); break; + case TypeCode.Int16: variant = ComVariant.Create(value.ToInt16(ci)); break; + case TypeCode.UInt16: variant = ComVariant.Create(value.ToUInt16(ci)); break; + case TypeCode.Int32: variant = ComVariant.Create(value.ToInt32(ci)); break; + case TypeCode.UInt32: variant = ComVariant.Create(value.ToUInt32(ci)); break; + case TypeCode.Int64: variant = ComVariant.Create(value.ToInt64(ci)); break; + case TypeCode.UInt64: variant = ComVariant.Create(value.ToInt64(ci)); break; + case TypeCode.Single: variant = ComVariant.Create(value.ToSingle(ci)); break; + case TypeCode.Double: variant = ComVariant.Create(value.ToDouble(ci)); break; + case TypeCode.Decimal: variant = ComVariant.Create(value.ToDecimal(ci)); break; + case TypeCode.DateTime: variant = ComVariant.Create(value.ToDateTime(ci)); break; + case TypeCode.String: variant = ComVariant.Create(new BStrWrapper(value.ToString(ci))); break; + + default: + throw new NotSupportedException(); + } + } + // VT_I1 + + public static void SetAsByrefI1(ref this ComVariant variant, ref sbyte value) + { + variant.SetAsByref(ref value, VarEnum.VT_I1); + } + + // VT_I2 + + public static void SetAsByrefI2(ref this ComVariant variant, ref short value) + { + variant.SetAsByref(ref value, VarEnum.VT_I2); + } + + // VT_I4 + + public static void SetAsByrefI4(ref this ComVariant variant, ref int value) + { + variant.SetAsByref(ref value, VarEnum.VT_I4); + } + + // VT_I8 + + public static void SetAsByrefI8(ref this ComVariant variant, ref long value) + { + variant.SetAsByref(ref value, VarEnum.VT_I8); + } + + // VT_UI1 + + public static void SetAsByrefUi1(ref this ComVariant variant, ref byte value) + { + variant.SetAsByref(ref value, VarEnum.VT_UI1); + } + + // VT_UI2 + + public static void SetAsByrefUi2(ref this ComVariant variant, ref ushort value) + { + variant.SetAsByref(ref value, VarEnum.VT_UI2); + } + + // VT_UI4 + + public static void SetAsByrefUi4(ref this ComVariant variant, ref uint value) + { + variant.SetAsByref(ref value, VarEnum.VT_UI4); + } + + // VT_UI8 + + public static void SetAsByrefUi8(ref this ComVariant variant, ref ulong value) + { + variant.SetAsByref(ref value, VarEnum.VT_UI8); + } + + // VT_INT + + public static void SetAsByrefInt(ref this ComVariant variant, ref int value) + { + variant.SetAsByref(ref value, VarEnum.VT_INT); + } + + // VT_UINT + + public static void SetAsByrefUint(ref this ComVariant variant, ref uint value) + { + variant.SetAsByref(ref value, VarEnum.VT_UINT); + } + + // VT_BOOL + + public static void SetAsByrefBool(ref this ComVariant variant, ref short value) + { + variant.SetAsByref(ref value, VarEnum.VT_BOOL); + } + + // VT_ERROR + + public static void SetAsByrefError(ref this ComVariant variant, ref int value) + { + variant.SetAsByref(ref value, VarEnum.VT_ERROR); + } + + // VT_R4 + + public static void SetAsByrefR4(ref this ComVariant variant, ref float value) + { + variant.SetAsByref(ref value, VarEnum.VT_R4); + } + + // VT_R8 + + public static void SetAsByrefR8(ref this ComVariant variant, ref double value) + { + variant.SetAsByref(ref value, VarEnum.VT_R8); + } + + // VT_DECIMAL + + public static void SetAsByrefDecimal(ref this ComVariant variant, ref decimal value) + { + variant.SetAsByref(ref value, VarEnum.VT_DECIMAL); + } + + // VT_CY + + public static void SetAsByrefCy(ref this ComVariant variant, ref long value) + { + variant.SetAsByref(ref value, VarEnum.VT_CY); + } + + // VT_DATE + + public static void SetAsByrefDate(ref this ComVariant variant, ref double value) + { + variant.SetAsByref(ref value, VarEnum.VT_DATE); + } + + // VT_BSTR + + public static void SetAsByrefBstr(ref this ComVariant variant, ref IntPtr value) + { + variant.SetAsByref(ref value, VarEnum.VT_BSTR); + } + + // VT_UNKNOWN + + public static void SetAsByrefUnknown(ref this ComVariant variant, ref IntPtr value) + { + variant.SetAsByref(ref value, VarEnum.VT_UNKNOWN); + } + + // VT_DISPATCH + + public static void SetAsByrefDispatch(ref this ComVariant variant, ref IntPtr value) + { + variant.SetAsByref(ref value, VarEnum.VT_DISPATCH); + } + + private static unsafe void SetAsByref(ref this ComVariant variant, ref T value, VarEnum type) + { + Debug.Assert(variant.VarType == VarEnum.VT_EMPTY); // The setter can only be called once as VariantClear might be needed otherwise + variant = ComVariant.CreateRaw(type | VarEnum.VT_BYREF, (nint)Unsafe.AsPointer(ref value)); + } + + public static void SetAsByrefVariant(ref this ComVariant variant, ref ComVariant value) + { + variant.SetAsByref(ref value, VarEnum.VT_VARIANT); + } + + [StructLayout(LayoutKind.Sequential)] + private struct Record + { + public IntPtr _record; + public IntPtr _recordInfo; + } + + // constructs a ByRef variant to pass contents of another variant ByRef. + public static unsafe void SetAsByrefVariantIndirect(ref this ComVariant variant, ref ComVariant value) + { + Debug.Assert(variant.VarType == VarEnum.VT_EMPTY); // The setter can only be called once as VariantClear might be needed otherwise + Debug.Assert((value.VarType & VarEnum.VT_BYREF) == 0, "double indirection"); + + switch (value.VarType) + { + case VarEnum.VT_EMPTY: + case VarEnum.VT_NULL: + // these cannot combine with VT_BYREF. Should try passing as a variant reference + variant.SetAsByrefVariant(ref value); + return; + case VarEnum.VT_RECORD: + // VT_RECORD's are weird in that regardless of is the VT_BYREF flag is set or not + // they have the same internal representation. + variant = ComVariant.CreateRaw(value.VarType | VarEnum.VT_BYREF, value.GetRawDataRef()); + break; + case VarEnum.VT_DECIMAL: + // The DECIMAL value in an OLE Variant is stored at the start of the structure. + variant = ComVariant.CreateRaw(value.VarType | VarEnum.VT_BYREF, (nint)Unsafe.AsPointer(ref value)); + break; + default: + variant = ComVariant.CreateRaw(value.VarType | VarEnum.VT_BYREF, (nint)Unsafe.AsPointer(ref value.GetRawDataRef())); + break; + } + } + + internal static System.Reflection.MethodInfo GetByrefSetter(VarEnum varType) + { + switch (varType) + { + case VarEnum.VT_I1: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetAsByrefI1)); + case VarEnum.VT_I2: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetAsByrefI2)); + case VarEnum.VT_I4: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetAsByrefI4)); + case VarEnum.VT_I8: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetAsByrefI8)); + case VarEnum.VT_UI1: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetAsByrefUi1)); + case VarEnum.VT_UI2: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetAsByrefUi2)); + case VarEnum.VT_UI4: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetAsByrefUi4)); + case VarEnum.VT_UI8: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetAsByrefUi8)); + case VarEnum.VT_INT: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetAsByrefInt)); + case VarEnum.VT_UINT: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetAsByrefUint)); + case VarEnum.VT_BOOL: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetAsByrefBool)); + case VarEnum.VT_ERROR: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetAsByrefError)); + case VarEnum.VT_R4: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetAsByrefR4)); + case VarEnum.VT_R8: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetAsByrefR8)); + case VarEnum.VT_DECIMAL: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetAsByrefDecimal)); + case VarEnum.VT_CY: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetAsByrefCy)); + case VarEnum.VT_DATE: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetAsByrefDate)); + case VarEnum.VT_BSTR: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetAsByrefBstr)); + case VarEnum.VT_UNKNOWN: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetAsByrefUnknown)); + case VarEnum.VT_DISPATCH: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetAsByrefDispatch)); + + case VarEnum.VT_VARIANT: + return typeof(DynamicVariantExtensions).GetMethod(nameof(SetAsByrefVariant)); + case VarEnum.VT_RECORD: + case VarEnum.VT_ARRAY: + return typeof(DynamicVariantExtensions).GetMethod(nameof(SetAsByrefVariantIndirect)); + + default: + throw new NotSupportedException(); + } + } + + public static void SetI1(this ref ComVariant variant, sbyte value) + { + variant = ComVariant.Create(value); + } + + public static void SetUi1(this ref ComVariant variant, byte value) + { + variant = ComVariant.Create(value); + } + + public static void SetI2(this ref ComVariant variant, short value) + { + variant = ComVariant.Create(value); + } + + public static void SetUi2(this ref ComVariant variant, ushort value) + { + variant = ComVariant.Create(value); + } + + public static void SetI4(this ref ComVariant variant, int value) + { + variant = ComVariant.Create(value); + } + + public static void SetUi4(this ref ComVariant variant, uint value) + { + variant = ComVariant.Create(value); + } + + public static void SetI8(this ref ComVariant variant, long value) + { + variant = ComVariant.Create(value); + } + + public static void SetUi8(this ref ComVariant variant, ulong value) + { + variant = ComVariant.Create(value); + } + + public static void SetInt(this ref ComVariant variant, int value) + { + variant = ComVariant.CreateRaw(VarEnum.VT_INT, value); + } + + public static void SetUint(this ref ComVariant variant, uint value) + { + variant = ComVariant.CreateRaw(VarEnum.VT_UINT, value); + } + + public static void SetBool(this ref ComVariant variant, bool value) + { + variant = ComVariant.Create(value); + } + + public static void SetR4(this ref ComVariant variant, float value) + { + variant = ComVariant.Create(value); + } + + public static void SetR8(this ref ComVariant variant, double value) + { + variant = ComVariant.Create(value); + } + + public static void SetDecimal(this ref ComVariant variant, decimal value) + { + variant = ComVariant.Create(value); + } + + public static void SetDate(this ref ComVariant variant, DateTime value) + { + variant = ComVariant.Create(value); + } + + public static void SetBstr(this ref ComVariant variant, string value) + { + variant = ComVariant.Create(new BStrWrapper(value)); + } + + public static void SetUnknown(this ref ComVariant variant, object value) + { + variant = ComVariant.CreateRaw(VarEnum.VT_UNKNOWN, Marshal.GetIUnknownForObject(value)); + } + + public static void SetDispatch(this ref ComVariant variant, object value) + { + variant = ComVariant.CreateRaw(VarEnum.VT_DISPATCH, Marshal.GetIDispatchForObject(value)); + } + + public static void SetError(this ref ComVariant variant, int value) + { + variant = ComVariant.CreateRaw(VarEnum.VT_ERROR, value); + } + + public static void SetCy(this ref ComVariant variant, decimal value) + { + variant = ComVariant.CreateRaw(VarEnum.VT_CY, decimal.ToOACurrency(value)); + } + + public static unsafe void SetVariant(this ref ComVariant variant, object value) + { + Debug.Assert(variant.VarType == VarEnum.VT_EMPTY); // The setter can only be called once as VariantClear might be needed otherwise + if (value != null) + { + UnsafeMethods.InitVariantForObject(value, ref variant); + } + } + + internal static System.Reflection.MethodInfo GetSetter(VarEnum varType) + { + switch (varType) + { + case VarEnum.VT_I1: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetI1), System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); + case VarEnum.VT_I2: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetI2), System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); + case VarEnum.VT_I4: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetI4), System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); + case VarEnum.VT_I8: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetI8), System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); + case VarEnum.VT_UI1: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetUi1), System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); + case VarEnum.VT_UI2: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetUi2), System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); + case VarEnum.VT_UI4: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetUi4), System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); + case VarEnum.VT_UI8: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetUi8), System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); + case VarEnum.VT_INT: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetInt), System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); + case VarEnum.VT_UINT: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetUint), System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); + case VarEnum.VT_BOOL: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetBool), System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); + case VarEnum.VT_ERROR: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetError), System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); + case VarEnum.VT_R4: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetR4), System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); + case VarEnum.VT_R8: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetR8), System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); + case VarEnum.VT_DECIMAL: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetDecimal), System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); + case VarEnum.VT_CY: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetCy), System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); + case VarEnum.VT_DATE: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetDate), System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); + case VarEnum.VT_BSTR: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetBstr), System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); + case VarEnum.VT_UNKNOWN: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetUnknown), System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); + case VarEnum.VT_DISPATCH: return typeof(DynamicVariantExtensions).GetMethod(nameof(SetDispatch), System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); + + case VarEnum.VT_VARIANT: + case VarEnum.VT_RECORD: + case VarEnum.VT_ARRAY: + return typeof(DynamicVariantExtensions).GetMethod(nameof(SetVariant), System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static); + + default: + throw new NotSupportedException(); + } + } + } +} diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/VarEnumSelector.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/VarEnumSelector.cs index 85846d888f90ec..6f69602277aba2 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/VarEnumSelector.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/VarEnumSelector.cs @@ -46,7 +46,7 @@ internal VarEnumSelector(Type[] explicitArgTypes) /// /// Gets the managed type that an object needs to be converted to in order for it to be able - /// to be represented as a Variant. + /// to be represented as an ComVariant. /// /// In general, there is a many-to-many mapping between Type and VarEnum. However, this method /// returns a simple mapping that is needed for the current implementation. The reason for the @@ -65,7 +65,7 @@ internal static Type GetManagedMarshalType(VarEnum varEnum) return typeof(CurrencyWrapper); } - if (Variant.IsPrimitiveType(varEnum)) + if (varEnum.IsPrimitiveType()) { return s_comToManagedPrimitiveTypes[varEnum]; } @@ -375,7 +375,7 @@ private static VarEnum GetComType(ref Type argumentType) } /// - /// Get the COM Variant type that argument should be marshaled as for a call to COM + /// Get the ComVariant type that argument should be marshaled as for a call to COM /// [RequiresUnreferencedCode(Binder.TrimmerWarning)] private static VariantBuilder GetVariantBuilder(Type argumentType) @@ -447,7 +447,7 @@ private static ArgBuilder GetByValArgBuilder(Type elementType, ref VarEnum eleme return GetSimpleArgBuilder(elementType, elementVarEnum); } - // This helper can produce a builder for types that are directly supported by Variant. + // This helper can produce a builder for types that are directly supported by ComVariant or our extension methods. private static SimpleArgBuilder GetSimpleArgBuilder(Type elementType, VarEnum elementVarEnum) { SimpleArgBuilder argBuilder; diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/Variant.Extended.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/Variant.Extended.cs deleted file mode 100644 index becef48a1466c2..00000000000000 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/Variant.Extended.cs +++ /dev/null @@ -1,319 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Diagnostics; -using System.Globalization; -using System.Runtime.CompilerServices; - -using Microsoft.CSharp.RuntimeBinder.ComInterop; - -namespace System.Runtime.InteropServices -{ - internal partial struct Variant - { - // VT_I1 - - public void SetAsByrefI1(ref sbyte value) - { - SetAsByref(ref value, VarEnum.VT_I1); - } - - // VT_I2 - - public void SetAsByrefI2(ref short value) - { - SetAsByref(ref value, VarEnum.VT_I2); - } - - // VT_I4 - - public void SetAsByrefI4(ref int value) - { - SetAsByref(ref value, VarEnum.VT_I4); - } - - // VT_I8 - - public void SetAsByrefI8(ref long value) - { - SetAsByref(ref value, VarEnum.VT_I8); - } - - // VT_UI1 - - public void SetAsByrefUi1(ref byte value) - { - SetAsByref(ref value, VarEnum.VT_UI1); - } - - // VT_UI2 - - public void SetAsByrefUi2(ref ushort value) - { - SetAsByref(ref value, VarEnum.VT_UI2); - } - - // VT_UI4 - - public void SetAsByrefUi4(ref uint value) - { - SetAsByref(ref value, VarEnum.VT_UI4); - } - - // VT_UI8 - - public void SetAsByrefUi8(ref ulong value) - { - SetAsByref(ref value, VarEnum.VT_UI8); - } - - // VT_INT - - public void SetAsByrefInt(ref int value) - { - SetAsByref(ref value, VarEnum.VT_INT); - } - - // VT_UINT - - public void SetAsByrefUint(ref uint value) - { - SetAsByref(ref value, VarEnum.VT_UINT); - } - - // VT_BOOL - - public void SetAsByrefBool(ref short value) - { - SetAsByref(ref value, VarEnum.VT_BOOL); - } - - // VT_ERROR - - public void SetAsByrefError(ref int value) - { - SetAsByref(ref value, VarEnum.VT_ERROR); - } - - // VT_R4 - - public void SetAsByrefR4(ref float value) - { - SetAsByref(ref value, VarEnum.VT_R4); - } - - // VT_R8 - - public void SetAsByrefR8(ref double value) - { - SetAsByref(ref value, VarEnum.VT_R8); - } - - // VT_DECIMAL - - public void SetAsByrefDecimal(ref decimal value) - { - SetAsByref(ref value, VarEnum.VT_DECIMAL); - } - - // VT_CY - - public void SetAsByrefCy(ref long value) - { - SetAsByref(ref value, VarEnum.VT_CY); - } - - // VT_DATE - - public void SetAsByrefDate(ref double value) - { - SetAsByref(ref value, VarEnum.VT_DATE); - } - - // VT_BSTR - - public void SetAsByrefBstr(ref IntPtr value) - { - SetAsByref(ref value, VarEnum.VT_BSTR); - } - - // VT_UNKNOWN - - public void SetAsByrefUnknown(ref IntPtr value) - { - SetAsByref(ref value, VarEnum.VT_UNKNOWN); - } - - // VT_DISPATCH - - public void SetAsByrefDispatch(ref IntPtr value) - { - SetAsByref(ref value, VarEnum.VT_DISPATCH); - } - - // VT_VARIANT - - public object AsVariant - { - get - { - return Marshal.GetObjectForNativeVariant(UnsafeMethods.ConvertVariantByrefToPtr(ref this)); - } - - set - { - Debug.Assert(IsEmpty); // The setter can only be called once as VariantClear might be needed otherwise - if (value != null) - { - UnsafeMethods.InitVariantForObject(value, ref this); - } - } - } - - public void SetAsByrefVariant(ref Variant value) - { - SetAsByref(ref value, VarEnum.VT_VARIANT); - } - - // constructs a ByRef variant to pass contents of another variant ByRef. - public unsafe void SetAsByrefVariantIndirect(ref Variant value) - { - Debug.Assert(IsEmpty); // The setter can only be called once as VariantClear might be needed otherwise - Debug.Assert((value.VariantType & VarEnum.VT_BYREF) == 0, "double indirection"); - - switch (value.VariantType) - { - case VarEnum.VT_EMPTY: - case VarEnum.VT_NULL: - // these cannot combine with VT_BYREF. Should try passing as a variant reference - SetAsByrefVariant(ref value); - return; - case VarEnum.VT_RECORD: - // VT_RECORD's are weird in that regardless of is the VT_BYREF flag is set or not - // they have the same internal representation. - _typeUnion._unionTypes._record = value._typeUnion._unionTypes._record; - break; - case VarEnum.VT_DECIMAL: - _typeUnion._unionTypes._byref = (IntPtr)Unsafe.AsPointer(ref value._decimal); - break; - default: - _typeUnion._unionTypes._byref = (IntPtr)Unsafe.AsPointer(ref value._typeUnion._unionTypes._byref); - break; - } - VariantType = (value.VariantType | VarEnum.VT_BYREF); - } - - private unsafe void SetAsByref(ref T value, VarEnum type) - { - Debug.Assert(IsEmpty); // The setter can only be called once as VariantClear might be needed otherwise - VariantType = type | VarEnum.VT_BYREF; - _typeUnion._unionTypes._byref = (IntPtr)Unsafe.AsPointer(ref value); - } - - internal static System.Reflection.PropertyInfo GetAccessor(VarEnum varType) - { - switch (varType) - { - case VarEnum.VT_I1: return typeof(Variant).GetProperty(nameof(AsI1)); - case VarEnum.VT_I2: return typeof(Variant).GetProperty(nameof(AsI2)); - case VarEnum.VT_I4: return typeof(Variant).GetProperty(nameof(AsI4)); - case VarEnum.VT_I8: return typeof(Variant).GetProperty(nameof(AsI8)); - case VarEnum.VT_UI1: return typeof(Variant).GetProperty(nameof(AsUi1)); - case VarEnum.VT_UI2: return typeof(Variant).GetProperty(nameof(AsUi2)); - case VarEnum.VT_UI4: return typeof(Variant).GetProperty(nameof(AsUi4)); - case VarEnum.VT_UI8: return typeof(Variant).GetProperty(nameof(AsUi8)); - case VarEnum.VT_INT: return typeof(Variant).GetProperty(nameof(AsInt)); - case VarEnum.VT_UINT: return typeof(Variant).GetProperty(nameof(AsUint)); - case VarEnum.VT_BOOL: return typeof(Variant).GetProperty(nameof(AsBool)); - case VarEnum.VT_ERROR: return typeof(Variant).GetProperty(nameof(AsError)); - case VarEnum.VT_R4: return typeof(Variant).GetProperty(nameof(AsR4)); - case VarEnum.VT_R8: return typeof(Variant).GetProperty(nameof(AsR8)); - case VarEnum.VT_DECIMAL: return typeof(Variant).GetProperty(nameof(AsDecimal)); - case VarEnum.VT_CY: return typeof(Variant).GetProperty(nameof(AsCy)); - case VarEnum.VT_DATE: return typeof(Variant).GetProperty(nameof(AsDate)); - case VarEnum.VT_BSTR: return typeof(Variant).GetProperty(nameof(AsBstr)); - case VarEnum.VT_UNKNOWN: return typeof(Variant).GetProperty(nameof(AsUnknown)); - case VarEnum.VT_DISPATCH: return typeof(Variant).GetProperty(nameof(AsDispatch)); - - case VarEnum.VT_VARIANT: - case VarEnum.VT_RECORD: - case VarEnum.VT_ARRAY: - return typeof(Variant).GetProperty(nameof(AsVariant)); - - default: - throw new NotSupportedException(); - } - } - - internal static System.Reflection.MethodInfo GetByrefSetter(VarEnum varType) - { - switch (varType) - { - case VarEnum.VT_I1: return typeof(Variant).GetMethod(nameof(SetAsByrefI1)); - case VarEnum.VT_I2: return typeof(Variant).GetMethod(nameof(SetAsByrefI2)); - case VarEnum.VT_I4: return typeof(Variant).GetMethod(nameof(SetAsByrefI4)); - case VarEnum.VT_I8: return typeof(Variant).GetMethod(nameof(SetAsByrefI8)); - case VarEnum.VT_UI1: return typeof(Variant).GetMethod(nameof(SetAsByrefUi1)); - case VarEnum.VT_UI2: return typeof(Variant).GetMethod(nameof(SetAsByrefUi2)); - case VarEnum.VT_UI4: return typeof(Variant).GetMethod(nameof(SetAsByrefUi4)); - case VarEnum.VT_UI8: return typeof(Variant).GetMethod(nameof(SetAsByrefUi8)); - case VarEnum.VT_INT: return typeof(Variant).GetMethod(nameof(SetAsByrefInt)); - case VarEnum.VT_UINT: return typeof(Variant).GetMethod(nameof(SetAsByrefUint)); - case VarEnum.VT_BOOL: return typeof(Variant).GetMethod(nameof(SetAsByrefBool)); - case VarEnum.VT_ERROR: return typeof(Variant).GetMethod(nameof(SetAsByrefError)); - case VarEnum.VT_R4: return typeof(Variant).GetMethod(nameof(SetAsByrefR4)); - case VarEnum.VT_R8: return typeof(Variant).GetMethod(nameof(SetAsByrefR8)); - case VarEnum.VT_DECIMAL: return typeof(Variant).GetMethod(nameof(SetAsByrefDecimal)); - case VarEnum.VT_CY: return typeof(Variant).GetMethod(nameof(SetAsByrefCy)); - case VarEnum.VT_DATE: return typeof(Variant).GetMethod(nameof(SetAsByrefDate)); - case VarEnum.VT_BSTR: return typeof(Variant).GetMethod(nameof(SetAsByrefBstr)); - case VarEnum.VT_UNKNOWN: return typeof(Variant).GetMethod(nameof(SetAsByrefUnknown)); - case VarEnum.VT_DISPATCH: return typeof(Variant).GetMethod(nameof(SetAsByrefDispatch)); - - case VarEnum.VT_VARIANT: - return typeof(Variant).GetMethod(nameof(SetAsByrefVariant)); - case VarEnum.VT_RECORD: - case VarEnum.VT_ARRAY: - return typeof(Variant).GetMethod(nameof(SetAsByrefVariantIndirect)); - - default: - throw new NotSupportedException(); - } - } - - public override string ToString() => $"Variant ({VariantType})"; - - public void SetAsIConvertible(IConvertible value) - { - Debug.Assert(IsEmpty); // The setter can only be called once as VariantClear might be needed otherwise - - TypeCode tc = value.GetTypeCode(); - CultureInfo ci = CultureInfo.CurrentCulture; - - switch (tc) - { - case TypeCode.Empty: break; - case TypeCode.Object: AsUnknown = value; break; - case TypeCode.DBNull: SetAsNULL(); break; - case TypeCode.Boolean: AsBool = value.ToBoolean(ci); break; - case TypeCode.Char: AsUi2 = value.ToChar(ci); break; - case TypeCode.SByte: AsI1 = value.ToSByte(ci); break; - case TypeCode.Byte: AsUi1 = value.ToByte(ci); break; - case TypeCode.Int16: AsI2 = value.ToInt16(ci); break; - case TypeCode.UInt16: AsUi2 = value.ToUInt16(ci); break; - case TypeCode.Int32: AsI4 = value.ToInt32(ci); break; - case TypeCode.UInt32: AsUi4 = value.ToUInt32(ci); break; - case TypeCode.Int64: AsI8 = value.ToInt64(ci); break; - case TypeCode.UInt64: AsI8 = value.ToInt64(ci); break; - case TypeCode.Single: AsR4 = value.ToSingle(ci); break; - case TypeCode.Double: AsR8 = value.ToDouble(ci); break; - case TypeCode.Decimal: AsDecimal = value.ToDecimal(ci); break; - case TypeCode.DateTime: AsDate = value.ToDateTime(ci); break; - case TypeCode.String: AsBstr = value.ToString(ci); break; - - default: - throw new NotSupportedException(); - } - } - } -} diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/VariantArray.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/VariantArray.cs index 37e34303feadff..559b9e92c01b1e 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/VariantArray.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/VariantArray.cs @@ -10,31 +10,32 @@ using System.Reflection; using System.Reflection.Emit; using System.Runtime.InteropServices; +using System.Runtime.InteropServices.Marshalling; namespace Microsoft.CSharp.RuntimeBinder.ComInterop { [StructLayout(LayoutKind.Sequential)] internal struct VariantArray1 { - public Variant Element0; + public ComVariant Element0; } [StructLayout(LayoutKind.Sequential)] internal struct VariantArray2 { - public Variant Element0, Element1; + public ComVariant Element0, Element1; } [StructLayout(LayoutKind.Sequential)] internal struct VariantArray4 { - public Variant Element0, Element1, Element2, Element3; + public ComVariant Element0, Element1, Element2, Element3; } [StructLayout(LayoutKind.Sequential)] internal struct VariantArray8 { - public Variant Element0, Element1, Element2, Element3, Element4, Element5, Element6, Element7; + public ComVariant Element0, Element1, Element2, Element3, Element4, Element5, Element6, Element7; } // @@ -49,7 +50,6 @@ internal static class VariantArray // Don't need a dictionary for this, it will have very few elements // (guaranteed less than 28, in practice 0-2) private static readonly List s_generatedTypes = new List(0); - private static readonly string[] s_genericTName = new string[] { "T" }; [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields, typeof(VariantArray1))] [DynamicDependency(DynamicallyAccessedMemberTypes.PublicFields, typeof(VariantArray2))] @@ -62,8 +62,6 @@ internal static MemberExpression GetStructField(ParameterExpression variantArray return Expression.Field(variantArray, "Element" + field); } - [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2055:UnrecognizedReflectionPattern", - Justification = "MakeGenericType is called on a dynamically created type that doesn't contain trimming annotations.")] internal static Type GetStructType(int args) { Debug.Assert(args >= 0); @@ -91,7 +89,7 @@ internal static Type GetStructType(int args) } // Else generate a new type - Type type = CreateCustomType(size).MakeGenericType(new Type[] { typeof(Variant) }); + Type type = CreateCustomType(size); s_generatedTypes.Add(type); return type; } @@ -101,10 +99,9 @@ private static Type CreateCustomType(int size) { TypeAttributes attrs = TypeAttributes.NotPublic | TypeAttributes.SequentialLayout; TypeBuilder type = UnsafeMethods.DynamicModule.DefineType("VariantArray" + size, attrs, typeof(ValueType)); - GenericTypeParameterBuilder T = type.DefineGenericParameters(s_genericTName)[0]; for (int i = 0; i < size; i++) { - type.DefineField("Element" + i, T, FieldAttributes.Public); + type.DefineField("Element" + i, typeof(ComVariant), FieldAttributes.Public); } return type.CreateType(); } diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/VariantBuilder.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/VariantBuilder.cs index 4fdb65bbd1aefb..39bdcc24d96478 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/VariantBuilder.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/ComInterop/VariantBuilder.cs @@ -4,12 +4,14 @@ using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Linq.Expressions; +using System.Reflection; using System.Runtime.InteropServices; +using System.Runtime.InteropServices.Marshalling; namespace Microsoft.CSharp.RuntimeBinder.ComInterop { /// - /// VariantBuilder handles packaging of arguments into a Variant for a call to IDispatch.Invoke + /// VariantBuilder handles packaging of arguments into an ComVariant for a call to IDispatch.Invoke /// internal sealed class VariantBuilder { @@ -49,8 +51,8 @@ internal Expression InitializeArgumentVariant(MemberExpression variant, Expressi return Expression.Block( Expression.Assign(TempVariable, argExpr), Expression.Call( + DynamicVariantExtensions.GetByrefSetter(_targetComType & ~VarEnum.VT_BYREF), variant, - Variant.GetByrefSetter(_targetComType & ~VarEnum.VT_BYREF), TempVariable ) ); @@ -63,13 +65,13 @@ internal Expression InitializeArgumentVariant(MemberExpression variant, Expressi if (_argBuilder is ConvertibleArgBuilder) { return Expression.Call( + typeof(DynamicVariantExtensions).GetMethod(nameof(DynamicVariantExtensions.SetAsIConvertible)), variant, - typeof(Variant).GetMethod(nameof(Variant.SetAsIConvertible)), argument ); } - if (Variant.IsPrimitiveType(_targetComType) || + if (_targetComType.IsPrimitiveType() || (_targetComType == VarEnum.VT_DISPATCH) || (_targetComType == VarEnum.VT_UNKNOWN) || (_targetComType == VarEnum.VT_VARIANT) || @@ -77,13 +79,10 @@ internal Expression InitializeArgumentVariant(MemberExpression variant, Expressi (_targetComType == VarEnum.VT_ARRAY)) { // paramVariants._elementN.AsT = (cast)argN - return Expression.Assign( - Expression.Property( - variant, - Variant.GetAccessor(_targetComType) - ), - argument - ); + return Expression.Call(null, + DynamicVariantExtensions.GetSetter(_targetComType), + variant, + argument); } switch (_targetComType) @@ -92,8 +91,8 @@ internal Expression InitializeArgumentVariant(MemberExpression variant, Expressi return null; case VarEnum.VT_NULL: - // paramVariants._elementN.SetAsNull(); - return Expression.Call(variant, typeof(Variant).GetMethod(nameof(Variant.SetAsNULL))); + // paramVariants._elementN = ComVariant.Null; + return Expression.Assign(variant, Expression.Property(null, typeof(ComVariant).GetProperty(nameof(ComVariant.Null), BindingFlags.Public | BindingFlags.Static))); default: Debug.Assert(false, "Unexpected VarEnum"); @@ -131,7 +130,7 @@ internal Expression Clear() if (_argBuilder is VariantArgBuilder) { Debug.Assert(TempVariable != null); - return Expression.Call(TempVariable, typeof(Variant).GetMethod(nameof(Variant.Clear))); + return Expression.Call(TempVariable, typeof(ComVariant).GetMethod(nameof(ComVariant.Dispose))); } return null; } @@ -148,11 +147,11 @@ internal Expression Clear() case VarEnum.VT_ARRAY: case VarEnum.VT_RECORD: case VarEnum.VT_VARIANT: - // paramVariants._elementN.Clear() - return Expression.Call(_variant, typeof(Variant).GetMethod(nameof(Variant.Clear))); + // paramVariants._elementN.Dispose() + return Expression.Call(_variant, typeof(ComVariant).GetMethod(nameof(ComVariant.Dispose))); default: - Debug.Assert(Variant.IsPrimitiveType(_targetComType), "Unexpected VarEnum"); + Debug.Assert(_targetComType.IsPrimitiveType(), "Unexpected VarEnum"); return null; } } diff --git a/src/libraries/System.Private.CoreLib/src/Resources/Strings.resx b/src/libraries/System.Private.CoreLib/src/Resources/Strings.resx index b8f8a8980528c7..540dc62f309186 100644 --- a/src/libraries/System.Private.CoreLib/src/Resources/Strings.resx +++ b/src/libraries/System.Private.CoreLib/src/Resources/Strings.resx @@ -1,17 +1,17 @@  - @@ -376,7 +376,7 @@ One of the identified items was in an invalid format. - + Generic arguments after array spec or pointer type. @@ -1080,7 +1080,7 @@ Field '{0}' does not belong to the same class as the constructor. - + Field '{0}' does not have a valid type. @@ -1502,7 +1502,7 @@ Path cannot be the empty string or all whitespace. - Value of argument {0} does not match parameter type: {1} -> {2}. + Value of argument {0} does not match parameter type: {1} -> {2}. Parameter {0} does not have a valid type. @@ -3774,7 +3774,7 @@ "Property '{0}' does not have a setter. - "Value of property '{0}' does not match property type: '{1}' -> '{2}'. + "Value of property '{0}' does not match property type: '{1}' -> '{2}'. Cannot load hostpolicy library. AssemblyDependencyResolver is currently only supported if the runtime is hosted through hostpolicy library. @@ -4253,4 +4253,25 @@ SearchValues<string> supports only StringComparison.Ordinal and StringComparison.OrdinalIgnoreCase. - + + ComVariants containing SAFEARRAYs are not supported on this platform + + + Size of {0} should be the same size as the value specified by {1} + + + Variant type '{0}' is not one of the supported variant types for this operation: [{1}] + + + VT_DECIMAL is not supported in CreateRaw. Use the Create method. + + + VT_DECIMAL is not supported in GetRawDataRef. Use the As method. + + + VT_VARIANT is not supported in variants. + + + Unsupported type + + \ No newline at end of file diff --git a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems index b27a43992e2ce7..6998e54610c793 100644 --- a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems +++ b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems @@ -978,6 +978,7 @@ + @@ -2053,6 +2054,9 @@ Common\Interop\Windows\Ole32\Interop.CoTaskMemAlloc.cs + + Common\Interop\Windows\Ole32\Interop.PropVariantClear.cs + Common\Interop\Windows\Secur32\Interop.GetUserNameExW.cs diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/ComVariant.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/ComVariant.cs new file mode 100644 index 00000000000000..95a102338e6211 --- /dev/null +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshalling/ComVariant.cs @@ -0,0 +1,569 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; +using System.Runtime.CompilerServices; + +namespace System.Runtime.InteropServices.Marshalling +{ + /// + /// A type that represents an OLE VARIANT in managed code. + /// + [StructLayout(LayoutKind.Explicit)] + public struct ComVariant : IDisposable + { + // See definition in wtypes.h in the Windows SDK. + private const VarEnum VT_VERSIONED_STREAM = (VarEnum)73; + // VARIANT_BOOL constants. + internal const short VARIANT_TRUE = -1; + internal const short VARIANT_FALSE = 0; +#if DEBUG + static unsafe ComVariant() + { + // Variant size is the size of 4 pointers (16 bytes) on a 32-bit processor, + // and 3 pointers (24 bytes) on a 64-bit processor. + // See definition in oaidl.h in the Windows SDK. + int variantSize = sizeof(ComVariant); + if (IntPtr.Size == 4) + { + Debug.Assert(variantSize == (4 * IntPtr.Size)); + } + else + { + Debug.Assert(IntPtr.Size == 8); + Debug.Assert(variantSize == (3 * IntPtr.Size)); + } + } +#endif + + // Most of the data types in the Variant are carried in _typeUnion + [FieldOffset(0)] private TypeUnion _typeUnion; + + // Decimal is the largest data type and it needs to use the space that is normally unused in TypeUnion._wReserved1, etc. + // Hence, it is declared to completely overlap with TypeUnion. A Decimal does not use the first two bytes, and so + // TypeUnion._vt can still be used to encode the type. + [FieldOffset(0)] private decimal _decimal; + + [StructLayout(LayoutKind.Sequential)] + private struct TypeUnion + { + public ushort _vt; + public ushort _wReserved1; + public ushort _wReserved2; + public ushort _wReserved3; + + public UnionTypes _unionTypes; + } + + [StructLayout(LayoutKind.Sequential)] + private struct Record + { + public IntPtr _record; + public IntPtr _recordInfo; + } + + [StructLayout(LayoutKind.Sequential)] + private struct Blob + { + public int _size; + public IntPtr _data; + } + + [StructLayout(LayoutKind.Sequential)] + private unsafe struct Vector where T : unmanaged + { + public int _numElements; + public T* _data; + + public Span AsSpan() => new(_data, _numElements); + } + + [StructLayout(LayoutKind.Sequential)] + private struct VersionedStream + { + public Guid _version; + public IntPtr _stream; + } + + [StructLayout(LayoutKind.Sequential)] + private struct ClipboardData + { + public uint _size; + public int _format; + public IntPtr _data; + } + + [StructLayout(LayoutKind.Explicit)] + private unsafe struct UnionTypes + { + [FieldOffset(0)] public sbyte _i1; + [FieldOffset(0)] public short _i2; + [FieldOffset(0)] public int _i4; + [FieldOffset(0)] public long _i8; + [FieldOffset(0)] public byte _ui1; + [FieldOffset(0)] public ushort _ui2; + [FieldOffset(0)] public uint _ui4; + [FieldOffset(0)] public ulong _ui8; + [FieldOffset(0)] public int _int; + [FieldOffset(0)] public uint _uint; + [FieldOffset(0)] public short _bool; + [FieldOffset(0)] public int _error; + [FieldOffset(0)] public float _r4; + [FieldOffset(0)] public double _r8; + [FieldOffset(0)] public long _cy; + [FieldOffset(0)] public double _date; + [FieldOffset(0)] public IntPtr _bstr; + [FieldOffset(0)] public IntPtr _unknown; + [FieldOffset(0)] public IntPtr _dispatch; + [FieldOffset(0)] public IntPtr _pvarVal; + [FieldOffset(0)] public IntPtr _byref; + [FieldOffset(0)] public Record _record; + [FieldOffset(0)] public Blob _blob; + [FieldOffset(0)] public VersionedStream* _versionedStream; + [FieldOffset(0)] public ClipboardData* clipboardData; + } + + /// + /// Release resources owned by this instance. + /// + public unsafe void Dispose() + { +#if TARGET_WINDOWS + fixed (void* pThis = &this) + { + // We are using PropVariantClear instead of VariantClear + // as PropVariantClear covers more cases (like VT_BLOB, VT_STREAM, VT_CF, etc.) + // than VariantClear does. We intend for users to be able to use this ComVariant type for + // both VARIANT and PROPVARIANT scenarios, so we need to support all of the variant kinds that might be set. + Interop.Ole32.PropVariantClear((nint)pThis); + } +#else + // Re-implement the same clearing semantics as PropVariantClear manually for non-Windows platforms. + if (VarType == VarEnum.VT_BSTR) + { + Marshal.FreeBSTR(_typeUnion._unionTypes._bstr); + } + else if (VarType.HasFlag(VarEnum.VT_ARRAY)) + { + throw new PlatformNotSupportedException(SR.ComVariant_SafeArray_PlatformNotSupported); + } + else if (VarType == VarEnum.VT_UNKNOWN || VarType == VarEnum.VT_DISPATCH) + { + if (_typeUnion._unionTypes._unknown != IntPtr.Zero) + { + Marshal.Release(_typeUnion._unionTypes._unknown); + } + } + else if (VarType == VarEnum.VT_RECORD) + { + if (_typeUnion._unionTypes._record._recordInfo != IntPtr.Zero) + { + // Invoke RecordClear on the record info with the data. + if (_typeUnion._unionTypes._record._record != IntPtr.Zero) + { + Marshal.ThrowExceptionForHR(((delegate* unmanaged)(*(*(void***)_typeUnion._unionTypes._record._recordInfo + 4 /* IRecordInfo.RecordClear slot */)))(_typeUnion._unionTypes._record._recordInfo, _typeUnion._unionTypes._record._record)); + } + Marshal.Release(_typeUnion._unionTypes._record._recordInfo); + } + } + else if (VarType == VarEnum.VT_LPSTR || VarType == VarEnum.VT_LPWSTR || VarType == VarEnum.VT_CLSID) + { + Marshal.FreeCoTaskMem(_typeUnion._unionTypes._byref); + } + else if (VarType == VarEnum.VT_BLOB || VarType == VarEnum.VT_BLOB_OBJECT) + { + Marshal.FreeCoTaskMem(_typeUnion._unionTypes._blob._data); + } + else if (VarType == VarEnum.VT_STREAM || VarType == VarEnum.VT_STREAMED_OBJECT || VarType == VarEnum.VT_STORAGE || VarType == VarEnum.VT_STORED_OBJECT) + { + if (_typeUnion._unionTypes._unknown != IntPtr.Zero) + { + Marshal.Release(_typeUnion._unionTypes._unknown); + } + } + else if (VarType == VT_VERSIONED_STREAM) + { + VersionedStream* versionedStream = _typeUnion._unionTypes._versionedStream; + if (versionedStream != null && versionedStream->_stream != IntPtr.Zero) + { + Marshal.Release(versionedStream->_stream); + } + Marshal.FreeCoTaskMem((nint)versionedStream); + } + else if (VarType == VarEnum.VT_CF) + { + ClipboardData* clipboardData = _typeUnion._unionTypes.clipboardData; + if (clipboardData != null) + { + Marshal.FreeCoTaskMem(clipboardData->_data); + Marshal.FreeCoTaskMem((nint)clipboardData); + } + } + else if (VarType.HasFlag(VarEnum.VT_VECTOR)) + { + switch (VarType & ~VarEnum.VT_VECTOR) + { + case VarEnum.VT_BSTR: + foreach (var str in GetRawDataRef>().AsSpan()) + { + Marshal.FreeBSTR(str); + } + break; + case VarEnum.VT_LPSTR: + case VarEnum.VT_LPWSTR: + foreach (var str in GetRawDataRef>().AsSpan()) + { + Marshal.FreeCoTaskMem(str); + } + break; + case VarEnum.VT_CF: + foreach (var cf in GetRawDataRef>().AsSpan()) + { + Marshal.FreeCoTaskMem(cf._data); + } + break; + case VarEnum.VT_VARIANT: + foreach (var variant in GetRawDataRef>().AsSpan()) + { + variant.Dispose(); + } + break; + default: + break; + } + Marshal.FreeCoTaskMem((nint)GetRawDataRef>()._data); + } + + // Clear out this ComVariant instance. + this = default; +#endif + } + +#pragma warning disable CS0618 // We support the obsolete CurrencyWrapper type + /// + /// Create an instance from the specified value. + /// + /// The type of the specified value. + /// The value to wrap in an . + /// An that contains the provided value. + /// When does not directly correspond to a variant type. + public static ComVariant Create([DisallowNull] T value) + { + Unsafe.SkipInit(out ComVariant variant); + if (typeof(T) == typeof(DBNull)) + { + variant = Null; + } + else if (typeof(T) == typeof(short)) + { + variant.VarType = VarEnum.VT_I2; + variant._typeUnion._unionTypes._i2 = (short)(object)value; + } + else if (typeof(T) == typeof(int)) + { + variant.VarType = VarEnum.VT_I4; + variant._typeUnion._unionTypes._i4 = (int)(object)value; + } + else if (typeof(T) == typeof(float)) + { + variant.VarType = VarEnum.VT_R4; + variant._typeUnion._unionTypes._r4 = (float)(object)value; + } + else if (typeof(T) == typeof(double)) + { + variant.VarType = VarEnum.VT_R8; + variant._typeUnion._unionTypes._r8 = (double)(object)value; + } + else if (typeof(T) == typeof(CurrencyWrapper)) + { + variant.VarType = VarEnum.VT_CY; + variant._typeUnion._unionTypes._cy = decimal.ToOACurrency(((CurrencyWrapper)(object)value).WrappedObject); + } + else if (typeof(T) == typeof(DateTime)) + { + variant.VarType = VarEnum.VT_DATE; + variant._typeUnion._unionTypes._date = ((DateTime)(object)value).ToOADate(); + } + else if (typeof(T) == typeof(BStrWrapper)) + { + variant.VarType = VarEnum.VT_BSTR; + variant._typeUnion._unionTypes._bstr = Marshal.StringToBSTR(((BStrWrapper)(object)value).WrappedObject); + } + else if (typeof(T) == typeof(string)) + { + // We map string to VT_BSTR as that's the only valid option for a VARIANT. + // The rest of the "string" options are only supported in TYPEDESCs and PROPVARIANTs, + // which are different scenarios. + // Users who want to use the ComVariant type with VT_LPSTR or VT_LPWSTR can use CreateRaw + // to do so. + variant.VarType = VarEnum.VT_BSTR; + variant._typeUnion._unionTypes._bstr = Marshal.StringToBSTR((string)(object)value); + } + else if (typeof(T) == typeof(ErrorWrapper)) + { + variant.VarType = VarEnum.VT_ERROR; + variant._typeUnion._unionTypes._error = ((ErrorWrapper)(object)value).ErrorCode; + } + else if (typeof(T) == typeof(bool)) + { + // bool values in OLE VARIANTs are VARIANT_BOOL values. + variant.VarType = VarEnum.VT_BOOL; + variant._typeUnion._unionTypes._bool = ((bool)(object)value) ? VARIANT_TRUE : VARIANT_FALSE; + } + else if (typeof(T) == typeof(decimal)) + { + // Set the value first and then the type as the decimal storage + // overlaps with the type descriminator. + variant._decimal = (decimal)(object)value; + variant.VarType = VarEnum.VT_DECIMAL; + } + else if (typeof(T) == typeof(sbyte)) + { + variant.VarType = VarEnum.VT_I1; + variant._typeUnion._unionTypes._i1 = (sbyte)(object)value; + } + else if (typeof(T) == typeof(byte)) + { + variant.VarType = VarEnum.VT_UI1; + variant._typeUnion._unionTypes._ui1 = (byte)(object)value; + } + else if (typeof(T) == typeof(ushort)) + { + variant.VarType = VarEnum.VT_UI2; + variant._typeUnion._unionTypes._ui2 = (ushort)(object)value; + } + else if (typeof(T) == typeof(uint)) + { + variant.VarType = VarEnum.VT_UI4; + variant._typeUnion._unionTypes._ui4 = (uint)(object)value; + } + else if (typeof(T) == typeof(long)) + { + variant.VarType = VarEnum.VT_I8; + variant._typeUnion._unionTypes._i8 = (long)(object)value; + } + else if (typeof(T) == typeof(ulong)) + { + variant.VarType = VarEnum.VT_UI8; + variant._typeUnion._unionTypes._ui8 = (ulong)(object)value; + } + else + { + throw new ArgumentException(SR.UnsupportedType, nameof(T)); + } + // We do not support mapping nint or nuint to VT_INT and VT_UINT respectively + // as this does not match the MS-OAUT spec. + // We do not map VT_BYREF automatically, nor do we map any of the array types. + return variant; + } +#pragma warning restore CS0618 + + /// + /// Create a with the given type and provided value. + /// + /// The type of the value to store in the variant. + /// The type of the variant + /// The raw value to store in the variant without any processing + /// A variant that contains the provided value. + /// When the provided corresponds to a variant type that is not supported in VARIANTs or is + /// When the provided specifies the flag for SAFEARRAYs. + public static unsafe ComVariant CreateRaw(VarEnum vt, T rawValue) + where T : unmanaged + { + ArgumentOutOfRangeException.ThrowIfGreaterThan(Unsafe.SizeOf(), sizeof(UnionTypes), nameof(T)); + if (vt == VarEnum.VT_DECIMAL) + { + throw new ArgumentException(SR.ComVariant_VT_DECIMAL_NotSupported_CreateRaw, nameof(vt)); + } + if (vt == VarEnum.VT_VARIANT) + { + throw new ArgumentException(SR.ComVariant_VT_VARIANT_In_Variant, nameof(vt)); + } + if (vt.HasFlag(VarEnum.VT_ARRAY) && !OperatingSystem.IsWindows()) + { + throw new PlatformNotSupportedException(SR.ComVariant_SafeArray_PlatformNotSupported); + } + + Unsafe.SkipInit(out ComVariant value); + value.VarType = vt; + value.GetRawDataRef() = (vt, sizeof(T)) switch + { + (VarEnum.VT_I1 or VarEnum.VT_UI1, 1) => rawValue, + (VarEnum.VT_I2 or VarEnum.VT_UI2 or VarEnum.VT_BOOL, 2) => rawValue, + (VarEnum.VT_ERROR or VarEnum.VT_HRESULT or VarEnum.VT_I4 or VarEnum.VT_UI4 or VarEnum.VT_R4 or VarEnum.VT_INT or VarEnum.VT_UINT, 4) => rawValue, + (VarEnum.VT_I8 or VarEnum.VT_UI8 or VarEnum.VT_R8 or VarEnum.VT_DATE, 8) => rawValue, + (VarEnum.VT_UNKNOWN or VarEnum.VT_DISPATCH or VarEnum.VT_LPSTR or VarEnum.VT_BSTR or VarEnum.VT_LPWSTR or VarEnum.VT_SAFEARRAY + or VarEnum.VT_CLSID or VarEnum.VT_STREAM or VarEnum.VT_STREAMED_OBJECT or VarEnum.VT_STORAGE or VarEnum.VT_STORED_OBJECT or VarEnum.VT_CF or VT_VERSIONED_STREAM, _) when sizeof(T) == nint.Size => rawValue, + (VarEnum.VT_CY or VarEnum.VT_FILETIME, 8) => rawValue, + (VarEnum.VT_RECORD, _) when sizeof(T) == sizeof(Record) => rawValue, + _ when vt.HasFlag(VarEnum.VT_BYREF) && sizeof(T) == nint.Size => rawValue, + _ when vt.HasFlag(VarEnum.VT_VECTOR) && sizeof(T) == sizeof(Vector) => rawValue, + _ when vt.HasFlag(VarEnum.VT_ARRAY) && sizeof(T) == nint.Size => rawValue, + (VarEnum.VT_BLOB or VarEnum.VT_BLOB_OBJECT, _) when sizeof(T) == sizeof(Blob) => rawValue, + _ => throw new ArgumentException(SR.Format(SR.ComVariant_SizeMustMatchVariantSize, nameof(T), nameof(vt))) + }; + + return value; + } + + /// + /// A instance that represents a null value with type. + /// + public static ComVariant Null { get; } = new() { VarType = VarEnum.VT_NULL }; + + private readonly void ThrowIfNotVarType(params VarEnum[] requiredType) + { + if (Array.IndexOf(requiredType, VarType) == -1) + { + throw new InvalidOperationException(SR.Format(SR.ComVariant_TypeIsNotSupportedType, VarType, string.Join(", ", requiredType))); + } + } + +#pragma warning disable CS0618 // Type or member is obsolete + /// + /// Create a managed value based on the value in the instance. + /// + /// The managed type to create an instance of. + /// The managed value contained in this variant. + /// When does not match the of the . + public readonly T? As() + { + if (VarType == VarEnum.VT_EMPTY) + { + return default; + } + if (typeof(T) == typeof(DBNull)) + { + ThrowIfNotVarType(VarEnum.VT_NULL); + return (T)(object)DBNull.Value; + } + else if (typeof(T) == typeof(short)) + { + ThrowIfNotVarType(VarEnum.VT_I2); + return (T)(object)_typeUnion._unionTypes._i2; + } + else if (typeof(T) == typeof(int)) + { + ThrowIfNotVarType(VarEnum.VT_I4, VarEnum.VT_ERROR, VarEnum.VT_INT); + return (T)(object)_typeUnion._unionTypes._i4; + } + else if (typeof(T) == typeof(float)) + { + ThrowIfNotVarType(VarEnum.VT_R4); + return (T)(object)_typeUnion._unionTypes._r4; + } + else if (typeof(T) == typeof(double)) + { + ThrowIfNotVarType(VarEnum.VT_R8); + return (T)(object)_typeUnion._unionTypes._r8; + } + else if (typeof(T) == typeof(CurrencyWrapper)) + { + ThrowIfNotVarType(VarEnum.VT_CY); + return (T)(object)new CurrencyWrapper(decimal.FromOACurrency(_typeUnion._unionTypes._cy)); + } + else if (typeof(T) == typeof(DateTime)) + { + ThrowIfNotVarType(VarEnum.VT_DATE); + return (T)(object)DateTime.FromOADate(_typeUnion._unionTypes._date); + } + else if (typeof(T) == typeof(BStrWrapper)) + { + ThrowIfNotVarType(VarEnum.VT_BSTR); + return (T)(object)new BStrWrapper(Marshal.PtrToStringBSTR(_typeUnion._unionTypes._bstr)); + } + else if (typeof(T) == typeof(string)) + { + // To match the Create method, we will only support getting a string from an ComVariant + // when the ComVariant holds a BSTR. + ThrowIfNotVarType(VarEnum.VT_BSTR); + if (_typeUnion._unionTypes._bstr == IntPtr.Zero) + { + return default; + } + return (T)(object)Marshal.PtrToStringBSTR(_typeUnion._unionTypes._bstr); + } + else if (typeof(T) == typeof(ErrorWrapper)) + { + ThrowIfNotVarType(VarEnum.VT_ERROR); + return (T)(object)new ErrorWrapper(_typeUnion._unionTypes._error); + } + else if (typeof(T) == typeof(bool)) + { + // bool values in OLE VARIANTs are VARIANT_BOOL values. + ThrowIfNotVarType(VarEnum.VT_BOOL); + return (T)(object)(_typeUnion._unionTypes._bool != VARIANT_FALSE); + } + else if (typeof(T) == typeof(decimal)) + { + // Set the value first and then the type as the decimal storage + // overlaps with the type descriminator. + ThrowIfNotVarType(VarEnum.VT_DECIMAL); + // Create a second variant copy with the VarType set to VT_EMPTY. + // This will ensure that we don't leak the VT_DECMIAL flag into the decimal value itself. + ComVariant variantWithoutVarType = this; + variantWithoutVarType.VarType = VarEnum.VT_EMPTY; + return (T)(object)variantWithoutVarType._decimal; + } + else if (typeof(T) == typeof(sbyte)) + { + ThrowIfNotVarType(VarEnum.VT_I1); + return (T)(object)_typeUnion._unionTypes._i1; + } + else if (typeof(T) == typeof(byte)) + { + ThrowIfNotVarType(VarEnum.VT_UI1); + return (T)(object)_typeUnion._unionTypes._ui1; + } + else if (typeof(T) == typeof(ushort)) + { + ThrowIfNotVarType(VarEnum.VT_UI2); + return (T)(object)_typeUnion._unionTypes._ui2; + } + else if (typeof(T) == typeof(uint)) + { + ThrowIfNotVarType(VarEnum.VT_UI4, VarEnum.VT_UINT); + return (T)(object)_typeUnion._unionTypes._ui4; + } + else if (typeof(T) == typeof(long)) + { + ThrowIfNotVarType(VarEnum.VT_I8); + return (T)(object)_typeUnion._unionTypes._i8; + } + else if (typeof(T) == typeof(ulong)) + { + ThrowIfNotVarType(VarEnum.VT_UI8); + return (T)(object)_typeUnion._unionTypes._ui8; + } + throw new ArgumentException(SR.UnsupportedType, nameof(T)); + } +#pragma warning restore CS0618 // Type or member is obsolete + + /// + /// The type of the data stored in this . + /// + public VarEnum VarType + { + readonly get => (VarEnum)_typeUnion._vt; + private set => _typeUnion._vt = (ushort)value; + } + + /// + /// Get a reference to the storage location within this instance. + /// + /// The type of reference to return. + /// A reference to the storage location within this . + /// is or larger than the storage space in an . + [UnscopedRef] + public unsafe ref T GetRawDataRef() + where T : unmanaged + { + ArgumentOutOfRangeException.ThrowIfGreaterThan(Unsafe.SizeOf(), sizeof(UnionTypes), nameof(T)); + if (typeof(T) == typeof(decimal)) + { + throw new ArgumentException(SR.ComVariant_VT_DECIMAL_NotSupported_RawDataRef, nameof(T)); + } + return ref Unsafe.As(ref _typeUnion._unionTypes); + } + } +} diff --git a/src/libraries/System.Runtime.InteropServices/System.Runtime.InteropServices.sln b/src/libraries/System.Runtime.InteropServices/System.Runtime.InteropServices.sln index e9534f4a25c813..56ccb89703b8ef 100644 --- a/src/libraries/System.Runtime.InteropServices/System.Runtime.InteropServices.sln +++ b/src/libraries/System.Runtime.InteropServices/System.Runtime.InteropServices.sln @@ -1,4 +1,8 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.8.34117.57 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Private.CoreLib", "..\..\coreclr\System.Private.CoreLib\System.Private.CoreLib.csproj", "{94B59BA0-491F-4B59-ADFF-A057EC3EC835}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestUtilities", "..\Common\tests\TestUtilities\TestUtilities.csproj", "{1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}" @@ -73,16 +77,21 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{B1678CCD-95C EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gen", "gen", "{E1AEBD5D-AE4E-4F61-B9ED-AEF950B0CC33}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gen", "tools\gen", "{8826C1E1-CEBD-49F8-9BC8-97FECE60F9B9}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gen", "gen", "{8826C1E1-CEBD-49F8-9BC8-97FECE60F9B9}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "tools\src", "{7B3C7C2F-58E0-4EE5-B904-9C978F40FD33}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{7B3C7C2F-58E0-4EE5-B904-9C978F40FD33}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "tools\ref", "{5114BD7E-8492-452A-8DAA-BF971D74A66D}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "ref", "{5114BD7E-8492-452A-8DAA-BF971D74A66D}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{8FA3249B-3567-4C76-BA32-9488FC92994D}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Checked|Any CPU = Checked|Any CPU + Checked|arm = Checked|arm + Checked|arm64 = Checked|arm64 + Checked|x64 = Checked|x64 + Checked|x86 = Checked|x86 Debug|Any CPU = Debug|Any CPU Debug|arm = Debug|arm Debug|arm64 = Debug|arm64 @@ -93,13 +102,18 @@ Global Release|arm64 = Release|arm64 Release|x64 = Release|x64 Release|x86 = Release|x86 - Checked|Any CPU = Checked|Any CPU - Checked|arm = Checked|arm - Checked|arm64 = Checked|arm64 - Checked|x64 = Checked|x64 - Checked|x86 = Checked|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|Any CPU.ActiveCfg = Checked|x64 + {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|Any CPU.Build.0 = Checked|x64 + {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|arm.ActiveCfg = Checked|arm + {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|arm.Build.0 = Checked|arm + {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|arm64.ActiveCfg = Checked|arm64 + {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|arm64.Build.0 = Checked|arm64 + {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|x64.ActiveCfg = Checked|x64 + {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|x64.Build.0 = Checked|x64 + {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|x86.ActiveCfg = Checked|x86 + {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|x86.Build.0 = Checked|x86 {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Debug|Any CPU.ActiveCfg = Debug|x64 {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Debug|Any CPU.Build.0 = Debug|x64 {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Debug|arm.ActiveCfg = Debug|arm @@ -120,16 +134,11 @@ Global {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Release|x64.Build.0 = Release|x64 {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Release|x86.ActiveCfg = Release|x86 {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Release|x86.Build.0 = Release|x86 - {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|Any CPU.ActiveCfg = Checked|x64 - {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|Any CPU.Build.0 = Checked|x64 - {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|arm.ActiveCfg = Checked|arm - {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|arm.Build.0 = Checked|arm - {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|arm64.ActiveCfg = Checked|arm64 - {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|arm64.Build.0 = Checked|arm64 - {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|x64.ActiveCfg = Checked|x64 - {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|x64.Build.0 = Checked|x64 - {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|x86.ActiveCfg = Checked|x86 - {94B59BA0-491F-4B59-ADFF-A057EC3EC835}.Checked|x86.Build.0 = Checked|x86 + {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Checked|arm.ActiveCfg = Debug|Any CPU + {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Checked|arm64.ActiveCfg = Debug|Any CPU + {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Checked|x64.ActiveCfg = Debug|Any CPU + {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Checked|x86.ActiveCfg = Debug|Any CPU {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Debug|Any CPU.Build.0 = Debug|Any CPU {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -146,11 +155,11 @@ Global {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Release|x64.Build.0 = Release|Any CPU {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Release|x86.ActiveCfg = Release|Any CPU {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Release|x86.Build.0 = Release|Any CPU - {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Checked|arm.ActiveCfg = Debug|Any CPU - {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Checked|arm64.ActiveCfg = Debug|Any CPU - {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Checked|x64.ActiveCfg = Debug|Any CPU - {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA}.Checked|x86.ActiveCfg = Debug|Any CPU + {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0}.Checked|arm.ActiveCfg = Debug|Any CPU + {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0}.Checked|arm64.ActiveCfg = Debug|Any CPU + {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0}.Checked|x64.ActiveCfg = Debug|Any CPU + {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0}.Checked|x86.ActiveCfg = Debug|Any CPU {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0}.Debug|Any CPU.Build.0 = Debug|Any CPU {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -167,11 +176,11 @@ Global {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0}.Release|x64.Build.0 = Release|Any CPU {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0}.Release|x86.ActiveCfg = Release|Any CPU {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0}.Release|x86.Build.0 = Release|Any CPU - {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0}.Checked|arm.ActiveCfg = Debug|Any CPU - {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0}.Checked|arm64.ActiveCfg = Debug|Any CPU - {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0}.Checked|x64.ActiveCfg = Debug|Any CPU - {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0}.Checked|x86.ActiveCfg = Debug|Any CPU + {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69}.Checked|arm.ActiveCfg = Debug|Any CPU + {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69}.Checked|arm64.ActiveCfg = Debug|Any CPU + {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69}.Checked|x64.ActiveCfg = Debug|Any CPU + {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69}.Checked|x86.ActiveCfg = Debug|Any CPU {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69}.Debug|Any CPU.Build.0 = Debug|Any CPU {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -188,11 +197,11 @@ Global {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69}.Release|x64.Build.0 = Release|Any CPU {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69}.Release|x86.ActiveCfg = Release|Any CPU {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69}.Release|x86.Build.0 = Release|Any CPU - {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69}.Checked|arm.ActiveCfg = Debug|Any CPU - {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69}.Checked|arm64.ActiveCfg = Debug|Any CPU - {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69}.Checked|x64.ActiveCfg = Debug|Any CPU - {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69}.Checked|x86.ActiveCfg = Debug|Any CPU + {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A}.Checked|arm.ActiveCfg = Debug|Any CPU + {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A}.Checked|arm64.ActiveCfg = Debug|Any CPU + {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A}.Checked|x64.ActiveCfg = Debug|Any CPU + {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A}.Checked|x86.ActiveCfg = Debug|Any CPU {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A}.Debug|Any CPU.Build.0 = Debug|Any CPU {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -209,11 +218,11 @@ Global {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A}.Release|x64.Build.0 = Release|Any CPU {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A}.Release|x86.ActiveCfg = Release|Any CPU {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A}.Release|x86.Build.0 = Release|Any CPU - {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A}.Checked|arm.ActiveCfg = Debug|Any CPU - {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A}.Checked|arm64.ActiveCfg = Debug|Any CPU - {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A}.Checked|x64.ActiveCfg = Debug|Any CPU - {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A}.Checked|x86.ActiveCfg = Debug|Any CPU + {C4B641C3-3317-4913-91DA-0DA3B64BABED}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {C4B641C3-3317-4913-91DA-0DA3B64BABED}.Checked|arm.ActiveCfg = Debug|Any CPU + {C4B641C3-3317-4913-91DA-0DA3B64BABED}.Checked|arm64.ActiveCfg = Debug|Any CPU + {C4B641C3-3317-4913-91DA-0DA3B64BABED}.Checked|x64.ActiveCfg = Debug|Any CPU + {C4B641C3-3317-4913-91DA-0DA3B64BABED}.Checked|x86.ActiveCfg = Debug|Any CPU {C4B641C3-3317-4913-91DA-0DA3B64BABED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C4B641C3-3317-4913-91DA-0DA3B64BABED}.Debug|Any CPU.Build.0 = Debug|Any CPU {C4B641C3-3317-4913-91DA-0DA3B64BABED}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -230,11 +239,11 @@ Global {C4B641C3-3317-4913-91DA-0DA3B64BABED}.Release|x64.Build.0 = Release|Any CPU {C4B641C3-3317-4913-91DA-0DA3B64BABED}.Release|x86.ActiveCfg = Release|Any CPU {C4B641C3-3317-4913-91DA-0DA3B64BABED}.Release|x86.Build.0 = Release|Any CPU - {C4B641C3-3317-4913-91DA-0DA3B64BABED}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {C4B641C3-3317-4913-91DA-0DA3B64BABED}.Checked|arm.ActiveCfg = Debug|Any CPU - {C4B641C3-3317-4913-91DA-0DA3B64BABED}.Checked|arm64.ActiveCfg = Debug|Any CPU - {C4B641C3-3317-4913-91DA-0DA3B64BABED}.Checked|x64.ActiveCfg = Debug|Any CPU - {C4B641C3-3317-4913-91DA-0DA3B64BABED}.Checked|x86.ActiveCfg = Debug|Any CPU + {3FB6F2AA-E763-4336-B927-18AB7AAF6C20}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {3FB6F2AA-E763-4336-B927-18AB7AAF6C20}.Checked|arm.ActiveCfg = Debug|Any CPU + {3FB6F2AA-E763-4336-B927-18AB7AAF6C20}.Checked|arm64.ActiveCfg = Debug|Any CPU + {3FB6F2AA-E763-4336-B927-18AB7AAF6C20}.Checked|x64.ActiveCfg = Debug|Any CPU + {3FB6F2AA-E763-4336-B927-18AB7AAF6C20}.Checked|x86.ActiveCfg = Debug|Any CPU {3FB6F2AA-E763-4336-B927-18AB7AAF6C20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3FB6F2AA-E763-4336-B927-18AB7AAF6C20}.Debug|Any CPU.Build.0 = Debug|Any CPU {3FB6F2AA-E763-4336-B927-18AB7AAF6C20}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -251,11 +260,11 @@ Global {3FB6F2AA-E763-4336-B927-18AB7AAF6C20}.Release|x64.Build.0 = Release|Any CPU {3FB6F2AA-E763-4336-B927-18AB7AAF6C20}.Release|x86.ActiveCfg = Release|Any CPU {3FB6F2AA-E763-4336-B927-18AB7AAF6C20}.Release|x86.Build.0 = Release|Any CPU - {3FB6F2AA-E763-4336-B927-18AB7AAF6C20}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {3FB6F2AA-E763-4336-B927-18AB7AAF6C20}.Checked|arm.ActiveCfg = Debug|Any CPU - {3FB6F2AA-E763-4336-B927-18AB7AAF6C20}.Checked|arm64.ActiveCfg = Debug|Any CPU - {3FB6F2AA-E763-4336-B927-18AB7AAF6C20}.Checked|x64.ActiveCfg = Debug|Any CPU - {3FB6F2AA-E763-4336-B927-18AB7AAF6C20}.Checked|x86.ActiveCfg = Debug|Any CPU + {716ED44B-37C8-4776-BE70-285952D2B30D}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {716ED44B-37C8-4776-BE70-285952D2B30D}.Checked|arm.ActiveCfg = Debug|Any CPU + {716ED44B-37C8-4776-BE70-285952D2B30D}.Checked|arm64.ActiveCfg = Debug|Any CPU + {716ED44B-37C8-4776-BE70-285952D2B30D}.Checked|x64.ActiveCfg = Debug|Any CPU + {716ED44B-37C8-4776-BE70-285952D2B30D}.Checked|x86.ActiveCfg = Debug|Any CPU {716ED44B-37C8-4776-BE70-285952D2B30D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {716ED44B-37C8-4776-BE70-285952D2B30D}.Debug|Any CPU.Build.0 = Debug|Any CPU {716ED44B-37C8-4776-BE70-285952D2B30D}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -272,11 +281,11 @@ Global {716ED44B-37C8-4776-BE70-285952D2B30D}.Release|x64.Build.0 = Release|Any CPU {716ED44B-37C8-4776-BE70-285952D2B30D}.Release|x86.ActiveCfg = Release|Any CPU {716ED44B-37C8-4776-BE70-285952D2B30D}.Release|x86.Build.0 = Release|Any CPU - {716ED44B-37C8-4776-BE70-285952D2B30D}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {716ED44B-37C8-4776-BE70-285952D2B30D}.Checked|arm.ActiveCfg = Debug|Any CPU - {716ED44B-37C8-4776-BE70-285952D2B30D}.Checked|arm64.ActiveCfg = Debug|Any CPU - {716ED44B-37C8-4776-BE70-285952D2B30D}.Checked|x64.ActiveCfg = Debug|Any CPU - {716ED44B-37C8-4776-BE70-285952D2B30D}.Checked|x86.ActiveCfg = Debug|Any CPU + {1B248B4C-7584-4C04-850A-A50EB592052C}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {1B248B4C-7584-4C04-850A-A50EB592052C}.Checked|arm.ActiveCfg = Debug|Any CPU + {1B248B4C-7584-4C04-850A-A50EB592052C}.Checked|arm64.ActiveCfg = Debug|Any CPU + {1B248B4C-7584-4C04-850A-A50EB592052C}.Checked|x64.ActiveCfg = Debug|Any CPU + {1B248B4C-7584-4C04-850A-A50EB592052C}.Checked|x86.ActiveCfg = Debug|Any CPU {1B248B4C-7584-4C04-850A-A50EB592052C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1B248B4C-7584-4C04-850A-A50EB592052C}.Debug|Any CPU.Build.0 = Debug|Any CPU {1B248B4C-7584-4C04-850A-A50EB592052C}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -293,11 +302,11 @@ Global {1B248B4C-7584-4C04-850A-A50EB592052C}.Release|x64.Build.0 = Release|Any CPU {1B248B4C-7584-4C04-850A-A50EB592052C}.Release|x86.ActiveCfg = Release|Any CPU {1B248B4C-7584-4C04-850A-A50EB592052C}.Release|x86.Build.0 = Release|Any CPU - {1B248B4C-7584-4C04-850A-A50EB592052C}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {1B248B4C-7584-4C04-850A-A50EB592052C}.Checked|arm.ActiveCfg = Debug|Any CPU - {1B248B4C-7584-4C04-850A-A50EB592052C}.Checked|arm64.ActiveCfg = Debug|Any CPU - {1B248B4C-7584-4C04-850A-A50EB592052C}.Checked|x64.ActiveCfg = Debug|Any CPU - {1B248B4C-7584-4C04-850A-A50EB592052C}.Checked|x86.ActiveCfg = Debug|Any CPU + {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886}.Checked|arm.ActiveCfg = Debug|Any CPU + {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886}.Checked|arm64.ActiveCfg = Debug|Any CPU + {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886}.Checked|x64.ActiveCfg = Debug|Any CPU + {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886}.Checked|x86.ActiveCfg = Debug|Any CPU {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886}.Debug|Any CPU.Build.0 = Debug|Any CPU {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -314,11 +323,11 @@ Global {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886}.Release|x64.Build.0 = Release|Any CPU {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886}.Release|x86.ActiveCfg = Release|Any CPU {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886}.Release|x86.Build.0 = Release|Any CPU - {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886}.Checked|arm.ActiveCfg = Debug|Any CPU - {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886}.Checked|arm64.ActiveCfg = Debug|Any CPU - {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886}.Checked|x64.ActiveCfg = Debug|Any CPU - {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886}.Checked|x86.ActiveCfg = Debug|Any CPU + {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5}.Checked|arm.ActiveCfg = Debug|Any CPU + {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5}.Checked|arm64.ActiveCfg = Debug|Any CPU + {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5}.Checked|x64.ActiveCfg = Debug|Any CPU + {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5}.Checked|x86.ActiveCfg = Debug|Any CPU {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5}.Debug|Any CPU.Build.0 = Debug|Any CPU {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -335,11 +344,11 @@ Global {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5}.Release|x64.Build.0 = Release|Any CPU {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5}.Release|x86.ActiveCfg = Release|Any CPU {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5}.Release|x86.Build.0 = Release|Any CPU - {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5}.Checked|arm.ActiveCfg = Debug|Any CPU - {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5}.Checked|arm64.ActiveCfg = Debug|Any CPU - {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5}.Checked|x64.ActiveCfg = Debug|Any CPU - {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5}.Checked|x86.ActiveCfg = Debug|Any CPU + {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40}.Checked|arm.ActiveCfg = Debug|Any CPU + {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40}.Checked|arm64.ActiveCfg = Debug|Any CPU + {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40}.Checked|x64.ActiveCfg = Debug|Any CPU + {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40}.Checked|x86.ActiveCfg = Debug|Any CPU {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40}.Debug|Any CPU.Build.0 = Debug|Any CPU {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -356,11 +365,11 @@ Global {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40}.Release|x64.Build.0 = Release|Any CPU {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40}.Release|x86.ActiveCfg = Release|Any CPU {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40}.Release|x86.Build.0 = Release|Any CPU - {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40}.Checked|arm.ActiveCfg = Debug|Any CPU - {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40}.Checked|arm64.ActiveCfg = Debug|Any CPU - {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40}.Checked|x64.ActiveCfg = Debug|Any CPU - {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40}.Checked|x86.ActiveCfg = Debug|Any CPU + {768B77B0-EA45-469D-B39E-545EB72F5A43}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {768B77B0-EA45-469D-B39E-545EB72F5A43}.Checked|arm.ActiveCfg = Debug|Any CPU + {768B77B0-EA45-469D-B39E-545EB72F5A43}.Checked|arm64.ActiveCfg = Debug|Any CPU + {768B77B0-EA45-469D-B39E-545EB72F5A43}.Checked|x64.ActiveCfg = Debug|Any CPU + {768B77B0-EA45-469D-B39E-545EB72F5A43}.Checked|x86.ActiveCfg = Debug|Any CPU {768B77B0-EA45-469D-B39E-545EB72F5A43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {768B77B0-EA45-469D-B39E-545EB72F5A43}.Debug|Any CPU.Build.0 = Debug|Any CPU {768B77B0-EA45-469D-B39E-545EB72F5A43}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -377,11 +386,11 @@ Global {768B77B0-EA45-469D-B39E-545EB72F5A43}.Release|x64.Build.0 = Release|Any CPU {768B77B0-EA45-469D-B39E-545EB72F5A43}.Release|x86.ActiveCfg = Release|Any CPU {768B77B0-EA45-469D-B39E-545EB72F5A43}.Release|x86.Build.0 = Release|Any CPU - {768B77B0-EA45-469D-B39E-545EB72F5A43}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {768B77B0-EA45-469D-B39E-545EB72F5A43}.Checked|arm.ActiveCfg = Debug|Any CPU - {768B77B0-EA45-469D-B39E-545EB72F5A43}.Checked|arm64.ActiveCfg = Debug|Any CPU - {768B77B0-EA45-469D-B39E-545EB72F5A43}.Checked|x64.ActiveCfg = Debug|Any CPU - {768B77B0-EA45-469D-B39E-545EB72F5A43}.Checked|x86.ActiveCfg = Debug|Any CPU + {8671F164-F78C-44FA-93B7-A310F67890FE}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {8671F164-F78C-44FA-93B7-A310F67890FE}.Checked|arm.ActiveCfg = Debug|Any CPU + {8671F164-F78C-44FA-93B7-A310F67890FE}.Checked|arm64.ActiveCfg = Debug|Any CPU + {8671F164-F78C-44FA-93B7-A310F67890FE}.Checked|x64.ActiveCfg = Debug|Any CPU + {8671F164-F78C-44FA-93B7-A310F67890FE}.Checked|x86.ActiveCfg = Debug|Any CPU {8671F164-F78C-44FA-93B7-A310F67890FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8671F164-F78C-44FA-93B7-A310F67890FE}.Debug|Any CPU.Build.0 = Debug|Any CPU {8671F164-F78C-44FA-93B7-A310F67890FE}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -398,11 +407,11 @@ Global {8671F164-F78C-44FA-93B7-A310F67890FE}.Release|x64.Build.0 = Release|Any CPU {8671F164-F78C-44FA-93B7-A310F67890FE}.Release|x86.ActiveCfg = Release|Any CPU {8671F164-F78C-44FA-93B7-A310F67890FE}.Release|x86.Build.0 = Release|Any CPU - {8671F164-F78C-44FA-93B7-A310F67890FE}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {8671F164-F78C-44FA-93B7-A310F67890FE}.Checked|arm.ActiveCfg = Debug|Any CPU - {8671F164-F78C-44FA-93B7-A310F67890FE}.Checked|arm64.ActiveCfg = Debug|Any CPU - {8671F164-F78C-44FA-93B7-A310F67890FE}.Checked|x64.ActiveCfg = Debug|Any CPU - {8671F164-F78C-44FA-93B7-A310F67890FE}.Checked|x86.ActiveCfg = Debug|Any CPU + {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Checked|arm.ActiveCfg = Debug|Any CPU + {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Checked|arm64.ActiveCfg = Debug|Any CPU + {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Checked|x64.ActiveCfg = Debug|Any CPU + {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Checked|x86.ActiveCfg = Debug|Any CPU {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Debug|Any CPU.Build.0 = Debug|Any CPU {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -419,11 +428,11 @@ Global {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Release|x64.Build.0 = Release|Any CPU {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Release|x86.ActiveCfg = Release|Any CPU {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Release|x86.Build.0 = Release|Any CPU - {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Checked|arm.ActiveCfg = Debug|Any CPU - {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Checked|arm64.ActiveCfg = Debug|Any CPU - {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Checked|x64.ActiveCfg = Debug|Any CPU - {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1}.Checked|x86.ActiveCfg = Debug|Any CPU + {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Checked|arm.ActiveCfg = Debug|Any CPU + {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Checked|arm64.ActiveCfg = Debug|Any CPU + {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Checked|x64.ActiveCfg = Debug|Any CPU + {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Checked|x86.ActiveCfg = Debug|Any CPU {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Debug|Any CPU.Build.0 = Debug|Any CPU {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -440,11 +449,11 @@ Global {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Release|x64.Build.0 = Release|Any CPU {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Release|x86.ActiveCfg = Release|Any CPU {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Release|x86.Build.0 = Release|Any CPU - {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Checked|arm.ActiveCfg = Debug|Any CPU - {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Checked|arm64.ActiveCfg = Debug|Any CPU - {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Checked|x64.ActiveCfg = Debug|Any CPU - {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E}.Checked|x86.ActiveCfg = Debug|Any CPU + {3741C833-C364-4269-9B1D-D442055DA7CE}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {3741C833-C364-4269-9B1D-D442055DA7CE}.Checked|arm.ActiveCfg = Debug|Any CPU + {3741C833-C364-4269-9B1D-D442055DA7CE}.Checked|arm64.ActiveCfg = Debug|Any CPU + {3741C833-C364-4269-9B1D-D442055DA7CE}.Checked|x64.ActiveCfg = Debug|Any CPU + {3741C833-C364-4269-9B1D-D442055DA7CE}.Checked|x86.ActiveCfg = Debug|Any CPU {3741C833-C364-4269-9B1D-D442055DA7CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3741C833-C364-4269-9B1D-D442055DA7CE}.Debug|Any CPU.Build.0 = Debug|Any CPU {3741C833-C364-4269-9B1D-D442055DA7CE}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -461,11 +470,11 @@ Global {3741C833-C364-4269-9B1D-D442055DA7CE}.Release|x64.Build.0 = Release|Any CPU {3741C833-C364-4269-9B1D-D442055DA7CE}.Release|x86.ActiveCfg = Release|Any CPU {3741C833-C364-4269-9B1D-D442055DA7CE}.Release|x86.Build.0 = Release|Any CPU - {3741C833-C364-4269-9B1D-D442055DA7CE}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {3741C833-C364-4269-9B1D-D442055DA7CE}.Checked|arm.ActiveCfg = Debug|Any CPU - {3741C833-C364-4269-9B1D-D442055DA7CE}.Checked|arm64.ActiveCfg = Debug|Any CPU - {3741C833-C364-4269-9B1D-D442055DA7CE}.Checked|x64.ActiveCfg = Debug|Any CPU - {3741C833-C364-4269-9B1D-D442055DA7CE}.Checked|x86.ActiveCfg = Debug|Any CPU + {1D771995-D475-429B-AC31-2B1F618AA45F}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {1D771995-D475-429B-AC31-2B1F618AA45F}.Checked|arm.ActiveCfg = Debug|Any CPU + {1D771995-D475-429B-AC31-2B1F618AA45F}.Checked|arm64.ActiveCfg = Debug|Any CPU + {1D771995-D475-429B-AC31-2B1F618AA45F}.Checked|x64.ActiveCfg = Debug|Any CPU + {1D771995-D475-429B-AC31-2B1F618AA45F}.Checked|x86.ActiveCfg = Debug|Any CPU {1D771995-D475-429B-AC31-2B1F618AA45F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1D771995-D475-429B-AC31-2B1F618AA45F}.Debug|Any CPU.Build.0 = Debug|Any CPU {1D771995-D475-429B-AC31-2B1F618AA45F}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -482,11 +491,11 @@ Global {1D771995-D475-429B-AC31-2B1F618AA45F}.Release|x64.Build.0 = Release|Any CPU {1D771995-D475-429B-AC31-2B1F618AA45F}.Release|x86.ActiveCfg = Release|Any CPU {1D771995-D475-429B-AC31-2B1F618AA45F}.Release|x86.Build.0 = Release|Any CPU - {1D771995-D475-429B-AC31-2B1F618AA45F}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {1D771995-D475-429B-AC31-2B1F618AA45F}.Checked|arm.ActiveCfg = Debug|Any CPU - {1D771995-D475-429B-AC31-2B1F618AA45F}.Checked|arm64.ActiveCfg = Debug|Any CPU - {1D771995-D475-429B-AC31-2B1F618AA45F}.Checked|x64.ActiveCfg = Debug|Any CPU - {1D771995-D475-429B-AC31-2B1F618AA45F}.Checked|x86.ActiveCfg = Debug|Any CPU + {9C2C2B5C-5E75-4935-8A4A-DE3D3A5DBBC1}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {9C2C2B5C-5E75-4935-8A4A-DE3D3A5DBBC1}.Checked|arm.ActiveCfg = Debug|Any CPU + {9C2C2B5C-5E75-4935-8A4A-DE3D3A5DBBC1}.Checked|arm64.ActiveCfg = Debug|Any CPU + {9C2C2B5C-5E75-4935-8A4A-DE3D3A5DBBC1}.Checked|x64.ActiveCfg = Debug|Any CPU + {9C2C2B5C-5E75-4935-8A4A-DE3D3A5DBBC1}.Checked|x86.ActiveCfg = Debug|Any CPU {9C2C2B5C-5E75-4935-8A4A-DE3D3A5DBBC1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {9C2C2B5C-5E75-4935-8A4A-DE3D3A5DBBC1}.Debug|Any CPU.Build.0 = Debug|Any CPU {9C2C2B5C-5E75-4935-8A4A-DE3D3A5DBBC1}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -503,11 +512,11 @@ Global {9C2C2B5C-5E75-4935-8A4A-DE3D3A5DBBC1}.Release|x64.Build.0 = Release|Any CPU {9C2C2B5C-5E75-4935-8A4A-DE3D3A5DBBC1}.Release|x86.ActiveCfg = Release|Any CPU {9C2C2B5C-5E75-4935-8A4A-DE3D3A5DBBC1}.Release|x86.Build.0 = Release|Any CPU - {9C2C2B5C-5E75-4935-8A4A-DE3D3A5DBBC1}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {9C2C2B5C-5E75-4935-8A4A-DE3D3A5DBBC1}.Checked|arm.ActiveCfg = Debug|Any CPU - {9C2C2B5C-5E75-4935-8A4A-DE3D3A5DBBC1}.Checked|arm64.ActiveCfg = Debug|Any CPU - {9C2C2B5C-5E75-4935-8A4A-DE3D3A5DBBC1}.Checked|x64.ActiveCfg = Debug|Any CPU - {9C2C2B5C-5E75-4935-8A4A-DE3D3A5DBBC1}.Checked|x86.ActiveCfg = Debug|Any CPU + {EA8DBC12-60BC-433E-ABFF-A89DFA795283}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {EA8DBC12-60BC-433E-ABFF-A89DFA795283}.Checked|arm.ActiveCfg = Debug|Any CPU + {EA8DBC12-60BC-433E-ABFF-A89DFA795283}.Checked|arm64.ActiveCfg = Debug|Any CPU + {EA8DBC12-60BC-433E-ABFF-A89DFA795283}.Checked|x64.ActiveCfg = Debug|Any CPU + {EA8DBC12-60BC-433E-ABFF-A89DFA795283}.Checked|x86.ActiveCfg = Debug|Any CPU {EA8DBC12-60BC-433E-ABFF-A89DFA795283}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {EA8DBC12-60BC-433E-ABFF-A89DFA795283}.Debug|Any CPU.Build.0 = Debug|Any CPU {EA8DBC12-60BC-433E-ABFF-A89DFA795283}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -524,11 +533,11 @@ Global {EA8DBC12-60BC-433E-ABFF-A89DFA795283}.Release|x64.Build.0 = Release|Any CPU {EA8DBC12-60BC-433E-ABFF-A89DFA795283}.Release|x86.ActiveCfg = Release|Any CPU {EA8DBC12-60BC-433E-ABFF-A89DFA795283}.Release|x86.Build.0 = Release|Any CPU - {EA8DBC12-60BC-433E-ABFF-A89DFA795283}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {EA8DBC12-60BC-433E-ABFF-A89DFA795283}.Checked|arm.ActiveCfg = Debug|Any CPU - {EA8DBC12-60BC-433E-ABFF-A89DFA795283}.Checked|arm64.ActiveCfg = Debug|Any CPU - {EA8DBC12-60BC-433E-ABFF-A89DFA795283}.Checked|x64.ActiveCfg = Debug|Any CPU - {EA8DBC12-60BC-433E-ABFF-A89DFA795283}.Checked|x86.ActiveCfg = Debug|Any CPU + {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Checked|arm.ActiveCfg = Debug|Any CPU + {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Checked|arm64.ActiveCfg = Debug|Any CPU + {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Checked|x64.ActiveCfg = Debug|Any CPU + {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Checked|x86.ActiveCfg = Debug|Any CPU {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Debug|Any CPU.Build.0 = Debug|Any CPU {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -545,11 +554,11 @@ Global {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Release|x64.Build.0 = Release|Any CPU {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Release|x86.ActiveCfg = Release|Any CPU {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Release|x86.Build.0 = Release|Any CPU - {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Checked|arm.ActiveCfg = Debug|Any CPU - {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Checked|arm64.ActiveCfg = Debug|Any CPU - {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Checked|x64.ActiveCfg = Debug|Any CPU - {25D66424-2EAF-464D-8460-10C04EDEF3C3}.Checked|x86.ActiveCfg = Debug|Any CPU + {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Checked|arm.ActiveCfg = Debug|Any CPU + {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Checked|arm64.ActiveCfg = Debug|Any CPU + {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Checked|x64.ActiveCfg = Debug|Any CPU + {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Checked|x86.ActiveCfg = Debug|Any CPU {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Debug|Any CPU.Build.0 = Debug|Any CPU {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -566,11 +575,11 @@ Global {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Release|x64.Build.0 = Release|Any CPU {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Release|x86.ActiveCfg = Release|Any CPU {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Release|x86.Build.0 = Release|Any CPU - {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Checked|arm.ActiveCfg = Debug|Any CPU - {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Checked|arm64.ActiveCfg = Debug|Any CPU - {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Checked|x64.ActiveCfg = Debug|Any CPU - {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF}.Checked|x86.ActiveCfg = Debug|Any CPU + {866D295E-424A-4747-9417-CD7746936138}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {866D295E-424A-4747-9417-CD7746936138}.Checked|arm.ActiveCfg = Debug|Any CPU + {866D295E-424A-4747-9417-CD7746936138}.Checked|arm64.ActiveCfg = Debug|Any CPU + {866D295E-424A-4747-9417-CD7746936138}.Checked|x64.ActiveCfg = Debug|Any CPU + {866D295E-424A-4747-9417-CD7746936138}.Checked|x86.ActiveCfg = Debug|Any CPU {866D295E-424A-4747-9417-CD7746936138}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {866D295E-424A-4747-9417-CD7746936138}.Debug|Any CPU.Build.0 = Debug|Any CPU {866D295E-424A-4747-9417-CD7746936138}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -587,11 +596,11 @@ Global {866D295E-424A-4747-9417-CD7746936138}.Release|x64.Build.0 = Release|Any CPU {866D295E-424A-4747-9417-CD7746936138}.Release|x86.ActiveCfg = Release|Any CPU {866D295E-424A-4747-9417-CD7746936138}.Release|x86.Build.0 = Release|Any CPU - {866D295E-424A-4747-9417-CD7746936138}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {866D295E-424A-4747-9417-CD7746936138}.Checked|arm.ActiveCfg = Debug|Any CPU - {866D295E-424A-4747-9417-CD7746936138}.Checked|arm64.ActiveCfg = Debug|Any CPU - {866D295E-424A-4747-9417-CD7746936138}.Checked|x64.ActiveCfg = Debug|Any CPU - {866D295E-424A-4747-9417-CD7746936138}.Checked|x86.ActiveCfg = Debug|Any CPU + {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Checked|arm.ActiveCfg = Debug|Any CPU + {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Checked|arm64.ActiveCfg = Debug|Any CPU + {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Checked|x64.ActiveCfg = Debug|Any CPU + {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Checked|x86.ActiveCfg = Debug|Any CPU {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Debug|Any CPU.Build.0 = Debug|Any CPU {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -608,11 +617,11 @@ Global {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Release|x64.Build.0 = Release|Any CPU {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Release|x86.ActiveCfg = Release|Any CPU {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Release|x86.Build.0 = Release|Any CPU - {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Checked|arm.ActiveCfg = Debug|Any CPU - {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Checked|arm64.ActiveCfg = Debug|Any CPU - {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Checked|x64.ActiveCfg = Debug|Any CPU - {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5}.Checked|x86.ActiveCfg = Debug|Any CPU + {0B5FD0C2-367D-4AD6-8001-80AD79B2441C}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {0B5FD0C2-367D-4AD6-8001-80AD79B2441C}.Checked|arm.ActiveCfg = Debug|Any CPU + {0B5FD0C2-367D-4AD6-8001-80AD79B2441C}.Checked|arm64.ActiveCfg = Debug|Any CPU + {0B5FD0C2-367D-4AD6-8001-80AD79B2441C}.Checked|x64.ActiveCfg = Debug|Any CPU + {0B5FD0C2-367D-4AD6-8001-80AD79B2441C}.Checked|x86.ActiveCfg = Debug|Any CPU {0B5FD0C2-367D-4AD6-8001-80AD79B2441C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0B5FD0C2-367D-4AD6-8001-80AD79B2441C}.Debug|Any CPU.Build.0 = Debug|Any CPU {0B5FD0C2-367D-4AD6-8001-80AD79B2441C}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -629,11 +638,11 @@ Global {0B5FD0C2-367D-4AD6-8001-80AD79B2441C}.Release|x64.Build.0 = Release|Any CPU {0B5FD0C2-367D-4AD6-8001-80AD79B2441C}.Release|x86.ActiveCfg = Release|Any CPU {0B5FD0C2-367D-4AD6-8001-80AD79B2441C}.Release|x86.Build.0 = Release|Any CPU - {0B5FD0C2-367D-4AD6-8001-80AD79B2441C}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {0B5FD0C2-367D-4AD6-8001-80AD79B2441C}.Checked|arm.ActiveCfg = Debug|Any CPU - {0B5FD0C2-367D-4AD6-8001-80AD79B2441C}.Checked|arm64.ActiveCfg = Debug|Any CPU - {0B5FD0C2-367D-4AD6-8001-80AD79B2441C}.Checked|x64.ActiveCfg = Debug|Any CPU - {0B5FD0C2-367D-4AD6-8001-80AD79B2441C}.Checked|x86.ActiveCfg = Debug|Any CPU + {C7DAC270-CC93-4C97-9A8D-6E724A10727D}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {C7DAC270-CC93-4C97-9A8D-6E724A10727D}.Checked|arm.ActiveCfg = Debug|Any CPU + {C7DAC270-CC93-4C97-9A8D-6E724A10727D}.Checked|arm64.ActiveCfg = Debug|Any CPU + {C7DAC270-CC93-4C97-9A8D-6E724A10727D}.Checked|x64.ActiveCfg = Debug|Any CPU + {C7DAC270-CC93-4C97-9A8D-6E724A10727D}.Checked|x86.ActiveCfg = Debug|Any CPU {C7DAC270-CC93-4C97-9A8D-6E724A10727D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C7DAC270-CC93-4C97-9A8D-6E724A10727D}.Debug|Any CPU.Build.0 = Debug|Any CPU {C7DAC270-CC93-4C97-9A8D-6E724A10727D}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -650,11 +659,11 @@ Global {C7DAC270-CC93-4C97-9A8D-6E724A10727D}.Release|x64.Build.0 = Release|Any CPU {C7DAC270-CC93-4C97-9A8D-6E724A10727D}.Release|x86.ActiveCfg = Release|Any CPU {C7DAC270-CC93-4C97-9A8D-6E724A10727D}.Release|x86.Build.0 = Release|Any CPU - {C7DAC270-CC93-4C97-9A8D-6E724A10727D}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {C7DAC270-CC93-4C97-9A8D-6E724A10727D}.Checked|arm.ActiveCfg = Debug|Any CPU - {C7DAC270-CC93-4C97-9A8D-6E724A10727D}.Checked|arm64.ActiveCfg = Debug|Any CPU - {C7DAC270-CC93-4C97-9A8D-6E724A10727D}.Checked|x64.ActiveCfg = Debug|Any CPU - {C7DAC270-CC93-4C97-9A8D-6E724A10727D}.Checked|x86.ActiveCfg = Debug|Any CPU + {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82}.Checked|arm.ActiveCfg = Debug|Any CPU + {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82}.Checked|arm64.ActiveCfg = Debug|Any CPU + {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82}.Checked|x64.ActiveCfg = Debug|Any CPU + {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82}.Checked|x86.ActiveCfg = Debug|Any CPU {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82}.Debug|Any CPU.Build.0 = Debug|Any CPU {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -671,11 +680,11 @@ Global {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82}.Release|x64.Build.0 = Release|Any CPU {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82}.Release|x86.ActiveCfg = Release|Any CPU {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82}.Release|x86.Build.0 = Release|Any CPU - {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82}.Checked|arm.ActiveCfg = Debug|Any CPU - {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82}.Checked|arm64.ActiveCfg = Debug|Any CPU - {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82}.Checked|x64.ActiveCfg = Debug|Any CPU - {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82}.Checked|x86.ActiveCfg = Debug|Any CPU + {5600CDE1-139F-461B-8DD9-86FCC499DCC2}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {5600CDE1-139F-461B-8DD9-86FCC499DCC2}.Checked|arm.ActiveCfg = Debug|Any CPU + {5600CDE1-139F-461B-8DD9-86FCC499DCC2}.Checked|arm64.ActiveCfg = Debug|Any CPU + {5600CDE1-139F-461B-8DD9-86FCC499DCC2}.Checked|x64.ActiveCfg = Debug|Any CPU + {5600CDE1-139F-461B-8DD9-86FCC499DCC2}.Checked|x86.ActiveCfg = Debug|Any CPU {5600CDE1-139F-461B-8DD9-86FCC499DCC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {5600CDE1-139F-461B-8DD9-86FCC499DCC2}.Debug|Any CPU.Build.0 = Debug|Any CPU {5600CDE1-139F-461B-8DD9-86FCC499DCC2}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -692,11 +701,11 @@ Global {5600CDE1-139F-461B-8DD9-86FCC499DCC2}.Release|x64.Build.0 = Release|Any CPU {5600CDE1-139F-461B-8DD9-86FCC499DCC2}.Release|x86.ActiveCfg = Release|Any CPU {5600CDE1-139F-461B-8DD9-86FCC499DCC2}.Release|x86.Build.0 = Release|Any CPU - {5600CDE1-139F-461B-8DD9-86FCC499DCC2}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {5600CDE1-139F-461B-8DD9-86FCC499DCC2}.Checked|arm.ActiveCfg = Debug|Any CPU - {5600CDE1-139F-461B-8DD9-86FCC499DCC2}.Checked|arm64.ActiveCfg = Debug|Any CPU - {5600CDE1-139F-461B-8DD9-86FCC499DCC2}.Checked|x64.ActiveCfg = Debug|Any CPU - {5600CDE1-139F-461B-8DD9-86FCC499DCC2}.Checked|x86.ActiveCfg = Debug|Any CPU + {169B126B-48DF-425C-B902-D376A689D9FB}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {169B126B-48DF-425C-B902-D376A689D9FB}.Checked|arm.ActiveCfg = Debug|Any CPU + {169B126B-48DF-425C-B902-D376A689D9FB}.Checked|arm64.ActiveCfg = Debug|Any CPU + {169B126B-48DF-425C-B902-D376A689D9FB}.Checked|x64.ActiveCfg = Debug|Any CPU + {169B126B-48DF-425C-B902-D376A689D9FB}.Checked|x86.ActiveCfg = Debug|Any CPU {169B126B-48DF-425C-B902-D376A689D9FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {169B126B-48DF-425C-B902-D376A689D9FB}.Debug|Any CPU.Build.0 = Debug|Any CPU {169B126B-48DF-425C-B902-D376A689D9FB}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -713,11 +722,11 @@ Global {169B126B-48DF-425C-B902-D376A689D9FB}.Release|x64.Build.0 = Release|Any CPU {169B126B-48DF-425C-B902-D376A689D9FB}.Release|x86.ActiveCfg = Release|Any CPU {169B126B-48DF-425C-B902-D376A689D9FB}.Release|x86.Build.0 = Release|Any CPU - {169B126B-48DF-425C-B902-D376A689D9FB}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {169B126B-48DF-425C-B902-D376A689D9FB}.Checked|arm.ActiveCfg = Debug|Any CPU - {169B126B-48DF-425C-B902-D376A689D9FB}.Checked|arm64.ActiveCfg = Debug|Any CPU - {169B126B-48DF-425C-B902-D376A689D9FB}.Checked|x64.ActiveCfg = Debug|Any CPU - {169B126B-48DF-425C-B902-D376A689D9FB}.Checked|x86.ActiveCfg = Debug|Any CPU + {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB}.Checked|arm.ActiveCfg = Debug|Any CPU + {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB}.Checked|arm64.ActiveCfg = Debug|Any CPU + {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB}.Checked|x64.ActiveCfg = Debug|Any CPU + {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB}.Checked|x86.ActiveCfg = Debug|Any CPU {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB}.Debug|Any CPU.Build.0 = Debug|Any CPU {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -734,11 +743,11 @@ Global {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB}.Release|x64.Build.0 = Release|Any CPU {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB}.Release|x86.ActiveCfg = Release|Any CPU {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB}.Release|x86.Build.0 = Release|Any CPU - {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB}.Checked|arm.ActiveCfg = Debug|Any CPU - {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB}.Checked|arm64.ActiveCfg = Debug|Any CPU - {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB}.Checked|x64.ActiveCfg = Debug|Any CPU - {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB}.Checked|x86.ActiveCfg = Debug|Any CPU + {1347FE73-506C-4C44-A469-979F6ADB78BE}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {1347FE73-506C-4C44-A469-979F6ADB78BE}.Checked|arm.ActiveCfg = Debug|Any CPU + {1347FE73-506C-4C44-A469-979F6ADB78BE}.Checked|arm64.ActiveCfg = Debug|Any CPU + {1347FE73-506C-4C44-A469-979F6ADB78BE}.Checked|x64.ActiveCfg = Debug|Any CPU + {1347FE73-506C-4C44-A469-979F6ADB78BE}.Checked|x86.ActiveCfg = Debug|Any CPU {1347FE73-506C-4C44-A469-979F6ADB78BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1347FE73-506C-4C44-A469-979F6ADB78BE}.Debug|Any CPU.Build.0 = Debug|Any CPU {1347FE73-506C-4C44-A469-979F6ADB78BE}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -755,11 +764,11 @@ Global {1347FE73-506C-4C44-A469-979F6ADB78BE}.Release|x64.Build.0 = Release|Any CPU {1347FE73-506C-4C44-A469-979F6ADB78BE}.Release|x86.ActiveCfg = Release|Any CPU {1347FE73-506C-4C44-A469-979F6ADB78BE}.Release|x86.Build.0 = Release|Any CPU - {1347FE73-506C-4C44-A469-979F6ADB78BE}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {1347FE73-506C-4C44-A469-979F6ADB78BE}.Checked|arm.ActiveCfg = Debug|Any CPU - {1347FE73-506C-4C44-A469-979F6ADB78BE}.Checked|arm64.ActiveCfg = Debug|Any CPU - {1347FE73-506C-4C44-A469-979F6ADB78BE}.Checked|x64.ActiveCfg = Debug|Any CPU - {1347FE73-506C-4C44-A469-979F6ADB78BE}.Checked|x86.ActiveCfg = Debug|Any CPU + {B36C9254-0C55-414E-8403-03B4F18D5F35}.Checked|Any CPU.ActiveCfg = Debug|Any CPU + {B36C9254-0C55-414E-8403-03B4F18D5F35}.Checked|arm.ActiveCfg = Debug|Any CPU + {B36C9254-0C55-414E-8403-03B4F18D5F35}.Checked|arm64.ActiveCfg = Debug|Any CPU + {B36C9254-0C55-414E-8403-03B4F18D5F35}.Checked|x64.ActiveCfg = Debug|Any CPU + {B36C9254-0C55-414E-8403-03B4F18D5F35}.Checked|x86.ActiveCfg = Debug|Any CPU {B36C9254-0C55-414E-8403-03B4F18D5F35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B36C9254-0C55-414E-8403-03B4F18D5F35}.Debug|Any CPU.Build.0 = Debug|Any CPU {B36C9254-0C55-414E-8403-03B4F18D5F35}.Debug|arm.ActiveCfg = Debug|Any CPU @@ -776,11 +785,6 @@ Global {B36C9254-0C55-414E-8403-03B4F18D5F35}.Release|x64.Build.0 = Release|Any CPU {B36C9254-0C55-414E-8403-03B4F18D5F35}.Release|x86.ActiveCfg = Release|Any CPU {B36C9254-0C55-414E-8403-03B4F18D5F35}.Release|x86.Build.0 = Release|Any CPU - {B36C9254-0C55-414E-8403-03B4F18D5F35}.Checked|Any CPU.ActiveCfg = Debug|Any CPU - {B36C9254-0C55-414E-8403-03B4F18D5F35}.Checked|arm.ActiveCfg = Debug|Any CPU - {B36C9254-0C55-414E-8403-03B4F18D5F35}.Checked|arm64.ActiveCfg = Debug|Any CPU - {B36C9254-0C55-414E-8403-03B4F18D5F35}.Checked|x64.ActiveCfg = Debug|Any CPU - {B36C9254-0C55-414E-8403-03B4F18D5F35}.Checked|x86.ActiveCfg = Debug|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -788,6 +792,19 @@ Global GlobalSection(NestedProjects) = preSolution {94B59BA0-491F-4B59-ADFF-A057EC3EC835} = {052823B7-A9E0-41DE-87D8-D1CAF407B41D} {1FF4CC8E-49C3-42A0-A6E0-2E5908455FBA} = {FB99AC59-1744-4F12-A4B0-0D54FCA048BF} + {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0} = {D893B9AA-57C5-49E3-97B1-12CC62D84307} + {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69} = {B1678CCD-95C8-4419-B9F9-14A03061BE4B} + {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A} = {D893B9AA-57C5-49E3-97B1-12CC62D84307} + {C4B641C3-3317-4913-91DA-0DA3B64BABED} = {B1678CCD-95C8-4419-B9F9-14A03061BE4B} + {3FB6F2AA-E763-4336-B927-18AB7AAF6C20} = {D893B9AA-57C5-49E3-97B1-12CC62D84307} + {716ED44B-37C8-4776-BE70-285952D2B30D} = {B1678CCD-95C8-4419-B9F9-14A03061BE4B} + {1B248B4C-7584-4C04-850A-A50EB592052C} = {E1AEBD5D-AE4E-4F61-B9ED-AEF950B0CC33} + {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886} = {D893B9AA-57C5-49E3-97B1-12CC62D84307} + {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5} = {E1AEBD5D-AE4E-4F61-B9ED-AEF950B0CC33} + {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40} = {E1AEBD5D-AE4E-4F61-B9ED-AEF950B0CC33} + {768B77B0-EA45-469D-B39E-545EB72F5A43} = {E1AEBD5D-AE4E-4F61-B9ED-AEF950B0CC33} + {8671F164-F78C-44FA-93B7-A310F67890FE} = {D893B9AA-57C5-49E3-97B1-12CC62D84307} + {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1} = {B1678CCD-95C8-4419-B9F9-14A03061BE4B} {79F7BE0E-01AA-4AFB-B047-CF7C0B38F81E} = {FB99AC59-1744-4F12-A4B0-0D54FCA048BF} {3741C833-C364-4269-9B1D-D442055DA7CE} = {FB99AC59-1744-4F12-A4B0-0D54FCA048BF} {1D771995-D475-429B-AC31-2B1F618AA45F} = {FB99AC59-1744-4F12-A4B0-0D54FCA048BF} @@ -797,32 +814,24 @@ Global {049B7FD4-ACEF-4BCD-A7A7-75C9BBEC4EBF} = {FB99AC59-1744-4F12-A4B0-0D54FCA048BF} {866D295E-424A-4747-9417-CD7746936138} = {FB99AC59-1744-4F12-A4B0-0D54FCA048BF} {D3A329E3-0FEB-4136-9CB6-B38319B0FFA5} = {FB99AC59-1744-4F12-A4B0-0D54FCA048BF} - {0E0D5A1F-0212-4CEB-BADA-E1E3ABD395A0} = {D893B9AA-57C5-49E3-97B1-12CC62D84307} - {4859BEE3-34B7-48E7-83D4-1ADD8B8F3B3A} = {D893B9AA-57C5-49E3-97B1-12CC62D84307} - {3FB6F2AA-E763-4336-B927-18AB7AAF6C20} = {D893B9AA-57C5-49E3-97B1-12CC62D84307} - {EF39CC5C-7A3B-40F2-82B6-C1C8BBC3F886} = {D893B9AA-57C5-49E3-97B1-12CC62D84307} - {8671F164-F78C-44FA-93B7-A310F67890FE} = {D893B9AA-57C5-49E3-97B1-12CC62D84307} {0B5FD0C2-367D-4AD6-8001-80AD79B2441C} = {D893B9AA-57C5-49E3-97B1-12CC62D84307} {C7DAC270-CC93-4C97-9A8D-6E724A10727D} = {D893B9AA-57C5-49E3-97B1-12CC62D84307} - {F552E4E4-20EE-484C-84F8-4FB3A3BD2E69} = {B1678CCD-95C8-4419-B9F9-14A03061BE4B} - {C4B641C3-3317-4913-91DA-0DA3B64BABED} = {B1678CCD-95C8-4419-B9F9-14A03061BE4B} - {716ED44B-37C8-4776-BE70-285952D2B30D} = {B1678CCD-95C8-4419-B9F9-14A03061BE4B} - {4FC33B9B-1BCF-4D16-B886-DCA8F2B823C1} = {B1678CCD-95C8-4419-B9F9-14A03061BE4B} {C9B349C8-7B11-4DE4-A4BB-8D957A1D2A82} = {B1678CCD-95C8-4419-B9F9-14A03061BE4B} - {1B248B4C-7584-4C04-850A-A50EB592052C} = {E1AEBD5D-AE4E-4F61-B9ED-AEF950B0CC33} - {C3EA0A28-A597-4946-9E08-EBBBFA94BFA5} = {E1AEBD5D-AE4E-4F61-B9ED-AEF950B0CC33} - {90CDAD9F-3ACC-43B0-9696-0C849FCD8C40} = {E1AEBD5D-AE4E-4F61-B9ED-AEF950B0CC33} - {768B77B0-EA45-469D-B39E-545EB72F5A43} = {E1AEBD5D-AE4E-4F61-B9ED-AEF950B0CC33} {5600CDE1-139F-461B-8DD9-86FCC499DCC2} = {8826C1E1-CEBD-49F8-9BC8-97FECE60F9B9} {169B126B-48DF-425C-B902-D376A689D9FB} = {8826C1E1-CEBD-49F8-9BC8-97FECE60F9B9} - {8826C1E1-CEBD-49F8-9BC8-97FECE60F9B9} = {8FA3249B-3567-4C76-BA32-9488FC92994D} {8EA17297-41EE-4CEE-AF61-F047D6F7A1AB} = {7B3C7C2F-58E0-4EE5-B904-9C978F40FD33} {1347FE73-506C-4C44-A469-979F6ADB78BE} = {7B3C7C2F-58E0-4EE5-B904-9C978F40FD33} - {7B3C7C2F-58E0-4EE5-B904-9C978F40FD33} = {8FA3249B-3567-4C76-BA32-9488FC92994D} {B36C9254-0C55-414E-8403-03B4F18D5F35} = {5114BD7E-8492-452A-8DAA-BF971D74A66D} + {8826C1E1-CEBD-49F8-9BC8-97FECE60F9B9} = {8FA3249B-3567-4C76-BA32-9488FC92994D} + {7B3C7C2F-58E0-4EE5-B904-9C978F40FD33} = {8FA3249B-3567-4C76-BA32-9488FC92994D} {5114BD7E-8492-452A-8DAA-BF971D74A66D} = {8FA3249B-3567-4C76-BA32-9488FC92994D} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {D4031401-FEB5-4CCF-91C1-38F5646B2BFD} EndGlobalSection + GlobalSection(SharedMSBuildProjectFiles) = preSolution + ..\..\tools\illink\src\ILLink.Shared\ILLink.Shared.projitems*{1347fe73-506c-4c44-a469-979f6adb78be}*SharedItemsImports = 5 + ..\..\tools\illink\src\ILLink.Shared\ILLink.Shared.projitems*{169b126b-48df-425c-b902-d376a689d9fb}*SharedItemsImports = 5 + ..\System.Private.CoreLib\src\System.Private.CoreLib.Shared.projitems*{94b59ba0-491f-4b59-adff-a057ec3ec835}*SharedItemsImports = 5 + EndGlobalSection EndGlobal diff --git a/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/ComInterfaceGeneratorHelpers.cs b/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/ComInterfaceGeneratorHelpers.cs index c5fd203db2a0f0..5bd5e1b893bc96 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/ComInterfaceGeneratorHelpers.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/ComInterfaceGeneratorHelpers.cs @@ -59,6 +59,7 @@ private static IMarshallingGeneratorFactory CreateGeneratorFactory(EnvironmentFl generatorFactory = new ComInterfaceDispatchMarshallerFactory(generatorFactory); generatorFactory = new ByValueContentsMarshalKindValidator(generatorFactory); + generatorFactory = new BreakingChangeDetector(generatorFactory); return generatorFactory; } diff --git a/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/VtableIndexStubGeneratorHelpers.cs b/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/VtableIndexStubGeneratorHelpers.cs index 7d7c516f50998c..7319a8540482ce 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/VtableIndexStubGeneratorHelpers.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/ComInterfaceGenerator/VtableIndexStubGeneratorHelpers.cs @@ -55,6 +55,7 @@ private static IMarshallingGeneratorFactory CreateGeneratorFactory(EnvironmentFl generatorFactory = new ObjectUnwrapperMarshallerFactory(generatorFactory); generatorFactory = new ByValueContentsMarshalKindValidator(generatorFactory); + generatorFactory = new BreakingChangeDetector(generatorFactory); return generatorFactory; } diff --git a/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/Strings.resx b/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/Strings.resx index bce2c5ae188043..c1b54b9dde9e90 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/Strings.resx +++ b/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/Strings.resx @@ -1,17 +1,17 @@  - @@ -907,4 +907,7 @@ The usage of 'LibraryImportAttribute' does not follow recommendations. {0} - + + Objects marshalled from VARIANTs as 'in' parameters in unmanaged-to-managed calls will not propagate back the updated result, even if the VARIANT is a VT_BYREF variant. Use a 'ref' parameter instead of an 'in' parameter to propagate the updated value back to the caller. + + \ No newline at end of file diff --git a/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.cs.xlf b/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.cs.xlf index 9f769d6c35c061..cb47ca8633ddb9 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.cs.xlf +++ b/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.cs.xlf @@ -492,6 +492,11 @@ atributy [In] a [Out] + + Objects marshalled from VARIANTs as 'in' parameters in unmanaged-to-managed calls will not propagate back the updated result, even if the VARIANT is a VT_BYREF variant. Use a 'ref' parameter instead of an 'in' parameter to propagate the updated value back to the caller. + Objects marshalled from VARIANTs as 'in' parameters in unmanaged-to-managed calls will not propagate back the updated result, even if the VARIANT is a VT_BYREF variant. Use a 'ref' parameter instead of an 'in' parameter to propagate the updated value back to the caller. + + Events are not a concept in COM, so no interop code will be source generated for instance events on source-generated COM interfaces. Události nejsou konceptem COM, takže pro události instance na rozhraních COM generovaných zdrojem nebude vygenerován žádný kód spolupráce. diff --git a/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.de.xlf b/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.de.xlf index a23a8178977575..4c074a73b1d06b 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.de.xlf +++ b/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.de.xlf @@ -492,6 +492,11 @@ [In]- und [Out]-Attribute + + Objects marshalled from VARIANTs as 'in' parameters in unmanaged-to-managed calls will not propagate back the updated result, even if the VARIANT is a VT_BYREF variant. Use a 'ref' parameter instead of an 'in' parameter to propagate the updated value back to the caller. + Objects marshalled from VARIANTs as 'in' parameters in unmanaged-to-managed calls will not propagate back the updated result, even if the VARIANT is a VT_BYREF variant. Use a 'ref' parameter instead of an 'in' parameter to propagate the updated value back to the caller. + + Events are not a concept in COM, so no interop code will be source generated for instance events on source-generated COM interfaces. Ereignisse sind kein Konzept in COM, daher wird kein Interopcode für Instanzereignisse auf von der Quelle generierten COM-Schnittstellen generiert. diff --git a/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.es.xlf b/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.es.xlf index 7d4da3d2391109..af7b114c148d88 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.es.xlf +++ b/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.es.xlf @@ -492,6 +492,11 @@ Atributos [In] y [Out] + + Objects marshalled from VARIANTs as 'in' parameters in unmanaged-to-managed calls will not propagate back the updated result, even if the VARIANT is a VT_BYREF variant. Use a 'ref' parameter instead of an 'in' parameter to propagate the updated value back to the caller. + Objects marshalled from VARIANTs as 'in' parameters in unmanaged-to-managed calls will not propagate back the updated result, even if the VARIANT is a VT_BYREF variant. Use a 'ref' parameter instead of an 'in' parameter to propagate the updated value back to the caller. + + Events are not a concept in COM, so no interop code will be source generated for instance events on source-generated COM interfaces. Los eventos no representan un concepto en COM, de modo que no se generará código de interoperabilidad para eventos de instancia en interfaces COM generadas en origen. diff --git a/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.fr.xlf b/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.fr.xlf index 467413d83f430d..f6a5d7a2405fcd 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.fr.xlf +++ b/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.fr.xlf @@ -492,6 +492,11 @@ Attributs [In] et [Out] + + Objects marshalled from VARIANTs as 'in' parameters in unmanaged-to-managed calls will not propagate back the updated result, even if the VARIANT is a VT_BYREF variant. Use a 'ref' parameter instead of an 'in' parameter to propagate the updated value back to the caller. + Objects marshalled from VARIANTs as 'in' parameters in unmanaged-to-managed calls will not propagate back the updated result, even if the VARIANT is a VT_BYREF variant. Use a 'ref' parameter instead of an 'in' parameter to propagate the updated value back to the caller. + + Events are not a concept in COM, so no interop code will be source generated for instance events on source-generated COM interfaces. Les événements ne sont pas un concept dans COM. Par conséquent, aucun code d’interopérabilité n’est généré à la source pour les événements d’instance sur les interfaces COM générées par la source. diff --git a/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.it.xlf b/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.it.xlf index 7af807ca8b6f60..583bd7d3b679a6 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.it.xlf +++ b/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.it.xlf @@ -492,6 +492,11 @@ Attributi [In] e [Out] + + Objects marshalled from VARIANTs as 'in' parameters in unmanaged-to-managed calls will not propagate back the updated result, even if the VARIANT is a VT_BYREF variant. Use a 'ref' parameter instead of an 'in' parameter to propagate the updated value back to the caller. + Objects marshalled from VARIANTs as 'in' parameters in unmanaged-to-managed calls will not propagate back the updated result, even if the VARIANT is a VT_BYREF variant. Use a 'ref' parameter instead of an 'in' parameter to propagate the updated value back to the caller. + + Events are not a concept in COM, so no interop code will be source generated for instance events on source-generated COM interfaces. Gli eventi non sono concetti in COM quindi non verrà generato codice di interoperabilità per gli eventi dell’istanza nelle interfacce COM generate dall'origine. diff --git a/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.ja.xlf b/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.ja.xlf index 900871e5738958..922438e3b3b460 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.ja.xlf +++ b/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.ja.xlf @@ -492,6 +492,11 @@ 属性の[In]と[Out] + + Objects marshalled from VARIANTs as 'in' parameters in unmanaged-to-managed calls will not propagate back the updated result, even if the VARIANT is a VT_BYREF variant. Use a 'ref' parameter instead of an 'in' parameter to propagate the updated value back to the caller. + Objects marshalled from VARIANTs as 'in' parameters in unmanaged-to-managed calls will not propagate back the updated result, even if the VARIANT is a VT_BYREF variant. Use a 'ref' parameter instead of an 'in' parameter to propagate the updated value back to the caller. + + Events are not a concept in COM, so no interop code will be source generated for instance events on source-generated COM interfaces. イベントは COM の概念ではないため、ソース生成 COM インターフェイス上のインスタンス イベントに対して相互運用コードはソース生成されません。 diff --git a/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.ko.xlf b/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.ko.xlf index c2061f1c47ed04..42a09317564add 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.ko.xlf +++ b/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.ko.xlf @@ -492,6 +492,11 @@ [In] 및 [Out] 속성 + + Objects marshalled from VARIANTs as 'in' parameters in unmanaged-to-managed calls will not propagate back the updated result, even if the VARIANT is a VT_BYREF variant. Use a 'ref' parameter instead of an 'in' parameter to propagate the updated value back to the caller. + Objects marshalled from VARIANTs as 'in' parameters in unmanaged-to-managed calls will not propagate back the updated result, even if the VARIANT is a VT_BYREF variant. Use a 'ref' parameter instead of an 'in' parameter to propagate the updated value back to the caller. + + Events are not a concept in COM, so no interop code will be source generated for instance events on source-generated COM interfaces. 이벤트는 COM의 개념이 아니므로 소스 생성 COM 인터페이스의 인스턴스 이벤트에 대해 interop 코드가 생성되지 않습니다. diff --git a/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.pl.xlf b/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.pl.xlf index 4a5bed01000cbb..a3b1860ab44e3a 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.pl.xlf +++ b/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.pl.xlf @@ -492,6 +492,11 @@ Atrybuty [In] i [Out] + + Objects marshalled from VARIANTs as 'in' parameters in unmanaged-to-managed calls will not propagate back the updated result, even if the VARIANT is a VT_BYREF variant. Use a 'ref' parameter instead of an 'in' parameter to propagate the updated value back to the caller. + Objects marshalled from VARIANTs as 'in' parameters in unmanaged-to-managed calls will not propagate back the updated result, even if the VARIANT is a VT_BYREF variant. Use a 'ref' parameter instead of an 'in' parameter to propagate the updated value back to the caller. + + Events are not a concept in COM, so no interop code will be source generated for instance events on source-generated COM interfaces. Zdarzenia nie są koncepcją w modelu COM, więc żaden kod międzyoperacyjny nie będzie generowany dla zdarzeń wystąpień w interfejsach COM generowanych źródłowo. diff --git a/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.pt-BR.xlf b/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.pt-BR.xlf index a2dcb00fc8aa2c..21f751b5361071 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.pt-BR.xlf +++ b/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.pt-BR.xlf @@ -492,6 +492,11 @@ Atributos [In] e [Out] + + Objects marshalled from VARIANTs as 'in' parameters in unmanaged-to-managed calls will not propagate back the updated result, even if the VARIANT is a VT_BYREF variant. Use a 'ref' parameter instead of an 'in' parameter to propagate the updated value back to the caller. + Objects marshalled from VARIANTs as 'in' parameters in unmanaged-to-managed calls will not propagate back the updated result, even if the VARIANT is a VT_BYREF variant. Use a 'ref' parameter instead of an 'in' parameter to propagate the updated value back to the caller. + + Events are not a concept in COM, so no interop code will be source generated for instance events on source-generated COM interfaces. Os eventos não são um conceito em COM, portanto, nenhum código de interoperabilidade será gerado para eventos de instância em interfaces COM geradas pela origem. diff --git a/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.ru.xlf b/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.ru.xlf index 9631d6c981aacd..a9171f2bc3161f 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.ru.xlf +++ b/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.ru.xlf @@ -492,6 +492,11 @@ Атрибуты [In] и [Out] + + Objects marshalled from VARIANTs as 'in' parameters in unmanaged-to-managed calls will not propagate back the updated result, even if the VARIANT is a VT_BYREF variant. Use a 'ref' parameter instead of an 'in' parameter to propagate the updated value back to the caller. + Objects marshalled from VARIANTs as 'in' parameters in unmanaged-to-managed calls will not propagate back the updated result, even if the VARIANT is a VT_BYREF variant. Use a 'ref' parameter instead of an 'in' parameter to propagate the updated value back to the caller. + + Events are not a concept in COM, so no interop code will be source generated for instance events on source-generated COM interfaces. События не являются концепцией в COM, поэтому источник не будет генерировать код взаимодействия для событий экземпляра в COM-интерфейсах, создаваемых источником. diff --git a/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.tr.xlf b/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.tr.xlf index 06f7c1279e14ac..1cc5531a8683c5 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.tr.xlf +++ b/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.tr.xlf @@ -492,6 +492,11 @@ [In] ve [Out] öznitelikleri + + Objects marshalled from VARIANTs as 'in' parameters in unmanaged-to-managed calls will not propagate back the updated result, even if the VARIANT is a VT_BYREF variant. Use a 'ref' parameter instead of an 'in' parameter to propagate the updated value back to the caller. + Objects marshalled from VARIANTs as 'in' parameters in unmanaged-to-managed calls will not propagate back the updated result, even if the VARIANT is a VT_BYREF variant. Use a 'ref' parameter instead of an 'in' parameter to propagate the updated value back to the caller. + + Events are not a concept in COM, so no interop code will be source generated for instance events on source-generated COM interfaces. Olaylar COM'da kavram olarak değerlendirilmez, bu nedenle kaynak tarafından oluşturulan COM arabirimleri üzerinde örnek olaylar için birlikte çalışma kodu oluşturulmaz. diff --git a/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.zh-Hans.xlf b/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.zh-Hans.xlf index 9cf9ccbc906f53..8f895c4fec8b42 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.zh-Hans.xlf +++ b/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.zh-Hans.xlf @@ -492,6 +492,11 @@ [In] 和 [Out] 属性 + + Objects marshalled from VARIANTs as 'in' parameters in unmanaged-to-managed calls will not propagate back the updated result, even if the VARIANT is a VT_BYREF variant. Use a 'ref' parameter instead of an 'in' parameter to propagate the updated value back to the caller. + Objects marshalled from VARIANTs as 'in' parameters in unmanaged-to-managed calls will not propagate back the updated result, even if the VARIANT is a VT_BYREF variant. Use a 'ref' parameter instead of an 'in' parameter to propagate the updated value back to the caller. + + Events are not a concept in COM, so no interop code will be source generated for instance events on source-generated COM interfaces. 事件不是 COM 的概念,因此不会为源生成的 COM 接口上的实例事件生成互操作代码。 diff --git a/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.zh-Hant.xlf b/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.zh-Hant.xlf index 08a0d9ac8eb548..34074c682f507c 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.zh-Hant.xlf +++ b/src/libraries/System.Runtime.InteropServices/gen/Common/Resources/xlf/Strings.zh-Hant.xlf @@ -492,6 +492,11 @@ [In] 與 [Out] 屬性 + + Objects marshalled from VARIANTs as 'in' parameters in unmanaged-to-managed calls will not propagate back the updated result, even if the VARIANT is a VT_BYREF variant. Use a 'ref' parameter instead of an 'in' parameter to propagate the updated value back to the caller. + Objects marshalled from VARIANTs as 'in' parameters in unmanaged-to-managed calls will not propagate back the updated result, even if the VARIANT is a VT_BYREF variant. Use a 'ref' parameter instead of an 'in' parameter to propagate the updated value back to the caller. + + Events are not a concept in COM, so no interop code will be source generated for instance events on source-generated COM interfaces. 事件不是 COM 中的概念,因此不會為來源產生的 COM 介面上的執行個體事件來源產生 Interop 程式碼。 diff --git a/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/LibraryImportGeneratorHelpers.cs b/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/LibraryImportGeneratorHelpers.cs index 95ab175c46b51a..49a5e8ac5edf53 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/LibraryImportGeneratorHelpers.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/LibraryImportGenerator/LibraryImportGeneratorHelpers.cs @@ -110,6 +110,7 @@ public static IMarshallingGeneratorFactory CreateGeneratorFactory(TargetFramewor } generatorFactory = new ByValueContentsMarshalKindValidator(generatorFactory); + generatorFactory = new BreakingChangeDetector(generatorFactory); } return generatorFactory; diff --git a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/CustomMarshallingInfoHelper.cs b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/CustomMarshallingInfoHelper.cs index e3dcb7a67ae4a7..e98bc9ec3ddbd0 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/CustomMarshallingInfoHelper.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/CustomMarshallingInfoHelper.cs @@ -4,6 +4,7 @@ using System; using System.Linq; using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.DotnetRuntime.Extensions; namespace Microsoft.Interop { @@ -165,5 +166,27 @@ public static MarshallingInfo CreateNativeMarshallingInfoForNonSignatureElement( return NoMarshallingInfo.Instance; } + + public static MarshallingInfo CreateMarshallingInfoByMarshallerTypeName( + Compilation compilation, + ITypeSymbol type, + string marshallerName) + { + INamedTypeSymbol? marshallerType = compilation.GetBestTypeByMetadataName(marshallerName); + if (marshallerType is null) + return new MissingSupportMarshallingInfo(); + + if (ManualTypeMarshallingHelper.HasEntryPointMarshallerAttribute(marshallerType)) + { + if (ManualTypeMarshallingHelper.TryGetValueMarshallersFromEntryType(marshallerType, type, compilation, out CustomTypeMarshallers? marshallers)) + { + return new NativeMarshallingAttributeInfo( + EntryPointType: ManagedTypeInfo.CreateTypeInfoForTypeSymbol(marshallerType), + Marshallers: marshallers.Value); + } + } + + return new MissingSupportMarshallingInfo(); + } } } diff --git a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/MarshalAsWithCustomMarshallersParser.cs b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/MarshalAsWithCustomMarshallersParser.cs index 496a767f3c01ba..863520167a0351 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/MarshalAsWithCustomMarshallersParser.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/MarshalAsWithCustomMarshallersParser.cs @@ -85,6 +85,11 @@ public MarshalAsWithCustomMarshallersParser(Compilation compilation, GeneratorDi return CreateStringMarshallingInfo(type, marshalAsInfo); } + if (type.SpecialType == SpecialType.System_Object && marshalAsInfo is MarshalAsScalarInfo(UnmanagedType.Struct, _)) + { + return CustomMarshallingInfoHelper.CreateMarshallingInfoByMarshallerTypeName(_compilation, type, TypeNames.ComVariantMarshaller); + } + return marshalAsInfo; } @@ -106,7 +111,7 @@ private MarshallingInfo CreateStringMarshallingInfo( return marshalAsInfo; } - return StringMarshallingInfoProvider.CreateStringMarshallingInfo(_compilation, type, marshallerName); + return CustomMarshallingInfoHelper.CreateMarshallingInfoByMarshallerTypeName(_compilation, type, marshallerName); } } } diff --git a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/BreakingChangeDetector.cs b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/BreakingChangeDetector.cs new file mode 100644 index 00000000000000..43f6e850d9a4bf --- /dev/null +++ b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/Marshalling/BreakingChangeDetector.cs @@ -0,0 +1,41 @@ +// 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.Collections.Generic; +using System.Text; +using Microsoft.CodeAnalysis; + +namespace Microsoft.Interop +{ + /// + /// An that adds diagnostics to warn users about breaking changes in the interop generators, + /// whether from built-in to source-generated interop or between versions of interop source-generation. + /// + public sealed class BreakingChangeDetector(IMarshallingGeneratorFactory inner) : IMarshallingGeneratorFactory + { + public ResolvedGenerator Create(TypePositionInfo info, StubCodeContext context) + { + ResolvedGenerator gen = inner.Create(info, context); + if (!gen.ResolvedSuccessfully) + { + return gen; + } + + // Breaking change: [MarshalAs(UnmanagedType.Struct)] in object in unmanaged-to-managed scenarios will not respect VT_BYREF. + if (info is { RefKind: RefKind.In, MarshallingAttributeInfo: NativeMarshallingAttributeInfo(ManagedTypeInfo(_, TypeNames.ComVariantMarshaller), _) } + && context.Direction == MarshalDirection.UnmanagedToManaged) + { + gen = ResolvedGenerator.ResolvedWithDiagnostics( + gen.Generator, + gen.Diagnostics.Add( + new GeneratorDiagnostic.NotRecommended(info, context) + { + Details = SR.InVariantShouldBeRef + })); + } + + return gen; + } + } +} diff --git a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/StringMarshallingInfoProvider.cs b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/StringMarshallingInfoProvider.cs index 12f69adfef136b..ed96fe7cd8a74c 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/StringMarshallingInfoProvider.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/StringMarshallingInfoProvider.cs @@ -59,35 +59,13 @@ public MarshallingInfo GetMarshallingInfo(ITypeSymbol type, int indirectionDepth // No marshalling info was computed, but a character encoding was provided. return _defaultMarshallingInfo.CharEncoding switch { - CharEncoding.Utf16 => CreateStringMarshallingInfo(_compilation, type, TypeNames.Utf16StringMarshaller), - CharEncoding.Utf8 => CreateStringMarshallingInfo(_compilation, type, TypeNames.Utf8StringMarshaller), + CharEncoding.Utf16 => CustomMarshallingInfoHelper.CreateMarshallingInfoByMarshallerTypeName(_compilation, type, TypeNames.Utf16StringMarshaller), + CharEncoding.Utf8 => CustomMarshallingInfoHelper.CreateMarshallingInfoByMarshallerTypeName(_compilation, type, TypeNames.Utf8StringMarshaller), _ => throw new InvalidOperationException() }; } return new MarshallingInfoStringSupport(_defaultMarshallingInfo.CharEncoding); } - - public static MarshallingInfo CreateStringMarshallingInfo( - Compilation compilation, - ITypeSymbol type, - string marshallerName) - { - INamedTypeSymbol? stringMarshaller = compilation.GetTypeByMetadataName(marshallerName); - if (stringMarshaller is null) - return new MissingSupportMarshallingInfo(); - - if (ManualTypeMarshallingHelper.HasEntryPointMarshallerAttribute(stringMarshaller)) - { - if (ManualTypeMarshallingHelper.TryGetValueMarshallersFromEntryType(stringMarshaller, type, compilation, out CustomTypeMarshallers? marshallers)) - { - return new NativeMarshallingAttributeInfo( - EntryPointType: ManagedTypeInfo.CreateTypeInfoForTypeSymbol(stringMarshaller), - Marshallers: marshallers.Value); - } - } - - return new MissingSupportMarshallingInfo(); - } } } diff --git a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/TypeNames.cs b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/TypeNames.cs index 3eeb17588a0863..818e9d00949415 100644 --- a/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/TypeNames.cs +++ b/src/libraries/System.Runtime.InteropServices/gen/Microsoft.Interop.SourceGeneration/TypeNames.cs @@ -311,5 +311,6 @@ public static string MarshalEx(InteropGenerationOptions options) public const string CallConvSuppressGCTransitionName = "System.Runtime.CompilerServices.CallConvSuppressGCTransition"; public const string CallConvMemberFunctionName = "System.Runtime.CompilerServices.CallConvMemberFunction"; public const string Nint = "nint"; + public const string ComVariantMarshaller = "System.Runtime.InteropServices.Marshalling.ComVariantMarshaller"; } } diff --git a/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs b/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs index 59dfcf2713620d..b973972873c91e 100644 --- a/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs +++ b/src/libraries/System.Runtime.InteropServices/ref/System.Runtime.InteropServices.cs @@ -460,6 +460,23 @@ public partial interface IUnmanagedVirtualMethodTableProvider { System.Runtime.InteropServices.Marshalling.VirtualMethodTableInfo GetVirtualMethodTableInfoForKey(System.Type type); } + [System.Runtime.InteropServices.Marshalling.CustomMarshallerAttribute(typeof(object), System.Runtime.InteropServices.Marshalling.MarshalMode.Default, typeof(System.Runtime.InteropServices.Marshalling.ComVariantMarshaller))] + [System.Runtime.InteropServices.Marshalling.CustomMarshallerAttribute(typeof(object), System.Runtime.InteropServices.Marshalling.MarshalMode.UnmanagedToManagedRef, typeof(System.Runtime.InteropServices.Marshalling.ComVariantMarshaller.RefPropagate))] + public static partial class ComVariantMarshaller + { + public static System.Runtime.InteropServices.Marshalling.ComVariant ConvertToUnmanaged(object? managed) { throw null; } + public static object? ConvertToManaged(System.Runtime.InteropServices.Marshalling.ComVariant unmanaged) { throw null; } + public static void Free(System.Runtime.InteropServices.Marshalling.ComVariant unmanaged) { } + + public struct RefPropagate + { + public void FromUnmanaged(System.Runtime.InteropServices.Marshalling.ComVariant unmanaged) { } + public void FromManaged(object? managed) { } + public System.Runtime.InteropServices.Marshalling.ComVariant ToUnmanaged() { throw null; } + public object? ToManaged() { throw null; } + public void Free() { } + } + } [System.CLSCompliantAttribute(false)] public partial class StrategyBasedComWrappers : System.Runtime.InteropServices.ComWrappers { @@ -2500,6 +2517,19 @@ public static unsafe class Utf16StringMarshaller public static void Free(ushort* unmanaged) { throw null; } public static ref readonly char GetPinnableReference(string? str) { throw null; } } + public struct ComVariant : System.IDisposable + { + private int _dummyPrimitive; + + public void Dispose() { } + public static System.Runtime.InteropServices.Marshalling.ComVariant Create([System.Diagnostics.CodeAnalysis.DisallowNullAttribute] T value) { throw null; } + public static System.Runtime.InteropServices.Marshalling.ComVariant CreateRaw(System.Runtime.InteropServices.VarEnum vt, T rawValue) where T : unmanaged { throw null; } + public static System.Runtime.InteropServices.Marshalling.ComVariant Null { get { throw null; } } + public readonly T? As() { throw null; } + public readonly System.Runtime.InteropServices.VarEnum VarType { get { throw null; } } + [System.Diagnostics.CodeAnalysis.UnscopedRefAttribute] + public ref T GetRawDataRef() where T : unmanaged { throw null; } + } } namespace System.Security { diff --git a/src/libraries/System.Runtime.InteropServices/src/Resources/Strings.resx b/src/libraries/System.Runtime.InteropServices/src/Resources/Strings.resx index 828dc3e2b9fe01..86f021792dd52b 100644 --- a/src/libraries/System.Runtime.InteropServices/src/Resources/Strings.resx +++ b/src/libraries/System.Runtime.InteropServices/src/Resources/Strings.resx @@ -1,4 +1,64 @@ - + + + @@ -111,4 +171,10 @@ Specified file length was too large for the file system. - + + Type of managed object is not supported for marshalling as ComVariant. + + + Type of unmanaged variant is not supported for marshalling to a managed object. + + \ No newline at end of file diff --git a/src/libraries/System.Runtime.InteropServices/src/System.Runtime.InteropServices.csproj b/src/libraries/System.Runtime.InteropServices/src/System.Runtime.InteropServices.csproj index 393febd4cdcb7b..1f5fd6a4de7e81 100644 --- a/src/libraries/System.Runtime.InteropServices/src/System.Runtime.InteropServices.csproj +++ b/src/libraries/System.Runtime.InteropServices/src/System.Runtime.InteropServices.csproj @@ -34,6 +34,7 @@ + diff --git a/src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/Marshalling/ComVariantMarshaller.cs b/src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/Marshalling/ComVariantMarshaller.cs new file mode 100644 index 00000000000000..9c2375d3a97fa6 --- /dev/null +++ b/src/libraries/System.Runtime.InteropServices/src/System/Runtime/InteropServices/Marshalling/ComVariantMarshaller.cs @@ -0,0 +1,333 @@ +// 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.Collections.Generic; +using System.Diagnostics; +using System.Text; +using System.Threading.Tasks; + +namespace System.Runtime.InteropServices.Marshalling +{ + /// + /// Marshals an to an . + /// + /// + /// Supports the same types as as well as any types with applied. + /// + [CustomMarshaller(typeof(object), MarshalMode.Default, typeof(ComVariantMarshaller))] + [CustomMarshaller(typeof(object), MarshalMode.UnmanagedToManagedRef, typeof(RefPropagate))] + public static partial class ComVariantMarshaller + { + // VARIANT_BOOL constants. + private const short VARIANT_TRUE = -1; + private const short VARIANT_FALSE = 0; + public static ComVariant ConvertToUnmanaged(object? managed) + { + if (managed is null) + { + return default; + } + +#pragma warning disable CS0618 // Type or member is obsolete + switch (managed) + { + case sbyte s: + return ComVariant.Create(s); + case byte b: + return ComVariant.Create(b); + case short s: + return ComVariant.Create(s); + case ushort s: + return ComVariant.Create(s); + case int i: + return ComVariant.Create(i); + case uint i: + return ComVariant.Create(i); + case long l: + return ComVariant.Create(l); + case ulong l: + return ComVariant.Create(l); + case float f: + return ComVariant.Create(f); + case double d: + return ComVariant.Create(d); + case decimal d: + return ComVariant.Create(d); + case bool b: + return ComVariant.Create(b); + case string s: + return ComVariant.Create(s); + case DateTime dt: + return ComVariant.Create(dt); + case ErrorWrapper errorWrapper: + return ComVariant.Create(errorWrapper); + case CurrencyWrapper currencyWrapper: + return ComVariant.Create(currencyWrapper); + case BStrWrapper bStrWrapper: + return ComVariant.Create(bStrWrapper); + case DBNull: + return ComVariant.Null; + } +#pragma warning restore CS0618 // Type or member is obsolete + + if (TryCreateOleVariantForInterfaceWrapper(managed, out ComVariant variant)) + { + return variant; + } + + throw new ArgumentException(SR.ComVariantMarshaller_ManagedTypeNotSupported, nameof(managed)); + } + +#pragma warning disable CA1416 // Validate platform compatibility + private static unsafe bool TryCreateOleVariantForInterfaceWrapper(object managed, out ComVariant variant) + { + if (managed is UnknownWrapper uw) + { + object? wrapped = uw.WrappedObject; + if (wrapped is null) + { + variant = default; + return true; + } + variant = ComVariant.CreateRaw(VarEnum.VT_UNKNOWN, StrategyBasedComWrappers.DefaultMarshallingInstance.GetOrCreateComInterfaceForObject(wrapped, CreateComInterfaceFlags.None)); + return true; + } + else if (managed is not null && StrategyBasedComWrappers.DefaultIUnknownInterfaceDetailsStrategy.GetComExposedTypeDetails(managed.GetType().TypeHandle) is not null) + { + variant = ComVariant.CreateRaw(VarEnum.VT_UNKNOWN, StrategyBasedComWrappers.DefaultMarshallingInstance.GetOrCreateComInterfaceForObject(managed, CreateComInterfaceFlags.None)); + return true; + } + variant = default; + return false; + } +#pragma warning restore CA1416 // Validate platform compatibility + + public static unsafe object? ConvertToManaged(ComVariant unmanaged) + { +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CA1416 // Validate platform compatibility + switch (unmanaged.VarType) + { + case VarEnum.VT_EMPTY: + case VarEnum.VT_BYREF | VarEnum.VT_EMPTY: + return null; + case VarEnum.VT_NULL: + case VarEnum.VT_BYREF | VarEnum.VT_NULL: + return DBNull.Value; + case VarEnum.VT_I1: + return unmanaged.As(); + case VarEnum.VT_UI1: + return unmanaged.As(); + case VarEnum.VT_I2: + return unmanaged.As(); + case VarEnum.VT_UI2: + return unmanaged.As(); + case VarEnum.VT_INT: + case VarEnum.VT_I4: + return unmanaged.As(); + case VarEnum.VT_UINT: + case VarEnum.VT_UI4: + return unmanaged.As(); + case VarEnum.VT_I8: + return unmanaged.As(); + case VarEnum.VT_UI8: + return unmanaged.As(); + case VarEnum.VT_R4: + return unmanaged.As(); + case VarEnum.VT_R8: + return unmanaged.As(); + case VarEnum.VT_DECIMAL: + return unmanaged.As(); + case VarEnum.VT_BOOL: + return unmanaged.As(); + case VarEnum.VT_BSTR: + return unmanaged.As(); + case VarEnum.VT_DATE: + return unmanaged.As(); + case VarEnum.VT_ERROR: + return unmanaged.As(); + case VarEnum.VT_CY: + return unmanaged.As()!.WrappedObject; + case VarEnum.VT_UNKNOWN: + case VarEnum.VT_DISPATCH: + return StrategyBasedComWrappers.DefaultMarshallingInstance.GetOrCreateObjectForComInstance(unmanaged.GetRawDataRef(), CreateObjectFlags.Unwrap); + case VarEnum.VT_BYREF | VarEnum.VT_VARIANT: + return ConvertToManaged(*(ComVariant*)unmanaged.GetRawDataRef()); + case VarEnum.VT_BYREF | VarEnum.VT_I1: + return *(sbyte*)unmanaged.GetRawDataRef(); + case VarEnum.VT_BYREF | VarEnum.VT_UI1: + return *(byte*)unmanaged.GetRawDataRef(); + case VarEnum.VT_BYREF | VarEnum.VT_I2: + return *(short*)unmanaged.GetRawDataRef(); + case VarEnum.VT_BYREF | VarEnum.VT_UI2: + return *(ushort*)unmanaged.GetRawDataRef(); + case VarEnum.VT_BYREF | VarEnum.VT_I4: + return *(int*)unmanaged.GetRawDataRef(); + case VarEnum.VT_BYREF | VarEnum.VT_UI4: + return *(uint*)unmanaged.GetRawDataRef(); + case VarEnum.VT_BYREF | VarEnum.VT_I8: + return *(long*)unmanaged.GetRawDataRef(); + case VarEnum.VT_BYREF | VarEnum.VT_UI8: + return *(ulong*)unmanaged.GetRawDataRef(); + case VarEnum.VT_BYREF | VarEnum.VT_R4: + return *(float*)unmanaged.GetRawDataRef(); + case VarEnum.VT_BYREF | VarEnum.VT_R8: + return *(double*)unmanaged.GetRawDataRef(); + case VarEnum.VT_BYREF | VarEnum.VT_DECIMAL: + return *(decimal*)unmanaged.GetRawDataRef(); + case VarEnum.VT_BYREF | VarEnum.VT_BOOL: + return *(short*)unmanaged.GetRawDataRef() != VARIANT_FALSE; + case VarEnum.VT_BYREF | VarEnum.VT_BSTR: + return Marshal.PtrToStringBSTR(*(IntPtr*)unmanaged.GetRawDataRef()); + case VarEnum.VT_BYREF | VarEnum.VT_DATE: + return DateTime.FromOADate(*(double*)unmanaged.GetRawDataRef()); + case VarEnum.VT_BYREF | VarEnum.VT_ERROR: + return *(int*)unmanaged.GetRawDataRef(); + case VarEnum.VT_BYREF | VarEnum.VT_CY: + return decimal.FromOACurrency(*(long*)unmanaged.GetRawDataRef()); + case VarEnum.VT_BYREF | VarEnum.VT_UNKNOWN: + return StrategyBasedComWrappers.DefaultMarshallingInstance.GetOrCreateObjectForComInstance(*(nint*)unmanaged.GetRawDataRef(), CreateObjectFlags.Unwrap); + default: + throw new ArgumentException(SR.ComVariantMarshaller_UnmanagedTypeNotSupported, nameof(unmanaged)); + } +#pragma warning restore CA1416 // Validate platform compatibility +#pragma warning restore CS0618 // Type or member is obsolete + } + + public static void Free(ComVariant unmanaged) => unmanaged.Dispose(); + + /// + /// Marshals a to an , propagating the value of the back to the variant's + /// existing data storage if the variant has type. + /// + public struct RefPropagate + { + private ComVariant _unmanaged; + private object? _managed; + + /// + /// Initializes the marshaller with an unmanaged variant. + /// + /// The unmanaged value + public void FromUnmanaged(ComVariant unmanaged) => _unmanaged = unmanaged; + + /// + /// Initializes the marshaller with a managed object. + /// + /// The managed object. + public void FromManaged(object? managed) => _managed = managed; + + /// + /// Create an unmanaged based on the provided managed and unmanaged values. + /// + /// An instance representing the marshaller's current state. + /// When the managed value must be propagated back to the unmanaged variant, but the managed value type cannot be converted to the variant's type. + public unsafe ComVariant ToUnmanaged() + { + if (!_unmanaged.VarType.HasFlag(VarEnum.VT_BYREF)) + { + return ConvertToUnmanaged(_managed); + } + + if (_managed is null + && (_unmanaged.VarType & ~VarEnum.VT_BYREF) is + VarEnum.VT_BSTR + or VarEnum.VT_DISPATCH + or VarEnum.VT_UNKNOWN) + { + *(IntPtr*)_unmanaged.GetRawDataRef() = default; + return _unmanaged; + } + +#pragma warning disable CS0618 // Type or member is obsolete +#pragma warning disable CA1416 // Validate platform compatibility + switch ((_unmanaged.VarType & ~VarEnum.VT_BYREF, _managed)) + { + case (VarEnum.VT_VARIANT, _): + *(ComVariant*)_unmanaged.GetRawDataRef() = ConvertToUnmanaged(_managed); + break; + case (VarEnum.VT_I1 or VarEnum.VT_UI1, sbyte s): + *(sbyte*)_unmanaged.GetRawDataRef() = s; + break; + case (VarEnum.VT_I1 or VarEnum.VT_UI1, byte b): + *(byte*)_unmanaged.GetRawDataRef() = b; + break; + case (VarEnum.VT_I2 or VarEnum.VT_UI2, short s): + *(short*)_unmanaged.GetRawDataRef() = s; + break; + case (VarEnum.VT_I2 or VarEnum.VT_UI2, ushort u): + *(ushort*)_unmanaged.GetRawDataRef() = u; + break; + case (VarEnum.VT_I4 or VarEnum.VT_INT or VarEnum.VT_UI4 or VarEnum.VT_UINT or VarEnum.VT_ERROR, int i): + *(int*)_unmanaged.GetRawDataRef() = i; + break; + case (VarEnum.VT_I4 or VarEnum.VT_INT or VarEnum.VT_UI4 or VarEnum.VT_UINT or VarEnum.VT_ERROR, uint u): + *(uint*)_unmanaged.GetRawDataRef() = u; + break; + case (VarEnum.VT_I8 or VarEnum.VT_UI8, long l): + *(long*)_unmanaged.GetRawDataRef() = l; + break; + case (VarEnum.VT_I8 or VarEnum.VT_UI8, ulong ul): + *(ulong*)_unmanaged.GetRawDataRef() = ul; + break; + case (VarEnum.VT_R4, float f): + *(float*)_unmanaged.GetRawDataRef() = f; + break; + case (VarEnum.VT_R8, double d): + *(double*)_unmanaged.GetRawDataRef() = d; + break; + case (VarEnum.VT_DECIMAL, decimal d): + *(decimal*)_unmanaged.GetRawDataRef() = d; + break; + case (VarEnum.VT_BOOL, bool b): + *(short*)_unmanaged.GetRawDataRef() = b ? VARIANT_TRUE : VARIANT_FALSE; + break; + case (VarEnum.VT_BSTR, string str): + { + ref IntPtr bstrStorage = ref *(IntPtr*)_unmanaged.GetRawDataRef(); + Marshal.FreeBSTR(bstrStorage); + bstrStorage = Marshal.StringToBSTR(str); + break; + } + case (VarEnum.VT_BSTR, BStrWrapper str): + { + ref IntPtr bstrStorage = ref *(IntPtr*)_unmanaged.GetRawDataRef(); + Marshal.FreeBSTR(bstrStorage); + bstrStorage = Marshal.StringToBSTR(str.WrappedObject); + break; + } + case (VarEnum.VT_DATE, DateTime dt): + *(double*)_unmanaged.GetRawDataRef() = dt.ToOADate(); + break; + case (VarEnum.VT_ERROR, ErrorWrapper error): + *(int*)_unmanaged.GetRawDataRef() = error.ErrorCode; + break; + case (VarEnum.VT_CY, CurrencyWrapper cy): + *(long*)_unmanaged.GetRawDataRef() = decimal.ToOACurrency(cy.WrappedObject); + break; + case (VarEnum.VT_UNKNOWN, object unkObj): + *(IntPtr*)_unmanaged.GetRawDataRef() = StrategyBasedComWrappers.DefaultMarshallingInstance.GetOrCreateComInterfaceForObject(unkObj, CreateComInterfaceFlags.None); + break; + default: + throw new ArgumentException("Invalid combination of unmanaged variant type and managed object type.", nameof(_managed)); + } +#pragma warning restore CA1416 // Validate platform compatibility +#pragma warning restore CS0618 // Type or member is obsolete + + return _unmanaged; + } + + /// + /// Create the managed value based on the provided unmanaged value. + /// + /// The managed value corresponding to the VARIANT. + public object? ToManaged() => ConvertToManaged(_unmanaged); + + /// + /// Free all resources owned by the marshaller. + /// + public void Free() => _unmanaged.Dispose(); + } + } +} diff --git a/src/libraries/System.Runtime.InteropServices/tests/ComInterfaceGenerator.Unit.Tests/CodeSnippets.cs b/src/libraries/System.Runtime.InteropServices/tests/ComInterfaceGenerator.Unit.Tests/CodeSnippets.cs index 700797fcb3e888..12b59f274425a6 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/ComInterfaceGenerator.Unit.Tests/CodeSnippets.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/ComInterfaceGenerator.Unit.Tests/CodeSnippets.cs @@ -301,6 +301,31 @@ partial interface INativeAPI """; public string BasicParametersAndModifiersNoImplicitThis() => BasicParametersAndModifiersNoImplicitThis(typeof(T).FullName!); + + public string MarshalAsParameterAndModifiers(string typeName, UnmanagedType unmanagedType) => + $$""" + using System.Runtime.CompilerServices; + using System.Runtime.InteropServices; + using System.Runtime.InteropServices.Marshalling; + + [assembly:DisableRuntimeMarshalling] + + {{UnmanagedObjectUnwrapper(typeof(UnmanagedObjectUnwrapper.TestUnwrapper))}} + {{GeneratedComInterface()}} + partial interface INativeAPI + { + {{VirtualMethodIndex(0)}} + [return: {|#10:MarshalAs(UnmanagedType.{{unmanagedType}})|}] + {{typeName}} {|#0:Method|}( + [{|#11:MarshalAs(UnmanagedType.{{unmanagedType}})|}] {{typeName}} {|#1:value|}, + [{|#12:MarshalAs(UnmanagedType.{{unmanagedType}})|}] in {{typeName}} {|#2:inValue|}, + [{|#13:MarshalAs(UnmanagedType.{{unmanagedType}})|}] ref {{typeName}} {|#3:refValue|}, + [{|#14:MarshalAs(UnmanagedType.{{unmanagedType}})|}] out {{typeName}} {|#4:outValue|}); + } + + {{_attributeProvider.AdditionalUserRequiredInterfaces("INativeAPI")}} + """; + public string MarshalUsingCollectionCountInfoParametersAndModifiers() => MarshalUsingCollectionCountInfoParametersAndModifiers(typeof(T).ToString()); public string MarshalUsingCollectionCountInfoParametersAndModifiers(string collectionType) => $$""" using System.Runtime.CompilerServices; diff --git a/src/libraries/System.Runtime.InteropServices/tests/ComInterfaceGenerator.Unit.Tests/CompileFails.cs b/src/libraries/System.Runtime.InteropServices/tests/ComInterfaceGenerator.Unit.Tests/CompileFails.cs index 331fa54117fb04..198e3370c04cd0 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/ComInterfaceGenerator.Unit.Tests/CompileFails.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/ComInterfaceGenerator.Unit.Tests/CompileFails.cs @@ -909,5 +909,24 @@ public async Task ValidateReturnTypeInfoDiagnostics(string id, string source, Di test.DisabledDiagnostics.Remove(GeneratorDiagnostics.Ids.NotRecommendedGeneratedComInterfaceUsage); await test.RunAsync(); } + + [Fact] + public async Task ByRefInVariant_ReportsNotRecommendedDiagnostic() + { + CodeSnippets codeSnippets = new CodeSnippets(GeneratorKind.ComInterfaceGeneratorManagedObjectWrapper); + + var test = new VerifyComInterfaceGenerator.Test(referenceAncillaryInterop: false) + { + TestCode = codeSnippets.MarshalAsParameterAndModifiers("object", System.Runtime.InteropServices.UnmanagedType.Struct), + TestBehaviors = TestBehaviors.SkipGeneratedSourcesCheck | TestBehaviors.SkipGeneratedCodeCheck, + }; + test.ExpectedDiagnostics.Add( + VerifyComInterfaceGenerator + .Diagnostic(GeneratorDiagnostics.GeneratedComInterfaceUsageDoesNotFollowBestPractices) + .WithLocation(2) + .WithArguments(SR.InVariantShouldBeRef)); + test.DisabledDiagnostics.Remove(GeneratorDiagnostics.Ids.NotRecommendedGeneratedComInterfaceUsage); + await test.RunAsync(); + } } } diff --git a/src/libraries/System.Runtime.InteropServices/tests/ComInterfaceGenerator.Unit.Tests/Compiles.cs b/src/libraries/System.Runtime.InteropServices/tests/ComInterfaceGenerator.Unit.Tests/Compiles.cs index 3d20f2a8c7c681..bf04b97ffcded6 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/ComInterfaceGenerator.Unit.Tests/Compiles.cs +++ b/src/libraries/System.Runtime.InteropServices/tests/ComInterfaceGenerator.Unit.Tests/Compiles.cs @@ -339,6 +339,14 @@ public static IEnumerable ComInterfaceSnippetsToCompile() yield return new object[] { ID(), codeSnippets.ComInterfaceParameters }; } + public static IEnumerable ManagedToUnmanagedComInterfaceSnippetsToCompile() + { + CodeSnippets codeSnippets = new(GeneratorKind.ComInterfaceGeneratorComObjectWrapper); + + // MarshalAs + yield return new[] { ID(), codeSnippets.MarshalAsParameterAndModifiers("object", System.Runtime.InteropServices.UnmanagedType.Struct) }; + } + [Theory] [MemberData(nameof(CodeSnippetsToCompile), GeneratorKind.ComInterfaceGenerator)] [MemberData(nameof(CustomCollections), GeneratorKind.ComInterfaceGenerator)] @@ -346,6 +354,7 @@ public static IEnumerable ComInterfaceSnippetsToCompile() [MemberData(nameof(UnmanagedToManagedCodeSnippetsToCompile), GeneratorKind.ComInterfaceGeneratorManagedObjectWrapper)] [MemberData(nameof(CustomCollectionsManagedToUnmanaged), GeneratorKind.ComInterfaceGeneratorComObjectWrapper)] [MemberData(nameof(ComInterfaceSnippetsToCompile))] + [MemberData(nameof(ManagedToUnmanagedComInterfaceSnippetsToCompile))] public async Task ValidateComInterfaceSnippets(string id, string source) { _ = id; diff --git a/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/VariantTests.cs b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/VariantTests.cs new file mode 100644 index 00000000000000..2689327c2a1fef --- /dev/null +++ b/src/libraries/System.Runtime.InteropServices/tests/LibraryImportGenerator.Tests/VariantTests.cs @@ -0,0 +1,28 @@ +// 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.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Xunit; + +namespace LibraryImportGenerator.IntegrationTests +{ + partial class NativeExportsNE + { + [LibraryImport(NativeExportsNE_Binary, EntryPoint = "get_variant_bstr_length")] + public static partial int GetVTBStrLength([MarshalAs(UnmanagedType.Struct)] in object obj); + } + + public class VariantTests + { + [Fact] + public void MarshalAsStruct_UsesVariantMarshaller() + { + Assert.Equal(3, NativeExportsNE.GetVTBStrLength("Foo")); + } + } +} diff --git a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System.Runtime.InteropServices.Tests.csproj b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System.Runtime.InteropServices.Tests.csproj index 90173a66a48c68..31369aaca2a4a3 100644 --- a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System.Runtime.InteropServices.Tests.csproj +++ b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System.Runtime.InteropServices.Tests.csproj @@ -30,6 +30,8 @@ + + diff --git a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/ComVariantMarshallerTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/ComVariantMarshallerTests.cs new file mode 100644 index 00000000000000..1e7e38610310e4 --- /dev/null +++ b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/ComVariantMarshallerTests.cs @@ -0,0 +1,295 @@ +// 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.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices.Marshalling; +using System.Runtime.InteropServices.Tests.Common; +using System.Text; +using System.Threading.Tasks; +using Xunit; + +namespace System.Runtime.InteropServices.Tests +{ + // NanoServer doesn't have any of the OLE Automation stack available, so we can't run these tests there. + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] + public partial class ComVariantMarshallerTests + { + [Fact] + public void Null_Marshals_To_Empty() + { + Assert.Equal(VarEnum.VT_EMPTY, ComVariantMarshaller.ConvertToUnmanaged(null).VarType); + Assert.Null(ComVariantMarshaller.ConvertToManaged(default)); + } + + [Fact] + public void DBNull_Marshals_To_Null() + { + Assert.Equal(VarEnum.VT_NULL, ComVariantMarshaller.ConvertToUnmanaged(DBNull.Value).VarType); + Assert.Same(DBNull.Value, ComVariantMarshaller.ConvertToManaged(ComVariant.Null)); + } + + [Fact] + public void String_Marshals_To_BStr() + { + string value = "Hello"; + ComVariant variant = ComVariantMarshaller.ConvertToUnmanaged(value); + Assert.Equal(VarEnum.VT_BSTR, variant.VarType); + Assert.Equal(value, ComVariantMarshaller.ConvertToManaged(variant)); + ComVariantMarshaller.Free(variant); + } + + [Fact] + public void BStrWrapper_Marshals_To_BStr() + { + string value = "Hello"; + ComVariant variant = ComVariantMarshaller.ConvertToUnmanaged(new BStrWrapper(value)); + Assert.Equal(VarEnum.VT_BSTR, variant.VarType); + Assert.Equal(value, ComVariantMarshaller.ConvertToManaged(variant)); + ComVariantMarshaller.Free(variant); + } + + [Fact] + public void Int32_Marshals_To_I4() + { + int value = 42; + ComVariant variant = ComVariantMarshaller.ConvertToUnmanaged(value); + Assert.Equal(VarEnum.VT_I4, variant.VarType); + Assert.Equal(value, ComVariantMarshaller.ConvertToManaged(variant)); + ComVariantMarshaller.Free(variant); + } + + [Fact] + public void UInt32_Marshals_To_UI4() + { + uint value = 42; + ComVariant variant = ComVariantMarshaller.ConvertToUnmanaged(value); + Assert.Equal(VarEnum.VT_UI4, variant.VarType); + Assert.Equal(value, ComVariantMarshaller.ConvertToManaged(variant)); + ComVariantMarshaller.Free(variant); + } + + [Fact] + public void Int16_Marshals_To_I2() + { + short value = 42; + ComVariant variant = ComVariantMarshaller.ConvertToUnmanaged(value); + Assert.Equal(VarEnum.VT_I2, variant.VarType); + Assert.Equal(value, ComVariantMarshaller.ConvertToManaged(variant)); + ComVariantMarshaller.Free(variant); + } + + [Fact] + public void UInt16_Marshals_To_UI2() + { + ushort value = 42; + ComVariant variant = ComVariantMarshaller.ConvertToUnmanaged(value); + Assert.Equal(VarEnum.VT_UI2, variant.VarType); + Assert.Equal(value, ComVariantMarshaller.ConvertToManaged(variant)); + ComVariantMarshaller.Free(variant); + } + + [Fact] + public void Byte_Marshals_To_UI1() + { + byte value = 42; + ComVariant variant = ComVariantMarshaller.ConvertToUnmanaged(value); + Assert.Equal(VarEnum.VT_UI1, variant.VarType); + Assert.Equal(value, ComVariantMarshaller.ConvertToManaged(variant)); + ComVariantMarshaller.Free(variant); + } + + [Fact] + public void SByte_Marshals_To_I1() + { + sbyte value = 42; + ComVariant variant = ComVariantMarshaller.ConvertToUnmanaged(value); + Assert.Equal(VarEnum.VT_I1, variant.VarType); + Assert.Equal(value, ComVariantMarshaller.ConvertToManaged(variant)); + ComVariantMarshaller.Free(variant); + } + + [Fact] + public void Double_Marshals_To_R8() + { + double value = 42.0; + ComVariant variant = ComVariantMarshaller.ConvertToUnmanaged(value); + Assert.Equal(VarEnum.VT_R8, variant.VarType); + Assert.Equal(value, ComVariantMarshaller.ConvertToManaged(variant)); + ComVariantMarshaller.Free(variant); + } + + [Fact] + public void Single_Marshals_To_R4() + { + float value = 42.0f; + ComVariant variant = ComVariantMarshaller.ConvertToUnmanaged(value); + Assert.Equal(VarEnum.VT_R4, variant.VarType); + Assert.Equal(value, ComVariantMarshaller.ConvertToManaged(variant)); + ComVariantMarshaller.Free(variant); + } + + [InlineData(true)] + [InlineData(false)] + [Theory] + public void Boolean_Marshals_To_BOOL(bool value) + { + ComVariant variant = ComVariantMarshaller.ConvertToUnmanaged(value); + Assert.Equal(VarEnum.VT_BOOL, variant.VarType); + Assert.Equal(value, ComVariantMarshaller.ConvertToManaged(variant)); + ComVariantMarshaller.Free(variant); + } + + [Fact] + public void ErrorWrapper_Maps_To_VT_ERROR() + { + ErrorWrapper errorWrapper = new ErrorWrapper(42); + ComVariant variant = ComVariantMarshaller.ConvertToUnmanaged(errorWrapper); + Assert.Equal(VarEnum.VT_ERROR, variant.VarType); + Assert.Equal(errorWrapper.ErrorCode, Assert.IsType(ComVariantMarshaller.ConvertToManaged(variant))); + ComVariantMarshaller.Free(variant); + } + + [Fact] + public void VariantWrapper_Throws() + { + VariantWrapper wrapper = new VariantWrapper(42); + Assert.Throws("managed", () => ComVariantMarshaller.ConvertToUnmanaged(wrapper)); + } + + [Fact] + public void Decimal_Marshals_To_DECIMAL() + { + decimal value = 42.0m; + ComVariant variant = ComVariantMarshaller.ConvertToUnmanaged(value); + Assert.Equal(VarEnum.VT_DECIMAL, variant.VarType); + Assert.Equal(value, ComVariantMarshaller.ConvertToManaged(variant)); + ComVariantMarshaller.Free(variant); + } + + [Fact] + public void Date_Marshals_To_DATE() + { + // OLE dates do not have time zones and do not support sub-millisecond precision. + // Select a date format that includes the maximum precision that OLE supports. + DateTime value = DateTime.Parse("2023-10-17T14:47:32.6390000"); + ComVariant variant = ComVariantMarshaller.ConvertToUnmanaged(value); + Assert.Equal(VarEnum.VT_DATE, variant.VarType); + Assert.Equal(value, ComVariantMarshaller.ConvertToManaged(variant)); + ComVariantMarshaller.Free(variant); + } + +#pragma warning disable CS0618 // Type or member is obsolete + [Fact] + public void CurrentyWrapper_Marshals_To_CY() + { + decimal value = 42.0m; + ComVariant variant = ComVariantMarshaller.ConvertToUnmanaged(new CurrencyWrapper(value)); + Assert.Equal(VarEnum.VT_CY, variant.VarType); + Assert.Equal(value, Assert.IsType(ComVariantMarshaller.ConvertToManaged(variant))); + ComVariantMarshaller.Free(variant); + } +#pragma warning restore CS0618 // Type or member is obsolete + + [GeneratedComInterface] + [Guid("ADD9E468-1503-48E5-AA18-B6B6BD1FF34A")] + internal partial interface IGeneratedComInterface + { + void Method(); + } + + [GeneratedComClass] + internal sealed partial class ComExposedType : IGeneratedComInterface + { + public void Method() { } + } + + [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/55742", TestRuntimes.Mono)] + public unsafe void GeneratedComInterfaceType_Marshals_To_UNKNOWN() + { + var obj = new ComExposedType(); + ComVariant variant = ComVariantMarshaller.ConvertToUnmanaged(obj); + Assert.Equal(VarEnum.VT_UNKNOWN, variant.VarType); + // Validate that the correct object is wrapped. + Assert.True(ComWrappers.TryGetObject(variant.GetRawDataRef(), out object wrappedObj)); + Assert.Same(obj, wrappedObj); + // Validate that we use the same ComWrappers instance as ComInterfaceMarshaller. + Assert.Same(obj, ComInterfaceMarshaller.ConvertToManaged((void*)variant.GetRawDataRef())); + Assert.Same(obj, ComVariantMarshaller.ConvertToManaged(variant)); + ComVariantMarshaller.Free(variant); + } + + [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/55742", TestRuntimes.Mono)] + public void UnknownWrapper_Of_GeneratedComInterfaceType_Marshals_To_UNKNOWN() + { + var obj = new ComExposedType(); + ComVariant variant = ComVariantMarshaller.ConvertToUnmanaged(new UnknownWrapper(obj)); + Assert.Equal(VarEnum.VT_UNKNOWN, variant.VarType); + Assert.True(ComWrappers.TryGetObject(variant.GetRawDataRef(), out object wrappedObj)); + Assert.Same(obj, wrappedObj); + Assert.Same(obj, ComVariantMarshaller.ConvertToManaged(variant)); + ComVariantMarshaller.Free(variant); + } + + [Fact] + public void INT_Marshals_as_Int() + { + ComVariant variant = ComVariant.CreateRaw(VarEnum.VT_INT, 42); + Assert.Equal(42, Assert.IsType(ComVariantMarshaller.ConvertToManaged(variant))); + } + + [Fact] + public void UINT_Marshals_as_UInt() + { + ComVariant variant = ComVariant.CreateRaw(VarEnum.VT_UINT, 42u); + Assert.Equal(42u, Assert.IsType(ComVariantMarshaller.ConvertToManaged(variant))); + } + + [InlineData(VarEnum.VT_I1, (byte)42)] + [InlineData(VarEnum.VT_I1, (sbyte)42)] + [InlineData(VarEnum.VT_UI1, (byte)42)] + [InlineData(VarEnum.VT_UI1, (sbyte)42)] + [InlineData(VarEnum.VT_I2, (short)42)] + [InlineData(VarEnum.VT_I2, (ushort)42)] + [InlineData(VarEnum.VT_UI2, (short)42)] + [InlineData(VarEnum.VT_UI2, (ushort)42)] + [InlineData(VarEnum.VT_I4, 42)] + [InlineData(VarEnum.VT_I4, (uint)42)] + [InlineData(VarEnum.VT_UI4, 42)] + [InlineData(VarEnum.VT_UI4, (uint)42)] + [InlineData(VarEnum.VT_ERROR, (uint)42)] + [InlineData(VarEnum.VT_ERROR, 42)] + [InlineData(VarEnum.VT_I8, 42L)] + [InlineData(VarEnum.VT_I8, 42UL)] + [InlineData(VarEnum.VT_UI8, 42L)] + [InlineData(VarEnum.VT_UI8, 42UL)] + [InlineData(VarEnum.VT_R4, 42.0f)] + [InlineData(VarEnum.VT_R8, 42.0)] + [InlineData(VarEnum.VT_BOOL, true)] + [InlineData(VarEnum.VT_BOOL, false)] + [Theory] + public unsafe void ByRef_Primitives(VarEnum elementType, object valueToSet) + { + long storage = 0; + ComVariant variant = ComVariant.CreateRaw(VarEnum.VT_BYREF | elementType, (nint)(&storage)); + // Set up the marshaller + ComVariantMarshaller.RefPropagate marshaller = default; + marshaller.FromUnmanaged(variant); + + // Marshal back the new value + marshaller.FromManaged(valueToSet); + + ComVariant updated = marshaller.ToUnmanaged(); + + // Make sure we didn't change the pointer. + Assert.Equal(variant.GetRawDataRef(), updated.GetRawDataRef()); + + // Validate that the new value of the variant is the same as the value we set. + // Go through IConvertible to handle the case of "same size, different signedness" (e.g. int and uint) + Assert.Equal(valueToSet, ((IConvertible)ComVariantMarshaller.ConvertToManaged(variant)).ToType(valueToSet.GetType(), null)); + } + } +} diff --git a/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/ComVariantTests.cs b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/ComVariantTests.cs new file mode 100644 index 00000000000000..652b07c09c9fc0 --- /dev/null +++ b/src/libraries/System.Runtime.InteropServices/tests/System.Runtime.InteropServices.UnitTests/System/Runtime/InteropServices/ComVariantTests.cs @@ -0,0 +1,493 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices.Marshalling; +using System.Runtime.InteropServices.Tests.Common; +using Xunit; + +namespace System.Runtime.InteropServices.Tests +{ + // NanoServer doesn't have any of the OLE Automation stack available, so we can't run these tests there. + [ConditionalClass(typeof(PlatformDetection), nameof(PlatformDetection.IsNotWindowsNanoServer))] + public class ComVariantTests + { + [Fact] + public void DefaultVariantIsEmpty() + { + Assert.Equal(VarEnum.VT_EMPTY, default(ComVariant).VarType); + } + + [Fact] + public void NullVariantIsNull() + { + Assert.Equal(VarEnum.VT_NULL, ComVariant.Null.VarType); + } + + [Fact] + public void Short() + { + ComVariant variant = ComVariant.Create(42); + Assert.Equal(VarEnum.VT_I2, variant.VarType); + Assert.Equal(42, variant.As()); + Assert.Equal(42, variant.GetRawDataRef()); + } + + [Fact] + public void Int4() + { + ComVariant variant = ComVariant.Create(42); + Assert.Equal(VarEnum.VT_I4, variant.VarType); + Assert.Equal(42, variant.As()); + Assert.Equal(42, variant.GetRawDataRef()); + } + + [Fact] + public void Float() + { + ComVariant variant = ComVariant.Create(42.0f); + Assert.Equal(VarEnum.VT_R4, variant.VarType); + Assert.Equal(42, variant.As()); + Assert.Equal(42, variant.GetRawDataRef()); + } + + [Fact] + public void Double() + { + ComVariant variant = ComVariant.Create(42.0); + Assert.Equal(VarEnum.VT_R8, variant.VarType); + Assert.Equal(42, variant.As()); + Assert.Equal(42, variant.GetRawDataRef()); + } + +#pragma warning disable CS0618 // Type or member is obsolete + [Fact] + public void Currency() + { + ComVariant variant = ComVariant.Create(new CurrencyWrapper(42.0m)); + Assert.Equal(VarEnum.VT_CY, variant.VarType); + Assert.Equal(42.0m, variant.As().WrappedObject); + Assert.Equal(decimal.ToOACurrency(42.0m), variant.GetRawDataRef()); + } +#pragma warning restore CS0618 // Type or member is obsolete + + [Fact] + public void Date() + { + ComVariant variant = ComVariant.Create(new DateTime(2020, 1, 1)); + Assert.Equal(VarEnum.VT_DATE, variant.VarType); + Assert.Equal(new DateTime(2020, 1, 1), variant.As()); + Assert.Equal(new DateTime(2020, 1, 1).ToOADate(), variant.GetRawDataRef()); + } + + [Fact] + public void BStrWrapper() + { + using ComVariant variant = ComVariant.Create(new BStrWrapper("Foo")); + Assert.Equal(VarEnum.VT_BSTR, variant.VarType); + Assert.Equal("Foo", variant.As().WrappedObject); + Assert.Equal("Foo", Marshal.PtrToStringBSTR(variant.GetRawDataRef())); + } + + [Fact] + public void BStr_String() + { + using ComVariant variant = ComVariant.Create("Foo"); + Assert.Equal(VarEnum.VT_BSTR, variant.VarType); + Assert.Equal("Foo", variant.As()); + Assert.Equal("Foo", Marshal.PtrToStringBSTR(variant.GetRawDataRef())); + } + + [Fact] + public void BStr_String_Null() + { + using ComVariant variant = ComVariant.Create(null); + Assert.Equal(VarEnum.VT_BSTR, variant.VarType); + Assert.Null(variant.As()); + Assert.Equal(IntPtr.Zero, variant.GetRawDataRef()); + } + +#if WINDOWS + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltInComEnabled))] + public void Dispatch_NotSupported() + { + DispatchWrapper wrapper = new(new IDispatchComObject()); + Assert.Throws("T", () => ComVariant.Create(wrapper)); + } +#endif + + [Fact] + public void Error() + { + ComVariant variant = ComVariant.CreateRaw(VarEnum.VT_ERROR, 1); + Assert.Equal(VarEnum.VT_ERROR, variant.VarType); + Assert.Equal(1, variant.GetRawDataRef()); + Assert.Equal(1, variant.As().ErrorCode); + Assert.Equal(1, variant.As()); + } + + [Fact] + public void VariantBoolTrue() + { + ComVariant trueVariant = ComVariant.Create(true); + Assert.Equal(VarEnum.VT_BOOL, trueVariant.VarType); + Assert.True(trueVariant.As()); + Assert.Equal(-1, trueVariant.GetRawDataRef()); + } + + [Fact] + public void VariantBoolFalse() + { + ComVariant falseVariant = ComVariant.Create(false); + Assert.Equal(VarEnum.VT_BOOL, falseVariant.VarType); + Assert.False(falseVariant.As()); + Assert.Equal(0, falseVariant.GetRawDataRef()); + } + + [Fact] + public void VTVariantNotSupported() + { + Assert.Throws("vt", () => ComVariant.CreateRaw(VarEnum.VT_VARIANT, 1)); + } + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsBuiltInComEnabled))] + public void Unknown_NotSupported() + { + UnknownWrapper wrapper = new(new TestObject()); + Assert.Throws("T", () => ComVariant.Create(wrapper)); + } + + [ComImport] + [Guid("9FBB5303-ED8B-448D-8174-571D03E1D947")] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + public interface IUnknownInterface + { + } + + private sealed class TestObject : IUnknownInterface + { + } + + [Fact] + public void Decimal() + { + ComVariant variant = ComVariant.Create(42.0m); + Assert.Equal(VarEnum.VT_DECIMAL, variant.VarType); + Assert.Equal(42.0m, variant.As()); + Assert.ThrowsAny(() => variant.GetRawDataRef()); + } + + [Fact] + public void SByte() + { + ComVariant variant = ComVariant.Create(42); + Assert.Equal(VarEnum.VT_I1, variant.VarType); + Assert.Equal(42, variant.As()); + Assert.Equal(42, variant.GetRawDataRef()); + } + + [Fact] + public void Byte() + { + ComVariant variant = ComVariant.Create(42); + Assert.Equal(VarEnum.VT_UI1, variant.VarType); + Assert.Equal(42, variant.As()); + Assert.Equal(42, variant.GetRawDataRef()); + } + + [Fact] + public void UShort() + { + ComVariant variant = ComVariant.Create(42); + Assert.Equal(VarEnum.VT_UI2, variant.VarType); + Assert.Equal(42, variant.As()); + Assert.Equal(42, variant.GetRawDataRef()); + } + + [Fact] + public void UInt4() + { + ComVariant variant = ComVariant.Create(42); + Assert.Equal(VarEnum.VT_UI4, variant.VarType); + Assert.Equal(42u, variant.As()); + Assert.Equal(42u, variant.GetRawDataRef()); + } + + [Fact] + public void Long() + { + ComVariant variant = ComVariant.Create(42); + Assert.Equal(VarEnum.VT_I8, variant.VarType); + Assert.Equal(42, variant.As()); + Assert.Equal(42, variant.GetRawDataRef()); + } + + [Fact] + public void ULong() + { + ComVariant variant = ComVariant.Create(42); + Assert.Equal(VarEnum.VT_UI8, variant.VarType); + Assert.Equal(42ul, variant.As()); + Assert.Equal(42ul, variant.GetRawDataRef()); + } + + [Fact] + public void Int_Raw() + { + ComVariant variant = ComVariant.CreateRaw(VarEnum.VT_INT, 42); + Assert.Equal(VarEnum.VT_INT, variant.VarType); + Assert.Equal(42, variant.As()); + Assert.Equal(42, variant.GetRawDataRef()); + } + + [Fact] + public void UInt() + { + ComVariant variant = ComVariant.CreateRaw(VarEnum.VT_UINT, 42u); + Assert.Equal(VarEnum.VT_UINT, variant.VarType); + Assert.Equal(42u, variant.As()); + Assert.Equal(42u, variant.GetRawDataRef()); + } + + [StructLayout(LayoutKind.Sequential)] + private struct Record + { + private IntPtr _typeDesc; + private IntPtr _data; + } + + [Fact] + public void Record_Raw() + { + // We do not support record types in the opinionated Create method. + Assert.Throws("T", () => ComVariant.Create(new Record())); + // We support creating a record-based variant with the CreateRaw method. + ComVariant variant = ComVariant.CreateRaw(VarEnum.VT_RECORD, new Record()); + Assert.Equal(VarEnum.VT_RECORD, variant.VarType); + Assert.Equal(default, variant.GetRawDataRef()); + } + + [Fact] + public void LPStr_Raw() + { + string str = "Foo"; + using ComVariant variant = ComVariant.CreateRaw(VarEnum.VT_LPSTR, Marshal.StringToCoTaskMemAnsi(str)); + Assert.Equal(VarEnum.VT_LPSTR, variant.VarType); + Assert.Throws(variant.As); + Assert.Equal(str, Marshal.PtrToStringAnsi(variant.GetRawDataRef())); + } + + [Fact] + public void LPWStr_Raw() + { + string str = "Foo"; + using ComVariant variant = ComVariant.CreateRaw(VarEnum.VT_LPWSTR, Marshal.StringToCoTaskMemUni(str)); + Assert.Equal(VarEnum.VT_LPWSTR, variant.VarType); + Assert.Throws(variant.As); + Assert.Equal(str, Marshal.PtrToStringUni(variant.GetRawDataRef())); + } + + [Fact] + public void FileTime_Raw() + { + long fileTime = DateTime.Now.ToFileTime(); + ComVariant variant = ComVariant.CreateRaw(VarEnum.VT_FILETIME, fileTime); + Assert.Equal(VarEnum.VT_FILETIME, variant.VarType); + Assert.Throws(() => variant.As()); + Assert.Equal(fileTime, variant.GetRawDataRef()); + } + + [StructLayout(LayoutKind.Sequential)] + private struct Blob + { + public int Length; + public IntPtr Data; + } + + [Fact] + public void Blob_Raw() + { + Blob blob = new Blob { Length = 3, Data = Marshal.AllocCoTaskMem(25) }; + using ComVariant variant = ComVariant.CreateRaw(VarEnum.VT_BLOB, blob); + Assert.Equal(VarEnum.VT_BLOB, variant.VarType); + Assert.Throws("T", () => variant.As()); + Assert.Equal(blob, variant.GetRawDataRef()); + } + + [Fact] + public void Stream_Raw() + { + IntPtr nativeStream = 42; + // Using a fake value so we aren't disposing the ComVariant instance. + ComVariant variant = ComVariant.CreateRaw(VarEnum.VT_STREAM, nativeStream); + Assert.Equal(VarEnum.VT_STREAM, variant.VarType); + Assert.Equal(nativeStream, variant.GetRawDataRef()); + } + + [Fact] + public void Storage_Raw() + { + IntPtr nativeStorage = 42; + // Using a fake value so we aren't disposing the ComVariant instance. + ComVariant variant = ComVariant.CreateRaw(VarEnum.VT_STORAGE, nativeStorage); + Assert.Equal(VarEnum.VT_STORAGE, variant.VarType); + Assert.Equal(nativeStorage, variant.GetRawDataRef()); + } + + [Fact] + public void StreamedObject_Raw() + { + IntPtr nativeStream = 42; + // Using a fake value so we aren't disposing the ComVariant instance. + ComVariant variant = ComVariant.CreateRaw(VarEnum.VT_STREAMED_OBJECT, nativeStream); + Assert.Equal(VarEnum.VT_STREAMED_OBJECT, variant.VarType); + Assert.Equal(nativeStream, variant.GetRawDataRef()); + } + + [Fact] + public void StoredObject_Raw() + { + IntPtr nativeStorage = 42; + // Using a fake value so we aren't disposing the ComVariant instance. + ComVariant variant = ComVariant.CreateRaw(VarEnum.VT_STORED_OBJECT, nativeStorage); + Assert.Equal(VarEnum.VT_STORED_OBJECT, variant.VarType); + Assert.Equal(nativeStorage, variant.GetRawDataRef()); + } + + [Fact] + public void VersionedStream_Raw() + { + IntPtr nativeStream = 42; + // Using a fake value so we aren't disposing the ComVariant instance. + ComVariant variant = ComVariant.CreateRaw((VarEnum)73, nativeStream); + Assert.Equal((VarEnum)73, variant.VarType); + Assert.Equal(nativeStream, variant.GetRawDataRef()); + } + + [Fact] + public void BlobObject_Raw() + { + Blob blob = new Blob { Length = 3, Data = Marshal.AllocCoTaskMem(10) }; + using ComVariant variant = ComVariant.CreateRaw(VarEnum.VT_BLOB_OBJECT, blob); + Assert.Equal(VarEnum.VT_BLOB_OBJECT, variant.VarType); + Assert.Throws("T", () => variant.As()); + Assert.Equal(blob, variant.GetRawDataRef()); + } + + [StructLayout(LayoutKind.Sequential)] + private unsafe struct ClipboardData + { + public uint _size; + public int _format; + public IntPtr _data; + } + + [Fact] + public unsafe void ClipData_Raw() + { + // Construct a valid clipboard data structure + // so we can validate the Clear/Dispose logic. + IntPtr clipboardData = Marshal.AllocCoTaskMem(sizeof(ClipboardData)); + ((ClipboardData*)clipboardData)->_data = Marshal.AllocCoTaskMem(10); + ((ClipboardData*)clipboardData)->_size = 10; + ((ClipboardData*)clipboardData)->_format = 1; + + using ComVariant variant = ComVariant.CreateRaw(VarEnum.VT_CF, clipboardData); + Assert.Equal(VarEnum.VT_CF, variant.VarType); + Assert.Equal(clipboardData, variant.GetRawDataRef()); + } + + [Fact] + public unsafe void Clsid_Raw() + { + // VT_CLSID is represented as a pointer to a GUID, not a GUID itself. + IntPtr pClsid = Marshal.AllocCoTaskMem(sizeof(Guid)); + *(Guid*)pClsid = Guid.NewGuid(); + using ComVariant variant = ComVariant.CreateRaw(VarEnum.VT_CLSID, pClsid); + Assert.Equal(VarEnum.VT_CLSID, variant.VarType); + Assert.Equal(pClsid, variant.GetRawDataRef()); + } + + [StructLayout(LayoutKind.Sequential)] + private struct Vector + { + public int Length; + public IntPtr Data; + } + + [Fact] + public void Vector_Raw() + { + Vector vector = new Vector { Length = 3, Data = Marshal.AllocCoTaskMem(sizeof(int) * 3) }; + using ComVariant variant = ComVariant.CreateRaw(VarEnum.VT_VECTOR | VarEnum.VT_I4, vector); + Assert.Equal(VarEnum.VT_VECTOR | VarEnum.VT_I4, variant.VarType); + Assert.Throws("T", () => variant.As()); + Assert.Equal(vector, variant.GetRawDataRef()); + } + + [Fact] + [PlatformSpecific(TestPlatforms.Windows)] + public void Array_Raw() + { + IntPtr safeArray = 42; + // Using a fake value so we aren't disposing the ComVariant instance. + ComVariant variant = ComVariant.CreateRaw(VarEnum.VT_ARRAY | VarEnum.VT_I4, safeArray); + Assert.Equal(VarEnum.VT_ARRAY | VarEnum.VT_I4, variant.VarType); + Assert.Equal(safeArray, variant.GetRawDataRef()); + } + + [Fact] + [PlatformSpecific(~TestPlatforms.Windows)] + public void Array_Raw_NonWindows() + { + Assert.Throws(() => ComVariant.CreateRaw(VarEnum.VT_ARRAY | VarEnum.VT_I4, 0)); + } + + [Fact] + public void ByRef_Raw() + { + // byref VARIANTs don't own the memory they point to. + IntPtr byref = Marshal.AllocCoTaskMem(4); + using ComVariant variant = ComVariant.CreateRaw(VarEnum.VT_BYREF | VarEnum.VT_I4, byref); + Assert.Equal(VarEnum.VT_BYREF | VarEnum.VT_I4, variant.VarType); + Assert.Equal(byref, variant.GetRawDataRef()); + Marshal.FreeCoTaskMem(byref); + } + + [InlineArray(5)] + private struct InvalidSize + { + private byte _b; + } + + // Test a variety of types to validate the size check. + [InlineData(VarEnum.VT_I1)] + [InlineData(VarEnum.VT_UI1)] + [InlineData(VarEnum.VT_I2)] + [InlineData(VarEnum.VT_UI2)] + [InlineData(VarEnum.VT_I4)] + [InlineData(VarEnum.VT_UI4)] + [InlineData(VarEnum.VT_I8)] + [InlineData(VarEnum.VT_UI8)] + [InlineData(VarEnum.VT_R4)] + [InlineData(VarEnum.VT_R8)] + [InlineData(VarEnum.VT_BOOL)] + [InlineData(VarEnum.VT_BLOB)] + [InlineData(VarEnum.VT_BYREF | VarEnum.VT_I4)] + [InlineData(VarEnum.VT_UNKNOWN)] + [Theory] + public void Raw_WrongSize(VarEnum vt) + { + // A 5-byte struct is never a valid size for a variant type. + Assert.Throws(() => ComVariant.CreateRaw(vt, new InvalidSize())); + } + + [InlineData(VarEnum.VT_INT)] + [InlineData(VarEnum.VT_UINT)] + [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.Is64BitProcess))] + public void Raw_Int_WrongSize(VarEnum vt) + { + Assert.Throws(() => ComVariant.CreateRaw(vt, (nint)42)); + } + } +} diff --git a/src/libraries/System.Runtime.InteropServices/tests/TestAssets/NativeExports/Variant.cs b/src/libraries/System.Runtime.InteropServices/tests/TestAssets/NativeExports/Variant.cs new file mode 100644 index 00000000000000..7ad1218f6f3ecc --- /dev/null +++ b/src/libraries/System.Runtime.InteropServices/tests/TestAssets/NativeExports/Variant.cs @@ -0,0 +1,23 @@ +// 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.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Runtime.InteropServices.Marshalling; +using System.Runtime.Versioning; +using System.Text; +using System.Threading.Tasks; + +namespace NativeExports +{ + public static unsafe class Variant + { + [UnmanagedCallersOnly(EntryPoint = "get_variant_bstr_length")] + public static int GetVTBStrLength([DNNE.C99Type("void*")] ComVariant* variant) + { + return variant->As().Length; + } + } +} From 497ae886f4428449b2ef7b8f8e1cbb3363051a21 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Fri, 27 Oct 2023 15:05:12 -0400 Subject: [PATCH 12/47] [wasm] Error out for AOT with no il trimming (#94064) Without trimming AOT builds would be very slow, and unusable. --- .../Wasm.Build.Tests/Blazor/NativeRefTests.cs | 27 +++---------------- .../wasm/Wasm.Build.Tests/NativeBuildTests.cs | 13 +++------ src/mono/wasm/build/WasmApp.Native.targets | 2 ++ 3 files changed, 10 insertions(+), 32 deletions(-) diff --git a/src/mono/wasm/Wasm.Build.Tests/Blazor/NativeRefTests.cs b/src/mono/wasm/Wasm.Build.Tests/Blazor/NativeRefTests.cs index 645aab3ac0eb85..fac71883e3f2ae 100644 --- a/src/mono/wasm/Wasm.Build.Tests/Blazor/NativeRefTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/Blazor/NativeRefTests.cs @@ -62,35 +62,16 @@ public void WithNativeReference_AOTOnCommandLine(string config) } [Theory] - [InlineData("Debug")] [InlineData("Release")] - public void BlazorWasm_CanRunMonoAOTCross_WithNoTrimming(string config) + public void BlazorWasm_CannotAOT_WithNoTrimming(string config) { string id = $"blazorwasm_{config}_aot_{GetRandomId()}"; CreateBlazorWasmTemplateProject(id); - - // We don't want to emcc compile, and link ~180 assemblies! - // So, stop once `mono-aot-cross` part of the build is done - string target = @" - - - "; AddItemsPropertiesToProject(Path.Combine(_projectDir!, $"{id}.csproj"), extraItems: null, - extraProperties: null, - atTheEnd: target); - - string publishLogPath = Path.Combine(s_buildEnv.LogRootPath, id, $"{id}.binlog"); - CommandResult res = new DotNetCommand(s_buildEnv, _testOutput) - .WithWorkingDirectory(_projectDir!) - .WithEnvironmentVariable("NUGET_PACKAGES", _nugetPackagesDir) - .ExecuteWithCapturedOutput("publish", - $"-bl:{publishLogPath}", - "-p:RunAOTCompilation=true", - "-p:PublishTrimmed=false", - $"-p:Configuration={config}"); + extraProperties: "falsetrue"); - Assert.True(res.ExitCode != 0, "Expected publish to fail"); - Assert.Contains("Stopping after AOT", res.Output); + (CommandResult res, _) = BlazorPublish(new BlazorBuildOptions(id, config, ExpectSuccess: false)); + Assert.Contains("AOT is not supported without IL trimming", res.Output); } } diff --git a/src/mono/wasm/Wasm.Build.Tests/NativeBuildTests.cs b/src/mono/wasm/Wasm.Build.Tests/NativeBuildTests.cs index 0ea7aaf7bfa8f2..ef3ed921a70037 100644 --- a/src/mono/wasm/Wasm.Build.Tests/NativeBuildTests.cs +++ b/src/mono/wasm/Wasm.Build.Tests/NativeBuildTests.cs @@ -41,17 +41,12 @@ public void SimpleNativeBuild(BuildArgs buildArgs, RunHost host, string id) [Theory] [BuildAndRun(aot: true, host: RunHost.None)] - public void MonoAOTCross_WorksWithNoTrimming(BuildArgs buildArgs, string id) + public void AOTNotSupportedWithNoTrimming(BuildArgs buildArgs, string id) { - // stop once `mono-aot-cross` part of the build is done - string target = @" - - "; - string projectName = $"mono_aot_cross_{buildArgs.Config}_{buildArgs.AOT}"; - buildArgs = buildArgs with { ProjectName = projectName, ExtraBuildArgs = "-p:PublishTrimmed=false -v:n" }; - buildArgs = ExpandBuildArgs(buildArgs, extraProperties: "true", insertAtEnd: target); + buildArgs = buildArgs with { ProjectName = projectName, ExtraBuildArgs = "-p:PublishTrimmed=false" }; + buildArgs = ExpandBuildArgs(buildArgs); (_, string output) = BuildProject( buildArgs, @@ -61,7 +56,7 @@ public void MonoAOTCross_WorksWithNoTrimming(BuildArgs buildArgs, string id) DotnetWasmFromRuntimePack: false, ExpectSuccess: false)); - Assert.Contains("Stopping after AOT", output); + Assert.Contains("AOT is not supported without IL trimming", output); } [Theory] diff --git a/src/mono/wasm/build/WasmApp.Native.targets b/src/mono/wasm/build/WasmApp.Native.targets index d9595b16c2eb42..43428034a93c1e 100644 --- a/src/mono/wasm/build/WasmApp.Native.targets +++ b/src/mono/wasm/build/WasmApp.Native.targets @@ -619,6 +619,8 @@ <_MonoAotCrossCompilerPath>@(MonoAotCrossCompiler->WithMetadataValue('RuntimeIdentifier','browser-wasm')) + From 77bd2ae57c67d9a7377305d4d1e169277c01daac Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 27 Oct 2023 15:23:53 -0400 Subject: [PATCH 13/47] [main] Update dependencies from dotnet/installer (#94084) Microsoft.Dotnet.Sdk.Internal From Version 9.0.100-alpha.1.23525.7 -> To Version 9.0.100-alpha.1.23527.1 Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 9345c7dfa37b8d..5093503afa632c 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -398,9 +398,9 @@ https://github.com/NuGet/NuGet.Client 8fef55f5a55a3b4f2c96cd1a9b5ddc51d4b927f8 - + https://github.com/dotnet/installer - 62a1b533e387db43c0e9b1b01754e040a143f96a + fb7c9717cfd661b120e900a073c60a8fc9e898da diff --git a/eng/Versions.props b/eng/Versions.props index 203a1b0e5f9857..c88a1ee96fa135 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -248,7 +248,7 @@ 3.1.7 1.0.406601 - 9.0.100-alpha.1.23525.7 + 9.0.100-alpha.1.23527.1 $(MicrosoftDotnetSdkInternalVersion) From 1cf878e4de3fc96a0c85f4c753781685c98e8355 Mon Sep 17 00:00:00 2001 From: Radek Doulik Date: Fri, 27 Oct 2023 22:43:14 +0200 Subject: [PATCH 14/47] [wasm] make it easy to exclude browser-bench measurements (#94099) Add options to the simple server, including the URL suffix Add exclusions URL option to the browser-bench This way we can exclude selected measurements. This can be used for MT measurements, where we are hitting few crashes. --- src/mono/sample/wasm/Directory.Build.targets | 2 +- src/mono/sample/wasm/browser-bench/Program.cs | 20 +++++++++ src/mono/sample/wasm/browser-bench/main.js | 6 +++ .../wasm/simple-server/HttpServer.csproj | 6 ++- src/mono/sample/wasm/simple-server/Program.cs | 44 +++++++++++++++++-- 5 files changed, 72 insertions(+), 6 deletions(-) diff --git a/src/mono/sample/wasm/Directory.Build.targets b/src/mono/sample/wasm/Directory.Build.targets index e320d5fd29dbbc..13379588de89a9 100644 --- a/src/mono/sample/wasm/Directory.Build.targets +++ b/src/mono/sample/wasm/Directory.Build.targets @@ -68,7 +68,7 @@ - + exclusionPatterns = new(); List tasks = new() { @@ -39,6 +40,15 @@ public static Task RunBenchmark() return Instance.RunTasks(); } + [JSExport] + public static void SetExclusions(string exclusions) + { + var patterns = exclusions.Split(','); + foreach(var def in patterns) { + exclusionPatterns.Add(new Regex(def)); + } + } + // the constructors of the task we care about are already used when createing tasks field [UnconditionalSuppressMessage("Trim analysis error", "IL2057")] [UnconditionalSuppressMessage("Trim analysis error", "IL2072")] @@ -128,6 +138,16 @@ async Task NextMeasurement() if (!await Task.Measurements[measurementIdx].IsEnabled()) continue; + bool excluded = false; + foreach(var exc in exclusionPatterns) + if (exc.IsMatch($"{Task.Name}:{Task.Measurements[measurementIdx].Name}")) { + excluded = true; + break; + } + + if (excluded) + continue; + if (Task.pattern == null || Task.pattern.IsMatch(Task.Measurements[measurementIdx].Name)) return true; } diff --git a/src/mono/sample/wasm/browser-bench/main.js b/src/mono/sample/wasm/browser-bench/main.js index 846c9d693ef9a7..e807004cdc0f31 100644 --- a/src/mono/sample/wasm/browser-bench/main.js +++ b/src/mono/sample/wasm/browser-bench/main.js @@ -7,6 +7,7 @@ import { dotnet, exit } from './_framework/dotnet.js' let runBenchmark; let setTasks; +let setExclusions; let getFullJsonResults; let legacyExportTargetInt; let jsExportTargetInt; @@ -68,6 +69,7 @@ class MainApp { _jiterpreter_dump_stats = INTERNAL.jiterpreter_dump_stats.bind(INTERNAL); runBenchmark = exports.Sample.Test.RunBenchmark; setTasks = exports.Sample.Test.SetTasks; + setExclusions = exports.Sample.Test.SetExclusions; getFullJsonResults = exports.Sample.Test.GetFullJsonResults; legacyExportTargetInt = BINDING.bind_static_method("[Wasm.Browser.Bench.Sample]Sample.ImportsExportsHelper:LegacyExportTargetInt"); @@ -97,6 +99,10 @@ class MainApp { if (tasks != '') { setTasks(tasks.join(',')); } + let exclusions = url.searchParams.getAll('exclusions'); + if (exclusions != '') { + setExclusions(exclusions.join(',')); + } const r = await fetch("/bootstrap.flag", { method: 'POST', diff --git a/src/mono/sample/wasm/simple-server/HttpServer.csproj b/src/mono/sample/wasm/simple-server/HttpServer.csproj index 330a025391578f..a315a0521a1024 100644 --- a/src/mono/sample/wasm/simple-server/HttpServer.csproj +++ b/src/mono/sample/wasm/simple-server/HttpServer.csproj @@ -2,10 +2,12 @@ Exe - net6.0 + net8.0 major enable enable - + + + diff --git a/src/mono/sample/wasm/simple-server/Program.cs b/src/mono/sample/wasm/simple-server/Program.cs index 22de3d8ddabe04..f750a18f908491 100644 --- a/src/mono/sample/wasm/simple-server/Program.cs +++ b/src/mono/sample/wasm/simple-server/Program.cs @@ -7,6 +7,7 @@ using System.Runtime.InteropServices; using System; using System.Security.Cryptography; +using Mono.Options; namespace HttpServer { @@ -21,11 +22,46 @@ public sealed record FileContent(byte[] buffer, string hash); public sealed class Program { - private bool Verbose = false; + private static bool Verbose = false; + private static string URLSuffix = ""; private ConcurrentDictionary Sessions = new ConcurrentDictionary(); private Dictionary cache = new(StringComparer.OrdinalIgnoreCase); - public static int Main() + static List ProcessArguments(string[] args) + { + var help = false; + var options = new OptionSet { + $"Usage: HttpServer OPTIONS*", + "", + "Simple http server for browser-bench sample", + "", + "Copyright 2022, 2023 Microsoft Corporation", + "", + "Options:", + { "h|help|?", + "Show this message and exit", + v => help = v != null }, + { "s=", + "URL {suffix}", + v => URLSuffix = v }, + { "v|verbose", + "Output more information during the run of the server.", + v => Verbose = true }, + }; + + var remaining = options.Parse(args); + + if (help) + { + options.WriteOptionDescriptions(Console.Out); + + Environment.Exit(0); + } + + return remaining; + } + + public static int Main(string[] args) { if (!HttpListener.IsSupported) { @@ -33,6 +69,8 @@ public static int Main() return -1; } + ProcessArguments(args); + // retry upto 9 times to find free port for (int i = 0; i < 10; i++) { @@ -60,7 +98,7 @@ private bool StartServer() } Console.WriteLine($"Listening on {url}"); - OpenUrl(url); + OpenUrl(url + URLSuffix); while (true) HandleRequest(listener); From af6efcbf14ad2af0479af7a85491f724d6629994 Mon Sep 17 00:00:00 2001 From: "Mukund Raghav Sharma (Moko)" <68247673+mrsharm@users.noreply.github.com> Date: Fri, 27 Oct 2023 14:08:45 -0700 Subject: [PATCH 15/47] Added the LOHThreshold public key to the GC Config. (#94068) * Added the LOHThreshold public key * Cleaned up formatting --- src/coreclr/gc/gcconfig.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coreclr/gc/gcconfig.h b/src/coreclr/gc/gcconfig.h index 7dd48eb02513c6..f4b88d26db1ecf 100644 --- a/src/coreclr/gc/gcconfig.h +++ b/src/coreclr/gc/gcconfig.h @@ -79,7 +79,7 @@ class GCConfigStringHolder BOOL_CONFIG (GCLargePages, "GCLargePages", "System.GC.LargePages", false, "Enables using Large Pages in the GC") \ INT_CONFIG (HeapVerifyLevel, "HeapVerify", NULL, HEAPVERIFY_NONE, "When set verifies the integrity of the managed heap on entry and exit of each GC") \ INT_CONFIG (LOHCompactionMode, "GCLOHCompact", NULL, 0, "Specifies the LOH compaction mode") \ - INT_CONFIG (LOHThreshold, "GCLOHThreshold", NULL, LARGE_OBJECT_SIZE, "Specifies the size that will make objects go on LOH") \ + INT_CONFIG (LOHThreshold, "GCLOHThreshold", "System.GC.LOHThreshold", LARGE_OBJECT_SIZE, "Specifies the size that will make objects go on LOH") \ INT_CONFIG (BGCSpinCount, "BGCSpinCount", NULL, 140, "Specifies the bgc spin count") \ INT_CONFIG (BGCSpin, "BGCSpin", NULL, 2, "Specifies the bgc spin time") \ INT_CONFIG (HeapCount, "GCHeapCount", "System.GC.HeapCount", 0, "Specifies the number of server GC heaps") \ @@ -138,7 +138,7 @@ class GCConfigStringHolder INT_CONFIG (GCConserveMem, "GCConserveMemory", "System.GC.ConserveMemory", 0, "Specifies how hard GC should try to conserve memory - values 0-9") \ INT_CONFIG (GCWriteBarrier, "GCWriteBarrier", NULL, 0, "Specifies whether GC should use more precise but slower write barrier") \ STRING_CONFIG(GCName, "GCName", "System.GC.Name", "Specifies the path of the standalone GC implementation.") \ - INT_CONFIG (GCSpinCountUnit, "GCSpinCountUnit", 0, 0, "Specifies the spin count unit used by the GC.") \ + INT_CONFIG (GCSpinCountUnit, "GCSpinCountUnit", NULL, 0, "Specifies the spin count unit used by the GC.") \ INT_CONFIG (GCDynamicAdaptationMode, "GCDynamicAdaptationMode", "System.GC.DynamicAdaptationMode", 0, "Enable the GC to dynamically adapt to application sizes.") // This class is responsible for retreiving configuration information // for how the GC should operate. From 92aeed0dd86e24b0296ab90a145b424200967e07 Mon Sep 17 00:00:00 2001 From: Ivan Diaz Sanchez Date: Fri, 27 Oct 2023 14:26:34 -0700 Subject: [PATCH 16/47] Add Separate Mode to XUnitLogChecker Where Only Dumps are Analyzed (#94094) * Overhauled the XUnitLogChecker to be able to work without a log for the libraries tests. * Adjusted the Helix script in helixpublishwitharcade.proj to use the new flagged command-line arguments, when calling the XUnitLogChecker. --- .../Common/XUnitLogChecker/XUnitLogChecker.cs | 215 +++++++++++++----- .../XUnitLogChecker/XUnitLogChecker.csproj | 1 + src/tests/Common/helixpublishwitharcade.proj | 8 +- 3 files changed, 163 insertions(+), 61 deletions(-) diff --git a/src/tests/Common/XUnitLogChecker/XUnitLogChecker.cs b/src/tests/Common/XUnitLogChecker/XUnitLogChecker.cs index 82b7d7db602399..be47532493dc7e 100644 --- a/src/tests/Common/XUnitLogChecker/XUnitLogChecker.cs +++ b/src/tests/Common/XUnitLogChecker/XUnitLogChecker.cs @@ -30,41 +30,116 @@ public TagResult(string matchValue, TagCategory matchCategory) public TagCategory Category { get; init; } } + private struct LogCheckerConfigParameters + { + public LogCheckerConfigParameters() + { + ResultsPath = string.Empty; + TestWrapperName = string.Empty; + DumpsPath = string.Empty; + } + + public string ResultsPath { get; set; } + public string TestWrapperName { get; set; } + public string DumpsPath { get; set; } + + public bool HasResultsPath() => !string.IsNullOrEmpty(ResultsPath); + public bool HasTestWrapper() => !string.IsNullOrEmpty(TestWrapperName); + public bool HasDumpsPath() => !string.IsNullOrEmpty(DumpsPath); + } + private enum TagCategory { OPENING, CLOSING } private const int SUCCESS = 0; private const int MISSING_ARGS = -1; private const int FAILURE = -2; + private static LogCheckerConfigParameters s_configuration; + static int Main(string[] args) { - if (args.Length < 2) + s_configuration = new LogCheckerConfigParameters(); + + // We start with a 'FAILURE' exit code because if something goes wrong + // later on and the log checker fails, we want to know it. + int exitCode = FAILURE; + + ParseCommandLineArgs(args); + + // In CoreCLR tests, we record each test's results in an XML file, which + // is stored in the same directory as said test's script. So, the + // XUnitLogChecker looks there for said results log to do its job of + // fixing it if necessary. Afterwards, it checks if there are any dumps + // to read and display. This is the log checker's full run. + // + // In the Libraries tests however, the test logs are stored and created + // in a different way, currently outside the scope of the XUnitLogChecker, + // and therefore only the dump checking functionality is required in + // those cases, so we skip directly to that step. + + if (s_configuration.HasResultsPath() && s_configuration.HasTestWrapper()) { - WriteLineTimestamp("The path to the log file and" - + " the name of the wrapper are required for an" - + " accurate check and fixing."); - return MISSING_ARGS; + WriteLineTimestamp("The full run will be done."); + exitCode = DoFullRun(); } + else + { + WriteLineTimestamp("Only dumps checking will be done."); + DoDumpsCheck(string.Empty); + exitCode = SUCCESS; + } + + return exitCode; + } - // Creating variables for code clarity and ease of understanding. + private static void ParseCommandLineArgs(string[] args) + { + // The command-line arguments will always come in pairs of '--flag value'. + // Hence, we process two elements of the args array at a time. - string resultsDir = args[0]; - string wrapperName = args[1]; + for (int i = 0; i < args.Length; i+=2) + { + string nextOption = args[i]; + string nextValue = (i+1) < args.Length ? args[i+1] : string.Empty; + + switch (nextOption) + { + case "--results-path": + s_configuration.ResultsPath = nextValue; + break; + + case "--test-wrapper": + s_configuration.TestWrapperName = nextValue; + break; + + case "--dumps-path": + s_configuration.DumpsPath = nextValue; + break; + + default: + throw new ArgumentException($"Unrecognized option {nextOption}."); + break; + } + } + } - string tempLogName = $"{wrapperName}.tempLog.xml"; - string finalLogName = $"{wrapperName}.testResults.xml"; - string statsCsvName = $"{wrapperName}.testStats.csv"; + private static int DoFullRun() + { + string tempLogName = $"{s_configuration.TestWrapperName}.tempLog.xml"; + string finalLogName = $"{s_configuration.TestWrapperName}.testResults.xml"; + string statsCsvName = $"{s_configuration.TestWrapperName}.testStats.csv"; - string tempLogPath = Path.Combine(resultsDir, tempLogName); - string finalLogPath = Path.Combine(resultsDir, finalLogName); - string statsCsvPath = Path.Combine(resultsDir, statsCsvName); + string tempLogPath = Path.Combine(s_configuration.ResultsPath, tempLogName); + string finalLogPath = Path.Combine(s_configuration.ResultsPath, finalLogName); + string statsCsvPath = Path.Combine(s_configuration.ResultsPath, statsCsvName); // If the final results log file is present, then we can assume everything // went fine, and it's ready to go without any further processing. if (File.Exists(finalLogPath)) { - WriteLineTimestamp($"Item '{wrapperName}' did complete successfully!"); + WriteLineTimestamp($"Item '{s_configuration.TestWrapperName}' did" + + " complete successfully!"); return SUCCESS; } @@ -81,6 +156,7 @@ static int Main(string[] args) { WriteLineTimestamp("No logs were found. This work" + " item was skipped."); + WriteLineTimestamp($"If this is a mistake, then" + " something went very wrong. The expected temp" + $" log name would be: '{tempLogName}'"); @@ -126,8 +202,7 @@ static int Main(string[] args) .Select(x => Int32.Parse(x)) .ToArray(); - // Here goes the main core of the XUnit Log Checker :) - WriteLineTimestamp($"Item '{wrapperName}' did not" + WriteLineTimestamp($"Item '{s_configuration.TestWrapperName}' did not" + " finish running. Checking and fixing the log..."); bool success = FixTheXml(tempLogPath); @@ -139,25 +214,8 @@ static int Main(string[] args) PrintWorkItemSummary(numExpectedTests, workItemEndStatus); - // The third command-line argument is an optional path where dumps would - // be located. If passed, then search that path accordingly. Otherwise, - // just skip and finish running. - - if (args.Length > 2) - { - string dumpsPath = args[2]; - - if (Directory.Exists(dumpsPath)) - { - PrintStackTracesFromDumps(dumpsPath, tempLogPath); - } - else - { - WriteLineTimestamp("The provided dumps path" - + $" '{dumpsPath}' was not able to be read or" - + " found. Skipping stack traces search..."); - } - } + if (s_configuration.HasDumpsPath()) + DoDumpsCheck(tempLogPath); // Rename the temp log to the final log, so that Helix can use it without // knowing what transpired here. @@ -166,6 +224,27 @@ static int Main(string[] args) return SUCCESS; } + private static void DoDumpsCheck(string testLogPath) + { + // If we received a dumps path, then search it accordingly. Otherwise, + // just skip this function and return. + // + // NOTE: In the case of the libraries test, 'testLogPath' will always + // be empty. + + if (s_configuration.HasDumpsPath() + && Directory.Exists(s_configuration.DumpsPath)) + { + PrintStackTracesFromDumps(testLogPath); + } + else + { + WriteLineTimestamp($"The provided dumps path '{s_configuration.DumpsPath}'" + + " was not found or was not able to be read. Skipping" + + " traces search..."); + } + } + static void WriteLineTimestamp(string message) => Console.WriteLine($"[XUnitLogChecker]: {System.DateTime.Now:HH:mm:ss.ff}: {message}"); @@ -174,6 +253,7 @@ static IEnumerable TryReadFile(string filePath) // Declaring the enumerable to contain the log lines first because we // might not be able to read on the first try due to locked resources // on Windows. We will retry for up to one minute when this case happens. + IEnumerable? fileContents = null; Stopwatch fileReadStopwatch = Stopwatch.StartNew(); @@ -379,27 +459,46 @@ static TagResult[] GetOrderedTagMatches(Match[] openingTags, Match[] closingTags return result; } - static void PrintStackTracesFromDumps(string dumpsPath, string tempLogPath) + static void PrintStackTracesFromDumps(string testLogPath) { WriteLineTimestamp("Checking for dumps..."); + IEnumerable? dumpsFound = null; - // Read our newly fixed log to retrieve the time and date when the - // test was run. This is to exclude potentially existing older dumps - // that are not related to this test run. - XElement fixedLogTree = XElement.Load(tempLogPath); - - // We know from the XUnitWrapperGenerator that the top element - // is the 'assembly' tag we're looking for. - var testRunDateTime = DateTime.ParseExact - ( - fixedLogTree.Attribute("run-date-time").Value, - "yyyy-MM-dd HH:mm:ss", - System.Globalization.CultureInfo.InvariantCulture - ); + // In CoreCLR, the test results log has the test's run time recorded. + // We extract it and use it to only retrieve the dumps that were created + // after that point in time. Any other dump present there is certainly + // unrelated to the currently being analyzed test. + // + // In Libraries, since we can't get said timestamp, we just retrieve + // all of the dumps. - IEnumerable dumpsFound = - Directory.GetFiles(dumpsPath, "*coredump*.dmp") - .Where(dmp => DateTime.Compare(File.GetCreationTime(dmp), testRunDateTime) >= 0); + if (!string.IsNullOrEmpty(testLogPath)) + { + // Read our newly fixed log to retrieve the time and date when the + // test was run. This is to exclude potentially existing older dumps + // that are not related to this test run. + XElement fixedLogTree = XElement.Load(testLogPath); + + // We know from the XUnitWrapperGenerator that the top element + // is the 'assembly' tag we're looking for. + var testRunDateTime = DateTime.ParseExact + ( + fixedLogTree.Attribute("run-date-time").Value, + "yyyy-MM-dd HH:mm:ss", + System.Globalization.CultureInfo.InvariantCulture + ); + + dumpsFound = Directory + .GetFiles(s_configuration.DumpsPath, "*coredump*.dmp") + .Where(dmp => + DateTime.Compare(File.GetCreationTime(dmp), + testRunDateTime) >= 0); + } + else + { + dumpsFound = Directory.GetFiles(s_configuration.DumpsPath, + "*coredump*.dmp"); + } if (dumpsFound.Count() == 0) { @@ -411,8 +510,7 @@ static void PrintStackTracesFromDumps(string dumpsPath, string tempLogPath) { if (OperatingSystem.IsWindows()) { - WriteLineTimestamp("Reading crash dump" - + $" '{dumpPath}'..."); + WriteLineTimestamp("Reading crash dump '{dumpPath}'..."); WriteLineTimestamp("Stack Trace Found:\n"); CoreclrTestWrapperLib.TryPrintStackTraceFromDmp(dumpPath, @@ -424,13 +522,12 @@ static void PrintStackTracesFromDumps(string dumpsPath, string tempLogPath) if (!File.Exists(crashReportPath)) { - WriteLineTimestamp("There was no crash" - + $" report for dump '{dumpPath}'. Skipping..."); + WriteLineTimestamp("There was no crash report for the" + + $" dump '{dumpPath}'. Skipping..."); continue; } - WriteLineTimestamp("Reading crash report" - + $" '{crashReportPath}'..."); + WriteLineTimestamp("Reading crash report '{crashReportPath}'..."); WriteLineTimestamp("Stack Trace Found:\n"); CoreclrTestWrapperLib.TryPrintStackTraceFromCrashReport(crashReportPath, diff --git a/src/tests/Common/XUnitLogChecker/XUnitLogChecker.csproj b/src/tests/Common/XUnitLogChecker/XUnitLogChecker.csproj index d7a68af20938f6..57ccdea11e28bf 100644 --- a/src/tests/Common/XUnitLogChecker/XUnitLogChecker.csproj +++ b/src/tests/Common/XUnitLogChecker/XUnitLogChecker.csproj @@ -15,4 +15,5 @@ + diff --git a/src/tests/Common/helixpublishwitharcade.proj b/src/tests/Common/helixpublishwitharcade.proj index 9a61470acd450f..8f8ae6c2951080 100644 --- a/src/tests/Common/helixpublishwitharcade.proj +++ b/src/tests/Common/helixpublishwitharcade.proj @@ -215,7 +215,7 @@ 1) they are in LegacyPayloadsRootDirectory or 2) they are grouped by XUnitWrapperGrouping. --> <_XUnitWrapperDll Include="$(TestBinDir)**\*.XUnitWrapper.dll" Exclude="$(LegacyPayloadsRootDirectory)**\*.XUnitWrapper.dll;@(XUnitWrapperGrouping->Metadata('FullPath'))"> - + @@ -412,9 +412,13 @@ %25HELIX_CORRELATION_PAYLOAD%25/ $(XUnitLogCheckerHelixPath)XUnitLogChecker/ - $(_MergedWrapperRunScriptDirectoryRelative) $(_MergedWrapperName) + --results-path $(_MergedWrapperRunScriptDirectoryRelative) + $(XUnitLogCheckerArgs) --test-wrapper $(_MergedWrapperName) + $(XUnitLogCheckerArgs) --dumps-path + $(XUnitLogCheckerArgs) %24HELIX_DUMP_FOLDER $(XUnitLogCheckerArgs) %25HELIX_DUMP_FOLDER%25 + dotnet $(XUnitLogCheckerHelixPath)XUnitLogChecker.dll $(XUnitLogCheckerArgs) From 5f0fe49eb2920d3a9ed59e7459c1b2bea503fa90 Mon Sep 17 00:00:00 2001 From: t-mustafin <66252296+t-mustafin@users.noreply.github.com> Date: Sat, 28 Oct 2023 00:54:08 +0300 Subject: [PATCH 17/47] [RISC-V] Disable FastTailCall in case of split arg (#93655) --- src/coreclr/jit/compiler.h | 2 +- src/coreclr/jit/lclvars.cpp | 7 +++++-- src/coreclr/jit/morph.cpp | 13 ++++++++----- src/coreclr/jit/registerargconvention.h | 10 ++++++++-- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/coreclr/jit/compiler.h b/src/coreclr/jit/compiler.h index 1d387fbcfbe689..e7c4cd157a342d 100644 --- a/src/coreclr/jit/compiler.h +++ b/src/coreclr/jit/compiler.h @@ -10352,7 +10352,7 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX unsigned compArgSize; // total size of arguments in bytes (including register args (lvIsRegArg)) -#ifdef TARGET_ARM +#if defined(TARGET_ARM) || defined(TARGET_RISCV64) bool compHasSplitParam; #endif diff --git a/src/coreclr/jit/lclvars.cpp b/src/coreclr/jit/lclvars.cpp index adf993d37b70c5..8f65aedab96dc5 100644 --- a/src/coreclr/jit/lclvars.cpp +++ b/src/coreclr/jit/lclvars.cpp @@ -259,9 +259,9 @@ void Compiler::lvaInitTypeRef() LclVarDsc* varDsc = varDscInfo.varDsc; CORINFO_ARG_LIST_HANDLE localsSig = info.compMethodInfo->locals.args; -#ifdef TARGET_ARM +#if defined(TARGET_ARM) || defined(TARGET_RISCV64) compHasSplitParam = varDscInfo.hasSplitParam; -#endif +#endif // TARGET_ARM || TARGET_RISCV64 for (unsigned i = 0; i < info.compMethodInfo->locals.numArgs; i++, varNum++, varDsc++, localsSig = info.compCompHnd->getArgNext(localsSig)) @@ -1043,6 +1043,9 @@ void Compiler::lvaInitUserArgs(InitVarDscInfo* varDscInfo, unsigned skipArgs, un varDscInfo->setAllRegArgUsed(argRegTypeInStruct1); #if FEATURE_FASTTAILCALL varDscInfo->stackArgSize += TARGET_POINTER_SIZE; +#endif +#ifdef TARGET_RISCV64 + varDscInfo->hasSplitParam = true; #endif } } diff --git a/src/coreclr/jit/morph.cpp b/src/coreclr/jit/morph.cpp index 22abfe722edfdb..e0971ae0a3d956 100644 --- a/src/coreclr/jit/morph.cpp +++ b/src/coreclr/jit/morph.cpp @@ -5439,24 +5439,27 @@ bool Compiler::fgCanFastTailCall(GenTreeCall* callee, const char** failReason) { calleeArgStackSize = roundUp(calleeArgStackSize, arg.AbiInfo.ByteAlignment); calleeArgStackSize += arg.AbiInfo.GetStackByteSize(); -#ifdef TARGET_ARM + +#if defined(TARGET_ARM) || defined(TARGET_RISCV64) if (arg.AbiInfo.IsSplit()) { - reportFastTailCallDecision("Argument splitting in callee is not supported on ARM32"); + reportFastTailCallDecision("Argument splitting in callee is not supported on " TARGET_READABLE_NAME); return false; } -#endif // TARGET_ARM +#endif // TARGET_ARM || TARGET_RISCV64 } calleeArgStackSize = GetOutgoingArgByteSize(calleeArgStackSize); -#ifdef TARGET_ARM +#if defined(TARGET_ARM) || defined(TARGET_RISCV64) if (compHasSplitParam) { - reportFastTailCallDecision("Argument splitting in caller is not supported on ARM32"); + reportFastTailCallDecision("Argument splitting in caller is not supported on " TARGET_READABLE_NAME); return false; } +#endif // TARGET_ARM || TARGET_RISCV64 +#ifdef TARGET_ARM if (compIsProfilerHookNeeded()) { reportFastTailCallDecision("Profiler is not supported on ARM32"); diff --git a/src/coreclr/jit/registerargconvention.h b/src/coreclr/jit/registerargconvention.h index 0085e8ac80a2ea..858efdc9d22c6f 100644 --- a/src/coreclr/jit/registerargconvention.h +++ b/src/coreclr/jit/registerargconvention.h @@ -23,9 +23,12 @@ struct InitVarDscInfo // handles arguments. regMaskTP fltArgSkippedRegMask; bool anyFloatStackArgs; - bool hasSplitParam; #endif // TARGET_ARM +#if defined(TARGET_ARM) || defined(TARGET_RISCV64) + bool hasSplitParam; +#endif // TARGET_ARM || TARGET_RISCV64 + #if FEATURE_FASTTAILCALL // It is used to calculate argument stack size information in byte unsigned stackArgSize; @@ -46,9 +49,12 @@ struct InitVarDscInfo #ifdef TARGET_ARM fltArgSkippedRegMask = RBM_NONE; anyFloatStackArgs = false; - hasSplitParam = false; #endif // TARGET_ARM +#if defined(TARGET_ARM) || defined(TARGET_RISCV64) + hasSplitParam = false; +#endif // TARGET_ARM || TARGET_RISCV64 + #if FEATURE_FASTTAILCALL stackArgSize = 0; #endif // FEATURE_FASTTAILCALL From 3e708f2f7ab0d5649287ec340521beee9267db02 Mon Sep 17 00:00:00 2001 From: Tomas Weinfurt Date: Fri, 27 Oct 2023 14:58:43 -0700 Subject: [PATCH 18/47] remove extra assert from WinHttp (#93984) --- .../src/System/Net/Http/WinHttpRequestCallback.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpRequestCallback.cs b/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpRequestCallback.cs index 13c154516ce82c..7542c42fab9b49 100644 --- a/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpRequestCallback.cs +++ b/src/libraries/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpRequestCallback.cs @@ -231,13 +231,12 @@ private static void OnRequestRedirect(WinHttpRequestState state, Uri redirectUri private static void OnRequestSendingRequest(WinHttpRequestState state) { Debug.Assert(state != null, "OnRequestSendingRequest: state is null"); - Debug.Assert(state.RequestHandle != null, "OnRequestSendingRequest: state.RequestHandle is null"); Debug.Assert(state.RequestMessage != null, "OnRequestSendingRequest: state.RequestMessage is null"); Debug.Assert(state.RequestMessage.RequestUri != null, "OnRequestSendingRequest: state.RequestMessage.RequestUri is null"); - if (state.RequestMessage.RequestUri.Scheme != UriScheme.Https) + if (state.RequestMessage.RequestUri.Scheme != UriScheme.Https || state.RequestHandle == null) { - // Not SSL/TLS. + // Not SSL/TLS or request already gone return; } From 9461f4b5bd036005f37e78516c48b13396f76750 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Fri, 27 Oct 2023 18:11:41 -0400 Subject: [PATCH 19/47] [wasm] Update Wasm.Build.Tests to build with tfm=net9.0 (#93693) * workload-testing.targets: Make dotnet script paths available outside .. targets. This is useful when `dotnet-none` is already installed and thus the installation target does not run. * WorkloadManifest.targets: Disable workaround to use net9.0 artifacts .. with `tfm=net8.0` . But don't disable this for Blazor projects which are still using `tfm=net8.0`. * [wasm] Improve parsing runtime pack versions from environment variables * [wasm] Allow WBTOverridePack targets use to be set per test This allows having it enabled only for the blazor projects right now, which are still on tfm=net8.0 . * [wasm] WBT: Update tests to run with net9.0 * [wasm] WBT: Remove --experiment-wasm-simd for v8 * [wasm] WBT: differentiate version used for tasks from the tfm * [wasm] Fix wasmbrowser template so it correctly updates the tfm in csproj * [wasm] WBT: Add runtime pack version for 9 in wasi * [wasm] WBT: Share nuget config files between wasm and wasi * [wasm] WBT: Fix blazor tests * [wasm] WBT: Don't test 8.0 templates yet. this will need more changes * [wasm] Don't default ForceNet8Current=false yet Instead set this only for WBT. * perf: add dummy change to trigger runtime-wasm-perf --- eng/pipelines/runtime-wasm-perf.yml | 2 +- eng/testing/workloads-testing.targets | 42 +++++++++---------- .../wasi/Wasi.Build.Tests/BuildTestBase.cs | 15 +++++-- .../Wasi.Build.Tests/Wasi.Build.Tests.csproj | 5 ++- .../Blazor/BlazorWasmTestBase.cs | 2 +- .../wasm/Wasm.Build.Tests/BuildTestBase.cs | 26 ++++++++---- .../Common/BuildEnvironment.cs | 30 ++++++------- .../HostRunner/V8HostRunner.cs | 2 +- .../NonWasmTemplateBuildTests.cs | 4 +- .../PInvokeTableGeneratorTests.cs | 2 +- .../SatelliteAssembliesTests.cs | 2 +- .../Templates/WasmTemplateTests.cs | 17 +++++--- .../Wasm.Build.Tests/TestMainJsTestBase.cs | 11 +++-- .../Wasm.Build.Tests/Wasm.Build.Tests.csproj | 7 ++++ .../Wasm.Build.Tests/WasmTemplateTestBase.cs | 9 +++- .../Wasm.Build.Tests/data/nuget9.config} | 1 + .../templates/browser/browser.0.csproj | 2 +- 17 files changed, 112 insertions(+), 67 deletions(-) rename src/mono/{wasi/Wasi.Build.Tests/data/nuget8.config => wasm/Wasm.Build.Tests/data/nuget9.config} (83%) diff --git a/eng/pipelines/runtime-wasm-perf.yml b/eng/pipelines/runtime-wasm-perf.yml index 120cc2df85307d..478bbb81f8a4c8 100644 --- a/eng/pipelines/runtime-wasm-perf.yml +++ b/eng/pipelines/runtime-wasm-perf.yml @@ -39,7 +39,7 @@ extends: runProfile: 'v8' collectHelixLogsScript: ${{ variables._wasmCollectHelixLogsScript }} onlySanityCheck: true - #perfForkToUse: + #perfForkToUse: - dummy change #url: https://github.com/radical/performance #branch: fix-build #downloadSpecificBuild: diff --git a/eng/testing/workloads-testing.targets b/eng/testing/workloads-testing.targets index eb8a84468d9dc0..d205af6fbdfde7 100644 --- a/eng/testing/workloads-testing.targets +++ b/eng/testing/workloads-testing.targets @@ -28,6 +28,27 @@ + + <_DotNetInstallScriptName Condition="!$([MSBuild]::IsOSPlatform('windows'))">dotnet-install.sh + <_DotNetInstallScriptName Condition=" $([MSBuild]::IsOSPlatform('windows'))">dotnet-install.ps1 + + <_DotNetInstallScriptPath>$(ArtifactsObjDir)$(_DotNetInstallScriptName) + + + + <_DotNetInstallCommand Condition="!$([MSBuild]::IsOSPlatform('windows'))" + >$(_DotNetInstallScriptPath) -i $(_SdkWithNoWorkloadPath) -v $(SdkVersionForWorkloadTesting) + <_DotNetInstallCommand Condition="$([MSBuild]::IsOSPlatform('windows'))" + >$(_DotNetInstallScriptPath) -InstallDir $(_SdkWithNoWorkloadPath) -Version $(SdkVersionForWorkloadTesting) + + + + <_DotNetInstallCommand Condition="!$([MSBuild]::IsOSPlatform('windows'))" + >$(_DotNetInstallScriptPath) -i $(_SdkWithNoWorkloadPath) -v latest -q daily --channel 9.0 + <_DotNetInstallCommand Condition="$([MSBuild]::IsOSPlatform('windows'))" + >$(_DotNetInstallScriptPath) -InstallDir $(_SdkWithNoWorkloadPath) -Quality daily -Channel 9.0 + + <_RuntimePackVersions Include="$(PackageVersion)" EnvVarName="RUNTIME_PACK_VER8" /> + + + <_RuntimePackVersions Include="$(PackageVersionNet7)" EnvVarName="RUNTIME_PACK_VER7" Condition="'$(PackageVersionNet7)' != ''" /> <_RuntimePackVersions Include="$(PackageVersion)" EnvVarName="RUNTIME_PACK_VER7" Condition="'$(PackageVersionNet7)' == ''" /> <_RuntimePackVersions Include="$(PackageVersionNet6)" EnvVarName="RUNTIME_PACK_VER6" /> diff --git a/src/mono/wasm/Wasm.Build.Tests/WasmTemplateTestBase.cs b/src/mono/wasm/Wasm.Build.Tests/WasmTemplateTestBase.cs index e58e7002a368bd..c9de1408701dc2 100644 --- a/src/mono/wasm/Wasm.Build.Tests/WasmTemplateTestBase.cs +++ b/src/mono/wasm/Wasm.Build.Tests/WasmTemplateTestBase.cs @@ -4,6 +4,7 @@ #nullable enable using System; +using System.Collections.Generic; using System.IO; using System.Text.Json.Nodes; using Xunit.Abstractions; @@ -21,7 +22,7 @@ protected WasmTemplateTestBase(ITestOutputHelper output, SharedBuildPerTestClass _provider.BundleDirName = "AppBundle"; } - public string CreateWasmTemplateProject(string id, string template = "wasmbrowser", string extraArgs = "", bool runAnalyzers = true, bool addFrameworkArg = true) + public string CreateWasmTemplateProject(string id, string template = "wasmbrowser", string extraArgs = "", bool runAnalyzers = true, bool addFrameworkArg = false) { InitPaths(id); InitProjectDir(_projectDir, addNuGetSourceForLocalPackages: true); @@ -37,7 +38,7 @@ public string CreateWasmTemplateProject(string id, string template = "wasmbrowse """); - if (BuildEnvironment.UseWBTOverridePackTargets) + if (UseWBTOverridePackTargets) File.Copy(BuildEnvironment.WasmOverridePacksTargetsPath, Path.Combine(_projectDir, Path.GetFileName(BuildEnvironment.WasmOverridePacksTargetsPath)), overwrite: true); if (addFrameworkArg) @@ -89,6 +90,10 @@ private static void UpdateRuntimeconfigTemplateForNode(string projectDir) string id, BuildProjectOptions buildProjectOptions) { + if (buildProjectOptions.ExtraBuildEnvironmentVariables is null) + buildProjectOptions = buildProjectOptions with { ExtraBuildEnvironmentVariables = new Dictionary() }; + buildProjectOptions.ExtraBuildEnvironmentVariables["ForceNet8Current"] = "false"; + (CommandResult res, string logFilePath) = BuildProjectWithoutAssert(id, buildArgs.Config, buildProjectOptions); if (buildProjectOptions.UseCache) _buildContext.CacheBuild(buildArgs, new BuildProduct(_projectDir!, logFilePath, true, res.Output)); diff --git a/src/mono/wasi/Wasi.Build.Tests/data/nuget8.config b/src/mono/wasm/Wasm.Build.Tests/data/nuget9.config similarity index 83% rename from src/mono/wasi/Wasi.Build.Tests/data/nuget8.config rename to src/mono/wasm/Wasm.Build.Tests/data/nuget9.config index dfdc8009c6a5d5..439c0c6101738b 100644 --- a/src/mono/wasi/Wasi.Build.Tests/data/nuget8.config +++ b/src/mono/wasm/Wasm.Build.Tests/data/nuget9.config @@ -8,6 +8,7 @@ + diff --git a/src/mono/wasm/templates/templates/browser/browser.0.csproj b/src/mono/wasm/templates/templates/browser/browser.0.csproj index 588c5219582125..1bc8c1bdc15c66 100644 --- a/src/mono/wasm/templates/templates/browser/browser.0.csproj +++ b/src/mono/wasm/templates/templates/browser/browser.0.csproj @@ -1,6 +1,6 @@ - net8.0 + net7.0 true From 212a5de16ef76b58f2e5f53bf383f0216bb885d7 Mon Sep 17 00:00:00 2001 From: Andy Gocke Date: Fri, 27 Oct 2023 16:37:48 -0700 Subject: [PATCH 20/47] Update trim/aot analyzer to run on generated code (#94069) --- .../src/CompatibilitySuppressions.xml | 264 ++++++++++++++++++ .../System/Dynamic/BinaryOperationBinder.cs | 2 + .../src/System/Dynamic/ConvertBinder.cs | 3 + .../System/Dynamic/CreateInstanceBinder.cs | 3 + .../src/System/Dynamic/DeleteIndexBinder.cs | 3 + .../src/System/Dynamic/DeleteMemberBinder.cs | 3 + .../System/Dynamic/DynamicMetaObjectBinder.cs | 2 + .../src/System/Dynamic/DynamicObject.cs | 3 + .../src/System/Dynamic/GetIndexBinder.cs | 3 + .../src/System/Dynamic/GetMemberBinder.cs | 3 + .../src/System/Dynamic/InvokeBinder.cs | 3 + .../src/System/Dynamic/InvokeMemberBinder.cs | 3 + .../src/System/Dynamic/SetIndexBinder.cs | 3 + .../src/System/Dynamic/SetMemberBinder.cs | 3 + .../System/Dynamic/UnaryOperationBinder.cs | 2 + .../Dynamic/UpdateDelegates.Generated.cs | 22 ++ .../Compiler/DelegateHelpers.Generated.cs | 6 + .../Expressions/Compiler/DelegateHelpers.cs | 3 + .../Linq/Expressions/Compiler/StackSpiller.cs | 3 +- .../Compiler/TypeInfoExtensions.cs | 3 + .../Linq/Expressions/DynamicExpression.cs | 14 + .../src/System/Linq/Expressions/Expression.cs | 14 + .../Interpreter/CallInstruction.Generated.cs | 4 + .../Interpreter/CallInstruction.cs | 4 + .../Linq/Expressions/LambdaExpression.cs | 11 + .../src/ILLink.RoslynAnalyzer/COMAnalyzer.cs | 4 +- .../DynamicallyAccessedMembersAnalyzer.cs | 4 +- .../RequiresAnalyzerBase.cs | 4 +- 28 files changed, 395 insertions(+), 4 deletions(-) diff --git a/src/libraries/System.Linq.Expressions/src/CompatibilitySuppressions.xml b/src/libraries/System.Linq.Expressions/src/CompatibilitySuppressions.xml index 2004f22a5b280c..6cd6653b9e03fd 100644 --- a/src/libraries/System.Linq.Expressions/src/CompatibilitySuppressions.xml +++ b/src/libraries/System.Linq.Expressions/src/CompatibilitySuppressions.xml @@ -97,6 +97,48 @@ ref/net9.0/System.Linq.Expressions.dll lib/net9.0/System.Linq.Expressions.dll + + CP0016 + M:System.Linq.Expressions.DynamicExpression.Dynamic(System.Runtime.CompilerServices.CallSiteBinder,System.Type,System.Collections.Generic.IEnumerable{System.Linq.Expressions.Expression}):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + M:System.Linq.Expressions.DynamicExpression.Dynamic(System.Runtime.CompilerServices.CallSiteBinder,System.Type,System.Linq.Expressions.Expression,System.Linq.Expressions.Expression,System.Linq.Expressions.Expression,System.Linq.Expressions.Expression):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + M:System.Linq.Expressions.DynamicExpression.Dynamic(System.Runtime.CompilerServices.CallSiteBinder,System.Type,System.Linq.Expressions.Expression,System.Linq.Expressions.Expression,System.Linq.Expressions.Expression):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + M:System.Linq.Expressions.DynamicExpression.Dynamic(System.Runtime.CompilerServices.CallSiteBinder,System.Type,System.Linq.Expressions.Expression,System.Linq.Expressions.Expression):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + M:System.Linq.Expressions.DynamicExpression.Dynamic(System.Runtime.CompilerServices.CallSiteBinder,System.Type,System.Linq.Expressions.Expression):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + M:System.Linq.Expressions.DynamicExpression.Dynamic(System.Runtime.CompilerServices.CallSiteBinder,System.Type,System.Linq.Expressions.Expression[]):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + M:System.Linq.Expressions.DynamicExpression.MakeDynamic(System.Type,System.Runtime.CompilerServices.CallSiteBinder,System.Collections.Generic.IEnumerable{System.Linq.Expressions.Expression}):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + CP0016 M:System.Linq.Expressions.Expression.Call(System.Linq.Expressions.Expression,System.String,System.Type[],System.Linq.Expressions.Expression[]):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] @@ -109,6 +151,96 @@ ref/net9.0/System.Linq.Expressions.dll lib/net9.0/System.Linq.Expressions.dll + + CP0016 + M:System.Linq.Expressions.Expression.Dynamic(System.Runtime.CompilerServices.CallSiteBinder,System.Type,System.Collections.Generic.IEnumerable{System.Linq.Expressions.Expression}):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + M:System.Linq.Expressions.Expression.Dynamic(System.Runtime.CompilerServices.CallSiteBinder,System.Type,System.Linq.Expressions.Expression,System.Linq.Expressions.Expression,System.Linq.Expressions.Expression,System.Linq.Expressions.Expression):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + M:System.Linq.Expressions.Expression.Dynamic(System.Runtime.CompilerServices.CallSiteBinder,System.Type,System.Linq.Expressions.Expression,System.Linq.Expressions.Expression,System.Linq.Expressions.Expression):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + M:System.Linq.Expressions.Expression.Dynamic(System.Runtime.CompilerServices.CallSiteBinder,System.Type,System.Linq.Expressions.Expression,System.Linq.Expressions.Expression):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + M:System.Linq.Expressions.Expression.Dynamic(System.Runtime.CompilerServices.CallSiteBinder,System.Type,System.Linq.Expressions.Expression):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + M:System.Linq.Expressions.Expression.Dynamic(System.Runtime.CompilerServices.CallSiteBinder,System.Type,System.Linq.Expressions.Expression[]):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + M:System.Linq.Expressions.Expression.GetActionType(System.Type[]):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + M:System.Linq.Expressions.Expression.GetDelegateType(System.Type[]):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + M:System.Linq.Expressions.Expression.GetFuncType(System.Type[]):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + M:System.Linq.Expressions.Expression.Lambda(System.Linq.Expressions.Expression,System.Boolean,System.Collections.Generic.IEnumerable{System.Linq.Expressions.ParameterExpression}):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + M:System.Linq.Expressions.Expression.Lambda(System.Linq.Expressions.Expression,System.Boolean,System.Linq.Expressions.ParameterExpression[]):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + M:System.Linq.Expressions.Expression.Lambda(System.Linq.Expressions.Expression,System.Collections.Generic.IEnumerable{System.Linq.Expressions.ParameterExpression}):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + M:System.Linq.Expressions.Expression.Lambda(System.Linq.Expressions.Expression,System.Linq.Expressions.ParameterExpression[]):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + M:System.Linq.Expressions.Expression.Lambda(System.Linq.Expressions.Expression,System.String,System.Boolean,System.Collections.Generic.IEnumerable{System.Linq.Expressions.ParameterExpression}):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + M:System.Linq.Expressions.Expression.Lambda(System.Linq.Expressions.Expression,System.String,System.Collections.Generic.IEnumerable{System.Linq.Expressions.ParameterExpression}):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + CP0016 M:System.Linq.Expressions.Expression.ListInit(System.Linq.Expressions.NewExpression,System.Collections.Generic.IEnumerable{System.Linq.Expressions.Expression}):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] @@ -133,12 +265,144 @@ ref/net9.0/System.Linq.Expressions.dll lib/net9.0/System.Linq.Expressions.dll + + CP0016 + M:System.Linq.Expressions.Expression.MakeDynamic(System.Type,System.Runtime.CompilerServices.CallSiteBinder,System.Collections.Generic.IEnumerable{System.Linq.Expressions.Expression}):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + M:System.Linq.Expressions.Expression.MakeDynamic(System.Type,System.Runtime.CompilerServices.CallSiteBinder,System.Linq.Expressions.Expression,System.Linq.Expressions.Expression,System.Linq.Expressions.Expression,System.Linq.Expressions.Expression):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + M:System.Linq.Expressions.Expression.MakeDynamic(System.Type,System.Runtime.CompilerServices.CallSiteBinder,System.Linq.Expressions.Expression,System.Linq.Expressions.Expression,System.Linq.Expressions.Expression):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + M:System.Linq.Expressions.Expression.MakeDynamic(System.Type,System.Runtime.CompilerServices.CallSiteBinder,System.Linq.Expressions.Expression,System.Linq.Expressions.Expression):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + M:System.Linq.Expressions.Expression.MakeDynamic(System.Type,System.Runtime.CompilerServices.CallSiteBinder,System.Linq.Expressions.Expression):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + M:System.Linq.Expressions.Expression.MakeDynamic(System.Type,System.Runtime.CompilerServices.CallSiteBinder,System.Linq.Expressions.Expression[]):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + M:System.Linq.Expressions.Expression.TryGetActionType(System.Type[],System.Type@):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + M:System.Linq.Expressions.Expression.TryGetFuncType(System.Type[],System.Type@):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + CP0016 M:System.Runtime.CompilerServices.CallSite`1.Create(System.Runtime.CompilerServices.CallSiteBinder):[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] ref/net9.0/System.Linq.Expressions.dll lib/net9.0/System.Linq.Expressions.dll + + CP0016 + T:System.Dynamic.BinaryOperationBinder:[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + T:System.Dynamic.ConvertBinder:[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + T:System.Dynamic.CreateInstanceBinder:[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + T:System.Dynamic.DeleteIndexBinder:[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + T:System.Dynamic.DeleteMemberBinder:[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + T:System.Dynamic.DynamicMetaObjectBinder:[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + T:System.Dynamic.DynamicObject:[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + T:System.Dynamic.GetIndexBinder:[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + T:System.Dynamic.GetMemberBinder:[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + T:System.Dynamic.InvokeBinder:[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + T:System.Dynamic.InvokeMemberBinder:[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + T:System.Dynamic.SetIndexBinder:[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + T:System.Dynamic.SetMemberBinder:[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + + + CP0016 + T:System.Dynamic.UnaryOperationBinder:[T:System.Diagnostics.CodeAnalysis.RequiresDynamicCodeAttribute] + ref/net9.0/System.Linq.Expressions.dll + lib/net9.0/System.Linq.Expressions.dll + CP0020 M:System.Linq.Expressions.DynamicExpressionVisitor.#ctor diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/BinaryOperationBinder.cs b/src/libraries/System.Linq.Expressions/src/System/Dynamic/BinaryOperationBinder.cs index 400221c2b692c4..58e80c379b106c 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/BinaryOperationBinder.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/BinaryOperationBinder.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.Diagnostics.CodeAnalysis; using System.Dynamic.Utils; using System.Linq.Expressions; @@ -9,6 +10,7 @@ namespace System.Dynamic /// /// Represents the binary dynamic operation at the call site, providing the binding semantic and the details about the operation. /// + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] public abstract class BinaryOperationBinder : DynamicMetaObjectBinder { /// diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/ConvertBinder.cs b/src/libraries/System.Linq.Expressions/src/System/Dynamic/ConvertBinder.cs index 3feb8bd630164b..ba8dc8184683ae 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/ConvertBinder.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/ConvertBinder.cs @@ -1,13 +1,16 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Dynamic.Utils; +using System.Linq.Expressions; namespace System.Dynamic { /// /// Represents the convert dynamic operation at the call site, providing the binding semantic and the details about the operation. /// + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] public abstract class ConvertBinder : DynamicMetaObjectBinder { /// diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/CreateInstanceBinder.cs b/src/libraries/System.Linq.Expressions/src/System/Dynamic/CreateInstanceBinder.cs index 5fe0fbddc9708a..2d4443ef2506f9 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/CreateInstanceBinder.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/CreateInstanceBinder.cs @@ -1,13 +1,16 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Dynamic.Utils; +using System.Linq.Expressions; namespace System.Dynamic { /// /// Represents the create dynamic operation at the call site, providing the binding semantic and the details about the operation. /// + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] public abstract class CreateInstanceBinder : DynamicMetaObjectBinder { /// diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/DeleteIndexBinder.cs b/src/libraries/System.Linq.Expressions/src/System/Dynamic/DeleteIndexBinder.cs index b12295b8269700..798c106f182b4e 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/DeleteIndexBinder.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/DeleteIndexBinder.cs @@ -1,13 +1,16 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Dynamic.Utils; +using System.Linq.Expressions; namespace System.Dynamic { /// /// Represents the dynamic delete index operation at the call site, providing the binding semantic and the details about the operation. /// + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] public abstract class DeleteIndexBinder : DynamicMetaObjectBinder { /// diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/DeleteMemberBinder.cs b/src/libraries/System.Linq.Expressions/src/System/Dynamic/DeleteMemberBinder.cs index 60a7ab2d351e8c..d6b075e1cb6e37 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/DeleteMemberBinder.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/DeleteMemberBinder.cs @@ -1,13 +1,16 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Dynamic.Utils; +using System.Linq.Expressions; namespace System.Dynamic { /// /// Represents the dynamic delete member operation at the call site, providing the binding semantic and the details about the operation. /// + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] public abstract class DeleteMemberBinder : DynamicMetaObjectBinder { /// diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/DynamicMetaObjectBinder.cs b/src/libraries/System.Linq.Expressions/src/System/Dynamic/DynamicMetaObjectBinder.cs index 7e39da3f5313d9..e8493fd4f4e4d2 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/DynamicMetaObjectBinder.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/DynamicMetaObjectBinder.cs @@ -3,6 +3,7 @@ using System.Collections.ObjectModel; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Dynamic.Utils; using System.Linq.Expressions; using System.Runtime.CompilerServices; @@ -19,6 +20,7 @@ namespace System.Dynamic /// as input. On the other hand, the participates in the /// binding protocol. /// + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] public abstract class DynamicMetaObjectBinder : CallSiteBinder { /// diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/DynamicObject.cs b/src/libraries/System.Linq.Expressions/src/System/Dynamic/DynamicObject.cs index 19910ca7cf67c4..21ba4d3e0e7238 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/DynamicObject.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/DynamicObject.cs @@ -23,6 +23,7 @@ namespace System.Dynamic /// If a method is not overridden then the does not directly support /// that behavior and the call site will determine how the binding should be performed. /// + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] public class DynamicObject : IDynamicMetaObjectProvider { /// @@ -205,6 +206,7 @@ public virtual bool TryGetIndex(GetIndexBinder binder, object[] indexes, out obj #region MetaDynamic + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] private sealed class MetaDynamic : DynamicMetaObject { internal MetaDynamic(Expression expression, DynamicObject value) @@ -855,6 +857,7 @@ private Expression GetLimitedSelf() // is only used by DynamicObject.GetMember--it is not expected to // (and cannot) implement binding semantics. It is just so the DO // can use the Name and IgnoreCase properties. + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] private sealed class GetBinderAdapter : GetMemberBinder { internal GetBinderAdapter(InvokeMemberBinder binder) diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/GetIndexBinder.cs b/src/libraries/System.Linq.Expressions/src/System/Dynamic/GetIndexBinder.cs index 93b086eeb4d9b8..a367ee3daea3e8 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/GetIndexBinder.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/GetIndexBinder.cs @@ -1,13 +1,16 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Dynamic.Utils; +using System.Linq.Expressions; namespace System.Dynamic { /// /// Represents the dynamic get index operation at the call site, providing the binding semantic and the details about the operation. /// + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] public abstract class GetIndexBinder : DynamicMetaObjectBinder { /// diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/GetMemberBinder.cs b/src/libraries/System.Linq.Expressions/src/System/Dynamic/GetMemberBinder.cs index 25cc22354b0a3e..e24d1ea956e6b5 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/GetMemberBinder.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/GetMemberBinder.cs @@ -1,13 +1,16 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Dynamic.Utils; +using System.Linq.Expressions; namespace System.Dynamic { /// /// Represents the dynamic get member operation at the call site, providing the binding semantic and the details about the operation. /// + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] public abstract class GetMemberBinder : DynamicMetaObjectBinder { /// diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/InvokeBinder.cs b/src/libraries/System.Linq.Expressions/src/System/Dynamic/InvokeBinder.cs index 1c9f895067d94d..cb144aee5fa7ec 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/InvokeBinder.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/InvokeBinder.cs @@ -1,13 +1,16 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Dynamic.Utils; +using System.Linq.Expressions; namespace System.Dynamic { /// /// Represents the invoke dynamic operation at the call site, providing the binding semantic and the details about the operation. /// + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] public abstract class InvokeBinder : DynamicMetaObjectBinder { /// diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/InvokeMemberBinder.cs b/src/libraries/System.Linq.Expressions/src/System/Dynamic/InvokeMemberBinder.cs index 634d77b0ad36a2..742df000b2df9f 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/InvokeMemberBinder.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/InvokeMemberBinder.cs @@ -1,13 +1,16 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Dynamic.Utils; +using System.Linq.Expressions; namespace System.Dynamic { /// /// Represents the invoke member dynamic operation at the call site, providing the binding semantic and the details about the operation. /// + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] public abstract class InvokeMemberBinder : DynamicMetaObjectBinder { /// diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/SetIndexBinder.cs b/src/libraries/System.Linq.Expressions/src/System/Dynamic/SetIndexBinder.cs index 8be0b539df48a2..9d9522432797d7 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/SetIndexBinder.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/SetIndexBinder.cs @@ -1,13 +1,16 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Dynamic.Utils; +using System.Linq.Expressions; namespace System.Dynamic { /// /// Represents the dynamic set index operation at the call site, providing the binding semantic and the details about the operation. /// + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] public abstract class SetIndexBinder : DynamicMetaObjectBinder { /// diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/SetMemberBinder.cs b/src/libraries/System.Linq.Expressions/src/System/Dynamic/SetMemberBinder.cs index 4f0b805053c972..4f8ec042d3829a 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/SetMemberBinder.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/SetMemberBinder.cs @@ -1,13 +1,16 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; using System.Dynamic.Utils; +using System.Linq.Expressions; namespace System.Dynamic { /// /// Represents the dynamic set member operation at the call site, providing the binding semantic and the details about the operation. /// + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] public abstract class SetMemberBinder : DynamicMetaObjectBinder { /// diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/UnaryOperationBinder.cs b/src/libraries/System.Linq.Expressions/src/System/Dynamic/UnaryOperationBinder.cs index 6d45ec4741ee4e..886bc89a5a522e 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/UnaryOperationBinder.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/UnaryOperationBinder.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.Diagnostics.CodeAnalysis; using System.Dynamic.Utils; using System.Linq.Expressions; @@ -9,6 +10,7 @@ namespace System.Dynamic /// /// Represents the unary dynamic operation at the call site, providing the binding semantic and the details about the operation. /// + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] public abstract class UnaryOperationBinder : DynamicMetaObjectBinder { /// diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/UpdateDelegates.Generated.cs b/src/libraries/System.Linq.Expressions/src/System/Dynamic/UpdateDelegates.Generated.cs index 2969348e143dc2..af8f38b38a778d 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/UpdateDelegates.Generated.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/UpdateDelegates.Generated.cs @@ -1,6 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; +using System.Linq.Expressions; using System.Runtime.CompilerServices; namespace System.Dynamic @@ -8,6 +10,7 @@ namespace System.Dynamic internal static partial class UpdateDelegates { [Obsolete("pregenerated CallSite.Update delegate", error: true)] + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] internal static TRet UpdateAndExecute1(CallSite site, T0 arg0) { // @@ -153,6 +156,7 @@ internal static TRet NoMatch1(CallSite site, T0 arg0) [Obsolete("pregenerated CallSite.Update delegate", error: true)] + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] internal static TRet UpdateAndExecute2(CallSite site, T0 arg0, T1 arg1) { // @@ -298,6 +302,7 @@ internal static TRet NoMatch2(CallSite site, T0 arg0, T1 arg1) [Obsolete("pregenerated CallSite.Update delegate", error: true)] + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] internal static TRet UpdateAndExecute3(CallSite site, T0 arg0, T1 arg1, T2 arg2) { // @@ -443,6 +448,7 @@ internal static TRet NoMatch3(CallSite site, T0 arg0, T1 arg1, [Obsolete("pregenerated CallSite.Update delegate", error: true)] + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] internal static TRet UpdateAndExecute4(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) { // @@ -588,6 +594,7 @@ internal static TRet NoMatch4(CallSite site, T0 arg0, T1 a [Obsolete("pregenerated CallSite.Update delegate", error: true)] + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] internal static TRet UpdateAndExecute5(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) { // @@ -733,6 +740,7 @@ internal static TRet NoMatch5(CallSite site, T0 arg0, [Obsolete("pregenerated CallSite.Update delegate", error: true)] + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] internal static TRet UpdateAndExecute6(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5) { // @@ -878,6 +886,7 @@ internal static TRet NoMatch6(CallSite site, T0 ar [Obsolete("pregenerated CallSite.Update delegate", error: true)] + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] internal static TRet UpdateAndExecute7(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) { // @@ -1023,6 +1032,7 @@ internal static TRet NoMatch7(CallSite site, T [Obsolete("pregenerated CallSite.Update delegate", error: true)] + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] internal static TRet UpdateAndExecute8(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7) { // @@ -1168,6 +1178,7 @@ internal static TRet NoMatch8(CallSite sit [Obsolete("pregenerated CallSite.Update delegate", error: true)] + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] internal static TRet UpdateAndExecute9(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8) { // @@ -1313,6 +1324,7 @@ internal static TRet NoMatch9(CallSite [Obsolete("pregenerated CallSite.Update delegate", error: true)] + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] internal static TRet UpdateAndExecute10(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9) { // @@ -1458,6 +1470,7 @@ internal static TRet NoMatch10(Cal [Obsolete("pregenerated CallSite.Update delegate", error: true)] + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] internal static void UpdateAndExecuteVoid1(CallSite site, T0 arg0) { // @@ -1602,6 +1615,7 @@ internal static void NoMatchVoid1(CallSite site, T0 arg0) [Obsolete("pregenerated CallSite.Update delegate", error: true)] + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] internal static void UpdateAndExecuteVoid2(CallSite site, T0 arg0, T1 arg1) { // @@ -1746,6 +1760,7 @@ internal static void NoMatchVoid2(CallSite site, T0 arg0, T1 arg1) [Obsolete("pregenerated CallSite.Update delegate", error: true)] + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] internal static void UpdateAndExecuteVoid3(CallSite site, T0 arg0, T1 arg1, T2 arg2) { // @@ -1890,6 +1905,7 @@ internal static void NoMatchVoid3(CallSite site, T0 arg0, T1 arg1, T [Obsolete("pregenerated CallSite.Update delegate", error: true)] + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] internal static void UpdateAndExecuteVoid4(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3) { // @@ -2034,6 +2050,7 @@ internal static void NoMatchVoid4(CallSite site, T0 arg0, T1 arg [Obsolete("pregenerated CallSite.Update delegate", error: true)] + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] internal static void UpdateAndExecuteVoid5(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) { // @@ -2178,6 +2195,7 @@ internal static void NoMatchVoid5(CallSite site, T0 arg0, T1 [Obsolete("pregenerated CallSite.Update delegate", error: true)] + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] internal static void UpdateAndExecuteVoid6(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5) { // @@ -2322,6 +2340,7 @@ internal static void NoMatchVoid6(CallSite site, T0 arg0 [Obsolete("pregenerated CallSite.Update delegate", error: true)] + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] internal static void UpdateAndExecuteVoid7(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6) { // @@ -2466,6 +2485,7 @@ internal static void NoMatchVoid7(CallSite site, T0 [Obsolete("pregenerated CallSite.Update delegate", error: true)] + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] internal static void UpdateAndExecuteVoid8(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7) { // @@ -2610,6 +2630,7 @@ internal static void NoMatchVoid8(CallSite site, [Obsolete("pregenerated CallSite.Update delegate", error: true)] + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] internal static void UpdateAndExecuteVoid9(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8) { // @@ -2754,6 +2775,7 @@ internal static void NoMatchVoid9(CallSite s [Obsolete("pregenerated CallSite.Update delegate", error: true)] + [RequiresDynamicCode(Expression.CallSiteRequiresDynamicCode)] internal static void UpdateAndExecuteVoid10(CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9) { // diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/DelegateHelpers.Generated.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/DelegateHelpers.Generated.cs index 77356647009076..1ebd36b069882e 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/DelegateHelpers.Generated.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/DelegateHelpers.Generated.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Dynamic.Utils; namespace System.Linq.Expressions.Compiler @@ -14,6 +15,7 @@ internal static partial class DelegateHelpers /// We use the cache to avoid copying the array, and to cache the /// created delegate type /// + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] internal static Type MakeDelegateType(Type[] types) { lock (_DelegateCache) @@ -90,6 +92,7 @@ private static TypeInfo NextTypeInfo(Type initialArg, TypeInfo curTypeInfo) public delegate object VBCallSiteDelegate6(T callSite, object instance, ref object arg1, ref object arg2, ref object arg3, ref object arg4, ref object arg5, ref object arg6); public delegate object VBCallSiteDelegate7(T callSite, object instance, ref object arg1, ref object arg2, ref object arg3, ref object arg4, ref object arg5, ref object arg6, ref object arg7); + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] private static Type TryMakeVBStyledCallSite(Type[] types) { // Shape of VB CallSiteDelegates is CallSite * (instance : obj) * [arg-n : byref obj] -> obj @@ -127,6 +130,7 @@ private static Type TryMakeVBStyledCallSite(Type[] types) /// Creates a new delegate, or uses a func/action /// Note: this method does not cache /// + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] internal static Type MakeNewDelegate(Type[] types) { Debug.Assert(types != null && types.Length > 0); @@ -180,6 +184,7 @@ internal static Type MakeNewDelegate(Type[] types) return result; } + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] internal static Type GetFuncType(Type[] types) { switch (types.Length) @@ -224,6 +229,7 @@ internal static Type GetFuncType(Type[] types) } } + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] internal static Type GetActionType(Type[] types) { switch (types.Length) diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/DelegateHelpers.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/DelegateHelpers.cs index aa940367777db7..db80a9c43fd4c0 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/DelegateHelpers.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/DelegateHelpers.cs @@ -3,6 +3,7 @@ using System.Collections.ObjectModel; using System.Runtime.CompilerServices; +using System.Diagnostics.CodeAnalysis; using System.Dynamic; using System.Dynamic.Utils; using System.Reflection; @@ -18,6 +19,7 @@ internal static partial class DelegateHelpers /// We take the read-only collection of Expression explicitly to avoid allocating memory (an array /// of types) on lookup of delegate types. /// + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] internal static Type MakeCallSiteDelegate(ReadOnlyCollection types, Type returnType) { lock (_DelegateCache) @@ -52,6 +54,7 @@ internal static Type MakeCallSiteDelegate(ReadOnlyCollection types, /// We take the array of MetaObject explicitly to avoid allocating memory (an array of types) on /// lookup of delegate types. /// + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] internal static Type MakeDeferredSiteDelegate(DynamicMetaObject[] args, Type returnType) { lock (_DelegateCache) diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.cs index 4012dd1ebbd8b4..6b10eae46d43a9 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/StackSpiller.cs @@ -462,7 +462,8 @@ private Result RewriteMethodCallExpression(Expression expr, Stack stack) return cr.Finish(expr); } - [RequiresDynamicCode(Expression.NewArrayRequiresDynamicCode)] + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL3050:RequiresDynamicCode", + Justification = "A NewArrayExpression has already been created. The original creator will get a warning that it is not trim compatible.")] private Result RewriteNewArrayExpression(Expression expr, Stack stack) { var node = (NewArrayExpression)expr; diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/TypeInfoExtensions.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/TypeInfoExtensions.cs index a2c1ddc189158b..ba17f904741ebf 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/TypeInfoExtensions.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/TypeInfoExtensions.cs @@ -2,17 +2,20 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; namespace System.Linq.Expressions.Compiler { internal static class TypeInfoExtensions { + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static Type MakeDelegateType(this DelegateHelpers.TypeInfo info, Type retType, params Expression[] args) { return info.MakeDelegateType(retType, (IList)args); } + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static Type MakeDelegateType(this DelegateHelpers.TypeInfo info, Type retType, IList args) { // nope, go ahead and create it and spend the diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/DynamicExpression.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/DynamicExpression.cs index d2e1204b2c1640..4b5a73f3588710 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/DynamicExpression.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/DynamicExpression.cs @@ -240,6 +240,7 @@ int IArgumentProvider.ArgumentCount /// The DelegateType property of the result will be inferred /// from the types of the arguments and the specified return type. /// + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static new DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, params Expression[] arguments) { return ExpressionExtension.Dynamic(binder, returnType, arguments); @@ -261,6 +262,7 @@ int IArgumentProvider.ArgumentCount /// The DelegateType property of the result will be inferred /// from the types of the arguments and the specified return type. /// + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static new DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, IEnumerable arguments) { return ExpressionExtension.Dynamic(binder, returnType, arguments); @@ -282,6 +284,7 @@ int IArgumentProvider.ArgumentCount /// The DelegateType property of the result will be inferred /// from the types of the arguments and the specified return type. /// + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static new DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, Expression arg0) { return ExpressionExtension.Dynamic(binder, returnType, arg0); @@ -304,6 +307,7 @@ int IArgumentProvider.ArgumentCount /// The DelegateType property of the result will be inferred /// from the types of the arguments and the specified return type. /// + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static new DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, Expression arg0, Expression arg1) { return ExpressionExtension.Dynamic(binder, returnType, arg0, arg1); @@ -327,6 +331,7 @@ int IArgumentProvider.ArgumentCount /// The DelegateType property of the result will be inferred /// from the types of the arguments and the specified return type. /// + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static new DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, Expression arg0, Expression arg1, Expression arg2) { return ExpressionExtension.Dynamic(binder, returnType, arg0, arg1, arg2); @@ -351,6 +356,7 @@ int IArgumentProvider.ArgumentCount /// The DelegateType property of the result will be inferred /// from the types of the arguments and the specified return type. /// + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static new DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, Expression arg0, Expression arg1, Expression arg2, Expression arg3) { return ExpressionExtension.Dynamic(binder, returnType, arg0, arg1, arg2, arg3); @@ -369,6 +375,7 @@ int IArgumentProvider.ArgumentCount /// Binder, and /// Arguments set to the specified values. /// + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static new DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, IEnumerable? arguments) { return ExpressionExtension.MakeDynamic(delegateType, binder, arguments); @@ -1026,6 +1033,7 @@ private static MethodInfo GetValidMethodForDynamic(Type delegateType) /// The DelegateType property of the /// result will be inferred from the types of the arguments and the specified return type. /// + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, params Expression[] arguments) { return Dynamic(binder, returnType, (IEnumerable)arguments); @@ -1047,6 +1055,7 @@ public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, /// The DelegateType property of the /// result will be inferred from the types of the arguments and the specified return type. /// + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, Expression arg0) { ArgumentNullException.ThrowIfNull(binder); @@ -1082,6 +1091,7 @@ public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, /// The DelegateType property of the /// result will be inferred from the types of the arguments and the specified return type. /// + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, Expression arg0, Expression arg1) { ArgumentNullException.ThrowIfNull(binder); @@ -1122,6 +1132,7 @@ public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, /// The DelegateType property of the /// result will be inferred from the types of the arguments and the specified return type. /// + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, Expression arg0, Expression arg1, Expression arg2) { ArgumentNullException.ThrowIfNull(binder); @@ -1167,6 +1178,7 @@ public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, /// The DelegateType property of the /// result will be inferred from the types of the arguments and the specified return type. /// + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, Expression arg0, Expression arg1, Expression arg2, Expression arg3) { ArgumentNullException.ThrowIfNull(binder); @@ -1213,6 +1225,7 @@ public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, /// The DelegateType property of the /// result will be inferred from the types of the arguments and the specified return type. /// + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, IEnumerable arguments) { ArgumentNullException.ThrowIfNull(arguments); @@ -1223,6 +1236,7 @@ public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, return MakeDynamic(binder, returnType, args); } + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] private static DynamicExpression MakeDynamic(CallSiteBinder binder, Type returnType, ReadOnlyCollection arguments) { ArgumentNullException.ThrowIfNull(binder); diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Expression.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Expression.cs index 690f234fae7298..0458fc01830e6d 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Expression.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Expression.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; using System.Dynamic.Utils; using System.Globalization; using System.Reflection; @@ -25,6 +26,7 @@ public abstract partial class Expression internal const string LambdaCompilerRequiresDynamicCode = "Compiling a lambda expression requires dynamic code generation."; internal const string StrongBoxRequiresDynamicCode = "Creating a StrongBox requires dynamic code generation."; internal const string NewArrayRequiresDynamicCode = "Creating arrays at runtime requires dynamic code generation."; + internal const string DelegateCreationRequiresDynamicCode = "Delegate creation requires dynamic code generation."; private static readonly CacheDict s_lambdaDelegateCache = new CacheDict(40); private static volatile CacheDict, LambdaExpression>>? s_lambdaFactories; @@ -298,6 +300,7 @@ private static void RequiresCanWrite(Expression expression, string paramName) /// The DelegateType property of the /// result will be inferred from the types of the arguments and the specified return type. /// + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, IEnumerable arguments) => DynamicExpression.Dynamic(binder, returnType, arguments); @@ -317,6 +320,7 @@ public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, /// The DelegateType property of the /// result will be inferred from the types of the arguments and the specified return type. /// + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, Expression arg0) => DynamicExpression.Dynamic(binder, returnType, arg0); @@ -337,6 +341,7 @@ public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, /// The DelegateType property of the /// result will be inferred from the types of the arguments and the specified return type. /// + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, Expression arg0, Expression arg1) => DynamicExpression.Dynamic(binder, returnType, arg0, arg1); @@ -358,6 +363,7 @@ public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, /// The DelegateType property of the /// result will be inferred from the types of the arguments and the specified return type. /// + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, Expression arg0, Expression arg1, Expression arg2) => DynamicExpression.Dynamic(binder, returnType, arg0, arg1, arg2); @@ -380,6 +386,7 @@ public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, /// The DelegateType property of the /// result will be inferred from the types of the arguments and the specified return type. /// + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, Expression arg0, Expression arg1, Expression arg2, Expression arg3) => DynamicExpression.Dynamic(binder, returnType, arg0, arg1, arg2, arg3); @@ -399,6 +406,7 @@ public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, /// The DelegateType property of the /// result will be inferred from the types of the arguments and the specified return type. /// + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, params Expression[] arguments) => DynamicExpression.Dynamic(binder, returnType, arguments); @@ -415,6 +423,7 @@ public static DynamicExpression Dynamic(CallSiteBinder binder, Type returnType, /// Binder, and /// Arguments set to the specified values. /// + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, IEnumerable? arguments) => DynamicExpression.MakeDynamic(delegateType, binder, arguments); @@ -431,6 +440,7 @@ public static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder bi /// Binder, and /// Arguments set to the specified values. /// + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, Expression arg0) => DynamicExpression.MakeDynamic(delegateType, binder, arg0); @@ -448,6 +458,7 @@ public static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder bi /// Binder, and /// Arguments set to the specified values. /// + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, Expression arg0, Expression arg1) => DynamicExpression.MakeDynamic(delegateType, binder, arg0, arg1); @@ -466,6 +477,7 @@ public static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder bi /// Binder, and /// Arguments set to the specified values. /// + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, Expression arg0, Expression arg1, Expression arg2) => DynamicExpression.MakeDynamic(delegateType, binder, arg0, arg1, arg2); @@ -485,6 +497,7 @@ public static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder bi /// Binder, and /// Arguments set to the specified values. /// + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, Expression arg0, Expression arg1, Expression arg2, Expression arg3) => DynamicExpression.MakeDynamic(delegateType, binder, arg0, arg1, arg2, arg3); @@ -501,6 +514,7 @@ public static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder bi /// Binder, and /// Arguments set to the specified values. /// + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static DynamicExpression MakeDynamic(Type delegateType, CallSiteBinder binder, params Expression[]? arguments) => MakeDynamic(delegateType, binder, (IEnumerable?)arguments); } diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/CallInstruction.Generated.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/CallInstruction.Generated.cs index 34203b5512d280..96bc1894bae8ef 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/CallInstruction.Generated.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/CallInstruction.Generated.cs @@ -32,6 +32,7 @@ internal partial class CallInstruction /// One relaxation is that for return types which are non-primitive types /// we can fall back to object due to relaxed delegates. /// + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] private static CallInstruction FastCreate(MethodInfo target, ParameterInfo[] pi) { Type t = TryGetParameterOrReturnType(target, pi, 0); @@ -71,6 +72,7 @@ private static CallInstruction FastCreate(MethodInfo target, ParameterInfo[] pi) } } + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] private static CallInstruction FastCreate(MethodInfo target, ParameterInfo[] pi) { Type t = TryGetParameterOrReturnType(target, pi, 1); @@ -114,6 +116,7 @@ private static CallInstruction FastCreate(MethodInfo target, ParameterInfo[] } } + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] private static CallInstruction FastCreate(MethodInfo target, ParameterInfo[] pi) { Type t = TryGetParameterOrReturnType(target, pi, 2); @@ -157,6 +160,7 @@ private static CallInstruction FastCreate(MethodInfo target, ParameterIn #endif [return: DynamicallyAccessedMembersAttribute(DynamicallyAccessedMemberTypes.PublicConstructors)] + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] private static Type GetHelperType(MethodInfo info, Type[] arrTypes) { Type t; diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/CallInstruction.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/CallInstruction.cs index 5ab0cea57217b1..f73d513a25d07a 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/CallInstruction.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Interpreter/CallInstruction.cs @@ -50,6 +50,8 @@ public static CallInstruction Create(MethodInfo info, ParameterInfo[] parameters if (!CanCreateArbitraryDelegates) return new MethodInfoCallInstruction(info, argumentCount); + // This code should be unreachable in AOT. The analyzer currently doesn't understand feature switches +#pragma warning disable IL3050 if (!info.IsStatic && info.DeclaringType!.IsValueType) { return new MethodInfoCallInstruction(info, argumentCount); @@ -113,6 +115,7 @@ public static CallInstruction Create(MethodInfo info, ParameterInfo[] parameters s_cache[info] = res; return res; +#pragma warning restore IL3050 } private static CallInstruction GetArrayAccessor(MethodInfo info, int argumentCount) @@ -205,6 +208,7 @@ private static bool IndexIsNotReturnType(int index, MethodInfo target, Parameter /// /// Uses reflection to create new instance of the appropriate ReflectedCaller /// + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] private static CallInstruction SlowCreate(MethodInfo info, ParameterInfo[] pis) { List types = new List(); diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/LambdaExpression.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/LambdaExpression.cs index 9b22fc9bc6e95b..d3f0366a01f386 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/LambdaExpression.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/LambdaExpression.cs @@ -742,6 +742,7 @@ public static Expression Lambda(Expression body, string? n /// An to set the property equal to. /// An array that contains objects to use to populate the collection. /// A that has the property equal to and the and properties set to the specified values. + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static LambdaExpression Lambda(Expression body, params ParameterExpression[]? parameters) { return Lambda(body, false, (IEnumerable?)parameters); @@ -754,6 +755,7 @@ public static LambdaExpression Lambda(Expression body, params ParameterExpressio /// A that indicates if tail call optimization will be applied when compiling the created expression. /// An array that contains objects to use to populate the collection. /// A that has the property equal to and the and properties set to the specified values. + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static LambdaExpression Lambda(Expression body, bool tailCall, params ParameterExpression[]? parameters) { return Lambda(body, tailCall, (IEnumerable?)parameters); @@ -765,6 +767,7 @@ public static LambdaExpression Lambda(Expression body, bool tailCall, params Par /// An to set the property equal to. /// An that contains objects to use to populate the collection. /// A that has the property equal to and the and properties set to the specified values. + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static LambdaExpression Lambda(Expression body, IEnumerable? parameters) { return Lambda(body, null, false, parameters); @@ -777,6 +780,7 @@ public static LambdaExpression Lambda(Expression body, IEnumerableA that indicates if tail call optimization will be applied when compiling the created expression. /// An that contains objects to use to populate the collection. /// A that has the property equal to and the and properties set to the specified values. + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static LambdaExpression Lambda(Expression body, bool tailCall, IEnumerable? parameters) { return Lambda(body, null, tailCall, parameters); @@ -839,6 +843,7 @@ public static LambdaExpression Lambda(Type delegateType, Expression body, bool t /// An that contains objects to use to populate the collection. /// The name for the lambda. Used for emitting debug information. /// A that has the property equal to and the and properties set to the specified values. + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static LambdaExpression Lambda(Expression body, string? name, IEnumerable? parameters) { return Lambda(body, name, false, parameters); @@ -852,6 +857,7 @@ public static LambdaExpression Lambda(Expression body, string? name, IEnumerable /// A that indicates if tail call optimization will be applied when compiling the created expression. /// An that contains objects to use to populate the collection. /// A that has the property equal to and the and properties set to the specified values. + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static LambdaExpression Lambda(Expression body, string? name, bool tailCall, IEnumerable? parameters) { ArgumentNullException.ThrowIfNull(body); @@ -1026,6 +1032,7 @@ private static TryGetFuncActionArgsResult ValidateTryGetFuncActionArgs(Type[]? t /// /// An array of objects that specify the type arguments for the System.Func delegate type. /// The type of a System.Func delegate that has the specified type arguments. + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static Type GetFuncType(params Type[]? typeArgs) { switch (ValidateTryGetFuncActionArgs(typeArgs)) @@ -1055,6 +1062,7 @@ public static Type GetFuncType(params Type[]? typeArgs) /// An array of objects that specify the type arguments for the System.Func delegate type. /// When this method returns, contains the generic System.Func delegate type that has specific type arguments. Contains null if there is no generic System.Func delegate that matches the .This parameter is passed uninitialized. /// true if generic System.Func delegate type was created for specific ; false otherwise. + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static bool TryGetFuncType(Type[] typeArgs, [NotNullWhen(true)] out Type? funcType) { if (ValidateTryGetFuncActionArgs(typeArgs) == TryGetFuncActionArgsResult.Valid) @@ -1071,6 +1079,7 @@ public static bool TryGetFuncType(Type[] typeArgs, [NotNullWhen(true)] out Type? /// /// An array of objects that specify the type arguments for the System.Action delegate type. /// The type of a System.Action delegate that has the specified type arguments. + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static Type GetActionType(params Type[]? typeArgs) { switch (ValidateTryGetFuncActionArgs(typeArgs)) @@ -1099,6 +1108,7 @@ public static Type GetActionType(params Type[]? typeArgs) /// An array of objects that specify the type arguments for the System.Action delegate type. /// When this method returns, contains the generic System.Action delegate type that has specific type arguments. Contains null if there is no generic System.Action delegate that matches the .This parameter is passed uninitialized. /// true if generic System.Action delegate type was created for specific ; false otherwise. + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static bool TryGetActionType(Type[] typeArgs, [NotNullWhen(true)] out Type? actionType) { if (ValidateTryGetFuncActionArgs(typeArgs) == TryGetFuncActionArgsResult.Valid) @@ -1120,6 +1130,7 @@ public static bool TryGetActionType(Type[] typeArgs, [NotNullWhen(true)] out Typ /// /// As with Func, the last argument is the return type. It can be set /// to to produce an Action. + [RequiresDynamicCode(Expression.DelegateCreationRequiresDynamicCode)] public static Type GetDelegateType(params Type[] typeArgs) { ContractUtils.RequiresNotEmpty(typeArgs, nameof(typeArgs)); diff --git a/src/tools/illink/src/ILLink.RoslynAnalyzer/COMAnalyzer.cs b/src/tools/illink/src/ILLink.RoslynAnalyzer/COMAnalyzer.cs index 31d4955e329b96..06ed3c7c44bf4f 100644 --- a/src/tools/illink/src/ILLink.RoslynAnalyzer/COMAnalyzer.cs +++ b/src/tools/illink/src/ILLink.RoslynAnalyzer/COMAnalyzer.cs @@ -26,9 +26,11 @@ public sealed class COMAnalyzer : DiagnosticAnalyzer public override void Initialize (AnalysisContext context) { + context.ConfigureGeneratedCodeAnalysis (GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); + if (!System.Diagnostics.Debugger.IsAttached) context.EnableConcurrentExecution (); - context.ConfigureGeneratedCodeAnalysis (GeneratedCodeAnalysisFlags.ReportDiagnostics); + context.RegisterCompilationStartAction (context => { var compilation = context.Compilation; if (!context.Options.IsMSBuildPropertyValueTrue (MSBuildPropertyOptionNames.EnableTrimAnalyzer)) diff --git a/src/tools/illink/src/ILLink.RoslynAnalyzer/DynamicallyAccessedMembersAnalyzer.cs b/src/tools/illink/src/ILLink.RoslynAnalyzer/DynamicallyAccessedMembersAnalyzer.cs index 33a7651c907aab..1480279be518e4 100644 --- a/src/tools/illink/src/ILLink.RoslynAnalyzer/DynamicallyAccessedMembersAnalyzer.cs +++ b/src/tools/illink/src/ILLink.RoslynAnalyzer/DynamicallyAccessedMembersAnalyzer.cs @@ -80,9 +80,11 @@ void AddRange (DiagnosticId first, DiagnosticId last) public override void Initialize (AnalysisContext context) { + context.ConfigureGeneratedCodeAnalysis (GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); + if (!System.Diagnostics.Debugger.IsAttached) context.EnableConcurrentExecution (); - context.ConfigureGeneratedCodeAnalysis (GeneratedCodeAnalysisFlags.ReportDiagnostics); + context.RegisterCompilationStartAction (context => { var dataFlowAnalyzerContext = DataFlowAnalyzerContext.Create (context.Options, context.Compilation, RequiresAnalyzers.Value); if (!dataFlowAnalyzerContext.AnyAnalyzersEnabled) diff --git a/src/tools/illink/src/ILLink.RoslynAnalyzer/RequiresAnalyzerBase.cs b/src/tools/illink/src/ILLink.RoslynAnalyzer/RequiresAnalyzerBase.cs index 3e86d98c6bd50e..2cee966b2cf02a 100644 --- a/src/tools/illink/src/ILLink.RoslynAnalyzer/RequiresAnalyzerBase.cs +++ b/src/tools/illink/src/ILLink.RoslynAnalyzer/RequiresAnalyzerBase.cs @@ -34,9 +34,11 @@ public abstract class RequiresAnalyzerBase : DiagnosticAnalyzer public override void Initialize (AnalysisContext context) { + context.ConfigureGeneratedCodeAnalysis (GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); + if (!System.Diagnostics.Debugger.IsAttached) context.EnableConcurrentExecution (); - context.ConfigureGeneratedCodeAnalysis (GeneratedCodeAnalysisFlags.ReportDiagnostics); + context.RegisterCompilationStartAction (context => { var compilation = context.Compilation; if (!IsAnalyzerEnabled (context.Options)) From a153c19a34fa265a2ce4a5ce132aaffc42bb7f22 Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Fri, 27 Oct 2023 19:02:48 -0500 Subject: [PATCH 21/47] Use the native cross compilers on win-arm64 (#92443) From 785b488003a7245d81daa72f101a2c1f726cb832 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Fri, 27 Oct 2023 19:11:43 -0500 Subject: [PATCH 22/47] [main] Update dependencies from dnceng/internal/dotnet-optimization (#94030) * Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20231025.5 optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR From Version 1.0.0-prerelease.23521.3 -> To Version 1.0.0-prerelease.23525.5 * Update dependencies from https://dev.azure.com/dnceng/internal/_git/dotnet-optimization build 20231025.5 optimization.linux-arm64.MIBC.Runtime , optimization.linux-x64.MIBC.Runtime , optimization.windows_nt-arm64.MIBC.Runtime , optimization.windows_nt-x64.MIBC.Runtime , optimization.windows_nt-x86.MIBC.Runtime , optimization.PGO.CoreCLR From Version 1.0.0-prerelease.23521.3 -> To Version 1.0.0-prerelease.23525.5 --------- Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 24 ++++++++++++------------ eng/Versions.props | 12 ++++++------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 5093503afa632c..2708cebcdc6245 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -334,21 +334,21 @@ https://github.com/dotnet/arcade 30d512ae84149b306b6c160ed83dc433fc9f9cae - + https://dev.azure.com/dnceng/internal/_git/dotnet-optimization - e5d9d61ccb43b9135a7471429b338aa7332e2eb5 + d80a861521d84459c9290c31127b2a0ce511f279 - + https://dev.azure.com/dnceng/internal/_git/dotnet-optimization - e5d9d61ccb43b9135a7471429b338aa7332e2eb5 + d80a861521d84459c9290c31127b2a0ce511f279 - + https://dev.azure.com/dnceng/internal/_git/dotnet-optimization - e5d9d61ccb43b9135a7471429b338aa7332e2eb5 + d80a861521d84459c9290c31127b2a0ce511f279 - + https://dev.azure.com/dnceng/internal/_git/dotnet-optimization - e5d9d61ccb43b9135a7471429b338aa7332e2eb5 + d80a861521d84459c9290c31127b2a0ce511f279 https://github.com/dotnet/hotreload-utils @@ -384,13 +384,13 @@ c613f005ed115f90c3ec79253bfe1870e4c7cdb2 - + https://dev.azure.com/dnceng/internal/_git/dotnet-optimization - e5d9d61ccb43b9135a7471429b338aa7332e2eb5 + d80a861521d84459c9290c31127b2a0ce511f279 - + https://dev.azure.com/dnceng/internal/_git/dotnet-optimization - e5d9d61ccb43b9135a7471429b338aa7332e2eb5 + d80a861521d84459c9290c31127b2a0ce511f279 diff --git a/eng/Versions.props b/eng/Versions.props index c88a1ee96fa135..c48917407f1b23 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -153,12 +153,12 @@ 8.0.0-beta.23516.1 8.0.0-beta.23516.1 - 1.0.0-prerelease.23521.3 - 1.0.0-prerelease.23521.3 - 1.0.0-prerelease.23521.3 - 1.0.0-prerelease.23521.3 - 1.0.0-prerelease.23521.3 - 1.0.0-prerelease.23521.3 + 1.0.0-prerelease.23525.5 + 1.0.0-prerelease.23525.5 + 1.0.0-prerelease.23525.5 + 1.0.0-prerelease.23525.5 + 1.0.0-prerelease.23525.5 + 1.0.0-prerelease.23525.5 16.11.27-beta1.23180.1 2.0.0-beta4.23307.1 From 2e4878953076f0b0ffc4d8e7bf27ff5de7ef30d3 Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Fri, 27 Oct 2023 19:21:53 -0500 Subject: [PATCH 23/47] Build the net8 workload msis (#94125) --- eng/pipelines/mono/templates/workloads-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/eng/pipelines/mono/templates/workloads-build.yml b/eng/pipelines/mono/templates/workloads-build.yml index 4a50ed665e24ee..b30b8889f286a7 100644 --- a/eng/pipelines/mono/templates/workloads-build.yml +++ b/eng/pipelines/mono/templates/workloads-build.yml @@ -65,6 +65,7 @@ jobs: IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NET.Workload.Mono.ToolChain.Current.Manifest*.nupkg IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NET.Workload.Mono.ToolChain.net6.Manifest*.nupkg IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NET.Workload.Mono.ToolChain.net7.Manifest*.nupkg + IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NET.Workload.Mono.ToolChain.net8.Manifest*.nupkg IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NET.Runtime.MonoTargets.Sdk*.nupkg IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NET.Runtime.MonoAOTCompiler.Task*.nupkg IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NET.Runtime.WebAssembly.Sdk*.nupkg From c2608bdfc9450330a908778d0d2588ca51e1d545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Fi=C5=A1era?= Date: Sat, 28 Oct 2023 02:49:49 +0200 Subject: [PATCH 24/47] [browser][Wasm.Build.Tests] Use trimmer friendly JSON serialization (#94034) * Use trimmer friendly JSON serialization * CI: trigger only WBT on testasset changes * CI: don't trigger non-wbt wasm jobs on testassets changes --------- Co-authored-by: Ankit Jain --- eng/pipelines/common/evaluate-default-paths.yml | 3 +++ .../wasm/testassets/WasmBasicTestApp/LazyLoadingTest.cs | 8 +++++++- .../testassets/WasmBasicTestApp/WasmBasicTestApp.csproj | 1 - 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/eng/pipelines/common/evaluate-default-paths.yml b/eng/pipelines/common/evaluate-default-paths.yml index ac43f54499e9b1..bd84175767331e 100644 --- a/eng/pipelines/common/evaluate-default-paths.yml +++ b/eng/pipelines/common/evaluate-default-paths.yml @@ -226,6 +226,7 @@ jobs: - src/mono/wasm/host/* - src/mono/wasm/runtime/* - src/mono/wasm/templates/* + - src/mono/wasm/testassets/* - src/mono/wasm/Wasm.Build.Tests/* - ${{ parameters._const_paths._wasm_chrome }} - ${{ parameters._const_paths._wasm_src_native }} @@ -266,6 +267,7 @@ jobs: - src/mono/wasi/* - src/mono/wasm/debugger/* - src/mono/wasm/host/* + - src/mono/wasm/testassets/* - src/mono/wasm/Wasm.Build.Tests/* - ${{ parameters._const_paths._wasm_pipelines }} - ${{ parameters._const_paths._always_exclude }} @@ -285,6 +287,7 @@ jobs: - src/mono/mono/component/mini-wasm-debugger.c - src/mono/wasm/debugger/* - src/mono/wasm/host/* + - src/mono/wasm/testassets/* - src/mono/wasm/Wasm.Build.Tests/* - src/mono/nuget/Microsoft.NET.Runtime* src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/* diff --git a/src/mono/wasm/testassets/WasmBasicTestApp/LazyLoadingTest.cs b/src/mono/wasm/testassets/WasmBasicTestApp/LazyLoadingTest.cs index 0d68b1216816c3..cdf52cb98d31c8 100644 --- a/src/mono/wasm/testassets/WasmBasicTestApp/LazyLoadingTest.cs +++ b/src/mono/wasm/testassets/WasmBasicTestApp/LazyLoadingTest.cs @@ -3,6 +3,7 @@ using System; using System.Text.Json; +using System.Text.Json.Serialization; using System.Runtime.InteropServices.JavaScript; public partial class LazyLoadingTest @@ -12,9 +13,14 @@ public static void Run() { // System.Text.Json is marked as lazy loaded in the csproj ("BlazorWebAssemblyLazyLoad"), this method can be called only after the assembly is lazy loaded // In the test case it is done in the JS before call to this method - var text = JsonSerializer.Serialize(new Person("John", "Doe")); + var text = JsonSerializer.Serialize(new Person("John", "Doe"), PersonJsonSerializerContext.Default.Person); TestOutput.WriteLine(text); } public record Person(string FirstName, string LastName); + + [JsonSerializable(typeof(Person))] + internal partial class PersonJsonSerializerContext : JsonSerializerContext + { + } } diff --git a/src/mono/wasm/testassets/WasmBasicTestApp/WasmBasicTestApp.csproj b/src/mono/wasm/testassets/WasmBasicTestApp/WasmBasicTestApp.csproj index 761ac6354ce861..33858b9a6a755f 100644 --- a/src/mono/wasm/testassets/WasmBasicTestApp/WasmBasicTestApp.csproj +++ b/src/mono/wasm/testassets/WasmBasicTestApp/WasmBasicTestApp.csproj @@ -4,7 +4,6 @@ browser-wasm Exe true - true From 039631a8e9f62a9a9ee72edc6c7896d58722e491 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Fri, 27 Oct 2023 23:26:50 -0700 Subject: [PATCH 25/47] Remove the JIT/CheckProjects tool (#94121) Fixes #76087 --- src/tests/JIT/CheckProjects/CheckProjects.cs | 502 ------------------ .../JIT/CheckProjects/CheckProjects.csproj | 13 - src/tests/issues.targets | 14 - 3 files changed, 529 deletions(-) delete mode 100644 src/tests/JIT/CheckProjects/CheckProjects.cs delete mode 100644 src/tests/JIT/CheckProjects/CheckProjects.csproj diff --git a/src/tests/JIT/CheckProjects/CheckProjects.cs b/src/tests/JIT/CheckProjects/CheckProjects.cs deleted file mode 100644 index 484caa870f82f0..00000000000000 --- a/src/tests/JIT/CheckProjects/CheckProjects.cs +++ /dev/null @@ -1,502 +0,0 @@ -// 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.Collections.Generic; -using System.Linq; -using System.IO; -using System.Xml.Serialization; -using System.Text; -using System.Xml.Linq; - -// Verify that jit test project files specify DebugType properly. -// Returns error status (-1) if any project files are in error. - -internal class ScanProjectFiles -{ - private static bool s_showNeedsFixOnly = true; - private static bool s_tryAndFix = true; - private static int s_projCount = 0; - private static int s_needsFixCount = 0; - private static int s_fixedCount = 0; - - private static int Main(string[] args) - { - // If invoked w/o args, locate jit test project dir from - // CORE_ROOT, and scan only. - // - // If invoked w args, locate and try to fix project files. - string projectRoot = null; - - if (args.Length == 0) - { - s_tryAndFix = false; - - // CORE_ROOT should be something like - // c:\repos\coreclr\artifacts\tests\coreclr\windows.x64.Checked\Tests\Core_Root - // or - // D:\j\workspace\x64_release_w---0575cb46\artifacts\tests\windows.x64.Release\Tests\Core_Root - // We want - // c:\repos\coreclr\tests\src\JIT - string coreRoot = System.Environment.GetEnvironmentVariable("CORE_ROOT"); - - if (coreRoot == null) - { - Console.WriteLine("CORE_ROOT must be set"); - return -1; - } - - int binIndex = coreRoot.IndexOf("bin"); - - if (binIndex < 0) - { - Console.WriteLine("No bin directory found in CORE_ROOT path `{0}`," + - " so no checking will be performed.", coreRoot); - return 100; - } - - string repoRoot = coreRoot.Substring(0, binIndex); - - projectRoot = Path.Combine(repoRoot, "tests", "src", "JIT"); - } - else if (args.Length != 1) - { - Console.WriteLine("Usage: CheckProjects []"); - Console.WriteLine("If optional is specified," - + " all project files under will be scanned and updates will be attempted."); - return -1; - } - else - { - projectRoot = args[0]; - } - - Console.WriteLine("Scanning{0}projects under {1}", - s_tryAndFix ? " and attempting to update " : " ", projectRoot); - - if (!Directory.Exists(projectRoot)) - { - Console.WriteLine("Project directory does not exist, so no checking will be performed."); - return 100; - } - - DirectoryInfo projectRootDir = new DirectoryInfo(projectRoot); - - foreach (FileInfo f in projectRootDir.GetFiles("*.*proj", SearchOption.AllDirectories)) - { - if (!f.FullName.Contains("JIT\\config") && !f.FullName.Contains("JIT/config")) - { - ParseAndUpdateProj(f.FullName, s_tryAndFix); - } - - } - - Console.WriteLine("{0} projects, {1} needed fixes, {2} were fixed", - s_projCount, s_needsFixCount, s_fixedCount); - - // Return error status if there are unfixed projects - return (s_needsFixCount == 0 ? 100 : -1); - } - - // Load up a project file and look for key attributes. - // Optionally try and update. Return true if modified. - private static bool ParseAndUpdateProj(string projFile, bool tryUpdate) - { - s_projCount++; - // Guess at expected settings by looking for suffixes... - string projFileBase = Path.GetFileNameWithoutExtension(projFile); - - bool isDebugTypeTest = projFileBase.EndsWith("_d") || projFileBase.EndsWith("_do") || projFileBase.EndsWith("_dbg"); - bool isRelTypeTest = projFileBase.EndsWith("_r") || projFileBase.EndsWith("_ro") || projFileBase.EndsWith("_rel"); - bool isNotOptTypeTest = projFileBase.EndsWith("_r") || projFileBase.EndsWith("_d"); - bool isOptTypeTest = projFileBase.EndsWith("_ro") || projFileBase.EndsWith("_do") || projFileBase.EndsWith("_opt"); - bool isSpecificTest = isDebugTypeTest || isRelTypeTest; - bool updated = false; - - try - { - XElement root = XElement.Load(projFile); - string nn = "{" + root.Name.NamespaceName + "}"; - IEnumerable props = from el in root.Descendants(nn + "PropertyGroup") select el; - bool hasReleaseCondition = false; - bool hasDebugCondition = false; - string oddness = null; - string optimizeOddness = null; - string debugVal = null; - string optimizeVal = null; - bool needsFix = false; - XElement bestPropertyGroupNode = null; - XElement lastPropertyGroupNode = null; - List debugTypePropertyGroupNodes = new List(); - List optimizePropertyGroupNodes = new List(); - - foreach (XElement prop in props) - { - lastPropertyGroupNode = prop; - XAttribute condition = prop.Attribute("Condition"); - bool isReleaseCondition = false; - bool isDebugCondition = false; - if (condition != null) - { - isReleaseCondition = condition.Value.Contains("Release"); - isDebugCondition = condition.Value.Contains("Debug"); - - if (isReleaseCondition || isDebugCondition) - { - bestPropertyGroupNode = prop; - } - } - - XElement debugType = prop.Element(nn + "DebugType"); - - if (debugType != null) - { - debugTypePropertyGroupNodes.Add(prop); - - // If appears multiple times, all should agree. - string newDebugVal = debugType.Value; - if (newDebugVal.Equals("")) - { - newDebugVal = "blank"; - } - - if (debugVal != null) - { - if (!debugType.Value.Equals(newDebugVal)) - { - oddness = "ConflictingDebugType"; - } - } - - debugVal = newDebugVal; - - if (condition != null) - { - if (isReleaseCondition == isDebugCondition) - { - oddness = "RelDebugDisagree"; - } - - hasReleaseCondition |= isReleaseCondition; - hasDebugCondition |= isDebugCondition; - } - else - { - if (hasReleaseCondition || hasDebugCondition) - { - oddness = "CondAndUncond"; - } - } - } - - XElement optimize = prop.Element(nn + "Optimize"); - if (optimize != null) - { - optimizePropertyGroupNodes.Add(optimize); - string newOptimizeVal = optimize.Value; - if (string.IsNullOrWhiteSpace(newOptimizeVal)) - { - newOptimizeVal = "False"; - } - - if (optimizeVal != null && !optimizeVal.Equals(newOptimizeVal, StringComparison.InvariantCultureIgnoreCase)) - { - optimizeOddness = "MultipleConflictValues"; - } - - optimizeVal = newOptimizeVal; - } - } - - if (oddness == null) - { - if (hasReleaseCondition && !hasDebugCondition) - { - oddness = "RelButNotDbg"; - } - else if (!hasReleaseCondition && hasDebugCondition) - { - oddness = "DbgButNotRel"; - } - } - - bool hasDebugType = debugTypePropertyGroupNodes.Count > 0; - bool hasOptimize = optimizePropertyGroupNodes.Count > 0; - - // Analyze suffix convention mismatches - string suffixNote = "SuffixNone"; - - if (isSpecificTest) - { - if (!hasDebugType || oddness != null || hasReleaseCondition || hasDebugCondition) - { - suffixNote = "SuffixProblem"; - needsFix = true; - } - else - { - if (isRelTypeTest) - { - if (debugVal.Equals("pdbonly", StringComparison.OrdinalIgnoreCase) - || debugVal.Equals("none", StringComparison.OrdinalIgnoreCase) - || debugVal.Equals("blank", StringComparison.OrdinalIgnoreCase) - || debugVal.Equals("embedded", StringComparison.OrdinalIgnoreCase)) - { - suffixNote = "SuffixRelOk"; - } - else - { - suffixNote = "SuffixRelTestNot"; - needsFix = true; - } - } - else if (isDebugTypeTest) - { - if (debugVal.Equals("full", StringComparison.OrdinalIgnoreCase)) - { - suffixNote = "SuffixDbgOk"; - } - else - { - suffixNote = "SuffixDbgTestNot"; - needsFix = true; - } - } - } - } - - if (!hasDebugType) - { - needsFix = true; - } - - if (oddness != null) - { - needsFix = true; - } - - if (needsFix || !s_showNeedsFixOnly) - { - if (!hasDebugType) - { - Console.WriteLine("{0} DebugType-n/a-{1}", projFile, suffixNote); - } - else if (oddness != null) - { - Console.WriteLine("{0} DebugType-Odd-{1}-{2}", projFile, oddness, suffixNote); - } - else if (hasReleaseCondition || hasDebugCondition) - { - Console.WriteLine("{0} DebugType-{1}-Conditional-{2}", projFile, debugVal, suffixNote); - } - else - { - Console.WriteLine("{0} DebugType-{1}-Unconditional-{2}", projFile, debugVal, suffixNote); - } - } - - if (optimizeOddness != null) - { - needsFix = true; - } - - if (!needsFix) - { - if (isOptTypeTest) - { - needsFix = DetermineIfOptimizeSettingNeedsFix(true, optimizeVal); - } - else if (isNotOptTypeTest) - { - needsFix = DetermineIfOptimizeSettingNeedsFix(false, optimizeVal); - } - } - - if (needsFix || !s_showNeedsFixOnly) - { - if (!hasOptimize) - { - Console.WriteLine("{0} Optimize-n/a", projFile); - } - else if (optimizeOddness != null) - { - Console.WriteLine("{0} Optimize-Odd-{1}", projFile, optimizeOddness); - } - else - { - Console.WriteLine("{0} Optimize-{1}-Conflict", projFile, optimizeVal); - } - } - - if (needsFix) - { - s_needsFixCount++; - } - - // If a fix is needed, give it a shot! - if (!needsFix || !tryUpdate) - { - return false; - } - - // Add new elements just after the conditional rel/debug - // property group entries, if possible. - if (bestPropertyGroupNode == null) - { - bestPropertyGroupNode = lastPropertyGroupNode; - } - - if (bestPropertyGroupNode == null) - { - Console.WriteLine(".... no prop group, can't fix"); - return false; - } - - if (debugTypePropertyGroupNodes.Count == 0) - { - // Fix projects that don't mention debug type at all. - Console.WriteLine(".... no DebugType, attempting fix ...."); - - XElement newPropGroup = new XElement(nn + "PropertyGroup", - new XElement(nn + "DebugType", isDebugTypeTest ? "Full" : "PdbOnly"), - new XElement(nn + "Optimize", isNotOptTypeTest ? "False" : "True")); - - bestPropertyGroupNode.AddAfterSelf(newPropGroup); - - // Write out updated project file - using (StreamWriter outFile = File.CreateText(projFile)) - { - root.Save(outFile); - updated = true; - s_fixedCount++; - } - } - else if (debugTypePropertyGroupNodes.Count == 1) - { - // Fix projects with just one mention of debug type. - Console.WriteLine(".... one DebugType, attempting fix ...."); - - XElement prop = debugTypePropertyGroupNodes.First(); - XAttribute condition = prop.Attribute("Condition"); - - // If there is no condition then this is likely a suffix mismatch - if ((condition == null) && suffixNote.Equals("SuffixDbgTestNot")) - { - Console.WriteLine("Unconditional debug test w/ suffix issue"); - - // Do case analysis of suffix and debugType/Opt, then update. - XElement debugType = prop.Element(nn + "DebugType"); - XElement optimize = prop.Element(nn + "Optimize"); - - // We know DebugType is set, but Optimize may not be. - if (optimize == null) - { - optimize = new XElement(nn + "Optimize"); - prop.Add(optimize); - } - - bool modified = false; - - if (isDebugTypeTest && !isOptTypeTest) - { - // "d" suffix -- - debugType.Value = "full"; - optimize.Value = "False"; - modified = true; - } - else if (isDebugTypeTest && isOptTypeTest) - { - // "do" suffix -- - debugType.Value = "full"; - optimize.Value = "True"; - modified = true; - } - - if (modified) - { - // Write out updated project file - using (StreamWriter outFile = File.CreateText(projFile)) - { - root.Save(outFile); - updated = true; - s_fixedCount++; - } - } - } - else - { - XElement newPropGroup = new XElement(prop); - newPropGroup.RemoveAttributes(); - prop.RemoveNodes(); - bestPropertyGroupNode.AddAfterSelf(newPropGroup); - - // Write out updated project file - using (StreamWriter outFile = File.CreateText(projFile)) - { - root.Save(outFile); - updated = true; - s_fixedCount++; - } - } - } - else - { - // Multiple property groups specifying DebugType. Remove any that are conditional. - Console.WriteLine(".... multiple DebugTypes, attempting fix ...."); - bool modified = false; - foreach (XElement prop in debugTypePropertyGroupNodes) - { - XAttribute condition = prop.Attribute("Condition"); - - if (condition != null) - { - prop.RemoveNodes(); - modified = true; - } - } - - if (modified) - { - // Write out updated project file - using (StreamWriter outFile = File.CreateText(projFile)) - { - root.Save(outFile); - updated = true; - s_fixedCount++; - } - } - } - } - catch (Exception e) - { - Console.WriteLine("{0} DebugType-fail {1}", projFile, e.Message); - } - - return updated; - } - - /// - /// Determines if optimize setting needs to fix. - /// - /// Whether a optimization is specified. This is the baseline for checking. - /// The optimize value in the project file's property. - /// True if a fix is needed. Otherwise false. - private static bool DetermineIfOptimizeSettingNeedsFix(bool isOptType, string optimizeVal) - { - if (isOptType && optimizeVal == null) - { - return true; - } - - if (optimizeVal != null) - { - string expectedOptimizeValue = isOptType.ToString(); - if (!optimizeVal.Equals(expectedOptimizeValue, StringComparison.InvariantCultureIgnoreCase)) - { - return true; - } - } - - return false; - } -} diff --git a/src/tests/JIT/CheckProjects/CheckProjects.csproj b/src/tests/JIT/CheckProjects/CheckProjects.csproj deleted file mode 100644 index 6aa1011be68b7b..00000000000000 --- a/src/tests/JIT/CheckProjects/CheckProjects.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - true - - - pdbonly - true - - - - - diff --git a/src/tests/issues.targets b/src/tests/issues.targets index 3c54496c11966c..83e6ae2671eced 100644 --- a/src/tests/issues.targets +++ b/src/tests/issues.targets @@ -2443,10 +2443,6 @@ This test includes an intentionally-invalid UnmanagedCallersOnly method. Invalid UnmanagedCallersOnly methods cause failures at AOT-time. - - needs triage - - https://github.com/dotnet/runtime/issues/75359 @@ -3020,9 +3016,6 @@ https://github.com/dotnet/runtime/issues/41472 - - tries to access project source code - not supported on mobile and wasm - https://github.com/dotnet/runtime/issues/56814 @@ -3338,9 +3331,6 @@ needs triage - - Tries to access project source code - not supported on mobile and wasm - https://github.com/dotnet/runtime/issues/73539 @@ -3596,10 +3586,6 @@ System.IO.FileNotFoundException: Could not load file or assembly 'xunit.performance.core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=67066efe964d3b03' or one of its dependencies. - - Tries to access project source code - not supported on mobile and wasm - - needs triage From 654d5cd2ceb0693b3888e0a5a490a8f1a2ba356a Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 28 Oct 2023 09:25:01 +0200 Subject: [PATCH 26/47] [main] Update dependencies from dotnet/arcade (#94111) * Update dependencies from https://github.com/dotnet/arcade build 20231027.3 Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XUnitAssert , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions From Version 9.0.0-beta.23527.1 -> To Version 9.0.0-beta.23527.3 * React to xliff-tasks -> arcade repo consolidation --------- Co-authored-by: dotnet-maestro[bot] Co-authored-by: Viktor Hofer --- eng/Version.Details.xml | 83 ++++++++++++++++++++--------------------- eng/Versions.props | 32 ++++++++-------- global.json | 6 +-- 3 files changed, 60 insertions(+), 61 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 2708cebcdc6245..9bead2c750d95c 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -107,83 +107,82 @@ - + https://github.com/dotnet/arcade - 30d512ae84149b306b6c160ed83dc433fc9f9cae + 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 - - https://github.com/dotnet/xliff-tasks - 0140d3d4a520d602a0721422eb656b78f16b5fba - + + https://github.com/dotnet/arcade + 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 - + https://github.com/dotnet/arcade - 30d512ae84149b306b6c160ed83dc433fc9f9cae + 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 - + https://github.com/dotnet/arcade - 30d512ae84149b306b6c160ed83dc433fc9f9cae + 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 - + https://github.com/dotnet/arcade - 30d512ae84149b306b6c160ed83dc433fc9f9cae + 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 - + https://github.com/dotnet/arcade - 30d512ae84149b306b6c160ed83dc433fc9f9cae + 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 - + https://github.com/dotnet/arcade - 30d512ae84149b306b6c160ed83dc433fc9f9cae + 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 - + https://github.com/dotnet/arcade - 30d512ae84149b306b6c160ed83dc433fc9f9cae + 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 - + https://github.com/dotnet/arcade - 30d512ae84149b306b6c160ed83dc433fc9f9cae + 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 - + https://github.com/dotnet/arcade - 30d512ae84149b306b6c160ed83dc433fc9f9cae + 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 - + https://github.com/dotnet/arcade - 30d512ae84149b306b6c160ed83dc433fc9f9cae + 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 - + https://github.com/dotnet/arcade - 30d512ae84149b306b6c160ed83dc433fc9f9cae + 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 - + https://github.com/dotnet/arcade - 30d512ae84149b306b6c160ed83dc433fc9f9cae + 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 - + https://github.com/dotnet/arcade - 30d512ae84149b306b6c160ed83dc433fc9f9cae + 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 - + https://github.com/dotnet/arcade - 30d512ae84149b306b6c160ed83dc433fc9f9cae + 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 - + https://github.com/dotnet/arcade - 30d512ae84149b306b6c160ed83dc433fc9f9cae + 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 - + https://github.com/dotnet/arcade - 30d512ae84149b306b6c160ed83dc433fc9f9cae + 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 - + https://github.com/dotnet/arcade - 30d512ae84149b306b6c160ed83dc433fc9f9cae + 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 - + https://github.com/dotnet/arcade - 30d512ae84149b306b6c160ed83dc433fc9f9cae + 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 https://github.com/dotnet/runtime-assets @@ -330,9 +329,9 @@ https://github.com/dotnet/xharness ab9528860ac51bb0aa6112fa2605b18c926594ef - + https://github.com/dotnet/arcade - 30d512ae84149b306b6c160ed83dc433fc9f9cae + 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 https://dev.azure.com/dnceng/internal/_git/dotnet-optimization diff --git a/eng/Versions.props b/eng/Versions.props index c48917407f1b23..a77ced224bea67 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -82,22 +82,22 @@ 9.0.100-alpha.1.23527.4 - 9.0.0-beta.23527.1 - 9.0.0-beta.23527.1 - 9.0.0-beta.23527.1 - 9.0.0-beta.23527.1 - 9.0.0-beta.23527.1 - 9.0.0-beta.23527.1 - 2.5.3-beta.23527.1 - 9.0.0-beta.23527.1 - 9.0.0-beta.23527.1 - 9.0.0-beta.23527.1 - 9.0.0-beta.23527.1 - 9.0.0-beta.23527.1 - 9.0.0-beta.23527.1 - 9.0.0-beta.23527.1 - 9.0.0-beta.23527.1 - 9.0.0-beta.23527.1 + 9.0.0-beta.23527.3 + 9.0.0-beta.23527.3 + 9.0.0-beta.23527.3 + 9.0.0-beta.23527.3 + 9.0.0-beta.23527.3 + 9.0.0-beta.23527.3 + 2.5.3-beta.23527.3 + 9.0.0-beta.23527.3 + 9.0.0-beta.23527.3 + 9.0.0-beta.23527.3 + 9.0.0-beta.23527.3 + 9.0.0-beta.23527.3 + 9.0.0-beta.23527.3 + 9.0.0-beta.23527.3 + 9.0.0-beta.23527.3 + 9.0.0-beta.23527.3 6.0.0-preview.1.102 diff --git a/global.json b/global.json index c9c3aec875b1cb..8c00d65dc01e5c 100644 --- a/global.json +++ b/global.json @@ -8,9 +8,9 @@ "dotnet": "8.0.100-rtm.23506.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.23527.1", - "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.23527.1", - "Microsoft.DotNet.SharedFramework.Sdk": "9.0.0-beta.23527.1", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.23527.3", + "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.23527.3", + "Microsoft.DotNet.SharedFramework.Sdk": "9.0.0-beta.23527.3", "Microsoft.Build.NoTargets": "3.7.0", "Microsoft.Build.Traversal": "3.4.0", "Microsoft.NET.Sdk.IL": "9.0.0-alpha.1.23523.1" From e30792635215453d30af195d2fdfdf2cb5565283 Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Sat, 28 Oct 2023 22:29:55 +0200 Subject: [PATCH 27/47] [main] Update dependencies from dotnet/emsdk dotnet/sdk dotnet/arcade (#94136) * Update dependencies from https://github.com/dotnet/arcade build 20231027.4 Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XliffTasks , Microsoft.DotNet.XUnitAssert , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions From Version 9.0.0-beta.23527.3 -> To Version 9.0.0-beta.23527.4 * Update dependencies from https://github.com/dotnet/emsdk build 20231028.1 Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport From Version 9.0.0-alpha.1.23523.3 -> To Version 9.0.0-alpha.1.23528.1 * Update dependencies from https://github.com/dotnet/sdk build 20231028.1 Microsoft.DotNet.ApiCompat.Task From Version 9.0.100-alpha.1.23527.4 -> To Version 9.0.100-alpha.1.23528.1 * Update dependencies from https://github.com/dotnet/arcade build 20231028.1 Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XliffTasks , Microsoft.DotNet.XUnitAssert , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions From Version 9.0.0-beta.23527.3 -> To Version 9.0.0-beta.23528.1 --------- Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 88 ++++++++++++++++++++--------------------- eng/Versions.props | 36 ++++++++--------- global.json | 6 +-- 3 files changed, 65 insertions(+), 65 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 9bead2c750d95c..34ca36bb236b8c 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -90,9 +90,9 @@ 45dd3a73dd5b64b010c4251303b3664bb30df029 - + https://github.com/dotnet/emsdk - cd13d57eccb71580227d612efc2fa27c5512aef4 + cdf33ffb6fc9e63c82cca2f67870e8e6cd16d741 @@ -107,82 +107,82 @@ - + https://github.com/dotnet/arcade - 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 + a4d49646dbac90883d3672f1c08134d84cca5707 - + https://github.com/dotnet/arcade - 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 + a4d49646dbac90883d3672f1c08134d84cca5707 - + https://github.com/dotnet/arcade - 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 + a4d49646dbac90883d3672f1c08134d84cca5707 - + https://github.com/dotnet/arcade - 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 + a4d49646dbac90883d3672f1c08134d84cca5707 - + https://github.com/dotnet/arcade - 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 + a4d49646dbac90883d3672f1c08134d84cca5707 - + https://github.com/dotnet/arcade - 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 + a4d49646dbac90883d3672f1c08134d84cca5707 - + https://github.com/dotnet/arcade - 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 + a4d49646dbac90883d3672f1c08134d84cca5707 - + https://github.com/dotnet/arcade - 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 + a4d49646dbac90883d3672f1c08134d84cca5707 - + https://github.com/dotnet/arcade - 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 + a4d49646dbac90883d3672f1c08134d84cca5707 - + https://github.com/dotnet/arcade - 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 + a4d49646dbac90883d3672f1c08134d84cca5707 - + https://github.com/dotnet/arcade - 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 + a4d49646dbac90883d3672f1c08134d84cca5707 - + https://github.com/dotnet/arcade - 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 + a4d49646dbac90883d3672f1c08134d84cca5707 - + https://github.com/dotnet/arcade - 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 + a4d49646dbac90883d3672f1c08134d84cca5707 - + https://github.com/dotnet/arcade - 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 + a4d49646dbac90883d3672f1c08134d84cca5707 - + https://github.com/dotnet/arcade - 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 + a4d49646dbac90883d3672f1c08134d84cca5707 - + https://github.com/dotnet/arcade - 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 + a4d49646dbac90883d3672f1c08134d84cca5707 - + https://github.com/dotnet/arcade - 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 + a4d49646dbac90883d3672f1c08134d84cca5707 - + https://github.com/dotnet/arcade - 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 + a4d49646dbac90883d3672f1c08134d84cca5707 - + https://github.com/dotnet/arcade - 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 + a4d49646dbac90883d3672f1c08134d84cca5707 https://github.com/dotnet/runtime-assets @@ -329,9 +329,9 @@ https://github.com/dotnet/xharness ab9528860ac51bb0aa6112fa2605b18c926594ef - + https://github.com/dotnet/arcade - 41cd1b7f72df41c8598a3be11d0dafbf98d4bc16 + a4d49646dbac90883d3672f1c08134d84cca5707 https://dev.azure.com/dnceng/internal/_git/dotnet-optimization @@ -378,9 +378,9 @@ https://github.com/dotnet/roslyn-analyzers b4ed6a3093cfd3c8d353214ce97aaa7d24cf2df1 - + https://github.com/dotnet/sdk - c613f005ed115f90c3ec79253bfe1870e4c7cdb2 + 6c69f67ac825da15ce05607d6a87b63693cac2a2 diff --git a/eng/Versions.props b/eng/Versions.props index a77ced224bea67..11c0d0bcae0497 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -80,24 +80,24 @@ 0.2.0 - 9.0.100-alpha.1.23527.4 + 9.0.100-alpha.1.23528.1 - 9.0.0-beta.23527.3 - 9.0.0-beta.23527.3 - 9.0.0-beta.23527.3 - 9.0.0-beta.23527.3 - 9.0.0-beta.23527.3 - 9.0.0-beta.23527.3 - 2.5.3-beta.23527.3 - 9.0.0-beta.23527.3 - 9.0.0-beta.23527.3 - 9.0.0-beta.23527.3 - 9.0.0-beta.23527.3 - 9.0.0-beta.23527.3 - 9.0.0-beta.23527.3 - 9.0.0-beta.23527.3 - 9.0.0-beta.23527.3 - 9.0.0-beta.23527.3 + 9.0.0-beta.23528.1 + 9.0.0-beta.23528.1 + 9.0.0-beta.23528.1 + 9.0.0-beta.23528.1 + 9.0.0-beta.23528.1 + 9.0.0-beta.23528.1 + 2.5.3-beta.23528.1 + 9.0.0-beta.23528.1 + 9.0.0-beta.23528.1 + 9.0.0-beta.23528.1 + 9.0.0-beta.23528.1 + 9.0.0-beta.23528.1 + 9.0.0-beta.23528.1 + 9.0.0-beta.23528.1 + 9.0.0-beta.23528.1 + 9.0.0-beta.23528.1 6.0.0-preview.1.102 @@ -230,7 +230,7 @@ Note: when the name is updated, make sure to update dependency name in eng/pipelines/common/xplat-setup.yml like - DarcDependenciesChanged.Microsoft_NET_Workload_Emscripten_Current_Manifest-9_0_100_Transport --> - 9.0.0-alpha.1.23523.3 + 9.0.0-alpha.1.23528.1 $(MicrosoftNETWorkloadEmscriptenCurrentManifest90100TransportVersion) 1.1.87-gba258badda diff --git a/global.json b/global.json index 8c00d65dc01e5c..c233650dc8b7f4 100644 --- a/global.json +++ b/global.json @@ -8,9 +8,9 @@ "dotnet": "8.0.100-rtm.23506.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.23527.3", - "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.23527.3", - "Microsoft.DotNet.SharedFramework.Sdk": "9.0.0-beta.23527.3", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.23528.1", + "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.23528.1", + "Microsoft.DotNet.SharedFramework.Sdk": "9.0.0-beta.23528.1", "Microsoft.Build.NoTargets": "3.7.0", "Microsoft.Build.Traversal": "3.4.0", "Microsoft.NET.Sdk.IL": "9.0.0-alpha.1.23523.1" From b6b00ec9f606eca0c47e01b30e74ee0d37d561ab Mon Sep 17 00:00:00 2001 From: Ahmet Ibrahim Aksoy Date: Sun, 29 Oct 2023 17:46:15 +0100 Subject: [PATCH 28/47] Disabling two socket tests (#93916) * Disable two socket tests * Revert close to dispose * Disable tests against one issue --- .../System.Net.Sockets/tests/FunctionalTests/Connect.cs | 6 ++++++ .../tests/FunctionalTests/TelemetryTest.cs | 1 + 2 files changed, 7 insertions(+) diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/Connect.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/Connect.cs index 7fbb92a2717428..f5b702d8ec77a6 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/Connect.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/Connect.cs @@ -137,6 +137,12 @@ public async Task Connect_AfterDisconnect_Fails() [InlineData("[::ffff:1.1.1.1]", true, false)] public async Task ConnectGetsCanceledByDispose(string addressString, bool useDns, bool owning) { + if (UsesSync && !PlatformDetection.IsWindows) + { + // [ActiveIssue("https://github.com/dotnet/runtime/issues/94149", TestPlatforms.Linux)] + return; + } + // Aborting sync operations for non-owning handles is not supported on Unix. if (!owning && UsesSync && !PlatformDetection.IsWindows) { diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/TelemetryTest.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/TelemetryTest.cs index 851b68288fd866..6886fa15e45d0b 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/TelemetryTest.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/TelemetryTest.cs @@ -187,6 +187,7 @@ await listener.RunWithCallbackAsync(e => events.Enqueue((e, e.ActivityId)), asyn }, connectMethod, useDnsEndPoint.ToString()).Dispose(); } + [ActiveIssue("https://github.com/dotnet/runtime/issues/94149", TestPlatforms.Linux)] [OuterLoop] [ConditionalTheory(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))] [SkipOnPlatform(TestPlatforms.OSX | TestPlatforms.FreeBSD, "Same as Connect.ConnectGetsCanceledByDispose")] From 1a19c09d12e8e876eca89c7286d28102c175dda6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Rylek?= Date: Mon, 30 Oct 2023 02:12:11 +0100 Subject: [PATCH 29/47] Convert all tests under baseservices to the merged test infrastructure (#91560) * Remove unused args parameter from the Main method in 349379.cs * Convert stackoverflowtester Main to individual test entrypoints * Don't complain about Exe type for test components Some tests have exe components - if these aren't marked with the CLRTestKind BuildAndRun, we shouldn't complain about them. Thanks Tomas * Make dynamicmethodliveness and ParallelCrash merge-friendly * Adjust the Tier1StackTrace test to be tolerant to merged wrappers * Convert baseservices/exceptions to merged mode * Remove constant return value 100 from the test test448035 * Make UnsafeAccessorTests owner class public * Make methods in RuntimeConfiguration/TestConfig public * Make TieredCompilation/BasicTest public * Remove unused exit code of runmoduleconstructor * Remove unused exit code of RuntimeHelperTests * Fix visibility in multidimarray/enum test * Fix visibility in TestCallingConventions test * Fix visibility in CriticalFinalizer test * Simplify RuntimeConfiguration/TestConfig * Clean up TieredCompilation tests * Convert istypeequivalent to use ConditionalFact clauses * Fix visibility in RuntimeHelpersTests * Add CoreCLRTestLibrary as a dependency of istypeequivalent * Fix merged behavior of test448035 * Fix entrypoint in 305155 * Modify TestConfig to use a separate TestConfigTester app * Additional fixes to TestConfig / TestConfigTester * Mechanically merge all remaining tests under baseservices * Fix BasicTestWithMcj, address initial Mark's PR feedback * Remove superfluous OutputType=Library annotations per Marks' PR feedback * Fix the baseservices/exceptions/unhandled test * Fix stackoverflow3 and unhandled exception tests * Remove unnecessary check from Directory.Build.targets * Fix stackoverflowtester per Mark's PR feedback --- .../baseservices/CET/CheckCETPresence.cs | 6 +- .../baseservices/CET/CheckCETPresence.csproj | 1 - src/tests/baseservices/Directory.Build.props | 11 + .../RuntimeConfiguration/TestConfig.cs | 100 +------ .../RuntimeConfiguration/TestConfig.csproj | 12 +- .../RuntimeConfiguration/TestConfigTester.cs | 83 ++++++ .../TestConfigTester.csproj | 21 ++ .../TieredCompilation/BasicTest.cs | 8 +- .../TieredCompilation/BasicTestWithMcj.cs | 3 +- .../TieredCompilation/BasicTestWithMcj.csproj | 6 + .../BasicTest_DefaultMode.csproj | 3 +- .../BasicTest_DefaultMode_R2r.csproj | 3 +- .../BasicTest_QuickJitForLoopsOff.csproj | 3 +- .../BasicTest_QuickJitForLoopsOff_R2r.csproj | 3 +- .../BasicTest_QuickJitForLoopsOn.csproj | 3 +- .../BasicTest_QuickJitForLoopsOn_R2r.csproj | 3 +- .../BasicTest_QuickJitOff.csproj | 3 +- .../BasicTest_QuickJitOff_R2r.csproj | 3 +- .../BasicTest_QuickJitOn.csproj | 3 +- .../BasicTest_QuickJitOn_R2r.csproj | 3 +- .../McjRecorderTimeoutBeforeStop.cs | 7 +- .../McjRecorderTimeoutBeforeStop.csproj | 3 +- .../TieredVtableMethodTests.cs | 4 +- .../TieredVtableMethodTests.csproj | 3 +- src/tests/baseservices/baseservices.csproj | 9 + .../callconvs/CallFunctionPointers.ilproj | 3 - .../callconvs/TestCallingConventions.cs | 5 +- .../callconvs/TestCallingConventions.csproj | 3 +- .../FixedAddressValueType.cs | 4 +- .../FixedAddressValueType.csproj | 3 +- .../DefaultImplementationsOfInterfaces.il | 4 +- .../DefaultImplementationsOfInterfaces.ilproj | 3 +- .../RuntimeHelpers/RuntimeHelpersTests.cs | 18 +- .../RuntimeHelpers/RuntimeHelpersTests.csproj | 3 +- .../RuntimeWrappedException.cs | 6 +- .../RuntimeWrappedException.csproj | 3 +- .../StringThrower.ilproj | 3 - .../UnsafeAccessors/UnsafeAccessorsTests.cs | 2 +- .../UnsafeAccessorsTests.csproj | 3 +- .../Dev10_535767.csproj | 3 +- .../dynamicobjectproperties/TestAPIs.csproj | 3 +- .../dynamicobjectproperties/TestGC.csproj | 3 +- .../TestOverrides.csproj | 3 +- .../dynamicobjectproperties/dev10_535767.cs | 6 +- .../dynamicobjectproperties/test448035.cs | 10 +- .../dynamicobjectproperties/test448035.csproj | 1 - .../dynamicobjectproperties/testapis.cs | 4 +- .../dynamicobjectproperties/testgc.cs | 4 +- .../dynamicobjectproperties/testoverrides.cs | 4 +- .../modulector/moduleCctor.ilproj | 3 - .../modulector/runmoduleconstructor.cs | 10 +- .../modulector/runmoduleconstructor.csproj | 3 +- .../AccessViolationException/AVException01.cs | 4 +- .../AVException01.csproj | 3 +- .../AccessViolationException/AVException02.cs | 4 +- .../AVException02.csproj | 3 +- .../AccessViolationException/AVException03.cs | 4 +- .../AVException03.csproj | 3 +- .../exceptions/Directory.Build.props | 10 + .../StackTracePreserveTests.cs | 6 +- .../StackTracePreserveTests.csproj | 3 +- .../WindowsEventLog_TargetUnix.csproj | 6 +- .../WindowsEventLog_TargetWindows.csproj | 6 +- .../exceptions/baseservices-exceptions.csproj | 7 + .../exceptions/generics/GenericExceptions.cs | 4 +- .../generics/GenericExceptions.csproj | 3 +- .../generics/GenericExceptions01.csproj | 3 +- .../generics/GenericExceptions02.csproj | 3 +- .../generics/GenericExceptions03.csproj | 3 +- .../generics/GenericExceptions04.csproj | 3 +- .../generics/GenericExceptions05.csproj | 3 +- .../generics/GenericExceptions06.csproj | 3 +- .../generics/GenericExceptions07.csproj | 3 +- .../generics/GenericExceptions08.csproj | 3 +- .../generics/TypeParameter001.csproj | 3 +- .../generics/TypeParameter002.csproj | 3 +- .../generics/TypeParameter003.csproj | 3 +- .../generics/TypeParameter004.csproj | 3 +- .../generics/TypeParameter005.csproj | 3 +- .../generics/TypeParameter006.csproj | 3 +- .../generics/TypeParameter007.csproj | 3 +- .../generics/TypeParameter008.csproj | 3 +- .../generics/TypeParameter009.csproj | 3 +- .../generics/TypeParameter010.csproj | 3 +- .../generics/TypeParameter011.csproj | 3 +- .../generics/TypeParameter012.csproj | 3 +- .../generics/TypeParameter013.csproj | 3 +- .../generics/TypeParameter014.csproj | 3 +- .../generics/TypeParameter015.csproj | 3 +- .../generics/TypeParameter016.csproj | 3 +- .../generics/TypeParameter017.csproj | 3 +- .../generics/TypeParameter018.csproj | 3 +- .../generics/genericexceptions01.cs | 4 +- .../generics/genericexceptions02.cs | 4 +- .../generics/genericexceptions03.cs | 4 +- .../generics/genericexceptions04.cs | 4 +- .../generics/genericexceptions05.cs | 4 +- .../generics/genericexceptions06.cs | 4 +- .../generics/genericexceptions07.cs | 4 +- .../generics/genericexceptions08.cs | 4 +- .../exceptions/generics/nested-try-catch01.cs | 4 +- .../generics/nested-try-catch01.csproj | 3 +- .../exceptions/generics/nested-try-catch02.cs | 4 +- .../generics/nested-try-catch02.csproj | 3 +- .../exceptions/generics/nested-try-catch03.cs | 4 +- .../generics/nested-try-catch03.csproj | 3 +- .../exceptions/generics/nested-try-catch04.cs | 4 +- .../generics/nested-try-catch04.csproj | 3 +- .../exceptions/generics/nested-try-catch05.cs | 4 +- .../generics/nested-try-catch05.csproj | 3 +- .../exceptions/generics/nested-try-catch06.cs | 4 +- .../generics/nested-try-catch06.csproj | 3 +- .../exceptions/generics/nested-try-catch07.cs | 4 +- .../generics/nested-try-catch07.csproj | 3 +- .../exceptions/generics/nested-try-catch08.cs | 4 +- .../generics/nested-try-catch08.csproj | 3 +- .../exceptions/generics/nested-try-catch09.cs | 4 +- .../generics/nested-try-catch09.csproj | 3 +- .../exceptions/generics/nested-try-catch10.cs | 4 +- .../generics/nested-try-catch10.csproj | 3 +- .../generics/try-catch-finally-struct01.cs | 4 +- .../try-catch-finally-struct01.csproj | 3 +- .../generics/try-catch-finally-struct02.cs | 4 +- .../try-catch-finally-struct02.csproj | 3 +- .../generics/try-catch-finally-struct03.cs | 4 +- .../try-catch-finally-struct03.csproj | 3 +- .../generics/try-catch-finally01.cs | 4 +- .../generics/try-catch-finally01.csproj | 3 +- .../generics/try-catch-finally02.cs | 4 +- .../generics/try-catch-finally02.csproj | 3 +- .../generics/try-catch-finally03.cs | 4 +- .../generics/try-catch-finally03.csproj | 3 +- .../exceptions/generics/try-catch-struct01.cs | 4 +- .../generics/try-catch-struct01.csproj | 3 +- .../exceptions/generics/try-catch-struct02.cs | 4 +- .../generics/try-catch-struct02.csproj | 3 +- .../exceptions/generics/try-catch-struct03.cs | 4 +- .../generics/try-catch-struct03.csproj | 3 +- .../exceptions/generics/try-catch-struct04.cs | 4 +- .../generics/try-catch-struct04.csproj | 3 +- .../exceptions/generics/try-catch-struct05.cs | 4 +- .../generics/try-catch-struct05.csproj | 3 +- .../exceptions/generics/try-catch-struct06.cs | 4 +- .../generics/try-catch-struct06.csproj | 3 +- .../exceptions/generics/try-catch-struct07.cs | 4 +- .../generics/try-catch-struct07.csproj | 3 +- .../exceptions/generics/try-catch-struct08.cs | 4 +- .../generics/try-catch-struct08.csproj | 3 +- .../exceptions/generics/try-catch-struct09.cs | 4 +- .../generics/try-catch-struct09.csproj | 3 +- .../exceptions/generics/try-catch01.cs | 4 +- .../exceptions/generics/try-catch01.csproj | 3 +- .../exceptions/generics/try-catch02.cs | 4 +- .../exceptions/generics/try-catch02.csproj | 3 +- .../exceptions/generics/try-catch03.cs | 4 +- .../exceptions/generics/try-catch03.csproj | 3 +- .../exceptions/generics/try-catch04.cs | 4 +- .../exceptions/generics/try-catch04.csproj | 3 +- .../exceptions/generics/try-catch05.cs | 4 +- .../exceptions/generics/try-catch05.csproj | 3 +- .../exceptions/generics/try-catch06.cs | 4 +- .../exceptions/generics/try-catch06.csproj | 3 +- .../exceptions/generics/try-catch07.cs | 4 +- .../exceptions/generics/try-catch07.csproj | 3 +- .../exceptions/generics/try-catch08.cs | 4 +- .../exceptions/generics/try-catch08.csproj | 3 +- .../exceptions/generics/try-catch09.cs | 4 +- .../exceptions/generics/try-catch09.csproj | 3 +- .../generics/try-fault-struct01.ilproj | 3 +- .../generics/try-fault-struct02.ilproj | 3 +- .../generics/try-fault-struct03.ilproj | 3 +- .../exceptions/generics/try-fault01.ilproj | 3 +- .../exceptions/generics/try-fault02.ilproj | 3 +- .../exceptions/generics/try-fault03.ilproj | 3 +- .../generics/try-filter-finally01.ilproj | 3 +- .../generics/try-filter-finally02.ilproj | 3 +- .../generics/try-filter-struct02.ilproj | 3 +- .../exceptions/generics/try-filter02.ilproj | 3 +- .../generics/try-finally-struct01.cs | 4 +- .../generics/try-finally-struct01.csproj | 3 +- .../generics/try-finally-struct02.cs | 4 +- .../generics/try-finally-struct02.csproj | 3 +- .../generics/try-finally-struct03.cs | 4 +- .../generics/try-finally-struct03.csproj | 3 +- .../exceptions/generics/try-finally01.cs | 4 +- .../exceptions/generics/try-finally01.csproj | 3 +- .../exceptions/generics/try-finally02.cs | 4 +- .../exceptions/generics/try-finally02.csproj | 3 +- .../exceptions/generics/try-finally03.cs | 4 +- .../exceptions/generics/try-finally03.csproj | 3 +- .../exceptions/generics/typeparameter001.cs | 4 +- .../exceptions/generics/typeparameter002.cs | 4 +- .../exceptions/generics/typeparameter003.cs | 4 +- .../exceptions/generics/typeparameter004.cs | 4 +- .../exceptions/generics/typeparameter005.cs | 4 +- .../exceptions/generics/typeparameter006.cs | 4 +- .../exceptions/generics/typeparameter007.cs | 4 +- .../exceptions/generics/typeparameter008.cs | 4 +- .../exceptions/generics/typeparameter009.cs | 4 +- .../exceptions/generics/typeparameter010.cs | 4 +- .../exceptions/generics/typeparameter011.cs | 4 +- .../exceptions/generics/typeparameter012.cs | 4 +- .../exceptions/generics/typeparameter013.cs | 4 +- .../exceptions/generics/typeparameter014.cs | 4 +- .../exceptions/generics/typeparameter015.cs | 4 +- .../exceptions/generics/typeparameter016.cs | 4 +- .../exceptions/generics/typeparameter017.cs | 4 +- .../exceptions/generics/typeparameter018.cs | 4 +- .../regressions/Dev11/147911/test147911.cs | 4 +- .../Dev11/147911/test147911.csproj | 3 +- .../Dev11/154243/dynamicmethodliveness.cs | 6 +- .../Dev11/154243/dynamicmethodliveness.csproj | 3 +- .../regressions/V1/SEH/COOL/finally.cs | 4 +- .../regressions/V1/SEH/COOL/finally.csproj | 3 +- .../regressions/V1/SEH/COOL/rethrow.cs | 4 +- .../regressions/V1/SEH/COOL/rethrow.csproj | 3 +- .../V1/SEH/VJ/ExternalException.cs | 4 +- .../V1/SEH/VJ/ExternalException.csproj | 3 +- .../regressions/V1/SEH/VJ/HandlerException.cs | 4 +- .../V1/SEH/VJ/HandlerException.csproj | 3 +- .../V1/SEH/VJ/MultipleException.cs | 4 +- .../V1/SEH/VJ/MultipleException.csproj | 3 +- .../regressions/V1/SEH/VJ/NestedEx1.cs | 6 +- .../regressions/V1/SEH/VJ/NestedEx1.csproj | 3 +- .../regressions/V1/SEH/VJ/NestedEx2.cs | 6 +- .../regressions/V1/SEH/VJ/NestedEx2.csproj | 3 +- .../regressions/V1/SEH/VJ/NestedException.cs | 4 +- .../V1/SEH/VJ/NestedException.csproj | 3 +- .../regressions/V1/SEH/VJ/NormalException.cs | 4 +- .../V1/SEH/VJ/NormalException.csproj | 3 +- .../V1/SEH/VJ/RecursiveException.cs | 4 +- .../V1/SEH/VJ/RecursiveException.csproj | 3 +- .../regressions/V1/SEH/VJ/TryCatch.cs | 4 +- .../regressions/V1/SEH/VJ/TryCatch.csproj | 3 +- .../regressions/V1/SEH/VJ/TryCatchFinally.cs | 4 +- .../V1/SEH/VJ/TryCatchFinally.csproj | 3 +- .../V1/SEH/VJ/UnmanagedToManaged.cs | 4 +- .../V1/SEH/VJ/UnmanagedToManaged.csproj | 3 +- .../regressions/V1/SEH/VJ/UserException.cs | 4 +- .../V1/SEH/VJ/UserException.csproj | 3 +- .../V1/SEH/VJ/UserExceptionThread.cs | 4 +- .../V1/SEH/VJ/UserExceptionThread.csproj | 3 +- .../regressions/V1/SEH/asm/Except.il | 8 +- .../regressions/V1/SEH/asm/Except.ilproj | 3 +- .../regressions/V1/SEH/asm/FiltCatch.il | 8 +- .../regressions/V1/SEH/asm/FiltCatch.ilproj | 3 +- .../regressions/V1/SEH/asm/FiltFallThru.il | 8 +- .../V1/SEH/asm/FiltFallThru.ilproj | 3 +- .../regressions/V1/SEH/asm/Filter.il | 8 +- .../regressions/V1/SEH/asm/Filter.ilproj | 3 +- .../regressions/V1/SEH/asm/Finally.il | 8 +- .../regressions/V1/SEH/asm/Finally.ilproj | 3 +- .../regressions/V1/SEH/asm/NestedExcept.il | 8 +- .../V1/SEH/asm/NestedExcept.ilproj | 3 +- .../regressions/V1/SEH/asm/NestedFilt.il | 8 +- .../regressions/V1/SEH/asm/NestedFilt.ilproj | 3 +- .../regressions/V1/SEH/coverage/Exceptions.cs | 6 +- .../V1/SEH/coverage/Exceptions.csproj | 3 +- .../exceptions/regressions/v1.0/15266.il | 2 +- .../exceptions/regressions/v1.0/15266.ilproj | 3 +- .../exceptions/regressions/v1.0/19896.cs | 4 +- .../exceptions/regressions/v1.0/19896.csproj | 3 +- .../regressions/v4.0/640474/other.csproj | 1 - .../regressions/v4.0/640474/test640474.cs | 4 +- .../regressions/v4.0/640474/test640474.csproj | 3 +- .../regressions/whidbeyM3.2/151232.cs | 4 +- .../regressions/whidbeyM3.2/151232.csproj | 3 +- .../regressions/whidbeybeta2/349379/349379.cs | 58 ++-- .../whidbeybeta2/349379/349379.csproj | 3 +- .../regressions/whidbeym3.3/106011/106011.cs | 4 +- .../whidbeym3.3/106011/106011.csproj | 3 +- .../regressions/whidbeym3.3/302680/302680.cs | 4 +- .../whidbeym3.3/302680/302680.csproj | 3 +- .../whidbeym3.3/302680/data.csproj | 1 - .../emptystacktrace/OOMException01.csproj | 3 +- .../emptystacktrace/oomexception01.cs | 4 +- .../exceptions/simple/ArrayInit.cs | 4 +- .../exceptions/simple/ArrayInit.csproj | 3 +- .../exceptions/simple/HardwareEh.cs | 4 +- .../exceptions/simple/HardwareEh.csproj | 3 +- .../exceptions/simple/ILHelper.ilproj | 1 - .../exceptions/simple/ParallelCrash.csproj | 10 +- .../simple/ParallelCrashMainThread.csproj | 12 - .../exceptions/simple/ParallelCrashTester.cs | 47 ++++ .../simple/ParallelCrashTester.csproj | 17 ++ .../simple/ParallelCrashWorkerThreads.csproj | 10 - .../baseservices/exceptions/simple/VT.ilproj | 1 - .../baseservices/exceptions/simple/fault.il | 2 +- .../exceptions/simple/fault.ilproj | 3 +- .../baseservices/exceptions/simple/finally.cs | 4 +- .../exceptions/simple/finally.csproj | 3 +- .../stackoverflow/stackoverflow.csproj | 7 +- .../stackoverflow/stackoverflow3.csproj | 5 +- .../stackoverflow/stackoverflowtester.cs | 261 ++++++------------ .../stackoverflow/stackoverflowtester.csproj | 3 +- .../exceptions/stacktrace/Tier1StackTrace.cs | 25 +- .../stacktrace/Tier1StackTrace.csproj | 3 +- .../exceptions/unhandled/unhandled.cs | 95 +------ .../exceptions/unhandled/unhandled.csproj | 6 +- .../exceptions/unhandled/unhandledTester.cs | 93 +++++++ .../unhandled/unhandledTester.csproj | 19 ++ .../exceptions/unittests/Baadbaad.cs | 4 +- .../exceptions/unittests/Baadbaad.csproj | 3 +- .../exceptions/unittests/BaseClass.csproj | 3 +- .../exceptions/unittests/CollidedUnwind.cs | 4 +- .../unittests/CollidedUnwind.csproj | 3 +- .../exceptions/unittests/EHPatternTests.cs | 4 +- .../unittests/EHPatternTests.csproj | 3 +- .../unittests/GoryManagedPresent.cs | 4 +- .../unittests/GoryManagedPresent.csproj | 3 +- .../exceptions/unittests/GoryNativePast.cs | 4 +- .../unittests/GoryNativePast.csproj | 3 +- .../exceptions/unittests/InnerFinally.csproj | 3 +- .../unittests/InnerFinallyAndCatch.cs | 4 +- .../unittests/InnerFinallyAndCatch.csproj | 3 +- .../exceptions/unittests/Pending.cs | 4 +- .../exceptions/unittests/Pending.csproj | 3 +- .../exceptions/unittests/Recurse.cs | 4 +- .../exceptions/unittests/Recurse.csproj | 3 +- .../exceptions/unittests/RecursiveRethrow.cs | 4 +- .../unittests/RecursiveRethrow.csproj | 3 +- .../exceptions/unittests/RecursiveThrowNew.cs | 4 +- .../unittests/RecursiveThrowNew.csproj | 3 +- .../unittests/RethrowAndFinally.csproj | 3 +- .../unittests/ReturnFromCatch.csproj | 3 +- .../exceptions/unittests/StrSwitchFinally.cs | 4 +- .../unittests/StrSwitchFinally.csproj | 3 +- .../exceptions/unittests/ThrowInCatch.csproj | 3 +- .../unittests/ThrowInFinally.csproj | 3 +- .../unittests/ThrowInFinallyNestedInTry.cs | 4 +- .../ThrowInFinallyNestedInTry.csproj | 3 +- .../unittests/TryCatchInFinally.csproj | 3 +- .../exceptions/unittests/baseclass.cs | 4 +- .../exceptions/unittests/innerfinally.cs | 4 +- .../exceptions/unittests/rethrowandfinally.cs | 4 +- .../exceptions/unittests/returnfromcatch.cs | 4 +- .../exceptions/unittests/throwincatch.cs | 4 +- .../exceptions/unittests/throwinfinally.cs | 4 +- .../exceptions/unittests/trycatchinfinally.cs | 4 +- .../finalization/CriticalFinalizer.cs | 6 +- .../finalization/CriticalFinalizer.csproj | 3 +- .../finalization/Finalizer.csproj | 3 +- .../baseservices/finalization/finalizer.cs | 4 +- .../regression/dd130885/xlib.csproj | 1 - .../regression/vswhidbey267905/267905.csproj | 1 - .../regression/vswhidbey305155/305155.cs | 8 +- .../regression/vswhidbey305155/305155.csproj | 1 - .../regression/vswhidbey395914/395914.csproj | 1 - .../InvalidOperations.csproj | 3 +- src/tests/baseservices/mono/runningmono.cs | 6 +- .../baseservices/mono/runningmono.csproj | 3 +- src/tests/baseservices/multidimmarray/enum.cs | 4 +- .../baseservices/multidimmarray/enum.csproj | 1 - .../baseservices/multidimmarray/rank1array.il | 6 + .../multidimmarray/rank1array.ilproj | 3 +- .../threading/Directory.Build.props | 1 - .../contracts/TypeContracts.csproj | 3 - .../typeequivalence/impl/PunningLib.ilproj | 3 - .../typeequivalence/impl/TypeImpl.csproj | 3 - .../istypeequivalent/istypeequivalent.cs | 17 +- .../istypeequivalent/istypeequivalent.csproj | 4 +- .../typeequivalenttypes_1.csproj | 1 - .../typeequivalenttypes_2.csproj | 1 - .../typeequivalence/pia/PIAContract.csproj | 3 - .../signatures/basetestclassesil.ilproj | 3 - .../typeequivalence/signatures/nopiatestil.il | 6 +- .../signatures/nopiatestil.ilproj | 3 +- .../signatures/testclassesil.ilproj | 3 - .../typeequivalence/simple/Simple.cs | 3 +- .../typeequivalence/simple/Simple.csproj | 3 +- .../baseservices/varargs/varargsupport.il | 2 +- .../baseservices/varargs/varargsupport.ilproj | 3 +- .../varargs/varargsupport_r.ilproj | 3 +- 373 files changed, 1343 insertions(+), 856 deletions(-) create mode 100644 src/tests/baseservices/Directory.Build.props create mode 100644 src/tests/baseservices/RuntimeConfiguration/TestConfigTester.cs create mode 100644 src/tests/baseservices/RuntimeConfiguration/TestConfigTester.csproj create mode 100644 src/tests/baseservices/baseservices.csproj create mode 100644 src/tests/baseservices/exceptions/Directory.Build.props create mode 100644 src/tests/baseservices/exceptions/baseservices-exceptions.csproj delete mode 100644 src/tests/baseservices/exceptions/simple/ParallelCrashMainThread.csproj create mode 100644 src/tests/baseservices/exceptions/simple/ParallelCrashTester.cs create mode 100644 src/tests/baseservices/exceptions/simple/ParallelCrashTester.csproj delete mode 100644 src/tests/baseservices/exceptions/simple/ParallelCrashWorkerThreads.csproj create mode 100644 src/tests/baseservices/exceptions/unhandled/unhandledTester.cs create mode 100644 src/tests/baseservices/exceptions/unhandled/unhandledTester.csproj diff --git a/src/tests/baseservices/CET/CheckCETPresence.cs b/src/tests/baseservices/CET/CheckCETPresence.cs index 656fcadfb7cfd3..80e5c71994e2db 100644 --- a/src/tests/baseservices/CET/CheckCETPresence.cs +++ b/src/tests/baseservices/CET/CheckCETPresence.cs @@ -3,13 +3,15 @@ using System; using System.Runtime.InteropServices; +using Xunit; -static class Program +public static class Program { [DllImport("cet_check.dll")] private static extern long ReadShadowStackPointer(); - public static int Main() + [Fact] + public static int TestEntryPoint() { Console.WriteLine("Checking whether codeflow enforcement technology (CET) is active"); long ssp = ReadShadowStackPointer(); diff --git a/src/tests/baseservices/CET/CheckCETPresence.csproj b/src/tests/baseservices/CET/CheckCETPresence.csproj index 845ff56e1c787e..d864079636c4e5 100644 --- a/src/tests/baseservices/CET/CheckCETPresence.csproj +++ b/src/tests/baseservices/CET/CheckCETPresence.csproj @@ -1,6 +1,5 @@ - Exe true true true diff --git a/src/tests/baseservices/Directory.Build.props b/src/tests/baseservices/Directory.Build.props new file mode 100644 index 00000000000000..17e80030ca09de --- /dev/null +++ b/src/tests/baseservices/Directory.Build.props @@ -0,0 +1,11 @@ + + + + + + + true + $(NoWarn);xUnit1013 + false + + diff --git a/src/tests/baseservices/RuntimeConfiguration/TestConfig.cs b/src/tests/baseservices/RuntimeConfiguration/TestConfig.cs index 39e20b4f88593a..3e670b37e7a76d 100644 --- a/src/tests/baseservices/RuntimeConfiguration/TestConfig.cs +++ b/src/tests/baseservices/RuntimeConfiguration/TestConfig.cs @@ -11,74 +11,66 @@ using Xunit; -class TestConfig +public class TestConfig { - const int Success = 100; - const int Fail = 101; + public const int Success = 100; + public const int Fail = 101; - [Fact] [EnvVar("DOTNET_gcServer", "1")] - static int Verify_ServerGC_Env_Enable(string[] _) + public static int Verify_ServerGC_Env_Enable() { return GCSettings.IsServerGC ? Success : Fail; } - [Fact] [EnvVar("DOTNET_gcServer", "0")] - static int Verify_ServerGC_Env_Disable(string[] _) + public static int Verify_ServerGC_Env_Disable() { return GCSettings.IsServerGC ? Fail : Success; } - [Fact] [ConfigProperty("System.GC.Server", "true")] - static int Verify_ServerGC_Prop_Enable(string[] _) + public static int Verify_ServerGC_Prop_Enable() { return GCSettings.IsServerGC ? Success : Fail; } - [Fact] [ConfigProperty("System.GC.Server", "false")] - static int Verify_ServerGC_Prop_Disable(string[] _) + public static int Verify_ServerGC_Prop_Disable() { return GCSettings.IsServerGC ? Fail : Success; } - [Fact] [EnvVar("DOTNET_gcServer", "0")] [ConfigProperty("System.GC.Server", "true")] - static int Verify_ServerGC_Env_Override_Prop(string[] _) + public static int Verify_ServerGC_Env_Override_Prop() { return GCSettings.IsServerGC ? Fail : Success; } +#if !IS_TESTER_APP static int Main(string[] args) { - if (args.Length == 0) - { - return RunTests(); - } - MethodInfo infos = typeof(TestConfig).GetMethod(args[0], BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public); if (infos is null) { return Fail; } - return (int)infos.Invoke(null, new object[] { args[1..] }); + return (int)infos.Invoke(null, Array.Empty()); } +#endif [AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = false)] - class EnvVarAttribute : Attribute + public class EnvVarAttribute : Attribute { public EnvVarAttribute(string name, string value) { Name = name; Value = value; } public string Name { get; init; } @@ -86,77 +78,11 @@ class EnvVarAttribute : Attribute } [AttributeUsage(AttributeTargets.Method, AllowMultiple = true, Inherited = false)] - class ConfigPropertyAttribute : Attribute + public class ConfigPropertyAttribute : Attribute { public ConfigPropertyAttribute(string name, string value) { Name = name; Value = value; } public string Name { get; init; } public string Value { get; init; } } - static int RunTests() - { - // clear some environment variables that we will set during the test run - Environment.SetEnvironmentVariable("DOTNET_gcServer", null); - - string corerunPath = GetCorerunPath(); - MethodInfo[] infos = typeof(TestConfig).GetMethods(BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public); - foreach (var mi in infos) - { - var factMaybe = mi.GetCustomAttributes(typeof(FactAttribute)); - if (!factMaybe.Any()) - { - continue; - } - - using Process process = new(); - - StringBuilder arguments = new(); - var configProperties = mi.GetCustomAttributes(typeof(ConfigPropertyAttribute)); - - foreach (Attribute cp in configProperties) - { - ConfigPropertyAttribute configProp = (ConfigPropertyAttribute)cp; - arguments.Append($"-p {configProp.Name}={configProp.Value} "); - } - - arguments.Append($"\"{System.Reflection.Assembly.GetExecutingAssembly().Location}\" {mi.Name}"); - - process.StartInfo.FileName = corerunPath; - process.StartInfo.Arguments = arguments.ToString(); - - var envVariables = mi.GetCustomAttributes(typeof(EnvVarAttribute)); - foreach (string key in Environment.GetEnvironmentVariables().Keys) - { - process.StartInfo.EnvironmentVariables[key] = Environment.GetEnvironmentVariable(key); - } - - Console.WriteLine($"Running: {process.StartInfo.Arguments}"); - foreach (Attribute ev in envVariables) - { - EnvVarAttribute envVar = (EnvVarAttribute)ev; - process.StartInfo.EnvironmentVariables[envVar.Name] = envVar.Value; - Console.WriteLine($" set {envVar.Name}={envVar.Value}"); - } - - process.Start(); - process.WaitForExit(); - if (process.ExitCode != Success) - { - Console.WriteLine($"Failed: {mi.Name}"); - return process.ExitCode; - } - } - - return Success; - } - - static string GetCorerunPath() - { - string corerunName = "corerun"; - if (TestLibrary.Utilities.IsWindows) - { - corerunName += ".exe"; - } - return Path.Combine(Environment.GetEnvironmentVariable("CORE_ROOT"), corerunName); - } } diff --git a/src/tests/baseservices/RuntimeConfiguration/TestConfig.csproj b/src/tests/baseservices/RuntimeConfiguration/TestConfig.csproj index efba9444477cd8..c92e82fb9e211b 100644 --- a/src/tests/baseservices/RuntimeConfiguration/TestConfig.csproj +++ b/src/tests/baseservices/RuntimeConfiguration/TestConfig.csproj @@ -1,15 +1,11 @@ - Exe - - true - true - true + + true + false + BuildOnly - - - \ No newline at end of file diff --git a/src/tests/baseservices/RuntimeConfiguration/TestConfigTester.cs b/src/tests/baseservices/RuntimeConfiguration/TestConfigTester.cs new file mode 100644 index 00000000000000..c39b965c55f4e2 --- /dev/null +++ b/src/tests/baseservices/RuntimeConfiguration/TestConfigTester.cs @@ -0,0 +1,83 @@ +// 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.IO; +using System.Linq; +using System.Reflection; +using System.Runtime; +using System.Text; + +using Xunit; + +public class TestConfigTester +{ + [Fact] + public static void RunTests() + { + // clear some environment variables that we will set during the test run + Environment.SetEnvironmentVariable("DOTNET_gcServer", null); + + string testConfigApp = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "TestConfig.dll"); + + MethodInfo[] infos = typeof(TestConfig).GetMethods(BindingFlags.Static | BindingFlags.NonPublic | BindingFlags.Public); + + string corerunPath = GetCorerunPath(); + foreach (var mi in infos) + { + var configProperties = mi.GetCustomAttributes(typeof(TestConfig.ConfigPropertyAttribute)); + var envVariables = mi.GetCustomAttributes(typeof(TestConfig.EnvVarAttribute)); + + if (configProperties.Count() == 0 && envVariables.Count() == 0) + { + continue; + } + + using Process process = new(); + + StringBuilder arguments = new(); + + foreach (Attribute cp in configProperties) + { + TestConfig.ConfigPropertyAttribute configProp = (TestConfig.ConfigPropertyAttribute)cp; + arguments.Append($"-p {configProp.Name}={configProp.Value} "); + } + + arguments.Append($"\"{testConfigApp}\" {mi.Name}"); + + process.StartInfo.FileName = corerunPath; + process.StartInfo.Arguments = arguments.ToString(); + + foreach (string key in Environment.GetEnvironmentVariables().Keys) + { + process.StartInfo.EnvironmentVariables[key] = Environment.GetEnvironmentVariable(key); + } + + Console.WriteLine($"Running: {process.StartInfo.Arguments}"); + foreach (Attribute ev in envVariables) + { + TestConfig.EnvVarAttribute envVar = (TestConfig.EnvVarAttribute)ev; + process.StartInfo.EnvironmentVariables[envVar.Name] = envVar.Value; + Console.WriteLine($" set {envVar.Name}={envVar.Value}"); + } + + process.Start(); + process.WaitForExit(); + if (process.ExitCode != TestConfig.Success) + { + throw new Exception($"Failed: {mi.Name}: exit code = {process.ExitCode}"); + } + } + } + + static string GetCorerunPath() + { + string corerunName = "corerun"; + if (TestLibrary.Utilities.IsWindows) + { + corerunName += ".exe"; + } + return Path.Combine(Environment.GetEnvironmentVariable("CORE_ROOT"), corerunName); + } +} diff --git a/src/tests/baseservices/RuntimeConfiguration/TestConfigTester.csproj b/src/tests/baseservices/RuntimeConfiguration/TestConfigTester.csproj new file mode 100644 index 00000000000000..cd6cb09525e455 --- /dev/null +++ b/src/tests/baseservices/RuntimeConfiguration/TestConfigTester.csproj @@ -0,0 +1,21 @@ + + + + true + true + true + $(DefineConstants);IS_TESTER_APP + + + + + + + + + false + Content + Always + + + diff --git a/src/tests/baseservices/TieredCompilation/BasicTest.cs b/src/tests/baseservices/TieredCompilation/BasicTest.cs index da3ee0e63d34f5..2e4d37fd7f218a 100644 --- a/src/tests/baseservices/TieredCompilation/BasicTest.cs +++ b/src/tests/baseservices/TieredCompilation/BasicTest.cs @@ -4,18 +4,16 @@ using System; using System.Runtime.CompilerServices; using System.Threading; +using Xunit; public static class BasicTest { - private static int Main() + [Fact] + public static void TestEntryPoint() { - const int Pass = 100; - PromoteToTier1(Foo, () => FooWithLoop(2)); Foo(); FooWithLoop(2); - - return Pass; } [MethodImpl(MethodImplOptions.NoInlining)] diff --git a/src/tests/baseservices/TieredCompilation/BasicTestWithMcj.cs b/src/tests/baseservices/TieredCompilation/BasicTestWithMcj.cs index 686517e431c189..c34d133a2af8d1 100644 --- a/src/tests/baseservices/TieredCompilation/BasicTestWithMcj.cs +++ b/src/tests/baseservices/TieredCompilation/BasicTestWithMcj.cs @@ -17,7 +17,7 @@ public struct MCJTestStruct { } - private static int Main() + public static int Main() { const int Pass = 100; @@ -45,6 +45,7 @@ private static int Main() FooWithGeneric(RegexOptions.IgnoreCase); ProfileOptimization.StartProfile(null); + return Pass; } diff --git a/src/tests/baseservices/TieredCompilation/BasicTestWithMcj.csproj b/src/tests/baseservices/TieredCompilation/BasicTestWithMcj.csproj index 250dbf3c13a6ce..e04e74d55b3275 100644 --- a/src/tests/baseservices/TieredCompilation/BasicTestWithMcj.csproj +++ b/src/tests/baseservices/TieredCompilation/BasicTestWithMcj.csproj @@ -1,6 +1,12 @@ + + + + true Exe + false + true true diff --git a/src/tests/baseservices/TieredCompilation/BasicTest_DefaultMode.csproj b/src/tests/baseservices/TieredCompilation/BasicTest_DefaultMode.csproj index 5f828af2b9e9c6..c963cba21c249a 100644 --- a/src/tests/baseservices/TieredCompilation/BasicTest_DefaultMode.csproj +++ b/src/tests/baseservices/TieredCompilation/BasicTest_DefaultMode.csproj @@ -1,6 +1,7 @@ - Exe + + true true true diff --git a/src/tests/baseservices/TieredCompilation/BasicTest_DefaultMode_R2r.csproj b/src/tests/baseservices/TieredCompilation/BasicTest_DefaultMode_R2r.csproj index f19143ec5f3aca..374da8ac31d9c7 100644 --- a/src/tests/baseservices/TieredCompilation/BasicTest_DefaultMode_R2r.csproj +++ b/src/tests/baseservices/TieredCompilation/BasicTest_DefaultMode_R2r.csproj @@ -1,6 +1,7 @@ - Exe + + true true true diff --git a/src/tests/baseservices/TieredCompilation/BasicTest_QuickJitForLoopsOff.csproj b/src/tests/baseservices/TieredCompilation/BasicTest_QuickJitForLoopsOff.csproj index e160b9df92178d..393859d3b9c4e0 100644 --- a/src/tests/baseservices/TieredCompilation/BasicTest_QuickJitForLoopsOff.csproj +++ b/src/tests/baseservices/TieredCompilation/BasicTest_QuickJitForLoopsOff.csproj @@ -1,6 +1,7 @@ - Exe + + true true true diff --git a/src/tests/baseservices/TieredCompilation/BasicTest_QuickJitForLoopsOff_R2r.csproj b/src/tests/baseservices/TieredCompilation/BasicTest_QuickJitForLoopsOff_R2r.csproj index 5557b2830b7bb0..04bc1888b98a15 100644 --- a/src/tests/baseservices/TieredCompilation/BasicTest_QuickJitForLoopsOff_R2r.csproj +++ b/src/tests/baseservices/TieredCompilation/BasicTest_QuickJitForLoopsOff_R2r.csproj @@ -1,6 +1,7 @@ - Exe + + true true true diff --git a/src/tests/baseservices/TieredCompilation/BasicTest_QuickJitForLoopsOn.csproj b/src/tests/baseservices/TieredCompilation/BasicTest_QuickJitForLoopsOn.csproj index 50d2d2858c3759..1c35491adb5460 100644 --- a/src/tests/baseservices/TieredCompilation/BasicTest_QuickJitForLoopsOn.csproj +++ b/src/tests/baseservices/TieredCompilation/BasicTest_QuickJitForLoopsOn.csproj @@ -1,6 +1,7 @@ - Exe + + true true true diff --git a/src/tests/baseservices/TieredCompilation/BasicTest_QuickJitForLoopsOn_R2r.csproj b/src/tests/baseservices/TieredCompilation/BasicTest_QuickJitForLoopsOn_R2r.csproj index a7c9ee4f350788..37fd659a83f330 100644 --- a/src/tests/baseservices/TieredCompilation/BasicTest_QuickJitForLoopsOn_R2r.csproj +++ b/src/tests/baseservices/TieredCompilation/BasicTest_QuickJitForLoopsOn_R2r.csproj @@ -1,6 +1,7 @@ - Exe + + true true true diff --git a/src/tests/baseservices/TieredCompilation/BasicTest_QuickJitOff.csproj b/src/tests/baseservices/TieredCompilation/BasicTest_QuickJitOff.csproj index 060be598945ab5..59fd5e8387d981 100644 --- a/src/tests/baseservices/TieredCompilation/BasicTest_QuickJitOff.csproj +++ b/src/tests/baseservices/TieredCompilation/BasicTest_QuickJitOff.csproj @@ -1,6 +1,7 @@ - Exe + + true true true diff --git a/src/tests/baseservices/TieredCompilation/BasicTest_QuickJitOff_R2r.csproj b/src/tests/baseservices/TieredCompilation/BasicTest_QuickJitOff_R2r.csproj index 228e1f1d40dc65..be0bdfc8cda7bf 100644 --- a/src/tests/baseservices/TieredCompilation/BasicTest_QuickJitOff_R2r.csproj +++ b/src/tests/baseservices/TieredCompilation/BasicTest_QuickJitOff_R2r.csproj @@ -1,6 +1,7 @@ - Exe + + true true true diff --git a/src/tests/baseservices/TieredCompilation/BasicTest_QuickJitOn.csproj b/src/tests/baseservices/TieredCompilation/BasicTest_QuickJitOn.csproj index c95590e4124f5f..253708ecbef7b5 100644 --- a/src/tests/baseservices/TieredCompilation/BasicTest_QuickJitOn.csproj +++ b/src/tests/baseservices/TieredCompilation/BasicTest_QuickJitOn.csproj @@ -1,6 +1,7 @@ - Exe + + true true true diff --git a/src/tests/baseservices/TieredCompilation/BasicTest_QuickJitOn_R2r.csproj b/src/tests/baseservices/TieredCompilation/BasicTest_QuickJitOn_R2r.csproj index 7dbf41084b4b11..a12825576b5073 100644 --- a/src/tests/baseservices/TieredCompilation/BasicTest_QuickJitOn_R2r.csproj +++ b/src/tests/baseservices/TieredCompilation/BasicTest_QuickJitOn_R2r.csproj @@ -1,6 +1,7 @@ - Exe + + true true true diff --git a/src/tests/baseservices/TieredCompilation/McjRecorderTimeoutBeforeStop.cs b/src/tests/baseservices/TieredCompilation/McjRecorderTimeoutBeforeStop.cs index 14ecd4785f1471..5597ad4f112229 100644 --- a/src/tests/baseservices/TieredCompilation/McjRecorderTimeoutBeforeStop.cs +++ b/src/tests/baseservices/TieredCompilation/McjRecorderTimeoutBeforeStop.cs @@ -5,13 +5,13 @@ using System.Runtime; using System.Runtime.CompilerServices; using System.Threading; +using Xunit; public static class BasicTest { - private static int Main() + [Fact] + public static void TestEntryPoint() { - const int Pass = 100; - ProfileOptimization.SetProfileRoot(Environment.CurrentDirectory); ProfileOptimization.StartProfile("profile.mcj"); @@ -23,7 +23,6 @@ private static int Main() // Stop the profile again after timeout (just verifying that it works) ProfileOptimization.StartProfile(null); - return Pass; } [MethodImpl(MethodImplOptions.NoInlining)] diff --git a/src/tests/baseservices/TieredCompilation/McjRecorderTimeoutBeforeStop.csproj b/src/tests/baseservices/TieredCompilation/McjRecorderTimeoutBeforeStop.csproj index 2c26b6cb44e329..7ac48baaae711b 100644 --- a/src/tests/baseservices/TieredCompilation/McjRecorderTimeoutBeforeStop.csproj +++ b/src/tests/baseservices/TieredCompilation/McjRecorderTimeoutBeforeStop.csproj @@ -1,6 +1,7 @@ - Exe + + true true true diff --git a/src/tests/baseservices/TieredCompilation/TieredVtableMethodTests.cs b/src/tests/baseservices/TieredCompilation/TieredVtableMethodTests.cs index c23ea9aa13b416..c0278fa9380ec6 100644 --- a/src/tests/baseservices/TieredCompilation/TieredVtableMethodTests.cs +++ b/src/tests/baseservices/TieredCompilation/TieredVtableMethodTests.cs @@ -7,6 +7,7 @@ using System.Runtime.CompilerServices; using System.Text; using System.Threading; +using Xunit; public static class TieredVtableMethodTests { @@ -15,7 +16,8 @@ public static class TieredVtableMethodTests private static StringBuilder s_expectedCallSequence = new StringBuilder(); private static StringBuilder s_actualCallSequence = new StringBuilder(); - private static int Main() + [Fact] + public static int TestEntryPoint() { const int Pass = 100, Fail = 101; diff --git a/src/tests/baseservices/TieredCompilation/TieredVtableMethodTests.csproj b/src/tests/baseservices/TieredCompilation/TieredVtableMethodTests.csproj index 2b5b366f0c4943..b0f01b0888d665 100644 --- a/src/tests/baseservices/TieredCompilation/TieredVtableMethodTests.csproj +++ b/src/tests/baseservices/TieredCompilation/TieredVtableMethodTests.csproj @@ -1,6 +1,7 @@ - Exe + + true true diff --git a/src/tests/baseservices/baseservices.csproj b/src/tests/baseservices/baseservices.csproj new file mode 100644 index 00000000000000..dd7dd0282c4fdd --- /dev/null +++ b/src/tests/baseservices/baseservices.csproj @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/src/tests/baseservices/callconvs/CallFunctionPointers.ilproj b/src/tests/baseservices/callconvs/CallFunctionPointers.ilproj index b2aad8af6d976e..e7220aa28403a5 100644 --- a/src/tests/baseservices/callconvs/CallFunctionPointers.ilproj +++ b/src/tests/baseservices/callconvs/CallFunctionPointers.ilproj @@ -1,7 +1,4 @@ - - library - diff --git a/src/tests/baseservices/callconvs/TestCallingConventions.cs b/src/tests/baseservices/callconvs/TestCallingConventions.cs index a3d5b5e2c83cb1..ad8b08d0bf1536 100644 --- a/src/tests/baseservices/callconvs/TestCallingConventions.cs +++ b/src/tests/baseservices/callconvs/TestCallingConventions.cs @@ -8,7 +8,7 @@ using Xunit; -unsafe class Program +public unsafe class Program { static void BlittableFunctionPointers() { @@ -164,7 +164,8 @@ static void NonblittableFunctionPointers() } } - static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/baseservices/callconvs/TestCallingConventions.csproj b/src/tests/baseservices/callconvs/TestCallingConventions.csproj index 03690f9d71f88a..700e6519daf3ea 100644 --- a/src/tests/baseservices/callconvs/TestCallingConventions.csproj +++ b/src/tests/baseservices/callconvs/TestCallingConventions.csproj @@ -1,6 +1,7 @@ - Exe + + true true diff --git a/src/tests/baseservices/compilerservices/FixedAddressValueType/FixedAddressValueType.cs b/src/tests/baseservices/compilerservices/FixedAddressValueType/FixedAddressValueType.cs index 56667c70cd2921..f4a6b9acd549c7 100644 --- a/src/tests/baseservices/compilerservices/FixedAddressValueType/FixedAddressValueType.cs +++ b/src/tests/baseservices/compilerservices/FixedAddressValueType/FixedAddressValueType.cs @@ -4,6 +4,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; public struct Age { @@ -27,7 +28,8 @@ public static unsafe IntPtr AddressOfFixedAge() public class Example { - public static int Main() + [Fact] + public static int TestEntryPoint() { for (int i = 0; i < 1000; i++) { diff --git a/src/tests/baseservices/compilerservices/FixedAddressValueType/FixedAddressValueType.csproj b/src/tests/baseservices/compilerservices/FixedAddressValueType/FixedAddressValueType.csproj index c70abc72c2df48..d0fa5a21b68adc 100644 --- a/src/tests/baseservices/compilerservices/FixedAddressValueType/FixedAddressValueType.csproj +++ b/src/tests/baseservices/compilerservices/FixedAddressValueType/FixedAddressValueType.csproj @@ -1,6 +1,7 @@ - Exe + + true true true 1 diff --git a/src/tests/baseservices/compilerservices/RuntimeFeature/DefaultImplementationsOfInterfaces.il b/src/tests/baseservices/compilerservices/RuntimeFeature/DefaultImplementationsOfInterfaces.il index 69d58572e5f3e1..8e9d81d694c4c0 100644 --- a/src/tests/baseservices/compilerservices/RuntimeFeature/DefaultImplementationsOfInterfaces.il +++ b/src/tests/baseservices/compilerservices/RuntimeFeature/DefaultImplementationsOfInterfaces.il @@ -12,7 +12,7 @@ .assembly DefaultImplementationsOfInterfaces{} -.class interface private abstract auto ansi DefaultInterface +.class interface public abstract auto ansi DefaultInterface { .method public hidebysig newslot virtual instance void Method() cil managed @@ -56,7 +56,7 @@ ret } -.method private hidebysig static int32 +.method public hidebysig static int32 Main() cil managed { .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( diff --git a/src/tests/baseservices/compilerservices/RuntimeFeature/DefaultImplementationsOfInterfaces.ilproj b/src/tests/baseservices/compilerservices/RuntimeFeature/DefaultImplementationsOfInterfaces.ilproj index 7b2b6debb21891..bd3ee9c5f9a243 100644 --- a/src/tests/baseservices/compilerservices/RuntimeFeature/DefaultImplementationsOfInterfaces.ilproj +++ b/src/tests/baseservices/compilerservices/RuntimeFeature/DefaultImplementationsOfInterfaces.ilproj @@ -1,6 +1,7 @@ - Exe + + true diff --git a/src/tests/baseservices/compilerservices/RuntimeHelpers/RuntimeHelpersTests.cs b/src/tests/baseservices/compilerservices/RuntimeHelpers/RuntimeHelpersTests.cs index a9c479e7bff7cf..2f58fd6601cbba 100644 --- a/src/tests/baseservices/compilerservices/RuntimeHelpers/RuntimeHelpersTests.cs +++ b/src/tests/baseservices/compilerservices/RuntimeHelpers/RuntimeHelpersTests.cs @@ -2,21 +2,13 @@ // The .NET Foundation licenses this file to you under the MIT license. // using System; +using Xunit; -class RuntimeHelpersTests +public class RuntimeHelpersTests { - static int Main() + [Fact] + public static void TestEntryPoint() { - try - { - ExecuteCodeWithGuaranteedCleanupTest.Run(); - } - catch (Exception e) - { - Console.WriteLine(e); - return 101; - } - - return 100; + ExecuteCodeWithGuaranteedCleanupTest.Run(); } } diff --git a/src/tests/baseservices/compilerservices/RuntimeHelpers/RuntimeHelpersTests.csproj b/src/tests/baseservices/compilerservices/RuntimeHelpers/RuntimeHelpersTests.csproj index 64124a2fd04bd5..1b9be34499d873 100644 --- a/src/tests/baseservices/compilerservices/RuntimeHelpers/RuntimeHelpersTests.csproj +++ b/src/tests/baseservices/compilerservices/RuntimeHelpers/RuntimeHelpersTests.csproj @@ -1,6 +1,7 @@ - Exe + + true 1 diff --git a/src/tests/baseservices/compilerservices/RuntimeWrappedException/RuntimeWrappedException.cs b/src/tests/baseservices/compilerservices/RuntimeWrappedException/RuntimeWrappedException.cs index 449bc5904eda0f..3dae0c38371315 100644 --- a/src/tests/baseservices/compilerservices/RuntimeWrappedException/RuntimeWrappedException.cs +++ b/src/tests/baseservices/compilerservices/RuntimeWrappedException/RuntimeWrappedException.cs @@ -5,10 +5,12 @@ using System.IO; using System.Runtime.CompilerServices; using System.Runtime.Serialization; +using Xunit; -class Test +public class Test { - public static int Main() + [Fact] + public static int TestEntryPoint() { int retVal = 0; var thrower = new StringThrowerClass(); diff --git a/src/tests/baseservices/compilerservices/RuntimeWrappedException/RuntimeWrappedException.csproj b/src/tests/baseservices/compilerservices/RuntimeWrappedException/RuntimeWrappedException.csproj index ac0e4264f95751..e5ccd9e668e2b8 100644 --- a/src/tests/baseservices/compilerservices/RuntimeWrappedException/RuntimeWrappedException.csproj +++ b/src/tests/baseservices/compilerservices/RuntimeWrappedException/RuntimeWrappedException.csproj @@ -1,6 +1,7 @@ - Exe + + true diff --git a/src/tests/baseservices/compilerservices/RuntimeWrappedException/StringThrower.ilproj b/src/tests/baseservices/compilerservices/RuntimeWrappedException/StringThrower.ilproj index d16d855aa32b91..a9774833fc1807 100644 --- a/src/tests/baseservices/compilerservices/RuntimeWrappedException/StringThrower.ilproj +++ b/src/tests/baseservices/compilerservices/RuntimeWrappedException/StringThrower.ilproj @@ -1,7 +1,4 @@ - - Library - diff --git a/src/tests/baseservices/compilerservices/UnsafeAccessors/UnsafeAccessorsTests.cs b/src/tests/baseservices/compilerservices/UnsafeAccessors/UnsafeAccessorsTests.cs index c524802b968be0..6e0a562f32a9b2 100644 --- a/src/tests/baseservices/compilerservices/UnsafeAccessors/UnsafeAccessorsTests.cs +++ b/src/tests/baseservices/compilerservices/UnsafeAccessors/UnsafeAccessorsTests.cs @@ -8,7 +8,7 @@ using Xunit; -static unsafe class UnsafeAccessorsTests +public static unsafe class UnsafeAccessorsTests { const string PrivateStatic = nameof(PrivateStatic); const string Private = nameof(Private); diff --git a/src/tests/baseservices/compilerservices/UnsafeAccessors/UnsafeAccessorsTests.csproj b/src/tests/baseservices/compilerservices/UnsafeAccessors/UnsafeAccessorsTests.csproj index 98cadb5e8d61d6..876d006ea96eb5 100644 --- a/src/tests/baseservices/compilerservices/UnsafeAccessors/UnsafeAccessorsTests.csproj +++ b/src/tests/baseservices/compilerservices/UnsafeAccessors/UnsafeAccessorsTests.csproj @@ -1,6 +1,7 @@ - Exe + + true true diff --git a/src/tests/baseservices/compilerservices/dynamicobjectproperties/Dev10_535767.csproj b/src/tests/baseservices/compilerservices/dynamicobjectproperties/Dev10_535767.csproj index 0d42acb01fca05..953c5ad72a9ce6 100644 --- a/src/tests/baseservices/compilerservices/dynamicobjectproperties/Dev10_535767.csproj +++ b/src/tests/baseservices/compilerservices/dynamicobjectproperties/Dev10_535767.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 true diff --git a/src/tests/baseservices/compilerservices/dynamicobjectproperties/TestAPIs.csproj b/src/tests/baseservices/compilerservices/dynamicobjectproperties/TestAPIs.csproj index 5afee4c900353c..7b1103ae0577aa 100644 --- a/src/tests/baseservices/compilerservices/dynamicobjectproperties/TestAPIs.csproj +++ b/src/tests/baseservices/compilerservices/dynamicobjectproperties/TestAPIs.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/compilerservices/dynamicobjectproperties/TestGC.csproj b/src/tests/baseservices/compilerservices/dynamicobjectproperties/TestGC.csproj index 24f322e486ed5c..c14a5a1fb87947 100644 --- a/src/tests/baseservices/compilerservices/dynamicobjectproperties/TestGC.csproj +++ b/src/tests/baseservices/compilerservices/dynamicobjectproperties/TestGC.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/compilerservices/dynamicobjectproperties/TestOverrides.csproj b/src/tests/baseservices/compilerservices/dynamicobjectproperties/TestOverrides.csproj index 09d4a509a9f85e..f01a592dfedb9e 100644 --- a/src/tests/baseservices/compilerservices/dynamicobjectproperties/TestOverrides.csproj +++ b/src/tests/baseservices/compilerservices/dynamicobjectproperties/TestOverrides.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/compilerservices/dynamicobjectproperties/dev10_535767.cs b/src/tests/baseservices/compilerservices/dynamicobjectproperties/dev10_535767.cs index a96ff4e444753a..8a89599ad93931 100644 --- a/src/tests/baseservices/compilerservices/dynamicobjectproperties/dev10_535767.cs +++ b/src/tests/baseservices/compilerservices/dynamicobjectproperties/dev10_535767.cs @@ -41,6 +41,7 @@ using System; using System.Runtime.CompilerServices; +using Xunit; // How we assign nodes to dependent handles. enum TableStyle @@ -357,10 +358,11 @@ public Node(TestSet owner, int id) } // The test class itself. -class DhTest1 +public class DhTest1 { // Entry point. - public static int Main() + [Fact] + public static int TestEntryPoint() { // The actual test runs are controlled from RunTest. True is returned if all succeeded, false // otherwise. diff --git a/src/tests/baseservices/compilerservices/dynamicobjectproperties/test448035.cs b/src/tests/baseservices/compilerservices/dynamicobjectproperties/test448035.cs index 77686303d7a83c..ce8d837cb23248 100644 --- a/src/tests/baseservices/compilerservices/dynamicobjectproperties/test448035.cs +++ b/src/tests/baseservices/compilerservices/dynamicobjectproperties/test448035.cs @@ -2,8 +2,9 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Runtime.CompilerServices; +using Xunit; -class Test_test448035 +public class Test_test448035 { int countdown; @@ -28,7 +29,8 @@ class Test_test448035 static ConditionalWeakTable table = new ConditionalWeakTable(); - public static int Main() + [Fact] + public static void TestEntryPoint() { for (int i = 0; i < 10; i++) { @@ -37,8 +39,6 @@ public static int Main() new Test_test448035(5).ToString(); - Console.WriteLine("PASS: Test did not assert"); - return 100; + Console.WriteLine("PASS: Test did not assert"); } } - diff --git a/src/tests/baseservices/compilerservices/dynamicobjectproperties/test448035.csproj b/src/tests/baseservices/compilerservices/dynamicobjectproperties/test448035.csproj index 2c7576c6a7c3de..8e134490b57802 100644 --- a/src/tests/baseservices/compilerservices/dynamicobjectproperties/test448035.csproj +++ b/src/tests/baseservices/compilerservices/dynamicobjectproperties/test448035.csproj @@ -1,6 +1,5 @@ - Exe true true 1 diff --git a/src/tests/baseservices/compilerservices/dynamicobjectproperties/testapis.cs b/src/tests/baseservices/compilerservices/dynamicobjectproperties/testapis.cs index 842db1275b9729..cf05613f0aa5d1 100644 --- a/src/tests/baseservices/compilerservices/dynamicobjectproperties/testapis.cs +++ b/src/tests/baseservices/compilerservices/dynamicobjectproperties/testapis.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.CompilerServices; using System.Collections.Generic; +using Xunit; public class Driver where K : class @@ -438,7 +439,8 @@ public static void NoDefaulConstructor() public class TestAPIs { - public static int Main() + [Fact] + public static int TestEntryPoint() { Random r = new Random(); diff --git a/src/tests/baseservices/compilerservices/dynamicobjectproperties/testgc.cs b/src/tests/baseservices/compilerservices/dynamicobjectproperties/testgc.cs index 4d79dbf142b574..152474ffa96d6f 100644 --- a/src/tests/baseservices/compilerservices/dynamicobjectproperties/testgc.cs +++ b/src/tests/baseservices/compilerservices/dynamicobjectproperties/testgc.cs @@ -1,5 +1,6 @@ using System; using System.Runtime.CompilerServices; +using Xunit; public class TestGC { @@ -235,7 +236,8 @@ public static void TestKeyWithOutsideReferences_Pass2(int length) GC.KeepAlive(tbl); } - public static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/baseservices/compilerservices/dynamicobjectproperties/testoverrides.cs b/src/tests/baseservices/compilerservices/dynamicobjectproperties/testoverrides.cs index e338e546c379db..4981977698a504 100644 --- a/src/tests/baseservices/compilerservices/dynamicobjectproperties/testoverrides.cs +++ b/src/tests/baseservices/compilerservices/dynamicobjectproperties/testoverrides.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Runtime.CompilerServices; +using Xunit; public class AKey { @@ -66,7 +67,8 @@ public static void TestOverrides() } } - public static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/baseservices/compilerservices/modulector/moduleCctor.ilproj b/src/tests/baseservices/compilerservices/modulector/moduleCctor.ilproj index 9b614c7ab4e4c3..081b39f14a1018 100644 --- a/src/tests/baseservices/compilerservices/modulector/moduleCctor.ilproj +++ b/src/tests/baseservices/compilerservices/modulector/moduleCctor.ilproj @@ -1,7 +1,4 @@ - - Library - diff --git a/src/tests/baseservices/compilerservices/modulector/runmoduleconstructor.cs b/src/tests/baseservices/compilerservices/modulector/runmoduleconstructor.cs index 389837e8e6d102..c3aa0693424614 100644 --- a/src/tests/baseservices/compilerservices/modulector/runmoduleconstructor.cs +++ b/src/tests/baseservices/compilerservices/modulector/runmoduleconstructor.cs @@ -7,10 +7,12 @@ using System.Runtime.Loader; using System.Runtime.CompilerServices; using System.Globalization; +using Xunit; -class RuntimeHelperTest +public class RuntimeHelperTest { - public static int Main() + [Fact] + public static void TestEntryPoint() { AssemblyLoadContext resolver0 = AssemblyLoadContext.GetLoadContext(Assembly.GetExecutingAssembly()); Assembly asm0 = resolver0.LoadFromAssemblyName(new AssemblyName("moduleCctor")); @@ -29,9 +31,5 @@ public static int Main() check.Invoke(null, final); RuntimeHelpers.RunModuleConstructor(mod.ModuleHandle); check.Invoke(null, final); - - - return 100; - } } diff --git a/src/tests/baseservices/compilerservices/modulector/runmoduleconstructor.csproj b/src/tests/baseservices/compilerservices/modulector/runmoduleconstructor.csproj index eedec9c2e8c306..489a746dbc7e7d 100644 --- a/src/tests/baseservices/compilerservices/modulector/runmoduleconstructor.csproj +++ b/src/tests/baseservices/compilerservices/modulector/runmoduleconstructor.csproj @@ -1,6 +1,7 @@ - Exe + + true 1 diff --git a/src/tests/baseservices/exceptions/AccessViolationException/AVException01.cs b/src/tests/baseservices/exceptions/AccessViolationException/AVException01.cs index f479faa53ab13a..9ddd89669e2d17 100644 --- a/src/tests/baseservices/exceptions/AccessViolationException/AVException01.cs +++ b/src/tests/baseservices/exceptions/AccessViolationException/AVException01.cs @@ -2,13 +2,15 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; public class test { private object _state = null; private static test _obj = null; - public static int Main() + [Fact] + public static int TestEntryPoint() { int ret = 0; try diff --git a/src/tests/baseservices/exceptions/AccessViolationException/AVException01.csproj b/src/tests/baseservices/exceptions/AccessViolationException/AVException01.csproj index 4235c59760d55d..f46e05eaf0b7fd 100644 --- a/src/tests/baseservices/exceptions/AccessViolationException/AVException01.csproj +++ b/src/tests/baseservices/exceptions/AccessViolationException/AVException01.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/AccessViolationException/AVException02.cs b/src/tests/baseservices/exceptions/AccessViolationException/AVException02.cs index 1679d5cb9c417a..a82f6dd55e1cb8 100644 --- a/src/tests/baseservices/exceptions/AccessViolationException/AVException02.cs +++ b/src/tests/baseservices/exceptions/AccessViolationException/AVException02.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 Xunit; public class test { #pragma warning disable 414 @@ -8,7 +9,8 @@ public class test #pragma warning restore 414 private static test _obj = null; - public static int Main() + [Fact] + public static int TestEntryPoint() { int ret = 0; try diff --git a/src/tests/baseservices/exceptions/AccessViolationException/AVException02.csproj b/src/tests/baseservices/exceptions/AccessViolationException/AVException02.csproj index 0cfdc4c5f11519..e392844d45ba7e 100644 --- a/src/tests/baseservices/exceptions/AccessViolationException/AVException02.csproj +++ b/src/tests/baseservices/exceptions/AccessViolationException/AVException02.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/AccessViolationException/AVException03.cs b/src/tests/baseservices/exceptions/AccessViolationException/AVException03.cs index bcf41d0dc6b375..23eafb9ddeec9c 100644 --- a/src/tests/baseservices/exceptions/AccessViolationException/AVException03.cs +++ b/src/tests/baseservices/exceptions/AccessViolationException/AVException03.cs @@ -2,13 +2,15 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; public class test { private object _state = null; private static test _obj = null; - public static int Main() + [Fact] + public static int TestEntryPoint() { int ret = 0; Object temp = new Object(); diff --git a/src/tests/baseservices/exceptions/AccessViolationException/AVException03.csproj b/src/tests/baseservices/exceptions/AccessViolationException/AVException03.csproj index da4aa952847c60..8e5d9404efe404 100644 --- a/src/tests/baseservices/exceptions/AccessViolationException/AVException03.csproj +++ b/src/tests/baseservices/exceptions/AccessViolationException/AVException03.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/Directory.Build.props b/src/tests/baseservices/exceptions/Directory.Build.props new file mode 100644 index 00000000000000..468da893df723a --- /dev/null +++ b/src/tests/baseservices/exceptions/Directory.Build.props @@ -0,0 +1,10 @@ + + + + + + true + $(NoWarn);xUnit1013 + false + + diff --git a/src/tests/baseservices/exceptions/StackTracePreserve/StackTracePreserveTests.cs b/src/tests/baseservices/exceptions/StackTracePreserve/StackTracePreserveTests.cs index da01c3b94f50cd..ec0868b6f040d4 100644 --- a/src/tests/baseservices/exceptions/StackTracePreserve/StackTracePreserveTests.cs +++ b/src/tests/baseservices/exceptions/StackTracePreserve/StackTracePreserveTests.cs @@ -5,8 +5,9 @@ using System.Runtime.ExceptionServices; using System.IO; using System.Security; +using Xunit; -class InactiveForeignException +public class InactiveForeignException { private static ExceptionDispatchInfo s_EDI = null; private static int iPassed = 0, iFailed = 0; @@ -501,7 +502,8 @@ private static void ProcessStatus(bool fPassed) } - public static int Main() + [Fact] + public static int TestEntryPoint() { iPassed = iFailed = 0; diff --git a/src/tests/baseservices/exceptions/StackTracePreserve/StackTracePreserveTests.csproj b/src/tests/baseservices/exceptions/StackTracePreserve/StackTracePreserveTests.csproj index c684e66b2b8221..d4102a7465bc15 100644 --- a/src/tests/baseservices/exceptions/StackTracePreserve/StackTracePreserveTests.csproj +++ b/src/tests/baseservices/exceptions/StackTracePreserve/StackTracePreserveTests.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/WindowsEventLog/WindowsEventLog_TargetUnix.csproj b/src/tests/baseservices/exceptions/WindowsEventLog/WindowsEventLog_TargetUnix.csproj index 36b5aecf07808e..78088fac857eb4 100644 --- a/src/tests/baseservices/exceptions/WindowsEventLog/WindowsEventLog_TargetUnix.csproj +++ b/src/tests/baseservices/exceptions/WindowsEventLog/WindowsEventLog_TargetUnix.csproj @@ -1,6 +1,10 @@ - Exe + + + true + false + true true diff --git a/src/tests/baseservices/exceptions/WindowsEventLog/WindowsEventLog_TargetWindows.csproj b/src/tests/baseservices/exceptions/WindowsEventLog/WindowsEventLog_TargetWindows.csproj index 862bebbb040e92..29b8bbdb92cf79 100644 --- a/src/tests/baseservices/exceptions/WindowsEventLog/WindowsEventLog_TargetWindows.csproj +++ b/src/tests/baseservices/exceptions/WindowsEventLog/WindowsEventLog_TargetWindows.csproj @@ -1,6 +1,10 @@ - Exe + + + true + false + WINDOWS true diff --git a/src/tests/baseservices/exceptions/baseservices-exceptions.csproj b/src/tests/baseservices/exceptions/baseservices-exceptions.csproj new file mode 100644 index 00000000000000..f751282d127da4 --- /dev/null +++ b/src/tests/baseservices/exceptions/baseservices-exceptions.csproj @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/tests/baseservices/exceptions/generics/GenericExceptions.cs b/src/tests/baseservices/exceptions/generics/GenericExceptions.cs index e43003e3061892..ed2a9bea53dc90 100644 --- a/src/tests/baseservices/exceptions/generics/GenericExceptions.cs +++ b/src/tests/baseservices/exceptions/generics/GenericExceptions.cs @@ -4,6 +4,7 @@ using System; using System.Globalization; using System.IO; +using Xunit; class MyException : Exception { @@ -300,7 +301,8 @@ public static void StructInstanceFunctionWithManyArgs() [System.Runtime.CompilerServices.MethodImpl( System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - public static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/baseservices/exceptions/generics/GenericExceptions.csproj b/src/tests/baseservices/exceptions/generics/GenericExceptions.csproj index 1b66be814ec948..d5783ff8da22af 100644 --- a/src/tests/baseservices/exceptions/generics/GenericExceptions.csproj +++ b/src/tests/baseservices/exceptions/generics/GenericExceptions.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/GenericExceptions01.csproj b/src/tests/baseservices/exceptions/generics/GenericExceptions01.csproj index fa9606017239a6..03b7210c47be32 100644 --- a/src/tests/baseservices/exceptions/generics/GenericExceptions01.csproj +++ b/src/tests/baseservices/exceptions/generics/GenericExceptions01.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/GenericExceptions02.csproj b/src/tests/baseservices/exceptions/generics/GenericExceptions02.csproj index e085b611b098de..2c5de57ccbaec8 100644 --- a/src/tests/baseservices/exceptions/generics/GenericExceptions02.csproj +++ b/src/tests/baseservices/exceptions/generics/GenericExceptions02.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/GenericExceptions03.csproj b/src/tests/baseservices/exceptions/generics/GenericExceptions03.csproj index 804838a3b657dc..ce64432fb28d2c 100644 --- a/src/tests/baseservices/exceptions/generics/GenericExceptions03.csproj +++ b/src/tests/baseservices/exceptions/generics/GenericExceptions03.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/GenericExceptions04.csproj b/src/tests/baseservices/exceptions/generics/GenericExceptions04.csproj index 2c154409793f59..2c3a4c45291e7e 100644 --- a/src/tests/baseservices/exceptions/generics/GenericExceptions04.csproj +++ b/src/tests/baseservices/exceptions/generics/GenericExceptions04.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/GenericExceptions05.csproj b/src/tests/baseservices/exceptions/generics/GenericExceptions05.csproj index 4a6771c3c3a42e..3765c54d5624c7 100644 --- a/src/tests/baseservices/exceptions/generics/GenericExceptions05.csproj +++ b/src/tests/baseservices/exceptions/generics/GenericExceptions05.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/GenericExceptions06.csproj b/src/tests/baseservices/exceptions/generics/GenericExceptions06.csproj index 40a508bd9babd8..af24deb6dafacc 100644 --- a/src/tests/baseservices/exceptions/generics/GenericExceptions06.csproj +++ b/src/tests/baseservices/exceptions/generics/GenericExceptions06.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/GenericExceptions07.csproj b/src/tests/baseservices/exceptions/generics/GenericExceptions07.csproj index 5656dc8854e7f6..2bcef54754b70e 100644 --- a/src/tests/baseservices/exceptions/generics/GenericExceptions07.csproj +++ b/src/tests/baseservices/exceptions/generics/GenericExceptions07.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/GenericExceptions08.csproj b/src/tests/baseservices/exceptions/generics/GenericExceptions08.csproj index 3542026eaf311e..054a1932d554b0 100644 --- a/src/tests/baseservices/exceptions/generics/GenericExceptions08.csproj +++ b/src/tests/baseservices/exceptions/generics/GenericExceptions08.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/TypeParameter001.csproj b/src/tests/baseservices/exceptions/generics/TypeParameter001.csproj index d3d4a495af9b15..dc18d729fe7a87 100644 --- a/src/tests/baseservices/exceptions/generics/TypeParameter001.csproj +++ b/src/tests/baseservices/exceptions/generics/TypeParameter001.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/TypeParameter002.csproj b/src/tests/baseservices/exceptions/generics/TypeParameter002.csproj index d9b00f4f7c94cf..3845a34a4d09f9 100644 --- a/src/tests/baseservices/exceptions/generics/TypeParameter002.csproj +++ b/src/tests/baseservices/exceptions/generics/TypeParameter002.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/TypeParameter003.csproj b/src/tests/baseservices/exceptions/generics/TypeParameter003.csproj index 3d4b4bdfed2cd7..7b358c3392fceb 100644 --- a/src/tests/baseservices/exceptions/generics/TypeParameter003.csproj +++ b/src/tests/baseservices/exceptions/generics/TypeParameter003.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/TypeParameter004.csproj b/src/tests/baseservices/exceptions/generics/TypeParameter004.csproj index abe74e05bb7426..a6a2d923fb4f1b 100644 --- a/src/tests/baseservices/exceptions/generics/TypeParameter004.csproj +++ b/src/tests/baseservices/exceptions/generics/TypeParameter004.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/TypeParameter005.csproj b/src/tests/baseservices/exceptions/generics/TypeParameter005.csproj index 06b8c69d3a5652..56994aa6c4f3fc 100644 --- a/src/tests/baseservices/exceptions/generics/TypeParameter005.csproj +++ b/src/tests/baseservices/exceptions/generics/TypeParameter005.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/TypeParameter006.csproj b/src/tests/baseservices/exceptions/generics/TypeParameter006.csproj index 6e3bded0a52f46..5df08c34b946c3 100644 --- a/src/tests/baseservices/exceptions/generics/TypeParameter006.csproj +++ b/src/tests/baseservices/exceptions/generics/TypeParameter006.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/TypeParameter007.csproj b/src/tests/baseservices/exceptions/generics/TypeParameter007.csproj index de0249704b58fd..cdd49832c2868e 100644 --- a/src/tests/baseservices/exceptions/generics/TypeParameter007.csproj +++ b/src/tests/baseservices/exceptions/generics/TypeParameter007.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/TypeParameter008.csproj b/src/tests/baseservices/exceptions/generics/TypeParameter008.csproj index c794edf9c6135c..f0026cb3365742 100644 --- a/src/tests/baseservices/exceptions/generics/TypeParameter008.csproj +++ b/src/tests/baseservices/exceptions/generics/TypeParameter008.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/TypeParameter009.csproj b/src/tests/baseservices/exceptions/generics/TypeParameter009.csproj index 9001fd5b86bcb0..dfa30401d312e2 100644 --- a/src/tests/baseservices/exceptions/generics/TypeParameter009.csproj +++ b/src/tests/baseservices/exceptions/generics/TypeParameter009.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/TypeParameter010.csproj b/src/tests/baseservices/exceptions/generics/TypeParameter010.csproj index a62a514dd2474a..d5c4ed1e2889ad 100644 --- a/src/tests/baseservices/exceptions/generics/TypeParameter010.csproj +++ b/src/tests/baseservices/exceptions/generics/TypeParameter010.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/TypeParameter011.csproj b/src/tests/baseservices/exceptions/generics/TypeParameter011.csproj index 275da6d8bbd3bb..d9b5d68509199e 100644 --- a/src/tests/baseservices/exceptions/generics/TypeParameter011.csproj +++ b/src/tests/baseservices/exceptions/generics/TypeParameter011.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/TypeParameter012.csproj b/src/tests/baseservices/exceptions/generics/TypeParameter012.csproj index abadef9011b2dc..22c3166a50f15d 100644 --- a/src/tests/baseservices/exceptions/generics/TypeParameter012.csproj +++ b/src/tests/baseservices/exceptions/generics/TypeParameter012.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/TypeParameter013.csproj b/src/tests/baseservices/exceptions/generics/TypeParameter013.csproj index c76d51825c9ae5..ff021d4b326206 100644 --- a/src/tests/baseservices/exceptions/generics/TypeParameter013.csproj +++ b/src/tests/baseservices/exceptions/generics/TypeParameter013.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/TypeParameter014.csproj b/src/tests/baseservices/exceptions/generics/TypeParameter014.csproj index 33c4511b691a64..afbb1d3bd0bc83 100644 --- a/src/tests/baseservices/exceptions/generics/TypeParameter014.csproj +++ b/src/tests/baseservices/exceptions/generics/TypeParameter014.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/TypeParameter015.csproj b/src/tests/baseservices/exceptions/generics/TypeParameter015.csproj index c8e71728d46c4c..d8049c3fbe2f67 100644 --- a/src/tests/baseservices/exceptions/generics/TypeParameter015.csproj +++ b/src/tests/baseservices/exceptions/generics/TypeParameter015.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/TypeParameter016.csproj b/src/tests/baseservices/exceptions/generics/TypeParameter016.csproj index b14e0b9d5656c0..e99dabb5898657 100644 --- a/src/tests/baseservices/exceptions/generics/TypeParameter016.csproj +++ b/src/tests/baseservices/exceptions/generics/TypeParameter016.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/TypeParameter017.csproj b/src/tests/baseservices/exceptions/generics/TypeParameter017.csproj index bc829d3ded59e7..86a450a1a2e7df 100644 --- a/src/tests/baseservices/exceptions/generics/TypeParameter017.csproj +++ b/src/tests/baseservices/exceptions/generics/TypeParameter017.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/TypeParameter018.csproj b/src/tests/baseservices/exceptions/generics/TypeParameter018.csproj index 7ea7ebec8d2d0a..903a55af5dcb79 100644 --- a/src/tests/baseservices/exceptions/generics/TypeParameter018.csproj +++ b/src/tests/baseservices/exceptions/generics/TypeParameter018.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/genericexceptions01.cs b/src/tests/baseservices/exceptions/generics/genericexceptions01.cs index 45ae71b88efa3f..6e56f9c09b84fb 100644 --- a/src/tests/baseservices/exceptions/generics/genericexceptions01.cs +++ b/src/tests/baseservices/exceptions/generics/genericexceptions01.cs @@ -3,6 +3,7 @@ using System; using System.Globalization; using System.IO; +using Xunit; class MyException : Exception { @@ -55,7 +56,8 @@ public static void InstanceFunctionWithFewArgs() (new A()).InstanceFunctionWithFewArgs(); } [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - public static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/baseservices/exceptions/generics/genericexceptions02.cs b/src/tests/baseservices/exceptions/generics/genericexceptions02.cs index 0b0fbf66c83738..915c8dd977cbc6 100644 --- a/src/tests/baseservices/exceptions/generics/genericexceptions02.cs +++ b/src/tests/baseservices/exceptions/generics/genericexceptions02.cs @@ -3,6 +3,7 @@ using System; using System.Globalization; using System.IO; +using Xunit; class MyException : Exception { @@ -53,7 +54,8 @@ public static void InstanceFunctionWithManyArgs() (new A()).InstanceFunctionWithManyArgs(1, 2, 3, Help.s_object); } [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - public static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/baseservices/exceptions/generics/genericexceptions03.cs b/src/tests/baseservices/exceptions/generics/genericexceptions03.cs index ee74aac015ba90..479323c99fbaf6 100644 --- a/src/tests/baseservices/exceptions/generics/genericexceptions03.cs +++ b/src/tests/baseservices/exceptions/generics/genericexceptions03.cs @@ -3,6 +3,7 @@ using System; using System.Globalization; using System.IO; +using Xunit; class MyException : Exception { @@ -60,7 +61,8 @@ public static void StaticFunctionWithFewArgs() [System.Runtime.CompilerServices.MethodImpl( System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - public static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/baseservices/exceptions/generics/genericexceptions04.cs b/src/tests/baseservices/exceptions/generics/genericexceptions04.cs index 6ed56fa3d2d6fd..407c99967b9e85 100644 --- a/src/tests/baseservices/exceptions/generics/genericexceptions04.cs +++ b/src/tests/baseservices/exceptions/generics/genericexceptions04.cs @@ -3,6 +3,7 @@ using System; using System.Globalization; using System.IO; +using Xunit; class MyException : Exception { @@ -53,7 +54,8 @@ public static void StaticFunctionWithManyArgs() A.StaticFunctionWithManyArgs(1, 2, 3, Help.s_object); } [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - public static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/baseservices/exceptions/generics/genericexceptions05.cs b/src/tests/baseservices/exceptions/generics/genericexceptions05.cs index 0eac4cd59d33bf..b5cad1a374f86a 100644 --- a/src/tests/baseservices/exceptions/generics/genericexceptions05.cs +++ b/src/tests/baseservices/exceptions/generics/genericexceptions05.cs @@ -3,6 +3,7 @@ using System; using System.Globalization; using System.IO; +using Xunit; class MyException : Exception { @@ -54,7 +55,8 @@ public static void GenericFunctionWithFewArgs() A.GenericFunctionWithFewArgs(); } [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - public static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/baseservices/exceptions/generics/genericexceptions06.cs b/src/tests/baseservices/exceptions/generics/genericexceptions06.cs index b38fcc4ae8ea41..60199a4c2301b1 100644 --- a/src/tests/baseservices/exceptions/generics/genericexceptions06.cs +++ b/src/tests/baseservices/exceptions/generics/genericexceptions06.cs @@ -3,6 +3,7 @@ using System; using System.Globalization; using System.IO; +using Xunit; class MyException : Exception { @@ -54,7 +55,8 @@ public static void GenericFunctionWithManyArgs() A.GenericFunctionWithManyArgs(1, 2, 3, Help.s_object); } [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - public static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/baseservices/exceptions/generics/genericexceptions07.cs b/src/tests/baseservices/exceptions/generics/genericexceptions07.cs index ca9f57eb72a9cc..5cb24c4cd85855 100644 --- a/src/tests/baseservices/exceptions/generics/genericexceptions07.cs +++ b/src/tests/baseservices/exceptions/generics/genericexceptions07.cs @@ -3,6 +3,7 @@ using System; using System.Globalization; using System.IO; +using Xunit; class MyException : Exception { @@ -53,7 +54,8 @@ public static void StructInstanceFunctionWithFewArgs() (new Struct()).StructInstanceFunctionWithFewArgs(); } [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - public static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/baseservices/exceptions/generics/genericexceptions08.cs b/src/tests/baseservices/exceptions/generics/genericexceptions08.cs index 2d6902514fad73..2f0873bd516fd5 100644 --- a/src/tests/baseservices/exceptions/generics/genericexceptions08.cs +++ b/src/tests/baseservices/exceptions/generics/genericexceptions08.cs @@ -3,6 +3,7 @@ using System; using System.Globalization; using System.IO; +using Xunit; class MyException : Exception { @@ -53,7 +54,8 @@ public static void StructInstanceFunctionWithManyArgs() (new Struct()).StructInstanceFunctionWithManyArgs(1, 2, 3, Help.s_object); } [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)] - public static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/baseservices/exceptions/generics/nested-try-catch01.cs b/src/tests/baseservices/exceptions/generics/nested-try-catch01.cs index 2d53dfd8e28b18..0212ed1e28a2a6 100644 --- a/src/tests/baseservices/exceptions/generics/nested-try-catch01.cs +++ b/src/tests/baseservices/exceptions/generics/nested-try-catch01.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -73,7 +74,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(true); new Gen().ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/nested-try-catch01.csproj b/src/tests/baseservices/exceptions/generics/nested-try-catch01.csproj index 6151cfb8822d20..f6b41fddeac98f 100644 --- a/src/tests/baseservices/exceptions/generics/nested-try-catch01.csproj +++ b/src/tests/baseservices/exceptions/generics/nested-try-catch01.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/nested-try-catch02.cs b/src/tests/baseservices/exceptions/generics/nested-try-catch02.cs index f930aa610dfb21..d6a3adc4be8cee 100644 --- a/src/tests/baseservices/exceptions/generics/nested-try-catch02.cs +++ b/src/tests/baseservices/exceptions/generics/nested-try-catch02.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -64,7 +65,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(true); new Gen().ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/nested-try-catch02.csproj b/src/tests/baseservices/exceptions/generics/nested-try-catch02.csproj index c1eae00179a45f..1617596282f0ca 100644 --- a/src/tests/baseservices/exceptions/generics/nested-try-catch02.csproj +++ b/src/tests/baseservices/exceptions/generics/nested-try-catch02.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/nested-try-catch03.cs b/src/tests/baseservices/exceptions/generics/nested-try-catch03.cs index 91af783e74b270..e9a7fd5a51ab11 100644 --- a/src/tests/baseservices/exceptions/generics/nested-try-catch03.cs +++ b/src/tests/baseservices/exceptions/generics/nested-try-catch03.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -79,7 +80,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(true); new Gen().ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/nested-try-catch03.csproj b/src/tests/baseservices/exceptions/generics/nested-try-catch03.csproj index 7710b4685dbfd1..738238d9bc92be 100644 --- a/src/tests/baseservices/exceptions/generics/nested-try-catch03.csproj +++ b/src/tests/baseservices/exceptions/generics/nested-try-catch03.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/nested-try-catch04.cs b/src/tests/baseservices/exceptions/generics/nested-try-catch04.cs index 85272bb5be73cc..5fe4939d3cfa5a 100644 --- a/src/tests/baseservices/exceptions/generics/nested-try-catch04.cs +++ b/src/tests/baseservices/exceptions/generics/nested-try-catch04.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -70,7 +71,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(true); new Gen().ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/nested-try-catch04.csproj b/src/tests/baseservices/exceptions/generics/nested-try-catch04.csproj index 9795d036228dce..f23b1af391a39b 100644 --- a/src/tests/baseservices/exceptions/generics/nested-try-catch04.csproj +++ b/src/tests/baseservices/exceptions/generics/nested-try-catch04.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/nested-try-catch05.cs b/src/tests/baseservices/exceptions/generics/nested-try-catch05.cs index f095054dfd79e9..a23b30096b7f7a 100644 --- a/src/tests/baseservices/exceptions/generics/nested-try-catch05.cs +++ b/src/tests/baseservices/exceptions/generics/nested-try-catch05.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -84,7 +85,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(true); new Gen().ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/nested-try-catch05.csproj b/src/tests/baseservices/exceptions/generics/nested-try-catch05.csproj index 5acbf186fe5a2b..edbae10df7aabe 100644 --- a/src/tests/baseservices/exceptions/generics/nested-try-catch05.csproj +++ b/src/tests/baseservices/exceptions/generics/nested-try-catch05.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/nested-try-catch06.cs b/src/tests/baseservices/exceptions/generics/nested-try-catch06.cs index 68aeafe9e448b8..6d294f6be5a9ae 100644 --- a/src/tests/baseservices/exceptions/generics/nested-try-catch06.cs +++ b/src/tests/baseservices/exceptions/generics/nested-try-catch06.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -84,7 +85,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(true); new Gen().ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/nested-try-catch06.csproj b/src/tests/baseservices/exceptions/generics/nested-try-catch06.csproj index 768c2726d928da..1a8848673d70aa 100644 --- a/src/tests/baseservices/exceptions/generics/nested-try-catch06.csproj +++ b/src/tests/baseservices/exceptions/generics/nested-try-catch06.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/nested-try-catch07.cs b/src/tests/baseservices/exceptions/generics/nested-try-catch07.cs index bdc084672760ab..9de7ddf9b50b0d 100644 --- a/src/tests/baseservices/exceptions/generics/nested-try-catch07.cs +++ b/src/tests/baseservices/exceptions/generics/nested-try-catch07.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -76,7 +77,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(true); new Gen().ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/nested-try-catch07.csproj b/src/tests/baseservices/exceptions/generics/nested-try-catch07.csproj index 2ead9e567d61a5..6f1e90be47d063 100644 --- a/src/tests/baseservices/exceptions/generics/nested-try-catch07.csproj +++ b/src/tests/baseservices/exceptions/generics/nested-try-catch07.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/nested-try-catch08.cs b/src/tests/baseservices/exceptions/generics/nested-try-catch08.cs index 347a1b1ea3e6c1..cae09404b14014 100644 --- a/src/tests/baseservices/exceptions/generics/nested-try-catch08.cs +++ b/src/tests/baseservices/exceptions/generics/nested-try-catch08.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -76,7 +77,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(true); new Gen().ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/nested-try-catch08.csproj b/src/tests/baseservices/exceptions/generics/nested-try-catch08.csproj index 2f67f1cc816a13..96f1da5418d02b 100644 --- a/src/tests/baseservices/exceptions/generics/nested-try-catch08.csproj +++ b/src/tests/baseservices/exceptions/generics/nested-try-catch08.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/nested-try-catch09.cs b/src/tests/baseservices/exceptions/generics/nested-try-catch09.cs index ba63325d6109a1..d2f3c686cfec0a 100644 --- a/src/tests/baseservices/exceptions/generics/nested-try-catch09.cs +++ b/src/tests/baseservices/exceptions/generics/nested-try-catch09.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -79,7 +80,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(true); new Gen().ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/nested-try-catch09.csproj b/src/tests/baseservices/exceptions/generics/nested-try-catch09.csproj index 807dc438e2eb35..8256e1565c8b43 100644 --- a/src/tests/baseservices/exceptions/generics/nested-try-catch09.csproj +++ b/src/tests/baseservices/exceptions/generics/nested-try-catch09.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/nested-try-catch10.cs b/src/tests/baseservices/exceptions/generics/nested-try-catch10.cs index 19f5f4fde376f6..806d75c6fe2471 100644 --- a/src/tests/baseservices/exceptions/generics/nested-try-catch10.cs +++ b/src/tests/baseservices/exceptions/generics/nested-try-catch10.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -80,7 +81,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(true); new Gen().ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/nested-try-catch10.csproj b/src/tests/baseservices/exceptions/generics/nested-try-catch10.csproj index 51d7705f310129..4a1655d6fb2600 100644 --- a/src/tests/baseservices/exceptions/generics/nested-try-catch10.csproj +++ b/src/tests/baseservices/exceptions/generics/nested-try-catch10.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-catch-finally-struct01.cs b/src/tests/baseservices/exceptions/generics/try-catch-finally-struct01.cs index 107a6694627847..683f77ecbdb073 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch-finally-struct01.cs +++ b/src/tests/baseservices/exceptions/generics/try-catch-finally-struct01.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -72,7 +73,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(true); new Gen().ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/try-catch-finally-struct01.csproj b/src/tests/baseservices/exceptions/generics/try-catch-finally-struct01.csproj index b16eec21e65b75..a6534d221210a6 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch-finally-struct01.csproj +++ b/src/tests/baseservices/exceptions/generics/try-catch-finally-struct01.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-catch-finally-struct02.cs b/src/tests/baseservices/exceptions/generics/try-catch-finally-struct02.cs index ccca794253b978..e4c5ec39fda143 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch-finally-struct02.cs +++ b/src/tests/baseservices/exceptions/generics/try-catch-finally-struct02.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -67,7 +68,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(true); new Gen().ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/try-catch-finally-struct02.csproj b/src/tests/baseservices/exceptions/generics/try-catch-finally-struct02.csproj index 1d04b0dc82541f..3a6af4a7ae8efa 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch-finally-struct02.csproj +++ b/src/tests/baseservices/exceptions/generics/try-catch-finally-struct02.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-catch-finally-struct03.cs b/src/tests/baseservices/exceptions/generics/try-catch-finally-struct03.cs index fa9b15f5bf2646..7365286b76b212 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch-finally-struct03.cs +++ b/src/tests/baseservices/exceptions/generics/try-catch-finally-struct03.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -68,7 +69,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(false); new Gen().ExceptionTest(false); diff --git a/src/tests/baseservices/exceptions/generics/try-catch-finally-struct03.csproj b/src/tests/baseservices/exceptions/generics/try-catch-finally-struct03.csproj index 1c345a793a8d1f..9bc8e66b5e8277 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch-finally-struct03.csproj +++ b/src/tests/baseservices/exceptions/generics/try-catch-finally-struct03.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-catch-finally01.cs b/src/tests/baseservices/exceptions/generics/try-catch-finally01.cs index 7a607309bf844e..a2b8c13eff963f 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch-finally01.cs +++ b/src/tests/baseservices/exceptions/generics/try-catch-finally01.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -72,7 +73,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(true); new Gen().ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/try-catch-finally01.csproj b/src/tests/baseservices/exceptions/generics/try-catch-finally01.csproj index 8ec87cce5f662f..b67cf46857c721 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch-finally01.csproj +++ b/src/tests/baseservices/exceptions/generics/try-catch-finally01.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-catch-finally02.cs b/src/tests/baseservices/exceptions/generics/try-catch-finally02.cs index a81176b97c6250..7d850ac3fab314 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch-finally02.cs +++ b/src/tests/baseservices/exceptions/generics/try-catch-finally02.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -67,7 +68,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(true); new Gen().ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/try-catch-finally02.csproj b/src/tests/baseservices/exceptions/generics/try-catch-finally02.csproj index 1325aff2448f2c..032dba68bb4057 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch-finally02.csproj +++ b/src/tests/baseservices/exceptions/generics/try-catch-finally02.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-catch-finally03.cs b/src/tests/baseservices/exceptions/generics/try-catch-finally03.cs index 05d3a0f10ba242..3ab10680821ed0 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch-finally03.cs +++ b/src/tests/baseservices/exceptions/generics/try-catch-finally03.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -68,7 +69,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(false); new Gen().ExceptionTest(false); diff --git a/src/tests/baseservices/exceptions/generics/try-catch-finally03.csproj b/src/tests/baseservices/exceptions/generics/try-catch-finally03.csproj index 078c583c1281c9..580e8b9591f244 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch-finally03.csproj +++ b/src/tests/baseservices/exceptions/generics/try-catch-finally03.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-catch-struct01.cs b/src/tests/baseservices/exceptions/generics/try-catch-struct01.cs index a53a26ef499513..09dd96e89ecd65 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch-struct01.cs +++ b/src/tests/baseservices/exceptions/generics/try-catch-struct01.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -65,7 +66,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(true); new Gen().ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/try-catch-struct01.csproj b/src/tests/baseservices/exceptions/generics/try-catch-struct01.csproj index fea5dae7ecca9d..615b14d7ffeb32 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch-struct01.csproj +++ b/src/tests/baseservices/exceptions/generics/try-catch-struct01.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-catch-struct02.cs b/src/tests/baseservices/exceptions/generics/try-catch-struct02.cs index 29e4e749ed39c5..88c826d69ad91e 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch-struct02.cs +++ b/src/tests/baseservices/exceptions/generics/try-catch-struct02.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -61,7 +62,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(true); new Gen().ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/try-catch-struct02.csproj b/src/tests/baseservices/exceptions/generics/try-catch-struct02.csproj index 09042c1567cf13..45a8d6f28a5f5f 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch-struct02.csproj +++ b/src/tests/baseservices/exceptions/generics/try-catch-struct02.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-catch-struct03.cs b/src/tests/baseservices/exceptions/generics/try-catch-struct03.cs index 3a0b4aed01be5b..63318cafc2bc37 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch-struct03.cs +++ b/src/tests/baseservices/exceptions/generics/try-catch-struct03.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -75,7 +76,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(true); new Gen().ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/try-catch-struct03.csproj b/src/tests/baseservices/exceptions/generics/try-catch-struct03.csproj index 56660eafbb0404..cc79353d01ae01 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch-struct03.csproj +++ b/src/tests/baseservices/exceptions/generics/try-catch-struct03.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-catch-struct04.cs b/src/tests/baseservices/exceptions/generics/try-catch-struct04.cs index 51d16379b16860..22896de0e82ee5 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch-struct04.cs +++ b/src/tests/baseservices/exceptions/generics/try-catch-struct04.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -65,7 +66,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { Gen.ExceptionTest(true); Gen.ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/try-catch-struct04.csproj b/src/tests/baseservices/exceptions/generics/try-catch-struct04.csproj index d1cc851e71cd1e..4b4d1629aae92a 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch-struct04.csproj +++ b/src/tests/baseservices/exceptions/generics/try-catch-struct04.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-catch-struct05.cs b/src/tests/baseservices/exceptions/generics/try-catch-struct05.cs index a9d3cc31ef64c4..e61e0680bca322 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch-struct05.cs +++ b/src/tests/baseservices/exceptions/generics/try-catch-struct05.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -61,7 +62,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { Gen.ExceptionTest(true); Gen.ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/try-catch-struct05.csproj b/src/tests/baseservices/exceptions/generics/try-catch-struct05.csproj index 1998803030a834..748846d245e880 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch-struct05.csproj +++ b/src/tests/baseservices/exceptions/generics/try-catch-struct05.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-catch-struct06.cs b/src/tests/baseservices/exceptions/generics/try-catch-struct06.cs index faa7e3afaa3641..2898254c8b3c74 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch-struct06.cs +++ b/src/tests/baseservices/exceptions/generics/try-catch-struct06.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -65,7 +66,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(true); new Gen().ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/try-catch-struct06.csproj b/src/tests/baseservices/exceptions/generics/try-catch-struct06.csproj index a4e05b874f9efe..f42d32e8dd6cac 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch-struct06.csproj +++ b/src/tests/baseservices/exceptions/generics/try-catch-struct06.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-catch-struct07.cs b/src/tests/baseservices/exceptions/generics/try-catch-struct07.cs index 2a110766159974..8b8104a6b815a9 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch-struct07.cs +++ b/src/tests/baseservices/exceptions/generics/try-catch-struct07.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -61,7 +62,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(true); new Gen().ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/try-catch-struct07.csproj b/src/tests/baseservices/exceptions/generics/try-catch-struct07.csproj index 0d617b435c4338..f40d6aafc39ed7 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch-struct07.csproj +++ b/src/tests/baseservices/exceptions/generics/try-catch-struct07.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-catch-struct08.cs b/src/tests/baseservices/exceptions/generics/try-catch-struct08.cs index ab7dc546061821..8e49bf095094c7 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch-struct08.cs +++ b/src/tests/baseservices/exceptions/generics/try-catch-struct08.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -65,7 +66,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { Gen.ExceptionTest(true); Gen.ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/try-catch-struct08.csproj b/src/tests/baseservices/exceptions/generics/try-catch-struct08.csproj index 681ded284e55f7..1e067003b88c6c 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch-struct08.csproj +++ b/src/tests/baseservices/exceptions/generics/try-catch-struct08.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-catch-struct09.cs b/src/tests/baseservices/exceptions/generics/try-catch-struct09.cs index 63932b2b4b301f..dad22eabc10a3e 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch-struct09.cs +++ b/src/tests/baseservices/exceptions/generics/try-catch-struct09.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -61,7 +62,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { Gen.ExceptionTest(true); Gen.ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/try-catch-struct09.csproj b/src/tests/baseservices/exceptions/generics/try-catch-struct09.csproj index 8e140d5a82fb11..715127fb9182b7 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch-struct09.csproj +++ b/src/tests/baseservices/exceptions/generics/try-catch-struct09.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-catch01.cs b/src/tests/baseservices/exceptions/generics/try-catch01.cs index 22a9efb039175e..94aa92dfc6bbaf 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch01.cs +++ b/src/tests/baseservices/exceptions/generics/try-catch01.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -65,7 +66,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(true); new Gen().ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/try-catch01.csproj b/src/tests/baseservices/exceptions/generics/try-catch01.csproj index 4c3fca8a5a8e06..30420223216e1c 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch01.csproj +++ b/src/tests/baseservices/exceptions/generics/try-catch01.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-catch02.cs b/src/tests/baseservices/exceptions/generics/try-catch02.cs index 3de20e5628251e..27e17734fed7dd 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch02.cs +++ b/src/tests/baseservices/exceptions/generics/try-catch02.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -61,7 +62,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(true); new Gen().ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/try-catch02.csproj b/src/tests/baseservices/exceptions/generics/try-catch02.csproj index 00fd96bc3d21db..39dbdcccdad642 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch02.csproj +++ b/src/tests/baseservices/exceptions/generics/try-catch02.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-catch03.cs b/src/tests/baseservices/exceptions/generics/try-catch03.cs index d59b3fc4aeb4ec..e6e5a15fe478ec 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch03.cs +++ b/src/tests/baseservices/exceptions/generics/try-catch03.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -75,7 +76,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(true); new Gen().ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/try-catch03.csproj b/src/tests/baseservices/exceptions/generics/try-catch03.csproj index 094c7a2970133d..6bc663aad21991 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch03.csproj +++ b/src/tests/baseservices/exceptions/generics/try-catch03.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-catch04.cs b/src/tests/baseservices/exceptions/generics/try-catch04.cs index 1f93c80e22c330..ba9a75686a5535 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch04.cs +++ b/src/tests/baseservices/exceptions/generics/try-catch04.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -65,7 +66,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { Gen.ExceptionTest(true); Gen.ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/try-catch04.csproj b/src/tests/baseservices/exceptions/generics/try-catch04.csproj index 4df4fef94a059c..2f35d40d3b5706 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch04.csproj +++ b/src/tests/baseservices/exceptions/generics/try-catch04.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-catch05.cs b/src/tests/baseservices/exceptions/generics/try-catch05.cs index 17649b35148aaf..24034fdcce1a12 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch05.cs +++ b/src/tests/baseservices/exceptions/generics/try-catch05.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -61,7 +62,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { Gen.ExceptionTest(true); Gen.ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/try-catch05.csproj b/src/tests/baseservices/exceptions/generics/try-catch05.csproj index 3d96639a8abbc4..dcc537b3285cd4 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch05.csproj +++ b/src/tests/baseservices/exceptions/generics/try-catch05.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-catch06.cs b/src/tests/baseservices/exceptions/generics/try-catch06.cs index b26bd5f68d4208..ffcf95f8eba3c9 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch06.cs +++ b/src/tests/baseservices/exceptions/generics/try-catch06.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -65,7 +66,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(true); new Gen().ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/try-catch06.csproj b/src/tests/baseservices/exceptions/generics/try-catch06.csproj index 254d59b5222696..1c6c563763c9fa 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch06.csproj +++ b/src/tests/baseservices/exceptions/generics/try-catch06.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-catch07.cs b/src/tests/baseservices/exceptions/generics/try-catch07.cs index f25805a0ca140a..505ef6f1df1f81 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch07.cs +++ b/src/tests/baseservices/exceptions/generics/try-catch07.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -61,7 +62,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(true); new Gen().ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/try-catch07.csproj b/src/tests/baseservices/exceptions/generics/try-catch07.csproj index aacabc4c3d8643..aedfb705e32123 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch07.csproj +++ b/src/tests/baseservices/exceptions/generics/try-catch07.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-catch08.cs b/src/tests/baseservices/exceptions/generics/try-catch08.cs index 97302ffa377cb3..8e369742bab5ed 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch08.cs +++ b/src/tests/baseservices/exceptions/generics/try-catch08.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -65,7 +66,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { Gen.ExceptionTest(true); Gen.ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/try-catch08.csproj b/src/tests/baseservices/exceptions/generics/try-catch08.csproj index a12d1d405867b9..51d290d8bac92f 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch08.csproj +++ b/src/tests/baseservices/exceptions/generics/try-catch08.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-catch09.cs b/src/tests/baseservices/exceptions/generics/try-catch09.cs index 73f47de9b03268..ac8717e330bc99 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch09.cs +++ b/src/tests/baseservices/exceptions/generics/try-catch09.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -61,7 +62,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { Gen.ExceptionTest(true); Gen.ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/try-catch09.csproj b/src/tests/baseservices/exceptions/generics/try-catch09.csproj index 8756d5b474d501..f259a5fafa4066 100644 --- a/src/tests/baseservices/exceptions/generics/try-catch09.csproj +++ b/src/tests/baseservices/exceptions/generics/try-catch09.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-fault-struct01.ilproj b/src/tests/baseservices/exceptions/generics/try-fault-struct01.ilproj index 3a017dba034b5a..386e2fb473e6fd 100644 --- a/src/tests/baseservices/exceptions/generics/try-fault-struct01.ilproj +++ b/src/tests/baseservices/exceptions/generics/try-fault-struct01.ilproj @@ -1,6 +1,7 @@ - Exe + + true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-fault-struct02.ilproj b/src/tests/baseservices/exceptions/generics/try-fault-struct02.ilproj index 282fa4100fca48..c29f62af4434dd 100644 --- a/src/tests/baseservices/exceptions/generics/try-fault-struct02.ilproj +++ b/src/tests/baseservices/exceptions/generics/try-fault-struct02.ilproj @@ -1,6 +1,7 @@ - Exe + + true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-fault-struct03.ilproj b/src/tests/baseservices/exceptions/generics/try-fault-struct03.ilproj index e9c1a8367d3fbf..26c8802b40d865 100644 --- a/src/tests/baseservices/exceptions/generics/try-fault-struct03.ilproj +++ b/src/tests/baseservices/exceptions/generics/try-fault-struct03.ilproj @@ -1,6 +1,7 @@ - Exe + + true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-fault01.ilproj b/src/tests/baseservices/exceptions/generics/try-fault01.ilproj index ee8ffc5a761bc2..0dcc0703a1a975 100644 --- a/src/tests/baseservices/exceptions/generics/try-fault01.ilproj +++ b/src/tests/baseservices/exceptions/generics/try-fault01.ilproj @@ -1,6 +1,7 @@ - Exe + + true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-fault02.ilproj b/src/tests/baseservices/exceptions/generics/try-fault02.ilproj index 4cd0e191ca1ce8..60acd8bd95bf6b 100644 --- a/src/tests/baseservices/exceptions/generics/try-fault02.ilproj +++ b/src/tests/baseservices/exceptions/generics/try-fault02.ilproj @@ -1,6 +1,7 @@ - Exe + + true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-fault03.ilproj b/src/tests/baseservices/exceptions/generics/try-fault03.ilproj index 037a35a2875cca..55e3e9f5b320b6 100644 --- a/src/tests/baseservices/exceptions/generics/try-fault03.ilproj +++ b/src/tests/baseservices/exceptions/generics/try-fault03.ilproj @@ -1,6 +1,7 @@ - Exe + + true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-filter-finally01.ilproj b/src/tests/baseservices/exceptions/generics/try-filter-finally01.ilproj index 471f0f991c8cd4..ceebcdd6f2dc83 100644 --- a/src/tests/baseservices/exceptions/generics/try-filter-finally01.ilproj +++ b/src/tests/baseservices/exceptions/generics/try-filter-finally01.ilproj @@ -1,6 +1,7 @@ - Exe + + true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-filter-finally02.ilproj b/src/tests/baseservices/exceptions/generics/try-filter-finally02.ilproj index 64cb12acba98d4..f110329a02cbcb 100644 --- a/src/tests/baseservices/exceptions/generics/try-filter-finally02.ilproj +++ b/src/tests/baseservices/exceptions/generics/try-filter-finally02.ilproj @@ -1,6 +1,7 @@ - Exe + + true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-filter-struct02.ilproj b/src/tests/baseservices/exceptions/generics/try-filter-struct02.ilproj index fdbb335a15493e..1b4dd5cbc01523 100644 --- a/src/tests/baseservices/exceptions/generics/try-filter-struct02.ilproj +++ b/src/tests/baseservices/exceptions/generics/try-filter-struct02.ilproj @@ -1,6 +1,7 @@ - Exe + + true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-filter02.ilproj b/src/tests/baseservices/exceptions/generics/try-filter02.ilproj index 0d483f025950d6..81374adde12a22 100644 --- a/src/tests/baseservices/exceptions/generics/try-filter02.ilproj +++ b/src/tests/baseservices/exceptions/generics/try-filter02.ilproj @@ -1,6 +1,7 @@ - Exe + + true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-finally-struct01.cs b/src/tests/baseservices/exceptions/generics/try-finally-struct01.cs index e6306fd4d2114e..e3bc8d0aadb42c 100644 --- a/src/tests/baseservices/exceptions/generics/try-finally-struct01.cs +++ b/src/tests/baseservices/exceptions/generics/try-finally-struct01.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -73,7 +74,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(true); new Gen().ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/try-finally-struct01.csproj b/src/tests/baseservices/exceptions/generics/try-finally-struct01.csproj index ed3afe4ba2a75d..02c87355d4a798 100644 --- a/src/tests/baseservices/exceptions/generics/try-finally-struct01.csproj +++ b/src/tests/baseservices/exceptions/generics/try-finally-struct01.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-finally-struct02.cs b/src/tests/baseservices/exceptions/generics/try-finally-struct02.cs index f5aab70b45c641..e26159d05ef9e3 100644 --- a/src/tests/baseservices/exceptions/generics/try-finally-struct02.cs +++ b/src/tests/baseservices/exceptions/generics/try-finally-struct02.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -72,7 +73,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(false); new Gen().ExceptionTest(false); diff --git a/src/tests/baseservices/exceptions/generics/try-finally-struct02.csproj b/src/tests/baseservices/exceptions/generics/try-finally-struct02.csproj index 919945e5e437c6..aa37ab9f989911 100644 --- a/src/tests/baseservices/exceptions/generics/try-finally-struct02.csproj +++ b/src/tests/baseservices/exceptions/generics/try-finally-struct02.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-finally-struct03.cs b/src/tests/baseservices/exceptions/generics/try-finally-struct03.cs index cf512fc82a4b8b..f1ef5000efb0c3 100644 --- a/src/tests/baseservices/exceptions/generics/try-finally-struct03.cs +++ b/src/tests/baseservices/exceptions/generics/try-finally-struct03.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -74,7 +75,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(true); new Gen().ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/try-finally-struct03.csproj b/src/tests/baseservices/exceptions/generics/try-finally-struct03.csproj index 29fca0e7e27af5..1e53e744a3f09d 100644 --- a/src/tests/baseservices/exceptions/generics/try-finally-struct03.csproj +++ b/src/tests/baseservices/exceptions/generics/try-finally-struct03.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-finally01.cs b/src/tests/baseservices/exceptions/generics/try-finally01.cs index 437fdc198f0956..e7334630c2c885 100644 --- a/src/tests/baseservices/exceptions/generics/try-finally01.cs +++ b/src/tests/baseservices/exceptions/generics/try-finally01.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -73,7 +74,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(true); new Gen().ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/try-finally01.csproj b/src/tests/baseservices/exceptions/generics/try-finally01.csproj index 123e23bd7e3fe6..2ed02426831e28 100644 --- a/src/tests/baseservices/exceptions/generics/try-finally01.csproj +++ b/src/tests/baseservices/exceptions/generics/try-finally01.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-finally02.cs b/src/tests/baseservices/exceptions/generics/try-finally02.cs index 3c0e937df02e5a..8a5939949a474b 100644 --- a/src/tests/baseservices/exceptions/generics/try-finally02.cs +++ b/src/tests/baseservices/exceptions/generics/try-finally02.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -72,7 +73,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(false); new Gen().ExceptionTest(false); diff --git a/src/tests/baseservices/exceptions/generics/try-finally02.csproj b/src/tests/baseservices/exceptions/generics/try-finally02.csproj index 797cfa60c76a03..513da1e6773381 100644 --- a/src/tests/baseservices/exceptions/generics/try-finally02.csproj +++ b/src/tests/baseservices/exceptions/generics/try-finally02.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/try-finally03.cs b/src/tests/baseservices/exceptions/generics/try-finally03.cs index 89ae042f7ada19..b1d00bc3409996 100644 --- a/src/tests/baseservices/exceptions/generics/try-finally03.cs +++ b/src/tests/baseservices/exceptions/generics/try-finally03.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 Xunit; public struct ValX0 {} public struct ValY0 {} @@ -74,7 +75,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(true); new Gen().ExceptionTest(true); diff --git a/src/tests/baseservices/exceptions/generics/try-finally03.csproj b/src/tests/baseservices/exceptions/generics/try-finally03.csproj index cf689aeb2e167b..db55dfb6c83aca 100644 --- a/src/tests/baseservices/exceptions/generics/try-finally03.csproj +++ b/src/tests/baseservices/exceptions/generics/try-finally03.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/generics/typeparameter001.cs b/src/tests/baseservices/exceptions/generics/typeparameter001.cs index 090cea95525ee4..361a959f83d9fc 100644 --- a/src/tests/baseservices/exceptions/generics/typeparameter001.cs +++ b/src/tests/baseservices/exceptions/generics/typeparameter001.cs @@ -11,6 +11,7 @@ // using System; +using Xunit; public struct ValX0 {} public struct ValY0 {} @@ -67,7 +68,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { Gen.ExceptionTest(new Exception()); Gen.ExceptionTest(new InvalidOperationException()); diff --git a/src/tests/baseservices/exceptions/generics/typeparameter002.cs b/src/tests/baseservices/exceptions/generics/typeparameter002.cs index 24387963d31dd7..9c8e8d7e910305 100644 --- a/src/tests/baseservices/exceptions/generics/typeparameter002.cs +++ b/src/tests/baseservices/exceptions/generics/typeparameter002.cs @@ -11,6 +11,7 @@ // using System; +using Xunit; public struct ValX0 {} public struct ValY0 {} @@ -67,7 +68,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { Gen.ExceptionTest(new Exception()); Gen.ExceptionTest(new InvalidOperationException()); diff --git a/src/tests/baseservices/exceptions/generics/typeparameter003.cs b/src/tests/baseservices/exceptions/generics/typeparameter003.cs index 0948989ded9040..c5532d4ecf8081 100644 --- a/src/tests/baseservices/exceptions/generics/typeparameter003.cs +++ b/src/tests/baseservices/exceptions/generics/typeparameter003.cs @@ -12,6 +12,7 @@ // using System; +using Xunit; public struct ValX0 {} public struct ValY0 {} @@ -68,7 +69,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(new Exception()); new Gen().ExceptionTest(new InvalidOperationException()); diff --git a/src/tests/baseservices/exceptions/generics/typeparameter004.cs b/src/tests/baseservices/exceptions/generics/typeparameter004.cs index c5b08cfb4e8efa..74941ff56df1f3 100644 --- a/src/tests/baseservices/exceptions/generics/typeparameter004.cs +++ b/src/tests/baseservices/exceptions/generics/typeparameter004.cs @@ -11,6 +11,7 @@ // using System; +using Xunit; public struct ValX0 {} public struct ValY0 {} @@ -67,7 +68,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(new Exception()); new Gen().ExceptionTest(new InvalidOperationException()); diff --git a/src/tests/baseservices/exceptions/generics/typeparameter005.cs b/src/tests/baseservices/exceptions/generics/typeparameter005.cs index 850a0eed1b7920..74d2ab0c13ed3d 100644 --- a/src/tests/baseservices/exceptions/generics/typeparameter005.cs +++ b/src/tests/baseservices/exceptions/generics/typeparameter005.cs @@ -11,6 +11,7 @@ // using System; +using Xunit; public struct ValX0 {} public struct ValY0 {} @@ -67,7 +68,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { Gen.ExceptionTest(new Exception()); Gen.ExceptionTest(new InvalidOperationException()); diff --git a/src/tests/baseservices/exceptions/generics/typeparameter006.cs b/src/tests/baseservices/exceptions/generics/typeparameter006.cs index eacc287d86c83d..1bff2ea38c28b8 100644 --- a/src/tests/baseservices/exceptions/generics/typeparameter006.cs +++ b/src/tests/baseservices/exceptions/generics/typeparameter006.cs @@ -11,6 +11,7 @@ // using System; +using Xunit; public struct ValX0 {} public struct ValY0 {} @@ -67,7 +68,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { Gen.ExceptionTest(new Exception()); Gen.ExceptionTest(new InvalidOperationException()); diff --git a/src/tests/baseservices/exceptions/generics/typeparameter007.cs b/src/tests/baseservices/exceptions/generics/typeparameter007.cs index 4a7163b1d0a974..109b62f143c777 100644 --- a/src/tests/baseservices/exceptions/generics/typeparameter007.cs +++ b/src/tests/baseservices/exceptions/generics/typeparameter007.cs @@ -11,6 +11,7 @@ // using System; +using Xunit; public struct ValX0 {} public struct ValY0 {} @@ -67,7 +68,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(new Exception()); new Gen().ExceptionTest(new InvalidOperationException()); diff --git a/src/tests/baseservices/exceptions/generics/typeparameter008.cs b/src/tests/baseservices/exceptions/generics/typeparameter008.cs index f4ebc52a99c1d4..b7d88041609098 100644 --- a/src/tests/baseservices/exceptions/generics/typeparameter008.cs +++ b/src/tests/baseservices/exceptions/generics/typeparameter008.cs @@ -11,6 +11,7 @@ // using System; +using Xunit; public struct ValX0 {} public struct ValY0 {} @@ -67,7 +68,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest(new Exception()); new Gen().ExceptionTest(new InvalidOperationException()); diff --git a/src/tests/baseservices/exceptions/generics/typeparameter009.cs b/src/tests/baseservices/exceptions/generics/typeparameter009.cs index e1e444297b4d6c..bfc45dec2daeba 100644 --- a/src/tests/baseservices/exceptions/generics/typeparameter009.cs +++ b/src/tests/baseservices/exceptions/generics/typeparameter009.cs @@ -11,6 +11,7 @@ // using System; +using Xunit; public class GenException : Exception {} @@ -51,7 +52,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { Gen,int>.ExceptionTest(new GenExceptionSub()); Gen,string>.ExceptionTest(new GenExceptionSub()); diff --git a/src/tests/baseservices/exceptions/generics/typeparameter010.cs b/src/tests/baseservices/exceptions/generics/typeparameter010.cs index a16db59d389ad3..70c597863a98e3 100644 --- a/src/tests/baseservices/exceptions/generics/typeparameter010.cs +++ b/src/tests/baseservices/exceptions/generics/typeparameter010.cs @@ -11,6 +11,7 @@ // using System; +using Xunit; public class GenException : Exception {} @@ -51,7 +52,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { Gen,int>.ExceptionTest(new GenExceptionSub()); Gen,string>.ExceptionTest(new GenExceptionSub()); diff --git a/src/tests/baseservices/exceptions/generics/typeparameter011.cs b/src/tests/baseservices/exceptions/generics/typeparameter011.cs index aa280dc9875424..39de786d9ea787 100644 --- a/src/tests/baseservices/exceptions/generics/typeparameter011.cs +++ b/src/tests/baseservices/exceptions/generics/typeparameter011.cs @@ -11,6 +11,7 @@ // using System; +using Xunit; public class GenException : Exception {} @@ -51,7 +52,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { Gen,int>.ExceptionTest(new GenExceptionSub()); Gen,string>.ExceptionTest(new GenExceptionSub()); diff --git a/src/tests/baseservices/exceptions/generics/typeparameter012.cs b/src/tests/baseservices/exceptions/generics/typeparameter012.cs index 8f51c74c6c3c80..9009836d165680 100644 --- a/src/tests/baseservices/exceptions/generics/typeparameter012.cs +++ b/src/tests/baseservices/exceptions/generics/typeparameter012.cs @@ -11,6 +11,7 @@ // using System; +using Xunit; public class GenException : Exception {} @@ -51,7 +52,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen,int>().ExceptionTest(new GenExceptionSub()); new Gen,string>().ExceptionTest(new GenExceptionSub()); diff --git a/src/tests/baseservices/exceptions/generics/typeparameter013.cs b/src/tests/baseservices/exceptions/generics/typeparameter013.cs index 0a2f9c15e3e3c5..467143868d8423 100644 --- a/src/tests/baseservices/exceptions/generics/typeparameter013.cs +++ b/src/tests/baseservices/exceptions/generics/typeparameter013.cs @@ -11,6 +11,7 @@ // using System; +using Xunit; public class GenException : Exception {} @@ -51,7 +52,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { Gen.ExceptionTest,int>(new GenExceptionSub()); Gen.ExceptionTest,string>(new GenExceptionSub()); diff --git a/src/tests/baseservices/exceptions/generics/typeparameter014.cs b/src/tests/baseservices/exceptions/generics/typeparameter014.cs index 1a6bb2778f52a7..40395b6efcca4c 100644 --- a/src/tests/baseservices/exceptions/generics/typeparameter014.cs +++ b/src/tests/baseservices/exceptions/generics/typeparameter014.cs @@ -11,6 +11,7 @@ // using System; +using Xunit; public class GenException : Exception {} @@ -51,7 +52,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { Gen.ExceptionTest,int>(new GenExceptionSub()); Gen.ExceptionTest,string>(new GenExceptionSub()); diff --git a/src/tests/baseservices/exceptions/generics/typeparameter015.cs b/src/tests/baseservices/exceptions/generics/typeparameter015.cs index 635811eda8cdef..53e5162a4ace90 100644 --- a/src/tests/baseservices/exceptions/generics/typeparameter015.cs +++ b/src/tests/baseservices/exceptions/generics/typeparameter015.cs @@ -11,6 +11,7 @@ // using System; +using Xunit; public class GenException : Exception {} @@ -51,7 +52,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest,int>(new GenExceptionSub()); new Gen().ExceptionTest,string>(new GenExceptionSub()); diff --git a/src/tests/baseservices/exceptions/generics/typeparameter016.cs b/src/tests/baseservices/exceptions/generics/typeparameter016.cs index 02b22e0bba9eb0..64294c5a5c910c 100644 --- a/src/tests/baseservices/exceptions/generics/typeparameter016.cs +++ b/src/tests/baseservices/exceptions/generics/typeparameter016.cs @@ -11,6 +11,7 @@ // using System; +using Xunit; public class GenException : Exception {} @@ -51,7 +52,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { new Gen().ExceptionTest,int>(new GenExceptionSub()); new Gen().ExceptionTest,string>(new GenExceptionSub()); diff --git a/src/tests/baseservices/exceptions/generics/typeparameter017.cs b/src/tests/baseservices/exceptions/generics/typeparameter017.cs index ee071e1cf915dd..24bbf2a5e4ee5d 100644 --- a/src/tests/baseservices/exceptions/generics/typeparameter017.cs +++ b/src/tests/baseservices/exceptions/generics/typeparameter017.cs @@ -12,6 +12,7 @@ // using System; +using Xunit; public class GenException : Exception {} @@ -51,7 +52,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { Gen.ExceptionTest(new Exception()); Gen.ExceptionTest>(new Exception()); diff --git a/src/tests/baseservices/exceptions/generics/typeparameter018.cs b/src/tests/baseservices/exceptions/generics/typeparameter018.cs index 70ad194ae7061e..4dbf726c387a93 100644 --- a/src/tests/baseservices/exceptions/generics/typeparameter018.cs +++ b/src/tests/baseservices/exceptions/generics/typeparameter018.cs @@ -12,6 +12,7 @@ // using System; +using Xunit; public class GenException : Exception {} @@ -51,7 +52,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { Gen.ExceptionTest(new Exception()); Gen.ExceptionTest>(new Exception()); diff --git a/src/tests/baseservices/exceptions/regressions/Dev11/147911/test147911.cs b/src/tests/baseservices/exceptions/regressions/Dev11/147911/test147911.cs index f260775d93ac7f..5f3605df9832f5 100644 --- a/src/tests/baseservices/exceptions/regressions/Dev11/147911/test147911.cs +++ b/src/tests/baseservices/exceptions/regressions/Dev11/147911/test147911.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.InteropServices; +using Xunit; public class Class1 @@ -10,7 +11,8 @@ public class Class1 [DllImport("fpcw.dll")] private static extern int RaiseFPException(); - public static int Main() + [Fact] + public static int TestEntryPoint() { int retVal = RaiseFPException(); diff --git a/src/tests/baseservices/exceptions/regressions/Dev11/147911/test147911.csproj b/src/tests/baseservices/exceptions/regressions/Dev11/147911/test147911.csproj index 9103b4b9bedc92..96a21300096137 100644 --- a/src/tests/baseservices/exceptions/regressions/Dev11/147911/test147911.csproj +++ b/src/tests/baseservices/exceptions/regressions/Dev11/147911/test147911.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/regressions/Dev11/154243/dynamicmethodliveness.cs b/src/tests/baseservices/exceptions/regressions/Dev11/154243/dynamicmethodliveness.cs index d5a518700bcf07..8f24ce4172ad47 100644 --- a/src/tests/baseservices/exceptions/regressions/Dev11/154243/dynamicmethodliveness.cs +++ b/src/tests/baseservices/exceptions/regressions/Dev11/154243/dynamicmethodliveness.cs @@ -9,6 +9,7 @@ using System.Threading; using System.Reflection; using System.Reflection.Emit; +using Xunit; public class My { @@ -63,7 +64,9 @@ static void DoStuff() { ((Action)method.CreateDelegate(typeof(Action)))(); } - static int Main() { + [Fact] + public static void TestEntryPoint() + { new Thread(Thrower).Start(); new Thread(Dynamizer).Start(); @@ -93,6 +96,5 @@ static int Main() { } } Console.WriteLine("Test case Pass"); - return 100; } } diff --git a/src/tests/baseservices/exceptions/regressions/Dev11/154243/dynamicmethodliveness.csproj b/src/tests/baseservices/exceptions/regressions/Dev11/154243/dynamicmethodliveness.csproj index bd125da6fda60c..c4643b642af363 100644 --- a/src/tests/baseservices/exceptions/regressions/Dev11/154243/dynamicmethodliveness.csproj +++ b/src/tests/baseservices/exceptions/regressions/Dev11/154243/dynamicmethodliveness.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/COOL/finally.cs b/src/tests/baseservices/exceptions/regressions/V1/SEH/COOL/finally.cs index 33536a0b35c019..cb0de787465c26 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/COOL/finally.cs +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/COOL/finally.cs @@ -3,6 +3,7 @@ using System; using System.Threading; +using Xunit; public class Foo { private static int n=0; @@ -19,7 +20,8 @@ public static void Bar(){ } } - public static int Main() + [Fact] + public static int TestEntryPoint() { String s = "Done"; Thread t = new Thread(new ThreadStart(Foo.Bar)); diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/COOL/finally.csproj b/src/tests/baseservices/exceptions/regressions/V1/SEH/COOL/finally.csproj index 0b6059412298da..1fb659a0b8b2b4 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/COOL/finally.csproj +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/COOL/finally.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/COOL/rethrow.cs b/src/tests/baseservices/exceptions/regressions/V1/SEH/COOL/rethrow.cs index 83e7ce5b7a6147..059a893d41879d 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/COOL/rethrow.cs +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/COOL/rethrow.cs @@ -3,6 +3,7 @@ using System; using System.Threading; +using Xunit; public class UserException1 : Exception { int ExceptionId; @@ -57,7 +58,8 @@ public RethrowException(int id){ } - public static int Main() { + [Fact] + public static int TestEntryPoint() { String s = "Done"; System.IO.TextWriter t = Console.Out; Console.SetOut(t); diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/COOL/rethrow.csproj b/src/tests/baseservices/exceptions/regressions/V1/SEH/COOL/rethrow.csproj index 9f0978caa74f38..3a456db0d68702 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/COOL/rethrow.csproj +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/COOL/rethrow.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/ExternalException.cs b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/ExternalException.cs index 9493aca688b08c..56c724afc99652 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/ExternalException.cs +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/ExternalException.cs @@ -3,6 +3,7 @@ using System; using System.Threading; +using Xunit; class ExternalClass { ExternalException ee = new ExternalException(); @@ -18,7 +19,8 @@ public class ExternalException : Exception { static int retVal = 100; - public static int Main() { + [Fact] + public static int TestEntryPoint() { Thread mv_Thread; String str = "Done"; ExternalException ee = new ExternalException(); diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/ExternalException.csproj b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/ExternalException.csproj index 6a62b0646f0757..79e205d7d94a14 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/ExternalException.csproj +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/ExternalException.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 true diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/HandlerException.cs b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/HandlerException.cs index 218047e3e2a0bf..288c2ce8fc8d83 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/HandlerException.cs +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/HandlerException.cs @@ -3,6 +3,7 @@ using System; using System.Threading; using System.IO; +using Xunit; class UserException1 : Exception { public int ExceptionId; @@ -45,7 +46,8 @@ public HandlerException(int id){ } - public static int Main() { + [Fact] + public static int TestEntryPoint() { String s = "Done"; int retVal = 100; Thread mv_Thread; diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/HandlerException.csproj b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/HandlerException.csproj index 43f46dd7840ef3..f791b036d1c3f3 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/HandlerException.csproj +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/HandlerException.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/MultipleException.cs b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/MultipleException.cs index 7969bef6c83c26..d0d39c4321c068 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/MultipleException.cs +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/MultipleException.cs @@ -3,6 +3,7 @@ using System; using System.Threading; using System.IO; +using Xunit; class UserException : Exception { internal int ExceptionId; @@ -20,7 +21,8 @@ public MultipleException(int id){ } - public static int Main() { + [Fact] + public static int TestEntryPoint() { int retVal = 100; String s = "Done"; Thread mv_Thread; diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/MultipleException.csproj b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/MultipleException.csproj index bf2a1fad59d449..6fae86e42321f8 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/MultipleException.csproj +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/MultipleException.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NestedEx1.cs b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NestedEx1.cs index 569a75693b961a..ddff96f571e696 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NestedEx1.cs +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NestedEx1.cs @@ -3,8 +3,9 @@ using System; using System.Security; +using Xunit; -class TestClass { +public class TestClass { static int iExitCode; @@ -105,7 +106,8 @@ void TestMain() } } - public static int Main() + [Fact] + public static int TestEntryPoint() { int retVal = 100; String str = "Done"; diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NestedEx1.csproj b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NestedEx1.csproj index bb2da21af094f4..78b0208a87ecb4 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NestedEx1.csproj +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NestedEx1.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NestedEx2.cs b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NestedEx2.cs index 9b64d7cf175fb2..4d63c02f6c54de 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NestedEx2.cs +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NestedEx2.cs @@ -3,8 +3,9 @@ using System; using System.Security; +using Xunit; -class TestClass { +public class TestClass { static int iExitCode; @@ -157,7 +158,8 @@ void TestMain() } } - public static int Main() + [Fact] + public static int TestEntryPoint() { int retVal = 100; String str = "Done"; diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NestedEx2.csproj b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NestedEx2.csproj index 9fb466a0175b27..721c5f75009bb4 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NestedEx2.csproj +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NestedEx2.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NestedException.cs b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NestedException.cs index 3cae6c0d9386b4..cb5348312812fc 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NestedException.cs +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NestedException.cs @@ -3,6 +3,7 @@ using System; using System.Threading; +using Xunit; class UserException1 : Exception { public int ExceptionId; @@ -45,7 +46,8 @@ public NestedException(int id){ } - public static int Main() { + [Fact] + public static int TestEntryPoint() { String s = "Done"; int retVal = 100; Thread mv_Thread; diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NestedException.csproj b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NestedException.csproj index 5b0617685957b6..49ae0ca6c0f14c 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NestedException.csproj +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NestedException.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NormalException.cs b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NormalException.cs index 6ca3bd770d417f..18e7aa670dcb57 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NormalException.cs +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NormalException.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 Xunit; class UserException : Exception{ @@ -150,7 +151,8 @@ public ComplexByte( ComplexByte cparm ) public class NormalException { - public static int Main() + [Fact] + public static int TestEntryPoint() { String s = "Done"; int retVal = 100; diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NormalException.csproj b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NormalException.csproj index db72e404ad8b8d..23c19d6dad78b4 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NormalException.csproj +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/NormalException.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/RecursiveException.cs b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/RecursiveException.cs index 024596bf5b699e..02db3efd01a9ab 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/RecursiveException.cs +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/RecursiveException.cs @@ -3,13 +3,15 @@ using System; using System.Threading; using System.IO; +using Xunit; class UserException : Exception { } public class RecursiveException { - public static int Main() { + [Fact] + public static int TestEntryPoint() { String s = "Done"; int retVal = 100; Thread mv_Thread; diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/RecursiveException.csproj b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/RecursiveException.csproj index 227768bdea0208..aa0ee8b679c196 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/RecursiveException.csproj +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/RecursiveException.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/TryCatch.cs b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/TryCatch.cs index 7e6990def76589..71208e5957db47 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/TryCatch.cs +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/TryCatch.cs @@ -2,10 +2,12 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; public class TryCatch{ - public static int Main() { + [Fact] + public static int TestEntryPoint() { int retVal = 100; int i = 0; String m_str = ""; diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/TryCatch.csproj b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/TryCatch.csproj index 3e01ed1942422a..59c41bc507ac6d 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/TryCatch.csproj +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/TryCatch.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/TryCatchFinally.cs b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/TryCatchFinally.cs index 390be614d8175c..901a64a59fa06a 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/TryCatchFinally.cs +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/TryCatchFinally.cs @@ -2,10 +2,12 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using Xunit; public class TryCatchFinally{ - public static int Main() { + [Fact] + public static int TestEntryPoint() { int i = 1; String m_str = "Failed"; String str = "Done"; diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/TryCatchFinally.csproj b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/TryCatchFinally.csproj index 67ac2a10461f91..e12f167365ac5e 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/TryCatchFinally.csproj +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/TryCatchFinally.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/UnmanagedToManaged.cs b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/UnmanagedToManaged.cs index 6526664b182bde..0a30aa51dde37b 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/UnmanagedToManaged.cs +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/UnmanagedToManaged.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Runtime.InteropServices; +using Xunit; public class UnmanagedToManaged { @@ -9,7 +10,8 @@ public class UnmanagedToManaged { [System.Runtime.InteropServices.DllImport("unmanaged.dll")] public static extern void UnmanagedCode( int i) ; - public static int Main(){ + [Fact] + public static int TestEntryPoint(){ String s = "Done"; int retVal = 0; try { diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/UnmanagedToManaged.csproj b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/UnmanagedToManaged.csproj index bdf71e39cd2d0e..7d5d5743ec22e4 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/UnmanagedToManaged.csproj +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/UnmanagedToManaged.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/UserException.cs b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/UserException.cs index eb17345c8d8f39..bc8862bde6e7ff 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/UserException.cs +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/UserException.cs @@ -2,9 +2,11 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Threading; +using Xunit; public class UserException : Exception { - public static int Main() { + [Fact] + public static int TestEntryPoint() { int counter = 0; String str = "Done"; diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/UserException.csproj b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/UserException.csproj index 948096e985eaf5..cae9c3fefa617d 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/UserException.csproj +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/UserException.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/UserExceptionThread.cs b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/UserExceptionThread.cs index 5634afb300a008..a223785787e2b8 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/UserExceptionThread.cs +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/UserExceptionThread.cs @@ -3,11 +3,13 @@ using System; using System.Threading; using System.IO; +using Xunit; public class UserExceptionThread : Exception { static int retVal = 100; - public static int Main() { + [Fact] + public static int TestEntryPoint() { Thread mv_Thread; String str = "Done"; UserExceptionThread ue = new UserExceptionThread(); diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/UserExceptionThread.csproj b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/UserExceptionThread.csproj index 3ac31e8875fe92..5dd9297f772be0 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/UserExceptionThread.csproj +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/VJ/UserExceptionThread.csproj @@ -1,6 +1,7 @@ - Exe + + true true true diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Except.il b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Except.il index 615efcdc9e38b9..9c6a828c55ce34 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Except.il +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Except.il @@ -7,6 +7,7 @@ // Basic exception handling test case. // .assembly extern legacy library mscorlib{} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -15,7 +16,7 @@ .assembly Except{} -.class Except { +.class public Except { // global for storing return value - defaults to 0 for success @@ -25,7 +26,10 @@ // Execution starts here -.method static int32 main() { +.method public static int32 main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .locals (string) .entrypoint .maxstack 2 diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Except.ilproj b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Except.ilproj index c3b0f4c93f8b54..405ac0edc43bcf 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Except.ilproj +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Except.ilproj @@ -1,6 +1,7 @@ - Exe + + true 1 diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/FiltCatch.il b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/FiltCatch.il index dfeb35a91e0fea..7eef9db4119de6 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/FiltCatch.il +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/FiltCatch.il @@ -9,6 +9,7 @@ // to an outer .exception aHandler. // .assembly extern legacy library mscorlib{} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -17,7 +18,7 @@ .assembly FiltCatch{} -.class FiltCatch { +.class public FiltCatch { // global for storing return value - defaults to 0 for success @@ -27,7 +28,10 @@ // Execution starts here -.method static int32 main() { +.method public static int32 main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .locals(string) .entrypoint .maxstack 2 diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/FiltCatch.ilproj b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/FiltCatch.ilproj index d0f01b933da16a..63e80a3d847745 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/FiltCatch.ilproj +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/FiltCatch.ilproj @@ -1,6 +1,7 @@ - Exe + + true 1 diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/FiltFallThru.il b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/FiltFallThru.il index 2d88706e80d596..2576af4173c917 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/FiltFallThru.il +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/FiltFallThru.il @@ -9,6 +9,7 @@ // outer .exception aHandler. // .assembly extern legacy library mscorlib{} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -17,7 +18,7 @@ .assembly FiltFallThru{} -.class FiltFallThru { +.class public FiltFallThru { // global for storing return value - defaults to 0 for success @@ -27,7 +28,10 @@ // Execution starts here -.method static int32 main() { +.method public static int32 main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .locals(string) .entrypoint .maxstack 2 diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/FiltFallThru.ilproj b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/FiltFallThru.ilproj index 5fff5c023ced5f..12acbbe0f70d6f 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/FiltFallThru.ilproj +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/FiltFallThru.ilproj @@ -1,6 +1,7 @@ - Exe + + true 1 diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Filter.il b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Filter.il index d5711679c52d04..2a130949fdb34c 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Filter.il +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Filter.il @@ -7,6 +7,7 @@ // Basic aFilter test case. // .assembly extern legacy library mscorlib{} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -16,7 +17,7 @@ .assembly Filter{} -.class Filter { +.class public Filter { // global for storing return value - defaults to 0 for success @@ -26,7 +27,10 @@ // Execution starts here -.method static int32 main() { +.method public static int32 main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .locals(string) .entrypoint .maxstack 2 diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Filter.ilproj b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Filter.ilproj index e64c29d72787d4..bf09cc3b81588f 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Filter.ilproj +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Filter.ilproj @@ -1,6 +1,7 @@ - Exe + + true 1 diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Finally.il b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Finally.il index af24a232714a83..e7260a3390cb70 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Finally.il +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Finally.il @@ -7,6 +7,7 @@ // Exercises finally exception syntax. // .assembly extern legacy library mscorlib{} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -16,7 +17,7 @@ .assembly Finally{} -.class Finally { +.class public Finally { .field static int32 iResult .field static int32 finally_flag @@ -38,7 +39,10 @@ // Execution starts here -.method static int32 main() { +.method public static int32 main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .locals(string) .entrypoint .maxstack 2 diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Finally.ilproj b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Finally.ilproj index 7e85e058408c45..0646c0d5634df2 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Finally.ilproj +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/Finally.ilproj @@ -1,6 +1,7 @@ - Exe + + true 1 diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/NestedExcept.il b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/NestedExcept.il index 172a23ab648a43..7087c3416ad67a 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/NestedExcept.il +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/NestedExcept.il @@ -8,6 +8,7 @@ // Nested exception test cases. // .assembly extern legacy library mscorlib{} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -16,7 +17,7 @@ .assembly NestedExcept{} -.class NestedExcept { +.class public NestedExcept { // global for storing return value - defaults to 0 for success @@ -26,7 +27,10 @@ // Execution starts here -.method static int32 main() { +.method public static int32 main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .locals(string) .entrypoint .maxstack 2 diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/NestedExcept.ilproj b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/NestedExcept.ilproj index 164f9846d46c0a..43177bc96ab244 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/NestedExcept.ilproj +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/NestedExcept.ilproj @@ -1,6 +1,7 @@ - Exe + + true 1 diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/NestedFilt.il b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/NestedFilt.il index bcbc3722f2f21b..9977a4a6dbe283 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/NestedFilt.il +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/NestedFilt.il @@ -7,6 +7,7 @@ // Nests filters that catch the same exception. // .assembly extern legacy library mscorlib{} +.assembly extern xunit.core {} .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) @@ -15,7 +16,7 @@ .assembly NestedFilt{} -.class NestedFilt { +.class public NestedFilt { // global for storing return value - defaults to 0 for success @@ -25,7 +26,10 @@ // Execution starts here -.method static int32 main() { +.method public static int32 main() { +.custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 +) .locals(string) .entrypoint .maxstack 3 diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/NestedFilt.ilproj b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/NestedFilt.ilproj index 48974fb1520e89..e336fd59e3d14c 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/NestedFilt.ilproj +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/asm/NestedFilt.ilproj @@ -1,6 +1,7 @@ - Exe + + true 1 diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/coverage/Exceptions.cs b/src/tests/baseservices/exceptions/regressions/V1/SEH/coverage/Exceptions.cs index af0c155cf8143e..4d8a0f242008c8 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/coverage/Exceptions.cs +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/coverage/Exceptions.cs @@ -8,12 +8,14 @@ using System.Runtime.InteropServices; using System.Security; using System.Threading; +using Xunit; -class MightyExceptor +public class MightyExceptor { static int Result = 100; - public static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/baseservices/exceptions/regressions/V1/SEH/coverage/Exceptions.csproj b/src/tests/baseservices/exceptions/regressions/V1/SEH/coverage/Exceptions.csproj index d9b4980703b203..d72ca284fa29c1 100644 --- a/src/tests/baseservices/exceptions/regressions/V1/SEH/coverage/Exceptions.csproj +++ b/src/tests/baseservices/exceptions/regressions/V1/SEH/coverage/Exceptions.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/regressions/v1.0/15266.il b/src/tests/baseservices/exceptions/regressions/v1.0/15266.il index 67a0ad3e0cf373..272d1a99cad2ad 100644 --- a/src/tests/baseservices/exceptions/regressions/v1.0/15266.il +++ b/src/tests/baseservices/exceptions/regressions/v1.0/15266.il @@ -13,7 +13,7 @@ } .assembly '15266' {} -.class private auto ansi beforefieldinit test +.class public auto ansi beforefieldinit test extends [mscorlib]System.Object { .method public static int32 Main() cil managed diff --git a/src/tests/baseservices/exceptions/regressions/v1.0/15266.ilproj b/src/tests/baseservices/exceptions/regressions/v1.0/15266.ilproj index 7e79791c160eac..2e8dae2d815486 100644 --- a/src/tests/baseservices/exceptions/regressions/v1.0/15266.ilproj +++ b/src/tests/baseservices/exceptions/regressions/v1.0/15266.ilproj @@ -1,6 +1,7 @@ - Exe + + true 1 diff --git a/src/tests/baseservices/exceptions/regressions/v1.0/19896.cs b/src/tests/baseservices/exceptions/regressions/v1.0/19896.cs index 88af83969970af..bd34d1728a07e5 100644 --- a/src/tests/baseservices/exceptions/regressions/v1.0/19896.cs +++ b/src/tests/baseservices/exceptions/regressions/v1.0/19896.cs @@ -1,10 +1,12 @@ // 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 Xunit; public class b19896 { - public static int Main() + [Fact] + public static int TestEntryPoint() { int retVal = 200; diff --git a/src/tests/baseservices/exceptions/regressions/v1.0/19896.csproj b/src/tests/baseservices/exceptions/regressions/v1.0/19896.csproj index 601eefc6443052..82f4752c43ba6b 100644 --- a/src/tests/baseservices/exceptions/regressions/v1.0/19896.csproj +++ b/src/tests/baseservices/exceptions/regressions/v1.0/19896.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/regressions/v4.0/640474/other.csproj b/src/tests/baseservices/exceptions/regressions/v4.0/640474/other.csproj index 1c438ffcd81d69..5d6118207a7817 100644 --- a/src/tests/baseservices/exceptions/regressions/v4.0/640474/other.csproj +++ b/src/tests/baseservices/exceptions/regressions/v4.0/640474/other.csproj @@ -1,6 +1,5 @@ - Library true 1 diff --git a/src/tests/baseservices/exceptions/regressions/v4.0/640474/test640474.cs b/src/tests/baseservices/exceptions/regressions/v4.0/640474/test640474.cs index e4ab3e99d1d984..7f8241a281d164 100644 --- a/src/tests/baseservices/exceptions/regressions/v4.0/640474/test640474.cs +++ b/src/tests/baseservices/exceptions/regressions/v4.0/640474/test640474.cs @@ -4,6 +4,7 @@ using System; using System.Runtime.CompilerServices; using System.Reflection; +using Xunit; public class My { @@ -32,7 +33,8 @@ public static void Worker() } } - public static int Main() + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/baseservices/exceptions/regressions/v4.0/640474/test640474.csproj b/src/tests/baseservices/exceptions/regressions/v4.0/640474/test640474.csproj index 77356561b0ae16..29eb9414e7ad4e 100644 --- a/src/tests/baseservices/exceptions/regressions/v4.0/640474/test640474.csproj +++ b/src/tests/baseservices/exceptions/regressions/v4.0/640474/test640474.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/regressions/whidbeyM3.2/151232.cs b/src/tests/baseservices/exceptions/regressions/whidbeyM3.2/151232.cs index d2916edb08e7b2..fe592a68292e7a 100644 --- a/src/tests/baseservices/exceptions/regressions/whidbeyM3.2/151232.cs +++ b/src/tests/baseservices/exceptions/regressions/whidbeyM3.2/151232.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 Xunit; public class E : Exception { T fld; @@ -31,7 +32,8 @@ public static int Test5(bool str,int x) { } public class M { - public static int Main() { + [Fact] + public static int TestEntryPoint() { M test = new M(); return test.Run(); } diff --git a/src/tests/baseservices/exceptions/regressions/whidbeyM3.2/151232.csproj b/src/tests/baseservices/exceptions/regressions/whidbeyM3.2/151232.csproj index ab0b5ec5ec02b2..bd3411aa8347a0 100644 --- a/src/tests/baseservices/exceptions/regressions/whidbeyM3.2/151232.csproj +++ b/src/tests/baseservices/exceptions/regressions/whidbeyM3.2/151232.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/regressions/whidbeybeta2/349379/349379.cs b/src/tests/baseservices/exceptions/regressions/whidbeybeta2/349379/349379.cs index ebccc5a62f3217..51fc29e2a7f9bc 100644 --- a/src/tests/baseservices/exceptions/regressions/whidbeybeta2/349379/349379.cs +++ b/src/tests/baseservices/exceptions/regressions/whidbeybeta2/349379/349379.cs @@ -1,46 +1,48 @@ // 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 Xunit; namespace TestCS { public class Class8 { - static int returnCode = 99; - static string expectedExceptionString; - static string expectedOuterExceptionString = "Foobar"; - - static public int Main(String[] args) + static int returnCode = 99; + static string expectedExceptionString; + static string expectedOuterExceptionString = "Foobar"; + + [Fact] + static public int TestEntryPoint() { Object foo = null; - try - { - foo.GetType(); - } - catch(Exception e) - { - expectedExceptionString = e.Message; - } - + try + { + foo.GetType(); + } + catch(Exception e) + { + expectedExceptionString = e.Message; + } + try { DoIt(); } catch(Exception e) { - if (e.Message != expectedOuterExceptionString) - returnCode = 98; - + if (e.Message != expectedOuterExceptionString) + returnCode = 98; + Console.WriteLine("Outer Exception Message Found: " + e.Message); Console.WriteLine("Outer Exception Message Expected: " + expectedOuterExceptionString); } - - if (returnCode == 100) - Console.WriteLine("Test PASSED"); - else - Console.WriteLine("Test FAILED"); + + if (returnCode == 100) + Console.WriteLine("Test PASSED"); + else + Console.WriteLine("Test FAILED"); - return returnCode; + return returnCode; } static public void DoIt() @@ -81,11 +83,11 @@ static public void Foobar() // The message here should be "Object reference not set to an instance of an object." // But it displays "Foobar" instead // - if (e.Message != expectedExceptionString) - returnCode = 98; - else - returnCode = 100; - + if (e.Message != expectedExceptionString) + returnCode = 98; + else + returnCode = 100; + Console.WriteLine("Message Found: " + e.Message); Console.WriteLine("Message Expected: " + expectedExceptionString); } diff --git a/src/tests/baseservices/exceptions/regressions/whidbeybeta2/349379/349379.csproj b/src/tests/baseservices/exceptions/regressions/whidbeybeta2/349379/349379.csproj index a7eeee0ff34f99..c89d7e6e456042 100644 --- a/src/tests/baseservices/exceptions/regressions/whidbeybeta2/349379/349379.csproj +++ b/src/tests/baseservices/exceptions/regressions/whidbeybeta2/349379/349379.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/regressions/whidbeym3.3/106011/106011.cs b/src/tests/baseservices/exceptions/regressions/whidbeym3.3/106011/106011.cs index ba2e02a2815e87..7b7af2bd7646c8 100644 --- a/src/tests/baseservices/exceptions/regressions/whidbeym3.3/106011/106011.cs +++ b/src/tests/baseservices/exceptions/regressions/whidbeym3.3/106011/106011.cs @@ -3,6 +3,7 @@ using System; +using Xunit; public class GenException : Exception {} @@ -42,7 +43,8 @@ public static void Eval(bool exp) } - public static int Main() + [Fact] + public static int TestEntryPoint() { Gen.ExceptionTest(new Exception()); Gen.ExceptionTest>(new Exception()); diff --git a/src/tests/baseservices/exceptions/regressions/whidbeym3.3/106011/106011.csproj b/src/tests/baseservices/exceptions/regressions/whidbeym3.3/106011/106011.csproj index a7eeee0ff34f99..c89d7e6e456042 100644 --- a/src/tests/baseservices/exceptions/regressions/whidbeym3.3/106011/106011.csproj +++ b/src/tests/baseservices/exceptions/regressions/whidbeym3.3/106011/106011.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/regressions/whidbeym3.3/302680/302680.cs b/src/tests/baseservices/exceptions/regressions/whidbeym3.3/302680/302680.cs index 521afd4a0fa779..d827b7e8796b8e 100644 --- a/src/tests/baseservices/exceptions/regressions/whidbeym3.3/302680/302680.cs +++ b/src/tests/baseservices/exceptions/regressions/whidbeym3.3/302680/302680.cs @@ -1,10 +1,12 @@ // 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 Xunit; public class xa { - public static int Main() { + [Fact] + public static int TestEntryPoint() { try { diff --git a/src/tests/baseservices/exceptions/regressions/whidbeym3.3/302680/302680.csproj b/src/tests/baseservices/exceptions/regressions/whidbeym3.3/302680/302680.csproj index 847305dc8f43f0..2def5c0aeae07f 100644 --- a/src/tests/baseservices/exceptions/regressions/whidbeym3.3/302680/302680.csproj +++ b/src/tests/baseservices/exceptions/regressions/whidbeym3.3/302680/302680.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/regressions/whidbeym3.3/302680/data.csproj b/src/tests/baseservices/exceptions/regressions/whidbeym3.3/302680/data.csproj index 08a600aeb34b64..7eeb67cd518d18 100644 --- a/src/tests/baseservices/exceptions/regressions/whidbeym3.3/302680/data.csproj +++ b/src/tests/baseservices/exceptions/regressions/whidbeym3.3/302680/data.csproj @@ -1,6 +1,5 @@ - Library true 1 diff --git a/src/tests/baseservices/exceptions/sharedexceptions/emptystacktrace/OOMException01.csproj b/src/tests/baseservices/exceptions/sharedexceptions/emptystacktrace/OOMException01.csproj index 7b6f354e794845..68bc6409bd3654 100644 --- a/src/tests/baseservices/exceptions/sharedexceptions/emptystacktrace/OOMException01.csproj +++ b/src/tests/baseservices/exceptions/sharedexceptions/emptystacktrace/OOMException01.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/sharedexceptions/emptystacktrace/oomexception01.cs b/src/tests/baseservices/exceptions/sharedexceptions/emptystacktrace/oomexception01.cs index 32942d796bea5b..3c6305620c64dd 100644 --- a/src/tests/baseservices/exceptions/sharedexceptions/emptystacktrace/oomexception01.cs +++ b/src/tests/baseservices/exceptions/sharedexceptions/emptystacktrace/oomexception01.cs @@ -2,12 +2,14 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Diagnostics; +using Xunit; public class SharedExceptions { public int retVal =0; - public static int Main() + [Fact] + public static int TestEntryPoint() { Console.WriteLine("Test that StackTrace for OOM is proper if memory is available"); SharedExceptions test = new SharedExceptions(); diff --git a/src/tests/baseservices/exceptions/simple/ArrayInit.cs b/src/tests/baseservices/exceptions/simple/ArrayInit.cs index 61b49b998c4bd9..7e6018bd1e09bc 100644 --- a/src/tests/baseservices/exceptions/simple/ArrayInit.cs +++ b/src/tests/baseservices/exceptions/simple/ArrayInit.cs @@ -2,10 +2,12 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; using TestLibrary; +using Xunit; public class ArrayInit { - public static int Main() + [Fact] + public static int TestEntryPoint() { ArrayInit ai = new ArrayInit(); diff --git a/src/tests/baseservices/exceptions/simple/ArrayInit.csproj b/src/tests/baseservices/exceptions/simple/ArrayInit.csproj index 28db5addb3b125..0dbbf526f1ff0c 100644 --- a/src/tests/baseservices/exceptions/simple/ArrayInit.csproj +++ b/src/tests/baseservices/exceptions/simple/ArrayInit.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/simple/HardwareEh.cs b/src/tests/baseservices/exceptions/simple/HardwareEh.cs index df9f44241d6351..2ea4b5f38738f8 100644 --- a/src/tests/baseservices/exceptions/simple/HardwareEh.cs +++ b/src/tests/baseservices/exceptions/simple/HardwareEh.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using Xunit; // DataMisalignment // NullRef (generic, nullable, object) @@ -22,7 +23,8 @@ public class HardwareEh public const long c_VALUE = 34252; public delegate bool TestDelegate(); - public static int Main() + [Fact] + public static int TestEntryPoint() { HardwareEh e = new HardwareEh(); diff --git a/src/tests/baseservices/exceptions/simple/HardwareEh.csproj b/src/tests/baseservices/exceptions/simple/HardwareEh.csproj index 24d855e4042077..4cc8189a157d53 100644 --- a/src/tests/baseservices/exceptions/simple/HardwareEh.csproj +++ b/src/tests/baseservices/exceptions/simple/HardwareEh.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/simple/ILHelper.ilproj b/src/tests/baseservices/exceptions/simple/ILHelper.ilproj index 1a2ddde67f37a2..73432dd63ba3e3 100644 --- a/src/tests/baseservices/exceptions/simple/ILHelper.ilproj +++ b/src/tests/baseservices/exceptions/simple/ILHelper.ilproj @@ -1,6 +1,5 @@ - Library 1 diff --git a/src/tests/baseservices/exceptions/simple/ParallelCrash.csproj b/src/tests/baseservices/exceptions/simple/ParallelCrash.csproj index bbad3fdf834bf5..1dd852e59d8a2e 100644 --- a/src/tests/baseservices/exceptions/simple/ParallelCrash.csproj +++ b/src/tests/baseservices/exceptions/simple/ParallelCrash.csproj @@ -1,11 +1,9 @@ - Exe - 1 - 134 - -2146232797 - - true + + true + false + BuildOnly diff --git a/src/tests/baseservices/exceptions/simple/ParallelCrashMainThread.csproj b/src/tests/baseservices/exceptions/simple/ParallelCrashMainThread.csproj deleted file mode 100644 index d7ad43abbd027a..00000000000000 --- a/src/tests/baseservices/exceptions/simple/ParallelCrashMainThread.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - RunOnly - 1 - ParallelCrash.csproj - 1 - 134 - -2146232797 - - true - - diff --git a/src/tests/baseservices/exceptions/simple/ParallelCrashTester.cs b/src/tests/baseservices/exceptions/simple/ParallelCrashTester.cs new file mode 100644 index 00000000000000..5d3124965d84e0 --- /dev/null +++ b/src/tests/baseservices/exceptions/simple/ParallelCrashTester.cs @@ -0,0 +1,47 @@ +// 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.IO; +using System.Runtime.InteropServices; +using Xunit; + +public class ParallelCrashTester +{ + [Fact] + public static void ParallelCrashMainThread() + { + RunParallelCrash(1); + } + + [Fact] + public static void ParallelCrashWorkerThreads() + { + RunParallelCrash(2); + } + + [Fact] + public static void ParallelCrashMainThreadAndWorkerThreads() + { + RunParallelCrash(0); + } + + private static void RunParallelCrash(int arg) + { + Console.WriteLine($"Running ParallelCrash test({arg})"); + Process testProcess = new Process(); + + testProcess.StartInfo.FileName = Path.Combine(Environment.GetEnvironmentVariable("CORE_ROOT"), "corerun"); + testProcess.StartInfo.Arguments = $"ParallelCrash.dll {arg}"; + testProcess.StartInfo.UseShellExecute = false; + testProcess.Start(); + testProcess.WaitForExit(); + + int expectedExitCode = (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? -2146232797 : 128 + 6); + if (testProcess.ExitCode != expectedExitCode) + { + throw new Exception($"Exit code = {testProcess.ExitCode}, expected {expectedExitCode}"); + } + } +} diff --git a/src/tests/baseservices/exceptions/simple/ParallelCrashTester.csproj b/src/tests/baseservices/exceptions/simple/ParallelCrashTester.csproj new file mode 100644 index 00000000000000..30bcef8c9c8b50 --- /dev/null +++ b/src/tests/baseservices/exceptions/simple/ParallelCrashTester.csproj @@ -0,0 +1,17 @@ + + + 1 + + true + + + + + + + false + Content + Always + + + diff --git a/src/tests/baseservices/exceptions/simple/ParallelCrashWorkerThreads.csproj b/src/tests/baseservices/exceptions/simple/ParallelCrashWorkerThreads.csproj deleted file mode 100644 index 03d65d6d1b2736..00000000000000 --- a/src/tests/baseservices/exceptions/simple/ParallelCrashWorkerThreads.csproj +++ /dev/null @@ -1,10 +0,0 @@ - - - RunOnly - 1 - ParallelCrash.csproj - 2 - 134 - -2146232797 - - diff --git a/src/tests/baseservices/exceptions/simple/VT.ilproj b/src/tests/baseservices/exceptions/simple/VT.ilproj index 125b5b3dc9d334..b5f8733125615b 100644 --- a/src/tests/baseservices/exceptions/simple/VT.ilproj +++ b/src/tests/baseservices/exceptions/simple/VT.ilproj @@ -1,6 +1,5 @@ - Library 1 diff --git a/src/tests/baseservices/exceptions/simple/fault.il b/src/tests/baseservices/exceptions/simple/fault.il index 05a18cbb10ec50..2023450120522a 100644 --- a/src/tests/baseservices/exceptions/simple/fault.il +++ b/src/tests/baseservices/exceptions/simple/fault.il @@ -11,7 +11,7 @@ .assembly 'fault' {} -.class auto ansi Fault +.class public auto ansi Fault { .method public static int32 Main() il managed { diff --git a/src/tests/baseservices/exceptions/simple/fault.ilproj b/src/tests/baseservices/exceptions/simple/fault.ilproj index 2cf8db5758170d..57c9e4f3012dec 100644 --- a/src/tests/baseservices/exceptions/simple/fault.ilproj +++ b/src/tests/baseservices/exceptions/simple/fault.ilproj @@ -1,6 +1,7 @@ - Exe + + true 1 diff --git a/src/tests/baseservices/exceptions/simple/finally.cs b/src/tests/baseservices/exceptions/simple/finally.cs index 44f742f82599d9..772f38c1307990 100644 --- a/src/tests/baseservices/exceptions/simple/finally.cs +++ b/src/tests/baseservices/exceptions/simple/finally.cs @@ -2,10 +2,12 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; using System.Threading; +using Xunit; public class Finally { - public static int Main() + [Fact] + public static int TestEntryPoint() { Finally f = new Finally(); diff --git a/src/tests/baseservices/exceptions/simple/finally.csproj b/src/tests/baseservices/exceptions/simple/finally.csproj index 82656ed43dc9c4..da8973186f0c57 100644 --- a/src/tests/baseservices/exceptions/simple/finally.csproj +++ b/src/tests/baseservices/exceptions/simple/finally.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/stackoverflow/stackoverflow.csproj b/src/tests/baseservices/exceptions/stackoverflow/stackoverflow.csproj index 552eb026fae0d2..e75283a0f2d0f8 100644 --- a/src/tests/baseservices/exceptions/stackoverflow/stackoverflow.csproj +++ b/src/tests/baseservices/exceptions/stackoverflow/stackoverflow.csproj @@ -1,8 +1,11 @@ - Exe - false + + true + false BuildOnly + + false diff --git a/src/tests/baseservices/exceptions/stackoverflow/stackoverflow3.csproj b/src/tests/baseservices/exceptions/stackoverflow/stackoverflow3.csproj index 343785e075ffde..d805f0b4c7ecb2 100644 --- a/src/tests/baseservices/exceptions/stackoverflow/stackoverflow3.csproj +++ b/src/tests/baseservices/exceptions/stackoverflow/stackoverflow3.csproj @@ -1,6 +1,9 @@ - Exe + + true + false + false true BuildOnly diff --git a/src/tests/baseservices/exceptions/stackoverflow/stackoverflowtester.cs b/src/tests/baseservices/exceptions/stackoverflow/stackoverflowtester.cs index 52707b0508f5ec..07f5e03e7cb625 100644 --- a/src/tests/baseservices/exceptions/stackoverflow/stackoverflowtester.cs +++ b/src/tests/baseservices/exceptions/stackoverflow/stackoverflowtester.cs @@ -5,23 +5,21 @@ using System.Diagnostics; using System.IO; using System.Text; +using Xunit; namespace TestStackOverflow { - class Program + public class Program { - static string s_corerunPath; - static string s_currentPath; - - static bool TestStackOverflow(string testName, string testArgs, out List stderrLines) + static void TestStackOverflow(string testName, string testArgs, out List stderrLines) { Console.WriteLine($"Running {testName} test({testArgs})"); List lines = new List(); Process testProcess = new Process(); - testProcess.StartInfo.FileName = s_corerunPath; - testProcess.StartInfo.Arguments = $"{Path.Combine(s_currentPath, "..", testName, $"{testName}.dll")} {testArgs}"; + testProcess.StartInfo.FileName = Path.Combine(Environment.GetEnvironmentVariable("CORE_ROOT"), "corerun"); + testProcess.StartInfo.Arguments = $"{Path.Combine(Directory.GetCurrentDirectory(), "..", testName, $"{testName}.dll")} {testArgs}"; testProcess.StartInfo.UseShellExecute = false; testProcess.StartInfo.RedirectStandardError = true; testProcess.ErrorDataReceived += (sender, line) => @@ -58,225 +56,144 @@ static bool TestStackOverflow(string testName, string testArgs, out List expectedListBuilder.Append($"{separator}0x{code:X8}"); separator = " or "; }); - Console.WriteLine($"Exit code: 0x{testProcess.ExitCode:X8}, expected {expectedListBuilder.ToString()}"); - return false; + throw new Exception($"Exit code: 0x{testProcess.ExitCode:X8}, expected {expectedListBuilder.ToString()}"); } if (lines[0] != "Stack overflow.") { - Console.WriteLine("Missing \"Stack overflow.\" at the first line"); - return false; + throw new Exception("Missing \"Stack overflow.\" at the first line"); } - - return true; } - static bool TestStackOverflowSmallFrameMainThread() + [Fact] + public static void TestStackOverflowSmallFrameMainThread() { - List lines; - if (TestStackOverflow("stackoverflow", "smallframe main", out lines)) - { - if (!lines[lines.Count - 1].EndsWith("at TestStackOverflow.Program.Main(System.String[])")) - { - Console.WriteLine("Missing \"Main\" method frame at the last line"); - return false; - } - - if (!lines.Exists(elem => elem.EndsWith("TestStackOverflow.Program.Test(Boolean)"))) - { - Console.WriteLine("Missing \"Test\" method frame"); - return false; - } - - if (!lines.Exists(elem => elem.EndsWith("at TestStackOverflow.Program.InfiniteRecursionA()"))) - { - Console.WriteLine("Missing \"InfiniteRecursionA\" method frame"); - return false; - } + TestStackOverflow("stackoverflow", "smallframe main", out List lines); - if (!lines.Exists(elem => elem.EndsWith("at TestStackOverflow.Program.InfiniteRecursionB()"))) - { - Console.WriteLine("Missing \"InfiniteRecursionB\" method frame"); - return false; - } - - if (!lines.Exists(elem => elem.EndsWith("at TestStackOverflow.Program.InfiniteRecursionC()"))) - { - Console.WriteLine("Missing \"InfiniteRecursionC\" method frame"); - return false; - } - - return true; + if (!lines[lines.Count - 1].EndsWith(".Main(System.String[])")) + { + throw new Exception("Missing \"Main\" method frame at the last line"); } - return false; - } - - static bool TestStackOverflowLargeFrameMainThread() - { - List lines; - if (TestStackOverflow("stackoverflow", "largeframe main", out lines)) + if (!lines.Exists(elem => elem.EndsWith("TestStackOverflow.Program.Test(Boolean)"))) { - if (!lines[lines.Count - 1].EndsWith("at TestStackOverflow.Program.Main(System.String[])")) - { - Console.WriteLine("Missing \"Main\" method frame at the last line"); - return false; - } - - if (!lines.Exists(elem => elem.EndsWith("TestStackOverflow.Program.Test(Boolean)"))) - { - Console.WriteLine("Missing \"Test\" method frame"); - return false; - } - - if (!lines.Exists(elem => elem.EndsWith("at TestStackOverflow.Program.InfiniteRecursionA2()"))) - { - Console.WriteLine("Missing \"InfiniteRecursionA2\" method frame"); - return false; - } - - if (!lines.Exists(elem => elem.EndsWith("at TestStackOverflow.Program.InfiniteRecursionB2()"))) - { - Console.WriteLine("Missing \"InfiniteRecursionB2\" method frame"); - return false; - } - - if (!lines.Exists(elem => elem.EndsWith("at TestStackOverflow.Program.InfiniteRecursionC2()"))) - { - Console.WriteLine("Missing \"InfiniteRecursionC2\" method frame"); - return false; - } - - return true; + throw new Exception("Missing \"Test\" method frame"); } - return false; - } - - static bool TestStackOverflowSmallFrameSecondaryThread() - { - List lines; - if (TestStackOverflow("stackoverflow", "smallframe secondary", out lines)) + if (!lines.Exists(elem => elem.EndsWith("at TestStackOverflow.Program.InfiniteRecursionA()"))) { - if (!lines.Exists(elem => elem.EndsWith("at TestStackOverflow.Program.Test(Boolean)"))) - { - Console.WriteLine("Missing \"TestStackOverflow.Program.Test\" method frame"); - return false; - } - - if (!lines.Exists(elem => elem.EndsWith("at TestStackOverflow.Program.InfiniteRecursionA()"))) - { - Console.WriteLine("Missing \"InfiniteRecursionA\" method frame"); - return false; - } - - if (!lines.Exists(elem => elem.EndsWith("at TestStackOverflow.Program.InfiniteRecursionB()"))) - { - Console.WriteLine("Missing \"InfiniteRecursionB\" method frame"); - return false; - } - - if (!lines.Exists(elem => elem.EndsWith("at TestStackOverflow.Program.InfiniteRecursionC()"))) - { - Console.WriteLine("Missing \"InfiniteRecursionC\" method frame"); - return false; - } + throw new Exception("Missing \"InfiniteRecursionA\" method frame"); + } - return true; + if (!lines.Exists(elem => elem.EndsWith("at TestStackOverflow.Program.InfiniteRecursionB()"))) + { + throw new Exception("Missing \"InfiniteRecursionB\" method frame"); } - return false; + if (!lines.Exists(elem => elem.EndsWith("at TestStackOverflow.Program.InfiniteRecursionC()"))) + { + throw new Exception("Missing \"InfiniteRecursionC\" method frame"); + } } - static bool TestStackOverflowLargeFrameSecondaryThread() + [Fact] + public static void TestStackOverflowLargeFrameMainThread() { - List lines; - if (TestStackOverflow("stackoverflow", "largeframe secondary", out lines)) - { - if (!lines.Exists(elem => elem.EndsWith("at TestStackOverflow.Program.Test(Boolean)"))) - { - Console.WriteLine("Missing \"TestStackOverflow.Program.Test\" method frame"); - return false; - } + TestStackOverflow("stackoverflow", "largeframe main", out List lines); - if (!lines.Exists(elem => elem.EndsWith("at TestStackOverflow.Program.InfiniteRecursionA2()"))) - { - Console.WriteLine("Missing \"InfiniteRecursionA2\" method frame"); - return false; - } + if (!lines[lines.Count - 1].EndsWith("at TestStackOverflow.Program.Main(System.String[])")) + { + throw new Exception("Missing \"Main\" method frame at the last line"); + } - if (!lines.Exists(elem => elem.EndsWith("TestStackOverflow.Program.InfiniteRecursionB2()"))) - { - Console.WriteLine("Missing \"InfiniteRecursionB2\" method frame"); - return false; - } + if (!lines.Exists(elem => elem.EndsWith("TestStackOverflow.Program.Test(Boolean)"))) + { + throw new Exception("Missing \"Test\" method frame"); + } - if (!lines.Exists(elem => elem.EndsWith("TestStackOverflow.Program.InfiniteRecursionC2()"))) - { - Console.WriteLine("Missing \"InfiniteRecursionC2\" method frame"); - return false; - } + if (!lines.Exists(elem => elem.EndsWith("at TestStackOverflow.Program.InfiniteRecursionA2()"))) + { + throw new Exception("Missing \"InfiniteRecursionA2\" method frame"); + } - return true; + if (!lines.Exists(elem => elem.EndsWith("at TestStackOverflow.Program.InfiniteRecursionB2()"))) + { + throw new Exception("Missing \"InfiniteRecursionB2\" method frame"); } - return false; + if (!lines.Exists(elem => elem.EndsWith("at TestStackOverflow.Program.InfiniteRecursionC2()"))) + { + throw new Exception("Missing \"InfiniteRecursionC2\" method frame"); + } } - static bool TestStackOverflow3() + [Fact] + public static void TestStackOverflowSmallFrameSecondaryThread() { - List lines; - if (TestStackOverflow("stackoverflow3", "", out lines)) + TestStackOverflow("stackoverflow", "smallframe secondary", out List lines); + + if (!lines.Exists(elem => elem.EndsWith("at TestStackOverflow.Program.Test(Boolean)"))) { - if (!lines[lines.Count - 1].EndsWith("at TestStackOverflow3.Program.Main()")) - { - Console.WriteLine("Missing \"Main\" method frame at the last line"); - return false; - } + throw new Exception("Missing \"TestStackOverflow.Program.Test\" method frame"); + } - if (!lines.Exists(elem => elem.EndsWith("at TestStackOverflow3.Program.Execute(System.String)"))) - { - Console.WriteLine("Missing \"Execute\" method frame"); - return false; - } + if (!lines.Exists(elem => elem.EndsWith("at TestStackOverflow.Program.InfiniteRecursionA()"))) + { + throw new Exception("Missing \"InfiniteRecursionA\" method frame"); + } - return true; + if (!lines.Exists(elem => elem.EndsWith("at TestStackOverflow.Program.InfiniteRecursionB()"))) + { + throw new Exception("Missing \"InfiniteRecursionB\" method frame"); } - return false; + if (!lines.Exists(elem => elem.EndsWith("at TestStackOverflow.Program.InfiniteRecursionC()"))) + { + throw new Exception("Missing \"InfiniteRecursionC\" method frame"); + } } - static int Main() + [Fact] + public static void TestStackOverflowLargeFrameSecondaryThread() { - s_currentPath = Directory.GetCurrentDirectory(); - s_corerunPath = Path.Combine(Environment.GetEnvironmentVariable("CORE_ROOT"), "corerun"); + TestStackOverflow("stackoverflow", "largeframe secondary", out List lines); - if (!TestStackOverflowSmallFrameMainThread()) + if (!lines.Exists(elem => elem.EndsWith("at TestStackOverflow.Program.Test(Boolean)"))) { - return 101; + throw new Exception("Missing \"TestStackOverflow.Program.Test\" method frame"); } - if (!TestStackOverflowLargeFrameMainThread()) + if (!lines.Exists(elem => elem.EndsWith("at TestStackOverflow.Program.InfiniteRecursionA2()"))) { - return 102; + throw new Exception("Missing \"InfiniteRecursionA2\" method frame"); } - if (!TestStackOverflowSmallFrameSecondaryThread()) + if (!lines.Exists(elem => elem.EndsWith("TestStackOverflow.Program.InfiniteRecursionB2()"))) { - return 103; + throw new Exception("Missing \"InfiniteRecursionB2\" method frame"); } - if (!TestStackOverflowLargeFrameSecondaryThread()) + if (!lines.Exists(elem => elem.EndsWith("TestStackOverflow.Program.InfiniteRecursionC2()"))) + { + throw new Exception("Missing \"InfiniteRecursionC2\" method frame"); + } + } + + [Fact] + public static void TestStackOverflow3() + { + TestStackOverflow("stackoverflow3", "", out List lines); + + if (!lines[lines.Count - 1].EndsWith("at TestStackOverflow3.Program.Main()")) { - return 104; + throw new Exception("Missing \"Main\" method frame at the last line"); } - if (!TestStackOverflow3()) + if (!lines.Exists(elem => elem.EndsWith("at TestStackOverflow3.Program.Execute(System.String)"))) { - return 105; + throw new Exception("Missing \"Execute\" method frame"); } - return 100; } } } diff --git a/src/tests/baseservices/exceptions/stackoverflow/stackoverflowtester.csproj b/src/tests/baseservices/exceptions/stackoverflow/stackoverflowtester.csproj index afed1789170b53..eb0ae0ea4cd17c 100644 --- a/src/tests/baseservices/exceptions/stackoverflow/stackoverflowtester.csproj +++ b/src/tests/baseservices/exceptions/stackoverflow/stackoverflowtester.csproj @@ -1,6 +1,7 @@ - Exe + + true false true diff --git a/src/tests/baseservices/exceptions/stacktrace/Tier1StackTrace.cs b/src/tests/baseservices/exceptions/stacktrace/Tier1StackTrace.cs index 4b0b98f58322c0..45d0c7a8015c7c 100644 --- a/src/tests/baseservices/exceptions/stacktrace/Tier1StackTrace.cs +++ b/src/tests/baseservices/exceptions/stacktrace/Tier1StackTrace.cs @@ -5,17 +5,20 @@ using System.Diagnostics; using System.Runtime.CompilerServices; using System.Threading; +using Xunit; -internal static class Program +public static class Program { - private static int Main() + [Fact] + public static void TestEntryPoint() { - const int Pass = 100, Fail = 1; - string tier0StackTrace = Capture(true); PromoteToTier1(() => Capture(false)); string tier1StackTrace = Capture(true); - return tier0StackTrace == tier1StackTrace ? Pass : Fail; + if (tier0StackTrace != tier1StackTrace) + { + throw new Exception($"Stack trace mismatch:\n------\nTier 0:\n------\n{tier0StackTrace}\n------\nTier 1:\n------\n{tier1StackTrace}"); + } } private static void PromoteToTier1(Action action) @@ -46,12 +49,16 @@ private static string Capture(bool doWork) string stackTrace = new StackTrace(true).ToString().Trim(); - // Remove the last line of the stack trace, which would correspond with Main() - int lastNewLineIndex = stackTrace.LastIndexOf('\n'); - if (lastNewLineIndex == -1) + // Remove everything past the test entrypoint line + int entrypointIndex = stackTrace.IndexOf("TestEntryPoint"); + if (entrypointIndex == -1) { return null; } - return stackTrace.Substring(0, lastNewLineIndex).Trim(); + while (entrypointIndex > 0 && stackTrace[entrypointIndex - 1] != '\n') + { + entrypointIndex--; + } + return stackTrace.Substring(0, entrypointIndex); } } diff --git a/src/tests/baseservices/exceptions/stacktrace/Tier1StackTrace.csproj b/src/tests/baseservices/exceptions/stacktrace/Tier1StackTrace.csproj index 83cd219165e2d3..e95d83a4a700b6 100644 --- a/src/tests/baseservices/exceptions/stacktrace/Tier1StackTrace.csproj +++ b/src/tests/baseservices/exceptions/stacktrace/Tier1StackTrace.csproj @@ -1,6 +1,7 @@ - Exe + + true true true 1 diff --git a/src/tests/baseservices/exceptions/unhandled/unhandled.cs b/src/tests/baseservices/exceptions/unhandled/unhandled.cs index f3f670d6f43a93..a21d7ddab1acf0 100644 --- a/src/tests/baseservices/exceptions/unhandled/unhandled.cs +++ b/src/tests/baseservices/exceptions/unhandled/unhandled.cs @@ -1,104 +1,15 @@ // 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.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; namespace TestUnhandledException { class Program { - static int Main(string[] args) + static void Main() { - if (args.Length != 0) - { - throw new Exception("Test"); - } - - List lines = new List(); - - Process testProcess = new Process(); - - // We don't need to trigger createdump logic. - testProcess.StartInfo.Environment.Remove("DOTNET_DbgEnableMiniDump"); - - testProcess.StartInfo.FileName = Environment.ProcessPath; - testProcess.StartInfo.Arguments = Environment.CommandLine + " throw"; - testProcess.StartInfo.RedirectStandardError = true; - testProcess.ErrorDataReceived += (sender, line) => - { - Console.WriteLine($"\"{line.Data}\""); - if (!string.IsNullOrEmpty(line.Data)) - { - lines.Add(line.Data); - } - }; - - testProcess.Start(); - testProcess.BeginErrorReadLine(); - testProcess.WaitForExit(); - testProcess.CancelErrorRead(); - - int expectedExitCode; - if (TestLibrary.Utilities.IsMonoRuntime) - { - expectedExitCode = 1; - } - else if (!OperatingSystem.IsWindows()) - { - expectedExitCode = 128 + 6; - } - else if (TestLibrary.Utilities.IsNativeAot) - { - expectedExitCode = unchecked((int)0xC0000409); - } - else - { - expectedExitCode = unchecked((int)0xE0434352); - } - - if (expectedExitCode != testProcess.ExitCode) - { - Console.WriteLine($"Wrong exit code 0x{testProcess.ExitCode:X8}"); - return 101; - } - - int exceptionStackFrameLine = 1; - if (TestLibrary.Utilities.IsMonoRuntime) - { - if (lines[0] != "Unhandled Exception:") - { - Console.WriteLine("Missing Unhandled exception header"); - return 102; - } - if (lines[1] != "System.Exception: Test") - { - Console.WriteLine("Missing exception type and message"); - return 103; - } - - exceptionStackFrameLine = 2; - } - else - { - if (lines[0] != "Unhandled exception. System.Exception: Test") - { - Console.WriteLine("Missing Unhandled exception header"); - return 102; - } - - } - - if (!lines[exceptionStackFrameLine].TrimStart().StartsWith("at TestUnhandledException.Program.Main")) - { - Console.WriteLine("Missing exception source frame"); - return 103; - } - - return 100; + throw new Exception("Test"); } } } diff --git a/src/tests/baseservices/exceptions/unhandled/unhandled.csproj b/src/tests/baseservices/exceptions/unhandled/unhandled.csproj index 047f77d45e41cb..66e7494198a664 100644 --- a/src/tests/baseservices/exceptions/unhandled/unhandled.csproj +++ b/src/tests/baseservices/exceptions/unhandled/unhandled.csproj @@ -1,6 +1,10 @@ - Exe + + true + false + BuildOnly + false diff --git a/src/tests/baseservices/exceptions/unhandled/unhandledTester.cs b/src/tests/baseservices/exceptions/unhandled/unhandledTester.cs new file mode 100644 index 00000000000000..0c174925706361 --- /dev/null +++ b/src/tests/baseservices/exceptions/unhandled/unhandledTester.cs @@ -0,0 +1,93 @@ +// 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.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Reflection; +using System.Text; +using System.Text.RegularExpressions; + +using Xunit; + +namespace TestUnhandledExceptionTester +{ + public class Program + { + [Fact] + public static void TestEntryPoint() + { + List lines = new List(); + + Process testProcess = new Process(); + + testProcess.StartInfo.FileName = Path.Combine(Environment.GetEnvironmentVariable("CORE_ROOT"), "corerun"); + testProcess.StartInfo.Arguments = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "unhandled.dll"); + testProcess.StartInfo.RedirectStandardError = true; + testProcess.ErrorDataReceived += (sender, line) => + { + Console.WriteLine($"\"{line.Data}\""); + if (!string.IsNullOrEmpty(line.Data)) + { + lines.Add(line.Data); + } + }; + + testProcess.Start(); + testProcess.BeginErrorReadLine(); + testProcess.WaitForExit(); + testProcess.CancelErrorRead(); + + int expectedExitCode; + if (TestLibrary.Utilities.IsMonoRuntime) + { + expectedExitCode = 1; + } + else if (!OperatingSystem.IsWindows()) + { + expectedExitCode = 128 + 6; + } + else if (TestLibrary.Utilities.IsNativeAot) + { + expectedExitCode = unchecked((int)0xC0000409); + } + else + { + expectedExitCode = unchecked((int)0xE0434352); + } + + if (expectedExitCode != testProcess.ExitCode) + { + throw new Exception($"Wrong exit code 0x{testProcess.ExitCode:X8}, expected 0x{expectedExitCode:X8}"); + } + + int exceptionStackFrameLine = 1; + if (TestLibrary.Utilities.IsMonoRuntime) + { + if (lines[0] != "Unhandled Exception:") + { + throw new Exception("Missing Unhandled exception header"); + } + if (lines[1] != "System.Exception: Test") + { + throw new Exception("Missing exception type and message"); + } + + exceptionStackFrameLine = 2; + } + else + { + if (lines[0] != "Unhandled exception. System.Exception: Test") + { + throw new Exception("Missing Unhandled exception header"); + } + + } + + if (!lines[exceptionStackFrameLine].TrimStart().StartsWith("at TestUnhandledException.Program.Main")) + { + throw new Exception("Missing exception source frame"); + } + } + } +} diff --git a/src/tests/baseservices/exceptions/unhandled/unhandledTester.csproj b/src/tests/baseservices/exceptions/unhandled/unhandledTester.csproj new file mode 100644 index 00000000000000..4e36bd12b7981d --- /dev/null +++ b/src/tests/baseservices/exceptions/unhandled/unhandledTester.csproj @@ -0,0 +1,19 @@ + + + + true + + false + + + + + + + + false + Content + Always + + + diff --git a/src/tests/baseservices/exceptions/unittests/Baadbaad.cs b/src/tests/baseservices/exceptions/unittests/Baadbaad.cs index e52bbb3410ffb4..bf1a1214a28558 100644 --- a/src/tests/baseservices/exceptions/unittests/Baadbaad.cs +++ b/src/tests/baseservices/exceptions/unittests/Baadbaad.cs @@ -3,6 +3,7 @@ using System; using System.IO; +using Xunit; // // main @@ -22,7 +23,8 @@ static void CountResults(int testReturnValue, ref int nSuccesses, ref int nFailu } } - public static int Main() + [Fact] + public static int TestEntryPoint() { int nSuccesses = 0; int nFailures = 0; diff --git a/src/tests/baseservices/exceptions/unittests/Baadbaad.csproj b/src/tests/baseservices/exceptions/unittests/Baadbaad.csproj index e756fc31ed2ee8..632cf201f27c8e 100644 --- a/src/tests/baseservices/exceptions/unittests/Baadbaad.csproj +++ b/src/tests/baseservices/exceptions/unittests/Baadbaad.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/unittests/BaseClass.csproj b/src/tests/baseservices/exceptions/unittests/BaseClass.csproj index b463b34d60bff6..eccad761ea533b 100644 --- a/src/tests/baseservices/exceptions/unittests/BaseClass.csproj +++ b/src/tests/baseservices/exceptions/unittests/BaseClass.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/unittests/CollidedUnwind.cs b/src/tests/baseservices/exceptions/unittests/CollidedUnwind.cs index af5f9c1e35b757..7566bf1302954f 100644 --- a/src/tests/baseservices/exceptions/unittests/CollidedUnwind.cs +++ b/src/tests/baseservices/exceptions/unittests/CollidedUnwind.cs @@ -3,6 +3,7 @@ using System; using System.IO; +using Xunit; public class TestSet { @@ -18,7 +19,8 @@ static void CountResults(int testReturnValue, ref int nSuccesses, ref int nFailu } } - public static int Main() + [Fact] + public static int TestEntryPoint() { int nSuccesses = 0; int nFailures = 0; diff --git a/src/tests/baseservices/exceptions/unittests/CollidedUnwind.csproj b/src/tests/baseservices/exceptions/unittests/CollidedUnwind.csproj index 4cc39d87a7465e..36f164c783cab1 100644 --- a/src/tests/baseservices/exceptions/unittests/CollidedUnwind.csproj +++ b/src/tests/baseservices/exceptions/unittests/CollidedUnwind.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/unittests/EHPatternTests.cs b/src/tests/baseservices/exceptions/unittests/EHPatternTests.cs index 7d776983079a72..c769ffbd52982f 100644 --- a/src/tests/baseservices/exceptions/unittests/EHPatternTests.cs +++ b/src/tests/baseservices/exceptions/unittests/EHPatternTests.cs @@ -3,6 +3,7 @@ using System; using System.IO; +using Xunit; // // infrastructure @@ -70,7 +71,8 @@ static void CountResults(int testReturnValue, ref int nSuccesses, ref int nFailu } } - public static int Main() + [Fact] + public static int TestEntryPoint() { int nSuccesses = 0; int nFailures = 0; diff --git a/src/tests/baseservices/exceptions/unittests/EHPatternTests.csproj b/src/tests/baseservices/exceptions/unittests/EHPatternTests.csproj index 1b181cd80731b9..4a4a15a97e14e6 100644 --- a/src/tests/baseservices/exceptions/unittests/EHPatternTests.csproj +++ b/src/tests/baseservices/exceptions/unittests/EHPatternTests.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/unittests/GoryManagedPresent.cs b/src/tests/baseservices/exceptions/unittests/GoryManagedPresent.cs index 0a082f629f847b..a690d0dd367178 100644 --- a/src/tests/baseservices/exceptions/unittests/GoryManagedPresent.cs +++ b/src/tests/baseservices/exceptions/unittests/GoryManagedPresent.cs @@ -3,6 +3,7 @@ using System; using System.IO; +using Xunit; public class TestSet { @@ -18,7 +19,8 @@ static void CountResults(int testReturnValue, ref int nSuccesses, ref int nFailu } } - public static int Main() + [Fact] + public static int TestEntryPoint() { int nSuccesses = 0; int nFailures = 0; diff --git a/src/tests/baseservices/exceptions/unittests/GoryManagedPresent.csproj b/src/tests/baseservices/exceptions/unittests/GoryManagedPresent.csproj index 91e5c744490132..2fe7fc589ebb10 100644 --- a/src/tests/baseservices/exceptions/unittests/GoryManagedPresent.csproj +++ b/src/tests/baseservices/exceptions/unittests/GoryManagedPresent.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/unittests/GoryNativePast.cs b/src/tests/baseservices/exceptions/unittests/GoryNativePast.cs index 3dfe19d48fc3b4..0cbc7b1b0efd50 100644 --- a/src/tests/baseservices/exceptions/unittests/GoryNativePast.cs +++ b/src/tests/baseservices/exceptions/unittests/GoryNativePast.cs @@ -3,6 +3,7 @@ using System; using System.IO; +using Xunit; public class TestSet { @@ -18,7 +19,8 @@ static void CountResults(int testReturnValue, ref int nSuccesses, ref int nFailu } } - public static int Main() + [Fact] + public static int TestEntryPoint() { int nSuccesses = 0; int nFailures = 0; diff --git a/src/tests/baseservices/exceptions/unittests/GoryNativePast.csproj b/src/tests/baseservices/exceptions/unittests/GoryNativePast.csproj index 2a3261357586f5..afce676b389dfe 100644 --- a/src/tests/baseservices/exceptions/unittests/GoryNativePast.csproj +++ b/src/tests/baseservices/exceptions/unittests/GoryNativePast.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/unittests/InnerFinally.csproj b/src/tests/baseservices/exceptions/unittests/InnerFinally.csproj index 25da8014c4356b..7bad983015a661 100644 --- a/src/tests/baseservices/exceptions/unittests/InnerFinally.csproj +++ b/src/tests/baseservices/exceptions/unittests/InnerFinally.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/unittests/InnerFinallyAndCatch.cs b/src/tests/baseservices/exceptions/unittests/InnerFinallyAndCatch.cs index 7a730e42409f8b..6d88ec09e2c6c0 100644 --- a/src/tests/baseservices/exceptions/unittests/InnerFinallyAndCatch.cs +++ b/src/tests/baseservices/exceptions/unittests/InnerFinallyAndCatch.cs @@ -3,6 +3,7 @@ using System; using System.IO; +using Xunit; public class TestSet { @@ -18,7 +19,8 @@ static void CountResults(int testReturnValue, ref int nSuccesses, ref int nFailu } } - public static int Main() + [Fact] + public static int TestEntryPoint() { int nSuccesses = 0; int nFailures = 0; diff --git a/src/tests/baseservices/exceptions/unittests/InnerFinallyAndCatch.csproj b/src/tests/baseservices/exceptions/unittests/InnerFinallyAndCatch.csproj index b476272b7bcada..acf36a0edf78ae 100644 --- a/src/tests/baseservices/exceptions/unittests/InnerFinallyAndCatch.csproj +++ b/src/tests/baseservices/exceptions/unittests/InnerFinallyAndCatch.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/unittests/Pending.cs b/src/tests/baseservices/exceptions/unittests/Pending.cs index ee8dc5a46c91f1..57b56317cc0019 100644 --- a/src/tests/baseservices/exceptions/unittests/Pending.cs +++ b/src/tests/baseservices/exceptions/unittests/Pending.cs @@ -3,6 +3,7 @@ using System; using System.IO; +using Xunit; public class TestSet { @@ -18,7 +19,8 @@ static void CountResults(int testReturnValue, ref int nSuccesses, ref int nFailu } } - public static int Main() + [Fact] + public static int TestEntryPoint() { int nSuccesses = 0; int nFailures = 0; diff --git a/src/tests/baseservices/exceptions/unittests/Pending.csproj b/src/tests/baseservices/exceptions/unittests/Pending.csproj index 2f0fab40ede0d6..29320fd94ffaeb 100644 --- a/src/tests/baseservices/exceptions/unittests/Pending.csproj +++ b/src/tests/baseservices/exceptions/unittests/Pending.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/unittests/Recurse.cs b/src/tests/baseservices/exceptions/unittests/Recurse.cs index 726672cc3fcad4..5f6ea3c6d22c0c 100644 --- a/src/tests/baseservices/exceptions/unittests/Recurse.cs +++ b/src/tests/baseservices/exceptions/unittests/Recurse.cs @@ -3,6 +3,7 @@ using System; using System.IO; +using Xunit; public class TestSet { @@ -18,7 +19,8 @@ static void CountResults(int testReturnValue, ref int nSuccesses, ref int nFailu } } - public static int Main() + [Fact] + public static int TestEntryPoint() { int nSuccesses = 0; int nFailures = 0; diff --git a/src/tests/baseservices/exceptions/unittests/Recurse.csproj b/src/tests/baseservices/exceptions/unittests/Recurse.csproj index 7e8e154716ec8f..de9574762ccdc2 100644 --- a/src/tests/baseservices/exceptions/unittests/Recurse.csproj +++ b/src/tests/baseservices/exceptions/unittests/Recurse.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/unittests/RecursiveRethrow.cs b/src/tests/baseservices/exceptions/unittests/RecursiveRethrow.cs index 0ac312e51837c4..e3177bca0a8920 100644 --- a/src/tests/baseservices/exceptions/unittests/RecursiveRethrow.cs +++ b/src/tests/baseservices/exceptions/unittests/RecursiveRethrow.cs @@ -3,6 +3,7 @@ using System; using System.IO; +using Xunit; public class TestSet { @@ -18,7 +19,8 @@ static void CountResults(int testReturnValue, ref int nSuccesses, ref int nFailu } } - public static int Main() + [Fact] + public static int TestEntryPoint() { int nSuccesses = 0; int nFailures = 0; diff --git a/src/tests/baseservices/exceptions/unittests/RecursiveRethrow.csproj b/src/tests/baseservices/exceptions/unittests/RecursiveRethrow.csproj index 372fc4349585eb..a5068b183a8db4 100644 --- a/src/tests/baseservices/exceptions/unittests/RecursiveRethrow.csproj +++ b/src/tests/baseservices/exceptions/unittests/RecursiveRethrow.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/unittests/RecursiveThrowNew.cs b/src/tests/baseservices/exceptions/unittests/RecursiveThrowNew.cs index 2dce0487db7e07..d0c827dd27e78a 100644 --- a/src/tests/baseservices/exceptions/unittests/RecursiveThrowNew.cs +++ b/src/tests/baseservices/exceptions/unittests/RecursiveThrowNew.cs @@ -3,6 +3,7 @@ using System; using System.IO; +using Xunit; public class TestSet { @@ -18,7 +19,8 @@ static void CountResults(int testReturnValue, ref int nSuccesses, ref int nFailu } } - public static int Main() + [Fact] + public static int TestEntryPoint() { int nSuccesses = 0; int nFailures = 0; diff --git a/src/tests/baseservices/exceptions/unittests/RecursiveThrowNew.csproj b/src/tests/baseservices/exceptions/unittests/RecursiveThrowNew.csproj index 265001717da73c..a2519153e3fe41 100644 --- a/src/tests/baseservices/exceptions/unittests/RecursiveThrowNew.csproj +++ b/src/tests/baseservices/exceptions/unittests/RecursiveThrowNew.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/unittests/RethrowAndFinally.csproj b/src/tests/baseservices/exceptions/unittests/RethrowAndFinally.csproj index 671eef71acc4f3..2090649d2bfc3f 100644 --- a/src/tests/baseservices/exceptions/unittests/RethrowAndFinally.csproj +++ b/src/tests/baseservices/exceptions/unittests/RethrowAndFinally.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/unittests/ReturnFromCatch.csproj b/src/tests/baseservices/exceptions/unittests/ReturnFromCatch.csproj index 07e8dcee3f74d6..090e4e7aa57cdc 100644 --- a/src/tests/baseservices/exceptions/unittests/ReturnFromCatch.csproj +++ b/src/tests/baseservices/exceptions/unittests/ReturnFromCatch.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/unittests/StrSwitchFinally.cs b/src/tests/baseservices/exceptions/unittests/StrSwitchFinally.cs index 147d77c21aa5d6..14de26ea89060e 100644 --- a/src/tests/baseservices/exceptions/unittests/StrSwitchFinally.cs +++ b/src/tests/baseservices/exceptions/unittests/StrSwitchFinally.cs @@ -3,6 +3,7 @@ using System; using System.IO; +using Xunit; // // main @@ -22,7 +23,8 @@ static void CountResults(int testReturnValue, ref int nSuccesses, ref int nFailu } } - public static int Main() + [Fact] + public static int TestEntryPoint() { int nSuccesses = 0; int nFailures = 0; diff --git a/src/tests/baseservices/exceptions/unittests/StrSwitchFinally.csproj b/src/tests/baseservices/exceptions/unittests/StrSwitchFinally.csproj index df7f3d9108cfd7..e365fa5fcc15ff 100644 --- a/src/tests/baseservices/exceptions/unittests/StrSwitchFinally.csproj +++ b/src/tests/baseservices/exceptions/unittests/StrSwitchFinally.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/unittests/ThrowInCatch.csproj b/src/tests/baseservices/exceptions/unittests/ThrowInCatch.csproj index 8b3c3e3439f59d..2ec497f2b05ab4 100644 --- a/src/tests/baseservices/exceptions/unittests/ThrowInCatch.csproj +++ b/src/tests/baseservices/exceptions/unittests/ThrowInCatch.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/unittests/ThrowInFinally.csproj b/src/tests/baseservices/exceptions/unittests/ThrowInFinally.csproj index 36ad927b89de46..14e15577eae49e 100644 --- a/src/tests/baseservices/exceptions/unittests/ThrowInFinally.csproj +++ b/src/tests/baseservices/exceptions/unittests/ThrowInFinally.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/unittests/ThrowInFinallyNestedInTry.cs b/src/tests/baseservices/exceptions/unittests/ThrowInFinallyNestedInTry.cs index 8cc583a3f02343..093e2f08a0e724 100644 --- a/src/tests/baseservices/exceptions/unittests/ThrowInFinallyNestedInTry.cs +++ b/src/tests/baseservices/exceptions/unittests/ThrowInFinallyNestedInTry.cs @@ -3,6 +3,7 @@ using System; using System.IO; +using Xunit; // // main @@ -22,7 +23,8 @@ static void CountResults(int testReturnValue, ref int nSuccesses, ref int nFailu } } - public static int Main() + [Fact] + public static int TestEntryPoint() { int nSuccesses = 0; int nFailures = 0; diff --git a/src/tests/baseservices/exceptions/unittests/ThrowInFinallyNestedInTry.csproj b/src/tests/baseservices/exceptions/unittests/ThrowInFinallyNestedInTry.csproj index 89c7b4b99eddac..75c269ac553ec7 100644 --- a/src/tests/baseservices/exceptions/unittests/ThrowInFinallyNestedInTry.csproj +++ b/src/tests/baseservices/exceptions/unittests/ThrowInFinallyNestedInTry.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/unittests/TryCatchInFinally.csproj b/src/tests/baseservices/exceptions/unittests/TryCatchInFinally.csproj index a975081e42810e..f78dc1cbf06626 100644 --- a/src/tests/baseservices/exceptions/unittests/TryCatchInFinally.csproj +++ b/src/tests/baseservices/exceptions/unittests/TryCatchInFinally.csproj @@ -1,6 +1,7 @@ - Exe + + true true 1 diff --git a/src/tests/baseservices/exceptions/unittests/baseclass.cs b/src/tests/baseservices/exceptions/unittests/baseclass.cs index dfd70a63b66a58..97526ad4ffb462 100644 --- a/src/tests/baseservices/exceptions/unittests/baseclass.cs +++ b/src/tests/baseservices/exceptions/unittests/baseclass.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; using System.IO; +using Xunit; // // main @@ -21,7 +22,8 @@ static void CountResults(int testReturnValue, ref int nSuccesses, ref int nFailu } } - public static int Main() + [Fact] + public static int TestEntryPoint() { int nSuccesses = 0; int nFailures = 0; diff --git a/src/tests/baseservices/exceptions/unittests/innerfinally.cs b/src/tests/baseservices/exceptions/unittests/innerfinally.cs index 9f41d24f2bd730..752f15e506b19b 100644 --- a/src/tests/baseservices/exceptions/unittests/innerfinally.cs +++ b/src/tests/baseservices/exceptions/unittests/innerfinally.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; using System.IO; +using Xunit; public class TestSet { @@ -17,7 +18,8 @@ static void CountResults(int testReturnValue, ref int nSuccesses, ref int nFailu } } - public static int Main() + [Fact] + public static int TestEntryPoint() { int nSuccesses = 0; int nFailures = 0; diff --git a/src/tests/baseservices/exceptions/unittests/rethrowandfinally.cs b/src/tests/baseservices/exceptions/unittests/rethrowandfinally.cs index 56af9b5b7b9489..de0338319693bb 100644 --- a/src/tests/baseservices/exceptions/unittests/rethrowandfinally.cs +++ b/src/tests/baseservices/exceptions/unittests/rethrowandfinally.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; using System.IO; +using Xunit; // // main @@ -21,7 +22,8 @@ static void CountResults(int testReturnValue, ref int nSuccesses, ref int nFailu } } - public static int Main() + [Fact] + public static int TestEntryPoint() { int nSuccesses = 0; int nFailures = 0; diff --git a/src/tests/baseservices/exceptions/unittests/returnfromcatch.cs b/src/tests/baseservices/exceptions/unittests/returnfromcatch.cs index 93b9f975773446..75934653d74755 100644 --- a/src/tests/baseservices/exceptions/unittests/returnfromcatch.cs +++ b/src/tests/baseservices/exceptions/unittests/returnfromcatch.cs @@ -1,11 +1,13 @@ // 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 Xunit; public class TestSet { - public static int Main() + [Fact] + public static int TestEntryPoint() { int retCode = (new ReturnFromCatchTest()).Run(); if (100 == retCode) diff --git a/src/tests/baseservices/exceptions/unittests/throwincatch.cs b/src/tests/baseservices/exceptions/unittests/throwincatch.cs index 2f7b67c9de48cc..877eea0dbc6883 100644 --- a/src/tests/baseservices/exceptions/unittests/throwincatch.cs +++ b/src/tests/baseservices/exceptions/unittests/throwincatch.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; using System.IO; +using Xunit; // // main @@ -21,7 +22,8 @@ static void CountResults(int testReturnValue, ref int nSuccesses, ref int nFailu } } - public static int Main() + [Fact] + public static int TestEntryPoint() { int nSuccesses = 0; int nFailures = 0; diff --git a/src/tests/baseservices/exceptions/unittests/throwinfinally.cs b/src/tests/baseservices/exceptions/unittests/throwinfinally.cs index c3bcc5290297f0..1360abb0d4d197 100644 --- a/src/tests/baseservices/exceptions/unittests/throwinfinally.cs +++ b/src/tests/baseservices/exceptions/unittests/throwinfinally.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; using System.IO; +using Xunit; // // main @@ -21,7 +22,8 @@ static void CountResults(int testReturnValue, ref int nSuccesses, ref int nFailu } } - public static int Main() + [Fact] + public static int TestEntryPoint() { int nSuccesses = 0; int nFailures = 0; diff --git a/src/tests/baseservices/exceptions/unittests/trycatchinfinally.cs b/src/tests/baseservices/exceptions/unittests/trycatchinfinally.cs index 5c031d51961625..d4fe564aeed330 100644 --- a/src/tests/baseservices/exceptions/unittests/trycatchinfinally.cs +++ b/src/tests/baseservices/exceptions/unittests/trycatchinfinally.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; using System.IO; +using Xunit; // // main @@ -21,7 +22,8 @@ static void CountResults(int testReturnValue, ref int nSuccesses, ref int nFailu } } - public static int Main() + [Fact] + public static int TestEntryPoint() { int nSuccesses = 0; int nFailures = 0; diff --git a/src/tests/baseservices/finalization/CriticalFinalizer.cs b/src/tests/baseservices/finalization/CriticalFinalizer.cs index 9ea7d56d881a87..74ebeb93a39aeb 100644 --- a/src/tests/baseservices/finalization/CriticalFinalizer.cs +++ b/src/tests/baseservices/finalization/CriticalFinalizer.cs @@ -9,6 +9,7 @@ using System.Runtime.CompilerServices; using System.Runtime.ConstrainedExecution; using System.Threading.Tasks; +using Xunit; class Normal { @@ -29,7 +30,7 @@ class Critical : CriticalFinalizerObject } } -static class CriticalFinalizerTest +public static class CriticalFinalizerTest { [MethodImpl(MethodImplOptions.NoInlining)] static void AllocateObjects(int count) @@ -45,7 +46,8 @@ static void AllocateObjects(int count) GC.KeepAlive(arr); } - static int Main() + [Fact] + public static int TestEntryPoint() { const int Count = 100; diff --git a/src/tests/baseservices/finalization/CriticalFinalizer.csproj b/src/tests/baseservices/finalization/CriticalFinalizer.csproj index d83ad37e49f1d7..e03c3e97ad927c 100644 --- a/src/tests/baseservices/finalization/CriticalFinalizer.csproj +++ b/src/tests/baseservices/finalization/CriticalFinalizer.csproj @@ -1,6 +1,7 @@ - Exe + + true diff --git a/src/tests/baseservices/finalization/Finalizer.csproj b/src/tests/baseservices/finalization/Finalizer.csproj index c7e6026192a4ca..5bda113e2e77e5 100644 --- a/src/tests/baseservices/finalization/Finalizer.csproj +++ b/src/tests/baseservices/finalization/Finalizer.csproj @@ -1,6 +1,7 @@ - Exe + + true 1 diff --git a/src/tests/baseservices/finalization/finalizer.cs b/src/tests/baseservices/finalization/finalizer.cs index fbfcfd16cdcf8d..8f068226286e25 100644 --- a/src/tests/baseservices/finalization/finalizer.cs +++ b/src/tests/baseservices/finalization/finalizer.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 Xunit; /* public interface IFinalize @@ -121,7 +122,8 @@ public Gen() { } public class Test { - public static int Main() + [Fact] + public static int TestEntryPoint() { return (new Test()).RunTest(); } diff --git a/src/tests/baseservices/ilasm_ildasm/regression/dd130885/xlib.csproj b/src/tests/baseservices/ilasm_ildasm/regression/dd130885/xlib.csproj index ba262fdf645374..dfcb9f60493044 100644 --- a/src/tests/baseservices/ilasm_ildasm/regression/dd130885/xlib.csproj +++ b/src/tests/baseservices/ilasm_ildasm/regression/dd130885/xlib.csproj @@ -1,6 +1,5 @@ - Library true 1 diff --git a/src/tests/baseservices/ilasm_ildasm/regression/vswhidbey267905/267905.csproj b/src/tests/baseservices/ilasm_ildasm/regression/vswhidbey267905/267905.csproj index 9130940e5a203e..abe22bd3f26bc0 100644 --- a/src/tests/baseservices/ilasm_ildasm/regression/vswhidbey267905/267905.csproj +++ b/src/tests/baseservices/ilasm_ildasm/regression/vswhidbey267905/267905.csproj @@ -1,6 +1,5 @@ - Library true 1 diff --git a/src/tests/baseservices/ilasm_ildasm/regression/vswhidbey305155/305155.cs b/src/tests/baseservices/ilasm_ildasm/regression/vswhidbey305155/305155.cs index 855c69807215f7..4e93e95544104c 100644 --- a/src/tests/baseservices/ilasm_ildasm/regression/vswhidbey305155/305155.cs +++ b/src/tests/baseservices/ilasm_ildasm/regression/vswhidbey305155/305155.cs @@ -1,15 +1,17 @@ // 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 Xunit; [AttributeUsage(AttributeTargets.Method)] public class MyAttribute : Attribute { - public Type[] Types; + public Type[] Types; } public class Test { - [MyAttribute(Types = new Type[]{typeof(string), typeof(void)})] - public static int Main() { return 0; } + [MyAttribute(Types = new Type[]{typeof(string), typeof(void)})] + [Fact] + public static void TestEntryPoint() { } } diff --git a/src/tests/baseservices/ilasm_ildasm/regression/vswhidbey305155/305155.csproj b/src/tests/baseservices/ilasm_ildasm/regression/vswhidbey305155/305155.csproj index e7e263fdac51d9..99197643a749e6 100644 --- a/src/tests/baseservices/ilasm_ildasm/regression/vswhidbey305155/305155.csproj +++ b/src/tests/baseservices/ilasm_ildasm/regression/vswhidbey305155/305155.csproj @@ -1,6 +1,5 @@ - Library true 1 diff --git a/src/tests/baseservices/ilasm_ildasm/regression/vswhidbey395914/395914.csproj b/src/tests/baseservices/ilasm_ildasm/regression/vswhidbey395914/395914.csproj index 81d07bb2bcc941..811322f9e3e222 100644 --- a/src/tests/baseservices/ilasm_ildasm/regression/vswhidbey395914/395914.csproj +++ b/src/tests/baseservices/ilasm_ildasm/regression/vswhidbey395914/395914.csproj @@ -1,6 +1,5 @@ - Library true 1 diff --git a/src/tests/baseservices/invalid_operations/InvalidOperations.csproj b/src/tests/baseservices/invalid_operations/InvalidOperations.csproj index 3c04f092ae83ca..5f4c03e91ae11a 100644 --- a/src/tests/baseservices/invalid_operations/InvalidOperations.csproj +++ b/src/tests/baseservices/invalid_operations/InvalidOperations.csproj @@ -1,6 +1,7 @@ - Exe + + true true diff --git a/src/tests/baseservices/mono/runningmono.cs b/src/tests/baseservices/mono/runningmono.cs index 9ccbcce11f98ac..eb897f04a95c0b 100644 --- a/src/tests/baseservices/mono/runningmono.cs +++ b/src/tests/baseservices/mono/runningmono.cs @@ -1,12 +1,14 @@ // 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 Xunit; namespace TestRunningMono { - class Program + public class Program { - public static int Main() + [Fact] + public static int TestEntryPoint() { const int Pass = 100, Fail = 1; bool isMono = typeof(object).Assembly.GetType("Mono.RuntimeStructs") != null; diff --git a/src/tests/baseservices/mono/runningmono.csproj b/src/tests/baseservices/mono/runningmono.csproj index c0a224c4f4b6ef..725b48bf011a9c 100644 --- a/src/tests/baseservices/mono/runningmono.csproj +++ b/src/tests/baseservices/mono/runningmono.csproj @@ -1,6 +1,7 @@ - Exe + + true false diff --git a/src/tests/baseservices/multidimmarray/enum.cs b/src/tests/baseservices/multidimmarray/enum.cs index 47854220b32ad5..334d42cd0d5da2 100644 --- a/src/tests/baseservices/multidimmarray/enum.cs +++ b/src/tests/baseservices/multidimmarray/enum.cs @@ -1,9 +1,11 @@ using System; +using Xunit; public class Test { enum State : sbyte { OK = 0, BUG = -1 } - static int Main() + [Fact] + public static int TestEntryPoint() { TestLibrary.TestFramework.BeginTestCase("Enum MultidimmArray"); var s = new State[1, 1]; diff --git a/src/tests/baseservices/multidimmarray/enum.csproj b/src/tests/baseservices/multidimmarray/enum.csproj index 72652f8430d8c5..197d4cc60200e4 100644 --- a/src/tests/baseservices/multidimmarray/enum.csproj +++ b/src/tests/baseservices/multidimmarray/enum.csproj @@ -1,6 +1,5 @@ - Library true 1 diff --git a/src/tests/baseservices/multidimmarray/rank1array.il b/src/tests/baseservices/multidimmarray/rank1array.il index 87da32f58d4eee..b1b88daa2e2106 100644 --- a/src/tests/baseservices/multidimmarray/rank1array.il +++ b/src/tests/baseservices/multidimmarray/rank1array.il @@ -7,6 +7,7 @@ // at the expected memory locations. .assembly extern mscorlib { } +.assembly extern xunit.core {} .assembly rank1array { @@ -16,8 +17,12 @@ .subsystem 0x0003 .corflags 0x00000001 +.class public auto ansi rank1array { .method public hidebysig static int32 Main () cil managed { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .locals init( [0] int32[] szArray, [1] int32[0...] mdArray @@ -157,3 +162,4 @@ DifferentTypes: ldc.i4 100 ret } +} diff --git a/src/tests/baseservices/multidimmarray/rank1array.ilproj b/src/tests/baseservices/multidimmarray/rank1array.ilproj index 6ae890d52b5b7b..a38eac100374a3 100644 --- a/src/tests/baseservices/multidimmarray/rank1array.ilproj +++ b/src/tests/baseservices/multidimmarray/rank1array.ilproj @@ -1,6 +1,7 @@ - Exe + + true 1 diff --git a/src/tests/baseservices/threading/Directory.Build.props b/src/tests/baseservices/threading/Directory.Build.props index 02a2c0eb2f6b60..eaafc60fa2f0ae 100644 --- a/src/tests/baseservices/threading/Directory.Build.props +++ b/src/tests/baseservices/threading/Directory.Build.props @@ -1,6 +1,5 @@ - diff --git a/src/tests/baseservices/typeequivalence/contracts/TypeContracts.csproj b/src/tests/baseservices/typeequivalence/contracts/TypeContracts.csproj index 306758e5a5b85f..8ee9620d55331a 100644 --- a/src/tests/baseservices/typeequivalence/contracts/TypeContracts.csproj +++ b/src/tests/baseservices/typeequivalence/contracts/TypeContracts.csproj @@ -1,7 +1,4 @@ - - Library - diff --git a/src/tests/baseservices/typeequivalence/impl/PunningLib.ilproj b/src/tests/baseservices/typeequivalence/impl/PunningLib.ilproj index 63831e07c6df90..8b878f563fb13e 100644 --- a/src/tests/baseservices/typeequivalence/impl/PunningLib.ilproj +++ b/src/tests/baseservices/typeequivalence/impl/PunningLib.ilproj @@ -1,7 +1,4 @@ - - Library - diff --git a/src/tests/baseservices/typeequivalence/impl/TypeImpl.csproj b/src/tests/baseservices/typeequivalence/impl/TypeImpl.csproj index b916b70076098c..a135d5a48238c0 100644 --- a/src/tests/baseservices/typeequivalence/impl/TypeImpl.csproj +++ b/src/tests/baseservices/typeequivalence/impl/TypeImpl.csproj @@ -1,7 +1,4 @@ - - Library - diff --git a/src/tests/baseservices/typeequivalence/istypeequivalent/istypeequivalent.cs b/src/tests/baseservices/typeequivalence/istypeequivalent/istypeequivalent.cs index b1da461ee4776a..9d70542ff9b95a 100644 --- a/src/tests/baseservices/typeequivalence/istypeequivalent/istypeequivalent.cs +++ b/src/tests/baseservices/typeequivalence/istypeequivalent/istypeequivalent.cs @@ -9,6 +9,8 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using TestLibrary; + using Xunit; // This test shares its logic with the managed type system test suite, and seeks to ensure the runtime agrees with it @@ -69,6 +71,7 @@ private static IEnumerable> GetTypesWhichClaimMatchingTyp } } + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsWindows))] public static void TestTypesWhichShouldMatch() { foreach (var typePair in GetTypesWhichClaimMatchingTypeIdentifiersInNamespace("TypesWhichMatch")) @@ -79,6 +82,7 @@ public static void TestTypesWhichShouldMatch() } } + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsWindows))] public static void TestTypesWhichShouldNotMatch() { foreach (var typePair in GetTypesWhichClaimMatchingTypeIdentifiersInNamespace("TypesWhichDoNotMatch")) @@ -87,18 +91,5 @@ public static void TestTypesWhichShouldNotMatch() Assert.False(typePair.Item1.IsEquivalentTo(typePair.Item2)); } } - - public static int Main() - { - if (!OperatingSystem.IsWindows()) - { - return 100; - } - - TestTypesWhichShouldMatch(); - TestTypesWhichShouldNotMatch(); - - return 100; - } } } diff --git a/src/tests/baseservices/typeequivalence/istypeequivalent/istypeequivalent.csproj b/src/tests/baseservices/typeequivalence/istypeequivalent/istypeequivalent.csproj index 98d6ad81b0ba9d..613497ba04ffeb 100644 --- a/src/tests/baseservices/typeequivalence/istypeequivalent/istypeequivalent.csproj +++ b/src/tests/baseservices/typeequivalence/istypeequivalent/istypeequivalent.csproj @@ -1,6 +1,7 @@ - Exe + + true True true @@ -10,6 +11,7 @@ + diff --git a/src/tests/baseservices/typeequivalence/istypeequivalent/typeequivalenttypes_1.csproj b/src/tests/baseservices/typeequivalence/istypeequivalent/typeequivalenttypes_1.csproj index 4c57dbcc522ad9..88b1833d02c978 100644 --- a/src/tests/baseservices/typeequivalence/istypeequivalent/typeequivalenttypes_1.csproj +++ b/src/tests/baseservices/typeequivalence/istypeequivalent/typeequivalenttypes_1.csproj @@ -1,6 +1,5 @@ - Library $(DefineConstants);TYPEEQUIVALENCEASSEMBLY_1 true diff --git a/src/tests/baseservices/typeequivalence/istypeequivalent/typeequivalenttypes_2.csproj b/src/tests/baseservices/typeequivalence/istypeequivalent/typeequivalenttypes_2.csproj index fe9e2a475dfbe1..462d5246fcdc37 100644 --- a/src/tests/baseservices/typeequivalence/istypeequivalent/typeequivalenttypes_2.csproj +++ b/src/tests/baseservices/typeequivalence/istypeequivalent/typeequivalenttypes_2.csproj @@ -1,6 +1,5 @@ - Library $(DefineConstants);TYPEEQUIVALENCEASSEMBLY_2 true diff --git a/src/tests/baseservices/typeequivalence/pia/PIAContract.csproj b/src/tests/baseservices/typeequivalence/pia/PIAContract.csproj index 306758e5a5b85f..8ee9620d55331a 100644 --- a/src/tests/baseservices/typeequivalence/pia/PIAContract.csproj +++ b/src/tests/baseservices/typeequivalence/pia/PIAContract.csproj @@ -1,7 +1,4 @@ - - Library - diff --git a/src/tests/baseservices/typeequivalence/signatures/basetestclassesil.ilproj b/src/tests/baseservices/typeequivalence/signatures/basetestclassesil.ilproj index 9de7e713a6e496..16c5501c7a97a6 100644 --- a/src/tests/baseservices/typeequivalence/signatures/basetestclassesil.ilproj +++ b/src/tests/baseservices/typeequivalence/signatures/basetestclassesil.ilproj @@ -1,7 +1,4 @@ - - Library - diff --git a/src/tests/baseservices/typeequivalence/signatures/nopiatestil.il b/src/tests/baseservices/typeequivalence/signatures/nopiatestil.il index 3ffaed86f8a6e0..0847732bae4408 100644 --- a/src/tests/baseservices/typeequivalence/signatures/nopiatestil.il +++ b/src/tests/baseservices/typeequivalence/signatures/nopiatestil.il @@ -10,6 +10,7 @@ .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. .ver 4:0:0:0 } +.assembly extern xunit.core {} .assembly extern testclassesil { .ver 0:0:0:0 @@ -952,8 +953,11 @@ IL_004d: ret } // end of method Program::Test14 - .method private hidebysig static int32 Main(string[] args) cil managed noinlining + .method public hidebysig static int32 Main(string[] args) cil managed noinlining { + .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( + 01 00 00 00 + ) .entrypoint // Code size 249 (0xf9) .maxstack 2 diff --git a/src/tests/baseservices/typeequivalence/signatures/nopiatestil.ilproj b/src/tests/baseservices/typeequivalence/signatures/nopiatestil.ilproj index c11566357a244b..605c52ed5cc211 100644 --- a/src/tests/baseservices/typeequivalence/signatures/nopiatestil.ilproj +++ b/src/tests/baseservices/typeequivalence/signatures/nopiatestil.ilproj @@ -1,6 +1,7 @@ - Exe + + true true diff --git a/src/tests/baseservices/typeequivalence/signatures/testclassesil.ilproj b/src/tests/baseservices/typeequivalence/signatures/testclassesil.ilproj index 33d76b40e6cd54..be40547c1bf555 100644 --- a/src/tests/baseservices/typeequivalence/signatures/testclassesil.ilproj +++ b/src/tests/baseservices/typeequivalence/signatures/testclassesil.ilproj @@ -1,7 +1,4 @@ - - Library - diff --git a/src/tests/baseservices/typeequivalence/simple/Simple.cs b/src/tests/baseservices/typeequivalence/simple/Simple.cs index 7595199a120e16..a5bc9a0984780a 100644 --- a/src/tests/baseservices/typeequivalence/simple/Simple.cs +++ b/src/tests/baseservices/typeequivalence/simple/Simple.cs @@ -285,7 +285,8 @@ private static void TestCastsOptimizations() EquivalentValueType inst = (EquivalentValueType)otherEquivalentValueTypeInstance; } - public static int Main() + [Fact] + public static int TestEntryPoint() { if (!OperatingSystem.IsWindows()) { diff --git a/src/tests/baseservices/typeequivalence/simple/Simple.csproj b/src/tests/baseservices/typeequivalence/simple/Simple.csproj index 39d83e32fccd42..44ffe34dd52916 100644 --- a/src/tests/baseservices/typeequivalence/simple/Simple.csproj +++ b/src/tests/baseservices/typeequivalence/simple/Simple.csproj @@ -1,6 +1,7 @@ - Exe + + true True true diff --git a/src/tests/baseservices/varargs/varargsupport.il b/src/tests/baseservices/varargs/varargsupport.il index 8d330c5136cdff..05e5395c8e6de9 100644 --- a/src/tests/baseservices/varargs/varargsupport.il +++ b/src/tests/baseservices/varargs/varargsupport.il @@ -15,7 +15,7 @@ } .namespace App { - .class auto ansi Foo extends [mscorlib]System.Object + .class public auto ansi Foo extends [mscorlib]System.Object { .field private class System.String text .method family newslot virtual instance vararg class App.Foo VargFunc() il managed diff --git a/src/tests/baseservices/varargs/varargsupport.ilproj b/src/tests/baseservices/varargs/varargsupport.ilproj index aa8a12e3192a72..3e92be6b1690bb 100644 --- a/src/tests/baseservices/varargs/varargsupport.ilproj +++ b/src/tests/baseservices/varargs/varargsupport.ilproj @@ -1,6 +1,7 @@ - Exe + + true Full diff --git a/src/tests/baseservices/varargs/varargsupport_r.ilproj b/src/tests/baseservices/varargs/varargsupport_r.ilproj index 6a144ab08286f4..845415d02427d5 100644 --- a/src/tests/baseservices/varargs/varargsupport_r.ilproj +++ b/src/tests/baseservices/varargs/varargsupport_r.ilproj @@ -1,6 +1,7 @@ - Exe + + true From cf9bb86cd908a00fa50459ae17ec9c4a76f85fe6 Mon Sep 17 00:00:00 2001 From: Will Smith Date: Sun, 29 Oct 2023 20:01:23 -0700 Subject: [PATCH 30/47] Enable IlasmRoundTrip tests for merged tests (#93368) * Initial work * Tweak * Tweak * Do not generate _ilasmroundtrip.py for tests that have a generated run script * Reduce imports * Force fail to see where CI fails * Revert forcing failure. Run roundtrip on build. * Trying to fix script * Backslash tweak * Do not roundtrip the same assembly * Fixing * Remove import glob * Added is_managed_assembly * remove print * Fixed paths * Support bash. Ignore certain tests for arm. Fix poison test. * Update CLRTest.Jit.targets * Feedback. Added AssemblyChecker. * Fix paths * Update src/tests/Common/Directory.Build.targets Co-authored-by: Bruce Forstall * Feedback * Feedback * Update AssemblyChecker.csproj * Update Program.cs * Trying to fix calling python on helix. * Remove old roundtrip script calls. Added --is-exe option for AssemblyChecker. * Tweak option: * Remove check * Remove imports * Fix build * Fix syntax errors. Fixed Popen arguments * Fixed Popen arguments * Fixing debug check * Fixing tests * Update ILVerificationTests.csproj * Fixing tests * Feedback * Feedback * Update CLRTest.Jit.targets * Added help usage flag for AssemblyChecker * Feedback on assembly-checker --------- Co-authored-by: Bruce Forstall --- eng/Subsets.props | 3 +- .../AssemblyChecker/AssemblyChecker.csproj | 16 ++ src/coreclr/tools/AssemblyChecker/Program.cs | 117 ++++++++++ src/tests/Common/CLRTest.Execute.Bash.targets | 4 - .../Common/CLRTest.Execute.Batch.targets | 2 - src/tests/Common/CLRTest.Jit.targets | 199 ++++++++++-------- src/tests/Common/Directory.Build.targets | 5 + .../Methodical/fp/exgen/10w5d_cs_do.csproj | 1 + .../CodeQuality/Bytemark/Bytemark.csproj | 1 + .../CodeQuality/Roslyn/CscBench.csproj | 1 + .../BinderTracingTest.ResolutionFlow.csproj | 2 + src/tests/ilverify/ILVerificationTests.csproj | 2 + 12 files changed, 255 insertions(+), 98 deletions(-) create mode 100644 src/coreclr/tools/AssemblyChecker/AssemblyChecker.csproj create mode 100644 src/coreclr/tools/AssemblyChecker/Program.cs diff --git a/eng/Subsets.props b/eng/Subsets.props index f2480616431b51..ce90e8748f887d 100644 --- a/eng/Subsets.props +++ b/eng/Subsets.props @@ -336,7 +336,8 @@ $(CoreClrProjectRoot)tools\r2rdump\R2RDump.csproj; $(CoreClrProjectRoot)tools\dotnet-pgo\dotnet-pgo.csproj; $(CoreClrProjectRoot)tools\aot\ILCompiler\repro\repro.csproj; - $(CoreClrProjectRoot)tools\r2rtest\R2RTest.csproj" Category="clr" Condition="'$(DotNetBuildFromSource)' != 'true'"/> + $(CoreClrProjectRoot)tools\r2rtest\R2RTest.csproj; + $(CoreClrProjectRoot)tools\AssemblyChecker\AssemblyChecker.csproj" Category="clr" Condition="'$(DotNetBuildFromSource)' != 'true'"/> diff --git a/src/coreclr/tools/AssemblyChecker/AssemblyChecker.csproj b/src/coreclr/tools/AssemblyChecker/AssemblyChecker.csproj new file mode 100644 index 00000000000000..821c47c95403cd --- /dev/null +++ b/src/coreclr/tools/AssemblyChecker/AssemblyChecker.csproj @@ -0,0 +1,16 @@ + + + AssemblyChecker + Exe + $(NetCoreAppToolCurrent) + AnyCPU + false + true + true + false + enable + enable + $(RuntimeBinDir)\AssemblyChecker + false + + diff --git a/src/coreclr/tools/AssemblyChecker/Program.cs b/src/coreclr/tools/AssemblyChecker/Program.cs new file mode 100644 index 00000000000000..69f86e050beb22 --- /dev/null +++ b/src/coreclr/tools/AssemblyChecker/Program.cs @@ -0,0 +1,117 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Text; +using System.Diagnostics; +using System.Reflection; +using System.Reflection.Metadata; +using System.Reflection.PortableExecutable; + +namespace AssemblyChecker +{ + /// + /// This is a simple console application that is designed to answer True or False + /// questions about whether a given file is a managed assembly or not. + /// You can also ask whether or not the assembly is debuggable. + /// Return code of 0 indicates the file is a managed assembly. + /// Return code of 1 indicates the file is not a managed assembly. No errors will be printed for this one. + /// + public class Program + { + private const string HelpText = @" +Usage: + : Check if the file-path is a managed assembly. + --is-debug : Check if the file-path is a managed assembly that is built with debuggability. + --is-exe : Check if the file-path is a managed assembly that is an executable. +"; + + static bool IsAssembly(string path) + { + using var fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); + + // Try to read CLI metadata from the PE file. + using var peReader = new PEReader(fs); + + if (!peReader.HasMetadata) + { + return false; // File does not have CLI metadata. + } + + // Check that file has an assembly manifest. + MetadataReader reader = peReader.GetMetadataReader(); + return reader.IsAssembly; + } + + static bool IsDebug(string path) + { + return + Assembly.LoadFrom(path) + .GetCustomAttributes(typeof(DebuggableAttribute), false) + .OfType().Any(x => x.IsJITOptimizerDisabled); + } + + static bool IsExe(string path) + { + using var fs = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); + + // Try to read CLI metadata from the PE file. + using var peReader = new PEReader(fs); + + if (!peReader.HasMetadata) + { + return false; // File does not have CLI metadata. + } + + return peReader.PEHeaders.IsExe; + } + + static int Main(string[] args) + { + if (args.Length == 0) + { + Console.WriteLine(HelpText); + Console.Error.WriteLine("\nExpected assembly file-path."); + return 2; + } + + // Help + if (args.Contains("-h")) + { + Console.WriteLine(HelpText); + return 0; + } + + if (args.Length == 1) + { + return IsAssembly(args[0]) ? 0 : 1; + } + + if (args.Length == 2) + { + switch (args[0]) + { + case "--is-debug": + { + return IsDebug(args[1]) ? 0 : 1; + } + + case "--is-exe": + { + return IsExe(args[1]) ? 0 : 1; + } + + default: + { + Console.WriteLine(HelpText); + Console.Error.WriteLine("\nInvalid option."); + return 2; + } + } + } + + Console.WriteLine(HelpText); + Console.Error.WriteLine("\nToo many arguments."); + return 2; + } + } +} diff --git a/src/tests/Common/CLRTest.Execute.Bash.targets b/src/tests/Common/CLRTest.Execute.Bash.targets index ea33ed79bad9b3..81a50db81cacc4 100644 --- a/src/tests/Common/CLRTest.Execute.Bash.targets +++ b/src/tests/Common/CLRTest.Execute.Bash.targets @@ -381,8 +381,6 @@ else LAUNCHER="$_DebuggerFullPath $_DebuggerArgsSeparator $(CLRTestRunFile)" fi -$(BashIlrtTestLaunchCmds) - if [ ! -z ${RunCrossGen2+x} ]%3B then TakeLock fi @@ -412,8 +410,6 @@ else LAUNCHER="$_DebuggerFullPath $_DebuggerArgsSeparator $(CLRTestRunFile)" fi -$(BashIlrtTestLaunchCmds) - if [ ! -z ${RunCrossGen2+x} ]%3B then TakeLock fi diff --git a/src/tests/Common/CLRTest.Execute.Batch.targets b/src/tests/Common/CLRTest.Execute.Batch.targets index 90ba71856b72e8..f19c8987bbc6f4 100644 --- a/src/tests/Common/CLRTest.Execute.Batch.targets +++ b/src/tests/Common/CLRTest.Execute.Batch.targets @@ -318,8 +318,6 @@ IF NOT "%CLRCustomTestLauncher%"=="" ( set LAUNCHER=%_DebuggerFullPath% $(CLRTestRunFile) ) -$(BatchIlrtTestLaunchCmds) - if defined RunCrossGen2 ( call :TakeLock ) diff --git a/src/tests/Common/CLRTest.Jit.targets b/src/tests/Common/CLRTest.Jit.targets index 9748b6424f7374..476595df0c8be9 100644 --- a/src/tests/Common/CLRTest.Jit.targets +++ b/src/tests/Common/CLRTest.Jit.targets @@ -62,66 +62,16 @@ export RunningIlasmRoundTrip= if [ -z "$DoLink" -a ! -z "$RunningIlasmRoundTrip" ]; then - mkdir IL-RT - cp $(InputAssemblyName) $(TargetAssemblyName) - echo "$CORE_ROOT/ildasm" -raweh -unicode -out=$(DisassemblyName) $(TargetAssemblyName) - "$CORE_ROOT/ildasm" -raweh -unicode -out=$(DisassemblyName) $(TargetAssemblyName) + python3 $(AssemblyName)_ilasmroundtrip.py ERRORLEVEL=$? if [ $ERRORLEVEL -ne 0 ] then - echo EXECUTION OF ILDASM - FAILED $ERRORLEVEL - exit 1 - fi - if [ ! -f "$(DisassemblyName)" ] - then - echo "EXECUTION OF ILDASM - FAILED $(DisassemblyName) is missing" - exit 1 - fi - - ilasm_count=1 - while true - do - echo "$CORE_ROOT/ilasm" -output=$(InputAssemblyName) $(_IlasmSwitches) $(DisassemblyName) - "$CORE_ROOT/ilasm" -output=$(InputAssemblyName) $(_IlasmSwitches) $(DisassemblyName) - ERRORLEVEL=$? - if [ $ERRORLEVEL -eq 0 ] - then - break - fi - - echo EXECUTION $ilasm_count OF ILASM - FAILED with $ERRORLEVEL - - if [ $ilasm_count -eq 3 ] - then - break - fi - - ((ilasm_count++)) - echo Trying again - sleep 10 - done - - if [ $ERRORLEVEL -ne 0 ] - then + echo ILASM ROUND-TRIP - FAILED $ERRORLEVEL exit 1 fi fi ]]> - - @@ -144,54 +94,18 @@ set RunningIlasmRoundTrip= REM IlasmRoundTrip Script REM Disable Ilasm round-tripping for Linker tests. REM Todo: Ilasm round-trip on linked binaries. + IF NOT DEFINED DoLink ( IF DEFINED RunningIlasmRoundTrip ( - mkdir IL-RT - copy $(InputAssemblyName) $(TargetAssemblyName) - ECHO %CORE_ROOT%\ildasm.exe /raweh /unicode /out=$(DisassemblyName) $(TargetAssemblyName) - %CORE_ROOT%\ildasm.exe /raweh /unicode /out=$(DisassemblyName) $(TargetAssemblyName) - + python $(AssemblyName)_ilasmroundtrip.py IF NOT "!ERRORLEVEL!"=="0" ( - ECHO EXECUTION OF ILDASM - FAILED !ERRORLEVEL! - Exit /b 1 - ) - IF NOT EXIST $(DisassemblyName) ( - ECHO EXECUTION OF ILDASM - FAILED $(DisassemblyName) is missing - Exit /b 1 - ) - - set ilasm_count=1 -:Try_ilasm - ECHO %CORE_ROOT%\ilasm.exe /output=$(InputAssemblyName) $(_IlasmSwitches) $(DisassemblyName) - %CORE_ROOT%\ilasm.exe /output=$(InputAssemblyName) $(_IlasmSwitches) $(DisassemblyName) - IF NOT "!ERRORLEVEL!"=="0" ( - ECHO EXECUTION OF ILASM - Try !ilasm_count! FAILED with status !ERRORLEVEL! - IF !ilasm_count! LEQ 3 ( - ECHO Trying again - set /A ilasm_count=ilasm_count+1 - timeout /t 10 /nobreak - goto :Try_ilasm - ) - ECHO EXECUTION OF ILASM - FAILED + ECHO ILASM ROUND-TRIP - FAILED !ERRORLEVEL! Exit /b 1 ) ) ) ]]> - - @@ -365,6 +279,109 @@ set DOTNET_JitPath=%CORE_ROOT%\superpmi-shim-collector.dll + + + + + $(AssemblyName).dll + IL-RT/$(AssemblyName).il + IL-RT/$(AssemblyName).dll + <_IlasmRoundTripScriptText> + + + + + + True + + diff --git a/src/tests/JIT/Methodical/fp/exgen/10w5d_cs_do.csproj b/src/tests/JIT/Methodical/fp/exgen/10w5d_cs_do.csproj index 9eff379e0d4559..d1e37c52b64235 100644 --- a/src/tests/JIT/Methodical/fp/exgen/10w5d_cs_do.csproj +++ b/src/tests/JIT/Methodical/fp/exgen/10w5d_cs_do.csproj @@ -3,6 +3,7 @@ true + true Full diff --git a/src/tests/JIT/Performance/CodeQuality/Bytemark/Bytemark.csproj b/src/tests/JIT/Performance/CodeQuality/Bytemark/Bytemark.csproj index 03274a86e59cc7..de85a9ce57835e 100644 --- a/src/tests/JIT/Performance/CodeQuality/Bytemark/Bytemark.csproj +++ b/src/tests/JIT/Performance/CodeQuality/Bytemark/Bytemark.csproj @@ -3,6 +3,7 @@ true true + true $(NoWarn);xUnit1013 true diff --git a/src/tests/JIT/Performance/CodeQuality/Roslyn/CscBench.csproj b/src/tests/JIT/Performance/CodeQuality/Roslyn/CscBench.csproj index 37d4ba53a4c2be..045dc9053d1af6 100644 --- a/src/tests/JIT/Performance/CodeQuality/Roslyn/CscBench.csproj +++ b/src/tests/JIT/Performance/CodeQuality/Roslyn/CscBench.csproj @@ -6,6 +6,7 @@ $(NoWarn);xUnit1013 true true + true pdbonly diff --git a/src/tests/Loader/binding/tracing/BinderTracingTest.ResolutionFlow.csproj b/src/tests/Loader/binding/tracing/BinderTracingTest.ResolutionFlow.csproj index 0bb68d9cb843d3..07f4907e396c9d 100644 --- a/src/tests/Loader/binding/tracing/BinderTracingTest.ResolutionFlow.csproj +++ b/src/tests/Loader/binding/tracing/BinderTracingTest.ResolutionFlow.csproj @@ -4,6 +4,8 @@ true true + true + true diff --git a/src/tests/ilverify/ILVerificationTests.csproj b/src/tests/ilverify/ILVerificationTests.csproj index 3144da43d0c20c..f9f7e7521ffaff 100644 --- a/src/tests/ilverify/ILVerificationTests.csproj +++ b/src/tests/ilverify/ILVerificationTests.csproj @@ -5,6 +5,8 @@ true true + true + true From e5c631d28b985b773b28d0cb2346f49a92bd41dd Mon Sep 17 00:00:00 2001 From: Badre BSAILA <54767641+pedrobsaila@users.noreply.github.com> Date: Mon, 30 Oct 2023 07:08:08 +0100 Subject: [PATCH 31/47] Improve ArraySegment debugging (#90488) --- src/libraries/System.Private.CoreLib/src/System/ArraySegment.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libraries/System.Private.CoreLib/src/System/ArraySegment.cs b/src/libraries/System.Private.CoreLib/src/System/ArraySegment.cs index e4ec370796bf60..5561c8ec3a4200 100644 --- a/src/libraries/System.Private.CoreLib/src/System/ArraySegment.cs +++ b/src/libraries/System.Private.CoreLib/src/System/ArraySegment.cs @@ -19,6 +19,8 @@ namespace System // (ie, users could assign a new value to the old location). [Serializable] [TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] + [DebuggerTypeProxy(typeof(ICollectionDebugView<>))] + [DebuggerDisplay("Count = {Count}")] #pragma warning disable CA1066 // adding IEquatable implementation could change semantics of code like that in xunit that queries for IEquatable vs enumerating contents public readonly struct ArraySegment : IList, IReadOnlyList #pragma warning restore CA1066 From 7420ee78b7fc63bcefbbd82b0a382599302c99b4 Mon Sep 17 00:00:00 2001 From: Gleb Balykov Date: Mon, 30 Oct 2023 18:53:41 +0900 Subject: [PATCH 32/47] Fix test returning 100 unconditionally (#94146) Xunit error XUW1002: Tests should not unconditionally return 100. Convert to a void return. --- src/tests/JIT/opt/RedundantBranch/RedundantBranchUnsigned2.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/tests/JIT/opt/RedundantBranch/RedundantBranchUnsigned2.cs b/src/tests/JIT/opt/RedundantBranch/RedundantBranchUnsigned2.cs index 7612414e4d1a58..b42c951517a039 100644 --- a/src/tests/JIT/opt/RedundantBranch/RedundantBranchUnsigned2.cs +++ b/src/tests/JIT/opt/RedundantBranch/RedundantBranchUnsigned2.cs @@ -9,7 +9,7 @@ public class RedundantBranchUnsigned2 { [Fact] - public static int TestEntryPoint() + public static void TestEntryPoint() { int[] arr1 = new int[2]; Test_Span1(arr1, -1); @@ -37,7 +37,6 @@ public static int TestEntryPoint() // Should not throw NRE Test_Array(arr3, -1); - return 100; } private static void Throws(Action action) where T : Exception From 3295789aa9a959a637b2a6b59eb1df1870df4658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Mon, 30 Oct 2023 14:21:24 +0100 Subject: [PATCH 33/47] Delete Interop.PrintDlg file, it was moved to dotnet/winforms (#94171) --- .../Windows/Comdlg32/Interop.PrintDlg.cs | 67 ------------------- 1 file changed, 67 deletions(-) delete mode 100644 src/libraries/Common/src/Interop/Windows/Comdlg32/Interop.PrintDlg.cs diff --git a/src/libraries/Common/src/Interop/Windows/Comdlg32/Interop.PrintDlg.cs b/src/libraries/Common/src/Interop/Windows/Comdlg32/Interop.PrintDlg.cs deleted file mode 100644 index 8fe0c9b9bd7ef3..00000000000000 --- a/src/libraries/Common/src/Interop/Windows/Comdlg32/Interop.PrintDlg.cs +++ /dev/null @@ -1,67 +0,0 @@ -// 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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Comdlg32 - { - [LibraryImport(Libraries.Comdlg32, EntryPoint="PrintDlgW", SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - internal static partial bool PrintDlg(ref PRINTDLG lppd); - - [LibraryImport(Libraries.Comdlg32, EntryPoint="PrintDlgW", SetLastError = true)] - [return: MarshalAs(UnmanagedType.Bool)] - internal static partial bool PrintDlg(ref PRINTDLGX86 lppd); - - [StructLayout(LayoutKind.Sequential)] - internal struct PRINTDLG - { - internal int lStructSize; - internal IntPtr hwndOwner; - internal IntPtr hDevMode; - internal IntPtr hDevNames; - internal IntPtr hDC; - internal int Flags; - internal short nFromPage; - internal short nToPage; - internal short nMinPage; - internal short nMaxPage; - internal short nCopies; - internal IntPtr hInstance; - internal IntPtr lCustData; - internal IntPtr lpfnPrintHook; - internal IntPtr lpfnSetupHook; - internal IntPtr lpPrintTemplateName; - internal IntPtr lpSetupTemplateName; - internal IntPtr hPrintTemplate; - internal IntPtr hSetupTemplate; - } - - [StructLayout(LayoutKind.Sequential, Pack = 1)] - internal struct PRINTDLGX86 - { - internal int lStructSize; - internal IntPtr hwndOwner; - internal IntPtr hDevMode; - internal IntPtr hDevNames; - internal IntPtr hDC; - internal int Flags; - internal short nFromPage; - internal short nToPage; - internal short nMinPage; - internal short nMaxPage; - internal short nCopies; - internal IntPtr hInstance; - internal IntPtr lCustData; - internal IntPtr lpfnPrintHook; - internal IntPtr lpfnSetupHook; - internal IntPtr lpPrintTemplateName; - internal IntPtr lpSetupTemplateName; - internal IntPtr hPrintTemplate; - internal IntPtr hSetupTemplate; - } - } -} From 44a5abd54c8c6888cdbb7fac490279fd7ee3334e Mon Sep 17 00:00:00 2001 From: Rob Hague Date: Mon, 30 Oct 2023 14:24:52 +0000 Subject: [PATCH 34/47] Use SequenceEqual in BigInteger.Equals (#91416) --- .../src/System/Numerics/BigInteger.cs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/libraries/System.Runtime.Numerics/src/System/Numerics/BigInteger.cs b/src/libraries/System.Runtime.Numerics/src/System/Numerics/BigInteger.cs index 2f8181f0d42176..b306da5f3726f1 100644 --- a/src/libraries/System.Runtime.Numerics/src/System/Numerics/BigInteger.cs +++ b/src/libraries/System.Runtime.Numerics/src/System/Numerics/BigInteger.cs @@ -1137,19 +1137,7 @@ public bool Equals(BigInteger other) AssertValid(); other.AssertValid(); - if (_sign != other._sign) - return false; - if (_bits == other._bits) - // _sign == other._sign && _bits == null && other._bits == null - return true; - - if (_bits == null || other._bits == null) - return false; - int cu = _bits.Length; - if (cu != other._bits.Length) - return false; - int cuDiff = GetDiffLength(_bits, other._bits, cu); - return cuDiff == 0; + return _sign == other._sign && _bits.AsSpan().SequenceEqual(other._bits); } public int CompareTo(long other) From c1f43410e677b7a4d34113582ae4703aa6c1cc99 Mon Sep 17 00:00:00 2001 From: Eirik Tsarpalis Date: Mon, 30 Oct 2023 16:04:33 +0000 Subject: [PATCH 35/47] Implement PriorityQueue.Remove (#93994) * Implement PriorityQueue.Remove * Update src/libraries/System.Collections/src/System/Collections/Generic/PriorityQueue.cs * Update src/libraries/System.Collections/src/System/Collections/Generic/PriorityQueue.cs Co-authored-by: Dan Moseley * Update src/libraries/System.Collections/src/System/Collections/Generic/PriorityQueue.cs * Update src/libraries/System.Collections/src/System/Collections/Generic/PriorityQueue.cs * Update src/libraries/System.Collections/src/System/Collections/Generic/PriorityQueue.cs Co-authored-by: Stephen Toub * Address feedback. * Address feedback * Add a Dijkstra smoke test. * Alias distance type --------- Co-authored-by: Dan Moseley Co-authored-by: Stephen Toub --- .../ref/System.Collections.cs | 1 + .../Collections/Generic/PriorityQueue.cs | 88 +++++++++++++++++++ .../PriorityQueue.Generic.Tests.cs | 31 ++++++- .../PriorityQueue.Tests.Dijkstra.cs | 78 ++++++++++++++++ .../PriorityQueue/PriorityQueue.Tests.cs | 61 ++++++++++++- .../tests/System.Collections.Tests.csproj | 3 +- 6 files changed, 259 insertions(+), 3 deletions(-) create mode 100644 src/libraries/System.Collections/tests/Generic/PriorityQueue/PriorityQueue.Tests.Dijkstra.cs diff --git a/src/libraries/System.Collections/ref/System.Collections.cs b/src/libraries/System.Collections/ref/System.Collections.cs index b0272046b38412..c12b04c3a3cf07 100644 --- a/src/libraries/System.Collections/ref/System.Collections.cs +++ b/src/libraries/System.Collections/ref/System.Collections.cs @@ -126,6 +126,7 @@ public void EnqueueRange(System.Collections.Generic.IEnumerable<(TElement Elemen public void EnqueueRange(System.Collections.Generic.IEnumerable elements, TPriority priority) { } public int EnsureCapacity(int capacity) { throw null; } public TElement Peek() { throw null; } + public bool Remove(TElement element, [System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute(false)] out TElement removedElement, [System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute(false)] out TPriority priority, System.Collections.Generic.IEqualityComparer? equalityComparer = null) { throw null; } public void TrimExcess() { } public bool TryDequeue([System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute(false)] out TElement element, [System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute(false)] out TPriority priority) { throw null; } public bool TryPeek([System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute(false)] out TElement element, [System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute(false)] out TPriority priority) { throw null; } diff --git a/src/libraries/System.Collections/src/System/Collections/Generic/PriorityQueue.cs b/src/libraries/System.Collections/src/System/Collections/Generic/PriorityQueue.cs index e8d8221641cd2a..edc1327b446cab 100644 --- a/src/libraries/System.Collections/src/System/Collections/Generic/PriorityQueue.cs +++ b/src/libraries/System.Collections/src/System/Collections/Generic/PriorityQueue.cs @@ -502,6 +502,59 @@ public void EnqueueRange(IEnumerable elements, TPriority priority) } } + /// + /// Removes the first occurrence that equals the specified parameter. + /// + /// The element to try to remove. + /// The actual element that got removed from the queue. + /// The priority value associated with the removed element. + /// The equality comparer governing element equality. + /// if matching entry was found and removed, otherwise. + /// + /// The method performs a linear-time scan of every element in the heap, removing the first value found to match the parameter. + /// In case of duplicate entries, what entry does get removed is non-deterministic and does not take priority into account. + /// + /// If no is specified, will be used instead. + /// + public bool Remove( + TElement element, + [MaybeNullWhen(false)] out TElement removedElement, + [MaybeNullWhen(false)] out TPriority priority, + IEqualityComparer? equalityComparer = null) + { + int index = FindIndex(element, equalityComparer); + if (index < 0) + { + removedElement = default; + priority = default; + return false; + } + + (TElement Element, TPriority Priority)[] nodes = _nodes; + (removedElement, priority) = nodes[index]; + int newSize = --_size; + + if (index < newSize) + { + // We're removing an element from the middle of the heap. + // Pop the last element in the collection and sift downward from the removed index. + (TElement Element, TPriority Priority) lastNode = nodes[newSize]; + + if (_comparer == null) + { + MoveDownDefaultComparer(lastNode, index); + } + else + { + MoveDownCustomComparer(lastNode, index); + } + } + + nodes[newSize] = default; + _version++; + return true; + } + /// /// Removes all items from the . /// @@ -809,6 +862,41 @@ private void MoveDownCustomComparer((TElement Element, TPriority Priority) node, nodes[nodeIndex] = node; } + /// + /// Scans the heap for the first index containing an element equal to the specified parameter. + /// + private int FindIndex(TElement element, IEqualityComparer? equalityComparer) + { + equalityComparer ??= EqualityComparer.Default; + ReadOnlySpan<(TElement Element, TPriority Priority)> nodes = _nodes.AsSpan(0, _size); + + // Currently the JIT doesn't optimize direct EqualityComparer.Default.Equals + // calls for reference types, so we want to cache the comparer instance instead. + // TODO https://github.com/dotnet/runtime/issues/10050: Update if this changes in the future. + if (typeof(TElement).IsValueType && equalityComparer == EqualityComparer.Default) + { + for (int i = 0; i < nodes.Length; i++) + { + if (EqualityComparer.Default.Equals(element, nodes[i].Element)) + { + return i; + } + } + } + else + { + for (int i = 0; i < nodes.Length; i++) + { + if (equalityComparer.Equals(element, nodes[i].Element)) + { + return i; + } + } + } + + return -1; + } + /// /// Initializes the custom comparer to be used internally by the heap. /// diff --git a/src/libraries/System.Collections/tests/Generic/PriorityQueue/PriorityQueue.Generic.Tests.cs b/src/libraries/System.Collections/tests/Generic/PriorityQueue/PriorityQueue.Generic.Tests.cs index c50dfa977d045a..0f50f9183f5cbe 100644 --- a/src/libraries/System.Collections/tests/Generic/PriorityQueue/PriorityQueue.Generic.Tests.cs +++ b/src/libraries/System.Collections/tests/Generic/PriorityQueue/PriorityQueue.Generic.Tests.cs @@ -93,7 +93,7 @@ public void PriorityQueue_EnumerableConstructor_ShouldContainAllElements(int cou #endregion - #region Enqueue, Dequeue, Peek, EnqueueDequeue, DequeueEnqueue + #region Enqueue, Dequeue, Peek, EnqueueDequeue, DequeueEnqueue, Remove [Theory] [MemberData(nameof(ValidCollectionSizes))] @@ -246,6 +246,35 @@ public void PriorityQueue_DequeueEnqueue(int count) AssertExtensions.CollectionEqual(expectedItems, queue.UnorderedItems, EqualityComparer<(TElement, TPriority)>.Default); } + [Theory] + [MemberData(nameof(ValidCollectionSizes))] + public void PriorityQueue_Remove_AllElements(int count) + { + bool result; + TElement removedElement; + TPriority removedPriority; + + PriorityQueue queue = CreatePriorityQueue(count, count, out List<(TElement element, TPriority priority)> generatedItems); + + for (int i = count - 1; i >= 0; i--) + { + (TElement element, TPriority priority) = generatedItems[i]; + + result = queue.Remove(element, out removedElement, out removedPriority); + + Assert.True(result); + Assert.Equal(element, removedElement); + Assert.Equal(priority, removedPriority); + Assert.Equal(i, queue.Count); + } + + result = queue.Remove(default, out removedElement, out removedPriority); + + Assert.False(result); + Assert.Equal(default, removedElement); + Assert.Equal(default, removedPriority); + } + #endregion #region Clear diff --git a/src/libraries/System.Collections/tests/Generic/PriorityQueue/PriorityQueue.Tests.Dijkstra.cs b/src/libraries/System.Collections/tests/Generic/PriorityQueue/PriorityQueue.Tests.Dijkstra.cs new file mode 100644 index 00000000000000..08155e493ee664 --- /dev/null +++ b/src/libraries/System.Collections/tests/Generic/PriorityQueue/PriorityQueue.Tests.Dijkstra.cs @@ -0,0 +1,78 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections.Generic; +using System.Linq; +using Xunit; +using NodeId = int; +using Distance = int; + +namespace System.Collections.Tests +{ + public partial class PriorityQueue_NonGeneric_Tests + { + public record struct Graph(Edge[][] nodes); + public record struct Edge(NodeId neighbor, Distance weight); + + [Fact] + public static void PriorityQueue_DijkstraSmokeTest() + { + var graph = new Graph([ + [new Edge(1, 7), new Edge(2, 9), new Edge(5, 14)], + [new Edge(0, 7), new Edge(2, 10), new Edge(3, 15)], + [new Edge(0, 9), new Edge(1, 10), new Edge(3, 11), new Edge(5, 2)], + [new Edge(1, 15), new Edge(2, 11), new Edge(4, 6)], + [new Edge(3, 6), new Edge(5, 9)], + [new Edge(0, 14), new Edge(2, 2), new Edge(4, 9)], + ]); + + NodeId startNode = 0; + + (NodeId node, Distance distance)[] expectedDistances = + [ + (0, 0), + (1, 7), + (2, 9), + (3, 20), + (4, 20), + (5, 11), + ]; + + (NodeId node, Distance distance)[] actualDistances = RunDijkstra(graph, startNode); + + Assert.Equal(expectedDistances, actualDistances); + } + + public static (NodeId node, Distance distance)[] RunDijkstra(Graph graph, NodeId startNode) + { + Distance[] distances = Enumerable.Repeat(int.MaxValue, graph.nodes.Length).ToArray(); + var queue = new PriorityQueue(); + + distances[startNode] = 0; + queue.Enqueue(startNode, 0); + + do + { + NodeId nodeId = queue.Dequeue(); + Distance nodeDistance = distances[nodeId]; + + foreach (Edge edge in graph.nodes[nodeId]) + { + Distance distance = distances[edge.neighbor]; + Distance newDistance = nodeDistance + edge.weight; + if (newDistance < distance) + { + distances[edge.neighbor] = newDistance; + // Simulate priority update by attempting to remove the entry + // before re-inserting it with the new distance. + queue.Remove(edge.neighbor, out _, out _); + queue.Enqueue(edge.neighbor, newDistance); + } + } + } + while (queue.Count > 0); + + return distances.Select((distance, nodeId) => (nodeId, distance)).ToArray(); + } + } +} diff --git a/src/libraries/System.Collections/tests/Generic/PriorityQueue/PriorityQueue.Tests.cs b/src/libraries/System.Collections/tests/Generic/PriorityQueue/PriorityQueue.Tests.cs index 0bd6a70a8f2a57..03419ab9f6af29 100644 --- a/src/libraries/System.Collections/tests/Generic/PriorityQueue/PriorityQueue.Tests.cs +++ b/src/libraries/System.Collections/tests/Generic/PriorityQueue/PriorityQueue.Tests.cs @@ -8,7 +8,7 @@ namespace System.Collections.Tests { - public class PriorityQueue_NonGeneric_Tests : TestBase + public partial class PriorityQueue_NonGeneric_Tests : TestBase { protected PriorityQueue CreateSmallPriorityQueue(out HashSet<(string, int)> items) { @@ -167,6 +167,55 @@ public void PriorityQueue_Generic_EnqueueRange_Null() Assert.Equal("not null", queue.Dequeue()); } + [Fact] + public void PriorityQueue_Generic_Remove_MatchingElement() + { + PriorityQueue queue = new PriorityQueue(); + queue.EnqueueRange([("value0", 0), ("value1", 1), ("value2", 2)]); + + Assert.True(queue.Remove("value1", out string removedElement, out int removedPriority)); + Assert.Equal("value1", removedElement); + Assert.Equal(1, removedPriority); + Assert.Equal(2, queue.Count); + } + + [Fact] + public void PriorityQueue_Generic_Remove_MismatchElement() + { + PriorityQueue queue = new PriorityQueue(); + queue.EnqueueRange([("value0", 0), ("value1", 1), ("value2", 2)]); + + Assert.False(queue.Remove("value4", out string removedElement, out int removedPriority)); + Assert.Null(removedElement); + Assert.Equal(0, removedPriority); + Assert.Equal(3, queue.Count); + } + + [Fact] + public void PriorityQueue_Generic_Remove_DuplicateElement() + { + PriorityQueue queue = new PriorityQueue(); + queue.EnqueueRange([("value0", 0), ("value1", 1), ("value0", 2)]); + + Assert.True(queue.Remove("value0", out string removedElement, out int removedPriority)); + Assert.Equal("value0", removedElement); + Assert.True(removedPriority is 0 or 2); + Assert.Equal(2, queue.Count); + } + + [Fact] + public void PriorityQueue_Generic_Remove_CustomEqualityComparer() + { + PriorityQueue queue = new PriorityQueue(); + queue.EnqueueRange([("value0", 0), ("value1", 1), ("value2", 2)]); + EqualityComparer equalityComparer = EqualityComparer.Create((left, right) => left[^1] == right[^1]); + + Assert.True(queue.Remove("someOtherValue1", out string removedElement, out int removedPriority, equalityComparer)); + Assert.Equal("value1", removedElement); + Assert.Equal(1, removedPriority); + Assert.Equal(2, queue.Count); + } + [Fact] public void PriorityQueue_Constructor_int_Negative_ThrowsArgumentOutOfRangeException() { @@ -207,6 +256,16 @@ public void PriorityQueue_EmptyCollection_Peek_ShouldReturnFalse() Assert.Throws(() => queue.Peek()); } + [Fact] + public void PriorityQueue_EmptyCollection_Remove_ShouldReturnFalse() + { + var queue = new PriorityQueue(); + + Assert.False(queue.Remove(element: "element", out string removedElement, out string removedPriority)); + Assert.Null(removedElement); + Assert.Null(removedPriority); + } + #region EnsureCapacity, TrimExcess [Fact] diff --git a/src/libraries/System.Collections/tests/System.Collections.Tests.csproj b/src/libraries/System.Collections/tests/System.Collections.Tests.csproj index 3d64df4f13ee57..1f45aa68f98f6e 100644 --- a/src/libraries/System.Collections/tests/System.Collections.Tests.csproj +++ b/src/libraries/System.Collections/tests/System.Collections.Tests.csproj @@ -1,4 +1,4 @@ - + $(NetCoreAppCurrent) true @@ -106,6 +106,7 @@ + From c9a985d75b2255035062398557ba5a281e537b64 Mon Sep 17 00:00:00 2001 From: Tomas Weinfurt Date: Mon, 30 Oct 2023 09:30:45 -0700 Subject: [PATCH 36/47] enable two HTTP POST tests (#94115) --- .../Net/Http/HttpClientHandlerTest.RemoteServer.cs | 12 +++--------- .../Common/tests/System/Net/Http/PostScenarioTest.cs | 6 ++---- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.RemoteServer.cs b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.RemoteServer.cs index ae054af8a93b33..a264482a5549be 100644 --- a/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.RemoteServer.cs +++ b/src/libraries/Common/tests/System/Net/Http/HttpClientHandlerTest.RemoteServer.cs @@ -671,14 +671,6 @@ public async Task PostAsync_Redirect_ResultingGetFormattedCorrectly(Configuratio [Theory, MemberData(nameof(RemoteServersMemberData))] public async Task PostAsync_RedirectWith307_LargePayload(Configuration.Http.RemoteServer remoteServer) { - if (remoteServer.HttpVersion == new Version(2, 0)) - { - // This is occasionally timing out in CI with SocketsHttpHandler and HTTP2, particularly on Linux - // Likely this is just a very slow test and not a product issue, so just increasing the timeout may be the right fix. - // Disable until we can investigate further. - return; - } - await PostAsync_Redirect_LargePayload_Helper(remoteServer, 307, true); } @@ -722,7 +714,9 @@ private async Task PostAsync_Redirect_LargePayload_Helper(Configuration.Http.Rem content.Headers.ContentMD5 = TestHelper.ComputeMD5Hash(contentBytes); } - using (HttpClient client = CreateHttpClientForRemoteServer(remoteServer)) + using HttpClient client = CreateHttpClientForRemoteServer(remoteServer); + client.Timeout = TimeSpan.FromMinutes(10); + using (HttpResponseMessage response = await client.PostAsync(redirectUri, content)) { try diff --git a/src/libraries/Common/tests/System/Net/Http/PostScenarioTest.cs b/src/libraries/Common/tests/System/Net/Http/PostScenarioTest.cs index d1201244c5aac7..488f00639cb0ad 100644 --- a/src/libraries/Common/tests/System/Net/Http/PostScenarioTest.cs +++ b/src/libraries/Common/tests/System/Net/Http/PostScenarioTest.cs @@ -165,11 +165,9 @@ public async Task PostLargeContentUsingContentLengthSemantics_Success(Configurat [Theory, MemberData(nameof(RemoteServersMemberData))] public async Task PostRewindableContentUsingAuth_NoPreAuthenticate_Success(Configuration.Http.RemoteServer remoteServer) { - if (remoteServer.HttpVersion == new Version(2, 0)) + // Sync API supported only up to HTTP/1.1 + if (!TestAsync && remoteServer.HttpVersion.Major >= 2) { - // This is occasionally timing out in CI with SocketsHttpHandler and HTTP2, particularly on Linux - // Likely this is just a very slow test and not a product issue, so just increasing the timeout may be the right fix. - // Disable until we can investigate further. return; } From 69f2b4052f93f8963dff8fd8d02e6376e394b1ea Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 30 Oct 2023 13:01:24 -0400 Subject: [PATCH 37/47] [main] Update dependencies from dotnet/arcade dotnet/emsdk dotnet/sdk dotnet/runtime dotnet/source-build-reference-packages (#94147) * Update dependencies from https://github.com/dotnet/arcade build 20231028.2 Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XliffTasks , Microsoft.DotNet.XUnitAssert , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions From Version 9.0.0-beta.23528.1 -> To Version 9.0.0-beta.23528.2 * Update dependencies from https://github.com/dotnet/emsdk build 20231028.4 Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport From Version 9.0.0-alpha.1.23528.1 -> To Version 9.0.0-alpha.1.23528.4 * Update dependencies from https://github.com/dotnet/sdk build 20231028.2 Microsoft.DotNet.ApiCompat.Task From Version 9.0.100-alpha.1.23528.1 -> To Version 9.0.100-alpha.1.23528.2 * Update dependencies from https://github.com/dotnet/arcade build 20231028.2 Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Build.Tasks.Archives , Microsoft.DotNet.Build.Tasks.Feed , Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Build.Tasks.Packaging , Microsoft.DotNet.Build.Tasks.TargetFramework , Microsoft.DotNet.Build.Tasks.Templating , Microsoft.DotNet.Build.Tasks.Workloads , Microsoft.DotNet.CodeAnalysis , Microsoft.DotNet.GenAPI , Microsoft.DotNet.GenFacades , Microsoft.DotNet.Helix.Sdk , Microsoft.DotNet.PackageTesting , Microsoft.DotNet.RemoteExecutor , Microsoft.DotNet.SharedFramework.Sdk , Microsoft.DotNet.VersionTools.Tasks , Microsoft.DotNet.XliffTasks , Microsoft.DotNet.XUnitAssert , Microsoft.DotNet.XUnitConsoleRunner , Microsoft.DotNet.XUnitExtensions From Version 9.0.0-beta.23528.1 -> To Version 9.0.0-beta.23528.2 * Update dependencies from https://github.com/dotnet/emsdk build 20231028.4 Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport From Version 9.0.0-alpha.1.23528.1 -> To Version 9.0.0-alpha.1.23528.4 * Update dependencies from https://github.com/dotnet/sdk build 20231030.1 Microsoft.DotNet.ApiCompat.Task From Version 9.0.100-alpha.1.23528.1 -> To Version 9.0.100-alpha.1.23530.1 * Update dependencies from https://github.com/dotnet/runtime build 20231029.4 Microsoft.DotNet.ILCompiler , Microsoft.NET.Sdk.IL , Microsoft.NETCore.App.Runtime.win-x64 , Microsoft.NETCore.ILAsm , runtime.native.System.IO.Ports , System.Text.Json From Version 9.0.0-alpha.1.23523.1 -> To Version 9.0.0-alpha.1.23529.4 * Update dependencies from https://github.com/dotnet/source-build-reference-packages build 20231027.1 Microsoft.SourceBuild.Intermediate.source-build-reference-packages From Version 9.0.0-alpha.1.23519.2 -> To Version 9.0.0-alpha.1.23527.1 --------- Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 116 ++++++++++++++++++++-------------------- eng/Versions.props | 46 ++++++++-------- global.json | 8 +-- 3 files changed, 85 insertions(+), 85 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 34ca36bb236b8c..e74ae5321fa279 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -90,14 +90,14 @@ 45dd3a73dd5b64b010c4251303b3664bb30df029 - + https://github.com/dotnet/emsdk - cdf33ffb6fc9e63c82cca2f67870e8e6cd16d741 + 104f09072729ed5953f0be303f62e8567f3a5478 - + https://github.com/dotnet/source-build-reference-packages - d3fbf3c3d4c4f142ea12efceaa6efece9ad2e6b5 + 947ef94c52440c781aeb6ee13e95a9ec9992e444 @@ -107,82 +107,82 @@ - + https://github.com/dotnet/arcade - a4d49646dbac90883d3672f1c08134d84cca5707 + bb2b4326ddf03d86c92bd125dba87e9d8df63463 - + https://github.com/dotnet/arcade - a4d49646dbac90883d3672f1c08134d84cca5707 + bb2b4326ddf03d86c92bd125dba87e9d8df63463 - + https://github.com/dotnet/arcade - a4d49646dbac90883d3672f1c08134d84cca5707 + bb2b4326ddf03d86c92bd125dba87e9d8df63463 - + https://github.com/dotnet/arcade - a4d49646dbac90883d3672f1c08134d84cca5707 + bb2b4326ddf03d86c92bd125dba87e9d8df63463 - + https://github.com/dotnet/arcade - a4d49646dbac90883d3672f1c08134d84cca5707 + bb2b4326ddf03d86c92bd125dba87e9d8df63463 - + https://github.com/dotnet/arcade - a4d49646dbac90883d3672f1c08134d84cca5707 + bb2b4326ddf03d86c92bd125dba87e9d8df63463 - + https://github.com/dotnet/arcade - a4d49646dbac90883d3672f1c08134d84cca5707 + bb2b4326ddf03d86c92bd125dba87e9d8df63463 - + https://github.com/dotnet/arcade - a4d49646dbac90883d3672f1c08134d84cca5707 + bb2b4326ddf03d86c92bd125dba87e9d8df63463 - + https://github.com/dotnet/arcade - a4d49646dbac90883d3672f1c08134d84cca5707 + bb2b4326ddf03d86c92bd125dba87e9d8df63463 - + https://github.com/dotnet/arcade - a4d49646dbac90883d3672f1c08134d84cca5707 + bb2b4326ddf03d86c92bd125dba87e9d8df63463 - + https://github.com/dotnet/arcade - a4d49646dbac90883d3672f1c08134d84cca5707 + bb2b4326ddf03d86c92bd125dba87e9d8df63463 - + https://github.com/dotnet/arcade - a4d49646dbac90883d3672f1c08134d84cca5707 + bb2b4326ddf03d86c92bd125dba87e9d8df63463 - + https://github.com/dotnet/arcade - a4d49646dbac90883d3672f1c08134d84cca5707 + bb2b4326ddf03d86c92bd125dba87e9d8df63463 - + https://github.com/dotnet/arcade - a4d49646dbac90883d3672f1c08134d84cca5707 + bb2b4326ddf03d86c92bd125dba87e9d8df63463 - + https://github.com/dotnet/arcade - a4d49646dbac90883d3672f1c08134d84cca5707 + bb2b4326ddf03d86c92bd125dba87e9d8df63463 - + https://github.com/dotnet/arcade - a4d49646dbac90883d3672f1c08134d84cca5707 + bb2b4326ddf03d86c92bd125dba87e9d8df63463 - + https://github.com/dotnet/arcade - a4d49646dbac90883d3672f1c08134d84cca5707 + bb2b4326ddf03d86c92bd125dba87e9d8df63463 - + https://github.com/dotnet/arcade - a4d49646dbac90883d3672f1c08134d84cca5707 + bb2b4326ddf03d86c92bd125dba87e9d8df63463 - + https://github.com/dotnet/arcade - a4d49646dbac90883d3672f1c08134d84cca5707 + bb2b4326ddf03d86c92bd125dba87e9d8df63463 https://github.com/dotnet/runtime-assets @@ -292,30 +292,30 @@ https://github.com/dotnet/llvm-project 6f49d078f656896bfb9fdee6e76c2ef7b63dab45 - + https://github.com/dotnet/runtime - 2959e1acd09aec0f1e59db9cbe41f3701b0bd4dd + e5c631d28b985b773b28d0cb2346f49a92bd41dd - + https://github.com/dotnet/runtime - 2959e1acd09aec0f1e59db9cbe41f3701b0bd4dd + e5c631d28b985b773b28d0cb2346f49a92bd41dd - + https://github.com/dotnet/runtime - 2959e1acd09aec0f1e59db9cbe41f3701b0bd4dd + e5c631d28b985b773b28d0cb2346f49a92bd41dd - + https://github.com/dotnet/runtime - 2959e1acd09aec0f1e59db9cbe41f3701b0bd4dd + e5c631d28b985b773b28d0cb2346f49a92bd41dd - + https://github.com/dotnet/runtime - 2959e1acd09aec0f1e59db9cbe41f3701b0bd4dd + e5c631d28b985b773b28d0cb2346f49a92bd41dd - + https://github.com/dotnet/runtime - 2959e1acd09aec0f1e59db9cbe41f3701b0bd4dd + e5c631d28b985b773b28d0cb2346f49a92bd41dd https://github.com/dotnet/xharness @@ -329,9 +329,9 @@ https://github.com/dotnet/xharness ab9528860ac51bb0aa6112fa2605b18c926594ef - + https://github.com/dotnet/arcade - a4d49646dbac90883d3672f1c08134d84cca5707 + bb2b4326ddf03d86c92bd125dba87e9d8df63463 https://dev.azure.com/dnceng/internal/_git/dotnet-optimization @@ -378,9 +378,9 @@ https://github.com/dotnet/roslyn-analyzers b4ed6a3093cfd3c8d353214ce97aaa7d24cf2df1 - + https://github.com/dotnet/sdk - 6c69f67ac825da15ce05607d6a87b63693cac2a2 + d2c0ee3b304fd04ab9c0128c5a8347edb72aeb1f diff --git a/eng/Versions.props b/eng/Versions.props index 11c0d0bcae0497..5db0962b91d6fc 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -80,31 +80,31 @@ 0.2.0 - 9.0.100-alpha.1.23528.1 + 9.0.100-alpha.1.23530.1 - 9.0.0-beta.23528.1 - 9.0.0-beta.23528.1 - 9.0.0-beta.23528.1 - 9.0.0-beta.23528.1 - 9.0.0-beta.23528.1 - 9.0.0-beta.23528.1 - 2.5.3-beta.23528.1 - 9.0.0-beta.23528.1 - 9.0.0-beta.23528.1 - 9.0.0-beta.23528.1 - 9.0.0-beta.23528.1 - 9.0.0-beta.23528.1 - 9.0.0-beta.23528.1 - 9.0.0-beta.23528.1 - 9.0.0-beta.23528.1 - 9.0.0-beta.23528.1 + 9.0.0-beta.23528.2 + 9.0.0-beta.23528.2 + 9.0.0-beta.23528.2 + 9.0.0-beta.23528.2 + 9.0.0-beta.23528.2 + 9.0.0-beta.23528.2 + 2.5.3-beta.23528.2 + 9.0.0-beta.23528.2 + 9.0.0-beta.23528.2 + 9.0.0-beta.23528.2 + 9.0.0-beta.23528.2 + 9.0.0-beta.23528.2 + 9.0.0-beta.23528.2 + 9.0.0-beta.23528.2 + 9.0.0-beta.23528.2 + 9.0.0-beta.23528.2 6.0.0-preview.1.102 - 9.0.0-alpha.1.23523.1 + 9.0.0-alpha.1.23529.4 6.0.0 - 9.0.0-alpha.1.23523.1 + 9.0.0-alpha.1.23529.4 16.0.5-alpha.1.23517.4 16.0.5-alpha.1.23517.4 16.0.5-alpha.1.23517.4 @@ -131,12 +131,12 @@ 5.0.0 5.0.0 7.0.0 - 9.0.0-alpha.1.23523.1 + 9.0.0-alpha.1.23529.4 6.0.0 7.0.0 4.5.4 4.5.0 - 9.0.0-alpha.1.23523.1 + 9.0.0-alpha.1.23529.4 8.0.0-beta.23516.1 8.0.0-beta.23516.1 @@ -205,7 +205,7 @@ 0.11.4-alpha.23509.2 - 9.0.0-alpha.1.23523.1 + 9.0.0-alpha.1.23529.4 9.0.0-alpha.1.23523.1 @@ -230,7 +230,7 @@ Note: when the name is updated, make sure to update dependency name in eng/pipelines/common/xplat-setup.yml like - DarcDependenciesChanged.Microsoft_NET_Workload_Emscripten_Current_Manifest-9_0_100_Transport --> - 9.0.0-alpha.1.23528.1 + 9.0.0-alpha.1.23528.4 $(MicrosoftNETWorkloadEmscriptenCurrentManifest90100TransportVersion) 1.1.87-gba258badda diff --git a/global.json b/global.json index c233650dc8b7f4..b0f734b4e9ea9e 100644 --- a/global.json +++ b/global.json @@ -8,11 +8,11 @@ "dotnet": "8.0.100-rtm.23506.1" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.23528.1", - "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.23528.1", - "Microsoft.DotNet.SharedFramework.Sdk": "9.0.0-beta.23528.1", + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.23528.2", + "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.23528.2", + "Microsoft.DotNet.SharedFramework.Sdk": "9.0.0-beta.23528.2", "Microsoft.Build.NoTargets": "3.7.0", "Microsoft.Build.Traversal": "3.4.0", - "Microsoft.NET.Sdk.IL": "9.0.0-alpha.1.23523.1" + "Microsoft.NET.Sdk.IL": "9.0.0-alpha.1.23529.4" } } From 7dba9af08cf7a6919ab8e3e15cfd62341167edc3 Mon Sep 17 00:00:00 2001 From: Andy Ayers Date: Mon, 30 Oct 2023 10:41:02 -0700 Subject: [PATCH 38/47] JIT: update tail call IR validity checks (#94130) Remove `fgCheckStmtAfterTailCall` as it did less thorough and less correct checking. Contributes to #93246. --- src/coreclr/jit/compiler.h | 1 - src/coreclr/jit/morph.cpp | 108 ------------------------------------- 2 files changed, 109 deletions(-) diff --git a/src/coreclr/jit/compiler.h b/src/coreclr/jit/compiler.h index e7c4cd157a342d..65e1474b26ab2a 100644 --- a/src/coreclr/jit/compiler.h +++ b/src/coreclr/jit/compiler.h @@ -5979,7 +5979,6 @@ class Compiler bool fgCallArgWillPointIntoLocalFrame(GenTreeCall* call, CallArg& arg); #endif - bool fgCheckStmtAfterTailCall(); GenTree* fgMorphTailCallViaHelpers(GenTreeCall* call, CORINFO_TAILCALL_HELPERS& help); bool fgCanTailCallViaJitHelper(GenTreeCall* call); void fgMorphTailCallViaJitHelper(GenTreeCall* call); diff --git a/src/coreclr/jit/morph.cpp b/src/coreclr/jit/morph.cpp index e0971ae0a3d956..f257cf44cd8ede 100644 --- a/src/coreclr/jit/morph.cpp +++ b/src/coreclr/jit/morph.cpp @@ -5894,12 +5894,6 @@ GenTree* Compiler::fgMorphPotentialTailCall(GenTreeCall* call) } } - if (!fgCheckStmtAfterTailCall()) - { - failTailCall("Unexpected statements after the tail call"); - return nullptr; - } - const char* failReason = nullptr; bool canFastTailCall = fgCanFastTailCall(call, &failReason); @@ -15367,108 +15361,6 @@ void Compiler::fgMarkDemotedImplicitByRefArgs() #endif // FEATURE_IMPLICIT_BYREFS } -//------------------------------------------------------------------------ -// fgCheckStmtAfterTailCall: check that statements after the tail call stmt -// candidate are in one of expected forms, that are desctibed below. -// -// Return Value: -// 'true' if stmts are in the expected form, else 'false'. -// -bool Compiler::fgCheckStmtAfterTailCall() -{ - - // For void calls, we would have created a GT_CALL in the stmt list. - // For non-void calls, we would have created a GT_RETURN(GT_CAST(GT_CALL)). - // For calls returning structs, we would have a void call, followed by a void return. - // For debuggable code, it would be an assignment of the call to a temp - // We want to get rid of any of this extra trees, and just leave - // the call. - Statement* callStmt = fgMorphStmt; - - Statement* nextMorphStmt = callStmt->GetNextStmt(); - - // Check that the rest stmts in the block are in one of the following pattern: - // 1) ret(void) - // 2) ret(cast*(callResultLclVar)) - // 3) lclVar = callResultLclVar, the actual ret(lclVar) in another block - // 4) nop - if (nextMorphStmt != nullptr) - { - GenTree* callExpr = callStmt->GetRootNode(); - if (!callExpr->OperIs(GT_STORE_LCL_VAR)) - { - // The next stmt can be GT_RETURN(TYP_VOID) or GT_RETURN(lclVar), - // where lclVar was return buffer in the call for structs or simd. - Statement* retStmt = nextMorphStmt; - GenTree* retExpr = retStmt->GetRootNode(); - noway_assert(retExpr->gtOper == GT_RETURN); - - nextMorphStmt = retStmt->GetNextStmt(); - } - else - { - noway_assert(callExpr->OperIs(GT_STORE_LCL_VAR)); - unsigned callResultLclNumber = callExpr->AsLclVar()->GetLclNum(); - -#if FEATURE_TAILCALL_OPT_SHARED_RETURN - - // We can have a chain of assignments from the call result to - // various inline return spill temps. These are ok as long - // as the last one ultimately provides the return value or is ignored. - // - // And if we're returning a small type we may see a cast - // on the source side. - while ((nextMorphStmt != nullptr) && (nextMorphStmt->GetRootNode()->OperIs(GT_STORE_LCL_VAR, GT_NOP))) - { - if (nextMorphStmt->GetRootNode()->OperIs(GT_NOP)) - { - nextMorphStmt = nextMorphStmt->GetNextStmt(); - continue; - } - Statement* moveStmt = nextMorphStmt; - GenTree* moveExpr = nextMorphStmt->GetRootNode(); - - // Tunnel through any casts on the source side. - GenTree* moveSource = moveExpr->AsLclVar()->Data(); - while (moveSource->OperIs(GT_CAST)) - { - noway_assert(!moveSource->gtOverflow()); - moveSource = moveSource->gtGetOp1(); - } - noway_assert(moveSource->OperIsLocal()); - - // Verify we're just passing the value from one local to another - // along the chain. - const unsigned srcLclNum = moveSource->AsLclVarCommon()->GetLclNum(); - noway_assert(srcLclNum == callResultLclNumber); - const unsigned dstLclNum = moveExpr->AsLclVar()->GetLclNum(); - callResultLclNumber = dstLclNum; - - nextMorphStmt = moveStmt->GetNextStmt(); - } - if (nextMorphStmt != nullptr) -#endif - { - Statement* retStmt = nextMorphStmt; - GenTree* retExpr = nextMorphStmt->GetRootNode(); - noway_assert(retExpr->gtOper == GT_RETURN); - - GenTree* treeWithLcl = retExpr->gtGetOp1(); - while (treeWithLcl->gtOper == GT_CAST) - { - noway_assert(!treeWithLcl->gtOverflow()); - treeWithLcl = treeWithLcl->gtGetOp1(); - } - - noway_assert(callResultLclNumber == treeWithLcl->AsLclVarCommon()->GetLclNum()); - - nextMorphStmt = retStmt->GetNextStmt(); - } - } - } - return nextMorphStmt == nullptr; -} - //------------------------------------------------------------------------ // fgCanTailCallViaJitHelper: check whether we can use the faster tailcall // JIT helper on x86. From 97f773875851aa7077d208236f91da69b1c31011 Mon Sep 17 00:00:00 2001 From: Elinor Fung Date: Mon, 30 Oct 2023 12:17:35 -0700 Subject: [PATCH 39/47] Remove BundleLegacy test targeting netcoreapp3.0/3.1 (#94118) --- .../TestProjects/StandaloneApp3x/Program.cs | 15 ---- .../StandaloneApp3x/StandaloneApp3x.csproj | 17 ----- .../BundleLegacy.cs | 71 ------------------- 3 files changed, 103 deletions(-) delete mode 100644 src/installer/tests/Assets/TestProjects/StandaloneApp3x/Program.cs delete mode 100644 src/installer/tests/Assets/TestProjects/StandaloneApp3x/StandaloneApp3x.csproj delete mode 100644 src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.Bundle.Tests/BundleLegacy.cs diff --git a/src/installer/tests/Assets/TestProjects/StandaloneApp3x/Program.cs b/src/installer/tests/Assets/TestProjects/StandaloneApp3x/Program.cs deleted file mode 100644 index 2bb065a6e980df..00000000000000 --- a/src/installer/tests/Assets/TestProjects/StandaloneApp3x/Program.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; - -namespace StandaloneApp -{ - public static class Program - { - public static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/src/installer/tests/Assets/TestProjects/StandaloneApp3x/StandaloneApp3x.csproj b/src/installer/tests/Assets/TestProjects/StandaloneApp3x/StandaloneApp3x.csproj deleted file mode 100644 index 567d0a28562310..00000000000000 --- a/src/installer/tests/Assets/TestProjects/StandaloneApp3x/StandaloneApp3x.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - StandaloneApp - netcoreapp3.0;netcoreapp3.1 - Exe - $(TestTargetRid) - true - - - - - net6.0 - - diff --git a/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.Bundle.Tests/BundleLegacy.cs b/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.Bundle.Tests/BundleLegacy.cs deleted file mode 100644 index 60ebfe7b4faf07..00000000000000 --- a/src/installer/tests/Microsoft.NET.HostModel.Tests/Microsoft.NET.HostModel.Bundle.Tests/BundleLegacy.cs +++ /dev/null @@ -1,71 +0,0 @@ -// 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 Xunit; -using Microsoft.DotNet.Cli.Build.Framework; -using Microsoft.DotNet.CoreSetup.Test; -using Microsoft.NET.HostModel.Bundle; -using BundleTests.Helpers; - -namespace Microsoft.NET.HostModel.Tests -{ - [SkipOnPlatform(TestPlatforms.OSX, "Not supported on OSX.")] - public class BundleLegacy : IClassFixture - { - private SharedTestState sharedTestState; - - public BundleLegacy(SharedTestState fixture) - { - sharedTestState = fixture; - } - - [InlineData(0)] - [InlineData(1)] - [Theory] - public void TestNetCoreApp3xApp(int minorVersion) - { - var fixture = (minorVersion == 0) ? sharedTestState.TestFixture30.Copy() : sharedTestState.TestFixture31.Copy(); - - var singleFile = BundleHelper.BundleApp(fixture, targetFrameworkVersion: new Version(3, minorVersion)); - - Command.Create(singleFile) - .CaptureStdErr() - .CaptureStdOut() - .Execute() - .Should() - .Pass() - .And - .HaveStdOutContaining("Hello World!"); - } - - private static TestProjectFixture CreatePublishedFixture(string netCoreAppFramework, string mnaVersion) - { - var repoDirectories = new RepoDirectoriesProvider(microsoftNETCoreAppVersion: mnaVersion); - var fixture = new TestProjectFixture("StandaloneApp3x", repoDirectories, framework: netCoreAppFramework, assemblyName: "StandaloneApp"); - - fixture.PublishProject(runtime: fixture.CurrentRid, selfContained: true, outputDirectory: BundleHelper.GetPublishPath(fixture), restore: true); - - return fixture; - } - - public class SharedTestState : IDisposable - { - public TestProjectFixture TestFixture30 { get; set; } - public TestProjectFixture TestFixture31 { get; set; } - - - public SharedTestState() - { - TestFixture30 = CreatePublishedFixture("netcoreapp3.0", "3.0.0"); - TestFixture31 = CreatePublishedFixture("netcoreapp3.1", "3.1.0"); - } - - public void Dispose() - { - TestFixture30.Dispose(); - TestFixture31.Dispose(); - } - } - } -} From bec0756aa8cdf9daa0920ab5e75dead8a568083d Mon Sep 17 00:00:00 2001 From: "dotnet-maestro[bot]" <42748379+dotnet-maestro[bot]@users.noreply.github.com> Date: Mon, 30 Oct 2023 15:49:13 -0400 Subject: [PATCH 40/47] [main] Update dependencies from dotnet/installer (#94137) * Update dependencies from https://github.com/dotnet/installer build 20231027.23 Microsoft.Dotnet.Sdk.Internal From Version 9.0.100-alpha.1.23527.1 -> To Version 9.0.100-alpha.1.23527.23 * Update dependencies from https://github.com/dotnet/installer build 20231028.2 Microsoft.Dotnet.Sdk.Internal From Version 9.0.100-alpha.1.23527.1 -> To Version 9.0.100-alpha.1.23528.2 * Update dependencies from https://github.com/dotnet/installer build 20231029.1 Microsoft.Dotnet.Sdk.Internal From Version 9.0.100-alpha.1.23527.1 -> To Version 9.0.100-alpha.1.23529.1 --------- Co-authored-by: dotnet-maestro[bot] --- eng/Version.Details.xml | 4 ++-- eng/Versions.props | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index e74ae5321fa279..ef03b5d42055f7 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -397,9 +397,9 @@ https://github.com/NuGet/NuGet.Client 8fef55f5a55a3b4f2c96cd1a9b5ddc51d4b927f8 - + https://github.com/dotnet/installer - fb7c9717cfd661b120e900a073c60a8fc9e898da + f3c39098a298693206acf00c470530407c8b2ba8 diff --git a/eng/Versions.props b/eng/Versions.props index 5db0962b91d6fc..421ed7583c8617 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -248,7 +248,7 @@ 3.1.7 1.0.406601 - 9.0.100-alpha.1.23527.1 + 9.0.100-alpha.1.23529.1 $(MicrosoftDotnetSdkInternalVersion) From 8d59c90e3c0a4de3717c13f5356fc7816d5fa943 Mon Sep 17 00:00:00 2001 From: Buyaa Namnan Date: Mon, 30 Oct 2023 13:45:31 -0700 Subject: [PATCH 41/47] Emit/Call member references in new ILGenerator (#94116) * Emit/Call member references in IL * Add more tests, add double iterations for prepopulating tokens * Emit constructor reference, add more tests * Apply feedbacks --- .../src/Resources/Strings.resx | 3 + .../Reflection/Emit/FieldBuilderImpl.cs | 7 +- .../System/Reflection/Emit/ILGeneratorImpl.cs | 132 +++++++- .../Reflection/Emit/MethodBuilderImpl.cs | 8 +- .../Reflection/Emit/ModuleBuilderImpl.cs | 165 ++++++++-- .../System/Reflection/Emit/TypeBuilderImpl.cs | 2 + .../AssemblySaveILGeneratorTests.cs | 284 ++++++++++++++++++ .../AssemblySaveTools.cs | 1 - 8 files changed, 571 insertions(+), 31 deletions(-) diff --git a/src/libraries/System.Reflection.Emit/src/Resources/Strings.resx b/src/libraries/System.Reflection.Emit/src/Resources/Strings.resx index e425a272ac097f..96643e5d40b0ee 100644 --- a/src/libraries/System.Reflection.Emit/src/Resources/Strings.resx +++ b/src/libraries/System.Reflection.Emit/src/Resources/Strings.resx @@ -195,4 +195,7 @@ Only 'OpCode.Switch' can be used. + + The specified opcode cannot be passed to EmitCall. + \ No newline at end of file diff --git a/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/FieldBuilderImpl.cs b/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/FieldBuilderImpl.cs index 39e8881c2ab8c5..54c24aa7bdb923 100644 --- a/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/FieldBuilderImpl.cs +++ b/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/FieldBuilderImpl.cs @@ -7,8 +7,6 @@ using System.Globalization; using System.Reflection.Metadata; using System.Reflection.Metadata.Ecma335; -using System.Runtime.InteropServices; -using System.Runtime.InteropServices.Marshalling; namespace System.Reflection.Emit { @@ -23,6 +21,7 @@ internal sealed class FieldBuilderImpl : FieldBuilder internal int _offset; internal List? _customAttributes; internal object? _defaultValue = DBNull.Value; + internal FieldDefinitionHandle _handle; internal FieldBuilderImpl(TypeBuilderImpl typeBuilder, string fieldName, Type type, FieldAttributes attributes) { @@ -107,7 +106,7 @@ protected override void SetCustomAttributeCore(ConstructorInfo con, ReadOnlySpan return; case "System.Runtime.InteropServices.MarshalAsAttribute": _attributes |= FieldAttributes.HasFieldMarshal; - _marshallingData = MarshallingData.CreateMarshallingData(con, binaryAttribute, isField : true); + _marshallingData = MarshallingData.CreateMarshallingData(con, binaryAttribute, isField: true); return; } @@ -124,7 +123,7 @@ protected override void SetOffsetCore(int iOffset) #region MemberInfo Overrides - public override int MetadataToken => throw new NotImplementedException(); + public override int MetadataToken => _handle == default ? 0 : MetadataTokens.GetToken(_handle); public override Module Module => _typeBuilder.Module; diff --git a/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/ILGeneratorImpl.cs b/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/ILGeneratorImpl.cs index e7331233adb3dc..75e06e19f87c4d 100644 --- a/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/ILGeneratorImpl.cs +++ b/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/ILGeneratorImpl.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; +using System.Diagnostics; using System.Reflection.Metadata; using System.Reflection.Metadata.Ecma335; using System.Runtime.InteropServices; @@ -19,6 +20,7 @@ internal sealed class ILGeneratorImpl : ILGenerator private int _currentStack; private List _locals = new(); private Dictionary _labelTable = new(2); + private List> _memberReferences = new(); internal ILGeneratorImpl(MethodBuilder methodBuilder, int size) { @@ -29,6 +31,7 @@ internal ILGeneratorImpl(MethodBuilder methodBuilder, int size) } internal int GetMaxStackSize() => _maxStackSize; + internal List> GetMemberReferences() => _memberReferences; internal InstructionEncoder Instructions => _il; internal bool HasDynamicStackAllocation => _hasDynamicStackAllocation; internal List Locals => _locals; @@ -68,6 +71,13 @@ private void UpdateStackSize(OpCode opCode) _maxStackSize = Math.Max(_maxStackSize, _currentStack); } + private void UpdateStackSize(OpCode opCode, int stackChange) + { + _currentStack += opCode.EvaluationStackDelta; + _currentStack += stackChange; + _maxStackSize = Math.Max(_maxStackSize, _currentStack); + } + public void EmitOpcode(OpCode opcode) { if (opcode == OpCodes.Localloc) @@ -210,7 +220,32 @@ public override void Emit(OpCode opcode, string str) _il.Token(tempVal); } - public override void Emit(OpCode opcode, ConstructorInfo con) => throw new NotImplementedException(); + public override void Emit(OpCode opcode, ConstructorInfo con) + { + ArgumentNullException.ThrowIfNull(con); + + if (!(opcode.Equals(OpCodes.Call) || opcode.Equals(OpCodes.Callvirt) || opcode.Equals(OpCodes.Newobj))) + { + throw new ArgumentException(SR.Argument_NotMethodCallOpcode, nameof(opcode)); + } + + int stackChange = 0; + // Push the return value + stackChange++; + // Pop the parameters. + stackChange -= con.GetParameters().Length; + // Pop the this parameter if the constructor is non-static and the + // instruction is not newobj. + if (!con.IsStatic && !opcode.Equals(OpCodes.Newobj)) + { + stackChange--; + } + + UpdateStackSize(opcode, stackChange); + _il.OpCode((ILOpCode)opcode.Value); + _memberReferences.Add(new KeyValuePair + (con, new BlobWriter(_il.CodeBuilder.ReserveBytes(sizeof(int))))); + } public override void Emit(OpCode opcode, Label label) { @@ -227,6 +262,8 @@ public override void Emit(OpCode opcode, Label label) public override void Emit(OpCode opcode, Label[] labels) { + ArgumentNullException.ThrowIfNull(labels); + if (!opcode.Equals(OpCodes.Switch)) { throw new ArgumentException(SR.Argument_MustBeSwitchOpCode, nameof(opcode)); @@ -270,10 +307,95 @@ public override void Emit(OpCode opcode, LocalBuilder local) } public override void Emit(OpCode opcode, SignatureHelper signature) => throw new NotImplementedException(); - public override void Emit(OpCode opcode, FieldInfo field) => throw new NotImplementedException(); - public override void Emit(OpCode opcode, MethodInfo meth) => throw new NotImplementedException(); - public override void Emit(OpCode opcode, Type cls) => throw new NotImplementedException(); - public override void EmitCall(OpCode opcode, MethodInfo methodInfo, Type[]? optionalParameterTypes) => throw new NotImplementedException(); + + public override void Emit(OpCode opcode, FieldInfo field) + { + ArgumentNullException.ThrowIfNull(field); + + EmitMember(opcode, field); + } + + public override void Emit(OpCode opcode, MethodInfo meth) + { + ArgumentNullException.ThrowIfNull(meth); + + if (opcode.Equals(OpCodes.Call) || opcode.Equals(OpCodes.Callvirt) || opcode.Equals(OpCodes.Newobj)) + { + EmitCall(opcode, meth, null); + } + else + { + EmitMember(opcode, meth); + } + } + + private void EmitMember(OpCode opcode, MemberInfo member) + { + EmitOpcode(opcode); + _memberReferences.Add(new KeyValuePair + (member, new BlobWriter(_il.CodeBuilder.ReserveBytes(sizeof(int))))); + } + + public override void Emit(OpCode opcode, Type cls) + { + ArgumentNullException.ThrowIfNull(cls); + + EmitOpcode(opcode); + ModuleBuilder module = (ModuleBuilder)_methodBuilder.Module; + _il.Token(module.GetTypeMetadataToken(cls)); + } + + public override void EmitCall(OpCode opcode, MethodInfo methodInfo, Type[]? optionalParameterTypes) + { + ArgumentNullException.ThrowIfNull(methodInfo); + + if (!(opcode.Equals(OpCodes.Call) || opcode.Equals(OpCodes.Callvirt) || opcode.Equals(OpCodes.Newobj))) + { + throw new ArgumentException(SR.Argument_NotMethodCallOpcode, nameof(opcode)); + } + + _il.OpCode((ILOpCode)opcode.Value); + UpdateStackSize(opcode, GetStackChange(opcode, methodInfo, optionalParameterTypes)); + _memberReferences.Add(new KeyValuePair + (methodInfo, new BlobWriter(_il.CodeBuilder.ReserveBytes(sizeof(int))))); + } + + private static int GetStackChange(OpCode opcode, MethodInfo methodInfo, Type[]? optionalParameterTypes) + { + int stackChange = 0; + + // Push the return value if there is one. + if (methodInfo.ReturnType != typeof(void)) + { + stackChange++; + } + + // Pop the parameters. + if (methodInfo is MethodBuilderImpl builder) + { + stackChange -= builder.ParameterCount; + } + else + { + stackChange -= methodInfo.GetParameters().Length; + } + + // Pop the this parameter if the method is non-static and the + // instruction is not newobj. + if (!methodInfo.IsStatic && !opcode.Equals(OpCodes.Newobj)) + { + stackChange--; + } + + // Pop the optional parameters off the stack. + if (optionalParameterTypes != null) + { + stackChange -= optionalParameterTypes.Length; + } + + return stackChange; + } + public override void EmitCalli(OpCode opcode, CallingConventions callingConvention, Type? returnType, Type[]? parameterTypes, Type[]? optionalParameterTypes) => throw new NotImplementedException(); public override void EmitCalli(OpCode opcode, CallingConvention unmanagedCallConv, Type? returnType, Type[]? parameterTypes) => throw new NotImplementedException(); public override void EndExceptionBlock() => throw new NotImplementedException(); diff --git a/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/MethodBuilderImpl.cs b/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/MethodBuilderImpl.cs index 0b0fa27f091e75..afb6518fe261ca 100644 --- a/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/MethodBuilderImpl.cs +++ b/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/MethodBuilderImpl.cs @@ -27,6 +27,7 @@ internal sealed class MethodBuilderImpl : MethodBuilder internal DllImportData? _dllImportData; internal List? _customAttributes; internal ParameterBuilderImpl[]? _parameters; + internal MethodDefinitionHandle _handle; internal MethodBuilderImpl(string name, MethodAttributes attributes, CallingConventions callingConventions, Type? returnType, Type[]? parameterTypes, ModuleBuilderImpl module, TypeBuilderImpl declaringType) @@ -52,6 +53,8 @@ internal MethodBuilderImpl(string name, MethodAttributes attributes, CallingConv _initLocals = true; } + internal int ParameterCount => _parameterTypes == null? 0 : _parameterTypes.Length; + internal ILGeneratorImpl? ILGeneratorImpl => _ilGenerator; internal BlobBuilder GetMethodSignatureBlob() => MetadataSignatureHelper.MethodSignatureEncoder(_module, @@ -201,7 +204,7 @@ protected override void SetSignatureCore(Type? returnType, Type[]? returnTypeReq public override bool IsSecurityCritical => true; public override bool IsSecuritySafeCritical => false; public override bool IsSecurityTransparent => false; - public override int MetadataToken { get => throw new NotImplementedException(); } + public override int MetadataToken => _handle == default ? 0 : MetadataTokens.GetToken(_handle); public override RuntimeMethodHandle MethodHandle => throw new NotSupportedException(SR.NotSupported_DynamicModule); public override Type? ReflectedType { get => throw new NotImplementedException(); } public override ParameterInfo ReturnParameter { get => throw new NotImplementedException(); } @@ -224,8 +227,7 @@ public override int GetHashCode() public override MethodImplAttributes GetMethodImplementationFlags() => _methodImplFlags; - public override ParameterInfo[] GetParameters() - => throw new NotImplementedException(); + public override ParameterInfo[] GetParameters() => throw new NotImplementedException(); public override object Invoke(object? obj, BindingFlags invokeAttr, Binder? binder, object?[]? parameters, CultureInfo? culture) => throw new NotSupportedException(SR.NotSupported_DynamicModule); diff --git a/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/ModuleBuilderImpl.cs b/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/ModuleBuilderImpl.cs index 0dde640eae2694..855fdb55912339 100644 --- a/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/ModuleBuilderImpl.cs +++ b/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/ModuleBuilderImpl.cs @@ -17,6 +17,7 @@ internal sealed class ModuleBuilderImpl : ModuleBuilder private readonly MetadataBuilder _metadataBuilder; private readonly Dictionary _assemblyReferences = new(); private readonly Dictionary _typeReferences = new(); + private readonly Dictionary _memberReferences = new(); private readonly List _typeDefinitions = new(); private readonly Dictionary _ctorReferences = new(); private Dictionary? _moduleReferences; @@ -119,6 +120,8 @@ internal void AppendMetadata(MethodBodyStreamEncoder methodBodyEncoder) WriteCustomAttributes(_customAttributes, moduleHandle); + PrePopulateTypeMembersTokens(); + // All generic parameters for all types and methods should be written in specific order List genericParams = new(); // Add each type definition to metadata table. @@ -130,7 +133,7 @@ internal void AppendMetadata(MethodBodyStreamEncoder methodBodyEncoder) parent = GetTypeHandle(typeBuilder.BaseType); } - TypeDefinitionHandle typeHandle = AddTypeDefinition(typeBuilder, parent, _nextMethodDefRowId, _nextFieldDefRowId); + TypeDefinitionHandle typeHandle = AddTypeDefinition(typeBuilder, parent, typeBuilder._firsMethodToken, typeBuilder._firstFieldToken); Debug.Assert(typeBuilder._handle.Equals(typeHandle)); if (typeBuilder.IsGenericType) @@ -161,8 +164,8 @@ internal void AppendMetadata(MethodBodyStreamEncoder methodBodyEncoder) } WriteCustomAttributes(typeBuilder._customAttributes, typeHandle); - WriteMethods(typeBuilder, genericParams, methodBodyEncoder); WriteFields(typeBuilder); + WriteMethods(typeBuilder._methodDefinitions, genericParams, methodBodyEncoder); } // Now write all generic parameters in order @@ -180,22 +183,51 @@ internal void AppendMetadata(MethodBodyStreamEncoder methodBodyEncoder) } } - private void WriteMethods(TypeBuilderImpl typeBuilder, List genericParams, MethodBodyStreamEncoder methodBodyEncoder) + // Need to pre populate all type members tokens so that they can be referenced from other type's metadata + private void PrePopulateTypeMembersTokens() + { + foreach (TypeBuilderImpl typeBuilder in _typeDefinitions) + { + typeBuilder._firsMethodToken = _nextMethodDefRowId; + typeBuilder._firstFieldToken = _nextFieldDefRowId; + PrePopulateMethodDefinitionHandles(typeBuilder._methodDefinitions); + PrePopulateFieldDefinitionHandles(typeBuilder._fieldDefinitions); + } + } + + private void PrePopulateFieldDefinitionHandles(List fieldDefinitions) { - foreach (MethodBuilderImpl method in typeBuilder._methodDefinitions) + foreach (FieldBuilderImpl field in fieldDefinitions) + { + field._handle = MetadataTokens.FieldDefinitionHandle(_nextFieldDefRowId++); + } + } + + private void PrePopulateMethodDefinitionHandles(List methods) + { + foreach (MethodBuilderImpl method in methods) + { + method._handle = MetadataTokens.MethodDefinitionHandle(_nextMethodDefRowId++); + } + } + + private void WriteMethods(List methods, List genericParams, MethodBodyStreamEncoder methodBodyEncoder) + { + foreach (MethodBuilderImpl method in methods) { int offset = -1; ILGeneratorImpl? il = method.ILGeneratorImpl; if (il != null) { + FillMemberReferences(il); StandaloneSignatureHandle signature = il.Locals.Count == 0 ? default : _metadataBuilder.AddStandaloneSignature(_metadataBuilder.GetOrAddBlob(MetadataSignatureHelper.LocalSignatureEncoder(il.Locals, this))); offset = AddMethodBody(method, il, signature, methodBodyEncoder); } - MethodDefinitionHandle methodHandle = AddMethodDefinition(method, method.GetMethodSignatureBlob(), offset, _nextParameterRowId); - WriteCustomAttributes(method._customAttributes, methodHandle); - _nextMethodDefRowId++; + MethodDefinitionHandle handle = AddMethodDefinition(method, method.GetMethodSignatureBlob(), offset, _nextParameterRowId); + Debug.Assert(method._handle == handle); + WriteCustomAttributes(method._customAttributes, handle); if (method.IsGenericMethodDefinition) { @@ -203,7 +235,7 @@ private void WriteMethods(TypeBuilderImpl typeBuilder, List pair in il.GetMemberReferences()) + { + pair.Value.WriteInt32(MetadataTokens.GetToken(GetMemberHandle(pair.Key))); + } + } private static int AddMethodBody(MethodBuilderImpl method, ILGeneratorImpl il, StandaloneSignatureHandle signature, MethodBodyStreamEncoder bodyEncoder) => bodyEncoder.AddMethodBody( @@ -251,23 +290,23 @@ private void WriteFields(TypeBuilderImpl typeBuilder) { foreach (FieldBuilderImpl field in typeBuilder._fieldDefinitions) { - FieldDefinitionHandle fieldHandle = AddFieldDefinition(field, MetadataSignatureHelper.FieldSignatureEncoder(field.FieldType, this)); - WriteCustomAttributes(field._customAttributes, fieldHandle); - _nextFieldDefRowId++; + FieldDefinitionHandle handle = AddFieldDefinition(field, MetadataSignatureHelper.FieldSignatureEncoder(field.FieldType, this)); + Debug.Assert(field._handle == handle); + WriteCustomAttributes(field._customAttributes, handle); if (field._offset > 0 && (typeBuilder.Attributes & TypeAttributes.ExplicitLayout) != 0) { - AddFieldLayout(fieldHandle, field._offset); + AddFieldLayout(handle, field._offset); } if (field._marshallingData != null) { - AddMarshalling(fieldHandle, field._marshallingData.SerializeMarshallingData()); + AddMarshalling(handle, field._marshallingData.SerializeMarshallingData()); } if (field._defaultValue != DBNull.Value) { - AddDefaultValue(fieldHandle, field._defaultValue); + AddDefaultValue(handle, field._defaultValue); } } } @@ -320,6 +359,55 @@ private TypeReferenceHandle GetTypeReference(Type type) return typeHandle; } + private MemberReferenceHandle GetMemberReference(MemberInfo member) + { + if (!_memberReferences.TryGetValue(member, out var memberHandle)) + { + memberHandle = AddMemberReference(member.Name, GetTypeReference(member.DeclaringType!), GetMemberSignature(member)); + _memberReferences.Add(member, memberHandle); + } + + return memberHandle; + } + + private BlobBuilder GetMemberSignature(MemberInfo member) + { + if (member is MethodInfo method) + { + return MetadataSignatureHelper.MethodSignatureEncoder(this, ParameterTypes(method.GetParameters()), method.ReturnType, + MethodBuilderImpl.GetSignatureConvention(method.CallingConvention), method.GetGenericArguments().Length, !method.IsStatic); + } + + if (member is FieldInfo field) + { + return MetadataSignatureHelper.FieldSignatureEncoder(field.FieldType, this); + } + + if (member is ConstructorInfo ctor) + { + return MetadataSignatureHelper.ConstructorSignatureEncoder(ctor.GetParameters(), this); + } + + throw new NotSupportedException(); + } + + private static Type[] ParameterTypes(ParameterInfo[] parameterInfos) + { + if (parameterInfos.Length == 0) + { + return Type.EmptyTypes; + } + + Type[] parameterTypes = new Type[parameterInfos.Length]; + + for (int i=0; i + _metadataBuilder.AddMemberReference( + parent: parent, + name: _metadataBuilder.GetOrAddString(memberName), + signature: _metadataBuilder.GetOrAddBlob(signature)); + private MemberReferenceHandle AddConstructorReference(TypeReferenceHandle parent, ConstructorInfo method) { var blob = MetadataSignatureHelper.ConstructorSignatureEncoder(method.GetParameters(), this); @@ -437,6 +531,21 @@ internal EntityHandle GetTypeHandle(Type type) return GetTypeReference(type); } + internal EntityHandle GetMemberHandle(MemberInfo member) + { + if (member is MethodBuilderImpl mb && Equals(mb.Module)) + { + return mb._handle; + } + + if (member is FieldBuilderImpl fb && Equals(fb.Module)) + { + return fb._handle; + } + + return GetMemberReference(member); + } + internal TypeBuilder DefineNestedType(string name, TypeAttributes attr, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)] Type? parent, Type[]? interfaces, PackingSize packingSize, int typesize, TypeBuilderImpl? enclosingType) { @@ -450,13 +559,33 @@ internal TypeBuilder DefineNestedType(string name, TypeAttributes attr, [Dynamic public override string Name => ""; public override string ScopeName => _name; public override bool IsDefined(Type attributeType, bool inherit) => throw new NotImplementedException(); - public override int GetFieldMetadataToken(FieldInfo field) => throw new NotImplementedException(); + + public override int GetFieldMetadataToken(FieldInfo field) + { + if (field is FieldBuilderImpl fb && fb._handle != default) + { + return MetadataTokens.GetToken(fb._handle); + } + + return 0; + } + public override int GetMethodMetadataToken(ConstructorInfo constructor) => throw new NotImplementedException(); - public override int GetMethodMetadataToken(MethodInfo method) => throw new NotImplementedException(); + + public override int GetMethodMetadataToken(MethodInfo method) + { + if (method is MethodBuilderImpl mb && mb._handle != default) + { + return MetadataTokens.GetToken(mb._handle); + } + + return 0; + } public override int GetStringMetadataToken(string stringConstant) => MetadataTokens.GetToken(_metadataBuilder.GetOrAddUserString(stringConstant)); - public override int GetTypeMetadataToken(Type type) => throw new NotImplementedException(); + public override int GetTypeMetadataToken(Type type) => MetadataTokens.GetToken(GetTypeHandle(type)); + protected override void CreateGlobalFunctionsCore() => throw new NotImplementedException(); protected override EnumBuilder DefineEnumCore(string name, TypeAttributes visibility, Type underlyingType) diff --git a/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/TypeBuilderImpl.cs b/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/TypeBuilderImpl.cs index ba77906508ebbd..3a07d131059547 100644 --- a/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/TypeBuilderImpl.cs +++ b/src/libraries/System.Reflection.Emit/src/System/Reflection/Emit/TypeBuilderImpl.cs @@ -26,6 +26,8 @@ internal sealed class TypeBuilderImpl : TypeBuilder private Type? _enumUnderlyingType; internal readonly TypeDefinitionHandle _handle; + internal int _firstFieldToken; + internal int _firsMethodToken; internal readonly List _methodDefinitions = new(); internal readonly List _fieldDefinitions = new(); internal List? _interfaces; diff --git a/src/libraries/System.Reflection.Emit/tests/PersistableAssemblyBuilder/AssemblySaveILGeneratorTests.cs b/src/libraries/System.Reflection.Emit/tests/PersistableAssemblyBuilder/AssemblySaveILGeneratorTests.cs index 5c5141f544c14c..c24fb693076065 100644 --- a/src/libraries/System.Reflection.Emit/tests/PersistableAssemblyBuilder/AssemblySaveILGeneratorTests.cs +++ b/src/libraries/System.Reflection.Emit/tests/PersistableAssemblyBuilder/AssemblySaveILGeneratorTests.cs @@ -542,5 +542,289 @@ public void LocalBuilderExceptions() Assert.Throws(() => il.Emit(OpCodes.Ldloc, nullBuilder)); Assert.Throws(() => anotherIL.Emit(OpCodes.Ldloc, stringLocal)); } + + [Fact] + public void ReferenceFieldInIL() + { + using (TempFile file = TempFile.Create()) + { + AssemblyBuilder ab = AssemblySaveTools.PopulateAssemblyBuilderTypeBuilderAndSaveMethod(out TypeBuilder tb, out MethodInfo saveMethod); + MethodBuilder methodBuilder = tb.DefineMethod("Method1", MethodAttributes.Public, typeof(int), new[] { typeof(int) }); + FieldBuilder fbNumber = tb.DefineField("_number", typeof(int), FieldAttributes.Private); + Assert.Equal(0, fbNumber.MetadataToken); + + ILGenerator il = methodBuilder.GetILGenerator(); + il.Emit(OpCodes.Ldarg_0); + il.Emit(OpCodes.Ldfld, fbNumber); + il.Emit(OpCodes.Ldarg_1); + il.Emit(OpCodes.Mul); + il.Emit(OpCodes.Ret); + saveMethod.Invoke(ab, new object[] { file.Path }); + + Assembly assemblyFromDisk = AssemblySaveTools.LoadAssemblyFromPath(file.Path); + Type typeFromDisk = assemblyFromDisk.Modules.First().GetType("MyType"); + byte[]? bodyBytes = typeFromDisk.GetMethod("Method1").GetMethodBody().GetILAsByteArray(); + Assert.Equal(9, bodyBytes.Length); + Assert.NotEqual(0, fbNumber.MetadataToken); + Assert.Equal(OpCodes.Ldarg_0.Value, bodyBytes[0]); + Assert.Equal(OpCodes.Ldfld.Value, bodyBytes[1]); + Assert.Equal(fbNumber.MetadataToken, BitConverter.ToInt32(bodyBytes.AsSpan().Slice(2, 4))); + Assert.Equal(OpCodes.Ldarg_1.Value, bodyBytes[6]); + Assert.Equal(OpCodes.Mul.Value, bodyBytes[7]); + Assert.Equal(OpCodes.Ret.Value, bodyBytes[8]); + } + } + + [Fact] + public void ReferenceFieldAndMethodsInIL() + { + using (TempFile file = TempFile.Create()) + { + AssemblyBuilder ab = AssemblySaveTools.PopulateAssemblyBuilderTypeBuilderAndSaveMethod(out TypeBuilder tb, out MethodInfo saveMethod); + MethodBuilder methodMain = tb.DefineMethod("Main", MethodAttributes.Public, typeof(void), new[] { typeof(int) }); + FieldBuilder field = tb.DefineField("_field", typeof(int), FieldAttributes.Private); + MethodInfo writeLineString = typeof(Console).GetMethod("WriteLine", new[] { typeof(string) }); + MethodInfo writeLineObj = typeof(Console).GetMethod("WriteLine", new[] { typeof(string), typeof(object), typeof(object), typeof(object) }); + MethodBuilder methodMultiply = tb.DefineMethod("Multiply", MethodAttributes.Public, typeof(int), new[] { typeof(int) }); + /* + class MyType + { + private int _field; + int Multiply(int value) => _field * value; + void Main(int a) + { + Console.WriteLine("Displaying the expression:"); + Console.WriteLine("{0} * {1} = {2}", _field, a, Multiply(a)); + } + } + */ + ILGenerator il = methodMultiply.GetILGenerator(); + il.Emit(OpCodes.Ldarg_0); + il.Emit(OpCodes.Ldfld, field); + il.Emit(OpCodes.Ldarg_1); + il.Emit(OpCodes.Mul); + il.Emit(OpCodes.Ret); + + ILGenerator ilMain = methodMain.GetILGenerator(); + ilMain.Emit(OpCodes.Ldstr, "Displaying the expression:"); + ilMain.Emit(OpCodes.Call, writeLineString); + ilMain.Emit(OpCodes.Ldstr, "{0} * {1} = {2}"); + ilMain.Emit(OpCodes.Ldarg_0); + ilMain.Emit(OpCodes.Ldfld, field); + ilMain.Emit(OpCodes.Box, typeof(int)); + ilMain.Emit(OpCodes.Ldarg_1); + ilMain.Emit(OpCodes.Box, typeof(int)); + ilMain.Emit(OpCodes.Ldarg_0); + ilMain.Emit(OpCodes.Ldarg_1); + ilMain.Emit(OpCodes.Call, methodMultiply); + ilMain.Emit(OpCodes.Box, typeof(int)); + ilMain.Emit(OpCodes.Call, writeLineObj); + ilMain.Emit(OpCodes.Ret); + + saveMethod.Invoke(ab, new object[] { file.Path }); + + Assembly assemblyFromDisk = AssemblySaveTools.LoadAssemblyFromPath(file.Path); + Type typeFromDisk = assemblyFromDisk.Modules.First().GetType("MyType"); + byte[]? bodyBytes = typeFromDisk.GetMethod("Main").GetMethodBody().GetILAsByteArray(); + Assert.Equal(OpCodes.Ldstr.Value, bodyBytes[0]); + Assert.Equal(OpCodes.Call.Value, bodyBytes[5]); + // Bytes 6, 7, 8, 9 are token for writeLineString, but it is not same as the value before save + Assert.Equal(OpCodes.Ldstr.Value, bodyBytes[10]); + Assert.Equal(OpCodes.Ldarg_0.Value, bodyBytes[15]); + Assert.Equal(OpCodes.Ldfld.Value, bodyBytes[16]); + Assert.Equal(field.MetadataToken, BitConverter.ToInt32(bodyBytes.AsSpan().Slice(17, 4))); + Assert.Equal(OpCodes.Box.Value, bodyBytes[21]); + int intTypeToken = BitConverter.ToInt32(bodyBytes.AsSpan().Slice(22, 4)); + Assert.Equal(OpCodes.Ldarg_1.Value, bodyBytes[26]); + Assert.Equal(OpCodes.Box.Value, bodyBytes[27]); + Assert.Equal(intTypeToken, BitConverter.ToInt32(bodyBytes.AsSpan().Slice(28, 4))); + Assert.Equal(OpCodes.Ldarg_0.Value, bodyBytes[32]); + Assert.Equal(OpCodes.Ldarg_1.Value, bodyBytes[33]); + Assert.Equal(OpCodes.Call.Value, bodyBytes[34]); + Assert.Equal(methodMultiply.MetadataToken, BitConverter.ToInt32(bodyBytes.AsSpan().Slice(35, 4))); + Assert.Equal(OpCodes.Box.Value, bodyBytes[39]); + Assert.Equal(intTypeToken, BitConverter.ToInt32(bodyBytes.AsSpan().Slice(40, 4))); + Assert.Equal(OpCodes.Call.Value, bodyBytes[44]); + // Bytes 24, 46, 47, 48 are token for writeLineObj, but it is not same as the value before save + Assert.Equal(OpCodes.Ret.Value, bodyBytes[49]); + } + } + + [Fact] + public void EmitWriteLineMacroTest() + { + using (TempFile file = TempFile.Create()) + { + AssemblyBuilder ab = AssemblySaveTools.PopulateAssemblyBuilderTypeBuilderAndSaveMethod(out TypeBuilder type1, out MethodInfo saveMethod); + MethodBuilder method = type1.DefineMethod("meth", MethodAttributes.Public, typeof(int), Type.EmptyTypes); + FieldBuilder field = type1.DefineField("field", typeof(int), FieldAttributes.Public | FieldAttributes.Static); + ILGenerator ilGenerator = method.GetILGenerator(); + LocalBuilder local = ilGenerator.DeclareLocal(typeof(int)); + ilGenerator.Emit(OpCodes.Ldc_I4_1); + ilGenerator.Emit(OpCodes.Stloc_0); + ilGenerator.Emit(OpCodes.Ldloc_0); + ilGenerator.Emit(OpCodes.Stsfld, field); + ilGenerator.EmitWriteLine(field); + ilGenerator.EmitWriteLine("Emit WriteLine"); + ilGenerator.EmitWriteLine(local); + ilGenerator.Emit(OpCodes.Ldsfld, field); + ilGenerator.Emit(OpCodes.Ret); + + saveMethod.Invoke(ab, new object[] { file.Path }); + + Assembly assemblyFromDisk = AssemblySaveTools.LoadAssemblyFromPath(file.Path); + Type typeFromDisk = assemblyFromDisk.Modules.First().GetType("MyType"); + byte[]? bodyBytes = typeFromDisk.GetMethod("meth").GetMethodBody().GetILAsByteArray(); + Assert.Equal(OpCodes.Ldc_I4_1.Value, bodyBytes[0]); + Assert.Equal(OpCodes.Stloc_0.Value, bodyBytes[1]); + Assert.Equal(OpCodes.Ldloc_0.Value, bodyBytes[2]); + Assert.Equal(OpCodes.Stsfld.Value, bodyBytes[3]); + Assert.Equal(field.MetadataToken, BitConverter.ToInt32(bodyBytes.AsSpan().Slice(4, 4))); + Assert.Equal(OpCodes.Call.Value, bodyBytes[8]); + Assert.Equal(OpCodes.Ldsfld.Value, bodyBytes[13]); + Assert.Equal(field.MetadataToken, BitConverter.ToInt32(bodyBytes.AsSpan().Slice(14, 4))); + Assert.Equal(OpCodes.Callvirt.Value, bodyBytes[18]); + Assert.Equal(OpCodes.Ldstr.Value, bodyBytes[23]); + Assert.Equal(OpCodes.Call.Value, bodyBytes[28]); + Assert.Equal(OpCodes.Call.Value, bodyBytes[33]); + Assert.Equal(OpCodes.Ldloc_0.Value, bodyBytes[38]); + Assert.Equal(OpCodes.Callvirt.Value, bodyBytes[39]); + Assert.Equal(OpCodes.Ldsfld.Value, bodyBytes[44]); + Assert.Equal(field.MetadataToken, BitConverter.ToInt32(bodyBytes.AsSpan().Slice(45, 4))); + Assert.Equal(OpCodes.Ret.Value, bodyBytes[49]); + } + } + + [Fact] + public void ReferenceStaticFieldAndMethodsInIL() + { + using (TempFile file = TempFile.Create()) + { + AssemblyBuilder ab = AssemblySaveTools.PopulateAssemblyBuilderTypeBuilderAndSaveMethod(out TypeBuilder tb, out MethodInfo saveMethod); + MethodBuilder methodMain = tb.DefineMethod("Main", MethodAttributes.Public, typeof(int), new[] { typeof(int) }); + TypeBuilder anotherType = ab.GetDynamicModule("MyModule").DefineType("AnotherType", TypeAttributes.Public); + FieldBuilder field = anotherType.DefineField("StaticField", typeof(int), FieldAttributes.Public | FieldAttributes.Static); + MethodBuilder staticMethod = anotherType.DefineMethod("StaticMethod", MethodAttributes.Public | MethodAttributes.Static, typeof(void), Type.EmptyTypes); + /*class MyType + { + int Main(int a) + { + AnotherType.StaticField = a; + AnotherType.StaticMethod(); + return AnotherType.StaticField; + } + } + public class AnotherType + { + public static int StaticField; + void static StaticMethod() { } + }*/ + ILGenerator ilMain = methodMain.GetILGenerator(); + ilMain.Emit(OpCodes.Call, staticMethod); + ilMain.Emit(OpCodes.Ldarg_1); + ilMain.Emit(OpCodes.Stsfld, field); + ilMain.Emit(OpCodes.Ldsfld, field); + ilMain.Emit(OpCodes.Ret); + ILGenerator il = staticMethod.GetILGenerator(); + il.Emit(OpCodes.Ret); + + saveMethod.Invoke(ab, new object[] { file.Path }); + + Assembly assemblyFromDisk = AssemblySaveTools.LoadAssemblyFromPath(file.Path); + Type typeFromDisk = assemblyFromDisk.Modules.First().GetType("MyType"); + byte[]? bodyBytes = typeFromDisk.GetMethod("Main").GetMethodBody().GetILAsByteArray(); + Assert.Equal(OpCodes.Call.Value, bodyBytes[0]); + Assert.Equal(staticMethod.MetadataToken, BitConverter.ToInt32(bodyBytes.AsSpan().Slice(1, 4))); + Assert.Equal(OpCodes.Ldarg_1.Value, bodyBytes[5]); + Assert.Equal(OpCodes.Stsfld.Value, bodyBytes[6]); + Assert.Equal(field.MetadataToken, BitConverter.ToInt32(bodyBytes.AsSpan().Slice(7, 4))); + Assert.Equal(OpCodes.Ldsfld.Value, bodyBytes[11]); + Assert.Equal(field.MetadataToken, BitConverter.ToInt32(bodyBytes.AsSpan().Slice(12, 4))); + Assert.Equal(OpCodes.Ret.Value, bodyBytes[16]); + } + } + + [Fact] + public void ReferenceConstructorInIL() + { + using (TempFile file = TempFile.Create()) + { + AssemblyBuilder ab = AssemblySaveTools.PopulateAssemblyBuilderTypeBuilderAndSaveMethod(out TypeBuilder tb, out MethodInfo saveMethod); + MethodBuilder methodBuilder = tb.DefineMethod("Method1", MethodAttributes.Public, typeof(Version), new[] { typeof(int), typeof(int) }); + ConstructorInfo ctor = typeof(Version).GetConstructor(new[] { typeof(int), typeof(int) }); + + ILGenerator il = methodBuilder.GetILGenerator(); + il.Emit(OpCodes.Ldarg_1); + il.Emit(OpCodes.Ldarg_2); + il.Emit(OpCodes.Newobj, ctor); + il.Emit(OpCodes.Ret); + + saveMethod.Invoke(ab, new object[] { file.Path }); + + Assembly assemblyFromDisk = AssemblySaveTools.LoadAssemblyFromPath(file.Path); + Type typeFromDisk = assemblyFromDisk.Modules.First().GetType("MyType"); + byte[]? bodyBytes = typeFromDisk.GetMethod("Method1").GetMethodBody().GetILAsByteArray(); + Assert.Equal(OpCodes.Ldarg_1.Value, bodyBytes[0]); + Assert.Equal(OpCodes.Ldarg_2.Value, bodyBytes[1]); + Assert.Equal(OpCodes.Newobj.Value, bodyBytes[2]); + Assert.Equal(OpCodes.Ret.Value, bodyBytes[7]); + } + } + + [Fact] + public void ReferenceAType() + { + using (TempFile file = TempFile.Create()) + { + AssemblyBuilder ab = AssemblySaveTools.PopulateAssemblyBuilderTypeBuilderAndSaveMethod(out TypeBuilder tb, out MethodInfo saveMethod); + MethodBuilder method = tb.DefineMethod("meth1", MethodAttributes.Public | MethodAttributes.Static, typeof(bool), new Type[0]); + ILGenerator ilGenerator = method.GetILGenerator(); + LocalBuilder lb0 = ilGenerator.DeclareLocal(typeof(ValueTuple)); + ilGenerator.Emit(OpCodes.Ldloca, lb0); + ilGenerator.Emit(OpCodes.Initobj, typeof(ValueTuple)); + ilGenerator.Emit(OpCodes.Ldc_I4, 1); + ilGenerator.Emit(OpCodes.Ret); + + saveMethod.Invoke(ab, new object[] { file.Path }); + + Assembly assemblyFromDisk = AssemblySaveTools.LoadAssemblyFromPath(file.Path); + Type typeFromDisk = assemblyFromDisk.Modules.First().GetType("MyType"); + byte[]? bodyBytes = typeFromDisk.GetMethod("meth1").GetMethodBody().GetILAsByteArray(); + Assert.Equal(OpCodes.Ldloca_S.Value, bodyBytes[0]); // short form of Ldloca + Assert.Equal(0, bodyBytes[1]); + Assert.Equal(0xFE, bodyBytes[2]); // Initobj = 0xfe15 + Assert.Equal(0x15, bodyBytes[3]); + Assert.Equal(OpCodes.Ldc_I4_1.Value, bodyBytes[8]); + Assert.Equal(OpCodes.Ret.Value, bodyBytes[9]); + } + } + + [Fact] + public void MemberReferenceExceptions() + { + AssemblyBuilder ab = AssemblySaveTools.PopulateAssemblyBuilderTypeBuilderAndSaveMethod(out TypeBuilder type, out MethodInfo saveMethod); + MethodBuilder method = type.DefineMethod("Method1", MethodAttributes.Public); + ILGenerator il = method.GetILGenerator(); + MethodInfo nullMethod = null; + ConstructorInfo nullConstructor = null; + FieldInfo nullField = null; + Label[] nullArray = null; + Type nullType = null; + + Assert.Throws(() => il.Emit(OpCodes.Call, nullMethod)); + Assert.Throws(() => il.Emit(OpCodes.Callvirt, nullConstructor)); + Assert.Throws(() => il.Emit(OpCodes.Ldfld, nullField)); + Assert.Throws(() => il.Emit(OpCodes.Switch, nullArray)); + Assert.Throws(() => il.Emit(OpCodes.Switch, nullType)); + Assert.Throws(() => il.EmitCall(OpCodes.Call, nullMethod, null)); + // only OpCodes.Switch expected + Assert.Throws(() => il.Emit(OpCodes.Call, new Label[0])); + // only OpCodes.Call or .OpCodes.Callvirt or OpCodes.Newob expected + Assert.Throws(() => il.Emit(OpCodes.Switch, typeof(object).GetConstructor(Type.EmptyTypes))); + // Undefined label + Assert.Throws(() => il.MarkLabel(new Label())); + // only OpCodes.Call or OpCodes.Callvirt or OpCodes.Newob expected + Assert.Throws(() => il.EmitCall(OpCodes.Ldfld, method, null)); + } } } diff --git a/src/libraries/System.Reflection.Emit/tests/PersistableAssemblyBuilder/AssemblySaveTools.cs b/src/libraries/System.Reflection.Emit/tests/PersistableAssemblyBuilder/AssemblySaveTools.cs index e756c8c4cf7cd3..f63eb084abcf0d 100644 --- a/src/libraries/System.Reflection.Emit/tests/PersistableAssemblyBuilder/AssemblySaveTools.cs +++ b/src/libraries/System.Reflection.Emit/tests/PersistableAssemblyBuilder/AssemblySaveTools.cs @@ -4,7 +4,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; -using System.Runtime.InteropServices; using Xunit; namespace System.Reflection.Emit.Tests From d58dd91b1b0dc64214ce0a825c0a278449b0431e Mon Sep 17 00:00:00 2001 From: Koundinya Veluri Date: Mon, 30 Oct 2023 14:10:07 -0700 Subject: [PATCH 42/47] Expose a `Lock` type in preview mode (#87672) * Expose a `Lock` type in preview mode - For now, the `Lock` type requires preview features to be enabled - Ported CoreCLR's AwareLock implementation to C# with a bit of refactoring, folded in a couple of ideas from NativeAOT's previous `Lock` implementation, and fixed a couple of issues. - Added an adaptive spin strategy to reduce CPU time from spin-waiting when spin-waits are not effective - This implementation replaces NativeAOT's `Lock` implementation. The performance of acquiring a lock under contention is improved in NativeAOT. API review: https://github.com/dotnet/runtime/issues/34812 --- .../src/System/Threading/Monitor.CoreCLR.cs | 4 +- .../Concurrent/ConcurrentUnifier.cs | 14 +- .../Concurrent/ConcurrentUnifierW.cs | 14 +- .../Concurrent/ConcurrentUnifierWKeyed.cs | 14 +- .../src/CompatibilitySuppressions.xml | 8 - .../SynchronizedMethodHelpers.cs | 10 +- .../src/System.Private.CoreLib.csproj | 8 +- .../ClassConstructorRunner.cs | 24 +- .../InteropServices/ComWrappers.NativeAot.cs | 6 +- .../src/System/Threading/Condition.cs | 16 +- .../src/System/Threading/Lock.NativeAot.cs | 229 +++ .../src/System/Threading/Lock.cs | 544 -------- .../src/System/Threading/LockHolder.cs | 27 - .../src/System/Threading/Monitor.NativeAot.cs | 65 +- .../src/System/Threading/ObjectHeader.cs | 41 +- .../src/System/Threading/SyncTable.cs | 14 +- .../Threading/Thread.NativeAot.Windows.cs | 2 +- .../src/System/Threading/Thread.NativeAot.cs | 4 +- .../System.Private.DisabledReflection.csproj | 2 + ...System.Private.Reflection.Execution.csproj | 2 + .../System.Private.StackTraceMetadata.csproj | 2 + ...ronment.ConstructedGenericMethodsLookup.cs | 6 +- ...vironment.ConstructedGenericTypesLookup.cs | 4 +- ...ronment.ConstructedGenericsRegistration.cs | 4 +- ...peLoaderEnvironment.LdTokenResultLookup.cs | 2 +- .../TypeLoaderEnvironment.StaticsLookup.cs | 6 +- .../TypeLoader/TypeLoaderEnvironment.cs | 20 +- .../TypeLoader/TypeSystemContextFactory.cs | 2 +- .../src/System.Private.TypeLoader.csproj | 2 + .../Unix/System.Native/Interop.Threading.cs | 8 + ...onentModel.Composition.Registration.csproj | 2 +- .../Registration/RegistrationBuilder.cs | 2 +- .../src/System/Threading/ReadLock.cs | 4 +- .../Threading/{Lock.cs => ReadWriteLock.cs} | 2 +- .../src/System/Threading/WriteLock.cs | 4 +- .../src/Microsoft/Internal/Lock.Reader.cs | 4 +- .../{Lock.cs => Lock.ReaderWriter.cs} | 2 +- .../src/Microsoft/Internal/Lock.Writer.cs | 4 +- .../System.ComponentModel.Composition.csproj | 2 +- .../ComposablePartCatalogCollection.cs | 2 +- .../Composition/Hosting/CompositionLock.cs | 4 +- .../Composition/Hosting/DirectoryCatalog.cs | 2 +- .../Composition/MetadataViewGenerator.cs | 2 +- .../src/Resources/Strings.resx | 8 +- .../System.Private.CoreLib.Shared.projitems | 9 +- .../src/System/AppContextConfigHelper.cs | 19 +- ...untimeEventSource.Threading.NativeSinks.cs | 18 + .../NativeRuntimeEventSource.Threading.cs | 18 + .../src/System/Threading/Lock.NonNativeAot.cs | 74 + .../src/System/Threading/Lock.cs | 1241 +++++++++++++++++ .../System/Threading/LowLevelLifoSemaphore.cs | 6 +- .../System/Threading/LowLevelSpinWaiter.cs | 6 +- .../src/System/Threading/SpinLock.cs | 2 +- .../src/System/Threading/TimerQueue.Unix.cs | 2 +- .../System/Threading/TimerQueue.Windows.cs | 2 +- .../src/System/ThrowHelper.cs | 13 + .../System.Runtime/ref/System.Runtime.cs | 16 + .../System.Threading/tests/LockTests.cs | 291 ++++ .../System.Threading/tests/MonitorTests.cs | 26 +- .../tests/System.Threading.Tests.csproj | 5 +- .../src/System/Threading/Monitor.Mono.cs | 11 +- .../Threading/TimerQueue.Browser.Mono.cs | 2 +- src/mono/mono/metadata/icall-def.h | 2 +- src/mono/mono/metadata/monitor.c | 2 +- src/mono/mono/metadata/monitor.h | 2 +- src/native/libs/System.Native/entrypoints.c | 2 + src/native/libs/System.Native/pal_threading.c | 48 + src/native/libs/System.Native/pal_threading.h | 3 + .../libs/System.Native/pal_threading_wasi.c | 14 + 69 files changed, 2209 insertions(+), 773 deletions(-) create mode 100644 src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Lock.NativeAot.cs delete mode 100644 src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Lock.cs delete mode 100644 src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/LockHolder.cs rename src/libraries/System.ComponentModel.Composition.Registration/src/System/Threading/{Lock.cs => ReadWriteLock.cs} (94%) rename src/libraries/System.ComponentModel.Composition/src/Microsoft/Internal/{Lock.cs => Lock.ReaderWriter.cs} (94%) create mode 100644 src/libraries/System.Private.CoreLib/src/System/Threading/Lock.NonNativeAot.cs create mode 100644 src/libraries/System.Private.CoreLib/src/System/Threading/Lock.cs create mode 100644 src/libraries/System.Threading/tests/LockTests.cs diff --git a/src/coreclr/System.Private.CoreLib/src/System/Threading/Monitor.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Threading/Monitor.CoreCLR.cs index 9fd823ba175708..ab3e7ad42504c1 100644 --- a/src/coreclr/System.Private.CoreLib/src/System/Threading/Monitor.CoreCLR.cs +++ b/src/coreclr/System.Private.CoreLib/src/System/Threading/Monitor.CoreCLR.cs @@ -183,10 +183,12 @@ public static void PulseAll(object obj) ObjPulseAll(obj); } +#pragma warning disable CA2252 // Opt in to preview features before using them (Lock) /// /// Gets the number of times there was contention upon trying to take a 's lock so far. /// - public static long LockContentionCount => GetLockContentionCount(); + public static long LockContentionCount => GetLockContentionCount() + Lock.ContentionCount; +#pragma warning restore CA2252 [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ObjectNative_GetMonitorLockContentionCount")] private static partial long GetLockContentionCount(); diff --git a/src/coreclr/nativeaot/Common/src/System/Collections/Concurrent/ConcurrentUnifier.cs b/src/coreclr/nativeaot/Common/src/System/Collections/Concurrent/ConcurrentUnifier.cs index 237895a8c0711b..73c81ddf45797c 100644 --- a/src/coreclr/nativeaot/Common/src/System/Collections/Concurrent/ConcurrentUnifier.cs +++ b/src/coreclr/nativeaot/Common/src/System/Collections/Concurrent/ConcurrentUnifier.cs @@ -79,7 +79,7 @@ protected ConcurrentUnifier() public V GetOrAdd(K key) { Debug.Assert(key != null); - Debug.Assert(!_lock.IsAcquired, "GetOrAdd called while lock already acquired. A possible cause of this is an Equals or GetHashCode method that causes reentrancy in the table."); + Debug.Assert(!_lock.IsHeldByCurrentThread, "GetOrAdd called while lock already acquired. A possible cause of this is an Equals or GetHashCode method that causes reentrancy in the table."); int hashCode = key.GetHashCode(); V value; @@ -89,7 +89,7 @@ public V GetOrAdd(K key) V checkedValue; bool checkedFound; // In debug builds, always exercise a locked TryGet (this is a good way to detect deadlock/reentrancy through Equals/GetHashCode()). - using (LockHolder.Hold(_lock)) + using (_lock.EnterScope()) { _container.VerifyUnifierConsistency(); int h = key.GetHashCode(); @@ -110,7 +110,7 @@ public V GetOrAdd(K key) value = this.Factory(key); - using (LockHolder.Hold(_lock)) + using (_lock.EnterScope()) { V heyIWasHereFirst; if (_container.TryGetValue(key, hashCode, out heyIWasHereFirst)) @@ -171,7 +171,7 @@ public bool TryGetValue(K key, int hashCode, out V value) public void Add(K key, int hashCode, V value) { - Debug.Assert(_owner._lock.IsAcquired); + Debug.Assert(_owner._lock.IsHeldByCurrentThread); int bucket = ComputeBucket(hashCode, _buckets.Length); @@ -194,14 +194,14 @@ public bool HasCapacity { get { - Debug.Assert(_owner._lock.IsAcquired); + Debug.Assert(_owner._lock.IsHeldByCurrentThread); return _nextFreeEntry != _entries.Length; } } public void Resize() { - Debug.Assert(_owner._lock.IsAcquired); + Debug.Assert(_owner._lock.IsHeldByCurrentThread); int newSize = HashHelpers.GetPrime(_buckets.Length * 2); #if DEBUG @@ -257,7 +257,7 @@ public void VerifyUnifierConsistency() if (_nextFreeEntry >= 5000 && (0 != (_nextFreeEntry % 100))) return; - Debug.Assert(_owner._lock.IsAcquired); + Debug.Assert(_owner._lock.IsHeldByCurrentThread); Debug.Assert(_nextFreeEntry >= 0 && _nextFreeEntry <= _entries.Length); int numEntriesEncountered = 0; for (int bucket = 0; bucket < _buckets.Length; bucket++) diff --git a/src/coreclr/nativeaot/Common/src/System/Collections/Concurrent/ConcurrentUnifierW.cs b/src/coreclr/nativeaot/Common/src/System/Collections/Concurrent/ConcurrentUnifierW.cs index 049ce1ee078ab2..321419e4aa5c0c 100644 --- a/src/coreclr/nativeaot/Common/src/System/Collections/Concurrent/ConcurrentUnifierW.cs +++ b/src/coreclr/nativeaot/Common/src/System/Collections/Concurrent/ConcurrentUnifierW.cs @@ -89,7 +89,7 @@ protected ConcurrentUnifierW() public V GetOrAdd(K key) { Debug.Assert(key != null); - Debug.Assert(!_lock.IsAcquired, "GetOrAdd called while lock already acquired. A possible cause of this is an Equals or GetHashCode method that causes reentrancy in the table."); + Debug.Assert(!_lock.IsHeldByCurrentThread, "GetOrAdd called while lock already acquired. A possible cause of this is an Equals or GetHashCode method that causes reentrancy in the table."); int hashCode = key.GetHashCode(); V? value; @@ -99,7 +99,7 @@ public V GetOrAdd(K key) V? checkedValue; bool checkedFound; // In debug builds, always exercise a locked TryGet (this is a good way to detect deadlock/reentrancy through Equals/GetHashCode()). - using (LockHolder.Hold(_lock)) + using (_lock.EnterScope()) { _container.VerifyUnifierConsistency(); int h = key.GetHashCode(); @@ -137,7 +137,7 @@ public V GetOrAdd(K key) return null; } - using (LockHolder.Hold(_lock)) + using (_lock.EnterScope()) { V? heyIWasHereFirst; if (_container.TryGetValue(key, hashCode, out heyIWasHereFirst)) @@ -201,7 +201,7 @@ public bool TryGetValue(K key, int hashCode, out V? value) public void Add(K key, int hashCode, V value) { - Debug.Assert(_owner._lock.IsAcquired); + Debug.Assert(_owner._lock.IsHeldByCurrentThread); int bucket = ComputeBucket(hashCode, _buckets.Length); @@ -251,14 +251,14 @@ public bool HasCapacity { get { - Debug.Assert(_owner._lock.IsAcquired); + Debug.Assert(_owner._lock.IsHeldByCurrentThread); return _nextFreeEntry != _entries.Length; } } public void Resize() { - Debug.Assert(_owner._lock.IsAcquired); + Debug.Assert(_owner._lock.IsHeldByCurrentThread); // Before we actually grow the size of the table, figure out how much we can recover just by dropping entries with // expired weak references. @@ -341,7 +341,7 @@ public void VerifyUnifierConsistency() if (_nextFreeEntry >= 5000 || (0 != (_nextFreeEntry % 100))) return; - Debug.Assert(_owner._lock.IsAcquired); + Debug.Assert(_owner._lock.IsHeldByCurrentThread); Debug.Assert(_nextFreeEntry >= 0 && _nextFreeEntry <= _entries.Length); int numEntriesEncountered = 0; for (int bucket = 0; bucket < _buckets.Length; bucket++) diff --git a/src/coreclr/nativeaot/Common/src/System/Collections/Concurrent/ConcurrentUnifierWKeyed.cs b/src/coreclr/nativeaot/Common/src/System/Collections/Concurrent/ConcurrentUnifierWKeyed.cs index 48708eac12a982..22c0fb5f680527 100644 --- a/src/coreclr/nativeaot/Common/src/System/Collections/Concurrent/ConcurrentUnifierWKeyed.cs +++ b/src/coreclr/nativeaot/Common/src/System/Collections/Concurrent/ConcurrentUnifierWKeyed.cs @@ -102,7 +102,7 @@ protected ConcurrentUnifierWKeyed() public V GetOrAdd(K key) { Debug.Assert(key != null); - Debug.Assert(!_lock.IsAcquired, "GetOrAdd called while lock already acquired. A possible cause of this is an Equals or GetHashCode method that causes reentrancy in the table."); + Debug.Assert(!_lock.IsHeldByCurrentThread, "GetOrAdd called while lock already acquired. A possible cause of this is an Equals or GetHashCode method that causes reentrancy in the table."); int hashCode = key.GetHashCode(); V value; @@ -112,7 +112,7 @@ public V GetOrAdd(K key) V checkedValue; bool checkedFound; // In debug builds, always exercise a locked TryGet (this is a good way to detect deadlock/reentrancy through Equals/GetHashCode()). - using (LockHolder.Hold(_lock)) + using (_lock.EnterScope()) { _container.VerifyUnifierConsistency(); int h = key.GetHashCode(); @@ -154,7 +154,7 @@ public V GetOrAdd(K key) // it needs to produce the key quickly and in a deadlock-free manner once we're inside the lock. value.PrepareKey(); - using (LockHolder.Hold(_lock)) + using (_lock.EnterScope()) { V heyIWasHereFirst; if (_container.TryGetValue(key, hashCode, out heyIWasHereFirst)) @@ -220,7 +220,7 @@ public bool TryGetValue(K key, int hashCode, out V value) public void Add(int hashCode, V value) { - Debug.Assert(_owner._lock.IsAcquired); + Debug.Assert(_owner._lock.IsHeldByCurrentThread); int bucket = ComputeBucket(hashCode, _buckets.Length); int newEntryIdx = _nextFreeEntry; @@ -241,14 +241,14 @@ public bool HasCapacity { get { - Debug.Assert(_owner._lock.IsAcquired); + Debug.Assert(_owner._lock.IsHeldByCurrentThread); return _nextFreeEntry != _entries.Length; } } public void Resize() { - Debug.Assert(_owner._lock.IsAcquired); + Debug.Assert(_owner._lock.IsHeldByCurrentThread); // Before we actually grow the size of the table, figure out how much we can recover just by dropping entries with // expired weak references. @@ -330,7 +330,7 @@ public void VerifyUnifierConsistency() if (_nextFreeEntry >= 5000 && (0 != (_nextFreeEntry % 100))) return; - Debug.Assert(_owner._lock.IsAcquired); + Debug.Assert(_owner._lock.IsHeldByCurrentThread); Debug.Assert(_nextFreeEntry >= 0 && _nextFreeEntry <= _entries.Length); int numEntriesEncountered = 0; for (int bucket = 0; bucket < _buckets.Length; bucket++) diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/CompatibilitySuppressions.xml b/src/coreclr/nativeaot/System.Private.CoreLib/src/CompatibilitySuppressions.xml index 2347f0973c539d..50058746b67b33 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/CompatibilitySuppressions.xml +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/CompatibilitySuppressions.xml @@ -929,14 +929,6 @@ CP0001 T:System.Threading.Condition - - CP0001 - T:System.Threading.Lock - - - CP0001 - T:System.Threading.LockHolder - CP0002 M:System.ModuleHandle.#ctor(System.Reflection.Module) diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Runtime/CompilerHelpers/SynchronizedMethodHelpers.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Runtime/CompilerHelpers/SynchronizedMethodHelpers.cs index 4f4db6916b511c..56701f033500b1 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Runtime/CompilerHelpers/SynchronizedMethodHelpers.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Runtime/CompilerHelpers/SynchronizedMethodHelpers.cs @@ -14,7 +14,8 @@ internal static class SynchronizedMethodHelpers private static void MonitorEnter(object obj, ref bool lockTaken) { // Inlined Monitor.Enter with a few tweaks - int resultOrIndex = ObjectHeader.Acquire(obj); + int currentThreadID = ManagedThreadId.CurrentManagedThreadIdUnchecked; + int resultOrIndex = ObjectHeader.Acquire(obj, currentThreadID); if (resultOrIndex < 0) { lockTaken = true; @@ -25,7 +26,7 @@ private static void MonitorEnter(object obj, ref bool lockTaken) ObjectHeader.GetLockObject(obj) : SyncTable.GetLockObject(resultOrIndex); - Monitor.TryAcquireSlow(lck, obj, Timeout.Infinite); + lck.TryEnterSlow(Timeout.Infinite, currentThreadID, obj); lockTaken = true; } private static void MonitorExit(object obj, ref bool lockTaken) @@ -42,7 +43,8 @@ private static unsafe void MonitorEnterStatic(MethodTable* pMT, ref bool lockTak { // Inlined Monitor.Enter with a few tweaks object obj = GetStaticLockObject(pMT); - int resultOrIndex = ObjectHeader.Acquire(obj); + int currentThreadID = ManagedThreadId.CurrentManagedThreadIdUnchecked; + int resultOrIndex = ObjectHeader.Acquire(obj, currentThreadID); if (resultOrIndex < 0) { lockTaken = true; @@ -53,7 +55,7 @@ private static unsafe void MonitorEnterStatic(MethodTable* pMT, ref bool lockTak ObjectHeader.GetLockObject(obj) : SyncTable.GetLockObject(resultOrIndex); - Monitor.TryAcquireSlow(lck, obj, Timeout.Infinite); + lck.TryEnterSlow(Timeout.Infinite, currentThreadID, obj); lockTaken = true; } private static unsafe void MonitorExitStatic(MethodTable* pMT, ref bool lockTaken) diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System.Private.CoreLib.csproj b/src/coreclr/nativeaot/System.Private.CoreLib/src/System.Private.CoreLib.csproj index e1f1b75afc3175..2d86bc5db04dc0 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System.Private.CoreLib.csproj +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System.Private.CoreLib.csproj @@ -3,6 +3,8 @@ true $(NoWarn);AD0001 + + true @@ -230,10 +232,9 @@ - + - @@ -304,9 +305,6 @@ Interop\Unix\System.Native\Interop.Exit.cs - - Interop\Unix\System.Native\Interop.Threading.cs - diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/CompilerServices/ClassConstructorRunner.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/CompilerServices/ClassConstructorRunner.cs index 8093c0f71ff147..7e8293e1a1653f 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/CompilerServices/ClassConstructorRunner.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/CompilerServices/ClassConstructorRunner.cs @@ -111,7 +111,7 @@ public static unsafe void EnsureClassConstructorRun(StaticClassConstructionConte cctors[cctorIndex].HoldingThread = ManagedThreadIdNone; NoisyLog("Releasing cctor lock, context={0}, thread={1}", pContext, currentManagedThreadId); - cctorLock.Release(); + cctorLock.Exit(); } } else @@ -142,10 +142,10 @@ private static unsafe bool DeadlockAwareAcquire(CctorHandle cctor, StaticClassCo int cctorIndex = cctor.Index; Cctor[] cctors = cctor.Array; Lock lck = cctors[cctorIndex].Lock; - if (lck.IsAcquired) + if (lck.IsHeldByCurrentThread) return false; // Thread recursively triggered the same cctor. - if (lck.TryAcquire(waitIntervalInMS)) + if (lck.TryEnter(waitIntervalInMS)) return true; // We couldn't acquire the lock. See if this .cctor is involved in a cross-thread deadlock. If so, break @@ -164,7 +164,7 @@ private static unsafe bool DeadlockAwareAcquire(CctorHandle cctor, StaticClassCo // deadlock themselves, then that's a bug in user code. for (;;) { - using (LockHolder.Hold(s_cctorGlobalLock)) + using (s_cctorGlobalLock.EnterScope()) { // Ask the guy who holds the cctor lock we're trying to acquire who he's waiting for. Keep // walking down that chain until we either discover a cycle or reach a non-blocking state. Note @@ -233,7 +233,7 @@ private static unsafe bool DeadlockAwareAcquire(CctorHandle cctor, StaticClassCo waitIntervalInMS *= 2; // We didn't find a cycle yet, try to take the lock again. - if (lck.TryAcquire(waitIntervalInMS)) + if (lck.TryEnter(waitIntervalInMS)) return true; } // infinite loop } @@ -283,7 +283,7 @@ public static CctorHandle GetCctor(StaticClassConstructionContext* pContext) } #endif // TARGET_WASM - using (LockHolder.Hold(s_cctorGlobalLock)) + using (s_cctorGlobalLock.EnterScope()) { Cctor[]? resultArray = null; int resultIndex = -1; @@ -355,14 +355,14 @@ public static int Count { get { - Debug.Assert(s_cctorGlobalLock.IsAcquired); + Debug.Assert(s_cctorGlobalLock.IsHeldByCurrentThread); return s_count; } } public static void Release(CctorHandle cctor) { - using (LockHolder.Hold(s_cctorGlobalLock)) + using (s_cctorGlobalLock.EnterScope()) { Cctor[] cctors = cctor.Array; int cctorIndex = cctor.Index; @@ -419,7 +419,7 @@ public static int MarkThreadAsBlocked(int managedThreadId, CctorHandle blockedOn #else const int Grow = 10; #endif - using (LockHolder.Hold(s_cctorGlobalLock)) + using (s_cctorGlobalLock.EnterScope()) { s_blockingRecords ??= new BlockingRecord[Grow]; int found; @@ -450,14 +450,14 @@ public static int MarkThreadAsBlocked(int managedThreadId, CctorHandle blockedOn public static void UnmarkThreadAsBlocked(int blockRecordIndex) { // This method must never throw - s_cctorGlobalLock.Acquire(); + s_cctorGlobalLock.Enter(); s_blockingRecords[blockRecordIndex].BlockedOn = new CctorHandle(null, 0); - s_cctorGlobalLock.Release(); + s_cctorGlobalLock.Exit(); } public static CctorHandle GetCctorThatThreadIsBlockedOn(int managedThreadId) { - Debug.Assert(s_cctorGlobalLock.IsAcquired); + Debug.Assert(s_cctorGlobalLock.IsHeldByCurrentThread); for (int i = 0; i < s_nextBlockingRecordIndex; i++) { if (s_blockingRecords[i].ManagedThreadId == managedThreadId) diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.NativeAot.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.NativeAot.cs index e776860562ca49..0fc6330a1c88e4 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.NativeAot.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/ComWrappers.NativeAot.cs @@ -951,7 +951,7 @@ private unsafe bool TryGetOrCreateObjectForComInstanceInternal( if (!flags.HasFlag(CreateObjectFlags.UniqueInstance)) { - using (LockHolder.Hold(_lock)) + using (_lock.EnterScope()) { if (_rcwCache.TryGetValue(identity, out GCHandle handle)) { @@ -1047,7 +1047,7 @@ private unsafe bool TryGetOrCreateObjectForComInstanceInternal( return true; } - using (LockHolder.Hold(_lock)) + using (_lock.EnterScope()) { object? cachedWrapper = null; if (_rcwCache.TryGetValue(identity, out var existingHandle)) @@ -1092,7 +1092,7 @@ private unsafe bool TryGetOrCreateObjectForComInstanceInternal( private void RemoveRCWFromCache(IntPtr comPointer, GCHandle expectedValue) { - using (LockHolder.Hold(_lock)) + using (_lock.EnterScope()) { // TryGetOrCreateObjectForComInstanceInternal may have put a new entry into the cache // in the time between the GC cleared the contents of the GC handle but before the diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Condition.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Condition.cs index a567debf03708e..c8fdbb60384348 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Condition.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Condition.cs @@ -56,7 +56,7 @@ private unsafe void AssertIsNotInList(Waiter waiter) private unsafe void AddWaiter(Waiter waiter) { - Debug.Assert(_lock.IsAcquired); + Debug.Assert(_lock.IsHeldByCurrentThread); AssertIsNotInList(waiter); waiter.prev = _waitersTail; @@ -70,7 +70,7 @@ private unsafe void AddWaiter(Waiter waiter) private unsafe void RemoveWaiter(Waiter waiter) { - Debug.Assert(_lock.IsAcquired); + Debug.Assert(_lock.IsHeldByCurrentThread); AssertIsInList(waiter); if (waiter.next != null) @@ -101,13 +101,13 @@ public unsafe bool Wait(int millisecondsTimeout) { ArgumentOutOfRangeException.ThrowIfLessThan(millisecondsTimeout, -1); - if (!_lock.IsAcquired) + if (!_lock.IsHeldByCurrentThread) throw new SynchronizationLockException(); Waiter waiter = GetWaiterForCurrentThread(); AddWaiter(waiter); - uint recursionCount = _lock.ReleaseAll(); + uint recursionCount = _lock.ExitAll(); bool success = false; try { @@ -115,8 +115,8 @@ public unsafe bool Wait(int millisecondsTimeout) } finally { - _lock.Reacquire(recursionCount); - Debug.Assert(_lock.IsAcquired); + _lock.Reenter(recursionCount); + Debug.Assert(_lock.IsHeldByCurrentThread); if (!waiter.signalled) { @@ -140,7 +140,7 @@ public unsafe bool Wait(int millisecondsTimeout) public unsafe void SignalAll() { - if (!_lock.IsAcquired) + if (!_lock.IsHeldByCurrentThread) throw new SynchronizationLockException(); while (_waitersHead != null) @@ -149,7 +149,7 @@ public unsafe void SignalAll() public unsafe void SignalOne() { - if (!_lock.IsAcquired) + if (!_lock.IsHeldByCurrentThread) throw new SynchronizationLockException(); Waiter? waiter = _waitersHead; diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Lock.NativeAot.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Lock.NativeAot.cs new file mode 100644 index 00000000000000..690014f91691fa --- /dev/null +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Lock.NativeAot.cs @@ -0,0 +1,229 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Diagnostics; +using System.Diagnostics.Tracing; +using System.Runtime.CompilerServices; + +namespace System.Threading +{ + public sealed partial class Lock + { + private const short SpinCountNotInitialized = short.MinValue; + + // NOTE: Lock must not have a static (class) constructor, as Lock itself is used to synchronize + // class construction. If Lock has its own class constructor, this can lead to infinite recursion. + // All static data in Lock must be lazy-initialized. + private static int s_staticsInitializationStage; + private static bool s_isSingleProcessor; + private static short s_maxSpinCount; + private static short s_minSpinCount; + + /// + /// Initializes a new instance of the class. + /// + public Lock() => _spinCount = SpinCountNotInitialized; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal bool TryEnterOneShot(int currentManagedThreadId) + { + Debug.Assert(currentManagedThreadId != 0); + + if (State.TryLock(this)) + { + Debug.Assert(_owningThreadId == 0); + Debug.Assert(_recursionCount == 0); + _owningThreadId = (uint)currentManagedThreadId; + return true; + } + + return false; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal void Exit(int currentManagedThreadId) + { + Debug.Assert(currentManagedThreadId != 0); + + if (_owningThreadId != (uint)currentManagedThreadId) + { + ThrowHelper.ThrowSynchronizationLockException_LockExit(); + } + + ExitImpl(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private ThreadId TryEnterSlow(int timeoutMs, ThreadId currentThreadId) => + TryEnterSlow(timeoutMs, currentThreadId, this); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal bool TryEnterSlow(int timeoutMs, int currentManagedThreadId, object associatedObject) => + TryEnterSlow(timeoutMs, new ThreadId((uint)currentManagedThreadId), associatedObject).IsInitialized; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal bool GetIsHeldByCurrentThread(int currentManagedThreadId) + { + Debug.Assert(currentManagedThreadId != 0); + + bool isHeld = _owningThreadId == (uint)currentManagedThreadId; + Debug.Assert(!isHeld || new State(this).IsLocked); + return isHeld; + } + + internal uint ExitAll() + { + Debug.Assert(IsHeldByCurrentThread); + + uint recursionCount = _recursionCount; + _owningThreadId = 0; + _recursionCount = 0; + + State state = State.Unlock(this); + if (state.HasAnyWaiters) + { + SignalWaiterIfNecessary(state); + } + + return recursionCount; + } + + internal void Reenter(uint previousRecursionCount) + { + Debug.Assert(!IsHeldByCurrentThread); + + Enter(); + _recursionCount = previousRecursionCount; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private TryLockResult LazyInitializeOrEnter() + { + StaticsInitializationStage stage = (StaticsInitializationStage)Volatile.Read(ref s_staticsInitializationStage); + switch (stage) + { + case StaticsInitializationStage.Complete: + if (_spinCount == SpinCountNotInitialized) + { + _spinCount = s_maxSpinCount; + } + return TryLockResult.Spin; + + case StaticsInitializationStage.Started: + // Spin-wait until initialization is complete or the lock is acquired to prevent class construction cycles + // later during a full wait + bool sleep = true; + while (true) + { + if (sleep) + { + Thread.UninterruptibleSleep0(); + } + else + { + Thread.SpinWait(1); + } + + stage = (StaticsInitializationStage)Volatile.Read(ref s_staticsInitializationStage); + if (stage == StaticsInitializationStage.Complete) + { + goto case StaticsInitializationStage.Complete; + } + else if (stage == StaticsInitializationStage.NotStarted) + { + goto default; + } + + if (State.TryLock(this)) + { + return TryLockResult.Locked; + } + + sleep = !sleep; + } + + default: + Debug.Assert(stage == StaticsInitializationStage.NotStarted); + if (TryInitializeStatics()) + { + goto case StaticsInitializationStage.Complete; + } + goto case StaticsInitializationStage.Started; + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + private static bool TryInitializeStatics() + { + // Since Lock is used to synchronize class construction, and some of the statics initialization may involve class + // construction, update the stage first to avoid infinite recursion + switch ( + (StaticsInitializationStage) + Interlocked.CompareExchange( + ref s_staticsInitializationStage, + (int)StaticsInitializationStage.Started, + (int)StaticsInitializationStage.NotStarted)) + { + case StaticsInitializationStage.Started: + return false; + case StaticsInitializationStage.Complete: + return true; + } + + try + { + s_isSingleProcessor = Environment.IsSingleProcessor; + s_maxSpinCount = DetermineMaxSpinCount(); + s_minSpinCount = DetermineMinSpinCount(); + + // Also initialize some types that are used later to prevent potential class construction cycles + NativeRuntimeEventSource.Log.IsEnabled(); + } + catch + { + s_staticsInitializationStage = (int)StaticsInitializationStage.NotStarted; + throw; + } + + Volatile.Write(ref s_staticsInitializationStage, (int)StaticsInitializationStage.Complete); + return true; + } + + // Returns false until the static variable is lazy-initialized + internal static bool IsSingleProcessor => s_isSingleProcessor; + + // Used to transfer the state when inflating thin locks + internal void InitializeLocked(int managedThreadId, uint recursionCount) + { + Debug.Assert(recursionCount == 0 || managedThreadId != 0); + + _state = managedThreadId == 0 ? State.InitialStateValue : State.LockedStateValue; + _owningThreadId = (uint)managedThreadId; + _recursionCount = recursionCount; + } + + internal struct ThreadId + { + private uint _id; + + public ThreadId(uint id) => _id = id; + public uint Id => _id; + public bool IsInitialized => _id != 0; + public static ThreadId Current_NoInitialize => new ThreadId((uint)ManagedThreadId.CurrentManagedThreadIdUnchecked); + + public void InitializeForCurrentThread() + { + Debug.Assert(!IsInitialized); + _id = (uint)ManagedThreadId.Current; + Debug.Assert(IsInitialized); + } + } + + private enum StaticsInitializationStage + { + NotStarted, + Started, + Complete + } + } +} diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Lock.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Lock.cs deleted file mode 100644 index 30bc946ad42546..00000000000000 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Lock.cs +++ /dev/null @@ -1,544 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Diagnostics; -using System.IO; -using System.Runtime; -using System.Runtime.CompilerServices; - -namespace System.Threading -{ - public sealed class Lock : IDisposable - { - // - // This lock is a hybrid spinning/blocking lock with dynamically adjusted spinning. - // On a multiprocessor machine an acquiring thread will try to acquire multiple times - // before going to sleep. The amount of spinning is dynamically adjusted based on past - // history of the lock and will stay in the following range. - // - // We use doubling-up delays with a cap while spinning (1,2,4,8,16,32,64,64,64,64, ...) - // Thus 20 iterations is about 1000 speenwaits (20-50 ns each) - // Context switch costs may vary and typically in 2-20 usec range - // Even if we are the only thread trying to acquire the lock at 20-50 usec the cost of being - // blocked+awaken may not be more than 2x of what we have already spent, so that is the max CPU time - // that we will allow to burn while spinning. - // - // This may not be always optimal, but should be close enough. - // I.E. in a system consisting of exactly 2 threads, unlimited spinning may work better, but we - // will not optimize specifically for that. - private const ushort MaxSpinLimit = 20; - private const ushort MinSpinLimit = 3; - private const ushort SpinningNotInitialized = MaxSpinLimit + 1; - private const ushort SpinningDisabled = 0; - - // - // We will use exponential backoff in rare cases when we need to change state atomically and cannot - // make progress due to concurrent state changes by other threads. - // While we cannot know the ideal amount of wait needed before making a successfull attempt, - // the exponential backoff will generally be not more than 2X worse than the perfect guess and - // will do a lot less attempts than an simple retry. On multiprocessor machine fruitless attempts - // will cause unnecessary sharing of the contended state which may make modifying the state more expensive. - // To protect against degenerate cases we will cap the per-iteration wait to 1024 spinwaits. - // - private const uint MaxExponentialBackoffBits = 10; - - // - // This lock is unfair and permits acquiring a contended lock by a nonwaiter in the presence of waiters. - // It is possible for one thread to keep holding the lock long enough that waiters go to sleep and - // then release and reacquire fast enough that waiters have no chance to get the lock. - // In extreme cases one thread could keep retaking the lock starving everybody else. - // If we see woken waiters not able to take the lock for too long we will ask nonwaiters to wait. - // - private const uint WaiterWatchdogTicks = 100; - - // - // NOTE: Lock must not have a static (class) constructor, as Lock itself is used to synchronize - // class construction. If Lock has its own class constructor, this can lead to infinite recursion. - // All static data in Lock must be lazy-initialized. - // - internal static int s_processorCount; - - // - // m_state layout: - // - // bit 0: True if the lock is held, false otherwise. - // - // bit 1: True if we've set the event to wake a waiting thread. The waiter resets this to false when it - // wakes up. This avoids the overhead of setting the event multiple times. - // - // bit 2: True if nonwaiters must not get ahead of waiters when acquiring a contended lock. - // - // everything else: A count of the number of threads waiting on the event. - // - private const int Uncontended = 0; - private const int Locked = 1; - private const int WaiterWoken = 2; - private const int YieldToWaiters = 4; - private const int WaiterCountIncrement = 8; - - // state of the lock - private AutoResetEvent? _lazyEvent; - private int _owningThreadId; - private uint _recursionCount; - private int _state; - private ushort _spinLimit = SpinningNotInitialized; - private short _wakeWatchDog; - - // used to transfer the state when inflating thin locks - internal void InitializeLocked(int threadId, int recursionCount) - { - Debug.Assert(recursionCount == 0 || threadId != 0); - - _state = threadId == 0 ? Uncontended : Locked; - _owningThreadId = threadId; - _recursionCount = (uint)recursionCount; - } - - private AutoResetEvent Event - { - get - { - if (_lazyEvent == null) - Interlocked.CompareExchange(ref _lazyEvent, new AutoResetEvent(false), null); - - return _lazyEvent; - } - } - - public void Dispose() - { - _lazyEvent?.Dispose(); - } - - private static int CurrentThreadId => Environment.CurrentManagedThreadId; - - [MethodImpl(MethodImplOptions.NoInlining)] - public void Acquire() - { - int currentThreadId = CurrentThreadId; - if (TryAcquireOneShot(currentThreadId)) - return; - - // - // Fall back to the slow path for contention - // - bool success = TryAcquireSlow(currentThreadId, Timeout.Infinite); - Debug.Assert(success); - } - - public bool TryAcquire(TimeSpan timeout) - { - return TryAcquire(WaitHandle.ToTimeoutMilliseconds(timeout)); - } - - public bool TryAcquire(int millisecondsTimeout) - { - ArgumentOutOfRangeException.ThrowIfLessThan(millisecondsTimeout, -1); - - int currentThreadId = CurrentThreadId; - if (TryAcquireOneShot(currentThreadId)) - return true; - - // - // Fall back to the slow path for contention - // - return TryAcquireSlow(currentThreadId, millisecondsTimeout, trackContentions: false); - } - - internal bool TryAcquireNoSpin() - { - // - // Make one quick attempt to acquire an uncontended lock - // - int currentThreadId = CurrentThreadId; - if (TryAcquireOneShot(currentThreadId)) - return true; - - // - // If we already own the lock, just increment the recursion count. - // - if (_owningThreadId == currentThreadId) - { - checked { _recursionCount++; } - return true; - } - - return false; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal bool TryAcquireOneShot(int currentThreadId) - { - int origState = _state; - int expectedState = origState & ~(YieldToWaiters | Locked); - int newState = origState | Locked; - if (Interlocked.CompareExchange(ref _state, newState, expectedState) == expectedState) - { - Debug.Assert(_owningThreadId == 0); - Debug.Assert(_recursionCount == 0); - _owningThreadId = currentThreadId; - return true; - } - - return false; - } - - private static unsafe void ExponentialBackoff(uint iteration) - { - if (iteration > 0) - { - // no need for much randomness here, we will just hash the stack address + iteration. - uint rand = ((uint)&iteration + iteration) * 2654435769u; - // set the highmost bit to ensure minimum number of spins is exponentialy increasing - // that is in case some stack location results in a sequence of very low spin counts - // it basically gurantees that we spin at least 1, 2, 4, 8, 16, times, and so on - rand |= (1u << 31); - uint spins = rand >> (byte)(32 - Math.Min(iteration, MaxExponentialBackoffBits)); - Thread.SpinWaitInternal((int)spins); - } - } - - internal bool TryAcquireSlow(int currentThreadId, int millisecondsTimeout, bool trackContentions = false) - { - // - // If we already own the lock, just increment the recursion count. - // - if (_owningThreadId == currentThreadId) - { - checked { _recursionCount++; } - return true; - } - - // - // We've already made one lock attempt at this point, so bail early if the timeout is zero. - // - if (millisecondsTimeout == 0) - return false; - - // since we have just made an attempt to accuire and failed, do a small pause - Thread.SpinWaitInternal(1); - - if (_spinLimit == SpinningNotInitialized) - { - // Use RhGetProcessCpuCount directly to avoid Environment.ProcessorCount->ClassConstructorRunner->Lock->Environment.ProcessorCount cycle - if (s_processorCount == 0) - s_processorCount = RuntimeImports.RhGetProcessCpuCount(); - - _spinLimit = (s_processorCount > 1) ? MinSpinLimit : SpinningDisabled; - } - - bool hasWaited = false; - // we will retry after waking up - while (true) - { - uint iteration = 0; - - // We will count when we failed to change the state of the lock and increase pauses - // so that bursts of activity are better tolerated. This should not happen often. - uint collisions = 0; - - // We will track the changes of ownership while we are trying to acquire the lock. - int oldOwner = _owningThreadId; - uint ownerChanged = 0; - - uint localSpinLimit = _spinLimit; - // inner loop where we try acquiring the lock or registering as a waiter - while (true) - { - // - // Try to grab the lock. We may take the lock here even if there are existing waiters. This creates the possibility - // of starvation of waiters, but it also prevents lock convoys and preempted waiters from destroying perf. - // However, if we do not see _wakeWatchDog cleared for long enough, we go into YieldToWaiters mode to ensure some - // waiter progress. - // - int oldState = _state; - bool canAcquire = ((oldState & Locked) == 0) && - (hasWaited || ((oldState & YieldToWaiters) == 0)); - - if (canAcquire) - { - int newState = oldState | Locked; - if (hasWaited) - newState = (newState - WaiterCountIncrement) & ~(WaiterWoken | YieldToWaiters); - - if (Interlocked.CompareExchange(ref _state, newState, oldState) == oldState) - { - // GOT THE LOCK!! - if (hasWaited) - _wakeWatchDog = 0; - - // now we can estimate how busy the lock is and adjust spinning accordingly - ushort spinLimit = _spinLimit; - if (ownerChanged != 0) - { - // The lock has changed ownership while we were trying to acquire it. - // It is a signal that we might want to spin less next time. - // Pursuing a lock that is being "stolen" by other threads is inefficient - // due to cache misses and unnecessary sharing of state that keeps invalidating. - if (spinLimit > MinSpinLimit) - { - _spinLimit = (ushort)(spinLimit - 1); - } - } - else if (spinLimit < MaxSpinLimit && iteration > spinLimit / 2) - { - // we used more than 50% of allowed iterations, but the lock does not look very contested, - // we can allow a bit more spinning. - _spinLimit = (ushort)(spinLimit + 1); - } - - Debug.Assert((_state | Locked) != 0); - Debug.Assert(_owningThreadId == 0); - Debug.Assert(_recursionCount == 0); - _owningThreadId = currentThreadId; - return true; - } - } - - if (iteration++ < localSpinLimit) - { - int newOwner = _owningThreadId; - if (newOwner != 0 && newOwner != oldOwner) - { - ownerChanged++; - oldOwner = newOwner; - } - - if (canAcquire) - { - collisions++; - } - - // We failed to acquire the lock and want to retry after a pause. - // Ideally we will retry right when the lock becomes free, but we cannot know when that will happen. - // We will use a pause that doubles up on every iteration. It will not be more than 2x worse - // than the ideal guess, while minimizing the number of retries. - // We will allow pauses up to 64~128 spinwaits, or more if there are collisions. - ExponentialBackoff(Math.Min(iteration, 6) + collisions); - continue; - } - else if (!canAcquire) - { - // - // We reached our spin limit, and need to wait. Increment the waiter count. - // Note that we do not do any overflow checking on this increment. In order to overflow, - // we'd need to have about 1 billion waiting threads, which is inconceivable anytime in the - // forseeable future. - // - int newState = oldState + WaiterCountIncrement; - if (hasWaited) - newState = (newState - WaiterCountIncrement) & ~WaiterWoken; - - if (Interlocked.CompareExchange(ref _state, newState, oldState) == oldState) - break; - - collisions++; - } - - ExponentialBackoff(collisions); - } - - // - // Now we wait. - // - - if (trackContentions) - { - Monitor.IncrementLockContentionCount(); - } - - TimeoutTracker timeoutTracker = TimeoutTracker.Start(millisecondsTimeout); - Debug.Assert(_state >= WaiterCountIncrement); - bool waitSucceeded = Event.WaitOne(millisecondsTimeout); - Debug.Assert(_state >= WaiterCountIncrement); - - if (!waitSucceeded) - break; - - // we did not time out and will try acquiring the lock - hasWaited = true; - millisecondsTimeout = timeoutTracker.Remaining; - } - - // We timed out. We're not going to wait again. - { - uint iteration = 0; - while (true) - { - int oldState = _state; - Debug.Assert(oldState >= WaiterCountIncrement); - - int newState = oldState - WaiterCountIncrement; - - // We could not have consumed a wake, or the wait would've succeeded. - // If we are the last waiter though, we will clear WaiterWoken and YieldToWaiters - // just so that lock would not look like contended. - if (newState < WaiterCountIncrement) - newState = newState & ~WaiterWoken & ~YieldToWaiters; - - if (Interlocked.CompareExchange(ref _state, newState, oldState) == oldState) - return false; - - ExponentialBackoff(iteration++); - } - } - } - - public bool IsAcquired - { - get - { - // - // Compare the current owning thread ID with the current thread ID. We need - // to read the current thread's ID before we read m_owningThreadId. Otherwise, - // the following might happen: - // - // 1) We read m_owningThreadId, and get, say 42, which belongs to another thread. - // 2) Thread 42 releases the lock, and exits. - // 3) We call ManagedThreadId.Current. If this is the first time it's been called - // on this thread, we'll go get a new ID. We may reuse thread 42's ID, since - // that thread is dead. - // 4) Now we're thread 42, and it looks like we own the lock, even though we don't. - // - // However, as long as we get this thread's ID first, we know it won't be reused, - // because while we're doing this check the current thread is definitely still - // alive. - // - int currentThreadId = CurrentThreadId; - return IsAcquiredByThread(currentThreadId); - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal bool IsAcquiredByThread(int currentThreadId) - { - bool acquired = (currentThreadId == _owningThreadId); - Debug.Assert(!acquired || (_state & Locked) != 0); - return acquired; - } - - [MethodImpl(MethodImplOptions.NoInlining)] - public void Release() - { - ReleaseByThread(CurrentThreadId); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal void ReleaseByThread(int threadId) - { - if (threadId != _owningThreadId) - throw new SynchronizationLockException(); - - if (_recursionCount == 0) - { - ReleaseCore(); - return; - } - - _recursionCount--; - } - - internal uint ReleaseAll() - { - Debug.Assert(IsAcquired); - - uint recursionCount = _recursionCount; - _recursionCount = 0; - - ReleaseCore(); - - return recursionCount; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private void ReleaseCore() - { - Debug.Assert(_recursionCount == 0); - _owningThreadId = 0; - int origState = Interlocked.Decrement(ref _state); - if (origState < WaiterCountIncrement || (origState & WaiterWoken) != 0) - { - return; - } - - // - // We have waiters; take the slow path. - // - AwakeWaiterIfNeeded(); - } - - private void AwakeWaiterIfNeeded() - { - uint iteration = 0; - while (true) - { - int oldState = _state; - if (oldState >= WaiterCountIncrement && (oldState & WaiterWoken) == 0) - { - // there are waiters, and nobody has woken one. - int newState = oldState | WaiterWoken; - - short lastWakeTicks = _wakeWatchDog; - if (lastWakeTicks != 0 && (short)Environment.TickCount - lastWakeTicks > WaiterWatchdogTicks) - { - newState |= YieldToWaiters; - } - - if (Interlocked.CompareExchange(ref _state, newState, oldState) == oldState) - { - if (lastWakeTicks == 0) - { - // nonzero timestamp of the last wake - _wakeWatchDog = (short)(Environment.TickCount | 1); - } - - Event.Set(); - return; - } - } - else - { - // no need to wake a waiter. - return; - } - - ExponentialBackoff(iteration++); - } - } - - internal void Reacquire(uint previousRecursionCount) - { - Acquire(); - Debug.Assert(_recursionCount == 0); - _recursionCount = previousRecursionCount; - } - - internal struct TimeoutTracker - { - private int _start; - private int _timeout; - - public static TimeoutTracker Start(int timeout) - { - TimeoutTracker tracker = new TimeoutTracker(); - tracker._timeout = timeout; - if (timeout != Timeout.Infinite) - tracker._start = Environment.TickCount; - return tracker; - } - - public int Remaining - { - get - { - if (_timeout == Timeout.Infinite) - return Timeout.Infinite; - int elapsed = Environment.TickCount - _start; - if (elapsed > _timeout) - return 0; - return _timeout - elapsed; - } - } - } - } -} diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/LockHolder.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/LockHolder.cs deleted file mode 100644 index 784a5d0fe3555e..00000000000000 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/LockHolder.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.CompilerServices; - -namespace System.Threading -{ - public struct LockHolder : IDisposable - { - private Lock _lock; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static LockHolder Hold(Lock l) - { - LockHolder h; - l.Acquire(); - h._lock = l; - return h; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void Dispose() - { - _lock.Release(); - } - } -} diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Monitor.NativeAot.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Monitor.NativeAot.cs index ce2e58a975abf0..89a8505663d307 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Monitor.NativeAot.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Monitor.NativeAot.cs @@ -41,7 +41,8 @@ private static Condition GetCondition(object obj) [MethodImpl(MethodImplOptions.NoInlining)] public static void Enter(object obj) { - int resultOrIndex = ObjectHeader.Acquire(obj); + int currentThreadID = ManagedThreadId.CurrentManagedThreadIdUnchecked; + int resultOrIndex = ObjectHeader.Acquire(obj, currentThreadID); if (resultOrIndex < 0) return; @@ -49,7 +50,7 @@ public static void Enter(object obj) ObjectHeader.GetLockObject(obj) : SyncTable.GetLockObject(resultOrIndex); - TryAcquireSlow(lck, obj, Timeout.Infinite); + lck.TryEnterSlow(Timeout.Infinite, currentThreadID, obj); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -66,7 +67,8 @@ public static void Enter(object obj, ref bool lockTaken) [MethodImpl(MethodImplOptions.NoInlining)] public static bool TryEnter(object obj) { - int resultOrIndex = ObjectHeader.TryAcquire(obj); + int currentThreadID = ManagedThreadId.CurrentManagedThreadIdUnchecked; + int resultOrIndex = ObjectHeader.TryAcquire(obj, currentThreadID); if (resultOrIndex < 0) return true; @@ -74,7 +76,13 @@ public static bool TryEnter(object obj) return false; Lock lck = SyncTable.GetLockObject(resultOrIndex); - return lck.TryAcquire(0); + + // The one-shot fast path is not covered by the slow path below for a zero timeout when the thread ID is + // initialized, so cover it here in case it wasn't already done + if (currentThreadID != 0 && lck.TryEnterOneShot(currentThreadID)) + return true; + + return lck.TryEnterSlow(0, currentThreadID, obj); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -92,7 +100,8 @@ public static bool TryEnter(object obj, int millisecondsTimeout) { ArgumentOutOfRangeException.ThrowIfLessThan(millisecondsTimeout, -1); - int resultOrIndex = ObjectHeader.TryAcquire(obj); + int currentThreadID = ManagedThreadId.CurrentManagedThreadIdUnchecked; + int resultOrIndex = ObjectHeader.TryAcquire(obj, currentThreadID); if (resultOrIndex < 0) return true; @@ -100,10 +109,12 @@ public static bool TryEnter(object obj, int millisecondsTimeout) ObjectHeader.GetLockObject(obj) : SyncTable.GetLockObject(resultOrIndex); - if (millisecondsTimeout == 0) - return lck.TryAcquireNoSpin(); + // The one-shot fast path is not covered by the slow path below for a zero timeout when the thread ID is + // initialized, so cover it here in case it wasn't already done + if (millisecondsTimeout == 0 && currentThreadID != 0 && lck.TryEnterOneShot(currentThreadID)) + return true; - return TryAcquireSlow(lck, obj, millisecondsTimeout); + return lck.TryEnterSlow(millisecondsTimeout, currentThreadID, obj); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -159,18 +170,6 @@ public static void PulseAll(object obj) #endregion - #region Slow path for Entry/TryEnter methods. - - internal static bool TryAcquireSlow(Lock lck, object obj, int millisecondsTimeout) - { - using (new DebugBlockingScope(obj, DebugBlockingItemType.MonitorCriticalSection, millisecondsTimeout, out _)) - { - return lck.TryAcquireSlow(Environment.CurrentManagedThreadId, millisecondsTimeout, trackContentions: true); - } - } - - #endregion - #region Debugger support // The debugger binds to the fields below by name. Do not change any names or types without @@ -185,14 +184,14 @@ internal static bool TryAcquireSlow(Lock lck, object obj, int millisecondsTimeou // Different ways a thread can be blocked that the debugger will expose. // Do not change or add members without updating the debugger code. - private enum DebugBlockingItemType + internal enum DebugBlockingItemType { MonitorCriticalSection = 0, MonitorEvent = 1 } // Represents an item a thread is blocked on. This structure is allocated on the stack and accessed by the debugger. - private struct DebugBlockingItem + internal struct DebugBlockingItem { // The object the thread is waiting on public object _object; @@ -207,7 +206,7 @@ private struct DebugBlockingItem public IntPtr _next; } - private unsafe struct DebugBlockingScope : IDisposable + internal unsafe struct DebugBlockingScope : IDisposable { public DebugBlockingScope(object obj, DebugBlockingItemType blockingType, int timeout, out DebugBlockingItem blockingItem) { @@ -229,28 +228,10 @@ public void Dispose() #region Metrics - private static readonly ThreadInt64PersistentCounter s_lockContentionCounter = new ThreadInt64PersistentCounter(); - - [ThreadStatic] - private static object t_ContentionCountObject; - - [MethodImpl(MethodImplOptions.NoInlining)] - private static object CreateThreadLocalContentionCountObject() - { - Debug.Assert(t_ContentionCountObject == null); - - object threadLocalContentionCountObject = s_lockContentionCounter.CreateThreadLocalCountObject(); - t_ContentionCountObject = threadLocalContentionCountObject; - return threadLocalContentionCountObject; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal static void IncrementLockContentionCount() => ThreadInt64PersistentCounter.Increment(t_ContentionCountObject ?? CreateThreadLocalContentionCountObject()); - /// /// Gets the number of times there was contention upon trying to take a 's lock so far. /// - public static long LockContentionCount => s_lockContentionCounter.Count; + public static long LockContentionCount => Lock.ContentionCount; #endregion } diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/ObjectHeader.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/ObjectHeader.cs index 327586771fe074..d411f997ee11a4 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/ObjectHeader.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/ObjectHeader.cs @@ -217,7 +217,7 @@ public static unsafe void SetSyncEntryIndex(int* pHeader, int syncIndex) { // Holding this lock implies there is at most one thread setting the sync entry index at // any given time. We also require that the sync entry index has not been already set. - Debug.Assert(SyncTable.s_lock.IsAcquired); + Debug.Assert(SyncTable.s_lock.IsHeldByCurrentThread); int oldBits, newBits; do @@ -239,7 +239,7 @@ public static unsafe void SetSyncEntryIndex(int* pHeader, int syncIndex) SyncTable.MoveThinLockToNewEntry( syncIndex, oldBits & SBLK_MASK_LOCK_THREADID, - (oldBits & SBLK_MASK_LOCK_RECLEVEL) >> SBLK_RECLEVEL_SHIFT); + (uint)((oldBits & SBLK_MASK_LOCK_RECLEVEL) >> SBLK_RECLEVEL_SHIFT)); } // Store the sync entry index @@ -284,24 +284,22 @@ public static unsafe void SetSyncEntryIndex(int* pHeader, int syncIndex) // 0 - failed // syncIndex - retry with the Lock [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe int Acquire(object obj) + public static unsafe int Acquire(object obj, int currentThreadID) { - return TryAcquire(obj, oneShot: false); + return TryAcquire(obj, currentThreadID, oneShot: false); } // -1 - success // 0 - failed // syncIndex - retry with the Lock [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe int TryAcquire(object obj, bool oneShot = true) + public static unsafe int TryAcquire(object obj, int currentThreadID, bool oneShot = true) { ArgumentNullException.ThrowIfNull(obj); Debug.Assert(!(obj is Lock), "Do not use Monitor.Enter or TryEnter on a Lock instance; use Lock methods directly instead."); - int currentThreadID = ManagedThreadId.CurrentManagedThreadIdUnchecked; - // if thread ID is uninitialized or too big, we do "uncommon" part. if ((uint)(currentThreadID - 1) <= (uint)SBLK_MASK_LOCK_THREADID) { @@ -323,7 +321,7 @@ public static unsafe int TryAcquire(object obj, bool oneShot = true) } else if (GetSyncEntryIndex(oldBits, out int syncIndex)) { - if (SyncTable.GetLockObject(syncIndex).TryAcquireOneShot(currentThreadID)) + if (SyncTable.GetLockObject(syncIndex).TryEnterOneShot(currentThreadID)) { return -1; } @@ -334,23 +332,25 @@ public static unsafe int TryAcquire(object obj, bool oneShot = true) } } - return TryAcquireUncommon(obj, oneShot); + return TryAcquireUncommon(obj, currentThreadID, oneShot); } // handling uncommon cases here - recursive lock, contention, retries // -1 - success // 0 - failed // syncIndex - retry with the Lock - private static unsafe int TryAcquireUncommon(object obj, bool oneShot) + private static unsafe int TryAcquireUncommon(object obj, int currentThreadID, bool oneShot) { + if (currentThreadID == 0) + currentThreadID = Environment.CurrentManagedThreadId; + // does thread ID fit? - int currentThreadID = Environment.CurrentManagedThreadId; if (currentThreadID > SBLK_MASK_LOCK_THREADID) return GetSyncIndex(obj); - // Lock.s_processorCount is lazy-initialized at fist contended acquire - // untill then it is 0 and we assume we have multicore machine - int retries = oneShot || Lock.s_processorCount == 1 ? 0 : 16; + // Lock.IsSingleProcessor gets a value that is lazy-initialized at the first contended acquire. + // Until then it is false and we assume we have multicore machine. + int retries = oneShot || Lock.IsSingleProcessor ? 0 : 16; // retry when the lock is owned by somebody else. // this loop will spinwait between iterations. @@ -422,9 +422,12 @@ private static unsafe int TryAcquireUncommon(object obj, bool oneShot) } } - // spin a bit before retrying (1 spinwait is roughly 35 nsec) - // the object is not pinned here - Thread.SpinWaitInternal(i); + if (retries != 0) + { + // spin a bit before retrying (1 spinwait is roughly 35 nsec) + // the object is not pinned here + Thread.SpinWaitInternal(i); + } } // owned by somebody else @@ -481,7 +484,7 @@ public static unsafe void Release(object obj) } } - fatLock.ReleaseByThread(currentThreadID); + fatLock.Exit(currentThreadID); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -510,7 +513,7 @@ public static unsafe bool IsAcquired(object obj) if (GetSyncEntryIndex(oldBits, out int syncIndex)) { - return SyncTable.GetLockObject(syncIndex).IsAcquiredByThread(currentThreadID); + return SyncTable.GetLockObject(syncIndex).GetIsHeldByCurrentThread(currentThreadID); } // someone else owns or noone. diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/SyncTable.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/SyncTable.cs index de07c986834ec1..02d7b4167ca6b2 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/SyncTable.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/SyncTable.cs @@ -106,7 +106,7 @@ public static unsafe int AssignEntry(object obj, int* pHeader) try { - using (LockHolder.Hold(s_lock)) + using (s_lock.EnterScope()) { // After acquiring the lock check whether another thread already assigned the sync entry if (ObjectHeader.GetSyncEntryIndex(*pHeader, out int syncIndex)) @@ -172,7 +172,7 @@ public static unsafe int AssignEntry(object obj, int* pHeader) /// private static void Grow() { - Debug.Assert(s_lock.IsAcquired); + Debug.Assert(s_lock.IsHeldByCurrentThread); int oldSize = s_entries.Length; int newSize = CalculateNewSize(oldSize); @@ -242,7 +242,7 @@ public static int SetHashCode(int syncIndex, int hashCode) // Acquire the lock to ensure we are updating the latest version of s_entries. This // lock may be avoided if we store the hash code and Monitor synchronization data in // the same object accessed by a reference. - using (LockHolder.Hold(s_lock)) + using (s_lock.EnterScope()) { int currentHash = s_entries[syncIndex].HashCode; if (currentHash != 0) @@ -260,7 +260,7 @@ public static int SetHashCode(int syncIndex, int hashCode) /// public static void MoveHashCodeToNewEntry(int syncIndex, int hashCode) { - Debug.Assert(s_lock.IsAcquired); + Debug.Assert(s_lock.IsHeldByCurrentThread); Debug.Assert((0 < syncIndex) && (syncIndex < s_unusedEntryIndex)); s_entries[syncIndex].HashCode = hashCode; } @@ -269,9 +269,9 @@ public static void MoveHashCodeToNewEntry(int syncIndex, int hashCode) /// Initializes the Lock assuming the caller holds s_lock. Use for not yet /// published entries only. /// - public static void MoveThinLockToNewEntry(int syncIndex, int threadId, int recursionLevel) + public static void MoveThinLockToNewEntry(int syncIndex, int threadId, uint recursionLevel) { - Debug.Assert(s_lock.IsAcquired); + Debug.Assert(s_lock.IsHeldByCurrentThread); Debug.Assert((0 < syncIndex) && (syncIndex < s_unusedEntryIndex)); s_entries[syncIndex].Lock.InitializeLocked(threadId, recursionLevel); @@ -305,7 +305,7 @@ public DeadEntryCollector() Lock? lockToDispose = default; DependentHandle dependentHandleToDispose = default; - using (LockHolder.Hold(s_lock)) + using (s_lock.EnterScope()) { ref Entry entry = ref s_entries[_index]; diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Thread.NativeAot.Windows.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Thread.NativeAot.Windows.cs index 467e13cfd60338..7d8c2f2a2f290f 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Thread.NativeAot.Windows.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Thread.NativeAot.Windows.cs @@ -251,7 +251,7 @@ private bool SetApartmentStateUnchecked(ApartmentState state, bool throwOnError) if (this != CurrentThread) { - using (LockHolder.Hold(_lock)) + using (_lock.EnterScope()) { if (HasStarted()) throw new ThreadStateException(); diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Thread.NativeAot.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Thread.NativeAot.cs index cda114276746c8..ef35ed5358fafc 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Thread.NativeAot.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Threading/Thread.NativeAot.cs @@ -230,7 +230,7 @@ public ThreadPriority Priority } // Prevent race condition with starting this thread - using (LockHolder.Hold(_lock)) + using (_lock.EnterScope()) { if (HasStarted() && !SetPriorityLive(value)) { @@ -358,7 +358,7 @@ public static void SpinWait(int iterations) private void StartCore() { - using (LockHolder.Hold(_lock)) + using (_lock.EnterScope()) { if (!GetThreadStateBit(ThreadState.Unstarted)) { diff --git a/src/coreclr/nativeaot/System.Private.DisabledReflection/src/System.Private.DisabledReflection.csproj b/src/coreclr/nativeaot/System.Private.DisabledReflection/src/System.Private.DisabledReflection.csproj index 163f809979cc42..25af7c63691ee8 100644 --- a/src/coreclr/nativeaot/System.Private.DisabledReflection/src/System.Private.DisabledReflection.csproj +++ b/src/coreclr/nativeaot/System.Private.DisabledReflection/src/System.Private.DisabledReflection.csproj @@ -2,6 +2,8 @@ false + + true diff --git a/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/System.Private.Reflection.Execution.csproj b/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/System.Private.Reflection.Execution.csproj index 5527d5920f6018..2610014e0d3c14 100644 --- a/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/System.Private.Reflection.Execution.csproj +++ b/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/System.Private.Reflection.Execution.csproj @@ -8,6 +8,8 @@ $(CompilerCommonPath)\Internal\NativeFormat false + + true diff --git a/src/coreclr/nativeaot/System.Private.StackTraceMetadata/src/System.Private.StackTraceMetadata.csproj b/src/coreclr/nativeaot/System.Private.StackTraceMetadata/src/System.Private.StackTraceMetadata.csproj index cc44031e9ac552..620a94d91c40ab 100644 --- a/src/coreclr/nativeaot/System.Private.StackTraceMetadata/src/System.Private.StackTraceMetadata.csproj +++ b/src/coreclr/nativeaot/System.Private.StackTraceMetadata/src/System.Private.StackTraceMetadata.csproj @@ -2,6 +2,8 @@ false + + true diff --git a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.ConstructedGenericMethodsLookup.cs b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.ConstructedGenericMethodsLookup.cs index 9fe72daf5045db..228da851da728f 100644 --- a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.ConstructedGenericMethodsLookup.cs +++ b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.ConstructedGenericMethodsLookup.cs @@ -274,7 +274,7 @@ public bool TryGetGenericVirtualMethodPointer(InstantiatedMethod method, out Int if (!TryLookupGenericMethodDictionary(new MethodDescBasedGenericMethodLookup(method), out dictionaryPointer)) { - using (LockHolder.Hold(_typeLoaderLock)) + using (_typeLoaderLock.EnterScope()) { // Now that we hold the lock, we may find that existing types can now find // their associated RuntimeTypeHandle. Flush the type builder states as a way @@ -297,7 +297,7 @@ private bool TryGetDynamicGenericMethodDictionary(GenericMethodLookupData lookup { result = IntPtr.Zero; - using (LockHolder.Hold(_dynamicGenericsLock)) + using (_dynamicGenericsLock.EnterScope()) { GenericMethodEntry entry; if (!_dynamicGenericMethods.TryGetValue(lookupData, out entry)) @@ -349,7 +349,7 @@ private bool TryGetDynamicGenericMethodComponents(IntPtr methodDictionary, out R methodNameAndSignature = null; genericMethodArgumentHandles = null; - using (LockHolder.Hold(_dynamicGenericsLock)) + using (_dynamicGenericsLock.EnterScope()) { GenericMethodEntry entry; if (!_dynamicGenericMethodComponents.TryGetValue(methodDictionary, out entry)) diff --git a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.ConstructedGenericTypesLookup.cs b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.ConstructedGenericTypesLookup.cs index 2db0a24b5586d9..257803bd9026ef 100644 --- a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.ConstructedGenericTypesLookup.cs +++ b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.ConstructedGenericTypesLookup.cs @@ -217,7 +217,7 @@ public bool TryLookupConstructedGenericTypeForComponents(RuntimeTypeHandle gener public bool TryLookupConstructedLazyDictionaryForContext(IntPtr context, IntPtr signature, out IntPtr dictionary) { - Debug.Assert(_typeLoaderLock.IsAcquired); + Debug.Assert(_typeLoaderLock.IsHeldByCurrentThread); return _lazyGenericDictionaries.TryGetValue(new LazyDictionaryContext { _context = context, _signature = signature }, out dictionary); } @@ -226,7 +226,7 @@ private unsafe bool TryGetDynamicGenericTypeForComponents(GenericTypeLookupData { runtimeTypeHandle = default(RuntimeTypeHandle); - using (LockHolder.Hold(_dynamicGenericsLock)) + using (_dynamicGenericsLock.EnterScope()) { GenericTypeEntry entry; if (!_dynamicGenericTypes.TryGetValue(lookupData, out entry)) diff --git a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.ConstructedGenericsRegistration.cs b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.ConstructedGenericsRegistration.cs index 8c9922d1a29c73..cebd5d917896fe 100644 --- a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.ConstructedGenericsRegistration.cs +++ b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.ConstructedGenericsRegistration.cs @@ -28,7 +28,7 @@ internal struct DynamicGenericsRegistrationData internal void RegisterDynamicGenericTypesAndMethods(DynamicGenericsRegistrationData registrationData) { - using (LockHolder.Hold(_dynamicGenericsLock)) + using (_dynamicGenericsLock.EnterScope()) { int registeredTypesCount = 0; int registeredMethodsCount = 0; @@ -130,7 +130,7 @@ internal void RegisterDynamicGenericTypesAndMethods(DynamicGenericsRegistrationD public void RegisterConstructedLazyDictionaryForContext(IntPtr context, IntPtr signature, IntPtr dictionary) { - Debug.Assert(_typeLoaderLock.IsAcquired); + Debug.Assert(_typeLoaderLock.IsHeldByCurrentThread); _lazyGenericDictionaries.Add(new LazyDictionaryContext { _context = context, _signature = signature }, dictionary); } } diff --git a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.LdTokenResultLookup.cs b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.LdTokenResultLookup.cs index 8cc5e5844218fa..ad8c68b171e5c0 100644 --- a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.LdTokenResultLookup.cs +++ b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.LdTokenResultLookup.cs @@ -57,7 +57,7 @@ private static unsafe string GetStringFromMemoryInNativeFormat(IntPtr pointerToD /// public IntPtr GetNativeFormatStringForString(string str) { - using (LockHolder.Hold(_typeLoaderLock)) + using (_typeLoaderLock.EnterScope()) { IntPtr result; if (_nativeFormatStrings.TryGetValue(str, out result)) diff --git a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.StaticsLookup.cs b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.StaticsLookup.cs index 4a28836cb33ce9..28cd9bf3276380 100644 --- a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.StaticsLookup.cs +++ b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.StaticsLookup.cs @@ -145,7 +145,7 @@ public IntPtr TryGetThreadStaticFieldData(RuntimeTypeHandle runtimeTypeHandle) public IntPtr GetThreadStaticGCDescForDynamicType(TypeManagerHandle typeManagerHandle, uint index) { - using (LockHolder.Hold(_threadStaticsLock)) + using (_threadStaticsLock.EnterScope()) { return _dynamicGenericsThreadStaticDescs[typeManagerHandle.GetIntPtrUNSAFE()][index]; } @@ -168,7 +168,7 @@ public void RegisterDynamicThreadStaticsInfo(RuntimeTypeHandle runtimeTypeHandle IntPtr typeManager = runtimeTypeHandle.GetTypeManager().GetIntPtrUNSAFE(); - _threadStaticsLock.Acquire(); + _threadStaticsLock.Enter(); try { if (!_dynamicGenericsThreadStaticDescs.TryGetValue(typeManager, out LowLevelDictionary gcDescs)) @@ -188,7 +188,7 @@ public void RegisterDynamicThreadStaticsInfo(RuntimeTypeHandle runtimeTypeHandle } } - _threadStaticsLock.Release(); + _threadStaticsLock.Exit(); } } #endregion diff --git a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.cs b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.cs index ab037c2b41e39c..1bd3cbd3672fac 100644 --- a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.cs +++ b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.cs @@ -144,13 +144,13 @@ internal static void Initialize() public void VerifyTypeLoaderLockHeld() { - if (!_typeLoaderLock.IsAcquired) + if (!_typeLoaderLock.IsHeldByCurrentThread) Environment.FailFast("TypeLoaderLock not held"); } public void RunUnderTypeLoaderLock(Action action) { - using (LockHolder.Hold(_typeLoaderLock)) + using (_typeLoaderLock.EnterScope()) { action(); } @@ -160,7 +160,7 @@ public IntPtr GenericLookupFromContextAndSignature(IntPtr context, IntPtr signat { IntPtr result; - using (LockHolder.Hold(_typeLoaderLock)) + using (_typeLoaderLock.EnterScope()) { try { @@ -191,7 +191,7 @@ private bool EnsureTypeHandleForType(TypeDesc type) { if (type.RuntimeTypeHandle.IsNull()) { - using (LockHolder.Hold(_typeLoaderLock)) + using (_typeLoaderLock.EnterScope()) { // Now that we hold the lock, we may find that existing types can now find // their associated RuntimeTypeHandle. Flush the type builder states as a way @@ -340,7 +340,7 @@ public bool TryGetConstructedGenericTypeForComponents(RuntimeTypeHandle genericT if (TryLookupConstructedGenericTypeForComponents(genericTypeDefinitionHandle, genericTypeArgumentHandles, out runtimeTypeHandle)) return true; - using (LockHolder.Hold(_typeLoaderLock)) + using (_typeLoaderLock.EnterScope()) { return TypeBuilder.TryBuildGenericType(genericTypeDefinitionHandle, genericTypeArgumentHandles, out runtimeTypeHandle); } @@ -351,7 +351,7 @@ public bool TryGetFunctionPointerTypeForComponents(RuntimeTypeHandle returnTypeH if (TryLookupFunctionPointerTypeForComponents(returnTypeHandle, parameterHandles, isUnmanaged, out runtimeTypeHandle)) return true; - using (LockHolder.Hold(_typeLoaderLock)) + using (_typeLoaderLock.EnterScope()) { return TypeBuilder.TryBuildFunctionPointerType(returnTypeHandle, parameterHandles, isUnmanaged, out runtimeTypeHandle); } @@ -390,7 +390,7 @@ public bool TryGetArrayTypeForElementType(RuntimeTypeHandle elementTypeHandle, b return true; } - using (LockHolder.Hold(_typeLoaderLock)) + using (_typeLoaderLock.EnterScope()) { if (isMdArray && (rank < MDArray.MinRank) && (rank > MDArray.MaxRank)) { @@ -432,7 +432,7 @@ public bool TryGetPointerTypeForTargetType(RuntimeTypeHandle pointeeTypeHandle, if (TryGetPointerTypeForTargetType_LookupOnly(pointeeTypeHandle, out pointerTypeHandle)) return true; - using (LockHolder.Hold(_typeLoaderLock)) + using (_typeLoaderLock.EnterScope()) { if (TypeSystemContext.PointerTypesCache.TryGetValue(pointeeTypeHandle, out pointerTypeHandle)) return true; @@ -461,7 +461,7 @@ public bool TryGetByRefTypeForTargetType(RuntimeTypeHandle pointeeTypeHandle, ou if (TryGetByRefTypeForTargetType_LookupOnly(pointeeTypeHandle, out byRefTypeHandle)) return true; - using (LockHolder.Hold(_typeLoaderLock)) + using (_typeLoaderLock.EnterScope()) { if (TypeSystemContext.ByRefTypesCache.TryGetValue(pointeeTypeHandle, out byRefTypeHandle)) return true; @@ -525,7 +525,7 @@ public bool TryGetGenericMethodDictionaryForComponents(RuntimeTypeHandle declari return true; } - using (LockHolder.Hold(_typeLoaderLock)) + using (_typeLoaderLock.EnterScope()) { bool success = TypeBuilder.TryBuildGenericMethod(methodBeingLoaded, out methodDictionary); diff --git a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeSystemContextFactory.cs b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeSystemContextFactory.cs index 4d3fa768fdd2d6..b0175eaaa48034 100644 --- a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeSystemContextFactory.cs +++ b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeSystemContextFactory.cs @@ -22,7 +22,7 @@ public static class TypeSystemContextFactory public static TypeSystemContext Create() { - using (LockHolder.Hold(s_lock)) + using (s_lock.EnterScope()) { TypeSystemContext context = (TypeSystemContext)s_cachedContext.Target; if (context != null) diff --git a/src/coreclr/nativeaot/System.Private.TypeLoader/src/System.Private.TypeLoader.csproj b/src/coreclr/nativeaot/System.Private.TypeLoader/src/System.Private.TypeLoader.csproj index 61799cfc159b1f..b25a5cfcf7d364 100644 --- a/src/coreclr/nativeaot/System.Private.TypeLoader/src/System.Private.TypeLoader.csproj +++ b/src/coreclr/nativeaot/System.Private.TypeLoader/src/System.Private.TypeLoader.csproj @@ -9,6 +9,8 @@ GENERICS_FORCE_USG;$(DefineConstants) false + + true diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Threading.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Threading.cs index 9fe84d213e290c..edcdaf3ee9f852 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Threading.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Threading.cs @@ -11,5 +11,13 @@ internal unsafe partial class Sys [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_CreateThread")] [return: MarshalAs(UnmanagedType.Bool)] internal static unsafe partial bool CreateThread(IntPtr stackSize, delegate* unmanaged startAddress, IntPtr parameter); + +#if TARGET_OSX + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetUInt64OSThreadId")] + internal static unsafe partial ulong GetUInt64OSThreadId(); +#else + [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_TryGetUInt32OSThreadId")] + internal static unsafe partial uint TryGetUInt32OSThreadId(); +#endif } } diff --git a/src/libraries/System.ComponentModel.Composition.Registration/src/System.ComponentModel.Composition.Registration.csproj b/src/libraries/System.ComponentModel.Composition.Registration/src/System.ComponentModel.Composition.Registration.csproj index b8ae87f03d00b9..66378b9fac149a 100644 --- a/src/libraries/System.ComponentModel.Composition.Registration/src/System.ComponentModel.Composition.Registration.csproj +++ b/src/libraries/System.ComponentModel.Composition.Registration/src/System.ComponentModel.Composition.Registration.csproj @@ -27,8 +27,8 @@ System.ComponentModel.Composition.Registration.ExportBuilder - + diff --git a/src/libraries/System.ComponentModel.Composition.Registration/src/System/ComponentModel/Composition/Registration/RegistrationBuilder.cs b/src/libraries/System.ComponentModel.Composition.Registration/src/System/ComponentModel/Composition/Registration/RegistrationBuilder.cs index c684ababe674eb..5397b13063aa4a 100644 --- a/src/libraries/System.ComponentModel.Composition.Registration/src/System/ComponentModel/Composition/Registration/RegistrationBuilder.cs +++ b/src/libraries/System.ComponentModel.Composition.Registration/src/System/ComponentModel/Composition/Registration/RegistrationBuilder.cs @@ -20,7 +20,7 @@ internal sealed class InnerRC : ReflectionContext private static readonly ReflectionContext s_inner = new InnerRC(); private static readonly List s_emptyList = new List(); - private readonly Lock _lock = new Lock(); + private readonly ReadWriteLock _lock = new ReadWriteLock(); private readonly List _conventions = new List(); private readonly Dictionary> _memberInfos = new Dictionary>(); diff --git a/src/libraries/System.ComponentModel.Composition.Registration/src/System/Threading/ReadLock.cs b/src/libraries/System.ComponentModel.Composition.Registration/src/System/Threading/ReadLock.cs index b60130e6378b5b..40b1dcf7523ee6 100644 --- a/src/libraries/System.ComponentModel.Composition.Registration/src/System/Threading/ReadLock.cs +++ b/src/libraries/System.ComponentModel.Composition.Registration/src/System/Threading/ReadLock.cs @@ -5,10 +5,10 @@ namespace System.Threading { internal struct ReadLock : IDisposable { - private readonly Lock _lock; + private readonly ReadWriteLock _lock; private int _isDisposed; - public ReadLock(Lock @lock) + public ReadLock(ReadWriteLock @lock) { _isDisposed = 0; _lock = @lock; diff --git a/src/libraries/System.ComponentModel.Composition.Registration/src/System/Threading/Lock.cs b/src/libraries/System.ComponentModel.Composition.Registration/src/System/Threading/ReadWriteLock.cs similarity index 94% rename from src/libraries/System.ComponentModel.Composition.Registration/src/System/Threading/Lock.cs rename to src/libraries/System.ComponentModel.Composition.Registration/src/System/Threading/ReadWriteLock.cs index 8d5101922df7ab..6f02e3db4c5546 100644 --- a/src/libraries/System.ComponentModel.Composition.Registration/src/System/Threading/Lock.cs +++ b/src/libraries/System.ComponentModel.Composition.Registration/src/System/Threading/ReadWriteLock.cs @@ -3,7 +3,7 @@ namespace System.Threading { - internal sealed class Lock : IDisposable + internal sealed class ReadWriteLock : IDisposable { private readonly ReaderWriterLockSlim _thisLock = new ReaderWriterLockSlim(LockRecursionPolicy.NoRecursion); private int _isDisposed; diff --git a/src/libraries/System.ComponentModel.Composition.Registration/src/System/Threading/WriteLock.cs b/src/libraries/System.ComponentModel.Composition.Registration/src/System/Threading/WriteLock.cs index 0c68d24b956dbc..dbd68c6af36e8a 100644 --- a/src/libraries/System.ComponentModel.Composition.Registration/src/System/Threading/WriteLock.cs +++ b/src/libraries/System.ComponentModel.Composition.Registration/src/System/Threading/WriteLock.cs @@ -5,10 +5,10 @@ namespace System.Threading { internal struct WriteLock : IDisposable { - private readonly Lock _lock; + private readonly ReadWriteLock _lock; private int _isDisposed; - public WriteLock(Lock @lock) + public WriteLock(ReadWriteLock @lock) { _isDisposed = 0; _lock = @lock; diff --git a/src/libraries/System.ComponentModel.Composition/src/Microsoft/Internal/Lock.Reader.cs b/src/libraries/System.ComponentModel.Composition/src/Microsoft/Internal/Lock.Reader.cs index e7a388afa265a4..77f2a6f3892739 100644 --- a/src/libraries/System.ComponentModel.Composition/src/Microsoft/Internal/Lock.Reader.cs +++ b/src/libraries/System.ComponentModel.Composition/src/Microsoft/Internal/Lock.Reader.cs @@ -8,10 +8,10 @@ namespace Microsoft.Internal { internal struct ReadLock : IDisposable { - private readonly Lock _lock; + private readonly ReadWriteLock _lock; private int _isDisposed; - public ReadLock(Lock @lock) + public ReadLock(ReadWriteLock @lock) { _isDisposed = 0; _lock = @lock; diff --git a/src/libraries/System.ComponentModel.Composition/src/Microsoft/Internal/Lock.cs b/src/libraries/System.ComponentModel.Composition/src/Microsoft/Internal/Lock.ReaderWriter.cs similarity index 94% rename from src/libraries/System.ComponentModel.Composition/src/Microsoft/Internal/Lock.cs rename to src/libraries/System.ComponentModel.Composition/src/Microsoft/Internal/Lock.ReaderWriter.cs index 044b2dc691c32e..d799d56961992d 100644 --- a/src/libraries/System.ComponentModel.Composition/src/Microsoft/Internal/Lock.cs +++ b/src/libraries/System.ComponentModel.Composition/src/Microsoft/Internal/Lock.ReaderWriter.cs @@ -6,7 +6,7 @@ namespace Microsoft.Internal { - internal sealed class Lock : IDisposable + internal sealed class ReadWriteLock : IDisposable { private readonly ReaderWriterLockSlim _thisLock = new ReaderWriterLockSlim(LockRecursionPolicy.NoRecursion); private int _isDisposed; diff --git a/src/libraries/System.ComponentModel.Composition/src/Microsoft/Internal/Lock.Writer.cs b/src/libraries/System.ComponentModel.Composition/src/Microsoft/Internal/Lock.Writer.cs index a7137c28a379b4..ca6cfd7abb6bb4 100644 --- a/src/libraries/System.ComponentModel.Composition/src/Microsoft/Internal/Lock.Writer.cs +++ b/src/libraries/System.ComponentModel.Composition/src/Microsoft/Internal/Lock.Writer.cs @@ -8,10 +8,10 @@ namespace Microsoft.Internal { internal struct WriteLock : IDisposable { - private readonly Lock _lock; + private readonly ReadWriteLock _lock; private int _isDisposed; - public WriteLock(Lock @lock) + public WriteLock(ReadWriteLock @lock) { _isDisposed = 0; _lock = @lock; diff --git a/src/libraries/System.ComponentModel.Composition/src/System.ComponentModel.Composition.csproj b/src/libraries/System.ComponentModel.Composition/src/System.ComponentModel.Composition.csproj index 0c043fd8a11c8a..aae409d311531d 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System.ComponentModel.Composition.csproj +++ b/src/libraries/System.ComponentModel.Composition/src/System.ComponentModel.Composition.csproj @@ -41,8 +41,8 @@ System.ComponentModel.Composition.ReflectionModel.ReflectionModelServices - + diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ComposablePartCatalogCollection.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ComposablePartCatalogCollection.cs index 810834261e25c0..5264003442603a 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ComposablePartCatalogCollection.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/ComposablePartCatalogCollection.cs @@ -19,7 +19,7 @@ namespace System.ComponentModel.Composition.Hosting /// internal sealed class ComposablePartCatalogCollection : ICollection, INotifyComposablePartCatalogChanged, IDisposable { - private readonly Lock _lock = new Lock(); + private readonly ReadWriteLock _lock = new ReadWriteLock(); private readonly Action? _onChanged; private readonly Action? _onChanging; private List _catalogs = new List(); diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CompositionLock.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CompositionLock.cs index 0b6de9492e37b4..53ea59b8fab3ef 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CompositionLock.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CompositionLock.cs @@ -22,7 +22,7 @@ namespace System.ComponentModel.Composition.Hosting internal sealed class CompositionLock : IDisposable { // narrow lock - private readonly Lock? _stateLock; + private readonly ReadWriteLock? _stateLock; // wide lock private static readonly object _compositionLock = new object(); @@ -36,7 +36,7 @@ public CompositionLock(bool isThreadSafe) _isThreadSafe = isThreadSafe; if (isThreadSafe) { - _stateLock = new Lock(); + _stateLock = new ReadWriteLock(); } } diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/DirectoryCatalog.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/DirectoryCatalog.cs index 0694fb819d5350..201ccada3e5f53 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/DirectoryCatalog.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/DirectoryCatalog.cs @@ -28,7 +28,7 @@ public partial class DirectoryCatalog : ComposablePartCatalog, INotifyComposable RuntimeInformation.IsOSPlatform(OSPlatform.Windows); #endif - private readonly Lock _thisLock = new Lock(); + private readonly ReadWriteLock _thisLock = new ReadWriteLock(); private readonly ICompositionElement? _definitionOrigin; private ComposablePartCatalogCollection _catalogCollection; private Dictionary _assemblyCatalogs; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/MetadataViewGenerator.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/MetadataViewGenerator.cs index 47640c87d93875..c4331dc1ec0c54 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/MetadataViewGenerator.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/MetadataViewGenerator.cs @@ -65,7 +65,7 @@ internal static class MetadataViewGenerator public const string MetadataItemValue = "MetadataItemValue"; public const string MetadataViewFactoryName = "Create"; - private static readonly Lock _lock = new Lock(); + private static readonly ReadWriteLock _lock = new ReadWriteLock(); private static readonly Dictionary _metadataViewFactories = new Dictionary(); private static readonly AssemblyName ProxyAssemblyName = new AssemblyName($"MetadataViewProxies_{Guid.NewGuid()}"); private static ModuleBuilder? transparentProxyModuleBuilder; diff --git a/src/libraries/System.Private.CoreLib/src/Resources/Strings.resx b/src/libraries/System.Private.CoreLib/src/Resources/Strings.resx index 540dc62f309186..007ffdbdc6fed4 100644 --- a/src/libraries/System.Private.CoreLib/src/Resources/Strings.resx +++ b/src/libraries/System.Private.CoreLib/src/Resources/Strings.resx @@ -3434,7 +3434,13 @@ Setter must have parameters. - + + The lock has reached the limit of recursive enters. + + + The lock has reached the limit of how many threads may wait for the lock. + + The calling thread does not hold the lock. diff --git a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems index 6998e54610c793..499142574857f4 100644 --- a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems +++ b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems @@ -1202,6 +1202,8 @@ + + @@ -1790,8 +1792,8 @@ Common\Interop\Windows\Kernel32\Interop.GetCurrentProcessId.cs - - Interop\Windows\Kernel32\Interop.GetCurrentThreadId.cs + + Common\Interop\Windows\Kernel32\Interop.GetCurrentThreadId.cs Common\Interop\Windows\Kernel32\Interop.GetFileAttributesEx.cs @@ -2407,6 +2409,9 @@ Common\Interop\Unix\System.Native\Interop.SysLog.cs + + Common\Interop\Unix\System.Native\Interop.Threading.cs + Common\Interop\Unix\System.Native\Interop.Unlink.cs diff --git a/src/libraries/System.Private.CoreLib/src/System/AppContextConfigHelper.cs b/src/libraries/System.Private.CoreLib/src/System/AppContextConfigHelper.cs index efbe9e691625d7..c16f72184736b1 100644 --- a/src/libraries/System.Private.CoreLib/src/System/AppContextConfigHelper.cs +++ b/src/libraries/System.Private.CoreLib/src/System/AppContextConfigHelper.cs @@ -7,18 +7,25 @@ namespace System { internal static class AppContextConfigHelper { - internal static bool GetBooleanConfig(string configName, bool defaultValue) => - AppContext.TryGetSwitch(configName, out bool value) ? value : defaultValue; + internal static bool GetBooleanConfig(string switchName, bool defaultValue) => + AppContext.TryGetSwitch(switchName, out bool value) ? value : defaultValue; internal static bool GetBooleanConfig(string switchName, string envVariable, bool defaultValue = false) { - if (!AppContext.TryGetSwitch(switchName, out bool ret)) + string? str = Environment.GetEnvironmentVariable(envVariable); + if (str != null) { - string? switchValue = Environment.GetEnvironmentVariable(envVariable); - ret = switchValue != null ? (bool.IsTrueStringIgnoreCase(switchValue) || switchValue.Equals("1")) : defaultValue; + if (str.Equals("1", StringComparison.Ordinal) || bool.IsTrueStringIgnoreCase(str)) + { + return true; + } + if (str.Equals("0", StringComparison.Ordinal) || bool.IsFalseStringIgnoreCase(str)) + { + return false; + } } - return ret; + return GetBooleanConfig(switchName, defaultValue); } internal static int GetInt32Config(string configName, int defaultValue, bool allowNegative = true) diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/NativeRuntimeEventSource.Threading.NativeSinks.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/NativeRuntimeEventSource.Threading.NativeSinks.cs index ad7ee54ae227a4..1cf9b4fecd6dbc 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/NativeRuntimeEventSource.Threading.NativeSinks.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/NativeRuntimeEventSource.Threading.NativeSinks.cs @@ -83,6 +83,12 @@ private void ContentionLockCreated(nint LockID, nint AssociatedObjectID, ushort LogContentionLockCreated(LockID, AssociatedObjectID, ClrInstanceID); } +#pragma warning disable CA2252 // Opt in to preview features before using them (Lock) + [NonEvent] + [MethodImpl(MethodImplOptions.NoInlining)] + public void ContentionLockCreated(Lock lockObj) => ContentionLockCreated(lockObj.LockIdForEvents, lockObj.ObjectIdForEvents); +#pragma warning restore CA2252 + [Event(81, Level = EventLevel.Informational, Message = Messages.ContentionStart, Task = Tasks.Contention, Opcode = EventOpcode.Start, Version = 2, Keywords = Keywords.ContentionKeyword)] private void ContentionStart( ContentionFlagsMap ContentionFlags, @@ -95,6 +101,18 @@ private void ContentionStart( LogContentionStart(ContentionFlags, ClrInstanceID, LockID, AssociatedObjectID, LockOwnerThreadID); } +#pragma warning disable CA2252 // Opt in to preview features before using them (Lock) + [NonEvent] + [MethodImpl(MethodImplOptions.NoInlining)] + public void ContentionStart(Lock lockObj) => + ContentionStart( + ContentionFlagsMap.Managed, + DefaultClrInstanceId, + lockObj.LockIdForEvents, + lockObj.ObjectIdForEvents, + lockObj.OwningThreadId); +#pragma warning restore CA2252 + [Event(91, Level = EventLevel.Informational, Message = Messages.ContentionStop, Task = Tasks.Contention, Opcode = EventOpcode.Stop, Version = 1, Keywords = Keywords.ContentionKeyword)] private void ContentionStop(ContentionFlagsMap ContentionFlags, ushort ClrInstanceID, double DurationNs) { diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/NativeRuntimeEventSource.Threading.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/NativeRuntimeEventSource.Threading.cs index c7a6d96aab2ba2..668547832733ea 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/NativeRuntimeEventSource.Threading.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/NativeRuntimeEventSource.Threading.cs @@ -95,6 +95,12 @@ private unsafe void ContentionLockCreated(nint LockID, nint AssociatedObjectID, WriteEventCore(90, 3, data); } +#pragma warning disable CA2252 // Opt in to preview features before using them (Lock) + [NonEvent] + [MethodImpl(MethodImplOptions.NoInlining)] + public void ContentionLockCreated(Lock lockObj) => ContentionLockCreated(lockObj.LockIdForEvents, lockObj.ObjectIdForEvents); +#pragma warning restore CA2252 + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:UnrecognizedReflectionPattern", Justification = "Parameters to this method are primitive and are trimmer safe")] [Event(81, Level = EventLevel.Informational, Message = Messages.ContentionStart, Task = Tasks.Contention, Opcode = EventOpcode.Start, Version = 2, Keywords = Keywords.ContentionKeyword)] private unsafe void ContentionStart( @@ -125,6 +131,18 @@ private unsafe void ContentionStart( WriteEventCore(81, 3, data); } +#pragma warning disable CA2252 // Opt in to preview features before using them (Lock) + [NonEvent] + [MethodImpl(MethodImplOptions.NoInlining)] + public void ContentionStart(Lock lockObj) => + ContentionStart( + ContentionFlagsMap.Managed, + DefaultClrInstanceId, + lockObj.LockIdForEvents, + lockObj.ObjectIdForEvents, + lockObj.OwningThreadId); +#pragma warning restore CA2252 + [UnconditionalSuppressMessage("ReflectionAnalysis", "IL2026:UnrecognizedReflectionPattern", Justification = "Parameters to this method are primitive and are trimmer safe")] [Event(91, Level = EventLevel.Informational, Message = Messages.ContentionStop, Task = Tasks.Contention, Opcode = EventOpcode.Stop, Version = 1, Keywords = Keywords.ContentionKeyword)] private unsafe void ContentionStop(ContentionFlagsMap ContentionFlags, ushort ClrInstanceID, double DurationNs) diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Lock.NonNativeAot.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Lock.NonNativeAot.cs new file mode 100644 index 00000000000000..9386b7ed174601 --- /dev/null +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Lock.NonNativeAot.cs @@ -0,0 +1,74 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Diagnostics; +using System.Runtime.CompilerServices; + +namespace System.Threading +{ + public sealed partial class Lock + { + private static readonly short s_maxSpinCount = DetermineMaxSpinCount(); + private static readonly short s_minSpinCount = DetermineMinSpinCount(); + + /// + /// Initializes a new instance of the class. + /// + public Lock() => _spinCount = s_maxSpinCount; + + private static TryLockResult LazyInitializeOrEnter() => TryLockResult.Spin; + private static bool IsSingleProcessor => Environment.IsSingleProcessor; + + internal partial struct ThreadId + { +#if TARGET_OSX + [ThreadStatic] + private static ulong t_threadId; + + private ulong _id; + + public ThreadId(ulong id) => _id = id; + public ulong Id => _id; +#else + [ThreadStatic] + private static uint t_threadId; + + private uint _id; + + public ThreadId(uint id) => _id = id; + public uint Id => _id; +#endif + + public bool IsInitialized => _id != 0; + public static ThreadId Current_NoInitialize => new ThreadId(t_threadId); + + public void InitializeForCurrentThread() + { + Debug.Assert(!IsInitialized); + Debug.Assert(t_threadId == 0); + +#if TARGET_WINDOWS + uint id = (uint)Interop.Kernel32.GetCurrentThreadId(); +#elif TARGET_OSX + ulong id = Interop.Sys.GetUInt64OSThreadId(); +#else + uint id = Interop.Sys.TryGetUInt32OSThreadId(); + if (id == unchecked((uint)-1)) + { + id = (uint)Environment.CurrentManagedThreadId; + Debug.Assert(id != 0); + } + else +#endif + + if (id == 0) + { + id--; + } + + t_threadId = _id = id; + Debug.Assert(IsInitialized); + } + } + } +} diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Lock.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Lock.cs new file mode 100644 index 00000000000000..0d7380d48b5a1e --- /dev/null +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Lock.cs @@ -0,0 +1,1241 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Diagnostics; +using System.Diagnostics.Tracing; +using System.Runtime.CompilerServices; + +namespace System.Threading +{ + /// + /// Provides a way to get mutual exclusion in regions of code between different threads. A lock may be held by one thread at + /// a time. + /// + /// + /// Threads that cannot immediately enter the lock may wait for the lock to be exited or until a specified timeout. A thread + /// that holds a lock may enter the lock repeatedly without exiting it, such as recursively, in which case the thread should + /// eventually exit the lock the same number of times to fully exit the lock and allow other threads to enter the lock. + /// + [Runtime.Versioning.RequiresPreviewFeatures] + public sealed partial class Lock + { + private const short DefaultMaxSpinCount = 22; + private const short DefaultAdaptiveSpinPeriod = 100; + private const short SpinSleep0Threshold = 10; + private const ushort MaxDurationMsForPreemptingWaiters = 100; + + private static long s_contentionCount; + + // The field's type is not ThreadId to try to retain the relative order of fields of intrinsic types. The type system + // appears to place struct fields after fields of other types, in which case there can be a greater chance that + // _owningThreadId is not in the same cache line as _state. +#if TARGET_OSX && !NATIVEAOT + private ulong _owningThreadId; +#else + private uint _owningThreadId; +#endif + + private uint _state; // see State for layout + private uint _recursionCount; + private short _spinCount; + private ushort _waiterStartTimeMs; + private AutoResetEvent? _waitEvent; + + /// + /// Enters the lock. Once the method returns, the calling thread would be the only thread that holds the lock. + /// + /// + /// If the lock cannot be entered immediately, the calling thread waits for the lock to be exited. If the lock is + /// already held by the calling thread, the lock is entered again. The calling thread should exit the lock as many times + /// as it had entered the lock to fully exit the lock and allow other threads to enter the lock. + /// + /// + /// The lock has reached the limit of recursive enters. The limit is implementation-defined, but is expected to be high + /// enough that it would typically not be reached when the lock is used properly. + /// + [MethodImpl(MethodImplOptions.NoInlining)] + public void Enter() + { + ThreadId currentThreadId = TryEnter_Inlined(timeoutMs: -1); + Debug.Assert(currentThreadId.IsInitialized); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + private ThreadId EnterAndGetCurrentThreadId() + { + ThreadId currentThreadId = TryEnter_Inlined(timeoutMs: -1); + Debug.Assert(currentThreadId.IsInitialized); + Debug.Assert(currentThreadId.Id == _owningThreadId); + return currentThreadId; + } + + /// + /// Enters the lock and returns a that may be disposed to exit the lock. Once the method returns, + /// the calling thread would be the only thread that holds the lock. This method is intended to be used along with a + /// language construct that would automatically dispose the , such as with the C# using + /// statement. + /// + /// + /// A that may be disposed to exit the lock. + /// + /// + /// If the lock cannot be entered immediately, the calling thread waits for the lock to be exited. If the lock is + /// already held by the calling thread, the lock is entered again. The calling thread should exit the lock, such as by + /// disposing the returned , as many times as it had entered the lock to fully exit the lock and + /// allow other threads to enter the lock. + /// + /// + /// The lock has reached the limit of recursive enters. The limit is implementation-defined, but is expected to be high + /// enough that it would typically not be reached when the lock is used properly. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public Scope EnterScope() => new Scope(this, EnterAndGetCurrentThreadId()); + + /// + /// A disposable structure that is returned by , which when disposed, exits the lock. + /// + public ref struct Scope + { + private Lock? _lockObj; + private ThreadId _currentThreadId; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + internal Scope(Lock lockObj, ThreadId currentThreadId) + { + _lockObj = lockObj; + _currentThreadId = currentThreadId; + } + + /// + /// Exits the lock. + /// + /// + /// If the calling thread holds the lock multiple times, such as recursively, the lock is exited only once. The + /// calling thread should ensure that each enter is matched with an exit. + /// + /// + /// The calling thread does not hold the lock. + /// + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public void Dispose() + { + Lock? lockObj = _lockObj; + if (lockObj != null) + { + _lockObj = null; + lockObj.Exit(_currentThreadId); + } + } + } + + /// + /// Tries to enter the lock without waiting. If the lock is entered, the calling thread would be the only thread that + /// holds the lock. + /// + /// + /// true if the lock was entered, false otherwise. + /// + /// + /// If the lock cannot be entered immediately, the method returns false. If the lock is already held by the + /// calling thread, the lock is entered again. The calling thread should exit the lock as many times as it had entered + /// the lock to fully exit the lock and allow other threads to enter the lock. + /// + /// + /// The lock has reached the limit of recursive enters. The limit is implementation-defined, but is expected to be high + /// enough that it would typically not be reached when the lock is used properly. + /// + [MethodImpl(MethodImplOptions.NoInlining)] + public bool TryEnter() => TryEnter_Inlined(timeoutMs: 0).IsInitialized; + + /// + /// Tries to enter the lock, waiting for roughly the specified duration. If the lock is entered, the calling thread + /// would be the only thread that holds the lock. + /// + /// + /// The rough duration in milliseconds for which the method will wait if the lock is not available. A value of + /// 0 specifies that the method should not wait, and a value of or + /// -1 specifies that the method should wait indefinitely until the lock is entered. + /// + /// + /// true if the lock was entered, false otherwise. + /// + /// + /// If the lock cannot be entered immediately, the calling thread waits for roughly the specified duration for the lock + /// to be exited. If the lock is already held by the calling thread, the lock is entered again. The calling thread + /// should exit the lock as many times as it had entered the lock to fully exit the lock and allow other threads to + /// enter the lock. + /// + /// + /// is less than -1. + /// + /// + /// The lock has reached the limit of recursive enters. The limit is implementation-defined, but is expected to be high + /// enough that it would typically not be reached when the lock is used properly. + /// + public bool TryEnter(int millisecondsTimeout) + { + ArgumentOutOfRangeException.ThrowIfLessThan(millisecondsTimeout, -1); + return TryEnter_Outlined(millisecondsTimeout); + } + + /// + /// Tries to enter the lock, waiting for roughly the specified duration. If the lock is entered, the calling thread + /// would be the only thread that holds the lock. + /// + /// + /// The rough duration for which the method will wait if the lock is not available. The timeout is converted to a number + /// of milliseconds by casting of the timeout to an integer value. A value + /// representing 0 milliseconds specifies that the method should not wait, and a value representing + /// or -1 milliseconds specifies that the method should wait indefinitely + /// until the lock is entered. + /// + /// + /// true if the lock was entered, false otherwise. + /// + /// + /// If the lock cannot be entered immediately, the calling thread waits for roughly the specified duration for the lock + /// to be exited. If the lock is already held by the calling thread, the lock is entered again. The calling thread + /// should exit the lock as many times as it had entered the lock to fully exit the lock and allow other threads to + /// enter the lock. + /// + /// + /// , after its conversion to an integer millisecond value, represents a value that is less + /// than -1 milliseconds or greater than milliseconds. + /// + /// + /// The lock has reached the limit of recursive enters. The limit is implementation-defined, but is expected to be high + /// enough that it would typically not be reached when the lock is used properly. + /// + public bool TryEnter(TimeSpan timeout) => TryEnter_Outlined(WaitHandle.ToTimeoutMilliseconds(timeout)); + + [MethodImpl(MethodImplOptions.NoInlining)] + private bool TryEnter_Outlined(int timeoutMs) => TryEnter_Inlined(timeoutMs).IsInitialized; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private ThreadId TryEnter_Inlined(int timeoutMs) + { + Debug.Assert(timeoutMs >= -1); + + ThreadId currentThreadId = ThreadId.Current_NoInitialize; + if (currentThreadId.IsInitialized && State.TryLock(this)) + { + Debug.Assert(!new ThreadId(_owningThreadId).IsInitialized); + Debug.Assert(_recursionCount == 0); + _owningThreadId = currentThreadId.Id; + return currentThreadId; + } + + return TryEnterSlow(timeoutMs, currentThreadId); + } + + /// + /// Exits the lock. + /// + /// + /// If the calling thread holds the lock multiple times, such as recursively, the lock is exited only once. The + /// calling thread should ensure that each enter is matched with an exit. + /// + /// + /// The calling thread does not hold the lock. + /// + [MethodImpl(MethodImplOptions.NoInlining)] + public void Exit() + { + var owningThreadId = new ThreadId(_owningThreadId); + if (!owningThreadId.IsInitialized || owningThreadId.Id != ThreadId.Current_NoInitialize.Id) + { + ThrowHelper.ThrowSynchronizationLockException_LockExit(); + } + + ExitImpl(); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + private void Exit(ThreadId currentThreadId) + { + Debug.Assert(currentThreadId.IsInitialized); + Debug.Assert(currentThreadId.Id == ThreadId.Current_NoInitialize.Id); + + if (_owningThreadId != currentThreadId.Id) + { + ThrowHelper.ThrowSynchronizationLockException_LockExit(); + } + + ExitImpl(); + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private void ExitImpl() + { + Debug.Assert(new ThreadId(_owningThreadId).IsInitialized); + Debug.Assert(_owningThreadId == ThreadId.Current_NoInitialize.Id); + Debug.Assert(new State(this).IsLocked); + + if (_recursionCount == 0) + { + _owningThreadId = 0; + + State state = State.Unlock(this); + if (state.HasAnyWaiters) + { + SignalWaiterIfNecessary(state); + } + } + else + { + _recursionCount--; + } + } + + private static bool IsAdaptiveSpinEnabled(short minSpinCount) => minSpinCount <= 0; + + [MethodImpl(MethodImplOptions.NoInlining)] +#if !NATIVEAOT + private ThreadId TryEnterSlow(int timeoutMs, ThreadId currentThreadId) +#else + private ThreadId TryEnterSlow(int timeoutMs, ThreadId currentThreadId, object associatedObject) +#endif + { + Debug.Assert(timeoutMs >= -1); + + if (!currentThreadId.IsInitialized) + { + // The thread info hasn't been initialized yet for this thread, and the fast path hasn't been tried yet. After + // initializing the thread info, try the fast path first. + currentThreadId.InitializeForCurrentThread(); + Debug.Assert(_owningThreadId != currentThreadId.Id); + if (State.TryLock(this)) + { + goto Locked; + } + } + else if (_owningThreadId == currentThreadId.Id) + { + Debug.Assert(new State(this).IsLocked); + + uint newRecursionCount = _recursionCount + 1; + if (newRecursionCount != 0) + { + _recursionCount = newRecursionCount; + return currentThreadId; + } + + throw new LockRecursionException(SR.Lock_Enter_LockRecursionException); + } + + if (timeoutMs == 0) + { + return new ThreadId(0); + } + + if (LazyInitializeOrEnter() == TryLockResult.Locked) + { + goto Locked; + } + + bool isSingleProcessor = IsSingleProcessor; + short maxSpinCount = s_maxSpinCount; + if (maxSpinCount == 0) + { + goto Wait; + } + + short minSpinCount = s_minSpinCount; + short spinCount = _spinCount; + if (spinCount < 0) + { + // When negative, the spin count serves as a counter for contentions such that a spin-wait can be attempted + // periodically to see if it would be beneficial. Increment the spin count and skip spin-waiting. + Debug.Assert(IsAdaptiveSpinEnabled(minSpinCount)); + _spinCount = (short)(spinCount + 1); + goto Wait; + } + + // Try to acquire the lock, and check if non-waiters should stop preempting waiters. If this thread should not + // preempt waiters, skip spin-waiting. Upon contention, register a spinner. + TryLockResult tryLockResult = State.TryLockBeforeSpinLoop(this, spinCount, out bool isFirstSpinner); + if (tryLockResult != TryLockResult.Spin) + { + goto LockedOrWait; + } + + // Lock was not acquired and a spinner was registered + + if (isFirstSpinner) + { + // Whether a full-length spin-wait would be effective is determined by having the first spinner do a full-length + // spin-wait to see if it is effective. Shorter spin-waits would more often be ineffective just because they are + // shorter. + spinCount = maxSpinCount; + } + + for (short spinIndex = 0; ;) + { + LowLevelSpinWaiter.Wait(spinIndex, SpinSleep0Threshold, isSingleProcessor); + + if (++spinIndex >= spinCount) + { + // The last lock attempt for this spin will be done after the loop + break; + } + + // Try to acquire the lock and unregister the spinner + tryLockResult = State.TryLockInsideSpinLoop(this); + if (tryLockResult == TryLockResult.Spin) + { + continue; + } + + if (tryLockResult == TryLockResult.Locked) + { + if (isFirstSpinner && IsAdaptiveSpinEnabled(minSpinCount)) + { + // Since the first spinner does a full-length spin-wait, and to keep upward and downward changes to the + // spin count more balanced, only the first spinner adjusts the spin count + spinCount = _spinCount; + if (spinCount < maxSpinCount) + { + _spinCount = (short)(spinCount + 1); + } + } + + goto Locked; + } + + // The lock was not acquired and the spinner was not unregistered, stop spinning + Debug.Assert(tryLockResult == TryLockResult.Wait); + break; + } + + // Unregister the spinner and try to acquire the lock + tryLockResult = State.TryLockAfterSpinLoop(this); + if (isFirstSpinner && IsAdaptiveSpinEnabled(minSpinCount)) + { + // Since the first spinner does a full-length spin-wait, and to keep upward and downward changes to the + // spin count more balanced, only the first spinner adjusts the spin count + if (tryLockResult == TryLockResult.Locked) + { + spinCount = _spinCount; + if (spinCount < maxSpinCount) + { + _spinCount = (short)(spinCount + 1); + } + } + else + { + // If the spin count is already zero, skip spin-waiting for a while, even for the first spinners. After a + // number of contentions, the first spinner will attempt a spin-wait again to see if it is effective. + Debug.Assert(tryLockResult == TryLockResult.Wait); + spinCount = _spinCount; + _spinCount = spinCount > 0 ? (short)(spinCount - 1) : minSpinCount; + } + } + + LockedOrWait: + Debug.Assert(tryLockResult != TryLockResult.Spin); + if (tryLockResult == TryLockResult.Wait) + { + goto Wait; + } + + Debug.Assert(tryLockResult == TryLockResult.Locked); + + Locked: + Debug.Assert(!new ThreadId(_owningThreadId).IsInitialized); + Debug.Assert(_recursionCount == 0); + _owningThreadId = currentThreadId.Id; + return currentThreadId; + + Wait: + bool areContentionEventsEnabled = + NativeRuntimeEventSource.Log.IsEnabled( + EventLevel.Informational, + NativeRuntimeEventSource.Keywords.ContentionKeyword); + AutoResetEvent waitEvent = _waitEvent ?? CreateWaitEvent(areContentionEventsEnabled); + if (State.TryLockBeforeWait(this)) + { + // Lock was acquired and a waiter was not registered + goto Locked; + } + + // Lock was not acquired and a waiter was registered. All following paths need to unregister the waiter, including + // exceptional paths. + try + { +#if NATIVEAOT + using var debugBlockingScope = + new Monitor.DebugBlockingScope( + associatedObject, + Monitor.DebugBlockingItemType.MonitorCriticalSection, + timeoutMs, + out _); +#endif + + Interlocked.Increment(ref s_contentionCount); + + long waitStartTimeTicks = 0; + if (areContentionEventsEnabled) + { + NativeRuntimeEventSource.Log.ContentionStart(this); + waitStartTimeTicks = Stopwatch.GetTimestamp(); + } + + bool acquiredLock = false; + int waitStartTimeMs = timeoutMs < 0 ? 0 : Environment.TickCount; + int remainingTimeoutMs = timeoutMs; + while (true) + { + if (!waitEvent.WaitOne(remainingTimeoutMs)) + { + break; + } + + // Spin a bit while trying to acquire the lock. This has a few benefits: + // - Spinning helps to reduce waiter starvation. Since other non-waiter threads can take the lock while + // there are waiters (see State.TryLock()), once a waiter wakes it will be able to better compete with + // other spinners for the lock. + // - If there is another thread that is repeatedly acquiring and releasing the lock, spinning before waiting + // again helps to prevent a waiter from repeatedly context-switching in and out + // - Further in the same situation above, waking up and waiting shortly thereafter deprioritizes this waiter + // because events release waiters in FIFO order. Spinning a bit helps a waiter to retain its priority at + // least for one spin duration before it gets deprioritized behind all other waiters. + for (short spinIndex = 0; spinIndex < maxSpinCount; spinIndex++) + { + if (State.TryLockInsideWaiterSpinLoop(this)) + { + acquiredLock = true; + break; + } + + LowLevelSpinWaiter.Wait(spinIndex, SpinSleep0Threshold, isSingleProcessor); + } + + if (acquiredLock) + { + break; + } + + if (State.TryLockAfterWaiterSpinLoop(this)) + { + acquiredLock = true; + break; + } + + if (remainingTimeoutMs < 0) + { + continue; + } + + uint waitDurationMs = (uint)(Environment.TickCount - waitStartTimeMs); + if (waitDurationMs >= (uint)timeoutMs) + { + break; + } + + remainingTimeoutMs = timeoutMs - (int)waitDurationMs; + } + + if (acquiredLock) + { + // In NativeAOT, ensure that class construction cycles do not occur after the lock is acquired but before + // the state is fully updated. Update the state to fully reflect that this thread owns the lock before doing + // other things. + Debug.Assert(!new ThreadId(_owningThreadId).IsInitialized); + Debug.Assert(_recursionCount == 0); + _owningThreadId = currentThreadId.Id; + + if (areContentionEventsEnabled) + { + double waitDurationNs = + (Stopwatch.GetTimestamp() - waitStartTimeTicks) * 1_000_000_000.0 / Stopwatch.Frequency; + NativeRuntimeEventSource.Log.ContentionStop(waitDurationNs); + } + + return currentThreadId; + } + } + catch // run this code before exception filters in callers + { + State.UnregisterWaiter(this); + throw; + } + + State.UnregisterWaiter(this); + return new ThreadId(0); + } + + private void ResetWaiterStartTime() => _waiterStartTimeMs = 0; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private void RecordWaiterStartTime() + { + ushort currentTimeMs = (ushort)Environment.TickCount; + if (currentTimeMs == 0) + { + // Don't record zero, that value is reserved for indicating that a time is not recorded + currentTimeMs--; + } + _waiterStartTimeMs = currentTimeMs; + } + + private bool ShouldStopPreemptingWaiters + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get + { + // If the recorded time is zero, a time has not been recorded yet + ushort waiterStartTimeMs = _waiterStartTimeMs; + return + waiterStartTimeMs != 0 && + (ushort)Environment.TickCount - waiterStartTimeMs >= MaxDurationMsForPreemptingWaiters; + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + private unsafe AutoResetEvent CreateWaitEvent(bool areContentionEventsEnabled) + { + var newWaitEvent = new AutoResetEvent(false); + AutoResetEvent? waitEventBeforeUpdate = Interlocked.CompareExchange(ref _waitEvent, newWaitEvent, null); + if (waitEventBeforeUpdate == null) + { + // Also check NativeRuntimeEventSource.Log.IsEnabled() to enable trimming + if (areContentionEventsEnabled && NativeRuntimeEventSource.Log.IsEnabled()) + { + NativeRuntimeEventSource.Log.ContentionLockCreated(this); + } + + return newWaitEvent; + } + + newWaitEvent.Dispose(); + return waitEventBeforeUpdate; + } + + [MethodImpl(MethodImplOptions.NoInlining)] + private void SignalWaiterIfNecessary(State state) + { + if (State.TrySetIsWaiterSignaledToWake(this, state)) + { + // Signal a waiter to wake + Debug.Assert(_waitEvent != null); + bool signaled = _waitEvent.Set(); + Debug.Assert(signaled); + } + } + + /// + /// true if the lock is held by the calling thread, false otherwise. + /// + public bool IsHeldByCurrentThread + { + get + { + var owningThreadId = new ThreadId(_owningThreadId); + bool isHeld = owningThreadId.IsInitialized && owningThreadId.Id == ThreadId.Current_NoInitialize.Id; + Debug.Assert(!isHeld || new State(this).IsLocked); + return isHeld; + } + } + + internal static long ContentionCount => s_contentionCount; + internal void Dispose() => _waitEvent?.Dispose(); + + internal nint LockIdForEvents + { + get + { + Debug.Assert(_waitEvent != null); + return _waitEvent.SafeWaitHandle.DangerousGetHandle(); + } + } + + internal unsafe nint ObjectIdForEvents + { + get + { + Lock lockObj = this; + return *(nint*)Unsafe.AsPointer(ref lockObj); + } + } + + internal ulong OwningThreadId => _owningThreadId; + + private static short DetermineMaxSpinCount() => + AppContextConfigHelper.GetInt16Config( + "System.Threading.Lock.SpinCount", + "DOTNET_Lock_SpinCount", + DefaultMaxSpinCount, + allowNegative: false); + + private static short DetermineMinSpinCount() + { + // The config var can be set to -1 to disable adaptive spin + short adaptiveSpinPeriod = + AppContextConfigHelper.GetInt16Config( + "System.Threading.Lock.AdaptiveSpinPeriod", + "DOTNET_Lock_AdaptiveSpinPeriod", + DefaultAdaptiveSpinPeriod, + allowNegative: true); + if (adaptiveSpinPeriod < -1) + { + adaptiveSpinPeriod = DefaultAdaptiveSpinPeriod; + } + + return (short)-adaptiveSpinPeriod; + } + + private struct State : IEquatable + { + // Layout constants for Lock._state + private const uint IsLockedMask = (uint)1 << 0; // bit 0 + private const uint ShouldNotPreemptWaitersMask = (uint)1 << 1; // bit 1 + private const uint SpinnerCountIncrement = (uint)1 << 2; // bits 2-4 + private const uint SpinnerCountMask = (uint)0x7 << 2; + private const uint IsWaiterSignaledToWakeMask = (uint)1 << 5; // bit 5 + private const byte WaiterCountShift = 6; + private const uint WaiterCountIncrement = (uint)1 << WaiterCountShift; // bits 6-31 + + private uint _state; + + public State(Lock lockObj) : this(lockObj._state) { } + private State(uint state) => _state = state; + + public static uint InitialStateValue => 0; + public static uint LockedStateValue => IsLockedMask; + private static uint Neg(uint state) => (uint)-(int)state; + public bool IsInitialState => this == default; + public bool IsLocked => (_state & IsLockedMask) != 0; + + private void SetIsLocked() + { + Debug.Assert(!IsLocked); + _state += IsLockedMask; + } + + private bool ShouldNotPreemptWaiters => (_state & ShouldNotPreemptWaitersMask) != 0; + + private void SetShouldNotPreemptWaiters() + { + Debug.Assert(!ShouldNotPreemptWaiters); + Debug.Assert(HasAnyWaiters); + + _state += ShouldNotPreemptWaitersMask; + } + + private void ClearShouldNotPreemptWaiters() + { + Debug.Assert(ShouldNotPreemptWaiters); + _state -= ShouldNotPreemptWaitersMask; + } + + private bool ShouldNonWaiterAttemptToAcquireLock + { + get + { + Debug.Assert(HasAnyWaiters || !ShouldNotPreemptWaiters); + return (_state & (IsLockedMask | ShouldNotPreemptWaitersMask)) == 0; + } + } + + private bool HasAnySpinners => (_state & SpinnerCountMask) != 0; + + private bool TryIncrementSpinnerCount() + { + uint newState = _state + SpinnerCountIncrement; + if (new State(newState).HasAnySpinners) // overflow check + { + _state = newState; + return true; + } + return false; + } + + private void DecrementSpinnerCount() + { + Debug.Assert(HasAnySpinners); + _state -= SpinnerCountIncrement; + } + + private bool IsWaiterSignaledToWake => (_state & IsWaiterSignaledToWakeMask) != 0; + + private void SetIsWaiterSignaledToWake() + { + Debug.Assert(HasAnyWaiters); + Debug.Assert(NeedToSignalWaiter); + + _state += IsWaiterSignaledToWakeMask; + } + + private void ClearIsWaiterSignaledToWake() + { + Debug.Assert(IsWaiterSignaledToWake); + _state -= IsWaiterSignaledToWakeMask; + } + + public bool HasAnyWaiters => _state >= WaiterCountIncrement; + + private bool TryIncrementWaiterCount() + { + uint newState = _state + WaiterCountIncrement; + if (new State(newState).HasAnyWaiters) // overflow check + { + _state = newState; + return true; + } + return false; + } + + private void DecrementWaiterCount() + { + Debug.Assert(HasAnyWaiters); + _state -= WaiterCountIncrement; + } + + public bool NeedToSignalWaiter + { + get + { + Debug.Assert(HasAnyWaiters); + return (_state & (SpinnerCountMask | IsWaiterSignaledToWakeMask)) == 0; + } + } + + public static bool operator ==(State state1, State state2) => state1._state == state2._state; + public static bool operator !=(State state1, State state2) => !(state1 == state2); + + bool IEquatable.Equals(State other) => this == other; + public override bool Equals(object? obj) => obj is State other && this == other; + public override int GetHashCode() => (int)_state; + + private static State CompareExchange(Lock lockObj, State toState, State fromState) => + new State(Interlocked.CompareExchange(ref lockObj._state, toState._state, fromState._state)); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool TryLock(Lock lockObj) + { + // The lock is mostly fair to release waiters in a typically FIFO order (though the order is not guaranteed). + // However, it allows non-waiters to acquire the lock if it's available to avoid lock convoys. + // + // Lock convoys can be detrimental to performance in scenarios where work is being done on multiple threads and + // the work involves periodically taking a particular lock for a short time to access shared resources. With a + // lock convoy, once there is a waiter for the lock (which is not uncommon in such scenarios), a worker thread + // would be forced to context-switch on the subsequent attempt to acquire the lock, often long before the worker + // thread exhausts its time slice. This process repeats as long as the lock has a waiter, forcing every worker + // to context-switch on each attempt to acquire the lock, killing performance and creating a positive feedback + // loop that makes it more likely for the lock to have waiters. To avoid the lock convoy, each worker needs to + // be allowed to acquire the lock multiple times in sequence despite there being a waiter for the lock in order + // to have the worker continue working efficiently during its time slice as long as the lock is not contended. + // + // This scheme has the possibility to starve waiters. Waiter starvation is mitigated by other means, see + // TryLockBeforeSpinLoop() and references to ShouldNotPreemptWaiters. + + var state = new State(lockObj); + if (!state.ShouldNonWaiterAttemptToAcquireLock) + { + return false; + } + + State newState = state; + newState.SetIsLocked(); + + return CompareExchange(lockObj, newState, state) == state; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static State Unlock(Lock lockObj) + { + Debug.Assert(IsLockedMask == 1); + + var state = new State(Interlocked.Decrement(ref lockObj._state)); + Debug.Assert(!state.IsLocked); + return state; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static TryLockResult TryLockBeforeSpinLoop(Lock lockObj, short spinCount, out bool isFirstSpinner) + { + // Normally, threads are allowed to preempt waiters to acquire the lock in order to avoid creating lock convoys, + // see TryLock(). There can be cases where waiters can be easily starved as a result. For example, a thread that + // holds a lock for a significant amount of time (much longer than the time it takes to do a context switch), + // then releases and reacquires the lock in quick succession, and repeats. Though a waiter would be woken upon + // lock release, usually it will not have enough time to context-switch-in and take the lock, and can be starved + // for an unreasonably long duration. + // + // In order to prevent such starvation and force a bit of fair forward progress, it is sometimes necessary to + // change the normal policy and disallow threads from preempting waiters. ShouldNotPreemptWaiters() indicates + // the current state of the policy and this method determines whether the policy should be changed to disallow + // non-waiters from preempting waiters. + // - When the first waiter begins waiting, it records the current time as a "waiter starvation start time". + // That is a point in time after which no forward progress has occurred for waiters. When a waiter acquires + // the lock, the time is updated to the current time. + // - This method checks whether the starvation duration has crossed a threshold and if so, sets + // ShouldNotPreemptWaitersMask + // + // When unreasonable starvation is occurring, the lock will be released occasionally and if caused by spinners, + // those threads may start to spin again. + // - Before starting to spin this method is called. If ShouldNotPreemptWaitersMask is set, the spinner will + // skip spinning and wait instead. Spinners that are already registered at the time + // ShouldNotPreemptWaitersMask is set will stop spinning as necessary. Eventually, all spinners will drain + // and no new ones will be registered. + // - Upon releasing a lock, if there are no spinners, a waiter will be signaled to wake. On that path, + // TrySetIsWaiterSignaledToWake() is called. + // - Eventually, after spinners have drained, only a waiter will be able to acquire the lock. When a waiter + // acquires the lock, or when the last waiter unregisters itself, ShouldNotPreemptWaitersMask is cleared to + // restore the normal policy. + + Debug.Assert(spinCount >= 0); + + isFirstSpinner = false; + var state = new State(lockObj); + while (true) + { + State newState = state; + TryLockResult result = TryLockResult.Spin; + if (newState.HasAnyWaiters) + { + if (newState.ShouldNotPreemptWaiters) + { + return TryLockResult.Wait; + } + if (lockObj.ShouldStopPreemptingWaiters) + { + newState.SetShouldNotPreemptWaiters(); + result = TryLockResult.Wait; + } + } + if (result == TryLockResult.Spin) + { + Debug.Assert(!newState.ShouldNotPreemptWaiters); + if (!newState.IsLocked) + { + newState.SetIsLocked(); + result = TryLockResult.Locked; + } + else if ((newState.HasAnySpinners && spinCount == 0) || !newState.TryIncrementSpinnerCount()) + { + return TryLockResult.Wait; + } + } + + State stateBeforeUpdate = CompareExchange(lockObj, newState, state); + if (stateBeforeUpdate == state) + { + if (result == TryLockResult.Spin && !state.HasAnySpinners) + { + isFirstSpinner = true; + } + return result; + } + + state = stateBeforeUpdate; + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static TryLockResult TryLockInsideSpinLoop(Lock lockObj) + { + // This method is called from inside a spin loop, it must unregister the spinner if the lock is acquired + + var state = new State(lockObj); + while (true) + { + Debug.Assert(state.HasAnySpinners); + if (!state.ShouldNonWaiterAttemptToAcquireLock) + { + return state.ShouldNotPreemptWaiters ? TryLockResult.Wait : TryLockResult.Spin; + } + + State newState = state; + newState.SetIsLocked(); + newState.DecrementSpinnerCount(); + + State stateBeforeUpdate = CompareExchange(lockObj, newState, state); + if (stateBeforeUpdate == state) + { + return TryLockResult.Locked; + } + + state = stateBeforeUpdate; + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static TryLockResult TryLockAfterSpinLoop(Lock lockObj) + { + // This method is called at the end of a spin loop, it must unregister the spinner always and acquire the lock + // if it's available. If the lock is available, a spinner must acquire the lock along with unregistering itself, + // because a lock releaser does not wake a waiter when there is a spinner registered. + + var state = new State(Interlocked.Add(ref lockObj._state, Neg(SpinnerCountIncrement))); + Debug.Assert(new State(state._state + SpinnerCountIncrement).HasAnySpinners); + + while (true) + { + Debug.Assert(state.HasAnyWaiters || !state.ShouldNotPreemptWaiters); + if (state.IsLocked) + { + return TryLockResult.Wait; + } + + State newState = state; + newState.SetIsLocked(); + + State stateBeforeUpdate = CompareExchange(lockObj, newState, state); + if (stateBeforeUpdate == state) + { + return TryLockResult.Locked; + } + + state = stateBeforeUpdate; + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool TryLockBeforeWait(Lock lockObj) + { + // This method is called before waiting. It must either acquire the lock or register a waiter. It also keeps + // track of the waiter starvation start time. + + var state = new State(lockObj); + bool waiterStartTimeWasReset = false; + while (true) + { + State newState = state; + if (newState.ShouldNonWaiterAttemptToAcquireLock) + { + newState.SetIsLocked(); + } + else + { + if (!newState.TryIncrementWaiterCount()) + { + ThrowHelper.ThrowOutOfMemoryException_LockEnter_WaiterCountOverflow(); + } + + if (!state.HasAnyWaiters && !waiterStartTimeWasReset) + { + // This would be the first waiter. Once the waiter is registered, another thread may check the + // waiter starvation start time and the previously recorded value may be stale, causing + // ShouldNotPreemptWaitersMask to be set unnecessarily. Reset the start time before registering the + // waiter. + waiterStartTimeWasReset = true; + lockObj.ResetWaiterStartTime(); + } + } + + State stateBeforeUpdate = CompareExchange(lockObj, newState, state); + if (stateBeforeUpdate == state) + { + if (state.ShouldNonWaiterAttemptToAcquireLock) + { + return true; + } + + Debug.Assert(state.HasAnyWaiters || waiterStartTimeWasReset); + if (!state.HasAnyWaiters || waiterStartTimeWasReset) + { + // This was the first waiter or the waiter start time was reset, record the waiter start time + lockObj.RecordWaiterStartTime(); + } + return false; + } + + state = stateBeforeUpdate; + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool TryLockInsideWaiterSpinLoop(Lock lockObj) + { + // This method is called from inside the waiter's spin loop and should observe the wake signal only if the lock + // is taken, to prevent a lock releaser from waking another waiter while one is already spinning to acquire the + // lock + + bool waiterStartTimeWasRecorded = false; + var state = new State(lockObj); + while (true) + { + Debug.Assert(state.HasAnyWaiters); + Debug.Assert(state.IsWaiterSignaledToWake); + + if (state.IsLocked) + { + return false; + } + + State newState = state; + newState.SetIsLocked(); + newState.ClearIsWaiterSignaledToWake(); + newState.DecrementWaiterCount(); + if (newState.ShouldNotPreemptWaiters) + { + newState.ClearShouldNotPreemptWaiters(); + + if (newState.HasAnyWaiters && !waiterStartTimeWasRecorded) + { + // Update the waiter starvation start time. The time must be recorded before + // ShouldNotPreemptWaitersMask is cleared, as once that is cleared, another thread may check the + // waiter starvation start time and the previously recorded value may be stale, causing + // ShouldNotPreemptWaitersMask to be set again unnecessarily. + waiterStartTimeWasRecorded = true; + lockObj.RecordWaiterStartTime(); + } + } + + State stateBeforeUpdate = CompareExchange(lockObj, newState, state); + if (stateBeforeUpdate == state) + { + if (newState.HasAnyWaiters) + { + Debug.Assert(!state.ShouldNotPreemptWaiters || waiterStartTimeWasRecorded); + if (!waiterStartTimeWasRecorded) + { + // Since the lock was acquired successfully by a waiter, update the waiter starvation start time + lockObj.RecordWaiterStartTime(); + } + } + return true; + } + + state = stateBeforeUpdate; + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool TryLockAfterWaiterSpinLoop(Lock lockObj) + { + // This method is called at the end of the waiter's spin loop. It must observe the wake signal always, and if + // the lock is available, it must acquire the lock and unregister the waiter. If the lock is available, a waiter + // must acquire the lock along with observing the wake signal, because a lock releaser does not wake a waiter + // when a waiter was signaled but the wake signal has not been observed. If the lock is acquired, the waiter + // starvation start time is also updated. + + var state = new State(Interlocked.Add(ref lockObj._state, Neg(IsWaiterSignaledToWakeMask))); + Debug.Assert(new State(state._state + IsWaiterSignaledToWakeMask).IsWaiterSignaledToWake); + + bool waiterStartTimeWasRecorded = false; + while (true) + { + Debug.Assert(state.HasAnyWaiters); + + if (state.IsLocked) + { + return false; + } + + State newState = state; + newState.SetIsLocked(); + newState.DecrementWaiterCount(); + if (newState.ShouldNotPreemptWaiters) + { + newState.ClearShouldNotPreemptWaiters(); + + if (newState.HasAnyWaiters && !waiterStartTimeWasRecorded) + { + // Update the waiter starvation start time. The time must be recorded before + // ShouldNotPreemptWaitersMask is cleared, as once that is cleared, another thread may check the + // waiter starvation start time and the previously recorded value may be stale, causing + // ShouldNotPreemptWaitersMask to be set again unnecessarily. + waiterStartTimeWasRecorded = true; + lockObj.RecordWaiterStartTime(); + } + } + + State stateBeforeUpdate = CompareExchange(lockObj, newState, state); + if (stateBeforeUpdate == state) + { + if (newState.HasAnyWaiters) + { + Debug.Assert(!state.ShouldNotPreemptWaiters || waiterStartTimeWasRecorded); + if (!waiterStartTimeWasRecorded) + { + // Since the lock was acquired successfully by a waiter, update the waiter starvation start time + lockObj.RecordWaiterStartTime(); + } + } + return true; + } + + state = stateBeforeUpdate; + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + public static void UnregisterWaiter(Lock lockObj) + { + // This method is called upon an exception while waiting, or when a wait has timed out. It must unregister the + // waiter, and if it's the last waiter, clear ShouldNotPreemptWaitersMask to allow other threads to acquire the + // lock. + + var state = new State(lockObj); + while (true) + { + Debug.Assert(state.HasAnyWaiters); + + State newState = state; + newState.DecrementWaiterCount(); + if (newState.ShouldNotPreemptWaiters && !newState.HasAnyWaiters) + { + newState.ClearShouldNotPreemptWaiters(); + } + + State stateBeforeUpdate = CompareExchange(lockObj, newState, state); + if (stateBeforeUpdate == state) + { + return; + } + + state = stateBeforeUpdate; + } + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool TrySetIsWaiterSignaledToWake(Lock lockObj, State state) + { + // Determine whether we must signal a waiter to wake. Keep track of whether a thread has been signaled to wake + // but has not yet woken from the wait. IsWaiterSignaledToWakeMask is cleared when a signaled thread wakes up by + // observing a signal. Since threads can preempt waiting threads and acquire the lock (see TryLock()), it allows + // for example, one thread to acquire and release the lock multiple times while there are multiple waiting + // threads. In such a case, we don't want that thread to signal a waiter every time it releases the lock, as + // that will cause unnecessary context switches with more and more signaled threads waking up, finding that the + // lock is still locked, and going back into a wait state. So, signal only one waiting thread at a time. + + Debug.Assert(state.HasAnyWaiters); + + while (true) + { + if (!state.NeedToSignalWaiter) + { + return false; + } + + State newState = state; + newState.SetIsWaiterSignaledToWake(); + if (!newState.ShouldNotPreemptWaiters && lockObj.ShouldStopPreemptingWaiters) + { + newState.SetShouldNotPreemptWaiters(); + } + + State stateBeforeUpdate = CompareExchange(lockObj, newState, state); + if (stateBeforeUpdate == state) + { + return true; + } + if (!stateBeforeUpdate.HasAnyWaiters) + { + return false; + } + + state = stateBeforeUpdate; + } + } + } + + private enum TryLockResult + { + Locked, + Spin, + Wait + } + } +} diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/LowLevelLifoSemaphore.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/LowLevelLifoSemaphore.cs index f555dff7d4eb59..133a14cf1ebe4f 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/LowLevelLifoSemaphore.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/LowLevelLifoSemaphore.cs @@ -78,11 +78,11 @@ public bool Wait(int timeoutMs, bool spinWait) // The PAL's wait subsystem is slower, spin more to compensate for the more expensive wait spinCount *= 2; #endif - int processorCount = Environment.ProcessorCount; - int spinIndex = processorCount > 1 ? 0 : SpinSleep0Threshold; + bool isSingleProcessor = Environment.IsSingleProcessor; + int spinIndex = isSingleProcessor ? SpinSleep0Threshold : 0; while (spinIndex < spinCount) { - LowLevelSpinWaiter.Wait(spinIndex, SpinSleep0Threshold, processorCount); + LowLevelSpinWaiter.Wait(spinIndex, SpinSleep0Threshold, isSingleProcessor); spinIndex++; // Try to acquire the semaphore and unregister as a spinner diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/LowLevelSpinWaiter.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/LowLevelSpinWaiter.cs index ba82f7237e518b..b7a622539c08ce 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/LowLevelSpinWaiter.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/LowLevelSpinWaiter.cs @@ -34,7 +34,7 @@ public bool SpinWaitForCondition(Func condition, object state, int for (int spinIndex = processorCount > 1 ? 0 : sleep0Threshold; spinIndex < spinCount; ++spinIndex) { // The caller should check the condition in a fast path before calling this method, so wait first - Wait(spinIndex, sleep0Threshold, processorCount); + Wait(spinIndex, sleep0Threshold, processorCount == 1); if (condition(state)) { @@ -51,7 +51,7 @@ public bool SpinWaitForCondition(Func condition, object state, int return false; } - public static void Wait(int spinIndex, int sleep0Threshold, int processorCount) + public static void Wait(int spinIndex, int sleep0Threshold, bool isSingleProcessor) { Debug.Assert(spinIndex >= 0); Debug.Assert(sleep0Threshold >= 0); @@ -65,7 +65,7 @@ public static void Wait(int spinIndex, int sleep0Threshold, int processorCount) // spin loop too early can cause excessive context switcing from the wait. // - If there are multiple threads doing Yield and Sleep(0) (typically from the same spin loop due to contention), // they may switch between one another, delaying work that can make progress. - if (processorCount > 1 && (spinIndex < sleep0Threshold || (spinIndex - sleep0Threshold) % 2 != 0)) + if (!isSingleProcessor && (spinIndex < sleep0Threshold || (spinIndex - sleep0Threshold) % 2 != 0)) { // Cap the maximum spin count to a value such that many thousands of CPU cycles would not be wasted doing // the equivalent of YieldProcessor(), as at that point SwitchToThread/Sleep(0) are more likely to be able to diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/SpinLock.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/SpinLock.cs index 68b70dc70ff9d0..c0eba40cb428af 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/SpinLock.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/SpinLock.cs @@ -509,7 +509,7 @@ private void ExitSlowPath(bool useMemoryBarrier) bool threadTrackingEnabled = (_owner & LOCK_ID_DISABLE_MASK) == 0; if (threadTrackingEnabled && !IsHeldByCurrentThread) { - throw new SynchronizationLockException(SR.SpinLock_Exit_SynchronizationLockException); + ThrowHelper.ThrowSynchronizationLockException_LockExit(); } if (useMemoryBarrier) diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/TimerQueue.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/TimerQueue.Unix.cs index 140d136a12cb1f..1f8dadaae8df29 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/TimerQueue.Unix.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/TimerQueue.Unix.cs @@ -5,7 +5,7 @@ namespace System.Threading { internal sealed partial class TimerQueue { - private static long TickCount64 => Environment.TickCount64; + public static long TickCount64 => Environment.TickCount64; #pragma warning disable IDE0060 private TimerQueue(int id) diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/TimerQueue.Windows.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/TimerQueue.Windows.cs index 48babb49981ef8..566c0cbc10dc1a 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/TimerQueue.Windows.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/TimerQueue.Windows.cs @@ -12,7 +12,7 @@ private TimerQueue(int id) _id = id; } - private static long TickCount64 + public static long TickCount64 { get { diff --git a/src/libraries/System.Private.CoreLib/src/System/ThrowHelper.cs b/src/libraries/System.Private.CoreLib/src/System/ThrowHelper.cs index 92c09c00b81e9b..27c77960c2f787 100644 --- a/src/libraries/System.Private.CoreLib/src/System/ThrowHelper.cs +++ b/src/libraries/System.Private.CoreLib/src/System/ThrowHelper.cs @@ -46,6 +46,7 @@ using System.Runtime.InteropServices; using System.Runtime.Intrinsics; using System.Runtime.Serialization; +using System.Threading; namespace System { @@ -451,6 +452,12 @@ internal static void ThrowOutOfMemoryException_StringTooLong() throw new OutOfMemoryException(SR.OutOfMemory_StringTooLong); } + [DoesNotReturn] + internal static void ThrowOutOfMemoryException_LockEnter_WaiterCountOverflow() + { + throw new OutOfMemoryException(SR.Lock_Enter_WaiterCountOverflow_OutOfMemoryException); + } + [DoesNotReturn] internal static void ThrowArgumentException_Argument_IncompatibleArrayType() { @@ -613,6 +620,12 @@ internal static void ThrowFormatIndexOutOfRange() throw new FormatException(SR.Format_IndexOutOfRange); } + [DoesNotReturn] + internal static void ThrowSynchronizationLockException_LockExit() + { + throw new SynchronizationLockException(SR.Lock_Exit_SynchronizationLockException); + } + internal static AmbiguousMatchException GetAmbiguousMatchException(MemberInfo memberInfo) { Type? declaringType = memberInfo.DeclaringType; diff --git a/src/libraries/System.Runtime/ref/System.Runtime.cs b/src/libraries/System.Runtime/ref/System.Runtime.cs index e3af0f096e4b62..797b0f52a6c714 100644 --- a/src/libraries/System.Runtime/ref/System.Runtime.cs +++ b/src/libraries/System.Runtime/ref/System.Runtime.cs @@ -15068,6 +15068,22 @@ public enum LazyThreadSafetyMode PublicationOnly = 1, ExecutionAndPublication = 2, } + [System.Runtime.Versioning.RequiresPreviewFeaturesAttribute] + public sealed partial class Lock + { + public Lock() { } + public void Enter() { } + public System.Threading.Lock.Scope EnterScope() { throw null; } + public void Exit() { } + public bool IsHeldByCurrentThread { get { throw null; } } + public bool TryEnter() { throw null; } + public bool TryEnter(int millisecondsTimeout) { throw null; } + public bool TryEnter(System.TimeSpan timeout) { throw null; } + public ref struct Scope + { + public void Dispose() { } + } + } public sealed partial class PeriodicTimer : System.IDisposable { public PeriodicTimer(System.TimeSpan period) { } diff --git a/src/libraries/System.Threading/tests/LockTests.cs b/src/libraries/System.Threading/tests/LockTests.cs new file mode 100644 index 00000000000000..b4eab8787c8cac --- /dev/null +++ b/src/libraries/System.Threading/tests/LockTests.cs @@ -0,0 +1,291 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System.Collections.Generic; +using System.Threading.Tasks; +using Xunit; + +namespace System.Threading.Tests +{ + public static class LockTests + { + private const int FailTimeoutMilliseconds = 30000; + + // Attempts a single recursive acquisition/release cycle of a newly-created lock. + [Fact] + public static void BasicRecursion() + { + Lock lockObj = new(); + Assert.True(lockObj.TryEnter()); + Assert.True(lockObj.TryEnter()); + lockObj.Exit(); + Assert.True(lockObj.IsHeldByCurrentThread); + lockObj.Enter(); + Assert.True(lockObj.IsHeldByCurrentThread); + lockObj.Exit(); + using (lockObj.EnterScope()) + { + Assert.True(lockObj.IsHeldByCurrentThread); + } + Assert.True(lockObj.IsHeldByCurrentThread); + lockObj.Exit(); + Assert.False(lockObj.IsHeldByCurrentThread); + } + + // Attempts to overflow the recursion count of a newly-created lock. + [Fact] + public static void DeepRecursion() + { + Lock lockObj = new(); + const int successLimit = 10000; + + int i = 0; + for (; i < successLimit; i++) + { + Assert.True(lockObj.TryEnter()); + } + + for (; i > 1; i--) + { + lockObj.Exit(); + Assert.True(lockObj.IsHeldByCurrentThread); + } + + lockObj.Exit(); + Assert.False(lockObj.IsHeldByCurrentThread); + } + + [Fact] + public static void IsHeldByCurrentThread() + { + Lock lockObj = new(); + Assert.False(lockObj.IsHeldByCurrentThread); + using (lockObj.EnterScope()) + { + Assert.True(lockObj.IsHeldByCurrentThread); + } + Assert.False(lockObj.IsHeldByCurrentThread); + } + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + public static void IsHeldByCurrentThread_WhenHeldBySomeoneElse() + { + Lock lockObj = new(); + var b = new Barrier(2); + + Task t = Task.Run(() => + { + using (lockObj.EnterScope()) + { + b.SignalAndWait(); + Assert.True(lockObj.IsHeldByCurrentThread); + b.SignalAndWait(); + } + }); + + b.SignalAndWait(); + Assert.False(lockObj.IsHeldByCurrentThread); + b.SignalAndWait(); + + t.Wait(); + } + + [Fact] + public static void Exit_Invalid() + { + Lock lockObj = new(); + Assert.Throws(() => lockObj.Exit()); + default(Lock.Scope).Dispose(); + } + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + public static void Exit_WhenHeldBySomeoneElse_ThrowsSynchronizationLockException() + { + Lock lockObj = new(); + var b = new Barrier(2); + + Lock.Scope lockScopeCopy; + using (Lock.Scope lockScope = lockObj.EnterScope()) + { + lockScopeCopy = lockScope; + } + + Task t = Task.Run(() => + { + using (lockObj.EnterScope()) + { + b.SignalAndWait(); + b.SignalAndWait(); + } + }); + + b.SignalAndWait(); + + Assert.Throws(() => lockObj.Exit()); + + try + { + // Can't use Assert.Throws because lockScopeCopy is a ref struct local that can't be captured by a lambda + // expression + lockScopeCopy.Dispose(); + Assert.Fail("Expected SynchronizationLockException but did not get an exception."); + } + catch (SynchronizationLockException) + { + } + catch (Exception ex) + { + Assert.Fail($"Expected SynchronizationLockException but got a different exception instead: {ex}"); + } + + b.SignalAndWait(); + t.Wait(); + } + + [Fact] + public static void TryEnter_Invalid() + { + Lock lockObj = new(); + + Assert.Throws(() => lockObj.TryEnter(-2)); + AssertExtensions.Throws( + "timeout", () => lockObj.TryEnter(TimeSpan.FromMilliseconds(-2))); + AssertExtensions.Throws( + "timeout", + () => lockObj.TryEnter(TimeSpan.FromMilliseconds((double)int.MaxValue + 1))); + } + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + public static void Enter_HasToWait() + { + Lock lockObj = new(); + + // When the current thread has the lock, have background threads wait for the lock in various ways. After a short + // duration, release the lock and allow the background threads to acquire the lock. + { + var backgroundTestDelegates = new List(); + Barrier readyBarrier = null; + + backgroundTestDelegates.Add(() => + { + readyBarrier.SignalAndWait(); + lockObj.Enter(); + lockObj.Exit(); + }); + + backgroundTestDelegates.Add(() => + { + readyBarrier.SignalAndWait(); + using (lockObj.EnterScope()) + { + } + }); + + backgroundTestDelegates.Add(() => + { + readyBarrier.SignalAndWait(); + Assert.True(lockObj.TryEnter(ThreadTestHelpers.UnexpectedTimeoutMilliseconds)); + lockObj.Exit(); + }); + + backgroundTestDelegates.Add(() => + { + readyBarrier.SignalAndWait(); + Assert.True(lockObj.TryEnter(TimeSpan.FromMilliseconds(ThreadTestHelpers.UnexpectedTimeoutMilliseconds))); + lockObj.Exit(); + }); + + int testCount = backgroundTestDelegates.Count; + readyBarrier = new Barrier(testCount + 1); // plus main thread + var waitForThreadArray = new Action[testCount]; + for (int i = 0; i < backgroundTestDelegates.Count; ++i) + { + int icopy = i; // for use in delegates + Thread t = + ThreadTestHelpers.CreateGuardedThread(out waitForThreadArray[i], + () => backgroundTestDelegates[icopy]()); + t.IsBackground = true; + t.Start(); + } + + using (lockObj.EnterScope()) + { + readyBarrier.SignalAndWait(ThreadTestHelpers.UnexpectedTimeoutMilliseconds); + Thread.Sleep(ThreadTestHelpers.ExpectedTimeoutMilliseconds); + } + foreach (Action waitForThread in waitForThreadArray) + waitForThread(); + } + + // When the current thread has the lock, have background threads wait for the lock in various ways and time out + // after a short duration + { + var backgroundTestDelegates = new List(); + Barrier readyBarrier = null; + + backgroundTestDelegates.Add(() => + { + readyBarrier.SignalAndWait(); + Assert.False(lockObj.TryEnter(ThreadTestHelpers.ExpectedTimeoutMilliseconds)); + }); + + backgroundTestDelegates.Add(() => + { + readyBarrier.SignalAndWait(); + Assert.False(lockObj.TryEnter(TimeSpan.FromMilliseconds(ThreadTestHelpers.ExpectedTimeoutMilliseconds))); + }); + + int testCount = backgroundTestDelegates.Count; + readyBarrier = new Barrier(testCount + 1); // plus main thread + var waitForThreadArray = new Action[testCount]; + for (int i = 0; i < backgroundTestDelegates.Count; ++i) + { + int icopy = i; // for use in delegates + Thread t = + ThreadTestHelpers.CreateGuardedThread(out waitForThreadArray[i], + () => backgroundTestDelegates[icopy]()); + t.IsBackground = true; + t.Start(); + } + + using (lockObj.EnterScope()) + { + readyBarrier.SignalAndWait(ThreadTestHelpers.UnexpectedTimeoutMilliseconds); + foreach (Action waitForThread in waitForThreadArray) + waitForThread(); + } + } + } + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + public static void Enter_HasToWait_LockContentionCountTest() + { + long initialLockContentionCount = Monitor.LockContentionCount; + Enter_HasToWait(); + Assert.True(Monitor.LockContentionCount - initialLockContentionCount >= 2); + } + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/49521", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] + public static void InterruptWaitTest() + { + Lock lockObj = new(); + using (lockObj.EnterScope()) + { + var threadReady = new AutoResetEvent(false); + var t = + ThreadTestHelpers.CreateGuardedThread(out Action waitForThread, () => + { + threadReady.Set(); + Assert.Throws(() => lockObj.Enter()); + }); + t.IsBackground = true; + t.Start(); + threadReady.CheckedWait(); + t.Interrupt(); + waitForThread(); + } + } + } +} diff --git a/src/libraries/System.Threading/tests/MonitorTests.cs b/src/libraries/System.Threading/tests/MonitorTests.cs index 50074a1e241096..c37ed60e5af670 100644 --- a/src/libraries/System.Threading/tests/MonitorTests.cs +++ b/src/libraries/System.Threading/tests/MonitorTests.cs @@ -66,7 +66,7 @@ public static void IsEntered() [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] [ActiveIssue("https://github.com/dotnet/runtime/issues/91538", typeof(PlatformDetection), nameof(PlatformDetection.IsWasmThreadingSupported))] - public static void IsEntered_WhenHeldBySomeoneElse_ThrowsSynchronizationLockException() + public static void IsEntered_WhenHeldBySomeoneElse() { var obj = new object(); var b = new Barrier(2); @@ -491,5 +491,29 @@ public static void ObjectHeaderSyncBlockTransitionTryEnterRaceTest() } while (!t.Join(0)); } } + + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/49521", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/87718", TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] + public static void InterruptWaitTest() + { + object obj = new(); + lock (obj) + { + var threadReady = new AutoResetEvent(false); + var t = + ThreadTestHelpers.CreateGuardedThread(out Action waitForThread, () => + { + threadReady.Set(); + Assert.Throws(() => Monitor.Enter(obj)); + }); + t.IsBackground = true; + t.Start(); + threadReady.CheckedWait(); + t.Interrupt(); + waitForThread(); + } + } } } diff --git a/src/libraries/System.Threading/tests/System.Threading.Tests.csproj b/src/libraries/System.Threading/tests/System.Threading.Tests.csproj index c4bb4f6191835e..e938db9863da3d 100644 --- a/src/libraries/System.Threading/tests/System.Threading.Tests.csproj +++ b/src/libraries/System.Threading/tests/System.Threading.Tests.csproj @@ -4,6 +4,8 @@ true $(NetCoreAppCurrent) true + + true @@ -14,9 +16,10 @@ - + + diff --git a/src/mono/System.Private.CoreLib/src/System/Threading/Monitor.Mono.cs b/src/mono/System.Private.CoreLib/src/System/Threading/Monitor.Mono.cs index 96424ec2bffa9a..fe81b79959f090 100644 --- a/src/mono/System.Private.CoreLib/src/System/Threading/Monitor.Mono.cs +++ b/src/mono/System.Private.CoreLib/src/System/Threading/Monitor.Mono.cs @@ -145,10 +145,11 @@ private static void ReliableEnterTimeout(object obj, int timeout, ref bool lockT try_enter_with_atomic_var(obj, timeout, true, ref lockTaken); } - public static extern long LockContentionCount - { - [MethodImplAttribute(MethodImplOptions.InternalCall)] - get; - } +#pragma warning disable CA2252 // Opt in to preview features before using them (Lock) + public static long LockContentionCount => Monitor_get_lock_contention_count() + Lock.ContentionCount; +#pragma warning restore CA2252 + + [MethodImplAttribute(MethodImplOptions.InternalCall)] + private static extern long Monitor_get_lock_contention_count(); } } diff --git a/src/mono/System.Private.CoreLib/src/System/Threading/TimerQueue.Browser.Mono.cs b/src/mono/System.Private.CoreLib/src/System/Threading/TimerQueue.Browser.Mono.cs index f4c7f64f89fe1c..9d9a422e56f7b2 100644 --- a/src/mono/System.Private.CoreLib/src/System/Threading/TimerQueue.Browser.Mono.cs +++ b/src/mono/System.Private.CoreLib/src/System/Threading/TimerQueue.Browser.Mono.cs @@ -16,7 +16,7 @@ namespace System.Threading // internal partial class TimerQueue { - private static long TickCount64 => Environment.TickCount64; + public static long TickCount64 => Environment.TickCount64; private static List? s_scheduledTimers; private static List? s_scheduledTimersToFire; private static long s_shortestDueTimeMs = long.MaxValue; diff --git a/src/mono/mono/metadata/icall-def.h b/src/mono/mono/metadata/icall-def.h index 0c5300aeb38d61..b18d285c421ca0 100644 --- a/src/mono/mono/metadata/icall-def.h +++ b/src/mono/mono/metadata/icall-def.h @@ -589,10 +589,10 @@ NOHANDLES(ICALL(LIFOSEM_4, "TimedWaitInternal", ves_icall_System_Threading_LowLe ICALL_TYPE(MONIT, "System.Threading.Monitor", MONIT_0) HANDLES(MONIT_0, "Enter", ves_icall_System_Threading_Monitor_Monitor_Enter, void, 1, (MonoObject)) HANDLES(MONIT_1, "InternalExit", mono_monitor_exit_icall, void, 1, (MonoObject)) +NOHANDLES(ICALL(MONIT_8, "Monitor_get_lock_contention_count", ves_icall_System_Threading_Monitor_Monitor_get_lock_contention_count)) HANDLES(MONIT_2, "Monitor_pulse", ves_icall_System_Threading_Monitor_Monitor_pulse, void, 1, (MonoObject)) HANDLES(MONIT_3, "Monitor_pulse_all", ves_icall_System_Threading_Monitor_Monitor_pulse_all, void, 1, (MonoObject)) HANDLES(MONIT_7, "Monitor_wait", ves_icall_System_Threading_Monitor_Monitor_wait, MonoBoolean, 3, (MonoObject, guint32, MonoBoolean)) -NOHANDLES(ICALL(MONIT_8, "get_LockContentionCount", ves_icall_System_Threading_Monitor_Monitor_LockContentionCount)) HANDLES(MONIT_9, "try_enter_with_atomic_var", ves_icall_System_Threading_Monitor_Monitor_try_enter_with_atomic_var, void, 4, (MonoObject, guint32, MonoBoolean, MonoBoolean_ref)) ICALL_TYPE(THREAD, "System.Threading.Thread", THREAD_1) diff --git a/src/mono/mono/metadata/monitor.c b/src/mono/mono/metadata/monitor.c index 1e861f8dec1b8e..6a72695e9fbedc 100644 --- a/src/mono/mono/metadata/monitor.c +++ b/src/mono/mono/metadata/monitor.c @@ -1434,7 +1434,7 @@ ves_icall_System_Threading_Monitor_Monitor_Enter (MonoObjectHandle obj, MonoErro } gint64 -ves_icall_System_Threading_Monitor_Monitor_LockContentionCount (void) +ves_icall_System_Threading_Monitor_Monitor_get_lock_contention_count (void) { return thread_contentions; } diff --git a/src/mono/mono/metadata/monitor.h b/src/mono/mono/metadata/monitor.h index f9be43d681f77b..d1900a889976da 100644 --- a/src/mono/mono/metadata/monitor.h +++ b/src/mono/mono/metadata/monitor.h @@ -129,7 +129,7 @@ mono_monitor_threads_sync_members_offset (int *status_offset, int *nest_offset); ICALL_EXPORT gint64 -ves_icall_System_Threading_Monitor_Monitor_LockContentionCount (void); +ves_icall_System_Threading_Monitor_Monitor_get_lock_contention_count (void); #ifdef HOST_WASM void diff --git a/src/native/libs/System.Native/entrypoints.c b/src/native/libs/System.Native/entrypoints.c index 8491ab83c4681b..f4fcd6f8d4d86c 100644 --- a/src/native/libs/System.Native/entrypoints.c +++ b/src/native/libs/System.Native/entrypoints.c @@ -275,6 +275,8 @@ static const Entry s_sysNative[] = DllImportEntry(SystemNative_GetEnviron) DllImportEntry(SystemNative_FreeEnviron) DllImportEntry(SystemNative_GetGroupName) + DllImportEntry(SystemNative_GetUInt64OSThreadId) + DllImportEntry(SystemNative_TryGetUInt32OSThreadId) }; EXTERN_C const void* SystemResolveDllImport(const char* name); diff --git a/src/native/libs/System.Native/pal_threading.c b/src/native/libs/System.Native/pal_threading.c index 6b2f0883632ac3..c96c7e8abd558c 100644 --- a/src/native/libs/System.Native/pal_threading.c +++ b/src/native/libs/System.Native/pal_threading.c @@ -277,3 +277,51 @@ void SystemNative_Abort(void) { abort(); } + +// Gets a non-truncated OS thread ID that is also suitable for diagnostics, for platforms that offer a 64-bit ID +uint64_t SystemNative_GetUInt64OSThreadId(void) +{ +#ifdef __APPLE__ + uint64_t threadId; + int result = pthread_threadid_np(pthread_self(), &threadId); + assert(result == 0); + return threadId; +#else + assert(false); + return 0; +#endif +} + +#if defined(__linux__) +#include +#include +#elif defined(__FreeBSD__) +#include +#elif defined(__NetBSD__) +#include +#endif + +// Tries to get a non-truncated OS thread ID that is also suitable for diagnostics, for platforms that offer a 32-bit ID. +// Returns (uint32_t)-1 when the implementation does not know how to get the OS thread ID. +uint32_t SystemNative_TryGetUInt32OSThreadId(void) +{ + const uint32_t InvalidId = (uint32_t)-1; + +#if defined(__linux__) + assert(sizeof(pid_t) == sizeof(uint32_t)); + uint32_t threadId = (uint32_t)syscall(SYS_gettid); + assert(threadId != InvalidId); + return threadId; +#elif defined(__FreeBSD__) + uint32_t threadId = (uint32_t)pthread_getthreadid_np(); + assert(threadId != InvalidId); + return threadId; +#elif defined(__NetBSD__) + assert(sizeof(lwpid_t) == sizeof(uint32_t)); + uint32_t threadId = (uint32_t)_lwp_self(); + assert(threadId != InvalidId); + return threadId; +#else + return InvalidId; +#endif +} diff --git a/src/native/libs/System.Native/pal_threading.h b/src/native/libs/System.Native/pal_threading.h index a3b336acd0461b..fb79aaf5928751 100644 --- a/src/native/libs/System.Native/pal_threading.h +++ b/src/native/libs/System.Native/pal_threading.h @@ -29,3 +29,6 @@ PALEXPORT int32_t SystemNative_SchedGetCpu(void); PALEXPORT __attribute__((noreturn)) void SystemNative_Exit(int32_t exitCode); PALEXPORT __attribute__((noreturn)) void SystemNative_Abort(void); + +PALEXPORT uint64_t SystemNative_GetUInt64OSThreadId(void); +PALEXPORT uint32_t SystemNative_TryGetUInt32OSThreadId(void); diff --git a/src/native/libs/System.Native/pal_threading_wasi.c b/src/native/libs/System.Native/pal_threading_wasi.c index 1f82d256ef7ac8..83fec6be55073b 100644 --- a/src/native/libs/System.Native/pal_threading_wasi.c +++ b/src/native/libs/System.Native/pal_threading_wasi.c @@ -80,3 +80,17 @@ void SystemNative_Abort(void) { abort(); } + +// Gets a non-truncated OS thread ID that is also suitable for diagnostics, for platforms that offer a 64-bit ID +uint64_t SystemNative_GetUInt64OSThreadId(void) +{ + assert(false); + return 0; +} + +// Tries to get a non-truncated OS thread ID that is also suitable for diagnostics, for platforms that offer a 32-bit ID. +// Returns (uint32_t)-1 when the implementation does not know how to get the OS thread ID. +uint32_t SystemNative_TryGetUInt32OSThreadId(void) +{ + return (uint32_t)-1; +} From 4b5756da32d94c77d8d2d9beb03135503c74cdf2 Mon Sep 17 00:00:00 2001 From: Will Smith Date: Mon, 30 Oct 2023 14:32:52 -0700 Subject: [PATCH 43/47] Arm64: Implement LoadVector64x*AndUnzip and LoadVector128x*AndUnzip APIs (#94128) * Initial LoadVector64/128AndUnzip APIs * Added hwintrinsics * Added generating tests * Fix semi * Whitespace * Whitespace * Whitespace * Whitespace * Whitespace * Whitespace * Fix test generation * fix missing cases in gentree * Minor formatting of the test generator * Fix comments * Fixing up tests * Use the right register variants --- src/coreclr/jit/gentree.cpp | 6 + src/coreclr/jit/hwintrinsic.h | 6 + src/coreclr/jit/hwintrinsicarm64.cpp | 6 + src/coreclr/jit/hwintrinsiclistarm64.h | 6 + src/coreclr/jit/lsraarm64.cpp | 6 + .../Arm/AdvSimd.PlatformNotSupported.cs | 255 ++++++++++++++++++ .../System/Runtime/Intrinsics/Arm/AdvSimd.cs | 255 ++++++++++++++++++ .../ref/System.Runtime.Intrinsics.cs | 51 ++++ .../GenerateHWIntrinsicTests_Arm.cs | 53 +++- 9 files changed, 643 insertions(+), 1 deletion(-) diff --git a/src/coreclr/jit/gentree.cpp b/src/coreclr/jit/gentree.cpp index 1d5ed98d0b4910..48d76cf396edb9 100644 --- a/src/coreclr/jit/gentree.cpp +++ b/src/coreclr/jit/gentree.cpp @@ -25852,6 +25852,7 @@ ClassLayout* GenTreeHWIntrinsic::GetLayout(Compiler* compiler) const case NI_AdvSimd_Arm64_LoadPairScalarVector64NonTemporal: case NI_AdvSimd_Arm64_LoadPairVector64: case NI_AdvSimd_Arm64_LoadPairVector64NonTemporal: + case NI_AdvSimd_LoadVector64x2AndUnzip: case NI_AdvSimd_LoadVector64x2: case NI_AdvSimd_LoadAndInsertScalarVector64x2: case NI_AdvSimd_LoadAndReplicateToVector64x2: @@ -25859,24 +25860,29 @@ ClassLayout* GenTreeHWIntrinsic::GetLayout(Compiler* compiler) const case NI_AdvSimd_Arm64_LoadPairVector128: case NI_AdvSimd_Arm64_LoadPairVector128NonTemporal: + case NI_AdvSimd_Arm64_LoadVector128x2AndUnzip: case NI_AdvSimd_Arm64_LoadVector128x2: case NI_AdvSimd_LoadVector64x4: + case NI_AdvSimd_LoadVector64x4AndUnzip: case NI_AdvSimd_LoadAndReplicateToVector64x4: case NI_AdvSimd_Arm64_LoadAndReplicateToVector128x2: case NI_AdvSimd_Arm64_LoadAndInsertScalarVector128x2: case NI_AdvSimd_LoadAndInsertScalarVector64x4: return compiler->typGetBlkLayout(32); + case NI_AdvSimd_LoadVector64x3AndUnzip: case NI_AdvSimd_LoadVector64x3: case NI_AdvSimd_LoadAndInsertScalarVector64x3: case NI_AdvSimd_LoadAndReplicateToVector64x3: return compiler->typGetBlkLayout(24); + case NI_AdvSimd_Arm64_LoadVector128x3AndUnzip: case NI_AdvSimd_Arm64_LoadVector128x3: case NI_AdvSimd_Arm64_LoadAndInsertScalarVector128x3: case NI_AdvSimd_Arm64_LoadAndReplicateToVector128x3: return compiler->typGetBlkLayout(48); + case NI_AdvSimd_Arm64_LoadVector128x4AndUnzip: case NI_AdvSimd_Arm64_LoadVector128x4: case NI_AdvSimd_Arm64_LoadAndInsertScalarVector128x4: case NI_AdvSimd_Arm64_LoadAndReplicateToVector128x4: diff --git a/src/coreclr/jit/hwintrinsic.h b/src/coreclr/jit/hwintrinsic.h index 4695af2a770963..d3dc426133d36d 100644 --- a/src/coreclr/jit/hwintrinsic.h +++ b/src/coreclr/jit/hwintrinsic.h @@ -768,6 +768,8 @@ struct HWIntrinsicInfo case NI_AdvSimd_Arm64_LoadPairVector64NonTemporal: case NI_AdvSimd_Arm64_LoadPairVector128: case NI_AdvSimd_Arm64_LoadPairVector128NonTemporal: + case NI_AdvSimd_LoadVector64x2AndUnzip: + case NI_AdvSimd_Arm64_LoadVector128x2AndUnzip: case NI_AdvSimd_LoadVector64x2: case NI_AdvSimd_Arm64_LoadVector128x2: case NI_AdvSimd_LoadAndInsertScalarVector64x2: @@ -776,6 +778,8 @@ struct HWIntrinsicInfo case NI_AdvSimd_Arm64_LoadAndReplicateToVector128x2: return 2; + case NI_AdvSimd_LoadVector64x3AndUnzip: + case NI_AdvSimd_Arm64_LoadVector128x3AndUnzip: case NI_AdvSimd_LoadVector64x3: case NI_AdvSimd_Arm64_LoadVector128x3: case NI_AdvSimd_LoadAndInsertScalarVector64x3: @@ -784,6 +788,8 @@ struct HWIntrinsicInfo case NI_AdvSimd_Arm64_LoadAndReplicateToVector128x3: return 3; + case NI_AdvSimd_LoadVector64x4AndUnzip: + case NI_AdvSimd_Arm64_LoadVector128x4AndUnzip: case NI_AdvSimd_LoadVector64x4: case NI_AdvSimd_Arm64_LoadVector128x4: case NI_AdvSimd_LoadAndInsertScalarVector64x4: diff --git a/src/coreclr/jit/hwintrinsicarm64.cpp b/src/coreclr/jit/hwintrinsicarm64.cpp index 01f64f47ce3cc5..15b9510b0f4b60 100644 --- a/src/coreclr/jit/hwintrinsicarm64.cpp +++ b/src/coreclr/jit/hwintrinsicarm64.cpp @@ -1883,6 +1883,12 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic, break; } + case NI_AdvSimd_LoadVector64x2AndUnzip: + case NI_AdvSimd_LoadVector64x3AndUnzip: + case NI_AdvSimd_LoadVector64x4AndUnzip: + case NI_AdvSimd_Arm64_LoadVector128x2AndUnzip: + case NI_AdvSimd_Arm64_LoadVector128x3AndUnzip: + case NI_AdvSimd_Arm64_LoadVector128x4AndUnzip: case NI_AdvSimd_LoadVector64x2: case NI_AdvSimd_LoadVector64x3: case NI_AdvSimd_LoadVector64x4: diff --git a/src/coreclr/jit/hwintrinsiclistarm64.h b/src/coreclr/jit/hwintrinsiclistarm64.h index c704f4e080c510..c68ddab429ceae 100644 --- a/src/coreclr/jit/hwintrinsiclistarm64.h +++ b/src/coreclr/jit/hwintrinsiclistarm64.h @@ -326,6 +326,9 @@ HARDWARE_INTRINSIC(AdvSimd, LoadAndReplicateToVector64x3, HARDWARE_INTRINSIC(AdvSimd, LoadAndReplicateToVector64x4, 8, 1, true, {INS_ld4r, INS_ld4r, INS_ld4r, INS_ld4r, INS_ld4r, INS_ld4r, INS_invalid, INS_invalid, INS_ld4r, INS_invalid}, HW_Category_MemoryLoad, HW_Flag_BaseTypeFromFirstArg|HW_Flag_SpecialImport|HW_Flag_MultiReg|HW_Flag_NeedsConsecutiveRegisters) HARDWARE_INTRINSIC(AdvSimd, LoadVector64, 8, 1, true, {INS_ld1, INS_ld1, INS_ld1, INS_ld1, INS_ld1, INS_ld1, INS_ld1, INS_ld1, INS_ld1, INS_ld1}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen) HARDWARE_INTRINSIC(AdvSimd, LoadVector128, 16, 1, true, {INS_ld1, INS_ld1, INS_ld1, INS_ld1, INS_ld1, INS_ld1, INS_ld1, INS_ld1, INS_ld1, INS_ld1}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_NoCodeGen) +HARDWARE_INTRINSIC(AdvSimd, LoadVector64x2AndUnzip, 8, 1, true, {INS_ld1_2regs, INS_ld1_2regs, INS_ld1_2regs, INS_ld1_2regs, INS_ld1_2regs, INS_ld1_2regs, INS_invalid, INS_invalid, INS_ld1_2regs, INS_invalid}, HW_Category_MemoryLoad, HW_Flag_BaseTypeFromFirstArg|HW_Flag_SpecialImport|HW_Flag_MultiReg|HW_Flag_NeedsConsecutiveRegisters) +HARDWARE_INTRINSIC(AdvSimd, LoadVector64x3AndUnzip, 8, 1, true, {INS_ld1_3regs, INS_ld1_3regs, INS_ld1_3regs, INS_ld1_3regs, INS_ld1_3regs, INS_ld1_3regs, INS_invalid, INS_invalid, INS_ld1_3regs, INS_invalid}, HW_Category_MemoryLoad, HW_Flag_BaseTypeFromFirstArg|HW_Flag_SpecialImport|HW_Flag_MultiReg|HW_Flag_NeedsConsecutiveRegisters) +HARDWARE_INTRINSIC(AdvSimd, LoadVector64x4AndUnzip, 8, 1, true, {INS_ld1_4regs, INS_ld1_4regs, INS_ld1_4regs, INS_ld1_4regs, INS_ld1_4regs, INS_ld1_4regs, INS_invalid, INS_invalid, INS_ld1_4regs, INS_invalid}, HW_Category_MemoryLoad, HW_Flag_BaseTypeFromFirstArg|HW_Flag_SpecialImport|HW_Flag_MultiReg|HW_Flag_NeedsConsecutiveRegisters) HARDWARE_INTRINSIC(AdvSimd, LoadVector64x2, 8, 1, true, {INS_ld2, INS_ld2, INS_ld2, INS_ld2, INS_ld2, INS_ld2, INS_invalid, INS_invalid, INS_ld2, INS_invalid}, HW_Category_MemoryLoad, HW_Flag_BaseTypeFromFirstArg|HW_Flag_SpecialImport|HW_Flag_MultiReg|HW_Flag_NeedsConsecutiveRegisters) HARDWARE_INTRINSIC(AdvSimd, LoadVector64x3, 8, 1, true, {INS_ld3, INS_ld3, INS_ld3, INS_ld3, INS_ld3, INS_ld3, INS_invalid, INS_invalid, INS_ld3, INS_invalid}, HW_Category_MemoryLoad, HW_Flag_BaseTypeFromFirstArg|HW_Flag_SpecialImport|HW_Flag_MultiReg|HW_Flag_NeedsConsecutiveRegisters) HARDWARE_INTRINSIC(AdvSimd, LoadVector64x4, 8, 1, true, {INS_ld4, INS_ld4, INS_ld4, INS_ld4, INS_ld4, INS_ld4, INS_invalid, INS_invalid, INS_ld4, INS_invalid}, HW_Category_MemoryLoad, HW_Flag_BaseTypeFromFirstArg|HW_Flag_SpecialImport|HW_Flag_MultiReg|HW_Flag_NeedsConsecutiveRegisters) @@ -589,6 +592,9 @@ HARDWARE_INTRINSIC(AdvSimd_Arm64, LoadAndInsertScalar, HARDWARE_INTRINSIC(AdvSimd_Arm64, LoadAndInsertScalarVector128x2, 16, 3, true, {INS_ld2, INS_ld2, INS_ld2, INS_ld2, INS_ld2, INS_ld2, INS_ld2, INS_ld2, INS_ld2, INS_ld2}, HW_Category_MemoryLoad, HW_Flag_HasImmediateOperand|HW_Flag_SpecialImport|HW_Flag_HasRMWSemantics|HW_Flag_SIMDScalar|HW_Flag_SpecialCodeGen|HW_Flag_MultiReg|HW_Flag_NeedsConsecutiveRegisters) HARDWARE_INTRINSIC(AdvSimd_Arm64, LoadAndInsertScalarVector128x3, 16, 3, true, {INS_ld3, INS_ld3, INS_ld3, INS_ld3, INS_ld3, INS_ld3, INS_ld3, INS_ld3, INS_ld3, INS_ld3}, HW_Category_MemoryLoad, HW_Flag_HasImmediateOperand|HW_Flag_SpecialImport|HW_Flag_HasRMWSemantics|HW_Flag_SIMDScalar|HW_Flag_SpecialCodeGen|HW_Flag_MultiReg|HW_Flag_NeedsConsecutiveRegisters) HARDWARE_INTRINSIC(AdvSimd_Arm64, LoadAndInsertScalarVector128x4, 16, 3, true, {INS_ld4, INS_ld4, INS_ld4, INS_ld4, INS_ld4, INS_ld4, INS_ld4, INS_ld4, INS_ld4, INS_ld4}, HW_Category_MemoryLoad, HW_Flag_HasImmediateOperand|HW_Flag_SpecialImport|HW_Flag_HasRMWSemantics|HW_Flag_SIMDScalar|HW_Flag_SpecialCodeGen|HW_Flag_MultiReg|HW_Flag_NeedsConsecutiveRegisters) +HARDWARE_INTRINSIC(AdvSimd_Arm64, LoadVector128x2AndUnzip, 16, 1, true, {INS_ld1_2regs, INS_ld1_2regs, INS_ld1_2regs, INS_ld1_2regs, INS_ld1_2regs, INS_ld1_2regs, INS_ld1_2regs, INS_ld1_2regs, INS_ld1_2regs, INS_ld1_2regs}, HW_Category_MemoryLoad, HW_Flag_BaseTypeFromFirstArg|HW_Flag_SpecialImport|HW_Flag_MultiReg|HW_Flag_NeedsConsecutiveRegisters) +HARDWARE_INTRINSIC(AdvSimd_Arm64, LoadVector128x3AndUnzip, 16, 1, true, {INS_ld1_3regs, INS_ld1_3regs, INS_ld1_3regs, INS_ld1_3regs, INS_ld1_3regs, INS_ld1_3regs, INS_ld1_3regs, INS_ld1_3regs, INS_ld1_3regs, INS_ld1_3regs}, HW_Category_MemoryLoad, HW_Flag_BaseTypeFromFirstArg|HW_Flag_SpecialImport|HW_Flag_MultiReg|HW_Flag_NeedsConsecutiveRegisters) +HARDWARE_INTRINSIC(AdvSimd_Arm64, LoadVector128x4AndUnzip, 16, 1, true, {INS_ld1_4regs, INS_ld1_4regs, INS_ld1_4regs, INS_ld1_4regs, INS_ld1_4regs, INS_ld1_4regs, INS_ld1_4regs, INS_ld1_4regs, INS_ld1_4regs, INS_ld1_4regs}, HW_Category_MemoryLoad, HW_Flag_BaseTypeFromFirstArg|HW_Flag_SpecialImport|HW_Flag_MultiReg|HW_Flag_NeedsConsecutiveRegisters) HARDWARE_INTRINSIC(AdvSimd_Arm64, LoadVector128x2, 16, 1, true, {INS_ld2, INS_ld2, INS_ld2, INS_ld2, INS_ld2, INS_ld2, INS_ld2, INS_ld2, INS_ld2, INS_ld2}, HW_Category_MemoryLoad, HW_Flag_BaseTypeFromFirstArg|HW_Flag_SpecialImport|HW_Flag_MultiReg|HW_Flag_NeedsConsecutiveRegisters) HARDWARE_INTRINSIC(AdvSimd_Arm64, LoadVector128x3, 16, 1, true, {INS_ld3, INS_ld3, INS_ld3, INS_ld3, INS_ld3, INS_ld3, INS_ld3, INS_ld3, INS_ld3, INS_ld3}, HW_Category_MemoryLoad, HW_Flag_BaseTypeFromFirstArg|HW_Flag_SpecialImport|HW_Flag_MultiReg|HW_Flag_NeedsConsecutiveRegisters) HARDWARE_INTRINSIC(AdvSimd_Arm64, LoadVector128x4, 16, 1, true, {INS_ld4, INS_ld4, INS_ld4, INS_ld4, INS_ld4, INS_ld4, INS_ld4, INS_ld4, INS_ld4, INS_ld4}, HW_Category_MemoryLoad, HW_Flag_BaseTypeFromFirstArg|HW_Flag_SpecialImport|HW_Flag_MultiReg|HW_Flag_NeedsConsecutiveRegisters) diff --git a/src/coreclr/jit/lsraarm64.cpp b/src/coreclr/jit/lsraarm64.cpp index 81bdd5334a54e3..e1907d4a3fa55e 100644 --- a/src/coreclr/jit/lsraarm64.cpp +++ b/src/coreclr/jit/lsraarm64.cpp @@ -1632,6 +1632,12 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree, int* pDstCou assert(intrinsicTree->OperIsMemoryLoadOrStore()); srcCount += BuildAddrUses(intrin.op3); FALLTHROUGH; + case NI_AdvSimd_LoadVector64x2AndUnzip: + case NI_AdvSimd_LoadVector64x3AndUnzip: + case NI_AdvSimd_LoadVector64x4AndUnzip: + case NI_AdvSimd_Arm64_LoadVector128x2AndUnzip: + case NI_AdvSimd_Arm64_LoadVector128x3AndUnzip: + case NI_AdvSimd_Arm64_LoadVector128x4AndUnzip: case NI_AdvSimd_LoadVector64x2: case NI_AdvSimd_LoadVector64x3: case NI_AdvSimd_LoadVector64x4: diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.PlatformNotSupported.cs index d386e1c299ee67..57fc22b034313a 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.PlatformNotSupported.cs @@ -2098,6 +2098,156 @@ internal Arm64() { } /// public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128NonTemporal(ulong* address) { throw new PlatformNotSupportedException(); } + /// + /// A64: LD1 { Vn.16B, Vn+1.16B }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2AndUnzip(byte* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.16B, Vn+1.16B }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2AndUnzip(sbyte* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.8H, Vn+1.8H }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2AndUnzip(short* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.8H, Vn+1.8H }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2AndUnzip(ushort* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2AndUnzip(int* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2AndUnzip(uint* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.2D, Vn+1.2D }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2AndUnzip(long* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.2D, Vn+1.2D }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2AndUnzip(ulong* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2AndUnzip(float* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.2D, Vn+1.2D }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2AndUnzip(double* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3AndUnzip(byte* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3AndUnzip(sbyte* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3AndUnzip(short* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3AndUnzip(ushort* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3AndUnzip(int* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3AndUnzip(uint* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3AndUnzip(long* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3AndUnzip(ulong* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3AndUnzip(float* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3AndUnzip(double* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4AndUnzip(byte* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4AndUnzip(sbyte* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4AndUnzip(short* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4AndUnzip(ushort* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4AndUnzip(int* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4AndUnzip(uint* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4AndUnzip(long* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4AndUnzip(ulong* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4AndUnzip(float* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4AndUnzip(double* address) { throw new PlatformNotSupportedException(); } + /// /// A64: LD2 { Vn.16B, Vn+1.16B }, [Xn] /// @@ -9037,6 +9187,111 @@ internal Arm64() { } /// public static unsafe Vector128 LoadVector128(ulong* address) { throw new PlatformNotSupportedException(); } + /// + /// A64: LD1 { Vn.16B, Vn+1.16B }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2AndUnzip(byte* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.16B, Vn+1.16B }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2AndUnzip(sbyte* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.8H, Vn+1.8H }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2AndUnzip(short* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.8H, Vn+1.8H }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2AndUnzip(ushort* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2AndUnzip(int* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2AndUnzip(uint* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2AndUnzip(float* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3AndUnzip(byte* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3AndUnzip(sbyte* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3AndUnzip(short* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3AndUnzip(ushort* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3AndUnzip(int* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3AndUnzip(uint* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3AndUnzip(float* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4AndUnzip(byte* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4AndUnzip(sbyte* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4AndUnzip(short* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4AndUnzip(ushort* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4AndUnzip(int* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4AndUnzip(uint* address) { throw new PlatformNotSupportedException(); } + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4AndUnzip(float* address) { throw new PlatformNotSupportedException(); } + /// /// A64: LD2 { Vn.16B, Vn+1.16B }, [Xn] /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.cs index 7ad85399285d1c..b8243b0693aa64 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.cs @@ -2096,6 +2096,156 @@ internal Arm64() { } /// public static unsafe (Vector128 Value1, Vector128 Value2) LoadPairVector128NonTemporal(ulong* address) => LoadPairVector128NonTemporal(address); + /// + /// A64: LD1 { Vn.16B, Vn+1.16B }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2AndUnzip(byte* address) => LoadVector128x2AndUnzip(address); + + /// + /// A64: LD1 { Vn.16B, Vn+1.16B }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2AndUnzip(sbyte* address) => LoadVector128x2AndUnzip(address); + + /// + /// A64: LD1 { Vn.8H, Vn+1.8H }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2AndUnzip(short* address) => LoadVector128x2AndUnzip(address); + + /// + /// A64: LD1 { Vn.8H, Vn+1.8H }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2AndUnzip(ushort* address) => LoadVector128x2AndUnzip(address); + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2AndUnzip(int* address) => LoadVector128x2AndUnzip(address); + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2AndUnzip(uint* address) => LoadVector128x2AndUnzip(address); + + /// + /// A64: LD1 { Vn.2D, Vn+1.2D }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2AndUnzip(long* address) => LoadVector128x2AndUnzip(address); + + /// + /// A64: LD1 { Vn.2D, Vn+1.2D }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2AndUnzip(ulong* address) => LoadVector128x2AndUnzip(address); + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2AndUnzip(float* address) => LoadVector128x2AndUnzip(address); + + /// + /// A64: LD1 { Vn.2D, Vn+1.2D }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2AndUnzip(double* address) => LoadVector128x2AndUnzip(address); + + /// + /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3AndUnzip(byte* address) => LoadVector128x3AndUnzip(address); + + /// + /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3AndUnzip(sbyte* address) => LoadVector128x3AndUnzip(address); + + /// + /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3AndUnzip(short* address) => LoadVector128x3AndUnzip(address); + + /// + /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3AndUnzip(ushort* address) => LoadVector128x3AndUnzip(address); + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3AndUnzip(int* address) => LoadVector128x3AndUnzip(address); + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3AndUnzip(uint* address) => LoadVector128x3AndUnzip(address); + + /// + /// A64: LD1 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3AndUnzip(long* address) => LoadVector128x3AndUnzip(address); + + /// + /// A64: LD1 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3AndUnzip(ulong* address) => LoadVector128x3AndUnzip(address); + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3AndUnzip(float* address) => LoadVector128x3AndUnzip(address); + + /// + /// A64: LD1 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3AndUnzip(double* address) => LoadVector128x3AndUnzip(address); + + /// + /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4AndUnzip(byte* address) => LoadVector128x4AndUnzip(address); + + /// + /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4AndUnzip(sbyte* address) => LoadVector128x4AndUnzip(address); + + /// + /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4AndUnzip(short* address) => LoadVector128x4AndUnzip(address); + + /// + /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4AndUnzip(ushort* address) => LoadVector128x4AndUnzip(address); + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4AndUnzip(int* address) => LoadVector128x4AndUnzip(address); + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4AndUnzip(uint* address) => LoadVector128x4AndUnzip(address); + + /// + /// A64: LD1 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4AndUnzip(long* address) => LoadVector128x4AndUnzip(address); + + /// + /// A64: LD1 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4AndUnzip(ulong* address) => LoadVector128x4AndUnzip(address); + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4AndUnzip(float* address) => LoadVector128x4AndUnzip(address); + + /// + /// A64: LD1 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] + /// + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4AndUnzip(double* address) => LoadVector128x4AndUnzip(address); + /// /// A64: LD2 { Vn.16B, Vn+1.16B }, [Xn] /// @@ -9034,6 +9184,111 @@ internal Arm64() { } /// public static unsafe Vector128 LoadVector128(ulong* address) => LoadVector128(address); + /// + /// A64: LD1 { Vn.16B, Vn+1.16B }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2AndUnzip(byte* address) => LoadVector64x2AndUnzip(address); + + /// + /// A64: LD1 { Vn.16B, Vn+1.16B }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2AndUnzip(sbyte* address) => LoadVector64x2AndUnzip(address); + + /// + /// A64: LD1 { Vn.8H, Vn+1.8H }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2AndUnzip(short* address) => LoadVector64x2AndUnzip(address); + + /// + /// A64: LD1 { Vn.8H, Vn+1.8H }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2AndUnzip(ushort* address) => LoadVector64x2AndUnzip(address); + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2AndUnzip(int* address) => LoadVector64x2AndUnzip(address); + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2AndUnzip(uint* address) => LoadVector64x2AndUnzip(address); + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2AndUnzip(float* address) => LoadVector64x2AndUnzip(address); + + /// + /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3AndUnzip(byte* address) => LoadVector64x3AndUnzip(address); + + /// + /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3AndUnzip(sbyte* address) => LoadVector64x3AndUnzip(address); + + /// + /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3AndUnzip(short* address) => LoadVector64x3AndUnzip(address); + + /// + /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3AndUnzip(ushort* address) => LoadVector64x3AndUnzip(address); + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3AndUnzip(int* address) => LoadVector64x3AndUnzip(address); + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3AndUnzip(uint* address) => LoadVector64x3AndUnzip(address); + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3AndUnzip(float* address) => LoadVector64x3AndUnzip(address); + + /// + /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4AndUnzip(byte* address) => LoadVector64x4AndUnzip(address); + + /// + /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4AndUnzip(sbyte* address) => LoadVector64x4AndUnzip(address); + + /// + /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4AndUnzip(short* address) => LoadVector64x4AndUnzip(address); + + /// + /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4AndUnzip(ushort* address) => LoadVector64x4AndUnzip(address); + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4AndUnzip(int* address) => LoadVector64x4AndUnzip(address); + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4AndUnzip(uint* address) => LoadVector64x4AndUnzip(address); + + /// + /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4AndUnzip(float* address) => LoadVector64x4AndUnzip(address); + /// /// A64: LD2 { Vn.16B, Vn+1.16B }, [Xn] /// diff --git a/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs b/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs index 8e9a0a50fbf275..e0f07a1441e248 100644 --- a/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs +++ b/src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs @@ -1960,6 +1960,27 @@ internal AdvSimd() { } public static unsafe System.Runtime.Intrinsics.Vector64 LoadVector64(ushort* address) { throw null; } public static unsafe System.Runtime.Intrinsics.Vector64 LoadVector64(uint* address) { throw null; } public static unsafe System.Runtime.Intrinsics.Vector64 LoadVector64(ulong* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadVector64x2AndUnzip(byte* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadVector64x2AndUnzip(sbyte* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadVector64x2AndUnzip(short* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadVector64x2AndUnzip(ushort* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadVector64x2AndUnzip(int* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadVector64x2AndUnzip(uint* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadVector64x2AndUnzip(float* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadVector64x3AndUnzip(byte* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadVector64x3AndUnzip(sbyte* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadVector64x3AndUnzip(short* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadVector64x3AndUnzip(ushort* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadVector64x3AndUnzip(int* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadVector64x3AndUnzip(uint* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadVector64x3AndUnzip(float* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadVector64x4AndUnzip(byte* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadVector64x4AndUnzip(sbyte* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadVector64x4AndUnzip(short* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadVector64x4AndUnzip(ushort* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadVector64x4AndUnzip(int* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadVector64x4AndUnzip(uint* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadVector64x4AndUnzip(float* address) { throw null; } public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadVector64x2(byte* address) { throw null; } public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadVector64x2(sbyte* address) { throw null; } public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadVector64x2(short* address) { throw null; } @@ -3335,6 +3356,36 @@ internal Arm64() { } public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadPairVector64NonTemporal(ushort* address) { throw null; } public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadPairVector64NonTemporal(uint* address) { throw null; } public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadPairVector64NonTemporal(ulong* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadVector128x2AndUnzip(byte* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadVector128x2AndUnzip(sbyte* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadVector128x2AndUnzip(short* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadVector128x2AndUnzip(ushort* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadVector128x2AndUnzip(int* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadVector128x2AndUnzip(uint* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadVector128x2AndUnzip(long* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadVector128x2AndUnzip(ulong* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadVector128x2AndUnzip(float* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadVector128x2AndUnzip(double* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadVector128x3AndUnzip(byte* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadVector128x3AndUnzip(sbyte* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadVector128x3AndUnzip(short* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadVector128x3AndUnzip(ushort* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadVector128x3AndUnzip(int* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadVector128x3AndUnzip(uint* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadVector128x3AndUnzip(long* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadVector128x3AndUnzip(ulong* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadVector128x3AndUnzip(float* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadVector128x3AndUnzip(double* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadVector128x4AndUnzip(byte* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadVector128x4AndUnzip(sbyte* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadVector128x4AndUnzip(short* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadVector128x4AndUnzip(ushort* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadVector128x4AndUnzip(int* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadVector128x4AndUnzip(uint* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadVector128x4AndUnzip(long* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadVector128x4AndUnzip(ulong* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadVector128x4AndUnzip(float* address) { throw null; } + public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadVector128x4AndUnzip(double* address) { throw null; } public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadVector128x2(byte* address) { throw null; } public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadVector128x2(sbyte* address) { throw null; } public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadVector128x2(short* address) { throw null; } diff --git a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs index 894fb2b159eb91..1510d5f84581ff 100644 --- a/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs +++ b/src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs @@ -790,6 +790,27 @@ ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector128_UInt16", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector128_UInt32", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), ("LoadUnOpTest.template", new Dictionary { ["TestName"] = "LoadVector128_UInt64", ["Isa"] = "AdvSimd", ["Method"] = "LoadVector128", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("LoadVectorx2Test.template", new Dictionary { ["TestName"] = "LoadVector64x2AndUnzipSByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector64x2AndUnzip", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 8]"}), + ("LoadVectorx2Test.template", new Dictionary { ["TestName"] = "LoadVector64x2AndUnzipByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector64x2AndUnzip", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 8]"}), + ("LoadVectorx2Test.template", new Dictionary { ["TestName"] = "LoadVector64x2AndUnzipUShort", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector64x2AndUnzip", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 4]"}), + ("LoadVectorx2Test.template", new Dictionary { ["TestName"] = "LoadVector64x2AndUnzipShort", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector64x2AndUnzip", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 4]"}), + ("LoadVectorx2Test.template", new Dictionary { ["TestName"] = "LoadVector64x2AndUnzipUInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector64x2AndUnzip", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 2]"}), + ("LoadVectorx2Test.template", new Dictionary { ["TestName"] = "LoadVector64x2AndUnzipInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector64x2AndUnzip", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 2]"}), + ("LoadVectorx2Test.template", new Dictionary { ["TestName"] = "LoadVector64x2AndUnzipFloat", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector64x2AndUnzip", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "float", ["LargestVectorSize"] = "8", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 2]"}), + ("LoadVectorx3Test.template", new Dictionary { ["TestName"] = "LoadVector64x3AndUnzipSByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector64x3AndUnzip", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 8] || result3[i] != input[i + 8 * 2]"}), + ("LoadVectorx3Test.template", new Dictionary { ["TestName"] = "LoadVector64x3AndUnzipByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector64x3AndUnzip", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 8] || result3[i] != input[i + 8 * 2]"}), + ("LoadVectorx3Test.template", new Dictionary { ["TestName"] = "LoadVector64x3AndUnzipUShort", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector64x3AndUnzip", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 4] || result3[i] != input[i + 4 * 2]"}), + ("LoadVectorx3Test.template", new Dictionary { ["TestName"] = "LoadVector64x3AndUnzipShort", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector64x3AndUnzip", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 4] || result3[i] != input[i + 4 * 2]"}), + ("LoadVectorx3Test.template", new Dictionary { ["TestName"] = "LoadVector64x3AndUnzipUInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector64x3AndUnzip", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 2] || result3[i] != input[i + 2 * 2]"}), + ("LoadVectorx3Test.template", new Dictionary { ["TestName"] = "LoadVector64x3AndUnzipInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector64x3AndUnzip", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 2] || result3[i] != input[i + 2 * 2]"}), + ("LoadVectorx3Test.template", new Dictionary { ["TestName"] = "LoadVector64x3AndUnzipFloat", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector64x3AndUnzip", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "float", ["LargestVectorSize"] = "8", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 2] || result3[i] != input[i + 2 * 2]"}), + ("LoadVectorx4Test.template", new Dictionary { ["TestName"] = "LoadVector64x4AndUnzipSByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector64x4AndUnzip", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 8] || result3[i] != input[i + 8 * 2] || result4[i] != input[i + 8 * 3]"}), + ("LoadVectorx4Test.template", new Dictionary { ["TestName"] = "LoadVector64x4AndUnzipByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector64x4AndUnzip", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 8] || result3[i] != input[i + 8 * 2] || result4[i] != input[i + 8 * 3]"}), + ("LoadVectorx4Test.template", new Dictionary { ["TestName"] = "LoadVector64x4AndUnzipUShort", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector64x4AndUnzip", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 4] || result3[i] != input[i + 4 * 2] || result4[i] != input[i + 4 * 3]"}), + ("LoadVectorx4Test.template", new Dictionary { ["TestName"] = "LoadVector64x4AndUnzipShort", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector64x4AndUnzip", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "8", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 4] || result3[i] != input[i + 4 * 2] || result4[i] != input[i + 4 * 3]"}), + ("LoadVectorx4Test.template", new Dictionary { ["TestName"] = "LoadVector64x4AndUnzipUInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector64x4AndUnzip", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "8", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 2] || result3[i] != input[i + 2 * 2] || result4[i] != input[i + 2 * 3]"}), + ("LoadVectorx4Test.template", new Dictionary { ["TestName"] = "LoadVector64x4AndUnzipInt32", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector64x4AndUnzip", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "8", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 2] || result3[i] != input[i + 2 * 2] || result4[i] != input[i + 2 * 3]"}), + ("LoadVectorx4Test.template", new Dictionary { ["TestName"] = "LoadVector64x4AndUnzipFloat", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector64x4AndUnzip", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "float", ["LargestVectorSize"] = "8", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 2] || result3[i] != input[i + 2 * 2] || result4[i] != input[i + 2 * 3]"}), ("LoadVectorx2Test.template", new Dictionary { ["TestName"] = "LoadVector64x2SByte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector64x2", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "8", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "result1[i] != input[i * 2] || result2[i] != input[(i * 2) + 1]"}), ("LoadVectorx2Test.template", new Dictionary { ["TestName"] = "LoadVector64x2Byte", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector64x2", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "8", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "result1[i] != input[i * 2] || result2[i] != input[(i * 2) + 1]"}), ("LoadVectorx2Test.template", new Dictionary { ["TestName"] = "LoadVector64x2UShort", ["Isa"] = "AdvSimd", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector64x2", ["Op1VectorType"] = "Vector64", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "8", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "result1[i] != input[i * 2] || result2[i] != input[(i * 2) + 1]"}), @@ -2167,7 +2188,37 @@ ("LoadPairVectorTest.template", new Dictionary { ["TestName"] = "LoadPairVector128NonTemporal_Single", ["Isa"] = "AdvSimd.Arm64", ["Method"] = "LoadPairVector128NonTemporal", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "32", ["NextValueOp1"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "BitConverter.DoubleToInt64Bits(firstOp[i]) != BitConverter.DoubleToInt64Bits(result[i])"}), ("LoadPairVectorTest.template", new Dictionary { ["TestName"] = "LoadPairVector128NonTemporal_UInt16", ["Isa"] = "AdvSimd.Arm64", ["Method"] = "LoadPairVector128NonTemporal", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "32", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), ("LoadPairVectorTest.template", new Dictionary { ["TestName"] = "LoadPairVector128NonTemporal_UInt32", ["Isa"] = "AdvSimd.Arm64", ["Method"] = "LoadPairVector128NonTemporal", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "32", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), - ("LoadPairVectorTest.template", new Dictionary { ["TestName"] = "LoadPairVector128NonTemporal_UInt64", ["Isa"] = "AdvSimd.Arm64", ["Method"] = "LoadPairVector128NonTemporal", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "32", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("LoadPairVectorTest.template", new Dictionary { ["TestName"] = "LoadPairVector128NonTemporal_UInt64", ["Isa"] = "AdvSimd.Arm64", ["Method"] = "LoadPairVector128NonTemporal", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "32", ["NextValueOp1"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "firstOp[i] != result[i]"}), + ("LoadVectorx2Test.template", new Dictionary { ["TestName"] = "LoadVector128x2AndUnzipSByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector128x2AndUnzip", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 16]"}), + ("LoadVectorx2Test.template", new Dictionary { ["TestName"] = "LoadVector128x2AndUnzipByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector128x2AndUnzip", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 16]"}), + ("LoadVectorx2Test.template", new Dictionary { ["TestName"] = "LoadVector128x2AndUnzipUShort", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector128x2AndUnzip", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 8]"}), + ("LoadVectorx2Test.template", new Dictionary { ["TestName"] = "LoadVector128x2AndUnzipShort", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector128x2AndUnzip", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 8]"}), + ("LoadVectorx2Test.template", new Dictionary { ["TestName"] = "LoadVector128x2AndUnzipUInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector128x2AndUnzip", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 4]"}), + ("LoadVectorx2Test.template", new Dictionary { ["TestName"] = "LoadVector128x2AndUnzipInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector128x2AndUnzip", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 4]"}), + ("LoadVectorx2Test.template", new Dictionary { ["TestName"] = "LoadVector128x2AndUnzipUInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector128x2AndUnzip", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 2]"}), + ("LoadVectorx2Test.template", new Dictionary { ["TestName"] = "LoadVector128x2AndUnzipInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector128x2AndUnzip", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 2]"}), + ("LoadVectorx2Test.template", new Dictionary { ["TestName"] = "LoadVector128x2AndUnzipFloat", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector128x2AndUnzip", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "float", ["LargestVectorSize"] = "16", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 4]"}), + ("LoadVectorx2Test.template", new Dictionary { ["TestName"] = "LoadVector128x2AndUnzipDouble", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector128x2AndUnzip", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "double", ["LargestVectorSize"] = "16", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 2]"}), + ("LoadVectorx3Test.template", new Dictionary { ["TestName"] = "LoadVector128x3AndUnzipSByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector128x3AndUnzip", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 16] || result3[i] != input[i + 16 * 2]"}), + ("LoadVectorx3Test.template", new Dictionary { ["TestName"] = "LoadVector128x3AndUnzipByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector128x3AndUnzip", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 16] || result3[i] != input[i + 16 * 2]"}), + ("LoadVectorx3Test.template", new Dictionary { ["TestName"] = "LoadVector128x3AndUnzipUShort", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector128x3AndUnzip", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 8] || result3[i] != input[i + 8 * 2]"}), + ("LoadVectorx3Test.template", new Dictionary { ["TestName"] = "LoadVector128x3AndUnzipShort", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector128x3AndUnzip", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 8] || result3[i] != input[i + 8 * 2]"}), + ("LoadVectorx3Test.template", new Dictionary { ["TestName"] = "LoadVector128x3AndUnzipUInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector128x3AndUnzip", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 4] || result3[i] != input[i + 4 * 2]"}), + ("LoadVectorx3Test.template", new Dictionary { ["TestName"] = "LoadVector128x3AndUnzipInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector128x3AndUnzip", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 4] || result3[i] != input[i + 4 * 2]"}), + ("LoadVectorx3Test.template", new Dictionary { ["TestName"] = "LoadVector128x3AndUnzipUInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector128x3AndUnzip", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 2] || result3[i] != input[i + 2 * 2]"}), + ("LoadVectorx3Test.template", new Dictionary { ["TestName"] = "LoadVector128x3AndUnzipInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector128x3AndUnzip", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 2] || result3[i] != input[i + 2 * 2]"}), + ("LoadVectorx3Test.template", new Dictionary { ["TestName"] = "LoadVector128x3AndUnzipFloat", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector128x3AndUnzip", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "float", ["LargestVectorSize"] = "16", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 4] || result3[i] != input[i + 4 * 2]"}), + ("LoadVectorx3Test.template", new Dictionary { ["TestName"] = "LoadVector128x3AndUnzipDouble", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector128x3AndUnzip", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "double", ["LargestVectorSize"] = "16", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 2] || result3[i] != input[i + 2 * 2]"}), + ("LoadVectorx4Test.template", new Dictionary { ["TestName"] = "LoadVector128x4AndUnzipSByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector128x4AndUnzip", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 16] || result3[i] != input[i + 16 * 2] || result4[i] != input[i + 16 * 3]"}), + ("LoadVectorx4Test.template", new Dictionary { ["TestName"] = "LoadVector128x4AndUnzipByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector128x4AndUnzip", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 16] || result3[i] != input[i + 16 * 2] || result4[i] != input[i + 16 * 3]"}), + ("LoadVectorx4Test.template", new Dictionary { ["TestName"] = "LoadVector128x4AndUnzipUShort", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector128x4AndUnzip", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 8] || result3[i] != input[i + 8 * 2] || result4[i] != input[i + 8 * 3]"}), + ("LoadVectorx4Test.template", new Dictionary { ["TestName"] = "LoadVector128x4AndUnzipShort", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector128x4AndUnzip", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int16", ["LargestVectorSize"] = "16", ["NextValueOp2"] = "TestLibrary.Generator.GetInt16()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 8] || result3[i] != input[i + 8 * 2] || result4[i] != input[i + 8 * 3]"}), + ("LoadVectorx4Test.template", new Dictionary { ["TestName"] = "LoadVector128x4AndUnzipUInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector128x4AndUnzip", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt32", ["LargestVectorSize"] = "16", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt32()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 4] || result3[i] != input[i + 4 * 2] || result4[i] != input[i + 4 * 3]"}), + ("LoadVectorx4Test.template", new Dictionary { ["TestName"] = "LoadVector128x4AndUnzipInt32", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector128x4AndUnzip", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp2"] = "TestLibrary.Generator.GetInt32()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 4] || result3[i] != input[i + 4 * 2] || result4[i] != input[i + 4 * 3]"}), + ("LoadVectorx4Test.template", new Dictionary { ["TestName"] = "LoadVector128x4AndUnzipUInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector128x4AndUnzip", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt64", ["LargestVectorSize"] = "16", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt64()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 2] || result3[i] != input[i + 2 * 2] || result4[i] != input[i + 2 * 3]"}), + ("LoadVectorx4Test.template", new Dictionary { ["TestName"] = "LoadVector128x4AndUnzipInt64", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector128x4AndUnzip", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Int64", ["LargestVectorSize"] = "16", ["NextValueOp2"] = "TestLibrary.Generator.GetInt64()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 2] || result3[i] != input[i + 2 * 2] || result4[i] != input[i + 2 * 3]"}), + ("LoadVectorx4Test.template", new Dictionary { ["TestName"] = "LoadVector128x4AndUnzipFloat", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector128x4AndUnzip", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "float", ["LargestVectorSize"] = "16", ["NextValueOp2"] = "TestLibrary.Generator.GetSingle()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 4] || result3[i] != input[i + 4 * 2] || result4[i] != input[i + 4 * 3]"}), + ("LoadVectorx4Test.template", new Dictionary { ["TestName"] = "LoadVector128x4AndUnzipDouble", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector128x4AndUnzip", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "double", ["LargestVectorSize"] = "16", ["NextValueOp2"] = "TestLibrary.Generator.GetDouble()", ["ValidateIterResult"] = "result1[i] != input[i] || result2[i] != input[i + 2] || result3[i] != input[i + 2 * 2] || result4[i] != input[i + 2 * 3]"}), ("LoadVectorx2Test.template", new Dictionary { ["TestName"] = "LoadVector128x2SByte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector128x2", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp2"] = "TestLibrary.Generator.GetSByte()", ["ValidateIterResult"] = "result1[i] != input[i * 2] || result2[i] != input[(i * 2) + 1]"}), ("LoadVectorx2Test.template", new Dictionary { ["TestName"] = "LoadVector128x2Byte", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector128x2", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "Byte", ["LargestVectorSize"] = "16", ["NextValueOp2"] = "TestLibrary.Generator.GetByte()", ["ValidateIterResult"] = "result1[i] != input[i * 2] || result2[i] != input[(i * 2) + 1]"}), ("LoadVectorx2Test.template", new Dictionary { ["TestName"] = "LoadVector128x2UShort", ["Isa"] = "AdvSimd.Arm64", ["LoadIsa"] = "AdvSimd", ["Method"] = "LoadVector128x2", ["Op1VectorType"] = "Vector128", ["Op1BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp2"] = "TestLibrary.Generator.GetUInt16()", ["ValidateIterResult"] = "result1[i] != input[i * 2] || result2[i] != input[(i * 2) + 1]"}), From 67a86a2e29ca9a851c3bb7f635d2d28502299534 Mon Sep 17 00:00:00 2001 From: Brant Burnett Date: Mon, 30 Oct 2023 16:51:37 -0500 Subject: [PATCH 44/47] Use Span to fill List in more ToList scenarios (#86796) * Use Span to fill List in more ToList scenarios * Optimize Append/Prepend changes * Update src/libraries/System.Linq/src/System/Linq/Lookup.SpeedOpt.cs Co-authored-by: Stephen Toub * Update src/libraries/System.Linq/src/System/Linq/Lookup.SpeedOpt.cs Co-authored-by: Stephen Toub * Address feedback * Remove ToSingleItemList, seems like an overoptimization --------- Co-authored-by: Stephen Toub --- .../src/System/Linq/AppendPrepend.SpeedOpt.cs | 30 +++++-------- .../src/System/Linq/Lookup.SpeedOpt.cs | 44 +++++++++++-------- .../System.Linq/src/System/Linq/Lookup.cs | 7 ++- .../src/System/Linq/Select.SpeedOpt.cs | 29 +++++++----- .../src/System/Linq/SingleLinkedNode.cs | 31 ++++++++++--- .../src/System/Linq/ToCollection.cs | 17 +++++-- .../System.Linq/tests/SelectTests.cs | 14 ++++++ 7 files changed, 114 insertions(+), 58 deletions(-) diff --git a/src/libraries/System.Linq/src/System/Linq/AppendPrepend.SpeedOpt.cs b/src/libraries/System.Linq/src/System/Linq/AppendPrepend.SpeedOpt.cs index a058b6048c2c4d..caf83bee1fcaac 100644 --- a/src/libraries/System.Linq/src/System/Linq/AppendPrepend.SpeedOpt.cs +++ b/src/libraries/System.Linq/src/System/Linq/AppendPrepend.SpeedOpt.cs @@ -73,6 +73,13 @@ public override TSource[] ToArray() public override List ToList() { int count = GetCount(onlyIfCheap: true); + + if (count == 1) + { + // If GetCount returns 1, then _source is empty and only _item should be returned + return new List(1) { _item }; + } + List list = count == -1 ? new List() : new List(count); if (!_appending) { @@ -122,17 +129,8 @@ private TSource[] LazyToArray() TSource[] array = builder.ToArray(); - int index = 0; - for (SingleLinkedNode? node = _prepended; node != null; node = node.Linked) - { - array[index++] = node.Item; - } - - index = array.Length - 1; - for (SingleLinkedNode? node = _appended; node != null; node = node.Linked) - { - array[index--] = node.Item; - } + _prepended?.Fill(array); + _appended?.FillReversed(array); return array; } @@ -181,17 +179,11 @@ public override List ToList() int count = GetCount(onlyIfCheap: true); List list = count == -1 ? new List() : new List(count); - for (SingleLinkedNode? node = _prepended; node != null; node = node.Linked) - { - list.Add(node.Item); - } + _prepended?.Fill(SetCountAndGetSpan(list, _prependCount)); list.AddRange(_source); - if (_appended != null) - { - list.AddRange(_appended.ToArray(_appendCount)); - } + _appended?.FillReversed(SetCountAndGetSpan(list, list.Count + _appendCount)); return list; } diff --git a/src/libraries/System.Linq/src/System/Linq/Lookup.SpeedOpt.cs b/src/libraries/System.Linq/src/System/Linq/Lookup.SpeedOpt.cs index 5fc89fc52555b6..2ef86a008493a8 100644 --- a/src/libraries/System.Linq/src/System/Linq/Lookup.SpeedOpt.cs +++ b/src/libraries/System.Linq/src/System/Linq/Lookup.SpeedOpt.cs @@ -10,22 +10,16 @@ public partial class Lookup : IIListProvider[] IIListProvider>.ToArray() { - IGrouping[] array = new IGrouping[_count]; - int index = 0; - Grouping? g = _lastGrouping; - if (g != null) + IGrouping[] array; + if (_count > 0) { - do - { - g = g._next; - Debug.Assert(g != null); - - array[index] = g; - ++index; - } - while (g != _lastGrouping); + array = new IGrouping[_count]; + Fill(_lastGrouping, array); + } + else + { + array = Array.Empty>(); } - return array; } @@ -53,8 +47,19 @@ internal TResult[] ToArray(Func, TResult> r List> IIListProvider>.ToList() { - List> list = new List>(_count); - Grouping? g = _lastGrouping; + var list = new List>(_count); + if (_count > 0) + { + Fill(_lastGrouping, Enumerable.SetCountAndGetSpan(list, _count)); + } + + return list; + } + + private static void Fill(Grouping? lastGrouping, Span> results) + { + int index = 0; + Grouping? g = lastGrouping; if (g != null) { do @@ -62,12 +67,13 @@ List> IIListProvider>.ToList g = g._next; Debug.Assert(g != null); - list.Add(g); + results[index] = g; + ++index; } - while (g != _lastGrouping); + while (g != lastGrouping); } - return list; + Debug.Assert(index == results.Length, "All list elements were not initialized."); } int IIListProvider>.GetCount(bool onlyIfCheap) => _count; diff --git a/src/libraries/System.Linq/src/System/Linq/Lookup.cs b/src/libraries/System.Linq/src/System/Linq/Lookup.cs index 2ee2d329255eb9..4e40e9c2e695d2 100644 --- a/src/libraries/System.Linq/src/System/Linq/Lookup.cs +++ b/src/libraries/System.Linq/src/System/Linq/Lookup.cs @@ -154,15 +154,20 @@ internal List ToList(Func, TResult Grouping? g = _lastGrouping; if (g != null) { + Span span = Enumerable.SetCountAndGetSpan(list, _count); + int index = 0; do { g = g._next; Debug.Assert(g != null); g.Trim(); - list.Add(resultSelector(g._key, g._elements)); + span[index] = resultSelector(g._key, g._elements); + ++index; } while (g != _lastGrouping); + + Debug.Assert(index == _count, "All list elements were not initialized."); } return list; diff --git a/src/libraries/System.Linq/src/System/Linq/Select.SpeedOpt.cs b/src/libraries/System.Linq/src/System/Linq/Select.SpeedOpt.cs index 7eed5849965e97..faf09335d5f3a3 100644 --- a/src/libraries/System.Linq/src/System/Linq/Select.SpeedOpt.cs +++ b/src/libraries/System.Linq/src/System/Linq/Select.SpeedOpt.cs @@ -611,13 +611,7 @@ private TResult[] PreallocatingToArray(int count) Debug.Assert(count == _source.GetCount(onlyIfCheap: true)); TResult[] array = new TResult[count]; - int index = 0; - foreach (TSource input in _source) - { - array[index] = _selector(input); - ++index; - } - + Fill(_source, array, _selector); return array; } @@ -640,20 +634,33 @@ public List ToList() { case -1: list = new List(); + foreach (TSource input in _source) + { + list.Add(_selector(input)); + } break; case 0: - return new List(); + list = new List(); + break; default: list = new List(count); + Fill(_source, SetCountAndGetSpan(list, count), _selector); break; } - foreach (TSource input in _source) + return list; + } + + private static void Fill(IPartition source, Span results, Func func) + { + int index = 0; + foreach (TSource item in source) { - list.Add(_selector(input)); + results[index] = func(item); + ++index; } - return list; + Debug.Assert(index == results.Length, "All list elements were not initialized."); } public int GetCount(bool onlyIfCheap) diff --git a/src/libraries/System.Linq/src/System/Linq/SingleLinkedNode.cs b/src/libraries/System.Linq/src/System/Linq/SingleLinkedNode.cs index 37a4a3a60c5582..7468973d2c77c0 100644 --- a/src/libraries/System.Linq/src/System/Linq/SingleLinkedNode.cs +++ b/src/libraries/System.Linq/src/System/Linq/SingleLinkedNode.cs @@ -92,15 +92,36 @@ public TSource[] ToArray(int count) Debug.Assert(count == GetCount()); TSource[] array = new TSource[count]; - int index = count; + FillReversed(array); + return array; + } + + /// + /// Fills a start of a span with the items of this node's singly-linked list. + /// + /// The span to fill. Must be the precise size required. + public void Fill(Span span) + { + int index = 0; for (SingleLinkedNode? node = this; node != null; node = node.Linked) { - --index; - array[index] = node.Item; + span[index] = node.Item; + index++; } + } - Debug.Assert(index == 0); - return array; + /// + /// Fills the end of a span with the items of this node's singly-linked list in reverse. + /// + /// The span to fill. + public void FillReversed(Span span) + { + int index = span.Length; + for (SingleLinkedNode? node = this; node != null; node = node.Linked) + { + --index; + span[index] = node.Item; + } } } } diff --git a/src/libraries/System.Linq/src/System/Linq/ToCollection.cs b/src/libraries/System.Linq/src/System/Linq/ToCollection.cs index 280ced4d34f629..aaf9b86dc93a54 100644 --- a/src/libraries/System.Linq/src/System/Linq/ToCollection.cs +++ b/src/libraries/System.Linq/src/System/Linq/ToCollection.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Generic; +using System.Diagnostics; namespace System.Linq { @@ -255,11 +256,21 @@ private static TSource[] HashSetToArray(HashSet set) private static List HashSetToList(HashSet set) { - var result = new List(set.Count); + int count = set.Count; - foreach (TSource item in set) + var result = new List(count); + if (count > 0) { - result.Add(item); + Span span = SetCountAndGetSpan(result, count); + + int index = 0; + foreach (TSource item in set) + { + span[index] = item; + ++index; + } + + Debug.Assert(index == span.Length, "All list elements were not initialized."); } return result; diff --git a/src/libraries/System.Linq/tests/SelectTests.cs b/src/libraries/System.Linq/tests/SelectTests.cs index 20de7814b6bcca..1f709bf9caadaf 100644 --- a/src/libraries/System.Linq/tests/SelectTests.cs +++ b/src/libraries/System.Linq/tests/SelectTests.cs @@ -1107,6 +1107,13 @@ public void Select_SourceIsArrayTakeTake() Assert.Equal(new[] { 2 }, source.Take(10)); } + [Fact] + public void Select_SourceIsIPartitionToArray() + { + Assert.Equal(Array.Empty(), new List().Order().Select(i => i * 2).ToArray()); + Assert.Equal(new[] { 2, 4, 6, 8 }, new List { 1, 2, 3, 4 }.Order().Select(i => i * 2).ToArray()); + } + [Fact] public void Select_SourceIsListSkipTakeCount() { @@ -1134,6 +1141,13 @@ public void Select_SourceIsListSkipTakeToList() Assert.Empty(new List { 1, 2, 3, 4 }.Select(i => i * 2).Skip(8).ToList()); } + [Fact] + public void Select_SourceIsIPartitionToList() + { + Assert.Equal(Array.Empty(), new List().Order().Select(i => i * 2).ToList()); + Assert.Equal(new[] { 2, 4, 6, 8 }, new List { 1, 2, 3, 4 }.Order().Select(i => i * 2).ToList()); + } + [Theory] [MemberData(nameof(MoveNextAfterDisposeData))] public void MoveNextAfterDispose(IEnumerable source) From 848c729ca44f3ae651ecd4672d40111508770450 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Tue, 31 Oct 2023 07:07:51 +0900 Subject: [PATCH 45/47] Avoid handing out duplicate `CORINFO_MODULE_STRUCT_*` handles (#94082) RyuJIT depends on never seeing two different `CORINFO_MODULE_STRUCT` for the same thing. Fixes #93843. --- .../tools/Common/JitInterface/CorInfoImpl.cs | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs index 9d98650b91bbb9..01d2d15fc2997e 100644 --- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs +++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs @@ -707,9 +707,15 @@ private void CompileMethodCleanup() _instantiationToJitVisibleInstantiation = null; _pgoResults.Clear(); + + // We need to clear out this cache because the next compilation could actually come up + // with a different MethodIL for the same MethodDesc. This happens when we need to replace + // a MethodIL with a throw helper. + _methodILScopeToHandle.Clear(); } private Dictionary _objectToHandle = new Dictionary(new JitObjectComparer()); + private Dictionary _methodILScopeToHandle = new Dictionary(new JitObjectComparer()); private List _handleToObject = new List(); private const int handleMultiplier = 8; @@ -720,6 +726,13 @@ private void CompileMethodCleanup() #endif private IntPtr ObjectToHandle(object obj) + { + // MethodILScopes need to go through ObjectToHandle(MethodILScope methodIL). + Debug.Assert(obj is not MethodILScope); + return ObjectToHandleUnchecked(obj); + } + + private IntPtr ObjectToHandleUnchecked(object obj) { // SuperPMI relies on the handle returned from this function being stable for the lifetime of the crossgen2 process // If handle deletion is implemented, please update SuperPMI @@ -752,10 +765,19 @@ private object HandleToObject(void* handle) private FieldDesc HandleToObject(CORINFO_FIELD_STRUCT_* field) => (FieldDesc)HandleToObject((void*)field); private CORINFO_FIELD_STRUCT_* ObjectToHandle(FieldDesc field) => (CORINFO_FIELD_STRUCT_*)ObjectToHandle((object)field); private MethodILScope HandleToObject(CORINFO_MODULE_STRUCT_* module) => (MethodIL)HandleToObject((void*)module); - private CORINFO_MODULE_STRUCT_* ObjectToHandle(MethodILScope methodIL) => (CORINFO_MODULE_STRUCT_*)ObjectToHandle((object)methodIL); private MethodSignature HandleToObject(MethodSignatureInfo* method) => (MethodSignature)HandleToObject((void*)method); private MethodSignatureInfo* ObjectToHandle(MethodSignature method) => (MethodSignatureInfo*)ObjectToHandle((object)method); + private CORINFO_MODULE_STRUCT_* ObjectToHandle(MethodILScope methodIL) + { + // RyuJIT requires CORINFO_MODULE_STRUCT to be unique. MethodILScope might not be unique + // due to ILProvider cache purging. See https://github.com/dotnet/runtime/issues/93843. + MethodDesc owningMethod = methodIL.OwningMethod; + if (!_methodILScopeToHandle.TryGetValue(owningMethod, out IntPtr handle)) + _methodILScopeToHandle[owningMethod] = handle = ObjectToHandleUnchecked((object)methodIL); + return (CORINFO_MODULE_STRUCT_*)handle; + } + private bool Get_CORINFO_METHOD_INFO(MethodDesc method, MethodIL methodIL, CORINFO_METHOD_INFO* methodInfo) { if (methodIL == null) From 920cd6e2b01d0fbede8882d015329e9b4d448c98 Mon Sep 17 00:00:00 2001 From: Will Smith Date: Mon, 30 Oct 2023 18:58:00 -0700 Subject: [PATCH 46/47] ARM64: Fix Vector64x2/3/4 API comments. Minor cleanup in AdvSimd. (#94188) * Fix Vector64x2/3/4 API comments. Minor cleanup in AdvSimd. * 4h to 4H --- .../Arm/AdvSimd.PlatformNotSupported.cs | 390 +++++++++--------- .../System/Runtime/Intrinsics/Arm/AdvSimd.cs | 390 +++++++++--------- 2 files changed, 390 insertions(+), 390 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.PlatformNotSupported.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.PlatformNotSupported.cs index 57fc22b034313a..500960104fb4a0 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.PlatformNotSupported.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.PlatformNotSupported.cs @@ -1553,152 +1553,152 @@ internal Arm64() { } /// /// A64: LD2 { Vn.16B, Vn+1.16B }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, byte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, byte* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2 { Vn.16B, Vn+1.16B }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, sbyte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, sbyte* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2 { Vn.8H, Vn+1.8H }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, short* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, short* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2 { Vn.8H, Vn+1.8H }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, ushort* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, ushort* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2 { Vn.4S, Vn+1.4S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, int* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, int* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2 { Vn.4S, Vn+1.4S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, uint* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, uint* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2 { Vn.2D, Vn+1.2D }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, long* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, long* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2 { Vn.2D, Vn+1.2D }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, ulong* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, ulong* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2 { Vn.4S, Vn+1.4S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, float* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, float* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2 { Vn.2D, Vn+1.2D }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, double* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, double* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3 { Vn.16B, Vn+1.16B, Vn+2.16B }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, byte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, byte* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3 { Vn.16B, Vn+1.16B, Vn+2.16B }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, sbyte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, sbyte* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3 { Vn.8H, Vn+1.8H, Vn+2.8H }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, short* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, short* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3 { Vn.8H, Vn+1.8H, Vn+2.8H }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, ushort* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, ushort* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, int* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, int* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, uint* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, uint* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3 { Vn.2D, Vn+1.2D, Vn+2.2D }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, long* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, long* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3 { Vn.2D, Vn+1.2D, Vn+2.2D }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, ulong* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, ulong* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, float* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, float* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3 { Vn.2D, Vn+1.2D, Vn+2.2D }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, double* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, double* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, byte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, byte* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, sbyte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, sbyte* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, short* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, short* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, ushort* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, ushort* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, int* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, int* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, uint* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, uint* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, long* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, long* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, ulong* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, ulong* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, float* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, float* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, double* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, double* address) { throw new PlatformNotSupportedException(); } /// /// float64x2_t vld1q_dup_f64 (float64_t const * ptr) @@ -1721,152 +1721,152 @@ internal Arm64() { } /// /// A64: LD2R { Vn.16B, Vn+1.16B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndReplicateToVector128x2(byte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(byte* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2R { Vn.16B, Vn+1.16B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndReplicateToVector128x2(sbyte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(sbyte* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2R { Vn.8H, Vn+1.8H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndReplicateToVector128x2(short* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(short* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2R { Vn.8H, Vn+1.8H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndReplicateToVector128x2(ushort* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(ushort* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2R { Vn.4S, Vn+1.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndReplicateToVector128x2(int* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(int* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2R { Vn.4S, Vn+1.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndReplicateToVector128x2(uint* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(uint* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2R { Vn.2D, Vn+1.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndReplicateToVector128x2(long* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(long* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2R { Vn.2D, Vn+1.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndReplicateToVector128x2(ulong* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(ulong* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2R { Vn.4S, Vn+1.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndReplicateToVector128x2(float* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(float* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2R { Vn.2D, Vn+1.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndReplicateToVector128x2(double* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(double* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3R { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndReplicateToVector128x3(byte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(byte* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3R { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndReplicateToVector128x3(sbyte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(sbyte* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3R { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndReplicateToVector128x3(short* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(short* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3R { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndReplicateToVector128x3(ushort* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(ushort* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3R { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndReplicateToVector128x3(int* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(int* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3R { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndReplicateToVector128x3(uint* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(uint* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3R { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndReplicateToVector128x3(long* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(long* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3R { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndReplicateToVector128x3(ulong* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(ulong* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3R { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndReplicateToVector128x3(float* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(float* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3R { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndReplicateToVector128x3(double* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(double* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4R { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndReplicateToVector128x4(byte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(byte* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4R { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndReplicateToVector128x4(sbyte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(sbyte* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4R { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndReplicateToVector128x4(short* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(short* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4R { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndReplicateToVector128x4(ushort* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(ushort* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4R { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndReplicateToVector128x4(int* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(int* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4R { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndReplicateToVector128x4(uint* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(uint* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4R { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndReplicateToVector128x4(long* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(long* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4R { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndReplicateToVector128x4(ulong* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(ulong* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4R { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndReplicateToVector128x4(float* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(float* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4R { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndReplicateToVector128x4(double* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(double* address) { throw new PlatformNotSupportedException(); } /// /// A64: LDP Dt1, Dt2, [Xn] @@ -2251,152 +2251,152 @@ internal Arm64() { } /// /// A64: LD2 { Vn.16B, Vn+1.16B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadVector128x2(byte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2(byte* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2 { Vn.16B, Vn+1.16B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadVector128x2(sbyte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2(sbyte* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2 { Vn.8H, Vn+1.8H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadVector128x2(short* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2(short* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2 { Vn.8H, Vn+1.8H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadVector128x2(ushort* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2(ushort* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2 { Vn.4S, Vn+1.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadVector128x2(int* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2(int* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2 { Vn.4S, Vn+1.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadVector128x2(uint* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2(uint* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2 { Vn.2D, Vn+1.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadVector128x2(long* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2(long* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2 { Vn.2D, Vn+1.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadVector128x2(ulong* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2(ulong* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2 { Vn.4S, Vn+1.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadVector128x2(float* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2(float* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2 { Vn.2D, Vn+1.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadVector128x2(double* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2(double* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadVector128x3(byte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3(byte* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadVector128x3(sbyte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3(sbyte* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadVector128x3(short* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3(short* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadVector128x3(ushort* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3(ushort* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadVector128x3(int* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3(int* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadVector128x3(uint* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3(uint* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadVector128x3(long* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3(long* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadVector128x3(ulong* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3(ulong* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadVector128x3(float* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3(float* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadVector128x3(double* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3(double* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadVector128x4(byte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4(byte* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadVector128x4(sbyte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4(sbyte* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadVector128x4(short* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4(short* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadVector128x4(ushort* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4(ushort* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadVector128x4(int* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4(int* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadVector128x4(uint* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4(uint* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadVector128x4(long* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4(long* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D}, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadVector128x4(ulong* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4(ulong* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadVector128x4(float* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4(float* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadVector128x4(double* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4(double* address) { throw new PlatformNotSupportedException(); } /// /// float64x2_t vmaxq_f64 (float64x2_t a, float64x2_t b) @@ -8742,107 +8742,107 @@ internal Arm64() { } /// /// A64: LD2 { Vn.8B, Vn+1.8B }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, byte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, byte* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2 { Vn.8B, Vn+1.8B }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, sbyte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, sbyte* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2 { Vn.4H, Vn+1.4H }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, short* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, short* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2 { Vn.4H, Vn+1.4H }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, ushort* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, ushort* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2 { Vn.2S, Vn+1.2S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, int* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, int* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2 { Vn.2S, Vn+1.2S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, uint* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, uint* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2 { Vn.2S, Vn+1.2S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, float* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, float* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3 { Vn.8B, Vn+1.8B, Vn+2.8B }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, byte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, byte* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3 { Vn.8B, Vn+1.8B, Vn+2.8B }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, sbyte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, sbyte* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3 { Vn.4H, Vn+1.4H, Vn+2.4H }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, short* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, short* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3 { Vn.4H, Vn+1.4H, Vn+2.4H }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, ushort* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, ushort* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3 { Vn.2S, Vn+1.2S, Vn+2.2S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, int* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, int* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3 { Vn.2S, Vn+1.2S, Vn+2.2S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, uint* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, uint* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3 { Vn.2S, Vn+1.2S, Vn+2.2S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, float* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, float* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, byte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, byte* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, sbyte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, sbyte* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, short* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, short* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, ushort* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, ushort* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, int* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, int* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, uint* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, uint* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, float* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, float* address) { throw new PlatformNotSupportedException(); } /// /// uint8x8_t vld1_dup_u8 (uint8_t const * ptr) @@ -8945,107 +8945,107 @@ internal Arm64() { } /// /// A64: LD2R { Vn.8B, Vn+1.8B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndReplicateToVector64x2(byte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(byte* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2R { Vn.8B, Vn+1.8B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndReplicateToVector64x2(sbyte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(sbyte* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2R { Vn.4H, Vn+1.4H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndReplicateToVector64x2(short* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(short* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2R { Vn.4H, Vn+1.4H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndReplicateToVector64x2(ushort* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(ushort* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2R { Vn.2S, Vn+1.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndReplicateToVector64x2(int* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(int* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2R { Vn.2S, Vn+1.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndReplicateToVector64x2(uint* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(uint* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD2R { Vn.2S, Vn+1.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndReplicateToVector64x2(float* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(float* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3R { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndReplicateToVector64x3(byte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(byte* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3R { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndReplicateToVector64x3(sbyte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(sbyte* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3R { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndReplicateToVector64x3(short* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(short* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3R { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndReplicateToVector64x3(ushort* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(ushort* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3R { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndReplicateToVector64x3(int* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(int* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3R { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndReplicateToVector64x3(uint* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(uint* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD3R { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndReplicateToVector64x3(float* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(float* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4R { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndReplicateToVector64x4(byte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(byte* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4R { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndReplicateToVector64x4(sbyte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(sbyte* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4R { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndReplicateToVector64x4(short* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(short* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4R { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndReplicateToVector64x4(ushort* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(ushort* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4R { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndReplicateToVector64x4(int* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(int* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4R { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndReplicateToVector64x4(uint* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(uint* address) { throw new PlatformNotSupportedException(); } /// /// A64: LD4R { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndReplicateToVector64x4(float* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(float* address) { throw new PlatformNotSupportedException(); } /// /// uint8x8_t vld1_u8 (uint8_t const * ptr) @@ -9188,214 +9188,214 @@ internal Arm64() { } public static unsafe Vector128 LoadVector128(ulong* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD1 { Vn.16B, Vn+1.16B }, [Xn] + /// A64: LD1 { Vn.8B, Vn+1.8B }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2AndUnzip(byte* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD1 { Vn.16B, Vn+1.16B }, [Xn] + /// A64: LD1 { Vn.8B, Vn+1.8B }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2AndUnzip(sbyte* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD1 { Vn.8H, Vn+1.8H }, [Xn] + /// A64: LD1 { Vn.4H, Vn+1.4H }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2AndUnzip(short* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD1 { Vn.8H, Vn+1.8H }, [Xn] + /// A64: LD1 { Vn.4H, Vn+1.4H }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2AndUnzip(ushort* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD1 { Vn.4S, Vn+1.4S }, [Xn] + /// A64: LD1 { Vn.2S, Vn+1.2S }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2AndUnzip(int* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD1 { Vn.4S, Vn+1.4S }, [Xn] + /// A64: LD1 { Vn.2S, Vn+1.2S }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2AndUnzip(uint* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD1 { Vn.4S, Vn+1.4S }, [Xn] + /// A64: LD1 { Vn.2S, Vn+1.2S }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2AndUnzip(float* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + /// A64: LD1 { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3AndUnzip(byte* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + /// A64: LD1 { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3AndUnzip(sbyte* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + /// A64: LD1 { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3AndUnzip(short* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + /// A64: LD1 { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3AndUnzip(ushort* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// A64: LD1 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3AndUnzip(int* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// A64: LD1 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3AndUnzip(uint* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// A64: LD1 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3AndUnzip(float* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + /// A64: LD1 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4AndUnzip(byte* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + /// A64: LD1 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4AndUnzip(sbyte* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + /// A64: LD1 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4AndUnzip(short* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + /// A64: LD1 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4AndUnzip(ushort* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// A64: LD1 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4AndUnzip(int* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// A64: LD1 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4AndUnzip(uint* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// A64: LD1 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4AndUnzip(float* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD2 { Vn.16B, Vn+1.16B }, [Xn] + /// A64: LD2 { Vn.8B, Vn+1.8B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadVector64x2(byte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2(byte* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD2 { Vn.16B, Vn+1.16B }, [Xn] + /// A64: LD2 { Vn.8B, Vn+1.8B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadVector64x2(sbyte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2(sbyte* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD2 { Vn.8H, Vn+1.8H }, [Xn] + /// A64: LD2 { Vn.4H, Vn+1.4H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadVector64x2(short* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2(short* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD2 { Vn.8H, Vn+1.8H }, [Xn] + /// A64: LD2 { Vn.4H, Vn+1.4H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadVector64x2(ushort* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2(ushort* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD2 { Vn.4S, Vn+1.4S }, [Xn] + /// A64: LD2 { Vn.2S, Vn+1.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadVector64x2(int* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2(int* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD2 { Vn.4S, Vn+1.4S }, [Xn] + /// A64: LD2 { Vn.2S, Vn+1.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadVector64x2(uint* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2(uint* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD2 { Vn.4S, Vn+1.4S }, [Xn] + /// A64: LD2 { Vn.2S, Vn+1.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadVector64x2(float* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2(float* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD3 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + /// A64: LD3 { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadVector64x3(byte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3(byte* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD3 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + /// A64: LD3 { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadVector64x3(sbyte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3(sbyte* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD3 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + /// A64: LD3 { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadVector64x3(short* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3(short* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD3 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + /// A64: LD3 { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadVector64x3(ushort* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3(ushort* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// A64: LD3 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadVector64x3(int* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3(int* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// A64: LD3 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadVector64x3(uint* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3(uint* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// A64: LD3 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadVector64x3(float* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3(float* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD4 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] + /// A64: LD4 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadVector64x4(byte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4(byte* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD4 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] + /// A64: LD4 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadVector64x4(sbyte* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4(sbyte* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD4 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] + /// A64: LD4 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadVector64x4(short* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4(short* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD4 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] + /// A64: LD4 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadVector64x4(ushort* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4(ushort* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] + /// A64: LD4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadVector64x4(int* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4(int* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] + /// A64: LD4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadVector64x4(uint* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4(uint* address) { throw new PlatformNotSupportedException(); } /// - /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] + /// A64: LD4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadVector64x4(float* address) { throw new PlatformNotSupportedException(); } + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4(float* address) { throw new PlatformNotSupportedException(); } /// /// uint8x8_t vmax_u8 (uint8x8_t a, uint8x8_t b) diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.cs index b8243b0693aa64..afd09b1307a68a 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/AdvSimd.cs @@ -1551,152 +1551,152 @@ internal Arm64() { } /// /// A64: LD2 { Vn.16B, Vn+1.16B }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, byte* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, byte* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD2 { Vn.16B, Vn+1.16B }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, sbyte* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, sbyte* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD2 { Vn.8H, Vn+1.8H }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, short* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, short* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD2 { Vn.8H, Vn+1.8H }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, ushort* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, ushort* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD2 { Vn.4S, Vn+1.4S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, int* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, int* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD2 { Vn.4S, Vn+1.4S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, uint* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, uint* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD2 { Vn.2D, Vn+1.2D }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, long* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, long* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD2 { Vn.2D, Vn+1.2D }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, ulong* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, ulong* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD2 { Vn.4S, Vn+1.4S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, float* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, float* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD2 { Vn.2D, Vn+1.2D }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, double* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndInsertScalar((Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, double* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD3 { Vn.16B, Vn+1.16B, Vn+2.16B }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, byte* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, byte* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD3 { Vn.16B, Vn+1.16B, Vn+2.16B }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, sbyte* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, sbyte* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD3 { Vn.8H, Vn+1.8H, Vn+2.8H }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, short* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, short* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD3 { Vn.8H, Vn+1.8H, Vn+2.8H }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, ushort* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, ushort* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, int* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, int* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, uint* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, uint* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD3 { Vn.2D, Vn+1.2D, Vn+2.2D }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, long* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, long* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD3 { Vn.2D, Vn+1.2D, Vn+2.2D }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, ulong* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, ulong* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, float* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, float* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD3 { Vn.2D, Vn+1.2D, Vn+2.2D }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, double* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndInsertScalar((Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, double* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD4 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, byte* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, byte* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD4 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, sbyte* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(15))] byte index, sbyte* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD4 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, short* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, short* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD4 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, ushort* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(7))] byte index, ushort* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, int* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, int* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, uint* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, uint* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, long* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, long* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, ulong* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, ulong* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, float* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(3))] byte index, float* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128, System.Runtime.Intrinsics.Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, double* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndInsertScalar((Vector128, Vector128, Vector128, Vector128) values, [ConstantExpected(Max = (byte)(1))] byte index, double* address) => LoadAndInsertScalar(values, index, address); /// /// float64x2_t vld1q_dup_f64 (float64_t const * ptr) @@ -1719,152 +1719,152 @@ internal Arm64() { } /// /// A64: LD2R { Vn.16B, Vn+1.16B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndReplicateToVector128x2(byte* address) => LoadAndReplicateToVector128x2(address); + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(byte* address) => LoadAndReplicateToVector128x2(address); /// /// A64: LD2R { Vn.16B, Vn+1.16B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndReplicateToVector128x2(sbyte* address) => LoadAndReplicateToVector128x2(address); + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(sbyte* address) => LoadAndReplicateToVector128x2(address); /// /// A64: LD2R { Vn.8H, Vn+1.8H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndReplicateToVector128x2(short* address) => LoadAndReplicateToVector128x2(address); + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(short* address) => LoadAndReplicateToVector128x2(address); /// /// A64: LD2R { Vn.8H, Vn+1.8H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndReplicateToVector128x2(ushort* address) => LoadAndReplicateToVector128x2(address); + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(ushort* address) => LoadAndReplicateToVector128x2(address); /// /// A64: LD2R { Vn.4S, Vn+1.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndReplicateToVector128x2(int* address) => LoadAndReplicateToVector128x2(address); + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(int* address) => LoadAndReplicateToVector128x2(address); /// /// A64: LD2R { Vn.4S, Vn+1.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndReplicateToVector128x2(uint* address) => LoadAndReplicateToVector128x2(address); + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(uint* address) => LoadAndReplicateToVector128x2(address); /// /// A64: LD2R { Vn.2D, Vn+1.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndReplicateToVector128x2(long* address) => LoadAndReplicateToVector128x2(address); + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(long* address) => LoadAndReplicateToVector128x2(address); /// /// A64: LD2R { Vn.2D, Vn+1.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndReplicateToVector128x2(ulong* address) => LoadAndReplicateToVector128x2(address); + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(ulong* address) => LoadAndReplicateToVector128x2(address); /// /// A64: LD2R { Vn.4S, Vn+1.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndReplicateToVector128x2(float* address) => LoadAndReplicateToVector128x2(address); + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(float* address) => LoadAndReplicateToVector128x2(address); /// /// A64: LD2R { Vn.2D, Vn+1.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadAndReplicateToVector128x2(double* address) => LoadAndReplicateToVector128x2(address); + public static unsafe (Vector128 Value1, Vector128 Value2) LoadAndReplicateToVector128x2(double* address) => LoadAndReplicateToVector128x2(address); /// /// A64: LD3R { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndReplicateToVector128x3(byte* address) => LoadAndReplicateToVector128x3(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(byte* address) => LoadAndReplicateToVector128x3(address); /// /// A64: LD3R { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndReplicateToVector128x3(sbyte* address) => LoadAndReplicateToVector128x3(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(sbyte* address) => LoadAndReplicateToVector128x3(address); /// /// A64: LD3R { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndReplicateToVector128x3(short* address) => LoadAndReplicateToVector128x3(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(short* address) => LoadAndReplicateToVector128x3(address); /// /// A64: LD3R { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndReplicateToVector128x3(ushort* address) => LoadAndReplicateToVector128x3(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(ushort* address) => LoadAndReplicateToVector128x3(address); /// /// A64: LD3R { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndReplicateToVector128x3(int* address) => LoadAndReplicateToVector128x3(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(int* address) => LoadAndReplicateToVector128x3(address); /// /// A64: LD3R { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndReplicateToVector128x3(uint* address) => LoadAndReplicateToVector128x3(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(uint* address) => LoadAndReplicateToVector128x3(address); /// /// A64: LD3R { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndReplicateToVector128x3(long* address) => LoadAndReplicateToVector128x3(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(long* address) => LoadAndReplicateToVector128x3(address); /// /// A64: LD3R { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndReplicateToVector128x3(ulong* address) => LoadAndReplicateToVector128x3(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(ulong* address) => LoadAndReplicateToVector128x3(address); /// /// A64: LD3R { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndReplicateToVector128x3(float* address) => LoadAndReplicateToVector128x3(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(float* address) => LoadAndReplicateToVector128x3(address); /// /// A64: LD3R { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadAndReplicateToVector128x3(double* address) => LoadAndReplicateToVector128x3(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadAndReplicateToVector128x3(double* address) => LoadAndReplicateToVector128x3(address); /// /// A64: LD4R { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndReplicateToVector128x4(byte* address) => LoadAndReplicateToVector128x4(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(byte* address) => LoadAndReplicateToVector128x4(address); /// /// A64: LD4R { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndReplicateToVector128x4(sbyte* address) => LoadAndReplicateToVector128x4(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(sbyte* address) => LoadAndReplicateToVector128x4(address); /// /// A64: LD4R { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndReplicateToVector128x4(short* address) => LoadAndReplicateToVector128x4(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(short* address) => LoadAndReplicateToVector128x4(address); /// /// A64: LD4R { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndReplicateToVector128x4(ushort* address) => LoadAndReplicateToVector128x4(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(ushort* address) => LoadAndReplicateToVector128x4(address); /// /// A64: LD4R { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndReplicateToVector128x4(int* address) => LoadAndReplicateToVector128x4(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(int* address) => LoadAndReplicateToVector128x4(address); /// /// A64: LD4R { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndReplicateToVector128x4(uint* address) => LoadAndReplicateToVector128x4(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(uint* address) => LoadAndReplicateToVector128x4(address); /// /// A64: LD4R { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndReplicateToVector128x4(long* address) => LoadAndReplicateToVector128x4(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(long* address) => LoadAndReplicateToVector128x4(address); /// /// A64: LD4R { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndReplicateToVector128x4(ulong* address) => LoadAndReplicateToVector128x4(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(ulong* address) => LoadAndReplicateToVector128x4(address); /// /// A64: LD4R { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndReplicateToVector128x4(float* address) => LoadAndReplicateToVector128x4(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(float* address) => LoadAndReplicateToVector128x4(address); /// /// A64: LD4R { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadAndReplicateToVector128x4(double* address) => LoadAndReplicateToVector128x4(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadAndReplicateToVector128x4(double* address) => LoadAndReplicateToVector128x4(address); /// /// A64: LDP Dt1, Dt2, [Xn] @@ -2249,152 +2249,152 @@ internal Arm64() { } /// /// A64: LD2 { Vn.16B, Vn+1.16B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadVector128x2(byte* address) => LoadVector128x2(address); + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2(byte* address) => LoadVector128x2(address); /// /// A64: LD2 { Vn.16B, Vn+1.16B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadVector128x2(sbyte* address) => LoadVector128x2(address); + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2(sbyte* address) => LoadVector128x2(address); /// /// A64: LD2 { Vn.8H, Vn+1.8H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadVector128x2(short* address) => LoadVector128x2(address); + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2(short* address) => LoadVector128x2(address); /// /// A64: LD2 { Vn.8H, Vn+1.8H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadVector128x2(ushort* address) => LoadVector128x2(address); + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2(ushort* address) => LoadVector128x2(address); /// /// A64: LD2 { Vn.4S, Vn+1.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadVector128x2(int* address) => LoadVector128x2(address); + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2(int* address) => LoadVector128x2(address); /// /// A64: LD2 { Vn.4S, Vn+1.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadVector128x2(uint* address) => LoadVector128x2(address); + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2(uint* address) => LoadVector128x2(address); /// /// A64: LD2 { Vn.2D, Vn+1.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadVector128x2(long* address) => LoadVector128x2(address); + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2(long* address) => LoadVector128x2(address); /// /// A64: LD2 { Vn.2D, Vn+1.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadVector128x2(ulong* address) => LoadVector128x2(address); + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2(ulong* address) => LoadVector128x2(address); /// /// A64: LD2 { Vn.4S, Vn+1.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadVector128x2(float* address) => LoadVector128x2(address); + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2(float* address) => LoadVector128x2(address); /// /// A64: LD2 { Vn.2D, Vn+1.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2) LoadVector128x2(double* address) => LoadVector128x2(address); + public static unsafe (Vector128 Value1, Vector128 Value2) LoadVector128x2(double* address) => LoadVector128x2(address); /// /// A64: LD3 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadVector128x3(byte* address) => LoadVector128x3(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3(byte* address) => LoadVector128x3(address); /// /// A64: LD3 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadVector128x3(sbyte* address) => LoadVector128x3(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3(sbyte* address) => LoadVector128x3(address); /// /// A64: LD3 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadVector128x3(short* address) => LoadVector128x3(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3(short* address) => LoadVector128x3(address); /// /// A64: LD3 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadVector128x3(ushort* address) => LoadVector128x3(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3(ushort* address) => LoadVector128x3(address); /// /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadVector128x3(int* address) => LoadVector128x3(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3(int* address) => LoadVector128x3(address); /// /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadVector128x3(uint* address) => LoadVector128x3(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3(uint* address) => LoadVector128x3(address); /// /// A64: LD3 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadVector128x3(long* address) => LoadVector128x3(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3(long* address) => LoadVector128x3(address); /// /// A64: LD3 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadVector128x3(ulong* address) => LoadVector128x3(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3(ulong* address) => LoadVector128x3(address); /// /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadVector128x3(float* address) => LoadVector128x3(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3(float* address) => LoadVector128x3(address); /// /// A64: LD3 { Vn.2D, Vn+1.2D, Vn+2.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3) LoadVector128x3(double* address) => LoadVector128x3(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3) LoadVector128x3(double* address) => LoadVector128x3(address); /// /// A64: LD4 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadVector128x4(byte* address) => LoadVector128x4(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4(byte* address) => LoadVector128x4(address); /// /// A64: LD4 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadVector128x4(sbyte* address) => LoadVector128x4(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4(sbyte* address) => LoadVector128x4(address); /// /// A64: LD4 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadVector128x4(short* address) => LoadVector128x4(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4(short* address) => LoadVector128x4(address); /// /// A64: LD4 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadVector128x4(ushort* address) => LoadVector128x4(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4(ushort* address) => LoadVector128x4(address); /// /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadVector128x4(int* address) => LoadVector128x4(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4(int* address) => LoadVector128x4(address); /// /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadVector128x4(uint* address) => LoadVector128x4(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4(uint* address) => LoadVector128x4(address); /// /// A64: LD4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadVector128x4(long* address) => LoadVector128x4(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4(long* address) => LoadVector128x4(address); /// /// A64: LD4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D}, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadVector128x4(ulong* address) => LoadVector128x4(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4(ulong* address) => LoadVector128x4(address); /// /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadVector128x4(float* address) => LoadVector128x4(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4(float* address) => LoadVector128x4(address); /// /// A64: LD4 { Vn.2D, Vn+1.2D, Vn+2.2D, Vn+3.2D }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector128 Value1, System.Runtime.Intrinsics.Vector128 Value2, System.Runtime.Intrinsics.Vector128 Value3, System.Runtime.Intrinsics.Vector128 Value4) LoadVector128x4(double* address) => LoadVector128x4(address); + public static unsafe (Vector128 Value1, Vector128 Value2, Vector128 Value3, Vector128 Value4) LoadVector128x4(double* address) => LoadVector128x4(address); /// /// float64x2_t vmaxq_f64 (float64x2_t a, float64x2_t b) @@ -8739,107 +8739,107 @@ internal Arm64() { } /// /// A64: LD2 { Vn.8B, Vn+1.8B }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, byte* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, byte* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD2 { Vn.8B, Vn+1.8B }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, sbyte* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, sbyte* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD2 { Vn.4H, Vn+1.4H }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, short* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, short* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD2 { Vn.4H, Vn+1.4H }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, ushort* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, ushort* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD2 { Vn.2S, Vn+1.2S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, int* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, int* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD2 { Vn.2S, Vn+1.2S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, uint* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, uint* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD2 { Vn.2S, Vn+1.2S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, float* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndInsertScalar((Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, float* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD3 { Vn.8B, Vn+1.8B, Vn+2.8B }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, byte* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, byte* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD3 { Vn.8B, Vn+1.8B, Vn+2.8B }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, sbyte* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, sbyte* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD3 { Vn.4H, Vn+1.4H, Vn+2.4H }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, short* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, short* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD3 { Vn.4H, Vn+1.4H, Vn+2.4H }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, ushort* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, ushort* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD3 { Vn.2S, Vn+1.2S, Vn+2.2S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, int* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, int* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD3 { Vn.2S, Vn+1.2S, Vn+2.2S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, uint* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, uint* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD3 { Vn.2S, Vn+1.2S, Vn+2.2S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, float* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndInsertScalar((Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, float* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD4 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, byte* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, byte* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD4 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, sbyte* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(7))] byte index, sbyte* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD4 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, short* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, short* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD4 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, ushort* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(3))] byte index, ushort* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, int* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, int* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, uint* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, uint* address) => LoadAndInsertScalar(values, index, address); /// /// A64: LD4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }[Vm], [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndInsertScalar((System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64, System.Runtime.Intrinsics.Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, float* address) => LoadAndInsertScalar(values, index, address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndInsertScalar((Vector64, Vector64, Vector64, Vector64) values, [ConstantExpected(Max = (byte)(1))] byte index, float* address) => LoadAndInsertScalar(values, index, address); /// /// uint8x8_t vld1_dup_u8 (uint8_t const * ptr) @@ -8942,107 +8942,107 @@ internal Arm64() { } /// /// A64: LD2R { Vn.8B, Vn+1.8B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndReplicateToVector64x2(byte* address) => LoadAndReplicateToVector64x2(address); + public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(byte* address) => LoadAndReplicateToVector64x2(address); /// /// A64: LD2R { Vn.8B, Vn+1.8B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndReplicateToVector64x2(sbyte* address) => LoadAndReplicateToVector64x2(address); + public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(sbyte* address) => LoadAndReplicateToVector64x2(address); /// /// A64: LD2R { Vn.4H, Vn+1.4H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndReplicateToVector64x2(short* address) => LoadAndReplicateToVector64x2(address); + public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(short* address) => LoadAndReplicateToVector64x2(address); /// /// A64: LD2R { Vn.4H, Vn+1.4H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndReplicateToVector64x2(ushort* address) => LoadAndReplicateToVector64x2(address); + public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(ushort* address) => LoadAndReplicateToVector64x2(address); /// /// A64: LD2R { Vn.2S, Vn+1.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndReplicateToVector64x2(int* address) => LoadAndReplicateToVector64x2(address); + public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(int* address) => LoadAndReplicateToVector64x2(address); /// /// A64: LD2R { Vn.2S, Vn+1.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndReplicateToVector64x2(uint* address) => LoadAndReplicateToVector64x2(address); + public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(uint* address) => LoadAndReplicateToVector64x2(address); /// /// A64: LD2R { Vn.2S, Vn+1.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadAndReplicateToVector64x2(float* address) => LoadAndReplicateToVector64x2(address); + public static unsafe (Vector64 Value1, Vector64 Value2) LoadAndReplicateToVector64x2(float* address) => LoadAndReplicateToVector64x2(address); /// /// A64: LD3R { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndReplicateToVector64x3(byte* address) => LoadAndReplicateToVector64x3(address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(byte* address) => LoadAndReplicateToVector64x3(address); /// /// A64: LD3R { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndReplicateToVector64x3(sbyte* address) => LoadAndReplicateToVector64x3(address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(sbyte* address) => LoadAndReplicateToVector64x3(address); /// /// A64: LD3R { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndReplicateToVector64x3(short* address) => LoadAndReplicateToVector64x3(address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(short* address) => LoadAndReplicateToVector64x3(address); /// /// A64: LD3R { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndReplicateToVector64x3(ushort* address) => LoadAndReplicateToVector64x3(address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(ushort* address) => LoadAndReplicateToVector64x3(address); /// /// A64: LD3R { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndReplicateToVector64x3(int* address) => LoadAndReplicateToVector64x3(address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(int* address) => LoadAndReplicateToVector64x3(address); /// /// A64: LD3R { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndReplicateToVector64x3(uint* address) => LoadAndReplicateToVector64x3(address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(uint* address) => LoadAndReplicateToVector64x3(address); /// /// A64: LD3R { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadAndReplicateToVector64x3(float* address) => LoadAndReplicateToVector64x3(address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadAndReplicateToVector64x3(float* address) => LoadAndReplicateToVector64x3(address); /// /// A64: LD4R { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndReplicateToVector64x4(byte* address) => LoadAndReplicateToVector64x4(address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(byte* address) => LoadAndReplicateToVector64x4(address); /// /// A64: LD4R { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndReplicateToVector64x4(sbyte* address) => LoadAndReplicateToVector64x4(address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(sbyte* address) => LoadAndReplicateToVector64x4(address); /// /// A64: LD4R { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndReplicateToVector64x4(short* address) => LoadAndReplicateToVector64x4(address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(short* address) => LoadAndReplicateToVector64x4(address); /// /// A64: LD4R { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndReplicateToVector64x4(ushort* address) => LoadAndReplicateToVector64x4(address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(ushort* address) => LoadAndReplicateToVector64x4(address); /// /// A64: LD4R { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndReplicateToVector64x4(int* address) => LoadAndReplicateToVector64x4(address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(int* address) => LoadAndReplicateToVector64x4(address); /// /// A64: LD4R { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndReplicateToVector64x4(uint* address) => LoadAndReplicateToVector64x4(address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(uint* address) => LoadAndReplicateToVector64x4(address); /// /// A64: LD4R { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadAndReplicateToVector64x4(float* address) => LoadAndReplicateToVector64x4(address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadAndReplicateToVector64x4(float* address) => LoadAndReplicateToVector64x4(address); /// /// uint8x8_t vld1_u8 (uint8_t const * ptr) @@ -9185,214 +9185,214 @@ internal Arm64() { } public static unsafe Vector128 LoadVector128(ulong* address) => LoadVector128(address); /// - /// A64: LD1 { Vn.16B, Vn+1.16B }, [Xn] + /// A64: LD1 { Vn.8B, Vn+1.8B }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2AndUnzip(byte* address) => LoadVector64x2AndUnzip(address); /// - /// A64: LD1 { Vn.16B, Vn+1.16B }, [Xn] + /// A64: LD1 { Vn.8B, Vn+1.8B }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2AndUnzip(sbyte* address) => LoadVector64x2AndUnzip(address); /// - /// A64: LD1 { Vn.8H, Vn+1.8H }, [Xn] + /// A64: LD1 { Vn.4H, Vn+1.4H }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2AndUnzip(short* address) => LoadVector64x2AndUnzip(address); /// - /// A64: LD1 { Vn.8H, Vn+1.8H }, [Xn] + /// A64: LD1 { Vn.4H, Vn+1.4H }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2AndUnzip(ushort* address) => LoadVector64x2AndUnzip(address); /// - /// A64: LD1 { Vn.4S, Vn+1.4S }, [Xn] + /// A64: LD1 { Vn.2S, Vn+1.2S }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2AndUnzip(int* address) => LoadVector64x2AndUnzip(address); /// - /// A64: LD1 { Vn.4S, Vn+1.4S }, [Xn] + /// A64: LD1 { Vn.2S, Vn+1.2S }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2AndUnzip(uint* address) => LoadVector64x2AndUnzip(address); /// - /// A64: LD1 { Vn.4S, Vn+1.4S }, [Xn] + /// A64: LD1 { Vn.2S, Vn+1.2S }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2AndUnzip(float* address) => LoadVector64x2AndUnzip(address); /// - /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + /// A64: LD1 { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3AndUnzip(byte* address) => LoadVector64x3AndUnzip(address); /// - /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + /// A64: LD1 { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3AndUnzip(sbyte* address) => LoadVector64x3AndUnzip(address); /// - /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + /// A64: LD1 { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3AndUnzip(short* address) => LoadVector64x3AndUnzip(address); /// - /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + /// A64: LD1 { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3AndUnzip(ushort* address) => LoadVector64x3AndUnzip(address); /// - /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// A64: LD1 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3AndUnzip(int* address) => LoadVector64x3AndUnzip(address); /// - /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// A64: LD1 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3AndUnzip(uint* address) => LoadVector64x3AndUnzip(address); /// - /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// A64: LD1 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3AndUnzip(float* address) => LoadVector64x3AndUnzip(address); /// - /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + /// A64: LD1 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4AndUnzip(byte* address) => LoadVector64x4AndUnzip(address); /// - /// A64: LD1 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + /// A64: LD1 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4AndUnzip(sbyte* address) => LoadVector64x4AndUnzip(address); /// - /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + /// A64: LD1 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4AndUnzip(short* address) => LoadVector64x4AndUnzip(address); /// - /// A64: LD1 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + /// A64: LD1 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4AndUnzip(ushort* address) => LoadVector64x4AndUnzip(address); /// - /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// A64: LD1 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4AndUnzip(int* address) => LoadVector64x4AndUnzip(address); /// - /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// A64: LD1 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4AndUnzip(uint* address) => LoadVector64x4AndUnzip(address); /// - /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// A64: LD1 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.2S }, [Xn] /// public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4AndUnzip(float* address) => LoadVector64x4AndUnzip(address); /// - /// A64: LD2 { Vn.16B, Vn+1.16B }, [Xn] + /// A64: LD2 { Vn.8B, Vn+1.8B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadVector64x2(byte* address) => LoadVector64x2(address); + public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2(byte* address) => LoadVector64x2(address); /// - /// A64: LD2 { Vn.16B, Vn+1.16B }, [Xn] + /// A64: LD2 { Vn.8B, Vn+1.8B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadVector64x2(sbyte* address) => LoadVector64x2(address); + public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2(sbyte* address) => LoadVector64x2(address); /// - /// A64: LD2 { Vn.8H, Vn+1.8H }, [Xn] + /// A64: LD2 { Vn.4H, Vn+1.4H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadVector64x2(short* address) => LoadVector64x2(address); + public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2(short* address) => LoadVector64x2(address); /// - /// A64: LD2 { Vn.8H, Vn+1.8H }, [Xn] + /// A64: LD2 { Vn.4H, Vn+1.4H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadVector64x2(ushort* address) => LoadVector64x2(address); + public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2(ushort* address) => LoadVector64x2(address); /// - /// A64: LD2 { Vn.4S, Vn+1.4S }, [Xn] + /// A64: LD2 { Vn.2S, Vn+1.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadVector64x2(int* address) => LoadVector64x2(address); + public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2(int* address) => LoadVector64x2(address); /// - /// A64: LD2 { Vn.4S, Vn+1.4S }, [Xn]128x4 + /// A64: LD2 { Vn.2S, Vn+1.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadVector64x2(uint* address) => LoadVector64x2(address); + public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2(uint* address) => LoadVector64x2(address); /// - /// A64: LD2 { Vn.4S, Vn+1.4S }, [Xn] + /// A64: LD2 { Vn.2S, Vn+1.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2) LoadVector64x2(float* address) => LoadVector64x2(address); + public static unsafe (Vector64 Value1, Vector64 Value2) LoadVector64x2(float* address) => LoadVector64x2(address); /// - /// A64: LD3 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + /// A64: LD3 { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadVector64x3(byte* address) => LoadVector64x3(address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3(byte* address) => LoadVector64x3(address); /// - /// A64: LD3 { Vn.16B, Vn+1.16B, Vn+2.16B }, [Xn] + /// A64: LD3 { Vn.8B, Vn+1.8B, Vn+2.8B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadVector64x3(sbyte* address) => LoadVector64x3(address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3(sbyte* address) => LoadVector64x3(address); /// - /// A64: LD3 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + /// A64: LD3 { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadVector64x3(short* address) => LoadVector64x3(address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3(short* address) => LoadVector64x3(address); /// - /// A64: LD3 { Vn.8H, Vn+1.8H, Vn+2.8H }, [Xn] + /// A64: LD3 { Vn.4H, Vn+1.4H, Vn+2.4H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadVector64x3(ushort* address) => LoadVector64x3(address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3(ushort* address) => LoadVector64x3(address); /// - /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// A64: LD3 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadVector64x3(int* address) => LoadVector64x3(address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3(int* address) => LoadVector64x3(address); /// - /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// A64: LD3 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadVector64x3(uint* address) => LoadVector64x3(address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3(uint* address) => LoadVector64x3(address); /// - /// A64: LD3 { Vn.4S, Vn+1.4S, Vn+2.4S }, [Xn] + /// A64: LD3 { Vn.2S, Vn+1.2S, Vn+2.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3) LoadVector64x3(float* address) => LoadVector64x3(address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3) LoadVector64x3(float* address) => LoadVector64x3(address); /// - /// A64: LD4 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] + /// A64: LD4 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadVector64x4(byte* address) => LoadVector64x4(address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4(byte* address) => LoadVector64x4(address); /// - /// A64: LD4 { Vn.16B, Vn+1.16B, Vn+2.16B, Vn+3.16B }, [Xn] + /// A64: LD4 { Vn.8B, Vn+1.8B, Vn+2.8B, Vn+3.8B }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadVector64x4(sbyte* address) => LoadVector64x4(address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4(sbyte* address) => LoadVector64x4(address); /// - /// A64: LD4 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] + /// A64: LD4 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadVector64x4(short* address) => LoadVector64x4(address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4(short* address) => LoadVector64x4(address); /// - /// A64: LD4 { Vn.8H, Vn+1.8H, Vn+2.8H, Vn+3.8H }, [Xn] + /// A64: LD4 { Vn.4H, Vn+1.4H, Vn+2.4H, Vn+3.4H }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadVector64x4(ushort* address) => LoadVector64x4(address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4(ushort* address) => LoadVector64x4(address); /// - /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] + /// A64: LD4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadVector64x4(int* address) => LoadVector64x4(address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4(int* address) => LoadVector64x4(address); /// - /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] + /// A64: LD4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadVector64x4(uint* address) => LoadVector64x4(address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4(uint* address) => LoadVector64x4(address); /// - /// A64: LD4 { Vn.4S, Vn+1.4S, Vn+2.4S, Vn+3.4S }, [Xn] + /// A64: LD4 { Vn.2S, Vn+1.2S, Vn+2.2S, Vn+3.2S }, [Xn] /// - public static unsafe (System.Runtime.Intrinsics.Vector64 Value1, System.Runtime.Intrinsics.Vector64 Value2, System.Runtime.Intrinsics.Vector64 Value3, System.Runtime.Intrinsics.Vector64 Value4) LoadVector64x4(float* address) => LoadVector64x4(address); + public static unsafe (Vector64 Value1, Vector64 Value2, Vector64 Value3, Vector64 Value4) LoadVector64x4(float* address) => LoadVector64x4(address); /// /// uint8x8_t vmax_u8 (uint8x8_t a, uint8x8_t b) From e4cc5702f433908b08be660575947603d11673cb Mon Sep 17 00:00:00 2001 From: Ilona Tomkowicz Date: Tue, 31 Oct 2023 10:58:10 +0100 Subject: [PATCH 47/47] Revert merge bug. --- .../tests/HostFactoryResolverTests.cs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/HostFactoryResolverTests.cs b/src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/HostFactoryResolverTests.cs index b35db51ec0da2d..3982ae29846862 100644 --- a/src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/HostFactoryResolverTests.cs +++ b/src/libraries/Microsoft.Extensions.HostFactoryResolver/tests/HostFactoryResolverTests.cs @@ -108,7 +108,6 @@ public void CreateHostBuilderPattern_CanFindHostBuilder() [Fact] [DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(CreateHostBuilderPatternTestSite.Program))] [DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(Host))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/73420", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] public void CreateHostBuilderPattern_CanFindServiceProvider() { var factory = HostFactoryResolver.ResolveServiceProviderFactory(typeof(CreateHostBuilderPatternTestSite.Program).Assembly); @@ -138,7 +137,6 @@ public void CreateHostBuilderPattern__Invalid_CantFindServiceProvider() [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] [DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(NoSpecialEntryPointPattern.Program))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/73420", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] public void NoSpecialEntryPointPattern() { var factory = HostFactoryResolver.ResolveServiceProviderFactory(typeof(NoSpecialEntryPointPattern.Program).Assembly, s_WaitTimeout); @@ -237,7 +235,6 @@ public void NoSpecialEntryPointPatternHangs() [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] [DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(NoSpecialEntryPointPatternMainNoArgs.Program))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/73420", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] public void NoSpecialEntryPointPatternMainNoArgs() { var factory = HostFactoryResolver.ResolveServiceProviderFactory(typeof(NoSpecialEntryPointPatternMainNoArgs.Program).Assembly, s_WaitTimeout); @@ -248,7 +245,6 @@ public void NoSpecialEntryPointPatternMainNoArgs() [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] [DynamicDependency(DynamicallyAccessedMemberTypes.All, "Program", "TopLevelStatements")] - [ActiveIssue("https://github.com/dotnet/runtime/issues/73420", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] public void TopLevelStatements() { var assembly = Assembly.Load("TopLevelStatements"); @@ -270,7 +266,6 @@ public void TopLevelStatementsTestsTimeout() } [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/73420", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] [DynamicDependency(DynamicallyAccessedMemberTypes.All, "Program", "ApplicationNameSetFromArgument")] public void ApplicationNameSetFromArgument() { @@ -284,7 +279,6 @@ public void ApplicationNameSetFromArgument() [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] [DynamicDependency(DynamicallyAccessedMemberTypes.All, typeof(NoSpecialEntryPointPattern.Program))] - [ActiveIssue("https://github.com/dotnet/runtime/issues/73420", typeof(PlatformDetection), nameof(PlatformDetection.IsNativeAot))] public void NoSpecialEntryPointPatternCanRunInParallel() { var factory = HostFactoryResolver.ResolveServiceProviderFactory(typeof(NoSpecialEntryPointPattern.Program).Assembly, s_WaitTimeout);