diff --git a/eng/DotNetBuild.props b/eng/DotNetBuild.props
index 67554644b5cf8f..ef11ad4af6ecec 100644
--- a/eng/DotNetBuild.props
+++ b/eng/DotNetBuild.props
@@ -77,6 +77,7 @@
$(InnerBuildArgs) /p:MonoAOTEnableLLVM=$(DotNetBuildMonoAOTEnableLLVM)
$(InnerBuildArgs) /p:MonoBundleLLVMOptimizer=$(DotNetBuildMonoBundleLLVMOptimizer)
$(InnerBuildArgs) /p:DotNetBuildMonoCrossAOT=$(DotNetBuildMonoCrossAOT)
+ $(InnerBuildArgs) /p:DotNetBuildAllRuntimePacks=$(DotNetBuildAllRuntimePacks)
$(InnerBuildArgs) $(FlagParameterPrefix)pgoinstrument
diff --git a/eng/Publishing.props b/eng/Publishing.props
index 9c2866118ede74..05a7d2e907063d 100644
--- a/eng/Publishing.props
+++ b/eng/Publishing.props
@@ -140,7 +140,7 @@
-
-
diff --git a/eng/Subsets.props b/eng/Subsets.props
index 9c095300d7d7c6..d4621753cb63bd 100644
--- a/eng/Subsets.props
+++ b/eng/Subsets.props
@@ -25,20 +25,41 @@
+
+
+ <_CoreCLRSupportedOS Condition="'$(TargetsMobile)' != 'true' and '$(TargetsLinuxBionic)' != 'true'">true
+ <_CoreCLRSupportedArch Condition="'$(TargetArchitecture)' != 'armv6' and '$(TargetArchitecture)' != 'ppc64le' and '$(TargetArchitecture)' != 's390x'">true
+ true
+
+
+ <_MonoSupportedOS>true
+ <_MonoSupportedArch Condition="!('$(TargetOS)' == 'windows' and '$(TargetArchitecture)' == 'arm64') and !('$(TargetsLinuxMusl)' == 'true' and ('$(TargetArchitecture)' == 'arm' or '$(TargetArchitecture)' == 'arm64')) and !('$(TargetsLinuxBionic)' == 'true' and '$(TargetArchitecture)' == 'arm')">true
+ true
+
+
+ <_MonoAotCrossSupportedOS Condition="'$(TargetsMobile)' != 'true' and '$(TargetsLinuxBionic)' != 'true'">true
+ <_MonoAotCrossSupportedArch Condition="'$(TargetArchitecture)' == 'x64' or '$(TargetArchitecture)' == 'arm64'">true
+ true
+
+
+ <_IsCommunityCrossArchitecture Condition="'$(CrossBuild)' == 'true' and ('$(TargetArchitecture)' == 'loongarch64' or '$(TargetArchitecture)' == 'riscv64')">true
+ <_NativeAotSupportedOS Condition="'$(TargetOS)' == 'windows' or '$(TargetOS)' == 'linux' or '$(TargetOS)' == 'osx' or '$(TargetOS)' == 'maccatalyst' or '$(TargetOS)' == 'iossimulator' or '$(TargetOS)' == 'ios' or '$(TargetOS)' == 'tvossimulator' or '$(TargetOS)' == 'tvos' or '$(TargetOS)' == 'freebsd'">true
+ <_NativeAotSupportedArch Condition="'$(TargetArchitecture)' == 'x64' or '$(TargetArchitecture)' == 'arm64' or '$(TargetArchitecture)' == 'arm' or '$(TargetArchitecture)' == 'loongarch64' or ('$(TargetOS)' == 'windows' and '$(TargetArchitecture)' == 'x86')">true
+ true
+
+
CoreCLR
- Mono
- Mono
- Mono
- Mono
- Mono
+ Mono
$(DefaultPrimaryRuntimeFlavor)
clr+mono+libs+tools+host+packs
mono+libs+packs
- mono+libs+host+packs
+ clr.nativeaotruntime+clr.nativeaotlibs+mono+libs+packs
+ clr.nativeaotruntime+clr.nativeaotlibs+mono+libs+host+packs
+ clr.nativeaotruntime+clr.nativeaotlibs+libs+packs
clr+libs+tools+host+packs
clr.nativeaotlibs+clr.nativeaotruntime+libs+packs
@@ -50,16 +71,21 @@
true
+
+ android+browser+wasi
+ $(MonoCrossAOTTargetOS)+tvos+ios+maccatalyst
+
+
<_subset Condition="'$(Subset)' != ''">+$(Subset.ToLowerInvariant())+
<_subset Condition="'$(Subset)' == ''">+$(DefaultSubsets)+
-
+
Mono
CoreCLR
- Mono
+ Mono
$(PrimaryRuntimeFlavor)
@@ -82,6 +108,9 @@
$(DefaultMonoSubsets)mono.tools+
$(DefaultMonoSubsets)host.native+
+
+ mono.aotcross
+
libs.native+
@@ -95,6 +124,8 @@
$(DefaultHostSubsets)+host.pretest+host.tests
host.native
+
+ host.native+host.pkg
packs.product
$(DefaultPacksSubsets)+packs.installers
@@ -120,11 +151,6 @@
-
- <_IsCommunityCrossArchitecture Condition="'$(CrossBuild)' == 'true' and ('$(TargetArchitecture)' == 'loongarch64' or '$(TargetArchitecture)' == 'riscv64')">true
- <_NativeAotSupportedOS Condition="'$(TargetOS)' == 'windows' or '$(TargetOS)' == 'linux' or '$(TargetOS)' == 'osx' or '$(TargetOS)' == 'maccatalyst' or '$(TargetOS)' == 'iossimulator' or '$(TargetOS)' == 'ios' or '$(TargetOS)' == 'tvossimulator' or '$(TargetOS)' == 'tvos' or '$(TargetOS)' == 'freebsd'">true
- <_NativeAotSupportedArch Condition="'$(TargetArchitecture)' == 'x64' or '$(TargetArchitecture)' == 'arm64' or '$(TargetArchitecture)' == 'arm' or '$(TargetArchitecture)' == 'loongarch64' or ('$(TargetOS)' == 'windows' and '$(TargetArchitecture)' == 'x86')">true
- true
true
@@ -517,7 +543,7 @@
-
+
@@ -532,33 +558,76 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <_BuildCoreCLRRuntimePack Condition="'$(RuntimeFlavor)' == 'CoreCLR' and '$(CoreCLRSupported)' == 'true' and '$(BuildNativeAOTRuntimePack)' != 'true'">true
+ <_BuildMonoRuntimePack Condition="'$(RuntimeFlavor)' == 'Mono' and '$(MonoSupported)' == 'true' and '$(BuildNativeAOTRuntimePack)' != 'true'">true
+ <_BuildNativeAOTRuntimePack Condition="'$(BuildNativeAOTRuntimePack)' == 'true'">true
+ <_BuildHostPack Condition="'$(RuntimeFlavor)' == '$(PrimaryRuntimeFlavor)' and '$(TargetsMobile)' != 'true' and '$(BuildNativeAOTRuntimePack)' != 'true'">true
+ <_BuildBundle Condition="'$(BuildNativeAOTRuntimePack)' != 'true' and '$(RuntimeFlavor)' == '$(PrimaryRuntimeFlavor)' and '$(TargetsMobile)' != 'true'">true
+
+
+
+ <_BuildCoreCLRRuntimePack Condition="'$(CoreCLRSupported)' == 'true'">true
+ <_BuildMonoRuntimePack Condition="'$(MonoSupported)' == 'true'">true
+
+
+
+
+ <_BuildCoreCLRRuntimePack Condition="'$(PrimaryRuntimeFlavor)' == 'CoreCLR'">true
+ <_BuildMonoRuntimePack Condition="'$(PrimaryRuntimeFlavor)' == 'Mono'">true
+
+
+
+ <_BuildNativeAOTRuntimePack Condition="'$(NativeAOTSupported)' == 'true'">true
+ <_BuildHostPack Condition="'$(TargetsMobile)' != 'true' and !('$(TargetsLinuxBionic)' == 'true' and '$(TargetArchitecture)' == 'arm')">true
+ <_BuildBundle Condition="'$(TargetsMobile)' != 'true' and !('$(TargetsLinuxBionic)' == 'true' and '$(TargetArchitecture)' == 'arm')">true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index 16ecf6a0ed48c6..aa757faca821db 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -60,14 +60,14 @@
9e8bd520939ddfee686261267a1646c1b113d9e1
-
+
https://github.com/dotnet/emsdk
- 6ee0290df7381d7b9c4887b440e1a2815dc72407
+ 0de3165cb0d56323b6caaf8e9916d4d9e72da32d
-
+
https://github.com/dotnet/emsdk
- 6ee0290df7381d7b9c4887b440e1a2815dc72407
+ 0de3165cb0d56323b6caaf8e9916d4d9e72da32d
@@ -166,57 +166,57 @@
https://github.com/dotnet/arcade
e7cb34898a1b610eb2a22591a2178da6f1fb7e3c
-
+
https://github.com/dotnet/runtime-assets
- eb4194502b1eb78fe0bda938d633eac5f0968c1d
+ 6082ed1bb2cfd2d394cdc0ec613c88f3754041f7
-
+
https://github.com/dotnet/runtime-assets
- eb4194502b1eb78fe0bda938d633eac5f0968c1d
+ 6082ed1bb2cfd2d394cdc0ec613c88f3754041f7
-
+
https://github.com/dotnet/runtime-assets
- eb4194502b1eb78fe0bda938d633eac5f0968c1d
+ 6082ed1bb2cfd2d394cdc0ec613c88f3754041f7
-
+
https://github.com/dotnet/runtime-assets
- eb4194502b1eb78fe0bda938d633eac5f0968c1d
+ 6082ed1bb2cfd2d394cdc0ec613c88f3754041f7
-
+
https://github.com/dotnet/runtime-assets
- eb4194502b1eb78fe0bda938d633eac5f0968c1d
+ 6082ed1bb2cfd2d394cdc0ec613c88f3754041f7
-
+
https://github.com/dotnet/runtime-assets
- eb4194502b1eb78fe0bda938d633eac5f0968c1d
+ 6082ed1bb2cfd2d394cdc0ec613c88f3754041f7
-
+
https://github.com/dotnet/runtime-assets
- eb4194502b1eb78fe0bda938d633eac5f0968c1d
+ 6082ed1bb2cfd2d394cdc0ec613c88f3754041f7
-
+
https://github.com/dotnet/runtime-assets
- eb4194502b1eb78fe0bda938d633eac5f0968c1d
+ 6082ed1bb2cfd2d394cdc0ec613c88f3754041f7
-
+
https://github.com/dotnet/runtime-assets
- eb4194502b1eb78fe0bda938d633eac5f0968c1d
+ 6082ed1bb2cfd2d394cdc0ec613c88f3754041f7
-
+
https://github.com/dotnet/runtime-assets
- eb4194502b1eb78fe0bda938d633eac5f0968c1d
+ 6082ed1bb2cfd2d394cdc0ec613c88f3754041f7
-
+
https://github.com/dotnet/runtime-assets
- eb4194502b1eb78fe0bda938d633eac5f0968c1d
+ 6082ed1bb2cfd2d394cdc0ec613c88f3754041f7
-
+
https://github.com/dotnet/runtime-assets
- eb4194502b1eb78fe0bda938d633eac5f0968c1d
+ 6082ed1bb2cfd2d394cdc0ec613c88f3754041f7
-
+
https://github.com/dotnet/runtime-assets
- eb4194502b1eb78fe0bda938d633eac5f0968c1d
+ 6082ed1bb2cfd2d394cdc0ec613c88f3754041f7
https://github.com/dotnet/llvm-project
@@ -372,9 +372,9 @@
https://github.com/dotnet/hotreload-utils
7d2f352486b2e39a7829fc7fefa7d6cf825deff5
-
+
https://github.com/dotnet/runtime-assets
- eb4194502b1eb78fe0bda938d633eac5f0968c1d
+ 6082ed1bb2cfd2d394cdc0ec613c88f3754041f7
https://github.com/dotnet/roslyn
@@ -438,41 +438,41 @@
https://github.com/NuGet/NuGet.Client
8fef55f5a55a3b4f2c96cd1a9b5ddc51d4b927f8
-
+
https://github.com/dotnet/node
- a3f38a5efc1ec0104af7aa212451a6a8dba5af8c
+ 703264f70f553a06adfb330378c96f56b7583273
-
+
https://github.com/dotnet/node
- a3f38a5efc1ec0104af7aa212451a6a8dba5af8c
+ 703264f70f553a06adfb330378c96f56b7583273
-
+
https://github.com/dotnet/node
- a3f38a5efc1ec0104af7aa212451a6a8dba5af8c
+ 703264f70f553a06adfb330378c96f56b7583273
-
+
https://github.com/dotnet/node
- a3f38a5efc1ec0104af7aa212451a6a8dba5af8c
+ 703264f70f553a06adfb330378c96f56b7583273
-
+
https://github.com/dotnet/node
- a3f38a5efc1ec0104af7aa212451a6a8dba5af8c
+ 703264f70f553a06adfb330378c96f56b7583273
-
+
https://github.com/dotnet/node
- a3f38a5efc1ec0104af7aa212451a6a8dba5af8c
+ 703264f70f553a06adfb330378c96f56b7583273
-
+
https://github.com/dotnet/node
- a3f38a5efc1ec0104af7aa212451a6a8dba5af8c
+ 703264f70f553a06adfb330378c96f56b7583273
-
+
https://github.com/dotnet/node
- a3f38a5efc1ec0104af7aa212451a6a8dba5af8c
+ 703264f70f553a06adfb330378c96f56b7583273
-
+
https://github.com/dotnet/runtime-assets
- eb4194502b1eb78fe0bda938d633eac5f0968c1d
+ 6082ed1bb2cfd2d394cdc0ec613c88f3754041f7
diff --git a/eng/Versions.props b/eng/Versions.props
index a6da06d19e2472..49c75940b4b650 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -142,21 +142,21 @@
8.0.0
8.0.0
- 10.0.0-beta.25057.1
- 10.0.0-beta.25057.1
- 10.0.0-beta.25057.1
- 10.0.0-beta.25057.1
- 10.0.0-beta.25057.1
- 10.0.0-beta.25057.1
- 10.0.0-beta.25057.1
- 10.0.0-beta.25057.1
- 10.0.0-beta.25057.1
- 10.0.0-beta.25057.1
- 10.0.0-beta.25057.1
- 10.0.0-beta.25057.1
- 10.0.0-beta.25057.1
- 10.0.0-beta.25057.1
- 10.0.0-beta.25057.1
+ 10.0.0-beta.25060.2
+ 10.0.0-beta.25060.2
+ 10.0.0-beta.25060.2
+ 10.0.0-beta.25060.2
+ 10.0.0-beta.25060.2
+ 10.0.0-beta.25060.2
+ 10.0.0-beta.25060.2
+ 10.0.0-beta.25060.2
+ 10.0.0-beta.25060.2
+ 10.0.0-beta.25060.2
+ 10.0.0-beta.25060.2
+ 10.0.0-beta.25060.2
+ 10.0.0-beta.25060.2
+ 10.0.0-beta.25060.2
+ 10.0.0-beta.25060.2
10.0.0-prerelease.24610.1
10.0.0-prerelease.24610.1
@@ -251,7 +251,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-10_0_100_Transport
-->
- 10.0.0-alpha.1.25058.3
+ 10.0.0-alpha.1.25059.1
$(MicrosoftNETWorkloadEmscriptenCurrentManifest100100TransportVersion)
1.1.87-gba258badda
@@ -270,7 +270,7 @@
1.0.406601
$(MicrosoftDotNetApiCompatTaskVersion)
- 10.0.0-alpha.1.25056.2
+ 10.0.0-alpha.1.25057.1
$(MicrosoftNETRuntimeEmscriptenVersion)
$(runtimewinx64MicrosoftNETCoreRuntimeWasmNodeTransportPackageVersion)
diff --git a/eng/pipelines/common/platform-matrix-multijob.yml b/eng/pipelines/common/platform-matrix-multijob.yml
deleted file mode 100644
index 5aa172664bce51..00000000000000
--- a/eng/pipelines/common/platform-matrix-multijob.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-# Use one list of platforms to create build jobs for multiple templates. Avoids
-# platform list duplication.
-parameters:
- jobTemplates: []
- platforms: []
-
-jobs:
-
-- ${{ each job in parameters.jobTemplates }}:
- - template: /eng/pipelines/common/platform-matrix.yml
- parameters:
- platforms: ${{ parameters.platforms }}
- ${{ insert }}: ${{ job }}
diff --git a/eng/pipelines/coreclr/perf-non-wasm-jobs.yml b/eng/pipelines/coreclr/perf-non-wasm-jobs.yml
index 81f20c32cd076a..9418fb0a517b88 100644
--- a/eng/pipelines/coreclr/perf-non-wasm-jobs.yml
+++ b/eng/pipelines/coreclr/perf-non-wasm-jobs.yml
@@ -1,5 +1,82 @@
parameters:
- perfBranch: 'main'
+ - name: perfBranch
+ type: string
+ default: main
+ - name: crossgen
+ type: object
+ default:
+ enabled: true
+ configs:
+ - windows_x64
+ - windows_x86
+ - name: viperJitOptRepeat
+ type: object
+ default:
+ enabled: true
+ configs:
+ - windows_x64
+ - linux_x64
+ - name: viperMicro
+ type: object
+ default:
+ enabled: true
+ configs:
+ - windows_x64
+ - linux_x64
+ - name: owlMicro
+ type: object
+ default:
+ enabled: true
+ configs:
+ - windows_x64
+ - linux_x64
+ - name: tigerNoR2R
+ type: object
+ default:
+ enabled: true
+ configs:
+ - windows_x64
+ - linux_x64
+ - name: tigerNoPGO
+ type: object
+ default:
+ enabled: true
+ configs:
+ - windows_x64
+ - linux_x64
+ - name: tigerMicro
+ type: object
+ default:
+ enabled: true
+ configs:
+ - windows_x64
+ - linux_x64
+ - windown_x86
+ - linux_musl_x64
+ - name: tigerMonoAOT
+ type: object
+ default:
+ enabled: true
+ configs:
+ - linux_x64
+ - name: tigerMonoInterpreter
+ type: object
+ default:
+ enabled: true
+ configs:
+ - linux_x64
+ - name: tigerMono
+ type: object
+ default:
+ enabled: true
+ configs:
+ - linux_x64
+ - name: androidMono
+ type: object
+ default:
+ enabled: true
+ configs:
+ - android_arm64
jobs:
diff --git a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml
index 9a769124a05dcf..c123ea162e4d08 100644
--- a/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml
+++ b/eng/pipelines/extra-platforms/runtime-extra-platforms-ioslike.yml
@@ -39,9 +39,9 @@ jobs:
isExtraPlatforms: ${{ parameters.isExtraPlatformsBuild }}
# Don't trim tests on rolling builds
${{ if eq(variables['isRollingBuild'], true) }}:
- buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) /p:BuildTestsOnHelix=true /p:EnableAdditionalTimezoneChecks=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true /p:IsManualOrRollingBuild=true /p:EnableAggressiveTrimming=false
+ buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) /p:BuildTestsOnHelix=true /p:EnableAdditionalTimezoneChecks=true /p:UsePortableRuntimePack=false /p:BuildDarwinFrameworks=true /p:IsManualOrRollingBuild=true /p:EnableAggressiveTrimming=false
${{ else }}:
- buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) /p:BuildTestsOnHelix=true /p:EnableAdditionalTimezoneChecks=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true /p:IsManualOrRollingBuild=true /p:EnableAggressiveTrimming=true
+ buildArgs: -s mono+libs+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true $(_runSmokeTestsOnlyArg) /p:BuildTestsOnHelix=true /p:EnableAdditionalTimezoneChecks=true /p:UsePortableRuntimePack=false /p:BuildDarwinFrameworks=true /p:IsManualOrRollingBuild=true /p:EnableAggressiveTrimming=true
timeoutInMinutes: 480
# extra steps, run tests
postBuildSteps:
diff --git a/eng/pipelines/libraries/fuzzing/deploy-to-onefuzz.yml b/eng/pipelines/libraries/fuzzing/deploy-to-onefuzz.yml
index 2c9d95a807d11b..1f7a53fe649409 100644
--- a/eng/pipelines/libraries/fuzzing/deploy-to-onefuzz.yml
+++ b/eng/pipelines/libraries/fuzzing/deploy-to-onefuzz.yml
@@ -98,6 +98,14 @@ extends:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
displayName: Send HttpHeadersFuzzer to OneFuzz
+ - task: onefuzz-task@0
+ inputs:
+ onefuzzOSes: 'Windows'
+ env:
+ onefuzzDropDirectory: $(fuzzerProject)/deployment/IPAddressFuzzer
+ SYSTEM_ACCESSTOKEN: $(System.AccessToken)
+ displayName: Send IPAddressFuzzer to OneFuzz
+
- task: onefuzz-task@0
inputs:
onefuzzOSes: 'Windows'
diff --git a/eng/pipelines/libraries/helix-queues-setup.yml b/eng/pipelines/libraries/helix-queues-setup.yml
index 42de807c32dbd8..41ae3ed5189361 100644
--- a/eng/pipelines/libraries/helix-queues-setup.yml
+++ b/eng/pipelines/libraries/helix-queues-setup.yml
@@ -126,7 +126,6 @@ jobs:
- ${{ if ne(parameters.jobParameters.testScope, 'outerloop') }}:
- (Windows.10.Amd64.ServerRS5.Open)windows.10.amd64.serverrs5.open@mcr.microsoft.com/dotnet-buildtools/prereqs:windowsservercore-ltsc2019-helix-amd64
- ${{ if or(ne(parameters.jobParameters.isExtraPlatformsBuild, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}:
- - Windows.81.Amd64.Open
- Windows.Amd64.Server2022.Open
- Windows.11.Amd64.Client.Open
- ${{ if eq(parameters.jobParameters.testScope, 'outerloop') }}:
diff --git a/eng/pipelines/runtime-official.yml b/eng/pipelines/runtime-official.yml
index 92ec42cb046514..4604248840acb0 100644
--- a/eng/pipelines/runtime-official.yml
+++ b/eng/pipelines/runtime-official.yml
@@ -73,7 +73,7 @@ extends:
jobParameters:
templatePath: 'templates-official'
buildArgs: -s clr.runtime+clr.alljits+clr.nativeaotruntime -c $(_BuildConfig) /bl:$(Build.SourcesDirectory)/artifacts/logs/$(_BuildConfig)/CoreClrNativeBuild.binlog
- nameSuffix: CoreCLR
+ nameSuffix: AllRuntimes
isOfficialBuild: ${{ variables.isOfficialBuild }}
timeoutInMinutes: 120
postBuildSteps:
@@ -85,8 +85,8 @@ extends:
# Now that we've signed the diagnostic files, do the rest of the build.
- template: /eng/pipelines/common/templates/global-build-step.yml
parameters:
- buildArgs: -s clr.corelib+clr.nativecorelib+clr.nativeaotlibs+clr.tools+clr.packages+libs+host+packs -c $(_BuildConfig)
- displayName: Build managed CoreCLR components, all libraries, hosts, and packs
+ buildArgs: -s clr.corelib+clr.nativecorelib+clr.nativeaotlibs+clr.tools+clr.packages+mono+libs+host+packs -c $(_BuildConfig) /p:DotNetBuildAllRuntimePacks=true
+ displayName: Build managed CoreCLR components, Mono, all libraries, hosts, and packs
# Upload the results.
- template: /eng/pipelines/common/upload-intermediate-artifacts-step.yml
@@ -94,7 +94,7 @@ extends:
name: $(osGroup)$(osSubgroup)_$(archType)
#
- # Build CoreCLR runtime packs
+ # Build all runtime packs
# Mac x64/arm64
# Sign and entitle createdump and corerun after native build.
#
@@ -108,7 +108,7 @@ extends:
jobParameters:
templatePath: 'templates-official'
buildArgs: -s clr.runtime+clr.alljits+clr.nativeaotruntime+host.native -c $(_BuildConfig) /bl:$(Build.SourcesDirectory)/artifacts/logs/$(_BuildConfig)/CoreClrNativeBuild.binlog
- nameSuffix: CoreCLR
+ nameSuffix: AllRuntimes
isOfficialBuild: ${{ variables.isOfficialBuild }}
timeoutInMinutes: 120
postBuildSteps:
@@ -136,8 +136,8 @@ extends:
# Now that we've entitled and signed createdump, we can build the rest.
- template: /eng/pipelines/common/templates/global-build-step.yml
parameters:
- buildArgs: -s clr.corelib+clr.nativecorelib+clr.nativeaotlibs+clr.tools+clr.packages+libs+host.tools+host.pkg+packs -c $(_BuildConfig)
- displayName: Build managed CoreCLR and host components, all libraries, and packs
+ buildArgs: -s clr.corelib+clr.nativecorelib+clr.nativeaotlibs+clr.tools+clr.packages+mono+libs+host.tools+host.pkg+packs -c $(_BuildConfig) /p:DotNetBuildAllRuntimePacks=true
+ displayName: Build managed CoreCLR and host components, Mono, all libraries, and packs
# Upload the results.
- template: /eng/pipelines/common/upload-intermediate-artifacts-step.yml
@@ -145,10 +145,8 @@ extends:
name: $(osGroup)$(osSubgroup)_$(archType)
#
- # Build CoreCLR runtime packs
- # Linux and Linux_musl
- # CoreCLR runtime for CrossDac packaging
- # Create Linux installers
+ # Build all runtime packs for Linux and Linux musl
+ # Upload CoreCLR runtime for CrossDac packaging
#
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
@@ -163,8 +161,8 @@ extends:
- linux_musl_arm64
jobParameters:
templatePath: 'templates-official'
- buildArgs: -s clr.runtime+clr.alljits+clr.corelib+clr.nativecorelib+clr.tools+clr.aot+clr.packages+libs+host+packs -c $(_BuildConfig)
- nameSuffix: CoreCLR
+ buildArgs: -c $(_BuildConfig) /p:DotNetBuildAllRuntimePacks=true
+ nameSuffix: AllRuntimes
isOfficialBuild: ${{ variables.isOfficialBuild }}
timeoutInMinutes: 120
postBuildSteps:
@@ -235,12 +233,12 @@ extends:
parameters:
name: windows_x64
dependsOn:
- - build_linux_x64_release_CoreCLR
- - build_linux_arm_release_CoreCLR
- - build_linux_arm64_release_CoreCLR
- - build_linux_musl_x64_release_CoreCLR
- - build_linux_musl_arm_release_CoreCLR
- - build_linux_musl_arm64_release_CoreCLR
+ - build_linux_x64_release_AllRuntimes
+ - build_linux_arm_release_AllRuntimes
+ - build_linux_arm64_release_AllRuntimes
+ - build_linux_musl_x64_release_AllRuntimes
+ - build_linux_musl_arm_release_AllRuntimes
+ - build_linux_musl_arm64_release_AllRuntimes
variables:
- name: crossDacArtifactsContainer
value: CoreCLRCrossDacArtifacts
@@ -250,60 +248,13 @@ extends:
value: $(crossDacArtifactsBasePath)/$(crossDacArtifactsContainer)
#
- # Build NativeAOT runtime packs
+ # Build All runtime packs for mobile platforms
#
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
buildConfig: release
platforms:
- - osx_x64
- - osx_arm64
- - maccatalyst_x64
- - maccatalyst_arm64
- - tvossimulator_x64
- - tvossimulator_arm64
- - tvos_arm64
- - iossimulator_x64
- - iossimulator_arm64
- - ios_arm64
- - linux_x64
- - linux_arm
- - linux_arm64
- - linux_musl_x64
- - linux_musl_arm
- - linux_musl_arm64
- - linux_bionic_x64
- - linux_bionic_arm
- - linux_bionic_arm64
- - windows_x86
- - windows_x64
- - windows_arm64
- jobParameters:
- templatePath: 'templates-official'
- buildArgs: -c $(_BuildConfig) /p:DotNetBuildRuntimeNativeAOTRuntimePack=true
- nameSuffix: NativeAOT
- isOfficialBuild: ${{ variables.isOfficialBuild }}
- postBuildSteps:
- # delete Microsoft.NETCore.App.Ref package to prevent upload conflict
- - task: DeleteFiles@1
- displayName: 'Delete Microsoft.NETCore.App.Ref package'
- inputs:
- SourceFolder: $(Build.SourcesDirectory)/artifacts/packages/$(_BuildConfig)/Shipping
- Contents: 'Microsoft.NETCore.App.Ref.*.nupkg'
- - template: /eng/pipelines/common/upload-intermediate-artifacts-step.yml
- parameters:
- name: NativeAOTRuntimePacks
-
- #
- # Build Mono runtime packs
- #
- - template: /eng/pipelines/common/platform-matrix.yml
- parameters:
- jobTemplate: /eng/pipelines/common/global-build-job.yml
- buildConfig: release
- runtimeFlavor: mono
- platforms:
- android_x64
- android_x86
- android_arm
@@ -316,34 +267,26 @@ extends:
- iossimulator_x64
- iossimulator_arm64
- ios_arm64
- - osx_x64
- - osx_arm64
- - linux_x64
- - linux_arm
- - linux_arm64
- - linux_musl_x64
- - linux_bionic_arm64
- linux_bionic_x64
- # - linux_musl_arm
- # - linux_musl_arm64
- - windows_x64
- - windows_x86
- # - windows_arm64
+ - linux_bionic_arm
+ - linux_bionic_arm64
jobParameters:
templatePath: 'templates-official'
- buildArgs: -s mono+libs+host+packs -c $(_BuildConfig) /p:BuildMonoAOTCrossCompiler=false
- nameSuffix: Mono
+ buildArgs: -c $(_BuildConfig) /p:BuildMonoAOTCrossCompiler=false /p:DotNetBuildAllRuntimePacks=true
+ nameSuffix: AllRuntimes
isOfficialBuild: ${{ variables.isOfficialBuild }}
postBuildSteps:
- # delete Microsoft.NETCore.App.Ref package to prevent upload conflict
+ # delete duplicate RIDless packages to prevent upload conflict
- task: DeleteFiles@1
- displayName: 'Delete Microsoft.NETCore.App.Ref package'
+ displayName: 'Delete Microsoft.NETCore.App.Ref and Microsoft.NETCore.App.HostModel package'
inputs:
SourceFolder: $(Build.SourcesDirectory)/artifacts/packages/$(_BuildConfig)/Shipping
- Contents: 'Microsoft.NETCore.App.Ref.*.nupkg'
+ Contents: |
+ 'Microsoft.NETCore.App.Ref.*.nupkg'
+ 'Microsoft.NET.HostModel.*.nupkg'
- template: /eng/pipelines/common/upload-intermediate-artifacts-step.yml
parameters:
- name: MonoRuntimePacks
+ name: MobileRuntimePacks
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
@@ -359,15 +302,17 @@ extends:
nameSuffix: Mono
isOfficialBuild: ${{ variables.isOfficialBuild }}
postBuildSteps:
- # delete Microsoft.NETCore.App.Ref package to prevent upload conflict
+ # delete duplicate RIDless packages to prevent upload conflict
- task: DeleteFiles@1
- displayName: 'Delete Microsoft.NETCore.App.Ref package'
+ displayName: 'Delete Microsoft.NETCore.App.Ref and Microsoft.NETCore.App.HostModel package'
inputs:
SourceFolder: $(Build.SourcesDirectory)/artifacts/packages/$(_BuildConfig)/Shipping
- Contents: 'Microsoft.NETCore.App.Ref.*.nupkg'
+ Contents: |
+ 'Microsoft.NETCore.App.Ref.*.nupkg'
+ 'Microsoft.NET.HostModel.*.nupkg'
- template: /eng/pipelines/common/upload-intermediate-artifacts-step.yml
parameters:
- name: MonoRuntimePacks
+ name: MobileRuntimePacks
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
@@ -383,75 +328,49 @@ extends:
isOfficialBuild: ${{ variables.isOfficialBuild }}
runtimeVariant: multithread
postBuildSteps:
- # delete Microsoft.NETCore.App.Ref package to prevent upload conflict
+ # delete duplicate RIDless packages to prevent upload conflict
- task: DeleteFiles@1
- displayName: 'Delete Microsoft.NETCore.App.Ref package'
+ displayName: 'Delete Microsoft.NETCore.App.Ref and Microsoft.NETCore.App.HostModel package'
inputs:
SourceFolder: $(Build.SourcesDirectory)/artifacts/packages/$(_BuildConfig)/Shipping
- Contents: 'Microsoft.NETCore.App.Ref.*.nupkg'
+ Contents: |
+ 'Microsoft.NETCore.App.Ref.*.nupkg'
+ 'Microsoft.NET.HostModel.*.nupkg'
- template: /eng/pipelines/common/upload-intermediate-artifacts-step.yml
parameters:
- name: MonoRuntimePacks
+ name: MobileRuntimePacks
#
- # Build Mono release AOT cross-compilers
+ # Build Mono LLVM runtime packs
#
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/common/global-build-job.yml
- runtimeFlavor: mono
- buildConfig: release
platforms:
+ - osx_x64
- linux_x64
- - linux_musl_x64
- linux_arm64
- - linux_musl_arm64
- - windows_arm64
- - windows_x64
- - osx_x64
- - osx_arm64
+ buildConfig: release
+ runtimeFlavor: mono
jobParameters:
templatePath: 'templates-official'
- buildArgs: -c $(_BuildConfig) /p:DotNetBuildMonoCrossAOT=true
- nameSuffix: CrossAOT_Mono
- runtimeVariant: crossaot
+ buildArgs: -s mono+libs+host+packs -c $(_BuildConfig)
+ /p:MonoEnableLLVM=true /p:MonoAOTEnableLLVM=true /p:MonoBundleLLVMOptimizer=true
+ nameSuffix: Mono_LLVMAOT
+ runtimeVariant: LLVMAOT
isOfficialBuild: ${{ variables.isOfficialBuild }}
postBuildSteps:
+ # delete duplicate RIDless packages to prevent upload conflict
+ - task: DeleteFiles@1
+ displayName: 'Delete Microsoft.NETCore.App.Ref and Microsoft.NETCore.App.HostModel package'
+ inputs:
+ SourceFolder: $(Build.SourcesDirectory)/artifacts/packages/$(_BuildConfig)/Shipping
+ Contents: |
+ 'Microsoft.NETCore.App.Ref.*.nupkg'
+ 'Microsoft.NET.HostModel.*.nupkg'
- template: /eng/pipelines/common/upload-intermediate-artifacts-step.yml
parameters:
- name: MonoRuntimePacks
-
- #
- # Build Mono LLVM runtime packs
- #
- - template: /eng/pipelines/common/platform-matrix-multijob.yml
- parameters:
- platforms:
- - osx_x64
- - linux_x64
- # - linux_arm
- - linux_arm64
- # - linux_musl_x64
- # - linux_musl_arm64
- # - windows_x64
- # - windows_x86
- # - windows_arm64
- jobTemplates:
- #LLVMAOT
- - jobTemplate: /eng/pipelines/common/global-build-job.yml
- buildConfig: release
- runtimeFlavor: mono
- jobParameters:
- templatePath: 'templates-official'
- buildArgs: -s mono+libs+host+packs -c $(_BuildConfig)
- /p:MonoEnableLLVM=true /p:MonoAOTEnableLLVM=true /p:MonoBundleLLVMOptimizer=true
- nameSuffix: Mono_LLVMAOT
- runtimeVariant: LLVMAOT
- isOfficialBuild: ${{ variables.isOfficialBuild }}
- postBuildSteps:
- - template: /eng/pipelines/common/upload-intermediate-artifacts-step.yml
- parameters:
- name: MonoRuntimePacks
+ name: $(osGroup)$(osSubgroup)_$(archType)
#
# Build libraries (all TFMs) and packages
@@ -525,36 +444,36 @@ extends:
artifact: 'IntermediateArtifacts'
path: $(Build.SourcesDirectory)/artifacts/workloadPackages
patterns: |
- IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.android-*.nupkg
- IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.AOT.win-arm64.Cross.android-*.nupkg
- IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm*.nupkg
- IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.AOT.win-arm64.Cross.browser-wasm*.nupkg
- IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.wasi-wasm*.nupkg
- IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.AOT.win-arm64.Cross.wasi-wasm*.nupkg
- IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.Mono.android-*.nupkg
- IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.Mono.browser-wasm*.nupkg
- IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.Mono.multithread.browser-wasm*.nupkg
- IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.Mono.ios-*.nupkg
- IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.Mono.iossimulator-*.nupkg
- IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.Mono.maccatalyst-*.nupkg
- IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.Mono.multithread.browser-wasm*.nupkg
- IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.Mono.tvos-*.nupkg
- IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.Mono.tvossimulator-*.nupkg
- IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.Mono.wasi-wasm*.nupkg
- 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.Workload.Mono.ToolChain.net9.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
- IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NET.Runtime.WebAssembly.Wasi*.nupkg
- IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NET.Runtime.WebAssembly.Templates*.nupkg
+ IntermediateArtifacts/windows_x64/Shipping/Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.android-*.nupkg
+ IntermediateArtifacts/windows_arm64/Shipping/Microsoft.NETCore.App.Runtime.AOT.win-arm64.Cross.android-*.nupkg
+ IntermediateArtifacts/windows_x64/Shipping/Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm*.nupkg
+ IntermediateArtifacts/windows_arm64/Shipping/Microsoft.NETCore.App.Runtime.AOT.win-arm64.Cross.browser-wasm*.nupkg
+ IntermediateArtifacts/windows_x64/Shipping/Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.wasi-wasm*.nupkg
+ IntermediateArtifacts/windows_arm64/Shipping/Microsoft.NETCore.App.Runtime.AOT.win-arm64.Cross.wasi-wasm*.nupkg
+ IntermediateArtifacts/MobileRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.Mono.android-*.nupkg
+ IntermediateArtifacts/MobileRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.Mono.browser-wasm*.nupkg
+ IntermediateArtifacts/MobileRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.Mono.multithread.browser-wasm*.nupkg
+ IntermediateArtifacts/MobileRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.Mono.ios-*.nupkg
+ IntermediateArtifacts/MobileRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.Mono.iossimulator-*.nupkg
+ IntermediateArtifacts/MobileRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.Mono.maccatalyst-*.nupkg
+ IntermediateArtifacts/MobileRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.Mono.multithread.browser-wasm*.nupkg
+ IntermediateArtifacts/MobileRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.Mono.tvos-*.nupkg
+ IntermediateArtifacts/MobileRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.Mono.tvossimulator-*.nupkg
+ IntermediateArtifacts/MobileRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.Mono.wasi-wasm*.nupkg
+ IntermediateArtifacts/MobileRuntimePacks/Shipping/Microsoft.NET.Workload.Mono.ToolChain.Current.Manifest*.nupkg
+ IntermediateArtifacts/MobileRuntimePacks/Shipping/Microsoft.NET.Workload.Mono.ToolChain.net6.Manifest*.nupkg
+ IntermediateArtifacts/MobileRuntimePacks/Shipping/Microsoft.NET.Workload.Mono.ToolChain.net7.Manifest*.nupkg
+ IntermediateArtifacts/MobileRuntimePacks/Shipping/Microsoft.NET.Workload.Mono.ToolChain.net8.Manifest*.nupkg
+ IntermediateArtifacts/MobileRuntimePacks/Shipping/Microsoft.NET.Workload.Mono.ToolChain.net9.Manifest*.nupkg
+ IntermediateArtifacts/MobileRuntimePacks/Shipping/Microsoft.NET.Runtime.MonoTargets.Sdk*.nupkg
+ IntermediateArtifacts/MobileRuntimePacks/Shipping/Microsoft.NET.Runtime.MonoAOTCompiler.Task*.nupkg
+ IntermediateArtifacts/MobileRuntimePacks/Shipping/Microsoft.NET.Runtime.WebAssembly.Sdk*.nupkg
+ IntermediateArtifacts/MobileRuntimePacks/Shipping/Microsoft.NET.Runtime.WebAssembly.Wasi*.nupkg
+ IntermediateArtifacts/MobileRuntimePacks/Shipping/Microsoft.NET.Runtime.WebAssembly.Templates*.nupkg
IntermediateArtifacts/windows_arm64/Shipping/Microsoft.NETCore.App.Runtime.win-arm64*.nupkg
IntermediateArtifacts/windows_x64/Shipping/Microsoft.NETCore.App.Runtime.win-x64*.nupkg
IntermediateArtifacts/windows_x86/Shipping/Microsoft.NETCore.App.Runtime.win-x86*.nupkg
- IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NET.Sdk.WebAssembly.Pack*.nupkg
+ IntermediateArtifacts/MobileRuntimePacks/Shipping/Microsoft.NET.Sdk.WebAssembly.Pack*.nupkg
- task: CopyFiles@2
displayName: Flatten packages
@@ -566,7 +485,7 @@ extends:
flattenFolders: true
buildArgs: -s mono.workloads -c $(_BuildConfig) /p:PackageSource=$(Build.SourcesDirectory)/artifacts/workloadPackages /p:WorkloadOutputPath=$(Build.SourcesDirectory)/artifacts/workloads
-
+
postBuildSteps:
# Prepare packages wrapping msis
- task: CopyFiles@2
@@ -603,25 +522,23 @@ extends:
isOfficialBuild: ${{ variables.isOfficialBuild }}
timeoutInMinutes: 120
dependsOn:
- - Build_android_arm_release_Mono
- - Build_android_arm64_release_Mono
- - Build_android_x86_release_Mono
- - Build_android_x64_release_Mono
+ - Build_android_arm_release_AllRuntimes
+ - Build_android_arm64_release_AllRuntimes
+ - Build_android_x86_release_AllRuntimes
+ - Build_android_x64_release_AllRuntimes
- Build_browser_wasm_Linux_release_Mono
- Build_wasi_wasm_linux_release_Mono
- - Build_ios_arm64_release_Mono
- - Build_iossimulator_x64_release_Mono
- - Build_iossimulator_arm64_release_Mono
- - Build_maccatalyst_arm64_release_Mono
- - Build_maccatalyst_x64_release_Mono
- - Build_tvos_arm64_release_Mono
- - Build_tvossimulator_arm64_release_Mono
- - Build_tvossimulator_x64_release_Mono
- - Build_windows_arm64_release_CrossAOT_Mono
- - Build_windows_x64_release_CrossAOT_Mono
- - Build_windows_x64_release_CoreCLR
- - Build_windows_x86_release_CoreCLR
- - Build_windows_arm64_release_CoreCLR
+ - Build_ios_arm64_release_AllRuntimes
+ - Build_iossimulator_x64_release_AllRuntimes
+ - Build_iossimulator_arm64_release_AllRuntimes
+ - Build_maccatalyst_arm64_release_AllRuntimes
+ - Build_maccatalyst_x64_release_AllRuntimes
+ - Build_tvos_arm64_release_AllRuntimes
+ - Build_tvossimulator_arm64_release_AllRuntimes
+ - Build_tvossimulator_x64_release_AllRuntimes
+ - Build_windows_x64_release_AllRuntimes
+ - Build_windows_x86_release_AllRuntimes
+ - Build_windows_arm64_release_AllRuntimes
- ${{ if eq(variables.isOfficialBuild, true) }}:
- template: /eng/pipelines/official/stages/publish.yml
diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml
index 49f615c82c5d23..a7b03da8ddd183 100644
--- a/eng/pipelines/runtime.yml
+++ b/eng/pipelines/runtime.yml
@@ -973,7 +973,7 @@ extends:
jobParameters:
testGroup: innerloop
nameSuffix: AllSubsets_Mono
- buildArgs: -s mono+libs+libs.tests+host+packs -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true /p:RunSmokeTestsOnly=true /p:BuildTestsOnHelix=true /p:EnableAdditionalTimezoneChecks=true /p:UsePortableRuntimePack=true /p:BuildDarwinFrameworks=true /p:EnableAggressiveTrimming=true
+ buildArgs: -s mono+libs+libs.tests+host+packs -c $(_BuildConfig) /p:ArchiveTests=true /p:DevTeamProvisioning=- /p:RunAOTCompilation=true /p:RunSmokeTestsOnly=true /p:BuildTestsOnHelix=true /p:EnableAdditionalTimezoneChecks=true /p:UsePortableRuntimePack=false /p:BuildDarwinFrameworks=true /p:EnableAggressiveTrimming=true
timeoutInMinutes: 480
condition: >-
or(
diff --git a/eng/testing/tests.ioslike.targets b/eng/testing/tests.ioslike.targets
index a59cce6c49aeea..e2e36415a31834 100644
--- a/eng/testing/tests.ioslike.targets
+++ b/eng/testing/tests.ioslike.targets
@@ -16,7 +16,7 @@
<_AOTBuildCommand Condition="'$(ContinuousIntegrationBuild)' != 'true'">$(_AOTBuildCommand) /p:RuntimeSrcDir=$(RepoRoot) /p:RuntimeConfig=$(Configuration)
- <_AOTBuildCommand>$(_AOTBuildCommand) /p:XHARNESS_EXECUTION_DIR="$XHARNESS_EXECUTION_DIR" /p:RunAOTCompilation=$(RunAOTCompilation) /p:UseNativeAOTRuntime=$(UseNativeAOTRuntime) /p:TargetOS=$(TargetOS) /p:TargetArchitecture=$(TargetArchitecture) /p:MonoForceInterpreter=$(MonoForceInterpreter) /p:MonoEnableLLVM=true /p:DevTeamProvisioning=$(DevTeamProvisioning) /p:UsePortableRuntimePack=true /p:Configuration=$(Configuration) /p:EnableAggressiveTrimming=$(EnableAggressiveTrimming)
+ <_AOTBuildCommand>$(_AOTBuildCommand) /p:XHARNESS_EXECUTION_DIR="$XHARNESS_EXECUTION_DIR" /p:RunAOTCompilation=$(RunAOTCompilation) /p:UseNativeAOTRuntime=$(UseNativeAOTRuntime) /p:TargetOS=$(TargetOS) /p:TargetArchitecture=$(TargetArchitecture) /p:MonoForceInterpreter=$(MonoForceInterpreter) /p:MonoEnableLLVM=true /p:DevTeamProvisioning=$(DevTeamProvisioning) /p:UsePortableRuntimePack=$(UsePortableRuntimePack) /p:Configuration=$(Configuration)
<_AOTBuildCommand Condition="'$(NativeLib)' != ''">$(_AOTBuildCommand) /p:NativeLib=$(NativeLib) /p:BundlesResources=$(BundlesResources) /p:ForceLibraryModeGenerateAppBundle=$(ForceLibraryModeGenerateAppBundle)
<_AOTBuildCommand>$(_AOTBuildCommand)
@@ -77,8 +77,6 @@
-
@@ -156,12 +154,6 @@
<_AppleItemsToPass Include="@(ReferenceExtraPathFiles->'%(FileName)%(Extension)')"
OriginalItemName__="AppleReferenceExtraPathFiles" />
- <_AppleItemsToPass Include="@(RuntimeHostConfigurationOption)"
- OriginalItemName__="_AppleUsedRuntimeHostConfigurationOption" />
-
- <_AppleItemsToPass Include="@(TrimmerRootAssembly)"
- OriginalItemName__="TrimmerRootAssembly" />
-
-
+
+
true
true
$(NoWarn);IL2103;IL2025;IL2111;IL2122
- false
false
- false
- false
false
- false
-
-
+
+
false
<_DefaultValueAttributeSupport Condition="'$(OverrideDefaultValueAndDesignerHostSupport)' == 'true'">true
<_DesignerHostSupport Condition="'$(OverrideDefaultValueAndDesignerHostSupport)' == 'true'">true
diff --git a/eng/testing/workloads-browser.targets b/eng/testing/workloads-browser.targets
index 8f610916ff9837..ad279f9f506223 100644
--- a/eng/testing/workloads-browser.targets
+++ b/eng/testing/workloads-browser.targets
@@ -80,7 +80,7 @@
diff --git a/eng/testing/workloads-wasm.targets b/eng/testing/workloads-wasm.targets
index cf7776018338ac..c6c5568818a34c 100644
--- a/eng/testing/workloads-wasm.targets
+++ b/eng/testing/workloads-wasm.targets
@@ -17,11 +17,10 @@
<_PropsForAOTCrossBuild Include="@(_DefaultPropsForNuGetBuild)" />
<_PropsForAOTCrossBuild Include="TestingWorkloads=true" />
<_PropsForAOTCrossBuild Include="RuntimeIdentifier=$(NETCoreSdkRuntimeIdentifier)" />
- <_PropsForAOTCrossBuild Include="TargetCrossRid=$(RIDForWorkload)" />
<_PropsForAOTCrossBuild Include="DisableSourceLink=true" />
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs
index 1bf9c90c514357..17bb50457648f5 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/RuntimeAssembly.cs
@@ -200,7 +200,7 @@ private static partial void GetTypeCoreIgnoreCase(QCallAssembly assembly,
int nestedTypeNamesLength,
ObjectHandleOnStack retType);
- internal Type? GetTypeCore(string typeName, ReadOnlySpan nestedTypeNames, bool throwOnError, bool ignoreCase)
+ internal Type? GetTypeCore(string typeName, ReadOnlySpan nestedTypeNames, bool throwOnFileNotFound, bool ignoreCase)
{
RuntimeAssembly runtimeAssembly = this;
Type? type = null;
@@ -224,14 +224,11 @@ private static partial void GetTypeCoreIgnoreCase(QCallAssembly assembly,
ObjectHandleOnStack.Create(ref type));
}
}
- catch (FileNotFoundException) when (!throwOnError)
+ catch (FileNotFoundException) when (!throwOnFileNotFound)
{
return null;
}
- if (type == null && throwOnError)
- throw new TypeLoadException(SR.Format(SR.ClassLoad_General /* TypeLoad_TypeNotFoundInAssembly */, typeName, FullName));
-
return type;
}
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Reflection/TypeNameResolver.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Reflection/TypeNameResolver.CoreCLR.cs
index 78e2422b341044..70b88afc0726bb 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Reflection/TypeNameResolver.CoreCLR.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Reflection/TypeNameResolver.CoreCLR.cs
@@ -213,7 +213,8 @@ internal static RuntimeType GetTypeReferencedByCustomAttribute(string typeName,
{
throw new TypeLoadException(assembly is null ?
SR.Format(SR.TypeLoad_ResolveType, escapedTypeName) :
- SR.Format(SR.TypeLoad_ResolveTypeFromAssembly, escapedTypeName, assembly.FullName));
+ SR.Format(SR.TypeLoad_ResolveTypeFromAssembly, escapedTypeName, assembly.FullName),
+ typeName: escapedTypeName);
}
return null;
}
@@ -226,7 +227,7 @@ internal static RuntimeType GetTypeReferencedByCustomAttribute(string typeName,
{
if (_throwOnError)
{
- throw new TypeLoadException(SR.Format(SR.TypeLoad_ResolveType, escapedTypeName));
+ throw new TypeLoadException(SR.Format(SR.TypeLoad_ResolveType, escapedTypeName), typeName: escapedTypeName);
}
return null;
}
@@ -235,13 +236,26 @@ internal static RuntimeType GetTypeReferencedByCustomAttribute(string typeName,
if (assembly is RuntimeAssembly runtimeAssembly)
{
- string unescapedTypeName = TypeNameHelpers.Unescape(escapedTypeName);
// Compat: Non-extensible parser allows ambiguous matches with ignore case lookup
- if (!_extensibleParser || !_ignoreCase)
+ bool useReflectionForNestedTypes = _extensibleParser && _ignoreCase;
+
+ type = runtimeAssembly.GetTypeCore(TypeNameHelpers.Unescape(escapedTypeName), useReflectionForNestedTypes ? default : nestedTypeNames,
+ throwOnFileNotFound: _throwOnError, ignoreCase: _ignoreCase);
+
+ if (type is null)
{
- return runtimeAssembly.GetTypeCore(unescapedTypeName, nestedTypeNames, throwOnError: _throwOnError, ignoreCase: _ignoreCase);
+ if (_throwOnError)
+ {
+ throw new TypeLoadException(SR.Format(SR.TypeLoad_ResolveTypeFromAssembly, parsedName.FullName, runtimeAssembly.FullName),
+ typeName: parsedName.FullName);
+ }
+ return null;
+ }
+
+ if (!useReflectionForNestedTypes)
+ {
+ return type;
}
- type = runtimeAssembly.GetTypeCore(unescapedTypeName, default, throwOnError: _throwOnError, ignoreCase: _ignoreCase);
}
else
{
@@ -268,7 +282,8 @@ internal static RuntimeType GetTypeReferencedByCustomAttribute(string typeName,
if (_throwOnError)
{
throw new TypeLoadException(SR.Format(SR.TypeLoad_ResolveNestedType,
- nestedTypeNames[i], (i > 0) ? nestedTypeNames[i - 1] : TypeNameHelpers.Unescape(escapedTypeName)));
+ nestedTypeNames[i], (i > 0) ? nestedTypeNames[i - 1] : TypeNameHelpers.Unescape(escapedTypeName)),
+ typeName: parsedName.FullName);
}
return null;
}
@@ -282,7 +297,7 @@ internal static RuntimeType GetTypeReferencedByCustomAttribute(string typeName,
RuntimeAssembly? requestingAssembly = (RuntimeAssembly?)_requestingAssembly;
if (requestingAssembly is not null)
{
- Type? type = requestingAssembly.GetTypeCore(typeName, nestedTypeNames, throwOnError: false, ignoreCase: _ignoreCase);
+ Type? type = requestingAssembly.GetTypeCore(typeName, nestedTypeNames, throwOnFileNotFound: false, ignoreCase: _ignoreCase);
if (type is not null)
return type;
}
@@ -290,7 +305,7 @@ internal static RuntimeType GetTypeReferencedByCustomAttribute(string typeName,
RuntimeAssembly coreLib = (RuntimeAssembly)typeof(object).Assembly;
if (requestingAssembly != coreLib)
{
- Type? type = coreLib.GetTypeCore(typeName, nestedTypeNames, throwOnError: false, ignoreCase: _ignoreCase);
+ Type? type = coreLib.GetTypeCore(typeName, nestedTypeNames, throwOnFileNotFound: false, ignoreCase: _ignoreCase);
if (type is not null)
return type;
}
@@ -298,13 +313,16 @@ internal static RuntimeType GetTypeReferencedByCustomAttribute(string typeName,
RuntimeAssembly? resolvedAssembly = AssemblyLoadContext.OnTypeResolve(requestingAssembly, parsedName.FullName);
if (resolvedAssembly is not null)
{
- Type? type = resolvedAssembly.GetTypeCore(typeName, nestedTypeNames, throwOnError: false, ignoreCase: _ignoreCase);
+ Type? type = resolvedAssembly.GetTypeCore(typeName, nestedTypeNames, throwOnFileNotFound: false, ignoreCase: _ignoreCase);
if (type is not null)
return type;
}
if (_throwOnError)
- throw new TypeLoadException(SR.Format(SR.TypeLoad_ResolveTypeFromAssembly, parsedName.FullName, (requestingAssembly ?? coreLib).FullName));
+ {
+ throw new TypeLoadException(SR.Format(SR.TypeLoad_ResolveTypeFromAssembly, parsedName.FullName, (requestingAssembly ?? coreLib).FullName),
+ typeName: parsedName.FullName);
+ }
return null;
}
diff --git a/src/coreclr/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs b/src/coreclr/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs
index f63c420d7a02bc..c646bada45e01c 100644
--- a/src/coreclr/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs
+++ b/src/coreclr/System.Private.CoreLib/src/System/Threading/Thread.CoreCLR.cs
@@ -490,5 +490,37 @@ private void ResetFinalizerThreadSlow()
Priority = ThreadPriority.Highest;
}
}
+
+ [LibraryImport(RuntimeHelpers.QCall, EntryPoint = "ThreadNative_PollGC")]
+ private static partial void ThreadNative_PollGC();
+
+ // GC Suspension is done by simply dropping into native code via p/invoke, and we reuse the p/invoke
+ // mechanism for suspension. On all architectures we should have the actual stub used for the check be implemented
+ // as a small assembly stub which checks the global g_TrapReturningThreads flag and tail-call to this helper
+ private static unsafe void PollGC()
+ {
+ NativeThreadState catchAtSafePoint = ((NativeThreadClass*)Thread.DirectOnThreadLocalData.pNativeThread)->m_State & NativeThreadState.TS_CatchAtSafePoint;
+ if (catchAtSafePoint != NativeThreadState.None)
+ {
+ ThreadNative_PollGC();
+ }
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ private struct NativeThreadClass
+ {
+ public NativeThreadState m_State;
+ }
+
+ private enum NativeThreadState
+ {
+ None = 0,
+ TS_AbortRequested = 0x00000001, // Abort the thread
+ TS_DebugSuspendPending = 0x00000008, // Is the debugger suspending threads?
+ TS_GCOnTransitions = 0x00000010, // Force a GC on stub transitions (GCStress only)
+
+ // We require (and assert) that the following bits are less than 0x100.
+ TS_CatchAtSafePoint = (TS_AbortRequested | TS_DebugSuspendPending | TS_GCOnTransitions),
+ };
}
}
diff --git a/src/coreclr/debug/ee/debugger.h b/src/coreclr/debug/ee/debugger.h
index 2a5c63200327ae..9da256056f71d0 100644
--- a/src/coreclr/debug/ee/debugger.h
+++ b/src/coreclr/debug/ee/debugger.h
@@ -3994,6 +3994,8 @@ HANDLE OpenWin32EventOrThrow(
// Returns true if the specified IL offset has a special meaning (eg. prolog, etc.)
bool DbgIsSpecialILOffset(DWORD offset);
+#if defined(TARGET_WINDOWS)
void FixupDispatcherContext(T_DISPATCHER_CONTEXT* pDispatcherContext, T_CONTEXT* pContext, PEXCEPTION_ROUTINE pUnwindPersonalityRoutine = NULL);
+#endif
#endif /* DEBUGGER_H_ */
diff --git a/src/coreclr/dlls/mscoree/coreclr/CMakeLists.txt b/src/coreclr/dlls/mscoree/coreclr/CMakeLists.txt
index 6dd42fe2b2538c..aed404b39e5ae2 100644
--- a/src/coreclr/dlls/mscoree/coreclr/CMakeLists.txt
+++ b/src/coreclr/dlls/mscoree/coreclr/CMakeLists.txt
@@ -186,7 +186,6 @@ if(FEATURE_MERGE_JIT_AND_ENGINE)
endif(FEATURE_MERGE_JIT_AND_ENGINE)
if (CLR_CMAKE_TARGET_OSX)
- include(CMakeFindFrameworks)
find_library(FOUNDATION Foundation REQUIRED)
endif()
diff --git a/src/coreclr/ildasm/dasm.cpp b/src/coreclr/ildasm/dasm.cpp
index 7a272cf27ca84a..e30cea034d29e9 100644
--- a/src/coreclr/ildasm/dasm.cpp
+++ b/src/coreclr/ildasm/dasm.cpp
@@ -1414,7 +1414,7 @@ mdToken ResolveReflectionNotation(BYTE* dataPtr,
if(mAsmRefs)
{
mdToken tkResScope = 0;
- mdToken tk=TokenFromRid(mdtAssemblyRef,1), tkmax=TokenFromRid(mdtAssemblyRef,mAsmRefs);
+ mdToken tk=TokenFromRid(1, mdtAssemblyRef), tkmax=TokenFromRid(mAsmRefs, mdtAssemblyRef);
LPCSTR szAsmRefName;
// these are dummies
const void* pPKT, *pHash;
@@ -1914,7 +1914,7 @@ BYTE* PrettyPrintCABlobValue(PCCOR_SIGNATURE &typePtr,
for(n=0; n < numElements; n++)
{
if(n) appendStr(out," ");
- sprintf_s(str, 64, "%.*g", 8, (double)(*((float*)dataPtr)));
+ sprintf_s(str, 64, "%#.8g", (double)(*((float*)dataPtr)));
float df = (float)atof(str);
// Must compare as underlying bytes, not floating point otherwise optimizer will
// try to enregister and compare 80-bit precision number with 32-bit precision number!!!!
@@ -1933,7 +1933,7 @@ BYTE* PrettyPrintCABlobValue(PCCOR_SIGNATURE &typePtr,
{
if(n) appendStr(out," ");
char *pch;
- sprintf_s(str, 64, "%.*g", 17, *((double*)dataPtr));
+ sprintf_s(str, 64, "%#.17g", *((double*)dataPtr));
double df = strtod(str, &pch);
// Must compare as underlying bytes, not floating point otherwise optimizer will
// try to enregister and compare 80-bit precision number with 64-bit precision number!!!!
@@ -2608,7 +2608,7 @@ void DumpDefaultValue(mdToken tok, __inout __nullterminated char* szString, void
case ELEMENT_TYPE_R4:
{
char szf[32];
- sprintf_s(szf, 32, "%.*g", 8, (double)MDDV.m_fltValue);
+ sprintf_s(szf, 32, "%#.8g", (double)MDDV.m_fltValue);
float df = (float)atof(szf);
// Must compare as underlying bytes, not floating point otherwise optimizer will
// try to enregister and compare 80-bit precision number with 32-bit precision number!!!!
@@ -2622,7 +2622,7 @@ void DumpDefaultValue(mdToken tok, __inout __nullterminated char* szString, void
case ELEMENT_TYPE_R8:
{
char szf[32], *pch;
- sprintf_s(szf, 32, "%.*g", 17, MDDV.m_dblValue);
+ sprintf_s(szf, 32, "%#.17g", MDDV.m_dblValue);
double df = strtod(szf, &pch); //atof(szf);
szf[31]=0;
// Must compare as underlying bytes, not floating point otherwise optimizer will
diff --git a/src/coreclr/inc/jithelpers.h b/src/coreclr/inc/jithelpers.h
index b34f77518b9d98..38114a9bbfcada 100644
--- a/src/coreclr/inc/jithelpers.h
+++ b/src/coreclr/inc/jithelpers.h
@@ -149,8 +149,8 @@
// GC support
DYNAMICJITHELPER(CORINFO_HELP_STOP_FOR_GC, JIT_RareDisableHelper, METHOD__NIL)
- JITHELPER(CORINFO_HELP_POLL_GC, JIT_PollGC, METHOD__NIL)
-
+ DYNAMICJITHELPER(CORINFO_HELP_POLL_GC, JIT_PollGC, METHOD__THREAD__POLLGC)
+
JITHELPER(CORINFO_HELP_CHECK_OBJ, JIT_CheckObj, METHOD__NIL)
// GC Write barrier support
diff --git a/src/coreclr/jit/assertionprop.cpp b/src/coreclr/jit/assertionprop.cpp
index bad18a06c30584..51220e99b352eb 100644
--- a/src/coreclr/jit/assertionprop.cpp
+++ b/src/coreclr/jit/assertionprop.cpp
@@ -2600,6 +2600,89 @@ AssertionIndex Compiler::optAssertionIsSubtype(GenTree* tree, GenTree* methodTab
return NO_ASSERTION_INDEX;
}
+//------------------------------------------------------------------------------
+// optVNBasedFoldExpr_Call_Memset: Unrolls NI_System_SpanHelpers_Fill for constant length.
+//
+// Arguments:
+// call - NI_System_SpanHelpers_Fill call to unroll
+//
+// Return Value:
+// Returns a new tree or nullptr if nothing is changed.
+//
+GenTree* Compiler::optVNBasedFoldExpr_Call_Memset(GenTreeCall* call)
+{
+ assert(call->IsSpecialIntrinsic(this, NI_System_SpanHelpers_Fill));
+
+ CallArg* dstArg = call->gtArgs.GetUserArgByIndex(0);
+ CallArg* lenArg = call->gtArgs.GetUserArgByIndex(1);
+ CallArg* valArg = call->gtArgs.GetUserArgByIndex(2);
+
+ var_types valType = valArg->GetSignatureType();
+ unsigned lengthScale = genTypeSize(valType);
+
+ if (lengthScale == 1)
+ {
+ // Lower expands it slightly better.
+ JITDUMP("...value's type is byte - leave it for lower to expand.\n");
+ return nullptr;
+ }
+
+ if (varTypeIsStruct(valType) || varTypeIsGC(valType))
+ {
+ JITDUMP("...value's type is not supported - bail out.\n");
+ return nullptr;
+ }
+
+ ValueNum lenVN = vnStore->VNConservativeNormalValue(lenArg->GetNode()->gtVNPair);
+ if (!vnStore->IsVNConstant(lenVN))
+ {
+ JITDUMP("...length is not a constant - bail out.\n");
+ return nullptr;
+ }
+
+ size_t len = vnStore->CoercedConstantValue(lenVN);
+ if ((len > getUnrollThreshold(Memset)) ||
+ // The first condition prevents the overflow in the second condition.
+ // since both len and lengthScale are expected to be small at this point.
+ (len * lengthScale) > getUnrollThreshold(Memset))
+ {
+ JITDUMP("...length is too big to unroll - bail out.\n");
+ return nullptr;
+ }
+
+ // Some arbitrary threshold if the value is not a constant,
+ // since it is unlikely that we can optimize it further.
+ if (!valArg->GetNode()->OperIsConst() && (len >= 8))
+ {
+ JITDUMP("...length is too big to unroll for non-constant value - bail out.\n");
+ return nullptr;
+ }
+
+ // Spill the side effects directly in the args, we're going to
+ // pick them up in the following gtExtractSideEffList
+ GenTree* dst = fgMakeMultiUse(&dstArg->NodeRef());
+ GenTree* val = fgMakeMultiUse(&valArg->NodeRef());
+
+ GenTree* result = nullptr;
+ gtExtractSideEffList(call, &result, GTF_ALL_EFFECT, true);
+
+ for (size_t offset = 0; offset < len; offset++)
+ {
+ // Clone dst and add offset if necessary.
+ GenTree* offsetNode = gtNewIconNode((ssize_t)(offset * lengthScale), TYP_I_IMPL);
+ GenTree* currDst = gtNewOperNode(GT_ADD, dst->TypeGet(), gtCloneExpr(dst), offsetNode);
+ GenTreeStoreInd* storeInd =
+ gtNewStoreIndNode(valType, currDst, gtCloneExpr(val), GTF_IND_UNALIGNED | GTF_IND_ALLOW_NON_ATOMIC);
+
+ // Merge with the previous result.
+ result = result == nullptr ? storeInd : gtNewOperNode(GT_COMMA, TYP_VOID, result, storeInd);
+ }
+
+ JITDUMP("...optimized into STOREIND(s):\n");
+ DISPTREE(result);
+ return result;
+}
+
//------------------------------------------------------------------------------
// optVNBasedFoldExpr_Call_Memmove: Unrolls NI_System_SpanHelpers_Memmove/CORINFO_HELP_MEMCPY
// if possible. This function effectively duplicates LowerCallMemmove.
@@ -2758,6 +2841,11 @@ GenTree* Compiler::optVNBasedFoldExpr_Call(BasicBlock* block, GenTree* parent, G
return optVNBasedFoldExpr_Call_Memmove(call);
}
+ if (call->IsSpecialIntrinsic(this, NI_System_SpanHelpers_Fill))
+ {
+ return optVNBasedFoldExpr_Call_Memset(call);
+ }
+
return nullptr;
}
@@ -4692,6 +4780,19 @@ GenTree* Compiler::optAssertionProp_Cast(ASSERT_VALARG_TP assertions, GenTreeCas
return nullptr;
}
+ // Try and see if we can make this cast into a cheaper zero-extending version
+ // if the input is known to be non-negative.
+ if (!cast->IsUnsigned() && genActualTypeIsInt(lcl) && cast->TypeIs(TYP_LONG) && (TARGET_POINTER_SIZE == 8))
+ {
+ bool isKnownNonZero;
+ bool isKnownNonNegative;
+ optAssertionProp_RangeProperties(assertions, lcl, &isKnownNonZero, &isKnownNonNegative);
+ if (isKnownNonNegative)
+ {
+ cast->SetUnsigned();
+ }
+ }
+
IntegralRange range = IntegralRange::ForCastInput(cast);
AssertionIndex index = optAssertionIsSubrange(lcl, range, assertions);
if (index != NO_ASSERTION_INDEX)
diff --git a/src/coreclr/jit/codegenarmarch.cpp b/src/coreclr/jit/codegenarmarch.cpp
index 07b08c3692a4e5..fb1e738f81451e 100644
--- a/src/coreclr/jit/codegenarmarch.cpp
+++ b/src/coreclr/jit/codegenarmarch.cpp
@@ -611,8 +611,6 @@ void CodeGen::genEmitGSCookieCheck(bool pushReg)
{
noway_assert(compiler->gsGlobalSecurityCookieAddr || compiler->gsGlobalSecurityCookieVal);
- assert(GetEmitter()->emitGCDisabled());
-
// We need two temporary registers, to load the GS cookie values and compare them. We can't use
// any argument registers if 'pushReg' is true (meaning we have a JMP call). They should be
// callee-trash registers, which should not contain anything interesting at this point.
diff --git a/src/coreclr/jit/codegencommon.cpp b/src/coreclr/jit/codegencommon.cpp
index ef5a45a8c7841c..4e5c864d34b631 100644
--- a/src/coreclr/jit/codegencommon.cpp
+++ b/src/coreclr/jit/codegencommon.cpp
@@ -1516,47 +1516,34 @@ void CodeGen::genExitCode(BasicBlock* block)
genIPmappingAdd(IPmappingDscKind::Epilog, DebugInfo(), true);
bool jmpEpilog = block->HasFlag(BBF_HAS_JMP);
- if (compiler->getNeedsGSSecurityCookie())
- {
-#ifndef JIT32_GCENCODER
- // At this point the gc info that we track in codegen is often incorrect,
- // as it could be missing return registers or arg registers (in a case of tail call).
- // GS cookie check will emit a call and that will pass our GC info to emit and potentially mess things up.
- // While we could infer returns/args and force them to be live and it seems to work in JIT32_GCENCODER case,
- // it appears to be nontrivial in more general case.
- // So, instead, we just claim that the whole thing is not GC-interruptible.
- // Effectively this starts the epilog a few instructions earlier.
- //
- // CONSIDER: is that a good place to be that codegen loses track of returns/args at this point?
- GetEmitter()->emitDisableGC();
-#endif
- genEmitGSCookieCheck(jmpEpilog);
-
-#ifdef JIT32_GCENCODER
- if (jmpEpilog)
+#ifdef DEBUG
+ // For returnining epilogs do some validation that the GC info looks right.
+ if (!jmpEpilog)
+ {
+ if (compiler->compMethodReturnsRetBufAddr())
{
- // Dev10 642944 -
- // The GS cookie check created a temp label that has no live
- // incoming GC registers, we need to fix that
-
- unsigned varNum;
- LclVarDsc* varDsc;
-
- /* Figure out which register parameters hold pointers */
+ assert((gcInfo.gcRegByrefSetCur & RBM_INTRET) != RBM_NONE);
+ }
+ else
+ {
+ const ReturnTypeDesc& retTypeDesc = compiler->compRetTypeDesc;
+ const unsigned regCount = retTypeDesc.GetReturnRegCount();
- for (varNum = 0, varDsc = compiler->lvaTable; varNum < compiler->lvaCount && varDsc->lvIsRegArg;
- varNum++, varDsc++)
+ for (unsigned i = 0; i < regCount; ++i)
{
- noway_assert(varDsc->lvIsParam);
-
- gcInfo.gcMarkRegPtrVal(varDsc->GetArgReg(), varDsc->TypeGet());
+ var_types type = retTypeDesc.GetReturnRegType(i);
+ regNumber reg = retTypeDesc.GetABIReturnReg(i, compiler->info.compCallConv);
+ assert((type == TYP_BYREF) == ((gcInfo.gcRegByrefSetCur & genRegMask(reg)) != RBM_NONE));
+ assert((type == TYP_REF) == ((gcInfo.gcRegGCrefSetCur & genRegMask(reg)) != RBM_NONE));
}
-
- GetEmitter()->emitThisGCrefRegs = GetEmitter()->emitInitGCrefRegs = gcInfo.gcRegGCrefSetCur;
- GetEmitter()->emitThisByrefRegs = GetEmitter()->emitInitByrefRegs = gcInfo.gcRegByrefSetCur;
}
+ }
#endif
+
+ if (compiler->getNeedsGSSecurityCookie())
+ {
+ genEmitGSCookieCheck(jmpEpilog);
}
genReserveEpilog(block);
@@ -4711,8 +4698,7 @@ void CodeGen::genReserveProlog(BasicBlock* block)
JITDUMP("Reserving prolog IG for block " FMT_BB "\n", block->bbNum);
- /* Nothing is live on entry to the prolog */
-
+ // Nothing is live on entry to the prolog
GetEmitter()->emitCreatePlaceholderIG(IGPT_PROLOG, block, VarSetOps::MakeEmpty(compiler), 0, 0, false);
}
@@ -4723,13 +4709,12 @@ void CodeGen::genReserveProlog(BasicBlock* block)
void CodeGen::genReserveEpilog(BasicBlock* block)
{
+ assert(block != nullptr);
+
JITDUMP("Reserving epilog IG for block " FMT_BB "\n", block->bbNum);
- assert(block != nullptr);
- // We pass empty GC info, because epilog is always an extend IG and will ignore what we pass.
- // Besides, at this point the GC info that we track in CodeGen is often incorrect.
- // See comments in genExitCode for more info.
- GetEmitter()->emitCreatePlaceholderIG(IGPT_EPILOG, block, VarSetOps::MakeEmpty(compiler), 0, 0, block->IsLast());
+ GetEmitter()->emitCreatePlaceholderIG(IGPT_EPILOG, block, VarSetOps::MakeEmpty(compiler), gcInfo.gcRegGCrefSetCur,
+ gcInfo.gcRegByrefSetCur, block->IsLast());
}
/*****************************************************************************
@@ -7162,14 +7147,24 @@ void CodeGen::genReturn(GenTree* treeNode)
}
}
+ const ReturnTypeDesc& retTypeDesc = compiler->compRetTypeDesc;
+
+ if (compiler->compMethodReturnsRetBufAddr())
+ {
+ gcInfo.gcMarkRegPtrVal(REG_INTRET, TYP_BYREF);
+ }
+ else
+ {
+ unsigned retRegCount = retTypeDesc.GetReturnRegCount();
+ for (unsigned i = 0; i < retRegCount; ++i)
+ {
+ gcInfo.gcMarkRegPtrVal(retTypeDesc.GetABIReturnReg(i, compiler->info.compCallConv),
+ retTypeDesc.GetReturnRegType(i));
+ }
+ }
+
#ifdef PROFILING_SUPPORTED
- // !! Note !!
- // TODO-AMD64-Unix: If the profiler hook is implemented on *nix, make sure for 2 register returned structs
- // the RAX and RDX needs to be kept alive. Make the necessary changes in lowerxarch.cpp
- // in the handling of the GT_RETURN statement.
- // Such structs containing GC pointers need to be handled by calling gcInfo.gcMarkRegSetNpt
- // for the return registers containing GC refs.
- //
+
// Reason for not materializing Leave callback as a GT_PROF_HOOK node after GT_RETURN:
// In flowgraph and other places assert that the last node of a block marked as
// BBJ_RETURN is either a GT_RETURN or GT_JMP or a tail call. It would be nice to
@@ -7180,46 +7175,7 @@ void CodeGen::genReturn(GenTree* treeNode)
//
if (treeNode->OperIs(GT_RETURN, GT_SWIFT_ERROR_RET) && compiler->compIsProfilerHookNeeded())
{
- // !! NOTE !!
- // Since we are invalidating the assumption that we would slip into the epilog
- // right after the "return", we need to preserve the return reg's GC state
- // across the call until actual method return.
-
- ReturnTypeDesc retTypeDesc = compiler->compRetTypeDesc;
- unsigned retRegCount = retTypeDesc.GetReturnRegCount();
-
- if (compiler->compMethodReturnsRetBufAddr())
- {
- gcInfo.gcMarkRegPtrVal(REG_INTRET, TYP_BYREF);
- }
- else
- {
- for (unsigned i = 0; i < retRegCount; ++i)
- {
- if (varTypeIsGC(retTypeDesc.GetReturnRegType(i)))
- {
- gcInfo.gcMarkRegPtrVal(retTypeDesc.GetABIReturnReg(i, compiler->info.compCallConv),
- retTypeDesc.GetReturnRegType(i));
- }
- }
- }
-
genProfilingLeaveCallback(CORINFO_HELP_PROF_FCN_LEAVE);
-
- if (compiler->compMethodReturnsRetBufAddr())
- {
- gcInfo.gcMarkRegSetNpt(genRegMask(REG_INTRET));
- }
- else
- {
- for (unsigned i = 0; i < retRegCount; ++i)
- {
- if (varTypeIsGC(retTypeDesc.GetReturnRegType(i)))
- {
- gcInfo.gcMarkRegSetNpt(genRegMask(retTypeDesc.GetABIReturnReg(i, compiler->info.compCallConv)));
- }
- }
- }
}
#endif // PROFILING_SUPPORTED
@@ -7469,6 +7425,12 @@ void CodeGen::genCallPlaceRegArgs(GenTreeCall* call)
/* canSkip */ true);
use = use->GetNext();
+
+ if (call->IsFastTailCall())
+ {
+ // We won't actually consume the register here -- keep it alive into the epilog.
+ gcInfo.gcMarkRegPtrVal(seg.GetRegister(), putArgRegNode->TypeGet());
+ }
}
assert(use == nullptr);
@@ -7493,6 +7455,12 @@ void CodeGen::genCallPlaceRegArgs(GenTreeCall* call)
var_types type = argNode->AsPutArgSplit()->GetRegType(regIndex);
inst_Mov(genActualType(type), seg.GetRegister(), allocReg, /* canSkip */ true);
+ if (call->IsFastTailCall())
+ {
+ // We won't actually consume the register here -- keep it alive into the epilog.
+ gcInfo.gcMarkRegPtrVal(seg.GetRegister(), type);
+ }
+
regIndex++;
}
@@ -7505,6 +7473,12 @@ void CodeGen::genCallPlaceRegArgs(GenTreeCall* call)
regNumber argReg = abiInfo.Segment(0).GetRegister();
genConsumeReg(argNode);
inst_Mov(genActualType(argNode), argReg, argNode->GetRegNum(), /* canSkip */ true);
+
+ if (call->IsFastTailCall())
+ {
+ // We won't actually consume the register here -- keep it alive into the epilog.
+ gcInfo.gcMarkRegPtrVal(argReg, argNode->TypeGet());
+ }
continue;
}
diff --git a/src/coreclr/jit/codegeninterface.h b/src/coreclr/jit/codegeninterface.h
index dccaf724b7f358..800f12c597f1d2 100644
--- a/src/coreclr/jit/codegeninterface.h
+++ b/src/coreclr/jit/codegeninterface.h
@@ -595,7 +595,7 @@ class CodeGenInterface
protected:
// Keeps track of how many bytes we've pushed on the processor's stack.
- unsigned genStackLevel;
+ unsigned genStackLevel = 0;
public:
//--------------------------------------------
diff --git a/src/coreclr/jit/codegenlinear.cpp b/src/coreclr/jit/codegenlinear.cpp
index e3dfa8a5695c40..53257afb010b74 100644
--- a/src/coreclr/jit/codegenlinear.cpp
+++ b/src/coreclr/jit/codegenlinear.cpp
@@ -483,24 +483,34 @@ void CodeGen::genCodeForBBlist()
regSet.rsSpillChk();
- /* Make sure we didn't bungle pointer register tracking */
+ // Make sure we didn't bungle pointer register tracking
regMaskTP ptrRegs = gcInfo.gcRegGCrefSetCur | gcInfo.gcRegByrefSetCur;
regMaskTP nonVarPtrRegs = ptrRegs & ~regSet.GetMaskVars();
- // If return is a GC-type, clear it. Note that if a common
- // epilog is generated (genReturnBB) it has a void return
- // even though we might return a ref. We can't use the compRetType
- // as the determiner because something we are tracking as a byref
- // might be used as a return value of a int function (which is legal)
- GenTree* blockLastNode = block->lastNode();
- if ((blockLastNode != nullptr) && (blockLastNode->OperIs(GT_RETURN, GT_SWIFT_ERROR_RET)) &&
- (varTypeIsGC(compiler->info.compRetType) ||
- (blockLastNode->AsOp()->GetReturnValue() != nullptr &&
- varTypeIsGC(blockLastNode->AsOp()->GetReturnValue()->TypeGet()))))
+ // If this is a return block then we expect some live GC regs. Clear those.
+ if (compiler->compMethodReturnsRetBufAddr())
{
nonVarPtrRegs &= ~RBM_INTRET;
}
+ else
+ {
+ const ReturnTypeDesc& retTypeDesc = compiler->compRetTypeDesc;
+ const unsigned regCount = retTypeDesc.GetReturnRegCount();
+
+ for (unsigned i = 0; i < regCount; ++i)
+ {
+ regNumber reg = retTypeDesc.GetABIReturnReg(i, compiler->info.compCallConv);
+ nonVarPtrRegs &= ~genRegMask(reg);
+ }
+ }
+
+ // For a tailcall arbitrary argument registers may be live into the
+ // prolog. Skip validating those.
+ if (block->HasFlag(BBF_HAS_JMP))
+ {
+ nonVarPtrRegs &= ~fullIntArgRegMask(CorInfoCallConvExtension::Managed);
+ }
if (nonVarPtrRegs)
{
diff --git a/src/coreclr/jit/codegenloongarch64.cpp b/src/coreclr/jit/codegenloongarch64.cpp
index c7fa8df00c4bc0..7f235ee2a1d1d6 100644
--- a/src/coreclr/jit/codegenloongarch64.cpp
+++ b/src/coreclr/jit/codegenloongarch64.cpp
@@ -4616,8 +4616,6 @@ void CodeGen::genEmitGSCookieCheck(bool pushReg)
{
noway_assert(compiler->gsGlobalSecurityCookieAddr || compiler->gsGlobalSecurityCookieVal);
- assert(GetEmitter()->emitGCDisabled());
-
// We need two temporary registers, to load the GS cookie values and compare them. We can't use
// any argument registers if 'pushReg' is true (meaning we have a JMP call). They should be
// callee-trash registers, which should not contain anything interesting at this point.
diff --git a/src/coreclr/jit/codegenriscv64.cpp b/src/coreclr/jit/codegenriscv64.cpp
index 6c93a636e0062c..9ce76ae3c0dab9 100644
--- a/src/coreclr/jit/codegenriscv64.cpp
+++ b/src/coreclr/jit/codegenriscv64.cpp
@@ -4666,8 +4666,6 @@ void CodeGen::genEmitGSCookieCheck(bool pushReg)
{
noway_assert(compiler->gsGlobalSecurityCookieAddr || compiler->gsGlobalSecurityCookieVal);
- assert(GetEmitter()->emitGCDisabled());
-
// We need two temporary registers, to load the GS cookie values and compare them. We can't use
// any argument registers if 'pushReg' is true (meaning we have a JMP call). They should be
// callee-trash registers, which should not contain anything interesting at this point.
diff --git a/src/coreclr/jit/codegenxarch.cpp b/src/coreclr/jit/codegenxarch.cpp
index bd80187eea6a44..dd843cbfa14a80 100644
--- a/src/coreclr/jit/codegenxarch.cpp
+++ b/src/coreclr/jit/codegenxarch.cpp
@@ -96,37 +96,6 @@ void CodeGen::genEmitGSCookieCheck(bool pushReg)
{
noway_assert(compiler->gsGlobalSecurityCookieAddr || compiler->gsGlobalSecurityCookieVal);
-#ifdef JIT32_GCENCODER
- if (!pushReg)
- {
- // Make sure that EAX is reported as live GC-ref so that any GC that kicks in while
- // executing GS cookie check will not collect the object pointed to by EAX.
- if (compiler->compMethodReturnsRetBufAddr())
- {
- // This is for returning in an implicit RetBuf.
- // If the address of the buffer is returned in REG_INTRET, mark the content of INTRET as ByRef.
-
- // In case the return is in an implicit RetBuf, the native return type should be a struct
- assert(varTypeIsStruct(compiler->info.compRetNativeType));
-
- gcInfo.gcMarkRegPtrVal(REG_INTRET, TYP_BYREF);
- }
- else
- {
- ReturnTypeDesc retTypeDesc = compiler->compRetTypeDesc;
- const unsigned regCount = retTypeDesc.GetReturnRegCount();
-
- for (unsigned i = 0; i < regCount; ++i)
- {
- gcInfo.gcMarkRegPtrVal(retTypeDesc.GetABIReturnReg(i, compiler->info.compCallConv),
- retTypeDesc.GetReturnRegType(i));
- }
- }
- }
-#else
- assert(GetEmitter()->emitGCDisabled());
-#endif
-
regNumber regGSCheck;
regMaskTP regMaskGSCheck = RBM_NONE;
diff --git a/src/coreclr/jit/compiler.cpp b/src/coreclr/jit/compiler.cpp
index 52975e90bf8854..5aab07895a7b85 100644
--- a/src/coreclr/jit/compiler.cpp
+++ b/src/coreclr/jit/compiler.cpp
@@ -4779,11 +4779,6 @@ void Compiler::compCompile(void** methodCodePtr, uint32_t* methodCodeSize, JitFl
//
DoPhase(this, PHASE_MORPH_IMPBYREF, &Compiler::fgRetypeImplicitByRefArgs);
- // Drop back to just checking profile likelihoods.
- //
- activePhaseChecks &= ~PhaseChecks::CHECK_PROFILE;
- activePhaseChecks |= PhaseChecks::CHECK_LIKELIHOODS;
-
#ifdef DEBUG
// Now that locals have address-taken and implicit byref marked, we can safely apply stress.
lvaStressLclFld();
@@ -4819,12 +4814,29 @@ void Compiler::compCompile(void** methodCodePtr, uint32_t* methodCodeSize, JitFl
//
DoPhase(this, PHASE_GS_COOKIE, &Compiler::gsPhase);
+ // Drop back to just checking profile likelihoods.
+ //
+ activePhaseChecks &= ~PhaseChecks::CHECK_PROFILE;
+ activePhaseChecks |= PhaseChecks::CHECK_LIKELIHOODS;
+
if (opts.OptimizationEnabled())
{
// Compute the block weights
//
DoPhase(this, PHASE_COMPUTE_BLOCK_WEIGHTS, &Compiler::fgComputeBlockWeights);
+ // Try again to remove empty try finally/fault clauses
+ //
+ DoPhase(this, PHASE_EMPTY_FINALLY_2, &Compiler::fgRemoveEmptyFinally);
+
+ // Remove empty try regions (try/finally)
+ //
+ DoPhase(this, PHASE_EMPTY_TRY_2, &Compiler::fgRemoveEmptyTry);
+
+ // Remove empty try regions (try/catch/fault)
+ //
+ DoPhase(this, PHASE_EMPTY_TRY_CATCH_FAULT_2, &Compiler::fgRemoveEmptyTryCatchOrTryFault);
+
// Invert loops
//
DoPhase(this, PHASE_INVERT_LOOPS, &Compiler::optInvertLoops);
@@ -4860,18 +4872,6 @@ void Compiler::compCompile(void** methodCodePtr, uint32_t* methodCodeSize, JitFl
//
DoPhase(this, PHASE_UNROLL_LOOPS, &Compiler::optUnrollLoops);
- // Try again to remove empty try finally/fault clauses
- //
- DoPhase(this, PHASE_EMPTY_FINALLY_2, &Compiler::fgRemoveEmptyFinally);
-
- // Remove empty try regions (try/finally)
- //
- DoPhase(this, PHASE_EMPTY_TRY_2, &Compiler::fgRemoveEmptyTry);
-
- // Remove empty try regions (try/catch/fault)
- //
- DoPhase(this, PHASE_EMPTY_TRY_CATCH_FAULT_2, &Compiler::fgRemoveEmptyTryCatchOrTryFault);
-
// Compute dominators and exceptional entry blocks
//
DoPhase(this, PHASE_COMPUTE_DOMINATORS, &Compiler::fgComputeDominators);
diff --git a/src/coreclr/jit/compiler.h b/src/coreclr/jit/compiler.h
index 626e6edfa38c9a..0e3986969c161e 100644
--- a/src/coreclr/jit/compiler.h
+++ b/src/coreclr/jit/compiler.h
@@ -3377,6 +3377,26 @@ class Compiler
CorInfoType simdBaseJitType,
unsigned simdSize);
+ GenTree* gtNewSimdIsEvenIntegerNode(var_types type,
+ GenTree* op1,
+ CorInfoType simdBaseJitType,
+ unsigned simdSize);
+
+ GenTree* gtNewSimdIsFiniteNode(var_types type,
+ GenTree* op1,
+ CorInfoType simdBaseJitType,
+ unsigned simdSize);
+
+ GenTree* gtNewSimdIsInfinityNode(var_types type,
+ GenTree* op1,
+ CorInfoType simdBaseJitType,
+ unsigned simdSize);
+
+ GenTree* gtNewSimdIsIntegerNode(var_types type,
+ GenTree* op1,
+ CorInfoType simdBaseJitType,
+ unsigned simdSize);
+
GenTree* gtNewSimdIsNaNNode(var_types type,
GenTree* op1,
CorInfoType simdBaseJitType,
@@ -3387,6 +3407,21 @@ class Compiler
CorInfoType simdBaseJitType,
unsigned simdSize);
+ GenTree* gtNewSimdIsNegativeInfinityNode(var_types type,
+ GenTree* op1,
+ CorInfoType simdBaseJitType,
+ unsigned simdSize);
+
+ GenTree* gtNewSimdIsNormalNode(var_types type,
+ GenTree* op1,
+ CorInfoType simdBaseJitType,
+ unsigned simdSize);
+
+ GenTree* gtNewSimdIsOddIntegerNode(var_types type,
+ GenTree* op1,
+ CorInfoType simdBaseJitType,
+ unsigned simdSize);
+
GenTree* gtNewSimdIsPositiveNode(var_types type,
GenTree* op1,
CorInfoType simdBaseJitType,
@@ -3397,6 +3432,11 @@ class Compiler
CorInfoType simdBaseJitType,
unsigned simdSize);
+ GenTree* gtNewSimdIsSubnormalNode(var_types type,
+ GenTree* op1,
+ CorInfoType simdBaseJitType,
+ unsigned simdSize);
+
GenTree* gtNewSimdIsZeroNode(var_types type,
GenTree* op1,
CorInfoType simdBaseJitType,
@@ -6276,7 +6316,6 @@ class Compiler
Compiler* compiler;
PriorityQueue cutPoints;
- unsigned* ordinals;
BasicBlock** blockOrder;
BasicBlock** tempOrder;
unsigned numCandidateBlocks;
@@ -8091,6 +8130,7 @@ class Compiler
GenTree* optVNBasedFoldExpr(BasicBlock* block, GenTree* parent, GenTree* tree);
GenTree* optVNBasedFoldExpr_Call(BasicBlock* block, GenTree* parent, GenTreeCall* call);
GenTree* optVNBasedFoldExpr_Call_Memmove(GenTreeCall* call);
+ GenTree* optVNBasedFoldExpr_Call_Memset(GenTreeCall* call);
AssertionIndex GetAssertionCount()
{
diff --git a/src/coreclr/jit/emitriscv64.cpp b/src/coreclr/jit/emitriscv64.cpp
index df5bbae20bd95b..01ab2f27d2e32b 100644
--- a/src/coreclr/jit/emitriscv64.cpp
+++ b/src/coreclr/jit/emitriscv64.cpp
@@ -3552,11 +3552,14 @@ void emitter::emitDispInsName(
const BYTE* insAdr = addr - writeableOffset;
unsigned int opcode = code & 0x7f;
- assert((opcode & 0x3) == 0x3);
+ assert((opcode & 0x3) == 0x3); // only 32-bit encodings supported
emitDispInsAddr(insAdr);
emitDispInsOffs(insOffset, doffs);
+ if (emitComp->opts.disCodeBytes && !emitComp->opts.disDiffable)
+ printf(" %08X ", code);
+
printf(" ");
switch (opcode)
@@ -4547,33 +4550,6 @@ void emitter::emitDispInsName(
NO_WAY("illegal ins within emitDisInsName!");
}
-/*****************************************************************************
- *
- * Display (optionally) the instruction encoding in hex
- */
-
-void emitter::emitDispInsHex(instrDesc* id, BYTE* code, size_t sz)
-{
- if (!emitComp->opts.disCodeBytes)
- {
- return;
- }
-
- // We do not display the instruction hex if we want diff-able disassembly
- if (!emitComp->opts.disDiffable)
- {
- if (sz == 4)
- {
- printf(" %08X ", (*((code_t*)code)));
- }
- else
- {
- assert(sz == 0);
- printf(" ");
- }
- }
-}
-
void emitter::emitDispInsInstrNum(const instrDesc* id) const
{
#ifdef DEBUG
@@ -5319,29 +5295,4 @@ const char* emitter::emitRegName(regNumber reg, emitAttr size, bool varName) con
}
#endif
-//------------------------------------------------------------------------
-// IsMovInstruction: Determines whether a give instruction is a move instruction
-//
-// Arguments:
-// ins -- The instruction being checked
-//
-bool emitter::IsMovInstruction(instruction ins)
-{
- switch (ins)
- {
- case INS_mov:
- case INS_fsgnj_s:
- case INS_fsgnj_d:
- {
- return true;
- }
-
- default:
- {
- return false;
- }
- }
- return false;
-}
-
#endif // defined(TARGET_RISCV64)
diff --git a/src/coreclr/jit/emitriscv64.h b/src/coreclr/jit/emitriscv64.h
index 6c73f3fe577fc4..446166fbe0e08d 100644
--- a/src/coreclr/jit/emitriscv64.h
+++ b/src/coreclr/jit/emitriscv64.h
@@ -85,10 +85,9 @@ void emitOutputInstrJumpDistanceHelper(const insGroup* ig,
// Method to do check if mov is redundant with respect to the last instruction.
// If yes, the caller of this method can choose to omit current mov instruction.
-static bool IsMovInstruction(instruction ins);
-bool IsRedundantMov(instruction ins, emitAttr size, regNumber dst, regNumber src, bool canSkip);
-bool IsRedundantLdStr(
- instruction ins, regNumber reg1, regNumber reg2, ssize_t imm, emitAttr size, insFormat fmt); // New functions end.
+bool IsRedundantMov(instruction ins, emitAttr size, regNumber dst, regNumber src, bool canSkip);
+bool IsRedundantLdStr(
+ instruction ins, regNumber reg1, regNumber reg2, ssize_t imm, emitAttr size, insFormat fmt); // New functions end.
static code_t insEncodeRTypeInstr(
unsigned opcode, unsigned rd, unsigned funct3, unsigned rs1, unsigned rs2, unsigned funct7);
diff --git a/src/coreclr/jit/fgbasic.cpp b/src/coreclr/jit/fgbasic.cpp
index 652a2d434380b1..a34e2622157ba3 100644
--- a/src/coreclr/jit/fgbasic.cpp
+++ b/src/coreclr/jit/fgbasic.cpp
@@ -156,14 +156,29 @@ void Compiler::fgConvertBBToThrowBB(BasicBlock* block)
}
// Scrub this block from the pred lists of any successors
- fgRemoveBlockAsPred(block);
+ bool profileInconsistent = false;
+
+ for (BasicBlock* const succBlock : block->Succs(this))
+ {
+ FlowEdge* const succEdge = fgRemoveAllRefPreds(succBlock, block);
+
+ if (block->hasProfileWeight() && succBlock->hasProfileWeight())
+ {
+ succBlock->decreaseBBProfileWeight(succEdge->getLikelyWeight());
+ profileInconsistent |= (succBlock->NumSucc() > 0);
+ }
+ }
+
+ if (profileInconsistent)
+ {
+ JITDUMP("Flow removal of " FMT_BB " needs to be propagated. Data %s inconsistent.\n", block->bbNum,
+ fgPgoConsistent ? "is now" : "was already");
+ fgPgoConsistent = false;
+ }
// Update jump kind after the scrub.
block->SetKindAndTargetEdge(BBJ_THROW);
block->RemoveFlags(BBF_RETLESS_CALL); // no longer a BBJ_CALLFINALLY
-
- // Any block with a throw is rare
- block->bbSetRunRarely();
}
/*****************************************************************************
diff --git a/src/coreclr/jit/fgehopt.cpp b/src/coreclr/jit/fgehopt.cpp
index 18fa193db493cc..2c8504ea0a8095 100644
--- a/src/coreclr/jit/fgehopt.cpp
+++ b/src/coreclr/jit/fgehopt.cpp
@@ -2433,7 +2433,7 @@ PhaseStatus Compiler::fgTailMergeThrows()
if (canonicalBlock->hasProfileWeight())
{
- canonicalBlock->setBBProfileWeight(canonicalBlock->bbWeight + removedWeight);
+ canonicalBlock->increaseBBProfileWeight(removedWeight);
modifiedProfile = true;
// Don't bother updating flow into nonCanonicalBlock, since it is now unreachable
@@ -2458,12 +2458,6 @@ PhaseStatus Compiler::fgTailMergeThrows()
assert(numCandidates < optNoReturnCallCount);
optNoReturnCallCount -= numCandidates;
- // If we altered flow, reset fgModified. Given where we sit in the
- // phase list, flow-dependent side data hasn't been built yet, so
- // nothing needs invalidation.
- //
- assert(fgModified);
- fgModified = false;
return PhaseStatus::MODIFIED_EVERYTHING;
}
diff --git a/src/coreclr/jit/fgopt.cpp b/src/coreclr/jit/fgopt.cpp
index 10d381c0caeaa8..d53df9af3597e3 100644
--- a/src/coreclr/jit/fgopt.cpp
+++ b/src/coreclr/jit/fgopt.cpp
@@ -1355,7 +1355,7 @@ bool Compiler::fgOptimizeBranchToEmptyUnconditional(BasicBlock* block, BasicBloc
//
if (bDest->hasProfileWeight())
{
- bDest->setBBProfileWeight(max(0.0, bDest->bbWeight - removedWeight));
+ bDest->decreaseBBProfileWeight(removedWeight);
}
return true;
@@ -1620,7 +1620,7 @@ bool Compiler::fgOptimizeSwitchBranches(BasicBlock* block)
if (bDest->hasProfileWeight())
{
weight_t const branchThroughWeight = oldEdge->getLikelyWeight();
- bDest->setBBProfileWeight(max(0.0, bDest->bbWeight - branchThroughWeight));
+ bDest->decreaseBBProfileWeight(branchThroughWeight);
}
// Update the switch jump table
@@ -4828,7 +4828,7 @@ void Compiler::fgMoveColdBlocks()
}
};
- BasicBlock* const lastMainBB = fgLastBBInMainFunction();
+ BasicBlock* lastMainBB = fgLastBBInMainFunction();
if (lastMainBB->IsFirst())
{
return;
@@ -4855,15 +4855,41 @@ void Compiler::fgMoveColdBlocks()
// We have moved all cold main blocks before lastMainBB to after lastMainBB.
// If lastMainBB itself is cold, move it to the end of the method to restore its relative ordering.
+ // But first, we can't move just the tail of a call-finally pair,
+ // so point lastMainBB to the pair's head, if necessary.
//
- if (lastMainBB->isBBWeightCold(this) && !lastMainBB->isBBCallFinallyPairTail())
+ if (lastMainBB->isBBCallFinallyPairTail())
{
+ lastMainBB = lastMainBB->Prev();
+ }
+
+ BasicBlock* lastHotBB = nullptr;
+ if (lastMainBB->isBBWeightCold(this))
+ {
+ // lastMainBB is cold, so the block behind it (if there is one) is the last hot block
+ //
+ lastHotBB = lastMainBB->Prev();
+
+ // Move lastMainBB
+ //
BasicBlock* const newLastMainBB = fgLastBBInMainFunction();
if (lastMainBB != newLastMainBB)
{
moveBlock(lastMainBB, newLastMainBB);
}
}
+ else
+ {
+ // lastMainBB isn't cold, so it (or its call-finally pair tail) the last hot block
+ //
+ lastHotBB = lastMainBB->isBBCallFinallyPair() ? lastMainBB->Next() : lastMainBB;
+ }
+
+ // Save the beginning of the cold section for later.
+ // If lastHotBB is null, there isn't a hot section,
+ // so there's no point in differentiating between sections for layout purposes.
+ //
+ fgFirstColdBlock = (lastHotBB == nullptr) ? nullptr : lastHotBB->Next();
}
//-----------------------------------------------------------------------------
@@ -4910,7 +4936,6 @@ void Compiler::fgMoveColdBlocks()
Compiler::ThreeOptLayout::ThreeOptLayout(Compiler* comp)
: compiler(comp)
, cutPoints(comp->getAllocator(CMK_FlowEdge), &ThreeOptLayout::EdgeCmp)
- , ordinals(new(comp, CMK_Generic) unsigned[comp->fgBBcount]{})
, blockOrder(nullptr)
, tempOrder(nullptr)
, numCandidateBlocks(0)
@@ -5107,10 +5132,6 @@ void Compiler::ThreeOptLayout::ConsiderEdge(FlowEdge* edge)
BasicBlock* const srcBlk = edge->getSourceBlock();
BasicBlock* const dstBlk = edge->getDestinationBlock();
- // Any edges under consideration should be between reachable blocks
- assert(compiler->m_dfsTree->Contains(srcBlk));
- assert(compiler->m_dfsTree->Contains(dstBlk));
-
// Ignore cross-region branches
if ((srcBlk->bbTryIndex != currEHRegion) || (dstBlk->bbTryIndex != currEHRegion))
{
@@ -5133,13 +5154,13 @@ void Compiler::ThreeOptLayout::ConsiderEdge(FlowEdge* edge)
return;
}
- const unsigned srcPos = ordinals[srcBlk->bbPostorderNum];
- const unsigned dstPos = ordinals[dstBlk->bbPostorderNum];
+ const unsigned srcPos = srcBlk->bbPostorderNum;
+ const unsigned dstPos = dstBlk->bbPostorderNum;
+ assert(srcPos < compiler->m_dfsTree->GetPostOrderCount());
+ assert(dstPos < compiler->m_dfsTree->GetPostOrderCount());
- // Don't consider edges from outside the hot range.
- // If 'srcBlk' has an ordinal of zero and it isn't the first block,
- // it's not tracked by 'ordinals', so it's not in the hot section.
- if ((srcPos == 0) && !srcBlk->IsFirst())
+ // Don't consider edges to or from outside the hot range (i.e. ordinal doesn't match 'blockOrder' position).
+ if ((srcBlk != blockOrder[srcPos]) || (dstBlk != blockOrder[dstPos]))
{
return;
}
@@ -5212,19 +5233,19 @@ void Compiler::ThreeOptLayout::AddNonFallthroughPreds(unsigned blockPos)
//
void Compiler::ThreeOptLayout::Run()
{
- // Walk backwards through the main method body, looking for the last hot block.
// Since we moved all cold blocks to the end of the method already,
- // we should have a span of hot blocks to consider reordering at the beginning of the method.
- // While doing this, try to get as tight an upper bound for the number of hot blocks as possible.
- // For methods without funclet regions, 'numBlocksUpperBound' is exact.
- // Otherwise, it's off by the number of handler blocks.
- BasicBlock* finalBlock;
- unsigned numBlocksUpperBound = compiler->fgBBcount;
- for (finalBlock = compiler->fgLastBBInMainFunction();
- !finalBlock->IsFirst() && finalBlock->isBBWeightCold(compiler); finalBlock = finalBlock->Prev())
- {
- numBlocksUpperBound--;
- }
+ // we should have a span of hot blocks to consider reordering at the beginning of the method
+ // (unless none of the blocks are cold relative to the rest of the method,
+ // in which case we will reorder the whole main method body).
+ BasicBlock* const finalBlock = (compiler->fgFirstColdBlock != nullptr) ? compiler->fgFirstColdBlock->Prev()
+ : compiler->fgLastBBInMainFunction();
+
+ // Reset cold section pointer, in case we decide to do hot/cold splitting later
+ compiler->fgFirstColdBlock = nullptr;
+
+ // We better have an end block for the hot section, and it better not be the start of a call-finally pair.
+ assert(finalBlock != nullptr);
+ assert(!finalBlock->isBBCallFinallyPair());
// For methods with fewer than three candidate blocks, we cannot partition anything
if (finalBlock->IsFirst() || finalBlock->Prev()->IsFirst())
@@ -5233,41 +5254,26 @@ void Compiler::ThreeOptLayout::Run()
return;
}
- // If only the first block of a call-finally pair is hot, include the whole pair in the hot section anyway.
- // This ensures the call-finally pair won't be split up when swapping partitions.
- if (finalBlock->isBBCallFinallyPair())
- {
- finalBlock = finalBlock->Next();
- numBlocksUpperBound++;
- }
-
+ // Get an upper bound on the number of hot blocks without walking the whole block list.
+ // We will only consider blocks reachable via normal flow.
+ const unsigned numBlocksUpperBound = compiler->m_dfsTree->GetPostOrderCount();
assert(numBlocksUpperBound != 0);
- blockOrder = new (compiler, CMK_BasicBlock) BasicBlock*[numBlocksUpperBound];
- tempOrder = new (compiler, CMK_BasicBlock) BasicBlock*[numBlocksUpperBound];
-
- // Initialize the current block order.
- // Note that we default-initialized 'ordinals' with zeros.
- // Block reordering shouldn't change the method's entry point,
- // so if a block has an ordinal of zero and it's not 'fgFirstBB',
- // the block wasn't visited below, so it's not in the range of candidate blocks.
- unsigned nextPostorderNum = compiler->m_dfsTree->GetPostOrderCount();
+ blockOrder = new (compiler, CMK_BasicBlock) BasicBlock*[numBlocksUpperBound * 2];
+ tempOrder = (blockOrder + numBlocksUpperBound);
+
+ // Initialize the current block order
for (BasicBlock* const block : compiler->Blocks(compiler->fgFirstBB, finalBlock))
{
- assert(numCandidateBlocks < numBlocksUpperBound);
- blockOrder[numCandidateBlocks] = tempOrder[numCandidateBlocks] = block;
-
- // Unreachable blocks should have been pushed out of the candidate set of blocks.
- // However, the entries of unreachable EH regions are left in-place to facilitate reestablishing contiguity,
- // so it is possible for us to encounter unreachable blocks.
- // When we do, assign them postorder numbers that can be used as keys into 'ordinals'.
if (!compiler->m_dfsTree->Contains(block))
{
- assert(nextPostorderNum < compiler->fgBBcount);
- block->bbPostorderNum = nextPostorderNum++;
+ continue;
}
- assert(ordinals[block->bbPostorderNum] == 0);
- ordinals[block->bbPostorderNum] = numCandidateBlocks++;
+ assert(numCandidateBlocks < numBlocksUpperBound);
+ blockOrder[numCandidateBlocks] = tempOrder[numCandidateBlocks] = block;
+
+ // Repurpose 'bbPostorderNum' for the block's ordinal
+ block->bbPostorderNum = numCandidateBlocks++;
// While walking the span of blocks to reorder,
// remember where each try region ends within this span.
@@ -5291,14 +5297,8 @@ void Compiler::ThreeOptLayout::Run()
continue;
}
- // Ignore try regions unreachable via normal flow
- if (!compiler->m_dfsTree->Contains(tryBeg))
- {
- continue;
- }
-
- // Only reorder try regions within the candidate span of blocks.
- if ((ordinals[tryBeg->bbPostorderNum] != 0) || tryBeg->IsFirst())
+ // Only reorder try regions within the candidate span of blocks
+ if ((tryBeg->bbPostorderNum < numCandidateBlocks) && (blockOrder[tryBeg->bbPostorderNum] == tryBeg))
{
JITDUMP("Running 3-opt for try region #%d\n", (currEHRegion - 1));
modified |= RunThreeOptPass(tryBeg, HBtab->ebdTryLast);
@@ -5372,8 +5372,8 @@ bool Compiler::ThreeOptLayout::RunGreedyThreeOptPass(unsigned startPos, unsigned
BasicBlock* const srcBlk = candidateEdge->getSourceBlock();
BasicBlock* const dstBlk = candidateEdge->getDestinationBlock();
- const unsigned srcPos = ordinals[srcBlk->bbPostorderNum];
- const unsigned dstPos = ordinals[dstBlk->bbPostorderNum];
+ const unsigned srcPos = srcBlk->bbPostorderNum;
+ const unsigned dstPos = dstBlk->bbPostorderNum;
// This edge better be between blocks in the current region
assert((srcPos >= startPos) && (srcPos <= endPos));
@@ -5393,7 +5393,7 @@ bool Compiler::ThreeOptLayout::RunGreedyThreeOptPass(unsigned startPos, unsigned
continue;
}
- // Before getting any edges, make sure 'ordinals' is accurate
+ // Before getting any edges, make sure the ordinals are accurate
assert(blockOrder[srcPos] == srcBlk);
assert(blockOrder[dstPos] == dstBlk);
@@ -5505,11 +5505,11 @@ bool Compiler::ThreeOptLayout::RunGreedyThreeOptPass(unsigned startPos, unsigned
// Update the ordinals for the blocks we moved
for (unsigned i = s2Start; i <= endPos; i++)
{
- ordinals[blockOrder[i]->bbPostorderNum] = i;
+ blockOrder[i]->bbPostorderNum = i;
}
// Ensure this move created fallthrough from 'srcBlk' to 'dstBlk'
- assert((ordinals[srcBlk->bbPostorderNum] + 1) == ordinals[dstBlk->bbPostorderNum]);
+ assert((srcBlk->bbPostorderNum + 1) == dstBlk->bbPostorderNum);
// At every cut point is an opportunity to consider more candidate edges.
// To the left of each cut point, consider successor edges that don't fall through.
@@ -5546,10 +5546,9 @@ bool Compiler::ThreeOptLayout::RunThreeOptPass(BasicBlock* startBlock, BasicBloc
assert(startBlock != nullptr);
assert(endBlock != nullptr);
- const unsigned startPos = ordinals[startBlock->bbPostorderNum];
- const unsigned endPos = ordinals[endBlock->bbPostorderNum];
+ const unsigned startPos = startBlock->bbPostorderNum;
+ const unsigned endPos = endBlock->bbPostorderNum;
const unsigned numBlocks = (endPos - startPos + 1);
- assert((startPos != 0) || startBlock->IsFirst());
assert(startPos <= endPos);
if (numBlocks < 3)
@@ -6108,6 +6107,15 @@ bool Compiler::fgUpdateFlowGraph(bool doTailDuplication /* = false */, bool isPh
}
} while (change);
+ // OSR entry blocks will frequently have a profile imbalance as original method execution was hijacked at them.
+ // Mark the profile as inconsistent if we might have propagated the OSR entry weight.
+ if (modified && opts.IsOSR())
+ {
+ JITDUMP("fgUpdateFlowGraph: Inconsistent OSR entry weight may have been propagated. Data %s consistent.\n",
+ fgPgoConsistent ? "is now" : "was already");
+ fgPgoConsistent = false;
+ }
+
#ifdef DEBUG
if (!isPhase)
{
@@ -6624,7 +6632,7 @@ PhaseStatus Compiler::fgHeadTailMerge(bool early)
// crossJumpTarget, so the profile update can be done locally.
if (crossJumpTarget->hasProfileWeight())
{
- crossJumpTarget->setBBProfileWeight(crossJumpTarget->bbWeight + predBlock->bbWeight);
+ crossJumpTarget->increaseBBProfileWeight(predBlock->bbWeight);
}
}
@@ -6771,12 +6779,6 @@ PhaseStatus Compiler::fgHeadTailMerge(bool early)
madeChanges |= fgHeadMerge(block, early);
}
- // If we altered flow, reset fgModified. Given where we sit in the
- // phase list, flow-dependent side data hasn't been built yet, so
- // nothing needs invalidation.
- //
- fgModified = false;
-
return madeChanges ? PhaseStatus::MODIFIED_EVERYTHING : PhaseStatus::MODIFIED_NOTHING;
}
diff --git a/src/coreclr/jit/flowgraph.cpp b/src/coreclr/jit/flowgraph.cpp
index 6a41de3c7ea34a..282335d1e23947 100644
--- a/src/coreclr/jit/flowgraph.cpp
+++ b/src/coreclr/jit/flowgraph.cpp
@@ -2989,6 +2989,18 @@ PhaseStatus Compiler::fgCreateFunclets()
assert(UsesFunclets());
assert(!fgFuncletsCreated);
+ // Allocate the PSPSym, if needed. PSPSym is not used by the NativeAOT ABI
+ if (!IsTargetAbi(CORINFO_NATIVEAOT_ABI))
+ {
+ if (ehNeedsPSPSym())
+ {
+ lvaPSPSym = lvaGrabTempWithImplicitUse(false DEBUGARG("PSPSym"));
+ LclVarDsc* lclPSPSym = lvaGetDesc(lvaPSPSym);
+ lclPSPSym->lvType = TYP_I_IMPL;
+ lvaSetVarDoNotEnregister(lvaPSPSym DEBUGARG(DoNotEnregisterReason::VMNeedsStackAddr));
+ }
+ }
+
fgCreateFuncletPrologBlocks();
unsigned XTnum;
diff --git a/src/coreclr/jit/gentree.cpp b/src/coreclr/jit/gentree.cpp
index 9154da487bd1fa..ba5407c7d02886 100644
--- a/src/coreclr/jit/gentree.cpp
+++ b/src/coreclr/jit/gentree.cpp
@@ -23560,6 +23560,166 @@ GenTree* Compiler::gtNewSimdGetUpperNode(var_types type, GenTree* op1, CorInfoTy
return gtNewSimdHWIntrinsicNode(type, op1, intrinsicId, simdBaseJitType, simdSize);
}
+//----------------------------------------------------------------------------------------------
+// Compiler::gtNewSimdIsEvenIntegerNode: Creates a new simd IsEvenInteger node
+//
+// Arguments:
+// type - The return type of SIMD node being created
+// op1 - The vector to check for even integers
+// simdBaseJitType - The base JIT type of SIMD type of the intrinsic
+// simdSize - The size of the SIMD type of the intrinsic
+//
+// Returns:
+// The created IsEvenInteger node
+//
+GenTree* Compiler::gtNewSimdIsEvenIntegerNode(var_types type,
+ GenTree* op1,
+ CorInfoType simdBaseJitType,
+ unsigned simdSize)
+{
+ assert(IsBaselineSimdIsaSupportedDebugOnly());
+
+ assert(varTypeIsSIMD(type));
+ assert(getSIMDTypeForSize(simdSize) == type);
+
+ assert(op1 != nullptr);
+ assert(op1->TypeIs(type));
+
+ var_types simdBaseType = JitType2PreciseVarType(simdBaseJitType);
+ assert(varTypeIsIntegral(simdBaseType));
+
+ op1 = gtNewSimdBinOpNode(GT_AND, type, op1, gtNewOneConNode(type, simdBaseType), simdBaseJitType, simdSize);
+ return gtNewSimdIsZeroNode(type, op1, simdBaseJitType, simdSize);
+}
+
+//----------------------------------------------------------------------------------------------
+// Compiler::gtNewSimdIsFiniteNode: Creates a new simd IsFinite node
+//
+// Arguments:
+// type - The return type of SIMD node being created
+// op1 - The vector to check for finite values
+// simdBaseJitType - The base JIT type of SIMD type of the intrinsic
+// simdSize - The size of the SIMD type of the intrinsic
+//
+// Returns:
+// The created IsFinite node
+//
+GenTree* Compiler::gtNewSimdIsFiniteNode(var_types type, GenTree* op1, CorInfoType simdBaseJitType, unsigned simdSize)
+{
+ assert(IsBaselineSimdIsaSupportedDebugOnly());
+
+ assert(varTypeIsSIMD(type));
+ assert(getSIMDTypeForSize(simdSize) == type);
+
+ assert(op1 != nullptr);
+ assert(op1->TypeIs(type));
+
+ var_types simdBaseType = JitType2PreciseVarType(simdBaseJitType);
+ assert(varTypeIsArithmetic(simdBaseType));
+
+ if (varTypeIsFloating(simdBaseType))
+ {
+ GenTree* cnsNode;
+
+ if (simdBaseType == TYP_FLOAT)
+ {
+ simdBaseType = TYP_INT;
+ simdBaseJitType = CORINFO_TYPE_UINT;
+ cnsNode = gtNewIconNode(0x7F800000);
+ }
+ else
+ {
+ assert(simdBaseType == TYP_DOUBLE);
+
+ simdBaseType = TYP_LONG;
+ simdBaseJitType = CORINFO_TYPE_ULONG;
+ cnsNode = gtNewLconNode(0x7FF0000000000000);
+ }
+ cnsNode = gtNewSimdCreateBroadcastNode(type, cnsNode, simdBaseJitType, simdSize);
+
+ op1 = gtNewSimdBinOpNode(GT_AND_NOT, type, cnsNode, op1, simdBaseJitType, simdSize);
+ return gtNewSimdCmpOpNode(GT_NE, type, op1, gtNewZeroConNode(type), simdBaseJitType, simdSize);
+ }
+
+ assert(varTypeIsIntegral(simdBaseType));
+ return gtNewAllBitsSetConNode(type);
+}
+
+//----------------------------------------------------------------------------------------------
+// Compiler::gtNewSimdIsInfinityNode: Creates a new simd IsInfinity node
+//
+// Arguments:
+// type - The return type of SIMD node being created
+// op1 - The vector to check for infinities
+// simdBaseJitType - The base JIT type of SIMD type of the intrinsic
+// simdSize - The size of the SIMD type of the intrinsic
+//
+// Returns:
+// The created IsInfinity node
+//
+GenTree* Compiler::gtNewSimdIsInfinityNode(var_types type, GenTree* op1, CorInfoType simdBaseJitType, unsigned simdSize)
+{
+ assert(IsBaselineSimdIsaSupportedDebugOnly());
+
+ assert(varTypeIsSIMD(type));
+ assert(getSIMDTypeForSize(simdSize) == type);
+
+ assert(op1 != nullptr);
+ assert(op1->TypeIs(type));
+
+ var_types simdBaseType = JitType2PreciseVarType(simdBaseJitType);
+ assert(varTypeIsArithmetic(simdBaseType));
+
+ if (varTypeIsFloating(simdBaseType))
+ {
+ op1 = gtNewSimdAbsNode(type, op1, simdBaseJitType, simdSize);
+ return gtNewSimdIsPositiveInfinityNode(type, op1, simdBaseJitType, simdSize);
+ }
+ return gtNewZeroConNode(type);
+}
+
+//----------------------------------------------------------------------------------------------
+// Compiler::gtNewSimdIsIntegerNode: Creates a new simd IsInteger node
+//
+// Arguments:
+// type - The return type of SIMD node being created
+// op1 - The vector to check for integers
+// simdBaseJitType - The base JIT type of SIMD type of the intrinsic
+// simdSize - The size of the SIMD type of the intrinsic
+//
+// Returns:
+// The created IsInteger node
+//
+GenTree* Compiler::gtNewSimdIsIntegerNode(var_types type, GenTree* op1, CorInfoType simdBaseJitType, unsigned simdSize)
+{
+ assert(IsBaselineSimdIsaSupportedDebugOnly());
+
+ assert(varTypeIsSIMD(type));
+ assert(getSIMDTypeForSize(simdSize) == type);
+
+ assert(op1 != nullptr);
+ assert(op1->TypeIs(type));
+
+ var_types simdBaseType = JitType2PreciseVarType(simdBaseJitType);
+ assert(varTypeIsArithmetic(simdBaseType));
+
+ if (varTypeIsFloating(simdBaseType))
+ {
+ GenTree* op1Dup1 = fgMakeMultiUse(&op1);
+ GenTree* op1Dup2 = gtCloneExpr(op1Dup1);
+
+ op1 = gtNewSimdIsFiniteNode(type, op1, simdBaseJitType, simdSize);
+
+ op1Dup1 = gtNewSimdTruncNode(type, op1Dup1, simdBaseJitType, simdSize);
+ GenTree* op2 = gtNewSimdCmpOpNode(GT_EQ, type, op1Dup1, op1Dup2, simdBaseJitType, simdSize);
+
+ return gtNewSimdBinOpNode(GT_AND, type, op1, op2, simdBaseJitType, simdSize);
+ }
+
+ assert(varTypeIsIntegral(simdBaseType));
+ return gtNewAllBitsSetConNode(type);
+}
+
//----------------------------------------------------------------------------------------------
// Compiler::gtNewSimdIsNaNNode: Creates a new simd IsNaN node
//
@@ -23598,7 +23758,7 @@ GenTree* Compiler::gtNewSimdIsNaNNode(var_types type, GenTree* op1, CorInfoType
//
// Arguments:
// type - The return type of SIMD node being created
-// op1 - The vector to check for Negatives
+// op1 - The vector to check for negatives
// simdBaseJitType - The base JIT type of SIMD type of the intrinsic
// simdSize - The size of the SIMD type of the intrinsic
//
@@ -23634,12 +23794,159 @@ GenTree* Compiler::gtNewSimdIsNegativeNode(var_types type, GenTree* op1, CorInfo
return gtNewSimdCmpOpNode(GT_LT, type, op1, gtNewZeroConNode(type), simdBaseJitType, simdSize);
}
+//----------------------------------------------------------------------------------------------
+// Compiler::gtNewSimdIsNegativeInfinityNode: Creates a new simd IsNegativeInfinity node
+//
+// Arguments:
+// type - The return type of SIMD node being created
+// op1 - The vector to check for negative infinities
+// simdBaseJitType - The base JIT type of SIMD type of the intrinsic
+// simdSize - The size of the SIMD type of the intrinsic
+//
+// Returns:
+// The created IsNegativeInfinity node
+//
+GenTree* Compiler::gtNewSimdIsNegativeInfinityNode(var_types type,
+ GenTree* op1,
+ CorInfoType simdBaseJitType,
+ unsigned simdSize)
+{
+ assert(IsBaselineSimdIsaSupportedDebugOnly());
+
+ assert(varTypeIsSIMD(type));
+ assert(getSIMDTypeForSize(simdSize) == type);
+
+ assert(op1 != nullptr);
+ assert(op1->TypeIs(type));
+
+ var_types simdBaseType = JitType2PreciseVarType(simdBaseJitType);
+ assert(varTypeIsArithmetic(simdBaseType));
+
+ if (varTypeIsFloating(simdBaseType))
+ {
+ GenTree* cnsNode;
+
+ if (simdBaseType == TYP_FLOAT)
+ {
+ simdBaseType = TYP_INT;
+ simdBaseJitType = CORINFO_TYPE_UINT;
+ cnsNode = gtNewIconNode(0xFF800000);
+ }
+ else
+ {
+ assert(simdBaseType == TYP_DOUBLE);
+
+ simdBaseType = TYP_LONG;
+ simdBaseJitType = CORINFO_TYPE_ULONG;
+ cnsNode = gtNewLconNode(0xFFF0000000000000);
+ }
+ cnsNode = gtNewSimdCreateBroadcastNode(type, cnsNode, simdBaseJitType, simdSize);
+
+ return gtNewSimdCmpOpNode(GT_EQ, type, op1, cnsNode, simdBaseJitType, simdSize);
+ }
+ return gtNewZeroConNode(type);
+}
+
+//----------------------------------------------------------------------------------------------
+// Compiler::gtNewSimdIsNormalNode: Creates a new simd IsNormal node
+//
+// Arguments:
+// type - The return type of SIMD node being created
+// op1 - The vector to check for normal values
+// simdBaseJitType - The base JIT type of SIMD type of the intrinsic
+// simdSize - The size of the SIMD type of the intrinsic
+//
+// Returns:
+// The created IsNormal node
+//
+GenTree* Compiler::gtNewSimdIsNormalNode(var_types type, GenTree* op1, CorInfoType simdBaseJitType, unsigned simdSize)
+{
+ assert(IsBaselineSimdIsaSupportedDebugOnly());
+
+ assert(varTypeIsSIMD(type));
+ assert(getSIMDTypeForSize(simdSize) == type);
+
+ assert(op1 != nullptr);
+ assert(op1->TypeIs(type));
+
+ var_types simdBaseType = JitType2PreciseVarType(simdBaseJitType);
+ assert(varTypeIsArithmetic(simdBaseType));
+
+ if (varTypeIsFloating(simdBaseType))
+ {
+ op1 = gtNewSimdAbsNode(type, op1, simdBaseJitType, simdSize);
+
+ GenTree* cnsNode1;
+ GenTree* cnsNode2;
+
+ if (simdBaseType == TYP_FLOAT)
+ {
+ simdBaseType = TYP_INT;
+ simdBaseJitType = CORINFO_TYPE_UINT;
+
+ cnsNode1 = gtNewIconNode(0x00800000);
+ cnsNode2 = gtNewIconNode(0x7F800000 - 0x00800000);
+ }
+ else
+ {
+ assert(simdBaseType == TYP_DOUBLE);
+
+ simdBaseType = TYP_LONG;
+ simdBaseJitType = CORINFO_TYPE_ULONG;
+
+ cnsNode1 = gtNewLconNode(0x0010000000000000);
+ cnsNode2 = gtNewLconNode(0x7FF0000000000000 - 0x0010000000000000);
+ }
+
+ cnsNode1 = gtNewSimdCreateBroadcastNode(type, cnsNode1, simdBaseJitType, simdSize);
+ cnsNode2 = gtNewSimdCreateBroadcastNode(type, cnsNode2, simdBaseJitType, simdSize);
+
+ op1 = gtNewSimdBinOpNode(GT_SUB, type, op1, cnsNode1, simdBaseJitType, simdSize);
+ return gtNewSimdCmpOpNode(GT_LT, type, op1, cnsNode2, simdBaseJitType, simdSize);
+ }
+
+ assert(varTypeIsIntegral(simdBaseType));
+ return gtNewSimdCmpOpNode(GT_NE, type, op1, gtNewZeroConNode(type), simdBaseJitType, simdSize);
+}
+
+//----------------------------------------------------------------------------------------------
+// Compiler::gtNewSimdIsOddIntegerNode: Creates a new simd IsOddInteger node
+//
+// Arguments:
+// type - The return type of SIMD node being created
+// op1 - The vector to check for odd integers
+// simdBaseJitType - The base JIT type of SIMD type of the intrinsic
+// simdSize - The size of the SIMD type of the intrinsic
+//
+// Returns:
+// The created IsOddInteger node
+//
+GenTree* Compiler::gtNewSimdIsOddIntegerNode(var_types type,
+ GenTree* op1,
+ CorInfoType simdBaseJitType,
+ unsigned simdSize)
+{
+ assert(IsBaselineSimdIsaSupportedDebugOnly());
+
+ assert(varTypeIsSIMD(type));
+ assert(getSIMDTypeForSize(simdSize) == type);
+
+ assert(op1 != nullptr);
+ assert(op1->TypeIs(type));
+
+ var_types simdBaseType = JitType2PreciseVarType(simdBaseJitType);
+ assert(varTypeIsIntegral(simdBaseType));
+
+ op1 = gtNewSimdBinOpNode(GT_AND, type, op1, gtNewOneConNode(type, simdBaseType), simdBaseJitType, simdSize);
+ return gtNewSimdCmpOpNode(GT_NE, type, op1, gtNewZeroConNode(type), simdBaseJitType, simdSize);
+}
+
//----------------------------------------------------------------------------------------------
// Compiler::gtNewSimdIsPositiveNode: Creates a new simd IsPositive node
//
// Arguments:
// type - The return type of SIMD node being created
-// op1 - The vector to check for Positives
+// op1 - The vector to check for positives
// simdBaseJitType - The base JIT type of SIMD type of the intrinsic
// simdSize - The size of the SIMD type of the intrinsic
//
@@ -23680,7 +23987,7 @@ GenTree* Compiler::gtNewSimdIsPositiveNode(var_types type, GenTree* op1, CorInfo
//
// Arguments:
// type - The return type of SIMD node being created
-// op1 - The vector to check for PositiveInfinities
+// op1 - The vector to check for positive infinities
// simdBaseJitType - The base JIT type of SIMD type of the intrinsic
// simdSize - The size of the SIMD type of the intrinsic
//
@@ -23705,14 +24012,91 @@ GenTree* Compiler::gtNewSimdIsPositiveInfinityNode(var_types type,
if (varTypeIsFloating(simdBaseType))
{
- double infinity = BitOperations::UInt64BitsToDouble(0x7FF0000000000000);
- GenTree* cnsNode = gtNewDconNode(infinity, simdBaseType);
- cnsNode = gtNewSimdCreateBroadcastNode(type, cnsNode, simdBaseJitType, simdSize);
+ GenTree* cnsNode;
+
+ if (simdBaseType == TYP_FLOAT)
+ {
+ simdBaseType = TYP_INT;
+ simdBaseJitType = CORINFO_TYPE_UINT;
+ cnsNode = gtNewIconNode(0x7F800000);
+ }
+ else
+ {
+ assert(simdBaseType == TYP_DOUBLE);
+
+ simdBaseType = TYP_LONG;
+ simdBaseJitType = CORINFO_TYPE_ULONG;
+ cnsNode = gtNewLconNode(0x7FF0000000000000);
+ }
+ cnsNode = gtNewSimdCreateBroadcastNode(type, cnsNode, simdBaseJitType, simdSize);
+
return gtNewSimdCmpOpNode(GT_EQ, type, op1, cnsNode, simdBaseJitType, simdSize);
}
return gtNewZeroConNode(type);
}
+//----------------------------------------------------------------------------------------------
+// Compiler::gtNewSimdIsSubnormalNode: Creates a new simd IsSubnormal node
+//
+// Arguments:
+// type - The return type of SIMD node being created
+// op1 - The vector to check for subnormal values
+// simdBaseJitType - The base JIT type of SIMD type of the intrinsic
+// simdSize - The size of the SIMD type of the intrinsic
+//
+// Returns:
+// The created IsSubnormal node
+//
+GenTree* Compiler::gtNewSimdIsSubnormalNode(var_types type,
+ GenTree* op1,
+ CorInfoType simdBaseJitType,
+ unsigned simdSize)
+{
+ assert(IsBaselineSimdIsaSupportedDebugOnly());
+
+ assert(varTypeIsSIMD(type));
+ assert(getSIMDTypeForSize(simdSize) == type);
+
+ assert(op1 != nullptr);
+ assert(op1->TypeIs(type));
+
+ var_types simdBaseType = JitType2PreciseVarType(simdBaseJitType);
+ assert(varTypeIsArithmetic(simdBaseType));
+
+ if (varTypeIsFloating(simdBaseType))
+ {
+ op1 = gtNewSimdAbsNode(type, op1, simdBaseJitType, simdSize);
+
+ GenTree* cnsNode1;
+ GenTree* cnsNode2;
+
+ if (simdBaseType == TYP_FLOAT)
+ {
+ simdBaseType = TYP_INT;
+ simdBaseJitType = CORINFO_TYPE_UINT;
+
+ cnsNode2 = gtNewIconNode(0x007FFFFF);
+ }
+ else
+ {
+ assert(simdBaseType == TYP_DOUBLE);
+
+ simdBaseType = TYP_LONG;
+ simdBaseJitType = CORINFO_TYPE_ULONG;
+
+ cnsNode2 = gtNewLconNode(0x000FFFFFFFFFFFFF);
+ }
+
+ cnsNode1 = gtNewOneConNode(type, simdBaseType);
+ cnsNode2 = gtNewSimdCreateBroadcastNode(type, cnsNode2, simdBaseJitType, simdSize);
+
+ op1 = gtNewSimdBinOpNode(GT_SUB, type, op1, cnsNode1, simdBaseJitType, simdSize);
+
+ return gtNewSimdCmpOpNode(GT_LT, type, op1, cnsNode2, simdBaseJitType, simdSize);
+ }
+ return gtNewZeroConNode(type);
+}
+
//----------------------------------------------------------------------------------------------
// Compiler::gtNewSimdIsZeroNode: Creates a new simd IsZero node
//
diff --git a/src/coreclr/jit/hwintrinsicarm64.cpp b/src/coreclr/jit/hwintrinsicarm64.cpp
index fac3e6c6216fe1..be1c577d4bdfaa 100644
--- a/src/coreclr/jit/hwintrinsicarm64.cpp
+++ b/src/coreclr/jit/hwintrinsicarm64.cpp
@@ -1343,7 +1343,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
case NI_Vector128_op_Equality:
{
assert(sig->numArgs == 2);
- var_types simdType = getSIMDTypeForSize(simdSize);
op2 = impSIMDPopStack();
op1 = impSIMDPopStack();
@@ -1356,7 +1355,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
case NI_Vector128_EqualsAny:
{
assert(sig->numArgs == 2);
- var_types simdType = getSIMDTypeForSize(simdSize);
op2 = impSIMDPopStack();
op1 = impSIMDPopStack();
@@ -1647,7 +1645,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
case NI_Vector128_GreaterThanAll:
{
assert(sig->numArgs == 2);
- var_types simdType = getSIMDTypeForSize(simdSize);
op2 = impSIMDPopStack();
op1 = impSIMDPopStack();
@@ -1660,7 +1657,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
case NI_Vector128_GreaterThanAny:
{
assert(sig->numArgs == 2);
- var_types simdType = getSIMDTypeForSize(simdSize);
op2 = impSIMDPopStack();
op1 = impSIMDPopStack();
@@ -1685,7 +1681,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
case NI_Vector128_GreaterThanOrEqualAll:
{
assert(sig->numArgs == 2);
- var_types simdType = getSIMDTypeForSize(simdSize);
op2 = impSIMDPopStack();
op1 = impSIMDPopStack();
@@ -1698,7 +1693,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
case NI_Vector128_GreaterThanOrEqualAny:
{
assert(sig->numArgs == 2);
- var_types simdType = getSIMDTypeForSize(simdSize);
op2 = impSIMDPopStack();
op1 = impSIMDPopStack();
@@ -1707,12 +1701,54 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
break;
}
+ case NI_Vector64_IsEvenInteger:
+ case NI_Vector128_IsEvenInteger:
+ {
+ assert(sig->numArgs == 1);
+
+ if (varTypeIsFloating(simdBaseType))
+ {
+ // The code for handling floating-point is decently complex but also expected
+ // to be rare, so we fallback to the managed implementation, which is accelerated
+ break;
+ }
+
+ op1 = impSIMDPopStack();
+ retNode = gtNewSimdIsEvenIntegerNode(retType, op1, simdBaseJitType, simdSize);
+ break;
+ }
+
+ case NI_Vector64_IsFinite:
+ case NI_Vector128_IsFinite:
+ {
+ assert(sig->numArgs == 1);
+ op1 = impSIMDPopStack();
+ retNode = gtNewSimdIsFiniteNode(retType, op1, simdBaseJitType, simdSize);
+ break;
+ }
+
+ case NI_Vector64_IsInfinity:
+ case NI_Vector128_IsInfinity:
+ {
+ assert(sig->numArgs == 1);
+ op1 = impSIMDPopStack();
+ retNode = gtNewSimdIsInfinityNode(retType, op1, simdBaseJitType, simdSize);
+ break;
+ }
+
+ case NI_Vector64_IsInteger:
+ case NI_Vector128_IsInteger:
+ {
+ assert(sig->numArgs == 1);
+ op1 = impSIMDPopStack();
+ retNode = gtNewSimdIsIntegerNode(retType, op1, simdBaseJitType, simdSize);
+ break;
+ }
+
case NI_Vector64_IsNaN:
case NI_Vector128_IsNaN:
{
assert(sig->numArgs == 1);
- var_types simdType = getSIMDTypeForSize(simdSize);
-
op1 = impSIMDPopStack();
retNode = gtNewSimdIsNaNNode(retType, op1, simdBaseJitType, simdSize);
break;
@@ -1722,19 +1758,50 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
case NI_Vector128_IsNegative:
{
assert(sig->numArgs == 1);
- var_types simdType = getSIMDTypeForSize(simdSize);
-
op1 = impSIMDPopStack();
retNode = gtNewSimdIsNegativeNode(retType, op1, simdBaseJitType, simdSize);
break;
}
+ case NI_Vector64_IsNegativeInfinity:
+ case NI_Vector128_IsNegativeInfinity:
+ {
+ assert(sig->numArgs == 1);
+ op1 = impSIMDPopStack();
+ retNode = gtNewSimdIsNegativeInfinityNode(retType, op1, simdBaseJitType, simdSize);
+ break;
+ }
+
+ case NI_Vector64_IsNormal:
+ case NI_Vector128_IsNormal:
+ {
+ assert(sig->numArgs == 1);
+ op1 = impSIMDPopStack();
+ retNode = gtNewSimdIsNormalNode(retType, op1, simdBaseJitType, simdSize);
+ break;
+ }
+
+ case NI_Vector64_IsOddInteger:
+ case NI_Vector128_IsOddInteger:
+ {
+ assert(sig->numArgs == 1);
+
+ if (varTypeIsFloating(simdBaseType))
+ {
+ // The code for handling floating-point is decently complex but also expected
+ // to be rare, so we fallback to the managed implementation, which is accelerated
+ break;
+ }
+
+ op1 = impSIMDPopStack();
+ retNode = gtNewSimdIsOddIntegerNode(retType, op1, simdBaseJitType, simdSize);
+ break;
+ }
+
case NI_Vector64_IsPositive:
case NI_Vector128_IsPositive:
{
assert(sig->numArgs == 1);
- var_types simdType = getSIMDTypeForSize(simdSize);
-
op1 = impSIMDPopStack();
retNode = gtNewSimdIsPositiveNode(retType, op1, simdBaseJitType, simdSize);
break;
@@ -1744,19 +1811,24 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
case NI_Vector128_IsPositiveInfinity:
{
assert(sig->numArgs == 1);
- var_types simdType = getSIMDTypeForSize(simdSize);
-
op1 = impSIMDPopStack();
retNode = gtNewSimdIsPositiveInfinityNode(retType, op1, simdBaseJitType, simdSize);
break;
}
+ case NI_Vector64_IsSubnormal:
+ case NI_Vector128_IsSubnormal:
+ {
+ assert(sig->numArgs == 1);
+ op1 = impSIMDPopStack();
+ retNode = gtNewSimdIsSubnormalNode(retType, op1, simdBaseJitType, simdSize);
+ break;
+ }
+
case NI_Vector64_IsZero:
case NI_Vector128_IsZero:
{
assert(sig->numArgs == 1);
- var_types simdType = getSIMDTypeForSize(simdSize);
-
op1 = impSIMDPopStack();
retNode = gtNewSimdIsZeroNode(retType, op1, simdBaseJitType, simdSize);
break;
@@ -1778,7 +1850,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
case NI_Vector128_LessThanAll:
{
assert(sig->numArgs == 2);
- var_types simdType = getSIMDTypeForSize(simdSize);
op2 = impSIMDPopStack();
op1 = impSIMDPopStack();
@@ -1791,7 +1862,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
case NI_Vector128_LessThanAny:
{
assert(sig->numArgs == 2);
- var_types simdType = getSIMDTypeForSize(simdSize);
op2 = impSIMDPopStack();
op1 = impSIMDPopStack();
@@ -1816,7 +1886,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
case NI_Vector128_LessThanOrEqualAll:
{
assert(sig->numArgs == 2);
- var_types simdType = getSIMDTypeForSize(simdSize);
op2 = impSIMDPopStack();
op1 = impSIMDPopStack();
@@ -1829,7 +1898,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
case NI_Vector128_LessThanOrEqualAny:
{
assert(sig->numArgs == 2);
- var_types simdType = getSIMDTypeForSize(simdSize);
op2 = impSIMDPopStack();
op1 = impSIMDPopStack();
@@ -2068,7 +2136,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
case NI_Vector128_op_Inequality:
{
assert(sig->numArgs == 2);
- var_types simdType = getSIMDTypeForSize(simdSize);
op2 = impSIMDPopStack();
op1 = impSIMDPopStack();
@@ -2153,6 +2220,35 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
break;
}
+ case NI_Vector64_ShiftLeft:
+ case NI_Vector128_ShiftLeft:
+ {
+ assert(sig->numArgs == 2);
+
+ if (!varTypeIsSIMD(impStackTop(0).val))
+ {
+ // We just want the inlining profitability boost for the helper intrinsics/
+ // that have operator alternatives like `simd << int`
+ break;
+ }
+
+ op2 = impSIMDPopStack();
+ op1 = impSIMDPopStack();
+
+ if (simdSize == 8)
+ {
+ intrinsic = varTypeIsLong(simdBaseType) ? NI_AdvSimd_ShiftLogicalScalar : NI_AdvSimd_ShiftLogical;
+ }
+ else
+ {
+ assert(simdSize == 16);
+ intrinsic = NI_AdvSimd_ShiftLogical;
+ }
+
+ retNode = gtNewSimdHWIntrinsicNode(retType, op1, op2, intrinsic, simdBaseJitType, simdSize);
+ break;
+ }
+
case NI_Vector64_Shuffle:
case NI_Vector128_Shuffle:
{
@@ -2251,8 +2347,7 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
simdSize = 16;
}
- var_types simdType = getSIMDTypeForSize(simdSize);
- op1 = impPopStack().val;
+ op1 = impPopStack().val;
if (op1->OperIs(GT_CAST) && op1->gtGetOp1()->TypeIs(TYP_BYREF))
{
@@ -2269,7 +2364,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
case NI_Vector128_StoreUnsafe:
{
assert(retType == TYP_VOID);
- var_types simdType = getSIMDTypeForSize(simdSize);
if (sig->numArgs == 3)
{
@@ -2321,8 +2415,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
break;
}
- var_types simdType = getSIMDTypeForSize(simdSize);
-
impSpillSideEffect(true, stackState.esStackDepth - 2 DEBUGARG("Spilling op1 side effects for HWIntrinsic"));
op2 = impPopStack().val;
@@ -2353,8 +2445,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
break;
}
- var_types simdType = getSIMDTypeForSize(simdSize);
-
impSpillSideEffect(true, stackState.esStackDepth - 2 DEBUGARG("Spilling op1 side effects for HWIntrinsic"));
op2 = impPopStack().val;
@@ -2486,8 +2576,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
case NI_Vector128_Sum:
{
assert(sig->numArgs == 1);
- var_types simdType = getSIMDTypeForSize(simdSize);
-
op1 = impSIMDPopStack();
retNode = gtNewSimdSumNode(retType, op1, simdBaseJitType, simdSize);
break;
diff --git a/src/coreclr/jit/hwintrinsiclistarm64.h b/src/coreclr/jit/hwintrinsiclistarm64.h
index 3f8c9ebf40dfaa..efad7ee0980253 100644
--- a/src/coreclr/jit/hwintrinsiclistarm64.h
+++ b/src/coreclr/jit/hwintrinsiclistarm64.h
@@ -60,10 +60,18 @@ HARDWARE_INTRINSIC(Vector64, GreaterThanAny,
HARDWARE_INTRINSIC(Vector64, GreaterThanOrEqual, 8, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector64, GreaterThanOrEqualAll, 8, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg)
HARDWARE_INTRINSIC(Vector64, GreaterThanOrEqualAny, 8, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg)
+HARDWARE_INTRINSIC(Vector64, IsEvenInteger, 8, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector64, IsFinite, 8, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector64, IsInfinity, 8, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector64, IsInteger, 8, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector64, IsNaN, 8, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector64, IsNegative, 8, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector64, IsNegativeInfinity, 8, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector64, IsNormal, 8, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector64, IsOddInteger, 8, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector64, IsPositive, 8, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector64, IsPositiveInfinity, 8, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector64, IsSubnormal, 8, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector64, IsZero, 8, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector64, LessThan, 8, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector64, LessThanAll, 8, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg)
@@ -81,7 +89,8 @@ HARDWARE_INTRINSIC(Vector64, MinNative,
HARDWARE_INTRINSIC(Vector64, MultiplyAddEstimate, 8, 3, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector64, Narrow, 8, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector64, Round, 8, -1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
-HARDWARE_INTRINSIC(Vector64, Shuffle, 8, -1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen)
+HARDWARE_INTRINSIC(Vector64, ShiftLeft, 8, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector64, Shuffle, 8, -1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen|HW_Flag_CanBenefitFromConstantProp)
HARDWARE_INTRINSIC(Vector64, Sqrt, 8, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector64, StoreAligned, 8, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg)
HARDWARE_INTRINSIC(Vector64, StoreAlignedNonTemporal, 8, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg)
@@ -173,10 +182,18 @@ HARDWARE_INTRINSIC(Vector128, GreaterThanAny,
HARDWARE_INTRINSIC(Vector128, GreaterThanOrEqual, 16, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector128, GreaterThanOrEqualAll, 16, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg)
HARDWARE_INTRINSIC(Vector128, GreaterThanOrEqualAny, 16, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg)
+HARDWARE_INTRINSIC(Vector128, IsEvenInteger, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector128, IsFinite, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector128, IsInfinity, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector128, IsInteger, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector128, IsNaN, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector128, IsNegative, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector128, IsNegativeInfinity, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector128, IsNormal, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector128, IsOddInteger, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector128, IsPositive, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector128, IsPositiveInfinity, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector128, IsSubnormal, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector128, IsZero, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector128, LessThan, 16, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector128, LessThanAll, 16, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg)
@@ -194,7 +211,8 @@ HARDWARE_INTRINSIC(Vector128, MinNative,
HARDWARE_INTRINSIC(Vector128, MultiplyAddEstimate, 16, 3, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector128, Narrow, 16, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector128, Round, 16, -1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
-HARDWARE_INTRINSIC(Vector128, Shuffle, 16, -1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen)
+HARDWARE_INTRINSIC(Vector128, ShiftLeft, 16, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector128, Shuffle, 16, -1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen|HW_Flag_CanBenefitFromConstantProp)
HARDWARE_INTRINSIC(Vector128, Sqrt, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector128, StoreAligned, 16, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg)
HARDWARE_INTRINSIC(Vector128, StoreAlignedNonTemporal, 16, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg)
diff --git a/src/coreclr/jit/hwintrinsiclistxarch.h b/src/coreclr/jit/hwintrinsiclistxarch.h
index 1ba32f12e0611b..b76781500c56fa 100644
--- a/src/coreclr/jit/hwintrinsiclistxarch.h
+++ b/src/coreclr/jit/hwintrinsiclistxarch.h
@@ -78,10 +78,18 @@ HARDWARE_INTRINSIC(Vector128, GreaterThanAny,
HARDWARE_INTRINSIC(Vector128, GreaterThanOrEqual, 16, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector128, GreaterThanOrEqualAll, 16, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg)
HARDWARE_INTRINSIC(Vector128, GreaterThanOrEqualAny, 16, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg)
+HARDWARE_INTRINSIC(Vector128, IsEvenInteger, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector128, IsFinite, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector128, IsInfinity, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector128, IsInteger, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector128, IsNaN, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector128, IsNegative, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector128, IsNegativeInfinity, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector128, IsNormal, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector128, IsOddInteger, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector128, IsPositive, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector128, IsPositiveInfinity, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector128, IsSubnormal, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector128, IsZero, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector128, LessThan, 16, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector128, LessThanAll, 16, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg)
@@ -99,7 +107,8 @@ HARDWARE_INTRINSIC(Vector128, MinNative,
HARDWARE_INTRINSIC(Vector128, MultiplyAddEstimate, 16, 3, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector128, Narrow, 16, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector128, Round, 16, -1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
-HARDWARE_INTRINSIC(Vector128, Shuffle, 16, -1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen)
+HARDWARE_INTRINSIC(Vector128, ShiftLeft, 16, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector128, Shuffle, 16, -1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen|HW_Flag_CanBenefitFromConstantProp)
HARDWARE_INTRINSIC(Vector128, Sqrt, 16, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector128, StoreAligned, 16, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg)
HARDWARE_INTRINSIC(Vector128, StoreAlignedNonTemporal, 16, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg)
@@ -188,10 +197,18 @@ HARDWARE_INTRINSIC(Vector256, GreaterThanAny,
HARDWARE_INTRINSIC(Vector256, GreaterThanOrEqual, 32, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector256, GreaterThanOrEqualAll, 32, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg)
HARDWARE_INTRINSIC(Vector256, GreaterThanOrEqualAny, 32, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg)
+HARDWARE_INTRINSIC(Vector256, IsEvenInteger, 32, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector256, IsFinite, 32, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector256, IsInfinity, 32, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector256, IsInteger, 32, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector256, IsNaN, 32, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector256, IsNegative, 32, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector256, IsNegativeInfinity, 32, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector256, IsNormal, 32, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector256, IsOddInteger, 32, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector256, IsPositive, 32, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector256, IsPositiveInfinity, 32, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector256, IsSubnormal, 32, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector256, IsZero, 32, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector256, LessThan, 32, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector256, LessThanAll, 32, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg)
@@ -209,7 +226,8 @@ HARDWARE_INTRINSIC(Vector256, MinNative,
HARDWARE_INTRINSIC(Vector256, MultiplyAddEstimate, 32, 3, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector256, Narrow, 32, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector256, Round, 32, -1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
-HARDWARE_INTRINSIC(Vector256, Shuffle, 32, -1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen)
+HARDWARE_INTRINSIC(Vector256, ShiftLeft, 32, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector256, Shuffle, 32, -1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen|HW_Flag_CanBenefitFromConstantProp)
HARDWARE_INTRINSIC(Vector256, Sqrt, 32, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_AvxOnlyCompatible)
HARDWARE_INTRINSIC(Vector256, StoreAligned, 32, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg|HW_Flag_AvxOnlyCompatible)
HARDWARE_INTRINSIC(Vector256, StoreAlignedNonTemporal, 32, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg|HW_Flag_AvxOnlyCompatible)
@@ -299,10 +317,18 @@ HARDWARE_INTRINSIC(Vector512, GreaterThanAny,
HARDWARE_INTRINSIC(Vector512, GreaterThanOrEqual, 64, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector512, GreaterThanOrEqualAll, 64, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg)
HARDWARE_INTRINSIC(Vector512, GreaterThanOrEqualAny, 64, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg)
+HARDWARE_INTRINSIC(Vector512, IsEvenInteger, 64, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector512, IsFinite, 64, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector512, IsInfinity, 64, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector512, IsInteger, 64, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector512, IsNaN, 64, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector512, IsNegative, 64, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector512, IsNegativeInfinity, 64, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector512, IsNormal, 64, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector512, IsOddInteger, 64, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector512, IsPositive, 64, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector512, IsPositiveInfinity, 64, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector512, IsSubnormal, 64, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector512, IsZero, 64, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector512, LessThan, 64, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector512, LessThanAll, 64, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg)
@@ -320,7 +346,8 @@ HARDWARE_INTRINSIC(Vector512, MinNative,
HARDWARE_INTRINSIC(Vector512, MultiplyAddEstimate, 64, 3, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector512, Narrow, 64, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector512, Round, 64, -1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
-HARDWARE_INTRINSIC(Vector512, Shuffle, 64, -1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen)
+HARDWARE_INTRINSIC(Vector512, ShiftLeft, 64, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
+HARDWARE_INTRINSIC(Vector512, Shuffle, 64, -1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_SpecialImport|HW_Flag_SpecialCodeGen|HW_Flag_CanBenefitFromConstantProp)
HARDWARE_INTRINSIC(Vector512, Sqrt, 64, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId)
HARDWARE_INTRINSIC(Vector512, StoreAligned, 64, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg)
HARDWARE_INTRINSIC(Vector512, StoreAlignedNonTemporal, 64, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_Helper, HW_Flag_InvalidNodeId|HW_Flag_BaseTypeFromFirstArg)
diff --git a/src/coreclr/jit/hwintrinsicxarch.cpp b/src/coreclr/jit/hwintrinsicxarch.cpp
index 55aa44bbca94da..b85dba5c363699 100644
--- a/src/coreclr/jit/hwintrinsicxarch.cpp
+++ b/src/coreclr/jit/hwintrinsicxarch.cpp
@@ -2782,8 +2782,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
if ((simdSize != 32) || compOpportunisticallyDependsOn(InstructionSet_AVX2))
{
- var_types simdType = getSIMDTypeForSize(simdSize);
-
op2 = impSIMDPopStack();
op1 = impSIMDPopStack();
@@ -2800,8 +2798,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
if ((simdSize != 32) || compOpportunisticallyDependsOn(InstructionSet_AVX2))
{
- var_types simdType = getSIMDTypeForSize(simdSize);
-
op2 = impSIMDPopStack();
op1 = impSIMDPopStack();
@@ -2835,8 +2831,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
if ((simdSize != 32) || compOpportunisticallyDependsOn(InstructionSet_AVX2))
{
- var_types simdType = getSIMDTypeForSize(simdSize);
-
op2 = impSIMDPopStack();
op1 = impSIMDPopStack();
@@ -2853,8 +2847,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
if ((simdSize != 32) || compOpportunisticallyDependsOn(InstructionSet_AVX2))
{
- var_types simdType = getSIMDTypeForSize(simdSize);
-
op2 = impSIMDPopStack();
op1 = impSIMDPopStack();
@@ -2863,13 +2855,71 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
break;
}
+ case NI_Vector128_IsEvenInteger:
+ case NI_Vector256_IsEvenInteger:
+ case NI_Vector512_IsEvenInteger:
+ {
+ assert(sig->numArgs == 1);
+
+ if (varTypeIsFloating(simdBaseType))
+ {
+ // The code for handling floating-point is decently complex but also expected
+ // to be rare, so we fallback to the managed implementation, which is accelerated
+ break;
+ }
+
+ op1 = impSIMDPopStack();
+ retNode = gtNewSimdIsEvenIntegerNode(retType, op1, simdBaseJitType, simdSize);
+ break;
+ }
+
+ case NI_Vector128_IsFinite:
+ case NI_Vector256_IsFinite:
+ case NI_Vector512_IsFinite:
+ {
+ assert(sig->numArgs == 1);
+
+ if ((simdSize != 32) || compOpportunisticallyDependsOn(InstructionSet_AVX2))
+ {
+ op1 = impSIMDPopStack();
+ retNode = gtNewSimdIsFiniteNode(retType, op1, simdBaseJitType, simdSize);
+ }
+ break;
+ }
+
+ case NI_Vector128_IsInfinity:
+ case NI_Vector256_IsInfinity:
+ case NI_Vector512_IsInfinity:
+ {
+ assert(sig->numArgs == 1);
+
+ if ((simdSize != 32) || compOpportunisticallyDependsOn(InstructionSet_AVX2))
+ {
+ op1 = impSIMDPopStack();
+ retNode = gtNewSimdIsInfinityNode(retType, op1, simdBaseJitType, simdSize);
+ }
+ break;
+ }
+
+ case NI_Vector128_IsInteger:
+ case NI_Vector256_IsInteger:
+ case NI_Vector512_IsInteger:
+ {
+ assert(sig->numArgs == 1);
+
+ if ((simdSize != 32) || compOpportunisticallyDependsOn(InstructionSet_AVX2))
+ {
+ op1 = impSIMDPopStack();
+ retNode = gtNewSimdIsIntegerNode(retType, op1, simdBaseJitType, simdSize);
+ }
+ break;
+ }
+
case NI_Vector128_IsNaN:
case NI_Vector256_IsNaN:
case NI_Vector512_IsNaN:
{
assert(sig->numArgs == 1);
- var_types simdType = getSIMDTypeForSize(simdSize);
-
op1 = impSIMDPopStack();
retNode = gtNewSimdIsNaNNode(retType, op1, simdBaseJitType, simdSize);
break;
@@ -2883,13 +2933,58 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
if ((simdSize != 32) || compOpportunisticallyDependsOn(InstructionSet_AVX2))
{
- var_types simdType = getSIMDTypeForSize(simdSize);
- op1 = impSIMDPopStack();
- retNode = gtNewSimdIsNegativeNode(retType, op1, simdBaseJitType, simdSize);
+ op1 = impSIMDPopStack();
+ retNode = gtNewSimdIsNegativeNode(retType, op1, simdBaseJitType, simdSize);
}
break;
}
+ case NI_Vector128_IsNegativeInfinity:
+ case NI_Vector256_IsNegativeInfinity:
+ case NI_Vector512_IsNegativeInfinity:
+ {
+ assert(sig->numArgs == 1);
+
+ if ((simdSize != 32) || compOpportunisticallyDependsOn(InstructionSet_AVX2))
+ {
+ op1 = impSIMDPopStack();
+ retNode = gtNewSimdIsNegativeInfinityNode(retType, op1, simdBaseJitType, simdSize);
+ }
+ break;
+ }
+
+ case NI_Vector128_IsNormal:
+ case NI_Vector256_IsNormal:
+ case NI_Vector512_IsNormal:
+ {
+ assert(sig->numArgs == 1);
+
+ if ((simdSize != 32) || compOpportunisticallyDependsOn(InstructionSet_AVX2))
+ {
+ op1 = impSIMDPopStack();
+ retNode = gtNewSimdIsNormalNode(retType, op1, simdBaseJitType, simdSize);
+ }
+ break;
+ }
+
+ case NI_Vector128_IsOddInteger:
+ case NI_Vector256_IsOddInteger:
+ case NI_Vector512_IsOddInteger:
+ {
+ assert(sig->numArgs == 1);
+
+ if (varTypeIsFloating(simdBaseType))
+ {
+ // The code for handling floating-point is decently complex but also expected
+ // to be rare, so we fallback to the managed implementation, which is accelerated
+ break;
+ }
+
+ op1 = impSIMDPopStack();
+ retNode = gtNewSimdIsOddIntegerNode(retType, op1, simdBaseJitType, simdSize);
+ break;
+ }
+
case NI_Vector128_IsPositive:
case NI_Vector256_IsPositive:
case NI_Vector512_IsPositive:
@@ -2898,9 +2993,8 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
if ((simdSize != 32) || compOpportunisticallyDependsOn(InstructionSet_AVX2))
{
- var_types simdType = getSIMDTypeForSize(simdSize);
- op1 = impSIMDPopStack();
- retNode = gtNewSimdIsPositiveNode(retType, op1, simdBaseJitType, simdSize);
+ op1 = impSIMDPopStack();
+ retNode = gtNewSimdIsPositiveNode(retType, op1, simdBaseJitType, simdSize);
}
break;
}
@@ -2910,10 +3004,26 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
case NI_Vector512_IsPositiveInfinity:
{
assert(sig->numArgs == 1);
- var_types simdType = getSIMDTypeForSize(simdSize);
- op1 = impSIMDPopStack();
- retNode = gtNewSimdIsPositiveInfinityNode(retType, op1, simdBaseJitType, simdSize);
+ if ((simdSize != 32) || compOpportunisticallyDependsOn(InstructionSet_AVX2))
+ {
+ op1 = impSIMDPopStack();
+ retNode = gtNewSimdIsPositiveInfinityNode(retType, op1, simdBaseJitType, simdSize);
+ }
+ break;
+ }
+
+ case NI_Vector128_IsSubnormal:
+ case NI_Vector256_IsSubnormal:
+ case NI_Vector512_IsSubnormal:
+ {
+ assert(sig->numArgs == 1);
+
+ if ((simdSize != 32) || compOpportunisticallyDependsOn(InstructionSet_AVX2))
+ {
+ op1 = impSIMDPopStack();
+ retNode = gtNewSimdIsSubnormalNode(retType, op1, simdBaseJitType, simdSize);
+ }
break;
}
@@ -2922,8 +3032,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
case NI_Vector512_IsZero:
{
assert(sig->numArgs == 1);
- var_types simdType = getSIMDTypeForSize(simdSize);
-
op1 = impSIMDPopStack();
retNode = gtNewSimdIsZeroNode(retType, op1, simdBaseJitType, simdSize);
break;
@@ -2954,8 +3062,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
if ((simdSize != 32) || compOpportunisticallyDependsOn(InstructionSet_AVX2))
{
- var_types simdType = getSIMDTypeForSize(simdSize);
-
op2 = impSIMDPopStack();
op1 = impSIMDPopStack();
@@ -2972,8 +3078,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
if ((simdSize != 32) || compOpportunisticallyDependsOn(InstructionSet_AVX2))
{
- var_types simdType = getSIMDTypeForSize(simdSize);
-
op2 = impSIMDPopStack();
op1 = impSIMDPopStack();
@@ -3007,8 +3111,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
if ((simdSize != 32) || compOpportunisticallyDependsOn(InstructionSet_AVX2))
{
- var_types simdType = getSIMDTypeForSize(simdSize);
-
op2 = impSIMDPopStack();
op1 = impSIMDPopStack();
@@ -3025,8 +3127,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
if ((simdSize != 32) || compOpportunisticallyDependsOn(InstructionSet_AVX2))
{
- var_types simdType = getSIMDTypeForSize(simdSize);
-
op2 = impSIMDPopStack();
op1 = impSIMDPopStack();
@@ -3350,8 +3450,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
if ((simdSize != 32) || varTypeIsFloating(simdBaseType) ||
compOpportunisticallyDependsOn(InstructionSet_AVX2))
{
- var_types simdType = getSIMDTypeForSize(simdSize);
-
op2 = impSIMDPopStack();
op1 = impSIMDPopStack();
@@ -3366,8 +3464,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
if (IsBaselineVector512IsaSupportedOpportunistically())
{
- var_types simdType = getSIMDTypeForSize(simdSize);
-
op2 = impSIMDPopStack();
op1 = impSIMDPopStack();
@@ -3491,6 +3587,39 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
break;
}
+ case NI_Vector128_ShiftLeft:
+ case NI_Vector256_ShiftLeft:
+ case NI_Vector512_ShiftLeft:
+ {
+ assert(sig->numArgs == 2);
+
+ if (!varTypeIsSIMD(impStackTop(0).val))
+ {
+ // We just want the inlining profitability boost for the helper intrinsics/
+ // that have operator alternatives like `simd << int`
+ break;
+ }
+
+ if ((simdSize != 16) || compOpportunisticallyDependsOn(InstructionSet_AVX2))
+ {
+ op2 = impSIMDPopStack();
+ op1 = impSIMDPopStack();
+
+ if (simdSize == 64)
+ {
+ intrinsic = NI_AVX512F_ShiftLeftLogicalVariable;
+ }
+ else
+ {
+ assert((simdSize == 16) || (simdSize == 32));
+ intrinsic = NI_AVX2_ShiftLeftLogicalVariable;
+ }
+
+ retNode = gtNewSimdHWIntrinsicNode(retType, op1, op2, intrinsic, simdBaseJitType, simdSize);
+ }
+ break;
+ }
+
case NI_Vector128_Shuffle:
case NI_Vector256_Shuffle:
case NI_Vector512_Shuffle:
@@ -3553,8 +3682,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
assert(retType == TYP_VOID);
assert(sig->numArgs == 2);
- var_types simdType = getSIMDTypeForSize(simdSize);
-
op2 = impSIMDPopStack();
op1 = impPopStack().val;
@@ -3573,7 +3700,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
case NI_Vector512_StoreUnsafe:
{
assert(retType == TYP_VOID);
- var_types simdType = getSIMDTypeForSize(simdSize);
if (sig->numArgs == 3)
{
@@ -3618,8 +3744,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
assert(sig->numArgs == 2);
assert(retType == TYP_VOID);
- var_types simdType = getSIMDTypeForSize(simdSize);
-
impSpillSideEffect(true, stackState.esStackDepth - 2 DEBUGARG("Spilling op1 side effects for HWIntrinsic"));
op2 = impPopStack().val;
@@ -3643,8 +3767,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
assert(sig->numArgs == 2);
assert(retType == TYP_VOID);
- var_types simdType = getSIMDTypeForSize(simdSize);
-
impSpillSideEffect(true, stackState.esStackDepth - 2 DEBUGARG("Spilling op1 side effects for HWIntrinsic"));
op2 = impPopStack().val;
@@ -3666,7 +3788,6 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,
case NI_Vector512_Sum:
{
assert(sig->numArgs == 1);
- var_types simdType = getSIMDTypeForSize(simdSize);
if ((simdSize == 32) && !compOpportunisticallyDependsOn(InstructionSet_AVX2))
{
diff --git a/src/coreclr/jit/importer.cpp b/src/coreclr/jit/importer.cpp
index ea6e8030cbadc6..c4efb0a63f8f3f 100644
--- a/src/coreclr/jit/importer.cpp
+++ b/src/coreclr/jit/importer.cpp
@@ -9699,6 +9699,26 @@ void Compiler::impImportBlockCode(BasicBlock* block)
/* Push the result of the call on the stack */
impPushOnStack(gtNewLclvNode(lclNum, TYP_REF), tiRetVal);
+
+#ifdef DEBUG
+ // Under SPMI, look up info we might ask for if we stack allocate this array
+ //
+ if (JitConfig.EnableExtraSuperPmiQueries())
+ {
+ void* pEmbedClsHnd;
+ info.compCompHnd->embedClassHandle(resolvedToken.hClass, &pEmbedClsHnd);
+ CORINFO_CLASS_HANDLE elemClsHnd = NO_CLASS_HANDLE;
+ CorInfoType elemCorType = info.compCompHnd->getChildType(resolvedToken.hClass, &elemClsHnd);
+ var_types elemType = JITtype2varType(elemCorType);
+ if (elemType == TYP_STRUCT)
+ {
+ typGetObjLayout(elemClsHnd);
+ info.compCompHnd->isValueClass(elemClsHnd);
+ }
+ void* pIndirection;
+ info.compCompHnd->getHelperFtn(CORINFO_HELP_MEMZERO, &pIndirection);
+ }
+#endif
}
else
{
diff --git a/src/coreclr/jit/jitmetadatalist.h b/src/coreclr/jit/jitmetadatalist.h
index 7ba0d732ab8645..db0f66f3f2c97e 100644
--- a/src/coreclr/jit/jitmetadatalist.h
+++ b/src/coreclr/jit/jitmetadatalist.h
@@ -68,6 +68,8 @@ JITMETADATAMETRIC(InlineAttempt, int, 0)
JITMETADATAMETRIC(InlineCount, int, 0)
JITMETADATAMETRIC(ProfileConsistentBeforeInline, int, 0)
JITMETADATAMETRIC(ProfileConsistentAfterInline, int, 0)
+JITMETADATAMETRIC(ProfileConsistentBeforeMorph, int, 0)
+JITMETADATAMETRIC(ProfileConsistentAfterMorph, int, 0)
JITMETADATAMETRIC(ProfileSynthesizedBlendedOrRepaired, int, 0)
JITMETADATAMETRIC(ProfileInconsistentInitially, int, 0)
JITMETADATAMETRIC(ProfileInconsistentResetLeave, int, 0)
diff --git a/src/coreclr/jit/lclvars.cpp b/src/coreclr/jit/lclvars.cpp
index 2e212085da8a92..5e41f5cea8ee3c 100644
--- a/src/coreclr/jit/lclvars.cpp
+++ b/src/coreclr/jit/lclvars.cpp
@@ -341,6 +341,8 @@ void Compiler::lvaInitArgs(InitVarDscInfo* varDscInfo)
#if defined(TARGET_ARM) && defined(PROFILING_SUPPORTED)
// Prespill all argument regs on to stack in case of Arm when under profiler.
+ // We do this as the arm32 CORINFO_HELP_FCN_ENTER helper does not preserve
+ // these registers, and is called very early.
if (compIsProfilerHookNeeded())
{
codeGen->regSet.rsMaskPreSpillRegArg |= RBM_ARG_REGS;
@@ -4073,6 +4075,13 @@ void Compiler::lvaSortByRefCount()
}
#endif
+ // No benefit in tracking the PSPSym (if any)
+ //
+ if (lclNum == lvaPSPSym)
+ {
+ varDsc->lvTracked = 0;
+ }
+
// Are we not optimizing and we have exception handlers?
// if so mark all args and locals "do not enregister".
//
@@ -4747,18 +4756,6 @@ PhaseStatus Compiler::lvaMarkLocalVars()
#endif // FEATURE_EH_WINDOWS_X86
- // PSPSym is not used by the NativeAOT ABI
- if (!IsTargetAbi(CORINFO_NATIVEAOT_ABI))
- {
- if (UsesFunclets() && ehNeedsPSPSym())
- {
- lvaPSPSym = lvaGrabTempWithImplicitUse(false DEBUGARG("PSPSym"));
- LclVarDsc* lclPSPSym = lvaGetDesc(lvaPSPSym);
- lclPSPSym->lvType = TYP_I_IMPL;
- lvaSetVarDoNotEnregister(lvaPSPSym DEBUGARG(DoNotEnregisterReason::VMNeedsStackAddr));
- }
- }
-
#ifdef JIT32_GCENCODER
// LocAllocSPvar is only required by the implicit frame layout expected by the VM on x86. Whether
// a function contains a Localloc is conveyed in the GC information, in the InfoHdrSmall.localloc
diff --git a/src/coreclr/jit/loopcloning.cpp b/src/coreclr/jit/loopcloning.cpp
index 0f6b681420a6da..b417622a0f38e2 100644
--- a/src/coreclr/jit/loopcloning.cpp
+++ b/src/coreclr/jit/loopcloning.cpp
@@ -2067,8 +2067,19 @@ void Compiler::optCloneLoop(FlowGraphNaturalLoop* loop, LoopCloneContext* contex
// bottomRedirBlk [BBJ_ALWAYS --> bottomNext]
// ... slow cloned loop (not yet inserted)
// bottomNext
- BasicBlock* bottom = loop->GetLexicallyBottomMostBlock();
- BasicBlock* newPred = bottom;
+ BasicBlock* bottom = loop->GetLexicallyBottomMostBlock();
+ BasicBlock* beforeSlowPreheader = bottom;
+
+ // Ensure the slow loop preheader ends up in the same EH region
+ // as the preheader.
+ //
+ bool inTry = false;
+ unsigned const enclosingRegion = ehGetMostNestedRegionIndex(preheader, &inTry);
+ if (!BasicBlock::sameEHRegion(beforeSlowPreheader, preheader))
+ {
+ beforeSlowPreheader = fgFindInsertPoint(enclosingRegion, inTry, bottom, /* endBlk */ nullptr,
+ /* nearBlk */ bottom, /* jumpBlk */ nullptr, /* runRarely */ false);
+ }
// Create a new preheader for the slow loop immediately before the slow
// loop itself. All failed conditions will branch to the slow preheader.
@@ -2078,22 +2089,20 @@ void Compiler::optCloneLoop(FlowGraphNaturalLoop* loop, LoopCloneContext* contex
// The slow preheader needs to go in the same EH region as the preheader.
//
JITDUMP("Create unique preheader for slow path loop\n");
- const bool extendRegion = BasicBlock::sameEHRegion(bottom, preheader);
- BasicBlock* slowPreheader = fgNewBBafter(BBJ_ALWAYS, newPred, extendRegion);
- JITDUMP("Adding " FMT_BB " after " FMT_BB "\n", slowPreheader->bbNum, newPred->bbNum);
- slowPreheader->bbWeight = newPred->isRunRarely() ? BB_ZERO_WEIGHT : ambientWeight;
- slowPreheader->CopyFlags(newPred, (BBF_PROF_WEIGHT | BBF_RUN_RARELY));
+ const bool extendRegion = BasicBlock::sameEHRegion(beforeSlowPreheader, preheader);
+ BasicBlock* slowPreheader = fgNewBBafter(BBJ_ALWAYS, beforeSlowPreheader, extendRegion);
+ JITDUMP("Adding " FMT_BB " after " FMT_BB "\n", slowPreheader->bbNum, beforeSlowPreheader->bbNum);
+ slowPreheader->bbWeight = preheader->isRunRarely() ? BB_ZERO_WEIGHT : ambientWeight;
+ slowPreheader->CopyFlags(preheader, (BBF_PROF_WEIGHT | BBF_RUN_RARELY));
slowPreheader->scaleBBWeight(LoopCloneContext::slowPathWeightScaleFactor);
- // If we didn't extend the region above (because the last loop
+ // If we didn't extend the region above (because the beforeSlowPreheader
// block was in some enclosed EH region), put the slow preheader
// into the appropriate region, and make appropriate extent updates.
//
if (!extendRegion)
{
slowPreheader->copyEHRegion(preheader);
- bool isTry = false;
- unsigned enclosingRegion = ehGetMostNestedRegionIndex(slowPreheader, &isTry);
if (enclosingRegion != 0)
{
@@ -2111,11 +2120,11 @@ void Compiler::optCloneLoop(FlowGraphNaturalLoop* loop, LoopCloneContext* contex
}
}
}
- newPred = slowPreheader;
// Now we'll clone the blocks of the loop body. These cloned blocks will be the slow path.
-
+ //
BlockToBlockMap* blockMap = new (getAllocator(CMK_LoopClone)) BlockToBlockMap(getAllocator(CMK_LoopClone));
+ BasicBlock* newPred = slowPreheader;
if (cloneLoopsWithEH)
{
diff --git a/src/coreclr/jit/lower.cpp b/src/coreclr/jit/lower.cpp
index b11495b8713921..724dd17082a4e3 100644
--- a/src/coreclr/jit/lower.cpp
+++ b/src/coreclr/jit/lower.cpp
@@ -3411,7 +3411,7 @@ void Lowering::RehomeArgForFastTailCall(unsigned int lclNum,
//------------------------------------------------------------------------
// LowerTailCallViaJitHelper: lower a call via the tailcall JIT helper. Morph
// has already inserted tailcall helper special arguments. This function inserts
-// actual data for some placeholders. This function is only used on x86.
+// actual data for some placeholders. This function is only used on Windows x86.
//
// Lower
// tail.call(, int numberOfOldStackArgs, int dummyNumberOfNewStackArgs, int flags, void* dummyArg)
@@ -9147,8 +9147,9 @@ void Lowering::LowerStoreIndirCoalescing(GenTreeIndir* ind)
}
// Since we're merging two stores of the same type, the new type is twice wider.
- var_types oldType = ind->TypeGet();
- var_types newType;
+ var_types oldType = ind->TypeGet();
+ var_types newType = TYP_UNDEF;
+ bool tryReusingPrevValue = false;
switch (oldType)
{
case TYP_BYTE:
@@ -9200,7 +9201,8 @@ void Lowering::LowerStoreIndirCoalescing(GenTreeIndir* ind)
newType = TYP_SIMD32;
break;
}
- return;
+ tryReusingPrevValue = true;
+ break;
case TYP_SIMD32:
if (comp->getPreferredVectorByteLength() >= 64)
@@ -9208,8 +9210,14 @@ void Lowering::LowerStoreIndirCoalescing(GenTreeIndir* ind)
newType = TYP_SIMD64;
break;
}
- return;
-#endif // TARGET_AMD64
+ tryReusingPrevValue = true;
+ break;
+#elif defined(TARGET_ARM64) // TARGET_AMD64
+ case TYP_SIMD16:
+ tryReusingPrevValue = true;
+ break;
+
+#endif // TARGET_ARM64
#endif // FEATURE_HW_INTRINSICS
#endif // TARGET_64BIT
@@ -9222,6 +9230,27 @@ void Lowering::LowerStoreIndirCoalescing(GenTreeIndir* ind)
return;
}
+ // If we can't merge these two stores into a single store, we can at least
+ // cache prevData.value to a local and reuse it in currData.
+ // Normally, LSRA is expected to do this for us, but it's not always the case for SIMD.
+ if (tryReusingPrevValue)
+ {
+#if defined(FEATURE_HW_INTRINSICS)
+ LIR::Use use;
+ if (currData.value->OperIs(GT_CNS_VEC) && GenTree::Compare(prevData.value, currData.value) &&
+ BlockRange().TryGetUse(prevData.value, &use))
+ {
+ GenTree* prevValueTmp = comp->gtNewLclvNode(use.ReplaceWithLclVar(comp), prevData.value->TypeGet());
+ BlockRange().InsertBefore(currData.value, prevValueTmp);
+ BlockRange().Remove(currData.value);
+ ind->Data() = prevValueTmp;
+ }
+#endif // FEATURE_HW_INTRINSICS
+ return;
+ }
+
+ assert(newType != TYP_UNDEF);
+
// We should not be here for stores requiring write barriers.
assert(!comp->codeGen->gcInfo.gcIsWriteBarrierStoreIndNode(ind->AsStoreInd()));
assert(!comp->codeGen->gcInfo.gcIsWriteBarrierStoreIndNode(prevInd->AsStoreInd()));
diff --git a/src/coreclr/jit/lowerxarch.cpp b/src/coreclr/jit/lowerxarch.cpp
index 7ff007ca86a4bb..c80d19e9fdd4f2 100644
--- a/src/coreclr/jit/lowerxarch.cpp
+++ b/src/coreclr/jit/lowerxarch.cpp
@@ -1330,49 +1330,29 @@ void Lowering::LowerHWIntrinsicCC(GenTreeHWIntrinsic* node, NamedIntrinsic newIn
void Lowering::LowerFusedMultiplyAdd(GenTreeHWIntrinsic* node)
{
assert(node->GetHWIntrinsicId() == NI_FMA_MultiplyAddScalar);
- GenTreeHWIntrinsic* createScalarOps[3];
+ assert(node->GetOperandCount() == 3);
+ bool negatedArgs[3] = {};
for (size_t i = 1; i <= 3; i++)
{
GenTree* arg = node->Op(i);
-
- if (!arg->OperIsHWIntrinsic() || (arg->AsHWIntrinsic()->GetHWIntrinsicId() != NI_Vector128_CreateScalarUnsafe))
+ if (arg->OperIsHWIntrinsic(NI_Vector128_CreateScalarUnsafe))
{
- return;
+ GenTree*& argOp = arg->AsHWIntrinsic()->Op(1);
+ if (argOp->OperIs(GT_NEG))
+ {
+ BlockRange().Remove(argOp);
+ argOp = argOp->gtGetOp1();
+ argOp->ClearContained();
+ ContainCheckHWIntrinsic(arg->AsHWIntrinsic());
+ negatedArgs[i - 1] = true;
+ }
}
-
- createScalarOps[i - 1] = arg->AsHWIntrinsic();
- }
-
- GenTree* argX = createScalarOps[0]->Op(1);
- GenTree* argY = createScalarOps[1]->Op(1);
- GenTree* argZ = createScalarOps[2]->Op(1);
-
- const bool negMul = argX->OperIs(GT_NEG) != argY->OperIs(GT_NEG);
- if (argX->OperIs(GT_NEG))
- {
- createScalarOps[0]->Op(1) = argX->gtGetOp1();
- BlockRange().Remove(argX);
-
- createScalarOps[0]->Op(1)->ClearContained();
- ContainCheckHWIntrinsic(createScalarOps[0]);
}
- if (argY->OperIs(GT_NEG))
- {
- createScalarOps[1]->Op(1) = argY->gtGetOp1();
- BlockRange().Remove(argY);
- createScalarOps[1]->Op(1)->ClearContained();
- ContainCheckHWIntrinsic(createScalarOps[1]);
- }
- if (argZ->OperIs(GT_NEG))
+ bool negMul = negatedArgs[0] ^ negatedArgs[1];
+ if (negatedArgs[2])
{
- createScalarOps[2]->Op(1) = argZ->gtGetOp1();
- BlockRange().Remove(argZ);
-
- createScalarOps[2]->Op(1)->ClearContained();
- ContainCheckHWIntrinsic(createScalarOps[2]);
-
node->ChangeHWIntrinsicId(negMul ? NI_FMA_MultiplySubtractNegatedScalar : NI_FMA_MultiplySubtractScalar);
}
else
diff --git a/src/coreclr/jit/lsrabuild.cpp b/src/coreclr/jit/lsrabuild.cpp
index 72f88864d755a7..21c5847da7c4fb 100644
--- a/src/coreclr/jit/lsrabuild.cpp
+++ b/src/coreclr/jit/lsrabuild.cpp
@@ -4300,6 +4300,16 @@ int LinearScan::BuildReturn(GenTree* tree)
return 1;
}
}
+ else
+ {
+ // In other cases we require the incoming operand to be in the
+ // right register(s) when we build the use(s), and thus we do not
+ // need to model that as a kill. However, in this case we have a
+ // contained operand. Codegen will move it to the right return
+ // registers; thus they will be killed.
+ regMaskTP killedRegs = compiler->compRetTypeDesc.GetABIReturnRegs(compiler->info.compCallConv);
+ buildKillPositionsForNode(tree, currentLoc + 1, killedRegs);
+ }
// No kills or defs.
return 0;
diff --git a/src/coreclr/jit/morph.cpp b/src/coreclr/jit/morph.cpp
index 8f42dd8743ce4e..8b2269bbd677de 100644
--- a/src/coreclr/jit/morph.cpp
+++ b/src/coreclr/jit/morph.cpp
@@ -5119,11 +5119,6 @@ GenTree* Compiler::fgMorphPotentialTailCall(GenTreeCall* call)
//
if (isImplicitOrStressTailCall)
{
- if (varDsc->lvHasLdAddrOp && !lvaIsImplicitByRefLocal(varNum))
- {
- failTailCall("Local address taken", varNum);
- return nullptr;
- }
if (varDsc->IsAddressExposed())
{
if (lvaIsImplicitByRefLocal(varNum))
@@ -5366,55 +5361,27 @@ GenTree* Compiler::fgMorphPotentialTailCall(GenTreeCall* call)
//
if (compCurBB->KindIs(BBJ_ALWAYS))
{
+ BasicBlock* const curBlock = compCurBB;
+ BasicBlock* const targetBlock = curBlock->GetTarget();
+
// Flow no longer reaches the target from here.
//
- fgRemoveRefPred(compCurBB->GetTargetEdge());
+ fgRemoveRefPred(curBlock->GetTargetEdge());
- // Adjust profile weights of the successor blocks.
+ // Adjust profile weights of the successor block.
//
// Note if this is a tail call to loop, further updates
// are needed once we install the loop edge.
//
- BasicBlock* curBlock = compCurBB;
- if (curBlock->hasProfileWeight())
+ if (curBlock->hasProfileWeight() && targetBlock->hasProfileWeight())
{
- weight_t weightLoss = curBlock->bbWeight;
- BasicBlock* nextBlock = curBlock->GetTarget();
+ targetBlock->decreaseBBProfileWeight(curBlock->bbWeight);
- while (nextBlock->hasProfileWeight())
+ if (targetBlock->NumSucc() > 0)
{
- // Since we have linear flow we can update the next block weight.
- //
- weight_t const nextWeight = nextBlock->bbWeight;
- weight_t const newNextWeight = nextWeight - weightLoss;
-
- // If the math would result in a negative weight then there's
- // no local repair we can do; just leave things inconsistent.
- //
- if (newNextWeight >= 0)
- {
- // Note if we'd already morphed the IR in nextblock we might
- // have done something profile sensitive that we should arguably reconsider.
- //
- JITDUMP("Reducing profile weight of " FMT_BB " from " FMT_WT " to " FMT_WT "\n", nextBlock->bbNum,
- nextWeight, newNextWeight);
-
- nextBlock->setBBProfileWeight(newNextWeight);
- }
- else
- {
- JITDUMP("Not reducing profile weight of " FMT_BB " as its weight " FMT_WT
- " is less than direct flow pred " FMT_BB " weight " FMT_WT "\n",
- nextBlock->bbNum, nextWeight, compCurBB->bbNum, weightLoss);
- }
-
- if (!nextBlock->KindIs(BBJ_ALWAYS))
- {
- break;
- }
-
- curBlock = nextBlock;
- nextBlock = curBlock->GetTarget();
+ JITDUMP("Flow removal out of " FMT_BB " needs to be propagated. Data %s inconsistent.\n",
+ curBlock->bbNum, fgPgoConsistent ? "is now" : "was already");
+ fgPgoConsistent = false;
}
}
}
@@ -6319,7 +6286,7 @@ void Compiler::fgMorphTailCallViaJitHelper(GenTreeCall* call)
// For the helper-assisted tail calls, we need to push all the arguments
// into a single list, and then add a few extra at the beginning or end.
//
- // For x86, the tailcall helper is defined as:
+ // For Windows x86, the tailcall helper is defined as:
//
// JIT_TailCall(, int numberOfOldStackArgsWords, int numberOfNewStackArgsWords, int flags, void*
// callTarget)
@@ -6755,12 +6722,12 @@ void Compiler::fgMorphRecursiveFastTailCallIntoLoop(BasicBlock* block, GenTreeCa
fgRemoveStmt(block, lastStmt);
// Set the loop edge.
+ BasicBlock* entryBB;
if (opts.IsOSR())
{
// Todo: this may not look like a viable loop header.
// Might need the moral equivalent of an init BB.
- FlowEdge* const newEdge = fgAddRefPred(fgEntryBB, block);
- block->SetKindAndTargetEdge(BBJ_ALWAYS, newEdge);
+ entryBB = fgEntryBB;
}
else
{
@@ -6769,9 +6736,19 @@ void Compiler::fgMorphRecursiveFastTailCallIntoLoop(BasicBlock* block, GenTreeCa
// TODO-Cleanup: We should really be expanding tailcalls into loops
// much earlier than this, at a place where we do not need to have
// hacky workarounds to figure out what the actual IL entry block is.
- BasicBlock* firstILBB = fgGetFirstILBlock();
- FlowEdge* const newEdge = fgAddRefPred(firstILBB, block);
- block->SetKindAndTargetEdge(BBJ_ALWAYS, newEdge);
+ entryBB = fgGetFirstILBlock();
+ }
+
+ FlowEdge* const newEdge = fgAddRefPred(entryBB, block);
+ block->SetKindAndTargetEdge(BBJ_ALWAYS, newEdge);
+
+ // Update profile
+ if (block->hasProfileWeight() && entryBB->hasProfileWeight())
+ {
+ entryBB->increaseBBProfileWeight(block->bbWeight);
+ JITDUMP("Flow into entry BB " FMT_BB " increased. Data %s inconsistent.\n", entryBB->bbNum,
+ fgPgoConsistent ? "is now" : "was already");
+ fgPgoConsistent = false;
}
// Finish hooking things up.
@@ -12741,10 +12718,11 @@ Compiler::FoldResult Compiler::fgFoldConditional(BasicBlock* block)
// modify the flow graph
// Find the actual jump target
- size_t switchVal = (size_t)cond->AsIntCon()->gtIconVal;
- unsigned jumpCnt = block->GetSwitchTargets()->bbsCount;
- FlowEdge** jumpTab = block->GetSwitchTargets()->bbsDstTab;
- bool foundVal = false;
+ size_t switchVal = (size_t)cond->AsIntCon()->gtIconVal;
+ unsigned jumpCnt = block->GetSwitchTargets()->bbsCount;
+ FlowEdge** jumpTab = block->GetSwitchTargets()->bbsDstTab;
+ bool foundVal = false;
+ bool profileInconsistent = false;
for (unsigned val = 0; val < jumpCnt; val++, jumpTab++)
{
@@ -12752,6 +12730,13 @@ Compiler::FoldResult Compiler::fgFoldConditional(BasicBlock* block)
assert(curEdge->getDestinationBlock()->countOfInEdges() > 0);
+ BasicBlock* const targetBlock = curEdge->getDestinationBlock();
+ if (block->hasProfileWeight() && targetBlock->hasProfileWeight())
+ {
+ targetBlock->decreaseBBProfileWeight(curEdge->getLikelyWeight());
+ profileInconsistent |= (targetBlock->NumSucc() > 0);
+ }
+
// If val matches switchVal or we are at the last entry and
// we never found the switch value then set the new jump dest
@@ -12759,6 +12744,12 @@ Compiler::FoldResult Compiler::fgFoldConditional(BasicBlock* block)
{
block->SetKindAndTargetEdge(BBJ_ALWAYS, curEdge);
foundVal = true;
+
+ if (block->hasProfileWeight() && targetBlock->hasProfileWeight())
+ {
+ targetBlock->increaseBBProfileWeight(block->bbWeight);
+ profileInconsistent |= (targetBlock->NumSucc() > 0);
+ }
}
else
{
@@ -12767,6 +12758,13 @@ Compiler::FoldResult Compiler::fgFoldConditional(BasicBlock* block)
}
}
+ if (profileInconsistent)
+ {
+ JITDUMP("Flow change out of " FMT_BB " needs to be propagated. Data %s inconsistent.\n", block->bbNum,
+ fgPgoConsistent ? "is now" : "was already");
+ fgPgoConsistent = false;
+ }
+
assert(foundVal);
#ifdef DEBUG
if (verbose)
@@ -13408,6 +13406,11 @@ PhaseStatus Compiler::fgMorphBlocks()
//
fgGlobalMorph = true;
+ if (fgPgoConsistent)
+ {
+ Metrics.ProfileConsistentBeforeMorph = 1;
+ }
+
if (opts.OptimizationEnabled())
{
// Local assertion prop is enabled if we are optimizing.
@@ -13505,6 +13508,25 @@ PhaseStatus Compiler::fgMorphBlocks()
fgEntryBB->bbRefs--;
fgEntryBBExtraRefs = 0;
+ // The original method entry will now be checked for profile consistency.
+ // If the entry has inconsistent incoming weight, flag the profile as inconsistent.
+ //
+ if (fgEntryBB->hasProfileWeight())
+ {
+ weight_t incomingWeight = BB_ZERO_WEIGHT;
+ for (FlowEdge* const predEdge : fgEntryBB->PredEdges())
+ {
+ incomingWeight += predEdge->getLikelyWeight();
+ }
+
+ if (!fgProfileWeightsConsistent(incomingWeight, fgEntryBB->bbWeight))
+ {
+ JITDUMP("OSR: Original method entry " FMT_BB " has inconsistent weight. Data %s inconsistent.\n",
+ fgPgoConsistent ? "is now" : "was already");
+ fgPgoConsistent = false;
+ }
+ }
+
// We don't need to remember this block anymore.
fgEntryBB = nullptr;
}
@@ -13544,6 +13566,11 @@ PhaseStatus Compiler::fgMorphBlocks()
// may no longer be canonical.
fgCanonicalizeFirstBB();
+ if (fgPgoConsistent)
+ {
+ Metrics.ProfileConsistentAfterMorph = 1;
+ }
+
INDEBUG(fgPostGlobalMorphChecks();)
return PhaseStatus::MODIFIED_EVERYTHING;
@@ -14263,6 +14290,15 @@ bool Compiler::fgExpandQmarkStmt(BasicBlock* block, Statement* stmt)
BasicBlock* condBlock = fgNewBBafter(BBJ_ALWAYS, block, true);
BasicBlock* elseBlock = fgNewBBafter(BBJ_ALWAYS, condBlock, true);
+ // Update flowgraph
+ fgRedirectTargetEdge(block, condBlock);
+ condBlock->SetTargetEdge(fgAddRefPred(elseBlock, condBlock));
+ elseBlock->SetTargetEdge(fgAddRefPred(remainderBlock, elseBlock));
+
+ // Propagate flow from block into condBlock.
+ // Leave flow out of remainderBlock intact, as it will post-dominate block.
+ condBlock->inheritWeight(block);
+
// These blocks are only internal if 'block' is (but they've been set as internal by fgNewBBafter).
// If they're not internal, mark them as imported to avoid asserts about un-imported blocks.
if (!block->HasFlag(BBF_INTERNAL))
@@ -14276,27 +14312,6 @@ bool Compiler::fgExpandQmarkStmt(BasicBlock* block, Statement* stmt)
block->RemoveFlags(BBF_NEEDS_GCPOLL);
remainderBlock->SetFlags(propagateFlagsToRemainder | propagateFlagsToAll);
- condBlock->inheritWeight(block);
-
- // Make sure remainderBlock gets exactly the same weight as block after split
- assert(condBlock->bbWeight == remainderBlock->bbWeight);
-
- assert(block->KindIs(BBJ_ALWAYS));
- fgRedirectTargetEdge(block, condBlock);
-
- {
- FlowEdge* const newEdge = fgAddRefPred(elseBlock, condBlock);
- condBlock->SetTargetEdge(newEdge);
- }
-
- {
- FlowEdge* const newEdge = fgAddRefPred(remainderBlock, elseBlock);
- elseBlock->SetTargetEdge(newEdge);
- }
-
- assert(condBlock->JumpsToNext());
- assert(elseBlock->JumpsToNext());
-
condBlock->SetFlags(propagateFlagsToAll);
elseBlock->SetFlags(propagateFlagsToAll);
@@ -14311,6 +14326,7 @@ bool Compiler::fgExpandQmarkStmt(BasicBlock* block, Statement* stmt)
// +--->--------+
// bbj_cond(true)
//
+ // TODO: Remove unnecessary condition reversal
gtReverseCond(condExpr);
thenBlock = fgNewBBafter(BBJ_ALWAYS, condBlock, true);
@@ -14324,13 +14340,12 @@ bool Compiler::fgExpandQmarkStmt(BasicBlock* block, Statement* stmt)
const unsigned thenLikelihood = qmark->ThenNodeLikelihood();
const unsigned elseLikelihood = qmark->ElseNodeLikelihood();
- FlowEdge* const newEdge = fgAddRefPred(remainderBlock, thenBlock);
- thenBlock->SetTargetEdge(newEdge);
+ thenBlock->SetTargetEdge(fgAddRefPred(remainderBlock, thenBlock));
assert(condBlock->TargetIs(elseBlock));
- FlowEdge* const elseEdge = fgAddRefPred(thenBlock, condBlock);
- FlowEdge* const thenEdge = condBlock->GetTargetEdge();
- condBlock->SetCond(thenEdge, elseEdge);
+ FlowEdge* const thenEdge = fgAddRefPred(thenBlock, condBlock);
+ FlowEdge* const elseEdge = condBlock->GetTargetEdge();
+ condBlock->SetCond(elseEdge, thenEdge);
thenBlock->inheritWeightPercentage(condBlock, thenLikelihood);
elseBlock->inheritWeightPercentage(condBlock, elseLikelihood);
thenEdge->setLikelihood(thenLikelihood / 100.0);
@@ -14344,6 +14359,7 @@ bool Compiler::fgExpandQmarkStmt(BasicBlock* block, Statement* stmt)
// +-->-------------+
// bbj_cond(true)
//
+ // TODO: Remove unnecessary condition reversal
gtReverseCond(condExpr);
const unsigned thenLikelihood = qmark->ThenNodeLikelihood();
diff --git a/src/coreclr/jit/optimizer.cpp b/src/coreclr/jit/optimizer.cpp
index e7ee7c2f230471..2ed5909eab2aa5 100644
--- a/src/coreclr/jit/optimizer.cpp
+++ b/src/coreclr/jit/optimizer.cpp
@@ -2351,7 +2351,6 @@ bool Compiler::optInvertWhileLoop(BasicBlock* block)
PhaseStatus Compiler::optInvertLoops()
{
noway_assert(opts.OptimizationEnabled());
- noway_assert(fgModified == false);
#if defined(OPT_CONFIG)
if (!JitConfig.JitDoLoopInversion())
@@ -2387,13 +2386,6 @@ PhaseStatus Compiler::optInvertLoops()
}
}
- if (fgModified)
- {
- // Reset fgModified here as we've done a consistent set of edits.
- //
- fgModified = false;
- }
-
return madeChanges ? PhaseStatus::MODIFIED_EVERYTHING : PhaseStatus::MODIFIED_NOTHING;
}
@@ -2410,7 +2402,6 @@ PhaseStatus Compiler::optInvertLoops()
PhaseStatus Compiler::optOptimizeFlow()
{
noway_assert(opts.OptimizationEnabled());
- noway_assert(fgModified == false);
fgUpdateFlowGraph(/* doTailDuplication */ true);
fgReorderBlocks(/* useProfile */ false);
diff --git a/src/coreclr/jit/targetriscv64.h b/src/coreclr/jit/targetriscv64.h
index 768c958a15d3d1..e5dcded3d878f5 100644
--- a/src/coreclr/jit/targetriscv64.h
+++ b/src/coreclr/jit/targetriscv64.h
@@ -139,7 +139,7 @@
#define REG_WRITE_BARRIER_SRC_BYREF REG_T5
#define RBM_WRITE_BARRIER_SRC_BYREF RBM_T5
- #define RBM_CALLEE_TRASH_NOGC (RBM_T0|RBM_T1|RBM_T2|RBM_T3|RBM_T4|RBM_T5|RBM_T6|RBM_DEFAULT_HELPER_CALL_TARGET)
+ #define RBM_CALLEE_TRASH_NOGC (RBM_T0|RBM_T1|RBM_T2|RBM_T4|RBM_T6|RBM_DEFAULT_HELPER_CALL_TARGET)
// Registers killed by CORINFO_HELP_ASSIGN_REF and CORINFO_HELP_CHECKED_ASSIGN_REF.
#define RBM_CALLEE_TRASH_WRITEBARRIER (RBM_WRITE_BARRIER_DST|RBM_CALLEE_TRASH_NOGC)
@@ -151,7 +151,7 @@
#define RBM_CALLEE_TRASH_WRITEBARRIER_BYREF (RBM_WRITE_BARRIER_DST_BYREF | RBM_WRITE_BARRIER_SRC_BYREF | RBM_CALLEE_TRASH_NOGC)
// Registers no longer containing GC pointers after CORINFO_HELP_ASSIGN_BYREF.
- // Note that x13 and x14 are still valid byref pointers after this helper call, despite their value being changed.
+ // Note that t3 and t5 are still valid byref pointers after this helper call, despite their value being changed.
#define RBM_CALLEE_GCTRASH_WRITEBARRIER_BYREF RBM_CALLEE_TRASH_NOGC
// GenericPInvokeCalliHelper VASigCookie Parameter
diff --git a/src/coreclr/md/compiler/filtermanager.cpp b/src/coreclr/md/compiler/filtermanager.cpp
index 1219bbeaabbfa1..2e3f3003353dcf 100644
--- a/src/coreclr/md/compiler/filtermanager.cpp
+++ b/src/coreclr/md/compiler/filtermanager.cpp
@@ -11,7 +11,7 @@
#include "stdafx.h"
#include "filtermanager.h"
-#define IsGlobalTypeDef(td) ((td) == TokenFromRid(mdtTypeDef, 1))
+#define IsGlobalTypeDef(td) ((td) == COR_GLOBAL_PARENT_TOKEN)
//*****************************************************************************
// Walk up to the containing tree and
diff --git a/src/coreclr/md/compiler/regmeta_emit.cpp b/src/coreclr/md/compiler/regmeta_emit.cpp
index dff2a329e5d109..eba625b297ef29 100644
--- a/src/coreclr/md/compiler/regmeta_emit.cpp
+++ b/src/coreclr/md/compiler/regmeta_emit.cpp
@@ -1202,7 +1202,7 @@ HRESULT RegMeta::_SetImplements( // S_OK or error.
i++;
- IfFailGo(UpdateENCLog(TokenFromRid(mdtInterfaceImpl, iInterfaceImpl)));
+ IfFailGo(UpdateENCLog(TokenFromRid(iInterfaceImpl, mdtInterfaceImpl)));
}
ErrExit:
diff --git a/src/coreclr/md/runtime/metamodelro.cpp b/src/coreclr/md/runtime/metamodelro.cpp
index 48e1f2e8e4f24f..4850db9833e699 100644
--- a/src/coreclr/md/runtime/metamodelro.cpp
+++ b/src/coreclr/md/runtime/metamodelro.cpp
@@ -411,7 +411,7 @@ CMiniMd::CommonGetCustomAttributeByNameEx(
IfFailGo(GetCustomAttributeRecord(ridStart, &pRec));
IfFailGo(getValueOfCustomAttribute(pRec, reinterpret_cast(ppData), pcbData));
if (ptkCA)
- *ptkCA = TokenFromRid(mdtCustomAttribute, ridStart);
+ *ptkCA = TokenFromRid(ridStart, mdtCustomAttribute);
}
break;
}
diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets
index d8783480def1f7..0e633f34e3b24f 100644
--- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets
+++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Publish.targets
@@ -64,13 +64,7 @@
-
-
-
-
-
diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets
index 970b1debbf46e1..d2fe6e75e1db6f 100644
--- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets
+++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets
@@ -39,7 +39,7 @@ The .NET Foundation licenses this file to you under the MIT license.
$(RuntimeIdentifier)
-
+ $(_targetArchitecture)
x86_64
aarch64
arm64
diff --git a/src/coreclr/nativeaot/Runtime/amd64/ExceptionHandling.asm b/src/coreclr/nativeaot/Runtime/amd64/ExceptionHandling.asm
index e6356dbe1bfcfd..741b916f00b904 100644
--- a/src/coreclr/nativeaot/Runtime/amd64/ExceptionHandling.asm
+++ b/src/coreclr/nativeaot/Runtime/amd64/ExceptionHandling.asm
@@ -532,7 +532,7 @@ endif
;; It was the ThreadAbortException, so rethrow it
mov rcx, STATUS_REDHAWK_THREAD_ABORT
mov rdx, rax ;; rdx <- continuation address as exception RIP
- mov rax, RhpThrowHwEx ;; Throw the ThreadAbortException as a special kind of hardware exception
+ lea rax, [RhpThrowHwEx] ;; Throw the ThreadAbortException as a special kind of hardware exception
;; reset RSP and jump to RAX
@@: mov rsp, r8 ;; reset the SP to resume SP value
diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Reflection/Augments/ReflectionAugments.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Reflection/Augments/ReflectionAugments.cs
index 86fbbcba782fe5..4eeda04b49f60c 100644
--- a/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Reflection/Augments/ReflectionAugments.cs
+++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/Internal/Reflection/Augments/ReflectionAugments.cs
@@ -93,11 +93,6 @@ internal static unsafe TypeCode GetRuntimeTypeCode(RuntimeType type)
return TypeCode.Object;
}
- public static TypeLoadException CreateTypeLoadException(string message, string typeName)
- {
- return new TypeLoadException(message, typeName);
- }
-
public static Assembly Load(AssemblyName assemblyRef, bool throwOnFileNotFound)
{
ArgumentNullException.ThrowIfNull(assemblyRef);
diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Runtime/General/Helpers.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Runtime/General/Helpers.cs
index b6d019046c3884..946ba3cb736cd2 100644
--- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Runtime/General/Helpers.cs
+++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Runtime/General/Helpers.cs
@@ -75,18 +75,10 @@ public static MethodInfo FilterAccessor(this MethodInfo accessor, bool nonPublic
return null;
}
- public static TypeLoadException CreateTypeLoadException(string typeName, Assembly assemblyIfAny)
- {
- if (assemblyIfAny == null)
- throw new TypeLoadException(SR.Format(SR.TypeLoad_TypeNotFound, typeName));
- else
- throw Helpers.CreateTypeLoadException(typeName, assemblyIfAny.FullName);
- }
-
public static TypeLoadException CreateTypeLoadException(string typeName, string assemblyName)
{
- string message = SR.Format(SR.TypeLoad_TypeNotFoundInAssembly, typeName, assemblyName);
- return ReflectionAugments.CreateTypeLoadException(message, typeName);
+ string message = SR.Format(SR.TypeLoad_ResolveTypeFromAssembly, typeName, assemblyName);
+ return new TypeLoadException(message, typeName);
}
// Escape identifiers as described in "Specifying Fully Qualified Type Names" on msdn.
diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Runtime/General/TypeResolver.NativeFormat.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Runtime/General/TypeResolver.NativeFormat.cs
index 3aed59328d5026..3e3eb8fc6ffe84 100644
--- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Runtime/General/TypeResolver.NativeFormat.cs
+++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Runtime/General/TypeResolver.NativeFormat.cs
@@ -195,7 +195,7 @@ internal static RuntimeTypeInfo ResolveTypeDefinition(this TypeDefinitionHandle
Type? resolvedType = outerTypeInfo.GetNestedType(name, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly);
if (resolvedType == null)
{
- exception = Helpers.CreateTypeLoadException(outerTypeInfo.FullName + "+" + name, outerTypeInfo.Assembly);
+ exception = Helpers.CreateTypeLoadException(outerTypeInfo.FullName + "+" + name, outerTypeInfo.Assembly.FullName);
return null;
}
return resolvedType.ToRuntimeTypeInfo();
diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/TypeNameResolver.NativeAot.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/TypeNameResolver.NativeAot.cs
index 51129f0fda74db..e512d04c3ac099 100644
--- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/TypeNameResolver.NativeAot.cs
+++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/TypeNameResolver.NativeAot.cs
@@ -146,7 +146,8 @@ internal partial struct TypeNameResolver
{
throw new TypeLoadException(assembly is null ?
SR.Format(SR.TypeLoad_ResolveType, escapedTypeName) :
- SR.Format(SR.TypeLoad_ResolveTypeFromAssembly, escapedTypeName, assembly.FullName));
+ SR.Format(SR.TypeLoad_ResolveTypeFromAssembly, escapedTypeName, assembly.FullName),
+ typeName: escapedTypeName);
}
return null;
}
@@ -234,7 +235,8 @@ internal partial struct TypeNameResolver
if (_throwOnError)
{
throw new TypeLoadException(SR.Format(SR.TypeLoad_ResolveNestedType,
- nestedTypeNames[i], (i > 0) ? nestedTypeNames[i - 1] : TypeNameHelpers.Unescape(escapedTypeName)));
+ nestedTypeNames[i], (i > 0) ? nestedTypeNames[i - 1] : TypeNameHelpers.Unescape(escapedTypeName)),
+ typeName: parsedName.FullName);
}
return null;
}
diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/ThunkPool.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/ThunkPool.cs
index 5996a37b81a548..fcfee9b11342f8 100644
--- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/ThunkPool.cs
+++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/ThunkPool.cs
@@ -35,6 +35,7 @@
//
using System.Diagnostics;
+using System.Numerics;
namespace System.Runtime
{
@@ -44,8 +45,8 @@ internal static class Constants
public static readonly int ThunkCodeSize = RuntimeImports.RhpGetThunkSize();
public static readonly int NumThunksPerBlock = RuntimeImports.RhpGetNumThunksPerBlock();
public static readonly int NumThunkBlocksPerMapping = RuntimeImports.RhpGetNumThunkBlocksPerMapping();
- public static readonly uint ThunkBlockSize = (uint)RuntimeImports.RhpGetThunkBlockSize();
- public static readonly nuint ThunkBlockSizeMask = ThunkBlockSize - 1;
+ public static readonly uint PageSize = BitOperations.RoundUpToPowerOf2((uint)Math.Max(ThunkCodeSize * NumThunksPerBlock, ThunkDataSize * NumThunksPerBlock + IntPtr.Size));
+ public static readonly nuint PageSizeMask = PageSize - 1;
}
internal class ThunksHeap
@@ -97,11 +98,11 @@ private unsafe ThunksHeap(IntPtr commonStubAddress)
IntPtr thunkDataBlock = RuntimeImports.RhpGetThunkDataBlockAddress(thunkStubsBlock);
// Address of the first thunk data cell should be at the beginning of the thunks data block (page-aligned)
- Debug.Assert(((nuint)(nint)thunkDataBlock % Constants.ThunkBlockSize) == 0);
+ Debug.Assert(((nuint)(nint)thunkDataBlock % Constants.PageSize) == 0);
// Update the last pointer value in the thunks data section with the value of the common stub address
- *(IntPtr*)(thunkDataBlock + (int)(Constants.ThunkBlockSize - IntPtr.Size)) = commonStubAddress;
- Debug.Assert(*(IntPtr*)(thunkDataBlock + (int)(Constants.ThunkBlockSize - IntPtr.Size)) == commonStubAddress);
+ *(IntPtr*)(thunkDataBlock + (int)(Constants.PageSize - IntPtr.Size)) = commonStubAddress;
+ Debug.Assert(*(IntPtr*)(thunkDataBlock + (int)(Constants.PageSize - IntPtr.Size)) == commonStubAddress);
// Set the head and end of the linked list
_nextAvailableThunkPtr = thunkDataBlock;
@@ -153,11 +154,11 @@ private unsafe bool ExpandHeap()
IntPtr thunkDataBlock = RuntimeImports.RhpGetThunkDataBlockAddress(thunkStubsBlock);
// Address of the first thunk data cell should be at the beginning of the thunks data block (page-aligned)
- Debug.Assert(((nuint)(nint)thunkDataBlock % Constants.ThunkBlockSize) == 0);
+ Debug.Assert(((nuint)(nint)thunkDataBlock % Constants.PageSize) == 0);
// Update the last pointer value in the thunks data section with the value of the common stub address
- *(IntPtr*)(thunkDataBlock + (int)(Constants.ThunkBlockSize - IntPtr.Size)) = _commonStubAddress;
- Debug.Assert(*(IntPtr*)(thunkDataBlock + (int)(Constants.ThunkBlockSize - IntPtr.Size)) == _commonStubAddress);
+ *(IntPtr*)(thunkDataBlock + (int)(Constants.PageSize - IntPtr.Size)) = _commonStubAddress;
+ Debug.Assert(*(IntPtr*)(thunkDataBlock + (int)(Constants.PageSize - IntPtr.Size)) == _commonStubAddress);
// Link the last entry in the old list to the first entry in the new list
*((IntPtr*)_lastThunkPtr) = thunkDataBlock;
@@ -210,7 +211,7 @@ public unsafe IntPtr AllocateThunk()
*((IntPtr*)(nextAvailableThunkPtr + IntPtr.Size)) = IntPtr.Zero;
#endif
- int thunkIndex = (int)(((nuint)(nint)nextAvailableThunkPtr) - ((nuint)(nint)nextAvailableThunkPtr & ~Constants.ThunkBlockSizeMask));
+ int thunkIndex = (int)(((nuint)(nint)nextAvailableThunkPtr) - ((nuint)(nint)nextAvailableThunkPtr & ~Constants.PageSizeMask));
Debug.Assert((thunkIndex % Constants.ThunkDataSize) == 0);
thunkIndex /= Constants.ThunkDataSize;
@@ -266,7 +267,7 @@ private static IntPtr TryGetThunkDataAddress(IntPtr thunkAddress)
nuint thunkAddressValue = (nuint)(nint)ClearThumbBit(thunkAddress);
// Compute the base address of the thunk's mapping
- nuint currentThunksBlockAddress = thunkAddressValue & ~Constants.ThunkBlockSizeMask;
+ nuint currentThunksBlockAddress = thunkAddressValue & ~Constants.PageSizeMask;
// Make sure the thunk address is valid by checking alignment
if ((thunkAddressValue - currentThunksBlockAddress) % (nuint)Constants.ThunkCodeSize != 0)
diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/TypeLoadException.NativeAot.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/TypeLoadException.NativeAot.cs
index 538f41116fd1f2..5c74308e786de1 100644
--- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/TypeLoadException.NativeAot.cs
+++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/TypeLoadException.NativeAot.cs
@@ -5,13 +5,6 @@ namespace System
{
public partial class TypeLoadException
{
- internal TypeLoadException(string message, string typeName)
- : base(message)
- {
- HResult = HResults.COR_E_TYPELOAD;
- _className = typeName;
- }
-
private void SetMessageField()
{
_message ??= SR.Arg_TypeLoadException;
diff --git a/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.MappingTables.cs b/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.MappingTables.cs
index fd9fba5b7d12e4..ace9bda16ba26c 100644
--- a/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.MappingTables.cs
+++ b/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/ExecutionEnvironmentImplementation.MappingTables.cs
@@ -719,7 +719,7 @@ private unsafe bool TryGetMethodForOriginalLdFtnResult_InvokeMap_Inner(NativeFor
QTypeDefinition qTypeDefinition = GetMetadataForNamedType(declaringTypeHandleDefinition);
MethodHandle nativeFormatMethodHandle =
- (((int)HandleType.Method << 24) | (int)entryMethodHandleOrNameAndSigRaw).AsMethodHandle();
+ (((int)HandleType.Method << 25) | (int)entryMethodHandleOrNameAndSigRaw).AsMethodHandle();
methodHandle = new QMethodDefinition(qTypeDefinition.NativeFormatReader, nativeFormatMethodHandle);
}
diff --git a/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/MetadataReaderExtensions.cs b/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/MetadataReaderExtensions.cs
index 28493dbc097696..00e67d79e6c588 100644
--- a/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/MetadataReaderExtensions.cs
+++ b/src/coreclr/nativeaot/System.Private.Reflection.Execution/src/Internal/Reflection/Execution/MetadataReaderExtensions.cs
@@ -19,7 +19,7 @@ public static MethodHandle AsMethodHandle(this int i)
{
unsafe
{
- Debug.Assert((HandleType)((uint)i >> 24) == HandleType.Method);
+ Debug.Assert((HandleType)((uint)i >> 25) == HandleType.Method);
return *(MethodHandle*)&i;
}
}
diff --git a/src/coreclr/nativeaot/System.Private.StackTraceMetadata/src/Internal/StackTraceMetadata/StackTraceMetadata.cs b/src/coreclr/nativeaot/System.Private.StackTraceMetadata/src/Internal/StackTraceMetadata/StackTraceMetadata.cs
index 44ebfc5864c6ee..008119ebd10cad 100644
--- a/src/coreclr/nativeaot/System.Private.StackTraceMetadata/src/Internal/StackTraceMetadata/StackTraceMetadata.cs
+++ b/src/coreclr/nativeaot/System.Private.StackTraceMetadata/src/Internal/StackTraceMetadata/StackTraceMetadata.cs
@@ -347,7 +347,8 @@ private unsafe void PopulateRvaToTokenMap(TypeManagerHandle handle, byte* pMap,
if ((command & StackTraceDataCommand.UpdateOwningType) != 0)
{
currentOwningType = Handle.FromIntToken((int)NativePrimitiveDecoder.ReadUInt32(ref pCurrent));
- Debug.Assert(currentOwningType.HandleType is HandleType.TypeDefinition or HandleType.TypeReference or HandleType.TypeSpecification);
+ Debug.Assert((command & StackTraceDataCommand.IsStackTraceHidden) != 0 ||
+ currentOwningType.HandleType is HandleType.TypeDefinition or HandleType.TypeReference or HandleType.TypeSpecification);
}
if ((command & StackTraceDataCommand.UpdateName) != 0)
diff --git a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.FieldAccess.cs b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.FieldAccess.cs
index f3d9ef3389204a..efe5e92830c6c1 100644
--- a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.FieldAccess.cs
+++ b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.FieldAccess.cs
@@ -129,7 +129,7 @@ private static unsafe bool TryGetFieldAccessMetadataFromFieldAccessMap(
if ((entryFlags & FieldTableFlags.HasMetadataHandle) != 0)
{
- Handle entryFieldHandle = (((int)HandleType.Field << 24) | (int)entryParser.GetUnsigned()).AsHandle();
+ Handle entryFieldHandle = (((int)HandleType.Field << 25) | (int)entryParser.GetUnsigned()).AsHandle();
if (!fieldHandle.Equals(entryFieldHandle))
continue;
}
diff --git a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.Metadata.cs b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.Metadata.cs
index 332b96d54c8474..6c94d937a87382 100644
--- a/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.Metadata.cs
+++ b/src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.Metadata.cs
@@ -844,7 +844,7 @@ public void GetNext(
if (_moduleHandle != _moduleForMethodHandle)
return;
- Handle entryMethodHandle = (((uint)HandleType.Method << 24) | entryParser.GetUnsigned()).AsHandle();
+ Handle entryMethodHandle = (((uint)HandleType.Method << 25) | entryParser.GetUnsigned()).AsHandle();
if (!_methodHandle.Equals(entryMethodHandle))
return;
}
diff --git a/src/coreclr/pal/src/file/file.cpp b/src/coreclr/pal/src/file/file.cpp
index d0eb9fb3d5d817..8eafaab2476bc9 100644
--- a/src/coreclr/pal/src/file/file.cpp
+++ b/src/coreclr/pal/src/file/file.cpp
@@ -73,11 +73,6 @@ CObjectType CorUnix::otFile(
NULL, // No immutable data cleanup routine
sizeof(CFileProcessLocalData),
CFileProcessLocalDataCleanupRoutine,
- GENERIC_READ|GENERIC_WRITE, // Ignored -- no Win32 object security support
- CObjectType::SecuritySupported,
- CObjectType::OSPersistedSecurityInfo,
- CObjectType::UnnamedObject,
- CObjectType::LocalDuplicationOnly,
CObjectType::UnwaitableObject,
CObjectType::SignalingNotApplicable,
CObjectType::ThreadReleaseNotApplicable,
diff --git a/src/coreclr/pal/src/include/pal/corunix.hpp b/src/coreclr/pal/src/include/pal/corunix.hpp
index dce19f62279799..4ebed32d57659e 100644
--- a/src/coreclr/pal/src/include/pal/corunix.hpp
+++ b/src/coreclr/pal/src/include/pal/corunix.hpp
@@ -189,24 +189,6 @@ namespace CorUnix
// supported generic access rights (e.g., GENERIC_READ) map to the
// specific access rights for this object type.
//
- // If instances of this object may have a security descriptor set on
- // them eSecuritySupport should be set to SecuritySupported. If the OS can
- // persist security information for the object type (as would be the case
- // for, say, files) eSecurityPersistence should be set to
- // OSPersistedSecurityInfo.
- //
- // If the object may have a name eObjectNameSupport should be
- // ObjectCanHaveName. A named object can be opened in more than one
- // process.
- //
- // If it is possible to duplicate a handle to an object across process
- // boundaries then eHandleDuplicationSupport should be set to
- // CrossProcessDuplicationAllowed. Note that it is possible to have
- // an object type where eObjectNameSupport is ObjectCanHaveName and
- // eHandleDuplicationSupport is LocalDuplicationOnly. For these object
- // types an unnamed object instance will only have references from
- // the creating process.
- //
// If the object may be waited on eSynchronizationSupport should be
// WaitableObject. (Note that this implies that object type supports
// the SYNCHRONIZE access right.)
@@ -232,31 +214,6 @@ namespace CorUnix
class CObjectType
{
public:
-
- enum SecuritySupport
- {
- SecuritySupported,
- SecurityNotSupported
- };
-
- enum SecurityPersistence
- {
- OSPersistedSecurityInfo,
- SecurityInfoNotPersisted
- };
-
- enum ObjectNameSupport
- {
- ObjectCanHaveName,
- UnnamedObject
- };
-
- enum HandleDuplicationSupport
- {
- CrossProcessDuplicationAllowed,
- LocalDuplicationOnly
- };
-
enum SynchronizationSupport
{
WaitableObject,
@@ -300,12 +257,7 @@ namespace CorUnix
OBJECT_IMMUTABLE_DATA_CLEANUP_ROUTINE m_pImmutableDataCleanupRoutine;
DWORD m_dwProcessLocalDataSize;
OBJECT_PROCESS_LOCAL_DATA_CLEANUP_ROUTINE m_pProcessLocalDataCleanupRoutine;
- DWORD m_dwSupportedAccessRights;
// Generic access rights mapping
- SecuritySupport m_eSecuritySupport;
- SecurityPersistence m_eSecurityPersistence;
- ObjectNameSupport m_eObjectNameSupport;
- HandleDuplicationSupport m_eHandleDuplicationSupport;
SynchronizationSupport m_eSynchronizationSupport;
SignalingSemantics m_eSignalingSemantics;
ThreadReleaseSemantics m_eThreadReleaseSemantics;
@@ -321,11 +273,6 @@ namespace CorUnix
OBJECT_IMMUTABLE_DATA_CLEANUP_ROUTINE pImmutableDataCleanupRoutine,
DWORD dwProcessLocalDataSize,
OBJECT_PROCESS_LOCAL_DATA_CLEANUP_ROUTINE pProcessLocalDataCleanupRoutine,
- DWORD dwSupportedAccessRights,
- SecuritySupport eSecuritySupport,
- SecurityPersistence eSecurityPersistence,
- ObjectNameSupport eObjectNameSupport,
- HandleDuplicationSupport eHandleDuplicationSupport,
SynchronizationSupport eSynchronizationSupport,
SignalingSemantics eSignalingSemantics,
ThreadReleaseSemantics eThreadReleaseSemantics,
@@ -339,11 +286,6 @@ namespace CorUnix
m_pImmutableDataCleanupRoutine(pImmutableDataCleanupRoutine),
m_dwProcessLocalDataSize(dwProcessLocalDataSize),
m_pProcessLocalDataCleanupRoutine(pProcessLocalDataCleanupRoutine),
- m_dwSupportedAccessRights(dwSupportedAccessRights),
- m_eSecuritySupport(eSecuritySupport),
- m_eSecurityPersistence(eSecurityPersistence),
- m_eObjectNameSupport(eObjectNameSupport),
- m_eHandleDuplicationSupport(eHandleDuplicationSupport),
m_eSynchronizationSupport(eSynchronizationSupport),
m_eSignalingSemantics(eSignalingSemantics),
m_eThreadReleaseSemantics(eThreadReleaseSemantics),
@@ -433,48 +375,8 @@ namespace CorUnix
return m_pProcessLocalDataCleanupRoutine;
}
- DWORD
- GetSupportedAccessRights(
- void
- )
- {
- return m_dwSupportedAccessRights;
- };
-
// Generic access rights mapping
- SecuritySupport
- GetSecuritySupport(
- void
- )
- {
- return m_eSecuritySupport;
- };
-
- SecurityPersistence
- GetSecurityPersistence(
- void
- )
- {
- return m_eSecurityPersistence;
- };
-
- ObjectNameSupport
- GetObjectNameSupport(
- void
- )
- {
- return m_eObjectNameSupport;
- };
-
- HandleDuplicationSupport
- GetHandleDuplicationSupport(
- void
- )
- {
- return m_eHandleDuplicationSupport;
- };
-
SynchronizationSupport
GetSynchronizationSupport(
void
diff --git a/src/coreclr/pal/src/map/map.cpp b/src/coreclr/pal/src/map/map.cpp
index 1ffa6d73ab5e0a..090ce7dc1beb95 100644
--- a/src/coreclr/pal/src/map/map.cpp
+++ b/src/coreclr/pal/src/map/map.cpp
@@ -133,11 +133,6 @@ CObjectType CorUnix::otFileMapping(
CFileMappingImmutableDataCleanupRoutine,
sizeof(CFileMappingProcessLocalData),
NULL, // No process local data cleanup routine
- PAGE_READWRITE | PAGE_READONLY | PAGE_WRITECOPY,
- CObjectType::SecuritySupported,
- CObjectType::SecurityInfoNotPersisted,
- CObjectType::UnnamedObject,
- CObjectType::LocalDuplicationOnly,
CObjectType::UnwaitableObject,
CObjectType::SignalingNotApplicable,
CObjectType::ThreadReleaseNotApplicable,
diff --git a/src/coreclr/pal/src/synchmgr/synchcontrollers.cpp b/src/coreclr/pal/src/synchmgr/synchcontrollers.cpp
index ec746d626f66ed..614944198d46bd 100644
--- a/src/coreclr/pal/src/synchmgr/synchcontrollers.cpp
+++ b/src/coreclr/pal/src/synchmgr/synchcontrollers.cpp
@@ -772,9 +772,7 @@ namespace CorUnix
SynchData (e.g. modifying the object signal count accordingly with its
thread release semantics)
- Note: this method must be called while holding the appropriate
- synchronization locks (the local process synch lock if the target
- object is local, both local and shared one if the object is shared).
+ Note: this method must be called while holding the local process synch lock.
--*/
PAL_ERROR CSynchData::ReleaseWaiterWithoutBlocking(
CPalThread * pthrCurrent,
diff --git a/src/coreclr/pal/src/synchobj/event.cpp b/src/coreclr/pal/src/synchobj/event.cpp
index 86d6f6623e3252..619a55f28a4595 100644
--- a/src/coreclr/pal/src/synchobj/event.cpp
+++ b/src/coreclr/pal/src/synchobj/event.cpp
@@ -37,11 +37,6 @@ CObjectType CorUnix::otManualResetEvent(
NULL, // No immutable data cleanup routine
0, // No process local data
NULL, // No process local data cleanup routine
- EVENT_ALL_ACCESS, // Currently ignored (no Win32 security)
- CObjectType::SecuritySupported,
- CObjectType::SecurityInfoNotPersisted,
- CObjectType::UnnamedObject,
- CObjectType::LocalDuplicationOnly,
CObjectType::WaitableObject,
CObjectType::ObjectCanBeUnsignaled,
CObjectType::ThreadReleaseHasNoSideEffects,
@@ -56,11 +51,6 @@ CObjectType CorUnix::otAutoResetEvent(
NULL, // No immutable data cleanup routine
0, // No process local data
NULL, // No process local data cleanup routine
- EVENT_ALL_ACCESS, // Currently ignored (no Win32 security)
- CObjectType::SecuritySupported,
- CObjectType::SecurityInfoNotPersisted,
- CObjectType::UnnamedObject,
- CObjectType::LocalDuplicationOnly,
CObjectType::WaitableObject,
CObjectType::ObjectCanBeUnsignaled,
CObjectType::ThreadReleaseAltersSignalCount,
diff --git a/src/coreclr/pal/src/synchobj/mutex.cpp b/src/coreclr/pal/src/synchobj/mutex.cpp
index ec0561813295a4..f720fbcfb5fe44 100644
--- a/src/coreclr/pal/src/synchobj/mutex.cpp
+++ b/src/coreclr/pal/src/synchobj/mutex.cpp
@@ -48,11 +48,6 @@ CObjectType CorUnix::otMutex(
NULL, // No immutable data cleanup routine
0, // No process local data
NULL, // No process local data cleanup routine
- 0, // Should be MUTEX_ALL_ACCESS; currently ignored (no Win32 security)
- CObjectType::SecuritySupported,
- CObjectType::SecurityInfoNotPersisted,
- CObjectType::UnnamedObject,
- CObjectType::LocalDuplicationOnly,
CObjectType::WaitableObject,
CObjectType::ObjectCanBeUnsignaled,
CObjectType::ThreadReleaseAltersSignalCount,
@@ -69,11 +64,6 @@ CObjectType CorUnix::otNamedMutex(
NULL, // No immutable data cleanup routine
0, // No process local data
NULL, // No process local data cleanup routine
- 0, // Should be MUTEX_ALL_ACCESS; currently ignored (no Win32 security)
- CObjectType::SecuritySupported,
- CObjectType::SecurityInfoNotPersisted,
- CObjectType::UnnamedObject, // PAL's naming infrastructure is not used
- CObjectType::LocalDuplicationOnly,
CObjectType::UnwaitableObject, // PAL's waiting infrastructure is not used
CObjectType::SignalingNotApplicable, // PAL's signaling infrastructure is not used
CObjectType::ThreadReleaseNotApplicable, // PAL's signaling infrastructure is not used
diff --git a/src/coreclr/pal/src/synchobj/semaphore.cpp b/src/coreclr/pal/src/synchobj/semaphore.cpp
index 47d2881fff7860..3ea6fd487691ba 100644
--- a/src/coreclr/pal/src/synchobj/semaphore.cpp
+++ b/src/coreclr/pal/src/synchobj/semaphore.cpp
@@ -37,11 +37,6 @@ CObjectType CorUnix::otSemaphore(
NULL, // No immutable data cleanup routine
0, // No process local data
NULL, // No process local data cleanup routine
- 0, // Should be SEMAPHORE_ALL_ACCESS; currently ignored (no Win32 security)
- CObjectType::SecuritySupported,
- CObjectType::SecurityInfoNotPersisted,
- CObjectType::UnnamedObject,
- CObjectType::LocalDuplicationOnly,
CObjectType::WaitableObject,
CObjectType::ObjectCanBeUnsignaled,
CObjectType::ThreadReleaseAltersSignalCount,
diff --git a/src/coreclr/pal/src/thread/process.cpp b/src/coreclr/pal/src/thread/process.cpp
index ef7d00f43ba05c..8b51ec971800a8 100644
--- a/src/coreclr/pal/src/thread/process.cpp
+++ b/src/coreclr/pal/src/thread/process.cpp
@@ -137,11 +137,6 @@ CObjectType CorUnix::otProcess(
NULL, // No immutable data cleanup routine
sizeof(CProcProcessLocalData),
NULL, // No process local data cleanup routine
- PROCESS_ALL_ACCESS,
- CObjectType::SecuritySupported,
- CObjectType::SecurityInfoNotPersisted,
- CObjectType::UnnamedObject,
- CObjectType::CrossProcessDuplicationAllowed,
CObjectType::WaitableObject,
CObjectType::SingleTransitionObject,
CObjectType::ThreadReleaseHasNoSideEffects,
diff --git a/src/coreclr/pal/src/thread/thread.cpp b/src/coreclr/pal/src/thread/thread.cpp
index 045b2ecebb9d8a..73203bfa3effe1 100644
--- a/src/coreclr/pal/src/thread/thread.cpp
+++ b/src/coreclr/pal/src/thread/thread.cpp
@@ -99,11 +99,6 @@ CObjectType CorUnix::otThread(
NULL, // No immutable data cleanup routine
sizeof(CThreadProcessLocalData),
NULL, // No process local data cleanup routine
- 0, // THREAD_ALL_ACCESS,
- CObjectType::SecuritySupported,
- CObjectType::SecurityInfoNotPersisted,
- CObjectType::UnnamedObject,
- CObjectType::LocalDuplicationOnly,
CObjectType::WaitableObject,
CObjectType::SingleTransitionObject,
CObjectType::ThreadReleaseHasNoSideEffects,
diff --git a/src/coreclr/scripts/superpmi.py b/src/coreclr/scripts/superpmi.py
index 53cf7f2d21c2aa..229dd3bdfec897 100644
--- a/src/coreclr/scripts/superpmi.py
+++ b/src/coreclr/scripts/superpmi.py
@@ -1207,6 +1207,9 @@ def map_rsp_argument(line):
if line.startswith("--exportsfile:"):
arg_path = os.path.join(test_native_directory, os.path.basename(line[len("--exportsfile:"):]))
return f"--exportsfile:{arg_path}"
+ elif line.startswith("--sourcelink:"):
+ arg_path = os.path.join(test_native_directory, os.path.basename(line[len("--sourcelink:"):]))
+ return f"--sourcelink:{arg_path}"
elif line.startswith("--descriptor:"):
arg_path = os.path.join(test_directory, os.path.basename(line[len("--descriptor:"):]))
return f"--descriptor:{arg_path}"
diff --git a/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/Generator/ReaderGen.cs b/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/Generator/ReaderGen.cs
index c7fc7bec86027a..04f962ebb1c48d 100644
--- a/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/Generator/ReaderGen.cs
+++ b/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/Generator/ReaderGen.cs
@@ -128,9 +128,9 @@ private void EmitHandle(RecordDef record)
CloseScope();
OpenScope($"internal {handleName}(int value)");
- WriteLine("HandleType hType = (HandleType)(value >> 24);");
- WriteLine($"Debug.Assert(hType == 0 || hType == HandleType.{record.Name} || hType == HandleType.Null);");
- WriteLine($"_value = (value & 0x00FFFFFF) | (((int)HandleType.{record.Name}) << 24);");
+ WriteLine("HandleType hType = (HandleType)((uint)value >> 25);");
+ WriteLine($"Debug.Assert(hType == HandleType.{record.Name} || hType == HandleType.Null);");
+ WriteLine($"_value = (value & 0x01FFFFFF) | (((int)HandleType.{record.Name}) << 25);");
WriteLine("_Validate();");
CloseScope();
@@ -157,18 +157,18 @@ private void EmitHandle(RecordDef record)
WriteLine(" => new Handle(handle._value);");
WriteLineIfNeeded();
- WriteLine("internal int Offset => (_value & 0x00FFFFFF);");
+ WriteLine("internal int Offset => (_value & 0x01FFFFFF);");
WriteLineIfNeeded();
WriteLine($"public {record.Name} Get{record.Name}(MetadataReader reader)");
WriteLine($" => new {record.Name}(reader, this);");
WriteLineIfNeeded();
- WriteLine("public bool IsNil => (_value & 0x00FFFFFF) == 0;");
+ WriteLine("public bool IsNil => (_value & 0x01FFFFFF) == 0;");
WriteScopeAttribute("[System.Diagnostics.Conditional(\"DEBUG\")]");
OpenScope("internal void _Validate()");
- WriteLine($"if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.{record.Name})");
+ WriteLine($"if ((HandleType)((uint)_value >> 25) != HandleType.{record.Name})");
WriteLine(" throw new ArgumentException();");
CloseScope("_Validate");
diff --git a/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/MdBinaryReader.cs b/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/MdBinaryReader.cs
index b52493d1b4bb1c..b6697fce3cbe8b 100644
--- a/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/MdBinaryReader.cs
+++ b/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/MdBinaryReader.cs
@@ -78,7 +78,7 @@ public static uint Read(this NativeReader reader, uint offset, out Handle handle
{
uint rawValue;
offset = reader.DecodeUnsigned(offset, out rawValue);
- handle = new Handle((HandleType)(byte)rawValue, (int)(rawValue >> 8));
+ handle = new Handle((HandleType)(rawValue & 0x7F), (int)(rawValue >> 7));
return offset;
}
diff --git a/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/NativeFormatReaderGen.cs b/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/NativeFormatReaderGen.cs
index 958e605b128249..b2fdce3f0c0cb1 100644
--- a/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/NativeFormatReaderGen.cs
+++ b/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/NativeFormatReaderGen.cs
@@ -70,9 +70,9 @@ internal ArraySignatureHandle(Handle handle) : this(handle._value)
internal ArraySignatureHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ArraySignature || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ArraySignature) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ArraySignature || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ArraySignature) << 25);
_Validate();
}
@@ -95,17 +95,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ArraySignatureHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ArraySignature GetArraySignature(MetadataReader reader)
=> new ArraySignature(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ArraySignature)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ArraySignature)
throw new ArgumentException();
} // _Validate
@@ -149,9 +149,9 @@ internal ByReferenceSignatureHandle(Handle handle) : this(handle._value)
internal ByReferenceSignatureHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ByReferenceSignature || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ByReferenceSignature) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ByReferenceSignature || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ByReferenceSignature) << 25);
_Validate();
}
@@ -174,17 +174,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ByReferenceSignatureHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ByReferenceSignature GetByReferenceSignature(MetadataReader reader)
=> new ByReferenceSignature(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ByReferenceSignature)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ByReferenceSignature)
throw new ArgumentException();
} // _Validate
@@ -227,9 +227,9 @@ internal ConstantBooleanArrayHandle(Handle handle) : this(handle._value)
internal ConstantBooleanArrayHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ConstantBooleanArray || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ConstantBooleanArray) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ConstantBooleanArray || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ConstantBooleanArray) << 25);
_Validate();
}
@@ -252,17 +252,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ConstantBooleanArrayHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ConstantBooleanArray GetConstantBooleanArray(MetadataReader reader)
=> new ConstantBooleanArray(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ConstantBooleanArray)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ConstantBooleanArray)
throw new ArgumentException();
} // _Validate
@@ -305,9 +305,9 @@ internal ConstantBooleanValueHandle(Handle handle) : this(handle._value)
internal ConstantBooleanValueHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ConstantBooleanValue || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ConstantBooleanValue) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ConstantBooleanValue || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ConstantBooleanValue) << 25);
_Validate();
}
@@ -330,17 +330,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ConstantBooleanValueHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ConstantBooleanValue GetConstantBooleanValue(MetadataReader reader)
=> new ConstantBooleanValue(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ConstantBooleanValue)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ConstantBooleanValue)
throw new ArgumentException();
} // _Validate
@@ -383,9 +383,9 @@ internal ConstantByteArrayHandle(Handle handle) : this(handle._value)
internal ConstantByteArrayHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ConstantByteArray || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ConstantByteArray) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ConstantByteArray || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ConstantByteArray) << 25);
_Validate();
}
@@ -408,17 +408,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ConstantByteArrayHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ConstantByteArray GetConstantByteArray(MetadataReader reader)
=> new ConstantByteArray(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ConstantByteArray)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ConstantByteArray)
throw new ArgumentException();
} // _Validate
@@ -461,9 +461,9 @@ internal ConstantByteValueHandle(Handle handle) : this(handle._value)
internal ConstantByteValueHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ConstantByteValue || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ConstantByteValue) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ConstantByteValue || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ConstantByteValue) << 25);
_Validate();
}
@@ -486,17 +486,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ConstantByteValueHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ConstantByteValue GetConstantByteValue(MetadataReader reader)
=> new ConstantByteValue(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ConstantByteValue)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ConstantByteValue)
throw new ArgumentException();
} // _Validate
@@ -539,9 +539,9 @@ internal ConstantCharArrayHandle(Handle handle) : this(handle._value)
internal ConstantCharArrayHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ConstantCharArray || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ConstantCharArray) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ConstantCharArray || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ConstantCharArray) << 25);
_Validate();
}
@@ -564,17 +564,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ConstantCharArrayHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ConstantCharArray GetConstantCharArray(MetadataReader reader)
=> new ConstantCharArray(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ConstantCharArray)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ConstantCharArray)
throw new ArgumentException();
} // _Validate
@@ -617,9 +617,9 @@ internal ConstantCharValueHandle(Handle handle) : this(handle._value)
internal ConstantCharValueHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ConstantCharValue || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ConstantCharValue) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ConstantCharValue || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ConstantCharValue) << 25);
_Validate();
}
@@ -642,17 +642,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ConstantCharValueHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ConstantCharValue GetConstantCharValue(MetadataReader reader)
=> new ConstantCharValue(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ConstantCharValue)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ConstantCharValue)
throw new ArgumentException();
} // _Validate
@@ -695,9 +695,9 @@ internal ConstantDoubleArrayHandle(Handle handle) : this(handle._value)
internal ConstantDoubleArrayHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ConstantDoubleArray || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ConstantDoubleArray) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ConstantDoubleArray || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ConstantDoubleArray) << 25);
_Validate();
}
@@ -720,17 +720,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ConstantDoubleArrayHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ConstantDoubleArray GetConstantDoubleArray(MetadataReader reader)
=> new ConstantDoubleArray(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ConstantDoubleArray)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ConstantDoubleArray)
throw new ArgumentException();
} // _Validate
@@ -773,9 +773,9 @@ internal ConstantDoubleValueHandle(Handle handle) : this(handle._value)
internal ConstantDoubleValueHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ConstantDoubleValue || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ConstantDoubleValue) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ConstantDoubleValue || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ConstantDoubleValue) << 25);
_Validate();
}
@@ -798,17 +798,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ConstantDoubleValueHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ConstantDoubleValue GetConstantDoubleValue(MetadataReader reader)
=> new ConstantDoubleValue(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ConstantDoubleValue)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ConstantDoubleValue)
throw new ArgumentException();
} // _Validate
@@ -855,9 +855,9 @@ internal ConstantEnumArrayHandle(Handle handle) : this(handle._value)
internal ConstantEnumArrayHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ConstantEnumArray || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ConstantEnumArray) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ConstantEnumArray || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ConstantEnumArray) << 25);
_Validate();
}
@@ -880,17 +880,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ConstantEnumArrayHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ConstantEnumArray GetConstantEnumArray(MetadataReader reader)
=> new ConstantEnumArray(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ConstantEnumArray)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ConstantEnumArray)
throw new ArgumentException();
} // _Validate
@@ -937,9 +937,9 @@ internal ConstantEnumValueHandle(Handle handle) : this(handle._value)
internal ConstantEnumValueHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ConstantEnumValue || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ConstantEnumValue) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ConstantEnumValue || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ConstantEnumValue) << 25);
_Validate();
}
@@ -962,17 +962,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ConstantEnumValueHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ConstantEnumValue GetConstantEnumValue(MetadataReader reader)
=> new ConstantEnumValue(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ConstantEnumValue)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ConstantEnumValue)
throw new ArgumentException();
} // _Validate
@@ -1015,9 +1015,9 @@ internal ConstantHandleArrayHandle(Handle handle) : this(handle._value)
internal ConstantHandleArrayHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ConstantHandleArray || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ConstantHandleArray) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ConstantHandleArray || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ConstantHandleArray) << 25);
_Validate();
}
@@ -1040,17 +1040,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ConstantHandleArrayHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ConstantHandleArray GetConstantHandleArray(MetadataReader reader)
=> new ConstantHandleArray(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ConstantHandleArray)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ConstantHandleArray)
throw new ArgumentException();
} // _Validate
@@ -1093,9 +1093,9 @@ internal ConstantInt16ArrayHandle(Handle handle) : this(handle._value)
internal ConstantInt16ArrayHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ConstantInt16Array || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ConstantInt16Array) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ConstantInt16Array || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ConstantInt16Array) << 25);
_Validate();
}
@@ -1118,17 +1118,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ConstantInt16ArrayHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ConstantInt16Array GetConstantInt16Array(MetadataReader reader)
=> new ConstantInt16Array(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ConstantInt16Array)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ConstantInt16Array)
throw new ArgumentException();
} // _Validate
@@ -1171,9 +1171,9 @@ internal ConstantInt16ValueHandle(Handle handle) : this(handle._value)
internal ConstantInt16ValueHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ConstantInt16Value || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ConstantInt16Value) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ConstantInt16Value || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ConstantInt16Value) << 25);
_Validate();
}
@@ -1196,17 +1196,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ConstantInt16ValueHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ConstantInt16Value GetConstantInt16Value(MetadataReader reader)
=> new ConstantInt16Value(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ConstantInt16Value)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ConstantInt16Value)
throw new ArgumentException();
} // _Validate
@@ -1249,9 +1249,9 @@ internal ConstantInt32ArrayHandle(Handle handle) : this(handle._value)
internal ConstantInt32ArrayHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ConstantInt32Array || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ConstantInt32Array) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ConstantInt32Array || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ConstantInt32Array) << 25);
_Validate();
}
@@ -1274,17 +1274,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ConstantInt32ArrayHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ConstantInt32Array GetConstantInt32Array(MetadataReader reader)
=> new ConstantInt32Array(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ConstantInt32Array)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ConstantInt32Array)
throw new ArgumentException();
} // _Validate
@@ -1327,9 +1327,9 @@ internal ConstantInt32ValueHandle(Handle handle) : this(handle._value)
internal ConstantInt32ValueHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ConstantInt32Value || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ConstantInt32Value) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ConstantInt32Value || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ConstantInt32Value) << 25);
_Validate();
}
@@ -1352,17 +1352,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ConstantInt32ValueHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ConstantInt32Value GetConstantInt32Value(MetadataReader reader)
=> new ConstantInt32Value(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ConstantInt32Value)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ConstantInt32Value)
throw new ArgumentException();
} // _Validate
@@ -1405,9 +1405,9 @@ internal ConstantInt64ArrayHandle(Handle handle) : this(handle._value)
internal ConstantInt64ArrayHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ConstantInt64Array || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ConstantInt64Array) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ConstantInt64Array || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ConstantInt64Array) << 25);
_Validate();
}
@@ -1430,17 +1430,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ConstantInt64ArrayHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ConstantInt64Array GetConstantInt64Array(MetadataReader reader)
=> new ConstantInt64Array(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ConstantInt64Array)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ConstantInt64Array)
throw new ArgumentException();
} // _Validate
@@ -1483,9 +1483,9 @@ internal ConstantInt64ValueHandle(Handle handle) : this(handle._value)
internal ConstantInt64ValueHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ConstantInt64Value || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ConstantInt64Value) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ConstantInt64Value || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ConstantInt64Value) << 25);
_Validate();
}
@@ -1508,17 +1508,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ConstantInt64ValueHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ConstantInt64Value GetConstantInt64Value(MetadataReader reader)
=> new ConstantInt64Value(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ConstantInt64Value)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ConstantInt64Value)
throw new ArgumentException();
} // _Validate
@@ -1557,9 +1557,9 @@ internal ConstantReferenceValueHandle(Handle handle) : this(handle._value)
internal ConstantReferenceValueHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ConstantReferenceValue || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ConstantReferenceValue) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ConstantReferenceValue || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ConstantReferenceValue) << 25);
_Validate();
}
@@ -1582,17 +1582,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ConstantReferenceValueHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ConstantReferenceValue GetConstantReferenceValue(MetadataReader reader)
=> new ConstantReferenceValue(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ConstantReferenceValue)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ConstantReferenceValue)
throw new ArgumentException();
} // _Validate
@@ -1635,9 +1635,9 @@ internal ConstantSByteArrayHandle(Handle handle) : this(handle._value)
internal ConstantSByteArrayHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ConstantSByteArray || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ConstantSByteArray) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ConstantSByteArray || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ConstantSByteArray) << 25);
_Validate();
}
@@ -1660,17 +1660,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ConstantSByteArrayHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ConstantSByteArray GetConstantSByteArray(MetadataReader reader)
=> new ConstantSByteArray(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ConstantSByteArray)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ConstantSByteArray)
throw new ArgumentException();
} // _Validate
@@ -1713,9 +1713,9 @@ internal ConstantSByteValueHandle(Handle handle) : this(handle._value)
internal ConstantSByteValueHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ConstantSByteValue || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ConstantSByteValue) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ConstantSByteValue || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ConstantSByteValue) << 25);
_Validate();
}
@@ -1738,17 +1738,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ConstantSByteValueHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ConstantSByteValue GetConstantSByteValue(MetadataReader reader)
=> new ConstantSByteValue(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ConstantSByteValue)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ConstantSByteValue)
throw new ArgumentException();
} // _Validate
@@ -1791,9 +1791,9 @@ internal ConstantSingleArrayHandle(Handle handle) : this(handle._value)
internal ConstantSingleArrayHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ConstantSingleArray || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ConstantSingleArray) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ConstantSingleArray || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ConstantSingleArray) << 25);
_Validate();
}
@@ -1816,17 +1816,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ConstantSingleArrayHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ConstantSingleArray GetConstantSingleArray(MetadataReader reader)
=> new ConstantSingleArray(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ConstantSingleArray)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ConstantSingleArray)
throw new ArgumentException();
} // _Validate
@@ -1869,9 +1869,9 @@ internal ConstantSingleValueHandle(Handle handle) : this(handle._value)
internal ConstantSingleValueHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ConstantSingleValue || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ConstantSingleValue) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ConstantSingleValue || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ConstantSingleValue) << 25);
_Validate();
}
@@ -1894,17 +1894,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ConstantSingleValueHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ConstantSingleValue GetConstantSingleValue(MetadataReader reader)
=> new ConstantSingleValue(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ConstantSingleValue)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ConstantSingleValue)
throw new ArgumentException();
} // _Validate
@@ -1948,9 +1948,9 @@ internal ConstantStringArrayHandle(Handle handle) : this(handle._value)
internal ConstantStringArrayHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ConstantStringArray || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ConstantStringArray) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ConstantStringArray || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ConstantStringArray) << 25);
_Validate();
}
@@ -1973,17 +1973,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ConstantStringArrayHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ConstantStringArray GetConstantStringArray(MetadataReader reader)
=> new ConstantStringArray(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ConstantStringArray)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ConstantStringArray)
throw new ArgumentException();
} // _Validate
@@ -2028,9 +2028,9 @@ internal ConstantStringValueHandle(Handle handle) : this(handle._value)
internal ConstantStringValueHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ConstantStringValue || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ConstantStringValue) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ConstantStringValue || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ConstantStringValue) << 25);
_Validate();
}
@@ -2053,17 +2053,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ConstantStringValueHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ConstantStringValue GetConstantStringValue(MetadataReader reader)
=> new ConstantStringValue(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ConstantStringValue)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ConstantStringValue)
throw new ArgumentException();
} // _Validate
@@ -2106,9 +2106,9 @@ internal ConstantUInt16ArrayHandle(Handle handle) : this(handle._value)
internal ConstantUInt16ArrayHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ConstantUInt16Array || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ConstantUInt16Array) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ConstantUInt16Array || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ConstantUInt16Array) << 25);
_Validate();
}
@@ -2131,17 +2131,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ConstantUInt16ArrayHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ConstantUInt16Array GetConstantUInt16Array(MetadataReader reader)
=> new ConstantUInt16Array(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ConstantUInt16Array)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ConstantUInt16Array)
throw new ArgumentException();
} // _Validate
@@ -2184,9 +2184,9 @@ internal ConstantUInt16ValueHandle(Handle handle) : this(handle._value)
internal ConstantUInt16ValueHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ConstantUInt16Value || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ConstantUInt16Value) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ConstantUInt16Value || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ConstantUInt16Value) << 25);
_Validate();
}
@@ -2209,17 +2209,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ConstantUInt16ValueHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ConstantUInt16Value GetConstantUInt16Value(MetadataReader reader)
=> new ConstantUInt16Value(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ConstantUInt16Value)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ConstantUInt16Value)
throw new ArgumentException();
} // _Validate
@@ -2262,9 +2262,9 @@ internal ConstantUInt32ArrayHandle(Handle handle) : this(handle._value)
internal ConstantUInt32ArrayHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ConstantUInt32Array || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ConstantUInt32Array) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ConstantUInt32Array || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ConstantUInt32Array) << 25);
_Validate();
}
@@ -2287,17 +2287,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ConstantUInt32ArrayHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ConstantUInt32Array GetConstantUInt32Array(MetadataReader reader)
=> new ConstantUInt32Array(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ConstantUInt32Array)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ConstantUInt32Array)
throw new ArgumentException();
} // _Validate
@@ -2340,9 +2340,9 @@ internal ConstantUInt32ValueHandle(Handle handle) : this(handle._value)
internal ConstantUInt32ValueHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ConstantUInt32Value || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ConstantUInt32Value) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ConstantUInt32Value || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ConstantUInt32Value) << 25);
_Validate();
}
@@ -2365,17 +2365,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ConstantUInt32ValueHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ConstantUInt32Value GetConstantUInt32Value(MetadataReader reader)
=> new ConstantUInt32Value(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ConstantUInt32Value)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ConstantUInt32Value)
throw new ArgumentException();
} // _Validate
@@ -2418,9 +2418,9 @@ internal ConstantUInt64ArrayHandle(Handle handle) : this(handle._value)
internal ConstantUInt64ArrayHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ConstantUInt64Array || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ConstantUInt64Array) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ConstantUInt64Array || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ConstantUInt64Array) << 25);
_Validate();
}
@@ -2443,17 +2443,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ConstantUInt64ArrayHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ConstantUInt64Array GetConstantUInt64Array(MetadataReader reader)
=> new ConstantUInt64Array(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ConstantUInt64Array)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ConstantUInt64Array)
throw new ArgumentException();
} // _Validate
@@ -2496,9 +2496,9 @@ internal ConstantUInt64ValueHandle(Handle handle) : this(handle._value)
internal ConstantUInt64ValueHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ConstantUInt64Value || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ConstantUInt64Value) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ConstantUInt64Value || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ConstantUInt64Value) << 25);
_Validate();
}
@@ -2521,17 +2521,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ConstantUInt64ValueHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ConstantUInt64Value GetConstantUInt64Value(MetadataReader reader)
=> new ConstantUInt64Value(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ConstantUInt64Value)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ConstantUInt64Value)
throw new ArgumentException();
} // _Validate
@@ -2584,9 +2584,9 @@ internal CustomAttributeHandle(Handle handle) : this(handle._value)
internal CustomAttributeHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.CustomAttribute || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.CustomAttribute) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.CustomAttribute || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.CustomAttribute) << 25);
_Validate();
}
@@ -2609,17 +2609,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(CustomAttributeHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public CustomAttribute GetCustomAttribute(MetadataReader reader)
=> new CustomAttribute(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.CustomAttribute)
+ if ((HandleType)((uint)_value >> 25) != HandleType.CustomAttribute)
throw new ArgumentException();
} // _Validate
@@ -2679,9 +2679,9 @@ internal EventHandle(Handle handle) : this(handle._value)
internal EventHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.Event || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.Event) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.Event || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.Event) << 25);
_Validate();
}
@@ -2704,17 +2704,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(EventHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public Event GetEvent(MetadataReader reader)
=> new Event(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.Event)
+ if ((HandleType)((uint)_value >> 25) != HandleType.Event)
throw new ArgumentException();
} // _Validate
@@ -2778,9 +2778,9 @@ internal FieldHandle(Handle handle) : this(handle._value)
internal FieldHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.Field || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.Field) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.Field || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.Field) << 25);
_Validate();
}
@@ -2803,17 +2803,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(FieldHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public Field GetField(MetadataReader reader)
=> new Field(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.Field)
+ if ((HandleType)((uint)_value >> 25) != HandleType.Field)
throw new ArgumentException();
} // _Validate
@@ -2857,9 +2857,9 @@ internal FieldSignatureHandle(Handle handle) : this(handle._value)
internal FieldSignatureHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.FieldSignature || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.FieldSignature) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.FieldSignature || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.FieldSignature) << 25);
_Validate();
}
@@ -2882,17 +2882,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(FieldSignatureHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public FieldSignature GetFieldSignature(MetadataReader reader)
=> new FieldSignature(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.FieldSignature)
+ if ((HandleType)((uint)_value >> 25) != HandleType.FieldSignature)
throw new ArgumentException();
} // _Validate
@@ -2935,9 +2935,9 @@ internal FunctionPointerSignatureHandle(Handle handle) : this(handle._value)
internal FunctionPointerSignatureHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.FunctionPointerSignature || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.FunctionPointerSignature) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.FunctionPointerSignature || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.FunctionPointerSignature) << 25);
_Validate();
}
@@ -2960,17 +2960,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(FunctionPointerSignatureHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public FunctionPointerSignature GetFunctionPointerSignature(MetadataReader reader)
=> new FunctionPointerSignature(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.FunctionPointerSignature)
+ if ((HandleType)((uint)_value >> 25) != HandleType.FunctionPointerSignature)
throw new ArgumentException();
} // _Validate
@@ -3034,9 +3034,9 @@ internal GenericParameterHandle(Handle handle) : this(handle._value)
internal GenericParameterHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.GenericParameter || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.GenericParameter) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.GenericParameter || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.GenericParameter) << 25);
_Validate();
}
@@ -3059,17 +3059,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(GenericParameterHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public GenericParameter GetGenericParameter(MetadataReader reader)
=> new GenericParameter(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.GenericParameter)
+ if ((HandleType)((uint)_value >> 25) != HandleType.GenericParameter)
throw new ArgumentException();
} // _Validate
@@ -3122,9 +3122,9 @@ internal MemberReferenceHandle(Handle handle) : this(handle._value)
internal MemberReferenceHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.MemberReference || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.MemberReference) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.MemberReference || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.MemberReference) << 25);
_Validate();
}
@@ -3147,17 +3147,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(MemberReferenceHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public MemberReference GetMemberReference(MetadataReader reader)
=> new MemberReference(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.MemberReference)
+ if ((HandleType)((uint)_value >> 25) != HandleType.MemberReference)
throw new ArgumentException();
} // _Validate
@@ -3224,9 +3224,9 @@ internal MethodHandle(Handle handle) : this(handle._value)
internal MethodHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.Method || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.Method) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.Method || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.Method) << 25);
_Validate();
}
@@ -3249,17 +3249,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(MethodHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public Method GetMethod(MetadataReader reader)
=> new Method(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.Method)
+ if ((HandleType)((uint)_value >> 25) != HandleType.Method)
throw new ArgumentException();
} // _Validate
@@ -3308,9 +3308,9 @@ internal MethodInstantiationHandle(Handle handle) : this(handle._value)
internal MethodInstantiationHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.MethodInstantiation || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.MethodInstantiation) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.MethodInstantiation || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.MethodInstantiation) << 25);
_Validate();
}
@@ -3333,17 +3333,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(MethodInstantiationHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public MethodInstantiation GetMethodInstantiation(MetadataReader reader)
=> new MethodInstantiation(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.MethodInstantiation)
+ if ((HandleType)((uint)_value >> 25) != HandleType.MethodInstantiation)
throw new ArgumentException();
} // _Validate
@@ -3390,9 +3390,9 @@ internal MethodSemanticsHandle(Handle handle) : this(handle._value)
internal MethodSemanticsHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.MethodSemantics || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.MethodSemantics) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.MethodSemantics || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.MethodSemantics) << 25);
_Validate();
}
@@ -3415,17 +3415,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(MethodSemanticsHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public MethodSemantics GetMethodSemantics(MetadataReader reader)
=> new MethodSemantics(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.MethodSemantics)
+ if ((HandleType)((uint)_value >> 25) != HandleType.MethodSemantics)
throw new ArgumentException();
} // _Validate
@@ -3487,9 +3487,9 @@ internal MethodSignatureHandle(Handle handle) : this(handle._value)
internal MethodSignatureHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.MethodSignature || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.MethodSignature) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.MethodSignature || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.MethodSignature) << 25);
_Validate();
}
@@ -3512,17 +3512,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(MethodSignatureHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public MethodSignature GetMethodSignature(MetadataReader reader)
=> new MethodSignature(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.MethodSignature)
+ if ((HandleType)((uint)_value >> 25) != HandleType.MethodSignature)
throw new ArgumentException();
} // _Validate
@@ -3565,9 +3565,9 @@ internal MethodTypeVariableSignatureHandle(Handle handle) : this(handle._value)
internal MethodTypeVariableSignatureHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.MethodTypeVariableSignature || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.MethodTypeVariableSignature) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.MethodTypeVariableSignature || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.MethodTypeVariableSignature) << 25);
_Validate();
}
@@ -3590,17 +3590,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(MethodTypeVariableSignatureHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public MethodTypeVariableSignature GetMethodTypeVariableSignature(MetadataReader reader)
=> new MethodTypeVariableSignature(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.MethodTypeVariableSignature)
+ if ((HandleType)((uint)_value >> 25) != HandleType.MethodTypeVariableSignature)
throw new ArgumentException();
} // _Validate
@@ -3653,9 +3653,9 @@ internal ModifiedTypeHandle(Handle handle) : this(handle._value)
internal ModifiedTypeHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ModifiedType || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ModifiedType) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ModifiedType || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ModifiedType) << 25);
_Validate();
}
@@ -3678,17 +3678,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ModifiedTypeHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ModifiedType GetModifiedType(MetadataReader reader)
=> new ModifiedType(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ModifiedType)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ModifiedType)
throw new ArgumentException();
} // _Validate
@@ -3745,9 +3745,9 @@ internal NamedArgumentHandle(Handle handle) : this(handle._value)
internal NamedArgumentHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.NamedArgument || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.NamedArgument) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.NamedArgument || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.NamedArgument) << 25);
_Validate();
}
@@ -3770,17 +3770,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(NamedArgumentHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public NamedArgument GetNamedArgument(MetadataReader reader)
=> new NamedArgument(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.NamedArgument)
+ if ((HandleType)((uint)_value >> 25) != HandleType.NamedArgument)
throw new ArgumentException();
} // _Validate
@@ -3840,9 +3840,9 @@ internal NamespaceDefinitionHandle(Handle handle) : this(handle._value)
internal NamespaceDefinitionHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.NamespaceDefinition || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.NamespaceDefinition) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.NamespaceDefinition || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.NamespaceDefinition) << 25);
_Validate();
}
@@ -3865,17 +3865,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(NamespaceDefinitionHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public NamespaceDefinition GetNamespaceDefinition(MetadataReader reader)
=> new NamespaceDefinition(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.NamespaceDefinition)
+ if ((HandleType)((uint)_value >> 25) != HandleType.NamespaceDefinition)
throw new ArgumentException();
} // _Validate
@@ -3923,9 +3923,9 @@ internal NamespaceReferenceHandle(Handle handle) : this(handle._value)
internal NamespaceReferenceHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.NamespaceReference || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.NamespaceReference) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.NamespaceReference || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.NamespaceReference) << 25);
_Validate();
}
@@ -3948,17 +3948,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(NamespaceReferenceHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public NamespaceReference GetNamespaceReference(MetadataReader reader)
=> new NamespaceReference(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.NamespaceReference)
+ if ((HandleType)((uint)_value >> 25) != HandleType.NamespaceReference)
throw new ArgumentException();
} // _Validate
@@ -4018,9 +4018,9 @@ internal ParameterHandle(Handle handle) : this(handle._value)
internal ParameterHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.Parameter || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.Parameter) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.Parameter || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.Parameter) << 25);
_Validate();
}
@@ -4043,17 +4043,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ParameterHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public Parameter GetParameter(MetadataReader reader)
=> new Parameter(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.Parameter)
+ if ((HandleType)((uint)_value >> 25) != HandleType.Parameter)
throw new ArgumentException();
} // _Validate
@@ -4097,9 +4097,9 @@ internal PointerSignatureHandle(Handle handle) : this(handle._value)
internal PointerSignatureHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.PointerSignature || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.PointerSignature) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.PointerSignature || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.PointerSignature) << 25);
_Validate();
}
@@ -4122,17 +4122,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(PointerSignatureHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public PointerSignature GetPointerSignature(MetadataReader reader)
=> new PointerSignature(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.PointerSignature)
+ if ((HandleType)((uint)_value >> 25) != HandleType.PointerSignature)
throw new ArgumentException();
} // _Validate
@@ -4196,9 +4196,9 @@ internal PropertyHandle(Handle handle) : this(handle._value)
internal PropertyHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.Property || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.Property) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.Property || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.Property) << 25);
_Validate();
}
@@ -4221,17 +4221,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(PropertyHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public Property GetProperty(MetadataReader reader)
=> new Property(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.Property)
+ if ((HandleType)((uint)_value >> 25) != HandleType.Property)
throw new ArgumentException();
} // _Validate
@@ -4284,9 +4284,9 @@ internal PropertySignatureHandle(Handle handle) : this(handle._value)
internal PropertySignatureHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.PropertySignature || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.PropertySignature) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.PropertySignature || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.PropertySignature) << 25);
_Validate();
}
@@ -4309,17 +4309,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(PropertySignatureHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public PropertySignature GetPropertySignature(MetadataReader reader)
=> new PropertySignature(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.PropertySignature)
+ if ((HandleType)((uint)_value >> 25) != HandleType.PropertySignature)
throw new ArgumentException();
} // _Validate
@@ -4366,9 +4366,9 @@ internal QualifiedFieldHandle(Handle handle) : this(handle._value)
internal QualifiedFieldHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.QualifiedField || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.QualifiedField) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.QualifiedField || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.QualifiedField) << 25);
_Validate();
}
@@ -4391,17 +4391,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(QualifiedFieldHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public QualifiedField GetQualifiedField(MetadataReader reader)
=> new QualifiedField(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.QualifiedField)
+ if ((HandleType)((uint)_value >> 25) != HandleType.QualifiedField)
throw new ArgumentException();
} // _Validate
@@ -4448,9 +4448,9 @@ internal QualifiedMethodHandle(Handle handle) : this(handle._value)
internal QualifiedMethodHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.QualifiedMethod || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.QualifiedMethod) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.QualifiedMethod || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.QualifiedMethod) << 25);
_Validate();
}
@@ -4473,17 +4473,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(QualifiedMethodHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public QualifiedMethod GetQualifiedMethod(MetadataReader reader)
=> new QualifiedMethod(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.QualifiedMethod)
+ if ((HandleType)((uint)_value >> 25) != HandleType.QualifiedMethod)
throw new ArgumentException();
} // _Validate
@@ -4527,9 +4527,9 @@ internal SZArraySignatureHandle(Handle handle) : this(handle._value)
internal SZArraySignatureHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.SZArraySignature || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.SZArraySignature) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.SZArraySignature || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.SZArraySignature) << 25);
_Validate();
}
@@ -4552,17 +4552,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(SZArraySignatureHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public SZArraySignature GetSZArraySignature(MetadataReader reader)
=> new SZArraySignature(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.SZArraySignature)
+ if ((HandleType)((uint)_value >> 25) != HandleType.SZArraySignature)
throw new ArgumentException();
} // _Validate
@@ -4665,9 +4665,9 @@ internal ScopeDefinitionHandle(Handle handle) : this(handle._value)
internal ScopeDefinitionHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ScopeDefinition || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ScopeDefinition) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ScopeDefinition || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ScopeDefinition) << 25);
_Validate();
}
@@ -4690,17 +4690,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ScopeDefinitionHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ScopeDefinition GetScopeDefinition(MetadataReader reader)
=> new ScopeDefinition(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ScopeDefinition)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ScopeDefinition)
throw new ArgumentException();
} // _Validate
@@ -4771,9 +4771,9 @@ internal ScopeReferenceHandle(Handle handle) : this(handle._value)
internal ScopeReferenceHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.ScopeReference || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.ScopeReference) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.ScopeReference || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.ScopeReference) << 25);
_Validate();
}
@@ -4796,17 +4796,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(ScopeReferenceHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public ScopeReference GetScopeReference(MetadataReader reader)
=> new ScopeReference(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.ScopeReference)
+ if ((HandleType)((uint)_value >> 25) != HandleType.ScopeReference)
throw new ArgumentException();
} // _Validate
@@ -4907,9 +4907,9 @@ internal TypeDefinitionHandle(Handle handle) : this(handle._value)
internal TypeDefinitionHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.TypeDefinition || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.TypeDefinition) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.TypeDefinition || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.TypeDefinition) << 25);
_Validate();
}
@@ -4932,17 +4932,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(TypeDefinitionHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public TypeDefinition GetTypeDefinition(MetadataReader reader)
=> new TypeDefinition(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.TypeDefinition)
+ if ((HandleType)((uint)_value >> 25) != HandleType.TypeDefinition)
throw new ArgumentException();
} // _Validate
@@ -4993,9 +4993,9 @@ internal TypeForwarderHandle(Handle handle) : this(handle._value)
internal TypeForwarderHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.TypeForwarder || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.TypeForwarder) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.TypeForwarder || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.TypeForwarder) << 25);
_Validate();
}
@@ -5018,17 +5018,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(TypeForwarderHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public TypeForwarder GetTypeForwarder(MetadataReader reader)
=> new TypeForwarder(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.TypeForwarder)
+ if ((HandleType)((uint)_value >> 25) != HandleType.TypeForwarder)
throw new ArgumentException();
} // _Validate
@@ -5077,9 +5077,9 @@ internal TypeInstantiationSignatureHandle(Handle handle) : this(handle._value)
internal TypeInstantiationSignatureHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.TypeInstantiationSignature || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.TypeInstantiationSignature) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.TypeInstantiationSignature || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.TypeInstantiationSignature) << 25);
_Validate();
}
@@ -5102,17 +5102,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(TypeInstantiationSignatureHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public TypeInstantiationSignature GetTypeInstantiationSignature(MetadataReader reader)
=> new TypeInstantiationSignature(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.TypeInstantiationSignature)
+ if ((HandleType)((uint)_value >> 25) != HandleType.TypeInstantiationSignature)
throw new ArgumentException();
} // _Validate
@@ -5160,9 +5160,9 @@ internal TypeReferenceHandle(Handle handle) : this(handle._value)
internal TypeReferenceHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.TypeReference || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.TypeReference) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.TypeReference || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.TypeReference) << 25);
_Validate();
}
@@ -5185,17 +5185,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(TypeReferenceHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public TypeReference GetTypeReference(MetadataReader reader)
=> new TypeReference(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.TypeReference)
+ if ((HandleType)((uint)_value >> 25) != HandleType.TypeReference)
throw new ArgumentException();
} // _Validate
@@ -5239,9 +5239,9 @@ internal TypeSpecificationHandle(Handle handle) : this(handle._value)
internal TypeSpecificationHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.TypeSpecification || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.TypeSpecification) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.TypeSpecification || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.TypeSpecification) << 25);
_Validate();
}
@@ -5264,17 +5264,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(TypeSpecificationHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public TypeSpecification GetTypeSpecification(MetadataReader reader)
=> new TypeSpecification(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.TypeSpecification)
+ if ((HandleType)((uint)_value >> 25) != HandleType.TypeSpecification)
throw new ArgumentException();
} // _Validate
@@ -5317,9 +5317,9 @@ internal TypeVariableSignatureHandle(Handle handle) : this(handle._value)
internal TypeVariableSignatureHandle(int value)
{
- HandleType hType = (HandleType)(value >> 24);
- Debug.Assert(hType == 0 || hType == HandleType.TypeVariableSignature || hType == HandleType.Null);
- _value = (value & 0x00FFFFFF) | (((int)HandleType.TypeVariableSignature) << 24);
+ HandleType hType = (HandleType)((uint)value >> 25);
+ Debug.Assert(hType == HandleType.TypeVariableSignature || hType == HandleType.Null);
+ _value = (value & 0x01FFFFFF) | (((int)HandleType.TypeVariableSignature) << 25);
_Validate();
}
@@ -5342,17 +5342,17 @@ public override bool Equals(object obj)
public static implicit operator Handle(TypeVariableSignatureHandle handle)
=> new Handle(handle._value);
- internal int Offset => (_value & 0x00FFFFFF);
+ internal int Offset => (_value & 0x01FFFFFF);
public TypeVariableSignature GetTypeVariableSignature(MetadataReader reader)
=> new TypeVariableSignature(reader, this);
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
[System.Diagnostics.Conditional("DEBUG")]
internal void _Validate()
{
- if ((HandleType)((_value & 0xFF000000) >> 24) != HandleType.TypeVariableSignature)
+ if ((HandleType)((uint)_value >> 25) != HandleType.TypeVariableSignature)
throw new ArgumentException();
} // _Validate
diff --git a/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/NativeMetadataReader.cs b/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/NativeMetadataReader.cs
index 91c7b47d3c69c6..39d22fa8d2dd71 100644
--- a/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/NativeMetadataReader.cs
+++ b/src/coreclr/tools/Common/Internal/Metadata/NativeFormat/NativeMetadataReader.cs
@@ -89,7 +89,7 @@ internal Handle(int value)
internal void Validate(params HandleType[] permittedTypes)
{
- var myHandleType = (HandleType)(_value >> 24);
+ var myHandleType = (HandleType)((uint)_value >> 25);
foreach (var hType in permittedTypes)
{
if (myHandleType == hType)
@@ -106,14 +106,14 @@ internal void Validate(params HandleType[] permittedTypes)
public Handle(HandleType type, int offset)
{
- _value = (int)type << 24 | (int)offset;
+ _value = (int)type << 25 | (int)offset;
}
- public HandleType HandleType => (HandleType)(_value >> 24);
+ public HandleType HandleType => (HandleType)((uint)_value >> 25);
- internal int Offset => _value & 0x00FFFFFF;
+ internal int Offset => _value & 0x01FFFFFF;
- public bool IsNil => (_value & 0x00FFFFFF) == 0;
+ public bool IsNil => (_value & 0x01FFFFFF) == 0;
public int ToIntToken() => _value;
@@ -194,7 +194,7 @@ public Handle NullHandle
{
get
{
- return new Handle(((int)HandleType.Null) << 24);
+ return new Handle(((int)HandleType.Null) << 25);
}
}
diff --git a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs
index 5ac150b37ec474..c635b416708be2 100644
--- a/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs
+++ b/src/coreclr/tools/Common/JitInterface/CorInfoImpl.cs
@@ -1117,9 +1117,9 @@ private uint getMethodAttribsInternal(MethodDesc method)
// TODO: Cache inlining hits
// Check for an inlining directive.
- if (method.IsNoInlining)
+ if (method.IsNoInlining || method.IsNoOptimization)
{
- /* Function marked as not inlineable */
+ // NoOptimization implies NoInlining.
result |= CorInfoFlag.CORINFO_FLG_DONT_INLINE;
}
else if (method.IsAggressiveInlining)
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_ARM/ARMReadyToRunHelperNode.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_ARM/ARMReadyToRunHelperNode.cs
index 17ba30882e7d5f..b531ea2a02ac2e 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_ARM/ARMReadyToRunHelperNode.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_ARM/ARMReadyToRunHelperNode.cs
@@ -21,24 +21,17 @@ protected override void EmitCode(NodeFactory factory, ref ARMEmitter encoder, bo
{
MetadataType target = (MetadataType)Target;
bool hasLazyStaticConstructor = factory.PreinitializationManager.HasLazyStaticConstructor(target);
- encoder.EmitMOV(encoder.TargetRegister.Result, factory.TypeNonGCStaticsSymbol(target));
if (!hasLazyStaticConstructor)
{
+ encoder.EmitMOV(encoder.TargetRegister.Result, factory.TypeNonGCStaticsSymbol(target));
encoder.EmitRET();
}
else
{
- // We need to trigger the cctor before returning the base. It is stored at the beginning of the non-GC statics region.
- encoder.EmitMOV(encoder.TargetRegister.Arg2, factory.TypeNonGCStaticsSymbol(target));
- encoder.EmitLDR(encoder.TargetRegister.Arg3, encoder.TargetRegister.Arg2,
- (short)-NonGCStaticsNode.GetClassConstructorContextSize(factory.Target));
- encoder.EmitDMB();
- encoder.EmitCMP(encoder.TargetRegister.Arg3, 0);
- encoder.EmitRETIfEqual();
-
- encoder.EmitMOV(encoder.TargetRegister.Arg1, encoder.TargetRegister.Result);
- encoder.EmitMOV(encoder.TargetRegister.Arg0/*Result*/, encoder.TargetRegister.Arg2);
+ // The fast path check is not necessary. It is always expanded by RyuJIT.
+ encoder.EmitMOV(encoder.TargetRegister.Arg1, factory.TypeNonGCStaticsSymbol(target));
+ encoder.EmitMOV(encoder.TargetRegister.Arg0/*Result*/, encoder.TargetRegister.Arg1);
encoder.EmitSUB(encoder.TargetRegister.Arg0, NonGCStaticsNode.GetClassConstructorContextSize(factory.Target));
encoder.EmitJMP(factory.HelperEntrypoint(HelperEntrypoint.EnsureClassConstructorRunAndReturnNonGCStaticBase));
}
@@ -76,23 +69,16 @@ protected override void EmitCode(NodeFactory factory, ref ARMEmitter encoder, bo
{
MetadataType target = (MetadataType)Target;
encoder.EmitMOV(encoder.TargetRegister.Result, factory.TypeGCStaticsSymbol(target));
- encoder.EmitLDR(encoder.TargetRegister.Result, encoder.TargetRegister.Result);
if (!factory.PreinitializationManager.HasLazyStaticConstructor(target))
{
+ encoder.EmitLDR(encoder.TargetRegister.Result, encoder.TargetRegister.Result);
encoder.EmitRET();
}
else
{
- // We need to trigger the cctor before returning the base. It is stored at the beginning of the non-GC statics region.
- encoder.EmitMOV(encoder.TargetRegister.Arg2, factory.TypeNonGCStaticsSymbol(target));
- encoder.EmitLDR(encoder.TargetRegister.Arg3, encoder.TargetRegister.Arg2,
- (short)-NonGCStaticsNode.GetClassConstructorContextSize(factory.Target));
- encoder.EmitDMB();
- encoder.EmitCMP(encoder.TargetRegister.Arg3, 0);
- encoder.EmitRETIfEqual();
-
- encoder.EmitMOV(encoder.TargetRegister.Arg1, encoder.TargetRegister.Result);
- encoder.EmitMOV(encoder.TargetRegister.Arg0/*Result*/, encoder.TargetRegister.Arg2);
+ // The fast path check is not necessary. It is always expanded by RyuJIT.
+ encoder.EmitLDR(encoder.TargetRegister.Arg1, encoder.TargetRegister.Result);
+ encoder.EmitMOV(encoder.TargetRegister.Arg0, factory.TypeNonGCStaticsSymbol(target));
encoder.EmitSUB(encoder.TargetRegister.Arg0, NonGCStaticsNode.GetClassConstructorContextSize(factory.Target));
encoder.EmitJMP(factory.HelperEntrypoint(HelperEntrypoint.EnsureClassConstructorRunAndReturnGCStaticBase));
}
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_ARM64/ARM64ReadyToRunHelperNode.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_ARM64/ARM64ReadyToRunHelperNode.cs
index bfcea10d71d33c..ec39613a7932f3 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_ARM64/ARM64ReadyToRunHelperNode.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_ARM64/ARM64ReadyToRunHelperNode.cs
@@ -23,23 +23,17 @@ protected override void EmitCode(NodeFactory factory, ref ARM64Emitter encoder,
MetadataType target = (MetadataType)Target;
bool hasLazyStaticConstructor = factory.PreinitializationManager.HasLazyStaticConstructor(target);
- encoder.EmitMOV(encoder.TargetRegister.Result, factory.TypeNonGCStaticsSymbol(target));
if (!hasLazyStaticConstructor)
{
+ encoder.EmitMOV(encoder.TargetRegister.Result, factory.TypeNonGCStaticsSymbol(target));
encoder.EmitRET();
}
else
{
- // We need to trigger the cctor before returning the base. It is stored at the beginning of the non-GC statics region.
- encoder.EmitSUB(encoder.TargetRegister.Arg3, encoder.TargetRegister.Result, NonGCStaticsNode.GetClassConstructorContextSize(factory.Target));
- encoder.EmitLDAR(encoder.TargetRegister.Arg2, encoder.TargetRegister.Arg3);
- encoder.EmitCMP(encoder.TargetRegister.Arg2, 0);
- encoder.EmitRETIfEqual();
-
- encoder.EmitMOV(encoder.TargetRegister.Arg1, encoder.TargetRegister.Result);
- encoder.EmitMOV(encoder.TargetRegister.Arg0, encoder.TargetRegister.Arg3);
-
+ // The fast path check is not necessary. It is always expanded by RyuJIT.
+ encoder.EmitMOV(encoder.TargetRegister.Arg1, factory.TypeNonGCStaticsSymbol(target));
+ encoder.EmitSUB(encoder.TargetRegister.Arg0, encoder.TargetRegister.Arg1, NonGCStaticsNode.GetClassConstructorContextSize(factory.Target));
encoder.EmitJMP(factory.HelperEntrypoint(HelperEntrypoint.EnsureClassConstructorRunAndReturnNonGCStaticBase));
}
}
@@ -90,24 +84,18 @@ protected override void EmitCode(NodeFactory factory, ref ARM64Emitter encoder,
MetadataType target = (MetadataType)Target;
encoder.EmitMOV(encoder.TargetRegister.Result, factory.TypeGCStaticsSymbol(target));
- encoder.EmitLDR(encoder.TargetRegister.Result, encoder.TargetRegister.Result);
if (!factory.PreinitializationManager.HasLazyStaticConstructor(target))
{
+ encoder.EmitLDR(encoder.TargetRegister.Result, encoder.TargetRegister.Result);
encoder.EmitRET();
}
else
{
- // We need to trigger the cctor before returning the base. It is stored at the beginning of the non-GC statics region.
- encoder.EmitMOV(encoder.TargetRegister.Arg2, factory.TypeNonGCStaticsSymbol(target));
- encoder.EmitSUB(encoder.TargetRegister.Arg2, NonGCStaticsNode.GetClassConstructorContextSize(factory.Target));
- encoder.EmitLDAR(encoder.TargetRegister.Arg3, encoder.TargetRegister.Arg2);
- encoder.EmitCMP(encoder.TargetRegister.Arg3, 0);
- encoder.EmitRETIfEqual();
-
- encoder.EmitMOV(encoder.TargetRegister.Arg1, encoder.TargetRegister.Result);
- encoder.EmitMOV(encoder.TargetRegister.Arg0, encoder.TargetRegister.Arg2);
-
+ // The fast path check is not necessary. It is always expanded by RyuJIT.
+ encoder.EmitLDR(encoder.TargetRegister.Arg1, encoder.TargetRegister.Result);
+ encoder.EmitMOV(encoder.TargetRegister.Arg0, factory.TypeNonGCStaticsSymbol(target));
+ encoder.EmitSUB(encoder.TargetRegister.Arg0, NonGCStaticsNode.GetClassConstructorContextSize(factory.Target));
encoder.EmitJMP(factory.HelperEntrypoint(HelperEntrypoint.EnsureClassConstructorRunAndReturnGCStaticBase));
}
}
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_LoongArch64/LoongArch64ReadyToRunHelperNode.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_LoongArch64/LoongArch64ReadyToRunHelperNode.cs
index fee267399ecd7f..f4a80e9be0b571 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_LoongArch64/LoongArch64ReadyToRunHelperNode.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_LoongArch64/LoongArch64ReadyToRunHelperNode.cs
@@ -23,24 +23,17 @@ protected override void EmitCode(NodeFactory factory, ref LoongArch64Emitter enc
MetadataType target = (MetadataType)Target;
bool hasLazyStaticConstructor = factory.PreinitializationManager.HasLazyStaticConstructor(target);
- encoder.EmitMOV(encoder.TargetRegister.Result, factory.TypeNonGCStaticsSymbol(target));
if (!hasLazyStaticConstructor)
{
+ encoder.EmitMOV(encoder.TargetRegister.Result, factory.TypeNonGCStaticsSymbol(target));
encoder.EmitRET();
}
else
{
- // We need to trigger the cctor before returning the base. It is stored at the beginning of the non-GC statics region.
- encoder.EmitADD(encoder.TargetRegister.Arg3, encoder.TargetRegister.Result, -NonGCStaticsNode.GetClassConstructorContextSize(factory.Target));
- encoder.EmitLD(encoder.TargetRegister.Arg2, encoder.TargetRegister.Arg3, factory.Target.PointerSize);
- encoder.EmitDBAR();
- encoder.EmitXOR(encoder.TargetRegister.IntraProcedureCallScratch1, encoder.TargetRegister.Arg2, 1);
- encoder.EmitRETIfEqual(encoder.TargetRegister.IntraProcedureCallScratch1);
-
- encoder.EmitMOV(encoder.TargetRegister.Arg1, encoder.TargetRegister.Result);
- encoder.EmitMOV(encoder.TargetRegister.Arg0, encoder.TargetRegister.Arg3);
-
+ // The fast path check is not necessary. It is always expanded by RyuJIT.
+ encoder.EmitMOV(encoder.TargetRegister.Arg1, factory.TypeNonGCStaticsSymbol(target));
+ encoder.EmitADD(encoder.TargetRegister.Arg0, encoder.TargetRegister.Arg1, -NonGCStaticsNode.GetClassConstructorContextSize(factory.Target));
encoder.EmitJMP(factory.HelperEntrypoint(HelperEntrypoint.EnsureClassConstructorRunAndReturnNonGCStaticBase));
}
}
@@ -83,25 +76,18 @@ protected override void EmitCode(NodeFactory factory, ref LoongArch64Emitter enc
MetadataType target = (MetadataType)Target;
encoder.EmitMOV(encoder.TargetRegister.Result, factory.TypeGCStaticsSymbol(target));
- encoder.EmitLD(encoder.TargetRegister.Result, encoder.TargetRegister.Result, 0);
if (!factory.PreinitializationManager.HasLazyStaticConstructor(target))
{
+ encoder.EmitLD(encoder.TargetRegister.Result, encoder.TargetRegister.Result, 0);
encoder.EmitRET();
}
else
{
- // We need to trigger the cctor before returning the base. It is stored at the beginning of the non-GC statics region.
- encoder.EmitMOV(encoder.TargetRegister.Arg2, factory.TypeNonGCStaticsSymbol(target));
- encoder.EmitADD(encoder.TargetRegister.Arg2, encoder.TargetRegister.Arg2, -NonGCStaticsNode.GetClassConstructorContextSize(factory.Target));
- encoder.EmitLD(encoder.TargetRegister.Arg3, encoder.TargetRegister.Arg2, 0);
- encoder.EmitDBAR();
- encoder.EmitXOR(encoder.TargetRegister.IntraProcedureCallScratch1, encoder.TargetRegister.Arg3, 0);
- encoder.EmitRETIfEqual(Register.R21);
-
- encoder.EmitMOV(encoder.TargetRegister.Arg1, encoder.TargetRegister.Result);
- encoder.EmitMOV(encoder.TargetRegister.Arg0, encoder.TargetRegister.Arg2);
-
+ // The fast path check is not necessary. It is always expanded by RyuJIT.
+ encoder.EmitLD(encoder.TargetRegister.Arg1, encoder.TargetRegister.Result, 0);
+ encoder.EmitMOV(encoder.TargetRegister.Arg0, factory.TypeNonGCStaticsSymbol(target));
+ encoder.EmitADD(encoder.TargetRegister.Arg0, encoder.TargetRegister.Arg0, -NonGCStaticsNode.GetClassConstructorContextSize(factory.Target));
encoder.EmitJMP(factory.HelperEntrypoint(HelperEntrypoint.EnsureClassConstructorRunAndReturnGCStaticBase));
}
}
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_RiscV64/RiscV64ReadyToRunHelperNode.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_RiscV64/RiscV64ReadyToRunHelperNode.cs
index c6ad35d1c76add..998efd900846fb 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_RiscV64/RiscV64ReadyToRunHelperNode.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_RiscV64/RiscV64ReadyToRunHelperNode.cs
@@ -23,22 +23,17 @@ protected override void EmitCode(NodeFactory factory, ref RiscV64Emitter encoder
MetadataType target = (MetadataType)Target;
bool hasLazyStaticConstructor = factory.PreinitializationManager.HasLazyStaticConstructor(target);
- encoder.EmitMOV(encoder.TargetRegister.Result, factory.TypeNonGCStaticsSymbol(target));
if (!hasLazyStaticConstructor)
{
+ encoder.EmitMOV(encoder.TargetRegister.Result, factory.TypeNonGCStaticsSymbol(target));
encoder.EmitRET();
}
else
{
- // We need to trigger the cctor before returning the base. It is stored at the beginning of the non-GC statics region.
- encoder.EmitADDI(encoder.TargetRegister.Arg3, encoder.TargetRegister.Result, -NonGCStaticsNode.GetClassConstructorContextSize(factory.Target));
- encoder.EmitLD(encoder.TargetRegister.Arg2, encoder.TargetRegister.Arg3, 0);
- encoder.EmitRETIfZero(encoder.TargetRegister.Arg2);
-
- encoder.EmitMOV(encoder.TargetRegister.Arg1, encoder.TargetRegister.Result);
- encoder.EmitMOV(encoder.TargetRegister.Arg0, encoder.TargetRegister.Arg3);
-
+ // The fast path check is not necessary. It is always expanded by RyuJIT.
+ encoder.EmitMOV(encoder.TargetRegister.Arg1, factory.TypeNonGCStaticsSymbol(target));
+ encoder.EmitADDI(encoder.TargetRegister.Arg0, encoder.TargetRegister.Arg1, -NonGCStaticsNode.GetClassConstructorContextSize(factory.Target));
encoder.EmitJMP(factory.HelperEntrypoint(HelperEntrypoint.EnsureClassConstructorRunAndReturnNonGCStaticBase));
}
}
@@ -79,23 +74,18 @@ protected override void EmitCode(NodeFactory factory, ref RiscV64Emitter encoder
MetadataType target = (MetadataType)Target;
encoder.EmitMOV(encoder.TargetRegister.Result, factory.TypeGCStaticsSymbol(target));
- encoder.EmitLD(encoder.TargetRegister.Result, encoder.TargetRegister.Result, 0);
if (!factory.PreinitializationManager.HasLazyStaticConstructor(target))
{
+ encoder.EmitLD(encoder.TargetRegister.Result, encoder.TargetRegister.Result, 0);
encoder.EmitRET();
}
else
{
- // We need to trigger the cctor before returning the base. It is stored at the beginning of the non-GC statics region.
- encoder.EmitMOV(encoder.TargetRegister.Arg2, factory.TypeNonGCStaticsSymbol(target));
- encoder.EmitADDI(encoder.TargetRegister.Arg2, encoder.TargetRegister.Arg2, -NonGCStaticsNode.GetClassConstructorContextSize(factory.Target));
- encoder.EmitLD(encoder.TargetRegister.Arg3, encoder.TargetRegister.Arg2, 0);
- encoder.EmitRETIfZero(encoder.TargetRegister.Arg3);
-
- encoder.EmitMOV(encoder.TargetRegister.Arg1, encoder.TargetRegister.Result);
- encoder.EmitMOV(encoder.TargetRegister.Arg0, encoder.TargetRegister.Arg2);
-
+ // The fast path check is not necessary. It is always expanded by RyuJIT.
+ encoder.EmitLD(encoder.TargetRegister.Arg1, encoder.TargetRegister.Result, 0);
+ encoder.EmitMOV(encoder.TargetRegister.Arg0, factory.TypeNonGCStaticsSymbol(target));
+ encoder.EmitADDI(encoder.TargetRegister.Arg0, encoder.TargetRegister.Arg0, -NonGCStaticsNode.GetClassConstructorContextSize(factory.Target));
encoder.EmitJMP(factory.HelperEntrypoint(HelperEntrypoint.EnsureClassConstructorRunAndReturnGCStaticBase));
}
}
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_X64/X64ReadyToRunHelperNode.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_X64/X64ReadyToRunHelperNode.cs
index 4b1b2d247f44d1..a63deaf80c1dd3 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_X64/X64ReadyToRunHelperNode.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_X64/X64ReadyToRunHelperNode.cs
@@ -22,22 +22,20 @@ protected override void EmitCode(NodeFactory factory, ref X64Emitter encoder, bo
{
MetadataType target = (MetadataType)Target;
bool hasLazyStaticConstructor = factory.PreinitializationManager.HasLazyStaticConstructor(target);
- encoder.EmitLEAQ(encoder.TargetRegister.Result, factory.TypeNonGCStaticsSymbol(target));
if (!hasLazyStaticConstructor)
{
+ encoder.EmitLEAQ(encoder.TargetRegister.Result, factory.TypeNonGCStaticsSymbol(target));
encoder.EmitRET();
}
else
{
- // We need to trigger the cctor before returning the base. It is stored at the beginning of the non-GC statics region.
- encoder.EmitLEAQ(encoder.TargetRegister.Arg0, factory.TypeNonGCStaticsSymbol(target), -NonGCStaticsNode.GetClassConstructorContextSize(factory.Target));
+ // The fast path check is not necessary. It is always expanded by RyuJIT.
+ encoder.EmitLEAQ(encoder.TargetRegister.Arg1, factory.TypeNonGCStaticsSymbol(target));
- AddrMode initialized = new AddrMode(encoder.TargetRegister.Arg0, null, 0, 0, AddrModeSize.Int64);
- encoder.EmitCMP(ref initialized, 0);
- encoder.EmitRETIfEqual();
+ AddrMode loadCctor = new AddrMode(encoder.TargetRegister.Arg1, null, -NonGCStaticsNode.GetClassConstructorContextSize(factory.Target), 0, AddrModeSize.Int64);
+ encoder.EmitLEA(encoder.TargetRegister.Arg0, ref loadCctor);
- encoder.EmitMOV(encoder.TargetRegister.Arg1, encoder.TargetRegister.Result);
encoder.EmitJMP(factory.HelperEntrypoint(HelperEntrypoint.EnsureClassConstructorRunAndReturnNonGCStaticBase));
}
}
@@ -89,24 +87,19 @@ protected override void EmitCode(NodeFactory factory, ref X64Emitter encoder, bo
MetadataType target = (MetadataType)Target;
encoder.EmitLEAQ(encoder.TargetRegister.Result, factory.TypeGCStaticsSymbol(target));
- AddrMode loadFromRax = new AddrMode(encoder.TargetRegister.Result, null, 0, 0, AddrModeSize.Int64);
- encoder.EmitMOV(encoder.TargetRegister.Result, ref loadFromRax);
if (!factory.PreinitializationManager.HasLazyStaticConstructor(target))
{
+ AddrMode loadFromRax = new AddrMode(encoder.TargetRegister.Result, null, 0, 0, AddrModeSize.Int64);
+ encoder.EmitMOV(encoder.TargetRegister.Result, ref loadFromRax);
encoder.EmitRET();
}
else
{
- // We need to trigger the cctor before returning the base. It is stored at the beginning of the non-GC statics region.
+ // The fast path check is not necessary. It is always expanded by RyuJIT.
+ AddrMode loadFromRax = new AddrMode(encoder.TargetRegister.Result, null, 0, 0, AddrModeSize.Int64);
+ encoder.EmitMOV(encoder.TargetRegister.Arg1, ref loadFromRax);
encoder.EmitLEAQ(encoder.TargetRegister.Arg0, factory.TypeNonGCStaticsSymbol(target), -NonGCStaticsNode.GetClassConstructorContextSize(factory.Target));
-
- AddrMode initialized = new AddrMode(encoder.TargetRegister.Arg0, null, 0, 0, AddrModeSize.Int64);
- encoder.EmitCMP(ref initialized, 0);
- encoder.EmitRETIfEqual();
-
- encoder.EmitMOV(encoder.TargetRegister.Arg1, encoder.TargetRegister.Result);
-
encoder.EmitJMP(factory.HelperEntrypoint(HelperEntrypoint.EnsureClassConstructorRunAndReturnGCStaticBase));
}
}
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_X86/X86ReadyToRunHelperNode.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_X86/X86ReadyToRunHelperNode.cs
index 239bfd338d9c3e..472f628a353393 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_X86/X86ReadyToRunHelperNode.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/DependencyAnalysis/Target_X86/X86ReadyToRunHelperNode.cs
@@ -23,22 +23,17 @@ protected override void EmitCode(NodeFactory factory, ref X86Emitter encoder, bo
{
MetadataType target = (MetadataType)Target;
bool hasLazyStaticConstructor = factory.PreinitializationManager.HasLazyStaticConstructor(target);
- encoder.EmitMOV(encoder.TargetRegister.Result, factory.TypeNonGCStaticsSymbol(target));
if (!hasLazyStaticConstructor)
{
+ encoder.EmitMOV(encoder.TargetRegister.Result, factory.TypeNonGCStaticsSymbol(target));
encoder.EmitRET();
}
else
{
- // We need to trigger the cctor before returning the base. It is stored at the beginning of the non-GC statics region.
+ // The fast path check is not necessary. It is always expanded by RyuJIT.
+ encoder.EmitMOV(encoder.TargetRegister.Arg1, factory.TypeNonGCStaticsSymbol(target));
encoder.EmitMOV(encoder.TargetRegister.Arg0, factory.TypeNonGCStaticsSymbol(target), -NonGCStaticsNode.GetClassConstructorContextSize(factory.Target));
-
- AddrMode initialized = new AddrMode(encoder.TargetRegister.Arg0, null, 0, 0, AddrModeSize.Int32);
- encoder.EmitCMP(ref initialized, 0);
- encoder.EmitRETIfEqual();
-
- encoder.EmitMOV(encoder.TargetRegister.Arg1, encoder.TargetRegister.Result);
encoder.EmitJMP(factory.HelperEntrypoint(HelperEntrypoint.EnsureClassConstructorRunAndReturnNonGCStaticBase));
}
}
@@ -95,23 +90,19 @@ protected override void EmitCode(NodeFactory factory, ref X86Emitter encoder, bo
MetadataType target = (MetadataType)Target;
bool hasLazyStaticConstructor = factory.PreinitializationManager.HasLazyStaticConstructor(target);
encoder.EmitMOV(encoder.TargetRegister.Result, factory.TypeGCStaticsSymbol(target));
- AddrMode loadFromEax = new AddrMode(encoder.TargetRegister.Result, null, 0, 0, AddrModeSize.Int32);
- encoder.EmitMOV(encoder.TargetRegister.Result, ref loadFromEax);
if (!hasLazyStaticConstructor)
{
+ AddrMode loadFromEax = new AddrMode(encoder.TargetRegister.Result, null, 0, 0, AddrModeSize.Int32);
+ encoder.EmitMOV(encoder.TargetRegister.Result, ref loadFromEax);
encoder.EmitRET();
}
else
{
- // We need to trigger the cctor before returning the base. It is stored at the beginning of the non-GC statics region.
+ // The fast path check is not necessary. It is always expanded by RyuJIT.
+ AddrMode loadFromEax = new AddrMode(encoder.TargetRegister.Result, null, 0, 0, AddrModeSize.Int32);
+ encoder.EmitMOV(encoder.TargetRegister.Arg1, ref loadFromEax);
encoder.EmitMOV(encoder.TargetRegister.Arg0, factory.TypeNonGCStaticsSymbol(target), -NonGCStaticsNode.GetClassConstructorContextSize(factory.Target));
-
- AddrMode initialized = new AddrMode(encoder.TargetRegister.Arg0, null, 0, 0, AddrModeSize.Int32);
- encoder.EmitCMP(ref initialized, 0);
- encoder.EmitRETIfEqual();
-
- encoder.EmitMOV(encoder.TargetRegister.Arg1, encoder.TargetRegister.Result);
encoder.EmitJMP(factory.HelperEntrypoint(HelperEntrypoint.EnsureClassConstructorRunAndReturnGCStaticBase));
}
}
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/MetadataManager.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/MetadataManager.cs
index 11b3bf944d83a8..53a722cdb663f0 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/MetadataManager.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/MetadataManager.cs
@@ -41,7 +41,7 @@ namespace ILCompiler
///
public abstract class MetadataManager : ICompilationRootProvider
{
- internal const int MetadataOffsetMask = 0xFFFFFF;
+ internal const int MetadataOffsetMask = 0x1FFFFFF;
protected readonly MetadataManagerOptions _options;
@@ -776,10 +776,10 @@ protected void ComputeMetadata(
metadataBlob = ms.ToArray();
- const int MaxAllowedMetadataOffset = 0xFFFFFF;
+ const int MaxAllowedMetadataOffset = 0x1FFFFFF;
if (metadataBlob.Length > MaxAllowedMetadataOffset)
{
- // Offset portion of metadata handles is limited to 16 MB.
+ // Offset portion of metadata handles is limited to 32 MB.
throw new InvalidOperationException($"Metadata blob exceeded the addressing range (allowed: {MaxAllowedMetadataOffset}, actual: {metadataBlob.Length})");
}
diff --git a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/SubstitutedILProvider.cs b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/SubstitutedILProvider.cs
index fd2442c4b6b41c..4450c53ed99584 100644
--- a/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/SubstitutedILProvider.cs
+++ b/src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/SubstitutedILProvider.cs
@@ -672,6 +672,7 @@ private bool TryGetMethodConstantValue(MethodDesc method, out int constant, int
if (returnType is < TypeFlags.Boolean or > TypeFlags.UInt32
|| method.IsIntrinsic
|| method.IsNoInlining
+ || method.IsNoOptimization
|| _nestedILProvider.GetMethodIL(method) is not MethodIL methodIL)
{
constant = 0;
diff --git a/src/coreclr/tools/aot/ILCompiler.MetadataTransform/Internal/Metadata/NativeFormat/Writer/MdBinaryWriter.cs b/src/coreclr/tools/aot/ILCompiler.MetadataTransform/Internal/Metadata/NativeFormat/Writer/MdBinaryWriter.cs
index ea6a7622e6b76a..fc4502c0f49fe1 100644
--- a/src/coreclr/tools/aot/ILCompiler.MetadataTransform/Internal/Metadata/NativeFormat/Writer/MdBinaryWriter.cs
+++ b/src/coreclr/tools/aot/ILCompiler.MetadataTransform/Internal/Metadata/NativeFormat/Writer/MdBinaryWriter.cs
@@ -77,7 +77,7 @@ public static void Write(this NativeWriter writer, double value)
public static void Write(this NativeWriter writer, MetadataRecord record)
{
if (record != null)
- writer.WriteUnsigned((uint)record.HandleType | (uint)(record.HandleOffset << 8));
+ writer.WriteUnsigned((uint)record.HandleType | (uint)(record.HandleOffset << 7));
else
writer.WriteUnsigned(0);
}
diff --git a/src/coreclr/tools/aot/ILCompiler.MetadataTransform/Internal/Metadata/NativeFormat/Writer/NativeMetadataWriter.cs b/src/coreclr/tools/aot/ILCompiler.MetadataTransform/Internal/Metadata/NativeFormat/Writer/NativeMetadataWriter.cs
index b05c1c6ed3a73b..f4df3c7e207172 100644
--- a/src/coreclr/tools/aot/ILCompiler.MetadataTransform/Internal/Metadata/NativeFormat/Writer/NativeMetadataWriter.cs
+++ b/src/coreclr/tools/aot/ILCompiler.MetadataTransform/Internal/Metadata/NativeFormat/Writer/NativeMetadataWriter.cs
@@ -519,7 +519,7 @@ internal int HandleOffset
{
get
{
- return _offset & 0x00FFFFFF;
+ return _offset & 0x01FFFFFF;
}
}
diff --git a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs
index 66c7767dab8a81..e1803a3f5d7931 100644
--- a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs
+++ b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs
@@ -82,8 +82,9 @@ public bool CanInline(MethodDesc caller, MethodDesc callee)
return false;
}
- if (callee.IsNoInlining)
+ if (callee.IsNoInlining || callee.IsNoOptimization)
{
+ // NoOptimization implies NoInlining
return false;
}
diff --git a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs
index 500863a90d9347..7cc3343a56d416 100644
--- a/src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs
+++ b/src/coreclr/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs
@@ -1299,10 +1299,12 @@ private bool canTailCall(CORINFO_METHOD_STRUCT_* callerHnd, CORINFO_METHOD_STRUC
return false;
}
- // Do not tailcall from methods that are marked as noinline (people often use no-inline
+ // Do not tailcall from methods that are marked as NoInlining (people often use no-inline
// to mean "I want to always see this method in stacktrace")
if (caller.IsNoInlining)
{
+ // NOTE: we don't have to handle NoOptimization here, because JIT is not expected
+ // to emit fast tail calls if optimizations are disabled.
return false;
}
diff --git a/src/coreclr/tools/aot/ILCompiler.RyuJit/JitInterface/CorInfoImpl.RyuJit.cs b/src/coreclr/tools/aot/ILCompiler.RyuJit/JitInterface/CorInfoImpl.RyuJit.cs
index fab907801e723b..b4933c28b25afc 100644
--- a/src/coreclr/tools/aot/ILCompiler.RyuJit/JitInterface/CorInfoImpl.RyuJit.cs
+++ b/src/coreclr/tools/aot/ILCompiler.RyuJit/JitInterface/CorInfoImpl.RyuJit.cs
@@ -833,8 +833,11 @@ private bool canTailCall(CORINFO_METHOD_STRUCT_* callerHnd, CORINFO_METHOD_STRUC
if (caller.IsNoInlining)
{
- // Do not tailcall from methods that are marked as noinline (people often use no-inline
+ // Do not tailcall from methods that are marked as NoInlining (people often use no-inline
// to mean "I want to always see this method in stacktrace")
+ //
+ // NOTE: we don't have to handle NoOptimization here, because JIT is not expected
+ // to emit fast tail calls if optimizations are disabled.
result = false;
}
}
diff --git a/src/coreclr/vm/CMakeLists.txt b/src/coreclr/vm/CMakeLists.txt
index 9d73e3783e1aba..c6edfe5a6ff526 100644
--- a/src/coreclr/vm/CMakeLists.txt
+++ b/src/coreclr/vm/CMakeLists.txt
@@ -855,12 +855,6 @@ elseif(CLR_CMAKE_TARGET_ARCH_RISCV64)
)
endif()
-if(CLR_CMAKE_HOST_UNIX)
- list(APPEND VM_SOURCES_WKS_ARCH
- ${ARCH_SOURCES_DIR}/unixstubs.cpp
- )
-endif(CLR_CMAKE_HOST_UNIX)
-
set(VM_SOURCES_DAC_ARCH
exceptionhandling.cpp
)
diff --git a/src/coreclr/vm/amd64/AsmHelpers.asm b/src/coreclr/vm/amd64/AsmHelpers.asm
index 18435be1b13727..95714fd0757321 100644
--- a/src/coreclr/vm/amd64/AsmHelpers.asm
+++ b/src/coreclr/vm/amd64/AsmHelpers.asm
@@ -12,6 +12,8 @@ extern ProfileTailcall:proc
extern OnHijackWorker:proc
extern JIT_RareDisableHelperWorker:proc
+extern g_pPollGC:QWORD
+extern g_TrapReturningThreads:DWORD
; EXTERN_C int __fastcall HelperMethodFrameRestoreState(
; INDEBUG_COMMA(HelperMethodFrame *pFrame)
@@ -447,5 +449,13 @@ NESTED_END OnCallCountThresholdReachedStub, _TEXT
endif ; FEATURE_TIERED_COMPILATION
- end
+LEAF_ENTRY JIT_PollGC, _TEXT
+ cmp [g_TrapReturningThreads], 0
+ jnz JIT_PollGCRarePath
+ ret
+JIT_PollGCRarePath:
+ mov rax, g_pPollGC
+ TAILJMP_RAX
+LEAF_END JIT_PollGC, _TEXT
+ end
\ No newline at end of file
diff --git a/src/coreclr/vm/amd64/asmhelpers.S b/src/coreclr/vm/amd64/asmhelpers.S
index 8d83938246a2c9..6bce2d2f2d3436 100644
--- a/src/coreclr/vm/amd64/asmhelpers.S
+++ b/src/coreclr/vm/amd64/asmhelpers.S
@@ -44,6 +44,14 @@
#
# ***********************************************************
+# EXTERN_C void JIT_ProfilerEnterLeaveTailcallStub(UINT_PTR ProfilerHandle);
+#
+#
+#
+LEAF_ENTRY JIT_ProfilerEnterLeaveTailcallStub, _TEXT
+ ret
+LEAF_END JIT_ProfilerEnterLeaveTailcallStub, _TEXT
+
# EXTERN_C void ProfileEnterNaked(FunctionIDOrClientID functionIDOrClientID, size_t profiledRsp);
#
#
@@ -311,3 +319,14 @@ LEAF_ENTRY GetTlsIndexObjectDescOffset, _TEXT
int 3
LEAF_END GetTlsIndexObjectDescOffset, _TEXT
#endif
+
+LEAF_ENTRY JIT_PollGC, _TEXT
+ PREPARE_EXTERNAL_VAR g_TrapReturningThreads, rax
+ cmp dword ptr [rax], 0
+ jnz LOCAL_LABEL(JIT_PollGCRarePath)
+ ret
+LOCAL_LABEL(JIT_PollGCRarePath):
+ PREPARE_EXTERNAL_VAR g_pPollGC, rax
+ mov rax, [rax]
+ jmp rax
+LEAF_END JIT_PollGC, _TEXT
diff --git a/src/coreclr/vm/amd64/excepamd64.cpp b/src/coreclr/vm/amd64/excepamd64.cpp
index 282a84c7d788db..c679a67b996fc2 100644
--- a/src/coreclr/vm/amd64/excepamd64.cpp
+++ b/src/coreclr/vm/amd64/excepamd64.cpp
@@ -48,12 +48,14 @@ inline PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrameWorker(UINT_PTR establi
return *ppContext;
}
+#ifdef TARGET_WINDOWS
PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(DISPATCHER_CONTEXT * pDispatcherContext)
{
LIMITED_METHOD_DAC_CONTRACT;
return GetCONTEXTFromRedirectedStubStackFrameWorker(pDispatcherContext->EstablisherFrame);
}
+#endif // TARGET_WINDOWS
PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(CONTEXT * pContext)
{
@@ -63,17 +65,14 @@ PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(CONTEXT * pContext)
}
#if !defined(DACCESS_COMPILE)
-
+#ifdef TARGET_WINDOWS
FaultingExceptionFrame *GetFrameFromRedirectedStubStackFrame (DISPATCHER_CONTEXT *pDispatcherContext)
{
LIMITED_METHOD_CONTRACT;
return (FaultingExceptionFrame*)(pDispatcherContext->EstablisherFrame + THROWSTUB_ESTABLISHER_OFFSET_FaultingExceptionFrame);
}
-
-#endif // !DACCESS_COMPILE
-
-#if !defined(DACCESS_COMPILE)
+#endif // TARGET_WINDOWS
#define AMD64_SIZE64_PREFIX 0x48
#define AMD64_ADD_IMM8_OP 0x83
diff --git a/src/coreclr/vm/amd64/excepcpu.h b/src/coreclr/vm/amd64/excepcpu.h
index 07a7d041dc9ce9..3403f99a5e8d91 100644
--- a/src/coreclr/vm/amd64/excepcpu.h
+++ b/src/coreclr/vm/amd64/excepcpu.h
@@ -40,14 +40,18 @@ EXTERN_C void RedirectForThrowControl();
// Retrieves the redirected CONTEXT* from the stack frame of one of the
// RedirectedHandledJITCaseForXXX_Stub's.
//
+#ifdef TARGET_WINDOWS
PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(DISPATCHER_CONTEXT * pDispatcherContext);
+#endif // TARGET_WINDOWS
PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(CONTEXT * pContext);
+#ifdef TARGET_WINDOWS
//
// Retrieves the FaultingExceptionFrame* from the stack frame of
// RedirectForThrowControl.
//
FaultingExceptionFrame *GetFrameFromRedirectedStubStackFrame (DISPATCHER_CONTEXT *pDispatcherContext);
+#endif // TARGET_WINDOWS
//
// Functions that wrap RtlVirtualUnwind to make sure that in the AMD64 case all the
diff --git a/src/coreclr/vm/amd64/unixstubs.cpp b/src/coreclr/vm/amd64/unixstubs.cpp
deleted file mode 100644
index 0edb1aef92cc3e..00000000000000
--- a/src/coreclr/vm/amd64/unixstubs.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-#include "common.h"
-
-extern "C"
-{
- void STDMETHODCALLTYPE JIT_ProfilerEnterLeaveTailcallStub(UINT_PTR ProfilerHandle)
- {
- }
-};
diff --git a/src/coreclr/vm/appdomain.cpp b/src/coreclr/vm/appdomain.cpp
index a3fb8bc3e9a4e0..7762d755052033 100644
--- a/src/coreclr/vm/appdomain.cpp
+++ b/src/coreclr/vm/appdomain.cpp
@@ -1006,6 +1006,8 @@ extern "C" PCODE g_pGetGCStaticBase;
PCODE g_pGetGCStaticBase;
extern "C" PCODE g_pGetNonGCStaticBase;
PCODE g_pGetNonGCStaticBase;
+extern "C" PCODE g_pPollGC;
+PCODE g_pPollGC;
void SystemDomain::LoadBaseSystemClasses()
{
@@ -1144,6 +1146,7 @@ void SystemDomain::LoadBaseSystemClasses()
g_pGetGCStaticBase = CoreLibBinder::GetMethod(METHOD__STATICSHELPERS__GET_GC_STATIC)->GetMultiCallableAddrOfCode();
g_pGetNonGCStaticBase = CoreLibBinder::GetMethod(METHOD__STATICSHELPERS__GET_NONGC_STATIC)->GetMultiCallableAddrOfCode();
+ g_pPollGC = CoreLibBinder::GetMethod(METHOD__THREAD__POLLGC)->GetMultiCallableAddrOfCode();
#ifdef PROFILING_SUPPORTED
// Note that g_profControlBlock.fBaseSystemClassesLoaded must be set to TRUE only after
@@ -1287,6 +1290,8 @@ bool SystemDomain::IsReflectionInvocationMethod(MethodDesc* pMeth)
CLASS__DELEGATE,
CLASS__MULTICAST_DELEGATE,
CLASS__METHODBASEINVOKER,
+ CLASS__INITHELPERS,
+ CLASS__STATICSHELPERS,
};
static bool fInited = false;
diff --git a/src/coreclr/vm/arm/asmhelpers.S b/src/coreclr/vm/arm/asmhelpers.S
index b970aaf28f07c8..5017a582f3ab8c 100644
--- a/src/coreclr/vm/arm/asmhelpers.S
+++ b/src/coreclr/vm/arm/asmhelpers.S
@@ -914,3 +914,26 @@ ProbeLoop:
NESTED_END OnCallCountThresholdReachedStub, _TEXT
#endif // FEATURE_TIERED_COMPILATION
+
+ LEAF_ENTRY JIT_PollGC, _TEXT
+#if defined(__clang__)
+ ldr r2, =g_TrapReturningThreads-(1f+4)
+1:
+ add r2, pc
+#else
+ ldr r2, =g_TrapReturningThreads
+#endif
+ ldr r2, [r2]
+ cbnz r2, LOCAL_LABEL(JIT_PollGCRarePath)
+ bx lr
+LOCAL_LABEL(JIT_PollGCRarePath):
+#if defined(__clang__)
+ ldr r2, =g_pPollGC-(1f+4)
+1:
+ add r2, pc
+#else
+ ldr r2, =g_pPollGC
+#endif
+ ldr r2, [r2]
+ EPILOG_BRANCH_REG r2
+ LEAF_END JIT_PollGC, _TEXT
diff --git a/src/coreclr/vm/arm/exceparm.cpp b/src/coreclr/vm/arm/exceparm.cpp
index 517c3c774cfb99..f9ce191fa3e36f 100644
--- a/src/coreclr/vm/arm/exceparm.cpp
+++ b/src/coreclr/vm/arm/exceparm.cpp
@@ -7,15 +7,6 @@
#include "asmconstants.h"
#include "virtualcallstub.h"
-PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(T_DISPATCHER_CONTEXT * pDispatcherContext)
-{
- LIMITED_METHOD_DAC_CONTRACT;
-
- UINT_PTR stackSlot = pDispatcherContext->EstablisherFrame + REDIRECTSTUB_SP_OFFSET_CONTEXT;
- PTR_PTR_CONTEXT ppContext = dac_cast((TADDR)stackSlot);
- return *ppContext;
-}
-
PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(T_CONTEXT * pContext)
{
LIMITED_METHOD_DAC_CONTRACT;
@@ -27,32 +18,6 @@ PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(T_CONTEXT * pContext)
#if !defined(DACCESS_COMPILE)
-// The next two functions help retrieve data kept relative to FaultingExceptionFrame that is setup
-// for handling async exceptions (e.g. AV, NullRef, ThreadAbort, etc).
-//
-// FEF (and related data) is available relative to R4 - the thing to be kept in mind is that the
-// DispatcherContext->ContextRecord:
-//
-// 1) represents the caller context in the first pass.
-// 2) represents the current context in the second pass.
-//
-// Since R4 is a non-volatile register, this works for us since we setup the value of R4
-// in the redirection helpers (e.g. RedirectForThreadAbort) but do not
-// change it in their respective callee functions (e.g. RedirectForThreadAbort2)
-// that have the personality routines associated with them (which perform the collided unwind and also
-// invoke the two functions below).
-//
-// Thus, when our personality routine gets called in either passes, DC->ContextRecord->R4 will
-// have the same value.
-
-// Returns the pointer to the FEF
-FaultingExceptionFrame *GetFrameFromRedirectedStubStackFrame (T_DISPATCHER_CONTEXT *pDispatcherContext)
-{
- LIMITED_METHOD_CONTRACT;
-
- return (FaultingExceptionFrame*)((TADDR)pDispatcherContext->ContextRecord->R4);
-}
-
// Returns TRUE if caller should resume execution.
BOOL
AdjustContextForVirtualStub(
diff --git a/src/coreclr/vm/arm/excepcpu.h b/src/coreclr/vm/arm/excepcpu.h
index f0c002e70930ce..7637cec21e76fd 100644
--- a/src/coreclr/vm/arm/excepcpu.h
+++ b/src/coreclr/vm/arm/excepcpu.h
@@ -26,15 +26,8 @@ class FaultingExceptionFrame;
// Retrieves the redirected CONTEXT* from the stack frame of one of the
// RedirectedHandledJITCaseForXXX_Stub's.
//
-PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(T_DISPATCHER_CONTEXT * pDispatcherContext);
PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(T_CONTEXT * pContext);
-//
-// Retrieves the FaultingExceptionFrame* from the stack frame of
-// RedirectForThrowControl.
-//
-FaultingExceptionFrame *GetFrameFromRedirectedStubStackFrame (T_DISPATCHER_CONTEXT *pDispatcherContext);
-
inline
PCODE GetAdjustedCallAddress(PCODE returnAddress)
{
diff --git a/src/coreclr/vm/arm/unixstubs.cpp b/src/coreclr/vm/arm/unixstubs.cpp
deleted file mode 100644
index 878d5b003686b6..00000000000000
--- a/src/coreclr/vm/arm/unixstubs.cpp
+++ /dev/null
@@ -1,4 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-#include "common.h"
diff --git a/src/coreclr/vm/arm64/asmhelpers.S b/src/coreclr/vm/arm64/asmhelpers.S
index 65c1eaec4121ad..d40d210dfb03ad 100644
--- a/src/coreclr/vm/arm64/asmhelpers.S
+++ b/src/coreclr/vm/arm64/asmhelpers.S
@@ -806,3 +806,14 @@ LEAF_ENTRY GetTLSResolverAddress, _TEXT
LEAF_END GetTLSResolverAddress, _TEXT
// ------------------------------------------------------------------
#endif // !TARGET_OSX
+
+LEAF_ENTRY JIT_PollGC, _TEXT
+ PREPARE_EXTERNAL_VAR g_TrapReturningThreads, x9
+ ldr w9, [x9]
+ cbnz w9, LOCAL_LABEL(JIT_PollGCRarePath)
+ ret
+LOCAL_LABEL(JIT_PollGCRarePath):
+ PREPARE_EXTERNAL_VAR g_pPollGC, x9
+ ldr x9, [x9]
+ br x9
+LEAF_END JIT_PollGC, _TEXT
diff --git a/src/coreclr/vm/arm64/asmhelpers.asm b/src/coreclr/vm/arm64/asmhelpers.asm
index eea1e98df75274..e240919a7395f0 100644
--- a/src/coreclr/vm/arm64/asmhelpers.asm
+++ b/src/coreclr/vm/arm64/asmhelpers.asm
@@ -39,6 +39,9 @@
IMPORT g_pGetGCStaticBase
IMPORT g_pGetNonGCStaticBase
+ IMPORT g_pPollGC
+ IMPORT g_TrapReturningThreads
+
#ifdef WRITE_BARRIER_CHECK
SETALIAS g_GCShadow, ?g_GCShadow@@3PEAEEA
SETALIAS g_GCShadowEnd, ?g_GCShadowEnd@@3PEAEEA
@@ -1179,6 +1182,17 @@ __HelperNakedFuncName SETS "$helper":CC:"Naked"
#endif ; FEATURE_SPECIAL_USER_MODE_APC
+ LEAF_ENTRY JIT_PollGC
+ ldr x9, =g_TrapReturningThreads
+ ldr w9, [x9]
+ cbnz w9, JIT_PollGCRarePath
+ ret
+JIT_PollGCRarePath
+ ldr x9, =g_pPollGC
+ ldr x9, [x9]
+ br x9
+ LEAF_END
+
; Must be at very end of file
END
diff --git a/src/coreclr/vm/arm64/excepcpu.h b/src/coreclr/vm/arm64/excepcpu.h
index eb575235af8feb..acbd29b102e7b5 100644
--- a/src/coreclr/vm/arm64/excepcpu.h
+++ b/src/coreclr/vm/arm64/excepcpu.h
@@ -28,14 +28,18 @@ class FaultingExceptionFrame;
// Retrieves the redirected CONTEXT* from the stack frame of one of the
// RedirectedHandledJITCaseForXXX_Stub's.
//
+#ifdef TARGET_WINDOWS
PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(T_DISPATCHER_CONTEXT * pDispatcherContext);
+#endif // TARGET_WINDOWS
PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(T_CONTEXT * pContext);
+#ifdef TARGET_WINDOWS
//
// Retrieves the FaultingExceptionFrame* from the stack frame of
-// RedirectForThrowControl.
+// RedirectForThreadAbort.
//
FaultingExceptionFrame *GetFrameFromRedirectedStubStackFrame (T_DISPATCHER_CONTEXT *pDispatcherContext);
+#endif // TARGET_WINDOWS
inline
PCODE GetAdjustedCallAddress(PCODE returnAddress)
diff --git a/src/coreclr/vm/arm64/stubs.cpp b/src/coreclr/vm/arm64/stubs.cpp
index 825d2e0e4fd811..6c7b02bab13e9e 100644
--- a/src/coreclr/vm/arm64/stubs.cpp
+++ b/src/coreclr/vm/arm64/stubs.cpp
@@ -859,11 +859,6 @@ void emitCOMStubCall (ComCallMethodDesc *pCOMMethodRX, ComCallMethodDesc *pCOMMe
}
#endif // FEATURE_COMINTEROP
-void JIT_TailCall()
-{
- _ASSERTE(!"ARM64:NYI");
-}
-
#if !defined(DACCESS_COMPILE)
EXTERN_C void JIT_UpdateWriteBarrierState(bool skipEphemeralCheck, size_t writeableOffset);
@@ -917,6 +912,7 @@ void InitJITHelpers1()
void UpdateWriteBarrierState(bool) {}
#endif // !defined(DACCESS_COMPILE)
+#ifdef TARGET_WINDOWS
PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(T_DISPATCHER_CONTEXT * pDispatcherContext)
{
LIMITED_METHOD_DAC_CONTRACT;
@@ -925,6 +921,7 @@ PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(T_DISPATCHER_CONTEXT * pDispa
PTR_PTR_CONTEXT ppContext = dac_cast((TADDR)stackSlot);
return *ppContext;
}
+#endif // TARGET_WINDOWS
PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(T_CONTEXT * pContext)
{
@@ -936,13 +933,14 @@ PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(T_CONTEXT * pContext)
}
#if !defined(DACCESS_COMPILE)
+#ifdef TARGET_WINDOWS
FaultingExceptionFrame *GetFrameFromRedirectedStubStackFrame (DISPATCHER_CONTEXT *pDispatcherContext)
{
LIMITED_METHOD_CONTRACT;
return (FaultingExceptionFrame*)((TADDR)pDispatcherContext->ContextRecord->X19);
}
-
+#endif // TARGET_WINDOWS
BOOL
AdjustContextForVirtualStub(
diff --git a/src/coreclr/vm/arm64/unixstubs.cpp b/src/coreclr/vm/arm64/unixstubs.cpp
deleted file mode 100644
index 878d5b003686b6..00000000000000
--- a/src/coreclr/vm/arm64/unixstubs.cpp
+++ /dev/null
@@ -1,4 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-#include "common.h"
diff --git a/src/coreclr/vm/assembly.cpp b/src/coreclr/vm/assembly.cpp
index e6be6728778d52..e124702167889b 100644
--- a/src/coreclr/vm/assembly.cpp
+++ b/src/coreclr/vm/assembly.cpp
@@ -2418,7 +2418,7 @@ HRESULT Assembly::GetDebuggingCustomAttributes(DWORD *pdwFlags)
ULONG size;
BYTE *blob;
IMDInternalImport* mdImport = GetPEAssembly()->GetMDImport();
- mdAssembly asTK = TokenFromRid(mdtAssembly, 1);
+ mdAssembly asTK = TokenFromRid(1, mdtAssembly);
HRESULT hr = mdImport->GetCustomAttributeByName(asTK,
DEBUGGABLE_ATTRIBUTE_TYPE,
diff --git a/src/coreclr/vm/clsload.cpp b/src/coreclr/vm/clsload.cpp
index 2acc0ffa4dc2c8..7862eef313478f 100644
--- a/src/coreclr/vm/clsload.cpp
+++ b/src/coreclr/vm/clsload.cpp
@@ -3461,6 +3461,12 @@ VOID ClassLoader::AddAvailableClassHaveLock(
if (SUCCEEDED(pMDImport->GetNestedClassProps(classdef, &enclosing))) {
// nested type
+ if (enclosing == COR_GLOBAL_PARENT_TOKEN)
+ {
+ // Types nested in the class can't be found by lookup.
+ return;
+ }
+
COUNT_T classEntryIndex = RidFromToken(enclosing) - 1;
_ASSERTE(RidFromToken(enclosing) < RidFromToken(classdef));
if (classEntries->GetCount() > classEntryIndex)
diff --git a/src/coreclr/vm/comsynchronizable.cpp b/src/coreclr/vm/comsynchronizable.cpp
index e71fe3908786bf..2e4170a81ef838 100644
--- a/src/coreclr/vm/comsynchronizable.cpp
+++ b/src/coreclr/vm/comsynchronizable.cpp
@@ -848,6 +848,12 @@ extern "C" void QCALLTYPE ThreadNative_DisableComObjectEagerCleanup(QCall::Threa
}
#endif //FEATURE_COMINTEROP
+extern "C" void QCALLTYPE ThreadNative_PollGC()
+{
+ // This is an intentional no-op. The call is made to ensure that the thread goes through a GC transition
+ // and is thus marked as a GC safe point, and that the p/invoke rare path will kick in
+}
+
extern "C" BOOL QCALLTYPE ThreadNative_YieldThread()
{
QCALL_CONTRACT;
diff --git a/src/coreclr/vm/comsynchronizable.h b/src/coreclr/vm/comsynchronizable.h
index c06af82d0f2967..9b17981e16e7a3 100644
--- a/src/coreclr/vm/comsynchronizable.h
+++ b/src/coreclr/vm/comsynchronizable.h
@@ -50,6 +50,7 @@ extern "C" BOOL QCALLTYPE ThreadNative_GetIsBackground(QCall::ThreadHandle threa
extern "C" void QCALLTYPE ThreadNative_SetIsBackground(QCall::ThreadHandle thread, BOOL value);
extern "C" void QCALLTYPE ThreadNative_InformThreadNameChange(QCall::ThreadHandle thread, LPCWSTR name, INT32 len);
extern "C" BOOL QCALLTYPE ThreadNative_YieldThread();
+extern "C" void QCALLTYPE ThreadNative_PollGC();
extern "C" UINT64 QCALLTYPE ThreadNative_GetCurrentOSThreadId();
extern "C" void QCALLTYPE ThreadNative_Initialize(QCall::ObjectHandleOnStack t);
extern "C" INT32 QCALLTYPE ThreadNative_GetThreadState(QCall::ThreadHandle thread);
diff --git a/src/coreclr/vm/corelib.h b/src/coreclr/vm/corelib.h
index e8eaf0ca12c224..e483a08eb1d670 100644
--- a/src/coreclr/vm/corelib.h
+++ b/src/coreclr/vm/corelib.h
@@ -867,6 +867,8 @@ DEFINE_CLASS(DIRECTONTHREADLOCALDATA, Threading, Thread+DirectOnThreadLocalData)
DEFINE_CLASS(THREAD, Threading, Thread)
DEFINE_METHOD(THREAD, START_CALLBACK, StartCallback, IM_RetVoid)
+DEFINE_METHOD(THREAD, POLLGC, PollGC, NoSig)
+
#ifdef FEATURE_OBJCMARSHAL
DEFINE_CLASS(AUTORELEASEPOOL, Threading, AutoreleasePool)
DEFINE_METHOD(AUTORELEASEPOOL, CREATEAUTORELEASEPOOL, CreateAutoreleasePool, SM_RetVoid)
diff --git a/src/coreclr/vm/exceptionhandling.cpp b/src/coreclr/vm/exceptionhandling.cpp
index 18abf22d51a48c..eedc2b5c39c195 100644
--- a/src/coreclr/vm/exceptionhandling.cpp
+++ b/src/coreclr/vm/exceptionhandling.cpp
@@ -5867,7 +5867,7 @@ void TrackerAllocator::FreeTrackerMemory(ExceptionTracker* pTracker)
InterlockedExchangeT(&(pTracker->m_pThread), NULL);
}
-#ifndef TARGET_UNIX
+#ifdef TARGET_WINDOWS
// This is Windows specific implementation as it is based upon the notion of collided unwind that is specific
// to Windows 64bit.
//
@@ -5890,8 +5890,8 @@ void FixupDispatcherContext(DISPATCHER_CONTEXT* pDispatcherContext, CONTEXT* pCo
}
pDispatcherContext->ControlPc = (UINT_PTR) GetIP(pDispatcherContext->ContextRecord);
-
-#if defined(TARGET_ARM) || defined(TARGET_ARM64) || defined(TARGET_LOONGARCH64) || defined(TARGET_RISCV64)
+
+#if defined(TARGET_ARM64)
// Since this routine is used to fixup contexts for async exceptions,
// clear the CONTEXT_UNWOUND_TO_CALL flag since, semantically, frames
// where such exceptions have happened do not have callsites. On a similar
@@ -5911,21 +5911,10 @@ void FixupDispatcherContext(DISPATCHER_CONTEXT* pDispatcherContext, CONTEXT* pCo
// be fixing it at their end, in their implementation of collided unwind.
pDispatcherContext->ContextRecord->ContextFlags &= ~CONTEXT_DEBUG_REGISTERS;
-#ifdef TARGET_ARM
- // But keep the architecture flag set (its part of CONTEXT_DEBUG_REGISTERS)
- pDispatcherContext->ContextRecord->ContextFlags |= CONTEXT_ARM;
-#elif defined(TARGET_LOONGARCH64)
- // But keep the architecture flag set (its part of CONTEXT_DEBUG_REGISTERS)
- pDispatcherContext->ContextRecord->ContextFlags |= CONTEXT_LOONGARCH64;
-#elif defined(TARGET_RISCV64)
- // But keep the architecture flag set (its part of CONTEXT_DEBUG_REGISTERS)
- pDispatcherContext->ContextRecord->ContextFlags |= CONTEXT_RISCV64;
-#else // TARGET_ARM64
// But keep the architecture flag set (its part of CONTEXT_DEBUG_REGISTERS)
pDispatcherContext->ContextRecord->ContextFlags |= CONTEXT_ARM64;
-#endif // TARGET_ARM
-#endif // TARGET_ARM || TARGET_ARM64 || TARGET_LOONGARCH64 || TARGET_RISCV64
+#endif // TARGET_ARM64
INDEBUG(pDispatcherContext->FunctionEntry = (PT_RUNTIME_FUNCTION)INVALID_POINTER_CD);
INDEBUG(pDispatcherContext->ImageBase = INVALID_POINTER_CD);
@@ -6101,7 +6090,7 @@ HijackHandler(IN PEXCEPTION_RECORD pExceptionRecord,
}
-#endif // !TARGET_UNIX
+#endif // !TARGET_WINDOWS
#ifdef _DEBUG
// IsSafeToUnwindFrameChain:
diff --git a/src/coreclr/vm/frames.h b/src/coreclr/vm/frames.h
index 46b435f94b8d94..f4a528d6f93962 100644
--- a/src/coreclr/vm/frames.h
+++ b/src/coreclr/vm/frames.h
@@ -720,7 +720,6 @@ class Frame : public FrameBase
friend class TailCallFrame;
friend class AppDomain;
friend VOID RealCOMPlusThrow(OBJECTREF);
-
#ifdef _DEBUG
friend LONG WINAPI CLRVectoredExceptionHandlerShim(PEXCEPTION_POINTERS pExceptionInfo);
#endif
diff --git a/src/coreclr/vm/i386/PInvokeStubs.asm b/src/coreclr/vm/i386/PInvokeStubs.asm
index 6f9ec4526a7ead..a0bc18d616bce1 100644
--- a/src/coreclr/vm/i386/PInvokeStubs.asm
+++ b/src/coreclr/vm/i386/PInvokeStubs.asm
@@ -24,7 +24,7 @@ extern _s_gsCookie:DWORD
extern ??_7InlinedCallFrame@@6B@:DWORD
extern _g_TrapReturningThreads:DWORD
-extern @JIT_PInvokeEndRarePath@0:proc
+extern _JIT_PInvokeEndRarePath@0:proc
.686P
.XMM
@@ -103,7 +103,7 @@ _JIT_PInvokeEnd@4 PROC public
ret
RarePath:
- jmp @JIT_PInvokeEndRarePath@0
+ jmp _JIT_PInvokeEndRarePath@0
_JIT_PInvokeEnd@4 ENDP
diff --git a/src/coreclr/vm/i386/excepcpu.h b/src/coreclr/vm/i386/excepcpu.h
index 09f0fa2fc8b725..779b6d61841a65 100644
--- a/src/coreclr/vm/i386/excepcpu.h
+++ b/src/coreclr/vm/i386/excepcpu.h
@@ -89,9 +89,6 @@ EXTERN_C LPVOID STDCALL COMPlusEndCatch(LPVOID ebp, DWORD ebx, DWORD edi, DWORD
// RedirectedHandledJITCaseForXXX_Stub's.
//
PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(CONTEXT * pContext);
-#ifdef FEATURE_EH_FUNCLETS
-PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(T_DISPATCHER_CONTEXT * pDispatcherContext);
-#endif // FEATURE_EH_FUNCLETS
// Determine the address of the instruction that made the current call.
inline
diff --git a/src/coreclr/vm/i386/jithelp.S b/src/coreclr/vm/i386/jithelp.S
index d0275252027814..71df3fa4610841 100644
--- a/src/coreclr/vm/i386/jithelp.S
+++ b/src/coreclr/vm/i386/jithelp.S
@@ -692,3 +692,13 @@ LEAF_END JIT_PatchedWriteBarrierGroup_End, _TEXT
LEAF_ENTRY JIT_PatchedCodeLast, _TEXT
ret
LEAF_END JIT_PatchedCodeLast, _TEXT
+
+LEAF_ENTRY JIT_PollGC, _TEXT
+ PREPARE_EXTERNAL_VAR g_TrapReturningThreads, eax
+ cmp DWORD PTR [eax], 0
+ jnz LOCAL_LABEL(JIT_PollGCRarePath)
+ ret
+LOCAL_LABEL(JIT_PollGCRarePath):
+ PREPARE_EXTERNAL_VAR g_pPollGC, eax
+ jmp [eax]
+LEAF_END JIT_PollGC, _TEXT
diff --git a/src/coreclr/vm/i386/jithelp.asm b/src/coreclr/vm/i386/jithelp.asm
index 536f55e4f5809a..54fce3385044c9 100644
--- a/src/coreclr/vm/i386/jithelp.asm
+++ b/src/coreclr/vm/i386/jithelp.asm
@@ -44,6 +44,9 @@ JIT_TailCallVSDLeave TEXTEQU <_JIT_TailCallVSDLeave@0>
JIT_TailCallHelper TEXTEQU <_JIT_TailCallHelper@4>
JIT_TailCallReturnFromVSD TEXTEQU <_JIT_TailCallReturnFromVSD@0>
+g_pPollGC TEXTEQU <_g_pPollGC>
+g_TrapReturningThreads TEXTEQU <_g_TrapReturningThreads>
+
EXTERN g_ephemeral_low:DWORD
EXTERN g_ephemeral_high:DWORD
EXTERN g_lowest_address:DWORD
@@ -59,6 +62,10 @@ EXTERN _g_TailCallFrameVptr:DWORD
EXTERN @JIT_FailFast@0:PROC
EXTERN _s_gsCookie:DWORD
+EXTERN g_pPollGC:DWORD
+EXTERN g_TrapReturningThreads:DWORD
+
+
ifdef WRITE_BARRIER_CHECK
; Those global variables are always defined, but should be 0 for Server GC
g_GCShadow TEXTEQU
@@ -1149,4 +1156,13 @@ _JIT_StackProbe_End@0 PROC
ret
_JIT_StackProbe_End@0 ENDP
+@JIT_PollGC@0 PROC public
+ cmp [g_TrapReturningThreads], 0
+ jnz JIT_PollGCRarePath
+ ret
+JIT_PollGCRarePath:
+ mov eax, g_pPollGC
+ jmp eax
+@JIT_PollGC@0 ENDP
+
end
diff --git a/src/coreclr/vm/i386/unixstubs.cpp b/src/coreclr/vm/i386/unixstubs.cpp
deleted file mode 100644
index eb6844e1b03825..00000000000000
--- a/src/coreclr/vm/i386/unixstubs.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-#include "common.h"
-
-EXTERN_C VOID JIT_TailCall()
-{
- PORTABILITY_ASSERT("JIT_TailCall");
-}
-
-EXTERN_C VOID JIT_TailCallReturnFromVSD()
-{
- PORTABILITY_ASSERT("JIT_TailCallReturnFromVSD");
-}
-
-EXTERN_C VOID JIT_TailCallVSDLeave()
-{
- PORTABILITY_ASSERT("JIT_TailCallVSDLeave");
-}
-
-EXTERN_C VOID JIT_TailCallLeave()
-{
- PORTABILITY_ASSERT("JIT_TailCallLeave");
-}
-
-PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(T_DISPATCHER_CONTEXT * pDispatcherContext)
-{
- PORTABILITY_ASSERT("GetCONTEXTFromRedirectedStubStackFrame");
- return NULL;
-}
diff --git a/src/coreclr/vm/i386/virtualcallstubcpu.hpp b/src/coreclr/vm/i386/virtualcallstubcpu.hpp
index 34a9c4d86c0ed6..6da58594858d04 100644
--- a/src/coreclr/vm/i386/virtualcallstubcpu.hpp
+++ b/src/coreclr/vm/i386/virtualcallstubcpu.hpp
@@ -690,8 +690,10 @@ StubCallSite::StubCallSite(TADDR siteAddrForRegisterIndirect, PCODE returnAddr)
}
}
+#ifndef UNIX_X86_ABI
// the special return address for VSD tailcalls
extern "C" void STDCALL JIT_TailCallReturnFromVSD();
+#endif // UNIX_X86_ABI
PCODE StubCallSite::GetCallerAddress()
{
diff --git a/src/coreclr/vm/jithelpers.cpp b/src/coreclr/vm/jithelpers.cpp
index e499579b040afa..eeac550b3c0979 100644
--- a/src/coreclr/vm/jithelpers.cpp
+++ b/src/coreclr/vm/jithelpers.cpp
@@ -2134,101 +2134,60 @@ HRESULT EEToProfInterfaceImpl::SetEnterLeaveFunctionHooksForJit(FunctionEnter3 *
//
//========================================================================
-/*************************************************************/
-// Slow helper to tailcall from the fast one
-NOINLINE HCIMPL0(void, JIT_PollGC_Framed)
-{
- BEGIN_PRESERVE_LAST_ERROR;
-
- FCALL_CONTRACT;
- FC_GC_POLL_NOT_NEEDED();
-
- HELPER_METHOD_FRAME_BEGIN_NOPOLL(); // Set up a frame
-#ifdef _DEBUG
- BOOL GCOnTransition = FALSE;
- if (g_pConfig->FastGCStressLevel()) {
- GCOnTransition = GC_ON_TRANSITIONS (FALSE);
- }
-#endif // _DEBUG
- CommonTripThread(); // Indicate we are at a GC safe point
-#ifdef _DEBUG
- if (g_pConfig->FastGCStressLevel()) {
- GC_ON_TRANSITIONS (GCOnTransition);
- }
-#endif // _DEBUG
- HELPER_METHOD_FRAME_END();
- END_PRESERVE_LAST_ERROR;
-}
-HCIMPLEND
-
-HCIMPL0(VOID, JIT_PollGC)
-{
- FCALL_CONTRACT;
-
- // As long as we can have GCPOLL_CALL polls, it would not hurt to check the trap flag.
- if (!g_TrapReturningThreads)
- return;
-
- // Does someone want this thread stopped?
- if (!GetThread()->CatchAtSafePoint())
- return;
-
- // Tailcall to the slow helper
- ENDFORBIDGC();
- HCCALL0(JIT_PollGC_Framed);
-}
-HCIMPLEND
-
-
/*************************************************************/
// This helper is similar to JIT_RareDisableHelper, but has more operations
// tailored to the post-pinvoke operations.
-extern "C" FCDECL0(VOID, JIT_PInvokeEndRarePath);
+extern "C" VOID JIT_PInvokeEndRarePath();
-HCIMPL0(void, JIT_PInvokeEndRarePath)
+void JIT_PInvokeEndRarePath()
{
BEGIN_PRESERVE_LAST_ERROR;
- FCALL_CONTRACT;
-
Thread *thread = GetThread();
- // We need to disable the implicit FORBID GC region that exists inside an FCALL
- // in order to call RareDisablePreemptiveGC().
- FC_CAN_TRIGGER_GC();
+ // We execute RareDisablePreemptiveGC manually before checking any abort conditions
+ // as that operation may run the allocator, etc, and we need to have handled any suspensions requested
+ // by the GC before we reach that point.
thread->RareDisablePreemptiveGC();
- FC_CAN_TRIGGER_GC_END();
- FC_GC_POLL_NOT_NEEDED();
-
- HELPER_METHOD_FRAME_BEGIN_NOPOLL(); // Set up a frame
- thread->HandleThreadAbort();
- HELPER_METHOD_FRAME_END();
+ if (thread->IsAbortRequested())
+ {
+ // This function is called after a pinvoke finishes, in the rare case that either a GC
+ // or ThreadAbort is requested. This means that the pinvoke frame is still on the stack and
+ // enabled, but the thread has been marked as returning to cooperative mode. Thus we can
+ // use that frame to provide GC suspension safety, but we need to manually call EnablePreemptiveGC
+ // and DisablePreemptiveGC to put the function in a state where the BEGIN_QCALL/END_QCALL macros
+ // will work correctly.
+ thread->EnablePreemptiveGC();
+ BEGIN_QCALL;
+ thread->HandleThreadAbort();
+ END_QCALL;
+ thread->DisablePreemptiveGC();
+ }
thread->m_pFrame->Pop(thread);
END_PRESERVE_LAST_ERROR;
}
-HCIMPLEND
/*************************************************************/
// For an inlined N/Direct call (and possibly for other places that need this service)
// we have noticed that the returning thread should trap for one reason or another.
// ECall sets up the frame.
-extern "C" FCDECL0(VOID, JIT_RareDisableHelper);
+extern "C" VOID JIT_RareDisableHelper();
#if defined(TARGET_ARM) || defined(TARGET_AMD64)
// The JIT expects this helper to preserve the return value on AMD64 and ARM. We should eventually
// switch other platforms to the same convention since it produces smaller code.
-extern "C" FCDECL0(VOID, JIT_RareDisableHelperWorker);
+extern "C" VOID JIT_RareDisableHelperWorker();
-HCIMPL0(void, JIT_RareDisableHelperWorker)
+void JIT_RareDisableHelperWorker()
#else
-HCIMPL0(void, JIT_RareDisableHelper)
+void JIT_RareDisableHelper()
#endif
{
- // We do this here (before we set up a frame), because the following scenario
+ // We do this here (before we enter the BEGIN_QCALL macro), because the following scenario
// We are in the process of doing an inlined pinvoke. Since we are in preemtive
// mode, the thread is allowed to continue. The thread continues and gets a context
// switch just after it has cleared the preemptive mode bit but before it gets
@@ -2248,25 +2207,29 @@ HCIMPL0(void, JIT_RareDisableHelper)
BEGIN_PRESERVE_LAST_ERROR;
- FCALL_CONTRACT;
-
Thread *thread = GetThread();
-
- // We need to disable the implicit FORBID GC region that exists inside an FCALL
- // in order to call RareDisablePreemptiveGC().
- FC_CAN_TRIGGER_GC();
+ // We execute RareDisablePreemptiveGC manually before checking any abort conditions
+ // as that operation may run the allocator, etc, and we need to be have have handled any suspensions requested
+ // by the GC before we reach that point.
thread->RareDisablePreemptiveGC();
- FC_CAN_TRIGGER_GC_END();
- FC_GC_POLL_NOT_NEEDED();
-
- HELPER_METHOD_FRAME_BEGIN_NOPOLL(); // Set up a frame
- thread->HandleThreadAbort();
- HELPER_METHOD_FRAME_END();
+ if (thread->IsAbortRequested())
+ {
+ // This function is called after a pinvoke finishes, in the rare case that either a GC
+ // or ThreadAbort is requested. This means that the pinvoke frame is still on the stack and
+ // enabled, but the thread has been marked as returning to cooperative mode. Thus we can
+ // use that frame to provide GC suspension safety, but we need to manually call EnablePreemptiveGC
+ // and DisablePreemptiveGC to put the function in a state where the BEGIN_QCALL/END_QCALL macros
+ // will work correctly.
+ thread->EnablePreemptiveGC();
+ BEGIN_QCALL;
+ thread->HandleThreadAbort();
+ END_QCALL;
+ thread->DisablePreemptiveGC();
+ }
END_PRESERVE_LAST_ERROR;
}
-HCIMPLEND
FCIMPL0(INT32, JIT_GetCurrentManagedThreadId)
{
diff --git a/src/coreclr/vm/jitinterface.cpp b/src/coreclr/vm/jitinterface.cpp
index 0a5e03371994dc..3354a7ec0f2ab4 100644
--- a/src/coreclr/vm/jitinterface.cpp
+++ b/src/coreclr/vm/jitinterface.cpp
@@ -8200,7 +8200,7 @@ bool CEEInfo::canTailCall (CORINFO_METHOD_HANDLE hCaller,
if (!pCaller->IsNoMetadata())
{
- // Do not tailcall from methods that are marked as noinline (people often use no-inline
+ // Do not tailcall from methods that are marked as NoInlining (people often use no-inline
// to mean "I want to always see this method in stacktrace")
DWORD dwImplFlags = 0;
IfFailThrow(pCaller->GetMDImport()->GetMethodImplProps(callerToken, NULL, &dwImplFlags));
@@ -8208,9 +8208,12 @@ bool CEEInfo::canTailCall (CORINFO_METHOD_HANDLE hCaller,
if (IsMiNoInlining(dwImplFlags))
{
result = false;
- szFailReason = "Caller is marked as no inline";
+ szFailReason = "Caller is marked as NoInlining";
goto exit;
}
+
+ // NOTE: we don't have to handle NoOptimization here, because JIT is not expected
+ // to emit fast tail calls if optimizations are disabled.
}
// Methods with StackCrawlMark depend on finding their caller on the stack.
@@ -12613,8 +12616,8 @@ CorJitResult invokeCompileMethod(EEJitManager *jitMgr,
flags.Set(CORJIT_FLAGS::CORJIT_FLAG_MIN_OPT);
}
- // Always emit frames for methods marked no-inline (see #define ETW_EBP_FRAMED in the JIT)
- if (IsMiNoInlining(dwImplFlags))
+ // Always emit frames for methods marked NoInlining or NoOptimization (see #define ETW_EBP_FRAMED in the JIT)
+ if (IsMiNoInlining(dwImplFlags) || IsMiNoOptimization(dwImplFlags))
{
flags.Set(CORJIT_FLAGS::CORJIT_FLAG_FRAMED);
}
diff --git a/src/coreclr/vm/jitinterface.h b/src/coreclr/vm/jitinterface.h
index 2dd59db18807cb..1d20db72f5f244 100644
--- a/src/coreclr/vm/jitinterface.h
+++ b/src/coreclr/vm/jitinterface.h
@@ -109,6 +109,8 @@ BOOL LoadDynamicInfoEntry(Module *currentModule,
// The portable helper is used if the platform does not provide optimized implementation.
//
+EXTERN_C FCDECL0(void, JIT_PollGC);
+
#ifndef JIT_MonEnter
#define JIT_MonEnter JIT_MonEnter_Portable
#endif
@@ -352,24 +354,19 @@ extern "C"
{
#ifndef FEATURE_EH_FUNCLETS
void STDCALL JIT_EndCatch(); // JIThelp.asm/JIThelp.s
-#endif // TARGET_X86
+#endif // FEATURE_EH_FUNCLETS
void STDCALL JIT_ByRefWriteBarrier(); // JIThelp.asm/JIThelp.s
-#if defined(TARGET_AMD64) || defined(TARGET_ARM)
-
- FCDECL2VA(void, JIT_TailCall, PCODE copyArgs, PCODE target);
-
-#else // TARGET_AMD64 || TARGET_ARM
-
+#if defined(TARGET_X86) && !defined(UNIX_X86_ABI)
void STDCALL JIT_TailCall(); // JIThelp.asm
-
-#endif // TARGET_AMD64 || TARGET_ARM
+#endif // defined(TARGET_X86) && !defined(UNIX_X86_ABI)
void STDMETHODCALLTYPE JIT_ProfilerEnterLeaveTailcallStub(UINT_PTR ProfilerHandle);
#if !defined(TARGET_ARM64) && !defined(TARGET_LOONGARCH64) && !defined(TARGET_RISCV64)
+ // TODO: implement stack probing for other architectures https://github.com/dotnet/runtime/issues/13519
void STDCALL JIT_StackProbe();
-#endif // TARGET_ARM64
+#endif // !defined(TARGET_ARM64) && !defined(TARGET_LOONGARCH64) && !defined(TARGET_RISCV64)
};
/*********************************************************************/
@@ -1032,7 +1029,6 @@ OBJECTHANDLE ConstructStringLiteral(CORINFO_MODULE_HANDLE scopeHnd, mdToken meta
FCDECL2(Object*, JIT_Box_MP_FastPortable, CORINFO_CLASS_HANDLE type, void* data);
FCDECL2(Object*, JIT_Box, CORINFO_CLASS_HANDLE type, void* data);
-FCDECL0(VOID, JIT_PollGC);
BOOL ObjIsInstanceOf(Object *pObject, TypeHandle toTypeHnd, BOOL throwCastException = FALSE);
diff --git a/src/coreclr/vm/loongarch64/asmhelpers.S b/src/coreclr/vm/loongarch64/asmhelpers.S
index 9a40cf8660a130..6be20320f9850c 100644
--- a/src/coreclr/vm/loongarch64/asmhelpers.S
+++ b/src/coreclr/vm/loongarch64/asmhelpers.S
@@ -1121,3 +1121,14 @@ LEAF_ENTRY GetTLSResolverAddress, _TEXT
EPILOG_RETURN
LEAF_END GetTLSResolverAddress, _TEXT
// ------------------------------------------------------------------
+
+LEAF_ENTRY JIT_PollGC, _TEXT
+ PREPARE_EXTERNAL_VAR g_TrapReturningThreads, $t0
+ ld.w $t0, $t0, 0
+ bne $t0, $zero, LOCAL_LABEL(JIT_PollGCRarePath)
+ jirl $r0, $ra, 0
+LOCAL_LABEL(JIT_PollGCRarePath):
+ PREPARE_EXTERNAL_VAR g_pPollGC, $t0
+ ld.d $t0, $t0, 0
+ EPILOG_BRANCH_REG $t0
+LEAF_END JIT_PollGC, _TEXT
diff --git a/src/coreclr/vm/loongarch64/excepcpu.h b/src/coreclr/vm/loongarch64/excepcpu.h
index 4146f7c6bd9417..8d2e1fdbbd2c07 100644
--- a/src/coreclr/vm/loongarch64/excepcpu.h
+++ b/src/coreclr/vm/loongarch64/excepcpu.h
@@ -24,15 +24,8 @@ class FaultingExceptionFrame;
// Retrieves the redirected CONTEXT* from the stack frame of one of the
// RedirectedHandledJITCaseForXXX_Stub's.
//
-PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(T_DISPATCHER_CONTEXT * pDispatcherContext);
PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(T_CONTEXT * pContext);
-//
-// Retrieves the FaultingExceptionFrame* from the stack frame of
-// RedirectForThrowControl.
-//
-FaultingExceptionFrame *GetFrameFromRedirectedStubStackFrame (T_DISPATCHER_CONTEXT *pDispatcherContext);
-
inline
PCODE GetAdjustedCallAddress(PCODE returnAddress)
{
diff --git a/src/coreclr/vm/loongarch64/stubs.cpp b/src/coreclr/vm/loongarch64/stubs.cpp
index c8e612ea2a9159..391c6fdf4cdd9e 100644
--- a/src/coreclr/vm/loongarch64/stubs.cpp
+++ b/src/coreclr/vm/loongarch64/stubs.cpp
@@ -892,11 +892,6 @@ void emitCOMStubCall (ComCallMethodDesc *pCOMMethodRX, ComCallMethodDesc *pCOMMe
#endif // FEATURE_COMINTEROP
-void JIT_TailCall()
-{
- _ASSERTE(!"LOONGARCH64:NYI");
-}
-
#if !defined(DACCESS_COMPILE)
EXTERN_C void JIT_UpdateWriteBarrierState(bool skipEphemeralCheck, size_t writeableOffset);
@@ -949,15 +944,6 @@ void InitJITHelpers1()
void UpdateWriteBarrierState(bool) {}
#endif // !defined(DACCESS_COMPILE)
-PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(T_DISPATCHER_CONTEXT * pDispatcherContext)
-{
- LIMITED_METHOD_DAC_CONTRACT;
-
- DWORD64 stackSlot = pDispatcherContext->EstablisherFrame + REDIRECTSTUB_SP_OFFSET_CONTEXT;
- PTR_PTR_CONTEXT ppContext = dac_cast((TADDR)stackSlot);
- return *ppContext;
-}
-
PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(T_CONTEXT * pContext)
{
LIMITED_METHOD_DAC_CONTRACT;
@@ -968,13 +954,6 @@ PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(T_CONTEXT * pContext)
}
#if !defined(DACCESS_COMPILE)
-FaultingExceptionFrame *GetFrameFromRedirectedStubStackFrame (DISPATCHER_CONTEXT *pDispatcherContext)
-{
- LIMITED_METHOD_CONTRACT;
-
- return (FaultingExceptionFrame*)((TADDR)pDispatcherContext->ContextRecord->S0);
-}
-
BOOL
AdjustContextForVirtualStub(
diff --git a/src/coreclr/vm/methodtablebuilder.cpp b/src/coreclr/vm/methodtablebuilder.cpp
index 69d5aa64d34ec1..60110263e4a274 100644
--- a/src/coreclr/vm/methodtablebuilder.cpp
+++ b/src/coreclr/vm/methodtablebuilder.cpp
@@ -5219,9 +5219,8 @@ MethodTableBuilder::InitNewMethodDesc(
}
}
- // Turn off inlining for any calls
- // that are marked in the metadata as not being inlineable.
- if(IsMiNoInlining(pMethod->GetImplAttrs()))
+ // Turn off inlining for any calls that are marked in the metadata as NoInlining or NoOptimization.
+ if (IsMiNoInlining(pMethod->GetImplAttrs()) || IsMiNoOptimization(pMethod->GetImplAttrs()))
{
pNewMD->SetNotInline(true);
}
diff --git a/src/coreclr/vm/ppc64le/unixstubs.cpp b/src/coreclr/vm/ppc64le/unixstubs.cpp
deleted file mode 100644
index d51902a949f26c..00000000000000
--- a/src/coreclr/vm/ppc64le/unixstubs.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-#include "common.h"
-
-extern "C"
-{
- void RedirectForThrowControl()
- {
- PORTABILITY_ASSERT("Implement for PAL");
- }
-};
diff --git a/src/coreclr/vm/qcallentrypoints.cpp b/src/coreclr/vm/qcallentrypoints.cpp
index 2836faa8b8fce8..085468f030e9b1 100644
--- a/src/coreclr/vm/qcallentrypoints.cpp
+++ b/src/coreclr/vm/qcallentrypoints.cpp
@@ -294,6 +294,7 @@ static const Entry s_QCall[] =
DllImportEntry(ThreadNative_SpinWait)
DllImportEntry(ThreadNative_Interrupt)
DllImportEntry(ThreadNative_Sleep)
+ DllImportEntry(ThreadNative_PollGC)
#ifdef FEATURE_COMINTEROP
DllImportEntry(ThreadNative_DisableComObjectEagerCleanup)
#endif // FEATURE_COMINTEROP
diff --git a/src/coreclr/vm/riscv64/asmhelpers.S b/src/coreclr/vm/riscv64/asmhelpers.S
index 8a14864b51f6d9..12b2918ae31e63 100644
--- a/src/coreclr/vm/riscv64/asmhelpers.S
+++ b/src/coreclr/vm/riscv64/asmhelpers.S
@@ -82,8 +82,8 @@ WRITE_BARRIER_ENTRY JIT_UpdateWriteBarrierState
beq t0, zero, LOCAL_LABEL(EphemeralCheckEnabled)
- ori a5, zero, 0
- addi a6, zero, -1
+ li a5, 0
+ li a6, -1
LOCAL_LABEL(EphemeralCheckEnabled):
lla a7, g_lowest_address
@@ -253,7 +253,7 @@ LOCAL_LABEL(ShadowUpdateDisabled):
lb t0, 0(t6)
bne t0, zero, LOCAL_LABEL(CheckCardTable)
- ori t0, zero, 0xFF
+ li t0, 0xFF
sb t0, 0(t6)
LOCAL_LABEL(CheckCardTable):
@@ -277,7 +277,7 @@ LOCAL_LABEL(SkipEphemeralCheck):
srli t0, t3, 11
add t4, t6, t0
lbu t1, 0(t4)
- ori t0, zero, 0xFF
+ li t0, 0xFF
beq t1, t0, LOCAL_LABEL(Exit)
sb t0, 0(t4)
@@ -290,7 +290,7 @@ LOCAL_LABEL(SkipEphemeralCheck):
add t4, t6, t0
lbu t6, 0(t4)
- ori t0, zero, 0xFF
+ li t0, 0xFF
beq t6, t0, LOCAL_LABEL(Exit)
sb t0, 0(t4)
@@ -968,3 +968,14 @@ LEAF_ENTRY GetThreadStaticsVariableOffset, _TEXT
la.tls.ie a0, t_ThreadStatics
EPILOG_RETURN
LEAF_END GetThreadStaticsVariableOffset, _TEXT
+
+LEAF_ENTRY JIT_PollGC, _TEXT
+ PREPARE_EXTERNAL_VAR g_TrapReturningThreads, t0
+ lw t0, 0(t0)
+ bnez t0, LOCAL_LABEL(JIT_PollGCRarePath)
+ ret
+LOCAL_LABEL(JIT_PollGCRarePath):
+ PREPARE_EXTERNAL_VAR g_pPollGC, t0
+ ld t0, 0(t0)
+ jr t0
+LEAF_END JIT_PollGC, _TEXT
\ No newline at end of file
diff --git a/src/coreclr/vm/riscv64/excepcpu.h b/src/coreclr/vm/riscv64/excepcpu.h
index eb575235af8feb..416828487517d8 100644
--- a/src/coreclr/vm/riscv64/excepcpu.h
+++ b/src/coreclr/vm/riscv64/excepcpu.h
@@ -28,15 +28,8 @@ class FaultingExceptionFrame;
// Retrieves the redirected CONTEXT* from the stack frame of one of the
// RedirectedHandledJITCaseForXXX_Stub's.
//
-PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(T_DISPATCHER_CONTEXT * pDispatcherContext);
PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(T_CONTEXT * pContext);
-//
-// Retrieves the FaultingExceptionFrame* from the stack frame of
-// RedirectForThrowControl.
-//
-FaultingExceptionFrame *GetFrameFromRedirectedStubStackFrame (T_DISPATCHER_CONTEXT *pDispatcherContext);
-
inline
PCODE GetAdjustedCallAddress(PCODE returnAddress)
{
diff --git a/src/coreclr/vm/riscv64/pinvokestubs.S b/src/coreclr/vm/riscv64/pinvokestubs.S
index 9f8cecb3bff43b..d96a581b8d8570 100644
--- a/src/coreclr/vm/riscv64/pinvokestubs.S
+++ b/src/coreclr/vm/riscv64/pinvokestubs.S
@@ -137,7 +137,7 @@
// a1 = pThread
// pThread->m_fPreemptiveGCDisabled = 1
- ori t4, x0, 1
+ li t4, 1
sw t4, (Thread_m_fPreemptiveGCDisabled)(a1)
// Check return trap
diff --git a/src/coreclr/vm/riscv64/stubs.cpp b/src/coreclr/vm/riscv64/stubs.cpp
index 3d48d68a4163f5..0d3d0e2f80d7cd 100644
--- a/src/coreclr/vm/riscv64/stubs.cpp
+++ b/src/coreclr/vm/riscv64/stubs.cpp
@@ -790,11 +790,6 @@ void emitCOMStubCall (ComCallMethodDesc *pCOMMethodRX, ComCallMethodDesc *pCOMMe
}
#endif // FEATURE_COMINTEROP
-void JIT_TailCall()
-{
- _ASSERTE(!"RISCV64:NYI");
-}
-
#if !defined(DACCESS_COMPILE)
EXTERN_C void JIT_UpdateWriteBarrierState(bool skipEphemeralCheck, size_t writeableOffset);
@@ -847,15 +842,6 @@ void InitJITHelpers1()
void UpdateWriteBarrierState(bool) {}
#endif // !defined(DACCESS_COMPILE)
-PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(T_DISPATCHER_CONTEXT * pDispatcherContext)
-{
- LIMITED_METHOD_DAC_CONTRACT;
-
- DWORD64 stackSlot = pDispatcherContext->EstablisherFrame + REDIRECTSTUB_SP_OFFSET_CONTEXT;
- PTR_PTR_CONTEXT ppContext = dac_cast((TADDR)stackSlot);
- return *ppContext;
-}
-
PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(T_CONTEXT * pContext)
{
LIMITED_METHOD_DAC_CONTRACT;
@@ -866,14 +852,6 @@ PTR_CONTEXT GetCONTEXTFromRedirectedStubStackFrame(T_CONTEXT * pContext)
}
#if !defined(DACCESS_COMPILE)
-FaultingExceptionFrame *GetFrameFromRedirectedStubStackFrame (DISPATCHER_CONTEXT *pDispatcherContext)
-{
- _ASSERTE(!"RISCV64: not implementation on riscv64!!!");
- LIMITED_METHOD_CONTRACT;
-
- return (FaultingExceptionFrame*)NULL;
-}
-
BOOL
AdjustContextForVirtualStub(
diff --git a/src/coreclr/vm/riscv64/unixstubs.cpp b/src/coreclr/vm/riscv64/unixstubs.cpp
deleted file mode 100644
index 878d5b003686b6..00000000000000
--- a/src/coreclr/vm/riscv64/unixstubs.cpp
+++ /dev/null
@@ -1,4 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-#include "common.h"
diff --git a/src/coreclr/vm/s390x/unixstubs.cpp b/src/coreclr/vm/s390x/unixstubs.cpp
deleted file mode 100644
index d51902a949f26c..00000000000000
--- a/src/coreclr/vm/s390x/unixstubs.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-#include "common.h"
-
-extern "C"
-{
- void RedirectForThrowControl()
- {
- PORTABILITY_ASSERT("Implement for PAL");
- }
-};
diff --git a/src/installer/pkg/projects/Microsoft.NETCore.DotNetAppHost/Microsoft.NETCore.DotNetAppHost.pkgproj b/src/installer/pkg/projects/Microsoft.NETCore.DotNetAppHost/Microsoft.NETCore.DotNetAppHost.pkgproj
index 6f50203e9056c1..fcae5c30d7a086 100644
--- a/src/installer/pkg/projects/Microsoft.NETCore.DotNetAppHost/Microsoft.NETCore.DotNetAppHost.pkgproj
+++ b/src/installer/pkg/projects/Microsoft.NETCore.DotNetAppHost/Microsoft.NETCore.DotNetAppHost.pkgproj
@@ -11,7 +11,7 @@
-
+
diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Host.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Host.sfxproj
index fc7b8b90fe9070..078991b13e8292 100644
--- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Host.sfxproj
+++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Host.sfxproj
@@ -2,7 +2,7 @@
- true
+ true
AppHostPack
true
dotnet-apphost-pack
@@ -31,7 +31,7 @@
-
+
diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.CoreCLR.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.CoreCLR.sfxproj
new file mode 100644
index 00000000000000..18ad16cfff4501
--- /dev/null
+++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.CoreCLR.sfxproj
@@ -0,0 +1,84 @@
+
+
+ CoreCLR
+ false
+ coreclr-pack
+
+
+
+
+
+ RuntimePack
+ dotnet-runtime
+ dotnet-runtime-internal
+ false
+ NetCore.SharedFramework
+ true
+ true
+
+
+
+
+
+
+
+ true
+
+ false
+
+ false
+ true
+ true
+ $(PublishReadyToRun)
+
+
+
+
+
+ true
+
+
+
+
+
+ $([MSBuild]::NormalizePath('$(Crossgen2InBuildDir)', 'crossgen2$(ExeSuffix)'))
+
+
+
+
+
+
+
+
+
+
+
+ tools
+
+
+
+
+
+
+
+
+
+
+ tools/$(CoreCLRCrossTargetComponentDirName)_$(TargetArchitecture)
+
+
+ tools/$(CoreCLRCrossTargetComponentDirName)_$(TargetArchitecture)
+
+
+
+
+
+
diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.Mono.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.Mono.sfxproj
new file mode 100644
index 00000000000000..f074aa4c2e5e06
--- /dev/null
+++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.Mono.sfxproj
@@ -0,0 +1,73 @@
+
+
+ Mono
+ false
+ mono-pack
+
+
+
+
+
+
+ RuntimePack
+ true
+ true
+
+
+
+ true
+
+
+
+ false
+ true
+ true
+ true
+
+
+
+ Mono
+ false
+
+
+ Mono.LLVM
+ false
+
+
+ Mono.LLVM.AOT
+ false
+
+
+ Mono.multithread
+
+
+ $(SharedFrameworkName).Runtime.$(RuntimeSpecificFrameworkSuffix).$(RuntimeIdentifier)
+
+
+
+
+
+
+
+ runtimes/$(RuntimeIdentifier)/native/Mono.release.framework/%(RecursiveDir)
+
+
+
+ runtimes/$(RuntimeIdentifier)/native/Mono.debug.framework/%(RecursiveDir)
+
+
+
+ runtimes/$(RuntimeIdentifier)/native/include/%(RecursiveDir)
+
+
+
+ runtimes/$(RuntimeIdentifier)/build/%(RecursiveDir)
+
+
+
+
+
diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.NativeAOT.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.NativeAOT.sfxproj
new file mode 100644
index 00000000000000..336574ffe10fc7
--- /dev/null
+++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.NativeAOT.sfxproj
@@ -0,0 +1,39 @@
+
+
+ CoreCLR
+ true
+ naot-pack
+
+
+
+
+
+
+ RuntimePack
+ true
+ true
+ true
+ false
+ $(SharedFrameworkName).Runtime.NativeAOT.$(RuntimeIdentifier)
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+ true
+
+
+
+
diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.props b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.props
index ea2a155cb59066..f64d11dfae3551 100644
--- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.props
+++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.props
@@ -5,61 +5,26 @@
AddRuntimeFilesToPackage;
AddFrameworkFilesToPackage
- true
- false
-
- false
-
- false
true
true
The .NET Shared Framework
- $(PublishReadyToRun)
-
- NativeAOT
-
-
- Mono
- false
-
-
- Mono.LLVM
- false
-
-
- Mono.LLVM.AOT
- false
-
-
- Mono.multithread
-
-
- $(SharedFrameworkName).Runtime.$(RuntimeSpecificFrameworkSuffix).$(RuntimeIdentifier)
-
-
-
-
+
+
+
-
-
-
-
-
-
-
<_HostFiles Include="$(DotNetHostBinDir)/$(LibPrefix)hostpolicy$(LibSuffix)" />
<_HostFiles Include="$(DotNetHostBinDir)/$(LibPrefix)hostfxr$(LibSuffix)" PackOnly="true" />
@@ -74,80 +39,29 @@
runtimes/$(RuntimeIdentifier)/native
-
-
-
- tools
-
-
-
- runtimes/$(RuntimeIdentifier)/native/Mono.release.framework/%(RecursiveDir)
-
-
-
- runtimes/$(RuntimeIdentifier)/native/Mono.debug.framework/%(RecursiveDir)
-
-
-
- runtimes/$(RuntimeIdentifier)/native/include/%(RecursiveDir)
-
-
-
- runtimes/$(RuntimeIdentifier)/build/%(RecursiveDir)
-
-
-
- runtimes/$(CoreCLRCrossTargetComponentDirName)_$(TargetArchitecture)/native
-
-
- tools/$(CoreCLRCrossTargetComponentDirName)_$(TargetArchitecture)
-
-
- tools/$(CoreCLRCrossTargetComponentDirName)_$(TargetArchitecture)
-
-
- tools/$(CoreCLRCrossTargetComponentDirName)_$(TargetArchitecture)
-
-
- tools
-
-
-
-
+
+ Condition="'%(LibrariesRuntimeFiles.Extension)' != '$(StaticLibSuffix)' or '$(IncludeStaticLibrariesInPack)' == 'true'">
runtimes/$(RuntimeIdentifier)/native/%(LibrariesRuntimeFiles.NativeSubDirectory)%(RecursiveDir)
-
-
- <_diaSymArch>$(_hostArch)
- <_diaSymReaderPath>$(PkgMicrosoft_DiaSymReader_Native)/runtimes/win/native/Microsoft.DiaSymReader.Native.$(_diaSymArch).dll
-
+
<_diaSymTargetArch>$(TargetArchitecture)
<_diaSymTargetArch Condition="'$(TargetArchitecture)' == 'x64'">amd64
<_diaSymReaderTargetArchPath>$(PkgMicrosoft_DiaSymReader_Native)/runtimes/win/native/Microsoft.DiaSymReader.Native.$(_diaSymTargetArch).dll
-
+
-
- runtimes/$(CoreCLRCrossTargetComponentDirName)_$(TargetArchitecture)/native
-
@@ -169,37 +83,10 @@
-
+
-
-
- true
-
-
-
-
-
-
- tools
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
+
diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.sfxproj
deleted file mode 100644
index e963032de1005e..00000000000000
--- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Runtime.sfxproj
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
-
- RuntimePack
- dotnet-runtime-internal
- dotnet-runtime
- dotnet-runtime-internal
- true
- false
- dotnet-runtime-symbols
- NetCore.SharedFramework
- true
- true
-
-
-
- true
-
- true
-
-
-
-
-
-
-
-
-
-
diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.MonoCrossAOT.Sdk.props.in b/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.Sdk.props.in
similarity index 100%
rename from src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.MonoCrossAOT.Sdk.props.in
rename to src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.Sdk.props.in
diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.MonoCrossAOT.UnixFilePermissions.xml.in b/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.UnixFilePermissions.xml.in
similarity index 100%
rename from src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.MonoCrossAOT.UnixFilePermissions.xml.in
rename to src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.UnixFilePermissions.xml.in
diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.android-arm.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.android-arm.sfxproj
new file mode 100644
index 00000000000000..33bf3321c0eb9c
--- /dev/null
+++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.android-arm.sfxproj
@@ -0,0 +1,8 @@
+
+
+
+ android-arm
+
+
+
+
diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.android-arm64.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.android-arm64.sfxproj
new file mode 100644
index 00000000000000..ee259d7812b9fc
--- /dev/null
+++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.android-arm64.sfxproj
@@ -0,0 +1,8 @@
+
+
+
+ android-arm64
+
+
+
+
diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.android-x64.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.android-x64.sfxproj
new file mode 100644
index 00000000000000..6574e57fd4db27
--- /dev/null
+++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.android-x64.sfxproj
@@ -0,0 +1,8 @@
+
+
+
+ android-x64
+
+
+
+
diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.android-x86.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.android-x86.sfxproj
new file mode 100644
index 00000000000000..b4279f57110d84
--- /dev/null
+++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.android-x86.sfxproj
@@ -0,0 +1,8 @@
+
+
+
+ android-x86
+
+
+
+
diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.browser-wasm.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.browser-wasm.sfxproj
new file mode 100644
index 00000000000000..19b7059c546e37
--- /dev/null
+++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.browser-wasm.sfxproj
@@ -0,0 +1,8 @@
+
+
+
+ browser-wasm
+
+
+
+
diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.ios-arm64.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.ios-arm64.sfxproj
new file mode 100644
index 00000000000000..0395c9e026647d
--- /dev/null
+++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.ios-arm64.sfxproj
@@ -0,0 +1,8 @@
+
+
+
+ ios-arm64
+
+
+
+
diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.iossimulator-arm64.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.iossimulator-arm64.sfxproj
new file mode 100644
index 00000000000000..245c0aceebfc86
--- /dev/null
+++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.iossimulator-arm64.sfxproj
@@ -0,0 +1,8 @@
+
+
+
+ iossimulator-arm64
+
+
+
+
diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.iossimulator-x64.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.iossimulator-x64.sfxproj
new file mode 100644
index 00000000000000..e4aa8896ac855e
--- /dev/null
+++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.iossimulator-x64.sfxproj
@@ -0,0 +1,8 @@
+
+
+
+ iossimulator-x64
+
+
+
+
diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.maccatalyst-arm64.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.maccatalyst-arm64.sfxproj
new file mode 100644
index 00000000000000..7625df228fc760
--- /dev/null
+++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.maccatalyst-arm64.sfxproj
@@ -0,0 +1,8 @@
+
+
+
+ maccatalyst-arm64
+
+
+
+
diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.maccatalyst-x64.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.maccatalyst-x64.sfxproj
new file mode 100644
index 00000000000000..7382e99e054f91
--- /dev/null
+++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.maccatalyst-x64.sfxproj
@@ -0,0 +1,8 @@
+
+
+
+ maccatalyst-x64
+
+
+
+
diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.MonoCrossAOT.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.props
similarity index 85%
rename from src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.MonoCrossAOT.sfxproj
rename to src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.props
index 74b9b1462dccc4..4394697562706b 100644
--- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.MonoCrossAOT.sfxproj
+++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.props
@@ -1,19 +1,15 @@
-
-
-
+
true
- RuntimePack
+ ToolPack
Microsoft.NETCore.App.MonoCrossAOT
Microsoft.NETCore.App.Runtime.AOT.$(RuntimeIdentifier).Cross.$(TargetCrossRid)
- monocrossaot
linux-x64;linux-arm64;linux-musl-x64;linux-musl-arm64;osx-x64;osx-arm64;win-x64;win-arm64
false
- false
- tools/
true
- mono-aot-cross
- $(AotCompilerFileName).exe
+ mono-aot-cross$(ExeSuffix)
+ true
+ ../PACKAGE.md
@@ -58,5 +54,4 @@
-
diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.tvos-arm64.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.tvos-arm64.sfxproj
new file mode 100644
index 00000000000000..dcee36b4c8cecd
--- /dev/null
+++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.tvos-arm64.sfxproj
@@ -0,0 +1,8 @@
+
+
+
+ tvos-arm64
+
+
+
+
diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.tvossimulator-arm64.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.tvossimulator-arm64.sfxproj
new file mode 100644
index 00000000000000..277b5aa1fdf4f7
--- /dev/null
+++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.tvossimulator-arm64.sfxproj
@@ -0,0 +1,8 @@
+
+
+
+ tvossimulator-arm64
+
+
+
+
diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.tvossimulator-x64.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.tvossimulator-x64.sfxproj
new file mode 100644
index 00000000000000..223592b08d753d
--- /dev/null
+++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.tvossimulator-x64.sfxproj
@@ -0,0 +1,8 @@
+
+
+
+ tvossimulator-x64
+
+
+
+
diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.wasi-wasm.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.wasi-wasm.sfxproj
new file mode 100644
index 00000000000000..36b9e2dcd7c6fb
--- /dev/null
+++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/MonoCrossAOT/Microsoft.NETCore.App.MonoCrossAOT.wasi-wasm.sfxproj
@@ -0,0 +1,8 @@
+
+
+
+ wasi-wasm
+
+
+
+
diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/ReadyToRun.targets b/src/installer/pkg/sfx/Microsoft.NETCore.App/ReadyToRun.targets
deleted file mode 100644
index 1e27f828c5bf58..00000000000000
--- a/src/installer/pkg/sfx/Microsoft.NETCore.App/ReadyToRun.targets
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
- 1
- $([MSBuild]::NormalizePath('$(Crossgen2InBuildDir)', 'crossgen2$(ExeSuffix)'))
-
-
-
-
-
-
-
diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/monocrossaot.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/monocrossaot.proj
similarity index 52%
rename from src/installer/pkg/sfx/Microsoft.NETCore.App/monocrossaot.sfxproj
rename to src/installer/pkg/sfx/Microsoft.NETCore.App/monocrossaot.proj
index 08da76561f220b..1f904f0d515fbe 100644
--- a/src/installer/pkg/sfx/Microsoft.NETCore.App/monocrossaot.sfxproj
+++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/monocrossaot.proj
@@ -8,23 +8,17 @@
$(MonoAotTargets);iossimulator-x64;iossimulator-arm64;ios-arm64
$(MonoAotTargets);maccatalyst-x64;maccatalyst-arm64
$(MonoAotTargets);wasi-wasm
+ true
-
-
+
+
+
+
+
+
+
-
-
-
-
-
-
-
diff --git a/src/installer/pkg/sfx/bundle/Microsoft.NETCore.App.Bundle.bundleproj b/src/installer/pkg/sfx/bundle/Microsoft.NETCore.App.Bundle.bundleproj
index 178a37fed055bb..d2701902038ee9 100644
--- a/src/installer/pkg/sfx/bundle/Microsoft.NETCore.App.Bundle.bundleproj
+++ b/src/installer/pkg/sfx/bundle/Microsoft.NETCore.App.Bundle.bundleproj
@@ -5,7 +5,7 @@
Name, used to generate the bundle upgrade code. Must stay the same to allow bundles in a given
product band to upgrade in place.
-->
- true
+ true
false
.NET Core Shared Framework Bundle Installer
$(MSBuildProjectDirectory)
@@ -24,7 +24,8 @@
-
+
+
diff --git a/src/installer/pkg/sfx/installers.proj b/src/installer/pkg/sfx/installers.proj
index 257ff4cc7593bd..41fe958ed6bb40 100644
--- a/src/installer/pkg/sfx/installers.proj
+++ b/src/installer/pkg/sfx/installers.proj
@@ -1,6 +1,8 @@
-
+
+
+
diff --git a/src/installer/tests/TestUtils/NetCoreAppBuilder.cs b/src/installer/tests/TestUtils/NetCoreAppBuilder.cs
index d2099b3ebfc4b3..636b8260af6af0 100644
--- a/src/installer/tests/TestUtils/NetCoreAppBuilder.cs
+++ b/src/installer/tests/TestUtils/NetCoreAppBuilder.cs
@@ -356,8 +356,10 @@ public NetCoreAppBuilder WithStandardRuntimeFallbacks()
.WithRuntimeFallbacks("win-x86", "win", "any")
.WithRuntimeFallbacks("win", "any")
.WithRuntimeFallbacks("linux-arm64", "linux", "any")
+ .WithRuntimeFallbacks("linux-riscv64", "linux", "any")
.WithRuntimeFallbacks("linux-x64", "linux", "any")
.WithRuntimeFallbacks("linux-musl-arm64", "linux-musl", "linux", "any")
+ .WithRuntimeFallbacks("linux-musl-riscv64", "linux-musl", "linux", "any")
.WithRuntimeFallbacks("linux-musl-x64", "linux-musl", "linux", "any")
.WithRuntimeFallbacks("linux", "any")
.WithRuntimeFallbacks("osx.10.12-x64", "osx-x64", "osx", "any")
diff --git a/src/installer/tests/pretest.proj b/src/installer/tests/hostpretest.proj
similarity index 60%
rename from src/installer/tests/pretest.proj
rename to src/installer/tests/hostpretest.proj
index b97a2e77c2e131..98b493566a73c4 100644
--- a/src/installer/tests/pretest.proj
+++ b/src/installer/tests/hostpretest.proj
@@ -8,13 +8,18 @@
+
+
+
+
+
-
+ Properties="MSBuildRestoreSessionId=$([System.Guid]::NewGuid())" />
diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.InitializeTerminalAndSignalHandling.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.InitializeTerminalAndSignalHandling.cs
index 9824f62e29fef2..fccf35c24ec8cd 100644
--- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.InitializeTerminalAndSignalHandling.cs
+++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.InitializeTerminalAndSignalHandling.cs
@@ -14,5 +14,8 @@ internal static partial class Sys
[LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetKeypadXmit", StringMarshalling = StringMarshalling.Utf8)]
internal static partial void SetKeypadXmit(SafeFileHandle terminalHandle, string terminfoString);
+
+ [LibraryImport(Libraries.SystemNative, EntryPoint = "SystemNative_UninitializeTerminal")]
+ internal static partial void UninitializeTerminal();
}
}
diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs
index f8fa8b7d736c0f..1fe9ee1ffb9200 100644
--- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs
+++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.OpenSsl.cs
@@ -408,7 +408,7 @@ internal static SafeSslHandle AllocateSslHandle(SslAuthenticationOptions sslAuth
if (sslAuthenticationOptions.IsClient)
{
- if (!string.IsNullOrEmpty(sslAuthenticationOptions.TargetHost) && !TargetHostNameHelper.IsValidAddress(sslAuthenticationOptions.TargetHost))
+ if (!string.IsNullOrEmpty(sslAuthenticationOptions.TargetHost) && !IPAddress.IsValid(sslAuthenticationOptions.TargetHost))
{
// Similar to windows behavior, set SNI on openssl by default for client context, ignore errors.
if (!Ssl.SslSetTlsExtHostName(sslHandle, sslAuthenticationOptions.TargetHost))
diff --git a/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/StreamExtensions.netstandard.cs b/src/libraries/Common/src/System/IO/StreamExtensions.netstandard.cs
similarity index 97%
rename from src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/StreamExtensions.netstandard.cs
rename to src/libraries/Common/src/System/IO/StreamExtensions.netstandard.cs
index d19a30d1d15750..368d80094fabd4 100644
--- a/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/StreamExtensions.netstandard.cs
+++ b/src/libraries/Common/src/System/IO/StreamExtensions.netstandard.cs
@@ -1,15 +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 System.Buffers;
-using System.Collections.Generic;
using System.Runtime.InteropServices;
-using System.Text;
using System.Threading;
using System.Threading.Tasks;
-namespace System.IO.Pipelines
+namespace System.IO
{
// Helpers to write Memory to Stream on netstandard 2.0
internal static class StreamExtensions
diff --git a/src/libraries/Common/src/System/Net/ArrayBuffer.cs b/src/libraries/Common/src/System/Net/ArrayBuffer.cs
index 7499861512f4b3..e07ff3ea333ceb 100644
--- a/src/libraries/Common/src/System/Net/ArrayBuffer.cs
+++ b/src/libraries/Common/src/System/Net/ArrayBuffer.cs
@@ -21,6 +21,12 @@ namespace System.Net
[StructLayout(LayoutKind.Auto)]
internal struct ArrayBuffer : IDisposable
{
+#if NET
+ private static int ArrayMaxLength => Array.MaxLength;
+#else
+ private const int ArrayMaxLength = 0X7FFFFFC7;
+#endif
+
private readonly bool _usePool;
private byte[] _bytes;
private int _activeStart;
@@ -144,13 +150,15 @@ private void EnsureAvailableSpaceCore(int byteCount)
return;
}
- // Double the size of the buffer until we have enough space.
int desiredSize = ActiveLength + byteCount;
- int newSize = _bytes.Length;
- do
+
+ if ((uint)desiredSize > ArrayMaxLength)
{
- newSize *= 2;
- } while (newSize < desiredSize);
+ throw new OutOfMemoryException();
+ }
+
+ // Double the existing buffer size (capped at Array.MaxLength).
+ int newSize = Math.Max(desiredSize, (int)Math.Min(ArrayMaxLength, 2 * (uint)_bytes.Length));
byte[] newBytes = _usePool ?
ArrayPool.Shared.Rent(newSize) :
diff --git a/src/libraries/Common/src/System/Net/IPv6AddressHelper.Common.cs b/src/libraries/Common/src/System/Net/IPv6AddressHelper.Common.cs
index 6645daa83e4b20..d27cd18b8d56c3 100644
--- a/src/libraries/Common/src/System/Net/IPv6AddressHelper.Common.cs
+++ b/src/libraries/Common/src/System/Net/IPv6AddressHelper.Common.cs
@@ -95,7 +95,7 @@ internal static bool ShouldHaveIpv4Embedded(ReadOnlySpan numbers)
// Remarks: MUST NOT be used unless all input indexes are verified and trusted.
// start must be next to '[' position, or error is reported
- internal static unsafe bool IsValidStrict(TChar* name, int start, ref int end)
+ internal static unsafe bool IsValidStrict(TChar* name, int start, int end)
where TChar : unmanaged, IBinaryInteger
{
Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
diff --git a/src/libraries/Common/src/System/Net/Security/TargetHostNameHelper.cs b/src/libraries/Common/src/System/Net/Security/TargetHostNameHelper.cs
index bc973c247aa91c..b60db14144d51a 100644
--- a/src/libraries/Common/src/System/Net/Security/TargetHostNameHelper.cs
+++ b/src/libraries/Common/src/System/Net/Security/TargetHostNameHelper.cs
@@ -1,9 +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.Buffers;
-using System.Collections.Generic;
using System.Globalization;
-using System.Runtime.InteropServices;
namespace System.Net.Security
{
@@ -37,45 +36,5 @@ internal static string NormalizeHostName(string? targetHost)
return targetHost;
}
-
- // Simplified version of IPAddressParser.Parse to avoid allocations and dependencies.
- // It purposely ignores scopeId as we don't really use so we do not need to map it to actual interface id.
- internal static unsafe bool IsValidAddress(string? hostname)
- {
- if (string.IsNullOrEmpty(hostname))
- {
- return false;
- }
-
- ReadOnlySpan ipSpan = hostname.AsSpan();
-
- int end = ipSpan.Length;
-
- if (ipSpan.Contains(':'))
- {
- // The address is parsed as IPv6 if and only if it contains a colon. This is valid because
- // we don't support/parse a port specification at the end of an IPv4 address.
- fixed (char* ipStringPtr = &MemoryMarshal.GetReference(ipSpan))
- {
- return IPv6AddressHelper.IsValidStrict(ipStringPtr, 0, ref end);
- }
- }
- else if (char.IsDigit(ipSpan[0]))
- {
- long tmpAddr;
-
- fixed (char* ipStringPtr = &MemoryMarshal.GetReference(ipSpan))
- {
- tmpAddr = IPv4AddressHelper.ParseNonCanonical(ipStringPtr, 0, ref end, notImplicitFile: true);
- }
-
- if (tmpAddr != IPv4AddressHelper.Invalid && end == ipSpan.Length)
- {
- return true;
- }
- }
-
- return false;
- }
}
}
diff --git a/src/libraries/Common/src/System/Text/Json/PooledByteBufferWriter.cs b/src/libraries/Common/src/System/Text/Json/PooledByteBufferWriter.cs
index 824e3ff409315d..d65665ec902b4b 100644
--- a/src/libraries/Common/src/System/Text/Json/PooledByteBufferWriter.cs
+++ b/src/libraries/Common/src/System/Text/Json/PooledByteBufferWriter.cs
@@ -1,12 +1,10 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System.Buffers;
using System.Diagnostics;
-using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.IO.Pipelines;
-using System.Runtime.CompilerServices;
+using System.Net;
using System.Threading;
using System.Threading.Tasks;
@@ -14,33 +12,14 @@ namespace System.Text.Json
{
internal sealed class PooledByteBufferWriter : PipeWriter, IDisposable
{
- // This class allows two possible configurations: if rentedBuffer is not null then
- // it can be used as an IBufferWriter and holds a buffer that should eventually be
- // returned to the shared pool. If rentedBuffer is null, then the instance is in a
- // cleared/disposed state and it must re-rent a buffer before it can be used again.
- private byte[]? _rentedBuffer;
- private int _index;
- private readonly Stream? _stream;
-
private const int MinimumBufferSize = 256;
- // Value copied from Array.MaxLength in System.Private.CoreLib/src/libraries/System.Private.CoreLib/src/System/Array.cs.
- public const int MaximumBufferSize = 0X7FFFFFC7;
-
- private PooledByteBufferWriter()
- {
-#if NET
- // Ensure we are in sync with the Array.MaxLength implementation.
- Debug.Assert(MaximumBufferSize == Array.MaxLength);
-#endif
- }
+ private ArrayBuffer _buffer;
+ private readonly Stream? _stream;
- public PooledByteBufferWriter(int initialCapacity) : this()
+ public PooledByteBufferWriter(int initialCapacity)
{
- Debug.Assert(initialCapacity > 0);
-
- _rentedBuffer = ArrayPool.Shared.Rent(initialCapacity);
- _index = 0;
+ _buffer = new ArrayBuffer(initialCapacity, usePool: true);
}
public PooledByteBufferWriter(int initialCapacity, Stream stream) : this(initialCapacity)
@@ -48,202 +27,67 @@ public PooledByteBufferWriter(int initialCapacity, Stream stream) : this(initial
_stream = stream;
}
- public ReadOnlyMemory WrittenMemory
- {
- get
- {
- Debug.Assert(_rentedBuffer != null);
- Debug.Assert(_index <= _rentedBuffer.Length);
- return _rentedBuffer.AsMemory(0, _index);
- }
- }
+ public ReadOnlySpan WrittenSpan => _buffer.ActiveSpan;
- public int WrittenCount
- {
- get
- {
- Debug.Assert(_rentedBuffer != null);
- return _index;
- }
- }
+ public ReadOnlyMemory WrittenMemory => _buffer.ActiveMemory;
- public int Capacity
- {
- get
- {
- Debug.Assert(_rentedBuffer != null);
- return _rentedBuffer.Length;
- }
- }
+ public int Capacity => _buffer.Capacity;
- public int FreeCapacity
- {
- get
- {
- Debug.Assert(_rentedBuffer != null);
- return _rentedBuffer.Length - _index;
- }
- }
-
- public void Clear()
- {
- ClearHelper();
- }
+ public void Clear() => _buffer.Discard(_buffer.ActiveLength);
- public void ClearAndReturnBuffers()
- {
- Debug.Assert(_rentedBuffer != null);
+ public void ClearAndReturnBuffers() => _buffer.ClearAndReturnBuffer();
- ClearHelper();
- byte[] toReturn = _rentedBuffer;
- _rentedBuffer = null;
- ArrayPool.Shared.Return(toReturn);
- }
-
- private void ClearHelper()
- {
- Debug.Assert(_rentedBuffer != null);
- Debug.Assert(_index <= _rentedBuffer.Length);
-
- _rentedBuffer.AsSpan(0, _index).Clear();
- _index = 0;
- }
-
- // Returns the rented buffer back to the pool
- public void Dispose()
- {
- if (_rentedBuffer == null)
- {
- return;
- }
-
- ClearHelper();
- byte[] toReturn = _rentedBuffer;
- _rentedBuffer = null;
- ArrayPool.Shared.Return(toReturn);
- }
+ public void Dispose() => _buffer.Dispose();
public void InitializeEmptyInstance(int initialCapacity)
{
Debug.Assert(initialCapacity > 0);
- Debug.Assert(_rentedBuffer is null);
+ Debug.Assert(_buffer.ActiveLength == 0);
- _rentedBuffer = ArrayPool.Shared.Rent(initialCapacity);
- _index = 0;
+ _buffer.EnsureAvailableSpace(initialCapacity);
}
- public static PooledByteBufferWriter CreateEmptyInstanceForCaching() => new PooledByteBufferWriter();
+ public static PooledByteBufferWriter CreateEmptyInstanceForCaching() => new PooledByteBufferWriter(initialCapacity: 0);
- public override void Advance(int count)
- {
- Debug.Assert(_rentedBuffer != null);
- Debug.Assert(count >= 0);
- Debug.Assert(_index <= _rentedBuffer.Length - count);
- _index += count;
- }
+ public override void Advance(int count) => _buffer.Commit(count);
public override Memory GetMemory(int sizeHint = MinimumBufferSize)
{
- CheckAndResizeBuffer(sizeHint);
- return _rentedBuffer.AsMemory(_index);
+ Debug.Assert(sizeHint > 0);
+
+ _buffer.EnsureAvailableSpace(sizeHint);
+ return _buffer.AvailableMemory;
}
public override Span GetSpan(int sizeHint = MinimumBufferSize)
{
- CheckAndResizeBuffer(sizeHint);
- return _rentedBuffer.AsSpan(_index);
+ Debug.Assert(sizeHint > 0);
+
+ _buffer.EnsureAvailableSpace(sizeHint);
+ return _buffer.AvailableSpan;
}
#if NET
- internal void WriteToStream(Stream destination)
- {
- destination.Write(WrittenMemory.Span);
- }
+ internal void WriteToStream(Stream destination) => destination.Write(_buffer.ActiveSpan);
#else
- internal void WriteToStream(Stream destination)
- {
- Debug.Assert(_rentedBuffer != null);
- destination.Write(_rentedBuffer, 0, _index);
- }
+ internal void WriteToStream(Stream destination) => destination.Write(_buffer.ActiveMemory);
#endif
- private void CheckAndResizeBuffer(int sizeHint)
- {
- Debug.Assert(_rentedBuffer != null);
- Debug.Assert(sizeHint > 0);
-
- int currentLength = _rentedBuffer.Length;
- int availableSpace = currentLength - _index;
-
- // If we've reached ~1GB written, grow to the maximum buffer
- // length to avoid incessant minimal growths causing perf issues.
- if (_index >= MaximumBufferSize / 2)
- {
- sizeHint = Math.Max(sizeHint, MaximumBufferSize - currentLength);
- }
-
- if (sizeHint > availableSpace)
- {
- int growBy = Math.Max(sizeHint, currentLength);
-
- int newSize = currentLength + growBy;
-
- if ((uint)newSize > MaximumBufferSize)
- {
- newSize = currentLength + sizeHint;
- if ((uint)newSize > MaximumBufferSize)
- {
- ThrowHelper.ThrowOutOfMemoryException_BufferMaximumSizeExceeded((uint)newSize);
- }
- }
-
- byte[] oldBuffer = _rentedBuffer;
-
- _rentedBuffer = ArrayPool.Shared.Rent(newSize);
-
- Debug.Assert(oldBuffer.Length >= _index);
- Debug.Assert(_rentedBuffer.Length >= _index);
-
- Span oldBufferAsSpan = oldBuffer.AsSpan(0, _index);
- oldBufferAsSpan.CopyTo(_rentedBuffer);
- oldBufferAsSpan.Clear();
- ArrayPool.Shared.Return(oldBuffer);
- }
-
- Debug.Assert(_rentedBuffer.Length - _index > 0);
- Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
- }
-
public override async ValueTask FlushAsync(CancellationToken cancellationToken = default)
{
Debug.Assert(_stream is not null);
-#if NET
await _stream.WriteAsync(WrittenMemory, cancellationToken).ConfigureAwait(false);
-#else
- Debug.Assert(_rentedBuffer != null);
- await _stream.WriteAsync(_rentedBuffer, 0, _index, cancellationToken).ConfigureAwait(false);
-#endif
Clear();
return new FlushResult(isCanceled: false, isCompleted: false);
}
public override bool CanGetUnflushedBytes => true;
- public override long UnflushedBytes => _index;
+ public override long UnflushedBytes => _buffer.ActiveLength;
// This type is used internally in JsonSerializer to help buffer and flush bytes to the underlying Stream.
// It's only pretending to be a PipeWriter and doesn't need Complete or CancelPendingFlush for the internal usage.
public override void CancelPendingFlush() => throw new NotImplementedException();
public override void Complete(Exception? exception = null) => throw new NotImplementedException();
}
-
- internal static partial class ThrowHelper
- {
- [DoesNotReturn]
- [MethodImpl(MethodImplOptions.NoInlining)]
- public static void ThrowOutOfMemoryException_BufferMaximumSizeExceeded(uint capacity)
- {
- throw new OutOfMemoryException(SR.Format(SR.BufferMaximumSizeExceeded, capacity));
- }
- }
}
diff --git a/src/libraries/Common/tests/Common.Tests.csproj b/src/libraries/Common/tests/Common.Tests.csproj
index baf24f1232c42e..453f93145e7178 100644
--- a/src/libraries/Common/tests/Common.Tests.csproj
+++ b/src/libraries/Common/tests/Common.Tests.csproj
@@ -83,6 +83,7 @@
+
diff --git a/src/libraries/Common/tests/System/GenericMathTestMemberData.cs b/src/libraries/Common/tests/System/GenericMathTestMemberData.cs
index 0e19ac826dfdda..0e314aa9e9a27f 100644
--- a/src/libraries/Common/tests/System/GenericMathTestMemberData.cs
+++ b/src/libraries/Common/tests/System/GenericMathTestMemberData.cs
@@ -676,23 +676,201 @@ public static IEnumerable
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/JsonConsoleFormatter.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/JsonConsoleFormatter.cs
index 1be9425aa310b8..6dd794b05a02eb 100644
--- a/src/libraries/Microsoft.Extensions.Logging.Console/src/JsonConsoleFormatter.cs
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/JsonConsoleFormatter.cs
@@ -96,7 +96,7 @@ private void WriteInternal(IExternalScopeProvider? scopeProvider, TextWriter tex
writer.Flush();
}
- var messageBytes = output.WrittenMemory.Span;
+ var messageBytes = output.WrittenSpan;
var logMessageBuffer = ArrayPool.Shared.Rent(Encoding.UTF8.GetMaxCharCount(messageBytes.Length));
try
{
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/Microsoft.Extensions.Logging.Console.csproj b/src/libraries/Microsoft.Extensions.Logging.Console/src/Microsoft.Extensions.Logging.Console.csproj
index bb9145aaab774d..217bfaed0470f8 100644
--- a/src/libraries/Microsoft.Extensions.Logging.Console/src/Microsoft.Extensions.Logging.Console.csproj
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/Microsoft.Extensions.Logging.Console.csproj
@@ -17,6 +17,7 @@
+
@@ -29,6 +30,7 @@
+
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/Resources/Strings.resx b/src/libraries/Microsoft.Extensions.Logging.Console/src/Resources/Strings.resx
index 8d925d89baf50f..1513cb7b8224bc 100644
--- a/src/libraries/Microsoft.Extensions.Logging.Console/src/Resources/Strings.resx
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/Resources/Strings.resx
@@ -117,9 +117,6 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
- Cannot allocate a buffer of size {0}.
-
{0} is not a supported queue mode value.
diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Container.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Container.cs
index 3c32c1ee6a3f67..c0058edd936430 100644
--- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Container.cs
+++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Container.cs
@@ -223,16 +223,19 @@ protected virtual void ValidateName(IComponent component, string? name)
if (name != null)
{
- for (int i = 0; i < Math.Min(_siteCount, _sites!.Length); i++)
+ lock (_syncObj)
{
- ISite? s = _sites[i];
-
- if (s?.Name != null && string.Equals(s.Name, name, StringComparison.OrdinalIgnoreCase) && s.Component != component)
+ for (int i = 0; i < Math.Min(_siteCount, _sites!.Length); i++)
{
- InheritanceAttribute inheritanceAttribute = (InheritanceAttribute)TypeDescriptor.GetAttributes(s.Component)[typeof(InheritanceAttribute)]!;
- if (inheritanceAttribute.InheritanceLevel != InheritanceLevel.InheritedReadOnly)
+ ISite? s = _sites[i];
+
+ if (s?.Name != null && string.Equals(s.Name, name, StringComparison.OrdinalIgnoreCase) && s.Component != component)
{
- throw new ArgumentException(SR.Format(SR.DuplicateComponentName, name));
+ InheritanceAttribute inheritanceAttribute = (InheritanceAttribute)TypeDescriptor.GetAttributes(s.Component)[typeof(InheritanceAttribute)]!;
+ if (inheritanceAttribute.InheritanceLevel != InheritanceLevel.InheritedReadOnly)
+ {
+ throw new ArgumentException(SR.Format(SR.DuplicateComponentName, name));
+ }
}
}
}
diff --git a/src/libraries/System.Console/src/System/ConsolePal.Unix.cs b/src/libraries/System.Console/src/System/ConsolePal.Unix.cs
index e7acb0e850400c..98aca9d7ef698b 100644
--- a/src/libraries/System.Console/src/System/ConsolePal.Unix.cs
+++ b/src/libraries/System.Console/src/System/ConsolePal.Unix.cs
@@ -885,6 +885,9 @@ private static unsafe void EnsureInitializedCore()
{
throw new Win32Exception();
}
+ // InitializeTerminalAndSignalHandling will reset the terminal on a normal exit.
+ // This also resets it for termination due to an unhandled exception.
+ AppDomain.CurrentDomain.UnhandledException += (_, _) => { Interop.Sys.UninitializeTerminal(); };
s_terminalHandle = !Console.IsOutputRedirected ? Interop.Sys.FileDescriptors.STDOUT_FILENO :
!Console.IsInputRedirected ? Interop.Sys.FileDescriptors.STDIN_FILENO :
diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.cs b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.cs
index b408cead906853..e7d36273408355 100644
--- a/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.cs
+++ b/src/libraries/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/Activity.cs
@@ -1233,7 +1233,9 @@ internal static Activity Create(ActivitySource source, string name, ActivityKind
activity._parentSpanId = parentContext.SpanId.ToString();
}
- activity.ActivityTraceFlags = parentContext.TraceFlags;
+ // Note: Don't inherit Recorded from parent as it is set below
+ // based on sampling decision
+ activity.ActivityTraceFlags = parentContext.TraceFlags & ~ActivityTraceFlags.Recorded;
activity._parentTraceFlags = (byte)parentContext.TraceFlags;
activity.HasRemoteParent = parentContext.IsRemote;
}
diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivitySourceTests.cs b/src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivitySourceTests.cs
index 86227dc2e74275..5870822e5b03ad 100644
--- a/src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivitySourceTests.cs
+++ b/src/libraries/System.Diagnostics.DiagnosticSource/tests/ActivitySourceTests.cs
@@ -256,7 +256,7 @@ public void TestListeningToConstructedActivityEvents()
}
[ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))]
- public void EnsureRecordingTest()
+ public void AllDataAndRecordedSamplingTest()
{
RemoteExecutor.Invoke(() => {
Activity.ForceDefaultIdFormat = true;
@@ -278,14 +278,76 @@ public void EnsureRecordingTest()
ActivitySource.AddActivityListener(listener);
- Activity a = aSource.StartActivity("RecordedActivity");
+ // Note: Remote parent is set as NOT recorded
+ var parentContext = new ActivityContext(ActivityTraceId.CreateRandom(), ActivitySpanId.CreateRandom(), ActivityTraceFlags.None, isRemote: true);
+
+ Activity a = aSource.StartActivity("RecordedActivity", ActivityKind.Internal, parentContext);
Assert.NotNull(a);
+ Assert.True(a.IsAllDataRequested);
Assert.True(a.Recorded);
Assert.True((a.Context.TraceFlags & ActivityTraceFlags.Recorded) != 0);
}).Dispose();
}
+ [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))]
+ public void AllDataSamplingTest()
+ {
+ RemoteExecutor.Invoke(() => {
+ Activity.ForceDefaultIdFormat = true;
+ Activity.DefaultIdFormat = ActivityIdFormat.W3C;
+
+ ActivitySource aSource = new ActivitySource("EnsureRecordingTest");
+
+ ActivityListener listener = new ActivityListener
+ {
+ ShouldListenTo = (activitySource) => true,
+ Sample = (ref ActivityCreationOptions activityOptions) => ActivitySamplingResult.AllData
+ };
+
+ ActivitySource.AddActivityListener(listener);
+
+ // Note: Remote parent is set as recorded
+ var parentContext = new ActivityContext(ActivityTraceId.CreateRandom(), ActivitySpanId.CreateRandom(), ActivityTraceFlags.Recorded, isRemote: true);
+
+ Activity a = aSource.StartActivity("RecordedActivity", ActivityKind.Internal, parentContext);
+ Assert.NotNull(a);
+
+ Assert.True(a.IsAllDataRequested);
+ Assert.False(a.Recorded);
+ Assert.False((a.Context.TraceFlags & ActivityTraceFlags.Recorded) != 0);
+ }).Dispose();
+ }
+
+ [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))]
+ public void PropagationDataSamplingTest()
+ {
+ RemoteExecutor.Invoke(() => {
+ Activity.ForceDefaultIdFormat = true;
+ Activity.DefaultIdFormat = ActivityIdFormat.W3C;
+
+ ActivitySource aSource = new ActivitySource("EnsureRecordingTest");
+
+ ActivityListener listener = new ActivityListener
+ {
+ ShouldListenTo = (activitySource) => true,
+ Sample = (ref ActivityCreationOptions activityOptions) => ActivitySamplingResult.PropagationData
+ };
+
+ ActivitySource.AddActivityListener(listener);
+
+ // Note: Remote parent is set as recorded
+ var parentContext = new ActivityContext(ActivityTraceId.CreateRandom(), ActivitySpanId.CreateRandom(), ActivityTraceFlags.Recorded, isRemote: true);
+
+ Activity a = aSource.StartActivity("RecordedActivity", ActivityKind.Internal, parentContext);
+ Assert.NotNull(a);
+
+ Assert.False(a.IsAllDataRequested);
+ Assert.False(a.Recorded);
+ Assert.False((a.Context.TraceFlags & ActivityTraceFlags.Recorded) != 0);
+ }).Dispose();
+ }
+
[ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))]
public void TestExpectedListenersReturnValues()
{
@@ -424,7 +486,10 @@ public void TestActivityCreationProperties()
Assert.Equal(ctx.TraceId, activity.TraceId);
Assert.Equal(ctx.SpanId, activity.ParentSpanId);
- Assert.Equal(ctx.TraceFlags, activity.ActivityTraceFlags);
+ Assert.NotEqual(ctx.TraceFlags, activity.ActivityTraceFlags);
+ Assert.True(ctx.TraceFlags.HasFlag(ActivityTraceFlags.Recorded));
+ Assert.False(activity.ActivityTraceFlags.HasFlag(ActivityTraceFlags.Recorded));
+ Assert.False(activity.Recorded);
Assert.Equal(ctx.TraceState, activity.TraceStateString);
Assert.Equal(ActivityIdFormat.W3C, activity.IdFormat);
diff --git a/src/libraries/System.IO.Compression/src/System/IO/Compression/DeflateManaged/HuffmanTree.cs b/src/libraries/System.IO.Compression/src/System/IO/Compression/DeflateManaged/HuffmanTree.cs
index f2262caad22986..a4f1f621df37ee 100644
--- a/src/libraries/System.IO.Compression/src/System/IO/Compression/DeflateManaged/HuffmanTree.cs
+++ b/src/libraries/System.IO.Compression/src/System/IO/Compression/DeflateManaged/HuffmanTree.cs
@@ -247,6 +247,12 @@ private void CreateTable()
}
index = -value; // go to next node
+ if (index >= array.Length)
+ {
+ // prevent an IndexOutOfRangeException from array[index]
+ throw new InvalidDataException(SR.InvalidHuffmanData);
+ }
+
codeBitMask <<= 1;
overflowBits--;
} while (overflowBits != 0);
diff --git a/src/libraries/System.IO.Compression/tests/ZipArchive/zip_InvalidParametersAndStrangeFiles.cs b/src/libraries/System.IO.Compression/tests/ZipArchive/zip_InvalidParametersAndStrangeFiles.cs
index 87695ad071edff..1bb8b2a113b05a 100644
--- a/src/libraries/System.IO.Compression/tests/ZipArchive/zip_InvalidParametersAndStrangeFiles.cs
+++ b/src/libraries/System.IO.Compression/tests/ZipArchive/zip_InvalidParametersAndStrangeFiles.cs
@@ -871,6 +871,24 @@ public void ReadArchive_WithDiskStartNumberGreaterThanIntMax()
Assert.Null(exception);
}
+ ///
+ /// This test checks that an InvalidDataException will be thrown when consuming a zip with bad Huffman data.
+ ///
+ [Fact]
+ public static async Task ZipArchive_InvalidHuffmanData()
+ {
+ string filename = bad("HuffmanTreeException.zip");
+ using (ZipArchive archive = new ZipArchive(await StreamHelpers.CreateTempCopyStream(filename), ZipArchiveMode.Read))
+ {
+ ZipArchiveEntry e = archive.Entries[0];
+ using (MemoryStream ms = new MemoryStream())
+ using (Stream s = e.Open())
+ {
+ Assert.Throws(() => s.CopyTo(ms)); //"Should throw on creating Huffman tree"
+ }
+ }
+ }
+
private static readonly byte[] s_slightlyIncorrectZip64 =
{
// ===== Local file header signature 0x04034b50
diff --git a/src/libraries/System.IO.Pipelines/src/System.IO.Pipelines.csproj b/src/libraries/System.IO.Pipelines/src/System.IO.Pipelines.csproj
index a4517443d1832b..7c1901590e388c 100644
--- a/src/libraries/System.IO.Pipelines/src/System.IO.Pipelines.csproj
+++ b/src/libraries/System.IO.Pipelines/src/System.IO.Pipelines.csproj
@@ -52,10 +52,10 @@ System.IO.Pipelines.PipeReader
-
+
diff --git a/src/libraries/System.IO.Ports/pkg/runtime.native.System.IO.Ports.proj b/src/libraries/System.IO.Ports/pkg/runtime.native.System.IO.Ports.proj
index 4be58c3771667f..00e32f9ad27dcd 100644
--- a/src/libraries/System.IO.Ports/pkg/runtime.native.System.IO.Ports.proj
+++ b/src/libraries/System.IO.Ports/pkg/runtime.native.System.IO.Ports.proj
@@ -13,7 +13,7 @@
+ They are filtered in the traversal build in oob-src.csproj based on the OutputRID. -->
diff --git a/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/ServerCertificateTest.cs b/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/ServerCertificateTest.cs
index df73619bf8dad8..4f7d573df68b09 100644
--- a/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/ServerCertificateTest.cs
+++ b/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/ServerCertificateTest.cs
@@ -32,6 +32,7 @@ public async Task NoCallback_ValidCertificate_CallbackNotCalled()
[OuterLoop]
[Fact]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/110578")]
public async Task UseCallback_NotSecureConnection_CallbackNotCalled()
{
var handler = new WinHttpHandler();
diff --git a/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/System.Net.Http.WinHttpHandler.Functional.Tests.csproj b/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/System.Net.Http.WinHttpHandler.Functional.Tests.csproj
index f25614ada92b3f..c5c7099713aa5f 100644
--- a/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/System.Net.Http.WinHttpHandler.Functional.Tests.csproj
+++ b/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/System.Net.Http.WinHttpHandler.Functional.Tests.csproj
@@ -40,8 +40,6 @@
Link="Common\System\Net\VerboseTestLogging.cs" />
-
+
+
+
diff --git a/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/WinHttpHandlerTest.cs b/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/WinHttpHandlerTest.cs
index 0abe14c11887bf..cc2b97bdde6da7 100644
--- a/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/WinHttpHandlerTest.cs
+++ b/src/libraries/System.Net.Http.WinHttpHandler/tests/FunctionalTests/WinHttpHandlerTest.cs
@@ -55,7 +55,7 @@ public async Task GetAsync_RedirectResponseHasCookie_CookieSentToFinalUri(
string cookieName,
string cookieValue)
{
- Uri uri = System.Net.Test.Common.Configuration.Http.RemoteHttp11Server.RedirectUriForDestinationUri(302, System.Net.Test.Common.Configuration.Http.RemoteEchoServer, 1);
+ Uri uri = System.Net.Test.Common.Configuration.Http.RemoteSecureHttp11Server.RedirectUriForDestinationUri(302, System.Net.Test.Common.Configuration.Http.SecureRemoteEchoServer, 1);
var handler = new WinHttpHandler();
handler.WindowsProxyUsePolicy = WindowsProxyUsePolicy.UseWinInetProxy;
handler.CookieUsePolicy = cookieUsePolicy;
diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/MetricsTest.cs b/src/libraries/System.Net.Http/tests/FunctionalTests/MetricsTest.cs
index 9d4afdd97788ab..1715dbf8c676df 100644
--- a/src/libraries/System.Net.Http/tests/FunctionalTests/MetricsTest.cs
+++ b/src/libraries/System.Net.Http/tests/FunctionalTests/MetricsTest.cs
@@ -381,7 +381,7 @@ public async Task ExternalServer_DurationMetrics_Recorded()
using InstrumentRecorder openConnectionsRecorder = SetupInstrumentRecorder(InstrumentNames.OpenConnections);
Uri uri = UseVersion == HttpVersion.Version11
- ? Test.Common.Configuration.Http.RemoteHttp11Server.EchoUri
+ ? Test.Common.Configuration.Http.RemoteSecureHttp11Server.EchoUri
: Test.Common.Configuration.Http.RemoteHttp2Server.EchoUri;
IPAddress[] addresses = await Dns.GetHostAddressesAsync(uri.Host);
addresses = addresses.Union(addresses.Select(a => a.MapToIPv6())).ToArray();
@@ -1259,7 +1259,7 @@ public Task RequestDuration_Redirect_RecordedForEachHttpSpan()
});
}, options: new GenericLoopbackOptions() { UseSsl = true });
- }, options: new GenericLoopbackOptions() { UseSsl = false});
+ }, options: new GenericLoopbackOptions() { UseSsl = false });
}
[Fact]
diff --git a/src/libraries/System.Net.HttpListener/src/System/Net/ServiceNameStore.cs b/src/libraries/System.Net.HttpListener/src/System/Net/ServiceNameStore.cs
index deaf7e1851a591..ed0d541195b7f1 100644
--- a/src/libraries/System.Net.HttpListener/src/System/Net/ServiceNameStore.cs
+++ b/src/libraries/System.Net.HttpListener/src/System/Net/ServiceNameStore.cs
@@ -272,7 +272,7 @@ public static string[] BuildServiceNames(string uriPrefix)
if (hostname == "*" ||
hostname == "+" ||
- IPAddress.TryParse(hostname, out _))
+ IPAddress.IsValid(hostname))
{
// for a wildcard, register the machine name. If the caller doesn't have DNS permission
// or the query fails for some reason, don't add an SPN.
diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/StringParsingHelpers.Addresses.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/StringParsingHelpers.Addresses.cs
index 426328818210a1..0543e2aabfc414 100644
--- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/StringParsingHelpers.Addresses.cs
+++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/StringParsingHelpers.Addresses.cs
@@ -131,14 +131,30 @@ internal static List ParseWinsServerAddressesFromSmbConfFile(string s
string fileContents = ReadAllText(smbConfFilePath);
string label = "wins server = ";
int labelIndex = fileContents.IndexOf(label);
+
+ if (labelIndex == -1)
+ {
+ return collection;
+ }
+
int labelLineStart = fileContents.LastIndexOf(Environment.NewLine, labelIndex, StringComparison.Ordinal);
- if (labelLineStart < labelIndex)
+
+ while (labelIndex != -1)
{
- int commentIndex = fileContents.IndexOf(';', labelLineStart, labelIndex - labelLineStart);
- if (commentIndex != -1)
+ int commentIndex = fileContents.IndexOfAny(CommentSymbols, labelLineStart, labelIndex - labelLineStart);
+ if (commentIndex == -1)
+ {
+ break;
+ }
+
+ labelIndex = fileContents.IndexOf(label, labelIndex + 16);
+
+ if (labelIndex == -1)
{
return collection;
}
+
+ labelLineStart = fileContents.LastIndexOf(Environment.NewLine, labelIndex, StringComparison.Ordinal);
}
int endOfLine = fileContents.IndexOf(Environment.NewLine, labelIndex, StringComparison.Ordinal);
ReadOnlySpan addressSpan = fileContents.AsSpan(labelIndex + label.Length, endOfLine - (labelIndex + label.Length));
@@ -154,5 +170,6 @@ internal static List ParseWinsServerAddressesFromSmbConfFile(string s
return collection;
}
+ private static readonly char[] CommentSymbols = [';', '#'];
}
}
diff --git a/src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/AddressParsingTests.cs b/src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/AddressParsingTests.cs
index 637cb202fe4362..378529b700fd75 100644
--- a/src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/AddressParsingTests.cs
+++ b/src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/AddressParsingTests.cs
@@ -97,15 +97,27 @@ public void DhcpServerAddressParsing()
Assert.Equal(IPAddress.Parse("10.105.128.4"), dhcpServerAddresses[0]);
}
- [Fact]
- public void WinsServerAddressParsing()
+ [Theory]
+ [InlineData("NetworkFiles/smb.conf")]
+ [InlineData("NetworkFiles/smb_with_commented_wins.conf")]
+ public void WinsServerAddressParsing(string source)
{
string fileName = GetTestFilePath();
- FileUtil.NormalizeLineEndings("NetworkFiles/smb.conf", fileName);
+ FileUtil.NormalizeLineEndings(source, fileName);
List winsServerAddresses = StringParsingHelpers.ParseWinsServerAddressesFromSmbConfFile(fileName);
Assert.Equal(1, winsServerAddresses.Count);
Assert.Equal(IPAddress.Parse("255.1.255.1"), winsServerAddresses[0]);
}
+
+ [Fact]
+ public void WinsServerAddressParsingWhenFileHasNotAny()
+ {
+ string fileName = GetTestFilePath();
+ FileUtil.NormalizeLineEndings("NetworkFiles/smb_without_wins.conf", fileName);
+
+ List winsServerAddresses = StringParsingHelpers.ParseWinsServerAddressesFromSmbConfFile(fileName);
+ Assert.Empty(winsServerAddresses);
+ }
}
}
diff --git a/src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/NetworkFiles/THIRD-PARTY-NOTICES b/src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/NetworkFiles/THIRD-PARTY-NOTICES
new file mode 100644
index 00000000000000..72123e758ebea2
--- /dev/null
+++ b/src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/NetworkFiles/THIRD-PARTY-NOTICES
@@ -0,0 +1,19 @@
+.NET uses third-party libraries or other resources that may be
+distributed under licenses different than the .NET software.
+
+In the event that we accidentally failed to list a required notice, please
+bring it to our attention. Post an issue or email us:
+
+ dotnet@microsoft.com
+
+The attached notices are provided for information only.
+
+License notice for the Samba team
+-----------------------------
+
+GPL-v3 and LGPL-v3: Copyright (C) [Samba team](https://www.samba.org/samba/team/).
+
+We use smb config template files in our tests (as provided in https://github.com/samba-team/samba/blob/master/examples/smb.conf.default):
+* https://github.com/dotnet/runtime/blob/main/src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/NetworkFiles/smb.conf
+* https://github.com/dotnet/runtime/blob/main/src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/NetworkFiles/smb_with_commented_wins.conf
+* https://github.com/dotnet/runtime/blob/main/src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/NetworkFiles/smb_without_wins.conf
diff --git a/src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/NetworkFiles/smb_with_commented_wins.conf b/src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/NetworkFiles/smb_with_commented_wins.conf
new file mode 100644
index 00000000000000..c3a504afd88a39
--- /dev/null
+++ b/src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/NetworkFiles/smb_with_commented_wins.conf
@@ -0,0 +1,269 @@
+#
+# Sample configuration file for the Samba suite for Debian GNU/Linux.
+#
+#
+# This is the main Samba configuration file. You should read the
+# smb.conf(5) manual page in order to understand the options listed
+# here. Samba has a huge number of configurable options most of which
+# are not shown in this example
+#
+# Some options that are often worth tuning have been included as
+# commented-out examples in this file.
+# - When such options are commented with ";", the proposed setting
+# differs from the default Samba behaviour
+# - When commented with "#", the proposed setting is the default
+# behaviour of Samba but the option is considered important
+# enough to be mentioned here
+#
+# NOTE: Whenever you modify this file you should run the command
+# "testparm" to check that you have not made any basic syntactic
+# errors.
+
+#======================= Global Settings =======================
+
+[global]
+
+## Browsing/Identification ###
+
+# Change this to the workgroup/NT-domain name your Samba server will part of
+ workgroup = WORKGROUP
+
+# server string is the equivalent of the NT Description field
+ server string = %h server (Samba, Ubuntu)
+
+# Windows Internet Name Serving Support Section:
+# WINS Support - Tells the NMBD component of Samba to enable its WINS Server
+# wins support = no
+
+# WINS Server - Tells the NMBD components of Samba to be a WINS Client
+# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
+
+# we comment the next two lines to check that we will consider only the uncommented server
+;wins server = 255.1.255.2
+#wins server = 255.1.255.3
+
+wins server = 255.1.255.1
+
+# we comment the next two lines to check that we will not consider them
+;wins server = 255.1.255.4
+#wins server = 255.1.255.5
+
+# This will prevent nmbd to search for NetBIOS names through DNS.
+ dns proxy = no
+
+#### Networking ####
+
+# The specific set of interfaces / networks to bind to
+# This can be either the interface name or an IP address/netmask;
+# interface names are normally preferred
+; interfaces = 127.0.0.0/8 eth0
+
+# Only bind to the named interfaces and/or networks; you must use the
+# 'interfaces' option above to use this.
+# It is recommended that you enable this feature if your Samba machine is
+# not protected by a firewall or is a firewall itself. However, this
+# option cannot handle dynamic or non-broadcast interfaces correctly.
+; bind interfaces only = yes
+
+
+
+#### Debugging/Accounting ####
+
+# This tells Samba to use a separate log file for each machine
+# that connects
+ log file = /var/log/samba/log.%m
+
+# Cap the size of the individual log files (in KiB).
+ max log size = 1000
+
+# If you want Samba to only log through syslog then set the following
+# parameter to 'yes'.
+# syslog only = no
+
+# We want Samba to log a minimum amount of information to syslog. Everything
+# should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
+# through syslog you should set the following parameter to something higher.
+ syslog = 0
+
+# Do something sensible when Samba crashes: mail the admin a backtrace
+ panic action = /usr/share/samba/panic-action %d
+
+
+####### Authentication #######
+
+# Server role. Defines in which mode Samba will operate. Possible
+# values are "standalone server", "member server", "classic primary
+# domain controller", "classic backup domain controller", "active
+# directory domain controller".
+#
+# Most people will want "standalone sever" or "member server".
+# Running as "active directory domain controller" will require first
+# running "samba-tool domain provision" to wipe databases and create a
+# new domain.
+ server role = standalone server
+
+# If you are using encrypted passwords, Samba will need to know what
+# password database type you are using.
+ passdb backend = tdbsam
+
+ obey pam restrictions = yes
+
+# This boolean parameter controls whether Samba attempts to sync the Unix
+# password with the SMB password when the encrypted SMB password in the
+# passdb is changed.
+ unix password sync = yes
+
+# For Unix password sync to work on a Debian GNU/Linux system, the following
+# parameters must be set (thanks to Ian Kahan < for
+# sending the correct chat script for the passwd program in Debian Sarge).
+ passwd program = /usr/bin/passwd %u
+ passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
+
+# This boolean controls whether PAM will be used for password changes
+# when requested by an SMB client instead of the program listed in
+# 'passwd program'. The default is 'no'.
+ pam password change = yes
+
+# This option controls how unsuccessful authentication attempts are mapped
+# to anonymous connections
+ map to guest = bad user
+
+########## Domains ###########
+
+#
+# The following settings only takes effect if 'server role = primary
+# classic domain controller', 'server role = backup domain controller'
+# or 'domain logons' is set
+#
+
+# It specifies the location of the user's
+# profile directory from the client point of view) The following
+# required a [profiles] share to be setup on the samba server (see
+# below)
+; logon path = \\%N\profiles\%U
+# Another common choice is storing the profile in the user's home directory
+# (this is Samba's default)
+# logon path = \\%N\%U\profile
+
+# The following setting only takes effect if 'domain logons' is set
+# It specifies the location of a user's home directory (from the client
+# point of view)
+; logon drive = H:
+# logon home = \\%N\%U
+
+# The following setting only takes effect if 'domain logons' is set
+# It specifies the script to run during logon. The script must be stored
+# in the [netlogon] share
+# NOTE: Must be store in 'DOS' file format convention
+; logon script = logon.cmd
+
+# This allows Unix users to be created on the domain controller via the SAMR
+# RPC pipe. The example command creates a user account with a disabled Unix
+# password; please adapt to your needs
+; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u
+
+# This allows machine accounts to be created on the domain controller via the
+# SAMR RPC pipe.
+# The following assumes a "machines" group exists on the system
+; add machine script = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u
+
+# This allows Unix groups to be created on the domain controller via the SAMR
+# RPC pipe.
+; add group script = /usr/sbin/addgroup --force-badname %g
+
+############ Misc ############
+
+# Using the following line enables you to customize your configuration
+# on a per machine basis. The %m gets replaced with the netbios name
+# of the machine that is connecting
+; include = /home/samba/etc/smb.conf.%m
+
+# Some defaults for winbind (make sure you're not using the ranges
+# for something else.)
+; idmap uid = 10000-20000
+; idmap gid = 10000-20000
+; template shell = /bin/bash
+
+# Setup usershare options to enable non-root users to share folders
+# with the net usershare command.
+
+# Maximum number of usershare. 0 (default) means that usershare is disabled.
+; usershare max shares = 100
+
+# Allow users who've been granted usershare privileges to create
+# public shares, not just authenticated ones
+ usershare allow guests = yes
+
+#======================= Share Definitions =======================
+
+# Un-comment the following (and tweak the other settings below to suit)
+# to enable the default home directory shares. This will share each
+# user's home directory as \\server\username
+;[homes]
+; comment = Home Directories
+; browseable = no
+
+# By default, the home directories are exported read-only. Change the
+# next parameter to 'no' if you want to be able to write to them.
+; read only = yes
+
+# File creation mask is set to 0700 for security reasons. If you want to
+# create files with group=rw permissions, set next parameter to 0775.
+; create mask = 0700
+
+# Directory creation mask is set to 0700 for security reasons. If you want to
+# create dirs. with group=rw permissions, set next parameter to 0775.
+; directory mask = 0700
+
+# By default, \\server\username shares can be connected to by anyone
+# with access to the samba server.
+# Un-comment the following parameter to make sure that only "username"
+# can connect to \\server\username
+# This might need tweaking when using external authentication schemes
+; valid users = %S
+
+# Un-comment the following and create the netlogon directory for Domain Logons
+# (you need to configure Samba to act as a domain controller too.)
+;[netlogon]
+; comment = Network Logon Service
+; path = /home/samba/netlogon
+; guest ok = yes
+; read only = yes
+
+# Un-comment the following and create the profiles directory to store
+# users profiles (see the "logon path" option above)
+# (you need to configure Samba to act as a domain controller too.)
+# The path below should be writable by all users so that their
+# profile directory may be created the first time they log on
+;[profiles]
+; comment = Users profiles
+; path = /home/samba/profiles
+; guest ok = no
+; browseable = no
+; create mask = 0600
+; directory mask = 0700
+
+[printers]
+ comment = All Printers
+ browseable = no
+ path = /var/spool/samba
+ printable = yes
+ guest ok = no
+ read only = yes
+ create mask = 0700
+
+# Windows clients look for this share name as a source of downloadable
+# printer drivers
+[print$]
+ comment = Printer Drivers
+ path = /var/lib/samba/printers
+ browseable = yes
+ read only = yes
+ guest ok = no
+# Uncomment to allow remote administration of Windows print drivers.
+# You may need to replace 'lpadmin' with the name of the group your
+# admin users are members of.
+# Please note that you also need to set appropriate Unix permissions
+# to the drivers directory for these users to have write rights in it
+; write list = root, @lpadmin
+
diff --git a/src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/NetworkFiles/smb_without_wins.conf b/src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/NetworkFiles/smb_without_wins.conf
new file mode 100644
index 00000000000000..ba3e9754e111ee
--- /dev/null
+++ b/src/libraries/System.Net.NetworkInformation/tests/FunctionalTests/NetworkFiles/smb_without_wins.conf
@@ -0,0 +1,252 @@
+#
+# Sample configuration file for the Samba suite for Debian GNU/Linux.
+#
+#
+# This is the main Samba configuration file. You should read the
+# smb.conf(5) manual page in order to understand the options listed
+# here. Samba has a huge number of configurable options most of which
+# are not shown in this example
+#
+# Some options that are often worth tuning have been included as
+# commented-out examples in this file.
+# - When such options are commented with ";", the proposed setting
+# differs from the default Samba behaviour
+# - When commented with "#", the proposed setting is the default
+# behaviour of Samba but the option is considered important
+# enough to be mentioned here
+#
+# NOTE: Whenever you modify this file you should run the command
+# "testparm" to check that you have not made any basic syntactic
+# errors.
+
+#======================= Global Settings =======================
+
+[global]
+
+## Browsing/Identification ###
+
+# Change this to the workgroup/NT-domain name your Samba server will part of
+ workgroup = WORKGROUP
+
+# server string is the equivalent of the NT Description field
+ server string = %h server (Samba, Ubuntu)
+
+# This will prevent nmbd to search for NetBIOS names through DNS.
+ dns proxy = no
+
+#### Networking ####
+
+# The specific set of interfaces / networks to bind to
+# This can be either the interface name or an IP address/netmask;
+# interface names are normally preferred
+; interfaces = 127.0.0.0/8 eth0
+
+# Only bind to the named interfaces and/or networks; you must use the
+# 'interfaces' option above to use this.
+# It is recommended that you enable this feature if your Samba machine is
+# not protected by a firewall or is a firewall itself. However, this
+# option cannot handle dynamic or non-broadcast interfaces correctly.
+; bind interfaces only = yes
+
+
+
+#### Debugging/Accounting ####
+
+# This tells Samba to use a separate log file for each machine
+# that connects
+ log file = /var/log/samba/log.%m
+
+# Cap the size of the individual log files (in KiB).
+ max log size = 1000
+
+# If you want Samba to only log through syslog then set the following
+# parameter to 'yes'.
+# syslog only = no
+
+# We want Samba to log a minimum amount of information to syslog. Everything
+# should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
+# through syslog you should set the following parameter to something higher.
+ syslog = 0
+
+# Do something sensible when Samba crashes: mail the admin a backtrace
+ panic action = /usr/share/samba/panic-action %d
+
+
+####### Authentication #######
+
+# Server role. Defines in which mode Samba will operate. Possible
+# values are "standalone server", "member server", "classic primary
+# domain controller", "classic backup domain controller", "active
+# directory domain controller".
+#
+# Most people will want "standalone sever" or "member server".
+# Running as "active directory domain controller" will require first
+# running "samba-tool domain provision" to wipe databases and create a
+# new domain.
+ server role = standalone server
+
+# If you are using encrypted passwords, Samba will need to know what
+# password database type you are using.
+ passdb backend = tdbsam
+
+ obey pam restrictions = yes
+
+# This boolean parameter controls whether Samba attempts to sync the Unix
+# password with the SMB password when the encrypted SMB password in the
+# passdb is changed.
+ unix password sync = yes
+
+# For Unix password sync to work on a Debian GNU/Linux system, the following
+# parameters must be set (thanks to Ian Kahan < for
+# sending the correct chat script for the passwd program in Debian Sarge).
+ passwd program = /usr/bin/passwd %u
+ passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
+
+# This boolean controls whether PAM will be used for password changes
+# when requested by an SMB client instead of the program listed in
+# 'passwd program'. The default is 'no'.
+ pam password change = yes
+
+# This option controls how unsuccessful authentication attempts are mapped
+# to anonymous connections
+ map to guest = bad user
+
+########## Domains ###########
+
+#
+# The following settings only takes effect if 'server role = primary
+# classic domain controller', 'server role = backup domain controller'
+# or 'domain logons' is set
+#
+
+# It specifies the location of the user's
+# profile directory from the client point of view) The following
+# required a [profiles] share to be setup on the samba server (see
+# below)
+; logon path = \\%N\profiles\%U
+# Another common choice is storing the profile in the user's home directory
+# (this is Samba's default)
+# logon path = \\%N\%U\profile
+
+# The following setting only takes effect if 'domain logons' is set
+# It specifies the location of a user's home directory (from the client
+# point of view)
+; logon drive = H:
+# logon home = \\%N\%U
+
+# The following setting only takes effect if 'domain logons' is set
+# It specifies the script to run during logon. The script must be stored
+# in the [netlogon] share
+# NOTE: Must be store in 'DOS' file format convention
+; logon script = logon.cmd
+
+# This allows Unix users to be created on the domain controller via the SAMR
+# RPC pipe. The example command creates a user account with a disabled Unix
+# password; please adapt to your needs
+; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u
+
+# This allows machine accounts to be created on the domain controller via the
+# SAMR RPC pipe.
+# The following assumes a "machines" group exists on the system
+; add machine script = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u
+
+# This allows Unix groups to be created on the domain controller via the SAMR
+# RPC pipe.
+; add group script = /usr/sbin/addgroup --force-badname %g
+
+############ Misc ############
+
+# Using the following line enables you to customize your configuration
+# on a per machine basis. The %m gets replaced with the netbios name
+# of the machine that is connecting
+; include = /home/samba/etc/smb.conf.%m
+
+# Some defaults for winbind (make sure you're not using the ranges
+# for something else.)
+; idmap uid = 10000-20000
+; idmap gid = 10000-20000
+; template shell = /bin/bash
+
+# Setup usershare options to enable non-root users to share folders
+# with the net usershare command.
+
+# Maximum number of usershare. 0 (default) means that usershare is disabled.
+; usershare max shares = 100
+
+# Allow users who've been granted usershare privileges to create
+# public shares, not just authenticated ones
+ usershare allow guests = yes
+
+#======================= Share Definitions =======================
+
+# Un-comment the following (and tweak the other settings below to suit)
+# to enable the default home directory shares. This will share each
+# user's home directory as \\server\username
+;[homes]
+; comment = Home Directories
+; browseable = no
+
+# By default, the home directories are exported read-only. Change the
+# next parameter to 'no' if you want to be able to write to them.
+; read only = yes
+
+# File creation mask is set to 0700 for security reasons. If you want to
+# create files with group=rw permissions, set next parameter to 0775.
+; create mask = 0700
+
+# Directory creation mask is set to 0700 for security reasons. If you want to
+# create dirs. with group=rw permissions, set next parameter to 0775.
+; directory mask = 0700
+
+# By default, \\server\username shares can be connected to by anyone
+# with access to the samba server.
+# Un-comment the following parameter to make sure that only "username"
+# can connect to \\server\username
+# This might need tweaking when using external authentication schemes
+; valid users = %S
+
+# Un-comment the following and create the netlogon directory for Domain Logons
+# (you need to configure Samba to act as a domain controller too.)
+;[netlogon]
+; comment = Network Logon Service
+; path = /home/samba/netlogon
+; guest ok = yes
+; read only = yes
+
+# Un-comment the following and create the profiles directory to store
+# users profiles (see the "logon path" option above)
+# (you need to configure Samba to act as a domain controller too.)
+# The path below should be writable by all users so that their
+# profile directory may be created the first time they log on
+;[profiles]
+; comment = Users profiles
+; path = /home/samba/profiles
+; guest ok = no
+; browseable = no
+; create mask = 0600
+; directory mask = 0700
+
+[printers]
+ comment = All Printers
+ browseable = no
+ path = /var/spool/samba
+ printable = yes
+ guest ok = no
+ read only = yes
+ create mask = 0700
+
+# Windows clients look for this share name as a source of downloadable
+# printer drivers
+[print$]
+ comment = Printer Drivers
+ path = /var/lib/samba/printers
+ browseable = yes
+ read only = yes
+ guest ok = no
+# Uncomment to allow remote administration of Windows print drivers.
+# You may need to replace 'lpadmin' with the name of the group your
+# admin users are members of.
+# Please note that you also need to set appropriate Unix permissions
+# to the drivers directory for these users to have write rights in it
+; write list = root, @lpadmin
+
diff --git a/src/libraries/System.Net.Primitives/ref/System.Net.Primitives.cs b/src/libraries/System.Net.Primitives/ref/System.Net.Primitives.cs
index 05dee66ca23777..6122e499bd50ae 100644
--- a/src/libraries/System.Net.Primitives/ref/System.Net.Primitives.cs
+++ b/src/libraries/System.Net.Primitives/ref/System.Net.Primitives.cs
@@ -256,6 +256,8 @@ public IPAddress(System.ReadOnlySpan address, long scopeid) { }
public static int HostToNetworkOrder(int host) { throw null; }
public static long HostToNetworkOrder(long host) { throw null; }
public static bool IsLoopback(System.Net.IPAddress address) { throw null; }
+ public static bool IsValidUtf8(System.ReadOnlySpan utf8Text) { throw null; }
+ public static bool IsValid(System.ReadOnlySpan ipSpan) { throw null; }
public System.Net.IPAddress MapToIPv4() { throw null; }
public System.Net.IPAddress MapToIPv6() { throw null; }
public static short NetworkToHostOrder(short network) { throw null; }
diff --git a/src/libraries/System.Net.Primitives/src/System/Net/IPAddress.cs b/src/libraries/System.Net.Primitives/src/System/Net/IPAddress.cs
index cd7e281e541c52..541e96219c1c03 100644
--- a/src/libraries/System.Net.Primitives/src/System/Net/IPAddress.cs
+++ b/src/libraries/System.Net.Primitives/src/System/Net/IPAddress.cs
@@ -226,6 +226,14 @@ internal IPAddress(int newAddress)
PrivateAddress = (uint)newAddress;
}
+ /// Determines whether the provided span contains a valid .
+ /// The text to parse.
+ public static bool IsValid(ReadOnlySpan ipSpan) => IPAddressParser.IsValid(ipSpan);
+
+ /// Determines whether the provided span contains a valid .
+ /// The text to parse.
+ public static bool IsValidUtf8(ReadOnlySpan utf8Text) => IPAddressParser.IsValid(utf8Text);
+
///
///
/// Converts an IP address string to an instance.
diff --git a/src/libraries/System.Net.Primitives/src/System/Net/IPAddressParser.cs b/src/libraries/System.Net.Primitives/src/System/Net/IPAddressParser.cs
index 7ef1cd216e99cb..2352c4f88397d2 100644
--- a/src/libraries/System.Net.Primitives/src/System/Net/IPAddressParser.cs
+++ b/src/libraries/System.Net.Primitives/src/System/Net/IPAddressParser.cs
@@ -16,6 +16,24 @@ internal static class IPAddressParser
internal const int MaxIPv4StringLength = 15; // 4 numbers separated by 3 periods, with up to 3 digits per number
internal const int MaxIPv6StringLength = 65;
+ public static unsafe bool IsValid(ReadOnlySpan ipSpan)
+ where TChar : unmanaged, IBinaryInteger
+ {
+ fixed (TChar* ipStringPtr = &MemoryMarshal.GetReference(ipSpan))
+ {
+ if (ipSpan.Contains(TChar.CreateTruncating(':')))
+ {
+ return IPv6AddressHelper.IsValidStrict(ipStringPtr, 0, ipSpan.Length);
+ }
+ else
+ {
+ int end = ipSpan.Length;
+ long address = IPv4AddressHelper.ParseNonCanonical(ipStringPtr, 0, ref end, notImplicitFile: true);
+ return address != IPv4AddressHelper.Invalid && end == ipSpan.Length;
+ }
+ }
+ }
+
internal static IPAddress? Parse(ReadOnlySpan ipSpan, bool tryParse)
where TChar : unmanaged, IBinaryInteger
{
@@ -75,60 +93,57 @@ private static unsafe bool TryParseIPv6(ReadOnlySpan ipSpan, Span<
Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
Debug.Assert(numbersLength >= IPAddressParserStatics.IPv6AddressShorts);
- int end = ipSpan.Length;
- bool isValid = false;
fixed (TChar* ipStringPtr = &MemoryMarshal.GetReference(ipSpan))
{
- isValid = IPv6AddressHelper.IsValidStrict(ipStringPtr, 0, ref end);
+ if (!IPv6AddressHelper.IsValidStrict(ipStringPtr, 0, ipSpan.Length))
+ {
+ scope = 0;
+ return false;
+ }
}
- scope = 0;
- if (isValid || (end != ipSpan.Length))
+ IPv6AddressHelper.Parse(ipSpan, numbers, out ReadOnlySpan scopeIdSpan);
+
+ if (scopeIdSpan.Length > 1)
{
- IPv6AddressHelper.Parse(ipSpan, numbers, out ReadOnlySpan scopeIdSpan);
+ bool parsedNumericScope;
+ scopeIdSpan = scopeIdSpan.Slice(1);
- if (scopeIdSpan.Length > 1)
+ // scopeId is a numeric value
+ if (typeof(TChar) == typeof(byte))
{
- bool parsedNumericScope = false;
- scopeIdSpan = scopeIdSpan.Slice(1);
+ ReadOnlySpan castScopeIdSpan = MemoryMarshal.Cast(scopeIdSpan);
- // scopeId is a numeric value
- if (typeof(TChar) == typeof(byte))
- {
- ReadOnlySpan castScopeIdSpan = MemoryMarshal.Cast(scopeIdSpan);
+ parsedNumericScope = uint.TryParse(castScopeIdSpan, NumberStyles.None, CultureInfo.InvariantCulture, out scope);
+ }
+ else
+ {
+ ReadOnlySpan castScopeIdSpan = MemoryMarshal.Cast(scopeIdSpan);
- parsedNumericScope = uint.TryParse(castScopeIdSpan, NumberStyles.None, CultureInfo.InvariantCulture, out scope);
- }
- else if (typeof(TChar) == typeof(char))
- {
- ReadOnlySpan castScopeIdSpan = MemoryMarshal.Cast(scopeIdSpan);
+ parsedNumericScope = uint.TryParse(castScopeIdSpan, NumberStyles.None, CultureInfo.InvariantCulture, out scope);
+ }
- parsedNumericScope = uint.TryParse(castScopeIdSpan, NumberStyles.None, CultureInfo.InvariantCulture, out scope);
- }
+ if (parsedNumericScope)
+ {
+ return true;
+ }
+ else
+ {
+ uint interfaceIndex = InterfaceInfoPal.InterfaceNameToIndex(scopeIdSpan);
- if (parsedNumericScope)
+ if (interfaceIndex > 0)
{
- return true;
+ scope = interfaceIndex;
+ return true; // scopeId is a known interface name
}
- else
- {
- uint interfaceIndex = InterfaceInfoPal.InterfaceNameToIndex(scopeIdSpan);
-
- if (interfaceIndex > 0)
- {
- scope = interfaceIndex;
- return true; // scopeId is a known interface name
- }
- }
-
- // scopeId is an unknown interface name
}
- // scopeId is not presented
- return true;
+ // scopeId is an unknown interface name
}
- return false;
+ // scopeId is not presented
+ scope = 0;
+ return true;
}
internal static int FormatIPv4Address(uint address, Span addressString)
diff --git a/src/libraries/System.Net.Primitives/tests/FunctionalTests/IPAddressParsing.cs b/src/libraries/System.Net.Primitives/tests/FunctionalTests/IPAddressParsing.cs
index 9331bf6b3b98c0..3e326de9236c9a 100644
--- a/src/libraries/System.Net.Primitives/tests/FunctionalTests/IPAddressParsing.cs
+++ b/src/libraries/System.Net.Primitives/tests/FunctionalTests/IPAddressParsing.cs
@@ -219,6 +219,8 @@ public abstract class IPAddressParsingFormatting
[MemberData(nameof(ValidIpv4Addresses))]
public void ParseIPv4_ValidAddress_Success(string address, string expected)
{
+ TestIsValid(address, true);
+
IPAddress ip = Parse(address);
// Validate the ToString of the parsed address matches the expected value
@@ -443,6 +445,8 @@ public void ParseIPv4_InvalidAddress_ThrowsFormatExceptionWithInnerException(str
[MemberData(nameof(ValidIpv6Addresses))]
public void ParseIPv6_ValidAddress_RoundtripMatchesExpected(string address, string expected)
{
+ TestIsValid(address, true);
+
IPAddress ip = Parse(address);
// Validate the ToString of the parsed address matches the expected value
@@ -467,6 +471,8 @@ public void ParseIPv6_ValidAddress_RoundtripMatchesExpected(string address, stri
[MemberData(nameof(ValidIpv6Addresses))]
public void TryParseIPv6_ValidAddress_RoundtripMatchesExpected(string address, string expected)
{
+ TestIsValid(address, true);
+
Assert.True(TryParse(address, out IPAddress ip));
// Validate the ToString of the parsed address matches the expected value
@@ -502,6 +508,7 @@ public void TryParseIPv6_ValidAddress_RoundtripMatchesExpected(string address, s
[MemberData(nameof(ScopeIds))]
public void ParseIPv6_ExtractsScopeId(string address, int expectedScopeId)
{
+ TestIsValid(address, true);
IPAddress ip = Parse(address);
Assert.Equal(expectedScopeId, ip.ScopeId);
}
@@ -613,6 +620,8 @@ public void ParseIPv6_InvalidAddress_ThrowsFormatExceptionWithNoInnerExceptionIn
private void ParseInvalidAddress(string invalidAddress, bool hasInnerSocketException)
{
+ TestIsValid(invalidAddress, false);
+
FormatException fe = Assert.Throws(() => Parse(invalidAddress));
if (hasInnerSocketException)
{
@@ -628,5 +637,11 @@ private void ParseInvalidAddress(string invalidAddress, bool hasInnerSocketExcep
Assert.False(TryParse(invalidAddress, out result));
Assert.Null(result);
}
+
+ private static void TestIsValid(string address, bool expectedValid)
+ {
+ Assert.Equal(expectedValid, IPAddress.IsValid(address));
+ Assert.Equal(expectedValid, IPAddress.IsValidUtf8(Encoding.UTF8.GetBytes(address)));
+ }
}
}
diff --git a/src/libraries/System.Net.Primitives/tests/UnitTests/Fakes/IPv6AddressHelper.cs b/src/libraries/System.Net.Primitives/tests/UnitTests/Fakes/IPv6AddressHelper.cs
index 32dc4cc2631925..07be627eedcba9 100644
--- a/src/libraries/System.Net.Primitives/tests/UnitTests/Fakes/IPv6AddressHelper.cs
+++ b/src/libraries/System.Net.Primitives/tests/UnitTests/Fakes/IPv6AddressHelper.cs
@@ -11,7 +11,7 @@ internal static class IPv6AddressHelper
internal static unsafe (int longestSequenceStart, int longestSequenceLength) FindCompressionRange(
ReadOnlySpan numbers) => (-1, -1);
internal static unsafe bool ShouldHaveIpv4Embedded(ReadOnlySpan numbers) => false;
- internal static unsafe bool IsValidStrict(TChar* name, int start, ref int end)
+ internal static unsafe bool IsValidStrict(TChar* name, int start, int end)
where TChar : unmanaged, IBinaryInteger => false;
internal static unsafe bool Parse(ReadOnlySpan address, Span numbers, out ReadOnlySpan scopeId)
where TChar : unmanaged, IBinaryInteger
diff --git a/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnection.cs b/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnection.cs
index 840e1bdac7b0c1..95457e48584077 100644
--- a/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnection.cs
+++ b/src/libraries/System.Net.Quic/src/System/Net/Quic/QuicConnection.cs
@@ -423,7 +423,7 @@ private async ValueTask FinishConnectAsync(QuicClientConnectionOptions options,
// RFC 6066 forbids IP literals.
// IDN mapping is handled by MsQuic.
- string sni = (TargetHostNameHelper.IsValidAddress(options.ClientAuthenticationOptions.TargetHost) ? null : options.ClientAuthenticationOptions.TargetHost) ?? host ?? string.Empty;
+ string sni = (IPAddress.IsValid(options.ClientAuthenticationOptions.TargetHost) ? null : options.ClientAuthenticationOptions.TargetHost) ?? host ?? string.Empty;
IntPtr targetHostPtr = Marshal.StringToCoTaskMemUTF8(sni);
try
@@ -458,7 +458,7 @@ internal ValueTask FinishHandshakeAsync(QuicServerConnectionOptions options, str
_streamCapacityCallback = options.StreamCapacityCallback;
// RFC 6066 forbids IP literals, avoid setting IP address here for consistency with SslStream
- if (TargetHostNameHelper.IsValidAddress(targetHost))
+ if (IPAddress.IsValid(targetHost))
{
targetHost = string.Empty;
}
diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/Pal.Android/SafeDeleteSslContext.cs b/src/libraries/System.Net.Security/src/System/Net/Security/Pal.Android/SafeDeleteSslContext.cs
index 0f141c0812f942..e958a482898f9e 100644
--- a/src/libraries/System.Net.Security/src/System/Net/Security/Pal.Android/SafeDeleteSslContext.cs
+++ b/src/libraries/System.Net.Security/src/System/Net/Security/Pal.Android/SafeDeleteSslContext.cs
@@ -255,7 +255,7 @@ private unsafe void InitializeSslContext(
Interop.AndroidCrypto.SSLStreamRequestClientAuthentication(handle);
}
- if (!isServer && !string.IsNullOrEmpty(authOptions.TargetHost) && !TargetHostNameHelper.IsValidAddress(authOptions.TargetHost))
+ if (!isServer && !string.IsNullOrEmpty(authOptions.TargetHost) && !IPAddress.IsValid(authOptions.TargetHost))
{
Interop.AndroidCrypto.SSLStreamSetTargetHost(handle, authOptions.TargetHost);
}
diff --git a/src/libraries/System.Net.Security/src/System/Net/Security/Pal.OSX/SafeDeleteSslContext.cs b/src/libraries/System.Net.Security/src/System/Net/Security/Pal.OSX/SafeDeleteSslContext.cs
index 7ff7b26e7a5e62..f1945c428363cd 100644
--- a/src/libraries/System.Net.Security/src/System/Net/Security/Pal.OSX/SafeDeleteSslContext.cs
+++ b/src/libraries/System.Net.Security/src/System/Net/Security/Pal.OSX/SafeDeleteSslContext.cs
@@ -95,7 +95,7 @@ public SafeDeleteSslContext(SslAuthenticationOptions sslAuthenticationOptions)
throw;
}
- if (!string.IsNullOrEmpty(sslAuthenticationOptions.TargetHost) && !sslAuthenticationOptions.IsServer && !TargetHostNameHelper.IsValidAddress(sslAuthenticationOptions.TargetHost))
+ if (!string.IsNullOrEmpty(sslAuthenticationOptions.TargetHost) && !sslAuthenticationOptions.IsServer && !IPAddress.IsValid(sslAuthenticationOptions.TargetHost))
{
Interop.AppleCrypto.SslSetTargetName(_sslContext, sslAuthenticationOptions.TargetHost);
}
diff --git a/src/libraries/System.Net.ServerSentEvents/src/System.Net.ServerSentEvents.csproj b/src/libraries/System.Net.ServerSentEvents/src/System.Net.ServerSentEvents.csproj
index 7ca797752fa435..4f94192389cfe3 100644
--- a/src/libraries/System.Net.ServerSentEvents/src/System.Net.ServerSentEvents.csproj
+++ b/src/libraries/System.Net.ServerSentEvents/src/System.Net.ServerSentEvents.csproj
@@ -24,6 +24,7 @@ System.Net.ServerSentEvents.SseParser
+
diff --git a/src/libraries/System.Net.ServerSentEvents/src/System/Net/ServerSentEvents/Helpers.cs b/src/libraries/System.Net.ServerSentEvents/src/System/Net/ServerSentEvents/Helpers.cs
index 4639c84cd3ded9..2b78bb445f28d7 100644
--- a/src/libraries/System.Net.ServerSentEvents/src/System/Net/ServerSentEvents/Helpers.cs
+++ b/src/libraries/System.Net.ServerSentEvents/src/System/Net/ServerSentEvents/Helpers.cs
@@ -4,11 +4,7 @@
using System.Buffers;
using System.Diagnostics;
using System.Globalization;
-using System.IO;
-using System.Runtime.InteropServices;
using System.Text;
-using System.Threading;
-using System.Threading.Tasks;
namespace System.Net.ServerSentEvents
{
@@ -67,34 +63,5 @@ public static unsafe void WriteUtf8String(this IBufferWriter writer, ReadO
public static bool ContainsLineBreaks(this ReadOnlySpan text) =>
text.IndexOfAny('\r', '\n') >= 0;
-
-#if !NET
-
- public static ValueTask WriteAsync(this Stream stream, ReadOnlyMemory buffer, CancellationToken cancellationToken = default)
- {
- if (MemoryMarshal.TryGetArray(buffer, out ArraySegment segment))
- {
- return new ValueTask(stream.WriteAsync(segment.Array, segment.Offset, segment.Count, cancellationToken));
- }
- else
- {
- return WriteAsyncUsingPooledBuffer(stream, buffer, cancellationToken);
-
- static async ValueTask WriteAsyncUsingPooledBuffer(Stream stream, ReadOnlyMemory buffer, CancellationToken cancellationToken)
- {
- byte[] sharedBuffer = ArrayPool.Shared.Rent(buffer.Length);
- buffer.Span.CopyTo(sharedBuffer);
- try
- {
- await stream.WriteAsync(sharedBuffer, 0, buffer.Length, cancellationToken).ConfigureAwait(false);
- }
- finally
- {
- ArrayPool.Shared.Return(sharedBuffer);
- }
- }
- }
- }
-#endif
}
}
diff --git a/src/libraries/System.Net.ServerSentEvents/src/System/Net/ServerSentEvents/SseParser_1.cs b/src/libraries/System.Net.ServerSentEvents/src/System/Net/ServerSentEvents/SseParser_1.cs
index bff2149a6b9f24..dbf4bd1579c03b 100644
--- a/src/libraries/System.Net.ServerSentEvents/src/System/Net/ServerSentEvents/SseParser_1.cs
+++ b/src/libraries/System.Net.ServerSentEvents/src/System/Net/ServerSentEvents/SseParser_1.cs
@@ -500,13 +500,7 @@ private async ValueTask FillLineBufferAsync(CancellationToken cancellationT
ShiftOrGrowLineBufferIfNecessary();
int offset = _lineOffset + _lineLength;
- int bytesRead = await
-#if NET
- _stream.ReadAsync(_lineBuffer.AsMemory(offset), cancellationToken)
-#else
- new ValueTask(_stream.ReadAsync(_lineBuffer, offset, _lineBuffer.Length - offset, cancellationToken))
-#endif
- .ConfigureAwait(false);
+ int bytesRead = await _stream.ReadAsync(_lineBuffer.AsMemory(offset), cancellationToken).ConfigureAwait(false);
if (bytesRead > 0)
{
diff --git a/src/libraries/System.Net.Sockets/src/Resources/Strings.resx b/src/libraries/System.Net.Sockets/src/Resources/Strings.resx
index 7a0feca077c032..36faf4552f604c 100644
--- a/src/libraries/System.Net.Sockets/src/Resources/Strings.resx
+++ b/src/libraries/System.Net.Sockets/src/Resources/Strings.resx
@@ -312,9 +312,6 @@
System.Net.Sockets is not supported on this platform.
-
- Handle is already used by another Socket.
-
Provided SocketAddress is too small for given AddressFamily.
diff --git a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncContext.Unix.cs b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncContext.Unix.cs
index 8463c5142b573c..4cc7a28fca8143 100644
--- a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncContext.Unix.cs
+++ b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncContext.Unix.cs
@@ -1262,6 +1262,8 @@ public void Trace(SocketAsyncContext context, string message, [CallerMemberName]
private SocketAsyncEngine? _asyncEngine;
private bool IsRegistered => _asyncEngine != null;
private bool _isHandleNonBlocking = OperatingSystem.IsWasi(); // WASI sockets are always non-blocking, because we don't have another thread which could be blocked
+ /// An index into 's table of all contexts that are currently .
+ internal int GlobalContextIndex = -1;
private readonly object _registerLock = new object();
@@ -1330,7 +1332,10 @@ public bool StopAndAbort()
// We don't need to synchronize with Register.
// This method is called when the handle gets released.
// The Register method will throw ODE when it tries to use the handle at this point.
- _asyncEngine?.UnregisterSocket(_socket.DangerousGetHandle(), this);
+ if (IsRegistered)
+ {
+ SocketAsyncEngine.UnregisterSocket(this);
+ }
return aborted;
}
diff --git a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEngine.Unix.cs b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEngine.Unix.cs
index 7405e579042232..b67af69163bc5e 100644
--- a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEngine.Unix.cs
+++ b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEngine.Unix.cs
@@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections.Concurrent;
+using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
@@ -74,14 +75,17 @@ private static SocketAsyncEngine[] CreateEngines()
return engines;
}
+ ///
+ /// Each is assigned an index into this table while registered with a .
+ /// The index is used as the to quickly map events to s.
+ /// It is also stored in so that we can efficiently remove it when unregistering the socket.
+ ///
+ private static SocketAsyncContext?[] s_registeredContexts = [];
+ private static readonly Queue s_registeredContextsFreeList = [];
+
private readonly IntPtr _port;
private readonly Interop.Sys.SocketEvent* _buffer;
- //
- // Maps handle values to SocketAsyncContext instances.
- //
- private readonly ConcurrentDictionary _handleToContextMap = new ConcurrentDictionary();
-
//
// Queue of events generated by EventLoop() that would be processed by the thread pool
//
@@ -119,28 +123,54 @@ public static bool TryRegisterSocket(IntPtr socketHandle, SocketAsyncContext con
private bool TryRegisterCore(IntPtr socketHandle, SocketAsyncContext context, out Interop.Error error)
{
- bool added = _handleToContextMap.TryAdd(socketHandle, new SocketAsyncContextWrapper(context));
- if (!added)
+ Debug.Assert(context.GlobalContextIndex == -1);
+
+ lock (s_registeredContextsFreeList)
{
- // Using public SafeSocketHandle(IntPtr) a user can add the same handle
- // from a different Socket instance.
- throw new InvalidOperationException(SR.net_sockets_handle_already_used);
+ if (!s_registeredContextsFreeList.TryDequeue(out int index))
+ {
+ int previousLength = s_registeredContexts.Length;
+ int newLength = Math.Max(4, 2 * previousLength);
+
+ Array.Resize(ref s_registeredContexts, newLength);
+
+ for (int i = previousLength + 1; i < newLength; i++)
+ {
+ s_registeredContextsFreeList.Enqueue(i);
+ }
+
+ index = previousLength;
+ }
+
+ Debug.Assert(s_registeredContexts[index] is null);
+
+ s_registeredContexts[index] = context;
+ context.GlobalContextIndex = index;
}
error = Interop.Sys.TryChangeSocketEventRegistration(_port, socketHandle, Interop.Sys.SocketEvents.None,
- Interop.Sys.SocketEvents.Read | Interop.Sys.SocketEvents.Write, socketHandle);
+ Interop.Sys.SocketEvents.Read | Interop.Sys.SocketEvents.Write, context.GlobalContextIndex);
if (error == Interop.Error.SUCCESS)
{
return true;
}
- _handleToContextMap.TryRemove(socketHandle, out _);
+ UnregisterSocket(context);
return false;
}
- public void UnregisterSocket(IntPtr socketHandle, SocketAsyncContext __)
+ public static void UnregisterSocket(SocketAsyncContext context)
{
- _handleToContextMap.TryRemove(socketHandle, out _);
+ Debug.Assert(context.GlobalContextIndex >= 0);
+ Debug.Assert(ReferenceEquals(s_registeredContexts[context.GlobalContextIndex], context));
+
+ lock (s_registeredContextsFreeList)
+ {
+ s_registeredContexts[context.GlobalContextIndex] = null;
+ s_registeredContextsFreeList.Enqueue(context.GlobalContextIndex);
+ }
+
+ context.GlobalContextIndex = -1;
}
private SocketAsyncEngine()
@@ -324,13 +354,11 @@ private readonly struct SocketEventHandler
{
public Interop.Sys.SocketEvent* Buffer { get; }
- private readonly ConcurrentDictionary _handleToContextMap;
private readonly ConcurrentQueue _eventQueue;
public SocketEventHandler(SocketAsyncEngine engine)
{
Buffer = engine._buffer;
- _handleToContextMap = engine._handleToContextMap;
_eventQueue = engine._eventQueue;
}
@@ -340,10 +368,15 @@ public bool HandleSocketEvents(int numEvents)
bool enqueuedEvent = false;
foreach (var socketEvent in new ReadOnlySpan(Buffer, numEvents))
{
- if (_handleToContextMap.TryGetValue(socketEvent.Data, out SocketAsyncContextWrapper contextWrapper))
- {
- SocketAsyncContext context = contextWrapper.Context;
+ Debug.Assert((uint)socketEvent.Data < (uint)s_registeredContexts.Length);
+ // The context may be null if the socket was unregistered right before the event was processed.
+ // The slot in s_registeredContexts may have been reused by a different context, in which case the
+ // incorrect socket will notice that no information is available yet and harmlessly retry, waiting for new events.
+ SocketAsyncContext? context = s_registeredContexts[(uint)socketEvent.Data];
+
+ if (context is not null)
+ {
if (context.PreferInlineCompletions)
{
context.HandleEventsInline(socketEvent.Events);
@@ -365,18 +398,6 @@ public bool HandleSocketEvents(int numEvents)
}
}
- // struct wrapper is used in order to improve the performance of the epoll thread hot path by up to 3% of some TechEmpower benchmarks
- // the goal is to have a dedicated generic instantiation and using:
- // System.Collections.Concurrent.ConcurrentDictionary`2[System.IntPtr,System.Net.Sockets.SocketAsyncContextWrapper]::TryGetValueInternal(!0,int32,!1&)
- // instead of:
- // System.Collections.Concurrent.ConcurrentDictionary`2[System.IntPtr,System.__Canon]::TryGetValueInternal(!0,int32,!1&)
- private readonly struct SocketAsyncContextWrapper
- {
- public SocketAsyncContextWrapper(SocketAsyncContext context) => Context = context;
-
- internal SocketAsyncContext Context { get; }
- }
-
private readonly struct SocketIOEvent
{
public SocketAsyncContext Context { get; }
diff --git a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEngine.Wasi.cs b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEngine.Wasi.cs
index 3b69902260d812..0a39feb2699364 100644
--- a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEngine.Wasi.cs
+++ b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEngine.Wasi.cs
@@ -35,9 +35,7 @@ public static bool TryRegisterSocket(IntPtr socketHandle, SocketAsyncContext con
return true;
}
-#pragma warning disable CA1822
- public void UnregisterSocket(IntPtr _, SocketAsyncContext context)
-#pragma warning restore CA1822
+ public static void UnregisterSocket(SocketAsyncContext context)
{
context.unregisterPollHook.Cancel();
}
diff --git a/src/libraries/System.Net.WebProxy/src/System/Net/WebProxy.Wasm.cs b/src/libraries/System.Net.WebProxy/src/System/Net/WebProxy.Wasm.cs
index a2756eb6487396..26f47648d5c8f5 100644
--- a/src/libraries/System.Net.WebProxy/src/System/Net/WebProxy.Wasm.cs
+++ b/src/libraries/System.Net.WebProxy/src/System/Net/WebProxy.Wasm.cs
@@ -16,7 +16,7 @@ private static bool IsLocal(Uri host)
string hostString = host.Host;
return
- !IPAddress.TryParse(hostString, out _) &&
+ !IPAddress.IsValid(hostString) &&
!hostString.Contains('.');
}
}
diff --git a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorExtensions.cs b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorExtensions.cs
index 1274b20b8cf9eb..5ba164337bfc91 100644
--- a/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorExtensions.cs
+++ b/src/libraries/System.Numerics.Tensors/src/System/Numerics/Tensors/netcore/TensorExtensions.cs
@@ -3501,7 +3501,7 @@ public static ref readonly TensorSpan StackAlongDimension(scoped ReadOnlyS
{
outputs[i] = Tensor.Unsqueeze(tensors[i], dimension);
}
- return ref Tensor.ConcatenateOnDimension(dimension, tensors, destination);
+ return ref Tensor.ConcatenateOnDimension(dimension, outputs, destination);
}
#endregion
diff --git a/src/libraries/System.Numerics.Tensors/tests/TensorTests.cs b/src/libraries/System.Numerics.Tensors/tests/TensorTests.cs
index 16cf20c3fc82b8..165779fe329a61 100644
--- a/src/libraries/System.Numerics.Tensors/tests/TensorTests.cs
+++ b/src/libraries/System.Numerics.Tensors/tests/TensorTests.cs
@@ -988,6 +988,7 @@ public static void TensorSetSliceTests()
Assert.Equal(13, t0[1, 3]);
Assert.Equal(14, t0[1, 4]);
}
+
[Fact]
public static void TensorStackTests()
{
@@ -1075,7 +1076,7 @@ public static void TensorStackTests()
Assert.Equal(9, resultTensor[1, 4, 0]);
Assert.Equal(9, resultTensor[1, 4, 1]);
- // stacking 2x2 tensors along dimention 1
+ // stacking 2x2 tensors along dimension 1
Tensor v1 = Tensor.Create([1, 2, 3, 4], [2, 2]);
Tensor v2 = Tensor.Create([10, 20, 30, 40], [2, 2]);
@@ -1095,6 +1096,26 @@ public static void TensorStackTests()
Assert.Equal(4, resultTensor[1, 0, 1]);
Assert.Equal(30, resultTensor[1, 1, 0]);
Assert.Equal(40, resultTensor[1, 1, 1]);
+
+ resultTensor = Tensor.StackAlongDimension(0, [v1, v2]);
+
+ Tensor resultTensor2 = Tensor.Create([2, 2, 2]);
+ Tensor.StackAlongDimension([v1, v2], resultTensor2, 1);
+
+ Assert.Equal(3, resultTensor2.Rank);
+ Assert.Equal(2, resultTensor2.Lengths[0]);
+ Assert.Equal(2, resultTensor2.Lengths[1]);
+ Assert.Equal(2, resultTensor2.Lengths[2]);
+
+ Assert.Equal(1, resultTensor2[0, 0, 0]);
+ Assert.Equal(2, resultTensor2[0, 0, 1]);
+ Assert.Equal(10, resultTensor2[0, 1, 0]);
+ Assert.Equal(20, resultTensor2[0, 1, 1]);
+
+ Assert.Equal(3, resultTensor2[1, 0, 0]);
+ Assert.Equal(4, resultTensor2[1, 0, 1]);
+ Assert.Equal(30, resultTensor2[1, 1, 0]);
+ Assert.Equal(40, resultTensor2[1, 1, 1]);
}
[Fact]
diff --git a/src/libraries/System.Numerics.Vectors/ref/System.Numerics.Vectors.cs b/src/libraries/System.Numerics.Vectors/ref/System.Numerics.Vectors.cs
index fd00fe8c727068..e485b71f87639e 100644
--- a/src/libraries/System.Numerics.Vectors/ref/System.Numerics.Vectors.cs
+++ b/src/libraries/System.Numerics.Vectors/ref/System.Numerics.Vectors.cs
@@ -205,7 +205,11 @@ public static partial class Vector
public static bool IsHardwareAccelerated { get { throw null; } }
public static System.Numerics.Vector Abs(System.Numerics.Vector value) { throw null; }
public static System.Numerics.Vector Add(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; }
+ public static bool All(System.Numerics.Vector vector, T value) { throw null; }
+ public static bool AllWhereAllBitsSet(System.Numerics.Vector vector) { throw null; }
public static System.Numerics.Vector AndNot(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; }
+ public static bool Any(System.Numerics.Vector vector, T value) { throw null; }
+ public static bool AnyWhereAllBitsSet(System.Numerics.Vector vector) { throw null; }
public static System.Numerics.Vector As(this System.Numerics.Vector vector) { throw null; }
public static System.Numerics.Plane AsPlane(this System.Numerics.Vector4 value) { throw null; }
public static System.Numerics.Quaternion AsQuaternion(this System.Numerics.Vector4 value) { throw null; }
@@ -264,6 +268,8 @@ public static partial class Vector
public static System.Numerics.Vector CopySign(System.Numerics.Vector value, System.Numerics.Vector sign) { throw null; }
public static System.Numerics.Vector Cos(System.Numerics.Vector vector) { throw null; }
public static System.Numerics.Vector Cos(System.Numerics.Vector vector) { throw null; }
+ public static int Count(System.Numerics.Vector vector, T value) { throw null; }
+ public static int CountWhereAllBitsSet(System.Numerics.Vector vector) { throw null; }
public static System.Numerics.Vector Create(T value) { throw null; }
public static System.Numerics.Vector Create(System.ReadOnlySpan values) { throw null; }
public static System.Numerics.Vector CreateSequence(T start, T step) { throw null; }
@@ -281,11 +287,20 @@ public static partial class Vector
public static System.Numerics.Vector Equals(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; }
public static System.Numerics.Vector Exp(System.Numerics.Vector vector) { throw null; }
public static System.Numerics.Vector Exp(System.Numerics.Vector vector) { throw null; }
+ [CLSCompliant(false)]
+ public static uint ExtractMostSignificantBits(this System.Numerics.Vector2 vector) { throw null; }
+ [CLSCompliant(false)]
+ public static uint ExtractMostSignificantBits(this System.Numerics.Vector3 vector) { throw null; }
+ [CLSCompliant(false)]
+ public static uint ExtractMostSignificantBits(this System.Numerics.Vector4 vector) { throw null; }
public static System.Numerics.Vector Floor(System.Numerics.Vector value) { throw null; }
public static System.Numerics.Vector Floor(System.Numerics.Vector value) { throw null; }
public static System.Numerics.Vector FusedMultiplyAdd(System.Numerics.Vector left, System.Numerics.Vector right, System.Numerics.Vector addend) { throw null; }
public static System.Numerics.Vector FusedMultiplyAdd(System.Numerics.Vector left, System.Numerics.Vector right, System.Numerics.Vector addend) { throw null; }
public static T GetElement(this System.Numerics.Vector vector, int index) { throw null; }
+ public static float GetElement(this System.Numerics.Vector2 vector, int index) { throw null; }
+ public static float GetElement(this System.Numerics.Vector3 vector, int index) { throw null; }
+ public static float GetElement(this System.Numerics.Vector4 vector, int index) { throw null; }
public static System.Numerics.Vector GreaterThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; }
public static System.Numerics.Vector GreaterThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; }
public static System.Numerics.Vector GreaterThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; }
@@ -302,11 +317,23 @@ public static partial class Vector
public static System.Numerics.Vector GreaterThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; }
public static System.Numerics.Vector Hypot(System.Numerics.Vector x, System.Numerics.Vector y) { throw null; }
public static System.Numerics.Vector Hypot(System.Numerics.Vector x, System.Numerics.Vector y) { throw null; }
+ public static int IndexOf(System.Numerics.Vector vector, T value) { throw null; }
+ public static int IndexOfWhereAllBitsSet(System.Numerics.Vector vector) { throw null; }
+ public static System.Numerics.Vector IsEvenInteger(System.Numerics.Vector vector) { throw null; }
+ public static System.Numerics.Vector IsFinite(System.Numerics.Vector vector) { throw null; }
+ public static System.Numerics.Vector IsInfinity(System.Numerics.Vector vector) { throw null; }
+ public static System.Numerics.Vector IsInteger(System.Numerics.Vector vector) { throw null; }
public static System.Numerics.Vector IsNaN(System.Numerics.Vector vector) { throw null; }
public static System.Numerics.Vector IsNegative(System.Numerics.Vector vector) { throw null; }
+ public static System.Numerics.Vector IsNegativeInfinity(System.Numerics.Vector vector) { throw null; }
+ public static System.Numerics.Vector IsNormal(System.Numerics.Vector vector) { throw null; }
+ public static System.Numerics.Vector IsOddInteger(System.Numerics.Vector vector) { throw null; }
public static System.Numerics.Vector IsPositive(System.Numerics.Vector vector) { throw null; }
public static System.Numerics.Vector IsPositiveInfinity(System.Numerics.Vector vector) { throw null; }
+ public static System.Numerics.Vector IsSubnormal(System.Numerics.Vector vector) { throw null; }
public static System.Numerics.Vector IsZero(System.Numerics.Vector vector) { throw null; }
+ public static int LastIndexOf(System.Numerics.Vector vector, T value) { throw null; }
+ public static int LastIndexOfWhereAllBitsSet(System.Numerics.Vector vector) { throw null; }
public static System.Numerics.Vector Lerp(System.Numerics.Vector x, System.Numerics.Vector y, System.Numerics.Vector amount) { throw null; }
public static System.Numerics.Vector Lerp(System.Numerics.Vector x, System.Numerics.Vector y, System.Numerics.Vector amount) { throw null; }
public static System.Numerics.Vector LessThan(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; }
@@ -363,6 +390,8 @@ public static partial class Vector
[System.CLSCompliantAttribute(false)]
public static System.Numerics.Vector Narrow(System.Numerics.Vector low, System.Numerics.Vector high) { throw null; }
public static System.Numerics.Vector Negate(System.Numerics.Vector value) { throw null; }
+ public static bool None(System.Numerics.Vector vector, T value) { throw null; }
+ public static bool NoneWhereAllBitsSet(System.Numerics.Vector vector) { throw null; }
public static System.Numerics.Vector OnesComplement(System.Numerics.Vector value) { throw null; }
public static System.Numerics.Vector RadiansToDegrees(System.Numerics.Vector radians) { throw null; }
public static System.Numerics.Vector RadiansToDegrees(System.Numerics.Vector radians) { throw null; }
@@ -414,15 +443,45 @@ public static partial class Vector
[System.CLSCompliantAttribute(false)]
public static unsafe void Store(this System.Numerics.Vector source, T* destination) { throw null; }
[System.CLSCompliantAttribute(false)]
+ public static unsafe void Store(this System.Numerics.Vector2 source, float* destination) { throw null; }
+ [System.CLSCompliantAttribute(false)]
+ public static unsafe void Store(this System.Numerics.Vector3 source, float* destination) { throw null; }
+ [System.CLSCompliantAttribute(false)]
+ public static unsafe void Store(this System.Numerics.Vector4 source, float* destination) { throw null; }
+ [System.CLSCompliantAttribute(false)]
public static unsafe void StoreAligned(this System.Numerics.Vector source, T* destination) { throw null; }
[System.CLSCompliantAttribute(false)]
+ public static unsafe void StoreAligned(this System.Numerics.Vector2 source, float* destination) { throw null; }
+ [System.CLSCompliantAttribute(false)]
+ public static unsafe void StoreAligned(this System.Numerics.Vector3 source, float* destination) { throw null; }
+ [System.CLSCompliantAttribute(false)]
+ public static unsafe void StoreAligned(this System.Numerics.Vector4 source, float* destination) { throw null; }
+ [System.CLSCompliantAttribute(false)]
public static unsafe void StoreAlignedNonTemporal(this System.Numerics.Vector source, T* destination) { throw null; }
+ [System.CLSCompliantAttribute(false)]
+ public static unsafe void StoreAlignedNonTemporal(this System.Numerics.Vector2 source, float* destination) { throw null; }
+ [System.CLSCompliantAttribute(false)]
+ public static unsafe void StoreAlignedNonTemporal(this System.Numerics.Vector3 source, float* destination) { throw null; }
+ [System.CLSCompliantAttribute(false)]
+ public static unsafe void StoreAlignedNonTemporal(this System.Numerics.Vector4 source, float* destination) { throw null; }
public static void StoreUnsafe(this System.Numerics.Vector source, ref T destination) { throw null; }
+ public static void StoreUnsafe(this System.Numerics.Vector2 source, ref float destination) { throw null; }
+ public static void StoreUnsafe(this System.Numerics.Vector3 source, ref float destination) { throw null; }
+ public static void StoreUnsafe(this System.Numerics.Vector4 source, ref float destination) { throw null; }
[System.CLSCompliantAttribute(false)]
public static void StoreUnsafe(this System.Numerics.Vector source, ref T destination, nuint elementOffset) { throw null; }
+ [System.CLSCompliantAttribute(false)]
+ public static void StoreUnsafe(this System.Numerics.Vector2 source, ref float destination, nuint elementOffset) { throw null; }
+ [System.CLSCompliantAttribute(false)]
+ public static void StoreUnsafe(this System.Numerics.Vector3 source, ref float destination, nuint elementOffset) { throw null; }
+ [System.CLSCompliantAttribute(false)]
+ public static void StoreUnsafe(this System.Numerics.Vector4 source, ref float destination, nuint elementOffset) { throw null; }
public static System.Numerics.Vector Subtract(System.Numerics.Vector left, System.Numerics.Vector right) { throw null; }
public static T Sum(System.Numerics.Vector value) { throw null; }
public static T ToScalar(this System.Numerics.Vector vector) { throw null; }
+ public static float ToScalar(this System.Numerics.Vector2 vector) { throw null; }
+ public static float ToScalar(this System.Numerics.Vector3 vector) { throw null; }
+ public static float ToScalar(this System.Numerics.Vector4 vector) { throw null; }
public static System.Numerics.Vector Truncate(System.Numerics.Vector vector) { throw null; }
public static System.Numerics.Vector Truncate(System.Numerics.Vector vector) { throw null; }
[System.CLSCompliantAttribute(false)]
@@ -459,6 +518,9 @@ public static partial class Vector
[System.CLSCompliantAttribute(false)]
public static System.Numerics.Vector WidenUpper(System.Numerics.Vector source) { throw null; }
public static System.Numerics.Vector