diff --git a/THIRD-PARTY-NOTICES.TXT b/THIRD-PARTY-NOTICES.TXT
index 707bd024f8f8..32e23122d71a 100644
--- a/THIRD-PARTY-NOTICES.TXT
+++ b/THIRD-PARTY-NOTICES.TXT
@@ -860,3 +860,28 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+License notice for vectorized sorting code
+------------------------------------------
+
+MIT License
+
+Copyright (c) 2020 Dan Shechter
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/docs/deep-dive-blog-posts.md b/docs/deep-dive-blog-posts.md
index 34d0b406eb99..01278693e80e 100644
--- a/docs/deep-dive-blog-posts.md
+++ b/docs/deep-dive-blog-posts.md
@@ -6,6 +6,7 @@
- [Performance improvements in .NET Core 2.0](https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-core/)
- [Performance improvements in .NET Core 2.1](https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-core-2-1/)
- [Performance improvements in .NET Core 3.0](https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-core-3-0/)
+- [Performance improvements in .NET 5](https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-5/)
### Posts that take a high-level look at the entire source:
diff --git a/docs/project/list-of-obsoletions.md b/docs/project/list-of-obsoletions.md
index 40e833ae20f8..6b4d3a415ef8 100644
--- a/docs/project/list-of-obsoletions.md
+++ b/docs/project/list-of-obsoletions.md
@@ -15,3 +15,4 @@ Currently the identifiers `MSLIB0001` through `MSLIB0999` are carved out for obs
| :--------------- | :---------- |
| __`MSLIB0001`__ | The UTF-7 encoding is insecure and should not be used. Consider using UTF-8 instead. |
| __`MSLIB0002`__ | `PrincipalPermissionAttribute` is not honored by the runtime and must not be used. |
+| __`MSLIB0003`__ | `BinaryFormatter` serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for recommended alternatives. |
diff --git a/docs/workflow/trimming/feature-switches.md b/docs/workflow/trimming/feature-switches.md
new file mode 100644
index 000000000000..ad911e818d7a
--- /dev/null
+++ b/docs/workflow/trimming/feature-switches.md
@@ -0,0 +1,57 @@
+# Libraries Feature Switches
+
+Starting with .NET 5 there are several [feature-switches](https://github.com/dotnet/designs/blob/master/accepted/2020/feature-switch.md) available which
+can be used to control the size of the final binary. They are available in all
+configurations but their defaults might vary as any SDK can set the defaults differently.
+
+## Available Feature Switches
+
+| MSBuild Property Name | AppContext Setting | Description |
+|-|-|-|
+| DebuggerSupport | System.Diagnostics.Debugger.IsSupported | Any dependency that enables better debugging experience to be trimmed when set to false |
+| EnableUnsafeUTF7Encoding | System.Text.Encoding.EnableUnsafeUTF7Encoding | Insecure UTF-7 encoding is trimmed when set to false |
+| EnableUnsafeBinaryFormatterSerialization | System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization | BinaryFormatter serialization support is trimmed when set to false |
+| EventSourceSupport | System.Diagnostics.Tracing.EventSource.IsSupported | Any EventSource related code or logic is trimmed when set to false |
+| InvariantGlobalization | System.Globalization.Invariant | All globalization specific code and data is trimmed when set to true |
+| UseSystemResourceKeys | System.Resources.UseSystemResourceKeys | Any localizable resources for system assemblies is trimmed when set to true |
+| - | System.Net.Http.EnableActivityPropagation | Any dependency related to diagnostics support for System.Net.Http is trimmed when set to false |
+
+Any feature-switch which defines property can be set in csproj file or
+on the command line as any other MSBuild property. Those without predefined property name
+the value can be set with following XML tag in csproj file.
+
+```xml
+
+```
+
+## Adding New Feature Switch
+
+The primary goal of features switches is to produce smaller output by removing code which is
+unreachable under feature condition. The typical approach is to introduce static bool like
+property which is used to guard the dependencies which can be trimmed when the value is flipped.
+Ideally, the static property should be located in type which does not have any static constructor
+logic. Once you are done with the code changes following steps connects the code with trimming
+settings.
+
+Add XML settings for the features switch to assembly substitution. It's usually located in
+`src/ILLink/ILLink.Substitutions.xml` file for each library. The example of the syntax used to control
+`EnableUnsafeUTF7Encoding` property is following.
+
+```xml
+
+```
+
+Add MSBuild integration by adding new RuntimeHostConfigurationOption entry. The file is located in
+[Microsoft.NET.Sdk.targets](https://github.com/dotnet/sdk/blob/33ce6234e6bf45bce16f610c441679252d309189/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets#L348-L401) file and includes all
+other public feature-switches. You can add a new one by simply adding a new XML tag
+
+```xml
+
+```
+
+Please don't forget to update the table with available features-switches when you are done.
diff --git a/eng/Analyzers.props b/eng/Analyzers.props
index 8d2a67cde8e1..2c9b1c8bee44 100644
--- a/eng/Analyzers.props
+++ b/eng/Analyzers.props
@@ -6,7 +6,7 @@
-
+
diff --git a/eng/CodeAnalysis.ruleset b/eng/CodeAnalysis.ruleset
index e88f8fc3bd83..42ea385a079d 100644
--- a/eng/CodeAnalysis.ruleset
+++ b/eng/CodeAnalysis.ruleset
@@ -122,7 +122,7 @@
-
+
diff --git a/eng/Configurations.props b/eng/Configurations.props
index 1d6ad36e8150..aa8e9add17dd 100644
--- a/eng/Configurations.props
+++ b/eng/Configurations.props
@@ -31,6 +31,7 @@
.NET $(NetCoreAppCurrentVersion)
net472
+ WINDOWS7.0
diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index 46f4d5a99b09..098240ee26cb 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -4,63 +4,67 @@
https://github.com/dotnet/standard
cfe95a23647c7de1fe1a349343115bd7720d6949
+
+ https://github.com/dotnet/icu
+ 7247fa0d9e8faee2cceee6f04856b2c447f41bca
+
-
+
https://github.com/dotnet/arcade
- 243cc92161ad44c2a07464425892daee19121c99
+ ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915
-
+
https://github.com/dotnet/arcade
- 243cc92161ad44c2a07464425892daee19121c99
+ ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915
-
+
https://github.com/dotnet/arcade
- 243cc92161ad44c2a07464425892daee19121c99
+ ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915
-
+
https://github.com/dotnet/arcade
- 243cc92161ad44c2a07464425892daee19121c99
+ ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915
-
+
https://github.com/dotnet/arcade
- 243cc92161ad44c2a07464425892daee19121c99
+ ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915
-
+
https://github.com/dotnet/arcade
- 243cc92161ad44c2a07464425892daee19121c99
+ ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915
-
+
https://github.com/dotnet/arcade
- 243cc92161ad44c2a07464425892daee19121c99
+ ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915
-
+
https://github.com/dotnet/arcade
- 243cc92161ad44c2a07464425892daee19121c99
+ ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915
-
+
https://github.com/dotnet/arcade
- 243cc92161ad44c2a07464425892daee19121c99
+ ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915
-
+
https://github.com/dotnet/arcade
- 243cc92161ad44c2a07464425892daee19121c99
+ ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915
-
+
https://github.com/dotnet/arcade
- 243cc92161ad44c2a07464425892daee19121c99
+ ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915
-
+
https://github.com/dotnet/arcade
- 243cc92161ad44c2a07464425892daee19121c99
+ ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915
-
+
https://github.com/dotnet/arcade
- 243cc92161ad44c2a07464425892daee19121c99
+ ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915
-
+
https://github.com/dotnet/arcade
- 243cc92161ad44c2a07464425892daee19121c99
+ ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915
https://dev.azure.com/dnceng/internal/_git/dotnet-optimization
@@ -86,41 +90,37 @@
https://github.com/microsoft/vstest
b9296fc900e2f2d717d507b4ee2a4306521796d4
-
+
https://github.com/dotnet/runtime-assets
- 629993236116221fba87fe1de6d7893dd02c3722
+ b34a70799faa67f13c2e72852e4f3af463ff4d6c
-
+
https://github.com/dotnet/runtime-assets
- 629993236116221fba87fe1de6d7893dd02c3722
+ b34a70799faa67f13c2e72852e4f3af463ff4d6c
-
+
https://github.com/dotnet/runtime-assets
- 629993236116221fba87fe1de6d7893dd02c3722
+ b34a70799faa67f13c2e72852e4f3af463ff4d6c
-
+
https://github.com/dotnet/runtime-assets
- 629993236116221fba87fe1de6d7893dd02c3722
+ b34a70799faa67f13c2e72852e4f3af463ff4d6c
-
+
https://github.com/dotnet/runtime-assets
- 629993236116221fba87fe1de6d7893dd02c3722
+ b34a70799faa67f13c2e72852e4f3af463ff4d6c
-
+
https://github.com/dotnet/runtime-assets
- 629993236116221fba87fe1de6d7893dd02c3722
+ b34a70799faa67f13c2e72852e4f3af463ff4d6c
-
+
https://github.com/dotnet/runtime-assets
- 629993236116221fba87fe1de6d7893dd02c3722
+ b34a70799faa67f13c2e72852e4f3af463ff4d6c
-
+
https://github.com/dotnet/runtime-assets
- 629993236116221fba87fe1de6d7893dd02c3722
-
-
- https://github.com/dotnet/icu
-
+ b34a70799faa67f13c2e72852e4f3af463ff4d6c
https://github.com/dotnet/llvm-project
@@ -182,9 +182,9 @@
https://github.com/dotnet/runtime
0375524a91a47ca4db3ee1be548f74bab7e26e76
-
+
https://github.com/mono/linker
- 095f30a37d740e5166d71ab2d2157c5bb2041efa
+ e76321851c05c5016df3d1243885c02e875b9912
https://github.com/dotnet/xharness
diff --git a/eng/Versions.props b/eng/Versions.props
index 1cfce994d4eb..f8c1705f7064 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -51,16 +51,16 @@
- 5.0.0-beta.20330.3
- 5.0.0-beta.20330.3
- 5.0.0-beta.20330.3
- 5.0.0-beta.20330.3
- 5.0.0-beta.20330.3
- 5.0.0-beta.20353.2
- 2.5.1-beta.20330.3
- 5.0.0-beta.20358.2
- 5.0.0-beta.20330.3
- 5.0.0-beta.20330.3
+ 5.0.0-beta.20364.3
+ 5.0.0-beta.20364.3
+ 5.0.0-beta.20364.3
+ 5.0.0-beta.20364.3
+ 5.0.0-beta.20364.3
+ 5.0.0-beta.20364.3
+ 2.5.1-beta.20364.3
+ 5.0.0-beta.20364.3
+ 5.0.0-beta.20364.3
+ 5.0.0-beta.20364.3
5.0.0-preview.4.20202.18
5.0.0-preview.4.20202.18
@@ -72,14 +72,14 @@
5.0.0-preview.4.20202.18
5.0.0-alpha.1.19563.3
- 5.0.0-beta.20319.2
- 5.0.0-beta.20319.2
- 5.0.0-beta.20319.2
- 5.0.0-beta.20319.2
- 5.0.0-beta.20319.2
- 5.0.0-beta.20319.2
- 5.0.0-beta.20319.2
- 5.0.0-beta.20319.2
+ 5.0.0-beta.20360.1
+ 5.0.0-beta.20360.1
+ 5.0.0-beta.20360.1
+ 5.0.0-beta.20360.1
+ 5.0.0-beta.20360.1
+ 5.0.0-beta.20360.1
+ 5.0.0-beta.20360.1
+ 5.0.0-beta.20360.1
2.2.0-prerelease.19564.1
@@ -114,11 +114,11 @@
12.0.3
4.12.0
- 3.0.0-preview-20200602.3
+ 3.0.0-preview-20200715.1
- 5.0.0-preview.3.20360.3
+ 5.0.0-preview.3.20363.5
- 5.0.0-preview.8.20359.5
+ 5.0.0-preview.8.20365.1
9.0.1-alpha.1.20356.1
9.0.1-alpha.1.20356.1
@@ -144,7 +144,6 @@
Microsoft.NETCore.Targets
Microsoft.NETCore.Runtime.CoreCLR
Microsoft.NETCore.Runtime.ICU.Transport
-
true
@@ -51,9 +52,9 @@
-
+ -->
$(ArtifactsBinDir)ILLinkTrimAssembly/$(BuildSettings)/trimmed
@@ -70,7 +71,7 @@
+ DependsOnTargets="_CombineILLinkDescriptorsXmls;_CombineILLinkSubstitutionsXmls;_CombineILLinkLinkAttributesXmls">
@@ -84,6 +85,12 @@
+
+
+ ILLink.LinkAttributes.xml
+
+
+
@@ -111,11 +118,11 @@
-
+
-
@@ -152,7 +159,23 @@
-
+
+ $(ILLinkLinkAttributesXmlIntermediatePath)
+
+
+
+
+
+
+
+
+
+
@@ -178,14 +201,15 @@
$(ILLinkArgs) -t
$(ILLinkArgs) -b true
-
- $(ILLinkArgs) -v true
$(ILLinkArgs) --strip-descriptors false
$(ILLinkArgs) -x "$(ILLinkTrimXmlLibraryBuild)"
$(ILLinkArgs) --strip-substitutions false
+
+
+ $(ILLinkArgs) --strip-link-attributes false --ignore-link-attributes true
$(ILLinkArgs) --skip-unresolved true
@@ -235,7 +259,7 @@
<_DotNetHostFileName>dotnet
<_DotNetHostFileName Condition=" '$(OS)' == 'Windows_NT' ">dotnet.exe
-
+
-
-
-
diff --git a/eng/liveBuilds.targets b/eng/liveBuilds.targets
index 763b369167db..e7cd12b6a4ea 100644
--- a/eng/liveBuilds.targets
+++ b/eng/liveBuilds.targets
@@ -191,7 +191,8 @@
Include="
$(LibrariesNativeArtifactsPath)dotnet.js;
$(LibrariesNativeArtifactsPath)dotnet.wasm;
- $(LibrariesNativeArtifactsPath)dotnet.timezones.blat;"
+ $(LibrariesNativeArtifactsPath)dotnet.timezones.blat;
+ $(LibrariesNativeArtifactsPath)icudt.dat;"
IsNative="true" />
diff --git a/eng/pipelines/common/build-coreclr-and-libraries-job.yml b/eng/pipelines/common/build-coreclr-and-libraries-job.yml
index ddf5d8103cac..439d97038f84 100644
--- a/eng/pipelines/common/build-coreclr-and-libraries-job.yml
+++ b/eng/pipelines/common/build-coreclr-and-libraries-job.yml
@@ -11,6 +11,8 @@ parameters:
stagedBuild: false
variables: {}
pool: ''
+ platform: ''
+ testBuildPlatforms: []
jobs:
- template: /eng/pipelines/coreclr/templates/build-job.yml
@@ -41,8 +43,8 @@ jobs:
testGroup: ${{ parameters.testGroup }}
crossrootfsDir: ${{ parameters.crossrootfsDir }}
timeoutInminutes: ${{ parameters.timeoutInMinutes }}
- signBinaries: ${{ parameters.signBinaries }}
- stagedBuild: ${{ parameters.stagedBuild }}
variables: ${{ parameters.variables }}
pool: ${{ parameters.pool }}
liveRuntimeBuildConfig: ${{ parameters.buildConfig }}
+ platform: ${{ parameters.platform }}
+ testBuildPlatforms: ${{ parameters.testBuildPlatforms }}
diff --git a/eng/pipelines/common/global-build-job.yml b/eng/pipelines/common/global-build-job.yml
index 8f02954c8703..dcbba9fb3654 100644
--- a/eng/pipelines/common/global-build-job.yml
+++ b/eng/pipelines/common/global-build-job.yml
@@ -7,7 +7,7 @@ parameters:
osSubgroup: ''
container: ''
crossrootfsDir: ''
- variables: {}
+ variables: []
timeoutInMinutes: ''
pool: ''
condition: true
@@ -54,7 +54,8 @@ jobs:
${{ if ne(parameters.isOfficialBuild, true) }}:
value: ''
- - ${{ parameters.variables }}
+ - ${{ each variable in parameters.variables }}:
+ - ${{ variable }}
steps:
- template: /eng/pipelines/common/clone-checkout-bundle-step.yml
diff --git a/eng/pipelines/common/platform-matrix.yml b/eng/pipelines/common/platform-matrix.yml
index bf9c4a2fc976..b4f802024006 100644
--- a/eng/pipelines/common/platform-matrix.yml
+++ b/eng/pipelines/common/platform-matrix.yml
@@ -22,6 +22,7 @@ parameters:
# Handled as an opt-in parameter to avoid excessive yaml.
passPlatforms: false
jobParameters: {}
+ variables: []
jobs:
@@ -31,6 +32,7 @@ jobs:
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
+ variables: ${{ parameters.variables }}
osGroup: Linux
archType: arm
platform: Linux_arm
@@ -54,6 +56,7 @@ jobs:
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
+ variables: ${{ parameters.variables }}
osGroup: Linux
archType: arm64
platform: Linux_arm64
@@ -77,6 +80,7 @@ jobs:
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
+ variables: ${{ parameters.variables }}
osGroup: Linux
osSubgroup: _musl
archType: x64
@@ -104,6 +108,7 @@ jobs:
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
+ variables: ${{ parameters.variables }}
osGroup: Linux
osSubgroup: _musl
archType: arm64
@@ -128,6 +133,7 @@ jobs:
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
+ variables: ${{ parameters.variables }}
osGroup: Linux
archType: x64
platform: Linux_x64
@@ -150,6 +156,7 @@ jobs:
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
+ variables: ${{ parameters.variables }}
osGroup: Browser
archType: wasm
platform: Browser_wasm
@@ -170,6 +177,7 @@ jobs:
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
+ variables: ${{ parameters.variables }}
osGroup: FreeBSD
archType: x64
platform: FreeBSD_x64
@@ -192,6 +200,7 @@ jobs:
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
+ variables: ${{ parameters.variables }}
osGroup: Android
archType: x64
platform: Android_x64
@@ -214,6 +223,7 @@ jobs:
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
+ variables: ${{ parameters.variables }}
osGroup: Android
archType: x86
platform: Android_x86
@@ -236,6 +246,7 @@ jobs:
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
+ variables: ${{ parameters.variables }}
osGroup: Android
archType: arm
platform: Android_arm
@@ -258,6 +269,7 @@ jobs:
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
+ variables: ${{ parameters.variables }}
osGroup: Android
archType: arm64
platform: Android_arm64
@@ -280,6 +292,7 @@ jobs:
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
+ variables: ${{ parameters.variables }}
osGroup: tvOS
archType: x64
platform: tvOS_x64
@@ -299,6 +312,7 @@ jobs:
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
+ variables: ${{ parameters.variables }}
osGroup: tvOS
archType: arm64
platform: tvOS_arm64
@@ -318,6 +332,7 @@ jobs:
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
+ variables: ${{ parameters.variables }}
osGroup: iOS
archType: x64
platform: iOS_x64
@@ -337,6 +352,7 @@ jobs:
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
+ variables: ${{ parameters.variables }}
osGroup: iOS
archType: x86
platform: iOS_x86
@@ -357,6 +373,7 @@ jobs:
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
+ variables: ${{ parameters.variables }}
osGroup: iOS
archType: arm
platform: iOS_arm
@@ -376,6 +393,7 @@ jobs:
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
+ variables: ${{ parameters.variables }}
osGroup: iOS
archType: arm64
platform: iOS_arm64
@@ -395,6 +413,7 @@ jobs:
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
+ variables: ${{ parameters.variables }}
osGroup: OSX
archType: x64
platform: OSX_x64
@@ -414,6 +433,7 @@ jobs:
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
+ variables: ${{ parameters.variables }}
osGroup: Windows_NT
archType: x64
platform: Windows_NT_x64
@@ -433,6 +453,7 @@ jobs:
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
+ variables: ${{ parameters.variables }}
osGroup: Windows_NT
archType: x86
platform: Windows_NT_x86
@@ -451,6 +472,7 @@ jobs:
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
+ variables: ${{ parameters.variables }}
osGroup: Windows_NT
archType: arm
platform: Windows_NT_arm
@@ -470,6 +492,7 @@ jobs:
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
+ variables: ${{ parameters.variables }}
osGroup: Windows_NT
archType: arm64
platform: Windows_NT_arm64
diff --git a/eng/pipelines/common/templates/runtimes/run-test-job.yml b/eng/pipelines/common/templates/runtimes/run-test-job.yml
index 4a89ea975bdb..39616a833b0e 100644
--- a/eng/pipelines/common/templates/runtimes/run-test-job.yml
+++ b/eng/pipelines/common/templates/runtimes/run-test-job.yml
@@ -268,6 +268,10 @@ jobs:
/p:TargetArchitecture=$(archType)
displayName: "Patch dotnet with mono"
+ - ${{ if and(eq(parameters.runtimeFlavor, 'mono'), eq(parameters.runtimeVariant, 'llvmaot')) }}:
+ - script: $(coreClrRepoRootDir)build-test$(scriptExt) mono_aot $(buildConfig)
+ displayName: "LLVM AOT compile CoreCLR tests"
+
# Send tests to Helix
- template: /eng/pipelines/common/templates/runtimes/send-to-helix-step.yml
parameters:
diff --git a/eng/pipelines/common/xplat-setup.yml b/eng/pipelines/common/xplat-setup.yml
index f80c77a01eb7..f6a5ee11f4ec 100644
--- a/eng/pipelines/common/xplat-setup.yml
+++ b/eng/pipelines/common/xplat-setup.yml
@@ -7,6 +7,7 @@ parameters:
helixQueuesTemplate: ''
platform: ''
jobParameters: {}
+ variables: []
jobs:
- template: ${{ coalesce(parameters.helixQueuesTemplate, parameters.jobTemplate) }}
@@ -84,6 +85,9 @@ jobs:
value: Mono
${{ if eq(parameters.jobParameters.runtimeFlavor, 'coreclr') }}:
value: CoreCLR
+
+ - ${{ each variable in parameters.variables }}:
+ - ${{ variable }}
osGroup: ${{ parameters.osGroup }}
osSubgroup: ${{ parameters.osSubgroup }}
diff --git a/eng/pipelines/coreclr/libraries-gcstress-extra.yml b/eng/pipelines/coreclr/libraries-gcstress-extra.yml
index 58b4370724df..4063b0a8ffb9 100644
--- a/eng/pipelines/coreclr/libraries-gcstress-extra.yml
+++ b/eng/pipelines/coreclr/libraries-gcstress-extra.yml
@@ -25,20 +25,11 @@ jobs:
jobTemplate: /eng/pipelines/common/build-coreclr-and-libraries-job.yml
buildConfig: checked
platformGroup: gcstress
-
-#
-# Libraries Test Build - Release innerloop. All libraries are built on x64 and reused on all platforms.
-#
-- template: /eng/pipelines/common/platform-matrix.yml
- parameters:
- jobTemplate: /eng/pipelines/libraries/build-test-job.yml
- buildConfig: Release
- platforms:
- - Linux_x64
- - Windows_NT_x64
jobParameters:
- liveRuntimeBuildConfig: checked
- testScope: innerloop
+ # libraries test build platforms
+ testBuildPlatforms:
+ - Linux_x64
+ - Windows_NT_x64
#
# Libraries Test Run using Release libraries, Checked CoreCLR, and stress modes
diff --git a/eng/pipelines/coreclr/libraries-gcstress0x3-gcstress0xc.yml b/eng/pipelines/coreclr/libraries-gcstress0x3-gcstress0xc.yml
index b11e314a983e..d5df152153db 100644
--- a/eng/pipelines/coreclr/libraries-gcstress0x3-gcstress0xc.yml
+++ b/eng/pipelines/coreclr/libraries-gcstress0x3-gcstress0xc.yml
@@ -25,20 +25,11 @@ jobs:
jobTemplate: /eng/pipelines/common/build-coreclr-and-libraries-job.yml
buildConfig: checked
platformGroup: gcstress
-
-#
-# Libraries Test Build - Release innerloop. All libraries are built on x64 and reused on all platforms.
-#
-- template: /eng/pipelines/common/platform-matrix.yml
- parameters:
- jobTemplate: /eng/pipelines/libraries/build-test-job.yml
- buildConfig: Release
- platforms:
- - Linux_x64
- - Windows_NT_x64
jobParameters:
- liveRuntimeBuildConfig: checked
- testScope: innerloop
+ # libraries test build platforms
+ testBuildPlatforms:
+ - Linux_x64
+ - Windows_NT_x64
#
# Libraries Test Run using Release libraries, Checked CoreCLR, and stress modes
diff --git a/eng/pipelines/coreclr/libraries-jitstress.yml b/eng/pipelines/coreclr/libraries-jitstress.yml
index ff7f25b767d5..7128ab1414c0 100644
--- a/eng/pipelines/coreclr/libraries-jitstress.yml
+++ b/eng/pipelines/coreclr/libraries-jitstress.yml
@@ -30,20 +30,11 @@ jobs:
- Windows_NT_x86
- Windows_NT_x64
- Windows_NT_arm64
-
-#
-# Libraries Test Build - Release innerloop. All libraries are built on x64 and reused on all platforms.
-#
-- template: /eng/pipelines/common/platform-matrix.yml
- parameters:
- jobTemplate: /eng/pipelines/libraries/build-test-job.yml
- buildConfig: Release
- platforms:
- - Linux_x64
- - Windows_NT_x64
jobParameters:
- liveRuntimeBuildConfig: checked
- testScope: innerloop
+ # libraries test build platforms
+ testBuildPlatforms:
+ - Linux_x64
+ - Windows_NT_x64
#
# Libraries Test Run using Release libraries, Checked CoreCLR, and stress modes
diff --git a/eng/pipelines/coreclr/libraries-jitstress2-jitstressregs.yml b/eng/pipelines/coreclr/libraries-jitstress2-jitstressregs.yml
index 656d13926a3e..d1a2a0afd0e5 100644
--- a/eng/pipelines/coreclr/libraries-jitstress2-jitstressregs.yml
+++ b/eng/pipelines/coreclr/libraries-jitstress2-jitstressregs.yml
@@ -30,20 +30,11 @@ jobs:
- Windows_NT_x86
- Windows_NT_x64
- Windows_NT_arm64
-
-#
-# Libraries Test Build - Release innerloop. All libraries are built on x64 and reused on all platforms.
-#
-- template: /eng/pipelines/common/platform-matrix.yml
- parameters:
- jobTemplate: /eng/pipelines/libraries/build-test-job.yml
- buildConfig: Release
- platforms:
- - Linux_x64
- - Windows_NT_x64
jobParameters:
- liveRuntimeBuildConfig: checked
- testScope: innerloop
+ # libraries test build platforms
+ testBuildPlatforms:
+ - Linux_x64
+ - Windows_NT_x64
#
# Libraries Test Run using Release libraries, Checked CoreCLR, and stress modes
diff --git a/eng/pipelines/coreclr/libraries-jitstressregs.yml b/eng/pipelines/coreclr/libraries-jitstressregs.yml
index 2e62420aaf19..691cb29b0d9f 100644
--- a/eng/pipelines/coreclr/libraries-jitstressregs.yml
+++ b/eng/pipelines/coreclr/libraries-jitstressregs.yml
@@ -30,20 +30,11 @@ jobs:
- Windows_NT_x86
- Windows_NT_x64
- Windows_NT_arm64
-
-#
-# Libraries Test Build - Release innerloop. All libraries are built on x64 and reused on all platforms.
-#
-- template: /eng/pipelines/common/platform-matrix.yml
- parameters:
- jobTemplate: /eng/pipelines/libraries/build-test-job.yml
- buildConfig: Release
- platforms:
- - Linux_x64
- - Windows_NT_x64
jobParameters:
- liveRuntimeBuildConfig: checked
- testScope: innerloop
+ # libraries test build platforms
+ testBuildPlatforms:
+ - Linux_x64
+ - Windows_NT_x64
#
# Libraries Test Run using Release libraries, Checked CoreCLR, and stress modes
diff --git a/eng/pipelines/coreclr/templates/run-performance-job.yml b/eng/pipelines/coreclr/templates/run-performance-job.yml
index 249ff6bd1a2f..7dadb9bd5eee 100644
--- a/eng/pipelines/coreclr/templates/run-performance-job.yml
+++ b/eng/pipelines/coreclr/templates/run-performance-job.yml
@@ -64,10 +64,16 @@ jobs:
- ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
- HelixPreCommand: $(HelixPreCommandStemLinux);$(ExtraMSBuildLogsLinux)
- IsInternal: --internal
-
- group: DotNet-HelixApi-Access
- group: dotnet-benchview
+ - ${{ if not(and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'))) }}:
+ - ${{ if eq( parameters.osGroup, 'Windows_NT') }}:
+ - HelixPreCommand: $(ExtraMSBuildLogsWindows)
+ - ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
+ - HelixPreCommand: $(ExtraMSBuildLogsLinux)
+
+
- ${{ if and(eq(parameters.codeGenType, 'Interpreter'), eq(parameters.runtimeType, 'mono')) }}:
- ${{ if eq( parameters.osGroup, 'Windows_NT') }}:
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
diff --git a/eng/pipelines/global-build.yml b/eng/pipelines/global-build.yml
index deed32365862..9721eb4b9f47 100644
--- a/eng/pipelines/global-build.yml
+++ b/eng/pipelines/global-build.yml
@@ -104,4 +104,4 @@ jobs:
- Linux_x64
jobParameters:
nameSuffix: SourceBuild
- buildArgs: /p:DotNetBuildFromSource=true
\ No newline at end of file
+ buildArgs: /p:DotNetBuildFromSource=true
diff --git a/eng/pipelines/libraries/base-job.yml b/eng/pipelines/libraries/base-job.yml
index 2f58e43033e2..99e627141899 100644
--- a/eng/pipelines/libraries/base-job.yml
+++ b/eng/pipelines/libraries/base-job.yml
@@ -43,6 +43,7 @@ jobs:
# rename this variable, due to collision with build-native.proj
- _runtimeOSArg: ''
- _finalFrameworkArg: ''
+ - _testModeArg: ''
- _buildScript: $(_buildScriptFileName)$(scriptExt)
- _testScopeArg: ''
- _extraHelixArguments: ''
@@ -73,7 +74,8 @@ jobs:
- ${{ if eq(parameters.framework, 'allConfigurations') }}:
- _finalFrameworkArg: -allConfigurations
- - _extraHelixArguments: /p:BuildAllConfigurations=true
+ - _testModeArg: /p:TestAssemblies=false /p:TestPackages=true
+ - _extraHelixArguments: /p:TestPackages=true
- ${{ if eq(parameters.isOfficialAllConfigurations, true) }}:
- librariesBuildArtifactName: 'libraries_bin_official_allconfigurations'
@@ -89,10 +91,6 @@ jobs:
- ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}:
- _runtimeDownloadPath: '$(Build.SourcesDirectory)/artifacts/transport/${{ parameters.runtimeFlavor }}'
- _runtimeConfigurationArg: -rc ${{ parameters.liveRuntimeBuildConfig }}
- # Download full product dependencies for mono or test
- - ${{ if or(ne(parameters.runtimeFlavor, 'coreclr'), ne(parameters.testScope, '')) }}:
- - _runtimeArtifactName: '$(runtimeFlavorName)Product_${{ parameters.runtimeVariant}}_${{ parameters.osGroup }}${{ parameters.osSubgroup }}_${{ parameters.archType }}_${{ parameters.liveRuntimeBuildConfig }}'
- - _runtimeArtifactsPathArg: ' /p:RuntimeArtifactsPath=$(_runtimeDownloadPath)'
- ${{ if eq(parameters.testDisplayName, '') }}:
- _testRunNamePrefixSuffix: $(runtimeFlavorName)_${{ parameters.liveRuntimeBuildConfig }}
- ${{ if ne(parameters.testDisplayName, '') }}:
@@ -106,7 +104,7 @@ jobs:
- ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
- _buildScript: ./$(_buildScriptFileName)$(scriptExt)
- - _buildArguments: $(_runtimeConfigurationArg) -configuration ${{ parameters.buildConfig }} -ci -arch ${{ parameters.archType }} $(_finalFrameworkArg) $(_testScopeArg) $(_runtimeOSArg) $(_msbuildCommonParameters) $(_runtimeArtifactsPathArg) $(_crossBuildPropertyArg)
+ - _buildArguments: $(_runtimeConfigurationArg) -configuration ${{ parameters.buildConfig }} -ci -arch ${{ parameters.archType }} $(_finalFrameworkArg) $(_testModeArg) $(_testScopeArg) $(_runtimeOSArg) $(_msbuildCommonParameters) $(_runtimeArtifactsPathArg) $(_crossBuildPropertyArg)
- ${{ parameters.variables }}
# we need to override this value to support build-coreclr-and-libraries-job.yml
@@ -123,13 +121,4 @@ jobs:
steps:
- template: /eng/pipelines/common/clone-checkout-bundle-step.yml
-
- - ${{ if and(ne(parameters.liveRuntimeBuildConfig, ''), or(ne(parameters.runtimeFlavor, 'coreclr'), ne(parameters.testScope, ''))) }}:
- - template: /eng/pipelines/common/download-artifact-step.yml
- parameters:
- unpackFolder: $(_runtimeDownloadPath)
- artifactFileName: '$(_runtimeArtifactName)$(archiveExtension)'
- artifactName: '$(_runtimeArtifactName)'
- displayName: '$(runtimeFlavorName) build drop'
-
- ${{ parameters.steps }}
diff --git a/eng/pipelines/libraries/build-job.yml b/eng/pipelines/libraries/build-job.yml
index e3200bd3f2a0..f2e8ff21683c 100644
--- a/eng/pipelines/libraries/build-job.yml
+++ b/eng/pipelines/libraries/build-job.yml
@@ -8,6 +8,7 @@ parameters:
isOfficialBuild: false
isOfficialAllConfigurations: false
runtimeVariant: ''
+ platform: ''
# When set to a non-empty value (Debug / Release), it determines the runtime's
# build configuration to use for building libraries and tests. Setting this
@@ -25,6 +26,7 @@ parameters:
pool: ''
runTests: false
testScope: ''
+ testBuildPlatforms: []
jobs:
- template: /eng/pipelines/libraries/base-job.yml
@@ -49,24 +51,18 @@ jobs:
name: build
displayName: 'Build'
- ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}:
- dependsOn:
- # Use full product dependency for non-coreclr and test builds
- - ${{ if or(ne(parameters.runtimeFlavor, 'coreclr'), ne(parameters.testScope, '')) }}:
- - ${{ format('{0}_{1}_product_build_{2}{3}_{4}_{5}', parameters.runtimeFlavor, parameters.runtimeVariant, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveRuntimeBuildConfig) }}
-
variables:
+ - librariesTestsArtifactName: ${{ format('libraries_test_assets_{0}_{1}_{2}', parameters.osGroup, parameters.archType, parameters.buildConfig) }}
- _subset: libs
- _additionalBuildArguments: ''
- ${{ parameters.variables }}
- ${{ if eq(parameters.osGroup, 'Browser') }}:
- EMSDK_PATH: /usr/local/emscripten
- # for coreclr library builds (when not testing) build corelib as well.
- - ${{ if and(eq(parameters.runtimeFlavor, 'coreclr'), eq(parameters.testScope, '')) }}:
- - _subset: clr.corelib+libs
+
# Tests only run for 'allConfiguration' and 'net472' build-jobs
- - ${{ if eq(parameters.runTests, true) }}:
- - _subset: clr.corelib+libs+libs.tests
+ # If platform is in testBuildPlatforms we build tests as well.
+ - ${{ if or(eq(parameters.runTests, true), containsValue(parameters.testBuildPlatforms, parameters.platform)) }}:
+ - _subset: libs+libs.tests
- _additionalBuildArguments: /p:ArchiveTests=true
- ${{ parameters.variables }}
@@ -97,19 +93,13 @@ jobs:
displayName: Disk Usage after Build
- ${{ if eq(parameters.runTests, false) }}:
- - ${{ if ne(parameters.isOfficialBuild, true) }}:
+ - ${{ if ne(parameters.isOfficialBuild, true) }}:
- task: CopyFiles@2
displayName: Prepare testhost folder to publish
inputs:
sourceFolder: $(Build.SourcesDirectory)/artifacts/bin/testhost
targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/bin/testhost
- - task: CopyFiles@2
- displayName: Prepare artifacts toolset folder to publish
- inputs:
- sourceFolder: $(Build.SourcesDirectory)/artifacts/toolset
- targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/toolset
-
- task: CopyFiles@2
displayName: Prepare runtime folder to publish
inputs:
@@ -162,6 +152,17 @@ jobs:
tarCompression: $(tarCompression)
artifactName: $(librariesBuildArtifactName)
displayName: Build Assets
+
+ - ${{ if containsValue(parameters.testBuildPlatforms, parameters.platform) }}:
+ - template: /eng/pipelines/common/upload-artifact-step.yml
+ parameters:
+ rootFolder: $(Build.SourcesDirectory)/artifacts/helix
+ includeRootFolder: true
+ archiveType: $(archiveType)
+ archiveExtension: $(archiveExtension)
+ tarCompression: $(tarCompression)
+ artifactName: $(librariesTestsArtifactName)
+ displayName: Test Assets
# Save AllConfigurations artifacts using the prepare-signed-artifacts format. The
# platform-specific jobs' nupkgs automatically flow through the matching platform-specific
diff --git a/eng/pipelines/libraries/build-test-job.yml b/eng/pipelines/libraries/build-test-job.yml
deleted file mode 100644
index 0ce715add47c..000000000000
--- a/eng/pipelines/libraries/build-test-job.yml
+++ /dev/null
@@ -1,86 +0,0 @@
-parameters:
- buildConfig: ''
- osGroup: ''
- osSubgroup: ''
- archType: ''
- framework: ''
- isOfficialBuild: false
- liveRuntimeBuildConfig: ''
- runtimeFlavor: 'coreclr'
- runtimeVariant: ''
- timeoutInMinutes: 150
- container: ''
- publishTestArtifacs: true
- pool: ''
- testScope: ''
- variables: {}
- condition: true
- runTests: false
-
-jobs:
- - template: /eng/pipelines/libraries/base-job.yml
- parameters:
- buildConfig: ${{ parameters.buildConfig }}
- osGroup: ${{ parameters.osGroup }}
- osSubgroup: ${{ parameters.osSubgroup }}
- archType: ${{ parameters.archType }}
- framework: ${{ parameters.framework }}
- isOfficialBuild: ${{ parameters.isOfficialBuild }}
- condition: ${{ parameters.condition }}
- liveRuntimeBuildConfig: ${{ parameters.liveRuntimeBuildConfig }}
- timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
- container: ${{ parameters.container }}
- runtimeVariant: ${{ parameters.runtimeVariant }}
- pool: ${{ parameters.pool }}
- testScope: ${{ parameters.testScope }}
- name: test_build
- displayName: 'Test Build'
-
- dependsOn:
- - ${{ format('libraries_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
- # Libraries Test also depends on Product, now that the libraries build only depends on corelib
- - ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}:
- - ${{ format('{0}_{1}_product_build_{2}{3}_{4}_{5}', parameters.runtimeFlavor, parameters.runtimeVariant, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveRuntimeBuildConfig) }}
-
- variables:
- - librariesTestsArtifactName: ${{ format('libraries_test_assets_{0}_{1}_{2}', parameters.osGroup, parameters.archType, parameters.buildConfig) }}
- - _archiveTestsParameter: /p:ArchiveTests=true
-
- - ${{ parameters.variables }}
-
- steps:
- - template: /eng/pipelines/common/download-artifact-step.yml
- parameters:
- displayName: Build Assets
- artifactName: $(librariesBuildArtifactName)
- artifactFileName: $(librariesBuildArtifactName)$(archiveExtension)
- unpackFolder: $(Build.SourcesDirectory)/artifacts
- cleanUnpackFolder: false
-
- - ${{ if in(parameters.osGroup, 'OSX', 'iOS','tvOS') }}:
- - script: |
- du -sh $(Build.SourcesDirectory)/*
- df -h
- displayName: Disk Usage before Build
-
- - script: $(_buildScript)
- -subset libs.pretest+libs.tests
- $(_buildArguments)
- $(_archiveTestsParameter)
- displayName: Restore and Build
-
- - ${{ if in(parameters.osGroup, 'OSX', 'iOS','tvOS') }}:
- - script: |
- du -sh $(Build.SourcesDirectory)/*
- df -h
- displayName: Disk Usage after Build
-
- - template: /eng/pipelines/common/upload-artifact-step.yml
- parameters:
- rootFolder: $(Build.SourcesDirectory)/artifacts/helix
- includeRootFolder: true
- archiveType: $(archiveType)
- archiveExtension: $(archiveExtension)
- tarCompression: $(tarCompression)
- artifactName: $(librariesTestsArtifactName)
- displayName: Test Assets
diff --git a/eng/pipelines/libraries/helix-queues-setup.yml b/eng/pipelines/libraries/helix-queues-setup.yml
index 2bdfc5715886..58d1f89fe3c0 100644
--- a/eng/pipelines/libraries/helix-queues-setup.yml
+++ b/eng/pipelines/libraries/helix-queues-setup.yml
@@ -1,6 +1,6 @@
parameters:
jobTemplate: ''
- variables: {}
+ variables: []
osGroup: ''
osSubgroup: ''
archType: ''
@@ -138,6 +138,6 @@ jobs:
# WebAssembly
- ${{ if eq(parameters.platform, 'Browser_wasm') }}:
- - Ubuntu.2004.Amd64.Open
+ - Ubuntu.1804.Amd64.Open
${{ insert }}: ${{ parameters.jobParameters }}
diff --git a/eng/pipelines/libraries/run-test-job.yml b/eng/pipelines/libraries/run-test-job.yml
index 7f04f6e2ebb1..cf6324e79068 100644
--- a/eng/pipelines/libraries/run-test-job.yml
+++ b/eng/pipelines/libraries/run-test-job.yml
@@ -52,16 +52,20 @@ jobs:
dependsOn:
- ${{ if notIn(parameters.framework, 'allConfigurations', 'net472') }}:
- ${{ format('libraries_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
- - ${{ format('libraries_test_build_{0}_{1}_{2}', parameters.osGroup, parameters.dependsOnTestArchitecture, parameters.dependsOnTestBuildConfiguration) }}
- - ${{ if in(parameters.framework, 'allConfigurations', 'net472') }}:
- - ${{ format('libraries_build_{0}_{1}{2}_{3}_{4}', parameters.framework, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
- - ${{ format('libraries_test_build_{0}_{1}_{2}_{3}', parameters.framework, parameters.osGroup, parameters.dependsOnTestArchitecture, parameters.dependsOnTestBuildConfiguration) }}
+ # tests are built as part of product build
+ - ${{ if or(ne(parameters.archType, parameters.dependsOnTestArchitecture), ne(parameters.buildConfig, parameters.dependsOnTestBuildConfiguration)) }}:
+ - ${{ format('libraries_build_{0}_{1}_{2}', parameters.osGroup, parameters.dependsOnTestArchitecture, parameters.dependsOnTestBuildConfiguration) }}
- ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}:
- ${{ format('{0}_{1}_product_build_{2}{3}_{4}_{5}', parameters.runtimeFlavor, parameters.runtimeVariant, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.liveRuntimeBuildConfig) }}
variables:
- librariesTestsArtifactName: ${{ format('libraries_test_assets_{0}_{1}_{2}', parameters.osGroup, parameters.dependsOnTestArchitecture, parameters.dependsOnTestBuildConfiguration) }}
- _archiveTestsParameter: /p:ArchiveTests=true
+
+ - ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}:
+ - _runtimeArtifactName: '$(runtimeFlavorName)Product_${{ parameters.runtimeVariant}}_${{ parameters.osGroup }}${{ parameters.osSubgroup }}_${{ parameters.archType }}_${{ parameters.liveRuntimeBuildConfig }}'
+ - _runtimeArtifactsPathArg: ' /p:RuntimeArtifactsPath=$(_runtimeDownloadPath)'
+
- ${{ parameters.variables }}
steps:
@@ -80,6 +84,14 @@ jobs:
artifactName: $(librariesTestsArtifactName)
artifactFileName: $(librariesTestsArtifactName)$(archiveExtension)
unpackFolder: $(Build.SourcesDirectory)/artifacts
+
+ - ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}:
+ - template: /eng/pipelines/common/download-artifact-step.yml
+ parameters:
+ unpackFolder: $(_runtimeDownloadPath)
+ artifactFileName: '$(_runtimeArtifactName)$(archiveExtension)'
+ artifactName: '$(_runtimeArtifactName)'
+ displayName: '$(runtimeFlavorName) build drop'
- ${{ if in(parameters.coreclrTestGroup, 'gcstress0x3-gcstress0xc', 'gcstress-extra') }}:
# We need to find and download the GC stress dependencies (namely, coredistools). Put them
@@ -138,7 +150,10 @@ jobs:
- jitstress2
- jitstress2_tiered
- zapdisable
- - tailcallstress
+ # tailcallstress currently has hundreds of failures on Linux/arm32, so disable it.
+ # Tracked by https://github.com/dotnet/runtime/issues/38892.
+ - ${{ if or(eq(parameters.osGroup, 'Windows_NT'), ne(parameters.archType, 'arm')) }}:
+ - tailcallstress
${{ if in(parameters.coreclrTestGroup, 'jitstressregs' ) }}:
scenarios:
- jitstressregs1
diff --git a/eng/pipelines/mono/templates/xplat-pipeline-job.yml b/eng/pipelines/mono/templates/xplat-pipeline-job.yml
index 364616643e86..89917a58e0b8 100644
--- a/eng/pipelines/mono/templates/xplat-pipeline-job.yml
+++ b/eng/pipelines/mono/templates/xplat-pipeline-job.yml
@@ -48,7 +48,7 @@ jobs:
variables:
- name: coreClrProductArtifactName
- value: 'CoreCLRProduct_${{ parameters.runtimeVariant }}_$(osGroup)$(osSubgroup)_$(archType)_${{ parameters.liveRuntimeBuildConfig }}'
+ value: 'CoreCLRProduct__$(osGroup)$(osSubgroup)_$(archType)_${{ parameters.liveRuntimeBuildConfig }}'
- name: coreClrProductRootFolderPath
value: '$(Build.SourcesDirectory)/artifacts/bin/coreclr/$(osGroup).$(archType).$(liveRuntimeBuildConfigUpper)'
diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml
index 32d7dc0e686f..6d70e6cd190d 100644
--- a/eng/pipelines/runtime.yml
+++ b/eng/pipelines/runtime.yml
@@ -159,7 +159,7 @@ jobs:
#
# Build CoreCLR checked using GCC toolchain
# Only when CoreCLR is changed
-#
+#
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/coreclr/templates/build-job.yml
@@ -250,7 +250,7 @@ jobs:
or(
eq(dependencies.checkout.outputs['SetPathVars_coreclr.containsChange'], true),
eq(variables['isFullMatrix'], true))
-
+
# Build the whole product using Mono runtime
# Only when libraries, mono or installer are changed
#
@@ -311,21 +311,33 @@ jobs:
runtimeFlavor: mono
platforms:
- Browser_wasm
+ variables:
+ # map dependencies variables to local variables
+ - name: librariesContainsChange
+ value: $[ dependencies.checkout.outputs['SetPathVars_libraries.containsChange'] ]
+ - name: monoContainsChange
+ value: $[ dependencies.checkout.outputs['SetPathVars_mono.containsChange'] ]
jobParameters:
testGroup: innerloop
nameSuffix: AllSubsets_Mono
buildArgs: -s mono+libs+installer+libs.tests -c $(_BuildConfig) /p:ArchiveTests=true
timeoutInMinutes: 120
- extraStepsTemplate: /eng/pipelines/libraries/helix.yml
- extraStepsParameters:
- creator: dotnet-bot
- testRunNamePrefixSuffix: Mono_$(_BuildConfig)
condition: >-
or(
eq(dependencies.checkout.outputs['SetPathVars_libraries.containsChange'], true),
eq(dependencies.checkout.outputs['SetPathVars_mono.containsChange'], true),
eq(dependencies.checkout.outputs['SetPathVars_installer.containsChange'], true),
eq(variables['isFullMatrix'], true))
+ # extra steps, run tests
+ extraStepsTemplate: /eng/pipelines/libraries/helix.yml
+ extraStepsParameters:
+ creator: dotnet-bot
+ testRunNamePrefixSuffix: Mono_$(_BuildConfig)
+ condition: >-
+ or(
+ eq(variables['librariesContainsChange'], true),
+ eq(variables['monoContainsChange'], true),
+ eq(variables['isFullMatrix'], true))
#
# Build Mono and Installer on LLVMJIT mode
@@ -479,6 +491,25 @@ jobs:
eq(dependencies.checkout.outputs['SetPathVars_mono.containsChange'], true),
eq(variables['isFullMatrix'], true))
+#
+# Build Mono release with LLVM AOT
+# Only when mono, or the runtime tests changed
+#
+- template: /eng/pipelines/common/platform-matrix.yml
+ parameters:
+ jobTemplate: /eng/pipelines/mono/templates/build-job.yml
+ runtimeFlavor: mono
+ buildConfig: release
+ platforms:
+ - Linux_x64
+ jobParameters:
+ runtimeVariant: llvmaot
+ condition: >-
+ or(
+ eq(dependencies.checkout.outputs['SetPathVars_runtimetests.containsChange'], true),
+ eq(dependencies.checkout.outputs['SetPathVars_mono.containsChange'], true),
+ eq(variables['isFullMatrix'], true))
+
#
# Build libraries using live CoreLib
# These set of libraries are built always no matter what changed
@@ -510,6 +541,11 @@ jobs:
- Windows_NT_x64
- FreeBSD_x64
jobParameters:
+ testScope: innerloop
+ testBuildPlatforms:
+ - Linux_x64
+ - Windows_NT_x64
+ - OSX_x64
liveRuntimeBuildConfig: release
#
@@ -597,30 +633,6 @@ jobs:
liveRuntimeBuildConfig: release
liveLibrariesBuildConfig: ${{ variables.debugOnPrReleaseOnRolling }}
-#
-# Libraries Test Build
-# Only when CoreCLR, Mono or Libraries is changed
-#
-- template: /eng/pipelines/common/platform-matrix.yml
- parameters:
- jobTemplate: /eng/pipelines/libraries/build-test-job.yml
- buildConfig: ${{ variables.debugOnPrReleaseOnRolling }}
- platforms:
- - OSX_x64
- - Linux_x64
- - Windows_NT_x64
- jobParameters:
- isOfficialBuild: false
- liveRuntimeBuildConfig: release
- testScope: innerloop
- condition: >-
- or(
- eq(dependencies.checkout.outputs['SetPathVars_libraries.containsChange'], true),
- eq(dependencies.checkout.outputs['SetPathVars_coreclr.containsChange'], true),
- eq(dependencies.checkout.outputs['SetPathVars_mono.containsChange'], true),
- eq(dependencies.checkout.outputs['SetPathVars_runtimetests.containsChange'], true),
- eq(variables['isFullMatrix'], true))
-
#
# Crossgen-comparison jobs
# Only when CoreCLR is changed
@@ -745,6 +757,29 @@ jobs:
eq(dependencies.checkout.outputs['SetPathVars_mono.containsChange'], true),
eq(dependencies.checkout.outputs['SetPathVars_runtimetests.containsChange'], true),
eq(variables['isFullMatrix'], true))
+#
+# Mono CoreCLR runtime Test executions using live libraries and LLVM AOT
+# Only when Mono is changed
+#
+- template: /eng/pipelines/common/platform-matrix.yml
+ parameters:
+ jobTemplate: /eng/pipelines/common/templates/runtimes/run-test-job.yml
+ buildConfig: release
+ runtimeFlavor: mono
+ platforms:
+ - Linux_x64
+ helixQueueGroup: pr
+ helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
+ jobParameters:
+ testGroup: innerloop
+ liveLibrariesBuildConfig: ${{ variables.debugOnPrReleaseOnRolling }}
+ liveRuntimeBuildConfig: release
+ runtimeVariant: llvmaot
+ condition: >-
+ or(
+ eq(dependencies.checkout.outputs['SetPathVars_mono.containsChange'], true),
+ eq(dependencies.checkout.outputs['SetPathVars_runtimetests.containsChange'], true),
+ eq(variables['isFullMatrix'], true))
#
# Libraries Release Test Execution against a release mono runtime.
diff --git a/eng/testing/RunnerTemplate.sh b/eng/testing/RunnerTemplate.sh
old mode 100644
new mode 100755
index 80b496efe82d..dbd5f4741a5d
--- a/eng/testing/RunnerTemplate.sh
+++ b/eng/testing/RunnerTemplate.sh
@@ -170,7 +170,14 @@ fi
# ======================= BEGIN Core File Inspection =========================
pushd $EXECUTION_DIR >/dev/null
if [[ "$(uname -s)" == "Linux" && $test_exitcode -ne 0 ]]; then
- echo Looking around for any Linux dump...
+ if [ -n "$HELIX_WORKITEM_PAYLOAD" ]; then
+ have_sleep=$(which sleep)
+ if [ -x "$have_sleep" ]; then
+ echo Waiting a few seconds for any dump to be written..
+ sleep 10s
+ fi
+ fi
+ echo Looking around for any Linux dump..
# Depending on distro/configuration, the core files may either be named "core"
# or "core." by default. We read /proc/sys/kernel/core_uses_pid to
# determine which it is.
diff --git a/eng/testing/linker/SupportFiles/Directory.Build.props b/eng/testing/linker/SupportFiles/Directory.Build.props
index 3bec2264d6fd..4f2c8b61a1e1 100644
--- a/eng/testing/linker/SupportFiles/Directory.Build.props
+++ b/eng/testing/linker/SupportFiles/Directory.Build.props
@@ -1,11 +1,11 @@
true
- <_TrimmerDefaultAction>link
- <_TrimmerLinkSymbols>true
+ link
+ false
true
false
true
-
\ No newline at end of file
+
diff --git a/eng/testing/linker/SupportFiles/Directory.Build.targets b/eng/testing/linker/SupportFiles/Directory.Build.targets
index 90ce573551e9..49422a33b9be 100644
--- a/eng/testing/linker/SupportFiles/Directory.Build.targets
+++ b/eng/testing/linker/SupportFiles/Directory.Build.targets
@@ -19,6 +19,15 @@
+
+
+
+ link
+
+
+
+
-
\ No newline at end of file
+
diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets
index ebefed0e7e96..266a6d37be65 100644
--- a/eng/testing/tests.mobile.targets
+++ b/eng/testing/tests.mobile.targets
@@ -121,10 +121,17 @@
AssemblyFile="$(WasmAppBuilderTasksAssemblyPath)" />
+
+
+
+ $([System.IO.Directory]::GetParent('%(Identity)').Name)
+
+
-
+
+
@@ -140,7 +147,6 @@
-
+ AssemblySearchPaths="@(AssemblySearchPaths)"/>
+
+
+
+ <_Parameter1>$(MinimiumSupportedWindowsPlatform)
+
+
+
@@ -57,6 +64,10 @@
<_Parameter1>$(AssemblyName)
+
+ <_Parameter1>en-US
+
+
<_Parameter1>%(AssemblyMetadata.Identity)
diff --git a/global.json b/global.json
index 2cbc796534d7..64916dd7429c 100644
--- a/global.json
+++ b/global.json
@@ -1,24 +1,24 @@
{
"sdk": {
- "version": "5.0.100-preview.6.20310.4",
+ "version": "5.0.100-preview.8.20362.3",
"allowPrerelease": true,
"rollForward": "major"
},
"tools": {
- "dotnet": "5.0.100-preview.6.20310.4"
+ "dotnet": "5.0.100-preview.8.20362.3"
},
"native-tools": {
"cmake": "3.14.5",
"python3": "3.7.1"
},
"msbuild-sdks": {
- "Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk": "5.0.0-beta.20330.3",
- "Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20330.3",
- "Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk": "5.0.0-beta.20330.3",
- "Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.20330.3",
+ "Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk": "5.0.0-beta.20364.3",
+ "Microsoft.DotNet.Arcade.Sdk": "5.0.0-beta.20364.3",
+ "Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk": "5.0.0-beta.20364.3",
+ "Microsoft.DotNet.Helix.Sdk": "5.0.0-beta.20364.3",
"Microsoft.FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0",
"Microsoft.NET.Sdk.IL": "5.0.0-preview.8.20359.4",
"Microsoft.Build.NoTargets": "1.0.53",
- "Microsoft.Build.Traversal": "2.0.34"
+ "Microsoft.Build.Traversal": "2.0.52"
}
}
diff --git a/src/coreclr/build-test.sh b/src/coreclr/build-test.sh
index 2de59c68c06c..f1a26c565e3b 100755
--- a/src/coreclr/build-test.sh
+++ b/src/coreclr/build-test.sh
@@ -47,6 +47,18 @@ build_test_wrappers()
fi
}
+build_mono_aot()
+{
+ __RuntimeFlavor="mono"
+ __MonoBinDir="$__RootBinDir/bin/mono/$__TargetOS.$__BuildArch.$__BuildType"
+ __Exclude="${__ProjectDir}/tests/issues.targets"
+ __TestBinDir="$__TestWorkingDir"
+ CORE_ROOT="$__TestBinDir"/Tests/Core_Root
+ export __Exclude
+ export CORE_ROOT
+ build_MSBuild_projects "Tests_MonoAot" "$__ProjectDir/tests/src/runtest.proj" "Mono AOT compile tests" "/t:MonoAotCompileTests" "/p:RuntimeFlavor=$__RuntimeFlavor" "/p:MonoLlvmPath=$__MonoBinDir"
+}
+
generate_layout()
{
echo "${__MsgPrefix}Creating test overlay..."
@@ -608,6 +620,12 @@ handle_arguments_local() {
excludemonofailures|-excludemonofailures)
__Mono=1
;;
+
+ mono_aot|-mono_aot)
+ __Mono=1
+ __MonoAot=1
+ ;;
+
*)
__UnprocessedBuildArgs+=("$1")
;;
@@ -661,6 +679,8 @@ __UseNinja=0
__VerboseBuild=0
__CMakeArgs=""
__priority1=
+__Mono=0
+__MonoAot=0
CORE_ROOT=
source "$__ProjectRoot"/_build-commons.sh
@@ -703,10 +723,12 @@ if [[ -z "$HOME" ]]; then
echo "HOME not defined; setting it to $HOME"
fi
-if [[ (-z "$__GenerateLayoutOnly") && (-z "$__BuildTestWrappersOnly") ]]; then
+if [[ (-z "$__GenerateLayoutOnly") && (-z "$__BuildTestWrappersOnly") && ("$__MonoAot" -eq 0) ]]; then
build_Tests
elif [[ ! -z "$__BuildTestWrappersOnly" ]]; then
build_test_wrappers
+elif [[ "$__MonoAot" -eq 1 ]]; then
+ build_mono_aot
else
generate_layout
fi
diff --git a/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj
index 7d77fd31d77b..501487c6a111 100644
--- a/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj
+++ b/src/coreclr/src/System.Private.CoreLib/System.Private.CoreLib.csproj
@@ -147,7 +147,6 @@
-
diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Enum.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Enum.CoreCLR.cs
index 465884a11d6c..3dded2f8d367 100644
--- a/src/coreclr/src/System.Private.CoreLib/src/System/Enum.CoreCLR.cs
+++ b/src/coreclr/src/System.Private.CoreLib/src/System/Enum.CoreCLR.cs
@@ -27,21 +27,6 @@ public abstract partial class Enum
[MethodImpl(MethodImplOptions.InternalCall)]
private extern bool InternalHasFlag(Enum flags);
- private class EnumInfo
- {
- public readonly bool HasFlagsAttribute;
- public readonly ulong[] Values;
- public readonly string[] Names;
-
- // Each entry contains a list of sorted pair of enum field names and values, sorted by values
- public EnumInfo(bool hasFlagsAttribute, ulong[] values, string[] names)
- {
- HasFlagsAttribute = hasFlagsAttribute;
- Values = values;
- Names = names;
- }
- }
-
private static EnumInfo GetEnumInfo(RuntimeType enumType, bool getNames = true)
{
EnumInfo? entry = enumType.GenericCache as EnumInfo;
@@ -64,82 +49,5 @@ private static EnumInfo GetEnumInfo(RuntimeType enumType, bool getNames = true)
return entry;
}
-
- internal static ulong[] InternalGetValues(RuntimeType enumType)
- {
- // Get all of the values
- return GetEnumInfo(enumType, false).Values;
- }
-
- internal static string[] InternalGetNames(RuntimeType enumType)
- {
- // Get all of the names
- return GetEnumInfo(enumType, true).Names;
- }
-
- [Intrinsic]
- public bool HasFlag(Enum flag)
- {
- if (flag == null)
- throw new ArgumentNullException(nameof(flag));
-
- if (!this.GetType().IsEquivalentTo(flag.GetType()))
- {
- throw new ArgumentException(SR.Format(SR.Argument_EnumTypeDoesNotMatch, flag.GetType(), this.GetType()));
- }
-
- return InternalHasFlag(flag);
- }
-
- public static string? GetName(Type enumType, object value)
- {
- if (enumType == null)
- throw new ArgumentNullException(nameof(enumType));
-
- return enumType.GetEnumName(value);
- }
-
- public static string[] GetNames(Type enumType)
- {
- if (enumType == null)
- throw new ArgumentNullException(nameof(enumType));
-
- return enumType.GetEnumNames();
- }
-
- public static Type GetUnderlyingType(Type enumType)
- {
- if (enumType == null)
- throw new ArgumentNullException(nameof(enumType));
-
- return enumType.GetEnumUnderlyingType();
- }
-
- public static Array GetValues(Type enumType)
- {
- if (enumType == null)
- throw new ArgumentNullException(nameof(enumType));
-
- return enumType.GetEnumValues();
- }
-
- public static bool IsDefined(Type enumType, object value)
- {
- if (enumType == null)
- throw new ArgumentNullException(nameof(enumType));
-
- return enumType.IsEnumDefined(value);
- }
-
- private static RuntimeType ValidateRuntimeType(Type enumType)
- {
- if (enumType == null)
- throw new ArgumentNullException(nameof(enumType));
- if (!enumType.IsEnum)
- throw new ArgumentException(SR.Arg_MustBeEnum, nameof(enumType));
- if (!(enumType is RuntimeType rtType))
- throw new ArgumentException(SR.Arg_MustBeType, nameof(enumType));
- return rtType;
- }
}
}
diff --git a/src/coreclr/src/binder/assemblybinder.cpp b/src/coreclr/src/binder/assemblybinder.cpp
index 0b3c465fa5b7..5f13adc7b2c8 100644
--- a/src/coreclr/src/binder/assemblybinder.cpp
+++ b/src/coreclr/src/binder/assemblybinder.cpp
@@ -396,9 +396,9 @@ namespace BINDER_SPACE
BundleFileLocation bundleFileLocation = Bundle::ProbeAppBundle(sCoreLibName, /*pathIsBundleRelative */ true);
if (!bundleFileLocation.IsValid())
{
- sCoreLib.Set(systemDirectory);
pathSource = BinderTracing::PathSource::ApplicationAssemblies;
}
+ sCoreLib.Set(systemDirectory);
CombinePath(sCoreLib, sCoreLibName, sCoreLib);
IF_FAIL_GO(AssemblyBinder::GetAssembly(sCoreLib,
diff --git a/src/coreclr/src/debug/daccess/dacdbiimpl.cpp b/src/coreclr/src/debug/daccess/dacdbiimpl.cpp
index 2f34a59c5d70..4bcd6f2ff4cb 100644
--- a/src/coreclr/src/debug/daccess/dacdbiimpl.cpp
+++ b/src/coreclr/src/debug/daccess/dacdbiimpl.cpp
@@ -22,6 +22,7 @@
#include "switches.h"
#include "generics.h"
#include "stackwalk.h"
+#include "virtualcallstub.h"
#include "dacdbiimpl.h"
@@ -3570,6 +3571,139 @@ HRESULT DacDbiInterfaceImpl::GetDelegateTargetObject(
return hr;
}
+static bool TrackMemoryRangeHelper(PTR_VOID pvArgs, PTR_VOID pvAllocationBase, SIZE_T cbReserved)
+{
+ // The pvArgs is really pointing to a debugger-side container. Sadly the callback only takes a PTR_VOID.
+ CQuickArrayList *rangeCollection =
+ (CQuickArrayList*)(dac_cast(pvArgs));
+ TADDR rangeStart = dac_cast(pvAllocationBase);
+ TADDR rangeEnd = rangeStart + cbReserved;
+ rangeCollection->Push({rangeStart, rangeEnd});
+
+ // This is a tracking function, not a search callback. Pretend we never found what we were looking for
+ // to get all possible ranges.
+ return false;
+}
+
+void DacDbiInterfaceImpl::EnumerateMemRangesForLoaderAllocator(PTR_LoaderAllocator pLoaderAllocator, CQuickArrayList *rangeAcummulator)
+{
+ CQuickArrayList heapsToEnumerate;
+
+ // We always expect to see these three heaps
+ _ASSERTE(pLoaderAllocator->GetLowFrequencyHeap() != NULL);
+ heapsToEnumerate.Push(pLoaderAllocator->GetLowFrequencyHeap());
+
+ _ASSERTE(pLoaderAllocator->GetHighFrequencyHeap() != NULL);
+ heapsToEnumerate.Push(pLoaderAllocator->GetHighFrequencyHeap());
+
+ _ASSERTE(pLoaderAllocator->GetStubHeap() != NULL);
+ heapsToEnumerate.Push(pLoaderAllocator->GetStubHeap());
+
+ // GetVirtualCallStubManager returns VirtualCallStubManager*, but it's really an address to target as
+ // pLoaderAllocator is DACized. Cast it so we don't try to to a Host to Target translation.
+ VirtualCallStubManager *pVcsMgr = PTR_VirtualCallStubManager(TO_TADDR(pLoaderAllocator->GetVirtualCallStubManager()));
+ LOG((LF_CORDB, LL_INFO10000, "DDBII::EMRFLA: VirtualCallStubManager 0x%x\n", PTR_HOST_TO_TADDR(pVcsMgr)));
+ if (pVcsMgr)
+ {
+ if (pVcsMgr->indcell_heap != NULL) heapsToEnumerate.Push(pVcsMgr->indcell_heap);
+ if (pVcsMgr->lookup_heap != NULL) heapsToEnumerate.Push(pVcsMgr->lookup_heap);
+ if (pVcsMgr->resolve_heap != NULL) heapsToEnumerate.Push(pVcsMgr->resolve_heap);
+ if (pVcsMgr->dispatch_heap != NULL) heapsToEnumerate.Push(pVcsMgr->dispatch_heap);
+ if (pVcsMgr->cache_entry_heap != NULL) heapsToEnumerate.Push(pVcsMgr->cache_entry_heap);
+ }
+
+ TADDR rangeAccumAsTaddr = TO_TADDR(rangeAcummulator);
+ for (uint32_t i = 0; i < (uint32_t)heapsToEnumerate.Size(); i++)
+ {
+ LOG((LF_CORDB, LL_INFO10000, "DDBII::EMRFLA: LoaderHeap 0x%x\n", heapsToEnumerate[i].GetAddr()));
+ heapsToEnumerate[i]->EnumPageRegions(TrackMemoryRangeHelper, rangeAccumAsTaddr);
+ }
+}
+
+void DacDbiInterfaceImpl::EnumerateMemRangesForJitCodeHeaps(CQuickArrayList *rangeAcummulator)
+{
+ // We should always have a valid EEJitManager with at least one code heap.
+ EEJitManager *pEM = ExecutionManager::GetEEJitManager();
+ _ASSERTE(pEM != NULL && pEM->m_pCodeHeap.IsValid());
+
+ PTR_HeapList pHeapList = pEM->m_pCodeHeap;
+ while (pHeapList != NULL)
+ {
+ CodeHeap *pHeap = pHeapList->pHeap;
+ DacpJitCodeHeapInfo jitCodeHeapInfo = DACGetHeapInfoForCodeHeap(pHeap);
+
+ switch (jitCodeHeapInfo.codeHeapType)
+ {
+ case CODEHEAP_LOADER:
+ {
+ TADDR targetLoaderHeap = CLRDATA_ADDRESS_TO_TADDR(jitCodeHeapInfo.LoaderHeap);
+ LOG((LF_CORDB, LL_INFO10000,
+ "DDBII::EMRFJCH: LoaderCodeHeap 0x%x with LoaderHeap at 0x%x\n",
+ PTR_HOST_TO_TADDR(pHeap), targetLoaderHeap));
+ PTR_ExplicitControlLoaderHeap pLoaderHeap = PTR_ExplicitControlLoaderHeap(targetLoaderHeap);
+ pLoaderHeap->EnumPageRegions(TrackMemoryRangeHelper, TO_TADDR(rangeAcummulator));
+ break;
+ }
+
+ case CODEHEAP_HOST:
+ {
+ LOG((LF_CORDB, LL_INFO10000,
+ "DDBII::EMRFJCH: HostCodeHeap 0x%x\n",
+ PTR_HOST_TO_TADDR(pHeap)));
+ rangeAcummulator->Push({
+ CLRDATA_ADDRESS_TO_TADDR(jitCodeHeapInfo.HostData.baseAddr),
+ CLRDATA_ADDRESS_TO_TADDR(jitCodeHeapInfo.HostData.currentAddr)
+ });
+ break;
+ }
+
+ default:
+ {
+ LOG((LF_CORDB, LL_INFO10000, "DDBII::EMRFJCH: unknown heap type at 0x%x\n\n", pHeap));
+ _ASSERTE("Unknown heap type enumerating code ranges.");
+ break;
+ }
+ }
+
+ pHeapList = pHeapList->GetNext();
+ }
+}
+
+HRESULT DacDbiInterfaceImpl::GetLoaderHeapMemoryRanges(DacDbiArrayList *pRanges)
+{
+ LOG((LF_CORDB, LL_INFO10000, "DDBII::GLHMR\n"));
+ DD_ENTER_MAY_THROW;
+
+ HRESULT hr = S_OK;
+
+ EX_TRY
+ {
+ CQuickArrayList memoryRanges;
+
+ // Anything that's loaded in the SystemDomain or into the main AppDomain's default context in .NET Core
+ // and after uses only one global allocator. Enumerating that one is enough for most purposes.
+ // This doesn't consider any uses of AssemblyLoadingContexts (Unloadable or not). Each context has
+ // it's own LoaderAllocator, but there's no easy way of getting a hand at them other than going through
+ // the heap, getting a managed LoaderAllocators, from there getting a Scout, and from there getting a native
+ // pointer to the LoaderAllocator tos enumerate.
+ PTR_LoaderAllocator pGlobalAllocator = SystemDomain::System()->GetLoaderAllocator();
+ _ASSERTE(pGlobalAllocator);
+ EnumerateMemRangesForLoaderAllocator(pGlobalAllocator, &memoryRanges);
+
+ EnumerateMemRangesForJitCodeHeaps(&memoryRanges);
+
+ // This code doesn't enumerate module thunk heaps to support IJW.
+ // It's a fairly rare scenario and requires to enumerate all modules.
+ // The return for such added time is minimal.
+
+ _ASSERTE(memoryRanges.Size() < INT_MAX);
+ pRanges->Init(memoryRanges.Ptr(), (UINT) memoryRanges.Size());
+ }
+ EX_CATCH_HRESULT(hr);
+
+ return hr;
+}
+
void DacDbiInterfaceImpl::GetStackFramesFromException(VMPTR_Object vmObject, DacDbiArrayList& dacStackFrames)
{
DD_ENTER_MAY_THROW;
diff --git a/src/coreclr/src/debug/daccess/dacdbiimpl.h b/src/coreclr/src/debug/daccess/dacdbiimpl.h
index 1856e1949616..9178e7173626 100644
--- a/src/coreclr/src/debug/daccess/dacdbiimpl.h
+++ b/src/coreclr/src/debug/daccess/dacdbiimpl.h
@@ -361,6 +361,8 @@ class DacDbiInterfaceImpl :
OUT VMPTR_Object *ppTargetObj,
OUT VMPTR_AppDomain *ppTargetAppDomain);
+ HRESULT GetLoaderHeapMemoryRanges(OUT DacDbiArrayList * pRanges);
+
// retrieves the list of COM interfaces implemented by vmObject, as it is known at
// the time of the call (the list may change as new interface types become available
// in the runtime)
@@ -394,6 +396,14 @@ class DacDbiInterfaceImpl :
OUT DacDbiArrayList * pTypes);
private:
+ // Helper to enumerate all possible memory ranges help by a loader allocator.
+ void EnumerateMemRangesForLoaderAllocator(
+ PTR_LoaderAllocator pLoaderAllocator,
+ CQuickArrayList *rangeAcummulator);
+
+ void EnumerateMemRangesForJitCodeHeaps(
+ CQuickArrayList *rangeAcummulator);
+
// Given a pointer to a managed function, obtain the method desc for it.
// Equivalent to GetMethodDescPtrFromIp, except if the method isn't jitted
// it will look for it in code stubs.
diff --git a/src/coreclr/src/debug/daccess/dacfn.cpp b/src/coreclr/src/debug/daccess/dacfn.cpp
index 4e6989c118a2..2aad5dcdfdfc 100644
--- a/src/coreclr/src/debug/daccess/dacfn.cpp
+++ b/src/coreclr/src/debug/daccess/dacfn.cpp
@@ -268,7 +268,7 @@ DacVirtualUnwind(ULONG32 threadId, PT_CONTEXT context, PT_KNONVOLATILE_CONTEXT_P
memset(contextPointers, 0, sizeof(T_KNONVOLATILE_CONTEXT_POINTERS));
}
- HRESULT hr = S_OK;
+ HRESULT hr = E_NOINTERFACE;
#ifdef FEATURE_DATATARGET4
ReleaseHolder dt;
@@ -277,9 +277,12 @@ DacVirtualUnwind(ULONG32 threadId, PT_CONTEXT context, PT_KNONVOLATILE_CONTEXT_P
{
hr = dt->VirtualUnwind(threadId, sizeof(CONTEXT), (BYTE*)context);
}
- else
#endif
+
+ if (hr == E_NOINTERFACE || hr == E_NOTIMPL)
{
+ hr = S_OK;
+
SIZE_T baseAddress = DacGlobalBase();
if (baseAddress == 0 || !PAL_VirtualUnwindOutOfProc(context, contextPointers, baseAddress, DacReadAllAdapter))
{
diff --git a/src/coreclr/src/debug/daccess/dacimpl.h b/src/coreclr/src/debug/daccess/dacimpl.h
index 9e20184e0549..efbd19da6f1a 100644
--- a/src/coreclr/src/debug/daccess/dacimpl.h
+++ b/src/coreclr/src/debug/daccess/dacimpl.h
@@ -1455,8 +1455,12 @@ class ClrDataAccess
private:
#endif
-#ifdef FEATURE_COMINTEROP
protected:
+ // Populates a DacpJitCodeHeapInfo with proper information about the
+ // code heap type and the information needed to locate it.
+ DacpJitCodeHeapInfo DACGetHeapInfoForCodeHeap(CodeHeap *heapAddr);
+
+#ifdef FEATURE_COMINTEROP
// Returns CCW pointer based on a target address.
PTR_ComCallWrapper DACGetCCWFromAddress(CLRDATA_ADDRESS addr);
diff --git a/src/coreclr/src/debug/daccess/request.cpp b/src/coreclr/src/debug/daccess/request.cpp
index 072eba0e55ac..b9a589fd609f 100644
--- a/src/coreclr/src/debug/daccess/request.cpp
+++ b/src/coreclr/src/debug/daccess/request.cpp
@@ -499,27 +499,8 @@ ClrDataAccess::GetCodeHeapList(CLRDATA_ADDRESS jitManager, unsigned int count, s
unsigned int i = 0;
while ((heapList != NULL) && (i < count))
{
- // What type of CodeHeap pointer do we have?
CodeHeap *codeHeap = heapList->pHeap;
- TADDR ourVTablePtr = VPTR_HOST_VTABLE_TO_TADDR(*(LPVOID*)codeHeap);
- if (ourVTablePtr == LoaderCodeHeap::VPtrTargetVTable())
- {
- LoaderCodeHeap *loaderCodeHeap = PTR_LoaderCodeHeap(PTR_HOST_TO_TADDR(codeHeap));
- codeHeaps[i].codeHeapType = CODEHEAP_LOADER;
- codeHeaps[i].LoaderHeap =
- TO_CDADDR(PTR_HOST_MEMBER_TADDR(LoaderCodeHeap, loaderCodeHeap, m_LoaderHeap));
- }
- else if (ourVTablePtr == HostCodeHeap::VPtrTargetVTable())
- {
- HostCodeHeap *hostCodeHeap = PTR_HostCodeHeap(PTR_HOST_TO_TADDR(codeHeap));
- codeHeaps[i].codeHeapType = CODEHEAP_HOST;
- codeHeaps[i].HostData.baseAddr = PTR_CDADDR(hostCodeHeap->m_pBaseAddr);
- codeHeaps[i].HostData.currentAddr = PTR_CDADDR(hostCodeHeap->m_pLastAvailableCommittedAddr);
- }
- else
- {
- codeHeaps[i].codeHeapType = CODEHEAP_UNKNOWN;
- }
+ codeHeaps[i] = DACGetHeapInfoForCodeHeap(codeHeap);
heapList = heapList->hpNext;
i++;
}
@@ -547,6 +528,33 @@ ClrDataAccess::GetCodeHeapList(CLRDATA_ADDRESS jitManager, unsigned int count, s
return hr;
}
+DacpJitCodeHeapInfo ClrDataAccess::DACGetHeapInfoForCodeHeap(CodeHeap *heapAddr)
+{
+ DacpJitCodeHeapInfo jitCodeHeapInfo;
+
+ TADDR targetVtblPtrForHeapType = VPTR_HOST_VTABLE_TO_TADDR(*(LPVOID*)heapAddr);
+ if (targetVtblPtrForHeapType == LoaderCodeHeap::VPtrTargetVTable())
+ {
+ LoaderCodeHeap *loaderCodeHeap = PTR_LoaderCodeHeap(PTR_HOST_TO_TADDR(heapAddr));
+ jitCodeHeapInfo.codeHeapType = CODEHEAP_LOADER;
+ jitCodeHeapInfo.LoaderHeap =
+ TO_CDADDR(PTR_HOST_MEMBER_TADDR(LoaderCodeHeap, loaderCodeHeap, m_LoaderHeap));
+ }
+ else if (targetVtblPtrForHeapType == HostCodeHeap::VPtrTargetVTable())
+ {
+ HostCodeHeap *hostCodeHeap = PTR_HostCodeHeap(PTR_HOST_TO_TADDR(heapAddr));
+ jitCodeHeapInfo.codeHeapType = CODEHEAP_HOST;
+ jitCodeHeapInfo.HostData.baseAddr = PTR_CDADDR(hostCodeHeap->m_pBaseAddr);
+ jitCodeHeapInfo.HostData.currentAddr = PTR_CDADDR(hostCodeHeap->m_pLastAvailableCommittedAddr);
+ }
+ else
+ {
+ jitCodeHeapInfo.codeHeapType = CODEHEAP_UNKNOWN;
+ }
+
+ return jitCodeHeapInfo;
+}
+
HRESULT
ClrDataAccess::GetStackLimits(CLRDATA_ADDRESS threadPtr, CLRDATA_ADDRESS *lower,
CLRDATA_ADDRESS *upper, CLRDATA_ADDRESS *fp)
diff --git a/src/coreclr/src/debug/di/process.cpp b/src/coreclr/src/debug/di/process.cpp
index 1b76753efcbe..bb09213c5553 100644
--- a/src/coreclr/src/debug/di/process.cpp
+++ b/src/coreclr/src/debug/di/process.cpp
@@ -2173,6 +2173,10 @@ HRESULT CordbProcess::QueryInterface(REFIID id, void **pInterface)
{
*pInterface = static_cast(this);
}
+ else if (id == IID_ICorDebugProcess11)
+ {
+ *pInterface = static_cast(this);
+ }
else if (id == IID_IUnknown)
{
*pInterface = static_cast(static_cast(this));
@@ -2531,6 +2535,35 @@ COM_METHOD CordbProcess::EnableGCNotificationEvents(BOOL fEnable)
return hr;
}
+//-----------------------------------------------------------
+// ICorDebugProcess11
+//-----------------------------------------------------------
+COM_METHOD CordbProcess::EnumerateLoaderHeapMemoryRegions(ICorDebugMemoryRangeEnum **ppRanges)
+{
+ VALIDATE_POINTER_TO_OBJECT(ppRanges, ICorDebugMemoryRangeEnum **);
+ FAIL_IF_NEUTERED(this);
+
+ HRESULT hr = S_OK;
+
+ PUBLIC_API_BEGIN(this);
+ {
+ DacDbiArrayList heapRanges;
+
+ hr = GetDAC()->GetLoaderHeapMemoryRanges(&heapRanges);
+
+ if (SUCCEEDED(hr))
+ {
+ RSInitHolder heapSegmentEnumerator(
+ new CordbMemoryRangeEnumerator(this, &heapRanges[0], (DWORD)heapRanges.Count()));
+
+ GetContinueNeuterList()->Add(this, heapSegmentEnumerator);
+ heapSegmentEnumerator.TransferOwnershipExternal(ppRanges);
+ }
+ }
+ PUBLIC_API_END(hr);
+ return hr;
+}
+
HRESULT CordbProcess::GetTypeForObject(CORDB_ADDRESS addr, CordbAppDomain* pAppDomainOverride, CordbType **ppType, CordbAppDomain **pAppDomain)
{
VMPTR_AppDomain appDomain;
diff --git a/src/coreclr/src/debug/di/rspriv.h b/src/coreclr/src/debug/di/rspriv.h
index 2831db5b86fe..1bb48df2356c 100644
--- a/src/coreclr/src/debug/di/rspriv.h
+++ b/src/coreclr/src/debug/di/rspriv.h
@@ -1668,6 +1668,11 @@ typedef CordbEnumerator > CordbHeapSegmentEnumerator;
+typedef CordbEnumerator > CordbMemoryRangeEnumerator;
+
typedef CordbEnumerator *pRanges) = 0;
+
// The following tag tells the DD-marshalling tool to stop scanning.
// END_MARSHAL
diff --git a/src/coreclr/src/dlls/mscordac/CMakeLists.txt b/src/coreclr/src/dlls/mscordac/CMakeLists.txt
index 94b61b52692f..7a3e19525f2a 100644
--- a/src/coreclr/src/dlls/mscordac/CMakeLists.txt
+++ b/src/coreclr/src/dlls/mscordac/CMakeLists.txt
@@ -179,6 +179,12 @@ if(CLR_CMAKE_HOST_WIN32 AND CLR_CMAKE_TARGET_UNIX)
)
endif(CLR_CMAKE_HOST_WIN32 AND CLR_CMAKE_TARGET_UNIX)
+if(CLR_CMAKE_HOST_OSX)
+ list(APPEND COREDAC_LIBRARIES
+ coreclrpal_dac
+ )
+endif(CLR_CMAKE_HOST_OSX)
+
target_link_libraries(mscordaccore PRIVATE ${COREDAC_LIBRARIES})
# Create the DAC module index header file containing the DAC build id
diff --git a/src/coreclr/src/gc/CMakeLists.txt b/src/coreclr/src/gc/CMakeLists.txt
index f94140e2241c..c46f46fdfbae 100644
--- a/src/coreclr/src/gc/CMakeLists.txt
+++ b/src/coreclr/src/gc/CMakeLists.txt
@@ -39,6 +39,20 @@ else()
windows/gcenv.windows.cpp)
endif(CLR_CMAKE_HOST_UNIX)
+if (CLR_CMAKE_TARGET_ARCH_AMD64 AND CLR_CMAKE_TARGET_WIN32)
+ set ( GC_SOURCES
+ ${GC_SOURCES}
+ vxsort/isa_detection_dummy.cpp
+ vxsort/do_vxsort_avx2.cpp
+ vxsort/do_vxsort_avx512.cpp
+ vxsort/machine_traits.avx2.cpp
+ vxsort/smallsort/bitonic_sort.AVX2.int64_t.generated.cpp
+ vxsort/smallsort/bitonic_sort.AVX2.int32_t.generated.cpp
+ vxsort/smallsort/bitonic_sort.AVX512.int64_t.generated.cpp
+ vxsort/smallsort/bitonic_sort.AVX512.int32_t.generated.cpp
+)
+endif (CLR_CMAKE_TARGET_ARCH_AMD64 AND CLR_CMAKE_TARGET_WIN32)
+
if (CLR_CMAKE_TARGET_WIN32)
set(GC_HEADERS
env/common.h
@@ -74,7 +88,8 @@ if (CLR_CMAKE_TARGET_WIN32)
handletable.inl
handletablepriv.h
objecthandle.h
- softwarewritewatch.h)
+ softwarewritewatch.h
+ vxsort/do_vxsort.h)
endif(CLR_CMAKE_TARGET_WIN32)
if(CLR_CMAKE_HOST_WIN32)
diff --git a/src/coreclr/src/gc/gc.cpp b/src/coreclr/src/gc/gc.cpp
index 57e525843dfe..6bf8e51a6bce 100644
--- a/src/coreclr/src/gc/gc.cpp
+++ b/src/coreclr/src/gc/gc.cpp
@@ -18,7 +18,11 @@
#include "gcpriv.h"
+#if defined(TARGET_AMD64) && defined(TARGET_WINDOWS)
+#define USE_VXSORT
+#else
#define USE_INTROSORT
+#endif
// We just needed a simple random number generator for testing.
class gc_rand
@@ -2075,6 +2079,10 @@ uint8_t* tree_search (uint8_t* tree, uint8_t* old_address);
#ifdef USE_INTROSORT
#define _sort introsort::sort
+#elif defined(USE_VXSORT)
+// in this case we have do_vxsort which takes an additional range that
+// all items to be sorted are contained in
+// so do not #define _sort
#else //USE_INTROSORT
#define _sort qsort1
void qsort1(uint8_t** low, uint8_t** high, unsigned int depth);
@@ -2096,6 +2104,7 @@ uint8_t** gc_heap::g_mark_list_copy;
#endif //PARALLEL_MARK_LIST_SORT
size_t gc_heap::mark_list_size;
+bool gc_heap::mark_list_overflow;
#endif //MARK_LIST
seg_mapping* seg_mapping_table;
@@ -8130,7 +8139,8 @@ void rqsort1( uint8_t* *low, uint8_t* *high)
}
}
-#ifdef USE_INTROSORT
+// vxsort uses introsort as a fallback if the AVX2 instruction set is not supported
+#if defined(USE_INTROSORT) || defined(USE_VXSORT)
class introsort
{
@@ -8254,18 +8264,109 @@ inline static void swap_elements(uint8_t** i,uint8_t** j)
};
-#endif //USE_INTROSORT
+#endif //defined(USE_INTROSORT) || defined(USE_VXSORT)
+
+#ifdef USE_VXSORT
+static void do_vxsort (uint8_t** item_array, ptrdiff_t item_count, uint8_t* range_low, uint8_t* range_high)
+{
+ // above this threshold, using AVX2 for sorting will likely pay off
+ // despite possible downclocking on some devices
+ const size_t AVX2_THRESHOLD_SIZE = 8 * 1024;
+
+ // above this threshold, using AVX51F for sorting will likely pay off
+ // despite possible downclocking on current devices
+ const size_t AVX512F_THRESHOLD_SIZE = 128 * 1024;
+
+ if (item_count <= 1)
+ return;
+
+ if (IsSupportedInstructionSet (InstructionSet::AVX2) && (item_count > AVX2_THRESHOLD_SIZE))
+ {
+ // is the range small enough for a 32-bit sort?
+ // the 32-bit sort is almost twice as fast
+ ptrdiff_t range = range_high - range_low;
+ assert(sizeof(uint8_t*) == (1 << 3));
+ ptrdiff_t scaled_range = range >> 3;
+ if ((uint32_t)scaled_range == scaled_range)
+ {
+ dprintf (3, ("Sorting mark lists as 32-bit offsets"));
+
+ do_pack_avx2 (item_array, item_count, range_low);
+
+ int32_t* item_array_32 = (int32_t*)item_array;
+
+ // use AVX512F only if the list is large enough to pay for downclocking impact
+ if (IsSupportedInstructionSet (InstructionSet::AVX512F) && (item_count > AVX512F_THRESHOLD_SIZE))
+ {
+ do_vxsort_avx512 (item_array_32, &item_array_32[item_count - 1]);
+ }
+ else
+ {
+ do_vxsort_avx2 (item_array_32, &item_array_32[item_count - 1]);
+ }
+
+ do_unpack_avx2 (item_array_32, item_count, range_low);
+ }
+ else
+ {
+ dprintf(3, ("Sorting mark lists"));
+
+ // use AVX512F only if the list is large enough to pay for downclocking impact
+ if (IsSupportedInstructionSet (InstructionSet::AVX512F) && (item_count > AVX512F_THRESHOLD_SIZE))
+ {
+ do_vxsort_avx512 (item_array, &item_array[item_count - 1]);
+ }
+ else
+ {
+ do_vxsort_avx2 (item_array, &item_array[item_count - 1]);
+ }
+ }
+ }
+ else
+ {
+ dprintf (3, ("Sorting mark lists"));
+ introsort::sort (item_array, &item_array[item_count - 1], 0);
+ }
+#ifdef _DEBUG
+ // check the array is sorted
+ for (ptrdiff_t i = 0; i < item_count - 1; i++)
+ {
+ assert (item_array[i] <= item_array[i + 1]);
+ }
+ // check that the ends of the array are indeed in range
+ // together with the above this implies all elements are in range
+ assert ((range_low <= item_array[0]) && (item_array[item_count - 1] <= range_high));
+#endif
+}
+#endif //USE_VXSORT
#ifdef MULTIPLE_HEAPS
#ifdef PARALLEL_MARK_LIST_SORT
+NOINLINE
void gc_heap::sort_mark_list()
{
+ if (settings.condemned_generation >= max_generation)
+ {
+ return;
+ }
+
// if this heap had a mark list overflow, we don't do anything
if (mark_list_index > mark_list_end)
{
// printf("sort_mark_list: overflow on heap %d\n", heap_number);
+ mark_list_overflow = true;
+ return;
+ }
+
+#ifdef BACKGROUND_GC
+ // we are not going to use the mark list if background GC is running
+ // so let's not waste time sorting it
+ if (gc_heap::background_running_p())
+ {
+ mark_list_index = mark_list_end + 1;
return;
}
+#endif //BACKGROUND_GC
// if any other heap had a mark list overflow, we fake one too,
// so we don't use an incomplete mark list by mistake
@@ -8281,9 +8382,98 @@ void gc_heap::sort_mark_list()
// unsigned long start = GetCycleCount32();
+ // compute total mark list size and total ephemeral size
+ size_t total_mark_list_size = 0;
+ size_t total_ephemeral_size = 0;
+ uint8_t* low = (uint8_t*)~0;
+ uint8_t* high = 0;
+ for (int i = 0; i < n_heaps; i++)
+ {
+ gc_heap* hp = g_heaps[i];
+ size_t ephemeral_size = heap_segment_allocated (hp->ephemeral_heap_segment) - hp->gc_low;
+ total_ephemeral_size += ephemeral_size;
+ total_mark_list_size += (hp->mark_list_index - hp->mark_list);
+ low = min (low, hp->gc_low);
+ high = max (high, heap_segment_allocated (hp->ephemeral_heap_segment));
+ }
+
+ // give up if this is not an ephemeral GC or the mark list size is unreasonably large
+ if (total_mark_list_size > (total_ephemeral_size / 256))
+ {
+ mark_list_index = mark_list_end + 1;
+ // let's not count this as a mark list overflow
+ mark_list_overflow = false;
+ return;
+ }
+
+#ifdef USE_VXSORT
+ ptrdiff_t item_count = mark_list_index - mark_list;
+//#define WRITE_SORT_DATA
+#if defined(_DEBUG) || defined(WRITE_SORT_DATA)
+ // in debug, make a copy of the mark list
+ // for checking and debugging purposes
+ uint8_t** mark_list_copy = &g_mark_list_copy[heap_number * mark_list_size];
+ uint8_t** mark_list_copy_index = &mark_list_copy[item_count];
+ for (ptrdiff_t i = 0; i < item_count; i++)
+ {
+ uint8_t* item = mark_list[i];
+ mark_list_copy[i] = item;
+ }
+#endif // defined(_DEBUG) || defined(WRITE_SORT_DATA)
+
+ ptrdiff_t start = get_cycle_count();
+
+ do_vxsort (mark_list, item_count, low, high);
+
+ ptrdiff_t elapsed_cycles = get_cycle_count() - start;
+
+#ifdef WRITE_SORT_DATA
+ char file_name[256];
+ sprintf_s (file_name, _countof(file_name), "sort_data_gc%d_heap%d", settings.gc_index, heap_number);
+
+ FILE* f;
+ errno_t err = fopen_s (&f, file_name, "wb");
+
+ if (err == 0)
+ {
+ size_t magic = 'SDAT';
+ if (fwrite (&magic, sizeof(magic), 1, f) != 1)
+ dprintf (3, ("fwrite failed\n"));
+ if (fwrite (&elapsed_cycles, sizeof(elapsed_cycles), 1, f) != 1)
+ dprintf (3, ("fwrite failed\n"));
+ if (fwrite (&low, sizeof(low), 1, f) != 1)
+ dprintf (3, ("fwrite failed\n"));
+ if (fwrite (&item_count, sizeof(item_count), 1, f) != 1)
+ dprintf (3, ("fwrite failed\n"));
+ if (fwrite (mark_list_copy, sizeof(mark_list_copy[0]), item_count, f) != item_count)
+ dprintf (3, ("fwrite failed\n"));
+ if (fwrite (&magic, sizeof(magic), 1, f) != 1)
+ dprintf (3, ("fwrite failed\n"));
+ if (fclose (f) != 0)
+ dprintf (3, ("fclose failed\n"));
+ }
+#endif
+
+#ifdef _DEBUG
+ // in debug, sort the copy as well using the proven sort, so we can check we got the right result
+ if (mark_list_copy_index > mark_list_copy)
+ {
+ introsort::sort (mark_list_copy, mark_list_copy_index - 1, 0);
+ }
+ for (ptrdiff_t i = 0; i < item_count; i++)
+ {
+ uint8_t* item = mark_list[i];
+ assert (mark_list_copy[i] == item);
+ }
+#endif //_DEBUG
+
+#else //USE_VXSORT
dprintf (3, ("Sorting mark lists"));
if (mark_list_index > mark_list)
- _sort (mark_list, mark_list_index - 1, 0);
+ {
+ introsort::sort (mark_list, mark_list_index - 1, 0);
+ }
+#endif
// printf("first phase of sort_mark_list for heap %d took %u cycles to sort %u entries\n", this->heap_number, GetCycleCount32() - start, mark_list_index - mark_list);
// start = GetCycleCount32();
@@ -8614,6 +8804,67 @@ void gc_heap::combine_mark_lists()
}
#endif // PARALLEL_MARK_LIST_SORT
#endif //MULTIPLE_HEAPS
+
+void gc_heap::grow_mark_list ()
+{
+ // with vectorized sorting, we can use bigger mark lists
+#ifdef USE_VXSORT
+#ifdef MULTIPLE_HEAPS
+ const size_t MAX_MARK_LIST_SIZE = IsSupportedInstructionSet (InstructionSet::AVX2) ? 1000 * 1024 : 200 * 1024;
+#else //MULTIPLE_HEAPS
+ const size_t MAX_MARK_LIST_SIZE = IsSupportedInstructionSet (InstructionSet::AVX2) ? 32 * 1024 : 16 * 1024;
+#endif //MULTIPLE_HEAPS
+#else
+#ifdef MULTIPLE_HEAPS
+ const size_t MAX_MARK_LIST_SIZE = 200 * 1024;
+#else //MULTIPLE_HEAPS
+ const size_t MAX_MARK_LIST_SIZE = 16 * 1024;
+#endif //MULTIPLE_HEAPS
+#endif
+
+ size_t new_mark_list_size = min (mark_list_size * 2, MAX_MARK_LIST_SIZE);
+ if (new_mark_list_size == mark_list_size)
+ return;
+
+#ifdef MULTIPLE_HEAPS
+ uint8_t** new_mark_list = make_mark_list (new_mark_list_size * n_heaps);
+
+#ifdef PARALLEL_MARK_LIST_SORT
+ uint8_t** new_mark_list_copy = make_mark_list (new_mark_list_size * n_heaps);
+#endif //PARALLEL_MARK_LIST_SORT
+
+ if (new_mark_list != nullptr
+#ifdef PARALLEL_MARK_LIST_SORT
+ && new_mark_list_copy != nullptr
+#endif //PARALLEL_MARK_LIST_SORT
+ )
+ {
+ delete[] g_mark_list;
+ g_mark_list = new_mark_list;
+#ifdef PARALLEL_MARK_LIST_SORT
+ delete[] g_mark_list_copy;
+ g_mark_list_copy = new_mark_list_copy;
+#endif //PARALLEL_MARK_LIST_SORT
+ mark_list_size = new_mark_list_size;
+ }
+ else
+ {
+ delete[] new_mark_list;
+#ifdef PARALLEL_MARK_LIST_SORT
+ delete[] new_mark_list_copy;
+#endif //PARALLEL_MARK_LIST_SORT
+ }
+
+#else //MULTIPLE_HEAPS
+ uint8_t** new_mark_list = make_mark_list (new_mark_list_size);
+ if (new_mark_list != nullptr)
+ {
+ delete[] mark_list;
+ g_mark_list = new_mark_list;
+ mark_list_size = new_mark_list_size;
+ }
+#endif //MULTIPLE_HEAPS
+}
#endif //MARK_LIST
class seg_free_spaces
@@ -10098,6 +10349,10 @@ HRESULT gc_heap::initialize_gc (size_t soh_segment_size,
static_cast(GCEventStatus::GetEnabledKeywords(GCEventProvider_Private)));
#endif // __linux__
+#ifdef USE_VXSORT
+ InitSupportedInstructionSet ((int32_t)GCConfig::GetGCEnabledInstructionSets());
+#endif
+
if (!init_semi_shared())
{
hres = E_FAIL;
@@ -10125,7 +10380,7 @@ gc_heap::init_semi_shared()
#ifdef MARK_LIST
#ifdef MULTIPLE_HEAPS
- mark_list_size = min (150*1024, max (8192, soh_segment_size/(2*10*32)));
+ mark_list_size = min (100*1024, max (8192, soh_segment_size/(2*10*32)));
g_mark_list = make_mark_list (mark_list_size*n_heaps);
min_balance_threshold = alloc_quantum_balance_units * CLR_SIZE * 2;
@@ -22032,7 +22287,12 @@ void gc_heap::plan_phase (int condemned_gen_number)
(mark_list_index - &mark_list[0]), ((mark_list_end - &mark_list[0]))));
if (mark_list_index >= (mark_list_end + 1))
+ {
mark_list_index = mark_list_end + 1;
+#ifndef MULTIPLE_HEAPS // in Server GC, we check for mark list overflow in sort_mark_list
+ mark_list_overflow = true;
+#endif
+ }
#else
dprintf (3, ("mark_list length: %Id",
(mark_list_index - &mark_list[0])));
@@ -22046,7 +22306,12 @@ void gc_heap::plan_phase (int condemned_gen_number)
)
{
#ifndef MULTIPLE_HEAPS
- _sort (&mark_list[0], mark_list_index-1, 0);
+#ifdef USE_VXSORT
+ do_vxsort (mark_list, mark_list_index - mark_list, slow, shigh);
+#else //USE_VXSORT
+ _sort (&mark_list[0], mark_list_index - 1, 0);
+#endif //USE_VXSORT
+
//printf ("using mark list at GC #%d", dd_collection_count (dynamic_data_of (0)));
//verify_qsort_array (&mark_list[0], mark_list_index-1);
#endif //!MULTIPLE_HEAPS
@@ -37045,6 +37310,12 @@ void gc_heap::do_post_gc()
#else
record_interesting_info_per_heap();
#endif //MULTIPLE_HEAPS
+ if (mark_list_overflow)
+ {
+ grow_mark_list();
+ mark_list_overflow = false;
+ }
+
record_global_mechanisms();
#endif //GC_CONFIG_DRIVEN
}
diff --git a/src/coreclr/src/gc/gcconfig.h b/src/coreclr/src/gc/gcconfig.h
index 3ff7a1dc2926..085562f56dd4 100644
--- a/src/coreclr/src/gc/gcconfig.h
+++ b/src/coreclr/src/gc/gcconfig.h
@@ -128,6 +128,7 @@ class GCConfigStringHolder
INT_CONFIG (GCHeapHardLimitSOHPercent, "GCHeapHardLimitSOHPercent", NULL, 0, "Specifies the GC heap SOH usage as a percentage of the total memory") \
INT_CONFIG (GCHeapHardLimitLOHPercent, "GCHeapHardLimitLOHPercent", NULL, 0, "Specifies the GC heap LOH usage as a percentage of the total memory") \
INT_CONFIG (GCHeapHardLimitPOHPercent, "GCHeapHardLimitPOHPercent", NULL, 0, "Specifies the GC heap POH usage as a percentage of the total memory") \
+ INT_CONFIG (GCEnabledInstructionSets, "GCEnabledInstructionSets", NULL, -1, "Specifies whether GC can use AVX2 or AVX512F - 0 for neither, 1 for AVX2, 3 for AVX512F")\
// This class is responsible for retreiving configuration information
// for how the GC should operate.
diff --git a/src/coreclr/src/gc/gcpriv.h b/src/coreclr/src/gc/gcpriv.h
index 62844b74eb50..0606b57d7279 100644
--- a/src/coreclr/src/gc/gcpriv.h
+++ b/src/coreclr/src/gc/gcpriv.h
@@ -1,15 +1,9 @@
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-//
-// Copyright (c) Microsoft. All rights reserved.
-// Licensed under the MIT license. See LICENSE file in the project root for full license information.
-//
-// optimize for speed
-
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
#ifndef _DEBUG
#ifdef _MSC_VER
+// optimize for speed
#pragma optimize( "t", on )
#endif
#endif
@@ -2936,6 +2930,11 @@ class gc_heap
#endif
#endif //MULTIPLE_HEAPS
+#ifdef MARK_LIST
+ PER_HEAP_ISOLATED
+ void grow_mark_list();
+#endif //MARK_LIST
+
#ifdef BACKGROUND_GC
PER_HEAP
@@ -3843,6 +3842,9 @@ class gc_heap
PER_HEAP_ISOLATED
size_t mark_list_size;
+ PER_HEAP_ISOLATED
+ bool mark_list_overflow;
+
PER_HEAP
uint8_t** mark_list_end;
diff --git a/src/coreclr/src/gc/gcsvr.cpp b/src/coreclr/src/gc/gcsvr.cpp
index 15ec076c6c5d..9e4a78473530 100644
--- a/src/coreclr/src/gc/gcsvr.cpp
+++ b/src/coreclr/src/gc/gcsvr.cpp
@@ -20,6 +20,10 @@
#define SERVER_GC 1
+#if defined(TARGET_AMD64) && defined(TARGET_WINDOWS)
+#include "vxsort/do_vxsort.h"
+#endif
+
namespace SVR {
#include "gcimpl.h"
#include "gc.cpp"
diff --git a/src/coreclr/src/gc/gcwks.cpp b/src/coreclr/src/gc/gcwks.cpp
index 3977c5141b1b..7d599e8d8e51 100644
--- a/src/coreclr/src/gc/gcwks.cpp
+++ b/src/coreclr/src/gc/gcwks.cpp
@@ -20,6 +20,10 @@
#undef SERVER_GC
#endif
+#if defined(TARGET_AMD64) && defined(TARGET_WINDOWS)
+#include "vxsort/do_vxsort.h"
+#endif
+
namespace WKS {
#include "gcimpl.h"
#include "gc.cpp"
diff --git a/src/coreclr/src/gc/sample/CMakeLists.txt b/src/coreclr/src/gc/sample/CMakeLists.txt
index 059c5e768b2b..40bb0b5dcd54 100644
--- a/src/coreclr/src/gc/sample/CMakeLists.txt
+++ b/src/coreclr/src/gc/sample/CMakeLists.txt
@@ -24,6 +24,20 @@ set(SOURCES
../softwarewritewatch.cpp
)
+if (CLR_CMAKE_TARGET_ARCH_AMD64 AND CLR_CMAKE_TARGET_WIN32)
+ set ( SOURCES
+ ${SOURCES}
+ ../vxsort/isa_detection_dummy.cpp
+ ../vxsort/do_vxsort_avx2.cpp
+ ../vxsort/do_vxsort_avx512.cpp
+ ../vxsort/machine_traits.avx2.cpp
+ ../vxsort/smallsort/bitonic_sort.AVX2.int64_t.generated.cpp
+ ../vxsort/smallsort/bitonic_sort.AVX2.int32_t.generated.cpp
+ ../vxsort/smallsort/bitonic_sort.AVX512.int64_t.generated.cpp
+ ../vxsort/smallsort/bitonic_sort.AVX512.int32_t.generated.cpp
+)
+endif (CLR_CMAKE_TARGET_ARCH_AMD64 AND CLR_CMAKE_TARGET_WIN32)
+
if(CLR_CMAKE_TARGET_WIN32)
set (GC_LINK_LIBRARIES
${STATIC_MT_CRT_LIB}
diff --git a/src/coreclr/src/gc/vxsort/alignment.h b/src/coreclr/src/gc/vxsort/alignment.h
new file mode 100644
index 000000000000..df61c3a30f41
--- /dev/null
+++ b/src/coreclr/src/gc/vxsort/alignment.h
@@ -0,0 +1,39 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+#ifndef VXSORT_ALIGNNMENT_H
+#define VXSORT_ALIGNNMENT_H
+
+//#include
+
+namespace vxsort {
+
+using namespace std;
+
+template
+struct alignment_hint {
+ public:
+ static const size_t ALIGN = N;
+ static const int8_t REALIGN = 0x66;
+
+ alignment_hint() : left_align(REALIGN), right_align(REALIGN) {}
+ alignment_hint realign_left() {
+ alignment_hint copy = *this;
+ copy.left_align = REALIGN;
+ return copy;
+ }
+
+ alignment_hint realign_right() {
+ alignment_hint copy = *this;
+ copy.right_align = REALIGN;
+ return copy;
+ }
+
+ static bool is_aligned(void* p) { return (size_t)p % ALIGN == 0; }
+
+ int left_align : 8;
+ int right_align : 8;
+};
+
+}
+#endif // VXSORT_ALIGNNMENT_H
diff --git a/src/coreclr/src/gc/vxsort/defs.h b/src/coreclr/src/gc/vxsort/defs.h
new file mode 100644
index 000000000000..628315e5110a
--- /dev/null
+++ b/src/coreclr/src/gc/vxsort/defs.h
@@ -0,0 +1,48 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+#ifndef VXSORT_DEFS_H
+#define VXSORT_DEFS_H
+
+#if _MSC_VER
+#ifdef _M_X86
+#define ARCH_X86
+#endif
+#ifdef _M_X64
+#define ARCH_X64
+#endif
+#ifdef _M_ARM64
+#define ARCH_ARM
+#endif
+#else
+#ifdef __i386__
+#define ARCH_X86
+#endif
+#ifdef __amd64__
+#define ARCH_X64
+#endif
+#ifdef __arm__
+#define ARCH_ARM
+#endif
+#endif
+
+#ifdef _MSC_VER
+#ifdef __clang__
+#define mess_up_cmov()
+#define INLINE __attribute__((always_inline))
+#define NOINLINE __attribute__((noinline))
+#else
+// MSVC
+#include
+#define mess_up_cmov() _ReadBarrier();
+#define INLINE __forceinline
+#define NOINLINE __declspec(noinline)
+#endif
+#else
+// GCC + Clang
+#define mess_up_cmov()
+#define INLINE __attribute__((always_inline))
+#define NOINLINE __attribute__((noinline))
+#endif
+
+#endif // VXSORT_DEFS_H
diff --git a/src/coreclr/src/gc/vxsort/do_vxsort.h b/src/coreclr/src/gc/vxsort/do_vxsort.h
new file mode 100644
index 000000000000..50a5e1ef77a7
--- /dev/null
+++ b/src/coreclr/src/gc/vxsort/do_vxsort.h
@@ -0,0 +1,24 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+// Enum for the IsSupportedInstructionSet method
+enum class InstructionSet
+{
+ AVX2 = 0,
+ AVX512F = 1,
+};
+
+void InitSupportedInstructionSet (int32_t configSetting);
+bool IsSupportedInstructionSet (InstructionSet instructionSet);
+
+void do_vxsort_avx2 (uint8_t** low, uint8_t** high);
+void do_vxsort_avx2 (int32_t* low, int32_t* high);
+
+void do_pack_avx2 (uint8_t** mem, size_t len, uint8_t* base);
+void do_unpack_avx2 (int32_t* mem, size_t len, uint8_t* base);
+
+void do_vxsort_avx512 (uint8_t** low, uint8_t** high);
+void do_vxsort_avx512 (int32_t* low, int32_t* high);
+
+void do_pack_avx512 (uint8_t** mem, size_t len, uint8_t* base);
+void do_unpack_avx512 (int32_t* mem, size_t len, uint8_t* base);
diff --git a/src/coreclr/src/gc/vxsort/do_vxsort_avx2.cpp b/src/coreclr/src/gc/vxsort/do_vxsort_avx2.cpp
new file mode 100644
index 000000000000..3e4fd10d15f4
--- /dev/null
+++ b/src/coreclr/src/gc/vxsort/do_vxsort_avx2.cpp
@@ -0,0 +1,86 @@
+// 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"
+
+#include "vxsort_targets_enable_avx2.h"
+
+namespace std
+{
+ template
+ class numeric_limits
+ {
+ public:
+ static _Ty Max()
+ {
+ return _Ty();
+ }
+ static _Ty Min()
+ {
+ return _Ty();
+ }
+ };
+ template <>
+ class numeric_limits
+ {
+ public:
+ static int32_t Max()
+ {
+ return 0x7fffffff;
+ }
+ static int32_t Min()
+ {
+ return -0x7fffffff-1;
+ }
+ };
+ template <>
+ class numeric_limits
+ {
+ public:
+ static int64_t Max()
+ {
+ return 0x7fffffffffffffffi64;
+ }
+
+ static int64_t Min()
+ {
+ return -0x7fffffffffffffffi64-1;
+ }
+ };
+}
+
+#ifndef max
+template
+T max (T a, T b)
+{
+ if (a > b) return a; else return b;
+}
+#endif
+#include "vxsort.h"
+#include "machine_traits.avx2.h"
+#include "packer.h"
+
+void do_vxsort_avx2 (uint8_t** low, uint8_t** high)
+{
+ auto sorter = vxsort::vxsort();
+ sorter.sort ((int64_t*)low, (int64_t*)high);
+}
+
+void do_vxsort_avx2 (int32_t* low, int32_t* high)
+{
+ auto sorter = vxsort::vxsort();
+ sorter.sort (low, high);
+}
+
+void do_pack_avx2 (uint8_t** mem, size_t len, uint8_t* base)
+{
+ auto packer = vxsort::packer();
+ packer.pack ((int64_t*)mem, len, (int64_t)base);
+}
+
+void do_unpack_avx2 (int32_t* mem, size_t len, uint8_t* base)
+{
+ auto packer = vxsort::packer();
+ packer.unpack (mem, len, (int64_t)base);
+}
+#include "vxsort_targets_disable.h"
diff --git a/src/coreclr/src/gc/vxsort/do_vxsort_avx512.cpp b/src/coreclr/src/gc/vxsort/do_vxsort_avx512.cpp
new file mode 100644
index 000000000000..aa0a8f99442e
--- /dev/null
+++ b/src/coreclr/src/gc/vxsort/do_vxsort_avx512.cpp
@@ -0,0 +1,75 @@
+// 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"
+
+#include "vxsort_targets_enable_avx512.h"
+
+namespace std
+{
+ template
+ class numeric_limits
+ {
+ public:
+ static _Ty Max()
+ {
+ return _Ty();
+ }
+ static _Ty Min()
+ {
+ return _Ty();
+ }
+ };
+ template <>
+ class numeric_limits
+ {
+ public:
+ static int32_t Max()
+ {
+ return 0x7fffffff;
+ }
+ static int32_t Min()
+ {
+ return -0x7fffffff - 1;
+ }
+ };
+ template <>
+ class numeric_limits
+ {
+ public:
+ static int64_t Max()
+ {
+ return 0x7fffffffffffffffi64;
+ }
+
+ static int64_t Min()
+ {
+ return -0x7fffffffffffffffi64 - 1;
+ }
+ };
+}
+
+#ifndef max
+template
+T max (T a, T b)
+{
+ if (a > b) return a; else return b;
+}
+#endif
+
+#include "vxsort.h"
+#include "machine_traits.avx512.h"
+
+void do_vxsort_avx512 (uint8_t** low, uint8_t** high)
+{
+ auto sorter = vxsort::vxsort();
+ sorter.sort ((int64_t*)low, (int64_t*)high);
+}
+
+void do_vxsort_avx512 (int32_t* low, int32_t* high)
+{
+ auto sorter = vxsort::vxsort();
+ sorter.sort (low, high);
+}
+
+#include "vxsort_targets_disable.h"
diff --git a/src/coreclr/src/gc/vxsort/isa_detection.cpp b/src/coreclr/src/gc/vxsort/isa_detection.cpp
new file mode 100644
index 000000000000..ac469a615dde
--- /dev/null
+++ b/src/coreclr/src/gc/vxsort/isa_detection.cpp
@@ -0,0 +1,140 @@
+// 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"
+#include
+
+#include "do_vxsort.h"
+
+enum class SupportedISA
+{
+ None = 0,
+ AVX2 = 1 << (int)InstructionSet::AVX2,
+ AVX512F = 1 << (int)InstructionSet::AVX512F
+};
+
+#if defined(TARGET_AMD64) && defined(TARGET_WINDOWS)
+
+static DWORD64 GetEnabledXStateFeaturesHelper()
+{
+ LIMITED_METHOD_CONTRACT;
+
+ // On Windows we have an api(GetEnabledXStateFeatures) to check if AVX is supported
+ typedef DWORD64(WINAPI* PGETENABLEDXSTATEFEATURES)();
+ PGETENABLEDXSTATEFEATURES pfnGetEnabledXStateFeatures = NULL;
+
+ HMODULE hMod = WszLoadLibraryEx(WINDOWS_KERNEL32_DLLNAME_W, NULL, LOAD_LIBRARY_SEARCH_SYSTEM32);
+ if (hMod == NULL)
+ return 0;
+
+ pfnGetEnabledXStateFeatures = (PGETENABLEDXSTATEFEATURES)GetProcAddress(hMod, "GetEnabledXStateFeatures");
+
+ if (pfnGetEnabledXStateFeatures == NULL)
+ {
+ return 0;
+ }
+
+ DWORD64 FeatureMask = pfnGetEnabledXStateFeatures();
+
+ return FeatureMask;
+}
+
+SupportedISA DetermineSupportedISA()
+{
+ // register definitions to make the following code more readable
+ enum reg
+ {
+ EAX = 0,
+ EBX = 1,
+ ECX = 2,
+ EDX = 3,
+ COUNT = 4
+ };
+
+ // bit definitions to make code more readable
+ enum bits
+ {
+ OCXSAVE = 1<<27,
+ AVX = 1<<28,
+ AVX2 = 1<<5,
+ AVX512F=1<<16,
+ };
+ int reg[COUNT];
+
+ __cpuid(reg, 0);
+ if (reg[EAX] < 7)
+ return SupportedISA::None;
+
+ __cpuid(reg, 1);
+
+ // both AVX and OCXSAVE feature flags must be enabled
+ if ((reg[ECX] & (OCXSAVE|AVX)) != (OCXSAVE | AVX))
+ return SupportedISA::None;
+
+ // get xcr0 register
+ DWORD64 xcr0 = _xgetbv(0);
+
+ // get OS XState info
+ DWORD64 FeatureMask = GetEnabledXStateFeaturesHelper();
+
+ // get processor extended feature flag info
+ __cpuid(reg, 7);
+
+ // check if both AVX2 and AVX512F are supported by both processor and OS
+ if ((reg[EBX] & (AVX2 | AVX512F)) == (AVX2 | AVX512F) &&
+ (xcr0 & 0xe6) == 0xe6 &&
+ (FeatureMask & (XSTATE_MASK_AVX | XSTATE_MASK_AVX512)) == (XSTATE_MASK_AVX | XSTATE_MASK_AVX512))
+ {
+ return (SupportedISA)((int)SupportedISA::AVX2 | (int)SupportedISA::AVX512F);
+ }
+
+ // check if AVX2 is supported by both processor and OS
+ if ((reg[EBX] & AVX2) &&
+ (xcr0 & 0x06) == 0x06 &&
+ (FeatureMask & XSTATE_MASK_AVX) == XSTATE_MASK_AVX)
+ {
+ return SupportedISA::AVX2;
+ }
+
+ return SupportedISA::None;
+}
+
+#elif defined(TARGET_UNIX)
+
+SupportedISA DetermineSupportedISA()
+{
+ __builtin_cpu_init();
+ if (__builtin_cpu_supports("avx2"))
+ {
+ if (__builtin_cpu_supports("avx512f"))
+ return (SupportedISA)((int)SupportedISA::AVX2 | (int)SupportedISA::AVX512F);
+ else
+ return SupportedISA::AVX2;
+ }
+ else
+ {
+ return SupportedISA::None;
+ }
+}
+
+#endif // defined(TARGET_UNIX)
+
+static bool s_initialized;
+static SupportedISA s_supportedISA;
+
+bool IsSupportedInstructionSet (InstructionSet instructionSet)
+{
+ assert(s_initialized);
+ assert(instructionSet == InstructionSet::AVX2 || instructionSet == InstructionSet::AVX512F);
+ return ((int)s_supportedISA & (1 << (int)instructionSet)) != 0;
+}
+
+void InitSupportedInstructionSet (int32_t configSetting)
+{
+ s_supportedISA = (SupportedISA)((int)DetermineSupportedISA() & configSetting);
+ // we are assuming that AVX2 can be used if AVX512F can,
+ // so if AVX2 is disabled, we need to disable AVX512F as well
+ if (!((int)s_supportedISA & (int)SupportedISA::AVX2))
+ s_supportedISA = SupportedISA::None;
+ s_initialized = true;
+}
diff --git a/src/coreclr/src/gc/vxsort/isa_detection_dummy.cpp b/src/coreclr/src/gc/vxsort/isa_detection_dummy.cpp
new file mode 100644
index 000000000000..e277a7675a9a
--- /dev/null
+++ b/src/coreclr/src/gc/vxsort/isa_detection_dummy.cpp
@@ -0,0 +1,19 @@
+// 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"
+
+#include "do_vxsort.h"
+
+#if defined(TARGET_AMD64) && defined(TARGET_WINDOWS)
+
+void InitSupportedInstructionSet (int32_t)
+{
+}
+
+bool IsSupportedInstructionSet (InstructionSet)
+{
+ return false;
+}
+#endif // defined(TARGET_AMD64) && defined(TARGET_WINDOWS)
+
diff --git a/src/coreclr/src/gc/vxsort/machine_traits.avx2.cpp b/src/coreclr/src/gc/vxsort/machine_traits.avx2.cpp
new file mode 100644
index 000000000000..d693d08ea414
--- /dev/null
+++ b/src/coreclr/src/gc/vxsort/machine_traits.avx2.cpp
@@ -0,0 +1,290 @@
+// 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"
+//#include
+
+#include "machine_traits.avx2.h"
+
+namespace vxsort {
+
+alignas(128) const int8_t perm_table_64[128] = {
+ 0, 1, 2, 3, 4, 5, 6, 7, // 0b0000 (0)
+ 2, 3, 4, 5, 6, 7, 0, 1, // 0b0001 (1)
+ 0, 1, 4, 5, 6, 7, 2, 3, // 0b0010 (2)
+ 4, 5, 6, 7, 0, 1, 2, 3, // 0b0011 (3)
+ 0, 1, 2, 3, 6, 7, 4, 5, // 0b0100 (4)
+ 2, 3, 6, 7, 0, 1, 4, 5, // 0b0101 (5)
+ 0, 1, 6, 7, 2, 3, 4, 5, // 0b0110 (6)
+ 6, 7, 0, 1, 2, 3, 4, 5, // 0b0111 (7)
+ 0, 1, 2, 3, 4, 5, 6, 7, // 0b1000 (8)
+ 2, 3, 4, 5, 0, 1, 6, 7, // 0b1001 (9)
+ 0, 1, 4, 5, 2, 3, 6, 7, // 0b1010 (10)
+ 4, 5, 0, 1, 2, 3, 6, 7, // 0b1011 (11)
+ 0, 1, 2, 3, 4, 5, 6, 7, // 0b1100 (12)
+ 2, 3, 0, 1, 4, 5, 6, 7, // 0b1101 (13)
+ 0, 1, 2, 3, 4, 5, 6, 7, // 0b1110 (14)
+ 0, 1, 2, 3, 4, 5, 6, 7, // 0b1111 (15)
+};
+
+alignas(2048) const int8_t perm_table_32[2048] = {
+ 0, 1, 2, 3, 4, 5, 6, 7, // 0b00000000 (0)
+ 1, 2, 3, 4, 5, 6, 7, 0, // 0b00000001 (1)
+ 0, 2, 3, 4, 5, 6, 7, 1, // 0b00000010 (2)
+ 2, 3, 4, 5, 6, 7, 0, 1, // 0b00000011 (3)
+ 0, 1, 3, 4, 5, 6, 7, 2, // 0b00000100 (4)
+ 1, 3, 4, 5, 6, 7, 0, 2, // 0b00000101 (5)
+ 0, 3, 4, 5, 6, 7, 1, 2, // 0b00000110 (6)
+ 3, 4, 5, 6, 7, 0, 1, 2, // 0b00000111 (7)
+ 0, 1, 2, 4, 5, 6, 7, 3, // 0b00001000 (8)
+ 1, 2, 4, 5, 6, 7, 0, 3, // 0b00001001 (9)
+ 0, 2, 4, 5, 6, 7, 1, 3, // 0b00001010 (10)
+ 2, 4, 5, 6, 7, 0, 1, 3, // 0b00001011 (11)
+ 0, 1, 4, 5, 6, 7, 2, 3, // 0b00001100 (12)
+ 1, 4, 5, 6, 7, 0, 2, 3, // 0b00001101 (13)
+ 0, 4, 5, 6, 7, 1, 2, 3, // 0b00001110 (14)
+ 4, 5, 6, 7, 0, 1, 2, 3, // 0b00001111 (15)
+ 0, 1, 2, 3, 5, 6, 7, 4, // 0b00010000 (16)
+ 1, 2, 3, 5, 6, 7, 0, 4, // 0b00010001 (17)
+ 0, 2, 3, 5, 6, 7, 1, 4, // 0b00010010 (18)
+ 2, 3, 5, 6, 7, 0, 1, 4, // 0b00010011 (19)
+ 0, 1, 3, 5, 6, 7, 2, 4, // 0b00010100 (20)
+ 1, 3, 5, 6, 7, 0, 2, 4, // 0b00010101 (21)
+ 0, 3, 5, 6, 7, 1, 2, 4, // 0b00010110 (22)
+ 3, 5, 6, 7, 0, 1, 2, 4, // 0b00010111 (23)
+ 0, 1, 2, 5, 6, 7, 3, 4, // 0b00011000 (24)
+ 1, 2, 5, 6, 7, 0, 3, 4, // 0b00011001 (25)
+ 0, 2, 5, 6, 7, 1, 3, 4, // 0b00011010 (26)
+ 2, 5, 6, 7, 0, 1, 3, 4, // 0b00011011 (27)
+ 0, 1, 5, 6, 7, 2, 3, 4, // 0b00011100 (28)
+ 1, 5, 6, 7, 0, 2, 3, 4, // 0b00011101 (29)
+ 0, 5, 6, 7, 1, 2, 3, 4, // 0b00011110 (30)
+ 5, 6, 7, 0, 1, 2, 3, 4, // 0b00011111 (31)
+ 0, 1, 2, 3, 4, 6, 7, 5, // 0b00100000 (32)
+ 1, 2, 3, 4, 6, 7, 0, 5, // 0b00100001 (33)
+ 0, 2, 3, 4, 6, 7, 1, 5, // 0b00100010 (34)
+ 2, 3, 4, 6, 7, 0, 1, 5, // 0b00100011 (35)
+ 0, 1, 3, 4, 6, 7, 2, 5, // 0b00100100 (36)
+ 1, 3, 4, 6, 7, 0, 2, 5, // 0b00100101 (37)
+ 0, 3, 4, 6, 7, 1, 2, 5, // 0b00100110 (38)
+ 3, 4, 6, 7, 0, 1, 2, 5, // 0b00100111 (39)
+ 0, 1, 2, 4, 6, 7, 3, 5, // 0b00101000 (40)
+ 1, 2, 4, 6, 7, 0, 3, 5, // 0b00101001 (41)
+ 0, 2, 4, 6, 7, 1, 3, 5, // 0b00101010 (42)
+ 2, 4, 6, 7, 0, 1, 3, 5, // 0b00101011 (43)
+ 0, 1, 4, 6, 7, 2, 3, 5, // 0b00101100 (44)
+ 1, 4, 6, 7, 0, 2, 3, 5, // 0b00101101 (45)
+ 0, 4, 6, 7, 1, 2, 3, 5, // 0b00101110 (46)
+ 4, 6, 7, 0, 1, 2, 3, 5, // 0b00101111 (47)
+ 0, 1, 2, 3, 6, 7, 4, 5, // 0b00110000 (48)
+ 1, 2, 3, 6, 7, 0, 4, 5, // 0b00110001 (49)
+ 0, 2, 3, 6, 7, 1, 4, 5, // 0b00110010 (50)
+ 2, 3, 6, 7, 0, 1, 4, 5, // 0b00110011 (51)
+ 0, 1, 3, 6, 7, 2, 4, 5, // 0b00110100 (52)
+ 1, 3, 6, 7, 0, 2, 4, 5, // 0b00110101 (53)
+ 0, 3, 6, 7, 1, 2, 4, 5, // 0b00110110 (54)
+ 3, 6, 7, 0, 1, 2, 4, 5, // 0b00110111 (55)
+ 0, 1, 2, 6, 7, 3, 4, 5, // 0b00111000 (56)
+ 1, 2, 6, 7, 0, 3, 4, 5, // 0b00111001 (57)
+ 0, 2, 6, 7, 1, 3, 4, 5, // 0b00111010 (58)
+ 2, 6, 7, 0, 1, 3, 4, 5, // 0b00111011 (59)
+ 0, 1, 6, 7, 2, 3, 4, 5, // 0b00111100 (60)
+ 1, 6, 7, 0, 2, 3, 4, 5, // 0b00111101 (61)
+ 0, 6, 7, 1, 2, 3, 4, 5, // 0b00111110 (62)
+ 6, 7, 0, 1, 2, 3, 4, 5, // 0b00111111 (63)
+ 0, 1, 2, 3, 4, 5, 7, 6, // 0b01000000 (64)
+ 1, 2, 3, 4, 5, 7, 0, 6, // 0b01000001 (65)
+ 0, 2, 3, 4, 5, 7, 1, 6, // 0b01000010 (66)
+ 2, 3, 4, 5, 7, 0, 1, 6, // 0b01000011 (67)
+ 0, 1, 3, 4, 5, 7, 2, 6, // 0b01000100 (68)
+ 1, 3, 4, 5, 7, 0, 2, 6, // 0b01000101 (69)
+ 0, 3, 4, 5, 7, 1, 2, 6, // 0b01000110 (70)
+ 3, 4, 5, 7, 0, 1, 2, 6, // 0b01000111 (71)
+ 0, 1, 2, 4, 5, 7, 3, 6, // 0b01001000 (72)
+ 1, 2, 4, 5, 7, 0, 3, 6, // 0b01001001 (73)
+ 0, 2, 4, 5, 7, 1, 3, 6, // 0b01001010 (74)
+ 2, 4, 5, 7, 0, 1, 3, 6, // 0b01001011 (75)
+ 0, 1, 4, 5, 7, 2, 3, 6, // 0b01001100 (76)
+ 1, 4, 5, 7, 0, 2, 3, 6, // 0b01001101 (77)
+ 0, 4, 5, 7, 1, 2, 3, 6, // 0b01001110 (78)
+ 4, 5, 7, 0, 1, 2, 3, 6, // 0b01001111 (79)
+ 0, 1, 2, 3, 5, 7, 4, 6, // 0b01010000 (80)
+ 1, 2, 3, 5, 7, 0, 4, 6, // 0b01010001 (81)
+ 0, 2, 3, 5, 7, 1, 4, 6, // 0b01010010 (82)
+ 2, 3, 5, 7, 0, 1, 4, 6, // 0b01010011 (83)
+ 0, 1, 3, 5, 7, 2, 4, 6, // 0b01010100 (84)
+ 1, 3, 5, 7, 0, 2, 4, 6, // 0b01010101 (85)
+ 0, 3, 5, 7, 1, 2, 4, 6, // 0b01010110 (86)
+ 3, 5, 7, 0, 1, 2, 4, 6, // 0b01010111 (87)
+ 0, 1, 2, 5, 7, 3, 4, 6, // 0b01011000 (88)
+ 1, 2, 5, 7, 0, 3, 4, 6, // 0b01011001 (89)
+ 0, 2, 5, 7, 1, 3, 4, 6, // 0b01011010 (90)
+ 2, 5, 7, 0, 1, 3, 4, 6, // 0b01011011 (91)
+ 0, 1, 5, 7, 2, 3, 4, 6, // 0b01011100 (92)
+ 1, 5, 7, 0, 2, 3, 4, 6, // 0b01011101 (93)
+ 0, 5, 7, 1, 2, 3, 4, 6, // 0b01011110 (94)
+ 5, 7, 0, 1, 2, 3, 4, 6, // 0b01011111 (95)
+ 0, 1, 2, 3, 4, 7, 5, 6, // 0b01100000 (96)
+ 1, 2, 3, 4, 7, 0, 5, 6, // 0b01100001 (97)
+ 0, 2, 3, 4, 7, 1, 5, 6, // 0b01100010 (98)
+ 2, 3, 4, 7, 0, 1, 5, 6, // 0b01100011 (99)
+ 0, 1, 3, 4, 7, 2, 5, 6, // 0b01100100 (100)
+ 1, 3, 4, 7, 0, 2, 5, 6, // 0b01100101 (101)
+ 0, 3, 4, 7, 1, 2, 5, 6, // 0b01100110 (102)
+ 3, 4, 7, 0, 1, 2, 5, 6, // 0b01100111 (103)
+ 0, 1, 2, 4, 7, 3, 5, 6, // 0b01101000 (104)
+ 1, 2, 4, 7, 0, 3, 5, 6, // 0b01101001 (105)
+ 0, 2, 4, 7, 1, 3, 5, 6, // 0b01101010 (106)
+ 2, 4, 7, 0, 1, 3, 5, 6, // 0b01101011 (107)
+ 0, 1, 4, 7, 2, 3, 5, 6, // 0b01101100 (108)
+ 1, 4, 7, 0, 2, 3, 5, 6, // 0b01101101 (109)
+ 0, 4, 7, 1, 2, 3, 5, 6, // 0b01101110 (110)
+ 4, 7, 0, 1, 2, 3, 5, 6, // 0b01101111 (111)
+ 0, 1, 2, 3, 7, 4, 5, 6, // 0b01110000 (112)
+ 1, 2, 3, 7, 0, 4, 5, 6, // 0b01110001 (113)
+ 0, 2, 3, 7, 1, 4, 5, 6, // 0b01110010 (114)
+ 2, 3, 7, 0, 1, 4, 5, 6, // 0b01110011 (115)
+ 0, 1, 3, 7, 2, 4, 5, 6, // 0b01110100 (116)
+ 1, 3, 7, 0, 2, 4, 5, 6, // 0b01110101 (117)
+ 0, 3, 7, 1, 2, 4, 5, 6, // 0b01110110 (118)
+ 3, 7, 0, 1, 2, 4, 5, 6, // 0b01110111 (119)
+ 0, 1, 2, 7, 3, 4, 5, 6, // 0b01111000 (120)
+ 1, 2, 7, 0, 3, 4, 5, 6, // 0b01111001 (121)
+ 0, 2, 7, 1, 3, 4, 5, 6, // 0b01111010 (122)
+ 2, 7, 0, 1, 3, 4, 5, 6, // 0b01111011 (123)
+ 0, 1, 7, 2, 3, 4, 5, 6, // 0b01111100 (124)
+ 1, 7, 0, 2, 3, 4, 5, 6, // 0b01111101 (125)
+ 0, 7, 1, 2, 3, 4, 5, 6, // 0b01111110 (126)
+ 7, 0, 1, 2, 3, 4, 5, 6, // 0b01111111 (127)
+ 0, 1, 2, 3, 4, 5, 6, 7, // 0b10000000 (128)
+ 1, 2, 3, 4, 5, 6, 0, 7, // 0b10000001 (129)
+ 0, 2, 3, 4, 5, 6, 1, 7, // 0b10000010 (130)
+ 2, 3, 4, 5, 6, 0, 1, 7, // 0b10000011 (131)
+ 0, 1, 3, 4, 5, 6, 2, 7, // 0b10000100 (132)
+ 1, 3, 4, 5, 6, 0, 2, 7, // 0b10000101 (133)
+ 0, 3, 4, 5, 6, 1, 2, 7, // 0b10000110 (134)
+ 3, 4, 5, 6, 0, 1, 2, 7, // 0b10000111 (135)
+ 0, 1, 2, 4, 5, 6, 3, 7, // 0b10001000 (136)
+ 1, 2, 4, 5, 6, 0, 3, 7, // 0b10001001 (137)
+ 0, 2, 4, 5, 6, 1, 3, 7, // 0b10001010 (138)
+ 2, 4, 5, 6, 0, 1, 3, 7, // 0b10001011 (139)
+ 0, 1, 4, 5, 6, 2, 3, 7, // 0b10001100 (140)
+ 1, 4, 5, 6, 0, 2, 3, 7, // 0b10001101 (141)
+ 0, 4, 5, 6, 1, 2, 3, 7, // 0b10001110 (142)
+ 4, 5, 6, 0, 1, 2, 3, 7, // 0b10001111 (143)
+ 0, 1, 2, 3, 5, 6, 4, 7, // 0b10010000 (144)
+ 1, 2, 3, 5, 6, 0, 4, 7, // 0b10010001 (145)
+ 0, 2, 3, 5, 6, 1, 4, 7, // 0b10010010 (146)
+ 2, 3, 5, 6, 0, 1, 4, 7, // 0b10010011 (147)
+ 0, 1, 3, 5, 6, 2, 4, 7, // 0b10010100 (148)
+ 1, 3, 5, 6, 0, 2, 4, 7, // 0b10010101 (149)
+ 0, 3, 5, 6, 1, 2, 4, 7, // 0b10010110 (150)
+ 3, 5, 6, 0, 1, 2, 4, 7, // 0b10010111 (151)
+ 0, 1, 2, 5, 6, 3, 4, 7, // 0b10011000 (152)
+ 1, 2, 5, 6, 0, 3, 4, 7, // 0b10011001 (153)
+ 0, 2, 5, 6, 1, 3, 4, 7, // 0b10011010 (154)
+ 2, 5, 6, 0, 1, 3, 4, 7, // 0b10011011 (155)
+ 0, 1, 5, 6, 2, 3, 4, 7, // 0b10011100 (156)
+ 1, 5, 6, 0, 2, 3, 4, 7, // 0b10011101 (157)
+ 0, 5, 6, 1, 2, 3, 4, 7, // 0b10011110 (158)
+ 5, 6, 0, 1, 2, 3, 4, 7, // 0b10011111 (159)
+ 0, 1, 2, 3, 4, 6, 5, 7, // 0b10100000 (160)
+ 1, 2, 3, 4, 6, 0, 5, 7, // 0b10100001 (161)
+ 0, 2, 3, 4, 6, 1, 5, 7, // 0b10100010 (162)
+ 2, 3, 4, 6, 0, 1, 5, 7, // 0b10100011 (163)
+ 0, 1, 3, 4, 6, 2, 5, 7, // 0b10100100 (164)
+ 1, 3, 4, 6, 0, 2, 5, 7, // 0b10100101 (165)
+ 0, 3, 4, 6, 1, 2, 5, 7, // 0b10100110 (166)
+ 3, 4, 6, 0, 1, 2, 5, 7, // 0b10100111 (167)
+ 0, 1, 2, 4, 6, 3, 5, 7, // 0b10101000 (168)
+ 1, 2, 4, 6, 0, 3, 5, 7, // 0b10101001 (169)
+ 0, 2, 4, 6, 1, 3, 5, 7, // 0b10101010 (170)
+ 2, 4, 6, 0, 1, 3, 5, 7, // 0b10101011 (171)
+ 0, 1, 4, 6, 2, 3, 5, 7, // 0b10101100 (172)
+ 1, 4, 6, 0, 2, 3, 5, 7, // 0b10101101 (173)
+ 0, 4, 6, 1, 2, 3, 5, 7, // 0b10101110 (174)
+ 4, 6, 0, 1, 2, 3, 5, 7, // 0b10101111 (175)
+ 0, 1, 2, 3, 6, 4, 5, 7, // 0b10110000 (176)
+ 1, 2, 3, 6, 0, 4, 5, 7, // 0b10110001 (177)
+ 0, 2, 3, 6, 1, 4, 5, 7, // 0b10110010 (178)
+ 2, 3, 6, 0, 1, 4, 5, 7, // 0b10110011 (179)
+ 0, 1, 3, 6, 2, 4, 5, 7, // 0b10110100 (180)
+ 1, 3, 6, 0, 2, 4, 5, 7, // 0b10110101 (181)
+ 0, 3, 6, 1, 2, 4, 5, 7, // 0b10110110 (182)
+ 3, 6, 0, 1, 2, 4, 5, 7, // 0b10110111 (183)
+ 0, 1, 2, 6, 3, 4, 5, 7, // 0b10111000 (184)
+ 1, 2, 6, 0, 3, 4, 5, 7, // 0b10111001 (185)
+ 0, 2, 6, 1, 3, 4, 5, 7, // 0b10111010 (186)
+ 2, 6, 0, 1, 3, 4, 5, 7, // 0b10111011 (187)
+ 0, 1, 6, 2, 3, 4, 5, 7, // 0b10111100 (188)
+ 1, 6, 0, 2, 3, 4, 5, 7, // 0b10111101 (189)
+ 0, 6, 1, 2, 3, 4, 5, 7, // 0b10111110 (190)
+ 6, 0, 1, 2, 3, 4, 5, 7, // 0b10111111 (191)
+ 0, 1, 2, 3, 4, 5, 6, 7, // 0b11000000 (192)
+ 1, 2, 3, 4, 5, 0, 6, 7, // 0b11000001 (193)
+ 0, 2, 3, 4, 5, 1, 6, 7, // 0b11000010 (194)
+ 2, 3, 4, 5, 0, 1, 6, 7, // 0b11000011 (195)
+ 0, 1, 3, 4, 5, 2, 6, 7, // 0b11000100 (196)
+ 1, 3, 4, 5, 0, 2, 6, 7, // 0b11000101 (197)
+ 0, 3, 4, 5, 1, 2, 6, 7, // 0b11000110 (198)
+ 3, 4, 5, 0, 1, 2, 6, 7, // 0b11000111 (199)
+ 0, 1, 2, 4, 5, 3, 6, 7, // 0b11001000 (200)
+ 1, 2, 4, 5, 0, 3, 6, 7, // 0b11001001 (201)
+ 0, 2, 4, 5, 1, 3, 6, 7, // 0b11001010 (202)
+ 2, 4, 5, 0, 1, 3, 6, 7, // 0b11001011 (203)
+ 0, 1, 4, 5, 2, 3, 6, 7, // 0b11001100 (204)
+ 1, 4, 5, 0, 2, 3, 6, 7, // 0b11001101 (205)
+ 0, 4, 5, 1, 2, 3, 6, 7, // 0b11001110 (206)
+ 4, 5, 0, 1, 2, 3, 6, 7, // 0b11001111 (207)
+ 0, 1, 2, 3, 5, 4, 6, 7, // 0b11010000 (208)
+ 1, 2, 3, 5, 0, 4, 6, 7, // 0b11010001 (209)
+ 0, 2, 3, 5, 1, 4, 6, 7, // 0b11010010 (210)
+ 2, 3, 5, 0, 1, 4, 6, 7, // 0b11010011 (211)
+ 0, 1, 3, 5, 2, 4, 6, 7, // 0b11010100 (212)
+ 1, 3, 5, 0, 2, 4, 6, 7, // 0b11010101 (213)
+ 0, 3, 5, 1, 2, 4, 6, 7, // 0b11010110 (214)
+ 3, 5, 0, 1, 2, 4, 6, 7, // 0b11010111 (215)
+ 0, 1, 2, 5, 3, 4, 6, 7, // 0b11011000 (216)
+ 1, 2, 5, 0, 3, 4, 6, 7, // 0b11011001 (217)
+ 0, 2, 5, 1, 3, 4, 6, 7, // 0b11011010 (218)
+ 2, 5, 0, 1, 3, 4, 6, 7, // 0b11011011 (219)
+ 0, 1, 5, 2, 3, 4, 6, 7, // 0b11011100 (220)
+ 1, 5, 0, 2, 3, 4, 6, 7, // 0b11011101 (221)
+ 0, 5, 1, 2, 3, 4, 6, 7, // 0b11011110 (222)
+ 5, 0, 1, 2, 3, 4, 6, 7, // 0b11011111 (223)
+ 0, 1, 2, 3, 4, 5, 6, 7, // 0b11100000 (224)
+ 1, 2, 3, 4, 0, 5, 6, 7, // 0b11100001 (225)
+ 0, 2, 3, 4, 1, 5, 6, 7, // 0b11100010 (226)
+ 2, 3, 4, 0, 1, 5, 6, 7, // 0b11100011 (227)
+ 0, 1, 3, 4, 2, 5, 6, 7, // 0b11100100 (228)
+ 1, 3, 4, 0, 2, 5, 6, 7, // 0b11100101 (229)
+ 0, 3, 4, 1, 2, 5, 6, 7, // 0b11100110 (230)
+ 3, 4, 0, 1, 2, 5, 6, 7, // 0b11100111 (231)
+ 0, 1, 2, 4, 3, 5, 6, 7, // 0b11101000 (232)
+ 1, 2, 4, 0, 3, 5, 6, 7, // 0b11101001 (233)
+ 0, 2, 4, 1, 3, 5, 6, 7, // 0b11101010 (234)
+ 2, 4, 0, 1, 3, 5, 6, 7, // 0b11101011 (235)
+ 0, 1, 4, 2, 3, 5, 6, 7, // 0b11101100 (236)
+ 1, 4, 0, 2, 3, 5, 6, 7, // 0b11101101 (237)
+ 0, 4, 1, 2, 3, 5, 6, 7, // 0b11101110 (238)
+ 4, 0, 1, 2, 3, 5, 6, 7, // 0b11101111 (239)
+ 0, 1, 2, 3, 4, 5, 6, 7, // 0b11110000 (240)
+ 1, 2, 3, 0, 4, 5, 6, 7, // 0b11110001 (241)
+ 0, 2, 3, 1, 4, 5, 6, 7, // 0b11110010 (242)
+ 2, 3, 0, 1, 4, 5, 6, 7, // 0b11110011 (243)
+ 0, 1, 3, 2, 4, 5, 6, 7, // 0b11110100 (244)
+ 1, 3, 0, 2, 4, 5, 6, 7, // 0b11110101 (245)
+ 0, 3, 1, 2, 4, 5, 6, 7, // 0b11110110 (246)
+ 3, 0, 1, 2, 4, 5, 6, 7, // 0b11110111 (247)
+ 0, 1, 2, 3, 4, 5, 6, 7, // 0b11111000 (248)
+ 1, 2, 0, 3, 4, 5, 6, 7, // 0b11111001 (249)
+ 0, 2, 1, 3, 4, 5, 6, 7, // 0b11111010 (250)
+ 2, 0, 1, 3, 4, 5, 6, 7, // 0b11111011 (251)
+ 0, 1, 2, 3, 4, 5, 6, 7, // 0b11111100 (252)
+ 1, 0, 2, 3, 4, 5, 6, 7, // 0b11111101 (253)
+ 0, 1, 2, 3, 4, 5, 6, 7, // 0b11111110 (254)
+ 0, 1, 2, 3, 4, 5, 6, 7, // 0b11111111 (255)
+};
+
+}
+
diff --git a/src/coreclr/src/gc/vxsort/machine_traits.avx2.h b/src/coreclr/src/gc/vxsort/machine_traits.avx2.h
new file mode 100644
index 000000000000..1944b57a18f1
--- /dev/null
+++ b/src/coreclr/src/gc/vxsort/machine_traits.avx2.h
@@ -0,0 +1,297 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+//
+// Created by dans on 6/1/20.
+//
+
+#ifndef VXSORT_MACHINE_TRAITS_AVX2_H
+#define VXSORT_MACHINE_TRAITS_AVX2_H
+
+#include "vxsort_targets_enable_avx2.h"
+
+#include
+//#include
+#include
+
+#include "defs.h"
+#include "machine_traits.h"
+
+#define i2d _mm256_castsi256_pd
+#define d2i _mm256_castpd_si256
+#define i2s _mm256_castsi256_ps
+#define s2i _mm256_castps_si256
+#define s2d _mm256_castps_pd
+#define d2s _mm256_castpd_ps
+
+namespace vxsort {
+extern const int8_t perm_table_64[128];
+extern const int8_t perm_table_32[2048];
+
+static void not_supported()
+{
+ assert(!"operation is unsupported");
+}
+
+#ifdef _DEBUG
+// in _DEBUG, we #define return to be something more complicated,
+// containing a statement, so #define away constexpr for _DEBUG
+#define constexpr
+#endif //_DEBUG
+
+template <>
+class vxsort_machine_traits {
+ public:
+ typedef __m256i TV;
+ typedef uint32_t TMASK;
+
+ static constexpr bool supports_compress_writes() { return false; }
+
+ static INLINE TV load_vec(TV* p) { return _mm256_lddqu_si256(p); }
+
+ static INLINE void store_vec(TV* ptr, TV v) { _mm256_storeu_si256(ptr, v); }
+
+ static void store_compress_vec(TV* ptr, TV v, TMASK mask) { not_supported(); }
+
+ static INLINE TV partition_vector(TV v, int mask) {
+ assert(mask >= 0);
+ assert(mask <= 255);
+ return s2i(_mm256_permutevar8x32_ps(i2s(v), _mm256_cvtepu8_epi32(_mm_loadu_si128((__m128i*)(perm_table_32 + mask * 8)))));
+ }
+
+ static INLINE TV broadcast(int32_t pivot) { return _mm256_set1_epi32(pivot); }
+ static INLINE TMASK get_cmpgt_mask(TV a, TV b) { return _mm256_movemask_ps(i2s(_mm256_cmpgt_epi32(a, b))); }
+
+ static TV shift_right(TV v, int i) { return _mm256_srli_epi32(v, i); }
+ static TV shift_left(TV v, int i) { return _mm256_slli_epi32(v, i); }
+
+ static INLINE TV add(TV a, TV b) { return _mm256_add_epi32(a, b); }
+ static INLINE TV sub(TV a, TV b) { return _mm256_sub_epi32(a, b); };
+};
+
+template <>
+class vxsort_machine_traits {
+ public:
+ typedef __m256i TV;
+ typedef uint32_t TMASK;
+
+ static constexpr bool supports_compress_writes() { return false; }
+
+ static INLINE TV load_vec(TV* p) { return _mm256_lddqu_si256(p); }
+
+ static INLINE void store_vec(TV* ptr, TV v) { _mm256_storeu_si256(ptr, v); }
+
+ static void store_compress_vec(TV* ptr, TV v, TMASK mask) { not_supported(); }
+
+ static INLINE TV partition_vector(TV v, int mask) {
+ assert(mask >= 0);
+ assert(mask <= 255);
+ return s2i(_mm256_permutevar8x32_ps(i2s(v), _mm256_cvtepu8_epi32(_mm_loadu_si128((__m128i*)(perm_table_32 + mask * 8)))));
+ }
+
+ static INLINE TV broadcast(uint32_t pivot) { return _mm256_set1_epi32(pivot); }
+ static INLINE TMASK get_cmpgt_mask(TV a, TV b) {
+ __m256i top_bit = _mm256_set1_epi32(1U << 31);
+ return _mm256_movemask_ps(i2s(_mm256_cmpgt_epi32(_mm256_xor_si256(top_bit, a), _mm256_xor_si256(top_bit, b))));
+ }
+
+ static TV shift_right(TV v, int i) { return _mm256_srli_epi32(v, i); }
+ static TV shift_left(TV v, int i) { return _mm256_slli_epi32(v, i); }
+
+ static INLINE TV add(TV a, TV b) { return _mm256_add_epi32(a, b); }
+ static INLINE TV sub(TV a, TV b) { return _mm256_sub_epi32(a, b); };
+};
+
+template <>
+class vxsort_machine_traits {
+ public:
+ typedef __m256 TV;
+ typedef uint32_t TMASK;
+
+ static constexpr bool supports_compress_writes() { return false; }
+
+ static INLINE TV load_vec(TV* p) { return _mm256_loadu_ps((float*)p); }
+
+ static INLINE void store_vec(TV* ptr, TV v) { _mm256_storeu_ps((float*)ptr, v); }
+
+ static void store_compress_vec(TV* ptr, TV v, TMASK mask) { not_supported(); }
+
+ static INLINE TV partition_vector(TV v, int mask) {
+ assert(mask >= 0);
+ assert(mask <= 255);
+ return _mm256_permutevar8x32_ps(v, _mm256_cvtepu8_epi32(_mm_loadu_si128((__m128i*)(perm_table_32 + mask * 8))));
+ }
+
+ static INLINE TV broadcast(float pivot) { return _mm256_set1_ps(pivot); }
+
+ static INLINE TMASK get_cmpgt_mask(TV a, TV b) {
+ /// 0x0E: Greater-than (ordered, signaling) \n
+ /// 0x1E: Greater-than (ordered, non-signaling)
+ return _mm256_movemask_ps(_mm256_cmp_ps(a, b, _CMP_GT_OS));
+ }
+
+ static INLINE TV add(TV a, TV b) { return _mm256_add_ps(a, b); }
+ static INLINE TV sub(TV a, TV b) { return _mm256_sub_ps(a, b); };
+
+};
+
+template <>
+class vxsort_machine_traits {
+ public:
+ typedef __m256i TV;
+ typedef uint32_t TMASK;
+
+ static constexpr bool supports_compress_writes() { return false; }
+
+ static INLINE TV load_vec(TV* p) { return _mm256_lddqu_si256(p); }
+
+ static INLINE void store_vec(TV* ptr, TV v) { _mm256_storeu_si256(ptr, v); }
+
+ static void store_compress_vec(TV* ptr, TV v, TMASK mask) { not_supported(); }
+
+ static INLINE TV partition_vector(TV v, int mask) {
+ assert(mask >= 0);
+ assert(mask <= 15);
+ return s2i(_mm256_permutevar8x32_ps(i2s(v), _mm256_cvtepu8_epi32(_mm_loadu_si128((__m128i*)(perm_table_64 + mask * 8)))));
+ }
+
+ static INLINE TV broadcast(int64_t pivot) { return _mm256_set1_epi64x(pivot); }
+ static INLINE TMASK get_cmpgt_mask(TV a, TV b) { return _mm256_movemask_pd(i2d(_mm256_cmpgt_epi64(a, b))); }
+
+ static TV shift_right(TV v, int i) { return _mm256_srli_epi64(v, i); }
+ static TV shift_left(TV v, int i) { return _mm256_slli_epi64(v, i); }
+
+ static INLINE TV add(TV a, TV b) { return _mm256_add_epi64(a, b); }
+ static INLINE TV sub(TV a, TV b) { return _mm256_sub_epi64(a, b); };
+
+
+
+ static INLINE TV pack_ordered(TV a, TV b) {
+ a = _mm256_permute4x64_epi64(_mm256_shuffle_epi32(a, _MM_PERM_DBCA), _MM_PERM_DBCA);
+ b = _mm256_permute4x64_epi64(_mm256_shuffle_epi32(b, _MM_PERM_DBCA), _MM_PERM_CADB);
+ return _mm256_blend_epi32(a, b, 0b11110000);
+ }
+
+ static INLINE TV pack_unordered(TV a, TV b) {
+ b = _mm256_shuffle_epi32(b, _MM_PERM_CDAB);
+ return _mm256_blend_epi32(a, b, 0b10101010);
+ }
+
+ static INLINE void unpack_ordered_signed(TV p, TV& u1, TV& u2) {
+ auto p01 = _mm256_extracti128_si256(p, 0);
+ auto p02 = _mm256_extracti128_si256(p, 1);
+
+ u1 = _mm256_cvtepi32_epi64(p01);
+ u2 = _mm256_cvtepi32_epi64(p02);
+
+ }
+
+ static INLINE void unpack_ordered_unsigned(TV p, TV& u1, TV& u2) {
+ auto p01 = _mm256_extracti128_si256(p, 0);
+ auto p02 = _mm256_extracti128_si256(p, 1);
+
+ u1 = _mm256_cvtepu32_epi64(p01);
+ u2 = _mm256_cvtepu32_epi64(p02);
+
+ }
+
+/*
+ template<>
+ static INLINE TV pack_ordered(TV a, TV b) {
+ a = _mm256_permute4x64_epi64(_mm256_shuffle_epi32(a, _MM_PERM_DBCA), _MM_PERM_DBCA);
+ b = _mm256_permute4x64_epi64(_mm256_shuffle_epi32(b, _MM_PERM_DBCA), _MM_PERM_CADB);
+ return _mm256_blend_epi32(a, b, 0b11110000);
+ }
+
+ template<>
+ static INLINE typename vxsort_machine_traits::TV pack_unordered(TV a, TV b) {
+ b = _mm256_shuffle_epi32(b, _MM_PERM_CDAB);
+ return _mm256_blend_epi32(a, b, 0b10101010);
+ }
+
+ */
+
+
+
+};
+
+template <>
+class vxsort_machine_traits {
+ public:
+ typedef __m256i TV;
+ typedef uint32_t TMASK;
+
+ static constexpr bool supports_compress_writes() { return false; }
+
+ static INLINE TV load_vec(TV* p) { return _mm256_lddqu_si256(p); }
+
+ static INLINE void store_vec(TV* ptr, TV v) { _mm256_storeu_si256(ptr, v); }
+
+ static void store_compress_vec(TV* ptr, TV v, TMASK mask) { not_supported(); }
+
+ static INLINE TV partition_vector(TV v, int mask) {
+ assert(mask >= 0);
+ assert(mask <= 15);
+ return s2i(_mm256_permutevar8x32_ps(i2s(v), _mm256_cvtepu8_epi32(_mm_loadu_si128((__m128i*)(perm_table_64 + mask * 8)))));
+ }
+ static INLINE TV broadcast(int64_t pivot) { return _mm256_set1_epi64x(pivot); }
+ static INLINE TMASK get_cmpgt_mask(TV a, TV b) {
+ __m256i top_bit = _mm256_set1_epi64x(1LLU << 63);
+ return _mm256_movemask_pd(i2d(_mm256_cmpgt_epi64(_mm256_xor_si256(top_bit, a), _mm256_xor_si256(top_bit, b))));
+ }
+
+ static INLINE TV shift_right(TV v, int i) { return _mm256_srli_epi64(v, i); }
+ static INLINE TV shift_left(TV v, int i) { return _mm256_slli_epi64(v, i); }
+
+ static INLINE TV add(TV a, TV b) { return _mm256_add_epi64(a, b); }
+ static INLINE TV sub(TV a, TV b) { return _mm256_sub_epi64(a, b); };
+};
+
+template <>
+class vxsort_machine_traits {
+ public:
+ typedef __m256d TV;
+ typedef uint32_t TMASK;
+
+ static constexpr bool supports_compress_writes() { return false; }
+
+ static INLINE TV load_vec(TV* p) { return _mm256_loadu_pd((double*)p); }
+
+ static INLINE void store_vec(TV* ptr, TV v) { _mm256_storeu_pd((double*)ptr, v); }
+
+ static void store_compress_vec(TV* ptr, TV v, TMASK mask) { not_supported(); }
+
+ static INLINE TV partition_vector(TV v, int mask) {
+ assert(mask >= 0);
+ assert(mask <= 15);
+ return s2d(_mm256_permutevar8x32_ps(d2s(v), _mm256_cvtepu8_epi32(_mm_loadu_si128((__m128i*)(perm_table_64 + mask * 8)))));
+ }
+
+ static INLINE TV broadcast(double pivot) { return _mm256_set1_pd(pivot); }
+ static INLINE TMASK get_cmpgt_mask(TV a, TV b) {
+ /// 0x0E: Greater-than (ordered, signaling) \n
+ /// 0x1E: Greater-than (ordered, non-signaling)
+ return _mm256_movemask_pd(_mm256_cmp_pd(a, b, _CMP_GT_OS));
+ }
+
+ static INLINE TV add(TV a, TV b) { return _mm256_add_pd(a, b); }
+ static INLINE TV sub(TV a, TV b) { return _mm256_sub_pd(a, b); };
+};
+
+}
+
+#undef i2d
+#undef d2i
+#undef i2s
+#undef s2i
+#undef s2d
+#undef d2s
+
+#ifdef _DEBUG
+#undef constexpr
+#endif //_DEBUG
+
+#include "vxsort_targets_disable.h"
+
+
+#endif // VXSORT_VXSORT_AVX2_H
diff --git a/src/coreclr/src/gc/vxsort/machine_traits.avx512.h b/src/coreclr/src/gc/vxsort/machine_traits.avx512.h
new file mode 100644
index 000000000000..443654a39b60
--- /dev/null
+++ b/src/coreclr/src/gc/vxsort/machine_traits.avx512.h
@@ -0,0 +1,230 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+//
+// Created by dans on 6/1/20.
+//
+
+#ifndef VXSORT_MACHINE_TRAITS_AVX512_H
+#define VXSORT_MACHINE_TRAITS_AVX512_H
+
+#include "vxsort_targets_enable_avx512.h"
+
+#include
+#include "defs.h"
+#include "machine_traits.h"
+
+#ifdef _DEBUG
+// in _DEBUG, we #define return to be something more complicated,
+// containing a statement, so #define away constexpr for _DEBUG
+#define constexpr
+#endif //_DEBUG
+
+namespace vxsort {
+template <>
+class vxsort_machine_traits {
+ public:
+ typedef __m512i TV;
+ typedef __mmask16 TMASK;
+
+ static constexpr bool supports_compress_writes() { return true; }
+
+ static INLINE TV load_vec(TV* p) {
+ return _mm512_loadu_si512(p);
+ }
+
+ static INLINE void store_vec(TV* ptr, TV v) {
+ _mm512_storeu_si512(ptr, v);
+ }
+
+ // Will never be called
+ static INLINE TV partition_vector(TV v, int mask) { return v; }
+
+
+ static void store_compress_vec(TV *ptr, TV v, TMASK mask) {
+ _mm512_mask_compressstoreu_epi32(ptr, mask, v);
+ }
+
+ static INLINE TV broadcast(int32_t pivot) {
+ return _mm512_set1_epi32(pivot);
+ }
+
+ static INLINE TMASK get_cmpgt_mask(TV a, TV b) {
+ return _mm512_cmp_epi32_mask(a, b, _MM_CMPINT_GT);
+ }
+};
+
+template <>
+class vxsort_machine_traits {
+ public:
+ typedef __m512i TV;
+ typedef __mmask16 TMASK;
+
+ static constexpr bool supports_compress_writes() { return true; }
+
+ static INLINE TV load_vec(TV* p) {
+ return _mm512_loadu_si512(p);
+ }
+
+ static INLINE void store_vec(TV* ptr, TV v) {
+ _mm512_storeu_si512(ptr, v);
+ }
+
+ // Will never be called
+ static INLINE TV partition_vector(TV v, int mask) { return v; }
+
+
+ static void store_compress_vec(TV *ptr, TV v, TMASK mask) {
+ _mm512_mask_compressstoreu_epi32(ptr, mask, v);
+ }
+
+ static INLINE TV broadcast(uint32_t pivot) {
+ return _mm512_set1_epi32(pivot);
+ }
+
+ static INLINE TMASK get_cmpgt_mask(TV a, TV b) {
+ return _mm512_cmp_epu32_mask(a, b, _MM_CMPINT_GT);
+ }
+};
+
+template <>
+class vxsort_machine_traits {
+ public:
+ typedef __m512 TV;
+ typedef __mmask16 TMASK;
+
+ static constexpr bool supports_compress_writes() { return true; }
+
+ static INLINE TV load_vec(TV* p) {
+ return _mm512_loadu_ps(p);
+ }
+
+ static INLINE void store_vec(TV* ptr, TV v) {
+ _mm512_storeu_ps(ptr, v);
+ }
+
+ // Will never be called
+ static INLINE TV partition_vector(TV v, int mask) { return v; }
+
+
+ static void store_compress_vec(TV *ptr, TV v, TMASK mask) {
+ _mm512_mask_compressstoreu_ps(ptr, mask, v);
+ }
+
+ static INLINE TV broadcast(float pivot) {
+ return _mm512_set1_ps(pivot);
+ }
+
+ static INLINE TMASK get_cmpgt_mask(TV a, TV b) {
+ return _mm512_cmp_ps_mask(a, b, _CMP_GT_OS);
+ }
+};
+
+template <>
+class vxsort_machine_traits {
+ public:
+ typedef __m512i TV;
+ typedef __mmask8 TMASK;
+
+ static bool supports_compress_writes() { return true; }
+
+ static INLINE TV load_vec(TV* p) {
+ return _mm512_loadu_si512(p);
+ }
+
+ static INLINE void store_vec(TV* ptr, TV v) {
+ _mm512_storeu_si512(ptr, v);
+ }
+
+ // Will never be called
+ static INLINE TV partition_vector(TV v, int mask) { return v; }
+
+
+ static void store_compress_vec(TV *ptr, TV v, TMASK mask) {
+ _mm512_mask_compressstoreu_epi64(ptr, mask, v);
+ }
+
+ static INLINE TV broadcast(int64_t pivot) {
+ return _mm512_set1_epi64(pivot);
+ }
+
+ static INLINE TMASK get_cmpgt_mask(TV a, TV b) {
+ return _mm512_cmp_epi64_mask(a, b, _MM_CMPINT_GT);
+ }
+};
+
+template <>
+class vxsort_machine_traits {
+ public:
+ typedef __m512i TV;
+ typedef __mmask8 TMASK;
+
+ static constexpr bool supports_compress_writes() { return true; }
+
+ static INLINE TV load_vec(TV* p) {
+ return _mm512_loadu_si512(p);
+ }
+
+ static INLINE void store_vec(TV* ptr, TV v) {
+ _mm512_storeu_si512(ptr, v);
+ }
+
+ // Will never be called
+ static INLINE TV partition_vector(TV v, int mask) { return v; }
+
+
+ static void store_compress_vec(TV *ptr, TV v, TMASK mask) {
+ _mm512_mask_compressstoreu_epi64(ptr, mask, v);
+ }
+
+ static INLINE TV broadcast(uint64_t pivot) {
+ return _mm512_set1_epi64(pivot);
+ }
+
+ static INLINE TMASK get_cmpgt_mask(TV a, TV b) {
+ return _mm512_cmp_epu64_mask(a, b, _MM_CMPINT_GT);
+ }
+};
+
+template <>
+class vxsort_machine_traits {
+ public:
+ typedef __m512d TV;
+ typedef __mmask8 TMASK;
+
+ static constexpr bool supports_compress_writes() { return true; }
+
+ static INLINE TV load_vec(TV* p) {
+ return _mm512_loadu_pd(p);
+ }
+
+ static INLINE void store_vec(TV* ptr, TV v) {
+ _mm512_storeu_pd(ptr, v);
+ }
+
+ // Will never be called
+ static INLINE TV partition_vector(TV v, int mask) { return v; }
+
+
+ static void store_compress_vec(TV *ptr, TV v, TMASK mask) {
+ _mm512_mask_compressstoreu_pd(ptr, mask, v);
+ }
+
+ static INLINE TV broadcast(double pivot) {
+ return _mm512_set1_pd(pivot);
+ }
+
+ static INLINE TMASK get_cmpgt_mask(TV a, TV b) {
+ return _mm512_cmp_pd_mask(a, b, _CMP_GT_OS);
+ }
+};
+
+}
+
+#ifdef _DEBUG
+#undef constexpr
+#endif //_DEBUG
+
+#include "vxsort_targets_disable.h"
+
+#endif // VXSORT_VXSORT_AVX512_H
diff --git a/src/coreclr/src/gc/vxsort/machine_traits.h b/src/coreclr/src/gc/vxsort/machine_traits.h
new file mode 100644
index 000000000000..cd31ed365777
--- /dev/null
+++ b/src/coreclr/src/gc/vxsort/machine_traits.h
@@ -0,0 +1,53 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+//
+// Created by dans on 6/1/20.
+//
+
+#ifndef VXSORT_MACHINE_TRAITS_H
+#define VXSORT_MACHINE_TRAITS_H
+
+//#include
+
+namespace vxsort {
+
+enum vector_machine {
+ NONE,
+ AVX2,
+ AVX512,
+ SVE,
+};
+
+template
+struct vxsort_machine_traits {
+ public:
+ typedef int TV;
+ typedef int TMASK;
+
+ static constexpr bool supports_compress_writes();
+
+ static TV load_vec(TV* ptr);
+ static void store_vec(TV* ptr, TV v);
+ static void store_compress_vec(TV* ptr, TV v, TMASK mask);
+ static TV partition_vector(TV v, int mask);
+ static TV broadcast(T pivot);
+ static TMASK get_cmpgt_mask(TV a, TV b);
+
+ static TV shift_right(TV v, int i);
+ static TV shift_left(TV v, int i);
+
+ static TV add(TV a, TV b);
+ static TV sub(TV a, TV b);
+
+ static TV pack_ordered(TV a, TV b);
+ static TV pack_unordered(TV a, TV b);
+
+ static void unpack_ordered_signed(TV p, TV& u1, TV& u2);
+ static void unpack_ordered_unsigned(TV p, TV& u1, TV& u2);
+
+
+};
+}
+
+#endif // VXSORT_MACHINE_TRAITS_H
diff --git a/src/coreclr/src/gc/vxsort/packer.h b/src/coreclr/src/gc/vxsort/packer.h
new file mode 100644
index 000000000000..4c7257a58f17
--- /dev/null
+++ b/src/coreclr/src/gc/vxsort/packer.h
@@ -0,0 +1,199 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+#ifndef VXSORT_PACKER_H
+#define VXSORT_PACKER_H
+
+#include "vxsort_targets_enable_avx2.h"
+
+//#include
+//#include
+//#include
+#//include
+#include "alignment.h"
+#include "machine_traits.h"
+#include "machine_traits.avx2.h"
+#include "machine_traits.avx512.h"
+
+#include
+//#include
+
+namespace vxsort {
+
+template
+class packer {
+ static_assert(Shift <= 31, "Shift must be in the range 0..31");
+ using MT = vxsort_machine_traits;
+ typedef typename MT::TV TV;
+ typedef typename std::make_unsigned::type TU;
+ static const int N = sizeof(TV) / sizeof(TFrom);
+ typedef alignment_hint AH;
+
+ static const size_t ALIGN = AH::ALIGN;
+ static const size_t ALIGN_MASK = ALIGN - 1;
+
+ static INLINE void pack_scalar(const TFrom offset, TFrom*& mem_read, TTo*& mem_write) {
+ auto d = *(mem_read++);
+ if (Shift > 0)
+ d >>= Shift;
+ d -= offset;
+ *(mem_write++) = (TTo) d;
+ }
+
+ static INLINE void unpack_scalar(const TFrom offset, TTo*& mem_read, TFrom*& mem_write) {
+ TFrom d = *(--mem_read);
+
+ d += offset;
+
+ if (Shift > 0)
+ d = (TFrom) (((TU) d) << Shift);
+
+ *(--mem_write) = d;
+ }
+
+ public:
+
+ static void pack(TFrom *mem, size_t len, TFrom base) {
+ TFrom offset = (base >> Shift) - std::numeric_limits::Min();
+ auto baseVec = MT::broadcast(offset);
+
+ auto pre_aligned_mem = reinterpret_cast(reinterpret_cast(mem) & ~ALIGN_MASK);
+
+ auto mem_read = mem;
+ auto mem_write = (TTo *) mem;
+
+ // Include a "special" pass to handle very short scalar
+ // passes
+ if (MinLength < N && len < N) {
+ while (len--) {
+ pack_scalar(offset, mem_read, mem_write);
+ }
+ return;
+ }
+
+ // We have at least
+ // one vector worth of data to handle
+ // Let's try to align to vector size first
+
+ if (pre_aligned_mem < mem) {
+ const auto alignment_point = pre_aligned_mem + N;
+ len -= (alignment_point - mem_read);
+ while (mem_read < alignment_point) {
+ pack_scalar(offset, mem_read, mem_write);
+ }
+ }
+
+ assert(AH::is_aligned(mem_read));
+
+ auto memv_read = (TV *) mem_read;
+ auto memv_write = (TV *) mem_write;
+
+ auto lenv = len / N;
+ len -= (lenv * N);
+
+ while (lenv >= 2) {
+ assert(memv_read >= memv_write);
+
+ auto d01 = MT::load_vec(memv_read);
+ auto d02 = MT::load_vec(memv_read + 1);
+ if (Shift > 0) { // This is statically compiled in/out
+ d01 = MT::shift_right(d01, Shift);
+ d02 = MT::shift_right(d02, Shift);
+ }
+ d01 = MT::sub(d01, baseVec);
+ d02 = MT::sub(d02, baseVec);
+
+ auto packed_data = RespectPackingOrder ?
+ MT::pack_ordered(d01, d02) :
+ MT::pack_unordered(d01, d02);
+
+ MT::store_vec(memv_write, packed_data);
+
+ memv_read += 2;
+ memv_write++;
+ lenv -= 2;
+ }
+
+ len += lenv * N;
+
+ mem_read = (TFrom *) memv_read;
+ mem_write = (TTo *) memv_write;
+
+ while (len-- > 0) {
+ pack_scalar(offset, mem_read, mem_write);
+ }
+ }
+
+ static void unpack(TTo *mem, size_t len, TFrom base) {
+ TFrom offset = (base >> Shift) - std::numeric_limits::Min();
+ auto baseVec = MT::broadcast(offset);
+
+ auto mem_read = mem + len;
+ auto mem_write = ((TFrom *) mem) + len;
+
+
+ // Include a "special" pass to handle very short scalar
+ // passers
+ if (MinLength < 2*N && len < 2*N) {
+ while (len--) {
+ unpack_scalar(offset, mem_read, mem_write);
+ }
+ return;
+ }
+
+ auto pre_aligned_mem = reinterpret_cast(reinterpret_cast(mem_read) & ~ALIGN_MASK);
+
+ if (pre_aligned_mem < mem_read) {
+ len -= (mem_read - pre_aligned_mem);
+ while (mem_read > pre_aligned_mem) {
+ unpack_scalar(offset, mem_read, mem_write);
+ }
+ }
+
+ assert(AH::is_aligned(mem_read));
+
+ auto lenv = len / (N*2);
+ auto memv_read = ((TV *) mem_read) - 1;
+ auto memv_write = ((TV *) mem_write) - 2;
+ len -= lenv * N * 2;
+
+ while (lenv > 0) {
+ assert(memv_read <= memv_write);
+ TV d01, d02;
+
+ if (std::numeric_limits::Min() < 0)
+ MT::unpack_ordered_signed(MT::load_vec(memv_read), d01, d02);
+ else
+ MT::unpack_ordered_unsigned(MT::load_vec(memv_read), d01, d02);
+
+ d01 = MT::add(d01, baseVec);
+ d02 = MT::add(d02, baseVec);
+
+ if (Shift > 0) { // This is statically compiled in/out
+ d01 = MT::shift_left(d01, Shift);
+ d02 = MT::shift_left(d02, Shift);
+ }
+
+ MT::store_vec(memv_write, d01);
+ MT::store_vec(memv_write + 1, d02);
+
+ memv_read -= 1;
+ memv_write -= 2;
+ lenv--;
+ }
+
+ mem_read = (TTo *) (memv_read + 1);
+ mem_write = (TFrom *) (memv_write + 2);
+
+ while (len-- > 0) {
+ unpack_scalar(offset, mem_read, mem_write);
+ }
+ }
+
+};
+
+}
+
+#include "vxsort_targets_disable.h"
+
+#endif // VXSORT_PACKER_H
diff --git a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int32_t.generated.cpp b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int32_t.generated.cpp
new file mode 100644
index 000000000000..17ddcd815057
--- /dev/null
+++ b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int32_t.generated.cpp
@@ -0,0 +1,30 @@
+// 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"
+#include "bitonic_sort.AVX2.int32_t.generated.h"
+
+using namespace vxsort;
+
+void vxsort::smallsort::bitonic::sort(int32_t *ptr, size_t length) {
+ const int N = 8;
+
+ switch(length / N) {
+ case 1: sort_01v(ptr); break;
+ case 2: sort_02v(ptr); break;
+ case 3: sort_03v(ptr); break;
+ case 4: sort_04v(ptr); break;
+ case 5: sort_05v(ptr); break;
+ case 6: sort_06v(ptr); break;
+ case 7: sort_07v(ptr); break;
+ case 8: sort_08v(ptr); break;
+ case 9: sort_09v(ptr); break;
+ case 10: sort_10v(ptr); break;
+ case 11: sort_11v(ptr); break;
+ case 12: sort_12v(ptr); break;
+ case 13: sort_13v(ptr); break;
+ case 14: sort_14v(ptr); break;
+ case 15: sort_15v(ptr); break;
+ case 16: sort_16v(ptr); break;
+ }
+}
diff --git a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int32_t.generated.h b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int32_t.generated.h
new file mode 100644
index 000000000000..79bdbcc870d4
--- /dev/null
+++ b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int32_t.generated.h
@@ -0,0 +1,1530 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+/////////////////////////////////////////////////////////////////////////////
+////
+// This file was auto-generated by a tool at 2020-06-22 05:27:48
+//
+// It is recommended you DO NOT directly edit this file but instead edit
+// the code-generator that generated this source file instead.
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BITONIC_SORT_AVX2_INT32_T_H
+#define BITONIC_SORT_AVX2_INT32_T_H
+
+#ifdef __GNUC__
+#ifdef __clang__
+#pragma clang attribute push (__attribute__((target("avx2"))), apply_to = any(function))
+#else
+#pragma GCC push_options
+#pragma GCC target("avx2")
+#endif
+#endif
+
+#include
+#include "bitonic_sort.h"
+
+#define i2d _mm256_castsi256_pd
+#define d2i _mm256_castpd_si256
+#define i2s _mm256_castsi256_ps
+#define s2i _mm256_castps_si256
+#define s2d _mm256_castps_pd
+#define d2s _mm256_castpd_ps
+
+namespace vxsort {
+namespace smallsort {
+template<> struct bitonic {
+public:
+
+ static INLINE void sort_01v_ascending(__m256i& d01) {
+ __m256i min, max, s;
+
+ s = _mm256_shuffle_epi32(d01, 0xB1);
+
+ min = _mm256_min_epi32(s, d01);
+ max = _mm256_max_epi32(s, d01);
+ d01 = _mm256_blend_epi32(min, max, 0xAA);
+
+ s = _mm256_shuffle_epi32(d01, 0x1B);
+
+ min = _mm256_min_epi32(s, d01);
+ max = _mm256_max_epi32(s, d01);
+ d01 = _mm256_blend_epi32(min, max, 0xCC);
+
+ s = _mm256_shuffle_epi32(d01, 0xB1);
+
+ min = _mm256_min_epi32(s, d01);
+ max = _mm256_max_epi32(s, d01);
+ d01 = _mm256_blend_epi32(min, max, 0xAA);
+
+ s = d2i(_mm256_permute4x64_pd(i2d(_mm256_shuffle_epi32(d01, 0x1B)), 0x4E));
+ min = _mm256_min_epi32(s, d01);
+ max = _mm256_max_epi32(s, d01);
+ d01 = _mm256_blend_epi32(min, max, 0xF0);
+
+ s = _mm256_shuffle_epi32(d01, 0x4E);
+ min = _mm256_min_epi32(s, d01);
+ max = _mm256_max_epi32(s, d01);
+ d01 = _mm256_blend_epi32(min, max, 0xCC);
+
+ s = _mm256_shuffle_epi32(d01, 0xB1);
+ min = _mm256_min_epi32(s, d01);
+ max = _mm256_max_epi32(s, d01);
+ d01 = _mm256_blend_epi32(min, max, 0xAA);
+}
+ static INLINE void sort_01v_merge_ascending(__m256i& d01) {
+ __m256i min, max, s;
+
+ s = d2i(_mm256_permute4x64_pd(i2d(d01), 0x4E));
+ min = _mm256_min_epi32(s, d01);
+ max = _mm256_max_epi32(s, d01);
+ d01 = _mm256_blend_epi32(min, max, 0xF0);
+
+ s = _mm256_shuffle_epi32(d01, 0x4E);
+
+ min = _mm256_min_epi32(s, d01);
+ max = _mm256_max_epi32(s, d01);
+ d01 = _mm256_blend_epi32(min, max, 0xCC);
+
+ s = _mm256_shuffle_epi32(d01, 0xB1);
+
+ min = _mm256_min_epi32(s, d01);
+ max = _mm256_max_epi32(s, d01);
+ d01 = _mm256_blend_epi32(min, max, 0xAA);
+ }
+ static INLINE void sort_01v_descending(__m256i& d01) {
+ __m256i min, max, s;
+
+ s = _mm256_shuffle_epi32(d01, 0xB1);
+
+ min = _mm256_min_epi32(s, d01);
+ max = _mm256_max_epi32(s, d01);
+ d01 = _mm256_blend_epi32(max, min, 0xAA);
+
+ s = _mm256_shuffle_epi32(d01, 0x1B);
+
+ min = _mm256_min_epi32(s, d01);
+ max = _mm256_max_epi32(s, d01);
+ d01 = _mm256_blend_epi32(max, min, 0xCC);
+
+ s = _mm256_shuffle_epi32(d01, 0xB1);
+
+ min = _mm256_min_epi32(s, d01);
+ max = _mm256_max_epi32(s, d01);
+ d01 = _mm256_blend_epi32(max, min, 0xAA);
+
+ s = d2i(_mm256_permute4x64_pd(i2d(_mm256_shuffle_epi32(d01, 0x1B)), 0x4E));
+ min = _mm256_min_epi32(s, d01);
+ max = _mm256_max_epi32(s, d01);
+ d01 = _mm256_blend_epi32(max, min, 0xF0);
+
+ s = _mm256_shuffle_epi32(d01, 0x4E);
+ min = _mm256_min_epi32(s, d01);
+ max = _mm256_max_epi32(s, d01);
+ d01 = _mm256_blend_epi32(max, min, 0xCC);
+
+ s = _mm256_shuffle_epi32(d01, 0xB1);
+ min = _mm256_min_epi32(s, d01);
+ max = _mm256_max_epi32(s, d01);
+ d01 = _mm256_blend_epi32(max, min, 0xAA);
+}
+ static INLINE void sort_01v_merge_descending(__m256i& d01) {
+ __m256i min, max, s;
+
+ s = d2i(_mm256_permute4x64_pd(i2d(d01), 0x4E));
+ min = _mm256_min_epi32(s, d01);
+ max = _mm256_max_epi32(s, d01);
+ d01 = _mm256_blend_epi32(max, min, 0xF0);
+
+ s = _mm256_shuffle_epi32(d01, 0x4E);
+
+ min = _mm256_min_epi32(s, d01);
+ max = _mm256_max_epi32(s, d01);
+ d01 = _mm256_blend_epi32(max, min, 0xCC);
+
+ s = _mm256_shuffle_epi32(d01, 0xB1);
+
+ min = _mm256_min_epi32(s, d01);
+ max = _mm256_max_epi32(s, d01);
+ d01 = _mm256_blend_epi32(max, min, 0xAA);
+ }
+ static INLINE void sort_02v_ascending(__m256i& d01, __m256i& d02) {
+ __m256i tmp;
+
+ sort_01v_ascending(d01);
+ sort_01v_descending(d02);
+
+ tmp = d02;
+
+ d02 = _mm256_max_epi32(d01, d02);
+ d01 = _mm256_min_epi32(d01, tmp);
+
+ sort_01v_merge_ascending(d01);
+ sort_01v_merge_ascending(d02);
+ }
+ static INLINE void sort_02v_descending(__m256i& d01, __m256i& d02) {
+ __m256i tmp;
+
+ sort_01v_descending(d01);
+ sort_01v_ascending(d02);
+
+ tmp = d02;
+
+ d02 = _mm256_max_epi32(d01, d02);
+ d01 = _mm256_min_epi32(d01, tmp);
+
+ sort_01v_merge_descending(d01);
+ sort_01v_merge_descending(d02);
+ }
+ static INLINE void sort_02v_merge_ascending(__m256i& d01, __m256i& d02) {
+ __m256i tmp;
+
+ tmp = d01;
+
+ d01 = _mm256_min_epi32(d02, d01);
+
+ d02 = _mm256_max_epi32(d02, tmp);
+
+ sort_01v_merge_ascending(d01);
+ sort_01v_merge_ascending(d02);
+ }
+ static INLINE void sort_02v_merge_descending(__m256i& d01, __m256i& d02) {
+ __m256i tmp;
+
+ tmp = d01;
+
+ d01 = _mm256_min_epi32(d02, d01);
+
+ d02 = _mm256_max_epi32(d02, tmp);
+
+ sort_01v_merge_descending(d01);
+ sort_01v_merge_descending(d02);
+ }
+ static INLINE void sort_03v_ascending(__m256i& d01, __m256i& d02, __m256i& d03) {
+ __m256i tmp;
+
+ sort_02v_ascending(d01, d02);
+ sort_01v_descending(d03);
+
+ tmp = d03;
+
+ d03 = _mm256_max_epi32(d02, d03);
+ d02 = _mm256_min_epi32(d02, tmp);
+
+ sort_02v_merge_ascending(d01, d02);
+ sort_01v_merge_ascending(d03);
+ }
+ static INLINE void sort_03v_descending(__m256i& d01, __m256i& d02, __m256i& d03) {
+ __m256i tmp;
+
+ sort_02v_descending(d01, d02);
+ sort_01v_ascending(d03);
+
+ tmp = d03;
+
+ d03 = _mm256_max_epi32(d02, d03);
+ d02 = _mm256_min_epi32(d02, tmp);
+
+ sort_02v_merge_descending(d01, d02);
+ sort_01v_merge_descending(d03);
+ }
+ static INLINE void sort_03v_merge_ascending(__m256i& d01, __m256i& d02, __m256i& d03) {
+ __m256i tmp;
+
+ tmp = d01;
+
+ d01 = _mm256_min_epi32(d03, d01);
+
+ d03 = _mm256_max_epi32(d03, tmp);
+
+ sort_02v_merge_ascending(d01, d02);
+ sort_01v_merge_ascending(d03);
+ }
+ static INLINE void sort_03v_merge_descending(__m256i& d01, __m256i& d02, __m256i& d03) {
+ __m256i tmp;
+
+ tmp = d01;
+
+ d01 = _mm256_min_epi32(d03, d01);
+
+ d03 = _mm256_max_epi32(d03, tmp);
+
+ sort_02v_merge_descending(d01, d02);
+ sort_01v_merge_descending(d03);
+ }
+ static INLINE void sort_04v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04) {
+ __m256i tmp;
+
+ sort_02v_ascending(d01, d02);
+ sort_02v_descending(d03, d04);
+
+ tmp = d03;
+
+ d03 = _mm256_max_epi32(d02, d03);
+ d02 = _mm256_min_epi32(d02, tmp);
+
+ tmp = d04;
+
+ d04 = _mm256_max_epi32(d01, d04);
+ d01 = _mm256_min_epi32(d01, tmp);
+
+ sort_02v_merge_ascending(d01, d02);
+ sort_02v_merge_ascending(d03, d04);
+ }
+ static INLINE void sort_04v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04) {
+ __m256i tmp;
+
+ sort_02v_descending(d01, d02);
+ sort_02v_ascending(d03, d04);
+
+ tmp = d03;
+
+ d03 = _mm256_max_epi32(d02, d03);
+ d02 = _mm256_min_epi32(d02, tmp);
+
+ tmp = d04;
+
+ d04 = _mm256_max_epi32(d01, d04);
+ d01 = _mm256_min_epi32(d01, tmp);
+
+ sort_02v_merge_descending(d01, d02);
+ sort_02v_merge_descending(d03, d04);
+ }
+ static INLINE void sort_04v_merge_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04) {
+ __m256i tmp;
+
+ tmp = d01;
+
+ d01 = _mm256_min_epi32(d03, d01);
+
+ d03 = _mm256_max_epi32(d03, tmp);
+
+ tmp = d02;
+
+ d02 = _mm256_min_epi32(d04, d02);
+
+ d04 = _mm256_max_epi32(d04, tmp);
+
+ sort_02v_merge_ascending(d01, d02);
+ sort_02v_merge_ascending(d03, d04);
+ }
+ static INLINE void sort_04v_merge_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04) {
+ __m256i tmp;
+
+ tmp = d01;
+
+ d01 = _mm256_min_epi32(d03, d01);
+
+ d03 = _mm256_max_epi32(d03, tmp);
+
+ tmp = d02;
+
+ d02 = _mm256_min_epi32(d04, d02);
+
+ d04 = _mm256_max_epi32(d04, tmp);
+
+ sort_02v_merge_descending(d01, d02);
+ sort_02v_merge_descending(d03, d04);
+ }
+ static INLINE void sort_05v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05) {
+ __m256i tmp;
+
+ sort_04v_ascending(d01, d02, d03, d04);
+ sort_01v_descending(d05);
+
+ tmp = d05;
+
+ d05 = _mm256_max_epi32(d04, d05);
+ d04 = _mm256_min_epi32(d04, tmp);
+
+ sort_04v_merge_ascending(d01, d02, d03, d04);
+ sort_01v_merge_ascending(d05);
+ }
+ static INLINE void sort_05v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05) {
+ __m256i tmp;
+
+ sort_04v_descending(d01, d02, d03, d04);
+ sort_01v_ascending(d05);
+
+ tmp = d05;
+
+ d05 = _mm256_max_epi32(d04, d05);
+ d04 = _mm256_min_epi32(d04, tmp);
+
+ sort_04v_merge_descending(d01, d02, d03, d04);
+ sort_01v_merge_descending(d05);
+ }
+ static INLINE void sort_05v_merge_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05) {
+ __m256i tmp;
+
+ tmp = d01;
+
+ d01 = _mm256_min_epi32(d05, d01);
+
+ d05 = _mm256_max_epi32(d05, tmp);
+
+ sort_04v_merge_ascending(d01, d02, d03, d04);
+ sort_01v_merge_ascending(d05);
+ }
+ static INLINE void sort_05v_merge_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05) {
+ __m256i tmp;
+
+ tmp = d01;
+
+ d01 = _mm256_min_epi32(d05, d01);
+
+ d05 = _mm256_max_epi32(d05, tmp);
+
+ sort_04v_merge_descending(d01, d02, d03, d04);
+ sort_01v_merge_descending(d05);
+ }
+ static INLINE void sort_06v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06) {
+ __m256i tmp;
+
+ sort_04v_ascending(d01, d02, d03, d04);
+ sort_02v_descending(d05, d06);
+
+ tmp = d05;
+
+ d05 = _mm256_max_epi32(d04, d05);
+ d04 = _mm256_min_epi32(d04, tmp);
+
+ tmp = d06;
+
+ d06 = _mm256_max_epi32(d03, d06);
+ d03 = _mm256_min_epi32(d03, tmp);
+
+ sort_04v_merge_ascending(d01, d02, d03, d04);
+ sort_02v_merge_ascending(d05, d06);
+ }
+ static INLINE void sort_06v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06) {
+ __m256i tmp;
+
+ sort_04v_descending(d01, d02, d03, d04);
+ sort_02v_ascending(d05, d06);
+
+ tmp = d05;
+
+ d05 = _mm256_max_epi32(d04, d05);
+ d04 = _mm256_min_epi32(d04, tmp);
+
+ tmp = d06;
+
+ d06 = _mm256_max_epi32(d03, d06);
+ d03 = _mm256_min_epi32(d03, tmp);
+
+ sort_04v_merge_descending(d01, d02, d03, d04);
+ sort_02v_merge_descending(d05, d06);
+ }
+ static INLINE void sort_06v_merge_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06) {
+ __m256i tmp;
+
+ tmp = d01;
+
+ d01 = _mm256_min_epi32(d05, d01);
+
+ d05 = _mm256_max_epi32(d05, tmp);
+
+ tmp = d02;
+
+ d02 = _mm256_min_epi32(d06, d02);
+
+ d06 = _mm256_max_epi32(d06, tmp);
+
+ sort_04v_merge_ascending(d01, d02, d03, d04);
+ sort_02v_merge_ascending(d05, d06);
+ }
+ static INLINE void sort_06v_merge_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06) {
+ __m256i tmp;
+
+ tmp = d01;
+
+ d01 = _mm256_min_epi32(d05, d01);
+
+ d05 = _mm256_max_epi32(d05, tmp);
+
+ tmp = d02;
+
+ d02 = _mm256_min_epi32(d06, d02);
+
+ d06 = _mm256_max_epi32(d06, tmp);
+
+ sort_04v_merge_descending(d01, d02, d03, d04);
+ sort_02v_merge_descending(d05, d06);
+ }
+ static INLINE void sort_07v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07) {
+ __m256i tmp;
+
+ sort_04v_ascending(d01, d02, d03, d04);
+ sort_03v_descending(d05, d06, d07);
+
+ tmp = d05;
+
+ d05 = _mm256_max_epi32(d04, d05);
+ d04 = _mm256_min_epi32(d04, tmp);
+
+ tmp = d06;
+
+ d06 = _mm256_max_epi32(d03, d06);
+ d03 = _mm256_min_epi32(d03, tmp);
+
+ tmp = d07;
+
+ d07 = _mm256_max_epi32(d02, d07);
+ d02 = _mm256_min_epi32(d02, tmp);
+
+ sort_04v_merge_ascending(d01, d02, d03, d04);
+ sort_03v_merge_ascending(d05, d06, d07);
+ }
+ static INLINE void sort_07v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07) {
+ __m256i tmp;
+
+ sort_04v_descending(d01, d02, d03, d04);
+ sort_03v_ascending(d05, d06, d07);
+
+ tmp = d05;
+
+ d05 = _mm256_max_epi32(d04, d05);
+ d04 = _mm256_min_epi32(d04, tmp);
+
+ tmp = d06;
+
+ d06 = _mm256_max_epi32(d03, d06);
+ d03 = _mm256_min_epi32(d03, tmp);
+
+ tmp = d07;
+
+ d07 = _mm256_max_epi32(d02, d07);
+ d02 = _mm256_min_epi32(d02, tmp);
+
+ sort_04v_merge_descending(d01, d02, d03, d04);
+ sort_03v_merge_descending(d05, d06, d07);
+ }
+ static INLINE void sort_07v_merge_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07) {
+ __m256i tmp;
+
+ tmp = d01;
+
+ d01 = _mm256_min_epi32(d05, d01);
+
+ d05 = _mm256_max_epi32(d05, tmp);
+
+ tmp = d02;
+
+ d02 = _mm256_min_epi32(d06, d02);
+
+ d06 = _mm256_max_epi32(d06, tmp);
+
+ tmp = d03;
+
+ d03 = _mm256_min_epi32(d07, d03);
+
+ d07 = _mm256_max_epi32(d07, tmp);
+
+ sort_04v_merge_ascending(d01, d02, d03, d04);
+ sort_03v_merge_ascending(d05, d06, d07);
+ }
+ static INLINE void sort_07v_merge_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07) {
+ __m256i tmp;
+
+ tmp = d01;
+
+ d01 = _mm256_min_epi32(d05, d01);
+
+ d05 = _mm256_max_epi32(d05, tmp);
+
+ tmp = d02;
+
+ d02 = _mm256_min_epi32(d06, d02);
+
+ d06 = _mm256_max_epi32(d06, tmp);
+
+ tmp = d03;
+
+ d03 = _mm256_min_epi32(d07, d03);
+
+ d07 = _mm256_max_epi32(d07, tmp);
+
+ sort_04v_merge_descending(d01, d02, d03, d04);
+ sort_03v_merge_descending(d05, d06, d07);
+ }
+ static INLINE void sort_08v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08) {
+ __m256i tmp;
+
+ sort_04v_ascending(d01, d02, d03, d04);
+ sort_04v_descending(d05, d06, d07, d08);
+
+ tmp = d05;
+
+ d05 = _mm256_max_epi32(d04, d05);
+ d04 = _mm256_min_epi32(d04, tmp);
+
+ tmp = d06;
+
+ d06 = _mm256_max_epi32(d03, d06);
+ d03 = _mm256_min_epi32(d03, tmp);
+
+ tmp = d07;
+
+ d07 = _mm256_max_epi32(d02, d07);
+ d02 = _mm256_min_epi32(d02, tmp);
+
+ tmp = d08;
+
+ d08 = _mm256_max_epi32(d01, d08);
+ d01 = _mm256_min_epi32(d01, tmp);
+
+ sort_04v_merge_ascending(d01, d02, d03, d04);
+ sort_04v_merge_ascending(d05, d06, d07, d08);
+ }
+ static INLINE void sort_08v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08) {
+ __m256i tmp;
+
+ sort_04v_descending(d01, d02, d03, d04);
+ sort_04v_ascending(d05, d06, d07, d08);
+
+ tmp = d05;
+
+ d05 = _mm256_max_epi32(d04, d05);
+ d04 = _mm256_min_epi32(d04, tmp);
+
+ tmp = d06;
+
+ d06 = _mm256_max_epi32(d03, d06);
+ d03 = _mm256_min_epi32(d03, tmp);
+
+ tmp = d07;
+
+ d07 = _mm256_max_epi32(d02, d07);
+ d02 = _mm256_min_epi32(d02, tmp);
+
+ tmp = d08;
+
+ d08 = _mm256_max_epi32(d01, d08);
+ d01 = _mm256_min_epi32(d01, tmp);
+
+ sort_04v_merge_descending(d01, d02, d03, d04);
+ sort_04v_merge_descending(d05, d06, d07, d08);
+ }
+ static INLINE void sort_08v_merge_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08) {
+ __m256i tmp;
+
+ tmp = d01;
+
+ d01 = _mm256_min_epi32(d05, d01);
+
+ d05 = _mm256_max_epi32(d05, tmp);
+
+ tmp = d02;
+
+ d02 = _mm256_min_epi32(d06, d02);
+
+ d06 = _mm256_max_epi32(d06, tmp);
+
+ tmp = d03;
+
+ d03 = _mm256_min_epi32(d07, d03);
+
+ d07 = _mm256_max_epi32(d07, tmp);
+
+ tmp = d04;
+
+ d04 = _mm256_min_epi32(d08, d04);
+
+ d08 = _mm256_max_epi32(d08, tmp);
+
+ sort_04v_merge_ascending(d01, d02, d03, d04);
+ sort_04v_merge_ascending(d05, d06, d07, d08);
+ }
+ static INLINE void sort_08v_merge_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08) {
+ __m256i tmp;
+
+ tmp = d01;
+
+ d01 = _mm256_min_epi32(d05, d01);
+
+ d05 = _mm256_max_epi32(d05, tmp);
+
+ tmp = d02;
+
+ d02 = _mm256_min_epi32(d06, d02);
+
+ d06 = _mm256_max_epi32(d06, tmp);
+
+ tmp = d03;
+
+ d03 = _mm256_min_epi32(d07, d03);
+
+ d07 = _mm256_max_epi32(d07, tmp);
+
+ tmp = d04;
+
+ d04 = _mm256_min_epi32(d08, d04);
+
+ d08 = _mm256_max_epi32(d08, tmp);
+
+ sort_04v_merge_descending(d01, d02, d03, d04);
+ sort_04v_merge_descending(d05, d06, d07, d08);
+ }
+ static INLINE void sort_09v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09) {
+ __m256i tmp;
+
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_01v_descending(d09);
+
+ tmp = d09;
+
+ d09 = _mm256_max_epi32(d08, d09);
+ d08 = _mm256_min_epi32(d08, tmp);
+
+ sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_01v_merge_ascending(d09);
+ }
+ static INLINE void sort_09v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09) {
+ __m256i tmp;
+
+ sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_01v_ascending(d09);
+
+ tmp = d09;
+
+ d09 = _mm256_max_epi32(d08, d09);
+ d08 = _mm256_min_epi32(d08, tmp);
+
+ sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_01v_merge_descending(d09);
+ }
+ static INLINE void sort_10v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10) {
+ __m256i tmp;
+
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_02v_descending(d09, d10);
+
+ tmp = d09;
+
+ d09 = _mm256_max_epi32(d08, d09);
+ d08 = _mm256_min_epi32(d08, tmp);
+
+ tmp = d10;
+
+ d10 = _mm256_max_epi32(d07, d10);
+ d07 = _mm256_min_epi32(d07, tmp);
+
+ sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_02v_merge_ascending(d09, d10);
+ }
+ static INLINE void sort_10v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10) {
+ __m256i tmp;
+
+ sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_02v_ascending(d09, d10);
+
+ tmp = d09;
+
+ d09 = _mm256_max_epi32(d08, d09);
+ d08 = _mm256_min_epi32(d08, tmp);
+
+ tmp = d10;
+
+ d10 = _mm256_max_epi32(d07, d10);
+ d07 = _mm256_min_epi32(d07, tmp);
+
+ sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_02v_merge_descending(d09, d10);
+ }
+ static INLINE void sort_11v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11) {
+ __m256i tmp;
+
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_03v_descending(d09, d10, d11);
+
+ tmp = d09;
+
+ d09 = _mm256_max_epi32(d08, d09);
+ d08 = _mm256_min_epi32(d08, tmp);
+
+ tmp = d10;
+
+ d10 = _mm256_max_epi32(d07, d10);
+ d07 = _mm256_min_epi32(d07, tmp);
+
+ tmp = d11;
+
+ d11 = _mm256_max_epi32(d06, d11);
+ d06 = _mm256_min_epi32(d06, tmp);
+
+ sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_03v_merge_ascending(d09, d10, d11);
+ }
+ static INLINE void sort_11v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11) {
+ __m256i tmp;
+
+ sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_03v_ascending(d09, d10, d11);
+
+ tmp = d09;
+
+ d09 = _mm256_max_epi32(d08, d09);
+ d08 = _mm256_min_epi32(d08, tmp);
+
+ tmp = d10;
+
+ d10 = _mm256_max_epi32(d07, d10);
+ d07 = _mm256_min_epi32(d07, tmp);
+
+ tmp = d11;
+
+ d11 = _mm256_max_epi32(d06, d11);
+ d06 = _mm256_min_epi32(d06, tmp);
+
+ sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_03v_merge_descending(d09, d10, d11);
+ }
+ static INLINE void sort_12v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12) {
+ __m256i tmp;
+
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_04v_descending(d09, d10, d11, d12);
+
+ tmp = d09;
+
+ d09 = _mm256_max_epi32(d08, d09);
+ d08 = _mm256_min_epi32(d08, tmp);
+
+ tmp = d10;
+
+ d10 = _mm256_max_epi32(d07, d10);
+ d07 = _mm256_min_epi32(d07, tmp);
+
+ tmp = d11;
+
+ d11 = _mm256_max_epi32(d06, d11);
+ d06 = _mm256_min_epi32(d06, tmp);
+
+ tmp = d12;
+
+ d12 = _mm256_max_epi32(d05, d12);
+ d05 = _mm256_min_epi32(d05, tmp);
+
+ sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_04v_merge_ascending(d09, d10, d11, d12);
+ }
+ static INLINE void sort_12v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12) {
+ __m256i tmp;
+
+ sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_04v_ascending(d09, d10, d11, d12);
+
+ tmp = d09;
+
+ d09 = _mm256_max_epi32(d08, d09);
+ d08 = _mm256_min_epi32(d08, tmp);
+
+ tmp = d10;
+
+ d10 = _mm256_max_epi32(d07, d10);
+ d07 = _mm256_min_epi32(d07, tmp);
+
+ tmp = d11;
+
+ d11 = _mm256_max_epi32(d06, d11);
+ d06 = _mm256_min_epi32(d06, tmp);
+
+ tmp = d12;
+
+ d12 = _mm256_max_epi32(d05, d12);
+ d05 = _mm256_min_epi32(d05, tmp);
+
+ sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_04v_merge_descending(d09, d10, d11, d12);
+ }
+ static INLINE void sort_13v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13) {
+ __m256i tmp;
+
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_05v_descending(d09, d10, d11, d12, d13);
+
+ tmp = d09;
+
+ d09 = _mm256_max_epi32(d08, d09);
+ d08 = _mm256_min_epi32(d08, tmp);
+
+ tmp = d10;
+
+ d10 = _mm256_max_epi32(d07, d10);
+ d07 = _mm256_min_epi32(d07, tmp);
+
+ tmp = d11;
+
+ d11 = _mm256_max_epi32(d06, d11);
+ d06 = _mm256_min_epi32(d06, tmp);
+
+ tmp = d12;
+
+ d12 = _mm256_max_epi32(d05, d12);
+ d05 = _mm256_min_epi32(d05, tmp);
+
+ tmp = d13;
+
+ d13 = _mm256_max_epi32(d04, d13);
+ d04 = _mm256_min_epi32(d04, tmp);
+
+ sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_05v_merge_ascending(d09, d10, d11, d12, d13);
+ }
+ static INLINE void sort_13v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13) {
+ __m256i tmp;
+
+ sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_05v_ascending(d09, d10, d11, d12, d13);
+
+ tmp = d09;
+
+ d09 = _mm256_max_epi32(d08, d09);
+ d08 = _mm256_min_epi32(d08, tmp);
+
+ tmp = d10;
+
+ d10 = _mm256_max_epi32(d07, d10);
+ d07 = _mm256_min_epi32(d07, tmp);
+
+ tmp = d11;
+
+ d11 = _mm256_max_epi32(d06, d11);
+ d06 = _mm256_min_epi32(d06, tmp);
+
+ tmp = d12;
+
+ d12 = _mm256_max_epi32(d05, d12);
+ d05 = _mm256_min_epi32(d05, tmp);
+
+ tmp = d13;
+
+ d13 = _mm256_max_epi32(d04, d13);
+ d04 = _mm256_min_epi32(d04, tmp);
+
+ sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_05v_merge_descending(d09, d10, d11, d12, d13);
+ }
+ static INLINE void sort_14v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13, __m256i& d14) {
+ __m256i tmp;
+
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_06v_descending(d09, d10, d11, d12, d13, d14);
+
+ tmp = d09;
+
+ d09 = _mm256_max_epi32(d08, d09);
+ d08 = _mm256_min_epi32(d08, tmp);
+
+ tmp = d10;
+
+ d10 = _mm256_max_epi32(d07, d10);
+ d07 = _mm256_min_epi32(d07, tmp);
+
+ tmp = d11;
+
+ d11 = _mm256_max_epi32(d06, d11);
+ d06 = _mm256_min_epi32(d06, tmp);
+
+ tmp = d12;
+
+ d12 = _mm256_max_epi32(d05, d12);
+ d05 = _mm256_min_epi32(d05, tmp);
+
+ tmp = d13;
+
+ d13 = _mm256_max_epi32(d04, d13);
+ d04 = _mm256_min_epi32(d04, tmp);
+
+ tmp = d14;
+
+ d14 = _mm256_max_epi32(d03, d14);
+ d03 = _mm256_min_epi32(d03, tmp);
+
+ sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_06v_merge_ascending(d09, d10, d11, d12, d13, d14);
+ }
+ static INLINE void sort_14v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13, __m256i& d14) {
+ __m256i tmp;
+
+ sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_06v_ascending(d09, d10, d11, d12, d13, d14);
+
+ tmp = d09;
+
+ d09 = _mm256_max_epi32(d08, d09);
+ d08 = _mm256_min_epi32(d08, tmp);
+
+ tmp = d10;
+
+ d10 = _mm256_max_epi32(d07, d10);
+ d07 = _mm256_min_epi32(d07, tmp);
+
+ tmp = d11;
+
+ d11 = _mm256_max_epi32(d06, d11);
+ d06 = _mm256_min_epi32(d06, tmp);
+
+ tmp = d12;
+
+ d12 = _mm256_max_epi32(d05, d12);
+ d05 = _mm256_min_epi32(d05, tmp);
+
+ tmp = d13;
+
+ d13 = _mm256_max_epi32(d04, d13);
+ d04 = _mm256_min_epi32(d04, tmp);
+
+ tmp = d14;
+
+ d14 = _mm256_max_epi32(d03, d14);
+ d03 = _mm256_min_epi32(d03, tmp);
+
+ sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_06v_merge_descending(d09, d10, d11, d12, d13, d14);
+ }
+ static INLINE void sort_15v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13, __m256i& d14, __m256i& d15) {
+ __m256i tmp;
+
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_07v_descending(d09, d10, d11, d12, d13, d14, d15);
+
+ tmp = d09;
+
+ d09 = _mm256_max_epi32(d08, d09);
+ d08 = _mm256_min_epi32(d08, tmp);
+
+ tmp = d10;
+
+ d10 = _mm256_max_epi32(d07, d10);
+ d07 = _mm256_min_epi32(d07, tmp);
+
+ tmp = d11;
+
+ d11 = _mm256_max_epi32(d06, d11);
+ d06 = _mm256_min_epi32(d06, tmp);
+
+ tmp = d12;
+
+ d12 = _mm256_max_epi32(d05, d12);
+ d05 = _mm256_min_epi32(d05, tmp);
+
+ tmp = d13;
+
+ d13 = _mm256_max_epi32(d04, d13);
+ d04 = _mm256_min_epi32(d04, tmp);
+
+ tmp = d14;
+
+ d14 = _mm256_max_epi32(d03, d14);
+ d03 = _mm256_min_epi32(d03, tmp);
+
+ tmp = d15;
+
+ d15 = _mm256_max_epi32(d02, d15);
+ d02 = _mm256_min_epi32(d02, tmp);
+
+ sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_07v_merge_ascending(d09, d10, d11, d12, d13, d14, d15);
+ }
+ static INLINE void sort_15v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13, __m256i& d14, __m256i& d15) {
+ __m256i tmp;
+
+ sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_07v_ascending(d09, d10, d11, d12, d13, d14, d15);
+
+ tmp = d09;
+
+ d09 = _mm256_max_epi32(d08, d09);
+ d08 = _mm256_min_epi32(d08, tmp);
+
+ tmp = d10;
+
+ d10 = _mm256_max_epi32(d07, d10);
+ d07 = _mm256_min_epi32(d07, tmp);
+
+ tmp = d11;
+
+ d11 = _mm256_max_epi32(d06, d11);
+ d06 = _mm256_min_epi32(d06, tmp);
+
+ tmp = d12;
+
+ d12 = _mm256_max_epi32(d05, d12);
+ d05 = _mm256_min_epi32(d05, tmp);
+
+ tmp = d13;
+
+ d13 = _mm256_max_epi32(d04, d13);
+ d04 = _mm256_min_epi32(d04, tmp);
+
+ tmp = d14;
+
+ d14 = _mm256_max_epi32(d03, d14);
+ d03 = _mm256_min_epi32(d03, tmp);
+
+ tmp = d15;
+
+ d15 = _mm256_max_epi32(d02, d15);
+ d02 = _mm256_min_epi32(d02, tmp);
+
+ sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_07v_merge_descending(d09, d10, d11, d12, d13, d14, d15);
+ }
+ static INLINE void sort_16v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13, __m256i& d14, __m256i& d15, __m256i& d16) {
+ __m256i tmp;
+
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_08v_descending(d09, d10, d11, d12, d13, d14, d15, d16);
+
+ tmp = d09;
+
+ d09 = _mm256_max_epi32(d08, d09);
+ d08 = _mm256_min_epi32(d08, tmp);
+
+ tmp = d10;
+
+ d10 = _mm256_max_epi32(d07, d10);
+ d07 = _mm256_min_epi32(d07, tmp);
+
+ tmp = d11;
+
+ d11 = _mm256_max_epi32(d06, d11);
+ d06 = _mm256_min_epi32(d06, tmp);
+
+ tmp = d12;
+
+ d12 = _mm256_max_epi32(d05, d12);
+ d05 = _mm256_min_epi32(d05, tmp);
+
+ tmp = d13;
+
+ d13 = _mm256_max_epi32(d04, d13);
+ d04 = _mm256_min_epi32(d04, tmp);
+
+ tmp = d14;
+
+ d14 = _mm256_max_epi32(d03, d14);
+ d03 = _mm256_min_epi32(d03, tmp);
+
+ tmp = d15;
+
+ d15 = _mm256_max_epi32(d02, d15);
+ d02 = _mm256_min_epi32(d02, tmp);
+
+ tmp = d16;
+
+ d16 = _mm256_max_epi32(d01, d16);
+ d01 = _mm256_min_epi32(d01, tmp);
+
+ sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_08v_merge_ascending(d09, d10, d11, d12, d13, d14, d15, d16);
+ }
+ static INLINE void sort_16v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13, __m256i& d14, __m256i& d15, __m256i& d16) {
+ __m256i tmp;
+
+ sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_08v_ascending(d09, d10, d11, d12, d13, d14, d15, d16);
+
+ tmp = d09;
+
+ d09 = _mm256_max_epi32(d08, d09);
+ d08 = _mm256_min_epi32(d08, tmp);
+
+ tmp = d10;
+
+ d10 = _mm256_max_epi32(d07, d10);
+ d07 = _mm256_min_epi32(d07, tmp);
+
+ tmp = d11;
+
+ d11 = _mm256_max_epi32(d06, d11);
+ d06 = _mm256_min_epi32(d06, tmp);
+
+ tmp = d12;
+
+ d12 = _mm256_max_epi32(d05, d12);
+ d05 = _mm256_min_epi32(d05, tmp);
+
+ tmp = d13;
+
+ d13 = _mm256_max_epi32(d04, d13);
+ d04 = _mm256_min_epi32(d04, tmp);
+
+ tmp = d14;
+
+ d14 = _mm256_max_epi32(d03, d14);
+ d03 = _mm256_min_epi32(d03, tmp);
+
+ tmp = d15;
+
+ d15 = _mm256_max_epi32(d02, d15);
+ d02 = _mm256_min_epi32(d02, tmp);
+
+ tmp = d16;
+
+ d16 = _mm256_max_epi32(d01, d16);
+ d01 = _mm256_min_epi32(d01, tmp);
+
+ sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_08v_merge_descending(d09, d10, d11, d12, d13, d14, d15, d16);
+ }
+
+ static NOINLINE void sort_01v(int32_t *ptr) {
+ __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);;
+ sort_01v_ascending(d01);
+ _mm256_storeu_si256((__m256i *) ptr + 0, d01);
+}
+
+ static NOINLINE void sort_02v(int32_t *ptr) {
+ __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);;
+ __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);;
+ sort_02v_ascending(d01, d02);
+ _mm256_storeu_si256((__m256i *) ptr + 0, d01);
+ _mm256_storeu_si256((__m256i *) ptr + 1, d02);
+}
+
+ static NOINLINE void sort_03v(int32_t *ptr) {
+ __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);;
+ __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);;
+ __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);;
+ sort_03v_ascending(d01, d02, d03);
+ _mm256_storeu_si256((__m256i *) ptr + 0, d01);
+ _mm256_storeu_si256((__m256i *) ptr + 1, d02);
+ _mm256_storeu_si256((__m256i *) ptr + 2, d03);
+}
+
+ static NOINLINE void sort_04v(int32_t *ptr) {
+ __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);;
+ __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);;
+ __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);;
+ __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);;
+ sort_04v_ascending(d01, d02, d03, d04);
+ _mm256_storeu_si256((__m256i *) ptr + 0, d01);
+ _mm256_storeu_si256((__m256i *) ptr + 1, d02);
+ _mm256_storeu_si256((__m256i *) ptr + 2, d03);
+ _mm256_storeu_si256((__m256i *) ptr + 3, d04);
+}
+
+ static NOINLINE void sort_05v(int32_t *ptr) {
+ __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);;
+ __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);;
+ __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);;
+ __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);;
+ __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);;
+ sort_05v_ascending(d01, d02, d03, d04, d05);
+ _mm256_storeu_si256((__m256i *) ptr + 0, d01);
+ _mm256_storeu_si256((__m256i *) ptr + 1, d02);
+ _mm256_storeu_si256((__m256i *) ptr + 2, d03);
+ _mm256_storeu_si256((__m256i *) ptr + 3, d04);
+ _mm256_storeu_si256((__m256i *) ptr + 4, d05);
+}
+
+ static NOINLINE void sort_06v(int32_t *ptr) {
+ __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);;
+ __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);;
+ __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);;
+ __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);;
+ __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);;
+ __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);;
+ sort_06v_ascending(d01, d02, d03, d04, d05, d06);
+ _mm256_storeu_si256((__m256i *) ptr + 0, d01);
+ _mm256_storeu_si256((__m256i *) ptr + 1, d02);
+ _mm256_storeu_si256((__m256i *) ptr + 2, d03);
+ _mm256_storeu_si256((__m256i *) ptr + 3, d04);
+ _mm256_storeu_si256((__m256i *) ptr + 4, d05);
+ _mm256_storeu_si256((__m256i *) ptr + 5, d06);
+}
+
+ static NOINLINE void sort_07v(int32_t *ptr) {
+ __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);;
+ __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);;
+ __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);;
+ __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);;
+ __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);;
+ __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);;
+ __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);;
+ sort_07v_ascending(d01, d02, d03, d04, d05, d06, d07);
+ _mm256_storeu_si256((__m256i *) ptr + 0, d01);
+ _mm256_storeu_si256((__m256i *) ptr + 1, d02);
+ _mm256_storeu_si256((__m256i *) ptr + 2, d03);
+ _mm256_storeu_si256((__m256i *) ptr + 3, d04);
+ _mm256_storeu_si256((__m256i *) ptr + 4, d05);
+ _mm256_storeu_si256((__m256i *) ptr + 5, d06);
+ _mm256_storeu_si256((__m256i *) ptr + 6, d07);
+}
+
+ static NOINLINE void sort_08v(int32_t *ptr) {
+ __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);;
+ __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);;
+ __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);;
+ __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);;
+ __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);;
+ __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);;
+ __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);;
+ __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);;
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ _mm256_storeu_si256((__m256i *) ptr + 0, d01);
+ _mm256_storeu_si256((__m256i *) ptr + 1, d02);
+ _mm256_storeu_si256((__m256i *) ptr + 2, d03);
+ _mm256_storeu_si256((__m256i *) ptr + 3, d04);
+ _mm256_storeu_si256((__m256i *) ptr + 4, d05);
+ _mm256_storeu_si256((__m256i *) ptr + 5, d06);
+ _mm256_storeu_si256((__m256i *) ptr + 6, d07);
+ _mm256_storeu_si256((__m256i *) ptr + 7, d08);
+}
+
+ static NOINLINE void sort_09v(int32_t *ptr) {
+ __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);;
+ __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);;
+ __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);;
+ __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);;
+ __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);;
+ __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);;
+ __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);;
+ __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);;
+ __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);;
+ sort_09v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09);
+ _mm256_storeu_si256((__m256i *) ptr + 0, d01);
+ _mm256_storeu_si256((__m256i *) ptr + 1, d02);
+ _mm256_storeu_si256((__m256i *) ptr + 2, d03);
+ _mm256_storeu_si256((__m256i *) ptr + 3, d04);
+ _mm256_storeu_si256((__m256i *) ptr + 4, d05);
+ _mm256_storeu_si256((__m256i *) ptr + 5, d06);
+ _mm256_storeu_si256((__m256i *) ptr + 6, d07);
+ _mm256_storeu_si256((__m256i *) ptr + 7, d08);
+ _mm256_storeu_si256((__m256i *) ptr + 8, d09);
+}
+
+ static NOINLINE void sort_10v(int32_t *ptr) {
+ __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);;
+ __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);;
+ __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);;
+ __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);;
+ __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);;
+ __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);;
+ __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);;
+ __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);;
+ __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);;
+ __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);;
+ sort_10v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10);
+ _mm256_storeu_si256((__m256i *) ptr + 0, d01);
+ _mm256_storeu_si256((__m256i *) ptr + 1, d02);
+ _mm256_storeu_si256((__m256i *) ptr + 2, d03);
+ _mm256_storeu_si256((__m256i *) ptr + 3, d04);
+ _mm256_storeu_si256((__m256i *) ptr + 4, d05);
+ _mm256_storeu_si256((__m256i *) ptr + 5, d06);
+ _mm256_storeu_si256((__m256i *) ptr + 6, d07);
+ _mm256_storeu_si256((__m256i *) ptr + 7, d08);
+ _mm256_storeu_si256((__m256i *) ptr + 8, d09);
+ _mm256_storeu_si256((__m256i *) ptr + 9, d10);
+}
+
+ static NOINLINE void sort_11v(int32_t *ptr) {
+ __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);;
+ __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);;
+ __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);;
+ __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);;
+ __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);;
+ __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);;
+ __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);;
+ __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);;
+ __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);;
+ __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);;
+ __m256i d11 = _mm256_lddqu_si256((__m256i const *) ptr + 10);;
+ sort_11v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11);
+ _mm256_storeu_si256((__m256i *) ptr + 0, d01);
+ _mm256_storeu_si256((__m256i *) ptr + 1, d02);
+ _mm256_storeu_si256((__m256i *) ptr + 2, d03);
+ _mm256_storeu_si256((__m256i *) ptr + 3, d04);
+ _mm256_storeu_si256((__m256i *) ptr + 4, d05);
+ _mm256_storeu_si256((__m256i *) ptr + 5, d06);
+ _mm256_storeu_si256((__m256i *) ptr + 6, d07);
+ _mm256_storeu_si256((__m256i *) ptr + 7, d08);
+ _mm256_storeu_si256((__m256i *) ptr + 8, d09);
+ _mm256_storeu_si256((__m256i *) ptr + 9, d10);
+ _mm256_storeu_si256((__m256i *) ptr + 10, d11);
+}
+
+ static NOINLINE void sort_12v(int32_t *ptr) {
+ __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);;
+ __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);;
+ __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);;
+ __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);;
+ __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);;
+ __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);;
+ __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);;
+ __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);;
+ __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);;
+ __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);;
+ __m256i d11 = _mm256_lddqu_si256((__m256i const *) ptr + 10);;
+ __m256i d12 = _mm256_lddqu_si256((__m256i const *) ptr + 11);;
+ sort_12v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12);
+ _mm256_storeu_si256((__m256i *) ptr + 0, d01);
+ _mm256_storeu_si256((__m256i *) ptr + 1, d02);
+ _mm256_storeu_si256((__m256i *) ptr + 2, d03);
+ _mm256_storeu_si256((__m256i *) ptr + 3, d04);
+ _mm256_storeu_si256((__m256i *) ptr + 4, d05);
+ _mm256_storeu_si256((__m256i *) ptr + 5, d06);
+ _mm256_storeu_si256((__m256i *) ptr + 6, d07);
+ _mm256_storeu_si256((__m256i *) ptr + 7, d08);
+ _mm256_storeu_si256((__m256i *) ptr + 8, d09);
+ _mm256_storeu_si256((__m256i *) ptr + 9, d10);
+ _mm256_storeu_si256((__m256i *) ptr + 10, d11);
+ _mm256_storeu_si256((__m256i *) ptr + 11, d12);
+}
+
+ static NOINLINE void sort_13v(int32_t *ptr) {
+ __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);;
+ __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);;
+ __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);;
+ __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);;
+ __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);;
+ __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);;
+ __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);;
+ __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);;
+ __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);;
+ __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);;
+ __m256i d11 = _mm256_lddqu_si256((__m256i const *) ptr + 10);;
+ __m256i d12 = _mm256_lddqu_si256((__m256i const *) ptr + 11);;
+ __m256i d13 = _mm256_lddqu_si256((__m256i const *) ptr + 12);;
+ sort_13v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13);
+ _mm256_storeu_si256((__m256i *) ptr + 0, d01);
+ _mm256_storeu_si256((__m256i *) ptr + 1, d02);
+ _mm256_storeu_si256((__m256i *) ptr + 2, d03);
+ _mm256_storeu_si256((__m256i *) ptr + 3, d04);
+ _mm256_storeu_si256((__m256i *) ptr + 4, d05);
+ _mm256_storeu_si256((__m256i *) ptr + 5, d06);
+ _mm256_storeu_si256((__m256i *) ptr + 6, d07);
+ _mm256_storeu_si256((__m256i *) ptr + 7, d08);
+ _mm256_storeu_si256((__m256i *) ptr + 8, d09);
+ _mm256_storeu_si256((__m256i *) ptr + 9, d10);
+ _mm256_storeu_si256((__m256i *) ptr + 10, d11);
+ _mm256_storeu_si256((__m256i *) ptr + 11, d12);
+ _mm256_storeu_si256((__m256i *) ptr + 12, d13);
+}
+
+ static NOINLINE void sort_14v(int32_t *ptr) {
+ __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);;
+ __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);;
+ __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);;
+ __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);;
+ __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);;
+ __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);;
+ __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);;
+ __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);;
+ __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);;
+ __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);;
+ __m256i d11 = _mm256_lddqu_si256((__m256i const *) ptr + 10);;
+ __m256i d12 = _mm256_lddqu_si256((__m256i const *) ptr + 11);;
+ __m256i d13 = _mm256_lddqu_si256((__m256i const *) ptr + 12);;
+ __m256i d14 = _mm256_lddqu_si256((__m256i const *) ptr + 13);;
+ sort_14v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14);
+ _mm256_storeu_si256((__m256i *) ptr + 0, d01);
+ _mm256_storeu_si256((__m256i *) ptr + 1, d02);
+ _mm256_storeu_si256((__m256i *) ptr + 2, d03);
+ _mm256_storeu_si256((__m256i *) ptr + 3, d04);
+ _mm256_storeu_si256((__m256i *) ptr + 4, d05);
+ _mm256_storeu_si256((__m256i *) ptr + 5, d06);
+ _mm256_storeu_si256((__m256i *) ptr + 6, d07);
+ _mm256_storeu_si256((__m256i *) ptr + 7, d08);
+ _mm256_storeu_si256((__m256i *) ptr + 8, d09);
+ _mm256_storeu_si256((__m256i *) ptr + 9, d10);
+ _mm256_storeu_si256((__m256i *) ptr + 10, d11);
+ _mm256_storeu_si256((__m256i *) ptr + 11, d12);
+ _mm256_storeu_si256((__m256i *) ptr + 12, d13);
+ _mm256_storeu_si256((__m256i *) ptr + 13, d14);
+}
+
+ static NOINLINE void sort_15v(int32_t *ptr) {
+ __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);;
+ __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);;
+ __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);;
+ __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);;
+ __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);;
+ __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);;
+ __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);;
+ __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);;
+ __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);;
+ __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);;
+ __m256i d11 = _mm256_lddqu_si256((__m256i const *) ptr + 10);;
+ __m256i d12 = _mm256_lddqu_si256((__m256i const *) ptr + 11);;
+ __m256i d13 = _mm256_lddqu_si256((__m256i const *) ptr + 12);;
+ __m256i d14 = _mm256_lddqu_si256((__m256i const *) ptr + 13);;
+ __m256i d15 = _mm256_lddqu_si256((__m256i const *) ptr + 14);;
+ sort_15v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14, d15);
+ _mm256_storeu_si256((__m256i *) ptr + 0, d01);
+ _mm256_storeu_si256((__m256i *) ptr + 1, d02);
+ _mm256_storeu_si256((__m256i *) ptr + 2, d03);
+ _mm256_storeu_si256((__m256i *) ptr + 3, d04);
+ _mm256_storeu_si256((__m256i *) ptr + 4, d05);
+ _mm256_storeu_si256((__m256i *) ptr + 5, d06);
+ _mm256_storeu_si256((__m256i *) ptr + 6, d07);
+ _mm256_storeu_si256((__m256i *) ptr + 7, d08);
+ _mm256_storeu_si256((__m256i *) ptr + 8, d09);
+ _mm256_storeu_si256((__m256i *) ptr + 9, d10);
+ _mm256_storeu_si256((__m256i *) ptr + 10, d11);
+ _mm256_storeu_si256((__m256i *) ptr + 11, d12);
+ _mm256_storeu_si256((__m256i *) ptr + 12, d13);
+ _mm256_storeu_si256((__m256i *) ptr + 13, d14);
+ _mm256_storeu_si256((__m256i *) ptr + 14, d15);
+}
+
+ static NOINLINE void sort_16v(int32_t *ptr) {
+ __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);;
+ __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);;
+ __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);;
+ __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);;
+ __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);;
+ __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);;
+ __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);;
+ __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);;
+ __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);;
+ __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);;
+ __m256i d11 = _mm256_lddqu_si256((__m256i const *) ptr + 10);;
+ __m256i d12 = _mm256_lddqu_si256((__m256i const *) ptr + 11);;
+ __m256i d13 = _mm256_lddqu_si256((__m256i const *) ptr + 12);;
+ __m256i d14 = _mm256_lddqu_si256((__m256i const *) ptr + 13);;
+ __m256i d15 = _mm256_lddqu_si256((__m256i const *) ptr + 14);;
+ __m256i d16 = _mm256_lddqu_si256((__m256i const *) ptr + 15);;
+ sort_16v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14, d15, d16);
+ _mm256_storeu_si256((__m256i *) ptr + 0, d01);
+ _mm256_storeu_si256((__m256i *) ptr + 1, d02);
+ _mm256_storeu_si256((__m256i *) ptr + 2, d03);
+ _mm256_storeu_si256((__m256i *) ptr + 3, d04);
+ _mm256_storeu_si256((__m256i *) ptr + 4, d05);
+ _mm256_storeu_si256((__m256i *) ptr + 5, d06);
+ _mm256_storeu_si256((__m256i *) ptr + 6, d07);
+ _mm256_storeu_si256((__m256i *) ptr + 7, d08);
+ _mm256_storeu_si256((__m256i *) ptr + 8, d09);
+ _mm256_storeu_si256((__m256i *) ptr + 9, d10);
+ _mm256_storeu_si256((__m256i *) ptr + 10, d11);
+ _mm256_storeu_si256((__m256i *) ptr + 11, d12);
+ _mm256_storeu_si256((__m256i *) ptr + 12, d13);
+ _mm256_storeu_si256((__m256i *) ptr + 13, d14);
+ _mm256_storeu_si256((__m256i *) ptr + 14, d15);
+ _mm256_storeu_si256((__m256i *) ptr + 15, d16);
+}
+ static void sort(int32_t *ptr, size_t length);
+
+};
+}
+}
+
+#undef i2d
+#undef d2i
+#undef i2s
+#undef s2i
+#undef s2d
+#undef d2s
+
+#ifdef __GNUC__
+#ifdef __clang__
+#pragma clang attribute pop
+#else
+#pragma GCC pop_options
+#endif
+#endif
+#endif
+
diff --git a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int64_t.generated.cpp b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int64_t.generated.cpp
new file mode 100644
index 000000000000..00360ae70f0c
--- /dev/null
+++ b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int64_t.generated.cpp
@@ -0,0 +1,30 @@
+// 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"
+#include "bitonic_sort.AVX2.int64_t.generated.h"
+
+using namespace vxsort;
+
+void vxsort::smallsort::bitonic::sort(int64_t *ptr, size_t length) {
+ const int N = 4;
+
+ switch(length / N) {
+ case 1: sort_01v(ptr); break;
+ case 2: sort_02v(ptr); break;
+ case 3: sort_03v(ptr); break;
+ case 4: sort_04v(ptr); break;
+ case 5: sort_05v(ptr); break;
+ case 6: sort_06v(ptr); break;
+ case 7: sort_07v(ptr); break;
+ case 8: sort_08v(ptr); break;
+ case 9: sort_09v(ptr); break;
+ case 10: sort_10v(ptr); break;
+ case 11: sort_11v(ptr); break;
+ case 12: sort_12v(ptr); break;
+ case 13: sort_13v(ptr); break;
+ case 14: sort_14v(ptr); break;
+ case 15: sort_15v(ptr); break;
+ case 16: sort_16v(ptr); break;
+ }
+}
diff --git a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int64_t.generated.h b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int64_t.generated.h
new file mode 100644
index 000000000000..5e9d2fea0dcf
--- /dev/null
+++ b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX2.int64_t.generated.h
@@ -0,0 +1,1490 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+/////////////////////////////////////////////////////////////////////////////
+////
+// This file was auto-generated by a tool at 2020-06-22 05:27:48
+//
+// It is recommended you DO NOT directly edit this file but instead edit
+// the code-generator that generated this source file instead.
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BITONIC_SORT_AVX2_INT64_T_H
+#define BITONIC_SORT_AVX2_INT64_T_H
+
+#ifdef __GNUC__
+#ifdef __clang__
+#pragma clang attribute push (__attribute__((target("avx2"))), apply_to = any(function))
+#else
+#pragma GCC push_options
+#pragma GCC target("avx2")
+#endif
+#endif
+
+#include
+#include "bitonic_sort.h"
+
+#define i2d _mm256_castsi256_pd
+#define d2i _mm256_castpd_si256
+#define i2s _mm256_castsi256_ps
+#define s2i _mm256_castps_si256
+#define s2d _mm256_castps_pd
+#define d2s _mm256_castpd_ps
+
+namespace vxsort {
+namespace smallsort {
+template<> struct bitonic {
+public:
+
+ static INLINE void sort_01v_ascending(__m256i& d01) {
+ __m256i min, max, s, cmp;
+
+ s = d2i(_mm256_shuffle_pd(i2d(d01), i2d(d01), 0x5));
+ cmp = _mm256_cmpgt_epi64(s, d01);
+ min = d2i(_mm256_blendv_pd(i2d(s), i2d(d01), i2d(cmp)));
+ max = d2i(_mm256_blendv_pd(i2d(d01), i2d(s), i2d(cmp)));
+ d01 = d2i(_mm256_blend_pd(i2d(min), i2d(max), 0xA));
+
+ s = d2i(_mm256_permute4x64_pd(i2d(d01), 0x1B));
+ cmp = _mm256_cmpgt_epi64(s, d01);
+ min = d2i(_mm256_blendv_pd(i2d(s), i2d(d01), i2d(cmp)));
+ max = d2i(_mm256_blendv_pd(i2d(d01), i2d(s), i2d(cmp)));
+ d01 = d2i(_mm256_blend_pd(i2d(min), i2d(max), 0xC));
+
+ s = d2i(_mm256_shuffle_pd(i2d(d01), i2d(d01), 0x5));
+ cmp = _mm256_cmpgt_epi64(s, d01);
+ min = d2i(_mm256_blendv_pd(i2d(s), i2d(d01), i2d(cmp)));
+ max = d2i(_mm256_blendv_pd(i2d(d01), i2d(s), i2d(cmp)));
+ d01 = d2i(_mm256_blend_pd(i2d(min), i2d(max), 0xA));
+}
+ static INLINE void sort_01v_merge_ascending(__m256i& d01) {
+ __m256i min, max, s, cmp;
+
+ s = d2i(_mm256_permute4x64_pd(i2d(d01), 0x4E));
+ cmp = _mm256_cmpgt_epi64(s, d01);
+ min = d2i(_mm256_blendv_pd(i2d(s), i2d(d01), i2d(cmp)));
+ max = d2i(_mm256_blendv_pd(i2d(d01), i2d(s), i2d(cmp)));
+ d01 = d2i(_mm256_blend_pd(i2d(min), i2d(max), 0xC));
+
+ s = d2i(_mm256_shuffle_pd(i2d(d01), i2d(d01), 0x5));
+ cmp = _mm256_cmpgt_epi64(s, d01);
+ min = d2i(_mm256_blendv_pd(i2d(s), i2d(d01), i2d(cmp)));
+ max = d2i(_mm256_blendv_pd(i2d(d01), i2d(s), i2d(cmp)));
+ d01 = d2i(_mm256_blend_pd(i2d(min), i2d(max), 0xA));
+ }
+ static INLINE void sort_01v_descending(__m256i& d01) {
+ __m256i min, max, s, cmp;
+
+ s = d2i(_mm256_shuffle_pd(i2d(d01), i2d(d01), 0x5));
+ cmp = _mm256_cmpgt_epi64(s, d01);
+ min = d2i(_mm256_blendv_pd(i2d(s), i2d(d01), i2d(cmp)));
+ max = d2i(_mm256_blendv_pd(i2d(d01), i2d(s), i2d(cmp)));
+ d01 = d2i(_mm256_blend_pd(i2d(max), i2d(min), 0xA));
+
+ s = d2i(_mm256_permute4x64_pd(i2d(d01), 0x1B));
+ cmp = _mm256_cmpgt_epi64(s, d01);
+ min = d2i(_mm256_blendv_pd(i2d(s), i2d(d01), i2d(cmp)));
+ max = d2i(_mm256_blendv_pd(i2d(d01), i2d(s), i2d(cmp)));
+ d01 = d2i(_mm256_blend_pd(i2d(max), i2d(min), 0xC));
+
+ s = d2i(_mm256_shuffle_pd(i2d(d01), i2d(d01), 0x5));
+ cmp = _mm256_cmpgt_epi64(s, d01);
+ min = d2i(_mm256_blendv_pd(i2d(s), i2d(d01), i2d(cmp)));
+ max = d2i(_mm256_blendv_pd(i2d(d01), i2d(s), i2d(cmp)));
+ d01 = d2i(_mm256_blend_pd(i2d(max), i2d(min), 0xA));
+}
+ static INLINE void sort_01v_merge_descending(__m256i& d01) {
+ __m256i min, max, s, cmp;
+
+ s = d2i(_mm256_permute4x64_pd(i2d(d01), 0x4E));
+ cmp = _mm256_cmpgt_epi64(s, d01);
+ min = d2i(_mm256_blendv_pd(i2d(s), i2d(d01), i2d(cmp)));
+ max = d2i(_mm256_blendv_pd(i2d(d01), i2d(s), i2d(cmp)));
+ d01 = d2i(_mm256_blend_pd(i2d(max), i2d(min), 0xC));
+
+ s = d2i(_mm256_shuffle_pd(i2d(d01), i2d(d01), 0x5));
+ cmp = _mm256_cmpgt_epi64(s, d01);
+ min = d2i(_mm256_blendv_pd(i2d(s), i2d(d01), i2d(cmp)));
+ max = d2i(_mm256_blendv_pd(i2d(d01), i2d(s), i2d(cmp)));
+ d01 = d2i(_mm256_blend_pd(i2d(max), i2d(min), 0xA));
+ }
+ static INLINE void sort_02v_ascending(__m256i& d01, __m256i& d02) {
+ __m256i tmp, cmp;
+
+ sort_01v_ascending(d01);
+ sort_01v_descending(d02);
+
+ tmp = d02;
+ cmp = _mm256_cmpgt_epi64(d01, d02);
+ d02 = d2i(_mm256_blendv_pd(i2d(d02), i2d(d01), i2d(cmp)));
+ d01 = d2i(_mm256_blendv_pd(i2d(d01), i2d(tmp), i2d(cmp)));
+
+ sort_01v_merge_ascending(d01);
+ sort_01v_merge_ascending(d02);
+ }
+ static INLINE void sort_02v_descending(__m256i& d01, __m256i& d02) {
+ __m256i tmp, cmp;
+
+ sort_01v_descending(d01);
+ sort_01v_ascending(d02);
+
+ tmp = d02;
+ cmp = _mm256_cmpgt_epi64(d01, d02);
+ d02 = d2i(_mm256_blendv_pd(i2d(d02), i2d(d01), i2d(cmp)));
+ d01 = d2i(_mm256_blendv_pd(i2d(d01), i2d(tmp), i2d(cmp)));
+
+ sort_01v_merge_descending(d01);
+ sort_01v_merge_descending(d02);
+ }
+ static INLINE void sort_02v_merge_ascending(__m256i& d01, __m256i& d02) {
+ __m256i tmp, cmp;
+
+ tmp = d01;
+ cmp = _mm256_cmpgt_epi64(d02, d01);
+ d01 = d2i(_mm256_blendv_pd(i2d(d02), i2d(d01), i2d(cmp)));
+ cmp = _mm256_cmpgt_epi64(d02, tmp);
+ d02 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d02), i2d(cmp)));
+
+ sort_01v_merge_ascending(d01);
+ sort_01v_merge_ascending(d02);
+ }
+ static INLINE void sort_02v_merge_descending(__m256i& d01, __m256i& d02) {
+ __m256i tmp, cmp;
+
+ tmp = d01;
+ cmp = _mm256_cmpgt_epi64(d02, d01);
+ d01 = d2i(_mm256_blendv_pd(i2d(d02), i2d(d01), i2d(cmp)));
+ cmp = _mm256_cmpgt_epi64(d02, tmp);
+ d02 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d02), i2d(cmp)));
+
+ sort_01v_merge_descending(d01);
+ sort_01v_merge_descending(d02);
+ }
+ static INLINE void sort_03v_ascending(__m256i& d01, __m256i& d02, __m256i& d03) {
+ __m256i tmp, cmp;
+
+ sort_02v_ascending(d01, d02);
+ sort_01v_descending(d03);
+
+ tmp = d03;
+ cmp = _mm256_cmpgt_epi64(d02, d03);
+ d03 = d2i(_mm256_blendv_pd(i2d(d03), i2d(d02), i2d(cmp)));
+ d02 = d2i(_mm256_blendv_pd(i2d(d02), i2d(tmp), i2d(cmp)));
+
+ sort_02v_merge_ascending(d01, d02);
+ sort_01v_merge_ascending(d03);
+ }
+ static INLINE void sort_03v_descending(__m256i& d01, __m256i& d02, __m256i& d03) {
+ __m256i tmp, cmp;
+
+ sort_02v_descending(d01, d02);
+ sort_01v_ascending(d03);
+
+ tmp = d03;
+ cmp = _mm256_cmpgt_epi64(d02, d03);
+ d03 = d2i(_mm256_blendv_pd(i2d(d03), i2d(d02), i2d(cmp)));
+ d02 = d2i(_mm256_blendv_pd(i2d(d02), i2d(tmp), i2d(cmp)));
+
+ sort_02v_merge_descending(d01, d02);
+ sort_01v_merge_descending(d03);
+ }
+ static INLINE void sort_03v_merge_ascending(__m256i& d01, __m256i& d02, __m256i& d03) {
+ __m256i tmp, cmp;
+
+ tmp = d01;
+ cmp = _mm256_cmpgt_epi64(d03, d01);
+ d01 = d2i(_mm256_blendv_pd(i2d(d03), i2d(d01), i2d(cmp)));
+ cmp = _mm256_cmpgt_epi64(d03, tmp);
+ d03 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d03), i2d(cmp)));
+
+ sort_02v_merge_ascending(d01, d02);
+ sort_01v_merge_ascending(d03);
+ }
+ static INLINE void sort_03v_merge_descending(__m256i& d01, __m256i& d02, __m256i& d03) {
+ __m256i tmp, cmp;
+
+ tmp = d01;
+ cmp = _mm256_cmpgt_epi64(d03, d01);
+ d01 = d2i(_mm256_blendv_pd(i2d(d03), i2d(d01), i2d(cmp)));
+ cmp = _mm256_cmpgt_epi64(d03, tmp);
+ d03 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d03), i2d(cmp)));
+
+ sort_02v_merge_descending(d01, d02);
+ sort_01v_merge_descending(d03);
+ }
+ static INLINE void sort_04v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04) {
+ __m256i tmp, cmp;
+
+ sort_02v_ascending(d01, d02);
+ sort_02v_descending(d03, d04);
+
+ tmp = d03;
+ cmp = _mm256_cmpgt_epi64(d02, d03);
+ d03 = d2i(_mm256_blendv_pd(i2d(d03), i2d(d02), i2d(cmp)));
+ d02 = d2i(_mm256_blendv_pd(i2d(d02), i2d(tmp), i2d(cmp)));
+
+ tmp = d04;
+ cmp = _mm256_cmpgt_epi64(d01, d04);
+ d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(d01), i2d(cmp)));
+ d01 = d2i(_mm256_blendv_pd(i2d(d01), i2d(tmp), i2d(cmp)));
+
+ sort_02v_merge_ascending(d01, d02);
+ sort_02v_merge_ascending(d03, d04);
+ }
+ static INLINE void sort_04v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04) {
+ __m256i tmp, cmp;
+
+ sort_02v_descending(d01, d02);
+ sort_02v_ascending(d03, d04);
+
+ tmp = d03;
+ cmp = _mm256_cmpgt_epi64(d02, d03);
+ d03 = d2i(_mm256_blendv_pd(i2d(d03), i2d(d02), i2d(cmp)));
+ d02 = d2i(_mm256_blendv_pd(i2d(d02), i2d(tmp), i2d(cmp)));
+
+ tmp = d04;
+ cmp = _mm256_cmpgt_epi64(d01, d04);
+ d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(d01), i2d(cmp)));
+ d01 = d2i(_mm256_blendv_pd(i2d(d01), i2d(tmp), i2d(cmp)));
+
+ sort_02v_merge_descending(d01, d02);
+ sort_02v_merge_descending(d03, d04);
+ }
+ static INLINE void sort_04v_merge_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04) {
+ __m256i tmp, cmp;
+
+ tmp = d01;
+ cmp = _mm256_cmpgt_epi64(d03, d01);
+ d01 = d2i(_mm256_blendv_pd(i2d(d03), i2d(d01), i2d(cmp)));
+ cmp = _mm256_cmpgt_epi64(d03, tmp);
+ d03 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d03), i2d(cmp)));
+
+ tmp = d02;
+ cmp = _mm256_cmpgt_epi64(d04, d02);
+ d02 = d2i(_mm256_blendv_pd(i2d(d04), i2d(d02), i2d(cmp)));
+ cmp = _mm256_cmpgt_epi64(d04, tmp);
+ d04 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d04), i2d(cmp)));
+
+ sort_02v_merge_ascending(d01, d02);
+ sort_02v_merge_ascending(d03, d04);
+ }
+ static INLINE void sort_04v_merge_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04) {
+ __m256i tmp, cmp;
+
+ tmp = d01;
+ cmp = _mm256_cmpgt_epi64(d03, d01);
+ d01 = d2i(_mm256_blendv_pd(i2d(d03), i2d(d01), i2d(cmp)));
+ cmp = _mm256_cmpgt_epi64(d03, tmp);
+ d03 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d03), i2d(cmp)));
+
+ tmp = d02;
+ cmp = _mm256_cmpgt_epi64(d04, d02);
+ d02 = d2i(_mm256_blendv_pd(i2d(d04), i2d(d02), i2d(cmp)));
+ cmp = _mm256_cmpgt_epi64(d04, tmp);
+ d04 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d04), i2d(cmp)));
+
+ sort_02v_merge_descending(d01, d02);
+ sort_02v_merge_descending(d03, d04);
+ }
+ static INLINE void sort_05v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05) {
+ __m256i tmp, cmp;
+
+ sort_04v_ascending(d01, d02, d03, d04);
+ sort_01v_descending(d05);
+
+ tmp = d05;
+ cmp = _mm256_cmpgt_epi64(d04, d05);
+ d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(d04), i2d(cmp)));
+ d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(tmp), i2d(cmp)));
+
+ sort_04v_merge_ascending(d01, d02, d03, d04);
+ sort_01v_merge_ascending(d05);
+ }
+ static INLINE void sort_05v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05) {
+ __m256i tmp, cmp;
+
+ sort_04v_descending(d01, d02, d03, d04);
+ sort_01v_ascending(d05);
+
+ tmp = d05;
+ cmp = _mm256_cmpgt_epi64(d04, d05);
+ d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(d04), i2d(cmp)));
+ d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(tmp), i2d(cmp)));
+
+ sort_04v_merge_descending(d01, d02, d03, d04);
+ sort_01v_merge_descending(d05);
+ }
+ static INLINE void sort_05v_merge_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05) {
+ __m256i tmp, cmp;
+
+ tmp = d01;
+ cmp = _mm256_cmpgt_epi64(d05, d01);
+ d01 = d2i(_mm256_blendv_pd(i2d(d05), i2d(d01), i2d(cmp)));
+ cmp = _mm256_cmpgt_epi64(d05, tmp);
+ d05 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d05), i2d(cmp)));
+
+ sort_04v_merge_ascending(d01, d02, d03, d04);
+ sort_01v_merge_ascending(d05);
+ }
+ static INLINE void sort_05v_merge_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05) {
+ __m256i tmp, cmp;
+
+ tmp = d01;
+ cmp = _mm256_cmpgt_epi64(d05, d01);
+ d01 = d2i(_mm256_blendv_pd(i2d(d05), i2d(d01), i2d(cmp)));
+ cmp = _mm256_cmpgt_epi64(d05, tmp);
+ d05 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d05), i2d(cmp)));
+
+ sort_04v_merge_descending(d01, d02, d03, d04);
+ sort_01v_merge_descending(d05);
+ }
+ static INLINE void sort_06v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06) {
+ __m256i tmp, cmp;
+
+ sort_04v_ascending(d01, d02, d03, d04);
+ sort_02v_descending(d05, d06);
+
+ tmp = d05;
+ cmp = _mm256_cmpgt_epi64(d04, d05);
+ d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(d04), i2d(cmp)));
+ d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(tmp), i2d(cmp)));
+
+ tmp = d06;
+ cmp = _mm256_cmpgt_epi64(d03, d06);
+ d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(d03), i2d(cmp)));
+ d03 = d2i(_mm256_blendv_pd(i2d(d03), i2d(tmp), i2d(cmp)));
+
+ sort_04v_merge_ascending(d01, d02, d03, d04);
+ sort_02v_merge_ascending(d05, d06);
+ }
+ static INLINE void sort_06v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06) {
+ __m256i tmp, cmp;
+
+ sort_04v_descending(d01, d02, d03, d04);
+ sort_02v_ascending(d05, d06);
+
+ tmp = d05;
+ cmp = _mm256_cmpgt_epi64(d04, d05);
+ d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(d04), i2d(cmp)));
+ d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(tmp), i2d(cmp)));
+
+ tmp = d06;
+ cmp = _mm256_cmpgt_epi64(d03, d06);
+ d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(d03), i2d(cmp)));
+ d03 = d2i(_mm256_blendv_pd(i2d(d03), i2d(tmp), i2d(cmp)));
+
+ sort_04v_merge_descending(d01, d02, d03, d04);
+ sort_02v_merge_descending(d05, d06);
+ }
+ static INLINE void sort_06v_merge_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06) {
+ __m256i tmp, cmp;
+
+ tmp = d01;
+ cmp = _mm256_cmpgt_epi64(d05, d01);
+ d01 = d2i(_mm256_blendv_pd(i2d(d05), i2d(d01), i2d(cmp)));
+ cmp = _mm256_cmpgt_epi64(d05, tmp);
+ d05 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d05), i2d(cmp)));
+
+ tmp = d02;
+ cmp = _mm256_cmpgt_epi64(d06, d02);
+ d02 = d2i(_mm256_blendv_pd(i2d(d06), i2d(d02), i2d(cmp)));
+ cmp = _mm256_cmpgt_epi64(d06, tmp);
+ d06 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d06), i2d(cmp)));
+
+ sort_04v_merge_ascending(d01, d02, d03, d04);
+ sort_02v_merge_ascending(d05, d06);
+ }
+ static INLINE void sort_06v_merge_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06) {
+ __m256i tmp, cmp;
+
+ tmp = d01;
+ cmp = _mm256_cmpgt_epi64(d05, d01);
+ d01 = d2i(_mm256_blendv_pd(i2d(d05), i2d(d01), i2d(cmp)));
+ cmp = _mm256_cmpgt_epi64(d05, tmp);
+ d05 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d05), i2d(cmp)));
+
+ tmp = d02;
+ cmp = _mm256_cmpgt_epi64(d06, d02);
+ d02 = d2i(_mm256_blendv_pd(i2d(d06), i2d(d02), i2d(cmp)));
+ cmp = _mm256_cmpgt_epi64(d06, tmp);
+ d06 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d06), i2d(cmp)));
+
+ sort_04v_merge_descending(d01, d02, d03, d04);
+ sort_02v_merge_descending(d05, d06);
+ }
+ static INLINE void sort_07v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07) {
+ __m256i tmp, cmp;
+
+ sort_04v_ascending(d01, d02, d03, d04);
+ sort_03v_descending(d05, d06, d07);
+
+ tmp = d05;
+ cmp = _mm256_cmpgt_epi64(d04, d05);
+ d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(d04), i2d(cmp)));
+ d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(tmp), i2d(cmp)));
+
+ tmp = d06;
+ cmp = _mm256_cmpgt_epi64(d03, d06);
+ d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(d03), i2d(cmp)));
+ d03 = d2i(_mm256_blendv_pd(i2d(d03), i2d(tmp), i2d(cmp)));
+
+ tmp = d07;
+ cmp = _mm256_cmpgt_epi64(d02, d07);
+ d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(d02), i2d(cmp)));
+ d02 = d2i(_mm256_blendv_pd(i2d(d02), i2d(tmp), i2d(cmp)));
+
+ sort_04v_merge_ascending(d01, d02, d03, d04);
+ sort_03v_merge_ascending(d05, d06, d07);
+ }
+ static INLINE void sort_07v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07) {
+ __m256i tmp, cmp;
+
+ sort_04v_descending(d01, d02, d03, d04);
+ sort_03v_ascending(d05, d06, d07);
+
+ tmp = d05;
+ cmp = _mm256_cmpgt_epi64(d04, d05);
+ d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(d04), i2d(cmp)));
+ d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(tmp), i2d(cmp)));
+
+ tmp = d06;
+ cmp = _mm256_cmpgt_epi64(d03, d06);
+ d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(d03), i2d(cmp)));
+ d03 = d2i(_mm256_blendv_pd(i2d(d03), i2d(tmp), i2d(cmp)));
+
+ tmp = d07;
+ cmp = _mm256_cmpgt_epi64(d02, d07);
+ d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(d02), i2d(cmp)));
+ d02 = d2i(_mm256_blendv_pd(i2d(d02), i2d(tmp), i2d(cmp)));
+
+ sort_04v_merge_descending(d01, d02, d03, d04);
+ sort_03v_merge_descending(d05, d06, d07);
+ }
+ static INLINE void sort_07v_merge_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07) {
+ __m256i tmp, cmp;
+
+ tmp = d01;
+ cmp = _mm256_cmpgt_epi64(d05, d01);
+ d01 = d2i(_mm256_blendv_pd(i2d(d05), i2d(d01), i2d(cmp)));
+ cmp = _mm256_cmpgt_epi64(d05, tmp);
+ d05 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d05), i2d(cmp)));
+
+ tmp = d02;
+ cmp = _mm256_cmpgt_epi64(d06, d02);
+ d02 = d2i(_mm256_blendv_pd(i2d(d06), i2d(d02), i2d(cmp)));
+ cmp = _mm256_cmpgt_epi64(d06, tmp);
+ d06 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d06), i2d(cmp)));
+
+ tmp = d03;
+ cmp = _mm256_cmpgt_epi64(d07, d03);
+ d03 = d2i(_mm256_blendv_pd(i2d(d07), i2d(d03), i2d(cmp)));
+ cmp = _mm256_cmpgt_epi64(d07, tmp);
+ d07 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d07), i2d(cmp)));
+
+ sort_04v_merge_ascending(d01, d02, d03, d04);
+ sort_03v_merge_ascending(d05, d06, d07);
+ }
+ static INLINE void sort_07v_merge_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07) {
+ __m256i tmp, cmp;
+
+ tmp = d01;
+ cmp = _mm256_cmpgt_epi64(d05, d01);
+ d01 = d2i(_mm256_blendv_pd(i2d(d05), i2d(d01), i2d(cmp)));
+ cmp = _mm256_cmpgt_epi64(d05, tmp);
+ d05 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d05), i2d(cmp)));
+
+ tmp = d02;
+ cmp = _mm256_cmpgt_epi64(d06, d02);
+ d02 = d2i(_mm256_blendv_pd(i2d(d06), i2d(d02), i2d(cmp)));
+ cmp = _mm256_cmpgt_epi64(d06, tmp);
+ d06 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d06), i2d(cmp)));
+
+ tmp = d03;
+ cmp = _mm256_cmpgt_epi64(d07, d03);
+ d03 = d2i(_mm256_blendv_pd(i2d(d07), i2d(d03), i2d(cmp)));
+ cmp = _mm256_cmpgt_epi64(d07, tmp);
+ d07 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d07), i2d(cmp)));
+
+ sort_04v_merge_descending(d01, d02, d03, d04);
+ sort_03v_merge_descending(d05, d06, d07);
+ }
+ static INLINE void sort_08v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08) {
+ __m256i tmp, cmp;
+
+ sort_04v_ascending(d01, d02, d03, d04);
+ sort_04v_descending(d05, d06, d07, d08);
+
+ tmp = d05;
+ cmp = _mm256_cmpgt_epi64(d04, d05);
+ d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(d04), i2d(cmp)));
+ d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(tmp), i2d(cmp)));
+
+ tmp = d06;
+ cmp = _mm256_cmpgt_epi64(d03, d06);
+ d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(d03), i2d(cmp)));
+ d03 = d2i(_mm256_blendv_pd(i2d(d03), i2d(tmp), i2d(cmp)));
+
+ tmp = d07;
+ cmp = _mm256_cmpgt_epi64(d02, d07);
+ d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(d02), i2d(cmp)));
+ d02 = d2i(_mm256_blendv_pd(i2d(d02), i2d(tmp), i2d(cmp)));
+
+ tmp = d08;
+ cmp = _mm256_cmpgt_epi64(d01, d08);
+ d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(d01), i2d(cmp)));
+ d01 = d2i(_mm256_blendv_pd(i2d(d01), i2d(tmp), i2d(cmp)));
+
+ sort_04v_merge_ascending(d01, d02, d03, d04);
+ sort_04v_merge_ascending(d05, d06, d07, d08);
+ }
+ static INLINE void sort_08v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08) {
+ __m256i tmp, cmp;
+
+ sort_04v_descending(d01, d02, d03, d04);
+ sort_04v_ascending(d05, d06, d07, d08);
+
+ tmp = d05;
+ cmp = _mm256_cmpgt_epi64(d04, d05);
+ d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(d04), i2d(cmp)));
+ d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(tmp), i2d(cmp)));
+
+ tmp = d06;
+ cmp = _mm256_cmpgt_epi64(d03, d06);
+ d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(d03), i2d(cmp)));
+ d03 = d2i(_mm256_blendv_pd(i2d(d03), i2d(tmp), i2d(cmp)));
+
+ tmp = d07;
+ cmp = _mm256_cmpgt_epi64(d02, d07);
+ d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(d02), i2d(cmp)));
+ d02 = d2i(_mm256_blendv_pd(i2d(d02), i2d(tmp), i2d(cmp)));
+
+ tmp = d08;
+ cmp = _mm256_cmpgt_epi64(d01, d08);
+ d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(d01), i2d(cmp)));
+ d01 = d2i(_mm256_blendv_pd(i2d(d01), i2d(tmp), i2d(cmp)));
+
+ sort_04v_merge_descending(d01, d02, d03, d04);
+ sort_04v_merge_descending(d05, d06, d07, d08);
+ }
+ static INLINE void sort_08v_merge_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08) {
+ __m256i tmp, cmp;
+
+ tmp = d01;
+ cmp = _mm256_cmpgt_epi64(d05, d01);
+ d01 = d2i(_mm256_blendv_pd(i2d(d05), i2d(d01), i2d(cmp)));
+ cmp = _mm256_cmpgt_epi64(d05, tmp);
+ d05 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d05), i2d(cmp)));
+
+ tmp = d02;
+ cmp = _mm256_cmpgt_epi64(d06, d02);
+ d02 = d2i(_mm256_blendv_pd(i2d(d06), i2d(d02), i2d(cmp)));
+ cmp = _mm256_cmpgt_epi64(d06, tmp);
+ d06 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d06), i2d(cmp)));
+
+ tmp = d03;
+ cmp = _mm256_cmpgt_epi64(d07, d03);
+ d03 = d2i(_mm256_blendv_pd(i2d(d07), i2d(d03), i2d(cmp)));
+ cmp = _mm256_cmpgt_epi64(d07, tmp);
+ d07 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d07), i2d(cmp)));
+
+ tmp = d04;
+ cmp = _mm256_cmpgt_epi64(d08, d04);
+ d04 = d2i(_mm256_blendv_pd(i2d(d08), i2d(d04), i2d(cmp)));
+ cmp = _mm256_cmpgt_epi64(d08, tmp);
+ d08 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d08), i2d(cmp)));
+
+ sort_04v_merge_ascending(d01, d02, d03, d04);
+ sort_04v_merge_ascending(d05, d06, d07, d08);
+ }
+ static INLINE void sort_08v_merge_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08) {
+ __m256i tmp, cmp;
+
+ tmp = d01;
+ cmp = _mm256_cmpgt_epi64(d05, d01);
+ d01 = d2i(_mm256_blendv_pd(i2d(d05), i2d(d01), i2d(cmp)));
+ cmp = _mm256_cmpgt_epi64(d05, tmp);
+ d05 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d05), i2d(cmp)));
+
+ tmp = d02;
+ cmp = _mm256_cmpgt_epi64(d06, d02);
+ d02 = d2i(_mm256_blendv_pd(i2d(d06), i2d(d02), i2d(cmp)));
+ cmp = _mm256_cmpgt_epi64(d06, tmp);
+ d06 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d06), i2d(cmp)));
+
+ tmp = d03;
+ cmp = _mm256_cmpgt_epi64(d07, d03);
+ d03 = d2i(_mm256_blendv_pd(i2d(d07), i2d(d03), i2d(cmp)));
+ cmp = _mm256_cmpgt_epi64(d07, tmp);
+ d07 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d07), i2d(cmp)));
+
+ tmp = d04;
+ cmp = _mm256_cmpgt_epi64(d08, d04);
+ d04 = d2i(_mm256_blendv_pd(i2d(d08), i2d(d04), i2d(cmp)));
+ cmp = _mm256_cmpgt_epi64(d08, tmp);
+ d08 = d2i(_mm256_blendv_pd(i2d(tmp), i2d(d08), i2d(cmp)));
+
+ sort_04v_merge_descending(d01, d02, d03, d04);
+ sort_04v_merge_descending(d05, d06, d07, d08);
+ }
+ static INLINE void sort_09v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09) {
+ __m256i tmp, cmp;
+
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_01v_descending(d09);
+
+ tmp = d09;
+ cmp = _mm256_cmpgt_epi64(d08, d09);
+ d09 = d2i(_mm256_blendv_pd(i2d(d09), i2d(d08), i2d(cmp)));
+ d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(tmp), i2d(cmp)));
+
+ sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_01v_merge_ascending(d09);
+ }
+ static INLINE void sort_09v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09) {
+ __m256i tmp, cmp;
+
+ sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_01v_ascending(d09);
+
+ tmp = d09;
+ cmp = _mm256_cmpgt_epi64(d08, d09);
+ d09 = d2i(_mm256_blendv_pd(i2d(d09), i2d(d08), i2d(cmp)));
+ d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(tmp), i2d(cmp)));
+
+ sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_01v_merge_descending(d09);
+ }
+ static INLINE void sort_10v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10) {
+ __m256i tmp, cmp;
+
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_02v_descending(d09, d10);
+
+ tmp = d09;
+ cmp = _mm256_cmpgt_epi64(d08, d09);
+ d09 = d2i(_mm256_blendv_pd(i2d(d09), i2d(d08), i2d(cmp)));
+ d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(tmp), i2d(cmp)));
+
+ tmp = d10;
+ cmp = _mm256_cmpgt_epi64(d07, d10);
+ d10 = d2i(_mm256_blendv_pd(i2d(d10), i2d(d07), i2d(cmp)));
+ d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(tmp), i2d(cmp)));
+
+ sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_02v_merge_ascending(d09, d10);
+ }
+ static INLINE void sort_10v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10) {
+ __m256i tmp, cmp;
+
+ sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_02v_ascending(d09, d10);
+
+ tmp = d09;
+ cmp = _mm256_cmpgt_epi64(d08, d09);
+ d09 = d2i(_mm256_blendv_pd(i2d(d09), i2d(d08), i2d(cmp)));
+ d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(tmp), i2d(cmp)));
+
+ tmp = d10;
+ cmp = _mm256_cmpgt_epi64(d07, d10);
+ d10 = d2i(_mm256_blendv_pd(i2d(d10), i2d(d07), i2d(cmp)));
+ d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(tmp), i2d(cmp)));
+
+ sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_02v_merge_descending(d09, d10);
+ }
+ static INLINE void sort_11v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11) {
+ __m256i tmp, cmp;
+
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_03v_descending(d09, d10, d11);
+
+ tmp = d09;
+ cmp = _mm256_cmpgt_epi64(d08, d09);
+ d09 = d2i(_mm256_blendv_pd(i2d(d09), i2d(d08), i2d(cmp)));
+ d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(tmp), i2d(cmp)));
+
+ tmp = d10;
+ cmp = _mm256_cmpgt_epi64(d07, d10);
+ d10 = d2i(_mm256_blendv_pd(i2d(d10), i2d(d07), i2d(cmp)));
+ d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(tmp), i2d(cmp)));
+
+ tmp = d11;
+ cmp = _mm256_cmpgt_epi64(d06, d11);
+ d11 = d2i(_mm256_blendv_pd(i2d(d11), i2d(d06), i2d(cmp)));
+ d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(tmp), i2d(cmp)));
+
+ sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_03v_merge_ascending(d09, d10, d11);
+ }
+ static INLINE void sort_11v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11) {
+ __m256i tmp, cmp;
+
+ sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_03v_ascending(d09, d10, d11);
+
+ tmp = d09;
+ cmp = _mm256_cmpgt_epi64(d08, d09);
+ d09 = d2i(_mm256_blendv_pd(i2d(d09), i2d(d08), i2d(cmp)));
+ d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(tmp), i2d(cmp)));
+
+ tmp = d10;
+ cmp = _mm256_cmpgt_epi64(d07, d10);
+ d10 = d2i(_mm256_blendv_pd(i2d(d10), i2d(d07), i2d(cmp)));
+ d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(tmp), i2d(cmp)));
+
+ tmp = d11;
+ cmp = _mm256_cmpgt_epi64(d06, d11);
+ d11 = d2i(_mm256_blendv_pd(i2d(d11), i2d(d06), i2d(cmp)));
+ d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(tmp), i2d(cmp)));
+
+ sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_03v_merge_descending(d09, d10, d11);
+ }
+ static INLINE void sort_12v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12) {
+ __m256i tmp, cmp;
+
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_04v_descending(d09, d10, d11, d12);
+
+ tmp = d09;
+ cmp = _mm256_cmpgt_epi64(d08, d09);
+ d09 = d2i(_mm256_blendv_pd(i2d(d09), i2d(d08), i2d(cmp)));
+ d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(tmp), i2d(cmp)));
+
+ tmp = d10;
+ cmp = _mm256_cmpgt_epi64(d07, d10);
+ d10 = d2i(_mm256_blendv_pd(i2d(d10), i2d(d07), i2d(cmp)));
+ d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(tmp), i2d(cmp)));
+
+ tmp = d11;
+ cmp = _mm256_cmpgt_epi64(d06, d11);
+ d11 = d2i(_mm256_blendv_pd(i2d(d11), i2d(d06), i2d(cmp)));
+ d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(tmp), i2d(cmp)));
+
+ tmp = d12;
+ cmp = _mm256_cmpgt_epi64(d05, d12);
+ d12 = d2i(_mm256_blendv_pd(i2d(d12), i2d(d05), i2d(cmp)));
+ d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(tmp), i2d(cmp)));
+
+ sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_04v_merge_ascending(d09, d10, d11, d12);
+ }
+ static INLINE void sort_12v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12) {
+ __m256i tmp, cmp;
+
+ sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_04v_ascending(d09, d10, d11, d12);
+
+ tmp = d09;
+ cmp = _mm256_cmpgt_epi64(d08, d09);
+ d09 = d2i(_mm256_blendv_pd(i2d(d09), i2d(d08), i2d(cmp)));
+ d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(tmp), i2d(cmp)));
+
+ tmp = d10;
+ cmp = _mm256_cmpgt_epi64(d07, d10);
+ d10 = d2i(_mm256_blendv_pd(i2d(d10), i2d(d07), i2d(cmp)));
+ d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(tmp), i2d(cmp)));
+
+ tmp = d11;
+ cmp = _mm256_cmpgt_epi64(d06, d11);
+ d11 = d2i(_mm256_blendv_pd(i2d(d11), i2d(d06), i2d(cmp)));
+ d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(tmp), i2d(cmp)));
+
+ tmp = d12;
+ cmp = _mm256_cmpgt_epi64(d05, d12);
+ d12 = d2i(_mm256_blendv_pd(i2d(d12), i2d(d05), i2d(cmp)));
+ d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(tmp), i2d(cmp)));
+
+ sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_04v_merge_descending(d09, d10, d11, d12);
+ }
+ static INLINE void sort_13v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13) {
+ __m256i tmp, cmp;
+
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_05v_descending(d09, d10, d11, d12, d13);
+
+ tmp = d09;
+ cmp = _mm256_cmpgt_epi64(d08, d09);
+ d09 = d2i(_mm256_blendv_pd(i2d(d09), i2d(d08), i2d(cmp)));
+ d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(tmp), i2d(cmp)));
+
+ tmp = d10;
+ cmp = _mm256_cmpgt_epi64(d07, d10);
+ d10 = d2i(_mm256_blendv_pd(i2d(d10), i2d(d07), i2d(cmp)));
+ d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(tmp), i2d(cmp)));
+
+ tmp = d11;
+ cmp = _mm256_cmpgt_epi64(d06, d11);
+ d11 = d2i(_mm256_blendv_pd(i2d(d11), i2d(d06), i2d(cmp)));
+ d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(tmp), i2d(cmp)));
+
+ tmp = d12;
+ cmp = _mm256_cmpgt_epi64(d05, d12);
+ d12 = d2i(_mm256_blendv_pd(i2d(d12), i2d(d05), i2d(cmp)));
+ d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(tmp), i2d(cmp)));
+
+ tmp = d13;
+ cmp = _mm256_cmpgt_epi64(d04, d13);
+ d13 = d2i(_mm256_blendv_pd(i2d(d13), i2d(d04), i2d(cmp)));
+ d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(tmp), i2d(cmp)));
+
+ sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_05v_merge_ascending(d09, d10, d11, d12, d13);
+ }
+ static INLINE void sort_13v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13) {
+ __m256i tmp, cmp;
+
+ sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_05v_ascending(d09, d10, d11, d12, d13);
+
+ tmp = d09;
+ cmp = _mm256_cmpgt_epi64(d08, d09);
+ d09 = d2i(_mm256_blendv_pd(i2d(d09), i2d(d08), i2d(cmp)));
+ d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(tmp), i2d(cmp)));
+
+ tmp = d10;
+ cmp = _mm256_cmpgt_epi64(d07, d10);
+ d10 = d2i(_mm256_blendv_pd(i2d(d10), i2d(d07), i2d(cmp)));
+ d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(tmp), i2d(cmp)));
+
+ tmp = d11;
+ cmp = _mm256_cmpgt_epi64(d06, d11);
+ d11 = d2i(_mm256_blendv_pd(i2d(d11), i2d(d06), i2d(cmp)));
+ d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(tmp), i2d(cmp)));
+
+ tmp = d12;
+ cmp = _mm256_cmpgt_epi64(d05, d12);
+ d12 = d2i(_mm256_blendv_pd(i2d(d12), i2d(d05), i2d(cmp)));
+ d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(tmp), i2d(cmp)));
+
+ tmp = d13;
+ cmp = _mm256_cmpgt_epi64(d04, d13);
+ d13 = d2i(_mm256_blendv_pd(i2d(d13), i2d(d04), i2d(cmp)));
+ d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(tmp), i2d(cmp)));
+
+ sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_05v_merge_descending(d09, d10, d11, d12, d13);
+ }
+ static INLINE void sort_14v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13, __m256i& d14) {
+ __m256i tmp, cmp;
+
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_06v_descending(d09, d10, d11, d12, d13, d14);
+
+ tmp = d09;
+ cmp = _mm256_cmpgt_epi64(d08, d09);
+ d09 = d2i(_mm256_blendv_pd(i2d(d09), i2d(d08), i2d(cmp)));
+ d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(tmp), i2d(cmp)));
+
+ tmp = d10;
+ cmp = _mm256_cmpgt_epi64(d07, d10);
+ d10 = d2i(_mm256_blendv_pd(i2d(d10), i2d(d07), i2d(cmp)));
+ d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(tmp), i2d(cmp)));
+
+ tmp = d11;
+ cmp = _mm256_cmpgt_epi64(d06, d11);
+ d11 = d2i(_mm256_blendv_pd(i2d(d11), i2d(d06), i2d(cmp)));
+ d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(tmp), i2d(cmp)));
+
+ tmp = d12;
+ cmp = _mm256_cmpgt_epi64(d05, d12);
+ d12 = d2i(_mm256_blendv_pd(i2d(d12), i2d(d05), i2d(cmp)));
+ d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(tmp), i2d(cmp)));
+
+ tmp = d13;
+ cmp = _mm256_cmpgt_epi64(d04, d13);
+ d13 = d2i(_mm256_blendv_pd(i2d(d13), i2d(d04), i2d(cmp)));
+ d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(tmp), i2d(cmp)));
+
+ tmp = d14;
+ cmp = _mm256_cmpgt_epi64(d03, d14);
+ d14 = d2i(_mm256_blendv_pd(i2d(d14), i2d(d03), i2d(cmp)));
+ d03 = d2i(_mm256_blendv_pd(i2d(d03), i2d(tmp), i2d(cmp)));
+
+ sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_06v_merge_ascending(d09, d10, d11, d12, d13, d14);
+ }
+ static INLINE void sort_14v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13, __m256i& d14) {
+ __m256i tmp, cmp;
+
+ sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_06v_ascending(d09, d10, d11, d12, d13, d14);
+
+ tmp = d09;
+ cmp = _mm256_cmpgt_epi64(d08, d09);
+ d09 = d2i(_mm256_blendv_pd(i2d(d09), i2d(d08), i2d(cmp)));
+ d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(tmp), i2d(cmp)));
+
+ tmp = d10;
+ cmp = _mm256_cmpgt_epi64(d07, d10);
+ d10 = d2i(_mm256_blendv_pd(i2d(d10), i2d(d07), i2d(cmp)));
+ d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(tmp), i2d(cmp)));
+
+ tmp = d11;
+ cmp = _mm256_cmpgt_epi64(d06, d11);
+ d11 = d2i(_mm256_blendv_pd(i2d(d11), i2d(d06), i2d(cmp)));
+ d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(tmp), i2d(cmp)));
+
+ tmp = d12;
+ cmp = _mm256_cmpgt_epi64(d05, d12);
+ d12 = d2i(_mm256_blendv_pd(i2d(d12), i2d(d05), i2d(cmp)));
+ d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(tmp), i2d(cmp)));
+
+ tmp = d13;
+ cmp = _mm256_cmpgt_epi64(d04, d13);
+ d13 = d2i(_mm256_blendv_pd(i2d(d13), i2d(d04), i2d(cmp)));
+ d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(tmp), i2d(cmp)));
+
+ tmp = d14;
+ cmp = _mm256_cmpgt_epi64(d03, d14);
+ d14 = d2i(_mm256_blendv_pd(i2d(d14), i2d(d03), i2d(cmp)));
+ d03 = d2i(_mm256_blendv_pd(i2d(d03), i2d(tmp), i2d(cmp)));
+
+ sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_06v_merge_descending(d09, d10, d11, d12, d13, d14);
+ }
+ static INLINE void sort_15v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13, __m256i& d14, __m256i& d15) {
+ __m256i tmp, cmp;
+
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_07v_descending(d09, d10, d11, d12, d13, d14, d15);
+
+ tmp = d09;
+ cmp = _mm256_cmpgt_epi64(d08, d09);
+ d09 = d2i(_mm256_blendv_pd(i2d(d09), i2d(d08), i2d(cmp)));
+ d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(tmp), i2d(cmp)));
+
+ tmp = d10;
+ cmp = _mm256_cmpgt_epi64(d07, d10);
+ d10 = d2i(_mm256_blendv_pd(i2d(d10), i2d(d07), i2d(cmp)));
+ d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(tmp), i2d(cmp)));
+
+ tmp = d11;
+ cmp = _mm256_cmpgt_epi64(d06, d11);
+ d11 = d2i(_mm256_blendv_pd(i2d(d11), i2d(d06), i2d(cmp)));
+ d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(tmp), i2d(cmp)));
+
+ tmp = d12;
+ cmp = _mm256_cmpgt_epi64(d05, d12);
+ d12 = d2i(_mm256_blendv_pd(i2d(d12), i2d(d05), i2d(cmp)));
+ d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(tmp), i2d(cmp)));
+
+ tmp = d13;
+ cmp = _mm256_cmpgt_epi64(d04, d13);
+ d13 = d2i(_mm256_blendv_pd(i2d(d13), i2d(d04), i2d(cmp)));
+ d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(tmp), i2d(cmp)));
+
+ tmp = d14;
+ cmp = _mm256_cmpgt_epi64(d03, d14);
+ d14 = d2i(_mm256_blendv_pd(i2d(d14), i2d(d03), i2d(cmp)));
+ d03 = d2i(_mm256_blendv_pd(i2d(d03), i2d(tmp), i2d(cmp)));
+
+ tmp = d15;
+ cmp = _mm256_cmpgt_epi64(d02, d15);
+ d15 = d2i(_mm256_blendv_pd(i2d(d15), i2d(d02), i2d(cmp)));
+ d02 = d2i(_mm256_blendv_pd(i2d(d02), i2d(tmp), i2d(cmp)));
+
+ sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_07v_merge_ascending(d09, d10, d11, d12, d13, d14, d15);
+ }
+ static INLINE void sort_15v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13, __m256i& d14, __m256i& d15) {
+ __m256i tmp, cmp;
+
+ sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_07v_ascending(d09, d10, d11, d12, d13, d14, d15);
+
+ tmp = d09;
+ cmp = _mm256_cmpgt_epi64(d08, d09);
+ d09 = d2i(_mm256_blendv_pd(i2d(d09), i2d(d08), i2d(cmp)));
+ d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(tmp), i2d(cmp)));
+
+ tmp = d10;
+ cmp = _mm256_cmpgt_epi64(d07, d10);
+ d10 = d2i(_mm256_blendv_pd(i2d(d10), i2d(d07), i2d(cmp)));
+ d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(tmp), i2d(cmp)));
+
+ tmp = d11;
+ cmp = _mm256_cmpgt_epi64(d06, d11);
+ d11 = d2i(_mm256_blendv_pd(i2d(d11), i2d(d06), i2d(cmp)));
+ d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(tmp), i2d(cmp)));
+
+ tmp = d12;
+ cmp = _mm256_cmpgt_epi64(d05, d12);
+ d12 = d2i(_mm256_blendv_pd(i2d(d12), i2d(d05), i2d(cmp)));
+ d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(tmp), i2d(cmp)));
+
+ tmp = d13;
+ cmp = _mm256_cmpgt_epi64(d04, d13);
+ d13 = d2i(_mm256_blendv_pd(i2d(d13), i2d(d04), i2d(cmp)));
+ d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(tmp), i2d(cmp)));
+
+ tmp = d14;
+ cmp = _mm256_cmpgt_epi64(d03, d14);
+ d14 = d2i(_mm256_blendv_pd(i2d(d14), i2d(d03), i2d(cmp)));
+ d03 = d2i(_mm256_blendv_pd(i2d(d03), i2d(tmp), i2d(cmp)));
+
+ tmp = d15;
+ cmp = _mm256_cmpgt_epi64(d02, d15);
+ d15 = d2i(_mm256_blendv_pd(i2d(d15), i2d(d02), i2d(cmp)));
+ d02 = d2i(_mm256_blendv_pd(i2d(d02), i2d(tmp), i2d(cmp)));
+
+ sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_07v_merge_descending(d09, d10, d11, d12, d13, d14, d15);
+ }
+ static INLINE void sort_16v_ascending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13, __m256i& d14, __m256i& d15, __m256i& d16) {
+ __m256i tmp, cmp;
+
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_08v_descending(d09, d10, d11, d12, d13, d14, d15, d16);
+
+ tmp = d09;
+ cmp = _mm256_cmpgt_epi64(d08, d09);
+ d09 = d2i(_mm256_blendv_pd(i2d(d09), i2d(d08), i2d(cmp)));
+ d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(tmp), i2d(cmp)));
+
+ tmp = d10;
+ cmp = _mm256_cmpgt_epi64(d07, d10);
+ d10 = d2i(_mm256_blendv_pd(i2d(d10), i2d(d07), i2d(cmp)));
+ d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(tmp), i2d(cmp)));
+
+ tmp = d11;
+ cmp = _mm256_cmpgt_epi64(d06, d11);
+ d11 = d2i(_mm256_blendv_pd(i2d(d11), i2d(d06), i2d(cmp)));
+ d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(tmp), i2d(cmp)));
+
+ tmp = d12;
+ cmp = _mm256_cmpgt_epi64(d05, d12);
+ d12 = d2i(_mm256_blendv_pd(i2d(d12), i2d(d05), i2d(cmp)));
+ d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(tmp), i2d(cmp)));
+
+ tmp = d13;
+ cmp = _mm256_cmpgt_epi64(d04, d13);
+ d13 = d2i(_mm256_blendv_pd(i2d(d13), i2d(d04), i2d(cmp)));
+ d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(tmp), i2d(cmp)));
+
+ tmp = d14;
+ cmp = _mm256_cmpgt_epi64(d03, d14);
+ d14 = d2i(_mm256_blendv_pd(i2d(d14), i2d(d03), i2d(cmp)));
+ d03 = d2i(_mm256_blendv_pd(i2d(d03), i2d(tmp), i2d(cmp)));
+
+ tmp = d15;
+ cmp = _mm256_cmpgt_epi64(d02, d15);
+ d15 = d2i(_mm256_blendv_pd(i2d(d15), i2d(d02), i2d(cmp)));
+ d02 = d2i(_mm256_blendv_pd(i2d(d02), i2d(tmp), i2d(cmp)));
+
+ tmp = d16;
+ cmp = _mm256_cmpgt_epi64(d01, d16);
+ d16 = d2i(_mm256_blendv_pd(i2d(d16), i2d(d01), i2d(cmp)));
+ d01 = d2i(_mm256_blendv_pd(i2d(d01), i2d(tmp), i2d(cmp)));
+
+ sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_08v_merge_ascending(d09, d10, d11, d12, d13, d14, d15, d16);
+ }
+ static INLINE void sort_16v_descending(__m256i& d01, __m256i& d02, __m256i& d03, __m256i& d04, __m256i& d05, __m256i& d06, __m256i& d07, __m256i& d08, __m256i& d09, __m256i& d10, __m256i& d11, __m256i& d12, __m256i& d13, __m256i& d14, __m256i& d15, __m256i& d16) {
+ __m256i tmp, cmp;
+
+ sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_08v_ascending(d09, d10, d11, d12, d13, d14, d15, d16);
+
+ tmp = d09;
+ cmp = _mm256_cmpgt_epi64(d08, d09);
+ d09 = d2i(_mm256_blendv_pd(i2d(d09), i2d(d08), i2d(cmp)));
+ d08 = d2i(_mm256_blendv_pd(i2d(d08), i2d(tmp), i2d(cmp)));
+
+ tmp = d10;
+ cmp = _mm256_cmpgt_epi64(d07, d10);
+ d10 = d2i(_mm256_blendv_pd(i2d(d10), i2d(d07), i2d(cmp)));
+ d07 = d2i(_mm256_blendv_pd(i2d(d07), i2d(tmp), i2d(cmp)));
+
+ tmp = d11;
+ cmp = _mm256_cmpgt_epi64(d06, d11);
+ d11 = d2i(_mm256_blendv_pd(i2d(d11), i2d(d06), i2d(cmp)));
+ d06 = d2i(_mm256_blendv_pd(i2d(d06), i2d(tmp), i2d(cmp)));
+
+ tmp = d12;
+ cmp = _mm256_cmpgt_epi64(d05, d12);
+ d12 = d2i(_mm256_blendv_pd(i2d(d12), i2d(d05), i2d(cmp)));
+ d05 = d2i(_mm256_blendv_pd(i2d(d05), i2d(tmp), i2d(cmp)));
+
+ tmp = d13;
+ cmp = _mm256_cmpgt_epi64(d04, d13);
+ d13 = d2i(_mm256_blendv_pd(i2d(d13), i2d(d04), i2d(cmp)));
+ d04 = d2i(_mm256_blendv_pd(i2d(d04), i2d(tmp), i2d(cmp)));
+
+ tmp = d14;
+ cmp = _mm256_cmpgt_epi64(d03, d14);
+ d14 = d2i(_mm256_blendv_pd(i2d(d14), i2d(d03), i2d(cmp)));
+ d03 = d2i(_mm256_blendv_pd(i2d(d03), i2d(tmp), i2d(cmp)));
+
+ tmp = d15;
+ cmp = _mm256_cmpgt_epi64(d02, d15);
+ d15 = d2i(_mm256_blendv_pd(i2d(d15), i2d(d02), i2d(cmp)));
+ d02 = d2i(_mm256_blendv_pd(i2d(d02), i2d(tmp), i2d(cmp)));
+
+ tmp = d16;
+ cmp = _mm256_cmpgt_epi64(d01, d16);
+ d16 = d2i(_mm256_blendv_pd(i2d(d16), i2d(d01), i2d(cmp)));
+ d01 = d2i(_mm256_blendv_pd(i2d(d01), i2d(tmp), i2d(cmp)));
+
+ sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_08v_merge_descending(d09, d10, d11, d12, d13, d14, d15, d16);
+ }
+
+ static NOINLINE void sort_01v(int64_t *ptr) {
+ __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);;
+ sort_01v_ascending(d01);
+ _mm256_storeu_si256((__m256i *) ptr + 0, d01);
+}
+
+ static NOINLINE void sort_02v(int64_t *ptr) {
+ __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);;
+ __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);;
+ sort_02v_ascending(d01, d02);
+ _mm256_storeu_si256((__m256i *) ptr + 0, d01);
+ _mm256_storeu_si256((__m256i *) ptr + 1, d02);
+}
+
+ static NOINLINE void sort_03v(int64_t *ptr) {
+ __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);;
+ __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);;
+ __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);;
+ sort_03v_ascending(d01, d02, d03);
+ _mm256_storeu_si256((__m256i *) ptr + 0, d01);
+ _mm256_storeu_si256((__m256i *) ptr + 1, d02);
+ _mm256_storeu_si256((__m256i *) ptr + 2, d03);
+}
+
+ static NOINLINE void sort_04v(int64_t *ptr) {
+ __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);;
+ __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);;
+ __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);;
+ __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);;
+ sort_04v_ascending(d01, d02, d03, d04);
+ _mm256_storeu_si256((__m256i *) ptr + 0, d01);
+ _mm256_storeu_si256((__m256i *) ptr + 1, d02);
+ _mm256_storeu_si256((__m256i *) ptr + 2, d03);
+ _mm256_storeu_si256((__m256i *) ptr + 3, d04);
+}
+
+ static NOINLINE void sort_05v(int64_t *ptr) {
+ __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);;
+ __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);;
+ __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);;
+ __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);;
+ __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);;
+ sort_05v_ascending(d01, d02, d03, d04, d05);
+ _mm256_storeu_si256((__m256i *) ptr + 0, d01);
+ _mm256_storeu_si256((__m256i *) ptr + 1, d02);
+ _mm256_storeu_si256((__m256i *) ptr + 2, d03);
+ _mm256_storeu_si256((__m256i *) ptr + 3, d04);
+ _mm256_storeu_si256((__m256i *) ptr + 4, d05);
+}
+
+ static NOINLINE void sort_06v(int64_t *ptr) {
+ __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);;
+ __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);;
+ __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);;
+ __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);;
+ __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);;
+ __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);;
+ sort_06v_ascending(d01, d02, d03, d04, d05, d06);
+ _mm256_storeu_si256((__m256i *) ptr + 0, d01);
+ _mm256_storeu_si256((__m256i *) ptr + 1, d02);
+ _mm256_storeu_si256((__m256i *) ptr + 2, d03);
+ _mm256_storeu_si256((__m256i *) ptr + 3, d04);
+ _mm256_storeu_si256((__m256i *) ptr + 4, d05);
+ _mm256_storeu_si256((__m256i *) ptr + 5, d06);
+}
+
+ static NOINLINE void sort_07v(int64_t *ptr) {
+ __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);;
+ __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);;
+ __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);;
+ __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);;
+ __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);;
+ __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);;
+ __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);;
+ sort_07v_ascending(d01, d02, d03, d04, d05, d06, d07);
+ _mm256_storeu_si256((__m256i *) ptr + 0, d01);
+ _mm256_storeu_si256((__m256i *) ptr + 1, d02);
+ _mm256_storeu_si256((__m256i *) ptr + 2, d03);
+ _mm256_storeu_si256((__m256i *) ptr + 3, d04);
+ _mm256_storeu_si256((__m256i *) ptr + 4, d05);
+ _mm256_storeu_si256((__m256i *) ptr + 5, d06);
+ _mm256_storeu_si256((__m256i *) ptr + 6, d07);
+}
+
+ static NOINLINE void sort_08v(int64_t *ptr) {
+ __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);;
+ __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);;
+ __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);;
+ __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);;
+ __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);;
+ __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);;
+ __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);;
+ __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);;
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ _mm256_storeu_si256((__m256i *) ptr + 0, d01);
+ _mm256_storeu_si256((__m256i *) ptr + 1, d02);
+ _mm256_storeu_si256((__m256i *) ptr + 2, d03);
+ _mm256_storeu_si256((__m256i *) ptr + 3, d04);
+ _mm256_storeu_si256((__m256i *) ptr + 4, d05);
+ _mm256_storeu_si256((__m256i *) ptr + 5, d06);
+ _mm256_storeu_si256((__m256i *) ptr + 6, d07);
+ _mm256_storeu_si256((__m256i *) ptr + 7, d08);
+}
+
+ static NOINLINE void sort_09v(int64_t *ptr) {
+ __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);;
+ __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);;
+ __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);;
+ __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);;
+ __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);;
+ __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);;
+ __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);;
+ __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);;
+ __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);;
+ sort_09v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09);
+ _mm256_storeu_si256((__m256i *) ptr + 0, d01);
+ _mm256_storeu_si256((__m256i *) ptr + 1, d02);
+ _mm256_storeu_si256((__m256i *) ptr + 2, d03);
+ _mm256_storeu_si256((__m256i *) ptr + 3, d04);
+ _mm256_storeu_si256((__m256i *) ptr + 4, d05);
+ _mm256_storeu_si256((__m256i *) ptr + 5, d06);
+ _mm256_storeu_si256((__m256i *) ptr + 6, d07);
+ _mm256_storeu_si256((__m256i *) ptr + 7, d08);
+ _mm256_storeu_si256((__m256i *) ptr + 8, d09);
+}
+
+ static NOINLINE void sort_10v(int64_t *ptr) {
+ __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);;
+ __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);;
+ __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);;
+ __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);;
+ __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);;
+ __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);;
+ __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);;
+ __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);;
+ __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);;
+ __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);;
+ sort_10v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10);
+ _mm256_storeu_si256((__m256i *) ptr + 0, d01);
+ _mm256_storeu_si256((__m256i *) ptr + 1, d02);
+ _mm256_storeu_si256((__m256i *) ptr + 2, d03);
+ _mm256_storeu_si256((__m256i *) ptr + 3, d04);
+ _mm256_storeu_si256((__m256i *) ptr + 4, d05);
+ _mm256_storeu_si256((__m256i *) ptr + 5, d06);
+ _mm256_storeu_si256((__m256i *) ptr + 6, d07);
+ _mm256_storeu_si256((__m256i *) ptr + 7, d08);
+ _mm256_storeu_si256((__m256i *) ptr + 8, d09);
+ _mm256_storeu_si256((__m256i *) ptr + 9, d10);
+}
+
+ static NOINLINE void sort_11v(int64_t *ptr) {
+ __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);;
+ __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);;
+ __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);;
+ __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);;
+ __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);;
+ __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);;
+ __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);;
+ __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);;
+ __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);;
+ __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);;
+ __m256i d11 = _mm256_lddqu_si256((__m256i const *) ptr + 10);;
+ sort_11v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11);
+ _mm256_storeu_si256((__m256i *) ptr + 0, d01);
+ _mm256_storeu_si256((__m256i *) ptr + 1, d02);
+ _mm256_storeu_si256((__m256i *) ptr + 2, d03);
+ _mm256_storeu_si256((__m256i *) ptr + 3, d04);
+ _mm256_storeu_si256((__m256i *) ptr + 4, d05);
+ _mm256_storeu_si256((__m256i *) ptr + 5, d06);
+ _mm256_storeu_si256((__m256i *) ptr + 6, d07);
+ _mm256_storeu_si256((__m256i *) ptr + 7, d08);
+ _mm256_storeu_si256((__m256i *) ptr + 8, d09);
+ _mm256_storeu_si256((__m256i *) ptr + 9, d10);
+ _mm256_storeu_si256((__m256i *) ptr + 10, d11);
+}
+
+ static NOINLINE void sort_12v(int64_t *ptr) {
+ __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);;
+ __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);;
+ __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);;
+ __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);;
+ __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);;
+ __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);;
+ __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);;
+ __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);;
+ __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);;
+ __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);;
+ __m256i d11 = _mm256_lddqu_si256((__m256i const *) ptr + 10);;
+ __m256i d12 = _mm256_lddqu_si256((__m256i const *) ptr + 11);;
+ sort_12v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12);
+ _mm256_storeu_si256((__m256i *) ptr + 0, d01);
+ _mm256_storeu_si256((__m256i *) ptr + 1, d02);
+ _mm256_storeu_si256((__m256i *) ptr + 2, d03);
+ _mm256_storeu_si256((__m256i *) ptr + 3, d04);
+ _mm256_storeu_si256((__m256i *) ptr + 4, d05);
+ _mm256_storeu_si256((__m256i *) ptr + 5, d06);
+ _mm256_storeu_si256((__m256i *) ptr + 6, d07);
+ _mm256_storeu_si256((__m256i *) ptr + 7, d08);
+ _mm256_storeu_si256((__m256i *) ptr + 8, d09);
+ _mm256_storeu_si256((__m256i *) ptr + 9, d10);
+ _mm256_storeu_si256((__m256i *) ptr + 10, d11);
+ _mm256_storeu_si256((__m256i *) ptr + 11, d12);
+}
+
+ static NOINLINE void sort_13v(int64_t *ptr) {
+ __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);;
+ __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);;
+ __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);;
+ __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);;
+ __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);;
+ __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);;
+ __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);;
+ __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);;
+ __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);;
+ __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);;
+ __m256i d11 = _mm256_lddqu_si256((__m256i const *) ptr + 10);;
+ __m256i d12 = _mm256_lddqu_si256((__m256i const *) ptr + 11);;
+ __m256i d13 = _mm256_lddqu_si256((__m256i const *) ptr + 12);;
+ sort_13v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13);
+ _mm256_storeu_si256((__m256i *) ptr + 0, d01);
+ _mm256_storeu_si256((__m256i *) ptr + 1, d02);
+ _mm256_storeu_si256((__m256i *) ptr + 2, d03);
+ _mm256_storeu_si256((__m256i *) ptr + 3, d04);
+ _mm256_storeu_si256((__m256i *) ptr + 4, d05);
+ _mm256_storeu_si256((__m256i *) ptr + 5, d06);
+ _mm256_storeu_si256((__m256i *) ptr + 6, d07);
+ _mm256_storeu_si256((__m256i *) ptr + 7, d08);
+ _mm256_storeu_si256((__m256i *) ptr + 8, d09);
+ _mm256_storeu_si256((__m256i *) ptr + 9, d10);
+ _mm256_storeu_si256((__m256i *) ptr + 10, d11);
+ _mm256_storeu_si256((__m256i *) ptr + 11, d12);
+ _mm256_storeu_si256((__m256i *) ptr + 12, d13);
+}
+
+ static NOINLINE void sort_14v(int64_t *ptr) {
+ __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);;
+ __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);;
+ __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);;
+ __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);;
+ __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);;
+ __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);;
+ __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);;
+ __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);;
+ __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);;
+ __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);;
+ __m256i d11 = _mm256_lddqu_si256((__m256i const *) ptr + 10);;
+ __m256i d12 = _mm256_lddqu_si256((__m256i const *) ptr + 11);;
+ __m256i d13 = _mm256_lddqu_si256((__m256i const *) ptr + 12);;
+ __m256i d14 = _mm256_lddqu_si256((__m256i const *) ptr + 13);;
+ sort_14v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14);
+ _mm256_storeu_si256((__m256i *) ptr + 0, d01);
+ _mm256_storeu_si256((__m256i *) ptr + 1, d02);
+ _mm256_storeu_si256((__m256i *) ptr + 2, d03);
+ _mm256_storeu_si256((__m256i *) ptr + 3, d04);
+ _mm256_storeu_si256((__m256i *) ptr + 4, d05);
+ _mm256_storeu_si256((__m256i *) ptr + 5, d06);
+ _mm256_storeu_si256((__m256i *) ptr + 6, d07);
+ _mm256_storeu_si256((__m256i *) ptr + 7, d08);
+ _mm256_storeu_si256((__m256i *) ptr + 8, d09);
+ _mm256_storeu_si256((__m256i *) ptr + 9, d10);
+ _mm256_storeu_si256((__m256i *) ptr + 10, d11);
+ _mm256_storeu_si256((__m256i *) ptr + 11, d12);
+ _mm256_storeu_si256((__m256i *) ptr + 12, d13);
+ _mm256_storeu_si256((__m256i *) ptr + 13, d14);
+}
+
+ static NOINLINE void sort_15v(int64_t *ptr) {
+ __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);;
+ __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);;
+ __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);;
+ __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);;
+ __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);;
+ __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);;
+ __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);;
+ __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);;
+ __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);;
+ __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);;
+ __m256i d11 = _mm256_lddqu_si256((__m256i const *) ptr + 10);;
+ __m256i d12 = _mm256_lddqu_si256((__m256i const *) ptr + 11);;
+ __m256i d13 = _mm256_lddqu_si256((__m256i const *) ptr + 12);;
+ __m256i d14 = _mm256_lddqu_si256((__m256i const *) ptr + 13);;
+ __m256i d15 = _mm256_lddqu_si256((__m256i const *) ptr + 14);;
+ sort_15v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14, d15);
+ _mm256_storeu_si256((__m256i *) ptr + 0, d01);
+ _mm256_storeu_si256((__m256i *) ptr + 1, d02);
+ _mm256_storeu_si256((__m256i *) ptr + 2, d03);
+ _mm256_storeu_si256((__m256i *) ptr + 3, d04);
+ _mm256_storeu_si256((__m256i *) ptr + 4, d05);
+ _mm256_storeu_si256((__m256i *) ptr + 5, d06);
+ _mm256_storeu_si256((__m256i *) ptr + 6, d07);
+ _mm256_storeu_si256((__m256i *) ptr + 7, d08);
+ _mm256_storeu_si256((__m256i *) ptr + 8, d09);
+ _mm256_storeu_si256((__m256i *) ptr + 9, d10);
+ _mm256_storeu_si256((__m256i *) ptr + 10, d11);
+ _mm256_storeu_si256((__m256i *) ptr + 11, d12);
+ _mm256_storeu_si256((__m256i *) ptr + 12, d13);
+ _mm256_storeu_si256((__m256i *) ptr + 13, d14);
+ _mm256_storeu_si256((__m256i *) ptr + 14, d15);
+}
+
+ static NOINLINE void sort_16v(int64_t *ptr) {
+ __m256i d01 = _mm256_lddqu_si256((__m256i const *) ptr + 0);;
+ __m256i d02 = _mm256_lddqu_si256((__m256i const *) ptr + 1);;
+ __m256i d03 = _mm256_lddqu_si256((__m256i const *) ptr + 2);;
+ __m256i d04 = _mm256_lddqu_si256((__m256i const *) ptr + 3);;
+ __m256i d05 = _mm256_lddqu_si256((__m256i const *) ptr + 4);;
+ __m256i d06 = _mm256_lddqu_si256((__m256i const *) ptr + 5);;
+ __m256i d07 = _mm256_lddqu_si256((__m256i const *) ptr + 6);;
+ __m256i d08 = _mm256_lddqu_si256((__m256i const *) ptr + 7);;
+ __m256i d09 = _mm256_lddqu_si256((__m256i const *) ptr + 8);;
+ __m256i d10 = _mm256_lddqu_si256((__m256i const *) ptr + 9);;
+ __m256i d11 = _mm256_lddqu_si256((__m256i const *) ptr + 10);;
+ __m256i d12 = _mm256_lddqu_si256((__m256i const *) ptr + 11);;
+ __m256i d13 = _mm256_lddqu_si256((__m256i const *) ptr + 12);;
+ __m256i d14 = _mm256_lddqu_si256((__m256i const *) ptr + 13);;
+ __m256i d15 = _mm256_lddqu_si256((__m256i const *) ptr + 14);;
+ __m256i d16 = _mm256_lddqu_si256((__m256i const *) ptr + 15);;
+ sort_16v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14, d15, d16);
+ _mm256_storeu_si256((__m256i *) ptr + 0, d01);
+ _mm256_storeu_si256((__m256i *) ptr + 1, d02);
+ _mm256_storeu_si256((__m256i *) ptr + 2, d03);
+ _mm256_storeu_si256((__m256i *) ptr + 3, d04);
+ _mm256_storeu_si256((__m256i *) ptr + 4, d05);
+ _mm256_storeu_si256((__m256i *) ptr + 5, d06);
+ _mm256_storeu_si256((__m256i *) ptr + 6, d07);
+ _mm256_storeu_si256((__m256i *) ptr + 7, d08);
+ _mm256_storeu_si256((__m256i *) ptr + 8, d09);
+ _mm256_storeu_si256((__m256i *) ptr + 9, d10);
+ _mm256_storeu_si256((__m256i *) ptr + 10, d11);
+ _mm256_storeu_si256((__m256i *) ptr + 11, d12);
+ _mm256_storeu_si256((__m256i *) ptr + 12, d13);
+ _mm256_storeu_si256((__m256i *) ptr + 13, d14);
+ _mm256_storeu_si256((__m256i *) ptr + 14, d15);
+ _mm256_storeu_si256((__m256i *) ptr + 15, d16);
+}
+ static void sort(int64_t *ptr, size_t length);
+
+};
+}
+}
+
+#undef i2d
+#undef d2i
+#undef i2s
+#undef s2i
+#undef s2d
+#undef d2s
+
+#ifdef __GNUC__
+#ifdef __clang__
+#pragma clang attribute pop
+#else
+#pragma GCC pop_options
+#endif
+#endif
+#endif
+
diff --git a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int32_t.generated.cpp b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int32_t.generated.cpp
new file mode 100644
index 000000000000..9efdf598ea49
--- /dev/null
+++ b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int32_t.generated.cpp
@@ -0,0 +1,30 @@
+// 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"
+#include "bitonic_sort.AVX512.int32_t.generated.h"
+
+using namespace vxsort;
+
+void vxsort::smallsort::bitonic::sort(int32_t *ptr, size_t length) {
+ const int N = 16;
+
+ switch(length / N) {
+ case 1: sort_01v(ptr); break;
+ case 2: sort_02v(ptr); break;
+ case 3: sort_03v(ptr); break;
+ case 4: sort_04v(ptr); break;
+ case 5: sort_05v(ptr); break;
+ case 6: sort_06v(ptr); break;
+ case 7: sort_07v(ptr); break;
+ case 8: sort_08v(ptr); break;
+ case 9: sort_09v(ptr); break;
+ case 10: sort_10v(ptr); break;
+ case 11: sort_11v(ptr); break;
+ case 12: sort_12v(ptr); break;
+ case 13: sort_13v(ptr); break;
+ case 14: sort_14v(ptr); break;
+ case 15: sort_15v(ptr); break;
+ case 16: sort_16v(ptr); break;
+ }
+}
diff --git a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int32_t.generated.h b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int32_t.generated.h
new file mode 100644
index 000000000000..21c992c3e0df
--- /dev/null
+++ b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int32_t.generated.h
@@ -0,0 +1,1387 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+/////////////////////////////////////////////////////////////////////////////
+////
+// This file was auto-generated by a tool at 2020-06-22 05:27:48
+//
+// It is recommended you DO NOT directly edit this file but instead edit
+// the code-generator that generated this source file instead.
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BITONIC_SORT_AVX512_INT32_T_H
+#define BITONIC_SORT_AVX512_INT32_T_H
+
+
+#ifdef __GNUC__
+#ifdef __clang__
+#pragma clang attribute push (__attribute__((target("avx512f"))), apply_to = any(function))
+#else
+#pragma GCC push_options
+#pragma GCC target("avx512f")
+#endif
+#endif
+
+#include
+#include "bitonic_sort.h"
+
+#define i2d _mm512_castsi512_pd
+#define d2i _mm512_castpd_si512
+#define i2s _mm512_castsi512_ps
+#define s2i _mm512_castps_si512
+#define s2d _mm512_castps_pd
+#define d2s _mm521_castpd_ps
+
+namespace vxsort {
+namespace smallsort {
+template<> struct bitonic {
+public:
+
+ static INLINE void sort_01v_ascending(__m512i& d01) {
+ __m512i min, s;
+
+ s = _mm512_shuffle_epi32(d01, _MM_PERM_CDAB);
+ min = _mm512_min_epi32(s, d01);
+ d01 = _mm512_mask_max_epi32(min, 0xAAAA, s, d01);
+
+ s = _mm512_shuffle_epi32(d01, _MM_PERM_ABCD);
+ min = _mm512_min_epi32(s, d01);
+ d01 = _mm512_mask_max_epi32(min, 0xCCCC, s, d01);
+
+ s = _mm512_shuffle_epi32(d01, _MM_PERM_CDAB);
+ min = _mm512_min_epi32(s, d01);
+ d01 = _mm512_mask_max_epi32(min, 0xAAAA, s, d01);
+
+ s = _mm512_permutex_epi64(_mm512_shuffle_epi32(d01, _MM_PERM_ABCD), _MM_PERM_BADC);
+ min = _mm512_min_epi32(s, d01);
+ d01 = _mm512_mask_max_epi32(min, 0xF0F0, s, d01);
+
+ s = _mm512_shuffle_epi32(d01, _MM_PERM_BADC);
+ min = _mm512_min_epi32(s, d01);
+ d01 = _mm512_mask_max_epi32(min, 0xCCCC, s, d01);
+
+ s = _mm512_shuffle_epi32(d01, _MM_PERM_CDAB);
+ min = _mm512_min_epi32(s, d01);
+ d01 = _mm512_mask_max_epi32(min, 0xAAAA, s, d01);
+
+ s = _mm512_shuffle_i64x2(_mm512_shuffle_epi32(d01, _MM_PERM_ABCD), _mm512_shuffle_epi32(d01, _MM_PERM_ABCD), _MM_PERM_ABCD);
+ min = _mm512_min_epi32(s, d01);
+ d01 = _mm512_mask_max_epi32(min, 0xFF00, s, d01);
+
+ s = _mm512_permutex_epi64(d01, _MM_PERM_BADC);
+ min = _mm512_min_epi32(s, d01);
+ d01 = _mm512_mask_max_epi32(min, 0xF0F0, s, d01);
+
+ s = _mm512_shuffle_epi32(d01, _MM_PERM_BADC);
+ min = _mm512_min_epi32(s, d01);
+ d01 = _mm512_mask_max_epi32(min, 0xCCCC, s, d01);
+
+ s = _mm512_shuffle_epi32(d01, _MM_PERM_CDAB);
+ min = _mm512_min_epi32(s, d01);
+ d01 = _mm512_mask_max_epi32(min, 0xAAAA, s, d01);
+ }
+ static INLINE void sort_01v_merge_ascending(__m512i& d01) {
+ __m512i min, s;
+
+ s = _mm512_shuffle_i64x2(d01, d01, _MM_PERM_BADC);
+ min = _mm512_min_epi32(s, d01);
+ d01 = _mm512_mask_max_epi32(min, 0xFF00, s, d01);
+
+ s = _mm512_permutex_epi64(d01, _MM_PERM_BADC);
+ min = _mm512_min_epi32(s, d01);
+ d01 = _mm512_mask_max_epi32(min, 0xF0F0, s, d01);
+
+ s = _mm512_shuffle_epi32(d01, _MM_PERM_BADC);
+ min = _mm512_min_epi32(s, d01);
+ d01 = _mm512_mask_max_epi32(min, 0xCCCC, s, d01);
+
+ s = _mm512_shuffle_epi32(d01, _MM_PERM_CDAB);
+ min = _mm512_min_epi32(s, d01);
+ d01 = _mm512_mask_max_epi32(min, 0xAAAA, s, d01);
+ }
+ static INLINE void sort_01v_descending(__m512i& d01) {
+ __m512i min, s;
+
+ s = _mm512_shuffle_epi32(d01, _MM_PERM_CDAB);
+ min = _mm512_min_epi32(s, d01);
+ d01 = _mm512_mask_max_epi32(min, 0x5555, s, d01);
+
+ s = _mm512_shuffle_epi32(d01, _MM_PERM_ABCD);
+ min = _mm512_min_epi32(s, d01);
+ d01 = _mm512_mask_max_epi32(min, 0x3333, s, d01);
+
+ s = _mm512_shuffle_epi32(d01, _MM_PERM_CDAB);
+ min = _mm512_min_epi32(s, d01);
+ d01 = _mm512_mask_max_epi32(min, 0x5555, s, d01);
+
+ s = _mm512_permutex_epi64(_mm512_shuffle_epi32(d01, _MM_PERM_ABCD), _MM_PERM_BADC);
+ min = _mm512_min_epi32(s, d01);
+ d01 = _mm512_mask_max_epi32(min, 0x0F0F, s, d01);
+
+ s = _mm512_shuffle_epi32(d01, _MM_PERM_BADC);
+ min = _mm512_min_epi32(s, d01);
+ d01 = _mm512_mask_max_epi32(min, 0x3333, s, d01);
+
+ s = _mm512_shuffle_epi32(d01, _MM_PERM_CDAB);
+ min = _mm512_min_epi32(s, d01);
+ d01 = _mm512_mask_max_epi32(min, 0x5555, s, d01);
+
+ s = _mm512_shuffle_i64x2(_mm512_shuffle_epi32(d01, _MM_PERM_ABCD), _mm512_shuffle_epi32(d01, _MM_PERM_ABCD), _MM_PERM_ABCD);
+ min = _mm512_min_epi32(s, d01);
+ d01 = _mm512_mask_max_epi32(min, 0x00FF, s, d01);
+
+ s = _mm512_permutex_epi64(d01, _MM_PERM_BADC);
+ min = _mm512_min_epi32(s, d01);
+ d01 = _mm512_mask_max_epi32(min, 0x0F0F, s, d01);
+
+ s = _mm512_shuffle_epi32(d01, _MM_PERM_BADC);
+ min = _mm512_min_epi32(s, d01);
+ d01 = _mm512_mask_max_epi32(min, 0x3333, s, d01);
+
+ s = _mm512_shuffle_epi32(d01, _MM_PERM_CDAB);
+ min = _mm512_min_epi32(s, d01);
+ d01 = _mm512_mask_max_epi32(min, 0x5555, s, d01);
+ }
+ static INLINE void sort_01v_merge_descending(__m512i& d01) {
+ __m512i min, s;
+
+ s = _mm512_shuffle_i64x2(d01, d01, _MM_PERM_BADC);
+ min = _mm512_min_epi32(s, d01);
+ d01 = _mm512_mask_max_epi32(min, 0x00FF, s, d01);
+
+ s = _mm512_permutex_epi64(d01, _MM_PERM_BADC);
+ min = _mm512_min_epi32(s, d01);
+ d01 = _mm512_mask_max_epi32(min, 0x0F0F, s, d01);
+
+ s = _mm512_shuffle_epi32(d01, _MM_PERM_BADC);
+ min = _mm512_min_epi32(s, d01);
+ d01 = _mm512_mask_max_epi32(min, 0x3333, s, d01);
+
+ s = _mm512_shuffle_epi32(d01, _MM_PERM_CDAB);
+ min = _mm512_min_epi32(s, d01);
+ d01 = _mm512_mask_max_epi32(min, 0x5555, s, d01);
+ }
+ static INLINE void sort_02v_ascending(__m512i& d01, __m512i& d02) {
+ __m512i tmp;
+
+ sort_01v_ascending(d01);
+ sort_01v_descending(d02);
+
+ tmp = d02;
+ d02 = _mm512_max_epi32(d01, d02);
+ d01 = _mm512_min_epi32(d01, tmp);
+
+ sort_01v_merge_ascending(d01);
+ sort_01v_merge_ascending(d02);
+ }
+ static INLINE void sort_02v_descending(__m512i& d01, __m512i& d02) {
+ __m512i tmp;
+
+ sort_01v_descending(d01);
+ sort_01v_ascending(d02);
+
+ tmp = d02;
+ d02 = _mm512_max_epi32(d01, d02);
+ d01 = _mm512_min_epi32(d01, tmp);
+
+ sort_01v_merge_descending(d01);
+ sort_01v_merge_descending(d02);
+ }
+ static INLINE void sort_02v_merge_ascending(__m512i& d01, __m512i& d02) {
+ __m512i tmp;
+
+ tmp = d01;
+ d01 = _mm512_min_epi32(d02, d01);
+ d02 = _mm512_max_epi32(d02, tmp);
+
+ sort_01v_merge_ascending(d01);
+ sort_01v_merge_ascending(d02);
+ }
+ static INLINE void sort_02v_merge_descending(__m512i& d01, __m512i& d02) {
+ __m512i tmp;
+
+ tmp = d01;
+ d01 = _mm512_min_epi32(d02, d01);
+ d02 = _mm512_max_epi32(d02, tmp);
+
+ sort_01v_merge_descending(d01);
+ sort_01v_merge_descending(d02);
+ }
+ static INLINE void sort_03v_ascending(__m512i& d01, __m512i& d02, __m512i& d03) {
+ __m512i tmp;
+
+ sort_02v_ascending(d01, d02);
+ sort_01v_descending(d03);
+
+ tmp = d03;
+ d03 = _mm512_max_epi32(d02, d03);
+ d02 = _mm512_min_epi32(d02, tmp);
+
+ sort_02v_merge_ascending(d01, d02);
+ sort_01v_merge_ascending(d03);
+ }
+ static INLINE void sort_03v_descending(__m512i& d01, __m512i& d02, __m512i& d03) {
+ __m512i tmp;
+
+ sort_02v_descending(d01, d02);
+ sort_01v_ascending(d03);
+
+ tmp = d03;
+ d03 = _mm512_max_epi32(d02, d03);
+ d02 = _mm512_min_epi32(d02, tmp);
+
+ sort_02v_merge_descending(d01, d02);
+ sort_01v_merge_descending(d03);
+ }
+ static INLINE void sort_03v_merge_ascending(__m512i& d01, __m512i& d02, __m512i& d03) {
+ __m512i tmp;
+
+ tmp = d01;
+ d01 = _mm512_min_epi32(d03, d01);
+ d03 = _mm512_max_epi32(d03, tmp);
+
+ sort_02v_merge_ascending(d01, d02);
+ sort_01v_merge_ascending(d03);
+ }
+ static INLINE void sort_03v_merge_descending(__m512i& d01, __m512i& d02, __m512i& d03) {
+ __m512i tmp;
+
+ tmp = d01;
+ d01 = _mm512_min_epi32(d03, d01);
+ d03 = _mm512_max_epi32(d03, tmp);
+
+ sort_02v_merge_descending(d01, d02);
+ sort_01v_merge_descending(d03);
+ }
+ static INLINE void sort_04v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04) {
+ __m512i tmp;
+
+ sort_02v_ascending(d01, d02);
+ sort_02v_descending(d03, d04);
+
+ tmp = d03;
+ d03 = _mm512_max_epi32(d02, d03);
+ d02 = _mm512_min_epi32(d02, tmp);
+
+ tmp = d04;
+ d04 = _mm512_max_epi32(d01, d04);
+ d01 = _mm512_min_epi32(d01, tmp);
+
+ sort_02v_merge_ascending(d01, d02);
+ sort_02v_merge_ascending(d03, d04);
+ }
+ static INLINE void sort_04v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04) {
+ __m512i tmp;
+
+ sort_02v_descending(d01, d02);
+ sort_02v_ascending(d03, d04);
+
+ tmp = d03;
+ d03 = _mm512_max_epi32(d02, d03);
+ d02 = _mm512_min_epi32(d02, tmp);
+
+ tmp = d04;
+ d04 = _mm512_max_epi32(d01, d04);
+ d01 = _mm512_min_epi32(d01, tmp);
+
+ sort_02v_merge_descending(d01, d02);
+ sort_02v_merge_descending(d03, d04);
+ }
+ static INLINE void sort_04v_merge_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04) {
+ __m512i tmp;
+
+ tmp = d01;
+ d01 = _mm512_min_epi32(d03, d01);
+ d03 = _mm512_max_epi32(d03, tmp);
+
+ tmp = d02;
+ d02 = _mm512_min_epi32(d04, d02);
+ d04 = _mm512_max_epi32(d04, tmp);
+
+ sort_02v_merge_ascending(d01, d02);
+ sort_02v_merge_ascending(d03, d04);
+ }
+ static INLINE void sort_04v_merge_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04) {
+ __m512i tmp;
+
+ tmp = d01;
+ d01 = _mm512_min_epi32(d03, d01);
+ d03 = _mm512_max_epi32(d03, tmp);
+
+ tmp = d02;
+ d02 = _mm512_min_epi32(d04, d02);
+ d04 = _mm512_max_epi32(d04, tmp);
+
+ sort_02v_merge_descending(d01, d02);
+ sort_02v_merge_descending(d03, d04);
+ }
+ static INLINE void sort_05v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05) {
+ __m512i tmp;
+
+ sort_04v_ascending(d01, d02, d03, d04);
+ sort_01v_descending(d05);
+
+ tmp = d05;
+ d05 = _mm512_max_epi32(d04, d05);
+ d04 = _mm512_min_epi32(d04, tmp);
+
+ sort_04v_merge_ascending(d01, d02, d03, d04);
+ sort_01v_merge_ascending(d05);
+ }
+ static INLINE void sort_05v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05) {
+ __m512i tmp;
+
+ sort_04v_descending(d01, d02, d03, d04);
+ sort_01v_ascending(d05);
+
+ tmp = d05;
+ d05 = _mm512_max_epi32(d04, d05);
+ d04 = _mm512_min_epi32(d04, tmp);
+
+ sort_04v_merge_descending(d01, d02, d03, d04);
+ sort_01v_merge_descending(d05);
+ }
+ static INLINE void sort_05v_merge_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05) {
+ __m512i tmp;
+
+ tmp = d01;
+ d01 = _mm512_min_epi32(d05, d01);
+ d05 = _mm512_max_epi32(d05, tmp);
+
+ sort_04v_merge_ascending(d01, d02, d03, d04);
+ sort_01v_merge_ascending(d05);
+ }
+ static INLINE void sort_05v_merge_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05) {
+ __m512i tmp;
+
+ tmp = d01;
+ d01 = _mm512_min_epi32(d05, d01);
+ d05 = _mm512_max_epi32(d05, tmp);
+
+ sort_04v_merge_descending(d01, d02, d03, d04);
+ sort_01v_merge_descending(d05);
+ }
+ static INLINE void sort_06v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06) {
+ __m512i tmp;
+
+ sort_04v_ascending(d01, d02, d03, d04);
+ sort_02v_descending(d05, d06);
+
+ tmp = d05;
+ d05 = _mm512_max_epi32(d04, d05);
+ d04 = _mm512_min_epi32(d04, tmp);
+
+ tmp = d06;
+ d06 = _mm512_max_epi32(d03, d06);
+ d03 = _mm512_min_epi32(d03, tmp);
+
+ sort_04v_merge_ascending(d01, d02, d03, d04);
+ sort_02v_merge_ascending(d05, d06);
+ }
+ static INLINE void sort_06v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06) {
+ __m512i tmp;
+
+ sort_04v_descending(d01, d02, d03, d04);
+ sort_02v_ascending(d05, d06);
+
+ tmp = d05;
+ d05 = _mm512_max_epi32(d04, d05);
+ d04 = _mm512_min_epi32(d04, tmp);
+
+ tmp = d06;
+ d06 = _mm512_max_epi32(d03, d06);
+ d03 = _mm512_min_epi32(d03, tmp);
+
+ sort_04v_merge_descending(d01, d02, d03, d04);
+ sort_02v_merge_descending(d05, d06);
+ }
+ static INLINE void sort_06v_merge_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06) {
+ __m512i tmp;
+
+ tmp = d01;
+ d01 = _mm512_min_epi32(d05, d01);
+ d05 = _mm512_max_epi32(d05, tmp);
+
+ tmp = d02;
+ d02 = _mm512_min_epi32(d06, d02);
+ d06 = _mm512_max_epi32(d06, tmp);
+
+ sort_04v_merge_ascending(d01, d02, d03, d04);
+ sort_02v_merge_ascending(d05, d06);
+ }
+ static INLINE void sort_06v_merge_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06) {
+ __m512i tmp;
+
+ tmp = d01;
+ d01 = _mm512_min_epi32(d05, d01);
+ d05 = _mm512_max_epi32(d05, tmp);
+
+ tmp = d02;
+ d02 = _mm512_min_epi32(d06, d02);
+ d06 = _mm512_max_epi32(d06, tmp);
+
+ sort_04v_merge_descending(d01, d02, d03, d04);
+ sort_02v_merge_descending(d05, d06);
+ }
+ static INLINE void sort_07v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07) {
+ __m512i tmp;
+
+ sort_04v_ascending(d01, d02, d03, d04);
+ sort_03v_descending(d05, d06, d07);
+
+ tmp = d05;
+ d05 = _mm512_max_epi32(d04, d05);
+ d04 = _mm512_min_epi32(d04, tmp);
+
+ tmp = d06;
+ d06 = _mm512_max_epi32(d03, d06);
+ d03 = _mm512_min_epi32(d03, tmp);
+
+ tmp = d07;
+ d07 = _mm512_max_epi32(d02, d07);
+ d02 = _mm512_min_epi32(d02, tmp);
+
+ sort_04v_merge_ascending(d01, d02, d03, d04);
+ sort_03v_merge_ascending(d05, d06, d07);
+ }
+ static INLINE void sort_07v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07) {
+ __m512i tmp;
+
+ sort_04v_descending(d01, d02, d03, d04);
+ sort_03v_ascending(d05, d06, d07);
+
+ tmp = d05;
+ d05 = _mm512_max_epi32(d04, d05);
+ d04 = _mm512_min_epi32(d04, tmp);
+
+ tmp = d06;
+ d06 = _mm512_max_epi32(d03, d06);
+ d03 = _mm512_min_epi32(d03, tmp);
+
+ tmp = d07;
+ d07 = _mm512_max_epi32(d02, d07);
+ d02 = _mm512_min_epi32(d02, tmp);
+
+ sort_04v_merge_descending(d01, d02, d03, d04);
+ sort_03v_merge_descending(d05, d06, d07);
+ }
+ static INLINE void sort_07v_merge_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07) {
+ __m512i tmp;
+
+ tmp = d01;
+ d01 = _mm512_min_epi32(d05, d01);
+ d05 = _mm512_max_epi32(d05, tmp);
+
+ tmp = d02;
+ d02 = _mm512_min_epi32(d06, d02);
+ d06 = _mm512_max_epi32(d06, tmp);
+
+ tmp = d03;
+ d03 = _mm512_min_epi32(d07, d03);
+ d07 = _mm512_max_epi32(d07, tmp);
+
+ sort_04v_merge_ascending(d01, d02, d03, d04);
+ sort_03v_merge_ascending(d05, d06, d07);
+ }
+ static INLINE void sort_07v_merge_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07) {
+ __m512i tmp;
+
+ tmp = d01;
+ d01 = _mm512_min_epi32(d05, d01);
+ d05 = _mm512_max_epi32(d05, tmp);
+
+ tmp = d02;
+ d02 = _mm512_min_epi32(d06, d02);
+ d06 = _mm512_max_epi32(d06, tmp);
+
+ tmp = d03;
+ d03 = _mm512_min_epi32(d07, d03);
+ d07 = _mm512_max_epi32(d07, tmp);
+
+ sort_04v_merge_descending(d01, d02, d03, d04);
+ sort_03v_merge_descending(d05, d06, d07);
+ }
+ static INLINE void sort_08v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08) {
+ __m512i tmp;
+
+ sort_04v_ascending(d01, d02, d03, d04);
+ sort_04v_descending(d05, d06, d07, d08);
+
+ tmp = d05;
+ d05 = _mm512_max_epi32(d04, d05);
+ d04 = _mm512_min_epi32(d04, tmp);
+
+ tmp = d06;
+ d06 = _mm512_max_epi32(d03, d06);
+ d03 = _mm512_min_epi32(d03, tmp);
+
+ tmp = d07;
+ d07 = _mm512_max_epi32(d02, d07);
+ d02 = _mm512_min_epi32(d02, tmp);
+
+ tmp = d08;
+ d08 = _mm512_max_epi32(d01, d08);
+ d01 = _mm512_min_epi32(d01, tmp);
+
+ sort_04v_merge_ascending(d01, d02, d03, d04);
+ sort_04v_merge_ascending(d05, d06, d07, d08);
+ }
+ static INLINE void sort_08v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08) {
+ __m512i tmp;
+
+ sort_04v_descending(d01, d02, d03, d04);
+ sort_04v_ascending(d05, d06, d07, d08);
+
+ tmp = d05;
+ d05 = _mm512_max_epi32(d04, d05);
+ d04 = _mm512_min_epi32(d04, tmp);
+
+ tmp = d06;
+ d06 = _mm512_max_epi32(d03, d06);
+ d03 = _mm512_min_epi32(d03, tmp);
+
+ tmp = d07;
+ d07 = _mm512_max_epi32(d02, d07);
+ d02 = _mm512_min_epi32(d02, tmp);
+
+ tmp = d08;
+ d08 = _mm512_max_epi32(d01, d08);
+ d01 = _mm512_min_epi32(d01, tmp);
+
+ sort_04v_merge_descending(d01, d02, d03, d04);
+ sort_04v_merge_descending(d05, d06, d07, d08);
+ }
+ static INLINE void sort_08v_merge_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08) {
+ __m512i tmp;
+
+ tmp = d01;
+ d01 = _mm512_min_epi32(d05, d01);
+ d05 = _mm512_max_epi32(d05, tmp);
+
+ tmp = d02;
+ d02 = _mm512_min_epi32(d06, d02);
+ d06 = _mm512_max_epi32(d06, tmp);
+
+ tmp = d03;
+ d03 = _mm512_min_epi32(d07, d03);
+ d07 = _mm512_max_epi32(d07, tmp);
+
+ tmp = d04;
+ d04 = _mm512_min_epi32(d08, d04);
+ d08 = _mm512_max_epi32(d08, tmp);
+
+ sort_04v_merge_ascending(d01, d02, d03, d04);
+ sort_04v_merge_ascending(d05, d06, d07, d08);
+ }
+ static INLINE void sort_08v_merge_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08) {
+ __m512i tmp;
+
+ tmp = d01;
+ d01 = _mm512_min_epi32(d05, d01);
+ d05 = _mm512_max_epi32(d05, tmp);
+
+ tmp = d02;
+ d02 = _mm512_min_epi32(d06, d02);
+ d06 = _mm512_max_epi32(d06, tmp);
+
+ tmp = d03;
+ d03 = _mm512_min_epi32(d07, d03);
+ d07 = _mm512_max_epi32(d07, tmp);
+
+ tmp = d04;
+ d04 = _mm512_min_epi32(d08, d04);
+ d08 = _mm512_max_epi32(d08, tmp);
+
+ sort_04v_merge_descending(d01, d02, d03, d04);
+ sort_04v_merge_descending(d05, d06, d07, d08);
+ }
+ static INLINE void sort_09v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09) {
+ __m512i tmp;
+
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_01v_descending(d09);
+
+ tmp = d09;
+ d09 = _mm512_max_epi32(d08, d09);
+ d08 = _mm512_min_epi32(d08, tmp);
+
+ sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_01v_merge_ascending(d09);
+ }
+ static INLINE void sort_09v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09) {
+ __m512i tmp;
+
+ sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_01v_ascending(d09);
+
+ tmp = d09;
+ d09 = _mm512_max_epi32(d08, d09);
+ d08 = _mm512_min_epi32(d08, tmp);
+
+ sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_01v_merge_descending(d09);
+ }
+ static INLINE void sort_10v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10) {
+ __m512i tmp;
+
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_02v_descending(d09, d10);
+
+ tmp = d09;
+ d09 = _mm512_max_epi32(d08, d09);
+ d08 = _mm512_min_epi32(d08, tmp);
+
+ tmp = d10;
+ d10 = _mm512_max_epi32(d07, d10);
+ d07 = _mm512_min_epi32(d07, tmp);
+
+ sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_02v_merge_ascending(d09, d10);
+ }
+ static INLINE void sort_10v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10) {
+ __m512i tmp;
+
+ sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_02v_ascending(d09, d10);
+
+ tmp = d09;
+ d09 = _mm512_max_epi32(d08, d09);
+ d08 = _mm512_min_epi32(d08, tmp);
+
+ tmp = d10;
+ d10 = _mm512_max_epi32(d07, d10);
+ d07 = _mm512_min_epi32(d07, tmp);
+
+ sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_02v_merge_descending(d09, d10);
+ }
+ static INLINE void sort_11v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11) {
+ __m512i tmp;
+
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_03v_descending(d09, d10, d11);
+
+ tmp = d09;
+ d09 = _mm512_max_epi32(d08, d09);
+ d08 = _mm512_min_epi32(d08, tmp);
+
+ tmp = d10;
+ d10 = _mm512_max_epi32(d07, d10);
+ d07 = _mm512_min_epi32(d07, tmp);
+
+ tmp = d11;
+ d11 = _mm512_max_epi32(d06, d11);
+ d06 = _mm512_min_epi32(d06, tmp);
+
+ sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_03v_merge_ascending(d09, d10, d11);
+ }
+ static INLINE void sort_11v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11) {
+ __m512i tmp;
+
+ sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_03v_ascending(d09, d10, d11);
+
+ tmp = d09;
+ d09 = _mm512_max_epi32(d08, d09);
+ d08 = _mm512_min_epi32(d08, tmp);
+
+ tmp = d10;
+ d10 = _mm512_max_epi32(d07, d10);
+ d07 = _mm512_min_epi32(d07, tmp);
+
+ tmp = d11;
+ d11 = _mm512_max_epi32(d06, d11);
+ d06 = _mm512_min_epi32(d06, tmp);
+
+ sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_03v_merge_descending(d09, d10, d11);
+ }
+ static INLINE void sort_12v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12) {
+ __m512i tmp;
+
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_04v_descending(d09, d10, d11, d12);
+
+ tmp = d09;
+ d09 = _mm512_max_epi32(d08, d09);
+ d08 = _mm512_min_epi32(d08, tmp);
+
+ tmp = d10;
+ d10 = _mm512_max_epi32(d07, d10);
+ d07 = _mm512_min_epi32(d07, tmp);
+
+ tmp = d11;
+ d11 = _mm512_max_epi32(d06, d11);
+ d06 = _mm512_min_epi32(d06, tmp);
+
+ tmp = d12;
+ d12 = _mm512_max_epi32(d05, d12);
+ d05 = _mm512_min_epi32(d05, tmp);
+
+ sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_04v_merge_ascending(d09, d10, d11, d12);
+ }
+ static INLINE void sort_12v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12) {
+ __m512i tmp;
+
+ sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_04v_ascending(d09, d10, d11, d12);
+
+ tmp = d09;
+ d09 = _mm512_max_epi32(d08, d09);
+ d08 = _mm512_min_epi32(d08, tmp);
+
+ tmp = d10;
+ d10 = _mm512_max_epi32(d07, d10);
+ d07 = _mm512_min_epi32(d07, tmp);
+
+ tmp = d11;
+ d11 = _mm512_max_epi32(d06, d11);
+ d06 = _mm512_min_epi32(d06, tmp);
+
+ tmp = d12;
+ d12 = _mm512_max_epi32(d05, d12);
+ d05 = _mm512_min_epi32(d05, tmp);
+
+ sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_04v_merge_descending(d09, d10, d11, d12);
+ }
+ static INLINE void sort_13v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13) {
+ __m512i tmp;
+
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_05v_descending(d09, d10, d11, d12, d13);
+
+ tmp = d09;
+ d09 = _mm512_max_epi32(d08, d09);
+ d08 = _mm512_min_epi32(d08, tmp);
+
+ tmp = d10;
+ d10 = _mm512_max_epi32(d07, d10);
+ d07 = _mm512_min_epi32(d07, tmp);
+
+ tmp = d11;
+ d11 = _mm512_max_epi32(d06, d11);
+ d06 = _mm512_min_epi32(d06, tmp);
+
+ tmp = d12;
+ d12 = _mm512_max_epi32(d05, d12);
+ d05 = _mm512_min_epi32(d05, tmp);
+
+ tmp = d13;
+ d13 = _mm512_max_epi32(d04, d13);
+ d04 = _mm512_min_epi32(d04, tmp);
+
+ sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_05v_merge_ascending(d09, d10, d11, d12, d13);
+ }
+ static INLINE void sort_13v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13) {
+ __m512i tmp;
+
+ sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_05v_ascending(d09, d10, d11, d12, d13);
+
+ tmp = d09;
+ d09 = _mm512_max_epi32(d08, d09);
+ d08 = _mm512_min_epi32(d08, tmp);
+
+ tmp = d10;
+ d10 = _mm512_max_epi32(d07, d10);
+ d07 = _mm512_min_epi32(d07, tmp);
+
+ tmp = d11;
+ d11 = _mm512_max_epi32(d06, d11);
+ d06 = _mm512_min_epi32(d06, tmp);
+
+ tmp = d12;
+ d12 = _mm512_max_epi32(d05, d12);
+ d05 = _mm512_min_epi32(d05, tmp);
+
+ tmp = d13;
+ d13 = _mm512_max_epi32(d04, d13);
+ d04 = _mm512_min_epi32(d04, tmp);
+
+ sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_05v_merge_descending(d09, d10, d11, d12, d13);
+ }
+ static INLINE void sort_14v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13, __m512i& d14) {
+ __m512i tmp;
+
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_06v_descending(d09, d10, d11, d12, d13, d14);
+
+ tmp = d09;
+ d09 = _mm512_max_epi32(d08, d09);
+ d08 = _mm512_min_epi32(d08, tmp);
+
+ tmp = d10;
+ d10 = _mm512_max_epi32(d07, d10);
+ d07 = _mm512_min_epi32(d07, tmp);
+
+ tmp = d11;
+ d11 = _mm512_max_epi32(d06, d11);
+ d06 = _mm512_min_epi32(d06, tmp);
+
+ tmp = d12;
+ d12 = _mm512_max_epi32(d05, d12);
+ d05 = _mm512_min_epi32(d05, tmp);
+
+ tmp = d13;
+ d13 = _mm512_max_epi32(d04, d13);
+ d04 = _mm512_min_epi32(d04, tmp);
+
+ tmp = d14;
+ d14 = _mm512_max_epi32(d03, d14);
+ d03 = _mm512_min_epi32(d03, tmp);
+
+ sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_06v_merge_ascending(d09, d10, d11, d12, d13, d14);
+ }
+ static INLINE void sort_14v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13, __m512i& d14) {
+ __m512i tmp;
+
+ sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_06v_ascending(d09, d10, d11, d12, d13, d14);
+
+ tmp = d09;
+ d09 = _mm512_max_epi32(d08, d09);
+ d08 = _mm512_min_epi32(d08, tmp);
+
+ tmp = d10;
+ d10 = _mm512_max_epi32(d07, d10);
+ d07 = _mm512_min_epi32(d07, tmp);
+
+ tmp = d11;
+ d11 = _mm512_max_epi32(d06, d11);
+ d06 = _mm512_min_epi32(d06, tmp);
+
+ tmp = d12;
+ d12 = _mm512_max_epi32(d05, d12);
+ d05 = _mm512_min_epi32(d05, tmp);
+
+ tmp = d13;
+ d13 = _mm512_max_epi32(d04, d13);
+ d04 = _mm512_min_epi32(d04, tmp);
+
+ tmp = d14;
+ d14 = _mm512_max_epi32(d03, d14);
+ d03 = _mm512_min_epi32(d03, tmp);
+
+ sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_06v_merge_descending(d09, d10, d11, d12, d13, d14);
+ }
+ static INLINE void sort_15v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13, __m512i& d14, __m512i& d15) {
+ __m512i tmp;
+
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_07v_descending(d09, d10, d11, d12, d13, d14, d15);
+
+ tmp = d09;
+ d09 = _mm512_max_epi32(d08, d09);
+ d08 = _mm512_min_epi32(d08, tmp);
+
+ tmp = d10;
+ d10 = _mm512_max_epi32(d07, d10);
+ d07 = _mm512_min_epi32(d07, tmp);
+
+ tmp = d11;
+ d11 = _mm512_max_epi32(d06, d11);
+ d06 = _mm512_min_epi32(d06, tmp);
+
+ tmp = d12;
+ d12 = _mm512_max_epi32(d05, d12);
+ d05 = _mm512_min_epi32(d05, tmp);
+
+ tmp = d13;
+ d13 = _mm512_max_epi32(d04, d13);
+ d04 = _mm512_min_epi32(d04, tmp);
+
+ tmp = d14;
+ d14 = _mm512_max_epi32(d03, d14);
+ d03 = _mm512_min_epi32(d03, tmp);
+
+ tmp = d15;
+ d15 = _mm512_max_epi32(d02, d15);
+ d02 = _mm512_min_epi32(d02, tmp);
+
+ sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_07v_merge_ascending(d09, d10, d11, d12, d13, d14, d15);
+ }
+ static INLINE void sort_15v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13, __m512i& d14, __m512i& d15) {
+ __m512i tmp;
+
+ sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_07v_ascending(d09, d10, d11, d12, d13, d14, d15);
+
+ tmp = d09;
+ d09 = _mm512_max_epi32(d08, d09);
+ d08 = _mm512_min_epi32(d08, tmp);
+
+ tmp = d10;
+ d10 = _mm512_max_epi32(d07, d10);
+ d07 = _mm512_min_epi32(d07, tmp);
+
+ tmp = d11;
+ d11 = _mm512_max_epi32(d06, d11);
+ d06 = _mm512_min_epi32(d06, tmp);
+
+ tmp = d12;
+ d12 = _mm512_max_epi32(d05, d12);
+ d05 = _mm512_min_epi32(d05, tmp);
+
+ tmp = d13;
+ d13 = _mm512_max_epi32(d04, d13);
+ d04 = _mm512_min_epi32(d04, tmp);
+
+ tmp = d14;
+ d14 = _mm512_max_epi32(d03, d14);
+ d03 = _mm512_min_epi32(d03, tmp);
+
+ tmp = d15;
+ d15 = _mm512_max_epi32(d02, d15);
+ d02 = _mm512_min_epi32(d02, tmp);
+
+ sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_07v_merge_descending(d09, d10, d11, d12, d13, d14, d15);
+ }
+ static INLINE void sort_16v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13, __m512i& d14, __m512i& d15, __m512i& d16) {
+ __m512i tmp;
+
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_08v_descending(d09, d10, d11, d12, d13, d14, d15, d16);
+
+ tmp = d09;
+ d09 = _mm512_max_epi32(d08, d09);
+ d08 = _mm512_min_epi32(d08, tmp);
+
+ tmp = d10;
+ d10 = _mm512_max_epi32(d07, d10);
+ d07 = _mm512_min_epi32(d07, tmp);
+
+ tmp = d11;
+ d11 = _mm512_max_epi32(d06, d11);
+ d06 = _mm512_min_epi32(d06, tmp);
+
+ tmp = d12;
+ d12 = _mm512_max_epi32(d05, d12);
+ d05 = _mm512_min_epi32(d05, tmp);
+
+ tmp = d13;
+ d13 = _mm512_max_epi32(d04, d13);
+ d04 = _mm512_min_epi32(d04, tmp);
+
+ tmp = d14;
+ d14 = _mm512_max_epi32(d03, d14);
+ d03 = _mm512_min_epi32(d03, tmp);
+
+ tmp = d15;
+ d15 = _mm512_max_epi32(d02, d15);
+ d02 = _mm512_min_epi32(d02, tmp);
+
+ tmp = d16;
+ d16 = _mm512_max_epi32(d01, d16);
+ d01 = _mm512_min_epi32(d01, tmp);
+
+ sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_08v_merge_ascending(d09, d10, d11, d12, d13, d14, d15, d16);
+ }
+ static INLINE void sort_16v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13, __m512i& d14, __m512i& d15, __m512i& d16) {
+ __m512i tmp;
+
+ sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_08v_ascending(d09, d10, d11, d12, d13, d14, d15, d16);
+
+ tmp = d09;
+ d09 = _mm512_max_epi32(d08, d09);
+ d08 = _mm512_min_epi32(d08, tmp);
+
+ tmp = d10;
+ d10 = _mm512_max_epi32(d07, d10);
+ d07 = _mm512_min_epi32(d07, tmp);
+
+ tmp = d11;
+ d11 = _mm512_max_epi32(d06, d11);
+ d06 = _mm512_min_epi32(d06, tmp);
+
+ tmp = d12;
+ d12 = _mm512_max_epi32(d05, d12);
+ d05 = _mm512_min_epi32(d05, tmp);
+
+ tmp = d13;
+ d13 = _mm512_max_epi32(d04, d13);
+ d04 = _mm512_min_epi32(d04, tmp);
+
+ tmp = d14;
+ d14 = _mm512_max_epi32(d03, d14);
+ d03 = _mm512_min_epi32(d03, tmp);
+
+ tmp = d15;
+ d15 = _mm512_max_epi32(d02, d15);
+ d02 = _mm512_min_epi32(d02, tmp);
+
+ tmp = d16;
+ d16 = _mm512_max_epi32(d01, d16);
+ d01 = _mm512_min_epi32(d01, tmp);
+
+ sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_08v_merge_descending(d09, d10, d11, d12, d13, d14, d15, d16);
+ }
+
+ static NOINLINE void sort_01v(int32_t *ptr) {
+ __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);;
+ sort_01v_ascending(d01);
+ _mm512_storeu_si512((__m512i *) ptr + 0, d01);
+}
+
+ static NOINLINE void sort_02v(int32_t *ptr) {
+ __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);;
+ __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);;
+ sort_02v_ascending(d01, d02);
+ _mm512_storeu_si512((__m512i *) ptr + 0, d01);
+ _mm512_storeu_si512((__m512i *) ptr + 1, d02);
+}
+
+ static NOINLINE void sort_03v(int32_t *ptr) {
+ __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);;
+ __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);;
+ __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);;
+ sort_03v_ascending(d01, d02, d03);
+ _mm512_storeu_si512((__m512i *) ptr + 0, d01);
+ _mm512_storeu_si512((__m512i *) ptr + 1, d02);
+ _mm512_storeu_si512((__m512i *) ptr + 2, d03);
+}
+
+ static NOINLINE void sort_04v(int32_t *ptr) {
+ __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);;
+ __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);;
+ __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);;
+ __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);;
+ sort_04v_ascending(d01, d02, d03, d04);
+ _mm512_storeu_si512((__m512i *) ptr + 0, d01);
+ _mm512_storeu_si512((__m512i *) ptr + 1, d02);
+ _mm512_storeu_si512((__m512i *) ptr + 2, d03);
+ _mm512_storeu_si512((__m512i *) ptr + 3, d04);
+}
+
+ static NOINLINE void sort_05v(int32_t *ptr) {
+ __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);;
+ __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);;
+ __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);;
+ __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);;
+ __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);;
+ sort_05v_ascending(d01, d02, d03, d04, d05);
+ _mm512_storeu_si512((__m512i *) ptr + 0, d01);
+ _mm512_storeu_si512((__m512i *) ptr + 1, d02);
+ _mm512_storeu_si512((__m512i *) ptr + 2, d03);
+ _mm512_storeu_si512((__m512i *) ptr + 3, d04);
+ _mm512_storeu_si512((__m512i *) ptr + 4, d05);
+}
+
+ static NOINLINE void sort_06v(int32_t *ptr) {
+ __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);;
+ __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);;
+ __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);;
+ __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);;
+ __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);;
+ __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);;
+ sort_06v_ascending(d01, d02, d03, d04, d05, d06);
+ _mm512_storeu_si512((__m512i *) ptr + 0, d01);
+ _mm512_storeu_si512((__m512i *) ptr + 1, d02);
+ _mm512_storeu_si512((__m512i *) ptr + 2, d03);
+ _mm512_storeu_si512((__m512i *) ptr + 3, d04);
+ _mm512_storeu_si512((__m512i *) ptr + 4, d05);
+ _mm512_storeu_si512((__m512i *) ptr + 5, d06);
+}
+
+ static NOINLINE void sort_07v(int32_t *ptr) {
+ __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);;
+ __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);;
+ __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);;
+ __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);;
+ __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);;
+ __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);;
+ __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);;
+ sort_07v_ascending(d01, d02, d03, d04, d05, d06, d07);
+ _mm512_storeu_si512((__m512i *) ptr + 0, d01);
+ _mm512_storeu_si512((__m512i *) ptr + 1, d02);
+ _mm512_storeu_si512((__m512i *) ptr + 2, d03);
+ _mm512_storeu_si512((__m512i *) ptr + 3, d04);
+ _mm512_storeu_si512((__m512i *) ptr + 4, d05);
+ _mm512_storeu_si512((__m512i *) ptr + 5, d06);
+ _mm512_storeu_si512((__m512i *) ptr + 6, d07);
+}
+
+ static NOINLINE void sort_08v(int32_t *ptr) {
+ __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);;
+ __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);;
+ __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);;
+ __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);;
+ __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);;
+ __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);;
+ __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);;
+ __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);;
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ _mm512_storeu_si512((__m512i *) ptr + 0, d01);
+ _mm512_storeu_si512((__m512i *) ptr + 1, d02);
+ _mm512_storeu_si512((__m512i *) ptr + 2, d03);
+ _mm512_storeu_si512((__m512i *) ptr + 3, d04);
+ _mm512_storeu_si512((__m512i *) ptr + 4, d05);
+ _mm512_storeu_si512((__m512i *) ptr + 5, d06);
+ _mm512_storeu_si512((__m512i *) ptr + 6, d07);
+ _mm512_storeu_si512((__m512i *) ptr + 7, d08);
+}
+
+ static NOINLINE void sort_09v(int32_t *ptr) {
+ __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);;
+ __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);;
+ __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);;
+ __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);;
+ __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);;
+ __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);;
+ __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);;
+ __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);;
+ __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);;
+ sort_09v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09);
+ _mm512_storeu_si512((__m512i *) ptr + 0, d01);
+ _mm512_storeu_si512((__m512i *) ptr + 1, d02);
+ _mm512_storeu_si512((__m512i *) ptr + 2, d03);
+ _mm512_storeu_si512((__m512i *) ptr + 3, d04);
+ _mm512_storeu_si512((__m512i *) ptr + 4, d05);
+ _mm512_storeu_si512((__m512i *) ptr + 5, d06);
+ _mm512_storeu_si512((__m512i *) ptr + 6, d07);
+ _mm512_storeu_si512((__m512i *) ptr + 7, d08);
+ _mm512_storeu_si512((__m512i *) ptr + 8, d09);
+}
+
+ static NOINLINE void sort_10v(int32_t *ptr) {
+ __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);;
+ __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);;
+ __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);;
+ __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);;
+ __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);;
+ __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);;
+ __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);;
+ __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);;
+ __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);;
+ __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);;
+ sort_10v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10);
+ _mm512_storeu_si512((__m512i *) ptr + 0, d01);
+ _mm512_storeu_si512((__m512i *) ptr + 1, d02);
+ _mm512_storeu_si512((__m512i *) ptr + 2, d03);
+ _mm512_storeu_si512((__m512i *) ptr + 3, d04);
+ _mm512_storeu_si512((__m512i *) ptr + 4, d05);
+ _mm512_storeu_si512((__m512i *) ptr + 5, d06);
+ _mm512_storeu_si512((__m512i *) ptr + 6, d07);
+ _mm512_storeu_si512((__m512i *) ptr + 7, d08);
+ _mm512_storeu_si512((__m512i *) ptr + 8, d09);
+ _mm512_storeu_si512((__m512i *) ptr + 9, d10);
+}
+
+ static NOINLINE void sort_11v(int32_t *ptr) {
+ __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);;
+ __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);;
+ __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);;
+ __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);;
+ __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);;
+ __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);;
+ __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);;
+ __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);;
+ __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);;
+ __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);;
+ __m512i d11 = _mm512_loadu_si512((__m512i const *) ptr + 10);;
+ sort_11v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11);
+ _mm512_storeu_si512((__m512i *) ptr + 0, d01);
+ _mm512_storeu_si512((__m512i *) ptr + 1, d02);
+ _mm512_storeu_si512((__m512i *) ptr + 2, d03);
+ _mm512_storeu_si512((__m512i *) ptr + 3, d04);
+ _mm512_storeu_si512((__m512i *) ptr + 4, d05);
+ _mm512_storeu_si512((__m512i *) ptr + 5, d06);
+ _mm512_storeu_si512((__m512i *) ptr + 6, d07);
+ _mm512_storeu_si512((__m512i *) ptr + 7, d08);
+ _mm512_storeu_si512((__m512i *) ptr + 8, d09);
+ _mm512_storeu_si512((__m512i *) ptr + 9, d10);
+ _mm512_storeu_si512((__m512i *) ptr + 10, d11);
+}
+
+ static NOINLINE void sort_12v(int32_t *ptr) {
+ __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);;
+ __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);;
+ __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);;
+ __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);;
+ __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);;
+ __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);;
+ __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);;
+ __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);;
+ __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);;
+ __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);;
+ __m512i d11 = _mm512_loadu_si512((__m512i const *) ptr + 10);;
+ __m512i d12 = _mm512_loadu_si512((__m512i const *) ptr + 11);;
+ sort_12v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12);
+ _mm512_storeu_si512((__m512i *) ptr + 0, d01);
+ _mm512_storeu_si512((__m512i *) ptr + 1, d02);
+ _mm512_storeu_si512((__m512i *) ptr + 2, d03);
+ _mm512_storeu_si512((__m512i *) ptr + 3, d04);
+ _mm512_storeu_si512((__m512i *) ptr + 4, d05);
+ _mm512_storeu_si512((__m512i *) ptr + 5, d06);
+ _mm512_storeu_si512((__m512i *) ptr + 6, d07);
+ _mm512_storeu_si512((__m512i *) ptr + 7, d08);
+ _mm512_storeu_si512((__m512i *) ptr + 8, d09);
+ _mm512_storeu_si512((__m512i *) ptr + 9, d10);
+ _mm512_storeu_si512((__m512i *) ptr + 10, d11);
+ _mm512_storeu_si512((__m512i *) ptr + 11, d12);
+}
+
+ static NOINLINE void sort_13v(int32_t *ptr) {
+ __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);;
+ __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);;
+ __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);;
+ __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);;
+ __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);;
+ __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);;
+ __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);;
+ __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);;
+ __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);;
+ __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);;
+ __m512i d11 = _mm512_loadu_si512((__m512i const *) ptr + 10);;
+ __m512i d12 = _mm512_loadu_si512((__m512i const *) ptr + 11);;
+ __m512i d13 = _mm512_loadu_si512((__m512i const *) ptr + 12);;
+ sort_13v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13);
+ _mm512_storeu_si512((__m512i *) ptr + 0, d01);
+ _mm512_storeu_si512((__m512i *) ptr + 1, d02);
+ _mm512_storeu_si512((__m512i *) ptr + 2, d03);
+ _mm512_storeu_si512((__m512i *) ptr + 3, d04);
+ _mm512_storeu_si512((__m512i *) ptr + 4, d05);
+ _mm512_storeu_si512((__m512i *) ptr + 5, d06);
+ _mm512_storeu_si512((__m512i *) ptr + 6, d07);
+ _mm512_storeu_si512((__m512i *) ptr + 7, d08);
+ _mm512_storeu_si512((__m512i *) ptr + 8, d09);
+ _mm512_storeu_si512((__m512i *) ptr + 9, d10);
+ _mm512_storeu_si512((__m512i *) ptr + 10, d11);
+ _mm512_storeu_si512((__m512i *) ptr + 11, d12);
+ _mm512_storeu_si512((__m512i *) ptr + 12, d13);
+}
+
+ static NOINLINE void sort_14v(int32_t *ptr) {
+ __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);;
+ __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);;
+ __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);;
+ __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);;
+ __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);;
+ __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);;
+ __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);;
+ __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);;
+ __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);;
+ __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);;
+ __m512i d11 = _mm512_loadu_si512((__m512i const *) ptr + 10);;
+ __m512i d12 = _mm512_loadu_si512((__m512i const *) ptr + 11);;
+ __m512i d13 = _mm512_loadu_si512((__m512i const *) ptr + 12);;
+ __m512i d14 = _mm512_loadu_si512((__m512i const *) ptr + 13);;
+ sort_14v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14);
+ _mm512_storeu_si512((__m512i *) ptr + 0, d01);
+ _mm512_storeu_si512((__m512i *) ptr + 1, d02);
+ _mm512_storeu_si512((__m512i *) ptr + 2, d03);
+ _mm512_storeu_si512((__m512i *) ptr + 3, d04);
+ _mm512_storeu_si512((__m512i *) ptr + 4, d05);
+ _mm512_storeu_si512((__m512i *) ptr + 5, d06);
+ _mm512_storeu_si512((__m512i *) ptr + 6, d07);
+ _mm512_storeu_si512((__m512i *) ptr + 7, d08);
+ _mm512_storeu_si512((__m512i *) ptr + 8, d09);
+ _mm512_storeu_si512((__m512i *) ptr + 9, d10);
+ _mm512_storeu_si512((__m512i *) ptr + 10, d11);
+ _mm512_storeu_si512((__m512i *) ptr + 11, d12);
+ _mm512_storeu_si512((__m512i *) ptr + 12, d13);
+ _mm512_storeu_si512((__m512i *) ptr + 13, d14);
+}
+
+ static NOINLINE void sort_15v(int32_t *ptr) {
+ __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);;
+ __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);;
+ __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);;
+ __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);;
+ __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);;
+ __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);;
+ __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);;
+ __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);;
+ __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);;
+ __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);;
+ __m512i d11 = _mm512_loadu_si512((__m512i const *) ptr + 10);;
+ __m512i d12 = _mm512_loadu_si512((__m512i const *) ptr + 11);;
+ __m512i d13 = _mm512_loadu_si512((__m512i const *) ptr + 12);;
+ __m512i d14 = _mm512_loadu_si512((__m512i const *) ptr + 13);;
+ __m512i d15 = _mm512_loadu_si512((__m512i const *) ptr + 14);;
+ sort_15v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14, d15);
+ _mm512_storeu_si512((__m512i *) ptr + 0, d01);
+ _mm512_storeu_si512((__m512i *) ptr + 1, d02);
+ _mm512_storeu_si512((__m512i *) ptr + 2, d03);
+ _mm512_storeu_si512((__m512i *) ptr + 3, d04);
+ _mm512_storeu_si512((__m512i *) ptr + 4, d05);
+ _mm512_storeu_si512((__m512i *) ptr + 5, d06);
+ _mm512_storeu_si512((__m512i *) ptr + 6, d07);
+ _mm512_storeu_si512((__m512i *) ptr + 7, d08);
+ _mm512_storeu_si512((__m512i *) ptr + 8, d09);
+ _mm512_storeu_si512((__m512i *) ptr + 9, d10);
+ _mm512_storeu_si512((__m512i *) ptr + 10, d11);
+ _mm512_storeu_si512((__m512i *) ptr + 11, d12);
+ _mm512_storeu_si512((__m512i *) ptr + 12, d13);
+ _mm512_storeu_si512((__m512i *) ptr + 13, d14);
+ _mm512_storeu_si512((__m512i *) ptr + 14, d15);
+}
+
+ static NOINLINE void sort_16v(int32_t *ptr) {
+ __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);;
+ __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);;
+ __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);;
+ __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);;
+ __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);;
+ __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);;
+ __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);;
+ __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);;
+ __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);;
+ __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);;
+ __m512i d11 = _mm512_loadu_si512((__m512i const *) ptr + 10);;
+ __m512i d12 = _mm512_loadu_si512((__m512i const *) ptr + 11);;
+ __m512i d13 = _mm512_loadu_si512((__m512i const *) ptr + 12);;
+ __m512i d14 = _mm512_loadu_si512((__m512i const *) ptr + 13);;
+ __m512i d15 = _mm512_loadu_si512((__m512i const *) ptr + 14);;
+ __m512i d16 = _mm512_loadu_si512((__m512i const *) ptr + 15);;
+ sort_16v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14, d15, d16);
+ _mm512_storeu_si512((__m512i *) ptr + 0, d01);
+ _mm512_storeu_si512((__m512i *) ptr + 1, d02);
+ _mm512_storeu_si512((__m512i *) ptr + 2, d03);
+ _mm512_storeu_si512((__m512i *) ptr + 3, d04);
+ _mm512_storeu_si512((__m512i *) ptr + 4, d05);
+ _mm512_storeu_si512((__m512i *) ptr + 5, d06);
+ _mm512_storeu_si512((__m512i *) ptr + 6, d07);
+ _mm512_storeu_si512((__m512i *) ptr + 7, d08);
+ _mm512_storeu_si512((__m512i *) ptr + 8, d09);
+ _mm512_storeu_si512((__m512i *) ptr + 9, d10);
+ _mm512_storeu_si512((__m512i *) ptr + 10, d11);
+ _mm512_storeu_si512((__m512i *) ptr + 11, d12);
+ _mm512_storeu_si512((__m512i *) ptr + 12, d13);
+ _mm512_storeu_si512((__m512i *) ptr + 13, d14);
+ _mm512_storeu_si512((__m512i *) ptr + 14, d15);
+ _mm512_storeu_si512((__m512i *) ptr + 15, d16);
+}
+ static void sort(int32_t *ptr, size_t length);
+
+};
+}
+}
+
+#undef i2d
+#undef d2i
+#undef i2s
+#undef s2i
+#undef s2d
+#undef d2s
+
+#ifdef __GNUC__
+#ifdef __clang__
+#pragma clang attribute pop
+#else
+#pragma GCC pop_options
+#endif
+#endif
+#endif
+
diff --git a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int64_t.generated.cpp b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int64_t.generated.cpp
new file mode 100644
index 000000000000..cf8b62809b36
--- /dev/null
+++ b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int64_t.generated.cpp
@@ -0,0 +1,30 @@
+// 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"
+#include "bitonic_sort.AVX512.int64_t.generated.h"
+
+using namespace vxsort;
+
+void vxsort::smallsort::bitonic::sort(int64_t *ptr, size_t length) {
+ const int N = 8;
+
+ switch(length / N) {
+ case 1: sort_01v(ptr); break;
+ case 2: sort_02v(ptr); break;
+ case 3: sort_03v(ptr); break;
+ case 4: sort_04v(ptr); break;
+ case 5: sort_05v(ptr); break;
+ case 6: sort_06v(ptr); break;
+ case 7: sort_07v(ptr); break;
+ case 8: sort_08v(ptr); break;
+ case 9: sort_09v(ptr); break;
+ case 10: sort_10v(ptr); break;
+ case 11: sort_11v(ptr); break;
+ case 12: sort_12v(ptr); break;
+ case 13: sort_13v(ptr); break;
+ case 14: sort_14v(ptr); break;
+ case 15: sort_15v(ptr); break;
+ case 16: sort_16v(ptr); break;
+ }
+}
diff --git a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int64_t.generated.h b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int64_t.generated.h
new file mode 100644
index 000000000000..483cf5a1e158
--- /dev/null
+++ b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.AVX512.int64_t.generated.h
@@ -0,0 +1,1347 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+/////////////////////////////////////////////////////////////////////////////
+////
+// This file was auto-generated by a tool at 2020-06-22 05:27:48
+//
+// It is recommended you DO NOT directly edit this file but instead edit
+// the code-generator that generated this source file instead.
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef BITONIC_SORT_AVX512_INT64_T_H
+#define BITONIC_SORT_AVX512_INT64_T_H
+
+
+#ifdef __GNUC__
+#ifdef __clang__
+#pragma clang attribute push (__attribute__((target("avx512f"))), apply_to = any(function))
+#else
+#pragma GCC push_options
+#pragma GCC target("avx512f")
+#endif
+#endif
+
+#include
+#include "bitonic_sort.h"
+
+#define i2d _mm512_castsi512_pd
+#define d2i _mm512_castpd_si512
+#define i2s _mm512_castsi512_ps
+#define s2i _mm512_castps_si512
+#define s2d _mm512_castps_pd
+#define d2s _mm521_castpd_ps
+
+namespace vxsort {
+namespace smallsort {
+template<> struct bitonic {
+public:
+
+ static INLINE void sort_01v_ascending(__m512i& d01) {
+ __m512i min, s;
+
+ s = d2i(_mm512_permute_pd(i2d(d01), _MM_PERM_BBBB));
+ min = _mm512_min_epi64(s, d01);
+ d01 = _mm512_mask_max_epi64(min, 0x00AA, s, d01);
+
+ s = d2i(_mm512_permutex_pd(i2d(d01), _MM_PERM_ABCD));
+ min = _mm512_min_epi64(s, d01);
+ d01 = _mm512_mask_max_epi64(min, 0x00CC, s, d01);
+
+ s = d2i(_mm512_permute_pd(i2d(d01), _MM_PERM_BBBB));
+ min = _mm512_min_epi64(s, d01);
+ d01 = _mm512_mask_max_epi64(min, 0x00AA, s, d01);
+
+ s = d2i(_mm512_shuffle_f64x2(_mm512_permutex_pd(i2d(d01), _MM_PERM_ABCD), _mm512_permutex_pd(i2d(d01), _MM_PERM_ABCD), _MM_PERM_BADC));
+ min = _mm512_min_epi64(s, d01);
+ d01 = _mm512_mask_max_epi64(min, 0x00F0, s, d01);
+
+ s = d2i(_mm512_permutex_pd(i2d(d01), _MM_PERM_BADC));
+ min = _mm512_min_epi64(s, d01);
+ d01 = _mm512_mask_max_epi64(min, 0x00CC, s, d01);
+
+ s = d2i(_mm512_permute_pd(i2d(d01), _MM_PERM_BBBB));
+ min = _mm512_min_epi64(s, d01);
+ d01 = _mm512_mask_max_epi64(min, 0x00AA, s, d01);
+ }
+ static INLINE void sort_01v_merge_ascending(__m512i& d01) {
+ __m512i min, s;
+
+ s = d2i(_mm512_shuffle_f64x2(i2d(d01), i2d(d01), _MM_PERM_BADC));
+ min = _mm512_min_epi64(s, d01);
+ d01 = _mm512_mask_max_epi64(min, 0x00F0, s, d01);
+
+ s = d2i(_mm512_permutex_pd(i2d(d01), _MM_PERM_BADC));
+ min = _mm512_min_epi64(s, d01);
+ d01 = _mm512_mask_max_epi64(min, 0x00CC, s, d01);
+
+ s = d2i(_mm512_permute_pd(i2d(d01), _MM_PERM_BBBB));
+ min = _mm512_min_epi64(s, d01);
+ d01 = _mm512_mask_max_epi64(min, 0x00AA, s, d01);
+ }
+ static INLINE void sort_01v_descending(__m512i& d01) {
+ __m512i min, s;
+
+ s = d2i(_mm512_permute_pd(i2d(d01), _MM_PERM_BBBB));
+ min = _mm512_min_epi64(s, d01);
+ d01 = _mm512_mask_max_epi64(min, 0x0055, s, d01);
+
+ s = d2i(_mm512_permutex_pd(i2d(d01), _MM_PERM_ABCD));
+ min = _mm512_min_epi64(s, d01);
+ d01 = _mm512_mask_max_epi64(min, 0x0033, s, d01);
+
+ s = d2i(_mm512_permute_pd(i2d(d01), _MM_PERM_BBBB));
+ min = _mm512_min_epi64(s, d01);
+ d01 = _mm512_mask_max_epi64(min, 0x0055, s, d01);
+
+ s = d2i(_mm512_shuffle_f64x2(_mm512_permutex_pd(i2d(d01), _MM_PERM_ABCD), _mm512_permutex_pd(i2d(d01), _MM_PERM_ABCD), _MM_PERM_BADC));
+ min = _mm512_min_epi64(s, d01);
+ d01 = _mm512_mask_max_epi64(min, 0x000F, s, d01);
+
+ s = d2i(_mm512_permutex_pd(i2d(d01), _MM_PERM_BADC));
+ min = _mm512_min_epi64(s, d01);
+ d01 = _mm512_mask_max_epi64(min, 0x0033, s, d01);
+
+ s = d2i(_mm512_permute_pd(i2d(d01), _MM_PERM_BBBB));
+ min = _mm512_min_epi64(s, d01);
+ d01 = _mm512_mask_max_epi64(min, 0x0055, s, d01);
+ }
+ static INLINE void sort_01v_merge_descending(__m512i& d01) {
+ __m512i min, s;
+
+ s = d2i(_mm512_shuffle_f64x2(i2d(d01), i2d(d01), _MM_PERM_BADC));
+ min = _mm512_min_epi64(s, d01);
+ d01 = _mm512_mask_max_epi64(min, 0x000F, s, d01);
+
+ s = d2i(_mm512_permutex_pd(i2d(d01), _MM_PERM_BADC));
+ min = _mm512_min_epi64(s, d01);
+ d01 = _mm512_mask_max_epi64(min, 0x0033, s, d01);
+
+ s = d2i(_mm512_permute_pd(i2d(d01), _MM_PERM_BBBB));
+ min = _mm512_min_epi64(s, d01);
+ d01 = _mm512_mask_max_epi64(min, 0x0055, s, d01);
+ }
+ static INLINE void sort_02v_ascending(__m512i& d01, __m512i& d02) {
+ __m512i tmp;
+
+ sort_01v_ascending(d01);
+ sort_01v_descending(d02);
+
+ tmp = d02;
+ d02 = _mm512_max_epi64(d01, d02);
+ d01 = _mm512_min_epi64(d01, tmp);
+
+ sort_01v_merge_ascending(d01);
+ sort_01v_merge_ascending(d02);
+ }
+ static INLINE void sort_02v_descending(__m512i& d01, __m512i& d02) {
+ __m512i tmp;
+
+ sort_01v_descending(d01);
+ sort_01v_ascending(d02);
+
+ tmp = d02;
+ d02 = _mm512_max_epi64(d01, d02);
+ d01 = _mm512_min_epi64(d01, tmp);
+
+ sort_01v_merge_descending(d01);
+ sort_01v_merge_descending(d02);
+ }
+ static INLINE void sort_02v_merge_ascending(__m512i& d01, __m512i& d02) {
+ __m512i tmp;
+
+ tmp = d01;
+ d01 = _mm512_min_epi64(d02, d01);
+ d02 = _mm512_max_epi64(d02, tmp);
+
+ sort_01v_merge_ascending(d01);
+ sort_01v_merge_ascending(d02);
+ }
+ static INLINE void sort_02v_merge_descending(__m512i& d01, __m512i& d02) {
+ __m512i tmp;
+
+ tmp = d01;
+ d01 = _mm512_min_epi64(d02, d01);
+ d02 = _mm512_max_epi64(d02, tmp);
+
+ sort_01v_merge_descending(d01);
+ sort_01v_merge_descending(d02);
+ }
+ static INLINE void sort_03v_ascending(__m512i& d01, __m512i& d02, __m512i& d03) {
+ __m512i tmp;
+
+ sort_02v_ascending(d01, d02);
+ sort_01v_descending(d03);
+
+ tmp = d03;
+ d03 = _mm512_max_epi64(d02, d03);
+ d02 = _mm512_min_epi64(d02, tmp);
+
+ sort_02v_merge_ascending(d01, d02);
+ sort_01v_merge_ascending(d03);
+ }
+ static INLINE void sort_03v_descending(__m512i& d01, __m512i& d02, __m512i& d03) {
+ __m512i tmp;
+
+ sort_02v_descending(d01, d02);
+ sort_01v_ascending(d03);
+
+ tmp = d03;
+ d03 = _mm512_max_epi64(d02, d03);
+ d02 = _mm512_min_epi64(d02, tmp);
+
+ sort_02v_merge_descending(d01, d02);
+ sort_01v_merge_descending(d03);
+ }
+ static INLINE void sort_03v_merge_ascending(__m512i& d01, __m512i& d02, __m512i& d03) {
+ __m512i tmp;
+
+ tmp = d01;
+ d01 = _mm512_min_epi64(d03, d01);
+ d03 = _mm512_max_epi64(d03, tmp);
+
+ sort_02v_merge_ascending(d01, d02);
+ sort_01v_merge_ascending(d03);
+ }
+ static INLINE void sort_03v_merge_descending(__m512i& d01, __m512i& d02, __m512i& d03) {
+ __m512i tmp;
+
+ tmp = d01;
+ d01 = _mm512_min_epi64(d03, d01);
+ d03 = _mm512_max_epi64(d03, tmp);
+
+ sort_02v_merge_descending(d01, d02);
+ sort_01v_merge_descending(d03);
+ }
+ static INLINE void sort_04v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04) {
+ __m512i tmp;
+
+ sort_02v_ascending(d01, d02);
+ sort_02v_descending(d03, d04);
+
+ tmp = d03;
+ d03 = _mm512_max_epi64(d02, d03);
+ d02 = _mm512_min_epi64(d02, tmp);
+
+ tmp = d04;
+ d04 = _mm512_max_epi64(d01, d04);
+ d01 = _mm512_min_epi64(d01, tmp);
+
+ sort_02v_merge_ascending(d01, d02);
+ sort_02v_merge_ascending(d03, d04);
+ }
+ static INLINE void sort_04v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04) {
+ __m512i tmp;
+
+ sort_02v_descending(d01, d02);
+ sort_02v_ascending(d03, d04);
+
+ tmp = d03;
+ d03 = _mm512_max_epi64(d02, d03);
+ d02 = _mm512_min_epi64(d02, tmp);
+
+ tmp = d04;
+ d04 = _mm512_max_epi64(d01, d04);
+ d01 = _mm512_min_epi64(d01, tmp);
+
+ sort_02v_merge_descending(d01, d02);
+ sort_02v_merge_descending(d03, d04);
+ }
+ static INLINE void sort_04v_merge_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04) {
+ __m512i tmp;
+
+ tmp = d01;
+ d01 = _mm512_min_epi64(d03, d01);
+ d03 = _mm512_max_epi64(d03, tmp);
+
+ tmp = d02;
+ d02 = _mm512_min_epi64(d04, d02);
+ d04 = _mm512_max_epi64(d04, tmp);
+
+ sort_02v_merge_ascending(d01, d02);
+ sort_02v_merge_ascending(d03, d04);
+ }
+ static INLINE void sort_04v_merge_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04) {
+ __m512i tmp;
+
+ tmp = d01;
+ d01 = _mm512_min_epi64(d03, d01);
+ d03 = _mm512_max_epi64(d03, tmp);
+
+ tmp = d02;
+ d02 = _mm512_min_epi64(d04, d02);
+ d04 = _mm512_max_epi64(d04, tmp);
+
+ sort_02v_merge_descending(d01, d02);
+ sort_02v_merge_descending(d03, d04);
+ }
+ static INLINE void sort_05v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05) {
+ __m512i tmp;
+
+ sort_04v_ascending(d01, d02, d03, d04);
+ sort_01v_descending(d05);
+
+ tmp = d05;
+ d05 = _mm512_max_epi64(d04, d05);
+ d04 = _mm512_min_epi64(d04, tmp);
+
+ sort_04v_merge_ascending(d01, d02, d03, d04);
+ sort_01v_merge_ascending(d05);
+ }
+ static INLINE void sort_05v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05) {
+ __m512i tmp;
+
+ sort_04v_descending(d01, d02, d03, d04);
+ sort_01v_ascending(d05);
+
+ tmp = d05;
+ d05 = _mm512_max_epi64(d04, d05);
+ d04 = _mm512_min_epi64(d04, tmp);
+
+ sort_04v_merge_descending(d01, d02, d03, d04);
+ sort_01v_merge_descending(d05);
+ }
+ static INLINE void sort_05v_merge_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05) {
+ __m512i tmp;
+
+ tmp = d01;
+ d01 = _mm512_min_epi64(d05, d01);
+ d05 = _mm512_max_epi64(d05, tmp);
+
+ sort_04v_merge_ascending(d01, d02, d03, d04);
+ sort_01v_merge_ascending(d05);
+ }
+ static INLINE void sort_05v_merge_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05) {
+ __m512i tmp;
+
+ tmp = d01;
+ d01 = _mm512_min_epi64(d05, d01);
+ d05 = _mm512_max_epi64(d05, tmp);
+
+ sort_04v_merge_descending(d01, d02, d03, d04);
+ sort_01v_merge_descending(d05);
+ }
+ static INLINE void sort_06v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06) {
+ __m512i tmp;
+
+ sort_04v_ascending(d01, d02, d03, d04);
+ sort_02v_descending(d05, d06);
+
+ tmp = d05;
+ d05 = _mm512_max_epi64(d04, d05);
+ d04 = _mm512_min_epi64(d04, tmp);
+
+ tmp = d06;
+ d06 = _mm512_max_epi64(d03, d06);
+ d03 = _mm512_min_epi64(d03, tmp);
+
+ sort_04v_merge_ascending(d01, d02, d03, d04);
+ sort_02v_merge_ascending(d05, d06);
+ }
+ static INLINE void sort_06v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06) {
+ __m512i tmp;
+
+ sort_04v_descending(d01, d02, d03, d04);
+ sort_02v_ascending(d05, d06);
+
+ tmp = d05;
+ d05 = _mm512_max_epi64(d04, d05);
+ d04 = _mm512_min_epi64(d04, tmp);
+
+ tmp = d06;
+ d06 = _mm512_max_epi64(d03, d06);
+ d03 = _mm512_min_epi64(d03, tmp);
+
+ sort_04v_merge_descending(d01, d02, d03, d04);
+ sort_02v_merge_descending(d05, d06);
+ }
+ static INLINE void sort_06v_merge_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06) {
+ __m512i tmp;
+
+ tmp = d01;
+ d01 = _mm512_min_epi64(d05, d01);
+ d05 = _mm512_max_epi64(d05, tmp);
+
+ tmp = d02;
+ d02 = _mm512_min_epi64(d06, d02);
+ d06 = _mm512_max_epi64(d06, tmp);
+
+ sort_04v_merge_ascending(d01, d02, d03, d04);
+ sort_02v_merge_ascending(d05, d06);
+ }
+ static INLINE void sort_06v_merge_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06) {
+ __m512i tmp;
+
+ tmp = d01;
+ d01 = _mm512_min_epi64(d05, d01);
+ d05 = _mm512_max_epi64(d05, tmp);
+
+ tmp = d02;
+ d02 = _mm512_min_epi64(d06, d02);
+ d06 = _mm512_max_epi64(d06, tmp);
+
+ sort_04v_merge_descending(d01, d02, d03, d04);
+ sort_02v_merge_descending(d05, d06);
+ }
+ static INLINE void sort_07v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07) {
+ __m512i tmp;
+
+ sort_04v_ascending(d01, d02, d03, d04);
+ sort_03v_descending(d05, d06, d07);
+
+ tmp = d05;
+ d05 = _mm512_max_epi64(d04, d05);
+ d04 = _mm512_min_epi64(d04, tmp);
+
+ tmp = d06;
+ d06 = _mm512_max_epi64(d03, d06);
+ d03 = _mm512_min_epi64(d03, tmp);
+
+ tmp = d07;
+ d07 = _mm512_max_epi64(d02, d07);
+ d02 = _mm512_min_epi64(d02, tmp);
+
+ sort_04v_merge_ascending(d01, d02, d03, d04);
+ sort_03v_merge_ascending(d05, d06, d07);
+ }
+ static INLINE void sort_07v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07) {
+ __m512i tmp;
+
+ sort_04v_descending(d01, d02, d03, d04);
+ sort_03v_ascending(d05, d06, d07);
+
+ tmp = d05;
+ d05 = _mm512_max_epi64(d04, d05);
+ d04 = _mm512_min_epi64(d04, tmp);
+
+ tmp = d06;
+ d06 = _mm512_max_epi64(d03, d06);
+ d03 = _mm512_min_epi64(d03, tmp);
+
+ tmp = d07;
+ d07 = _mm512_max_epi64(d02, d07);
+ d02 = _mm512_min_epi64(d02, tmp);
+
+ sort_04v_merge_descending(d01, d02, d03, d04);
+ sort_03v_merge_descending(d05, d06, d07);
+ }
+ static INLINE void sort_07v_merge_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07) {
+ __m512i tmp;
+
+ tmp = d01;
+ d01 = _mm512_min_epi64(d05, d01);
+ d05 = _mm512_max_epi64(d05, tmp);
+
+ tmp = d02;
+ d02 = _mm512_min_epi64(d06, d02);
+ d06 = _mm512_max_epi64(d06, tmp);
+
+ tmp = d03;
+ d03 = _mm512_min_epi64(d07, d03);
+ d07 = _mm512_max_epi64(d07, tmp);
+
+ sort_04v_merge_ascending(d01, d02, d03, d04);
+ sort_03v_merge_ascending(d05, d06, d07);
+ }
+ static INLINE void sort_07v_merge_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07) {
+ __m512i tmp;
+
+ tmp = d01;
+ d01 = _mm512_min_epi64(d05, d01);
+ d05 = _mm512_max_epi64(d05, tmp);
+
+ tmp = d02;
+ d02 = _mm512_min_epi64(d06, d02);
+ d06 = _mm512_max_epi64(d06, tmp);
+
+ tmp = d03;
+ d03 = _mm512_min_epi64(d07, d03);
+ d07 = _mm512_max_epi64(d07, tmp);
+
+ sort_04v_merge_descending(d01, d02, d03, d04);
+ sort_03v_merge_descending(d05, d06, d07);
+ }
+ static INLINE void sort_08v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08) {
+ __m512i tmp;
+
+ sort_04v_ascending(d01, d02, d03, d04);
+ sort_04v_descending(d05, d06, d07, d08);
+
+ tmp = d05;
+ d05 = _mm512_max_epi64(d04, d05);
+ d04 = _mm512_min_epi64(d04, tmp);
+
+ tmp = d06;
+ d06 = _mm512_max_epi64(d03, d06);
+ d03 = _mm512_min_epi64(d03, tmp);
+
+ tmp = d07;
+ d07 = _mm512_max_epi64(d02, d07);
+ d02 = _mm512_min_epi64(d02, tmp);
+
+ tmp = d08;
+ d08 = _mm512_max_epi64(d01, d08);
+ d01 = _mm512_min_epi64(d01, tmp);
+
+ sort_04v_merge_ascending(d01, d02, d03, d04);
+ sort_04v_merge_ascending(d05, d06, d07, d08);
+ }
+ static INLINE void sort_08v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08) {
+ __m512i tmp;
+
+ sort_04v_descending(d01, d02, d03, d04);
+ sort_04v_ascending(d05, d06, d07, d08);
+
+ tmp = d05;
+ d05 = _mm512_max_epi64(d04, d05);
+ d04 = _mm512_min_epi64(d04, tmp);
+
+ tmp = d06;
+ d06 = _mm512_max_epi64(d03, d06);
+ d03 = _mm512_min_epi64(d03, tmp);
+
+ tmp = d07;
+ d07 = _mm512_max_epi64(d02, d07);
+ d02 = _mm512_min_epi64(d02, tmp);
+
+ tmp = d08;
+ d08 = _mm512_max_epi64(d01, d08);
+ d01 = _mm512_min_epi64(d01, tmp);
+
+ sort_04v_merge_descending(d01, d02, d03, d04);
+ sort_04v_merge_descending(d05, d06, d07, d08);
+ }
+ static INLINE void sort_08v_merge_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08) {
+ __m512i tmp;
+
+ tmp = d01;
+ d01 = _mm512_min_epi64(d05, d01);
+ d05 = _mm512_max_epi64(d05, tmp);
+
+ tmp = d02;
+ d02 = _mm512_min_epi64(d06, d02);
+ d06 = _mm512_max_epi64(d06, tmp);
+
+ tmp = d03;
+ d03 = _mm512_min_epi64(d07, d03);
+ d07 = _mm512_max_epi64(d07, tmp);
+
+ tmp = d04;
+ d04 = _mm512_min_epi64(d08, d04);
+ d08 = _mm512_max_epi64(d08, tmp);
+
+ sort_04v_merge_ascending(d01, d02, d03, d04);
+ sort_04v_merge_ascending(d05, d06, d07, d08);
+ }
+ static INLINE void sort_08v_merge_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08) {
+ __m512i tmp;
+
+ tmp = d01;
+ d01 = _mm512_min_epi64(d05, d01);
+ d05 = _mm512_max_epi64(d05, tmp);
+
+ tmp = d02;
+ d02 = _mm512_min_epi64(d06, d02);
+ d06 = _mm512_max_epi64(d06, tmp);
+
+ tmp = d03;
+ d03 = _mm512_min_epi64(d07, d03);
+ d07 = _mm512_max_epi64(d07, tmp);
+
+ tmp = d04;
+ d04 = _mm512_min_epi64(d08, d04);
+ d08 = _mm512_max_epi64(d08, tmp);
+
+ sort_04v_merge_descending(d01, d02, d03, d04);
+ sort_04v_merge_descending(d05, d06, d07, d08);
+ }
+ static INLINE void sort_09v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09) {
+ __m512i tmp;
+
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_01v_descending(d09);
+
+ tmp = d09;
+ d09 = _mm512_max_epi64(d08, d09);
+ d08 = _mm512_min_epi64(d08, tmp);
+
+ sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_01v_merge_ascending(d09);
+ }
+ static INLINE void sort_09v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09) {
+ __m512i tmp;
+
+ sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_01v_ascending(d09);
+
+ tmp = d09;
+ d09 = _mm512_max_epi64(d08, d09);
+ d08 = _mm512_min_epi64(d08, tmp);
+
+ sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_01v_merge_descending(d09);
+ }
+ static INLINE void sort_10v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10) {
+ __m512i tmp;
+
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_02v_descending(d09, d10);
+
+ tmp = d09;
+ d09 = _mm512_max_epi64(d08, d09);
+ d08 = _mm512_min_epi64(d08, tmp);
+
+ tmp = d10;
+ d10 = _mm512_max_epi64(d07, d10);
+ d07 = _mm512_min_epi64(d07, tmp);
+
+ sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_02v_merge_ascending(d09, d10);
+ }
+ static INLINE void sort_10v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10) {
+ __m512i tmp;
+
+ sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_02v_ascending(d09, d10);
+
+ tmp = d09;
+ d09 = _mm512_max_epi64(d08, d09);
+ d08 = _mm512_min_epi64(d08, tmp);
+
+ tmp = d10;
+ d10 = _mm512_max_epi64(d07, d10);
+ d07 = _mm512_min_epi64(d07, tmp);
+
+ sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_02v_merge_descending(d09, d10);
+ }
+ static INLINE void sort_11v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11) {
+ __m512i tmp;
+
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_03v_descending(d09, d10, d11);
+
+ tmp = d09;
+ d09 = _mm512_max_epi64(d08, d09);
+ d08 = _mm512_min_epi64(d08, tmp);
+
+ tmp = d10;
+ d10 = _mm512_max_epi64(d07, d10);
+ d07 = _mm512_min_epi64(d07, tmp);
+
+ tmp = d11;
+ d11 = _mm512_max_epi64(d06, d11);
+ d06 = _mm512_min_epi64(d06, tmp);
+
+ sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_03v_merge_ascending(d09, d10, d11);
+ }
+ static INLINE void sort_11v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11) {
+ __m512i tmp;
+
+ sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_03v_ascending(d09, d10, d11);
+
+ tmp = d09;
+ d09 = _mm512_max_epi64(d08, d09);
+ d08 = _mm512_min_epi64(d08, tmp);
+
+ tmp = d10;
+ d10 = _mm512_max_epi64(d07, d10);
+ d07 = _mm512_min_epi64(d07, tmp);
+
+ tmp = d11;
+ d11 = _mm512_max_epi64(d06, d11);
+ d06 = _mm512_min_epi64(d06, tmp);
+
+ sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_03v_merge_descending(d09, d10, d11);
+ }
+ static INLINE void sort_12v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12) {
+ __m512i tmp;
+
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_04v_descending(d09, d10, d11, d12);
+
+ tmp = d09;
+ d09 = _mm512_max_epi64(d08, d09);
+ d08 = _mm512_min_epi64(d08, tmp);
+
+ tmp = d10;
+ d10 = _mm512_max_epi64(d07, d10);
+ d07 = _mm512_min_epi64(d07, tmp);
+
+ tmp = d11;
+ d11 = _mm512_max_epi64(d06, d11);
+ d06 = _mm512_min_epi64(d06, tmp);
+
+ tmp = d12;
+ d12 = _mm512_max_epi64(d05, d12);
+ d05 = _mm512_min_epi64(d05, tmp);
+
+ sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_04v_merge_ascending(d09, d10, d11, d12);
+ }
+ static INLINE void sort_12v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12) {
+ __m512i tmp;
+
+ sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_04v_ascending(d09, d10, d11, d12);
+
+ tmp = d09;
+ d09 = _mm512_max_epi64(d08, d09);
+ d08 = _mm512_min_epi64(d08, tmp);
+
+ tmp = d10;
+ d10 = _mm512_max_epi64(d07, d10);
+ d07 = _mm512_min_epi64(d07, tmp);
+
+ tmp = d11;
+ d11 = _mm512_max_epi64(d06, d11);
+ d06 = _mm512_min_epi64(d06, tmp);
+
+ tmp = d12;
+ d12 = _mm512_max_epi64(d05, d12);
+ d05 = _mm512_min_epi64(d05, tmp);
+
+ sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_04v_merge_descending(d09, d10, d11, d12);
+ }
+ static INLINE void sort_13v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13) {
+ __m512i tmp;
+
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_05v_descending(d09, d10, d11, d12, d13);
+
+ tmp = d09;
+ d09 = _mm512_max_epi64(d08, d09);
+ d08 = _mm512_min_epi64(d08, tmp);
+
+ tmp = d10;
+ d10 = _mm512_max_epi64(d07, d10);
+ d07 = _mm512_min_epi64(d07, tmp);
+
+ tmp = d11;
+ d11 = _mm512_max_epi64(d06, d11);
+ d06 = _mm512_min_epi64(d06, tmp);
+
+ tmp = d12;
+ d12 = _mm512_max_epi64(d05, d12);
+ d05 = _mm512_min_epi64(d05, tmp);
+
+ tmp = d13;
+ d13 = _mm512_max_epi64(d04, d13);
+ d04 = _mm512_min_epi64(d04, tmp);
+
+ sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_05v_merge_ascending(d09, d10, d11, d12, d13);
+ }
+ static INLINE void sort_13v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13) {
+ __m512i tmp;
+
+ sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_05v_ascending(d09, d10, d11, d12, d13);
+
+ tmp = d09;
+ d09 = _mm512_max_epi64(d08, d09);
+ d08 = _mm512_min_epi64(d08, tmp);
+
+ tmp = d10;
+ d10 = _mm512_max_epi64(d07, d10);
+ d07 = _mm512_min_epi64(d07, tmp);
+
+ tmp = d11;
+ d11 = _mm512_max_epi64(d06, d11);
+ d06 = _mm512_min_epi64(d06, tmp);
+
+ tmp = d12;
+ d12 = _mm512_max_epi64(d05, d12);
+ d05 = _mm512_min_epi64(d05, tmp);
+
+ tmp = d13;
+ d13 = _mm512_max_epi64(d04, d13);
+ d04 = _mm512_min_epi64(d04, tmp);
+
+ sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_05v_merge_descending(d09, d10, d11, d12, d13);
+ }
+ static INLINE void sort_14v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13, __m512i& d14) {
+ __m512i tmp;
+
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_06v_descending(d09, d10, d11, d12, d13, d14);
+
+ tmp = d09;
+ d09 = _mm512_max_epi64(d08, d09);
+ d08 = _mm512_min_epi64(d08, tmp);
+
+ tmp = d10;
+ d10 = _mm512_max_epi64(d07, d10);
+ d07 = _mm512_min_epi64(d07, tmp);
+
+ tmp = d11;
+ d11 = _mm512_max_epi64(d06, d11);
+ d06 = _mm512_min_epi64(d06, tmp);
+
+ tmp = d12;
+ d12 = _mm512_max_epi64(d05, d12);
+ d05 = _mm512_min_epi64(d05, tmp);
+
+ tmp = d13;
+ d13 = _mm512_max_epi64(d04, d13);
+ d04 = _mm512_min_epi64(d04, tmp);
+
+ tmp = d14;
+ d14 = _mm512_max_epi64(d03, d14);
+ d03 = _mm512_min_epi64(d03, tmp);
+
+ sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_06v_merge_ascending(d09, d10, d11, d12, d13, d14);
+ }
+ static INLINE void sort_14v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13, __m512i& d14) {
+ __m512i tmp;
+
+ sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_06v_ascending(d09, d10, d11, d12, d13, d14);
+
+ tmp = d09;
+ d09 = _mm512_max_epi64(d08, d09);
+ d08 = _mm512_min_epi64(d08, tmp);
+
+ tmp = d10;
+ d10 = _mm512_max_epi64(d07, d10);
+ d07 = _mm512_min_epi64(d07, tmp);
+
+ tmp = d11;
+ d11 = _mm512_max_epi64(d06, d11);
+ d06 = _mm512_min_epi64(d06, tmp);
+
+ tmp = d12;
+ d12 = _mm512_max_epi64(d05, d12);
+ d05 = _mm512_min_epi64(d05, tmp);
+
+ tmp = d13;
+ d13 = _mm512_max_epi64(d04, d13);
+ d04 = _mm512_min_epi64(d04, tmp);
+
+ tmp = d14;
+ d14 = _mm512_max_epi64(d03, d14);
+ d03 = _mm512_min_epi64(d03, tmp);
+
+ sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_06v_merge_descending(d09, d10, d11, d12, d13, d14);
+ }
+ static INLINE void sort_15v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13, __m512i& d14, __m512i& d15) {
+ __m512i tmp;
+
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_07v_descending(d09, d10, d11, d12, d13, d14, d15);
+
+ tmp = d09;
+ d09 = _mm512_max_epi64(d08, d09);
+ d08 = _mm512_min_epi64(d08, tmp);
+
+ tmp = d10;
+ d10 = _mm512_max_epi64(d07, d10);
+ d07 = _mm512_min_epi64(d07, tmp);
+
+ tmp = d11;
+ d11 = _mm512_max_epi64(d06, d11);
+ d06 = _mm512_min_epi64(d06, tmp);
+
+ tmp = d12;
+ d12 = _mm512_max_epi64(d05, d12);
+ d05 = _mm512_min_epi64(d05, tmp);
+
+ tmp = d13;
+ d13 = _mm512_max_epi64(d04, d13);
+ d04 = _mm512_min_epi64(d04, tmp);
+
+ tmp = d14;
+ d14 = _mm512_max_epi64(d03, d14);
+ d03 = _mm512_min_epi64(d03, tmp);
+
+ tmp = d15;
+ d15 = _mm512_max_epi64(d02, d15);
+ d02 = _mm512_min_epi64(d02, tmp);
+
+ sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_07v_merge_ascending(d09, d10, d11, d12, d13, d14, d15);
+ }
+ static INLINE void sort_15v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13, __m512i& d14, __m512i& d15) {
+ __m512i tmp;
+
+ sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_07v_ascending(d09, d10, d11, d12, d13, d14, d15);
+
+ tmp = d09;
+ d09 = _mm512_max_epi64(d08, d09);
+ d08 = _mm512_min_epi64(d08, tmp);
+
+ tmp = d10;
+ d10 = _mm512_max_epi64(d07, d10);
+ d07 = _mm512_min_epi64(d07, tmp);
+
+ tmp = d11;
+ d11 = _mm512_max_epi64(d06, d11);
+ d06 = _mm512_min_epi64(d06, tmp);
+
+ tmp = d12;
+ d12 = _mm512_max_epi64(d05, d12);
+ d05 = _mm512_min_epi64(d05, tmp);
+
+ tmp = d13;
+ d13 = _mm512_max_epi64(d04, d13);
+ d04 = _mm512_min_epi64(d04, tmp);
+
+ tmp = d14;
+ d14 = _mm512_max_epi64(d03, d14);
+ d03 = _mm512_min_epi64(d03, tmp);
+
+ tmp = d15;
+ d15 = _mm512_max_epi64(d02, d15);
+ d02 = _mm512_min_epi64(d02, tmp);
+
+ sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_07v_merge_descending(d09, d10, d11, d12, d13, d14, d15);
+ }
+ static INLINE void sort_16v_ascending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13, __m512i& d14, __m512i& d15, __m512i& d16) {
+ __m512i tmp;
+
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_08v_descending(d09, d10, d11, d12, d13, d14, d15, d16);
+
+ tmp = d09;
+ d09 = _mm512_max_epi64(d08, d09);
+ d08 = _mm512_min_epi64(d08, tmp);
+
+ tmp = d10;
+ d10 = _mm512_max_epi64(d07, d10);
+ d07 = _mm512_min_epi64(d07, tmp);
+
+ tmp = d11;
+ d11 = _mm512_max_epi64(d06, d11);
+ d06 = _mm512_min_epi64(d06, tmp);
+
+ tmp = d12;
+ d12 = _mm512_max_epi64(d05, d12);
+ d05 = _mm512_min_epi64(d05, tmp);
+
+ tmp = d13;
+ d13 = _mm512_max_epi64(d04, d13);
+ d04 = _mm512_min_epi64(d04, tmp);
+
+ tmp = d14;
+ d14 = _mm512_max_epi64(d03, d14);
+ d03 = _mm512_min_epi64(d03, tmp);
+
+ tmp = d15;
+ d15 = _mm512_max_epi64(d02, d15);
+ d02 = _mm512_min_epi64(d02, tmp);
+
+ tmp = d16;
+ d16 = _mm512_max_epi64(d01, d16);
+ d01 = _mm512_min_epi64(d01, tmp);
+
+ sort_08v_merge_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_08v_merge_ascending(d09, d10, d11, d12, d13, d14, d15, d16);
+ }
+ static INLINE void sort_16v_descending(__m512i& d01, __m512i& d02, __m512i& d03, __m512i& d04, __m512i& d05, __m512i& d06, __m512i& d07, __m512i& d08, __m512i& d09, __m512i& d10, __m512i& d11, __m512i& d12, __m512i& d13, __m512i& d14, __m512i& d15, __m512i& d16) {
+ __m512i tmp;
+
+ sort_08v_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_08v_ascending(d09, d10, d11, d12, d13, d14, d15, d16);
+
+ tmp = d09;
+ d09 = _mm512_max_epi64(d08, d09);
+ d08 = _mm512_min_epi64(d08, tmp);
+
+ tmp = d10;
+ d10 = _mm512_max_epi64(d07, d10);
+ d07 = _mm512_min_epi64(d07, tmp);
+
+ tmp = d11;
+ d11 = _mm512_max_epi64(d06, d11);
+ d06 = _mm512_min_epi64(d06, tmp);
+
+ tmp = d12;
+ d12 = _mm512_max_epi64(d05, d12);
+ d05 = _mm512_min_epi64(d05, tmp);
+
+ tmp = d13;
+ d13 = _mm512_max_epi64(d04, d13);
+ d04 = _mm512_min_epi64(d04, tmp);
+
+ tmp = d14;
+ d14 = _mm512_max_epi64(d03, d14);
+ d03 = _mm512_min_epi64(d03, tmp);
+
+ tmp = d15;
+ d15 = _mm512_max_epi64(d02, d15);
+ d02 = _mm512_min_epi64(d02, tmp);
+
+ tmp = d16;
+ d16 = _mm512_max_epi64(d01, d16);
+ d01 = _mm512_min_epi64(d01, tmp);
+
+ sort_08v_merge_descending(d01, d02, d03, d04, d05, d06, d07, d08);
+ sort_08v_merge_descending(d09, d10, d11, d12, d13, d14, d15, d16);
+ }
+
+ static NOINLINE void sort_01v(int64_t *ptr) {
+ __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);;
+ sort_01v_ascending(d01);
+ _mm512_storeu_si512((__m512i *) ptr + 0, d01);
+}
+
+ static NOINLINE void sort_02v(int64_t *ptr) {
+ __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);;
+ __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);;
+ sort_02v_ascending(d01, d02);
+ _mm512_storeu_si512((__m512i *) ptr + 0, d01);
+ _mm512_storeu_si512((__m512i *) ptr + 1, d02);
+}
+
+ static NOINLINE void sort_03v(int64_t *ptr) {
+ __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);;
+ __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);;
+ __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);;
+ sort_03v_ascending(d01, d02, d03);
+ _mm512_storeu_si512((__m512i *) ptr + 0, d01);
+ _mm512_storeu_si512((__m512i *) ptr + 1, d02);
+ _mm512_storeu_si512((__m512i *) ptr + 2, d03);
+}
+
+ static NOINLINE void sort_04v(int64_t *ptr) {
+ __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);;
+ __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);;
+ __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);;
+ __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);;
+ sort_04v_ascending(d01, d02, d03, d04);
+ _mm512_storeu_si512((__m512i *) ptr + 0, d01);
+ _mm512_storeu_si512((__m512i *) ptr + 1, d02);
+ _mm512_storeu_si512((__m512i *) ptr + 2, d03);
+ _mm512_storeu_si512((__m512i *) ptr + 3, d04);
+}
+
+ static NOINLINE void sort_05v(int64_t *ptr) {
+ __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);;
+ __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);;
+ __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);;
+ __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);;
+ __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);;
+ sort_05v_ascending(d01, d02, d03, d04, d05);
+ _mm512_storeu_si512((__m512i *) ptr + 0, d01);
+ _mm512_storeu_si512((__m512i *) ptr + 1, d02);
+ _mm512_storeu_si512((__m512i *) ptr + 2, d03);
+ _mm512_storeu_si512((__m512i *) ptr + 3, d04);
+ _mm512_storeu_si512((__m512i *) ptr + 4, d05);
+}
+
+ static NOINLINE void sort_06v(int64_t *ptr) {
+ __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);;
+ __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);;
+ __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);;
+ __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);;
+ __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);;
+ __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);;
+ sort_06v_ascending(d01, d02, d03, d04, d05, d06);
+ _mm512_storeu_si512((__m512i *) ptr + 0, d01);
+ _mm512_storeu_si512((__m512i *) ptr + 1, d02);
+ _mm512_storeu_si512((__m512i *) ptr + 2, d03);
+ _mm512_storeu_si512((__m512i *) ptr + 3, d04);
+ _mm512_storeu_si512((__m512i *) ptr + 4, d05);
+ _mm512_storeu_si512((__m512i *) ptr + 5, d06);
+}
+
+ static NOINLINE void sort_07v(int64_t *ptr) {
+ __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);;
+ __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);;
+ __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);;
+ __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);;
+ __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);;
+ __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);;
+ __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);;
+ sort_07v_ascending(d01, d02, d03, d04, d05, d06, d07);
+ _mm512_storeu_si512((__m512i *) ptr + 0, d01);
+ _mm512_storeu_si512((__m512i *) ptr + 1, d02);
+ _mm512_storeu_si512((__m512i *) ptr + 2, d03);
+ _mm512_storeu_si512((__m512i *) ptr + 3, d04);
+ _mm512_storeu_si512((__m512i *) ptr + 4, d05);
+ _mm512_storeu_si512((__m512i *) ptr + 5, d06);
+ _mm512_storeu_si512((__m512i *) ptr + 6, d07);
+}
+
+ static NOINLINE void sort_08v(int64_t *ptr) {
+ __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);;
+ __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);;
+ __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);;
+ __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);;
+ __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);;
+ __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);;
+ __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);;
+ __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);;
+ sort_08v_ascending(d01, d02, d03, d04, d05, d06, d07, d08);
+ _mm512_storeu_si512((__m512i *) ptr + 0, d01);
+ _mm512_storeu_si512((__m512i *) ptr + 1, d02);
+ _mm512_storeu_si512((__m512i *) ptr + 2, d03);
+ _mm512_storeu_si512((__m512i *) ptr + 3, d04);
+ _mm512_storeu_si512((__m512i *) ptr + 4, d05);
+ _mm512_storeu_si512((__m512i *) ptr + 5, d06);
+ _mm512_storeu_si512((__m512i *) ptr + 6, d07);
+ _mm512_storeu_si512((__m512i *) ptr + 7, d08);
+}
+
+ static NOINLINE void sort_09v(int64_t *ptr) {
+ __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);;
+ __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);;
+ __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);;
+ __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);;
+ __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);;
+ __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);;
+ __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);;
+ __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);;
+ __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);;
+ sort_09v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09);
+ _mm512_storeu_si512((__m512i *) ptr + 0, d01);
+ _mm512_storeu_si512((__m512i *) ptr + 1, d02);
+ _mm512_storeu_si512((__m512i *) ptr + 2, d03);
+ _mm512_storeu_si512((__m512i *) ptr + 3, d04);
+ _mm512_storeu_si512((__m512i *) ptr + 4, d05);
+ _mm512_storeu_si512((__m512i *) ptr + 5, d06);
+ _mm512_storeu_si512((__m512i *) ptr + 6, d07);
+ _mm512_storeu_si512((__m512i *) ptr + 7, d08);
+ _mm512_storeu_si512((__m512i *) ptr + 8, d09);
+}
+
+ static NOINLINE void sort_10v(int64_t *ptr) {
+ __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);;
+ __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);;
+ __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);;
+ __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);;
+ __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);;
+ __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);;
+ __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);;
+ __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);;
+ __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);;
+ __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);;
+ sort_10v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10);
+ _mm512_storeu_si512((__m512i *) ptr + 0, d01);
+ _mm512_storeu_si512((__m512i *) ptr + 1, d02);
+ _mm512_storeu_si512((__m512i *) ptr + 2, d03);
+ _mm512_storeu_si512((__m512i *) ptr + 3, d04);
+ _mm512_storeu_si512((__m512i *) ptr + 4, d05);
+ _mm512_storeu_si512((__m512i *) ptr + 5, d06);
+ _mm512_storeu_si512((__m512i *) ptr + 6, d07);
+ _mm512_storeu_si512((__m512i *) ptr + 7, d08);
+ _mm512_storeu_si512((__m512i *) ptr + 8, d09);
+ _mm512_storeu_si512((__m512i *) ptr + 9, d10);
+}
+
+ static NOINLINE void sort_11v(int64_t *ptr) {
+ __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);;
+ __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);;
+ __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);;
+ __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);;
+ __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);;
+ __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);;
+ __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);;
+ __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);;
+ __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);;
+ __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);;
+ __m512i d11 = _mm512_loadu_si512((__m512i const *) ptr + 10);;
+ sort_11v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11);
+ _mm512_storeu_si512((__m512i *) ptr + 0, d01);
+ _mm512_storeu_si512((__m512i *) ptr + 1, d02);
+ _mm512_storeu_si512((__m512i *) ptr + 2, d03);
+ _mm512_storeu_si512((__m512i *) ptr + 3, d04);
+ _mm512_storeu_si512((__m512i *) ptr + 4, d05);
+ _mm512_storeu_si512((__m512i *) ptr + 5, d06);
+ _mm512_storeu_si512((__m512i *) ptr + 6, d07);
+ _mm512_storeu_si512((__m512i *) ptr + 7, d08);
+ _mm512_storeu_si512((__m512i *) ptr + 8, d09);
+ _mm512_storeu_si512((__m512i *) ptr + 9, d10);
+ _mm512_storeu_si512((__m512i *) ptr + 10, d11);
+}
+
+ static NOINLINE void sort_12v(int64_t *ptr) {
+ __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);;
+ __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);;
+ __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);;
+ __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);;
+ __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);;
+ __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);;
+ __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);;
+ __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);;
+ __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);;
+ __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);;
+ __m512i d11 = _mm512_loadu_si512((__m512i const *) ptr + 10);;
+ __m512i d12 = _mm512_loadu_si512((__m512i const *) ptr + 11);;
+ sort_12v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12);
+ _mm512_storeu_si512((__m512i *) ptr + 0, d01);
+ _mm512_storeu_si512((__m512i *) ptr + 1, d02);
+ _mm512_storeu_si512((__m512i *) ptr + 2, d03);
+ _mm512_storeu_si512((__m512i *) ptr + 3, d04);
+ _mm512_storeu_si512((__m512i *) ptr + 4, d05);
+ _mm512_storeu_si512((__m512i *) ptr + 5, d06);
+ _mm512_storeu_si512((__m512i *) ptr + 6, d07);
+ _mm512_storeu_si512((__m512i *) ptr + 7, d08);
+ _mm512_storeu_si512((__m512i *) ptr + 8, d09);
+ _mm512_storeu_si512((__m512i *) ptr + 9, d10);
+ _mm512_storeu_si512((__m512i *) ptr + 10, d11);
+ _mm512_storeu_si512((__m512i *) ptr + 11, d12);
+}
+
+ static NOINLINE void sort_13v(int64_t *ptr) {
+ __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);;
+ __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);;
+ __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);;
+ __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);;
+ __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);;
+ __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);;
+ __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);;
+ __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);;
+ __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);;
+ __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);;
+ __m512i d11 = _mm512_loadu_si512((__m512i const *) ptr + 10);;
+ __m512i d12 = _mm512_loadu_si512((__m512i const *) ptr + 11);;
+ __m512i d13 = _mm512_loadu_si512((__m512i const *) ptr + 12);;
+ sort_13v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13);
+ _mm512_storeu_si512((__m512i *) ptr + 0, d01);
+ _mm512_storeu_si512((__m512i *) ptr + 1, d02);
+ _mm512_storeu_si512((__m512i *) ptr + 2, d03);
+ _mm512_storeu_si512((__m512i *) ptr + 3, d04);
+ _mm512_storeu_si512((__m512i *) ptr + 4, d05);
+ _mm512_storeu_si512((__m512i *) ptr + 5, d06);
+ _mm512_storeu_si512((__m512i *) ptr + 6, d07);
+ _mm512_storeu_si512((__m512i *) ptr + 7, d08);
+ _mm512_storeu_si512((__m512i *) ptr + 8, d09);
+ _mm512_storeu_si512((__m512i *) ptr + 9, d10);
+ _mm512_storeu_si512((__m512i *) ptr + 10, d11);
+ _mm512_storeu_si512((__m512i *) ptr + 11, d12);
+ _mm512_storeu_si512((__m512i *) ptr + 12, d13);
+}
+
+ static NOINLINE void sort_14v(int64_t *ptr) {
+ __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);;
+ __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);;
+ __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);;
+ __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);;
+ __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);;
+ __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);;
+ __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);;
+ __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);;
+ __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);;
+ __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);;
+ __m512i d11 = _mm512_loadu_si512((__m512i const *) ptr + 10);;
+ __m512i d12 = _mm512_loadu_si512((__m512i const *) ptr + 11);;
+ __m512i d13 = _mm512_loadu_si512((__m512i const *) ptr + 12);;
+ __m512i d14 = _mm512_loadu_si512((__m512i const *) ptr + 13);;
+ sort_14v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14);
+ _mm512_storeu_si512((__m512i *) ptr + 0, d01);
+ _mm512_storeu_si512((__m512i *) ptr + 1, d02);
+ _mm512_storeu_si512((__m512i *) ptr + 2, d03);
+ _mm512_storeu_si512((__m512i *) ptr + 3, d04);
+ _mm512_storeu_si512((__m512i *) ptr + 4, d05);
+ _mm512_storeu_si512((__m512i *) ptr + 5, d06);
+ _mm512_storeu_si512((__m512i *) ptr + 6, d07);
+ _mm512_storeu_si512((__m512i *) ptr + 7, d08);
+ _mm512_storeu_si512((__m512i *) ptr + 8, d09);
+ _mm512_storeu_si512((__m512i *) ptr + 9, d10);
+ _mm512_storeu_si512((__m512i *) ptr + 10, d11);
+ _mm512_storeu_si512((__m512i *) ptr + 11, d12);
+ _mm512_storeu_si512((__m512i *) ptr + 12, d13);
+ _mm512_storeu_si512((__m512i *) ptr + 13, d14);
+}
+
+ static NOINLINE void sort_15v(int64_t *ptr) {
+ __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);;
+ __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);;
+ __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);;
+ __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);;
+ __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);;
+ __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);;
+ __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);;
+ __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);;
+ __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);;
+ __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);;
+ __m512i d11 = _mm512_loadu_si512((__m512i const *) ptr + 10);;
+ __m512i d12 = _mm512_loadu_si512((__m512i const *) ptr + 11);;
+ __m512i d13 = _mm512_loadu_si512((__m512i const *) ptr + 12);;
+ __m512i d14 = _mm512_loadu_si512((__m512i const *) ptr + 13);;
+ __m512i d15 = _mm512_loadu_si512((__m512i const *) ptr + 14);;
+ sort_15v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14, d15);
+ _mm512_storeu_si512((__m512i *) ptr + 0, d01);
+ _mm512_storeu_si512((__m512i *) ptr + 1, d02);
+ _mm512_storeu_si512((__m512i *) ptr + 2, d03);
+ _mm512_storeu_si512((__m512i *) ptr + 3, d04);
+ _mm512_storeu_si512((__m512i *) ptr + 4, d05);
+ _mm512_storeu_si512((__m512i *) ptr + 5, d06);
+ _mm512_storeu_si512((__m512i *) ptr + 6, d07);
+ _mm512_storeu_si512((__m512i *) ptr + 7, d08);
+ _mm512_storeu_si512((__m512i *) ptr + 8, d09);
+ _mm512_storeu_si512((__m512i *) ptr + 9, d10);
+ _mm512_storeu_si512((__m512i *) ptr + 10, d11);
+ _mm512_storeu_si512((__m512i *) ptr + 11, d12);
+ _mm512_storeu_si512((__m512i *) ptr + 12, d13);
+ _mm512_storeu_si512((__m512i *) ptr + 13, d14);
+ _mm512_storeu_si512((__m512i *) ptr + 14, d15);
+}
+
+ static NOINLINE void sort_16v(int64_t *ptr) {
+ __m512i d01 = _mm512_loadu_si512((__m512i const *) ptr + 0);;
+ __m512i d02 = _mm512_loadu_si512((__m512i const *) ptr + 1);;
+ __m512i d03 = _mm512_loadu_si512((__m512i const *) ptr + 2);;
+ __m512i d04 = _mm512_loadu_si512((__m512i const *) ptr + 3);;
+ __m512i d05 = _mm512_loadu_si512((__m512i const *) ptr + 4);;
+ __m512i d06 = _mm512_loadu_si512((__m512i const *) ptr + 5);;
+ __m512i d07 = _mm512_loadu_si512((__m512i const *) ptr + 6);;
+ __m512i d08 = _mm512_loadu_si512((__m512i const *) ptr + 7);;
+ __m512i d09 = _mm512_loadu_si512((__m512i const *) ptr + 8);;
+ __m512i d10 = _mm512_loadu_si512((__m512i const *) ptr + 9);;
+ __m512i d11 = _mm512_loadu_si512((__m512i const *) ptr + 10);;
+ __m512i d12 = _mm512_loadu_si512((__m512i const *) ptr + 11);;
+ __m512i d13 = _mm512_loadu_si512((__m512i const *) ptr + 12);;
+ __m512i d14 = _mm512_loadu_si512((__m512i const *) ptr + 13);;
+ __m512i d15 = _mm512_loadu_si512((__m512i const *) ptr + 14);;
+ __m512i d16 = _mm512_loadu_si512((__m512i const *) ptr + 15);;
+ sort_16v_ascending(d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12, d13, d14, d15, d16);
+ _mm512_storeu_si512((__m512i *) ptr + 0, d01);
+ _mm512_storeu_si512((__m512i *) ptr + 1, d02);
+ _mm512_storeu_si512((__m512i *) ptr + 2, d03);
+ _mm512_storeu_si512((__m512i *) ptr + 3, d04);
+ _mm512_storeu_si512((__m512i *) ptr + 4, d05);
+ _mm512_storeu_si512((__m512i *) ptr + 5, d06);
+ _mm512_storeu_si512((__m512i *) ptr + 6, d07);
+ _mm512_storeu_si512((__m512i *) ptr + 7, d08);
+ _mm512_storeu_si512((__m512i *) ptr + 8, d09);
+ _mm512_storeu_si512((__m512i *) ptr + 9, d10);
+ _mm512_storeu_si512((__m512i *) ptr + 10, d11);
+ _mm512_storeu_si512((__m512i *) ptr + 11, d12);
+ _mm512_storeu_si512((__m512i *) ptr + 12, d13);
+ _mm512_storeu_si512((__m512i *) ptr + 13, d14);
+ _mm512_storeu_si512((__m512i *) ptr + 14, d15);
+ _mm512_storeu_si512((__m512i *) ptr + 15, d16);
+}
+ static void sort(int64_t *ptr, size_t length);
+
+};
+}
+}
+
+#undef i2d
+#undef d2i
+#undef i2s
+#undef s2i
+#undef s2d
+#undef d2s
+
+#ifdef __GNUC__
+#ifdef __clang__
+#pragma clang attribute pop
+#else
+#pragma GCC pop_options
+#endif
+#endif
+#endif
+
diff --git a/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.h b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.h
new file mode 100644
index 000000000000..0e87b3742266
--- /dev/null
+++ b/src/coreclr/src/gc/vxsort/smallsort/bitonic_sort.h
@@ -0,0 +1,20 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+#ifndef BITONIC_SORT_H
+#define BITONIC_SORT_H
+
+#include
+#include "../defs.h"
+#include "../machine_traits.h"
+
+namespace vxsort {
+namespace smallsort {
+template
+struct bitonic {
+ public:
+ static void sort(T* ptr, size_t length);
+};
+} // namespace smallsort
+} // namespace gcsort
+#endif
diff --git a/src/coreclr/src/gc/vxsort/smallsort/codegen/avx2.py b/src/coreclr/src/gc/vxsort/smallsort/codegen/avx2.py
new file mode 100644
index 000000000000..5f941d37ff1e
--- /dev/null
+++ b/src/coreclr/src/gc/vxsort/smallsort/codegen/avx2.py
@@ -0,0 +1,490 @@
+##
+## Licensed to the .NET Foundation under one or more agreements.
+## The .NET Foundation licenses this file to you under the MIT license.
+##
+
+import os
+from datetime import datetime
+
+from utils import native_size_map, next_power_of_2
+from bitonic_isa import BitonicISA
+
+
+class AVX2BitonicISA(BitonicISA):
+ def __init__(self, type):
+ self.vector_size_in_bytes = 32
+
+ self.type = type
+
+ self.bitonic_size_map = {}
+
+ for t, s in native_size_map.items():
+ self.bitonic_size_map[t] = int(self.vector_size_in_bytes / s)
+
+ self.bitonic_type_map = {
+ "int32_t": "__m256i",
+ "uint32_t": "__m256i",
+ "float": "__m256",
+ "int64_t": "__m256i",
+ "uint64_t": "__m256i",
+ "double": "__m256d",
+ }
+
+ def max_bitonic_sort_vectors(self):
+ return 16
+
+ def vector_size(self):
+ return self.bitonic_size_map[self.type]
+
+ def vector_type(self):
+ return self.bitonic_type_map[self.type]
+
+ @classmethod
+ def supported_types(cls):
+ return native_size_map.keys()
+
+ def i2d(self, v):
+ t = self.type
+ if t == "double":
+ return v
+ elif t == "float":
+ return f"s2d({v})"
+ return f"i2d({v})"
+
+ def i2s(self, v):
+ t = self.type
+ if t == "double":
+ raise Exception("Incorrect Type")
+ elif t == "float":
+ return f"i2s({v})"
+ return v
+
+ def d2i(self, v):
+ t = self.type
+ if t == "double":
+ return v
+ elif t == "float":
+ return f"d2s({v})"
+ return f"d2i({v})"
+
+ def s2i(self, v):
+ t = self.type
+ if t == "double":
+ raise Exception("Incorrect Type")
+ elif t == "float":
+ return f"s2i({v})"
+ return v
+
+ def generate_param_list(self, start, numParams):
+ return str.join(", ", list(map(lambda p: f"d{p:02d}", range(start, start + numParams))))
+
+ def generate_param_def_list(self, numParams):
+ t = self.type
+ return str.join(", ", list(map(lambda p: f"{self.vector_type()}& d{p:02d}", range(1, numParams + 1))))
+
+ def generate_shuffle_X1(self, v):
+ size = self.vector_size()
+ if size == 8:
+ return self.i2s(f"_mm256_shuffle_epi32({self.s2i(v)}, 0xB1)")
+ elif size == 4:
+ return self.d2i(f"_mm256_shuffle_pd({self.i2d(v)}, {self.i2d(v)}, 0x5)")
+
+ def generate_shuffle_X2(self, v):
+ size = self.vector_size()
+ if size == 8:
+ return self.i2s(f"_mm256_shuffle_epi32({self.s2i(v)}, 0x4E)")
+ elif size == 4:
+ return self.d2i(f"_mm256_permute4x64_pd({self.i2d(v)}, 0x4E)")
+
+ def generate_shuffle_XR(self, v):
+ size = self.vector_size()
+ if size == 8:
+ return self.i2s(f"_mm256_shuffle_epi32({self.s2i(v)}, 0x1B)")
+ elif size == 4:
+ return self.d2i(f"_mm256_permute4x64_pd({self.i2d(v)}, 0x1B)")
+
+ def generate_blend_B1(self, v1, v2, ascending):
+ size = self.vector_size()
+ if size == 8:
+ if ascending:
+ return self.i2s(f"_mm256_blend_epi32({self.s2i(v1)}, {self.s2i(v2)}, 0xAA)")
+ else:
+ return self.i2s(f"_mm256_blend_epi32({self.s2i(v2)}, {self.s2i(v1)}, 0xAA)")
+ elif size == 4:
+ if ascending:
+ return self.d2i(f"_mm256_blend_pd({self.i2d(v1)}, {self.i2d(v2)}, 0xA)")
+ else:
+ return self.d2i(f"_mm256_blend_pd({self.i2d(v2)}, {self.i2d(v1)}, 0xA)")
+
+ def generate_blend_B2(self, v1, v2, ascending):
+ size = self.vector_size()
+ if size == 8:
+ if ascending:
+ return self.i2s(f"_mm256_blend_epi32({self.s2i(v1)}, {self.s2i(v2)}, 0xCC)")
+ else:
+ return self.i2s(f"_mm256_blend_epi32({self.s2i(v2)}, {self.s2i(v1)}, 0xCC)")
+ elif size == 4:
+ if ascending:
+ return self.d2i(f"_mm256_blend_pd({self.i2d(v1)}, {self.i2d(v2)}, 0xC)")
+ else:
+ return self.d2i(f"_mm256_blend_pd({self.i2d(v2)}, {self.i2d(v1)}, 0xC)")
+
+ def generate_blend_B4(self, v1, v2, ascending):
+ size = self.vector_size()
+ if size == 8:
+ if ascending:
+ return self.i2s(f"_mm256_blend_epi32({self.s2i(v1)}, {self.s2i(v2)}, 0xF0)")
+ else:
+ return self.i2s(f"_mm256_blend_epi32({self.s2i(v2)}, {self.s2i(v1)}, 0xF0)")
+ elif size == 4:
+ raise Exception("Incorrect Size")
+
+ def generate_cross(self, v):
+ size = self.vector_size()
+ if size == 8:
+ return self.d2i(f"_mm256_permute4x64_pd({self.i2d(v)}, 0x4E)")
+ elif size == 4:
+ raise Exception("Incorrect Size")
+
+ def generate_reverse(self, v):
+ size = self.vector_size()
+ if size == 8:
+ v = f"_mm256_shuffle_epi32({self.s2i(v)}, 0x1B)"
+ return self.d2i(f"_mm256_permute4x64_pd(i2d({v}), 0x4E)")
+ elif size == 4:
+ return self.d2i(f"_mm256_permute4x64_pd({self.i2d(v)}, 0x1B)")
+
+ def crappity_crap_crap(self, v1, v2):
+ t = self.type
+ if t == "int64_t":
+ return f"cmp = _mm256_cmpgt_epi64({v1}, {v2});"
+ elif t == "uint64_t":
+ return f"cmp = _mm256_cmpgt_epi64(_mm256_xor_si256(topBit, {v1}), _mm256_xor_si256(topBit, {v2}));"
+
+ return ""
+
+ def generate_min(self, v1, v2):
+ t = self.type
+ if t == "int32_t":
+ return f"_mm256_min_epi32({v1}, {v2})"
+ elif t == "uint32_t":
+ return f"_mm256_min_epu32({v1}, {v2})"
+ elif t == "float":
+ return f"_mm256_min_ps({v1}, {v2})"
+ elif t == "int64_t":
+ return self.d2i(f"_mm256_blendv_pd({self.i2d(v1)}, {self.i2d(v2)}, i2d(cmp))")
+ elif t == "uint64_t":
+ return self.d2i(f"_mm256_blendv_pd({self.i2d(v1)}, {self.i2d(v2)}, i2d(cmp))")
+ elif t == "double":
+ return f"_mm256_min_pd({v1}, {v2})"
+
+ def generate_max(self, v1, v2):
+ t = self.type
+ if t == "int32_t":
+ return f"_mm256_max_epi32({v1}, {v2})"
+ elif t == "uint32_t":
+ return f"_mm256_max_epu32({v1}, {v2})"
+ elif t == "float":
+ return f"_mm256_max_ps({v1}, {v2})"
+ elif t == "int64_t":
+ return self.d2i(f"_mm256_blendv_pd({self.i2d(v2)}, {self.i2d(v1)}, i2d(cmp))")
+ elif t == "uint64_t":
+ return self.d2i(f"_mm256_blendv_pd({self.i2d(v2)}, {self.i2d(v1)}, i2d(cmp))")
+ elif t == "double":
+ return f"_mm256_max_pd({v1}, {v2})"
+
+ def get_load_intrinsic(self, v, offset):
+ t = self.type
+ if t == "double":
+ return f"_mm256_loadu_pd(({t} const *) ((__m256d const *) {v} + {offset}))"
+ if t == "float":
+ return f"_mm256_loadu_ps(({t} const *) ((__m256 const *) {v} + {offset}))"
+ return f"_mm256_lddqu_si256((__m256i const *) {v} + {offset});"
+
+
+ def get_store_intrinsic(self, ptr, offset, value):
+ t = self.type
+ if t == "double":
+ return f"_mm256_storeu_pd(({t} *) ((__m256d *) {ptr} + {offset}), {value})"
+ if t == "float":
+ return f"_mm256_storeu_ps(({t} *) ((__m256 *) {ptr} + {offset}), {value})"
+ return f"_mm256_storeu_si256((__m256i *) {ptr} + {offset}, {value})"
+
+ def autogenerated_blabber(self):
+ return f"""/////////////////////////////////////////////////////////////////////////////
+////
+// This file was auto-generated by a tool at {datetime.now().strftime("%F %H:%M:%S")}
+//
+// It is recommended you DO NOT directly edit this file but instead edit
+// the code-generator that generated this source file instead.
+/////////////////////////////////////////////////////////////////////////////"""
+
+ def generate_prologue(self, f):
+ t = self.type
+ s = f"""{self.autogenerated_blabber()}
+
+#ifndef BITONIC_SORT_AVX2_{t.upper()}_H
+#define BITONIC_SORT_AVX2_{t.upper()}_H
+
+#ifdef __GNUC__
+#ifdef __clang__
+#pragma clang attribute push (__attribute__((target("avx2"))), apply_to = any(function))
+#else
+#pragma GCC push_options
+#pragma GCC target("avx2")
+#endif
+#endif
+
+#include
+#include "bitonic_sort.h"
+
+#define i2d _mm256_castsi256_pd
+#define d2i _mm256_castpd_si256
+#define i2s _mm256_castsi256_ps
+#define s2i _mm256_castps_si256
+#define s2d _mm256_castps_pd
+#define d2s _mm256_castpd_ps
+
+namespace vxsort {{
+namespace smallsort {{
+template<> struct bitonic<{t}, AVX2> {{
+public:
+"""
+ print(s, file=f)
+
+ def generate_epilogue(self, f):
+ s = f"""
+}};
+}}
+}}
+
+#undef i2d
+#undef d2i
+#undef i2s
+#undef s2i
+#undef s2d
+#undef d2s
+
+#ifdef __GNUC__
+#ifdef __clang__
+#pragma clang attribute pop
+#else
+#pragma GCC pop_options
+#endif
+#endif
+#endif
+ """
+ print(s, file=f)
+
+ def generate_1v_basic_sorters(self, f, ascending):
+ g = self
+ type = self.type
+ maybe_cmp = lambda: ", cmp" if (type == "int64_t" or type == "uint64_t") else ""
+ maybe_topbit = lambda: f"\n {g.vector_type()} topBit = _mm256_set1_epi64x(1LLU << 63);" if (type == "uint64_t") else ""
+ suffix = "ascending" if ascending else "descending"
+
+ s = f""" static INLINE void sort_01v_{suffix}({g.generate_param_def_list(1)}) {{
+ {g.vector_type()} min, max, s{maybe_cmp()};{maybe_topbit()}
+
+ s = {g.generate_shuffle_X1("d01")};
+ {g.crappity_crap_crap("s", "d01")}
+ min = {g.generate_min("s", "d01")};
+ max = {g.generate_max("s", "d01")};
+ d01 = {g.generate_blend_B1("min", "max", ascending)};
+
+ s = {g.generate_shuffle_XR("d01")};
+ {g.crappity_crap_crap("s", "d01")}
+ min = {g.generate_min("s", "d01")};
+ max = {g.generate_max("s", "d01")};
+ d01 = {g.generate_blend_B2("min", "max", ascending)};
+
+ s = {g.generate_shuffle_X1("d01")};
+ {g.crappity_crap_crap("s", "d01")}
+ min = {g.generate_min("s", "d01")};
+ max = {g.generate_max("s", "d01")};
+ d01 = {g.generate_blend_B1("min", "max", ascending)};"""
+
+ print(s, file=f)
+
+ if g.vector_size() == 8:
+ s = f"""
+ s = {g.generate_reverse("d01")};
+ min = {g.generate_min("s", "d01")};
+ max = {g.generate_max("s", "d01")};
+ d01 = {g.generate_blend_B4("min", "max", ascending)};
+
+ s = {g.generate_shuffle_X2("d01")};
+ min = {g.generate_min("s", "d01")};
+ max = {g.generate_max("s", "d01")};
+ d01 = {g.generate_blend_B2("min", "max", ascending)};
+
+ s = {g.generate_shuffle_X1("d01")};
+ min = {g.generate_min("s", "d01")};
+ max = {g.generate_max("s", "d01")};
+ d01 = {g.generate_blend_B1("min", "max", ascending)};"""
+ print(s, file=f)
+ print("}", file=f)
+
+
+
+ def generate_1v_merge_sorters(self, f, ascending: bool):
+ g = self
+ type = self.type
+ maybe_cmp = lambda: ", cmp" if (type == "int64_t" or type == "uint64_t") else ""
+ maybe_topbit = lambda: f"\n {g.vector_type()} topBit = _mm256_set1_epi64x(1LLU << 63);" if (
+ type == "uint64_t") else ""
+
+ suffix = "ascending" if ascending else "descending"
+
+ s = f""" static INLINE void sort_01v_merge_{suffix}({g.generate_param_def_list(1)}) {{
+ {g.vector_type()} min, max, s{maybe_cmp()};{maybe_topbit()}"""
+ print(s, file=f)
+
+ if g.vector_size() == 8:
+ s = f"""
+ s = {g.generate_cross("d01")};
+ min = {g.generate_min("s", "d01")};
+ max = {g.generate_max("s", "d01")};
+ d01 = {g.generate_blend_B4("min", "max", ascending)};"""
+ print(s, file=f)
+
+ s = f"""
+ s = {g.generate_shuffle_X2("d01")};
+ {g.crappity_crap_crap("s", "d01")}
+ min = {g.generate_min("s", "d01")};
+ max = {g.generate_max("s", "d01")};
+ d01 = {g.generate_blend_B2("min", "max", ascending)};
+
+ s = {g.generate_shuffle_X1("d01")};
+ {g.crappity_crap_crap("s", "d01")}
+ min = {g.generate_min("s", "d01")};
+ max = {g.generate_max("s", "d01")};
+ d01 = {g.generate_blend_B1("min", "max", ascending)};"""
+
+ print(s, file=f)
+ print(" }", file=f)
+
+ def generate_compounded_sorter(self, f, width, ascending, inline):
+ type = self.type
+ g = self
+ maybe_cmp = lambda: ", cmp" if (type == "int64_t" or type == "uint64_t") else ""
+ maybe_topbit = lambda: f"\n {g.vector_type()} topBit = _mm256_set1_epi64x(1LLU << 63);" if (
+ type == "uint64_t") else ""
+
+ w1 = int(next_power_of_2(width) / 2)
+ w2 = int(width - w1)
+
+ suffix = "ascending" if ascending else "descending"
+ rev_suffix = "descending" if ascending else "ascending"
+
+ inl = "INLINE" if inline else "NOINLINE"
+
+ s = f""" static {inl} void sort_{width:02d}v_{suffix}({g.generate_param_def_list(width)}) {{
+ {g.vector_type()} tmp{maybe_cmp()};{maybe_topbit()}
+
+ sort_{w1:02d}v_{suffix}({g.generate_param_list(1, w1)});
+ sort_{w2:02d}v_{rev_suffix}({g.generate_param_list(w1 + 1, w2)});"""
+
+ print(s, file=f)
+
+ for r in range(w1 + 1, width + 1):
+ x = w1 + 1 - (r - w1)
+ s = f"""
+ tmp = d{r:02d};
+ {g.crappity_crap_crap(f"d{x:02d}", f"d{r:02d}")}
+ d{r:02d} = {g.generate_max(f"d{x:02d}", f"d{r:02d}")};
+ d{x:02d} = {g.generate_min(f"d{x:02d}", "tmp")};"""
+
+ print(s, file=f)
+
+ s = f"""
+ sort_{w1:02d}v_merge_{suffix}({g.generate_param_list(1, w1)});
+ sort_{w2:02d}v_merge_{suffix}({g.generate_param_list(w1 + 1, w2)});"""
+ print(s, file=f)
+ print(" }", file=f)
+
+
+ def generate_compounded_merger(self, f, width, ascending, inline):
+ type = self.type
+ g = self
+ maybe_cmp = lambda: ", cmp" if (type == "int64_t" or type == "uint64_t") else ""
+ maybe_topbit = lambda: f"\n {g.vector_type()} topBit = _mm256_set1_epi64x(1LLU << 63);" if (
+ type == "uint64_t") else ""
+
+ w1 = int(next_power_of_2(width) / 2)
+ w2 = int(width - w1)
+
+ suffix = "ascending" if ascending else "descending"
+ rev_suffix = "descending" if ascending else "ascending"
+
+ inl = "INLINE" if inline else "NOINLINE"
+
+ s = f""" static {inl} void sort_{width:02d}v_merge_{suffix}({g.generate_param_def_list(width)}) {{
+ {g.vector_type()} tmp{maybe_cmp()};{maybe_topbit()}"""
+ print(s, file=f)
+
+ for r in range(w1 + 1, width + 1):
+ x = r - w1
+ s = f"""
+ tmp = d{x:02d};
+ {g.crappity_crap_crap(f"d{r:02d}", f"d{x:02d}")}
+ d{x:02d} = {g.generate_min(f"d{r:02d}", f"d{x:02d}")};
+ {g.crappity_crap_crap(f"d{r:02d}", "tmp")}
+ d{r:02d} = {g.generate_max(f"d{r:02d}", "tmp")};"""
+ print(s, file=f)
+
+ s = f"""
+ sort_{w1:02d}v_merge_{suffix}({g.generate_param_list(1, w1)});
+ sort_{w2:02d}v_merge_{suffix}({g.generate_param_list(w1 + 1, w2)});"""
+ print(s, file=f)
+ print(" }", file=f)
+
+
+ def generate_entry_points(self, f):
+ type = self.type
+ g = self
+ for m in range(1, g.max_bitonic_sort_vectors() + 1):
+ s = f"""
+ static NOINLINE void sort_{m:02d}v({type} *ptr) {{"""
+ print(s, file=f)
+
+ for l in range(0, m):
+ s = f" {g.vector_type()} d{l + 1:02d} = {g.get_load_intrinsic('ptr', l)};"
+ print(s, file=f)
+
+ s = f" sort_{m:02d}v_ascending({g.generate_param_list(1, m)});"
+ print(s, file=f)
+
+ for l in range(0, m):
+ s = f" {g.get_store_intrinsic('ptr', l, f'd{l + 1:02d}')};"
+ print(s, file=f)
+
+ print("}", file=f)
+
+
+ def generate_master_entry_point(self, f_header, f_src):
+ basename = os.path.basename(f_header.name)
+ s = f"""#include "{basename}"
+
+using namespace vxsort;
+"""
+ print(s, file=f_src)
+
+ t = self.type
+ g = self
+
+ s = f""" static void sort({t} *ptr, size_t length);"""
+ print(s, file=f_header)
+
+ s = f"""void vxsort::smallsort::bitonic<{t}, vector_machine::AVX2 >::sort({t} *ptr, size_t length) {{
+ const int N = {g.vector_size()};
+
+ switch(length / N) {{"""
+ print(s, file=f_src)
+
+ for m in range(1, self.max_bitonic_sort_vectors() + 1):
+ s = f" case {m}: sort_{m:02d}v(ptr); break;"
+ print(s, file=f_src)
+ print(" }", file=f_src)
+ print("}", file=f_src)
+ pass
diff --git a/src/coreclr/src/gc/vxsort/smallsort/codegen/avx512.py b/src/coreclr/src/gc/vxsort/smallsort/codegen/avx512.py
new file mode 100644
index 000000000000..f08fda8a4445
--- /dev/null
+++ b/src/coreclr/src/gc/vxsort/smallsort/codegen/avx512.py
@@ -0,0 +1,490 @@
+##
+## Licensed to the .NET Foundation under one or more agreements.
+## The .NET Foundation licenses this file to you under the MIT license.
+##
+
+from datetime import datetime
+
+from utils import native_size_map, next_power_of_2
+from bitonic_isa import BitonicISA
+import os
+
+
+class AVX512BitonicISA(BitonicISA):
+ def __init__(self, type):
+ self.vector_size_in_bytes = 64
+
+ self.type = type
+
+ self.bitonic_size_map = {}
+
+ for t, s in native_size_map.items():
+ self.bitonic_size_map[t] = int(self.vector_size_in_bytes / s)
+
+ self.bitonic_type_map = {
+ "int32_t": "__m512i",
+ "uint32_t": "__m512i",
+ "float": "__m512",
+ "int64_t": "__m512i",
+ "uint64_t": "__m512i",
+ "double": "__m512d",
+ }
+
+ def max_bitonic_sort_vectors(self):
+ return 16
+
+ def vector_size(self):
+ return self.bitonic_size_map[self.type]
+
+ def vector_type(self):
+ return self.bitonic_type_map[self.type]
+
+ @classmethod
+ def supported_types(cls):
+ return native_size_map.keys()
+
+ def i2d(self, v):
+ t = self.type
+ if t == "double":
+ return v
+ elif t == "float":
+ raise Exception("Incorrect Type")
+ return f"i2d({v})"
+
+ def i2s(self, v):
+ t = self.type
+ if t == "double":
+ raise Exception("Incorrect Type")
+ elif t == "float":
+ return f"i2s({v})"
+ return v
+
+ def d2i(self, v):
+ t = self.type
+ if t == "double":
+ return v
+ elif t == "float":
+ raise Exception("Incorrect Type")
+ return f"d2i({v})"
+
+ def s2i(self, v):
+ t = self.type
+ if t == "double":
+ raise Exception("Incorrect Type")
+ elif t == "float":
+ return f"s2i({v})"
+ return v
+
+ def generate_param_list(self, start, numParams):
+ return str.join(", ", list(map(lambda p: f"d{p:02d}", range(start, start + numParams))))
+
+ def generate_param_def_list(self, numParams):
+ t = self.type
+ return str.join(", ", list(map(lambda p: f"{self.vector_type()}& d{p:02d}", range(1, numParams + 1))))
+
+ def generate_shuffle_S1(self, v):
+ t = self.type
+ size = self.bitonic_size_map[t]
+ if size == 16:
+ return self.i2s(f"_mm512_shuffle_epi32({self.s2i(v)}, _MM_PERM_CDAB)")
+ elif size == 8:
+ return self.d2i(f"_mm512_permute_pd({self.i2d(v)}, _MM_PERM_BBBB)")
+
+ def generate_shuffle_X4(self, v):
+ t = self.type
+ size = self.bitonic_size_map[t]
+ if size == 16:
+ return self.i2s(f"_mm512_shuffle_epi32({self.s2i(v)}, _MM_PERM_ABCD)")
+ elif size == 8:
+ return self.d2i(f"_mm512_permutex_pd({self.i2d(v)}, _MM_PERM_ABCD)")
+
+ def generate_shuffle_X8(self, v):
+ t = self.type
+ size = self.bitonic_size_map[t]
+ if size == 16:
+ s1 = f"_mm512_shuffle_epi32({self.s2i(v)}, _MM_PERM_ABCD)"
+ return self.i2s(f"_mm512_permutex_epi64({s1}, _MM_PERM_BADC)")
+ elif size == 8:
+ s1 = f"_mm512_permutex_pd({self.i2d(v)}, _MM_PERM_ABCD)"
+ return self.d2i(f"_mm512_shuffle_f64x2({s1}, {s1}, _MM_PERM_BADC)")
+
+ def generate_shuffle_S2(self, v):
+ t = self.type
+ size = self.bitonic_size_map[t]
+ if size == 16:
+ return self.i2s(f"_mm512_shuffle_epi32({self.s2i(v)}, _MM_PERM_BADC)")
+ elif size == 8:
+ return self.d2i(f"_mm512_permutex_pd({self.i2d(v)}, _MM_PERM_BADC)")
+
+ def generate_shuffle_X16(self, v):
+ t = self.type
+ size = self.bitonic_size_map[t]
+ if size == 16:
+ s1 = f"_mm512_shuffle_epi32({self.s2i(v)}, _MM_PERM_ABCD)"
+ return self.i2s(f"_mm512_shuffle_i64x2({s1}, {s1}, _MM_PERM_ABCD)")
+ elif size == 8:
+ return self.d2i(f"_mm512_shuffle_pd({self.i2d(v)}, {self.i2d(v)}, 0xB1)")
+
+ def generate_shuffle_S4(self, v):
+ t = self.type
+ size = self.bitonic_size_map[t]
+ if size == 16:
+ return self.i2s(f"_mm512_permutex_epi64({self.s2i(v)}, _MM_PERM_BADC)")
+ elif size == 8:
+ return self.d2i(f"_mm512_shuffle_f64x2({self.i2d(v)}, {self.i2d(v)}, _MM_PERM_BADC)")
+
+ def generate_shuffle_S8(self, v):
+ t = self.type
+ size = self.bitonic_size_map[t]
+ if size == 16:
+ return self.i2s(f"_mm512_shuffle_i64x2({self.s2i(v)}, {self.s2i(v)}, _MM_PERM_BADC)")
+ elif size == 8:
+ return self.d2i(f"_mm512_shuffle_pd({self.i2d(v)}, {self.i2d(v)}, 0xB1)")
+
+ def generate_min(self, v1, v2):
+ t = self.type
+ if t == "int32_t":
+ return f"_mm512_min_epi32({v1}, {v2})"
+ elif t == "uint32_t":
+ return f"_mm512_min_epu32({v1}, {v2})"
+ elif t == "float":
+ return f"_mm512_min_ps({v1}, {v2})"
+ elif t == "int64_t":
+ return f"_mm512_min_epi64({v1}, {v2})"
+ elif t == "uint64_t":
+ return f"_mm512_min_epu64({v1}, {v2})"
+ elif t == "double":
+ return f"_mm512_min_pd({v1}, {v2})"
+
+ def generate_max(self, v1, v2):
+ t = self.type
+ if t == "int32_t":
+ return f"_mm512_max_epi32({v1}, {v2})"
+ elif t == "uint32_t":
+ return f"_mm512_max_epu32({v1}, {v2})"
+ elif t == "float":
+ return f"_mm512_max_ps({v1}, {v2})"
+ elif t == "int64_t":
+ return f"_mm512_max_epi64({v1}, {v2})"
+ elif t == "uint64_t":
+ return f"_mm512_max_epu64({v1}, {v2})"
+ elif t == "double":
+ return f"_mm512_max_pd({v1}, {v2})"
+
+ def generate_mask(self, stride, ascending):
+ b = 1 << stride
+ b = b - 1
+ if ascending:
+ b = b << stride
+
+ mask = 0
+ size = self.vector_size()
+ while size > 0:
+ mask = mask << (stride * 2) | b
+ size = size - (stride * 2)
+ return mask
+
+
+ def generate_max_with_blend(self, src, v1, v2, stride, ascending):
+ mask = self.generate_mask(stride, ascending)
+ t = self.type
+ if t == "int32_t":
+ return f"_mm512_mask_max_epi32({src}, 0x{mask:04X}, {v1}, {v2})"
+ elif t == "uint32_t":
+ return f"_mm512_mask_max_epu32({src}, 0x{mask:04X}, {v1}, {v2})"
+ elif t == "float":
+ return f"_mm512_mask_max_ps({src}, 0x{mask:04X}, {v1}, {v2})"
+ elif t == "int64_t":
+ return f"_mm512_mask_max_epi64({src}, 0x{mask:04X}, {v1}, {v2})"
+ elif t == "uint64_t":
+ return f"_mm512_mask_max_epu64({src}, 0x{mask:04X}, {v1}, {v2})"
+ elif t == "double":
+ return f"_mm512_mask_max_pd({src}, 0x{mask:04X}, {v1}, {v2})"
+
+
+ def get_load_intrinsic(self, v, offset):
+ t = self.type
+ if t == "double":
+ return f"_mm512_loadu_pd(({t} const *) ((__m512d const *) {v} + {offset}))"
+ if t == "float":
+ return f"_mm512_loadu_ps(({t} const *) ((__m512 const *) {v} + {offset}))"
+ return f"_mm512_loadu_si512((__m512i const *) {v} + {offset});"
+
+
+ def get_store_intrinsic(self, ptr, offset, value):
+ t = self.type
+ if t == "double":
+ return f"_mm512_storeu_pd(({t} *) ((__m512d *) {ptr} + {offset}), {value})"
+ if t == "float":
+ return f"_mm512_storeu_ps(({t} *) ((__m512 *) {ptr} + {offset}), {value})"
+ return f"_mm512_storeu_si512((__m512i *) {ptr} + {offset}, {value})"
+
+ def autogenerated_blabber(self):
+ return f"""/////////////////////////////////////////////////////////////////////////////
+////
+// This file was auto-generated by a tool at {datetime.now().strftime("%F %H:%M:%S")}
+//
+// It is recommended you DO NOT directly edit this file but instead edit
+// the code-generator that generated this source file instead.
+/////////////////////////////////////////////////////////////////////////////"""
+
+ def generate_prologue(self, f):
+ t = self.type
+ s = f"""{self.autogenerated_blabber()}
+
+#ifndef BITONIC_SORT_AVX512_{t.upper()}_H
+#define BITONIC_SORT_AVX512_{t.upper()}_H
+
+
+#ifdef __GNUC__
+#ifdef __clang__
+#pragma clang attribute push (__attribute__((target("avx512f"))), apply_to = any(function))
+#else
+#pragma GCC push_options
+#pragma GCC target("avx512f")
+#endif
+#endif
+
+#include
+#include "bitonic_sort.h"
+
+#define i2d _mm512_castsi512_pd
+#define d2i _mm512_castpd_si512
+#define i2s _mm512_castsi512_ps
+#define s2i _mm512_castps_si512
+#define s2d _mm512_castps_pd
+#define d2s _mm521_castpd_ps
+
+namespace vxsort {{
+namespace smallsort {{
+template<> struct bitonic<{t}, AVX512> {{
+public:
+"""
+ print(s, file=f)
+
+ def generate_epilogue(self, f):
+ s = f"""
+}};
+}}
+}}
+
+#undef i2d
+#undef d2i
+#undef i2s
+#undef s2i
+#undef s2d
+#undef d2s
+
+#ifdef __GNUC__
+#ifdef __clang__
+#pragma clang attribute pop
+#else
+#pragma GCC pop_options
+#endif
+#endif
+#endif
+"""
+ print(s, file=f)
+
+ def generate_1v_basic_sorters(self, f, ascending):
+ g = self
+ type = self.type
+ suffix = "ascending" if ascending else "descending"
+
+ s = f""" static INLINE void sort_01v_{suffix}({g.generate_param_def_list(1)}) {{
+ {g.vector_type()} min, s;
+
+ s = {g.generate_shuffle_S1("d01")};
+ min = {g.generate_min("s", "d01")};
+ d01 = {g.generate_max_with_blend("min", "s", "d01", 1, ascending)};
+
+ s = {g.generate_shuffle_X4("d01")};
+ min = {g.generate_min("s", "d01")};
+ d01 = {g.generate_max_with_blend("min", "s", "d01", 2, ascending)};
+
+ s = {g.generate_shuffle_S1("d01")};
+ min = {g.generate_min("s", "d01")};
+ d01 = {g.generate_max_with_blend("min", "s", "d01", 1, ascending)};
+
+ s = {g.generate_shuffle_X8("d01")};
+ min = {g.generate_min("s", "d01")};
+ d01 = {g.generate_max_with_blend("min", "s", "d01", 4, ascending)};
+
+ s = {g.generate_shuffle_S2("d01")};
+ min = {g.generate_min("s", "d01")};
+ d01 = {g.generate_max_with_blend("min", "s", "d01", 2, ascending)};
+
+ s = {g.generate_shuffle_S1("d01")};
+ min = {g.generate_min("s", "d01")};
+ d01 = {g.generate_max_with_blend("min", "s", "d01", 1, ascending)};"""
+
+ print(s, file=f)
+
+ if g.vector_size() == 16:
+ s = f"""
+ s = {g.generate_shuffle_X16("d01")};
+ min = {g.generate_min("s", "d01")};
+ d01 = {g.generate_max_with_blend("min", "s", "d01", 8, ascending)};
+
+ s = {g.generate_shuffle_S4("d01")};
+ min = {g.generate_min("s", "d01")};
+ d01 = {g.generate_max_with_blend("min", "s", "d01", 4, ascending)};
+
+ s = {g.generate_shuffle_S2("d01")};
+ min = {g.generate_min("s", "d01")};
+ d01 = {g.generate_max_with_blend("min", "s", "d01", 2, ascending)};
+
+ s = {g.generate_shuffle_S1("d01")};
+ min = {g.generate_min("s", "d01")};
+ d01 = {g.generate_max_with_blend("min", "s", "d01", 1, ascending)};"""
+ print(s, file=f)
+ print(" }", file=f)
+
+ def generate_1v_merge_sorters(self, f, ascending: bool):
+ g = self
+ type = self.type
+ suffix = "ascending" if ascending else "descending"
+
+ s = f""" static INLINE void sort_01v_merge_{suffix}({g.generate_param_def_list(1)}) {{
+ {g.vector_type()} min, s;"""
+ print(s, file=f)
+
+ if g.vector_size() == 16:
+ s = f"""
+ s = {g.generate_shuffle_S8("d01")};
+ min = {g.generate_min("s", "d01")};
+ d01 = {g.generate_max_with_blend("min", "s", "d01", 8, ascending)};"""
+ print(s, file=f)
+
+ s = f"""
+ s = {g.generate_shuffle_S4("d01")};
+ min = {g.generate_min("s", "d01")};
+ d01 = {g.generate_max_with_blend("min", "s", "d01", 4, ascending)};
+
+ s = {g.generate_shuffle_S2("d01")};
+ min = {g.generate_min("s", "d01")};
+ d01 = {g.generate_max_with_blend("min", "s", "d01", 2, ascending)};
+
+ s = {g.generate_shuffle_S1("d01")};
+ min = {g.generate_min("s", "d01")};
+ d01 = {g.generate_max_with_blend("min", "s", "d01", 1, ascending)};"""
+
+ print(s, file=f)
+ print(" }", file=f)
+
+
+ def generate_compounded_sorter(self, f, width, ascending, inline):
+ type = self.type
+ g = self
+
+ w1 = int(next_power_of_2(width) / 2)
+ w2 = int(width - w1)
+
+ suffix = "ascending" if ascending else "descending"
+ rev_suffix = "descending" if ascending else "ascending"
+
+ inl = "INLINE" if inline else "NOINLINE"
+
+ s = f""" static {inl} void sort_{width:02d}v_{suffix}({g.generate_param_def_list(width)}) {{
+ {g.vector_type()} tmp;
+
+ sort_{w1:02d}v_{suffix}({g.generate_param_list(1, w1)});
+ sort_{w2:02d}v_{rev_suffix}({g.generate_param_list(w1 + 1, w2)});"""
+
+ print(s, file=f)
+
+ for r in range(w1 + 1, width + 1):
+ x = w1 + 1 - (r - w1)
+ s = f"""
+ tmp = d{r:02d};
+ d{r:02d} = {g.generate_max(f"d{x:02d}", f"d{r:02d}")};
+ d{x:02d} = {g.generate_min(f"d{x:02d}", "tmp")};"""
+
+ print(s, file=f)
+
+ s = f"""
+ sort_{w1:02d}v_merge_{suffix}({g.generate_param_list(1, w1)});
+ sort_{w2:02d}v_merge_{suffix}({g.generate_param_list(w1 + 1, w2)});"""
+ print(s, file=f)
+ print(" }", file=f)
+
+
+ def generate_compounded_merger(self, f, width, ascending, inline):
+ type = self.type
+ g = self
+
+ w1 = int(next_power_of_2(width) / 2)
+ w2 = int(width - w1)
+
+ suffix = "ascending" if ascending else "descending"
+ rev_suffix = "descending" if ascending else "ascending"
+
+ inl = "INLINE" if inline else "NOINLINE"
+
+ s = f""" static {inl} void sort_{width:02d}v_merge_{suffix}({g.generate_param_def_list(width)}) {{
+ {g.vector_type()} tmp;"""
+ print(s, file=f)
+
+ for r in range(w1 + 1, width + 1):
+ x = r - w1
+ s = f"""
+ tmp = d{x:02d};
+ d{x:02d} = {g.generate_min(f"d{r:02d}", f"d{x:02d}")};
+ d{r:02d} = {g.generate_max(f"d{r:02d}", "tmp")};"""
+ print(s, file=f)
+
+ s = f"""
+ sort_{w1:02d}v_merge_{suffix}({g.generate_param_list(1, w1)});
+ sort_{w2:02d}v_merge_{suffix}({g.generate_param_list(w1 + 1, w2)});"""
+ print(s, file=f)
+ print(" }", file=f)
+
+
+ def generate_entry_points(self, f):
+ type = self.type
+ g = self
+ for m in range(1, g.max_bitonic_sort_vectors() + 1):
+ s = f"""
+ static NOINLINE void sort_{m:02d}v({type} *ptr) {{"""
+ print(s, file=f)
+
+ for l in range(0, m):
+ s = f" {g.vector_type()} d{l + 1:02d} = {g.get_load_intrinsic('ptr', l)};"
+ print(s, file=f)
+
+ s = f" sort_{m:02d}v_ascending({g.generate_param_list(1, m)});"
+ print(s, file=f)
+
+ for l in range(0, m):
+ s = f" {g.get_store_intrinsic('ptr', l, f'd{l + 1:02d}')};"
+ print(s, file=f)
+
+ print("}", file=f)
+
+
+ def generate_master_entry_point(self, f_header, f_src):
+ basename = os.path.basename(f_header.name)
+ s = f"""#include "{basename}"
+
+using namespace vxsort;
+"""
+ print(s, file=f_src)
+
+ t = self.type
+ g = self
+
+ s = f""" static void sort({t} *ptr, size_t length);"""
+ print(s, file=f_header)
+
+ s = f"""void vxsort::smallsort::bitonic<{t}, vector_machine::AVX512 >::sort({t} *ptr, size_t length) {{
+ const int N = {g.vector_size()};
+
+ switch(length / N) {{"""
+ print(s, file=f_src)
+
+ for m in range(1, self.max_bitonic_sort_vectors() + 1):
+ s = f" case {m}: sort_{m:02d}v(ptr); break;"
+ print(s, file=f_src)
+ print(" }", file=f_src)
+ print("}", file=f_src)
+ pass
diff --git a/src/coreclr/src/gc/vxsort/smallsort/codegen/bitonic_gen.py b/src/coreclr/src/gc/vxsort/smallsort/codegen/bitonic_gen.py
new file mode 100644
index 000000000000..4681e4986c3f
--- /dev/null
+++ b/src/coreclr/src/gc/vxsort/smallsort/codegen/bitonic_gen.py
@@ -0,0 +1,119 @@
+##
+## Licensed to the .NET Foundation under one or more agreements.
+## The .NET Foundation licenses this file to you under the MIT license.
+##
+
+#!/usr/bin/env python3
+#
+# This is a tool to generate the bitonic sorter code that is used for small arrays.
+#
+# usage: bitonic_gen.py [-h] [--vector-isa VECTOR_ISA [VECTOR_ISA ...]]
+# [--break-inline BREAK_INLINE] [--output-dir OUTPUT_DIR]
+#
+# the files in src/coreclr/src/gc/vxsort/smallsort checked in can be generated with:
+# python bitonic_gen.py --output-dir c:\temp --vector-isa AVX2 AVX512
+#
+import argparse
+import os
+from enum import Enum
+
+from avx2 import AVX2BitonicISA
+from avx512 import AVX512BitonicISA
+from bitonic_isa import BitonicISA
+
+BitonicISA.register(AVX2BitonicISA)
+BitonicISA.register(AVX512BitonicISA)
+
+
+def get_generator_supported_types(vector_isa):
+ if isinstance(vector_isa, str):
+ vector_isa = VectorISA[vector_isa]
+ if vector_isa == VectorISA.AVX2:
+ return AVX2BitonicISA.supported_types()
+ elif vector_isa == VectorISA.AVX512:
+ return AVX512BitonicISA.supported_types()
+ else:
+ raise Exception(f"Non-supported vector machine-type: {vector_isa}")
+
+
+def get_generator(vector_isa, type):
+ if isinstance(vector_isa, str):
+ vector_isa = VectorISA[vector_isa]
+ if vector_isa == VectorISA.AVX2:
+ return AVX2BitonicISA(type)
+ elif vector_isa == VectorISA.AVX512:
+ return AVX512BitonicISA(type)
+ else:
+ raise Exception(f"Non-supported vector machine-type: {vector_isa}")
+
+
+def generate_per_type(f_header, f_src, type, vector_isa, break_inline):
+ g = get_generator(vector_isa, type)
+ g.generate_prologue(f_header)
+ g.generate_1v_sorters(f_header, ascending=True)
+ g.generate_1v_sorters(f_header, ascending=False)
+ for width in range(2, g.max_bitonic_sort_vectors() + 1):
+
+ # Allow breaking the inline chain once in a while (configurable)
+ if break_inline == 0 or width & break_inline != 0:
+ inline = True
+ else:
+ inline = False
+ g.generate_compounded_sorter(f_header, width, ascending=True, inline=inline)
+ g.generate_compounded_sorter(f_header, width, ascending=False, inline=inline)
+ if width <= g.largest_merge_variant_needed():
+ g.generate_compounded_merger(f_header, width, ascending=True, inline=inline)
+ g.generate_compounded_merger(f_header, width, ascending=False, inline=inline)
+
+ g.generate_entry_points(f_header)
+ g.generate_master_entry_point(f_header, f_src)
+ g.generate_epilogue(f_header)
+
+
+class Language(Enum):
+ csharp = 'csharp'
+ cpp = 'cpp'
+ rust = 'rust'
+
+ def __str__(self):
+ return self.value
+
+
+class VectorISA(Enum):
+ AVX2 = 'AVX2'
+ AVX512 = 'AVX512'
+ SVE = 'SVE'
+
+ def __str__(self):
+ return self.value
+
+def generate_all_types():
+ parser = argparse.ArgumentParser()
+ #parser.add_argument("--language", type=Language, choices=list(Language),
+ # help="select output language: csharp/cpp/rust")
+ parser.add_argument("--vector-isa",
+ nargs='+',
+ default='all',
+ help='list of vector ISA to generate',
+ choices=list(VectorISA).append("all"))
+ parser.add_argument("--break-inline", type=int, default=0, help="break inlining every N levels")
+
+ parser.add_argument("--output-dir", type=str,
+ help="output directory")
+
+ opts = parser.parse_args()
+
+ if 'all' in opts.vector_isa:
+ opts.vector_isa = list(VectorISA)
+
+ for isa in opts.vector_isa:
+ for t in get_generator_supported_types(isa):
+ filename = f"bitonic_sort.{isa}.{t}.generated"
+ print(f"Generating {filename}.{{h,.cpp}}")
+ h_filename = os.path.join(opts.output_dir, filename + ".h")
+ h_src = os.path.join(opts.output_dir, filename + ".cpp")
+ with open(h_filename, "w") as f_header, open(h_src, "w") as f_source:
+ generate_per_type(f_header, f_source, t, isa, opts.break_inline)
+
+if __name__ == '__main__':
+ generate_all_types()
diff --git a/src/coreclr/src/gc/vxsort/smallsort/codegen/bitonic_isa.py b/src/coreclr/src/gc/vxsort/smallsort/codegen/bitonic_isa.py
new file mode 100644
index 000000000000..d48d7871dedf
--- /dev/null
+++ b/src/coreclr/src/gc/vxsort/smallsort/codegen/bitonic_isa.py
@@ -0,0 +1,72 @@
+##
+## Licensed to the .NET Foundation under one or more agreements.
+## The .NET Foundation licenses this file to you under the MIT license.
+##
+
+from abc import ABC, ABCMeta, abstractmethod
+
+from utils import next_power_of_2
+
+
+class BitonicISA(ABC, metaclass=ABCMeta):
+
+ @abstractmethod
+ def vector_size(self):
+ pass
+
+ @abstractmethod
+ def max_bitonic_sort_vectors(self):
+ pass
+
+ def largest_merge_variant_needed(self):
+ return next_power_of_2(self.max_bitonic_sort_vectors()) / 2;
+
+ @abstractmethod
+ def vector_size(self):
+ pass
+
+ @abstractmethod
+ def vector_type(self):
+ pass
+
+ @classmethod
+ @abstractmethod
+ def supported_types(cls):
+ pass
+
+ @abstractmethod
+ def generate_prologue(self, f):
+ pass
+
+ @abstractmethod
+ def generate_epilogue(self, f):
+ pass
+
+
+ @abstractmethod
+ def generate_1v_basic_sorters(self, f, ascending):
+ pass
+
+ @abstractmethod
+ def generate_1v_merge_sorters(self, f, ascending):
+ pass
+
+ def generate_1v_sorters(self, f, ascending):
+ self.generate_1v_basic_sorters(f, ascending)
+ self.generate_1v_merge_sorters(f, ascending)
+
+ @abstractmethod
+ def generate_compounded_sorter(self, f, width, ascending, inline):
+ pass
+
+ @abstractmethod
+ def generate_compounded_merger(self, f, width, ascending, inline):
+ pass
+
+ @abstractmethod
+ def generate_entry_points(self, f):
+ pass
+
+ @abstractmethod
+ def generate_master_entry_point(self, f):
+ pass
diff --git a/src/coreclr/src/gc/vxsort/smallsort/codegen/utils.py b/src/coreclr/src/gc/vxsort/smallsort/codegen/utils.py
new file mode 100644
index 000000000000..e96c4e8ffbb4
--- /dev/null
+++ b/src/coreclr/src/gc/vxsort/smallsort/codegen/utils.py
@@ -0,0 +1,24 @@
+##
+## Licensed to the .NET Foundation under one or more agreements.
+## The .NET Foundation licenses this file to you under the MIT license.
+##
+
+native_size_map = {
+ "int32_t": 4,
+ "uint32_t": 4,
+ "float": 4,
+ "int64_t": 8,
+ "uint64_t": 8,
+ "double": 8,
+}
+
+
+def next_power_of_2(v):
+ v = v - 1
+ v |= v >> 1
+ v |= v >> 2
+ v |= v >> 4
+ v |= v >> 8
+ v |= v >> 16
+ v = v + 1
+ return int(v)
diff --git a/src/coreclr/src/gc/vxsort/vxsort.h b/src/coreclr/src/gc/vxsort/vxsort.h
new file mode 100644
index 000000000000..35812d9356f3
--- /dev/null
+++ b/src/coreclr/src/gc/vxsort/vxsort.h
@@ -0,0 +1,602 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+#ifndef VXSORT_VXSORT_H
+#define VXSORT_VXSORT_H
+
+#ifdef __GNUC__
+#ifdef __clang__
+#pragma clang attribute push (__attribute__((target("popcnt"))), apply_to = any(function))
+#else
+#pragma GCC push_options
+#pragma GCC target("popcnt")
+#endif
+#endif
+
+
+#include
+#include
+
+
+#include "defs.h"
+//#include "isa_detection.h"
+#include "alignment.h"
+#include "machine_traits.h"
+#include "smallsort/bitonic_sort.h"
+
+//#include
+//#include
+//#include
+
+namespace vxsort {
+using vxsort::smallsort::bitonic;
+
+
+template
+class vxsort {
+ static_assert(Unroll >= 1, "Unroll can be in the range 1..12");
+ static_assert(Unroll <= 12, "Unroll can be in the range 1..12");
+
+private:
+ using MT = vxsort_machine_traits;
+ typedef typename MT::TV TV;
+ typedef alignment_hint AH;
+
+ static const int ELEMENT_ALIGN = sizeof(T) - 1;
+ static const int N = sizeof(TV) / sizeof(T);
+ static const int32_t MAX_BITONIC_SORT_VECTORS = 16;
+ static const int32_t SMALL_SORT_THRESHOLD_ELEMENTS = MAX_BITONIC_SORT_VECTORS * N;
+ static const int32_t MaxInnerUnroll = (MAX_BITONIC_SORT_VECTORS - 3) / 2;
+ static const int32_t SafeInnerUnroll = MaxInnerUnroll > Unroll ? Unroll : MaxInnerUnroll;
+ static const int32_t SLACK_PER_SIDE_IN_VECTORS = Unroll;
+ static const size_t ALIGN = AH::ALIGN;
+ static const size_t ALIGN_MASK = ALIGN - 1;
+
+ static const int SLACK_PER_SIDE_IN_ELEMENTS = SLACK_PER_SIDE_IN_VECTORS * N;
+ // The formula for figuring out how much temporary space we need for partitioning:
+ // 2 x the number of slack elements on each side for the purpose of partitioning in unrolled manner +
+ // 2 x amount of maximal bytes needed for alignment (32)
+ // one more vector's worth of elements since we write with N-way stores from both ends of the temporary area
+ // and we must make sure we do not accidentally over-write from left -> right or vice-versa right on that edge...
+ // In other words, while we allocated this much temp memory, the actual amount of elements inside said memory
+ // is smaller by 8 elements + 1 for each alignment (max alignment is actually N-1, I just round up to N...)
+ // This long sense just means that we over-allocate N+2 elements...
+ static const int PARTITION_TMP_SIZE_IN_ELEMENTS =
+ (2 * SLACK_PER_SIDE_IN_ELEMENTS + N + 4*N);
+
+ static int floor_log2_plus_one(size_t n) {
+ auto result = 0;
+ while (n >= 1) {
+ result++;
+ n /= 2;
+ }
+ return result;
+ }
+ static void swap(T* left, T* right) {
+ auto tmp = *left;
+ *left = *right;
+ *right = tmp;
+ }
+ static void swap_if_greater(T* left, T* right) {
+ if (*left <= *right)
+ return;
+ swap(left, right);
+ }
+
+ static void insertion_sort(T* lo, T* hi) {
+ for (auto i = lo + 1; i <= hi; i++) {
+ auto j = i;
+ auto t = *i;
+ while ((j > lo) && (t < *(j - 1))) {
+ *j = *(j - 1);
+ j--;
+ }
+ *j = t;
+ }
+ }
+
+ static void heap_sort(T* lo, T* hi) {
+ size_t n = hi - lo + 1;
+ for (size_t i = n / 2; i >= 1; i--) {
+ down_heap(i, n, lo);
+ }
+ for (size_t i = n; i > 1; i--) {
+ swap(lo, lo + i - 1);
+ down_heap(1, i - 1, lo);
+ }
+ }
+ static void down_heap(size_t i, size_t n, T* lo) {
+ auto d = *(lo + i - 1);
+ size_t child;
+ while (i <= n / 2) {
+ child = 2 * i;
+ if (child < n && *(lo + child - 1) < (*(lo + child))) {
+ child++;
+ }
+ if (!(d < *(lo + child - 1))) {
+ break;
+ }
+ *(lo + i - 1) = *(lo + child - 1);
+ i = child;
+ }
+ *(lo + i - 1) = d;
+ }
+
+ void reset(T* start, T* end) {
+ _depth = 0;
+ _startPtr = start;
+ _endPtr = end;
+ }
+
+ T* _startPtr = nullptr;
+ T* _endPtr = nullptr;
+
+ T _temp[PARTITION_TMP_SIZE_IN_ELEMENTS];
+ int _depth = 0;
+
+ NOINLINE
+ T* align_left_scalar_uncommon(T* read_left, T pivot,
+ T*& tmp_left, T*& tmp_right) {
+ if (((size_t)read_left & ALIGN_MASK) == 0)
+ return read_left;
+
+ auto next_align = (T*)(((size_t)read_left + ALIGN) & ~ALIGN_MASK);
+ while (read_left < next_align) {
+ auto v = *(read_left++);
+ if (v <= pivot) {
+ *(tmp_left++) = v;
+ } else {
+ *(--tmp_right) = v;
+ }
+ }
+
+ return read_left;
+ }
+
+ NOINLINE
+ T* align_right_scalar_uncommon(T* readRight, T pivot,
+ T*& tmpLeft, T*& tmpRight) {
+ if (((size_t) readRight & ALIGN_MASK) == 0)
+ return readRight;
+
+ auto nextAlign = (T *) ((size_t) readRight & ~ALIGN_MASK);
+ while (readRight > nextAlign) {
+ auto v = *(--readRight);
+ if (v <= pivot) {
+ *(tmpLeft++) = v;
+ } else {
+ *(--tmpRight) = v;
+ }
+ }
+
+ return readRight;
+ }
+
+ void sort(T* left, T* right, AH realignHint,
+ int depthLimit) {
+ auto length = (size_t)(right - left + 1);
+
+ T* mid;
+ switch (length) {
+ case 0:
+ case 1:
+ return;
+ case 2:
+ swap_if_greater(left, right);
+ return;
+ case 3:
+ mid = right - 1;
+ swap_if_greater(left, mid);
+ swap_if_greater(left, right);
+ swap_if_greater(mid, right);
+ return;
+ }
+
+ // Go to insertion sort below this threshold
+ if (length <= SMALL_SORT_THRESHOLD_ELEMENTS) {
+
+ auto nextLength = (length & (N-1)) > 0 ? (length + N) & ~(N-1) : length;
+
+ auto extraSpaceNeeded = nextLength - length;
+ auto fakeLeft = left - extraSpaceNeeded;
+ if (fakeLeft >= _startPtr) {
+ bitonic::sort(fakeLeft, nextLength);
+ } else {
+ insertion_sort(left, right);
+ }
+ return;
+ }
+
+ // Detect a whole bunch of bad cases where partitioning
+ // will not do well:
+ // 1. Reverse sorted array
+ // 2. High degree of repeated values (dutch flag problem, one value)
+ if (depthLimit == 0) {
+ heap_sort(left, right);
+ _depth--;
+ return;
+ }
+ depthLimit--;
+
+ // This is going to be a bit weird:
+ // Pre/Post alignment calculations happen here: we prepare hints to the
+ // partition function of how much to align and in which direction
+ // (pre/post). The motivation to do these calculations here and the actual
+ // alignment inside the partitioning code is that here, we can cache those
+ // calculations. As we recurse to the left we can reuse the left cached
+ // calculation, And when we recurse to the right we reuse the right
+ // calculation, so we can avoid re-calculating the same aligned addresses
+ // throughout the recursion, at the cost of a minor code complexity
+ // Since we branch on the magi values REALIGN_LEFT & REALIGN_RIGHT its safe
+ // to assume the we are not torturing the branch predictor.'
+
+ // We use a long as a "struct" to pass on alignment hints to the
+ // partitioning By packing 2 32 bit elements into it, as the JIT seem to not
+ // do this. In reality we need more like 2x 4bits for each side, but I
+ // don't think there is a real difference'
+
+ if (realignHint.left_align == AH::REALIGN) {
+ // Alignment flow:
+ // * Calculate pre-alignment on the left
+ // * See it would cause us an out-of bounds read
+ // * Since we'd like to avoid that, we adjust for post-alignment
+ // * No branches since we do branch->arithmetic
+ auto preAlignedLeft = reinterpret_cast(reinterpret_cast(left) & ~ALIGN_MASK);
+ auto cannotPreAlignLeft = (preAlignedLeft - _startPtr) >> 63;
+ realignHint.left_align = (preAlignedLeft - left) + (N & cannotPreAlignLeft);
+ assert(realignHint.left_align >= -N && realignHint.left_align <= N);
+ assert(AH::is_aligned(left + realignHint.left_align));
+ }
+
+ if (realignHint.right_align == AH::REALIGN) {
+ // Same as above, but in addition:
+ // right is pointing just PAST the last element we intend to partition
+ // (it's pointing to where we will store the pivot!) So we calculate alignment based on
+ // right - 1
+ auto preAlignedRight = reinterpret_cast(((reinterpret_cast(right) - 1) & ~ALIGN_MASK) + ALIGN);
+ auto cannotPreAlignRight = (_endPtr - preAlignedRight) >> 63;
+ realignHint.right_align = (preAlignedRight - right - (N & cannotPreAlignRight));
+ assert(realignHint.right_align >= -N && realignHint.right_align <= N);
+ assert(AH::is_aligned(right + realignHint.right_align));
+ }
+
+ // Compute median-of-three, of:
+ // the first, mid and one before last elements
+ mid = left + ((right - left) / 2);
+ swap_if_greater(left, mid);
+ swap_if_greater(left, right - 1);
+ swap_if_greater(mid, right - 1);
+
+ // Pivot is mid, place it in the right hand side
+ swap(mid, right);
+
+ auto sep = (length < PARTITION_TMP_SIZE_IN_ELEMENTS) ?
+ vectorized_partition(left, right, realignHint) :
+ vectorized_partition(left, right, realignHint);
+
+
+
+ _depth++;
+ sort(left, sep - 2, realignHint.realign_right(), depthLimit);
+ sort(sep, right, realignHint.realign_left(), depthLimit);
+ _depth--;
+ }
+
+
+ static INLINE void partition_block(TV& dataVec,
+ const TV& P,
+ T*& left,
+ T*& right) {
+ if (MT::supports_compress_writes()) {
+ partition_block_with_compress(dataVec, P, left, right);
+ } else {
+ partition_block_without_compress(dataVec, P, left, right);
+ }
+ }
+
+ static INLINE void partition_block_without_compress(TV& dataVec,
+ const TV& P,
+ T*& left,
+ T*& right) {
+ auto mask = MT::get_cmpgt_mask(dataVec, P);
+ dataVec = MT::partition_vector(dataVec, mask);
+ MT::store_vec(reinterpret_cast(left), dataVec);
+ MT::store_vec(reinterpret_cast(right), dataVec);
+ auto popCount = -_mm_popcnt_u64(mask);
+ right += popCount;
+ left += popCount + N;
+ }
+
+ static INLINE void partition_block_with_compress(TV& dataVec,
+ const TV& P,
+ T*& left,
+ T*& right) {
+ auto mask = MT::get_cmpgt_mask(dataVec, P);
+ auto popCount = -_mm_popcnt_u64(mask);
+ MT::store_compress_vec(reinterpret_cast(left), dataVec, ~mask);
+ MT::store_compress_vec(reinterpret_cast(right + N + popCount), dataVec, mask);
+ right += popCount;
+ left += popCount + N;
+ }
+
+ template
+ T* vectorized_partition(T* const left, T* const right, const AH hint) {
+ assert(right - left >= SMALL_SORT_THRESHOLD_ELEMENTS);
+ assert((reinterpret_cast(left) & ELEMENT_ALIGN) == 0);
+ assert((reinterpret_cast(right) & ELEMENT_ALIGN) == 0);
+
+ // Vectorized double-pumped (dual-sided) partitioning:
+ // We start with picking a pivot using the media-of-3 "method"
+ // Once we have sensible pivot stored as the last element of the array
+ // We process the array from both ends.
+ //
+ // To get this rolling, we first read 2 Vector256 elements from the left and
+ // another 2 from the right, and store them in some temporary space in order
+ // to leave enough "space" inside the vector for storing partitioned values.
+ // Why 2 from each side? Because we need n+1 from each side where n is the
+ // number of Vector256 elements we process in each iteration... The
+ // reasoning behind the +1 is because of the way we decide from *which* side
+ // to read, we may end up reading up to one more vector from any given side
+ // and writing it in its entirety to the opposite side (this becomes
+ // slightly clearer when reading the code below...) Conceptually, the bulk
+ // of the processing looks like this after clearing out some initial space
+ // as described above:
+
+ // [.............................................................................]
+ // ^wl ^rl rr^ wr^
+ // Where:
+ // wl = writeLeft
+ // rl = readLeft
+ // rr = readRight
+ // wr = writeRight
+
+ // In every iteration, we select what side to read from based on how much
+ // space is left between head read/write pointer on each side...
+ // We read from where there is a smaller gap, e.g. that side
+ // that is closer to the unfortunate possibility of its write head
+ // overwriting its read head... By reading from THAT side, we're ensuring
+ // this does not happen
+
+ // An additional unfortunate complexity we need to deal with is that the
+ // right pointer must be decremented by another Vector256.Count elements
+ // Since the Load/Store primitives obviously accept start addresses
+ auto pivot = *right;
+ // We do this here just in case we need to pre-align to the right
+ // We end up
+ *right = std::numeric_limits::Max();
+
+ // Broadcast the selected pivot
+ const TV P = MT::broadcast(pivot);
+
+ auto readLeft = left;
+ auto readRight = right;
+
+ auto tmpStartLeft = _temp;
+ auto tmpLeft = tmpStartLeft;
+ auto tmpStartRight = _temp + PARTITION_TMP_SIZE_IN_ELEMENTS;
+ auto tmpRight = tmpStartRight;
+
+ tmpRight -= N;
+
+ // the read heads always advance by 8 elements, or 32 bytes,
+ // We can spend some extra time here to align the pointers
+ // so they start at a cache-line boundary
+ // Once that happens, we can read with Avx.LoadAlignedVector256
+ // And also know for sure that our reads will never cross cache-lines
+ // Otherwise, 50% of our AVX2 Loads will need to read from two cache-lines
+ align_vectorized(left, right, hint, P, readLeft, readRight,
+ tmpStartLeft, tmpLeft, tmpStartRight, tmpRight);
+
+ const auto leftAlign = hint.left_align;
+ const auto rightAlign = hint.right_align;
+ if (leftAlign > 0) {
+ tmpRight += N;
+ readLeft = align_left_scalar_uncommon(readLeft, pivot, tmpLeft, tmpRight);
+ tmpRight -= N;
+ }
+
+ if (rightAlign < 0) {
+ tmpRight += N;
+ readRight =
+ align_right_scalar_uncommon(readRight, pivot, tmpLeft, tmpRight);
+ tmpRight -= N;
+ }
+
+ assert(((size_t)readLeft & ALIGN_MASK) == 0);
+ assert(((size_t)readRight & ALIGN_MASK) == 0);
+
+ assert((((size_t)readRight - (size_t)readLeft) % ALIGN) == 0);
+ assert((readRight - readLeft) >= InnerUnroll * 2);
+
+ // From now on, we are fully aligned
+ // and all reading is done in full vector units
+ auto readLeftV = (TV*) readLeft;
+ auto readRightV = (TV*) readRight;
+ #ifndef NDEBUG
+ readLeft = nullptr;
+ readRight = nullptr;
+ #endif
+
+ for (auto u = 0; u < InnerUnroll; u++) {
+ auto dl = MT::load_vec(readLeftV + u);
+ auto dr = MT::load_vec(readRightV - (u + 1));
+ partition_block(dl, P, tmpLeft, tmpRight);
+ partition_block(dr, P, tmpLeft, tmpRight);
+ }
+
+ tmpRight += N;
+ // Adjust for the reading that was made above
+ readLeftV += InnerUnroll;
+ readRightV -= InnerUnroll*2;
+ TV* nextPtr;
+
+ auto writeLeft = left;
+ auto writeRight = right - N;
+
+ while (readLeftV < readRightV) {
+ if (writeRight - ((T *) readRightV) < (2 * (InnerUnroll * N) - N)) {
+ nextPtr = readRightV;
+ readRightV -= InnerUnroll;
+ } else {
+ mess_up_cmov();
+ nextPtr = readLeftV;
+ readLeftV += InnerUnroll;
+ }
+
+ TV d01, d02, d03, d04, d05, d06, d07, d08, d09, d10, d11, d12;
+
+ switch (InnerUnroll) {
+ case 12: d12 = MT::load_vec(nextPtr + InnerUnroll - 12);
+ case 11: d11 = MT::load_vec(nextPtr + InnerUnroll - 11);
+ case 10: d10 = MT::load_vec(nextPtr + InnerUnroll - 10);
+ case 9: d09 = MT::load_vec(nextPtr + InnerUnroll - 9);
+ case 8: d08 = MT::load_vec(nextPtr + InnerUnroll - 8);
+ case 7: d07 = MT::load_vec(nextPtr + InnerUnroll - 7);
+ case 6: d06 = MT::load_vec(nextPtr + InnerUnroll - 6);
+ case 5: d05 = MT::load_vec(nextPtr + InnerUnroll - 5);
+ case 4: d04 = MT::load_vec(nextPtr + InnerUnroll - 4);
+ case 3: d03 = MT::load_vec(nextPtr + InnerUnroll - 3);
+ case 2: d02 = MT::load_vec(nextPtr + InnerUnroll - 2);
+ case 1: d01 = MT::load_vec(nextPtr + InnerUnroll - 1);
+ }
+
+ switch (InnerUnroll) {
+ case 12: partition_block(d12, P, writeLeft, writeRight);
+ case 11: partition_block(d11, P, writeLeft, writeRight);
+ case 10: partition_block(d10, P, writeLeft, writeRight);
+ case 9: partition_block(d09, P, writeLeft, writeRight);
+ case 8: partition_block(d08, P, writeLeft, writeRight);
+ case 7: partition_block(d07, P, writeLeft, writeRight);
+ case 6: partition_block(d06, P, writeLeft, writeRight);
+ case 5: partition_block(d05, P, writeLeft, writeRight);
+ case 4: partition_block(d04, P, writeLeft, writeRight);
+ case 3: partition_block(d03, P, writeLeft, writeRight);
+ case 2: partition_block(d02, P, writeLeft, writeRight);
+ case 1: partition_block(d01, P, writeLeft, writeRight);
+ }
+ }
+
+ readRightV += (InnerUnroll - 1);
+
+ while (readLeftV <= readRightV) {
+ if (writeRight - (T *) readRightV < N) {
+ nextPtr = readRightV;
+ readRightV -= 1;
+ } else {
+ mess_up_cmov();
+ nextPtr = readLeftV;
+ readLeftV += 1;
+ }
+
+ auto d = MT::load_vec(nextPtr);
+ partition_block(d, P, writeLeft, writeRight);
+ //partition_block_without_compress(d, P, writeLeft, writeRight);
+ }
+
+ // 3. Copy-back the 4 registers + remainder we partitioned in the beginning
+ auto leftTmpSize = tmpLeft - tmpStartLeft;
+ memcpy(writeLeft, tmpStartLeft, leftTmpSize * sizeof(T));
+ writeLeft += leftTmpSize;
+ auto rightTmpSize = tmpStartRight - tmpRight;
+ memcpy(writeLeft, tmpRight, rightTmpSize * sizeof(T));
+
+ // Shove to pivot back to the boundary
+ *right = *writeLeft;
+ *writeLeft++ = pivot;
+
+ assert(writeLeft > left);
+ assert(writeLeft <= right);
+
+ return writeLeft;
+ }
+ void align_vectorized(const T* left,
+ const T* right,
+ const AH& hint,
+ const TV P,
+ T*& readLeft,
+ T*& readRight,
+ T*& tmpStartLeft,
+ T*& tmpLeft,
+ T*& tmpStartRight,
+ T*& tmpRight) const {
+ const auto leftAlign = hint.left_align;
+ const auto rightAlign = hint.right_align;
+ const auto rai = ~((rightAlign - 1) >> 31);
+ const auto lai = leftAlign >> 31;
+ const auto preAlignedLeft = (TV*) (left + leftAlign);
+ const auto preAlignedRight = (TV*) (right + rightAlign - N);
+
+ // Alignment with vectorization is tricky, so read carefully before changing code:
+ // 1. We load data, which we might need to align, if the alignment hints
+ // mean pre-alignment (or overlapping alignment)
+ // 2. We partition and store in the following order:
+ // a) right-portion of right vector to the right-side
+ // b) left-portion of left vector to the right side
+ // c) at this point one-half of each partitioned vector has been committed
+ // back to memory.
+ // d) we advance the right write (tmpRight) pointer by how many elements
+ // were actually needed to be written to the right hand side
+ // e) We write the right portion of the left vector to the right side
+ // now that its write position has been updated
+ auto RT0 = MT::load_vec(preAlignedRight);
+ auto LT0 = MT::load_vec(preAlignedLeft);
+ auto rtMask = MT::get_cmpgt_mask(RT0, P);
+ auto ltMask = MT::get_cmpgt_mask(LT0, P);
+ const auto rtPopCountRightPart = max(_mm_popcnt_u32(rtMask), rightAlign);
+ const auto ltPopCountRightPart = _mm_popcnt_u32(ltMask);
+ const auto rtPopCountLeftPart = N - rtPopCountRightPart;
+ const auto ltPopCountLeftPart = N - ltPopCountRightPart;
+
+ if (MT::supports_compress_writes()) {
+ MT::store_compress_vec((TV *) (tmpRight + N - rtPopCountRightPart), RT0, rtMask);
+ MT::store_compress_vec((TV *) tmpLeft, LT0, ~ltMask);
+
+ tmpRight -= rtPopCountRightPart & rai;
+ readRight += (rightAlign - N) & rai;
+
+ MT::store_compress_vec((TV *) (tmpRight + N - ltPopCountRightPart), LT0, ltMask);
+ tmpRight -= ltPopCountRightPart & lai;
+ tmpLeft += ltPopCountLeftPart & lai;
+ tmpStartLeft += -leftAlign & lai;
+ readLeft += (leftAlign + N) & lai;
+
+ MT::store_compress_vec((TV*) tmpLeft, RT0, ~rtMask);
+ tmpLeft += rtPopCountLeftPart & rai;
+ tmpStartRight -= rightAlign & rai;
+ }
+ else {
+ RT0 = MT::partition_vector(RT0, rtMask);
+ LT0 = MT::partition_vector(LT0, ltMask);
+ MT::store_vec((TV*) tmpRight, RT0);
+ MT::store_vec((TV*) tmpLeft, LT0);
+
+
+ tmpRight -= rtPopCountRightPart & rai;
+ readRight += (rightAlign - N) & rai;
+
+ MT::store_vec((TV*) tmpRight, LT0);
+ tmpRight -= ltPopCountRightPart & lai;
+
+ tmpLeft += ltPopCountLeftPart & lai;
+ tmpStartLeft += -leftAlign & lai;
+ readLeft += (leftAlign + N) & lai;
+
+ MT::store_vec((TV*) tmpLeft, RT0);
+ tmpLeft += rtPopCountLeftPart & rai;
+ tmpStartRight -= rightAlign & rai;
+ }
+ }
+
+ public:
+ NOINLINE void sort(T* left, T* right) {
+ reset(left, right);
+ auto depthLimit = 2 * floor_log2_plus_one(right + 1 - left);
+ sort(left, right, AH(), depthLimit);
+ }
+};
+
+} // namespace gcsort
+
+#include "vxsort_targets_disable.h"
+
+#endif
diff --git a/src/coreclr/src/gc/vxsort/vxsort_targets_disable.h b/src/coreclr/src/gc/vxsort/vxsort_targets_disable.h
new file mode 100644
index 000000000000..1c6efb1b2462
--- /dev/null
+++ b/src/coreclr/src/gc/vxsort/vxsort_targets_disable.h
@@ -0,0 +1,11 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+
+#ifdef __GNUC__
+#ifdef __clang__
+#pragma clang attribute pop
+#else
+#pragma GCC pop_options
+#endif
+#endif
diff --git a/src/coreclr/src/gc/vxsort/vxsort_targets_enable_avx2.h b/src/coreclr/src/gc/vxsort/vxsort_targets_enable_avx2.h
new file mode 100644
index 000000000000..343d7ae18506
--- /dev/null
+++ b/src/coreclr/src/gc/vxsort/vxsort_targets_enable_avx2.h
@@ -0,0 +1,11 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+#ifdef __GNUC__
+#ifdef __clang__
+#pragma clang attribute push (__attribute__((target("avx2"))), apply_to = any(function))
+#else
+#pragma GCC push_options
+#pragma GCC target("avx512f")
+#endif
+#endif
diff --git a/src/coreclr/src/gc/vxsort/vxsort_targets_enable_avx512.h b/src/coreclr/src/gc/vxsort/vxsort_targets_enable_avx512.h
new file mode 100644
index 000000000000..c5bfe4998a8f
--- /dev/null
+++ b/src/coreclr/src/gc/vxsort/vxsort_targets_enable_avx512.h
@@ -0,0 +1,11 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+#ifdef __GNUC__
+#ifdef __clang__
+#pragma clang attribute push (__attribute__((target("avx512f"))), apply_to = any(function))
+#else
+#pragma GCC push_options
+#pragma GCC target("avx512f")
+#endif
+#endif
diff --git a/src/coreclr/src/ilasm/CMakeLists.txt b/src/coreclr/src/ilasm/CMakeLists.txt
index ae5419514df5..13e7467e0b1e 100644
--- a/src/coreclr/src/ilasm/CMakeLists.txt
+++ b/src/coreclr/src/ilasm/CMakeLists.txt
@@ -4,6 +4,7 @@ add_definitions(-DUNICODE)
add_definitions(-D_UNICODE)
add_definitions(-D_FEATURE_NO_HOST)
add_definitions(-D__ILASM__)
+add_definitions(-DFEATURE_METADATA_EMIT_PORTABLE_PDB)
add_definitions(-DFEATURE_CORECLR)
@@ -18,6 +19,7 @@ set(ILASM_SOURCES
main.cpp
assembler.cpp
prebuilt/asmparse.cpp
+ portable_pdb.cpp
)
set(ILASM_HEADERS
@@ -32,6 +34,7 @@ set(ILASM_HEADERS
method.hpp
nvpair.h
typar.hpp
+ portable_pdb.h
)
if(CLR_CMAKE_TARGET_WIN32)
@@ -72,11 +75,11 @@ set(ILASM_LINK_LIBRARIES
utilcodestaticnohost
mscorpe
${START_LIBRARY_GROUP} # Start group of libraries that have circular references
- mdhotdata_full
- mdcompiler_wks
- mdruntime_wks
- mdruntimerw_wks
- mdstaticapi
+ mdhotdata_ppdb
+ mdcompiler_ppdb
+ mdruntime_ppdb
+ mdruntimerw_ppdb
+ mdstaticapi_ppdb
${END_LIBRARY_GROUP} # End group of libraries that have circular references
ceefgen
corguids
diff --git a/src/coreclr/src/ilasm/assem.cpp b/src/coreclr/src/ilasm/assem.cpp
index cdfd302be2ef..7ded7ca981d9 100644
--- a/src/coreclr/src/ilasm/assem.cpp
+++ b/src/coreclr/src/ilasm/assem.cpp
@@ -157,6 +157,9 @@ Assembler::Assembler()
dummyClass = new Class(NULL);
indexKeywords(&indxKeywords);
+
+ m_pdbFormat = CLASSIC;
+ m_pPortablePdbWriter = NULL;
}
@@ -218,7 +221,11 @@ Assembler::~Assembler()
m_pEmitter->Release();
m_pEmitter = NULL;
}
-
+ if (m_pPortablePdbWriter != NULL)
+ {
+ delete m_pPortablePdbWriter;
+ m_pPortablePdbWriter = NULL;
+ }
if (m_pDisp != NULL)
{
m_pDisp->Release();
@@ -227,7 +234,7 @@ Assembler::~Assembler()
}
-BOOL Assembler::Init()
+BOOL Assembler::Init(BOOL generatePdb, PdbFormat pdbFormat)
{
if (m_pCeeFileGen != NULL) {
if (m_pCeeFile)
@@ -246,6 +253,9 @@ BOOL Assembler::Init()
if (FAILED(m_pCeeFileGen->GetSectionCreate (m_pCeeFile, ".sdata", sdReadWrite, &m_pGlobalDataSection))) return FALSE;
if (FAILED(m_pCeeFileGen->GetSectionCreate (m_pCeeFile, ".tls", sdReadWrite, &m_pTLSSection))) return FALSE;
+ m_fGeneratePDB = generatePdb;
+ m_pdbFormat = pdbFormat;
+
return TRUE;
}
@@ -468,6 +478,8 @@ BOOL Assembler::AddMethod(Method *pMethod)
BOOL Assembler::EmitMethodBody(Method* pMethod, BinStr* pbsOut)
{
+ HRESULT hr = S_OK;
+
if(pMethod)
{
BinStr* pbsBody = pMethod->m_pbsBody;
@@ -483,7 +495,6 @@ BOOL Assembler::EmitMethodBody(Method* pMethod, BinStr* pbsOut)
VarDescr* pVD;
BinStr* pbsSig = new BinStr();
unsigned cnt;
- HRESULT hr;
DWORD cSig;
const COR_SIGNATURE* mySig;
@@ -514,57 +525,67 @@ BOOL Assembler::EmitMethodBody(Method* pMethod, BinStr* pbsOut)
pFH->SetLocalVarSigTok(pMethod->m_LocalsSig);
}
//--------------------------------------------------------------------------------
- if(m_fGeneratePDB && (m_pSymWriter != NULL))
+ if(m_fGeneratePDB)
{
- m_pSymWriter->OpenMethod(pMethod->m_Tok);
- ULONG N = pMethod->m_LinePCList.COUNT();
- if(pMethod->m_fEntryPoint) m_pSymWriter->SetUserEntryPoint(pMethod->m_Tok);
- if(N)
+ if (m_pSymWriter != NULL)
{
- LinePC *pLPC;
- ULONG32 *offsets=new ULONG32[N], *lines = new ULONG32[N], *columns = new ULONG32[N];
- ULONG32 *endlines=new ULONG32[N], *endcolumns=new ULONG32[N];
- if(offsets && lines && columns && endlines && endcolumns)
+ m_pSymWriter->OpenMethod(pMethod->m_Tok);
+ ULONG N = pMethod->m_LinePCList.COUNT();
+ if(pMethod->m_fEntryPoint) m_pSymWriter->SetUserEntryPoint(pMethod->m_Tok);
+ if(N)
{
- DocWriter* pDW;
- unsigned j=0;
- while((pDW = m_DocWriterList.PEEK(j++)))
+ LinePC *pLPC;
+ ULONG32 *offsets=new ULONG32[N], *lines = new ULONG32[N], *columns = new ULONG32[N];
+ ULONG32 *endlines=new ULONG32[N], *endcolumns=new ULONG32[N];
+ if(offsets && lines && columns && endlines && endcolumns)
{
- if((m_pSymDocument = pDW->pWriter))
+ DocWriter* pDW;
+ unsigned j=0;
+ while((pDW = m_DocWriterList.PEEK(j++)))
{
- int i, n;
- for(i=0, n=0; (pLPC = pMethod->m_LinePCList.PEEK(i)); i++)
+ if((m_pSymDocument = pDW->pWriter))
{
- if(pLPC->pWriter == m_pSymDocument)
+ int i, n;
+ for(i=0, n=0; (pLPC = pMethod->m_LinePCList.PEEK(i)); i++)
{
- offsets[n] = pLPC->PC;
- lines[n] = pLPC->Line;
- columns[n] = pLPC->Column;
- endlines[n] = pLPC->LineEnd;
- endcolumns[n] = pLPC->ColumnEnd;
- n++;
+ if(pLPC->pWriter == m_pSymDocument)
+ {
+ offsets[n] = pLPC->PC;
+ lines[n] = pLPC->Line;
+ columns[n] = pLPC->Column;
+ endlines[n] = pLPC->LineEnd;
+ endcolumns[n] = pLPC->ColumnEnd;
+ n++;
+ }
}
- }
- if(n) m_pSymWriter->DefineSequencePoints(m_pSymDocument,n,
- offsets,lines,columns,endlines,endcolumns);
- } // end if(pSymDocument)
- } // end while(pDW = next doc.writer)
- pMethod->m_LinePCList.RESET(true);
- }
- else report->error("\nOutOfMemory!\n");
- delete [] offsets;
- delete [] lines;
- delete [] columns;
- delete [] endlines;
- delete [] endcolumns;
- }//enf if(N)
- HRESULT hrr;
- if(pMethod->m_ulLines[1])
- hrr = m_pSymWriter->SetMethodSourceRange(m_pSymDocument,pMethod->m_ulLines[0], pMethod->m_ulColumns[0],
- m_pSymDocument,pMethod->m_ulLines[1], pMethod->m_ulColumns[1]);
- EmitScope(&(pMethod->m_MainScope)); // recursively emits all nested scopes
-
- m_pSymWriter->CloseMethod();
+ if(n) m_pSymWriter->DefineSequencePoints(m_pSymDocument,n,
+ offsets,lines,columns,endlines,endcolumns);
+ } // end if(pSymDocument)
+ } // end while(pDW = next doc.writer)
+ pMethod->m_LinePCList.RESET(true);
+ }
+ else report->error("\nOutOfMemory!\n");
+ delete [] offsets;
+ delete [] lines;
+ delete [] columns;
+ delete [] endlines;
+ delete [] endcolumns;
+ }//enf if(N)
+ HRESULT hrr;
+ if(pMethod->m_ulLines[1])
+ hrr = m_pSymWriter->SetMethodSourceRange(m_pSymDocument,pMethod->m_ulLines[0], pMethod->m_ulColumns[0],
+ m_pSymDocument,pMethod->m_ulLines[1], pMethod->m_ulColumns[1]);
+ EmitScope(&(pMethod->m_MainScope)); // recursively emits all nested scopes
+
+ m_pSymWriter->CloseMethod();
+ }
+ else if (IsPortablePdb())
+ {
+ if (FAILED(m_pPortablePdbWriter->DefineSequencePoints(pMethod)))
+ return FALSE;
+ if (FAILED(m_pPortablePdbWriter->DefineLocalScope(pMethod)))
+ return FALSE;
+ }
} // end if(fIncludeDebugInfo)
//-----------------------------------------------------
diff --git a/src/coreclr/src/ilasm/assembler.cpp b/src/coreclr/src/ilasm/assembler.cpp
index b1c9dd50d81b..9a418e0fd44b 100644
--- a/src/coreclr/src/ilasm/assembler.cpp
+++ b/src/coreclr/src/ilasm/assembler.cpp
@@ -1418,6 +1418,20 @@ void Assembler::EmitOpcode(Instr* instr)
pLPC->ColumnEnd = instr->column_end;
pLPC->PC = m_CurPC;
pLPC->pWriter = instr->pWriter;
+
+ pLPC->pOwnerDocument = instr->pOwnerDocument;
+ if (0xfeefee == instr->linenum &&
+ 0xfeefee == instr->linenum_end &&
+ 0 == instr->column &&
+ 0 == instr->column_end)
+ {
+ pLPC->IsHidden = TRUE;
+ }
+ else
+ {
+ pLPC->IsHidden = FALSE;
+ }
+
m_pCurMethod->m_LinePCList.PUSH(pLPC);
}
else report->error("\nOut of memory!\n");
@@ -2375,40 +2389,51 @@ void Assembler::SetSourceFileName(__in __nullterminated char* szName)
}
if(m_fGeneratePDB)
{
- DocWriter* pDW;
- unsigned i=0;
- while((pDW = m_DocWriterList.PEEK(i++)) != NULL)
- {
- if(!strcmp(szName,pDW->Name)) break;
- }
- if(pDW)
+ if (IsPortablePdb())
{
- m_pSymDocument = pDW->pWriter;
- delete [] szName;
+ if (FAILED(m_pPortablePdbWriter->DefineDocument(szName, &m_guidLang)))
+ {
+ report->error("Failed to define a document: '%s'", szName);
+ }
+ delete[] szName;
}
- else if(m_pSymWriter)
+ else
{
- HRESULT hr;
- WszMultiByteToWideChar(g_uCodePage,0,szName,-1,wzUniBuf,dwUniBuf);
- if(FAILED(hr=m_pSymWriter->DefineDocument(wzUniBuf,&m_guidLang,
- &m_guidLangVendor,&m_guidDoc,&m_pSymDocument)))
+ DocWriter* pDW;
+ unsigned i = 0;
+ while ((pDW = m_DocWriterList.PEEK(i++)) != NULL)
{
- m_pSymDocument = NULL;
- report->error("Failed to define a document writer");
+ if (!strcmp(szName, pDW->Name)) break;
}
- if((pDW = new DocWriter()) != NULL)
+ if (pDW)
{
- pDW->Name = szName;
- pDW->pWriter = m_pSymDocument;
- m_DocWriterList.PUSH(pDW);
+ m_pSymDocument = pDW->pWriter;
+ delete[] szName;
}
- else
+ else if (m_pSymWriter)
{
- report->error("Out of memory");
- delete [] szName;
+ HRESULT hr;
+ WszMultiByteToWideChar(g_uCodePage, 0, szName, -1, wzUniBuf, dwUniBuf);
+ if (FAILED(hr = m_pSymWriter->DefineDocument(wzUniBuf, &m_guidLang,
+ &m_guidLangVendor, &m_guidDoc, &m_pSymDocument)))
+ {
+ m_pSymDocument = NULL;
+ report->error("Failed to define a document writer");
+ }
+ if ((pDW = new DocWriter()) != NULL)
+ {
+ pDW->Name = szName;
+ pDW->pWriter = m_pSymDocument;
+ m_DocWriterList.PUSH(pDW);
+ }
+ else
+ {
+ report->error("Out of memory");
+ delete[] szName;
+ }
}
+ else delete[] szName;
}
- else delete [] szName;
}
else delete [] szName;
}
@@ -2428,6 +2453,39 @@ void Assembler::SetSourceFileName(BinStr* pbsName)
}
}
+// Portable PDB paraphernalia
+void Assembler::SetPdbFileName(__in __nullterminated char* szName)
+{
+ if (szName)
+ {
+ if (*szName)
+ {
+ strcpy_s(m_szPdbFileName, MAX_FILENAME_LENGTH * 3 + 1, szName);
+ WszMultiByteToWideChar(g_uCodePage, 0, szName, -1, m_wzPdbFileName, MAX_FILENAME_LENGTH);
+ }
+ }
+}
+HRESULT Assembler::SavePdbFile()
+{
+ HRESULT hr = S_OK;
+ mdMethodDef entryPoint;
+
+ if (m_pdbFormat == PORTABLE)
+ {
+ if (FAILED(hr = (m_pPortablePdbWriter == NULL ? E_FAIL : S_OK))) goto exit;
+ if (FAILED(hr = (m_pPortablePdbWriter->GetEmitter() == NULL ? E_FAIL : S_OK))) goto exit;
+ if (FAILED(hr = m_pCeeFileGen->GetEntryPoint(m_pCeeFile, &entryPoint))) goto exit;
+ if (FAILED(hr = m_pPortablePdbWriter->BuildPdbStream(m_pEmitter, entryPoint))) goto exit;
+ if (FAILED(hr = m_pPortablePdbWriter->GetEmitter()->Save(m_wzPdbFileName, NULL))) goto exit;
+ }
+exit:
+ return hr;
+}
+BOOL Assembler::IsPortablePdb()
+{
+ return (m_pdbFormat == PORTABLE) && (m_pPortablePdbWriter != NULL);
+}
+
void Assembler::RecordTypeConstraints(GenericParamConstraintList* pGPCList, int numTyPars, TyParDescr* tyPars)
{
if (numTyPars > 0)
diff --git a/src/coreclr/src/ilasm/assembler.h b/src/coreclr/src/ilasm/assembler.h
index 39bacaf44213..60aa014940d5 100644
--- a/src/coreclr/src/ilasm/assembler.h
+++ b/src/coreclr/src/ilasm/assembler.h
@@ -16,6 +16,9 @@
#include "asmenum.h"
#include "asmtemplates.h"
+#include "portable_pdb.h"
+#include "portablepdbmdi.h"
+
// Disable the "initialization of static local vars is no thread safe" error
#ifdef _MSC_VER
#pragma warning(disable : 4640)
@@ -640,6 +643,7 @@ struct Instr
unsigned column_end;
unsigned pc;
ISymUnmanagedDocumentWriter* pWriter;
+ Document* pOwnerDocument;
};
#define INSTR_POOL_SIZE 16
@@ -732,6 +736,12 @@ struct Indx
}
};
+typedef enum {
+ CLASSIC, // default - classic PDB format, currently not supported for CoreCLR
+ PORTABLE,
+ // EMBEDDED // for future use
+} PdbFormat;
+
class Assembler {
public:
Assembler();
@@ -769,8 +779,8 @@ class Assembler {
mdToken m_tkSysEnum;
BOOL m_fDidCoInitialise;
- IMetaDataDispenserEx *m_pDisp;
- IMetaDataEmit2 *m_pEmitter;
+ IMetaDataDispenserEx2 *m_pDisp;
+ IMetaDataEmit3 *m_pEmitter;
ICeeFileGen *m_pCeeFileGen;
IMetaDataImport2 *m_pImporter; // Import interface.
HCEEFILE m_pCeeFile;
@@ -842,7 +852,7 @@ class Assembler {
void AddToImplList(mdToken);
void ClearBoundList(void);
//--------------------------------------------------------------------------------
- BOOL Init();
+ BOOL Init(BOOL generatePdb, PdbFormat pdbFormat);
void ProcessLabel(__in_z __in char *pszName);
GlobalLabel *FindGlobalLabel(LPCUTF8 pszName);
GlobalFixup *AddDeferredGlobalFixup(__in __nullterminated char *pszLabel, BYTE* reference);
@@ -1049,6 +1059,20 @@ class Assembler {
GUID m_guidLangVendor;
GUID m_guidDoc;
+ // Portable PDB paraphernalia
+public:
+ PdbFormat m_pdbFormat;
+ PortablePdbWriter* m_pPortablePdbWriter;
+ char m_szPdbFileName[MAX_FILENAME_LENGTH * 3 + 1];
+ WCHAR m_wzPdbFileName[MAX_FILENAME_LENGTH];
+
+ // Sets the pdb file name of the assembled file.
+ void SetPdbFileName(__in __nullterminated char* szName);
+ // Saves the pdb file.
+ HRESULT SavePdbFile();
+ // Checks whether pdb generation is portable
+ BOOL IsPortablePdb();
+
// Security paraphernalia
public:
void AddPermissionDecl(CorDeclSecurity action, mdToken type, NVPair *pairs)
@@ -1223,7 +1247,7 @@ class Assembler {
Clockwork* bClock;
void SetClock(Clockwork* val) { bClock = val; };
// ENC paraphernalia
- HRESULT InitMetaDataForENC(__in __nullterminated WCHAR* wzOrigFileName);
+ HRESULT InitMetaDataForENC(__in __nullterminated WCHAR* wzOrigFileName, BOOL generatePdb, PdbFormat pdbFormat);
BOOL EmitFieldsMethodsENC(Class* pClass);
BOOL EmitEventsPropsENC(Class* pClass);
HRESULT CreateDeltaFiles(__in __nullterminated WCHAR *pwzOutputFilename);
diff --git a/src/coreclr/src/ilasm/grammar_after.cpp b/src/coreclr/src/ilasm/grammar_after.cpp
index 96787774562f..dc4c8497e818 100644
--- a/src/coreclr/src/ilasm/grammar_after.cpp
+++ b/src/coreclr/src/ilasm/grammar_after.cpp
@@ -284,7 +284,7 @@ Instr* SetupInstr(unsigned short opcode)
if((pVal = PASM->GetInstr()))
{
pVal->opcode = opcode;
- if((pVal->pWriter = PASM->m_pSymDocument)!=NULL)
+ if((pVal->pWriter = PASM->m_pSymDocument)!=NULL || PASM->IsPortablePdb())
{
if(PENV->bExternSource)
{
@@ -299,9 +299,13 @@ Instr* SetupInstr(unsigned short opcode)
pVal->linenum = PENV->curLine;
pVal->column = 1;
pVal->linenum_end = PENV->curLine;
- pVal->column_end = 0;
+ // Portable PDB rule:
+ // - If Start Line is equal to End Line then End Column is greater than Start Column.
+ // To fulfill this condition the column_end is set to 2 instead of 0
+ pVal->column_end = PASM->IsPortablePdb() ? 2 : 0;
pVal->pc = PASM->m_CurPC;
}
+ pVal->pOwnerDocument = PASM->IsPortablePdb() ? PASM->m_pPortablePdbWriter->GetCurrentDocument() : NULL;
}
}
return pVal;
diff --git a/src/coreclr/src/ilasm/main.cpp b/src/coreclr/src/ilasm/main.cpp
index 3942e8cecc99..9eec9a853277 100644
--- a/src/coreclr/src/ilasm/main.cpp
+++ b/src/coreclr/src/ilasm/main.cpp
@@ -94,6 +94,7 @@ WCHAR *pwzDeltaFiles[1024];
char szInputFilename[MAX_FILENAME_LENGTH*3];
WCHAR wzInputFilename[MAX_FILENAME_LENGTH];
WCHAR wzOutputFilename[MAX_FILENAME_LENGTH];
+WCHAR wzPdbFilename[MAX_FILENAME_LENGTH];
#ifdef _PREFAST_
@@ -111,7 +112,8 @@ extern "C" int _cdecl wmain(int argc, __in WCHAR **argv)
int exitval=1;
bool bLogo = TRUE;
bool bReportProgress = TRUE;
- BOOL bNoDebug = TRUE;
+ BOOL bGeneratePdb = FALSE;
+ PdbFormat pdbFormat = CLASSIC;
WCHAR* wzIncludePath = NULL;
int exitcode = 0;
unsigned uCodePage;
@@ -132,6 +134,7 @@ extern "C" int _cdecl wmain(int argc, __in WCHAR **argv)
g_uConsoleCP = GetConsoleOutputCP();
memset(wzOutputFilename,0,sizeof(wzOutputFilename));
+ memset(wzPdbFilename, 0, sizeof(wzPdbFilename));
#ifdef _DEBUG
DisableThrowCheck();
@@ -163,6 +166,8 @@ extern "C" int _cdecl wmain(int argc, __in WCHAR **argv)
printf("\n/DLL Compile to .dll");
printf("\n/EXE Compile to .exe (default)");
printf("\n/PDB Create the PDB file without enabling debug info tracking");
+ printf("\n/PDBFMT=CLASSIC Use classic PDB format for PDB file generation (default)");
+ printf("\n/PDBFMT=PORTABLE Use portable PDB format for PDB file generation");
printf("\n/APPCONTAINER Create an AppContainer exe or dll");
printf("\n/DEBUG Disable JIT optimization, create PDB file, use sequence points from PDB");
printf("\n/DEBUG=IMPL Disable JIT optimization, create PDB file, use implicit sequence points");
@@ -245,11 +250,9 @@ extern "C" int _cdecl wmain(int argc, __in WCHAR **argv)
}
else if (!_stricmp(szOpt, "DEB"))
{
- pAsm->m_dwIncludeDebugInfo = 0x101;
- // PDB is ignored under 'DEB' option for ilasm on CoreCLR.
- // https://github.com/dotnet/coreclr/issues/2982
- bNoDebug = FALSE;
+ bGeneratePdb = TRUE;
+ pAsm->m_dwIncludeDebugInfo = 0x101;
WCHAR *pStr = EqualOrColon(argv[i]);
if(pStr != NULL)
{
@@ -275,9 +278,43 @@ extern "C" int _cdecl wmain(int argc, __in WCHAR **argv)
}
else if (!_stricmp(szOpt, "PDB"))
{
- // 'PDB' option is ignored for ilasm on CoreCLR.
- // https://github.com/dotnet/coreclr/issues/2982
- bNoDebug = FALSE;
+ bGeneratePdb = TRUE;
+
+ // check for /PDBFMT= command line option
+ char szOpt2[3 + 1] = { 0 };
+ WszWideCharToMultiByte(uCodePage, 0, &argv[i][4], 3, szOpt2, sizeof(szOpt2), NULL, NULL);
+ if (!_stricmp(szOpt2, "FMT"))
+ {
+ WCHAR* pStr = EqualOrColon(argv[i]);
+ if (pStr != NULL)
+ {
+ for (pStr++; *pStr == L' '; pStr++); //skip the blanks
+ if (wcslen(pStr) == 0)
+ {
+ goto InvalidOption; //if no suboption
+ }
+ else
+ {
+ WCHAR wzSubOpt[8 + 1];
+ wcsncpy_s(wzSubOpt, 8 + 1, pStr, 8);
+ wzSubOpt[8] = 0;
+ if (0 == _wcsicmp(wzSubOpt, W("CLASSIC")))
+ pdbFormat = CLASSIC;
+ else if (0 == _wcsicmp(wzSubOpt, W("PORTABLE")))
+ pdbFormat = PORTABLE;
+ else
+ goto InvalidOption; // bad subooption
+ }
+ }
+ else
+ {
+ goto InvalidOption; // bad subooption
+ }
+ }
+ else if (*szOpt2)
+ {
+ goto InvalidOption; // bad subooption
+ }
}
else if (!_stricmp(szOpt, "CLO"))
{
@@ -599,7 +636,15 @@ extern "C" int _cdecl wmain(int argc, __in WCHAR **argv)
delete pAsm;
goto ErrorExit;
}
- if(!pAsm->Init())
+ if (bGeneratePdb && CLASSIC == pdbFormat)
+ {
+ // Classic PDB format is not supported on CoreCLR
+ // https://github.com/dotnet/coreclr/issues/2982
+
+ printf("WARNING: Classic PDB format is not supported on CoreCLR.\n");
+ printf("Use '/PDBFMT=PORTABLE' option in order to generate portable PDB format. \n");
+ }
+ if (!pAsm->Init(bGeneratePdb, pdbFormat))
{
fprintf(stderr,"Failed to initialize Assembler\n");
delete pAsm;
@@ -624,6 +669,17 @@ extern "C" int _cdecl wmain(int argc, __in WCHAR **argv)
while(j);
wcscat_s(wzOutputFilename, MAX_FILENAME_LENGTH,(IsDLL ? W(".dll") : (IsOBJ ? W(".obj") : W(".exe"))));
}
+ if (pAsm->m_fGeneratePDB)
+ {
+ wcscpy_s(wzPdbFilename, MAX_FILENAME_LENGTH, wzOutputFilename);
+ WCHAR* extPos = wcsrchr(wzPdbFilename, L'.');
+ if (extPos != NULL)
+ *extPos = 0;
+ wcscat_s(wzPdbFilename, MAX_FILENAME_LENGTH, W(".pdb"));
+ char* pszPdbFilename = FullFileName(wzPdbFilename, uCodePage);
+ pAsm->SetPdbFileName(pszPdbFilename);
+ delete[] pszPdbFilename;
+ }
if(wzIncludePath == NULL)
{
PathString wzIncludePathBuffer;
@@ -744,6 +800,16 @@ extern "C" int _cdecl wmain(int argc, __in WCHAR **argv)
exitval = 1;
pParser->msg("Failed to write output file, error code=0x%08X\n",hr);
}
+ // Generate PDB file
+ if (pAsm->m_fGeneratePDB)
+ {
+ if (pAsm->m_fReportProgress) pParser->msg("Writing PDB file: %s\n", pAsm->m_szPdbFileName);
+ if (FAILED(hr = pAsm->SavePdbFile()))
+ {
+ exitval = 1;
+ pParser->msg("Failed to write PDB file, error code=0x%08X\n", hr);
+ }
+ }
if(bClock) cw.cEnd = GetTickCount();
#define ENC_ENABLED
if(exitval==0)
@@ -788,7 +854,7 @@ extern "C" int _cdecl wmain(int argc, __in WCHAR **argv)
}
else
#endif
- if (SUCCEEDED(pAsm->InitMetaDataForENC(wzNewOutputFilename)))
+ if (SUCCEEDED(pAsm->InitMetaDataForENC(wzNewOutputFilename, bGeneratePdb, pdbFormat)))
{
pAsm->SetSourceFileName(FullFileName(wzInputFilename,uCodePage)); // deletes the argument!
@@ -860,7 +926,7 @@ extern "C" int _cdecl wmain(int argc, __in WCHAR **argv)
WszSetEnvironmentVariable(W("COMP_ENC_OPENSCOPE"), W(""));
WszSetEnvironmentVariable(W("COMP_ENC_EMIT"), W(""));
- if(exitval || bNoDebug)
+ if (exitval || !bGeneratePdb)
{
// PE file was not created, or no debug info required. Kill PDB if any
WCHAR* pc = wcsrchr(wzOutputFilename,L'.');
diff --git a/src/coreclr/src/ilasm/method.hpp b/src/coreclr/src/ilasm/method.hpp
index 47786f5d33c0..c52a3a41e810 100644
--- a/src/coreclr/src/ilasm/method.hpp
+++ b/src/coreclr/src/ilasm/method.hpp
@@ -24,6 +24,8 @@ struct LinePC
ULONG ColumnEnd;
ULONG PC;
ISymUnmanagedDocumentWriter* pWriter;
+ Document* pOwnerDocument;
+ BOOL IsHidden;
};
typedef FIFO LinePCList;
diff --git a/src/coreclr/src/ilasm/portable_pdb.cpp b/src/coreclr/src/ilasm/portable_pdb.cpp
new file mode 100644
index 000000000000..f283ad05ec3d
--- /dev/null
+++ b/src/coreclr/src/ilasm/portable_pdb.cpp
@@ -0,0 +1,399 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+#include "portable_pdb.h"
+#include
+#include "assembler.h"
+
+//*****************************************************************************
+// Document
+//*****************************************************************************
+Document::Document()
+{
+ m_name = NULL;
+ m_token = mdDocumentNil;
+}
+
+Document::~Document()
+{
+ if (m_name)
+ {
+ delete[] m_name;
+ m_name = NULL;
+ }
+ m_token = mdDocumentNil;
+};
+
+char* Document::GetName()
+{
+ return m_name;
+}
+
+void Document::SetName(char* name)
+{
+ m_name = new char[strlen(name) + 1];
+ strcpy_s(m_name, strlen(name) + 1, name);
+}
+
+mdDocument Document::GetToken()
+{
+ return m_token;
+}
+
+void Document::SetToken(mdDocument token)
+{
+ m_token = token;
+}
+
+
+//*****************************************************************************
+// PortablePdbWriter
+//*****************************************************************************
+PortablePdbWriter::PortablePdbWriter()
+{
+ m_pdbStream.id.pdbGuid = { 0 };
+ m_pdbStream.id.pdbTimeStamp = 0;
+ m_pdbStream.entryPoint = mdMethodDefNil;
+ m_pdbStream.referencedTypeSystemTables = 0UL;
+ m_pdbStream.typeSystemTableRows = new ULONG[TBL_COUNT];
+ m_pdbStream.typeSystemTableRowsSize = 0;
+ m_currentDocument = NULL;
+ m_pdbEmitter = NULL;
+}
+
+PortablePdbWriter::~PortablePdbWriter()
+{
+ if (m_pdbEmitter != NULL)
+ {
+ m_pdbEmitter->Release();
+ m_pdbEmitter = NULL;
+ }
+ if (m_pdbStream.typeSystemTableRows != NULL)
+ {
+ delete[] m_pdbStream.typeSystemTableRows;
+ m_pdbStream.typeSystemTableRows = NULL;
+ }
+
+ m_documentList.RESET(true);
+}
+
+HRESULT PortablePdbWriter::Init(IMetaDataDispenserEx2* mdDispenser)
+{
+ HRESULT hr = S_OK;
+ if (m_pdbEmitter != NULL)
+ {
+ m_pdbEmitter->Release();
+ m_pdbEmitter = NULL;
+ }
+ m_currentDocument = NULL;
+ m_documentList.RESET(true);
+
+ memset(m_pdbStream.typeSystemTableRows, 0, sizeof(ULONG) * TBL_COUNT);
+ time_t now;
+ time(&now);
+ m_pdbStream.id.pdbTimeStamp = (ULONG)now;
+ hr = CoCreateGuid(&m_pdbStream.id.pdbGuid);
+
+ if (FAILED(hr)) goto exit;
+
+ hr = mdDispenser->DefinePortablePdbScope(
+ CLSID_CorMetaDataRuntime,
+ 0,
+ IID_IMetaDataEmit3,
+ (IUnknown**)&m_pdbEmitter);
+exit:
+ return hr;
+}
+
+IMetaDataEmit3* PortablePdbWriter::GetEmitter()
+{
+ return m_pdbEmitter;
+}
+
+GUID* PortablePdbWriter::GetGuid()
+{
+ return &m_pdbStream.id.pdbGuid;
+}
+
+ULONG PortablePdbWriter::GetTimestamp()
+{
+ return m_pdbStream.id.pdbTimeStamp;
+}
+
+Document* PortablePdbWriter::GetCurrentDocument()
+{
+ return m_currentDocument;
+}
+
+HRESULT PortablePdbWriter::BuildPdbStream(IMetaDataEmit3* peEmitter, mdMethodDef entryPoint)
+{
+ HRESULT hr = S_OK;
+
+ m_pdbStream.entryPoint = entryPoint;
+
+ if (FAILED(hr = peEmitter->GetReferencedTypeSysTables(
+ &m_pdbStream.referencedTypeSystemTables,
+ m_pdbStream.typeSystemTableRows,
+ TBL_COUNT,
+ &m_pdbStream.typeSystemTableRowsSize))) goto exit;
+
+ if (FAILED(hr = m_pdbEmitter->DefinePdbStream(&m_pdbStream))) goto exit;
+
+exit:
+ return hr;
+}
+
+HRESULT PortablePdbWriter::DefineDocument(char* name, GUID* language)
+{
+ HRESULT hr = S_OK;
+ Document* document = NULL;
+ unsigned i = 0;
+
+ // did we already add a document with this name
+ while ((document = m_documentList.PEEK(i++)) != NULL)
+ {
+ if (!strcmp(name, document->GetName()))
+ break;
+ }
+
+ if (document)
+ {
+ // found one in the list
+ // set it as current
+ m_currentDocument = document;
+ }
+ else
+ {
+ // define a new document
+ document = new Document();
+ // save the document name, the 'name' parameter will be overriten - tokenized
+ document->SetName(name);
+
+ // TODO: make use of hash algorithm and hash value
+ GUID hashAlgorithmUnknown = { 0 };
+ BYTE* hashValue = NULL;
+ ULONG cbHashValue = 0;
+ mdDocument docToken = mdDocumentNil;
+
+ if (FAILED(hr = m_pdbEmitter->DefineDocument(
+ name, // will be tokenized
+ &hashAlgorithmUnknown,
+ hashValue,
+ cbHashValue,
+ language,
+ &docToken)))
+ {
+ delete document;
+ m_currentDocument = NULL;
+ hr = E_FAIL;
+ }
+ else
+ {
+ document->SetToken(docToken);
+ m_currentDocument = document;
+ m_documentList.PUSH(document);
+ }
+ }
+
+ return hr;
+}
+
+HRESULT PortablePdbWriter::DefineSequencePoints(Method* method)
+{
+ HRESULT hr = S_OK;
+ BinStr* blob = new BinStr();
+
+ // Blob ::= header SequencePointRecord (SequencePointRecord | document-record)*
+ // SequencePointRecord :: = sequence-point-record | hidden-sequence-point-record
+
+ // header ::= {LocalSignature, InitialDocument}
+ // LocalSignature
+ ULONG localSigRid = RidFromToken(method->m_LocalsSig);
+ CompressUnsignedLong(localSigRid, blob);
+ // InitialDocument TODO: skip this for now
+
+ // SequencePointRecord
+ ULONG offset = 0;
+ ULONG deltaLines = 0;
+ LONG deltaColumns = 0;
+ LONG deltaStartLine = 0;
+ LONG deltaStartColumn = 0;
+ LinePC* currSeqPoint = NULL;
+ LinePC* prevSeqPoint = NULL;
+ LinePC* prevNonHiddenSeqPoint = NULL;
+ LinePC* nextSeqPoint = NULL;
+ BOOL isValid = TRUE;
+
+ for (UINT32 i = 0; i < method->m_LinePCList.COUNT(); i++)
+ {
+ currSeqPoint = method->m_LinePCList.PEEK(i);
+ if (i < (method->m_LinePCList.COUNT() - 1))
+ nextSeqPoint = method->m_LinePCList.PEEK(i + 1);
+ else
+ nextSeqPoint = NULL;
+
+ isValid = VerifySequencePoint(currSeqPoint, nextSeqPoint);
+ if (!isValid)
+ {
+ method->m_pAssembler->report->warn("Sequence point at line: [0x%x] and offset: [0x%x] in method '%s' is not valid!\n",
+ currSeqPoint->Line,
+ currSeqPoint->PC,
+ method->m_szName);
+ hr = E_FAIL;
+ break; // TODO: break or ignore?
+ }
+
+ if (!currSeqPoint->IsHidden)
+ {
+ //offset
+ offset = (i == 0) ? currSeqPoint->PC : currSeqPoint->PC - prevSeqPoint->PC;
+ CompressUnsignedLong(offset, blob);
+
+ //delta lines
+ deltaLines = currSeqPoint->LineEnd - currSeqPoint->Line;
+ CompressUnsignedLong(deltaLines, blob);
+
+ //delta columns
+ deltaColumns = currSeqPoint->ColumnEnd - currSeqPoint->Column;
+ if (deltaLines == 0)
+ CompressUnsignedLong(deltaColumns, blob);
+ else
+ CompressSignedLong(deltaColumns, blob);
+
+ //delta start line
+ if (prevNonHiddenSeqPoint == NULL)
+ {
+ deltaStartLine = currSeqPoint->Line;
+ CompressUnsignedLong(deltaStartLine, blob);
+ }
+ else
+ {
+ deltaStartLine = currSeqPoint->Line - prevNonHiddenSeqPoint->Line;
+ CompressSignedLong(deltaStartLine, blob);
+ }
+
+ //delta start column
+ if (prevNonHiddenSeqPoint == NULL)
+ {
+ deltaStartColumn = currSeqPoint->Column;
+ CompressUnsignedLong(deltaStartColumn, blob);
+ }
+ else
+ {
+ deltaStartColumn = currSeqPoint->Column - prevNonHiddenSeqPoint->Column;
+ CompressSignedLong(deltaStartColumn, blob);
+ }
+
+ prevNonHiddenSeqPoint = currSeqPoint;
+ }
+ else
+ {
+ //offset
+ offset = (i == 0) ? currSeqPoint->PC : currSeqPoint->PC - prevSeqPoint->PC;
+ CompressUnsignedLong(offset, blob);
+
+ //delta lines
+ deltaLines = 0;
+ CompressUnsignedLong(deltaLines, blob);
+
+ //delta lines
+ deltaColumns = 0;
+ CompressUnsignedLong(deltaColumns, blob);
+ }
+ prevSeqPoint = currSeqPoint;
+ }
+
+ // finally define sequence points for the method
+ if (isValid && currSeqPoint != NULL)
+ {
+ ULONG documentRid = RidFromToken(currSeqPoint->pOwnerDocument->GetToken());
+ hr = m_pdbEmitter->DefineSequencePoints(documentRid, blob->ptr(), blob->length());
+ }
+
+ delete blob;
+ return hr;
+}
+
+HRESULT PortablePdbWriter::DefineLocalScope(Method* method)
+{
+ if (!_DefineLocalScope(method->m_Tok, &method->m_MainScope))
+ return E_FAIL;
+ else
+ return S_OK;
+}
+
+BOOL PortablePdbWriter::_DefineLocalScope(mdMethodDef methodDefToken, Scope* currScope)
+{
+ BOOL fSuccess = FALSE;
+ ARG_NAME_LIST* pLocalVar = currScope->pLocals;
+ ULONG methodRid = RidFromToken(methodDefToken);
+ ULONG importScopeRid = RidFromToken(mdImportScopeNil); // TODO: not supported for now
+ ULONG firstLocalVarRid = 0;
+ ULONG firstLocalConstRid = RidFromToken(mdLocalConstantNil); // TODO: not supported for now
+ ULONG start = 0;
+ ULONG length = 0;
+ mdLocalVariable firstLocVarToken = mdLocalScopeNil;
+
+ while (pLocalVar != NULL)
+ {
+ mdLocalVariable locVarToken = mdLocalScopeNil;
+ USHORT attribute = 0; // TODO: not supported for now
+ USHORT index = pLocalVar->dwAttr & 0xffff; // slot
+ if (FAILED(m_pdbEmitter->DefineLocalVariable(attribute, index, (char*)pLocalVar->szName, &locVarToken))) goto exit;
+
+ if (firstLocVarToken == mdLocalScopeNil)
+ firstLocVarToken = locVarToken;
+
+ pLocalVar = pLocalVar->pNext;
+ }
+
+ if (firstLocVarToken != mdLocalScopeNil)
+ {
+ firstLocalVarRid = RidFromToken(firstLocVarToken);
+ start = currScope->dwStart;
+ length = currScope->dwEnd - currScope->dwStart;
+ if (FAILED(m_pdbEmitter->DefineLocalScope(methodRid, importScopeRid, firstLocalVarRid, firstLocalConstRid, start, length))) goto exit;
+ }
+
+ fSuccess = TRUE;
+ for (ULONG i = 0; i < currScope->SubScope.COUNT(); i++)
+ fSuccess &= _DefineLocalScope(methodDefToken, currScope->SubScope.PEEK(i));
+
+exit:
+ return fSuccess;
+}
+
+BOOL PortablePdbWriter::VerifySequencePoint(LinePC* curr, LinePC* next)
+{
+ if (!curr->IsHidden)
+ {
+ if ((curr->PC >= 0 && curr->PC < 0x20000000) &&
+ (next == NULL || (next != NULL && curr->PC < next->PC)) &&
+ (curr->Line >= 0 && curr->Line < 0x20000000 && curr->Line != 0xfeefee) &&
+ (curr->LineEnd >= 0 && curr->LineEnd < 0x20000000 && curr->LineEnd != 0xfeefee) &&
+ (curr->Column >= 0 && curr->Column < 0x10000) &&
+ (curr->ColumnEnd >= 0 && curr->ColumnEnd < 0x10000) &&
+ (curr->LineEnd > curr->Line || (curr->Line == curr->LineEnd && curr->ColumnEnd > curr->Column)))
+ {
+ return TRUE;
+ }
+ else
+ {
+ return FALSE;
+ }
+ }
+ return TRUE;
+}
+
+void PortablePdbWriter::CompressUnsignedLong(ULONG srcData, BinStr* dstBuffer)
+{
+ ULONG cnt = CorSigCompressData(srcData, dstBuffer->getBuff(sizeof(ULONG) + 1));
+ dstBuffer->remove((sizeof(ULONG) + 1) - cnt);
+}
+
+void PortablePdbWriter::CompressSignedLong(LONG srcData, BinStr* dstBuffer)
+{
+ ULONG cnt = CorSigCompressSignedInt(srcData, dstBuffer->getBuff(sizeof(LONG) + 1));
+ dstBuffer->remove((sizeof(LONG) + 1) - cnt);
+}
diff --git a/src/coreclr/src/ilasm/portable_pdb.h b/src/coreclr/src/ilasm/portable_pdb.h
new file mode 100644
index 000000000000..0685842069b4
--- /dev/null
+++ b/src/coreclr/src/ilasm/portable_pdb.h
@@ -0,0 +1,69 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+#ifndef PORTABLE_PDB_H
+#define PORTABLE_PDB_H
+
+#include "ilasmpch.h"
+#include "asmtemplates.h"
+#include "portablepdbmdds.h"
+#include "portablepdbmdi.h"
+
+//*****************************************************************************
+// Document
+//*****************************************************************************
+class Document
+{
+public:
+ Document();
+ ~Document();
+ char* GetName();
+ void SetName(char* name);
+ mdDocument GetToken();
+ void SetToken(mdDocument token);
+
+private:
+ char* m_name;
+ mdDocument m_token;
+};
+
+typedef FIFO DocumentList;
+
+class BinStr;
+class Method;
+class Scope;
+struct LinePC;
+
+//*****************************************************************************
+// PortablePdbWriter
+//*****************************************************************************
+class PortablePdbWriter
+{
+public:
+ PortablePdbWriter();
+ ~PortablePdbWriter();
+ HRESULT Init(IMetaDataDispenserEx2* mdDispenser);
+ IMetaDataEmit3* GetEmitter();
+ GUID* GetGuid();
+ ULONG GetTimestamp();
+ Document* GetCurrentDocument();
+ HRESULT BuildPdbStream(IMetaDataEmit3* peEmitter, mdMethodDef entryPoint);
+ HRESULT DefineDocument(char* name, GUID* language);
+ HRESULT DefineSequencePoints(Method* method);
+ HRESULT DefineLocalScope(Method* method);
+
+private:
+ BOOL VerifySequencePoint(LinePC* curr, LinePC* next);
+ void CompressUnsignedLong(ULONG srcData, BinStr* dstBuffer);
+ void CompressSignedLong(LONG srcData, BinStr* dstBuffer);
+ BOOL _DefineLocalScope(mdMethodDef methodDefToken, Scope* currScope);
+
+private:
+ IMetaDataEmit3* m_pdbEmitter;
+ PORT_PDB_STREAM m_pdbStream;
+ DocumentList m_documentList;
+ Document* m_currentDocument;
+};
+
+#endif
diff --git a/src/coreclr/src/ilasm/writer.cpp b/src/coreclr/src/ilasm/writer.cpp
index 64b0054ec3e0..dc3df055470b 100644
--- a/src/coreclr/src/ilasm/writer.cpp
+++ b/src/coreclr/src/ilasm/writer.cpp
@@ -30,7 +30,7 @@ HRESULT Assembler::InitMetaData()
if(bClock) bClock->cMDInitBegin = GetTickCount();
hr = MetaDataGetDispenser(CLSID_CorMetaDataDispenser,
- IID_IMetaDataDispenserEx, (void **)&m_pDisp);
+ IID_IMetaDataDispenserEx2, (void **)&m_pDisp);
if (FAILED(hr))
goto exit;
@@ -43,7 +43,7 @@ HRESULT Assembler::InitMetaData()
hr = m_pDisp->SetOption(MetaDataRuntimeVersion, &encOption);
::SysFreeString(bstr);
}
- hr = m_pDisp->DefineScope(CLSID_CorMetaDataRuntime, 0, IID_IMetaDataEmit2,
+ hr = m_pDisp->DefineScope(CLSID_CorMetaDataRuntime, 0, IID_IMetaDataEmit3,
(IUnknown **)&m_pEmitter);
if (FAILED(hr))
goto exit;
@@ -52,6 +52,11 @@ HRESULT Assembler::InitMetaData()
if(FAILED(hr = m_pEmitter->QueryInterface(IID_IMetaDataImport2, (void**)&m_pImporter)))
goto exit;
+ if (m_pdbFormat == PdbFormat::PORTABLE)
+ {
+ m_pPortablePdbWriter = new PortablePdbWriter();
+ if (FAILED(hr = m_pPortablePdbWriter->Init(m_pDisp))) goto exit;
+ }
//m_Parser = new AsmParse(m_pEmitter);
m_fInitialisedMetaData = TRUE;
@@ -204,7 +209,7 @@ HRESULT Assembler::CreateDebugDirectory()
ULONG deOffset;
// Only emit this if we're also emitting debug info.
- if (!(m_fGeneratePDB && m_pSymWriter))
+ if (!(m_fGeneratePDB && (m_pSymWriter || IsPortablePdb())))
return S_OK;
IMAGE_DEBUG_DIRECTORY debugDirIDD;
@@ -215,38 +220,80 @@ HRESULT Assembler::CreateDebugDirectory()
} param;
param.debugDirData = NULL;
- // Get the debug info from the symbol writer.
- if (FAILED(hr=m_pSymWriter->GetDebugInfo(NULL, 0, ¶m.debugDirDataSize, NULL)))
- return hr;
+ if (m_pSymWriter) // CLASSIC
+ {
+ // Get the debug info from the symbol writer.
+ if (FAILED(hr=m_pSymWriter->GetDebugInfo(NULL, 0, ¶m.debugDirDataSize, NULL)))
+ return hr;
- // Will there even be any?
- if (param.debugDirDataSize == 0)
- return S_OK;
+ // Will there even be any?
+ if (param.debugDirDataSize == 0)
+ return S_OK;
- // Make some room for the data.
- PAL_TRY(Param *, pParam, ¶m) {
- pParam->debugDirData = new BYTE[pParam->debugDirDataSize];
- } PAL_EXCEPT(EXCEPTION_EXECUTE_HANDLER) {
- hr = E_FAIL;
- } PAL_ENDTRY
-
- if(FAILED(hr)) return hr;
- // Actually get the data now.
- if (FAILED(hr = m_pSymWriter->GetDebugInfo(&debugDirIDD,
- param.debugDirDataSize,
- NULL,
- param.debugDirData)))
- goto ErrExit;
+ // Make some room for the data.
+ PAL_TRY(Param *, pParam, ¶m) {
+ pParam->debugDirData = new BYTE[pParam->debugDirDataSize];
+ } PAL_EXCEPT(EXCEPTION_EXECUTE_HANDLER) {
+ hr = E_FAIL;
+ } PAL_ENDTRY
- // Grab the timestamp of the PE file.
- DWORD fileTimeStamp;
+ if(FAILED(hr)) return hr;
+ // Actually get the data now.
+ if (FAILED(hr = m_pSymWriter->GetDebugInfo(&debugDirIDD,
+ param.debugDirDataSize,
+ NULL,
+ param.debugDirData)))
+ goto ErrExit;
- if (FAILED(hr = m_pCeeFileGen->GetFileTimeStamp(m_pCeeFile,
- &fileTimeStamp)))
- goto ErrExit;
+ // Grab the timestamp of the PE file.
+ DWORD fileTimeStamp;
- // Fill in the directory entry.
- debugDirIDD.TimeDateStamp = VAL32(fileTimeStamp);
+ if (FAILED(hr = m_pCeeFileGen->GetFileTimeStamp(m_pCeeFile,
+ &fileTimeStamp)))
+ goto ErrExit;
+
+ // Fill in the directory entry.
+ debugDirIDD.TimeDateStamp = VAL32(fileTimeStamp);
+ }
+ else if (IsPortablePdb()) // PORTABLE
+ {
+ // get module ID
+ DWORD rsds = 0x53445352;
+ DWORD pdbAge = 0x1;
+ DWORD len = sizeof(rsds) + sizeof(GUID) + sizeof(pdbAge) + (DWORD)strlen(m_szPdbFileName) + 1;
+ BYTE* dbgDirData = new BYTE[len];
+
+ DWORD offset = 0;
+ memcpy_s(dbgDirData + offset, len, &rsds, sizeof(rsds)); // RSDS
+ offset += sizeof(rsds);
+ memcpy_s(dbgDirData + offset, len, m_pPortablePdbWriter->GetGuid(), sizeof(GUID)); // PDB GUID
+ offset += sizeof(GUID);
+ memcpy_s(dbgDirData + offset, len, &pdbAge, sizeof(pdbAge)); // PDB AGE
+ offset += sizeof(pdbAge);
+ memcpy_s(dbgDirData + offset, len, m_szPdbFileName, strlen(m_szPdbFileName) + 1); // PDB PATH
+
+ debugDirIDD.Characteristics = 0;
+ debugDirIDD.TimeDateStamp = m_pPortablePdbWriter->GetTimestamp();
+ debugDirIDD.MajorVersion = 0x100;
+ debugDirIDD.MinorVersion = 0x504d;
+ debugDirIDD.Type = IMAGE_DEBUG_TYPE_CODEVIEW;
+ debugDirIDD.SizeOfData = len;
+ debugDirIDD.AddressOfRawData = 0; // will be updated bellow
+ debugDirIDD.PointerToRawData = 0; // will be updated bellow
+
+ param.debugDirDataSize = len;
+
+ // Make some room for the data.
+ PAL_TRY(Param*, pParam, ¶m) {
+ pParam->debugDirData = new BYTE[pParam->debugDirDataSize];
+ } PAL_EXCEPT(EXCEPTION_EXECUTE_HANDLER) {
+ hr = E_FAIL;
+ } PAL_ENDTRY
+
+ if (FAILED(hr)) return hr;
+
+ param.debugDirData = dbgDirData;
+ }
// Grab memory in the section for our stuff.
// Note that UpdateResource doesn't work correctly if the debug directory is
diff --git a/src/coreclr/src/ilasm/writer_enc.cpp b/src/coreclr/src/ilasm/writer_enc.cpp
index 1888b563e6f8..96a637b4dec4 100644
--- a/src/coreclr/src/ilasm/writer_enc.cpp
+++ b/src/coreclr/src/ilasm/writer_enc.cpp
@@ -12,7 +12,7 @@
int ist=0;
#define REPT_STEP //printf("Step %d\n",++ist);
-HRESULT Assembler::InitMetaDataForENC(__in __nullterminated WCHAR* wzOrigFileName)
+HRESULT Assembler::InitMetaDataForENC(__in __nullterminated WCHAR* wzOrigFileName, BOOL generatePdb, PdbFormat pdbFormat)
{
HRESULT hr = E_FAIL;
@@ -33,6 +33,11 @@ HRESULT Assembler::InitMetaDataForENC(__in __nullterminated WCHAR* wzOrigFileNam
m_pEmitter->Release();
m_pEmitter = NULL;
}
+ if (m_pPortablePdbWriter != NULL)
+ {
+ delete m_pPortablePdbWriter;
+ m_pPortablePdbWriter = NULL;
+ }
//WszSetEnvironmentVariable(L"COMP_ENC_OPENSCOPE", wzOrigFileName);
//hr = m_pDisp->DefineScope(CLSID_CorMetaDataRuntime, 0, IID_IMetaDataEmit2,
// (IUnknown **)&m_pEmitter);
@@ -63,7 +68,7 @@ HRESULT Assembler::InitMetaDataForENC(__in __nullterminated WCHAR* wzOrigFileNam
goto exit;
//WszSetEnvironmentVariable(L"COMP_ENC_EMIT", wzOrigFileName);
- if(!Init()) goto exit; // close and re-open CeeFileGen and CeeFile
+ if(!Init(generatePdb, pdbFormat)) goto exit; // close and re-open CeeFileGen and CeeFile
hr = S_OK;
@@ -445,6 +450,11 @@ REPT_STEP
m_pEmitter->Release();
m_pEmitter = NULL;
}
+ if (m_pPortablePdbWriter != NULL)
+ {
+ delete m_pPortablePdbWriter;
+ m_pPortablePdbWriter = NULL;
+ }
return S_OK;
diff --git a/src/coreclr/src/inc/cordebug.idl b/src/coreclr/src/inc/cordebug.idl
index 857f0dee2ed0..7ab2867d9f28 100644
--- a/src/coreclr/src/inc/cordebug.idl
+++ b/src/coreclr/src/inc/cordebug.idl
@@ -3313,6 +3313,45 @@ interface ICorDebugProcess10 : IUnknown
HRESULT EnableGCNotificationEvents(BOOL fEnable);
}
+// The memory range described by this structure is a closed-open
+// interval, that is only the start is inclusive.
+typedef struct _COR_MEMORY_RANGE
+{
+ CORDB_ADDRESS start; // The start address of the range.
+ CORDB_ADDRESS end; // The end address of the range.
+} COR_MEMORY_RANGE;
+
+[
+ object,
+ local,
+ uuid(D1A0BCFC-5865-4437-BE3F-36F022951F8A),
+ pointer_default(unique)
+]
+interface ICorDebugMemoryRangeEnum : ICorDebugEnum
+{
+ /*
+ * Gets the next "celt" number of objects in the enumeration.
+ * The actual number of objects retrieved is returned in "pceltFetched".
+ * Returns S_FALSE if the actual number of objects retrieved is smaller
+ * than the number of objects requested.
+ */
+ HRESULT Next([in] ULONG celt,
+ [out, size_is(celt),
+ length_is(*pceltFetched)] COR_MEMORY_RANGE objects[],
+ [out] ULONG *pceltFetched);
+};
+
+[
+ object,
+ local,
+ uuid(344B37AA-F2C0-4D3B-9909-91CCF787DA8C),
+ pointer_default(unique)
+]
+interface ICorDebugProcess11 : IUnknown
+{
+ HRESULT EnumerateLoaderHeapMemoryRegions([out] ICorDebugMemoryRangeEnum** ppRanges);
+}
+
// Event types MODULE_LOADED and MODULE_UNLOADED implement this interface
[
object,
diff --git a/src/coreclr/src/inc/corinfoinstructionset.h b/src/coreclr/src/inc/corinfoinstructionset.h
index a2d9aaf69c9f..c292403b9e1c 100644
--- a/src/coreclr/src/inc/corinfoinstructionset.h
+++ b/src/coreclr/src/inc/corinfoinstructionset.h
@@ -20,17 +20,21 @@ enum CORINFO_InstructionSet
InstructionSet_AdvSimd=2,
InstructionSet_Aes=3,
InstructionSet_Crc32=4,
- InstructionSet_Sha1=5,
- InstructionSet_Sha256=6,
- InstructionSet_Atomics=7,
- InstructionSet_Vector64=8,
- InstructionSet_Vector128=9,
- InstructionSet_ArmBase_Arm64=10,
- InstructionSet_AdvSimd_Arm64=11,
- InstructionSet_Aes_Arm64=12,
- InstructionSet_Crc32_Arm64=13,
- InstructionSet_Sha1_Arm64=14,
- InstructionSet_Sha256_Arm64=15,
+ InstructionSet_Dp=5,
+ InstructionSet_Rdm=6,
+ InstructionSet_Sha1=7,
+ InstructionSet_Sha256=8,
+ InstructionSet_Atomics=9,
+ InstructionSet_Vector64=10,
+ InstructionSet_Vector128=11,
+ InstructionSet_ArmBase_Arm64=12,
+ InstructionSet_AdvSimd_Arm64=13,
+ InstructionSet_Aes_Arm64=14,
+ InstructionSet_Crc32_Arm64=15,
+ InstructionSet_Dp_Arm64=16,
+ InstructionSet_Rdm_Arm64=17,
+ InstructionSet_Sha1_Arm64=18,
+ InstructionSet_Sha256_Arm64=19,
#endif // TARGET_ARM64
#ifdef TARGET_AMD64
InstructionSet_X86Base=1,
@@ -158,6 +162,10 @@ struct CORINFO_InstructionSetFlags
AddInstructionSet(InstructionSet_Aes_Arm64);
if (HasInstructionSet(InstructionSet_Crc32))
AddInstructionSet(InstructionSet_Crc32_Arm64);
+ if (HasInstructionSet(InstructionSet_Dp))
+ AddInstructionSet(InstructionSet_Dp_Arm64);
+ if (HasInstructionSet(InstructionSet_Rdm))
+ AddInstructionSet(InstructionSet_Rdm_Arm64);
if (HasInstructionSet(InstructionSet_Sha1))
AddInstructionSet(InstructionSet_Sha1_Arm64);
if (HasInstructionSet(InstructionSet_Sha256))
@@ -237,6 +245,14 @@ inline CORINFO_InstructionSetFlags EnsureInstructionSetFlagsAreValid(CORINFO_Ins
resultflags.RemoveInstructionSet(InstructionSet_Crc32);
if (resultflags.HasInstructionSet(InstructionSet_Crc32_Arm64) && !resultflags.HasInstructionSet(InstructionSet_Crc32))
resultflags.RemoveInstructionSet(InstructionSet_Crc32_Arm64);
+ if (resultflags.HasInstructionSet(InstructionSet_Dp) && !resultflags.HasInstructionSet(InstructionSet_Dp_Arm64))
+ resultflags.RemoveInstructionSet(InstructionSet_Dp);
+ if (resultflags.HasInstructionSet(InstructionSet_Dp_Arm64) && !resultflags.HasInstructionSet(InstructionSet_Dp))
+ resultflags.RemoveInstructionSet(InstructionSet_Dp_Arm64);
+ if (resultflags.HasInstructionSet(InstructionSet_Rdm) && !resultflags.HasInstructionSet(InstructionSet_Rdm_Arm64))
+ resultflags.RemoveInstructionSet(InstructionSet_Rdm);
+ if (resultflags.HasInstructionSet(InstructionSet_Rdm_Arm64) && !resultflags.HasInstructionSet(InstructionSet_Rdm))
+ resultflags.RemoveInstructionSet(InstructionSet_Rdm_Arm64);
if (resultflags.HasInstructionSet(InstructionSet_Sha1) && !resultflags.HasInstructionSet(InstructionSet_Sha1_Arm64))
resultflags.RemoveInstructionSet(InstructionSet_Sha1);
if (resultflags.HasInstructionSet(InstructionSet_Sha1_Arm64) && !resultflags.HasInstructionSet(InstructionSet_Sha1))
@@ -251,6 +267,10 @@ inline CORINFO_InstructionSetFlags EnsureInstructionSetFlagsAreValid(CORINFO_Ins
resultflags.RemoveInstructionSet(InstructionSet_Aes);
if (resultflags.HasInstructionSet(InstructionSet_Crc32) && !resultflags.HasInstructionSet(InstructionSet_ArmBase))
resultflags.RemoveInstructionSet(InstructionSet_Crc32);
+ if (resultflags.HasInstructionSet(InstructionSet_Dp) && !resultflags.HasInstructionSet(InstructionSet_AdvSimd))
+ resultflags.RemoveInstructionSet(InstructionSet_Dp);
+ if (resultflags.HasInstructionSet(InstructionSet_Rdm) && !resultflags.HasInstructionSet(InstructionSet_AdvSimd))
+ resultflags.RemoveInstructionSet(InstructionSet_Rdm);
if (resultflags.HasInstructionSet(InstructionSet_Sha1) && !resultflags.HasInstructionSet(InstructionSet_ArmBase))
resultflags.RemoveInstructionSet(InstructionSet_Sha1);
if (resultflags.HasInstructionSet(InstructionSet_Sha256) && !resultflags.HasInstructionSet(InstructionSet_ArmBase))
@@ -415,6 +435,14 @@ inline const char *InstructionSetToString(CORINFO_InstructionSet instructionSet)
return "Crc32";
case InstructionSet_Crc32_Arm64 :
return "Crc32_Arm64";
+ case InstructionSet_Dp :
+ return "Dp";
+ case InstructionSet_Dp_Arm64 :
+ return "Dp_Arm64";
+ case InstructionSet_Rdm :
+ return "Rdm";
+ case InstructionSet_Rdm_Arm64 :
+ return "Rdm_Arm64";
case InstructionSet_Sha1 :
return "Sha1";
case InstructionSet_Sha1_Arm64 :
@@ -561,6 +589,8 @@ inline CORINFO_InstructionSet InstructionSetFromR2RInstructionSet(ReadyToRunInst
case READYTORUN_INSTRUCTION_AdvSimd: return InstructionSet_AdvSimd;
case READYTORUN_INSTRUCTION_Aes: return InstructionSet_Aes;
case READYTORUN_INSTRUCTION_Crc32: return InstructionSet_Crc32;
+ case READYTORUN_INSTRUCTION_Dp: return InstructionSet_Dp;
+ case READYTORUN_INSTRUCTION_Rdm: return InstructionSet_Rdm;
case READYTORUN_INSTRUCTION_Sha1: return InstructionSet_Sha1;
case READYTORUN_INSTRUCTION_Sha256: return InstructionSet_Sha256;
case READYTORUN_INSTRUCTION_Atomics: return InstructionSet_Atomics;
diff --git a/src/coreclr/src/inc/dacprivate.h b/src/coreclr/src/inc/dacprivate.h
index 2587609228e7..99419667a963 100644
--- a/src/coreclr/src/inc/dacprivate.h
+++ b/src/coreclr/src/inc/dacprivate.h
@@ -1028,6 +1028,8 @@ struct MSLAYOUT DacpJitCodeHeapInfo
CLRDATA_ADDRESS currentAddr = 0;
} HostData;
};
+
+ DacpJitCodeHeapInfo() : codeHeapType(0), LoaderHeap(0) {}
};
#include "static_assert.h"
diff --git a/src/coreclr/src/inc/mdcommon.h b/src/coreclr/src/inc/mdcommon.h
index 4a375770d90c..eeeb32fc7282 100644
--- a/src/coreclr/src/inc/mdcommon.h
+++ b/src/coreclr/src/inc/mdcommon.h
@@ -38,7 +38,9 @@ enum MAPPINGTYPE
#define ENC_MODEL_STREAM_A "#-"
#define MINIMAL_MD_STREAM_A "#JTD"
#define HOT_MODEL_STREAM_A "#!"
-
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+#define PDB_STREAM_A "#Pdb"
+#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB
#define SCHEMA_STREAM W("#Schema")
#define STRING_POOL_STREAM W("#Strings")
@@ -49,5 +51,8 @@ enum MAPPINGTYPE
#define ENC_MODEL_STREAM W("#-")
#define MINIMAL_MD_STREAM W("#JTD")
#define HOT_MODEL_STREAM W("#!")
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+#define PDB_STREAM W("#Pdb")
+#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB
#endif // __MDCommon_h__
diff --git a/src/coreclr/src/inc/metamodelpub.h b/src/coreclr/src/inc/metamodelpub.h
index 003902be696f..0f00534a6214 100644
--- a/src/coreclr/src/inc/metamodelpub.h
+++ b/src/coreclr/src/inc/metamodelpub.h
@@ -1520,6 +1520,133 @@ class GenericParamConstraintRec
};
};
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+/* Portable PDB tables */
+// -- Dummy records to fill the gap to 0x30
+class DummyRec
+{
+public:
+ enum {
+ COL_COUNT,
+ COL_KEY
+ };
+};
+class Dummy1Rec : public DummyRec {};
+class Dummy2Rec : public DummyRec {};
+class Dummy3Rec : public DummyRec {};
+
+class DocumentRec
+{
+public:
+ enum {
+ COL_Name,
+ COL_HashAlgorithm,
+ COL_Hash,
+ COL_Language,
+ COL_COUNT,
+ COL_KEY
+ };
+};
+
+class MethodDebugInformationRec
+{
+public:
+ enum {
+ COL_Document,
+ COL_SequencePoints,
+ COL_COUNT,
+ COL_KEY
+ };
+};
+
+class LocalScopeRec
+{
+METADATA_FIELDS_PROTECTION:
+ // [IMPORTANT]: Assigning values directly can override other columns, use PutCol instead
+ ULONG m_StartOffset;
+ // [IMPORTANT]: Assigning values directly can override other columns, use PutCol instead
+ ULONG m_Length;
+public:
+ enum {
+ COL_Method,
+ COL_ImportScope,
+ COL_VariableList,
+ COL_ConstantList,
+ COL_StartOffset,
+ COL_Length,
+ COL_COUNT,
+ COL_KEY
+ };
+};
+
+class LocalVariableRec
+{
+METADATA_FIELDS_PROTECTION:
+ USHORT m_Attributes;
+ USHORT m_Index;
+public:
+ enum {
+ COL_Attributes,
+ COL_Index,
+ COL_Name,
+ COL_COUNT,
+ COL_KEY
+ };
+
+ USHORT GetAttributes()
+ {
+ LIMITED_METHOD_CONTRACT;
+
+ return GET_UNALIGNED_VAL16(&m_Attributes);
+ }
+ void SetAttributes(USHORT attributes)
+ {
+ LIMITED_METHOD_CONTRACT;
+
+ m_Attributes = VAL16(attributes);
+ }
+
+ USHORT GetIndex()
+ {
+ LIMITED_METHOD_CONTRACT;
+
+ return GET_UNALIGNED_VAL16(&m_Index);
+ }
+ void SetIndex(USHORT index)
+ {
+ LIMITED_METHOD_CONTRACT;
+
+ m_Index = VAL16(index);
+ }
+};
+
+class LocalConstantRec
+{
+public:
+ enum {
+ COL_Name,
+ COL_Signature,
+ COL_COUNT,
+ COL_KEY
+ };
+};
+
+class ImportScopeRec
+{
+public:
+ enum {
+ COL_Parent,
+ COL_Imports,
+ COL_COUNT,
+ COL_KEY
+ };
+};
+
+// TODO:
+// class StateMachineMethodRec
+// class CustomDebugInformationRec
+#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB
+
#include
// List of MiniMd tables.
@@ -1569,15 +1696,40 @@ class GenericParamConstraintRec
MiniMdTable(NestedClass) \
MiniMdTable(GenericParam) \
MiniMdTable(MethodSpec) \
- MiniMdTable(GenericParamConstraint) \
+ MiniMdTable(GenericParamConstraint)
+
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+#define PortablePdbMiniMdTables() \
+ /* Dummy tables to fill the gap to 0x30 */ \
+ MiniMdTable(Dummy1) /* 0x2D */ \
+ MiniMdTable(Dummy2) /* 0x2E */ \
+ MiniMdTable(Dummy3) /* 0x2F */ \
+ /* Actual portable PDB tables */ \
+ MiniMdTable(Document) /* 0x30 */ \
+ MiniMdTable(MethodDebugInformation) /* 0x31 */ \
+ MiniMdTable(LocalScope) /* 0x32 */ \
+ MiniMdTable(LocalVariable) /* 0x33 */ \
+ MiniMdTable(LocalConstant) /* 0x34 */ \
+ MiniMdTable(ImportScope) /* 0x35 */ \
+ // TODO:
+ // MiniMdTable(StateMachineMethod) /* 0x36 */
+ // MiniMdTable(CustomDebugInformation) /* 0x37 */
+#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB
#undef MiniMdTable
#define MiniMdTable(x) TBL_##x,
enum {
MiniMdTables()
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+ PortablePdbMiniMdTables()
+#endif
TBL_COUNT, // Highest table.
TBL_COUNT_V1 = TBL_NestedClass + 1, // Highest table in v1.0 database
+#ifndef FEATURE_METADATA_EMIT_PORTABLE_PDB
TBL_COUNT_V2 = TBL_GenericParamConstraint + 1 // Highest in v2.0 database
+#else
+ TBL_COUNT_V2 = TBL_ImportScope + 1 // Highest in portable PDB database
+#endif
};
#undef MiniMdTable
diff --git a/src/coreclr/src/inc/readytorun.h b/src/coreclr/src/inc/readytorun.h
index f3bc01a878b9..b883f4b558e9 100644
--- a/src/coreclr/src/inc/readytorun.h
+++ b/src/coreclr/src/inc/readytorun.h
@@ -219,6 +219,7 @@ enum ReadyToRunHelper
// Not a real helper - handle to current module passed to delay load helpers.
READYTORUN_HELPER_Module = 0x01,
READYTORUN_HELPER_GSCookie = 0x02,
+ READYTORUN_HELPER_IndirectTrapThreads = 0x03,
//
// Delay load helpers
diff --git a/src/coreclr/src/inc/readytoruninstructionset.h b/src/coreclr/src/inc/readytoruninstructionset.h
index 85347d873a12..670a66458ff7 100644
--- a/src/coreclr/src/inc/readytoruninstructionset.h
+++ b/src/coreclr/src/inc/readytoruninstructionset.h
@@ -31,6 +31,8 @@ enum ReadyToRunInstructionSet
READYTORUN_INSTRUCTION_Sha256=20,
READYTORUN_INSTRUCTION_Atomics=21,
READYTORUN_INSTRUCTION_X86Base=22,
+ READYTORUN_INSTRUCTION_Dp=23,
+ READYTORUN_INSTRUCTION_Rdm=24,
};
diff --git a/src/coreclr/src/jit/block.h b/src/coreclr/src/jit/block.h
index dedbdaecb96e..26ccbd80a42a 100644
--- a/src/coreclr/src/jit/block.h
+++ b/src/coreclr/src/jit/block.h
@@ -445,6 +445,7 @@ struct BasicBlock : private LIR::Range
#define BBF_DOMINATED_BY_EXCEPTIONAL_ENTRY 0x800000000 // Block is dominated by exceptional entry.
#define BBF_BACKWARD_JUMP_TARGET 0x1000000000 // Block is a target of a backward jump
#define BBF_PATCHPOINT 0x2000000000 // Block is a patchpoint
+#define BBF_HAS_SUPPRESSGC_CALL 0x4000000000 // BB contains a call to a method with SuppressGCTransitionAttribute
// clang-format on
diff --git a/src/coreclr/src/jit/codegen.h b/src/coreclr/src/jit/codegen.h
index 36f6842295f6..d6e14d7a308c 100644
--- a/src/coreclr/src/jit/codegen.h
+++ b/src/coreclr/src/jit/codegen.h
@@ -92,7 +92,7 @@ class CodeGen final : public CodeGenInterface
inline RegState* regStateForType(var_types t)
{
- return varTypeIsFloating(t) ? &floatRegState : &intRegState;
+ return varTypeUsesFloatReg(t) ? &floatRegState : &intRegState;
}
inline RegState* regStateForReg(regNumber reg)
{
diff --git a/src/coreclr/src/jit/codegencommon.cpp b/src/coreclr/src/jit/codegencommon.cpp
index be4b08e9f436..ccfd7567f46a 100644
--- a/src/coreclr/src/jit/codegencommon.cpp
+++ b/src/coreclr/src/jit/codegencommon.cpp
@@ -440,7 +440,7 @@ regMaskTP CodeGenInterface::genGetRegMask(const LclVarDsc* varDsc)
assert(varDsc->lvIsInReg());
- if (varTypeIsFloating(varDsc->TypeGet()))
+ if (varTypeUsesFloatReg(varDsc->TypeGet()))
{
regMask = genRegMaskFloat(varDsc->GetRegNum(), varDsc->TypeGet());
}
@@ -11457,13 +11457,13 @@ void CodeGen::genReturn(GenTree* treeNode)
genSimpleReturn(treeNode);
#else // !TARGET_ARM64
#if defined(TARGET_X86)
- if (varTypeIsFloating(treeNode))
+ if (varTypeUsesFloatReg(treeNode))
{
genFloatReturn(treeNode);
}
else
#elif defined(TARGET_ARM)
- if (varTypeIsFloating(treeNode) && (compiler->opts.compUseSoftFP || compiler->info.compIsVarArgs))
+ if (varTypeUsesFloatReg(treeNode) && (compiler->opts.compUseSoftFP || compiler->info.compIsVarArgs))
{
if (targetType == TYP_FLOAT)
{
@@ -11479,7 +11479,7 @@ void CodeGen::genReturn(GenTree* treeNode)
else
#endif // TARGET_ARM
{
- regNumber retReg = varTypeIsFloating(treeNode) ? REG_FLOATRET : REG_INTRET;
+ regNumber retReg = varTypeUsesFloatReg(treeNode) ? REG_FLOATRET : REG_INTRET;
if (op1->GetRegNum() != retReg)
{
inst_RV_RV(ins_Move_Extend(targetType, true), retReg, op1->GetRegNum(), targetType);
@@ -11613,10 +11613,8 @@ bool CodeGen::isStructReturn(GenTree* treeNode)
#if defined(TARGET_AMD64) && !defined(UNIX_AMD64_ABI)
assert(!varTypeIsStruct(treeNode));
return false;
-#elif defined(TARGET_ARM64)
- return varTypeIsStruct(treeNode) && (compiler->info.compRetNativeType == TYP_STRUCT);
#else
- return varTypeIsStruct(treeNode);
+ return varTypeIsStruct(treeNode) && (compiler->info.compRetNativeType == TYP_STRUCT);
#endif
}
@@ -11946,8 +11944,8 @@ void CodeGen::genRegCopy(GenTree* treeNode)
// an argument, or returned from a call, in an integer register and must be
// copied if it's in an xmm register.
- bool srcFltReg = (varTypeIsFloating(op1) || varTypeIsSIMD(op1));
- bool tgtFltReg = (varTypeIsFloating(treeNode) || varTypeIsSIMD(treeNode));
+ bool srcFltReg = (varTypeUsesFloatReg(op1));
+ bool tgtFltReg = (varTypeUsesFloatReg(treeNode));
if (srcFltReg != tgtFltReg)
{
instruction ins;
diff --git a/src/coreclr/src/jit/codegenlinear.cpp b/src/coreclr/src/jit/codegenlinear.cpp
index 0de6f0ecf297..94306e936549 100644
--- a/src/coreclr/src/jit/codegenlinear.cpp
+++ b/src/coreclr/src/jit/codegenlinear.cpp
@@ -57,7 +57,7 @@ void CodeGen::genInitializeRegisterState()
continue;
}
- noway_assert(!varTypeIsFloating(varDsc->TypeGet()));
+ noway_assert(!varTypeUsesFloatReg(varDsc->TypeGet()));
// Mark the register as holding the variable
assert(varDsc->GetRegNum() != REG_STK);
diff --git a/src/coreclr/src/jit/codegenxarch.cpp b/src/coreclr/src/jit/codegenxarch.cpp
index b66c75b51f9c..207cef87d94e 100644
--- a/src/coreclr/src/jit/codegenxarch.cpp
+++ b/src/coreclr/src/jit/codegenxarch.cpp
@@ -4812,10 +4812,10 @@ void CodeGen::genCodeForSwap(GenTreeOp* tree)
var_types type2 = varDsc2->TypeGet();
// We must have both int or both fp regs
- assert(!varTypeIsFloating(type1) || varTypeIsFloating(type2));
+ assert(!varTypeUsesFloatReg(type1) || varTypeUsesFloatReg(type2));
// FP swap is not yet implemented (and should have NYI'd in LSRA)
- assert(!varTypeIsFloating(type1));
+ assert(!varTypeUsesFloatReg(type1));
regNumber oldOp1Reg = lcl1->GetRegNum();
regMaskTP oldOp1RegMask = genRegMask(oldOp1Reg);
@@ -4999,7 +4999,7 @@ void CodeGen::genCallInstruction(GenTreeCall* call)
genConsumeReg(putArgRegNode);
// Validate the putArgRegNode has the right type.
- assert(varTypeIsFloating(putArgRegNode->TypeGet()) == genIsValidFloatReg(argReg));
+ assert(varTypeUsesFloatReg(putArgRegNode->TypeGet()) == genIsValidFloatReg(argReg));
if (putArgRegNode->GetRegNum() != argReg)
{
inst_RV_RV(ins_Move_Extend(putArgRegNode->TypeGet(), false), argReg, putArgRegNode->GetRegNum());
@@ -5910,12 +5910,14 @@ void CodeGen::genCompareInt(GenTree* treeNode)
{
assert(treeNode->OperIsCompare() || treeNode->OperIs(GT_CMP));
- GenTreeOp* tree = treeNode->AsOp();
- GenTree* op1 = tree->gtOp1;
- GenTree* op2 = tree->gtOp2;
- var_types op1Type = op1->TypeGet();
- var_types op2Type = op2->TypeGet();
- regNumber targetReg = tree->GetRegNum();
+ GenTreeOp* tree = treeNode->AsOp();
+ GenTree* op1 = tree->gtOp1;
+ GenTree* op2 = tree->gtOp2;
+ var_types op1Type = op1->TypeGet();
+ var_types op2Type = op2->TypeGet();
+ regNumber targetReg = tree->GetRegNum();
+ emitter* emit = GetEmitter();
+ bool canReuseFlags = false;
genConsumeOperands(tree);
@@ -5947,6 +5949,11 @@ void CodeGen::genCompareInt(GenTree* treeNode)
}
else if (op1->isUsedFromReg() && op2->IsIntegralConst(0))
{
+ if (compiler->opts.OptimizationEnabled())
+ {
+ canReuseFlags = true;
+ }
+
// We're comparing a register to 0 so we can generate "test reg1, reg1"
// instead of the longer "cmp reg1, 0"
ins = INS_test;
@@ -5997,7 +6004,15 @@ void CodeGen::genCompareInt(GenTree* treeNode)
// TYP_UINT and TYP_ULONG should not appear here, only small types can be unsigned
assert(!varTypeIsUnsigned(type) || varTypeIsSmall(type));
- GetEmitter()->emitInsBinary(ins, emitTypeSize(type), op1, op2);
+ bool needsOCFlags = !tree->OperIs(GT_EQ, GT_NE);
+ if (canReuseFlags && emit->AreFlagsSetToZeroCmp(op1->GetRegNum(), emitTypeSize(type), needsOCFlags))
+ {
+ JITDUMP("Not emitting compare due to flags being already set\n");
+ }
+ else
+ {
+ emit->emitInsBinary(ins, emitTypeSize(type), op1, op2);
+ }
// Are we evaluating this into a register?
if (targetReg != REG_NA)
@@ -7065,9 +7080,9 @@ void CodeGen::genIntrinsic(GenTree* treeNode)
//
void CodeGen::genBitCast(var_types targetType, regNumber targetReg, var_types srcType, regNumber srcReg)
{
- const bool srcFltReg = varTypeIsFloating(srcType) || varTypeIsSIMD(srcType);
+ const bool srcFltReg = varTypeUsesFloatReg(srcType) || varTypeIsSIMD(srcType);
assert(srcFltReg == genIsValidFloatReg(srcReg));
- const bool dstFltReg = varTypeIsFloating(targetType) || varTypeIsSIMD(targetType);
+ const bool dstFltReg = varTypeUsesFloatReg(targetType) || varTypeIsSIMD(targetType);
assert(dstFltReg == genIsValidFloatReg(targetReg));
if (srcFltReg != dstFltReg)
{
@@ -7818,7 +7833,7 @@ void CodeGen::genStoreRegToStackArg(var_types type, regNumber srcReg, int offset
else
#endif // TARGET_X86
{
- assert((varTypeIsFloating(type) && genIsValidFloatReg(srcReg)) ||
+ assert((varTypeUsesFloatReg(type) && genIsValidFloatReg(srcReg)) ||
(varTypeIsIntegralOrI(type) && genIsValidIntReg(srcReg)));
ins = ins_Store(type);
}
diff --git a/src/coreclr/src/jit/compiler.cpp b/src/coreclr/src/jit/compiler.cpp
index a6e4ee76f9b9..c78ee4477e0d 100644
--- a/src/coreclr/src/jit/compiler.cpp
+++ b/src/coreclr/src/jit/compiler.cpp
@@ -4841,6 +4841,9 @@ void Compiler::compCompile(void** methodCodePtr, ULONG* methodCodeSize, JitFlags
compQuirkForPPPflag = compQuirkForPPP();
#endif
+ // Insert GC Polls
+ DoPhase(this, PHASE_INSERT_GC_POLLS, &Compiler::fgInsertGCPolls);
+
// Determine start of cold region if we are hot/cold splitting
//
DoPhase(this, PHASE_DETERMINE_FIRST_COLD_BLOCK, &Compiler::fgDetermineFirstColdBlock);
diff --git a/src/coreclr/src/jit/compiler.h b/src/coreclr/src/jit/compiler.h
index 6e5f95482511..c5f571838d4b 100644
--- a/src/coreclr/src/jit/compiler.h
+++ b/src/coreclr/src/jit/compiler.h
@@ -764,7 +764,7 @@ class LclVarDsc
regMaskTP lvRegMask() const
{
regMaskTP regMask = RBM_NONE;
- if (varTypeIsFloating(TypeGet()))
+ if (varTypeUsesFloatReg(TypeGet()))
{
if (GetRegNum() != REG_STK)
{
@@ -900,7 +900,7 @@ class LclVarDsc
bool propagate = true);
bool IsFloatRegType() const
{
- return isFloatRegType(lvType) || lvIsHfaRegArg();
+ return varTypeUsesFloatReg(lvType) || lvIsHfaRegArg();
}
var_types GetHfaType() const
@@ -3239,6 +3239,7 @@ class Compiler
#endif // TARGET_ARM
void lvaAssignFrameOffsets(FrameLayoutState curState);
void lvaFixVirtualFrameOffsets();
+ void lvaUpdateArgWithInitialReg(LclVarDsc* varDsc);
void lvaUpdateArgsWithInitialReg();
void lvaAssignVirtualFrameOffsetsToArgs();
#ifdef UNIX_AMD64_ABI
@@ -3468,6 +3469,10 @@ class Compiler
bool CanPromoteStructType(CORINFO_CLASS_HANDLE typeHnd);
bool TryPromoteStructVar(unsigned lclNum);
+ void Clear()
+ {
+ structPromotionInfo.typeHnd = NO_CLASS_HANDLE;
+ }
#ifdef DEBUG
void CheckRetypedAsScalar(CORINFO_FIELD_HANDLE fieldHnd, var_types requestedType);
@@ -4989,10 +4994,11 @@ class Compiler
void fgInitBlockVarSets();
// true if we've gone through and created GC Poll calls.
- bool fgGCPollsCreated;
- void fgMarkGCPollBlocks();
- void fgCreateGCPolls();
- bool fgCreateGCPoll(GCPollType pollType, BasicBlock* block, Statement* stmt = nullptr);
+ bool fgGCPollsCreated;
+ void fgMarkGCPollBlocks();
+ void fgCreateGCPolls();
+ PhaseStatus fgInsertGCPolls();
+ BasicBlock* fgCreateGCPoll(GCPollType pollType, BasicBlock* block);
// Requires that "block" is a block that returns from
// a finally. Returns the number of successors (jump targets of
@@ -5616,6 +5622,8 @@ class Compiler
GenTree* fgMorphToEmulatedFP(GenTree* tree);
GenTree* fgMorphConst(GenTree* tree);
+ GenTreeLclVar* fgMorphTryFoldObjAsLclVar(GenTreeObj* obj);
+
public:
GenTree* fgMorphTree(GenTree* tree, MorphAddrContext* mac = nullptr);
@@ -6517,6 +6525,7 @@ class Compiler
#define OMF_HAS_GUARDEDDEVIRT 0x00000080 // Method contains guarded devirtualization candidate
#define OMF_HAS_EXPRUNTIMELOOKUP 0x00000100 // Method contains a runtime lookup to an expandable dictionary.
#define OMF_HAS_PATCHPOINT 0x00000200 // Method contains patchpoints
+#define OMF_NEEDS_GCPOLLS 0x00000400 // Method needs GC polls
bool doesMethodHaveFatPointer()
{
@@ -7609,7 +7618,7 @@ class Compiler
// If "tree" is a indirection (GT_IND, or GT_OBJ) whose arg is an ADDR, whose arg is a LCL_VAR, return that LCL_VAR
// node, else NULL.
- static GenTree* fgIsIndirOfAddrOfLocal(GenTree* tree);
+ static GenTreeLclVar* fgIsIndirOfAddrOfLocal(GenTree* tree);
// This map is indexed by GT_OBJ nodes that are address of promoted struct variables, which
// have been annotated with the GTF_VAR_DEATH flag. If such a node is *not* mapped in this
diff --git a/src/coreclr/src/jit/compphases.h b/src/coreclr/src/jit/compphases.h
index 79370e83c6a0..0fe78151c173 100644
--- a/src/coreclr/src/jit/compphases.h
+++ b/src/coreclr/src/jit/compphases.h
@@ -86,6 +86,7 @@ CompPhaseNameMacro(PHASE_ASSERTION_PROP_MAIN, "Assertion prop",
#endif
CompPhaseNameMacro(PHASE_OPT_UPDATE_FLOW_GRAPH, "Update flow graph opt pass", "UPD-FG-O", false, -1, false)
CompPhaseNameMacro(PHASE_COMPUTE_EDGE_WEIGHTS2, "Compute edge weights (2, false)", "EDG-WGT2", false, -1, false)
+CompPhaseNameMacro(PHASE_INSERT_GC_POLLS, "Insert GC Polls", "GC-POLLS", false, -1, true)
CompPhaseNameMacro(PHASE_DETERMINE_FIRST_COLD_BLOCK, "Determine first cold block", "COLD-BLK", false, -1, true)
CompPhaseNameMacro(PHASE_RATIONALIZE, "Rationalize IR", "RAT", false, -1, false)
CompPhaseNameMacro(PHASE_SIMPLE_LOWERING, "Do 'simple' lowering", "SMP-LWR", false, -1, false)
diff --git a/src/coreclr/src/jit/emitxarch.cpp b/src/coreclr/src/jit/emitxarch.cpp
index 1321067fef64..81f9ce8ef681 100644
--- a/src/coreclr/src/jit/emitxarch.cpp
+++ b/src/coreclr/src/jit/emitxarch.cpp
@@ -213,6 +213,93 @@ bool emitter::AreUpper32BitsZero(regNumber reg)
return false;
}
+//------------------------------------------------------------------------
+// AreFlagsSetToZeroCmp: Checks if the previous instruction set the SZ, and optionally OC, flags to
+// the same values as if there were a compare to 0
+//
+// Arguments:
+// reg - register of interest
+// opSize - size of register
+// needsOCFlags - additionally check the overflow and carry flags
+//
+// Return Value:
+// true if the previous instruction set the flags for reg
+// false if not, or if we can't safely determine
+//
+// Notes:
+// Currently only looks back one instruction.
+bool emitter::AreFlagsSetToZeroCmp(regNumber reg, emitAttr opSize, bool needsOCFlags)
+{
+ assert(reg != REG_NA);
+ // Don't look back across IG boundaries (possible control flow)
+ if (emitCurIGinsCnt == 0 && ((emitCurIG->igFlags & IGF_EXTEND) == 0))
+ {
+ return false;
+ }
+
+ instrDesc* id = emitLastIns;
+ insFormat fmt = id->idInsFmt();
+
+ // make sure op1 is a reg
+ switch (fmt)
+ {
+ case IF_RWR_CNS:
+ case IF_RRW_CNS:
+ case IF_RRW_SHF:
+ case IF_RWR_RRD:
+ case IF_RRW_RRD:
+ case IF_RWR_MRD:
+ case IF_RWR_SRD:
+ case IF_RRW_SRD:
+ case IF_RWR_ARD:
+ case IF_RRW_ARD:
+ case IF_RWR:
+ case IF_RRD:
+ case IF_RRW:
+ break;
+
+ default:
+ return false;
+ }
+
+ if (id->idReg1() != reg)
+ {
+ return false;
+ }
+
+ switch (id->idIns())
+ {
+ case INS_adc:
+ case INS_add:
+ case INS_dec:
+ case INS_dec_l:
+ case INS_inc:
+ case INS_inc_l:
+ case INS_neg:
+ case INS_shr_1:
+ case INS_shl_1:
+ case INS_sar_1:
+ case INS_sbb:
+ case INS_sub:
+ case INS_xadd:
+ if (needsOCFlags)
+ {
+ return false;
+ }
+ __fallthrough;
+ // these always set OC to 0
+ case INS_and:
+ case INS_or:
+ case INS_xor:
+ return id->idOpSize() == opSize;
+
+ default:
+ break;
+ }
+
+ return false;
+}
+
//------------------------------------------------------------------------
// IsDstSrcImmAvxInstruction: Checks if the instruction has a "reg, reg/mem, imm" or
// "reg/mem, reg, imm" form for the legacy, VEX, and EVEX
diff --git a/src/coreclr/src/jit/emitxarch.h b/src/coreclr/src/jit/emitxarch.h
index fff3fd017ee7..f7c0f5c65af4 100644
--- a/src/coreclr/src/jit/emitxarch.h
+++ b/src/coreclr/src/jit/emitxarch.h
@@ -96,6 +96,8 @@ bool Is4ByteSSEInstruction(instruction ins);
bool AreUpper32BitsZero(regNumber reg);
+bool AreFlagsSetToZeroCmp(regNumber reg, emitAttr opSize, bool needsOCFlags);
+
bool hasRexPrefix(code_t code)
{
#ifdef TARGET_AMD64
diff --git a/src/coreclr/src/jit/flowgraph.cpp b/src/coreclr/src/jit/flowgraph.cpp
index b7582eb2a6f9..e870a8f4c0fe 100644
--- a/src/coreclr/src/jit/flowgraph.cpp
+++ b/src/coreclr/src/jit/flowgraph.cpp
@@ -3557,10 +3557,177 @@ void Compiler::fgInitBlockVarSets()
fgBBVarSetsInited = true;
}
+//------------------------------------------------------------------------------
+// fgInsertGCPolls : Insert GC polls for basic blocks containing calls to methods
+// with SuppressGCTransitionAttribute.
+//
+// Notes:
+// When not optimizing, the method relies on BBF_HAS_SUPPRESSGC_CALL flag to
+// find the basic blocks that require GC polls; when optimizing the tree nodes
+// are scanned to find calls to methods with SuppressGCTransitionAttribute.
+//
+// Returns:
+// PhaseStatus indicating what, if anything, was changed.
+//
+
+PhaseStatus Compiler::fgInsertGCPolls()
+{
+ PhaseStatus result = PhaseStatus::MODIFIED_NOTHING;
+
+ if ((optMethodFlags & OMF_NEEDS_GCPOLLS) == 0)
+ {
+ return result;
+ }
+
+ bool createdPollBlocks = false;
+
+#ifdef DEBUG
+ if (verbose)
+ {
+ printf("*************** In fgInsertGCPolls() for %s\n", info.compFullName);
+ fgDispBasicBlocks(false);
+ printf("\n");
+ }
+#endif // DEBUG
+
+ BasicBlock* block;
+
+ // Walk through the blocks and hunt for a block that has needs a GC Poll
+ for (block = fgFirstBB; block; block = block->bbNext)
+ {
+ bool blockNeedsGCPoll = false;
+ if (opts.OptimizationDisabled())
+ {
+ if ((block->bbFlags & BBF_HAS_SUPPRESSGC_CALL) != 0)
+ {
+ blockNeedsGCPoll = true;
+ }
+ }
+ else
+ {
+ // When optimizations are enabled, we can't rely on BBF_HAS_SUPPRESSGC_CALL flag:
+ // the call could've been moved, e.g., hoisted from a loop, CSE'd, etc.
+ for (Statement* stmt = block->FirstNonPhiDef(); !blockNeedsGCPoll && (stmt != nullptr);
+ stmt = stmt->GetNextStmt())
+ {
+ if ((stmt->GetRootNode()->gtFlags & GTF_CALL) != 0)
+ {
+ for (GenTree* tree = stmt->GetTreeList(); !blockNeedsGCPoll && (tree != nullptr);
+ tree = tree->gtNext)
+ {
+ if (tree->OperGet() == GT_CALL)
+ {
+ GenTreeCall* call = tree->AsCall();
+ if (call->IsUnmanaged() && call->IsSuppressGCTransition())
+ {
+ blockNeedsGCPoll = true;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (!blockNeedsGCPoll)
+ {
+ continue;
+ }
+
+ result = PhaseStatus::MODIFIED_EVERYTHING;
+
+ // This block needs a GC poll. We either just insert a callout or we split the block and inline part of
+ // the test.
+
+ // If we're doing GCPOLL_CALL, just insert a GT_CALL node before the last node in the block.
+ CLANG_FORMAT_COMMENT_ANCHOR;
+
+#ifdef DEBUG
+ switch (block->bbJumpKind)
+ {
+ case BBJ_RETURN:
+ case BBJ_ALWAYS:
+ case BBJ_COND:
+ case BBJ_SWITCH:
+ case BBJ_NONE:
+ case BBJ_THROW:
+ break;
+ default:
+ assert(!"Unexpected block kind");
+ }
+#endif // DEBUG
+
+ GCPollType pollType = GCPOLL_INLINE;
+
+ // We'd like to inset an inline poll. Below is the list of places where we
+ // can't or don't want to emit an inline poll. Check all of those. If after all of that we still
+ // have INLINE, then emit an inline check.
+
+ if (opts.OptimizationDisabled())
+ {
+#ifdef DEBUG
+ if (verbose)
+ {
+ printf("Selecting CALL poll in block " FMT_BB " because of debug/minopts\n", block->bbNum);
+ }
+#endif // DEBUG
+
+ // Don't split blocks and create inlined polls unless we're optimizing.
+ pollType = GCPOLL_CALL;
+ }
+ else if (genReturnBB == block)
+ {
+#ifdef DEBUG
+ if (verbose)
+ {
+ printf("Selecting CALL poll in block " FMT_BB " because it is the single return block\n", block->bbNum);
+ }
+#endif // DEBUG
+
+ // we don't want to split the single return block
+ pollType = GCPOLL_CALL;
+ }
+ else if (BBJ_SWITCH == block->bbJumpKind)
+ {
+#ifdef DEBUG
+ if (verbose)
+ {
+ printf("Selecting CALL poll in block " FMT_BB " because it is a SWITCH block\n", block->bbNum);
+ }
+#endif // DEBUG
+
+ // We don't want to deal with all the outgoing edges of a switch block.
+ pollType = GCPOLL_CALL;
+ }
+
+ BasicBlock* curBasicBlock = fgCreateGCPoll(pollType, block);
+ createdPollBlocks |= (block != curBasicBlock);
+ block = curBasicBlock;
+ }
+
+ // If we split a block to create a GC Poll, then rerun fgReorderBlocks to push the rarely run blocks out
+ // past the epilog. We should never split blocks unless we're optimizing.
+ if (createdPollBlocks)
+ {
+ noway_assert(opts.OptimizationEnabled());
+ fgReorderBlocks();
+ fgUpdateChangedFlowGraph();
+ }
+#ifdef DEBUG
+ if (verbose)
+ {
+ printf("*************** After fgInsertGCPolls()\n");
+ fgDispBasicBlocks(true);
+ }
+#endif // DEBUG
+
+ return result;
+}
+
/*****************************************************************************
*
* The following does the final pass on BBF_NEEDS_GCPOLL and then actually creates the GC Polls.
*/
+
void Compiler::fgCreateGCPolls()
{
if (GCPOLL_NONE == opts.compGCPollType)
@@ -3832,7 +3999,8 @@ void Compiler::fgCreateGCPolls()
// TODO-Cleanup: potentially don't split if we're in an EH region.
- createdPollBlocks |= fgCreateGCPoll(pollType, block);
+ BasicBlock* curBasicBlock = fgCreateGCPoll(pollType, block);
+ createdPollBlocks |= (block != curBasicBlock);
}
// If we split a block to create a GC Poll, then rerun fgReorderBlocks to push the rarely run blocks out
@@ -3852,13 +4020,18 @@ void Compiler::fgCreateGCPolls()
#endif // DEBUG
}
-/*****************************************************************************
- *
- * Actually create a GCPoll in the given block. Returns true if it created
- * a basic block.
- */
+//------------------------------------------------------------------------------
+// fgCreateGCPoll : Insert a GC poll of the specified type for the given basic block.
+//
+// Arguments:
+// pollType - The type of GC poll to insert
+// block - Basic block to insert the poll for
+//
+// Return Value:
+// If new basic blocks are inserted, the last inserted block; otherwise, the input block.
+//
-bool Compiler::fgCreateGCPoll(GCPollType pollType, BasicBlock* block, Statement* stmt)
+BasicBlock* Compiler::fgCreateGCPoll(GCPollType pollType, BasicBlock* block)
{
bool createdPollBlocks;
@@ -3873,51 +4046,26 @@ bool Compiler::fgCreateGCPoll(GCPollType pollType, BasicBlock* block, Statement*
pollType = GCPOLL_CALL;
}
-#ifdef DEBUG
- // If a statment was supplied it should be contained in the block.
- if (stmt != nullptr)
- {
- bool containsStmt = false;
- for (Statement* stmtMaybe : block->Statements())
- {
- containsStmt = (stmtMaybe == stmt);
- if (containsStmt)
- {
- break;
- }
- }
-
- assert(containsStmt);
- }
-#endif
// Create the GC_CALL node
GenTree* call = gtNewHelperCallNode(CORINFO_HELP_POLL_GC, TYP_VOID);
call = fgMorphCall(call->AsCall());
gtSetEvalOrder(call);
+ BasicBlock* bottom = nullptr;
+
if (pollType == GCPOLL_CALL)
{
createdPollBlocks = false;
- if (stmt != nullptr)
- {
- // The GC_POLL should be inserted relative to the supplied statement. The safer
- // location for the insertion is prior to the current statement since the supplied
- // statement could be a GT_JTRUE (see fgNewStmtNearEnd() for more details).
- Statement* newStmt = gtNewStmt(call);
-
- // Set the GC_POLL statement to have the same IL offset at the subsequent one.
- newStmt->SetILOffsetX(stmt->GetILOffsetX());
- fgInsertStmtBefore(block, stmt, newStmt);
- }
- else if (block->bbJumpKind == BBJ_ALWAYS)
+ Statement* newStmt = nullptr;
+ if (block->bbJumpKind == BBJ_ALWAYS)
{
// for BBJ_ALWAYS I don't need to insert it before the condition. Just append it.
- fgNewStmtAtEnd(block, call);
+ newStmt = fgNewStmtAtEnd(block, call);
}
else
{
- Statement* newStmt = fgNewStmtNearEnd(block, call);
+ newStmt = fgNewStmtNearEnd(block, call);
// For DDB156656, we need to associate the GC Poll with the IL offset (and therefore sequence
// point) of the tree before which we inserted the poll. One example of when this is a
// problem:
@@ -3945,6 +4093,12 @@ bool Compiler::fgCreateGCPoll(GCPollType pollType, BasicBlock* block, Statement*
}
}
+ if (fgStmtListThreaded)
+ {
+ gtSetStmtInfo(newStmt);
+ fgSetStmtSeq(newStmt);
+ }
+
block->bbFlags |= BBF_GC_SAFE_POINT;
#ifdef DEBUG
if (verbose)
@@ -3974,8 +4128,8 @@ bool Compiler::fgCreateGCPoll(GCPollType pollType, BasicBlock* block, Statement*
lpIndexFallThrough = topFallThrough->bbNatLoopNum;
}
- BasicBlock* poll = fgNewBBafter(BBJ_NONE, top, true);
- BasicBlock* bottom = fgNewBBafter(top->bbJumpKind, poll, true);
+ BasicBlock* poll = fgNewBBafter(BBJ_NONE, top, true);
+ bottom = fgNewBBafter(top->bbJumpKind, poll, true);
BBjumpKinds oldJumpKind = top->bbJumpKind;
unsigned char lpIndex = top->bbNatLoopNum;
@@ -4010,12 +4164,16 @@ bool Compiler::fgCreateGCPoll(GCPollType pollType, BasicBlock* block, Statement*
}
// Add the GC_CALL node to Poll.
- fgNewStmtAtEnd(poll, call);
+ Statement* pollStmt = fgNewStmtAtEnd(poll, call);
+ if (fgStmtListThreaded)
+ {
+ gtSetStmtInfo(pollStmt);
+ fgSetStmtSeq(pollStmt);
+ }
- // Remove the last statement from Top and add it to Bottom.
- if (oldJumpKind != BBJ_ALWAYS)
+ // Remove the last statement from Top and add it to Bottom if necessary.
+ if ((oldJumpKind == BBJ_COND) || (oldJumpKind == BBJ_RETURN) || (oldJumpKind == BBJ_THROW))
{
- // if I'm always jumping to the target, then this is not a condition that needs moving.
Statement* stmt = top->firstStmt();
while (stmt->GetNextStmt() != nullptr)
{
@@ -4063,7 +4221,12 @@ bool Compiler::fgCreateGCPoll(GCPollType pollType, BasicBlock* block, Statement*
trapRelop->gtFlags |= GTF_RELOP_JMP_USED | GTF_DONT_CSE;
GenTree* trapCheck = gtNewOperNode(GT_JTRUE, TYP_VOID, trapRelop);
gtSetEvalOrder(trapCheck);
- fgNewStmtAtEnd(top, trapCheck);
+ Statement* trapCheckStmt = fgNewStmtAtEnd(top, trapCheck);
+ if (fgStmtListThreaded)
+ {
+ gtSetStmtInfo(trapCheckStmt);
+ fgSetStmtSeq(trapCheckStmt);
+ }
#ifdef DEBUG
if (verbose)
@@ -4087,10 +4250,10 @@ bool Compiler::fgCreateGCPoll(GCPollType pollType, BasicBlock* block, Statement*
switch (oldJumpKind)
{
case BBJ_NONE:
- // nothing to update. This can happen when inserting a GC Poll
- // when suppressing a GC transition during an unmanaged call.
+ fgReplacePred(bottom->bbNext, top, bottom);
break;
case BBJ_RETURN:
+ case BBJ_THROW:
// no successors
break;
case BBJ_COND:
@@ -4136,7 +4299,7 @@ bool Compiler::fgCreateGCPoll(GCPollType pollType, BasicBlock* block, Statement*
#endif // DEBUG
}
- return createdPollBlocks;
+ return createdPollBlocks ? bottom : block;
}
/*****************************************************************************
@@ -7136,13 +7299,15 @@ bool Compiler::fgIsCommaThrow(GenTree* tree, bool forFolding /* = false */)
// tree - The tree node under consideration
//
// Return Value:
-// If "tree" is a indirection (GT_IND, GT_BLK, or GT_OBJ) whose arg is an ADDR,
-// whose arg in turn is a LCL_VAR, return that LCL_VAR node, else nullptr.
+// If "tree" is a indirection (GT_IND, GT_BLK, or GT_OBJ) whose arg is:
+// - an ADDR, whose arg in turn is a LCL_VAR, return that LCL_VAR node;
+// - a LCL_VAR_ADDR, return that LCL_VAR_ADDR;
+// - else nullptr.
//
// static
-GenTree* Compiler::fgIsIndirOfAddrOfLocal(GenTree* tree)
+GenTreeLclVar* Compiler::fgIsIndirOfAddrOfLocal(GenTree* tree)
{
- GenTree* res = nullptr;
+ GenTreeLclVar* res = nullptr;
if (tree->OperIsIndir())
{
GenTree* addr = tree->AsIndir()->Addr();
@@ -7175,12 +7340,12 @@ GenTree* Compiler::fgIsIndirOfAddrOfLocal(GenTree* tree)
GenTree* lclvar = addr->AsOp()->gtOp1;
if (lclvar->OperGet() == GT_LCL_VAR)
{
- res = lclvar;
+ res = lclvar->AsLclVar();
}
}
else if (addr->OperGet() == GT_LCL_VAR_ADDR)
{
- res = addr;
+ res = addr->AsLclVar();
}
}
return res;
@@ -7295,7 +7460,7 @@ GenTreeCall* Compiler::fgGetStaticsCCtorHelper(CORINFO_CLASS_HANDLE cls, CorInfo
NamedIntrinsic ni = lookupNamedIntrinsic(info.compMethodHnd);
if (ni == NI_System_Collections_Generic_EqualityComparer_get_Default)
{
- JITDUMP("\nmarking helper call [06%u] as special dce...\n", result->gtTreeID);
+ JITDUMP("\nmarking helper call [%06u] as special dce...\n", result->gtTreeID);
result->gtCallMoreFlags |= GTF_CALL_M_HELPER_SPECIAL_DCE;
}
}
@@ -15176,6 +15341,12 @@ bool Compiler::fgOptimizeBranch(BasicBlock* bJump)
return false;
}
+ if (fgStmtListThreaded)
+ {
+ gtSetStmtInfo(stmt);
+ fgSetStmtSeq(stmt);
+ }
+
/* Append the expression to our list */
if (newStmtList != nullptr)
@@ -21223,7 +21394,8 @@ void Compiler::fgDebugCheckBBlist(bool checkBBNum /* = false */, bool checkBBRef
assert(block->lastNode()->gtNext == nullptr &&
(block->lastNode()->gtOper == GT_SWITCH || block->lastNode()->gtOper == GT_SWITCH_TABLE));
}
- else if (!(block->bbJumpKind == BBJ_ALWAYS || block->bbJumpKind == BBJ_RETURN))
+ else if (!(block->bbJumpKind == BBJ_ALWAYS || block->bbJumpKind == BBJ_RETURN ||
+ block->bbJumpKind == BBJ_NONE || block->bbJumpKind == BBJ_THROW))
{
// this block cannot have a poll
assert(!(block->bbFlags & BBF_NEEDS_GCPOLL));
diff --git a/src/coreclr/src/jit/gentree.cpp b/src/coreclr/src/jit/gentree.cpp
index 98bea0eabc9c..8ca9a49a2ce7 100644
--- a/src/coreclr/src/jit/gentree.cpp
+++ b/src/coreclr/src/jit/gentree.cpp
@@ -2782,7 +2782,7 @@ bool Compiler::gtIsLikelyRegVar(GenTree* tree)
}
#ifdef TARGET_X86
- if (varTypeIsFloating(tree->TypeGet()))
+ if (varTypeUsesFloatReg(tree->TypeGet()))
return false;
if (varTypeIsLong(tree->TypeGet()))
return false;
@@ -11089,7 +11089,7 @@ void Compiler::gtDispLeaf(GenTree* tree, IndentStack* indentStack)
break;
case GT_PHYSREG:
- printf(" %s", getRegName(tree->AsPhysReg()->gtSrcReg, varTypeIsFloating(tree)));
+ printf(" %s", getRegName(tree->AsPhysReg()->gtSrcReg, varTypeUsesFloatReg(tree)));
break;
case GT_IL_OFFSET:
@@ -15348,7 +15348,7 @@ GenTree* Compiler::gtNewTempAssign(
// see "Zero init inlinee locals:" in fgInlinePrependStatements
// thus we may need to set compFloatingPointUsed to true here.
//
- if (varTypeIsFloating(dstTyp) && (compFloatingPointUsed == false))
+ if (varTypeUsesFloatReg(dstTyp) && (compFloatingPointUsed == false))
{
compFloatingPointUsed = true;
}
@@ -19165,7 +19165,7 @@ regNumber ReturnTypeDesc::GetABIReturnReg(unsigned idx) const
}
else
{
- noway_assert(varTypeIsFloating(regType0));
+ noway_assert(varTypeUsesFloatReg(regType0));
resultReg = REG_FLOATRET;
}
}
@@ -19186,9 +19186,9 @@ regNumber ReturnTypeDesc::GetABIReturnReg(unsigned idx) const
}
else
{
- noway_assert(varTypeIsFloating(regType1));
+ noway_assert(varTypeUsesFloatReg(regType1));
- if (varTypeIsFloating(regType0))
+ if (varTypeUsesFloatReg(regType0))
{
resultReg = REG_FLOATRET_1;
}
diff --git a/src/coreclr/src/jit/gentree.h b/src/coreclr/src/jit/gentree.h
index 4f61fa7ef75b..5e51988d7668 100644
--- a/src/coreclr/src/jit/gentree.h
+++ b/src/coreclr/src/jit/gentree.h
@@ -7493,7 +7493,7 @@ inline bool GenTree::HasLastUse()
//
inline void GenTree::SetLastUse(int regIndex)
{
- unsigned int bitToSet = gtFlags |= GetLastUseBit(regIndex);
+ gtFlags |= GetLastUseBit(regIndex);
}
//-----------------------------------------------------------------------------------
diff --git a/src/coreclr/src/jit/hwintrinsic.cpp b/src/coreclr/src/jit/hwintrinsic.cpp
index 14a9b8628ffc..5e7eda61c30d 100644
--- a/src/coreclr/src/jit/hwintrinsic.cpp
+++ b/src/coreclr/src/jit/hwintrinsic.cpp
@@ -914,6 +914,14 @@ GenTree* Compiler::impHWIntrinsic(NamedIntrinsic intrinsic,
{
assert(numArgs == 4);
indexedElementBaseType = getBaseTypeAndSizeOfSIMDType(sigReader.op3ClsHnd, &indexedElementSimdSize);
+
+ if (intrinsic == NI_Dp_DotProductBySelectedQuadruplet)
+ {
+ assert(((baseType == TYP_INT) && (indexedElementBaseType == TYP_BYTE)) ||
+ ((baseType == TYP_UINT) && (indexedElementBaseType == TYP_UBYTE)));
+ // The second source operand of sdot, udot instructions is an indexed 32-bit element.
+ indexedElementBaseType = baseType;
+ }
}
assert(indexedElementBaseType == baseType);
diff --git a/src/coreclr/src/jit/hwintrinsicarm64.cpp b/src/coreclr/src/jit/hwintrinsicarm64.cpp
index f869fcd2a8c5..c572f9bf0888 100644
--- a/src/coreclr/src/jit/hwintrinsicarm64.cpp
+++ b/src/coreclr/src/jit/hwintrinsicarm64.cpp
@@ -26,10 +26,14 @@ static CORINFO_InstructionSet Arm64VersionOfIsa(CORINFO_InstructionSet isa)
return InstructionSet_ArmBase_Arm64;
case InstructionSet_Crc32:
return InstructionSet_Crc32_Arm64;
+ case InstructionSet_Dp:
+ return InstructionSet_Dp_Arm64;
case InstructionSet_Sha1:
return InstructionSet_Sha1_Arm64;
case InstructionSet_Sha256:
return InstructionSet_Sha256_Arm64;
+ case InstructionSet_Rdm:
+ return InstructionSet_Rdm_Arm64;
default:
return InstructionSet_NONE;
}
@@ -69,6 +73,20 @@ static CORINFO_InstructionSet lookupInstructionSet(const char* className)
return InstructionSet_Crc32;
}
}
+ else if (className[0] == 'D')
+ {
+ if (strcmp(className, "Dp") == 0)
+ {
+ return InstructionSet_Dp;
+ }
+ }
+ else if (className[0] == 'R')
+ {
+ if (strcmp(className, "Rdm") == 0)
+ {
+ return InstructionSet_Rdm;
+ }
+ }
else if (className[0] == 'S')
{
if (strcmp(className, "Sha1") == 0)
@@ -140,20 +158,20 @@ bool HWIntrinsicInfo::isFullyImplementedIsa(CORINFO_InstructionSet isa)
case InstructionSet_ArmBase_Arm64:
case InstructionSet_Crc32:
case InstructionSet_Crc32_Arm64:
+ case InstructionSet_Dp:
+ case InstructionSet_Dp_Arm64:
+ case InstructionSet_Rdm:
+ case InstructionSet_Rdm_Arm64:
case InstructionSet_Sha1:
case InstructionSet_Sha1_Arm64:
case InstructionSet_Sha256:
case InstructionSet_Sha256_Arm64:
case InstructionSet_Vector64:
case InstructionSet_Vector128:
- {
return true;
- }
default:
- {
return false;
- }
}
}
diff --git a/src/coreclr/src/jit/hwintrinsiccodegenarm64.cpp b/src/coreclr/src/jit/hwintrinsiccodegenarm64.cpp
index a6b3bf943388..162fd4588915 100644
--- a/src/coreclr/src/jit/hwintrinsiccodegenarm64.cpp
+++ b/src/coreclr/src/jit/hwintrinsiccodegenarm64.cpp
@@ -718,6 +718,16 @@ void CodeGen::genHWIntrinsic(GenTreeHWIntrinsic* node)
}
break;
+ case NI_AdvSimd_Arm64_StorePair:
+ case NI_AdvSimd_Arm64_StorePairNonTemporal:
+ GetEmitter()->emitIns_R_R_R(ins, emitSize, op2Reg, op3Reg, op1Reg);
+ break;
+
+ case NI_AdvSimd_Arm64_StorePairScalar:
+ case NI_AdvSimd_Arm64_StorePairScalarNonTemporal:
+ GetEmitter()->emitIns_R_R_R(ins, emitTypeSize(intrin.baseType), op2Reg, op3Reg, op1Reg);
+ break;
+
case NI_Vector64_CreateScalarUnsafe:
case NI_Vector128_CreateScalarUnsafe:
if (intrin.op1->isContainedFltOrDblImmed())
diff --git a/src/coreclr/src/jit/hwintrinsiclistarm64.h b/src/coreclr/src/jit/hwintrinsiclistarm64.h
index 09154b51bd2a..6de9ca2b158b 100644
--- a/src/coreclr/src/jit/hwintrinsiclistarm64.h
+++ b/src/coreclr/src/jit/hwintrinsiclistarm64.h
@@ -488,6 +488,10 @@ HARDWARE_INTRINSIC(AdvSimd_Arm64, ShiftRightArithmeticRoundedNarrowingSaturateUn
HARDWARE_INTRINSIC(AdvSimd_Arm64, ShiftRightLogicalNarrowingSaturateScalar, 8, 2, {INS_uqshrn, INS_uqshrn, INS_uqshrn, INS_uqshrn, INS_uqshrn, INS_uqshrn, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_ShiftRightByImmediate, HW_Flag_HasImmediateOperand|HW_Flag_SIMDScalar)
HARDWARE_INTRINSIC(AdvSimd_Arm64, ShiftRightLogicalRoundedNarrowingSaturateScalar, 8, 2, {INS_uqrshrn, INS_uqrshrn, INS_uqrshrn, INS_uqrshrn, INS_uqrshrn, INS_uqrshrn, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_ShiftRightByImmediate, HW_Flag_HasImmediateOperand|HW_Flag_SIMDScalar)
HARDWARE_INTRINSIC(AdvSimd_Arm64, Sqrt, -1, 1, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_fsqrt, INS_fsqrt}, HW_Category_SIMD, HW_Flag_NoFlag)
+HARDWARE_INTRINSIC(AdvSimd_Arm64, StorePair, -1, 3, {INS_stp, INS_stp, INS_stp, INS_stp, INS_stp, INS_stp, INS_stp, INS_stp, INS_stp, INS_stp}, HW_Category_MemoryStore, HW_Flag_BaseTypeFromSecondArg|HW_Flag_SpecialCodeGen)
+HARDWARE_INTRINSIC(AdvSimd_Arm64, StorePairScalar, 8, 3, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_stp, INS_stp, INS_invalid, INS_invalid, INS_stp, INS_invalid}, HW_Category_MemoryStore, HW_Flag_BaseTypeFromSecondArg|HW_Flag_SpecialCodeGen)
+HARDWARE_INTRINSIC(AdvSimd_Arm64, StorePairScalarNonTemporal, 8, 3, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_stnp, INS_stnp, INS_invalid, INS_invalid, INS_stnp, INS_invalid}, HW_Category_MemoryStore, HW_Flag_BaseTypeFromSecondArg|HW_Flag_SpecialCodeGen)
+HARDWARE_INTRINSIC(AdvSimd_Arm64, StorePairNonTemporal, -1, 3, {INS_stnp, INS_stnp, INS_stnp, INS_stnp, INS_stnp, INS_stnp, INS_stnp, INS_stnp, INS_stnp, INS_stp}, HW_Category_MemoryStore, HW_Flag_BaseTypeFromSecondArg|HW_Flag_SpecialCodeGen)
HARDWARE_INTRINSIC(AdvSimd_Arm64, Subtract, 16, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_fsub}, HW_Category_SIMD, HW_Flag_NoFlag)
HARDWARE_INTRINSIC(AdvSimd_Arm64, SubtractSaturateScalar, 8, 2, {INS_sqsub, INS_uqsub, INS_sqsub, INS_uqsub, INS_sqsub, INS_uqsub, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_SIMDScalar)
HARDWARE_INTRINSIC(AdvSimd_Arm64, TransposeEven, -1, 2, {INS_trn1, INS_trn1, INS_trn1, INS_trn1, INS_trn1, INS_trn1, INS_trn1, INS_trn1, INS_trn1, INS_trn1}, HW_Category_SIMD, HW_Flag_NoFlag)
@@ -544,6 +548,34 @@ HARDWARE_INTRINSIC(Crc32, ComputeCrc32C,
HARDWARE_INTRINSIC(Crc32_Arm64, ComputeCrc32, 0, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_crc32x, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_BaseTypeFromSecondArg|HW_Flag_NoFloatingPointUsed|HW_Flag_SpecialCodeGen)
HARDWARE_INTRINSIC(Crc32_Arm64, ComputeCrc32C, 0, 2, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_crc32cx, INS_invalid, INS_invalid}, HW_Category_Scalar, HW_Flag_BaseTypeFromSecondArg|HW_Flag_NoFloatingPointUsed|HW_Flag_SpecialCodeGen)
+// ***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
+// ISA Function name SIMD size Number of arguments Instructions Category Flags
+// {TYP_BYTE, TYP_UBYTE, TYP_SHORT, TYP_USHORT, TYP_INT, TYP_UINT, TYP_LONG, TYP_ULONG, TYP_FLOAT, TYP_DOUBLE}
+// ***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
+// DP Intrinsics
+HARDWARE_INTRINSIC(Dp, DotProduct, -1, 3, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sdot, INS_udot, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_HasRMWSemantics)
+HARDWARE_INTRINSIC(Dp, DotProductBySelectedQuadruplet, -1, 4, {INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_sdot, INS_udot, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMDByIndexedElement, HW_Flag_HasImmediateOperand|HW_Flag_HasRMWSemantics)
+
+// ***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
+// ISA Function name SIMD size Number of arguments Instructions Category Flags
+// {TYP_BYTE, TYP_UBYTE, TYP_SHORT, TYP_USHORT, TYP_INT, TYP_UINT, TYP_LONG, TYP_ULONG, TYP_FLOAT, TYP_DOUBLE}
+// ***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
+// RDM Intrinsics
+HARDWARE_INTRINSIC(Rdm, MultiplyRoundedDoublingAndAddSaturateHigh, -1, 3, {INS_invalid, INS_invalid, INS_sqrdmlah, INS_invalid, INS_sqrdmlah, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_HasRMWSemantics)
+HARDWARE_INTRINSIC(Rdm, MultiplyRoundedDoublingAndSubtractSaturateHigh, -1, 3, {INS_invalid, INS_invalid, INS_sqrdmlsh, INS_invalid, INS_sqrdmlsh, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_HasRMWSemantics)
+HARDWARE_INTRINSIC(Rdm, MultiplyRoundedDoublingBySelectedScalarAndAddSaturateHigh, -1, 4, {INS_invalid, INS_invalid, INS_sqrdmlah, INS_invalid, INS_sqrdmlah, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMDByIndexedElement, HW_Flag_HasImmediateOperand|HW_Flag_HasRMWSemantics)
+HARDWARE_INTRINSIC(Rdm, MultiplyRoundedDoublingBySelectedScalarAndSubtractSaturateHigh, -1, 4, {INS_invalid, INS_invalid, INS_sqrdmlsh, INS_invalid, INS_sqrdmlsh, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMDByIndexedElement, HW_Flag_HasImmediateOperand|HW_Flag_HasRMWSemantics)
+
+// ***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
+// ISA Function name SIMD size Number of arguments Instructions Category Flags
+// {TYP_BYTE, TYP_UBYTE, TYP_SHORT, TYP_USHORT, TYP_INT, TYP_UINT, TYP_LONG, TYP_ULONG, TYP_FLOAT, TYP_DOUBLE}
+// ***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
+// RDM 64-bit only Intrinsics
+HARDWARE_INTRINSIC(Rdm_Arm64, MultiplyRoundedDoublingAndAddSaturateHighScalar, 8, 3, {INS_invalid, INS_invalid, INS_sqrdmlah, INS_invalid, INS_sqrdmlah, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_HasRMWSemantics|HW_Flag_SIMDScalar)
+HARDWARE_INTRINSIC(Rdm_Arm64, MultiplyRoundedDoublingAndSubtractSaturateHighScalar, 8, 3, {INS_invalid, INS_invalid, INS_sqrdmlsh, INS_invalid, INS_sqrdmlsh, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMD, HW_Flag_HasRMWSemantics|HW_Flag_SIMDScalar)
+HARDWARE_INTRINSIC(Rdm_Arm64, MultiplyRoundedDoublingScalarBySelectedScalarAndAddSaturateHigh, 8, 4, {INS_invalid, INS_invalid, INS_sqrdmlah, INS_invalid, INS_sqrdmlah, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMDByIndexedElement, HW_Flag_HasImmediateOperand|HW_Flag_HasRMWSemantics|HW_Flag_SIMDScalar)
+HARDWARE_INTRINSIC(Rdm_Arm64, MultiplyRoundedDoublingScalarBySelectedScalarAndSubtractSaturateHigh, 8, 4, {INS_invalid, INS_invalid, INS_sqrdmlsh, INS_invalid, INS_sqrdmlsh, INS_invalid, INS_invalid, INS_invalid, INS_invalid, INS_invalid}, HW_Category_SIMDByIndexedElement, HW_Flag_HasImmediateOperand|HW_Flag_HasRMWSemantics|HW_Flag_SIMDScalar)
+
// ***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
// ISA Function name SIMD size Number of arguments Instructions Category Flags
// {TYP_BYTE, TYP_UBYTE, TYP_SHORT, TYP_USHORT, TYP_INT, TYP_UINT, TYP_LONG, TYP_ULONG, TYP_FLOAT, TYP_DOUBLE}
diff --git a/src/coreclr/src/jit/importer.cpp b/src/coreclr/src/jit/importer.cpp
index 10b760702ccc..e3efd08dbe30 100644
--- a/src/coreclr/src/jit/importer.cpp
+++ b/src/coreclr/src/jit/importer.cpp
@@ -893,8 +893,10 @@ GenTreeCall::Use* Compiler::impPopCallArgs(unsigned count, CORINFO_SIG_INFO* sig
// ABI handling of this argument.
// Note that this can happen, for example, if we have a SIMD intrinsic that returns a SIMD type
// with a different baseType than we've seen.
+ // We also need to ensure an OBJ node if we have a FIELD node that might be transformed to LCL_FLD
+ // or a plain GT_IND.
// TODO-Cleanup: Consider whether we can eliminate all of these cases.
- if (gtGetStructHandleIfPresent(temp) != structType)
+ if ((gtGetStructHandleIfPresent(temp) != structType) || temp->OperIs(GT_FIELD))
{
forceNormalization = true;
}
@@ -1666,9 +1668,12 @@ GenTree* Compiler::impNormStructVal(GenTree* structVal,
break;
case GT_FIELD:
- // Wrap it in a GT_OBJ.
+ // Wrap it in a GT_OBJ, if needed.
structVal->gtType = structType;
- structVal = gtNewObjNode(structHnd, gtNewOperNode(GT_ADDR, TYP_BYREF, structVal));
+ if ((structType == TYP_STRUCT) || forceNormalization)
+ {
+ structVal = gtNewObjNode(structHnd, gtNewOperNode(GT_ADDR, TYP_BYREF, structVal));
+ }
break;
case GT_LCL_VAR:
@@ -12534,7 +12539,15 @@ void Compiler::impImportBlockCode(BasicBlock* block)
op1 = impPopStack().val;
type = op1->TypeGet();
- // brfalse and brtrue is only allowed on I4, refs, and byrefs.
+ // Per Ecma-355, brfalse and brtrue are only specified for nint, ref, and byref.
+ //
+ // We've historically been a bit more permissive, so here we allow
+ // any type that gtNewZeroConNode can handle.
+ if (!varTypeIsArithmetic(type) && !varTypeIsGC(type))
+ {
+ BADCODE("invalid type for brtrue/brfalse");
+ }
+
if (opts.OptimizationEnabled() && (block->bbJumpDest == block->bbNext))
{
block->bbJumpKind = BBJ_NONE;
@@ -12561,12 +12574,11 @@ void Compiler::impImportBlockCode(BasicBlock* block)
}
else
{
- /* We'll compare against an equally-sized integer 0 */
- /* For small types, we always compare against int */
+ // We'll compare against an equally-sized integer 0
+ // For small types, we always compare against int
op2 = gtNewZeroConNode(genActualType(op1->gtType));
- /* Create the comparison operator and try to fold it */
-
+ // Create the comparison operator and try to fold it
oper = (opcode == CEE_BRTRUE || opcode == CEE_BRTRUE_S) ? GT_NE : GT_EQ;
op1 = gtNewOperNode(oper, TYP_INT, op1, op2);
}
diff --git a/src/coreclr/src/jit/layout.cpp b/src/coreclr/src/jit/layout.cpp
index b76b4322aae4..bafe17bb0b0a 100644
--- a/src/coreclr/src/jit/layout.cpp
+++ b/src/coreclr/src/jit/layout.cpp
@@ -410,3 +410,64 @@ ClassLayout* ClassLayout::GetPPPQuirkLayout(CompAllocator alloc)
return m_pppQuirkLayout;
}
#endif // TARGET_AMD64
+
+//------------------------------------------------------------------------
+// AreCompatible: check if 2 layouts are the same for copying.
+//
+// Arguments:
+// layout1 - the first layout;
+// layout2 - the second layout.
+//
+// Return value:
+// true if compatible, false otherwise.
+//
+// Notes:
+// Layouts are called compatible if they are equal or if
+// they have the same size and the same GC slots.
+//
+// static
+bool ClassLayout::AreCompatible(const ClassLayout* layout1, const ClassLayout* layout2)
+{
+ CORINFO_CLASS_HANDLE clsHnd1 = layout1->GetClassHandle();
+ CORINFO_CLASS_HANDLE clsHnd2 = layout2->GetClassHandle();
+ assert(clsHnd1 != NO_CLASS_HANDLE);
+ assert(clsHnd2 != NO_CLASS_HANDLE);
+
+ if (clsHnd1 == clsHnd2)
+ {
+ return true;
+ }
+
+ if (layout1->GetSize() != layout2->GetSize())
+ {
+ return false;
+ }
+
+ if (layout1->HasGCPtr() != layout2->HasGCPtr())
+ {
+ return false;
+ }
+
+ if (!layout1->HasGCPtr() && !layout2->HasGCPtr())
+ {
+ return true;
+ }
+
+ assert(layout1->HasGCPtr() && layout2->HasGCPtr());
+ if (layout1->GetGCPtrCount() != layout2->GetGCPtrCount())
+ {
+ return false;
+ }
+
+ assert(layout1->GetSlotCount() == layout2->GetSlotCount());
+ unsigned slotsCount = layout1->GetSlotCount();
+
+ for (unsigned i = 0; i < slotsCount; ++i)
+ {
+ if (layout1->GetGCPtrType(i) != layout2->GetGCPtrType(i))
+ {
+ return false;
+ }
+ }
+ return true;
+}
diff --git a/src/coreclr/src/jit/layout.h b/src/coreclr/src/jit/layout.h
index 315a19452a5a..6a74949cfd21 100644
--- a/src/coreclr/src/jit/layout.h
+++ b/src/coreclr/src/jit/layout.h
@@ -195,6 +195,8 @@ class ClassLayout
}
}
+ static bool AreCompatible(const ClassLayout* layout1, const ClassLayout* layout2);
+
private:
const BYTE* GetGCPtrs() const
{
diff --git a/src/coreclr/src/jit/lclvars.cpp b/src/coreclr/src/jit/lclvars.cpp
index ae8408df6e0c..3cf7f4c14091 100644
--- a/src/coreclr/src/jit/lclvars.cpp
+++ b/src/coreclr/src/jit/lclvars.cpp
@@ -909,12 +909,12 @@ void Compiler::lvaInitUserArgs(InitVarDscInfo* varDscInfo)
#if defined(UNIX_AMD64_ABI)
if (varTypeIsStruct(argType) && (structDesc.eightByteCount >= 1))
{
- isFloat = varTypeIsFloating(firstEightByteType);
+ isFloat = varTypeUsesFloatReg(firstEightByteType);
}
else
#endif // !UNIX_AMD64_ABI
{
- isFloat = varTypeIsFloating(argType);
+ isFloat = varTypeUsesFloatReg(argType);
}
#if defined(UNIX_AMD64_ABI)
@@ -940,13 +940,13 @@ void Compiler::lvaInitUserArgs(InitVarDscInfo* varDscInfo)
{
printf(", secondEightByte: %s",
getRegName(genMapRegArgNumToRegNum(secondAllocatedRegArgNum, secondEightByteType),
- varTypeIsFloating(secondEightByteType)));
+ varTypeUsesFloatReg(secondEightByteType)));
}
}
else
#endif // defined(UNIX_AMD64_ABI)
{
- isFloat = varTypeIsFloating(argType);
+ isFloat = varTypeUsesFloatReg(argType);
unsigned regArgNum = genMapRegNumToRegArgNum(varDsc->GetArgReg(), argType);
for (unsigned ix = 0; ix < cSlots; ix++, regArgNum++)
@@ -998,7 +998,7 @@ void Compiler::lvaInitUserArgs(InitVarDscInfo* varDscInfo)
{
#if defined(TARGET_ARM)
varDscInfo->setAllRegArgUsed(argType);
- if (varTypeIsFloating(argType))
+ if (varTypeUsesFloatReg(argType))
{
varDscInfo->setAnyFloatStackArgs();
}
@@ -2194,7 +2194,7 @@ void Compiler::StructPromotionHelper::PromoteStructVar(unsigned lclNum)
{
const lvaStructFieldInfo* pFieldInfo = &structPromotionInfo.fields[index];
- if (varTypeIsFloating(pFieldInfo->fldType) || varTypeIsSIMD(pFieldInfo->fldType))
+ if (varTypeUsesFloatReg(pFieldInfo->fldType))
{
// Whenever we promote a struct that contains a floating point field
// it's possible we transition from a method that originally only had integer
@@ -5131,10 +5131,26 @@ bool Compiler::lvaIsPreSpilled(unsigned lclNum, regMaskTP preSpillMask)
}
#endif // TARGET_ARM
-/*****************************************************************************
- * lvaUpdateArgsWithInitialReg() : For each argument variable descriptor, update
- * its current register with the initial register as assigned by LSRA.
- */
+//------------------------------------------------------------------------
+// UpdateLifeFieldVar: Update live sets for only the given field of a multi-reg LclVar node.
+//
+// Arguments:
+// lclNode - the GT_LCL_VAR node.
+//
+void Compiler::lvaUpdateArgWithInitialReg(LclVarDsc* varDsc)
+{
+ noway_assert(varDsc->lvIsParam);
+
+ if (varDsc->lvIsRegCandidate())
+ {
+ varDsc->SetRegNum(varDsc->GetArgInitReg());
+ }
+}
+
+//------------------------------------------------------------------------
+// lvaUpdateArgsWithInitialReg() : For each argument variable descriptor, update
+// its current register with the initial register as assigned by LSRA.
+//
void Compiler::lvaUpdateArgsWithInitialReg()
{
if (!compLSRADone)
@@ -5144,7 +5160,7 @@ void Compiler::lvaUpdateArgsWithInitialReg()
for (unsigned lclNum = 0; lclNum < info.compArgsCount; lclNum++)
{
- LclVarDsc* varDsc = lvaTable + lclNum;
+ LclVarDsc* varDsc = lvaGetDesc(lclNum);
if (varDsc->lvPromotedStruct())
{
@@ -5158,7 +5174,7 @@ void Compiler::lvaUpdateArgsWithInitialReg()
if (varDsc->lvIsRegCandidate())
{
- varDsc->SetRegNum(varDsc->GetArgInitReg());
+ lvaUpdateArgWithInitialReg(varDsc);
}
}
}
@@ -5378,23 +5394,7 @@ int Compiler::lvaAssignVirtualFrameOffsetToArg(unsigned lclNum,
unsigned fieldVarNum = BAD_VAR_NUM;
noway_assert(lclNum < lvaCount);
- LclVarDsc* varDsc = lvaTable + lclNum;
-
- if (varDsc->lvPromotedStruct())
- {
- noway_assert(varDsc->lvFieldCnt == 1); // We only handle one field here
- fieldVarNum = varDsc->lvFieldLclStart;
-
- lvaPromotionType promotionType = lvaGetPromotionType(varDsc);
-
- if (promotionType == PROMOTION_TYPE_INDEPENDENT)
- {
- lclNum = fieldVarNum;
- noway_assert(lclNum < lvaCount);
- varDsc = lvaTable + lclNum;
- assert(varDsc->lvIsStructField);
- }
- }
+ LclVarDsc* varDsc = lvaGetDesc(lclNum);
noway_assert(varDsc->lvIsParam);
@@ -5440,19 +5440,18 @@ int Compiler::lvaAssignVirtualFrameOffsetToArg(unsigned lclNum,
}
}
- // For struct promoted parameters we need to set the offsets for both LclVars.
+ // For struct promoted parameters we need to set the offsets for the field lclVars.
//
- // For a dependent promoted struct we also assign the struct fields stack offset
+ // For a promoted struct we also assign the struct fields stack offset
if (varDsc->lvPromotedStruct())
{
- lvaPromotionType promotionType = lvaGetPromotionType(varDsc);
-
- if (promotionType == PROMOTION_TYPE_DEPENDENT)
+ unsigned firstFieldNum = varDsc->lvFieldLclStart;
+ int offset = varDsc->lvStkOffs;
+ for (unsigned i = 0; i < varDsc->lvFieldCnt; i++)
{
- noway_assert(varDsc->lvFieldCnt == 1); // We only handle one field here
-
- assert(fieldVarNum == varDsc->lvFieldLclStart);
- lvaTable[fieldVarNum].lvStkOffs = varDsc->lvStkOffs;
+ LclVarDsc* fieldVarDsc = lvaGetDesc(firstFieldNum + i);
+ fieldVarDsc->lvStkOffs = offset;
+ offset += fieldVarDsc->lvFldOffset;
}
}
// For an independent promoted struct field we also assign the parent struct stack offset
@@ -5495,23 +5494,7 @@ int Compiler::lvaAssignVirtualFrameOffsetToArg(unsigned lclNum,
unsigned fieldVarNum = BAD_VAR_NUM;
noway_assert(lclNum < lvaCount);
- LclVarDsc* varDsc = lvaTable + lclNum;
-
- if (varDsc->lvPromotedStruct())
- {
- noway_assert(varDsc->lvFieldCnt == 1); // We only handle one field here
- fieldVarNum = varDsc->lvFieldLclStart;
-
- lvaPromotionType promotionType = lvaGetPromotionType(varDsc);
-
- if (promotionType == PROMOTION_TYPE_INDEPENDENT)
- {
- lclNum = fieldVarNum;
- noway_assert(lclNum < lvaCount);
- varDsc = lvaTable + lclNum;
- assert(varDsc->lvIsStructField);
- }
- }
+ LclVarDsc* varDsc = lvaGetDesc(lclNum);
noway_assert(varDsc->lvIsParam);
@@ -5767,22 +5750,13 @@ int Compiler::lvaAssignVirtualFrameOffsetToArg(unsigned lclNum,
#endif // !defined(TARGET_64BIT)
if (varDsc->lvPromotedStruct())
{
- lvaPromotionType promotionType = lvaGetPromotionType(varDsc);
-
- if (promotionType == PROMOTION_TYPE_DEPENDENT)
+ unsigned firstFieldNum = varDsc->lvFieldLclStart;
+ for (unsigned i = 0; i < varDsc->lvFieldCnt; i++)
{
- noway_assert(varDsc->lvFieldCnt == 1); // We only handle one field here
-
- assert(fieldVarNum == varDsc->lvFieldLclStart);
- lvaTable[fieldVarNum].lvStkOffs = varDsc->lvStkOffs;
+ LclVarDsc* fieldVarDsc = lvaGetDesc(firstFieldNum + i);
+ fieldVarDsc->lvStkOffs = varDsc->lvStkOffs + fieldVarDsc->lvFldOffset;
}
}
- // For an independent promoted struct field we also assign the parent struct stack offset
- else if (varDsc->lvIsStructField)
- {
- noway_assert(varDsc->lvParentLcl < lvaCount);
- lvaTable[varDsc->lvParentLcl].lvStkOffs = varDsc->lvStkOffs;
- }
if (Target::g_tgtArgOrder == Target::ARG_ORDER_R2L && !varDsc->lvIsRegArg)
{
diff --git a/src/coreclr/src/jit/lower.cpp b/src/coreclr/src/jit/lower.cpp
index 69cfbbe34a99..cc9e2891e9a4 100644
--- a/src/coreclr/src/jit/lower.cpp
+++ b/src/coreclr/src/jit/lower.cpp
@@ -4983,7 +4983,7 @@ GenTree* Lowering::LowerAdd(GenTreeOp* node)
GenTree* next = node->gtNext;
BlockRange().Remove(op2);
BlockRange().Remove(node);
- JITDUMP("Remove [06%u], [06%u]\n", op2->gtTreeID, node->gtTreeID);
+ JITDUMP("Remove [%06u], [%06u]\n", op2->gtTreeID, node->gtTreeID);
return next;
}
@@ -6530,8 +6530,11 @@ void Lowering::LowerBlockStoreCommon(GenTreeBlk* blkNode)
bool Lowering::TryTransformStoreObjAsStoreInd(GenTreeBlk* blkNode)
{
assert(blkNode->OperIs(GT_STORE_BLK, GT_STORE_DYN_BLK, GT_STORE_OBJ));
- return false;
-#if 0 // the optimization is temporary disabled due to https://github.com/dotnet/wpf/issues/3226 issue.
+ if (comp->opts.OptimizationEnabled())
+ {
+ return false;
+ }
+
if (blkNode->OperIs(GT_STORE_DYN_BLK))
{
return false;
@@ -6575,6 +6578,7 @@ bool Lowering::TryTransformStoreObjAsStoreInd(GenTreeBlk* blkNode)
return false;
}
+ JITDUMP("Replacing STORE_OBJ with STOREIND for [06%u]", blkNode->gtTreeID);
blkNode->ChangeOper(GT_STOREIND);
blkNode->ChangeType(regType);
@@ -6597,7 +6601,10 @@ bool Lowering::TryTransformStoreObjAsStoreInd(GenTreeBlk* blkNode)
blkNode->SetData(src);
BlockRange().Remove(initVal);
}
+ else
+ {
+ assert(src->TypeIs(regType) || src->IsCnsIntOrI() || src->IsCall());
+ }
LowerStoreIndirCommon(blkNode);
return true;
-#endif
}
diff --git a/src/coreclr/src/jit/lsra.h b/src/coreclr/src/jit/lsra.h
index 7050e5f069a2..c2adcf29a40a 100644
--- a/src/coreclr/src/jit/lsra.h
+++ b/src/coreclr/src/jit/lsra.h
@@ -44,13 +44,7 @@ typedef var_types RegisterType;
template
RegisterType regType(T type)
{
-#ifdef FEATURE_SIMD
- if (varTypeIsSIMD(type))
- {
- return FloatRegisterType;
- }
-#endif // FEATURE_SIMD
- return varTypeIsFloating(TypeGet(type)) ? FloatRegisterType : IntRegisterType;
+ return varTypeUsesFloatReg(TypeGet(type)) ? FloatRegisterType : IntRegisterType;
}
//------------------------------------------------------------------------
diff --git a/src/coreclr/src/jit/lsrabuild.cpp b/src/coreclr/src/jit/lsrabuild.cpp
index 549a463b3ea2..d902b3a1ab4e 100644
--- a/src/coreclr/src/jit/lsrabuild.cpp
+++ b/src/coreclr/src/jit/lsrabuild.cpp
@@ -1150,6 +1150,8 @@ bool LinearScan::buildKillPositionsForNode(GenTree* tree, LsraLocation currentLo
// many of which appear to be regressions (because there is more spill on the infrequently path),
// but are not really because the frequent path becomes smaller. Validating these diffs will need
// to be done before making this change.
+ // Also note that we avoid setting callee-save preferences for floating point. This may need
+ // revisiting, and note that it doesn't currently apply to SIMD types, only float or double.
// if (!blockSequence[curBBSeqNum]->isRunRarely())
if (enregisterLocalVars)
{
@@ -2533,7 +2535,7 @@ void LinearScan::buildIntervals()
// across a call in the non-EH code, we'll be extra conservative about this.
// Note that for writeThru intervals we don't update the preferences to be only callee-save.
unsigned calleeSaveCount =
- (varTypeIsFloating(interval->registerType)) ? CNT_CALLEE_SAVED_FLOAT : CNT_CALLEE_ENREG;
+ (varTypeUsesFloatReg(interval->registerType)) ? CNT_CALLEE_SAVED_FLOAT : CNT_CALLEE_ENREG;
if ((weight <= (BB_UNITY_WEIGHT * 7)) || varDsc->lvVarIndex >= calleeSaveCount)
{
// If this is relatively low weight, don't prefer callee-save at all.
@@ -2710,7 +2712,7 @@ RefPosition* LinearScan::BuildDef(GenTree* tree, regMaskTP dstCandidates, int mu
type = tree->GetRegTypeByIndex(multiRegIdx);
}
- if (varTypeIsFloating(type) || varTypeIsSIMD(type))
+ if (varTypeUsesFloatReg(type))
{
compiler->compFloatingPointUsed = true;
}
@@ -3487,7 +3489,7 @@ int LinearScan::BuildReturn(GenTree* tree)
{
hasMismatchedRegTypes = true;
regMaskTP dstRegMask = genRegMask(pRetTypeDesc->GetABIReturnReg(i));
- if (varTypeIsFloating(dstType))
+ if (varTypeUsesFloatReg(dstType))
{
buildInternalFloatRegisterDefForNode(tree, dstRegMask);
}
diff --git a/src/coreclr/src/jit/lsraxarch.cpp b/src/coreclr/src/jit/lsraxarch.cpp
index 780d959a9e93..8895dc95ecec 100644
--- a/src/coreclr/src/jit/lsraxarch.cpp
+++ b/src/coreclr/src/jit/lsraxarch.cpp
@@ -70,7 +70,7 @@ int LinearScan::BuildNode(GenTree* tree)
}
// floating type generates AVX instruction (vmovss etc.), set the flag
- if (varTypeIsFloating(tree->TypeGet()))
+ if (varTypeUsesFloatReg(tree->TypeGet()))
{
SetContainsAVXFlags();
}
@@ -1042,7 +1042,7 @@ int LinearScan::BuildCall(GenTreeCall* call)
ctrlExpr = call->gtCallAddr;
}
- RegisterType registerType = call->TypeGet();
+ RegisterType registerType = regType(call);
// Set destination candidates for return value of the call.
CLANG_FORMAT_COMMENT_ANCHOR;
@@ -1063,7 +1063,7 @@ int LinearScan::BuildCall(GenTreeCall* call)
dstCandidates = retTypeDesc->GetABIReturnRegs();
assert((int)genCountBits(dstCandidates) == dstCount);
}
- else if (varTypeIsFloating(registerType))
+ else if (varTypeUsesFloatReg(registerType))
{
#ifdef TARGET_X86
// The return value will be on the X87 stack, and we will need to move it.
diff --git a/src/coreclr/src/jit/morph.cpp b/src/coreclr/src/jit/morph.cpp
index 8fd2c69a4413..4d420dabaa80 100644
--- a/src/coreclr/src/jit/morph.cpp
+++ b/src/coreclr/src/jit/morph.cpp
@@ -2881,7 +2881,7 @@ void Compiler::fgInitArgInfo(GenTreeCall* call)
#endif // FEATURE_HFA
#ifdef TARGET_ARM
- passUsingFloatRegs = !callIsVararg && (isHfaArg || varTypeIsFloating(argx)) && !opts.compUseSoftFP;
+ passUsingFloatRegs = !callIsVararg && (isHfaArg || varTypeUsesFloatReg(argx)) && !opts.compUseSoftFP;
bool passUsingIntRegs = passUsingFloatRegs ? false : (intArgRegNum < MAX_REG_ARG);
// We don't use the "size" return value from InferOpSizeAlign().
@@ -2918,7 +2918,7 @@ void Compiler::fgInitArgInfo(GenTreeCall* call)
#elif defined(TARGET_ARM64)
assert(!callIsVararg || !isHfaArg);
- passUsingFloatRegs = !callIsVararg && (isHfaArg || varTypeIsFloating(argx));
+ passUsingFloatRegs = !callIsVararg && (isHfaArg || varTypeUsesFloatReg(argx));
#elif defined(TARGET_AMD64)
@@ -5281,14 +5281,31 @@ const int MAX_INDEX_COMPLEXITY = 4;
GenTree* Compiler::fgMorphArrayIndex(GenTree* tree)
{
noway_assert(tree->gtOper == GT_INDEX);
- GenTreeIndex* asIndex = tree->AsIndex();
-
- var_types elemTyp = tree->TypeGet();
- unsigned elemSize = tree->AsIndex()->gtIndElemSize;
- CORINFO_CLASS_HANDLE elemStructType = tree->AsIndex()->gtStructElemClass;
+ GenTreeIndex* asIndex = tree->AsIndex();
+ var_types elemTyp = asIndex->TypeGet();
+ unsigned elemSize = asIndex->gtIndElemSize;
+ CORINFO_CLASS_HANDLE elemStructType = asIndex->gtStructElemClass;
noway_assert(elemTyp != TYP_STRUCT || elemStructType != nullptr);
+ // Fold "cns_str"[cns_index] to ushort constant
+ if (opts.OptimizationEnabled() && asIndex->Arr()->OperIs(GT_CNS_STR) && asIndex->Index()->IsIntCnsFitsInI32())
+ {
+ const int cnsIndex = static_cast(asIndex->Index()->AsIntConCommon()->IconValue());
+ if (cnsIndex >= 0)
+ {
+ int length;
+ LPCWSTR str = info.compCompHnd->getStringLiteral(asIndex->Arr()->AsStrCon()->gtScpHnd,
+ asIndex->Arr()->AsStrCon()->gtSconCPX, &length);
+ if ((cnsIndex < length) && (str != nullptr))
+ {
+ GenTree* cnsCharNode = gtNewIconNode(str[cnsIndex], elemTyp);
+ INDEBUG(cnsCharNode->gtDebugFlags |= GTF_DEBUG_NODE_MORPHED);
+ return cnsCharNode;
+ }
+ }
+ }
+
#ifdef FEATURE_SIMD
if (featureSIMD && varTypeIsStruct(elemTyp) && structSizeMightRepresentSIMDType(elemSize))
{
@@ -5537,7 +5554,7 @@ GenTree* Compiler::fgMorphArrayIndex(GenTree* tree)
// If the index node is a floating-point type, notify the compiler
// we'll potentially use floating point registers at the time of codegen.
- if (varTypeIsFloating(tree->gtType))
+ if (varTypeUsesFloatReg(tree->gtType))
{
this->compFloatingPointUsed = true;
}
@@ -7543,8 +7560,9 @@ GenTree* Compiler::fgMorphPotentialTailCall(GenTreeCall* call)
// fgSetBlockOrder() is going to mark the method as fully interruptible
// if the block containing this tail call is reachable without executing
// any call.
+ BasicBlock* curBlock = compCurBB;
if (canFastTailCall || (fgFirstBB->bbFlags & BBF_GC_SAFE_POINT) || (compCurBB->bbFlags & BBF_GC_SAFE_POINT) ||
- !fgCreateGCPoll(GCPOLL_INLINE, compCurBB))
+ (fgCreateGCPoll(GCPOLL_INLINE, compCurBB) == curBlock))
{
// We didn't insert a poll block, so we need to morph the call now
// (Normally it will get morphed when we get to the split poll block)
@@ -8838,12 +8856,11 @@ GenTree* Compiler::fgMorphCall(GenTreeCall* call)
// Regardless of the state of the basic block with respect to GC safe point,
// we will always insert a GC Poll for scenarios involving a suppressed GC
- // transition. Only insert the GC Poll on the first morph.
+ // transition. Only mark the block for GC Poll insertion on the first morph.
if (fgGlobalMorph && call->IsUnmanaged() && call->IsSuppressGCTransition())
{
- // Insert a GC poll.
- bool insertedBB = fgCreateGCPoll(GCPOLL_CALL, compCurBB, compCurStmt);
- assert(!insertedBB); // No new block should be inserted
+ compCurBB->bbFlags |= (BBF_HAS_SUPPRESSGC_CALL | BBF_GC_SAFE_POINT);
+ optMethodFlags |= OMF_NEEDS_GCPOLLS;
}
// Morph Type.op_Equality, Type.op_Inequality, and Enum.HasFlag
@@ -9114,6 +9131,63 @@ GenTree* Compiler::fgMorphConst(GenTree* tree)
return fgMorphTree(tree);
}
+//------------------------------------------------------------------------
+// fgMorphTryFoldObjAsLclVar: try to fold an Obj node as a LclVar.
+//
+// Arguments:
+// obj - the obj node.
+//
+// Return value:
+// GenTreeLclVar if the obj can be replaced by it, null otherwise.
+//
+// Notes:
+// TODO-CQ: currently this transformation is done only under copy block,
+// but it is benefitial to do for each OBJ node. However, `PUT_ARG_STACK`
+// for some platforms does not expect struct `LCL_VAR` as a source, so
+// it needs more work.
+//
+GenTreeLclVar* Compiler::fgMorphTryFoldObjAsLclVar(GenTreeObj* obj)
+{
+ if (opts.OptimizationEnabled())
+ {
+ GenTree* op1 = obj->Addr();
+ if (op1->OperIs(GT_ADDR))
+ {
+ GenTreeUnOp* addr = op1->AsUnOp();
+ GenTree* addrOp = addr->gtGetOp1();
+ if (addrOp->TypeIs(obj->TypeGet()) && addrOp->OperIs(GT_LCL_VAR))
+ {
+ GenTreeLclVar* lclVar = addrOp->AsLclVar();
+
+ ClassLayout* lclVarLayout = lvaGetDesc(lclVar)->GetLayout();
+ ClassLayout* objLayout = obj->GetLayout();
+ if (ClassLayout::AreCompatible(lclVarLayout, objLayout))
+ {
+#ifdef DEBUG
+ CORINFO_CLASS_HANDLE objClsHandle = obj->GetLayout()->GetClassHandle();
+ assert(objClsHandle != NO_CLASS_HANDLE);
+ if (verbose)
+ {
+ CORINFO_CLASS_HANDLE lclClsHnd = gtGetStructHandle(lclVar);
+ printf("fold OBJ(ADDR(X)) [%06u] into X [%06u], ", dspTreeID(obj), dspTreeID(lclVar));
+ printf("with %s handles\n", ((lclClsHnd == objClsHandle) ? "matching" : "different"));
+ }
+#endif
+ // Keep the DONT_CSE flag in sync
+ // (as the addr always marks it for its op1)
+ lclVar->gtFlags &= ~GTF_DONT_CSE;
+ lclVar->gtFlags |= (obj->gtFlags & GTF_DONT_CSE);
+
+ DEBUG_DESTROY_NODE(obj);
+ DEBUG_DESTROY_NODE(addr);
+ return lclVar;
+ }
+ }
+ }
+ }
+ return nullptr;
+}
+
/*****************************************************************************
*
* Transform the given GTK_LEAF tree for code generation.
@@ -10265,13 +10339,13 @@ GenTree* Compiler::fgMorphBlockOperand(GenTree* tree, var_types asgType, unsigne
if (indirTree->OperIsBlk() && !isBlkReqd)
{
effectiveVal->SetOper(GT_IND);
- effectiveVal->gtType = asgType;
}
else
{
// If we have an indirection and a block is required, it should already be a block.
assert(indirTree->OperIsBlk() || !isBlkReqd);
}
+ effectiveVal->gtType = asgType;
}
else
{
@@ -10298,6 +10372,7 @@ GenTree* Compiler::fgMorphBlockOperand(GenTree* tree, var_types asgType, unsigne
}
}
}
+ assert(effectiveVal->TypeIs(asgType) || (varTypeIsSIMD(asgType) && varTypeIsStruct(effectiveVal)));
tree = effectiveVal;
return tree;
}
@@ -10346,13 +10421,26 @@ GenTree* Compiler::fgMorphCopyBlock(GenTree* tree)
}
#endif // FEATURE_MULTIREG_RET
- if (src->IsCall() && dest->OperIs(GT_LCL_VAR) && !compDoOldStructRetyping())
+ if (src->IsCall() && !compDoOldStructRetyping())
{
- LclVarDsc* varDsc = lvaGetDesc(dest->AsLclVar());
- if (varTypeIsStruct(varDsc) && varDsc->CanBeReplacedWithItsField(this))
+ if (dest->OperIs(GT_OBJ))
{
- JITDUMP(" not morphing a single reg call return\n");
- return tree;
+ GenTreeLclVar* lclVar = fgMorphTryFoldObjAsLclVar(dest->AsObj());
+ if (lclVar != nullptr)
+ {
+ dest = lclVar;
+ asg->gtOp1 = lclVar;
+ }
+ }
+
+ if (dest->OperIs(GT_LCL_VAR))
+ {
+ LclVarDsc* varDsc = lvaGetDesc(dest->AsLclVar());
+ if (varTypeIsStruct(varDsc) && varDsc->CanBeReplacedWithItsField(this))
+ {
+ JITDUMP(" not morphing a single reg call return\n");
+ return tree;
+ }
}
}
@@ -10890,23 +10978,23 @@ GenTree* Compiler::fgMorphCopyBlock(GenTree* tree)
addrSpill = gtCloneExpr(destAddr); // addrSpill represents the 'destAddr'
noway_assert(addrSpill != nullptr);
}
+ }
+ }
- // TODO-CQ: this should be based on a more general
- // "BaseAddress" method, that handles fields of structs, before or after
- // morphing.
- if (addrSpill != nullptr && addrSpill->OperGet() == GT_ADDR)
- {
- if (addrSpill->AsOp()->gtOp1->IsLocal())
- {
- // We will *not* consider this to define the local, but rather have each individual field assign
- // be a definition.
- addrSpill->AsOp()->gtOp1->gtFlags &= ~(GTF_LIVENESS_MASK);
- assert(lvaGetPromotionType(addrSpill->AsOp()->gtOp1->AsLclVarCommon()->GetLclNum()) !=
- PROMOTION_TYPE_INDEPENDENT);
- addrSpillIsStackDest = true; // addrSpill represents the address of LclVar[varNum] in our
- // local stack frame
- }
- }
+ // TODO-CQ: this should be based on a more general
+ // "BaseAddress" method, that handles fields of structs, before or after
+ // morphing.
+ if ((addrSpill != nullptr) && addrSpill->OperIs(GT_ADDR))
+ {
+ GenTree* addrSpillOp = addrSpill->AsOp()->gtGetOp1();
+ if (addrSpillOp->IsLocal())
+ {
+ // We will *not* consider this to define the local, but rather have each individual field assign
+ // be a definition.
+ addrSpillOp->gtFlags &= ~(GTF_LIVENESS_MASK);
+ assert(lvaGetPromotionType(addrSpillOp->AsLclVarCommon()->GetLclNum()) != PROMOTION_TYPE_INDEPENDENT);
+ addrSpillIsStackDest = true; // addrSpill represents the address of LclVar[varNum] in our
+ // local stack frame
}
}
diff --git a/src/coreclr/src/jit/optimizer.cpp b/src/coreclr/src/jit/optimizer.cpp
index 9bd4ba9e7008..d953ecd92aed 100644
--- a/src/coreclr/src/jit/optimizer.cpp
+++ b/src/coreclr/src/jit/optimizer.cpp
@@ -9257,7 +9257,7 @@ void Compiler::optRemoveRedundantZeroInits()
Statement* next = stmt->GetNextStmt();
for (GenTree* tree = stmt->GetTreeList(); tree != nullptr; tree = tree->gtNext)
{
- if (((tree->gtFlags & GTF_CALL) != 0) && (!tree->IsCall() || !tree->AsCall()->IsSuppressGCTransition()))
+ if (((tree->gtFlags & GTF_CALL) != 0))
{
hasGCSafePoint = true;
}
diff --git a/src/coreclr/src/jit/target.h b/src/coreclr/src/jit/target.h
index 4229d39b3266..6e79bfac3df5 100644
--- a/src/coreclr/src/jit/target.h
+++ b/src/coreclr/src/jit/target.h
@@ -1590,7 +1590,7 @@ C_ASSERT((FEATURE_TAILCALL_OPT == 0) || (FEATURE_FASTTAILCALL == 1));
#define BITS_PER_BYTE 8
#define REGNUM_MASK ((1 << REGNUM_BITS) - 1) // a n-bit mask use to encode multiple REGNUMs into a unsigned int
-#define RBM_ALL(type) (varTypeIsFloating(type) ? RBM_ALLFLOAT : RBM_ALLINT)
+#define RBM_ALL(type) (varTypeUsesFloatReg(type) ? RBM_ALLFLOAT : RBM_ALLINT)
/*****************************************************************************/
@@ -1896,7 +1896,7 @@ inline regMaskTP genRegMask(regNumber regNum, var_types type)
#else
regMaskTP regMask = RBM_NONE;
- if (varTypeIsFloating(type))
+ if (varTypeUsesFloatReg(type))
{
regMask = genRegMaskFloat(regNum, type);
}
@@ -1944,7 +1944,7 @@ inline regNumber regNextOfType(regNumber reg, var_types type)
regReturn = REG_NEXT(reg);
#endif
- if (varTypeIsFloating(type))
+ if (varTypeUsesFloatReg(type))
{
if (regReturn > REG_FP_LAST)
{
diff --git a/src/coreclr/src/md/compiler/CMakeLists.txt b/src/coreclr/src/md/compiler/CMakeLists.txt
index 6b89cfa5308d..495fa4d70ca2 100644
--- a/src/coreclr/src/md/compiler/CMakeLists.txt
+++ b/src/coreclr/src/md/compiler/CMakeLists.txt
@@ -17,7 +17,6 @@ set(MDCOMPILER_SOURCES
regmeta_import.cpp
regmeta_imetadatatables.cpp
regmeta_vm.cpp
- verifylayouts.cpp
)
set(MDCOMPILER_HEADERS
@@ -33,8 +32,6 @@ set(MDCOMPILER_HEADERS
../inc/metamodelrw.h
../inc/rwutil.h
../inc/stgio.h
- ../inc/verifylayouts.h
- ../inc/VerifyLayouts.h
cacheload.h
classfactory.h
custattr.h
@@ -47,18 +44,31 @@ set(MDCOMPILER_HEADERS
regmeta.h
)
+set(MDCOMPILER_WKS_SOURCES
+ ${MDCOMPILER_SOURCES}
+ verifylayouts.cpp
+)
+
+set(MDCOMPILER_WKS_HEADERS
+ ${MDCOMPILER_HEADERS}
+ ../inc/verifylayouts.h
+)
+
convert_to_absolute_path(MDCOMPILER_SOURCES ${MDCOMPILER_SOURCES})
convert_to_absolute_path(MDCOMPILER_HEADERS ${MDCOMPILER_HEADERS})
+convert_to_absolute_path(MDCOMPILER_WKS_SOURCES ${MDCOMPILER_WKS_SOURCES})
+convert_to_absolute_path(MDCOMPILER_WKS_HEADERS ${MDCOMPILER_WKS_HEADERS})
if (CLR_CMAKE_TARGET_WIN32)
list(APPEND MDCOMPILER_SOURCES ${MDCOMPILER_HEADERS})
+ list(APPEND MDCOMPILER_WKS_SOURCES ${MDCOMPILER_WKS_HEADERS})
endif()
add_library_clr(mdcompiler_dac ${MDCOMPILER_SOURCES})
set_target_properties(mdcompiler_dac PROPERTIES DAC_COMPONENT TRUE)
target_precompile_header(TARGET mdcompiler_dac HEADER stdafx.h)
-add_library_clr(mdcompiler_wks OBJECT ${MDCOMPILER_SOURCES})
+add_library_clr(mdcompiler_wks OBJECT ${MDCOMPILER_WKS_SOURCES})
target_compile_definitions(mdcompiler_wks PRIVATE FEATURE_METADATA_EMIT_ALL)
target_precompile_header(TARGET mdcompiler_wks HEADER stdafx.h)
@@ -69,3 +79,7 @@ target_precompile_header(TARGET mdcompiler-dbi HEADER stdafx.h)
add_library_clr(mdcompiler_crossgen ${MDCOMPILER_SOURCES})
set_target_properties(mdcompiler_crossgen PROPERTIES CROSSGEN_COMPONENT TRUE)
target_precompile_header(TARGET mdcompiler_crossgen HEADER stdafx.h)
+
+add_library_clr(mdcompiler_ppdb ${MDCOMPILER_SOURCES})
+target_compile_definitions(mdcompiler_ppdb PRIVATE FEATURE_METADATA_EMIT_ALL FEATURE_METADATA_EMIT_PORTABLE_PDB)
+target_precompile_header(TARGET mdcompiler_ppdb HEADER stdafx.h)
\ No newline at end of file
diff --git a/src/coreclr/src/md/compiler/disp.cpp b/src/coreclr/src/md/compiler/disp.cpp
index 82d09e8c2d9a..95c35063c719 100644
--- a/src/coreclr/src/md/compiler/disp.cpp
+++ b/src/coreclr/src/md/compiler/disp.cpp
@@ -478,6 +478,81 @@ HRESULT Disp::OpenScopeOnITypeInfo( // Return code.
return E_NOTIMPL;
} // Disp::OpenScopeOnITypeInfo
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+//*****************************************************************************
+// Create a brand new scope which will be used for portable PDB metadata.
+// This is based on the CLSID that was used to get the dispenser.
+//
+// The existing DefineScope method cannot be used for the purpose of PDB
+// metadata generation, since it internally creates module and type def table
+// entries.
+//*****************************************************************************
+__checkReturn
+HRESULT
+Disp::DefinePortablePdbScope(
+ REFCLSID rclsid, // [in] What version to create.
+ DWORD dwCreateFlags, // [in] Flags on the create.
+ REFIID riid, // [in] The interface desired.
+ IUnknown** ppIUnk) // [out] Return interface on success.
+{
+#ifdef FEATURE_METADATA_EMIT
+ HRESULT hr = S_OK;
+
+ BEGIN_ENTRYPOINT_NOTHROW;
+
+ RegMeta* pMeta = 0;
+ OptionValue optionForNewScope = m_OptionValue;
+
+ LOG((LF_METADATA, LL_INFO10, "Disp::DefinePortablePdbScope(0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", rclsid, dwCreateFlags, riid, ppIUnk));
+
+ if (dwCreateFlags)
+ IfFailGo(E_INVALIDARG);
+
+ // Currently the portable PDB tables are treated as an extension to the MDVersion2
+ // TODO: this extension might deserve its own version number e.g. 'MDVersion3'
+ if (rclsid == CLSID_CLR_v2_MetaData)
+ {
+ optionForNewScope.m_MetadataVersion = MDVersion2;
+ }
+ else
+ {
+ // If it is a version we don't understand, then we cannot continue.
+ IfFailGo(CLDB_E_FILE_OLDVER);
+ }
+
+ // Create a new coclass for this.
+ pMeta = new (nothrow) RegMeta();
+ IfNullGo(pMeta);
+
+ IfFailGo(pMeta->SetOption(&optionForNewScope));
+
+ // Create the MiniMd-style scope for portable pdb
+ IfFailGo(pMeta->CreateNewPortablePdbMD());
+
+ // Get the requested interface.
+ IfFailGo(pMeta->QueryInterface(riid, (void**)ppIUnk));
+
+ // Add the new RegMeta to the cache.
+ IfFailGo(pMeta->AddToCache());
+
+ LOG((LOGMD, "{%08x} Created new emit scope\n", pMeta));
+
+ErrExit:
+ if (FAILED(hr))
+ {
+ if (pMeta != NULL)
+ delete pMeta;
+ *ppIUnk = NULL;
+ }
+ END_ENTRYPOINT_NOTHROW;
+
+ return hr;
+#else //!FEATURE_METADATA_EMIT
+ return E_NOTIMPL;
+#endif //!FEATURE_METADATA_EMIT
+} // Disp::DefineScope
+#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB
+
#ifdef FEATURE_METADATA_CUSTOM_DATA_SOURCE
//*****************************************************************************
@@ -595,6 +670,10 @@ HRESULT Disp::QueryInterface(REFIID riid, void **ppUnk)
*ppUnk = (IMetaDataDispenser *) this;
else if (riid == IID_IMetaDataDispenserEx)
*ppUnk = (IMetaDataDispenserEx *) this;
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+ else if (riid == IID_IMetaDataDispenserEx2)
+ *ppUnk = (IMetaDataDispenserEx2 *) this;
+#endif
#ifdef FEATURE_METADATA_CUSTOM_DATA_SOURCE
else if (riid == IID_IMetaDataDispenserCustom)
*ppUnk = static_cast(this);
diff --git a/src/coreclr/src/md/compiler/disp.h b/src/coreclr/src/md/compiler/disp.h
index 2a183051d9bf..fbca3f069c61 100644
--- a/src/coreclr/src/md/compiler/disp.h
+++ b/src/coreclr/src/md/compiler/disp.h
@@ -15,7 +15,11 @@
class Disp :
+#ifndef FEATURE_METADATA_EMIT_PORTABLE_PDB
public IMetaDataDispenserEx
+#else
+ public IMetaDataDispenserEx2
+#endif
#ifdef FEATURE_METADATA_CUSTOM_DATA_SOURCE
, IMetaDataDispenserCustom
#endif
@@ -88,6 +92,14 @@ class Disp :
ULONG cchName, // [IN] the name buffer's size
ULONG *pcName); // [OUT] the number of characters returend in the buffer
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+ STDMETHODIMP DefinePortablePdbScope( // Return code.
+ REFCLSID rclsid, // [in] What version to create.
+ DWORD dwCreateFlags, // [in] Flags on the create.
+ REFIID riid, // [in] The interface desired.
+ IUnknown** ppIUnk); // [out] Return interface on success.
+#endif
+
#ifdef FEATURE_METADATA_CUSTOM_DATA_SOURCE
// *** IMetaDataDispenserCustom methods ***
STDMETHODIMP OpenScopeOnCustomDataSource( // S_OK or error
diff --git a/src/coreclr/src/md/compiler/emit.cpp b/src/coreclr/src/md/compiler/emit.cpp
index 1d380129983a..4a7cf802022b 100644
--- a/src/coreclr/src/md/compiler/emit.cpp
+++ b/src/coreclr/src/md/compiler/emit.cpp
@@ -2044,6 +2044,329 @@ HRESULT RegMeta::_SetGenericParamProps( // S_OK or error.
#endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER
} // RegMeta::_SetGenericParamProps
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+//*****************************************************************************
+// Get referenced type system metadata tables.
+//*****************************************************************************
+STDMETHODIMP RegMeta::GetReferencedTypeSysTables( // S_OK or error.
+ ULONG64 *refTables, // [OUT] Bit vector of referenced type system metadata tables.
+ ULONG refTableRows[], // [OUT] Array of number of rows for each referenced type system table.
+ const ULONG maxTableRowsSize, // [IN] Max size of the rows array.
+ ULONG *tableRowsSize) // [OUT] Size of the rows array.
+{
+#ifdef FEATURE_METADATA_EMIT_IN_DEBUGGER
+ return E_NOTIMPL;
+#else //!FEATURE_METADATA_EMIT_IN_DEBUGGER
+ HRESULT hr = S_OK;
+
+ BEGIN_ENTRYPOINT_NOTHROW;
+
+ LOG((LOGMD, "RegMeta::GetReferencedTypeSysTables()\n"));
+ START_MD_PERF();
+
+ ULONG64 refTablesBitVector = 0;
+ ULONG count = 0;
+ ULONG* ptr = NULL;
+ ULONG rowsSize = 0;
+
+ for (ULONG i = 0; i < TBL_COUNT; i++)
+ {
+ if (m_pStgdb->m_MiniMd.m_Tables[i].GetRecordCount() > 0)
+ {
+ refTablesBitVector |= (ULONG64)1UL << i;
+ count++;
+ }
+ }
+
+ _ASSERTE(count <= maxTableRowsSize);
+ if (count > maxTableRowsSize)
+ {
+ hr = META_E_BADMETADATA;
+ goto ErrExit;
+ }
+
+ *refTables = refTablesBitVector;
+ *tableRowsSize = count;
+
+ ptr = refTableRows;
+ for (ULONG i = 0; i < TBL_COUNT; i++)
+ {
+ rowsSize = m_pStgdb->m_MiniMd.m_Tables[i].GetRecordCount();
+ if (rowsSize > 0)
+ *ptr++ = rowsSize;
+ }
+
+ErrExit:
+ STOP_MD_PERF(GetReferencedTypeSysTables);
+
+ END_ENTRYPOINT_NOTHROW;
+ return hr;
+#endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER
+} // RegMeta::GetReferencedTypeSysTables
+
+
+//*****************************************************************************
+// Defines PDB stream data for portable PDB metadata
+//*****************************************************************************
+STDMETHODIMP RegMeta::DefinePdbStream( // S_OK or error.
+ PORT_PDB_STREAM* pdbStream) // [IN] Portable pdb stream data.
+{
+#ifdef FEATURE_METADATA_EMIT_IN_DEBUGGER
+ return E_NOTIMPL;
+#else //!FEATURE_METADATA_EMIT_IN_DEBUGGER
+ HRESULT hr = S_OK;
+
+ BEGIN_ENTRYPOINT_NOTHROW;
+
+ LOG((LOGMD, "RegMeta::DefinePdbStream()\n"));
+ START_MD_PERF();
+
+ IfFailGo(m_pStgdb->m_pPdbHeap->SetData(pdbStream));
+
+ErrExit:
+ STOP_MD_PERF(DefinePdbStream);
+
+ END_ENTRYPOINT_NOTHROW;
+ return hr;
+#endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER
+} // RegMeta::DefinePdbStream
+
+//*****************************************************************************
+// Defines a document for portable PDB metadata
+//*****************************************************************************
+STDMETHODIMP RegMeta::DefineDocument( // S_OK or error.
+ char *docName, // [IN] Document name (string will be tokenized).
+ GUID *hashAlg, // [IN] Hash algorithm GUID.
+ BYTE *hashVal, // [IN] Hash value.
+ ULONG hashValSize, // [IN] Hash value size.
+ GUID *lang, // [IN] Language GUID.
+ mdDocument *docMdToken) // [OUT] Token of the defined document.
+{
+#ifdef FEATURE_METADATA_EMIT_IN_DEBUGGER
+ return E_NOTIMPL;
+#else //!FEATURE_METADATA_EMIT_IN_DEBUGGER
+ HRESULT hr = S_OK;
+ char delim[2] = "";
+ ULONG docNameBlobSize = 0;
+ ULONG docNameBlobMaxSize = 0;
+ BYTE* docNameBlob = NULL;
+ BYTE* docNameBlobPtr = NULL;
+ ULONG partsCount = 0;
+ ULONG partsIndexesCount = 0;
+ UINT32* partsIndexes = NULL;
+ UINT32* partsIndexesPtr = NULL;
+ char* stringToken = NULL;
+
+ BEGIN_ENTRYPOINT_NOTHROW;
+
+ LOG((LOGMD, "RegMeta::DefineDocument(%s)\n", docName));
+ START_MD_PERF();
+ LOCKWRITE();
+
+ IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
+
+ // determine separator and number of separated parts
+ GetPathSeparator(docName, delim, &partsCount);
+ delim[1] = '\0';
+
+ // allocate the maximum size of a document blob
+ // treating each compressed index to take maximum of 4 bytes.
+ // the actual size will be calculated once we compress each index.
+ docNameBlobMaxSize = sizeof(char) + sizeof(ULONG) * partsCount; // (delim + 4 * partsCount)
+ docNameBlob = new BYTE[docNameBlobMaxSize];
+ partsIndexes = new UINT32[partsCount];
+
+ // add path parts to blob heap and store their indexes
+ partsIndexesPtr = partsIndexes;
+ if (*delim == *docName)
+ {
+ // if the path starts with the delimiter (e.g. /home/user/...) store an empty string
+ *partsIndexesPtr++ = 0;
+ partsIndexesCount++;
+ }
+ stringToken = strtok(docName, (const char*)delim);
+ while (stringToken != NULL)
+ {
+ IfFailGo(m_pStgdb->m_MiniMd.m_BlobHeap.AddBlob(MetaData::DataBlob((BYTE*)stringToken, (ULONG)strlen(stringToken)), partsIndexesPtr++));
+ stringToken = strtok(NULL, (const char*)delim);
+ partsIndexesCount++;
+ }
+
+ _ASSERTE(partsIndexesCount == partsCount);
+
+ // build up the documentBlob ::= separator part+
+ docNameBlobPtr = docNameBlob;
+ // put separator
+ *docNameBlobPtr = delim[0];
+ docNameBlobPtr++;
+ docNameBlobSize++;
+ // put part+: compress and put each part index
+ for (ULONG i = 0; i < partsCount; i++)
+ {
+ ULONG cnt = CorSigCompressData(partsIndexes[i], docNameBlobPtr);
+ docNameBlobPtr += cnt;
+ docNameBlobSize += cnt;
+ }
+
+ _ASSERTE(docNameBlobSize <= docNameBlobMaxSize);
+
+ // Add record
+ ULONG docRecord;
+ DocumentRec* pDocument;
+ IfFailGo(m_pStgdb->m_MiniMd.AddDocumentRecord(&pDocument, &docRecord));
+ // Name column
+ IfFailGo(m_pStgdb->m_MiniMd.PutBlob(TBL_Document, DocumentRec::COL_Name, pDocument, docNameBlob, docNameBlobSize));
+ // HashAlgorithm column
+ IfFailGo(m_pStgdb->m_MiniMd.PutGuid(TBL_Document, DocumentRec::COL_HashAlgorithm, pDocument, *hashAlg));
+ // HashValue column
+ IfFailGo(m_pStgdb->m_MiniMd.PutBlob(TBL_Document, DocumentRec::COL_Hash, pDocument, hashVal, hashValSize));
+ // Language column
+ IfFailGo(m_pStgdb->m_MiniMd.PutGuid(TBL_Document, DocumentRec::COL_Language, pDocument, *lang));
+
+ *docMdToken = TokenFromRid(docRecord, mdtDocument);
+
+ErrExit:
+ if (docNameBlob != NULL)
+ delete[] docNameBlob;
+
+ if (partsIndexes != NULL)
+ delete[] partsIndexes;
+
+ STOP_MD_PERF(DefineDocument);
+
+ END_ENTRYPOINT_NOTHROW;
+ return hr;
+#endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER
+} // RegMeta::DefineDocument
+
+//*****************************************************************************
+// Defines sequence points for portable PDB metadata
+//*****************************************************************************
+STDMETHODIMP RegMeta::DefineSequencePoints( // S_OK or error.
+ ULONG docRid, // [IN] Document RID.
+ BYTE *sequencePtsBlob, // [IN] Sequence point blob.
+ ULONG sequencePtsBlobSize) // [IN] Sequence point blob size.
+{
+#ifdef FEATURE_METADATA_EMIT_IN_DEBUGGER
+ return E_NOTIMPL;
+#else //!FEATURE_METADATA_EMIT_IN_DEBUGGER
+ HRESULT hr = S_OK;
+
+ BEGIN_ENTRYPOINT_NOTHROW;
+
+ LOG((LOGMD, "RegMeta::DefineSequencePoints()\n"));
+ START_MD_PERF();
+
+ LOCKWRITE();
+
+ IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
+
+ ULONG methodDbgInfoRec;
+ MethodDebugInformationRec* pMethodDbgInfo;
+ IfFailGo(m_pStgdb->m_MiniMd.AddMethodDebugInformationRecord(&pMethodDbgInfo, &methodDbgInfoRec));
+ // Document column
+ IfFailGo(m_pStgdb->m_MiniMd.PutCol(TBL_MethodDebugInformation,
+ MethodDebugInformationRec::COL_Document, pMethodDbgInfo, docRid));
+ // Sequence points column
+ IfFailGo(m_pStgdb->m_MiniMd.PutBlob(TBL_MethodDebugInformation,
+ MethodDebugInformationRec::COL_SequencePoints, pMethodDbgInfo, sequencePtsBlob, sequencePtsBlobSize));
+
+ErrExit:
+ STOP_MD_PERF(DefineSequencePoints);
+
+ END_ENTRYPOINT_NOTHROW;
+ return hr;
+#endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER
+} // RegMeta::DefineSequencePoints
+
+//*****************************************************************************
+// Defines a local scope for portable PDB metadata
+//*****************************************************************************
+STDMETHODIMP RegMeta::DefineLocalScope( // S_OK or error.
+ ULONG methodDefRid, // [IN] Method RID.
+ ULONG importScopeRid, // [IN] Import scope RID.
+ ULONG firstLocalVarRid, // [IN] First local variable RID (of the continous run).
+ ULONG firstLocalConstRid, // [IN] First local constant RID (of the continous run).
+ ULONG startOffset, // [IN] Start offset of the scope.
+ ULONG length) // [IN] Scope length.
+{
+#ifdef FEATURE_METADATA_EMIT_IN_DEBUGGER
+ return E_NOTIMPL;
+#else //!FEATURE_METADATA_EMIT_IN_DEBUGGER
+ HRESULT hr = S_OK;
+
+ BEGIN_ENTRYPOINT_NOTHROW;
+
+ LOG((LOGMD, "RegMeta::DefineLocalScope()\n"));
+ START_MD_PERF();
+
+ LOCKWRITE();
+
+ IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
+
+ ULONG localScopeRecord;
+ LocalScopeRec* pLocalScope;
+ IfFailGo(m_pStgdb->m_MiniMd.AddLocalScopeRecord(&pLocalScope, &localScopeRecord));
+ IfFailGo(m_pStgdb->m_MiniMd.PutCol(TBL_LocalScope, LocalScopeRec::COL_Method, pLocalScope, methodDefRid));
+ IfFailGo(m_pStgdb->m_MiniMd.PutCol(TBL_LocalScope, LocalScopeRec::COL_ImportScope, pLocalScope, importScopeRid));
+ IfFailGo(m_pStgdb->m_MiniMd.PutCol(TBL_LocalScope, LocalScopeRec::COL_VariableList, pLocalScope, firstLocalVarRid));
+ IfFailGo(m_pStgdb->m_MiniMd.PutCol(TBL_LocalScope, LocalScopeRec::COL_ConstantList, pLocalScope, firstLocalConstRid));
+ IfFailGo(m_pStgdb->m_MiniMd.PutCol(TBL_LocalScope, LocalScopeRec::COL_StartOffset, pLocalScope, startOffset));
+ IfFailGo(m_pStgdb->m_MiniMd.PutCol(TBL_LocalScope, LocalScopeRec::COL_Length, pLocalScope, length));
+
+ // TODO: Force set sorted tables flag, do this properly
+ m_pStgdb->m_MiniMd.SetSorted(TBL_LocalScope, true);
+
+ErrExit:
+ STOP_MD_PERF(DefineLocalScope);
+
+ END_ENTRYPOINT_NOTHROW;
+ return hr;
+#endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER
+} // RegMeta::DefineLocalScope
+
+//*****************************************************************************
+// Defines a local variable for portable PDB metadata
+//*****************************************************************************
+STDMETHODIMP RegMeta::DefineLocalVariable( // S_OK or error.
+ USHORT attribute, // [IN] Variable attribute.
+ USHORT index, // [IN] Variable index (slot).
+ char *name, // [IN] Variable name.
+ mdLocalVariable* locVarToken) // [OUT] Token of the defined variable.
+{
+#ifdef FEATURE_METADATA_EMIT_IN_DEBUGGER
+ return E_NOTIMPL;
+#else //!FEATURE_METADATA_EMIT_IN_DEBUGGER
+ HRESULT hr = S_OK;
+
+ BEGIN_ENTRYPOINT_NOTHROW;
+
+ LOG((LOGMD, "RegMeta::DefineLocalVariable(%s)\n", name));
+ START_MD_PERF();
+
+ LOCKWRITE();
+
+ IfFailGo(m_pStgdb->m_MiniMd.PreUpdate());
+
+ ULONG localVariableRecord;
+ LocalVariableRec* pLocalVariable;
+ IfFailGo(m_pStgdb->m_MiniMd.AddLocalVariableRecord(&pLocalVariable, &localVariableRecord));
+ IfFailGo(m_pStgdb->m_MiniMd.PutString(TBL_LocalVariable, LocalVariableRec::COL_Name, pLocalVariable, name));
+
+ pLocalVariable->SetAttributes(attribute);
+ pLocalVariable->SetIndex(index);
+
+ *locVarToken = TokenFromRid(localVariableRecord, mdtLocalVariable);
+
+ErrExit:
+ STOP_MD_PERF(DefineLocalVariable);
+
+ END_ENTRYPOINT_NOTHROW;
+ return hr;
+#endif //!FEATURE_METADATA_EMIT_IN_DEBUGGER
+} // RegMeta::DefineLocalVariable
+#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB
+
//*****************************************************************************
// Create and set a MethodSpec record.
//*****************************************************************************
diff --git a/src/coreclr/src/md/compiler/helper.cpp b/src/coreclr/src/md/compiler/helper.cpp
index 8c8662c8dc5a..a4e7b10c8bed 100644
--- a/src/coreclr/src/md/compiler/helper.cpp
+++ b/src/coreclr/src/md/compiler/helper.cpp
@@ -369,6 +369,62 @@ HRESULT RegMeta::AddInterfaceImpl( // Return hresult.
return hr;
} // RegMeta::AddInterfaceImpl
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+//*******************************************************************************
+// Helper to determine path separator and number of separated parts.
+//
+// Implements internal API code:IMDInternalEmit::GetPathSeparator.
+//*******************************************************************************
+HRESULT
+RegMeta::GetPathSeparator(
+ char *path,
+ char *separator,
+ ULONG *partsCount)
+{
+ const char delimiters[] = { '\\', '/', '\0'};
+ ULONG tokens = 1;
+
+ // try first
+ char delim = delimiters[0];
+ char* charPtr = strchr(path, delim);
+
+ if (charPtr != NULL)
+ {
+ // count tokens
+ while (charPtr != NULL)
+ {
+ tokens++;
+ charPtr = strchr(charPtr + 1, delim);
+ }
+ }
+ else
+ {
+ // try second
+ delim = delimiters[1];
+ charPtr = strchr(path, delim);
+ if (charPtr != NULL)
+ {
+ // count tokens
+ while (charPtr != NULL)
+ {
+ tokens++;
+ charPtr = strchr(charPtr + 1, delim);
+ }
+ }
+ else
+ {
+ // delimiter not found - set to \0;
+ delim = delimiters[2];
+ }
+ }
+
+ *separator = delim;
+ *partsCount = tokens;
+
+ return S_OK;
+} // RegMeta::GetPathSeparator
+#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB
+
#endif //FEATURE_METADATA_EMIT && FEATURE_METADATA_INTERNAL_APIS
#ifdef FEATURE_METADATA_INTERNAL_APIS
diff --git a/src/coreclr/src/md/compiler/regmeta.cpp b/src/coreclr/src/md/compiler/regmeta.cpp
index c411346c0d20..11c1974c157d 100644
--- a/src/coreclr/src/md/compiler/regmeta.cpp
+++ b/src/coreclr/src/md/compiler/regmeta.cpp
@@ -276,6 +276,53 @@ RegMeta::CreateNewMD()
return hr;
} // RegMeta::CreateNewMD
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+//*****************************************************************************
+// Create new stgdb for portable pdb
+//*****************************************************************************
+__checkReturn
+HRESULT
+RegMeta::CreateNewPortablePdbMD()
+{
+ HRESULT hr = NOERROR;
+ // TODO: move the constant to a better location
+ static const char* PDB_VERSION = "PDB v1.0";
+ size_t len = strlen(PDB_VERSION) + 1;
+
+ m_OpenFlags = ofWrite;
+
+ // Allocate our m_pStgdb.
+ _ASSERTE(m_pStgdb == NULL);
+ IfNullGo(m_pStgdb = new (nothrow) CLiteWeightStgdbRW);
+
+ // Initialize the new, empty database.
+
+ // First tell the new database what sort of metadata to create
+ m_pStgdb->m_MiniMd.m_OptionValue.m_MetadataVersion = m_OptionValue.m_MetadataVersion;
+ m_pStgdb->m_MiniMd.m_OptionValue.m_InitialSize = m_OptionValue.m_InitialSize;
+ IfFailGo(m_pStgdb->InitNew());
+
+ // Set up the pdb version
+ m_OptionValue.m_RuntimeVersion = new char[len];
+ strcpy_s(m_OptionValue.m_RuntimeVersion, len, PDB_VERSION);
+
+ IfFailGo(m_pStgdb->m_MiniMd.SetOption(&m_OptionValue));
+
+ if (IsThreadSafetyOn())
+ {
+ m_pSemReadWrite = new (nothrow) UTSemReadWrite();
+ IfNullGo(m_pSemReadWrite);
+ IfFailGo(m_pSemReadWrite->Init());
+ m_fOwnSem = true;
+
+ INDEBUG(m_pStgdb->m_MiniMd.Debug_SetLock(m_pSemReadWrite);)
+ }
+
+ErrExit:
+ return hr;
+} // RegMeta::CreateNewPortablePdbMD
+#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB
+
#endif //FEATURE_METADATA_EMIT
//*****************************************************************************
@@ -545,6 +592,13 @@ RegMeta::QueryInterface(
*ppUnk = (IMetaDataEmit2 *)this;
fIsInterfaceRW = true;
}
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+ else if (riid == IID_IMetaDataEmit3)
+ {
+ *ppUnk = (IMetaDataEmit3 *)this;
+ fIsInterfaceRW = true;
+ }
+#endif
else if (riid == IID_IMetaDataAssemblyEmit)
{
*ppUnk = (IMetaDataAssemblyEmit *)this;
diff --git a/src/coreclr/src/md/compiler/regmeta.h b/src/coreclr/src/md/compiler/regmeta.h
index 1da1afaf8bdc..82be41bbb472 100644
--- a/src/coreclr/src/md/compiler/regmeta.h
+++ b/src/coreclr/src/md/compiler/regmeta.h
@@ -148,7 +148,11 @@ class RegMeta :
, public IMetaDataInfo
#ifdef FEATURE_METADATA_EMIT
+#ifndef FEATURE_METADATA_EMIT_PORTABLE_PDB
, public IMetaDataEmit2
+#else
+ , public IMetaDataEmit3
+#endif
, public IMetaDataAssemblyEmit
#endif
@@ -1104,6 +1108,47 @@ class RegMeta :
DWORD reserved, // [IN] For future use (e.g. non-type parameters)
mdToken rtkConstraints[]); // [IN] Array of type constraints (TypeDef,TypeRef,TypeSpec)
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+//*****************************************************************************
+// IMetaDataEmit3 methods
+//*****************************************************************************
+ STDMETHODIMP GetReferencedTypeSysTables(// S_OK or error.
+ ULONG64 *refTables, // [OUT] Bit vector of referenced type system metadata tables.
+ ULONG refTableRows[], // [OUT] Array of number of rows for each referenced type system table.
+ const ULONG maxTableRowsSize, // [IN] Max size of the rows array.
+ ULONG *tableRowsSize); // [OUT] Actual size of the rows array.
+
+ STDMETHODIMP DefinePdbStream( // S_OK or error.
+ PORT_PDB_STREAM* pdbStream); // [IN] Portable pdb stream data.
+
+ STDMETHODIMP DefineDocument( // S_OK or error.
+ char *docName, // [IN] Document name (string will be tokenized).
+ GUID *hashAlg, // [IN] Hash algorithm GUID.
+ BYTE *hashVal, // [IN] Hash value.
+ ULONG hashValSize, // [IN] Hash value size.
+ GUID *lang, // [IN] Language GUID.
+ mdDocument *docMdToken); // [OUT] Token of the defined document.
+
+ STDMETHODIMP DefineSequencePoints( // S_OK or error.
+ ULONG docRid, // [IN] Document RID.
+ BYTE *sequencePtsBlob, // [IN] Sequence point blob.
+ ULONG sequencePtsBlobSize); // [IN] Sequence point blob size.
+
+ STDMETHODIMP DefineLocalScope( // S_OK or error.
+ ULONG methodDefRid, // [IN] Method RID.
+ ULONG importScopeRid, // [IN] Import scope RID.
+ ULONG firstLocalVarRid, // [IN] First local variable RID (of the continous run).
+ ULONG firstLocalConstRid, // [IN] First local constant RID (of the continous run).
+ ULONG startOffset, // [IN] Start offset of the scope.
+ ULONG length); // [IN] Scope length.
+
+ STDMETHODIMP DefineLocalVariable( // S_OK or error.
+ USHORT attribute, // [IN] Variable attribute.
+ USHORT index, // [IN] Variable index (slot).
+ char *name, // [IN] Variable name.
+ mdLocalVariable *locVarToken); // [OUT] Token of the defined variable.
+#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB
+
//*****************************************************************************
// IMetaDataAssemblyEmit
//*****************************************************************************
@@ -1255,6 +1300,13 @@ class RegMeta :
STDMETHOD(SetMDUpdateMode)(
ULONG updateMode, ULONG *pPreviousUpdateMode);
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+ STDMETHODIMP GetPathSeparator( // S_OK or error.
+ char *path, // [IN] Path string to search.
+ char *separator, // [OUT] Separator used in path string, NULL if none.
+ ULONG *partsCount); // [OUT] Number of parts separated by the separator.
+#endif
+
//*****************************************************************************
// IMetaDataHelper
//*****************************************************************************
@@ -1561,6 +1613,10 @@ class RegMeta :
HRESULT CreateNewMD();
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+ HRESULT CreateNewPortablePdbMD();
+#endif
+
HRESULT OpenExistingMD(
LPCWSTR szDatabase, // Name of database.
void *pbData, // Data to open on top of, 0 default.
@@ -1924,6 +1980,9 @@ class RegMeta :
#undef MiniMdTable
#define MiniMdTable(x) HRESULT Validate##x(RID rid);
MiniMdTables()
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+ PortablePdbMiniMdTables()
+#endif
// Validate a record in a generic sense using Meta-Meta data.
STDMETHODIMP ValidateRecord(ULONG ixTbl, ULONG ulRow);
diff --git a/src/coreclr/src/md/enc/CMakeLists.txt b/src/coreclr/src/md/enc/CMakeLists.txt
index bf209317d032..14ed0a267fae 100644
--- a/src/coreclr/src/md/enc/CMakeLists.txt
+++ b/src/coreclr/src/md/enc/CMakeLists.txt
@@ -8,6 +8,7 @@ set(MDRUNTIMERW_SOURCES
stgtiggerstorage.cpp
stgtiggerstream.cpp
mdinternalrw.cpp
+ pdbheap.cpp
)
set(MDRUNTIMERW_HEADERS
@@ -29,6 +30,9 @@ set(MDRUNTIMERW_HEADERS
../inc/metamodel.h
../inc/metamodelro.h
../inc/metamodelrw.h
+ ../inc/pdbheap.h
+ ../inc/portablepdbmdds.h
+ ../inc/portablepdbmdi.h
../inc/rwutil.h
../inc/stgio.h
../inc/stgtiggerstorage.h
@@ -59,3 +63,7 @@ target_precompile_header(TARGET mdruntimerw-dbi HEADER stdafx.h)
add_library_clr(mdruntimerw_crossgen ${MDRUNTIMERW_SOURCES})
set_target_properties(mdruntimerw_crossgen PROPERTIES CROSSGEN_COMPONENT TRUE)
target_precompile_header(TARGET mdruntimerw_crossgen HEADER stdafx.h)
+
+add_library_clr(mdruntimerw_ppdb ${MDRUNTIMERW_SOURCES})
+target_compile_definitions(mdruntimerw_ppdb PRIVATE FEATURE_METADATA_EMIT_ALL FEATURE_METADATA_EMIT_PORTABLE_PDB)
+target_precompile_header(TARGET mdruntimerw_ppdb HEADER stdafx.h)
\ No newline at end of file
diff --git a/src/coreclr/src/md/enc/liteweightstgdbrw.cpp b/src/coreclr/src/md/enc/liteweightstgdbrw.cpp
index 5e5fbe9314ff..236c051706cd 100644
--- a/src/coreclr/src/md/enc/liteweightstgdbrw.cpp
+++ b/src/coreclr/src/md/enc/liteweightstgdbrw.cpp
@@ -126,6 +126,13 @@ CLiteWeightStgdbRW::~CLiteWeightStgdbRW()
{
delete [] m_wszFileName;
}
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+ if (m_pPdbHeap != NULL)
+ {
+ delete m_pPdbHeap;
+ m_pPdbHeap = NULL;
+ }
+#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB
}
//*****************************************************************************
@@ -506,7 +513,9 @@ HRESULT CLiteWeightStgdbRW::InitNew()
{
InitializeLogging();
LOG((LF_METADATA, LL_INFO10, "Metadata logging enabled\n"));
-
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+ m_pPdbHeap = new PdbHeap();
+#endif
//@FUTURE: should probably init the pools here instead of in the MiniMd.
return m_MiniMd.InitNew();
}
@@ -553,6 +562,24 @@ HRESULT CLiteWeightStgdbRW::GetSaveSize(// S_OK or error.
}
}
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+ // [IMPORTANT]:
+ // Apparently, string pool must exist in the portable PDB metadata in order to be recognized
+ // by the VS debugger. For this purpose, we are adding a dummy " " value in cases when
+ // the string pool is empty.
+ // Interestingly enough, similar is done for user string pool (check above #549).
+ // TODO: do this in a more clever way, and check if/why/when this is necessary
+ if (m_MiniMd.m_StringHeap.GetUnalignedSize() <= 1)
+ {
+ if (!IsENCDelta(m_MiniMd.m_OptionValue.m_UpdateMode) &&
+ !m_MiniMd.IsMinimalDelta())
+ {
+ UINT32 nIndex_Ignore;
+ IfFailGo(m_MiniMd.m_StringHeap.AddString(" ", &nIndex_Ignore));
+ }
+ }
+#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB
+
// If we're saving a delta metadata, figure out how much space it will take to
// save the minimal metadata stream (used only to identify that we have a delta
// metadata... nothing should be in that stream.
@@ -614,6 +641,10 @@ HRESULT CLiteWeightStgdbRW::GetSaveSize(// S_OK or error.
cbTotal += cbSize;
IfFailGo(GetPoolSaveSize(BLOB_POOL_STREAM, MDPoolBlobs, &cbSize));
cbTotal += cbSize;
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+ IfFailGo(GetPoolSaveSize(PDB_STREAM, NULL, &cbSize));
+ cbTotal += cbSize;
+#endif
// Finally, ask the storage system to add fixed overhead it needs for the
// file format. The overhead of each stream has already be calculated as
@@ -655,31 +686,51 @@ CLiteWeightStgdbRW::GetPoolSaveSize(
{
UINT32 cbSize = 0; // Size of pool data.
UINT32 cbStream; // Size of just the stream.
- HRESULT hr;
+ HRESULT hr = S_OK;
*pcbSaveSize = 0;
- // If there is no data, then don't bother.
- if (m_MiniMd.IsPoolEmpty(iPool))
- return (S_OK);
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+ // Treat PDB stream differently since we are not using StgPools
+ if (wcscmp(PDB_STREAM, szHeap) == 0)
+ {
+ if (m_pPdbHeap && !m_pPdbHeap->IsEmpty())
+ {
+ cbSize = m_pPdbHeap->GetSize();
+ IfFailGo(AddStreamToList(cbSize, szHeap));
+ IfFailGo(TiggerStorage::GetStreamSaveSize(szHeap, cbSize, &cbSize));
+ *pcbSaveSize = cbSize;
+ }
+ else
+ {
+ goto ErrExit;
+ }
+ }
+ else
+#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB
+ {
+ // If there is no data, then don't bother.
+ if (m_MiniMd.IsPoolEmpty(iPool))
+ return (S_OK);
- // Ask the pool to size its data.
- IfFailGo(m_MiniMd.GetPoolSaveSize(iPool, &cbSize));
- cbStream = cbSize;
+ // Ask the pool to size its data.
+ IfFailGo(m_MiniMd.GetPoolSaveSize(iPool, &cbSize));
+ cbStream = cbSize;
- // Add this item to the save list.
- IfFailGo(AddStreamToList(cbSize, szHeap));
+ // Add this item to the save list.
+ IfFailGo(AddStreamToList(cbSize, szHeap));
- // Ask the storage system to add stream fixed overhead.
- IfFailGo(TiggerStorage::GetStreamSaveSize(szHeap, cbSize, &cbSize));
+ // Ask the storage system to add stream fixed overhead.
+ IfFailGo(TiggerStorage::GetStreamSaveSize(szHeap, cbSize, &cbSize));
- // Log the size info.
- LOG((LF_METADATA, LL_INFO10, "Metadata: GetSaveSize for %ls: %d data, %d total.\n",
- szHeap, cbStream, cbSize));
+ // Log the size info.
+ LOG((LF_METADATA, LL_INFO10, "Metadata: GetSaveSize for %ls: %d data, %d total.\n",
+ szHeap, cbStream, cbSize));
- // Give the size of the pool to the caller's total.
- *pcbSaveSize = cbSize;
+ // Give the size of the pool to the caller's total.
+ *pcbSaveSize = cbSize;
+ }
ErrExit:
return hr;
@@ -896,6 +947,9 @@ HRESULT CLiteWeightStgdbRW::SaveToStorage(
IfFailGo(SavePool(US_BLOB_POOL_STREAM, pStorage, MDPoolUSBlobs));
IfFailGo(SavePool(GUID_POOL_STREAM, pStorage, MDPoolGuids));
IfFailGo(SavePool(BLOB_POOL_STREAM, pStorage, MDPoolBlobs));
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+ IfFailGo(SavePool(PDB_STREAM, pStorage, NULL));
+#endif
// Write the header to disk.
OptionValue ov;
@@ -929,17 +983,37 @@ HRESULT CLiteWeightStgdbRW::SavePool( // Return code.
int iPool) // The pool to save.
{
IStream *pIStream=0; // For writing.
- HRESULT hr;
+ HRESULT hr = S_OK;
- // If there is no data, then don't bother.
- if (m_MiniMd.IsPoolEmpty(iPool))
- return (S_OK);
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+ // Treat PDB stream differently since we are not using StgPools
+ if (wcscmp(PDB_STREAM, szName) == 0)
+ {
+ if (m_pPdbHeap && !m_pPdbHeap->IsEmpty())
+ {
+ IfFailGo(pStorage->CreateStream(szName,
+ STGM_DIRECT | STGM_READWRITE | STGM_SHARE_EXCLUSIVE,
+ 0, 0, &pIStream));
+ IfFailGo(m_pPdbHeap->SaveToStream(pIStream));
+ }
+ else
+ {
+ goto ErrExit;
+ }
+ }
+ else
+#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB
+ {
+ // If there is no data, then don't bother.
+ if (m_MiniMd.IsPoolEmpty(iPool))
+ return (S_OK);
- // Create the new stream to hold this table and save it.
- IfFailGo(pStorage->CreateStream(szName,
+ // Create the new stream to hold this table and save it.
+ IfFailGo(pStorage->CreateStream(szName,
STGM_DIRECT | STGM_READWRITE | STGM_SHARE_EXCLUSIVE,
0, 0, &pIStream));
- IfFailGo(m_MiniMd.SavePoolToStream(iPool, pIStream));
+ IfFailGo(m_MiniMd.SavePoolToStream(iPool, pIStream));
+ }
ErrExit:
if (pIStream)
diff --git a/src/coreclr/src/md/enc/metamodelrw.cpp b/src/coreclr/src/md/enc/metamodelrw.cpp
index ac0e400be4e2..c48dc5a36b31 100644
--- a/src/coreclr/src/md/enc/metamodelrw.cpp
+++ b/src/coreclr/src/md/enc/metamodelrw.cpp
@@ -146,6 +146,22 @@ g_TblSizeInfo[MDSizeIndex_Count][TBL_COUNT] =
0, // GenericParam
0, // MethodSpec
0, // GenericParamConstraint
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+ /* Dummy tables to fill the gap to 0x30 */
+ 0, // Dummy1
+ 0, // Dummy2
+ 0, // Dummy3
+ /* Actual portable PDB tables */
+ 0, // Document
+ 0, // MethodDebugInformation
+ 0, // LocalScope
+ 0, // LocalVariable
+ 0, // LocalConstant
+ 0, // ImportScope
+ // TODO:
+ // 0, // StateMachineMethod
+ // 0, // CustomDebugInformation
+#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB
},
// Minimal table sizes (code:MDSizeIndex_Minimal).
{
@@ -194,6 +210,22 @@ g_TblSizeInfo[MDSizeIndex_Count][TBL_COUNT] =
0, // GenericParam
0, // MethodSpec
0, // GenericParamConstraint
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+ /* Dummy tables to fill the gap to 0x30 */
+ 0, // Dummy1
+ 0, // Dummy2
+ 0, // Dummy3
+ /* Actual portable PDB tables */
+ 0, // Document
+ 0, // MethodDebugInformation
+ 0, // LocalScope
+ 0, // LocalVariable
+ 0, // LocalConstant
+ 0, // ImportScope
+ // TODO:
+ // 0, // StateMachineMethod
+ // 0, // CustomDebugInformation
+#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB
}
}; // g_TblSizeInfo
@@ -252,6 +284,22 @@ const TblIndex g_TblIndex[TBL_COUNT] =
{(ULONG) -1, (ULONG) -1, mdtGenericParam}, // GenericParam
{(ULONG) -1, (ULONG) -1, mdtMethodSpec}, // MethodSpec
{(ULONG) -1, (ULONG) -1, mdtGenericParamConstraint},// GenericParamConstraint
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+ /* Dummy tables to fill the gap to 0x30 */
+ {(ULONG)-1, (ULONG)-1, (ULONG)-1}, // Dummy1
+ {(ULONG)-1, (ULONG)-1, (ULONG)-1}, // Dummy2
+ {(ULONG)-1, (ULONG)-1, (ULONG)-1}, // Dummy3
+ /* Actual portable PDB tables */
+ {(ULONG)-1, (ULONG)-1, mdtDocument}, // Document
+ {(ULONG)-1, (ULONG)-1, mdtMethodDebugInformation},// MethodDebugInformation
+ {(ULONG)-1, (ULONG)-1, mdtLocalScope}, // LocalScope
+ {(ULONG)-1, (ULONG)-1, mdtLocalVariable}, // LocalVariable
+ {(ULONG)-1, (ULONG)-1, mdtLocalConstant}, // LocalConstant
+ {(ULONG) -1, (ULONG) -1, mdtImportScope}, // ImportScope
+ // TODO:
+ // {(ULONG) -1, (ULONG) -1, mdtStateMachineMethod},// StateMachineMethod
+ // {(ULONG) -1, (ULONG) -1, mdtCustomDebugInformation},// CustomDebugInformation
+#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB
};
ULONG CMiniMdRW::m_TruncatedEncTables[] =
diff --git a/src/coreclr/src/md/enc/pdbheap.cpp b/src/coreclr/src/md/enc/pdbheap.cpp
new file mode 100644
index 000000000000..8305986f8c0c
--- /dev/null
+++ b/src/coreclr/src/md/enc/pdbheap.cpp
@@ -0,0 +1,73 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+#include "stdafx.h"
+#include "pdbheap.h"
+
+PdbHeap::PdbHeap() : m_data(NULL), m_size(0)
+{
+}
+
+PdbHeap::~PdbHeap()
+{
+ if (m_data != NULL)
+ {
+ delete[] m_data;
+ m_data = NULL;
+ }
+}
+
+__checkReturn
+HRESULT PdbHeap::SetData(PORT_PDB_STREAM* data)
+{
+ m_size = sizeof(data->id) +
+ sizeof(data->entryPoint) +
+ sizeof(data->referencedTypeSystemTables) +
+ (sizeof(ULONG) * data->typeSystemTableRowsSize);
+ m_data = new BYTE[m_size];
+
+ ULONG offset = 0;
+ if (memcpy_s(m_data + offset, m_size, &data->id, sizeof(data->id)))
+ return E_FAIL;
+ offset += sizeof(data->id);
+
+ if (memcpy_s(m_data + offset, m_size, &data->entryPoint, sizeof(data->entryPoint)))
+ return E_FAIL;
+ offset += sizeof(data->entryPoint);
+
+ if (memcpy_s(m_data + offset, m_size, &data->referencedTypeSystemTables, sizeof(data->referencedTypeSystemTables)))
+ return E_FAIL;
+ offset += sizeof(data->referencedTypeSystemTables);
+
+ if (memcpy_s(m_data + offset, m_size, data->typeSystemTableRows, sizeof(ULONG) * data->typeSystemTableRowsSize))
+ return E_FAIL;
+ offset += sizeof(ULONG) * data->typeSystemTableRowsSize;
+
+ _ASSERTE(offset == m_size);
+
+ return S_OK;
+}
+
+__checkReturn
+HRESULT PdbHeap::SaveToStream(IStream* stream)
+{
+ HRESULT hr = S_OK;
+ if (!IsEmpty())
+ {
+ ULONG written = 0;
+ hr = stream->Write(m_data, m_size, &written);
+ _ASSERTE(m_size == written);
+ }
+ return hr;
+}
+
+BOOL PdbHeap::IsEmpty()
+{
+ return m_size == 0;
+}
+
+ULONG PdbHeap::GetSize()
+{
+ return m_size;
+}
diff --git a/src/coreclr/src/md/hotdata/CMakeLists.txt b/src/coreclr/src/md/hotdata/CMakeLists.txt
index 6f7a2891d20c..03430e292c75 100644
--- a/src/coreclr/src/md/hotdata/CMakeLists.txt
+++ b/src/coreclr/src/md/hotdata/CMakeLists.txt
@@ -44,3 +44,7 @@ if(CLR_CMAKE_HOST_WIN32)
add_library_clr(mdhotdata-staticcrt ${MDHOTDATA_SOURCES})
target_precompile_header(TARGET mdhotdata-staticcrt HEADER external.h)
endif(CLR_CMAKE_HOST_WIN32)
+
+add_library_clr(mdhotdata_ppdb ${MDHOTDATA_SOURCES})
+target_compile_definitions(mdhotdata_ppdb PRIVATE FEATURE_METADATA_EMIT_PORTABLE_PDB)
+target_precompile_header(TARGET mdhotdata_ppdb HEADER external.h)
\ No newline at end of file
diff --git a/src/coreclr/src/md/inc/liteweightstgdb.h b/src/coreclr/src/md/inc/liteweightstgdb.h
index 1e35df09cccb..062dee00a591 100644
--- a/src/coreclr/src/md/inc/liteweightstgdb.h
+++ b/src/coreclr/src/md/inc/liteweightstgdb.h
@@ -21,6 +21,9 @@
class StgIO;
#include "mdcommon.h"
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+#include "pdbheap.h"
+#endif
#ifdef _PREFAST_
#pragma warning(push)
@@ -109,6 +112,9 @@ class CLiteWeightStgdbRW : public CLiteWeightStgdb
m_dwPEKind = (DWORD)(-1);
m_dwDatabaseLFS = 0;
m_dwDatabaseLFT = 0;
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+ m_pPdbHeap = NULL;
+#endif
}
~CLiteWeightStgdbRW();
@@ -250,7 +256,9 @@ class CLiteWeightStgdbRW : public CLiteWeightStgdb
DWORD m_dwDatabaseLFT; // Low bytes of the database file's last write time
DWORD m_dwDatabaseLFS; // Low bytes of the database file's size
StgIO * m_pStgIO; // For file i/o.
-
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+ PdbHeap *m_pPdbHeap;
+#endif
}; // class CLiteWeightStgdbRW
#endif // __LiteWeightStgdb_h__
diff --git a/src/coreclr/src/md/inc/mdcolumndescriptors.h b/src/coreclr/src/md/inc/mdcolumndescriptors.h
index 21a46afec72b..496aa6c33e28 100644
--- a/src/coreclr/src/md/inc/mdcolumndescriptors.h
+++ b/src/coreclr/src/md/inc/mdcolumndescriptors.h
@@ -48,3 +48,19 @@ static const BYTE s_NestedClassCol[];
static const BYTE s_GenericParamCol[];
static const BYTE s_MethodSpecCol[];
static const BYTE s_GenericParamConstraintCol[];
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+// Dummy descriptors to fill the gap to 0x30
+static const BYTE s_Dummy1Col[];
+static const BYTE s_Dummy2Col[];
+static const BYTE s_Dummy3Col[];
+// Actual portable PDB tables descriptors
+static const BYTE s_DocumentCol[];
+static const BYTE s_MethodDebugInformationCol[];
+static const BYTE s_LocalScopeCol[];
+static const BYTE s_LocalVariableCol[];
+static const BYTE s_LocalConstantCol[];
+static const BYTE s_ImportScopeCol[];
+// TODO:
+// static const BYTE s_StateMachineMethodCol[];
+// static const BYTE s_CustomDebugInformationCol[];
+#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB
diff --git a/src/coreclr/src/md/inc/metamodel.h b/src/coreclr/src/md/inc/metamodel.h
index c48a69872488..d06932e10110 100644
--- a/src/coreclr/src/md/inc/metamodel.h
+++ b/src/coreclr/src/md/inc/metamodel.h
@@ -21,6 +21,11 @@
#include "../datablob.h"
#include "../debug_metadata.h"
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+#include "portablepdbmdds.h"
+#include "portablepdbmdi.h"
+#endif
+
#define ALLOCATED_MEMORY_MARKER 0xff
// Version numbers for metadata format.
@@ -1595,6 +1600,9 @@ template class CMiniMdTemplate : public CMiniMdBase
#undef MiniMdTable
#define MiniMdTable(tbl) ULONG getCount##tbl##s() { return _TBLCNT(tbl); }
MiniMdTables();
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+ PortablePdbMiniMdTables();
+#endif
// macro misspells some names.
ULONG getCountProperties() {return getCountPropertys();}
ULONG getCountMethodSemantics() {return getCountMethodSemanticss();}
@@ -1607,6 +1615,9 @@ template class CMiniMdTemplate : public CMiniMdBase
#define MiniMdTable(tbl) __checkReturn HRESULT Get##tbl##Record(RID rid, tbl##Rec **ppRecord) { \
return getRow(TBL_##tbl, rid, reinterpret_cast(ppRecord)); }
MiniMdTables();
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+ PortablePdbMiniMdTables();
+#endif
//*************************************************************************
// These are specialized searching functions. Mostly generic (ie, find
diff --git a/src/coreclr/src/md/inc/metamodelrw.h b/src/coreclr/src/md/inc/metamodelrw.h
index 87917890da83..51cb0707c891 100644
--- a/src/coreclr/src/md/inc/metamodelrw.h
+++ b/src/coreclr/src/md/inc/metamodelrw.h
@@ -381,6 +381,18 @@ class CMiniMdRW : public CMiniMdTemplate
AddTblRecord(MethodSpec)
AddTblRecord(GenericParamConstraint)
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+ AddTblRecord(Document)
+ AddTblRecord(MethodDebugInformation)
+ AddTblRecord(LocalScope)
+ AddTblRecord(LocalVariable)
+ AddTblRecord(LocalConstant)
+ AddTblRecord(ImportScope)
+ // TODO:
+ // AddTblRecord(StateMachineMethod)
+ // AddTblRecord(CustomDebugInformation)
+#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB
+
// Specialized AddXxxToYyy() functions.
__checkReturn HRESULT AddMethodToTypeDef(RID td, RID md);
__checkReturn HRESULT AddFieldToTypeDef(RID td, RID md);
diff --git a/src/coreclr/src/md/inc/pdbheap.h b/src/coreclr/src/md/inc/pdbheap.h
new file mode 100644
index 000000000000..0f5d25a91b20
--- /dev/null
+++ b/src/coreclr/src/md/inc/pdbheap.h
@@ -0,0 +1,34 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+#ifndef _PDBHEAP_H_
+#define _PDBHEAP_H_
+
+#if _MSC_VER >= 1100
+#pragma once
+#endif
+
+#include "metamodel.h"
+#include "portablepdbmdds.h"
+
+/* Simple storage class (similar to StgPool) holding pdbstream data
+** for portable PDB metadata.
+*/
+class PdbHeap
+{
+public:
+ PdbHeap();
+ ~PdbHeap();
+
+ __checkReturn HRESULT SetData(PORT_PDB_STREAM* data);
+ __checkReturn HRESULT SaveToStream(IStream* stream);
+ BOOL IsEmpty();
+ ULONG GetSize();
+
+private:
+ BYTE* m_data;
+ ULONG m_size;
+};
+
+#endif
diff --git a/src/coreclr/src/md/inc/portablepdbmdds.h b/src/coreclr/src/md/inc/portablepdbmdds.h
new file mode 100644
index 000000000000..ddaa8a8c74bd
--- /dev/null
+++ b/src/coreclr/src/md/inc/portablepdbmdds.h
@@ -0,0 +1,79 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*****************************************************************************
+ ** **
+ ** portablepdbmdds.h - contains data structures and types used for **
+ ** portable PDB metadata generation. **
+ ** **
+ *****************************************************************************/
+
+#ifndef _PORTABLEPDBMDDS_H_
+#define _PORTABLEPDBMDDS_H_
+
+#if _MSC_VER >= 1100
+#pragma once
+#endif
+
+#include "corhdr.h"
+
+//-------------------------------------
+//--- PDB stream data structure
+//-------------------------------------
+typedef struct _PDB_ID
+{
+ GUID pdbGuid;
+ ULONG pdbTimeStamp;
+} PDB_ID;
+
+typedef struct _PORT_PDB_STREAM
+{
+ PDB_ID id;
+ mdMethodDef entryPoint;
+ ULONG64 referencedTypeSystemTables;
+ ULONG *typeSystemTableRows;
+ ULONG typeSystemTableRowsSize;
+} PORT_PDB_STREAM;
+
+//-------------------------------------
+//--- Portable PDB table tokens
+//-------------------------------------
+
+// PPdb token definitions
+typedef mdToken mdDocument;
+typedef mdToken mdMethodDebugInformation;
+typedef mdToken mdLocalScope;
+typedef mdToken mdLocalVariable;
+typedef mdToken mdLocalConstant;
+typedef mdToken mdImportScope;
+// TODO:
+// typedef mdToken mdStateMachineMethod;
+// typedef mdToken mdCustomDebugInformation;
+
+// PPdb token tags
+typedef enum PPdbCorTokenType
+{
+ mdtDocument = 0x30000000,
+ mdtMethodDebugInformation = 0x31000000,
+ mdtLocalScope = 0x32000000,
+ mdtLocalVariable = 0x33000000,
+ mdtLocalConstant = 0x34000000,
+ mdtImportScope = 0x35000000,
+ // TODO:
+ // mdtStateMachineMethod = 0x36000000,
+ // mdtCustomDebugInformation = 0x37000000,
+} PPdbCorTokenType;
+
+// PPdb Nil tokens
+#define mdDocumentNil ((mdDocument)mdtDocument)
+#define mdMethodDebugInformationNil ((mdMethodDebugInformation)mdtMethodDebugInformation)
+#define mdLocalScopeNil ((mdLocalScope)mdtLocalScope)
+#define mdLocalVariableNil ((mdLocalVariable)mdtLocalVariable)
+#define mdLocalConstantNil ((mdLocalConstant)mdtLocalConstant)
+#define mdImportScopeNil ((mdImportScope)mdtImportScope)
+// TODO:
+// #define mdStateMachineMethodNil ((mdStateMachineMethod)mdtStateMachineMethod)
+// #define mdCustomDebugInformationNil ((mdCustomDebugInformation)mdtCustomDebugInformation)
+
+#endif // _PORTABLEPDBMDDS_H_
diff --git a/src/coreclr/src/md/inc/portablepdbmdi.h b/src/coreclr/src/md/inc/portablepdbmdi.h
new file mode 100644
index 000000000000..26a1cb916f43
--- /dev/null
+++ b/src/coreclr/src/md/inc/portablepdbmdi.h
@@ -0,0 +1,97 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+/*****************************************************************************
+ ** **
+ ** portablepdbmdi.h - contains COM interface definitions for portable PDB **
+ ** metadata generation. **
+ ** **
+ *****************************************************************************/
+
+#ifndef _PORTABLEPDBMDI_H_
+#define _PORTABLEPDBMDI_H_
+
+#if _MSC_VER >= 1100
+#pragma once
+#endif
+
+#include "cor.h"
+#include "portablepdbmdds.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//-------------------------------------
+//--- IMetaDataEmit3
+//-------------------------------------
+// {1a5abcd7-854e-4f07-ace4-3f09e6092939}
+EXTERN_GUID(IID_IMetaDataEmit3, 0x1a5abcd7, 0x854e, 0x4f07, 0xac, 0xe4, 0x3f, 0x09, 0xe6, 0x09, 0x29, 0x39);
+
+//---
+#undef INTERFACE
+#define INTERFACE IMetaDataEmit3
+DECLARE_INTERFACE_(IMetaDataEmit3, IMetaDataEmit2)
+{
+
+ STDMETHOD(GetReferencedTypeSysTables)( // S_OK or error.
+ ULONG64 *refTables, // [OUT] Bit vector of referenced type system metadata tables.
+ ULONG refTableRows[], // [OUT] Array of number of rows for each referenced type system table.
+ const ULONG maxTableRowsSize, // [IN] Max size of the rows array.
+ ULONG *tableRowsSize) PURE; // [OUT] Actual size of the rows array.
+
+ STDMETHOD(DefinePdbStream)( // S_OK or error.
+ PORT_PDB_STREAM *pdbStream) PURE; // [IN] Portable pdb stream data.
+
+ STDMETHOD(DefineDocument)( // S_OK or error.
+ char *docName, // [IN] Document name (string will be tokenized).
+ GUID *hashAlg, // [IN] Hash algorithm GUID.
+ BYTE *hashVal, // [IN] Hash value.
+ ULONG hashValSize, // [IN] Hash value size.
+ GUID *lang, // [IN] Language GUID.
+ mdDocument *docMdToken) PURE; // [OUT] Token of the defined document.
+
+ STDMETHOD(DefineSequencePoints)( // S_OK or error.
+ ULONG docRid, // [IN] Document RID.
+ BYTE *sequencePtsBlob, // [IN] Sequence point blob.
+ ULONG sequencePtsBlobSize) PURE; // [IN] Sequence point blob size.
+
+ STDMETHOD(DefineLocalScope)( // S_OK or error.
+ ULONG methodDefRid, // [IN] Method RID.
+ ULONG importScopeRid, // [IN] Import scope RID.
+ ULONG firstLocalVarRid, // [IN] First local variable RID (of the continous run).
+ ULONG firstLocalConstRid, // [IN] First local constant RID (of the continous run).
+ ULONG startOffset, // [IN] Start offset of the scope.
+ ULONG length) PURE; // [IN] Scope length.
+
+ STDMETHOD(DefineLocalVariable)( // S_OK or error.
+ USHORT attribute, // [IN] Variable attribute.
+ USHORT index, // [IN] Variable index (slot).
+ char *name, // [IN] Variable name.
+ mdLocalVariable *locVarToken) PURE; // [OUT] Token of the defined variable.
+};
+
+//-------------------------------------
+//--- IMetaDataDispenserEx2
+//-------------------------------------
+
+// {23aaef0d-49bf-43f0-9744-1c3e9c56322a}
+EXTERN_GUID(IID_IMetaDataDispenserEx2, 0x23aaef0d, 0x49bf, 0x43f0, 0x97, 0x44, 0x1c, 0x3e, 0x9c, 0x56, 0x32, 0x2a);
+
+#undef INTERFACE
+#define INTERFACE IMetaDataDispenserEx2
+DECLARE_INTERFACE_(IMetaDataDispenserEx2, IMetaDataDispenserEx)
+{
+ STDMETHOD(DefinePortablePdbScope)( // Return code.
+ REFCLSID rclsid, // [IN] What version to create.
+ DWORD dwCreateFlags, // [IN] Flags on the create.
+ REFIID riid, // [IN] The interface desired.
+ IUnknown * *ppIUnk) PURE; // [OUT] Return interface on success.
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _PORTABLEPDBMDI_H_
diff --git a/src/coreclr/src/md/runtime/CMakeLists.txt b/src/coreclr/src/md/runtime/CMakeLists.txt
index 99b8bec54958..5753e655abf9 100644
--- a/src/coreclr/src/md/runtime/CMakeLists.txt
+++ b/src/coreclr/src/md/runtime/CMakeLists.txt
@@ -29,6 +29,9 @@ set(MDRUNTIME_HEADERS
../inc/mdcolumndescriptors.h
../inc/metamodel.h
../inc/metamodelro.h
+ ../inc/pdbheap.h
+ ../inc/portablepdbmdds.h
+ ../inc/portablepdbmdi.h
../inc/recordpool.h
metamodelcolumndefs.h
mdinternaldisp.h
@@ -57,3 +60,7 @@ target_precompile_header(TARGET mdruntime-dbi HEADER stdafx.h)
add_library_clr(mdruntime_crossgen ${MDRUNTIME_SOURCES})
set_target_properties(mdruntime_crossgen PROPERTIES CROSSGEN_COMPONENT TRUE)
target_precompile_header(TARGET mdruntime_crossgen HEADER stdafx.h)
+
+add_library_clr(mdruntime_ppdb ${MDRUNTIME_SOURCES})
+target_compile_definitions(mdruntime_ppdb PRIVATE FEATURE_METADATA_EMIT_ALL FEATURE_METADATA_EMIT_PORTABLE_PDB)
+target_precompile_header(TARGET mdruntime_ppdb HEADER stdafx.h)
\ No newline at end of file
diff --git a/src/coreclr/src/md/runtime/mdcolumndescriptors.cpp b/src/coreclr/src/md/runtime/mdcolumndescriptors.cpp
index 3806c93ca956..3b795df80973 100644
--- a/src/coreclr/src/md/runtime/mdcolumndescriptors.cpp
+++ b/src/coreclr/src/md/runtime/mdcolumndescriptors.cpp
@@ -163,6 +163,40 @@ const BYTE CMiniMdBase::s_MethodSpecCol[] = {2,
const BYTE CMiniMdBase::s_GenericParamConstraintCol[] = {1,
42,0,2, 64,2,2,
};
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+// Dummy descriptors to fill the gap to 0x30
+const BYTE CMiniMdBase::s_Dummy1Col[] = { NULL };
+const BYTE CMiniMdBase::s_Dummy2Col[] = { NULL };
+const BYTE CMiniMdBase::s_Dummy3Col[] = { NULL };
+// Actual portable PDB tables descriptors
+const BYTE CMiniMdBase::s_DocumentCol[] = { 2,
+ 103,0,2, 102,2,2, 103,4,2, 102,6,2,
+ 103,0,4, 102,4,2, 103,6,2, 102,8,4,
+};
+const BYTE CMiniMdBase::s_MethodDebugInformationCol[] = { 2,
+ 48,0,2, 103,2,2,
+ 48,0,2, 103,2,4,
+};
+const BYTE CMiniMdBase::s_LocalScopeCol[] = { 1,
+ 6,0,2, 53,2,2, 51,4,2, 52,6,2, 99,8,4, 99,12,4
+};
+const BYTE CMiniMdBase::s_LocalVariableCol[] = { 2,
+ 97,0,2, 97,2,2, 101,4,2,
+ 97,0,2, 97,2,2, 101,4,4
+};
+const BYTE CMiniMdBase::s_LocalConstantCol[] = { 3,
+ 101,0,2, 103,2,2,
+ 101,0,4, 103,4,4,
+ 101,0,4, 103,4,2,
+};
+const BYTE CMiniMdBase::s_ImportScopeCol[] = { 2,
+ 53,0,2, 103,2,2,
+ 53,0,2, 103,2,4
+};
+// TODO:
+// const BYTE CMiniMdBase::s_StateMachineMethodCol[] = {};
+// const BYTE CMiniMdBase::s_CustomDebugInformationCol[] = {};
+#endif // #ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
const BYTE* const CMiniMdBase::s_TableColumnDescriptors[] = {
s_ModuleCol,
@@ -209,5 +243,21 @@ s_ManifestResourceCol,
s_NestedClassCol,
s_GenericParamCol,
s_MethodSpecCol,
-s_GenericParamConstraintCol
+s_GenericParamConstraintCol,
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+// Dummy descriptors to fill the gap to 0x30
+s_Dummy1Col,
+s_Dummy2Col,
+s_Dummy3Col,
+// Actual portable PDB tables descriptors
+s_DocumentCol,
+s_MethodDebugInformationCol,
+s_LocalScopeCol,
+s_LocalVariableCol,
+s_LocalConstantCol,
+s_ImportScopeCol,
+// TODO:
+// s_StateMachineMethodCol,
+// s_CustomDebugInformationCol,
+#endif // #ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
};
diff --git a/src/coreclr/src/md/runtime/metamodel.cpp b/src/coreclr/src/md/runtime/metamodel.cpp
index 84c091678c38..cd1ccde9cc36 100644
--- a/src/coreclr/src/md/runtime/metamodel.cpp
+++ b/src/coreclr/src/md/runtime/metamodel.cpp
@@ -75,6 +75,16 @@
#undef SCHEMA_ITEM_CDTKN
#undef SCHEMA_TABLE_END
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+//Dummy tables to fill the gap to 0x30
+static CMiniColDef rDummy1Cols[] = { { 0 } };
+static CMiniColDef rDummy2Cols[] = { { 0 } };
+static CMiniColDef rDummy3Cols[] = { { 0 } };
+static const char* rDummy1ColNames[] = { "" };
+static const char* rDummy2ColNames[] = { "" };
+static const char* rDummy3ColNames[] = { "" };
+#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB
+
//-----------------------------------------------------------------------------
// End of column definitions.
//-----------------------------------------------------------------------------
@@ -91,6 +101,9 @@ const CCodedTokenDef g_CodedTokens [] = {
#define MiniMdTable(x) { { r##x##Cols, lengthof(r##x##Cols), x##Rec::COL_KEY, 0 }, r##x##ColNames, #x},
const CMiniTableDefEx g_Tables[TBL_COUNT] = {
MiniMdTables()
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+ PortablePdbMiniMdTables()
+#endif
};
// Define a table descriptor for the obsolete v1.0 GenericParam table definition.
@@ -104,6 +117,9 @@ const CMiniTableDefEx g_Table_GenericParamV1_1 = { { rGenericParamV1_1Cols, leng
#define MiniMdTable(x) { TBL_COUNT, 0 },
TblCol g_PtrTableIxs[TBL_COUNT] = {
MiniMdTables()
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+ PortablePdbMiniMdTables()
+#endif
};
//*****************************************************************************
@@ -440,6 +456,9 @@ CMiniMdBase::CMiniMdBase()
m_TableDefs[TBL_##tbl] = g_Tables[TBL_##tbl].m_Def; \
m_TableDefs[TBL_##tbl].m_pColDefs = BYTEARRAY_TO_COLDES(s_##tbl##Col);
MiniMdTables()
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+ PortablePdbMiniMdTables()
+#endif
m_TblCount = TBL_COUNT;
_ASSERTE(TBL_COUNT == TBL_COUNT_V2); // v2 counts.
@@ -471,6 +490,17 @@ CMiniMdBase::CMiniMdBase()
_ASSERTE((TypeFromToken(mdtGenericParam) >> 24) == TBL_GenericParam);
_ASSERTE((TypeFromToken(mdtMethodSpec) >> 24) == TBL_MethodSpec);
_ASSERTE((TypeFromToken(mdtGenericParamConstraint) >> 24) == TBL_GenericParamConstraint);
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+ _ASSERTE((TypeFromToken(mdtDocument) >> 24) == TBL_Document);
+ _ASSERTE((TypeFromToken(mdtMethodDebugInformation) >> 24) == TBL_MethodDebugInformation);
+ _ASSERTE((TypeFromToken(mdtLocalScope) >> 24) == TBL_LocalScope);
+ _ASSERTE((TypeFromToken(mdtLocalVariable) >> 24) == TBL_LocalVariable);
+ _ASSERTE((TypeFromToken(mdtLocalConstant) >> 24) == TBL_LocalConstant);
+ _ASSERTE((TypeFromToken(mdtImportScope) >> 24) == TBL_ImportScope);
+ // TODO:
+ // _ASSERTE((TypeFromToken(mdtStateMachineMethod) >> 24) == TBL_StateMachineMethod);
+ // _ASSERTE((TypeFromToken(mdtCustomDebugInformation) >> 24) == TBL_CustomDebugInformation);
+#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB
} // CMiniMdBase::CMiniMdBase
@@ -699,7 +729,7 @@ CMiniMdBase::InitColsForTable(
iOffset = 0;
- pTemplate = GetTableDefTemplate(ixTbl);
+ pTemplate = GetTableDefTemplate(ixTbl);
PREFIX_ASSUME(pTemplate->m_pColDefs != NULL);
@@ -745,22 +775,39 @@ CMiniMdBase::InitColsForTable(
{ // Fixed type.
switch (pCols[ixCol].m_Type)
{
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+ /* Portable PDB tables */
+ // Commenting out column offset asserts.
+ // It makes sense to assert calculated offsets against values from the table
+ // definition templates, only if the fixed field columns appear at the beginning
+ // of a table record.
+ // Initializing StartOffset and Length (4th and 5th columns of the portable PDB
+ // LocalScope table) can cause assertion to fail at this point, since preceeding
+ // column sizes are determined dynamically (2 or 4 bytes for RIDs depending on the
+ // number of records) and cannot be compared against the static template.
+#endif
case iBYTE:
iSize = 1;
_ASSERTE(pCols[ixCol].m_cbColumn == iSize);
- _ASSERTE(pCols[ixCol].m_oColumn == iOffset);
+#ifndef FEATURE_METADATA_EMIT_PORTABLE_PDB
+ _ASSERTE(pCols[ixCol].m_oColumn == iOffset);
+#endif
break;
case iSHORT:
case iUSHORT:
iSize = 2;
_ASSERTE(pCols[ixCol].m_cbColumn == iSize);
+#ifndef FEATURE_METADATA_EMIT_PORTABLE_PDB
_ASSERTE(pCols[ixCol].m_oColumn == iOffset);
+#endif
break;
case iLONG:
case iULONG:
iSize = 4;
_ASSERTE(pCols[ixCol].m_cbColumn == iSize);
+#ifndef FEATURE_METADATA_EMIT_PORTABLE_PDB
_ASSERTE(pCols[ixCol].m_oColumn == iOffset);
+#endif
break;
case iSTRING:
iSize = (Schema.m_heaps & CMiniMdSchema::HEAP_STRING_4) ? 4 : 2;
diff --git a/src/coreclr/src/md/runtime/metamodelcolumndefs.h b/src/coreclr/src/md/runtime/metamodelcolumndefs.h
index ad4f8071e943..6790252d8255 100644
--- a/src/coreclr/src/md/runtime/metamodelcolumndefs.h
+++ b/src/coreclr/src/md/runtime/metamodelcolumndefs.h
@@ -397,4 +397,58 @@
SCHEMA_ITEM_CDTKN(GenericParamConstraint, Constraint, TypeDefOrRef)
SCHEMA_TABLE_END(GenericParamConstraint)
+#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
+ //-------------------------------------------------------------------------
+ //Document
+ SCHEMA_TABLE_START(Document)
+ SCHEMA_ITEM_BLOB(Document, Name)
+ SCHEMA_ITEM_GUID(Document, HashAlgorithm)
+ SCHEMA_ITEM_BLOB(Document, Hash)
+ SCHEMA_ITEM_GUID(Document, Language)
+ SCHEMA_TABLE_END(Document)
+
+ //-------------------------------------------------------------------------
+ //MethodDebugInformation
+ SCHEMA_TABLE_START(MethodDebugInformation)
+ SCHEMA_ITEM_RID(MethodDebugInformation, Document, Document)
+ SCHEMA_ITEM_BLOB(MethodDebugInformation, SequencePoints)
+ SCHEMA_TABLE_END(MethodDebugInformation)
+
+ //-------------------------------------------------------------------------
+ //LocalScope
+ SCHEMA_TABLE_START(LocalScope)
+ SCHEMA_ITEM_RID(LocalScope, Method, Method)
+ SCHEMA_ITEM_RID(LocalScope, ImportScope, ImportScope)
+ SCHEMA_ITEM_RID(LocalScope, VariableList, LocalVariable)
+ SCHEMA_ITEM_RID(LocalScope, ConstantList, LocalConstant)
+ SCHEMA_ITEM(LocalScope, ULONG, StartOffset)
+ SCHEMA_ITEM(LocalScope, ULONG, Length)
+ SCHEMA_TABLE_END(LocalScope)
+
+ //-------------------------------------------------------------------------
+ //LocalVariable
+ SCHEMA_TABLE_START(LocalVariable)
+ SCHEMA_ITEM(LocalVariable, USHORT, Attributes)
+ SCHEMA_ITEM(LocalVariable, USHORT, Index)
+ SCHEMA_ITEM_STRING(LocalVariable, Name)
+ SCHEMA_TABLE_END(LocalVariable)
+
+ //-------------------------------------------------------------------------
+ //LocalConstant
+ SCHEMA_TABLE_START(LocalConstant)
+ SCHEMA_ITEM_STRING(LocalConstant, Name)
+ SCHEMA_ITEM_BLOB(LocalConstant, Signature)
+ SCHEMA_TABLE_END(LocalConstant)
+
+ //-------------------------------------------------------------------------
+ //ImportScope
+ SCHEMA_TABLE_START(ImportScope)
+ SCHEMA_ITEM_RID(ImportScope, Parent, ImportScope)
+ SCHEMA_ITEM_BLOB(ImportScope, Imports)
+ SCHEMA_TABLE_END(ImportScope)
+
+ // TODO:
+ // StateMachineMethod
+ // CustomDebugInformation
+#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB
// eof ------------------------------------------------------------------------
diff --git a/src/coreclr/src/md/staticmd/CMakeLists.txt b/src/coreclr/src/md/staticmd/CMakeLists.txt
index c3726a80812d..99612f824aba 100644
--- a/src/coreclr/src/md/staticmd/CMakeLists.txt
+++ b/src/coreclr/src/md/staticmd/CMakeLists.txt
@@ -10,4 +10,7 @@ add_definitions(-DFEATURE_METADATA_EMIT_ALL)
add_definitions(-DFEATURE_METADATA_EMIT)
add_definitions(-DFEATURE_METADATA_INTERNAL_APIS)
-add_library_clr(mdstaticapi ${STATICMD_SOURCES})
\ No newline at end of file
+add_library_clr(mdstaticapi ${STATICMD_SOURCES})
+
+add_library_clr(mdstaticapi_ppdb ${STATICMD_SOURCES})
+target_compile_definitions(mdstaticapi_ppdb PRIVATE FEATURE_METADATA_EMIT_PORTABLE_PDB)
\ No newline at end of file
diff --git a/src/coreclr/src/pal/prebuilt/idl/cordebug_i.cpp b/src/coreclr/src/pal/prebuilt/idl/cordebug_i.cpp
index c6b8512eb0a8..85d7ab575a51 100644
--- a/src/coreclr/src/pal/prebuilt/idl/cordebug_i.cpp
+++ b/src/coreclr/src/pal/prebuilt/idl/cordebug_i.cpp
@@ -1,6 +1,3 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
/* this ALWAYS GENERATED file contains the IIDs and CLSIDs */
@@ -9,6 +6,16 @@
/* File created by MIDL compiler version 8.01.0622 */
+/* at Mon Jan 18 19:14:07 2038
+ */
+/* Compiler settings for E:/repos/runtime2/src/coreclr/src/inc/cordebug.idl:
+ Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.01.0622
+ protocol : dce , ms_ext, c_ext, robust
+ error checks: allocation ref bounds_check enum stub_data
+ VC __declspec() decoration level:
+ __declspec(uuid()), __declspec(selectany), __declspec(novtable)
+ DECLSPEC_UUID(), MIDL_INTERFACE()
+*/
/* @@MIDL_FILE_HEADING( ) */
#pragma warning( disable: 4049 ) /* more than 64k source lines */
@@ -16,7 +23,7 @@
#ifdef __cplusplus
extern "C"{
-#endif
+#endif
#include
@@ -198,6 +205,12 @@ MIDL_DEFINE_GUID(IID, IID_ICorDebugProcess8,0x2E6F28C1,0x85EB,0x4141,0x80,0xAD,0
MIDL_DEFINE_GUID(IID, IID_ICorDebugProcess10,0x8F378F6F,0x1017,0x4461,0x98,0x90,0xEC,0xF6,0x4C,0x54,0x07,0x9F);
+MIDL_DEFINE_GUID(IID, IID_ICorDebugMemoryRangeEnum,0xD1A0BCFC,0x5865,0x4437,0xBE,0x3F,0x36,0xF0,0x22,0x95,0x1F,0x8A);
+
+
+MIDL_DEFINE_GUID(IID, IID_ICorDebugProcess11,0x344B37AA,0xF2C0,0x4D3B,0x99,0x09,0x91,0xCC,0xF7,0x87,0xDA,0x8C);
+
+
MIDL_DEFINE_GUID(IID, IID_ICorDebugModuleDebugEvent,0x51A15E8D,0x9FFF,0x4864,0x9B,0x87,0xF4,0xFB,0xDE,0xA7,0x47,0xA2);
@@ -463,6 +476,3 @@ MIDL_DEFINE_GUID(CLSID, CLSID_EmbeddedCLRCorDebug,0x211f1254,0xbc7e,0x4af5,0xb9,
#ifdef __cplusplus
}
#endif
-
-
-
diff --git a/src/coreclr/src/pal/prebuilt/inc/cordebug.h b/src/coreclr/src/pal/prebuilt/inc/cordebug.h
index 7b68842d2c9d..3418b8cf9b30 100644
--- a/src/coreclr/src/pal/prebuilt/inc/cordebug.h
+++ b/src/coreclr/src/pal/prebuilt/inc/cordebug.h
@@ -6,7 +6,7 @@
/* File created by MIDL compiler version 8.01.0622 */
/* at Mon Jan 18 19:14:07 2038
*/
-/* Compiler settings for C:/git/runtime/src/coreclr/src/inc/cordebug.idl:
+/* Compiler settings for E:/repos/runtime2/src/coreclr/src/inc/cordebug.idl:
Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.01.0622
protocol : dce , ms_ext, c_ext, robust
error checks: allocation ref bounds_check enum stub_data
@@ -49,910 +49,924 @@
#define __ICorDebugDataTarget_FWD_DEFINED__
typedef interface ICorDebugDataTarget ICorDebugDataTarget;
-#endif /* __ICorDebugDataTarget_FWD_DEFINED__ */
+#endif /* __ICorDebugDataTarget_FWD_DEFINED__ */
#ifndef __ICorDebugStaticFieldSymbol_FWD_DEFINED__
#define __ICorDebugStaticFieldSymbol_FWD_DEFINED__
typedef interface ICorDebugStaticFieldSymbol ICorDebugStaticFieldSymbol;
-#endif /* __ICorDebugStaticFieldSymbol_FWD_DEFINED__ */
+#endif /* __ICorDebugStaticFieldSymbol_FWD_DEFINED__ */
#ifndef __ICorDebugInstanceFieldSymbol_FWD_DEFINED__
#define __ICorDebugInstanceFieldSymbol_FWD_DEFINED__
typedef interface ICorDebugInstanceFieldSymbol ICorDebugInstanceFieldSymbol;
-#endif /* __ICorDebugInstanceFieldSymbol_FWD_DEFINED__ */
+#endif /* __ICorDebugInstanceFieldSymbol_FWD_DEFINED__ */
#ifndef __ICorDebugVariableSymbol_FWD_DEFINED__
#define __ICorDebugVariableSymbol_FWD_DEFINED__
typedef interface ICorDebugVariableSymbol ICorDebugVariableSymbol;
-#endif /* __ICorDebugVariableSymbol_FWD_DEFINED__ */
+#endif /* __ICorDebugVariableSymbol_FWD_DEFINED__ */
#ifndef __ICorDebugMemoryBuffer_FWD_DEFINED__
#define __ICorDebugMemoryBuffer_FWD_DEFINED__
typedef interface ICorDebugMemoryBuffer ICorDebugMemoryBuffer;
-#endif /* __ICorDebugMemoryBuffer_FWD_DEFINED__ */
+#endif /* __ICorDebugMemoryBuffer_FWD_DEFINED__ */
#ifndef __ICorDebugMergedAssemblyRecord_FWD_DEFINED__
#define __ICorDebugMergedAssemblyRecord_FWD_DEFINED__
typedef interface ICorDebugMergedAssemblyRecord ICorDebugMergedAssemblyRecord;
-#endif /* __ICorDebugMergedAssemblyRecord_FWD_DEFINED__ */
+#endif /* __ICorDebugMergedAssemblyRecord_FWD_DEFINED__ */
#ifndef __ICorDebugSymbolProvider_FWD_DEFINED__
#define __ICorDebugSymbolProvider_FWD_DEFINED__
typedef interface ICorDebugSymbolProvider ICorDebugSymbolProvider;
-#endif /* __ICorDebugSymbolProvider_FWD_DEFINED__ */
+#endif /* __ICorDebugSymbolProvider_FWD_DEFINED__ */
#ifndef __ICorDebugSymbolProvider2_FWD_DEFINED__
#define __ICorDebugSymbolProvider2_FWD_DEFINED__
typedef interface ICorDebugSymbolProvider2 ICorDebugSymbolProvider2;
-#endif /* __ICorDebugSymbolProvider2_FWD_DEFINED__ */
+#endif /* __ICorDebugSymbolProvider2_FWD_DEFINED__ */
#ifndef __ICorDebugVirtualUnwinder_FWD_DEFINED__
#define __ICorDebugVirtualUnwinder_FWD_DEFINED__
typedef interface ICorDebugVirtualUnwinder ICorDebugVirtualUnwinder;
-#endif /* __ICorDebugVirtualUnwinder_FWD_DEFINED__ */
+#endif /* __ICorDebugVirtualUnwinder_FWD_DEFINED__ */
#ifndef __ICorDebugDataTarget2_FWD_DEFINED__
#define __ICorDebugDataTarget2_FWD_DEFINED__
typedef interface ICorDebugDataTarget2 ICorDebugDataTarget2;
-#endif /* __ICorDebugDataTarget2_FWD_DEFINED__ */
+#endif /* __ICorDebugDataTarget2_FWD_DEFINED__ */
#ifndef __ICorDebugLoadedModule_FWD_DEFINED__
#define __ICorDebugLoadedModule_FWD_DEFINED__
typedef interface ICorDebugLoadedModule ICorDebugLoadedModule;
-#endif /* __ICorDebugLoadedModule_FWD_DEFINED__ */
+#endif /* __ICorDebugLoadedModule_FWD_DEFINED__ */
#ifndef __ICorDebugDataTarget3_FWD_DEFINED__
#define __ICorDebugDataTarget3_FWD_DEFINED__
typedef interface ICorDebugDataTarget3 ICorDebugDataTarget3;
-#endif /* __ICorDebugDataTarget3_FWD_DEFINED__ */
+#endif /* __ICorDebugDataTarget3_FWD_DEFINED__ */
#ifndef __ICorDebugDataTarget4_FWD_DEFINED__
#define __ICorDebugDataTarget4_FWD_DEFINED__
typedef interface ICorDebugDataTarget4 ICorDebugDataTarget4;
-#endif /* __ICorDebugDataTarget4_FWD_DEFINED__ */
+#endif /* __ICorDebugDataTarget4_FWD_DEFINED__ */
#ifndef __ICorDebugMutableDataTarget_FWD_DEFINED__
#define __ICorDebugMutableDataTarget_FWD_DEFINED__
typedef interface ICorDebugMutableDataTarget ICorDebugMutableDataTarget;
-#endif /* __ICorDebugMutableDataTarget_FWD_DEFINED__ */
+#endif /* __ICorDebugMutableDataTarget_FWD_DEFINED__ */
#ifndef __ICorDebugMetaDataLocator_FWD_DEFINED__
#define __ICorDebugMetaDataLocator_FWD_DEFINED__
typedef interface ICorDebugMetaDataLocator ICorDebugMetaDataLocator;
-#endif /* __ICorDebugMetaDataLocator_FWD_DEFINED__ */
+#endif /* __ICorDebugMetaDataLocator_FWD_DEFINED__ */
#ifndef __ICorDebugManagedCallback_FWD_DEFINED__
#define __ICorDebugManagedCallback_FWD_DEFINED__
typedef interface ICorDebugManagedCallback ICorDebugManagedCallback;
-#endif /* __ICorDebugManagedCallback_FWD_DEFINED__ */
+#endif /* __ICorDebugManagedCallback_FWD_DEFINED__ */
#ifndef __ICorDebugManagedCallback3_FWD_DEFINED__
#define __ICorDebugManagedCallback3_FWD_DEFINED__
typedef interface ICorDebugManagedCallback3 ICorDebugManagedCallback3;
-#endif /* __ICorDebugManagedCallback3_FWD_DEFINED__ */
+#endif /* __ICorDebugManagedCallback3_FWD_DEFINED__ */
#ifndef __ICorDebugManagedCallback4_FWD_DEFINED__
#define __ICorDebugManagedCallback4_FWD_DEFINED__
typedef interface ICorDebugManagedCallback4 ICorDebugManagedCallback4;
-#endif /* __ICorDebugManagedCallback4_FWD_DEFINED__ */
+#endif /* __ICorDebugManagedCallback4_FWD_DEFINED__ */
#ifndef __ICorDebugManagedCallback2_FWD_DEFINED__
#define __ICorDebugManagedCallback2_FWD_DEFINED__
typedef interface ICorDebugManagedCallback2 ICorDebugManagedCallback2;
-#endif /* __ICorDebugManagedCallback2_FWD_DEFINED__ */
+#endif /* __ICorDebugManagedCallback2_FWD_DEFINED__ */
#ifndef __ICorDebugUnmanagedCallback_FWD_DEFINED__
#define __ICorDebugUnmanagedCallback_FWD_DEFINED__
typedef interface ICorDebugUnmanagedCallback ICorDebugUnmanagedCallback;
-#endif /* __ICorDebugUnmanagedCallback_FWD_DEFINED__ */
+#endif /* __ICorDebugUnmanagedCallback_FWD_DEFINED__ */
#ifndef __ICorDebug_FWD_DEFINED__
#define __ICorDebug_FWD_DEFINED__
typedef interface ICorDebug ICorDebug;
-#endif /* __ICorDebug_FWD_DEFINED__ */
+#endif /* __ICorDebug_FWD_DEFINED__ */
#ifndef __ICorDebugRemoteTarget_FWD_DEFINED__
#define __ICorDebugRemoteTarget_FWD_DEFINED__
typedef interface ICorDebugRemoteTarget ICorDebugRemoteTarget;
-#endif /* __ICorDebugRemoteTarget_FWD_DEFINED__ */
+#endif /* __ICorDebugRemoteTarget_FWD_DEFINED__ */
#ifndef __ICorDebugRemote_FWD_DEFINED__
#define __ICorDebugRemote_FWD_DEFINED__
typedef interface ICorDebugRemote ICorDebugRemote;
-#endif /* __ICorDebugRemote_FWD_DEFINED__ */
+#endif /* __ICorDebugRemote_FWD_DEFINED__ */
#ifndef __ICorDebug2_FWD_DEFINED__
#define __ICorDebug2_FWD_DEFINED__
typedef interface ICorDebug2 ICorDebug2;
-#endif /* __ICorDebug2_FWD_DEFINED__ */
+#endif /* __ICorDebug2_FWD_DEFINED__ */
#ifndef __ICorDebugController_FWD_DEFINED__
#define __ICorDebugController_FWD_DEFINED__
typedef interface ICorDebugController ICorDebugController;
-#endif /* __ICorDebugController_FWD_DEFINED__ */
+#endif /* __ICorDebugController_FWD_DEFINED__ */
#ifndef __ICorDebugAppDomain_FWD_DEFINED__
#define __ICorDebugAppDomain_FWD_DEFINED__
typedef interface ICorDebugAppDomain ICorDebugAppDomain;
-#endif /* __ICorDebugAppDomain_FWD_DEFINED__ */
+#endif /* __ICorDebugAppDomain_FWD_DEFINED__ */
#ifndef __ICorDebugAppDomain2_FWD_DEFINED__
#define __ICorDebugAppDomain2_FWD_DEFINED__
typedef interface ICorDebugAppDomain2 ICorDebugAppDomain2;
-#endif /* __ICorDebugAppDomain2_FWD_DEFINED__ */
+#endif /* __ICorDebugAppDomain2_FWD_DEFINED__ */
#ifndef __ICorDebugEnum_FWD_DEFINED__
#define __ICorDebugEnum_FWD_DEFINED__
typedef interface ICorDebugEnum ICorDebugEnum;
-#endif /* __ICorDebugEnum_FWD_DEFINED__ */
+#endif /* __ICorDebugEnum_FWD_DEFINED__ */
#ifndef __ICorDebugGuidToTypeEnum_FWD_DEFINED__
#define __ICorDebugGuidToTypeEnum_FWD_DEFINED__
typedef interface ICorDebugGuidToTypeEnum ICorDebugGuidToTypeEnum;
-#endif /* __ICorDebugGuidToTypeEnum_FWD_DEFINED__ */
+#endif /* __ICorDebugGuidToTypeEnum_FWD_DEFINED__ */
#ifndef __ICorDebugAppDomain3_FWD_DEFINED__
#define __ICorDebugAppDomain3_FWD_DEFINED__
typedef interface ICorDebugAppDomain3 ICorDebugAppDomain3;
-#endif /* __ICorDebugAppDomain3_FWD_DEFINED__ */
+#endif /* __ICorDebugAppDomain3_FWD_DEFINED__ */
#ifndef __ICorDebugAppDomain4_FWD_DEFINED__
#define __ICorDebugAppDomain4_FWD_DEFINED__
typedef interface ICorDebugAppDomain4 ICorDebugAppDomain4;
-#endif /* __ICorDebugAppDomain4_FWD_DEFINED__ */
+#endif /* __ICorDebugAppDomain4_FWD_DEFINED__ */
#ifndef __ICorDebugAssembly_FWD_DEFINED__
#define __ICorDebugAssembly_FWD_DEFINED__
typedef interface ICorDebugAssembly ICorDebugAssembly;
-#endif /* __ICorDebugAssembly_FWD_DEFINED__ */
+#endif /* __ICorDebugAssembly_FWD_DEFINED__ */
#ifndef __ICorDebugAssembly2_FWD_DEFINED__
#define __ICorDebugAssembly2_FWD_DEFINED__
typedef interface ICorDebugAssembly2 ICorDebugAssembly2;
-#endif /* __ICorDebugAssembly2_FWD_DEFINED__ */
+#endif /* __ICorDebugAssembly2_FWD_DEFINED__ */
#ifndef __ICorDebugAssembly3_FWD_DEFINED__
#define __ICorDebugAssembly3_FWD_DEFINED__
typedef interface ICorDebugAssembly3 ICorDebugAssembly3;
-#endif /* __ICorDebugAssembly3_FWD_DEFINED__ */
+#endif /* __ICorDebugAssembly3_FWD_DEFINED__ */
#ifndef __ICorDebugHeapEnum_FWD_DEFINED__
#define __ICorDebugHeapEnum_FWD_DEFINED__
typedef interface ICorDebugHeapEnum ICorDebugHeapEnum;
-#endif /* __ICorDebugHeapEnum_FWD_DEFINED__ */
+#endif /* __ICorDebugHeapEnum_FWD_DEFINED__ */
#ifndef __ICorDebugHeapSegmentEnum_FWD_DEFINED__
#define __ICorDebugHeapSegmentEnum_FWD_DEFINED__
typedef interface ICorDebugHeapSegmentEnum ICorDebugHeapSegmentEnum;
-#endif /* __ICorDebugHeapSegmentEnum_FWD_DEFINED__ */
+#endif /* __ICorDebugHeapSegmentEnum_FWD_DEFINED__ */
#ifndef __ICorDebugGCReferenceEnum_FWD_DEFINED__
#define __ICorDebugGCReferenceEnum_FWD_DEFINED__
typedef interface ICorDebugGCReferenceEnum ICorDebugGCReferenceEnum;
-#endif /* __ICorDebugGCReferenceEnum_FWD_DEFINED__ */
+#endif /* __ICorDebugGCReferenceEnum_FWD_DEFINED__ */
#ifndef __ICorDebugProcess_FWD_DEFINED__
#define __ICorDebugProcess_FWD_DEFINED__
typedef interface ICorDebugProcess ICorDebugProcess;
-#endif /* __ICorDebugProcess_FWD_DEFINED__ */
+#endif /* __ICorDebugProcess_FWD_DEFINED__ */
#ifndef __ICorDebugProcess2_FWD_DEFINED__
#define __ICorDebugProcess2_FWD_DEFINED__
typedef interface ICorDebugProcess2 ICorDebugProcess2;
-#endif /* __ICorDebugProcess2_FWD_DEFINED__ */
+#endif /* __ICorDebugProcess2_FWD_DEFINED__ */
#ifndef __ICorDebugProcess3_FWD_DEFINED__
#define __ICorDebugProcess3_FWD_DEFINED__
typedef interface ICorDebugProcess3 ICorDebugProcess3;
-#endif /* __ICorDebugProcess3_FWD_DEFINED__ */
+#endif /* __ICorDebugProcess3_FWD_DEFINED__ */
#ifndef __ICorDebugProcess5_FWD_DEFINED__
#define __ICorDebugProcess5_FWD_DEFINED__
typedef interface ICorDebugProcess5 ICorDebugProcess5;
-#endif /* __ICorDebugProcess5_FWD_DEFINED__ */
+#endif /* __ICorDebugProcess5_FWD_DEFINED__ */
#ifndef __ICorDebugDebugEvent_FWD_DEFINED__
#define __ICorDebugDebugEvent_FWD_DEFINED__
typedef interface ICorDebugDebugEvent ICorDebugDebugEvent;
-#endif /* __ICorDebugDebugEvent_FWD_DEFINED__ */
+#endif /* __ICorDebugDebugEvent_FWD_DEFINED__ */
#ifndef __ICorDebugProcess6_FWD_DEFINED__
#define __ICorDebugProcess6_FWD_DEFINED__
typedef interface ICorDebugProcess6 ICorDebugProcess6;
-#endif /* __ICorDebugProcess6_FWD_DEFINED__ */
+#endif /* __ICorDebugProcess6_FWD_DEFINED__ */
#ifndef __ICorDebugProcess7_FWD_DEFINED__
#define __ICorDebugProcess7_FWD_DEFINED__
typedef interface ICorDebugProcess7 ICorDebugProcess7;
-#endif /* __ICorDebugProcess7_FWD_DEFINED__ */
+#endif /* __ICorDebugProcess7_FWD_DEFINED__ */
#ifndef __ICorDebugProcess8_FWD_DEFINED__
#define __ICorDebugProcess8_FWD_DEFINED__
typedef interface ICorDebugProcess8 ICorDebugProcess8;
-#endif /* __ICorDebugProcess8_FWD_DEFINED__ */
+#endif /* __ICorDebugProcess8_FWD_DEFINED__ */
#ifndef __ICorDebugProcess10_FWD_DEFINED__
#define __ICorDebugProcess10_FWD_DEFINED__
typedef interface ICorDebugProcess10 ICorDebugProcess10;
-#endif /* __ICorDebugProcess10_FWD_DEFINED__ */
+#endif /* __ICorDebugProcess10_FWD_DEFINED__ */
+
+
+#ifndef __ICorDebugMemoryRangeEnum_FWD_DEFINED__
+#define __ICorDebugMemoryRangeEnum_FWD_DEFINED__
+typedef interface ICorDebugMemoryRangeEnum ICorDebugMemoryRangeEnum;
+
+#endif /* __ICorDebugMemoryRangeEnum_FWD_DEFINED__ */
+
+
+#ifndef __ICorDebugProcess11_FWD_DEFINED__
+#define __ICorDebugProcess11_FWD_DEFINED__
+typedef interface ICorDebugProcess11 ICorDebugProcess11;
+
+#endif /* __ICorDebugProcess11_FWD_DEFINED__ */
#ifndef __ICorDebugModuleDebugEvent_FWD_DEFINED__
#define __ICorDebugModuleDebugEvent_FWD_DEFINED__
typedef interface ICorDebugModuleDebugEvent ICorDebugModuleDebugEvent;
-#endif /* __ICorDebugModuleDebugEvent_FWD_DEFINED__ */
+#endif /* __ICorDebugModuleDebugEvent_FWD_DEFINED__ */
#ifndef __ICorDebugExceptionDebugEvent_FWD_DEFINED__
#define __ICorDebugExceptionDebugEvent_FWD_DEFINED__
typedef interface ICorDebugExceptionDebugEvent ICorDebugExceptionDebugEvent;
-#endif /* __ICorDebugExceptionDebugEvent_FWD_DEFINED__ */
+#endif /* __ICorDebugExceptionDebugEvent_FWD_DEFINED__ */
#ifndef __ICorDebugBreakpoint_FWD_DEFINED__
#define __ICorDebugBreakpoint_FWD_DEFINED__
typedef interface ICorDebugBreakpoint ICorDebugBreakpoint;
-#endif /* __ICorDebugBreakpoint_FWD_DEFINED__ */
+#endif /* __ICorDebugBreakpoint_FWD_DEFINED__ */
#ifndef __ICorDebugFunctionBreakpoint_FWD_DEFINED__
#define __ICorDebugFunctionBreakpoint_FWD_DEFINED__
typedef interface ICorDebugFunctionBreakpoint ICorDebugFunctionBreakpoint;
-#endif /* __ICorDebugFunctionBreakpoint_FWD_DEFINED__ */
+#endif /* __ICorDebugFunctionBreakpoint_FWD_DEFINED__ */
#ifndef __ICorDebugModuleBreakpoint_FWD_DEFINED__
#define __ICorDebugModuleBreakpoint_FWD_DEFINED__
typedef interface ICorDebugModuleBreakpoint ICorDebugModuleBreakpoint;
-#endif /* __ICorDebugModuleBreakpoint_FWD_DEFINED__ */
+#endif /* __ICorDebugModuleBreakpoint_FWD_DEFINED__ */
#ifndef __ICorDebugValueBreakpoint_FWD_DEFINED__
#define __ICorDebugValueBreakpoint_FWD_DEFINED__
typedef interface ICorDebugValueBreakpoint ICorDebugValueBreakpoint;
-#endif /* __ICorDebugValueBreakpoint_FWD_DEFINED__ */
+#endif /* __ICorDebugValueBreakpoint_FWD_DEFINED__ */
#ifndef __ICorDebugStepper_FWD_DEFINED__
#define __ICorDebugStepper_FWD_DEFINED__
typedef interface ICorDebugStepper ICorDebugStepper;
-#endif /* __ICorDebugStepper_FWD_DEFINED__ */
+#endif /* __ICorDebugStepper_FWD_DEFINED__ */
#ifndef __ICorDebugStepper2_FWD_DEFINED__
#define __ICorDebugStepper2_FWD_DEFINED__
typedef interface ICorDebugStepper2 ICorDebugStepper2;
-#endif /* __ICorDebugStepper2_FWD_DEFINED__ */
+#endif /* __ICorDebugStepper2_FWD_DEFINED__ */
#ifndef __ICorDebugRegisterSet_FWD_DEFINED__
#define __ICorDebugRegisterSet_FWD_DEFINED__
typedef interface ICorDebugRegisterSet ICorDebugRegisterSet;
-#endif /* __ICorDebugRegisterSet_FWD_DEFINED__ */
+#endif /* __ICorDebugRegisterSet_FWD_DEFINED__ */
#ifndef __ICorDebugRegisterSet2_FWD_DEFINED__
#define __ICorDebugRegisterSet2_FWD_DEFINED__
typedef interface ICorDebugRegisterSet2 ICorDebugRegisterSet2;
-#endif /* __ICorDebugRegisterSet2_FWD_DEFINED__ */
+#endif /* __ICorDebugRegisterSet2_FWD_DEFINED__ */
#ifndef __ICorDebugThread_FWD_DEFINED__
#define __ICorDebugThread_FWD_DEFINED__
typedef interface ICorDebugThread ICorDebugThread;
-#endif /* __ICorDebugThread_FWD_DEFINED__ */
+#endif /* __ICorDebugThread_FWD_DEFINED__ */
#ifndef __ICorDebugThread2_FWD_DEFINED__
#define __ICorDebugThread2_FWD_DEFINED__
typedef interface ICorDebugThread2 ICorDebugThread2;
-#endif /* __ICorDebugThread2_FWD_DEFINED__ */
+#endif /* __ICorDebugThread2_FWD_DEFINED__ */
#ifndef __ICorDebugThread3_FWD_DEFINED__
#define __ICorDebugThread3_FWD_DEFINED__
typedef interface ICorDebugThread3 ICorDebugThread3;
-#endif /* __ICorDebugThread3_FWD_DEFINED__ */
+#endif /* __ICorDebugThread3_FWD_DEFINED__ */
#ifndef __ICorDebugThread4_FWD_DEFINED__
#define __ICorDebugThread4_FWD_DEFINED__
typedef interface ICorDebugThread4 ICorDebugThread4;
-#endif /* __ICorDebugThread4_FWD_DEFINED__ */
+#endif /* __ICorDebugThread4_FWD_DEFINED__ */
#ifndef __ICorDebugStackWalk_FWD_DEFINED__
#define __ICorDebugStackWalk_FWD_DEFINED__
typedef interface ICorDebugStackWalk ICorDebugStackWalk;
-#endif /* __ICorDebugStackWalk_FWD_DEFINED__ */
+#endif /* __ICorDebugStackWalk_FWD_DEFINED__ */
#ifndef __ICorDebugChain_FWD_DEFINED__
#define __ICorDebugChain_FWD_DEFINED__
typedef interface ICorDebugChain ICorDebugChain;
-#endif /* __ICorDebugChain_FWD_DEFINED__ */
+#endif /* __ICorDebugChain_FWD_DEFINED__ */
#ifndef __ICorDebugFrame_FWD_DEFINED__
#define __ICorDebugFrame_FWD_DEFINED__
typedef interface ICorDebugFrame ICorDebugFrame;
-#endif /* __ICorDebugFrame_FWD_DEFINED__ */
+#endif /* __ICorDebugFrame_FWD_DEFINED__ */
#ifndef __ICorDebugInternalFrame_FWD_DEFINED__
#define __ICorDebugInternalFrame_FWD_DEFINED__
typedef interface ICorDebugInternalFrame ICorDebugInternalFrame;
-#endif /* __ICorDebugInternalFrame_FWD_DEFINED__ */
+#endif /* __ICorDebugInternalFrame_FWD_DEFINED__ */
#ifndef __ICorDebugInternalFrame2_FWD_DEFINED__
#define __ICorDebugInternalFrame2_FWD_DEFINED__
typedef interface ICorDebugInternalFrame2 ICorDebugInternalFrame2;
-#endif /* __ICorDebugInternalFrame2_FWD_DEFINED__ */
+#endif /* __ICorDebugInternalFrame2_FWD_DEFINED__ */
#ifndef __ICorDebugILFrame_FWD_DEFINED__
#define __ICorDebugILFrame_FWD_DEFINED__
typedef interface ICorDebugILFrame ICorDebugILFrame;
-#endif /* __ICorDebugILFrame_FWD_DEFINED__ */
+#endif /* __ICorDebugILFrame_FWD_DEFINED__ */
#ifndef __ICorDebugILFrame2_FWD_DEFINED__
#define __ICorDebugILFrame2_FWD_DEFINED__
typedef interface ICorDebugILFrame2 ICorDebugILFrame2;
-#endif /* __ICorDebugILFrame2_FWD_DEFINED__ */
+#endif /* __ICorDebugILFrame2_FWD_DEFINED__ */
#ifndef __ICorDebugILFrame3_FWD_DEFINED__
#define __ICorDebugILFrame3_FWD_DEFINED__
typedef interface ICorDebugILFrame3 ICorDebugILFrame3;
-#endif /* __ICorDebugILFrame3_FWD_DEFINED__ */
+#endif /* __ICorDebugILFrame3_FWD_DEFINED__ */
#ifndef __ICorDebugILFrame4_FWD_DEFINED__
#define __ICorDebugILFrame4_FWD_DEFINED__
typedef interface ICorDebugILFrame4 ICorDebugILFrame4;
-#endif /* __ICorDebugILFrame4_FWD_DEFINED__ */
+#endif /* __ICorDebugILFrame4_FWD_DEFINED__ */
#ifndef __ICorDebugNativeFrame_FWD_DEFINED__
#define __ICorDebugNativeFrame_FWD_DEFINED__
typedef interface ICorDebugNativeFrame ICorDebugNativeFrame;
-#endif /* __ICorDebugNativeFrame_FWD_DEFINED__ */
+#endif /* __ICorDebugNativeFrame_FWD_DEFINED__ */
#ifndef __ICorDebugNativeFrame2_FWD_DEFINED__
#define __ICorDebugNativeFrame2_FWD_DEFINED__
typedef interface ICorDebugNativeFrame2 ICorDebugNativeFrame2;
-#endif /* __ICorDebugNativeFrame2_FWD_DEFINED__ */
+#endif /* __ICorDebugNativeFrame2_FWD_DEFINED__ */
#ifndef __ICorDebugModule3_FWD_DEFINED__
#define __ICorDebugModule3_FWD_DEFINED__
typedef interface ICorDebugModule3 ICorDebugModule3;
-#endif /* __ICorDebugModule3_FWD_DEFINED__ */
+#endif /* __ICorDebugModule3_FWD_DEFINED__ */
#ifndef __ICorDebugRuntimeUnwindableFrame_FWD_DEFINED__
#define __ICorDebugRuntimeUnwindableFrame_FWD_DEFINED__
typedef interface ICorDebugRuntimeUnwindableFrame ICorDebugRuntimeUnwindableFrame;
-#endif /* __ICorDebugRuntimeUnwindableFrame_FWD_DEFINED__ */
+#endif /* __ICorDebugRuntimeUnwindableFrame_FWD_DEFINED__ */
#ifndef __ICorDebugModule_FWD_DEFINED__
#define __ICorDebugModule_FWD_DEFINED__
typedef interface ICorDebugModule ICorDebugModule;
-#endif /* __ICorDebugModule_FWD_DEFINED__ */
+#endif /* __ICorDebugModule_FWD_DEFINED__ */
#ifndef __ICorDebugModule2_FWD_DEFINED__
#define __ICorDebugModule2_FWD_DEFINED__
typedef interface ICorDebugModule2 ICorDebugModule2;
-#endif /* __ICorDebugModule2_FWD_DEFINED__ */
+#endif /* __ICorDebugModule2_FWD_DEFINED__ */
#ifndef __ICorDebugFunction_FWD_DEFINED__
#define __ICorDebugFunction_FWD_DEFINED__
typedef interface ICorDebugFunction ICorDebugFunction;
-#endif /* __ICorDebugFunction_FWD_DEFINED__ */
+#endif /* __ICorDebugFunction_FWD_DEFINED__ */
#ifndef __ICorDebugFunction2_FWD_DEFINED__
#define __ICorDebugFunction2_FWD_DEFINED__
typedef interface ICorDebugFunction2 ICorDebugFunction2;
-#endif /* __ICorDebugFunction2_FWD_DEFINED__ */
+#endif /* __ICorDebugFunction2_FWD_DEFINED__ */
#ifndef __ICorDebugFunction3_FWD_DEFINED__
#define __ICorDebugFunction3_FWD_DEFINED__
typedef interface ICorDebugFunction3 ICorDebugFunction3;
-#endif /* __ICorDebugFunction3_FWD_DEFINED__ */
+#endif /* __ICorDebugFunction3_FWD_DEFINED__ */
#ifndef __ICorDebugFunction4_FWD_DEFINED__
#define __ICorDebugFunction4_FWD_DEFINED__
typedef interface ICorDebugFunction4 ICorDebugFunction4;
-#endif /* __ICorDebugFunction4_FWD_DEFINED__ */
+#endif /* __ICorDebugFunction4_FWD_DEFINED__ */
#ifndef __ICorDebugCode_FWD_DEFINED__
#define __ICorDebugCode_FWD_DEFINED__
typedef interface ICorDebugCode ICorDebugCode;
-#endif /* __ICorDebugCode_FWD_DEFINED__ */
+#endif /* __ICorDebugCode_FWD_DEFINED__ */
#ifndef __ICorDebugCode2_FWD_DEFINED__
#define __ICorDebugCode2_FWD_DEFINED__
typedef interface ICorDebugCode2 ICorDebugCode2;
-#endif /* __ICorDebugCode2_FWD_DEFINED__ */
+#endif /* __ICorDebugCode2_FWD_DEFINED__ */
#ifndef __ICorDebugCode3_FWD_DEFINED__
#define __ICorDebugCode3_FWD_DEFINED__
typedef interface ICorDebugCode3 ICorDebugCode3;
-#endif /* __ICorDebugCode3_FWD_DEFINED__ */
+#endif /* __ICorDebugCode3_FWD_DEFINED__ */
#ifndef __ICorDebugCode4_FWD_DEFINED__
#define __ICorDebugCode4_FWD_DEFINED__
typedef interface ICorDebugCode4 ICorDebugCode4;
-#endif /* __ICorDebugCode4_FWD_DEFINED__ */
+#endif /* __ICorDebugCode4_FWD_DEFINED__ */
#ifndef __ICorDebugILCode_FWD_DEFINED__
#define __ICorDebugILCode_FWD_DEFINED__
typedef interface ICorDebugILCode ICorDebugILCode;
-#endif /* __ICorDebugILCode_FWD_DEFINED__ */
+#endif /* __ICorDebugILCode_FWD_DEFINED__ */
#ifndef __ICorDebugILCode2_FWD_DEFINED__
#define __ICorDebugILCode2_FWD_DEFINED__
typedef interface ICorDebugILCode2 ICorDebugILCode2;
-#endif /* __ICorDebugILCode2_FWD_DEFINED__ */
+#endif /* __ICorDebugILCode2_FWD_DEFINED__ */
#ifndef __ICorDebugClass_FWD_DEFINED__
#define __ICorDebugClass_FWD_DEFINED__
typedef interface ICorDebugClass ICorDebugClass;
-#endif /* __ICorDebugClass_FWD_DEFINED__ */
+#endif /* __ICorDebugClass_FWD_DEFINED__ */
#ifndef __ICorDebugClass2_FWD_DEFINED__
#define __ICorDebugClass2_FWD_DEFINED__
typedef interface ICorDebugClass2 ICorDebugClass2;
-#endif /* __ICorDebugClass2_FWD_DEFINED__ */
+#endif /* __ICorDebugClass2_FWD_DEFINED__ */
#ifndef __ICorDebugEval_FWD_DEFINED__
#define __ICorDebugEval_FWD_DEFINED__
typedef interface ICorDebugEval ICorDebugEval;
-#endif /* __ICorDebugEval_FWD_DEFINED__ */
+#endif /* __ICorDebugEval_FWD_DEFINED__ */
#ifndef __ICorDebugEval2_FWD_DEFINED__
#define __ICorDebugEval2_FWD_DEFINED__
typedef interface ICorDebugEval2 ICorDebugEval2;
-#endif /* __ICorDebugEval2_FWD_DEFINED__ */
+#endif /* __ICorDebugEval2_FWD_DEFINED__ */
#ifndef __ICorDebugValue_FWD_DEFINED__
#define __ICorDebugValue_FWD_DEFINED__
typedef interface ICorDebugValue ICorDebugValue;
-#endif /* __ICorDebugValue_FWD_DEFINED__ */
+#endif /* __ICorDebugValue_FWD_DEFINED__ */
#ifndef __ICorDebugValue2_FWD_DEFINED__
#define __ICorDebugValue2_FWD_DEFINED__
typedef interface ICorDebugValue2 ICorDebugValue2;
-#endif /* __ICorDebugValue2_FWD_DEFINED__ */
+#endif /* __ICorDebugValue2_FWD_DEFINED__ */
#ifndef __ICorDebugValue3_FWD_DEFINED__
#define __ICorDebugValue3_FWD_DEFINED__
typedef interface ICorDebugValue3 ICorDebugValue3;
-#endif /* __ICorDebugValue3_FWD_DEFINED__ */
+#endif /* __ICorDebugValue3_FWD_DEFINED__ */
#ifndef __ICorDebugGenericValue_FWD_DEFINED__
#define __ICorDebugGenericValue_FWD_DEFINED__
typedef interface ICorDebugGenericValue ICorDebugGenericValue;
-#endif /* __ICorDebugGenericValue_FWD_DEFINED__ */
+#endif /* __ICorDebugGenericValue_FWD_DEFINED__ */
#ifndef __ICorDebugReferenceValue_FWD_DEFINED__
#define __ICorDebugReferenceValue_FWD_DEFINED__
typedef interface ICorDebugReferenceValue ICorDebugReferenceValue;
-#endif /* __ICorDebugReferenceValue_FWD_DEFINED__ */
+#endif /* __ICorDebugReferenceValue_FWD_DEFINED__ */
#ifndef __ICorDebugHeapValue_FWD_DEFINED__
#define __ICorDebugHeapValue_FWD_DEFINED__
typedef interface ICorDebugHeapValue ICorDebugHeapValue;
-#endif /* __ICorDebugHeapValue_FWD_DEFINED__ */
+#endif /* __ICorDebugHeapValue_FWD_DEFINED__ */
#ifndef __ICorDebugHeapValue2_FWD_DEFINED__
#define __ICorDebugHeapValue2_FWD_DEFINED__
typedef interface ICorDebugHeapValue2 ICorDebugHeapValue2;
-#endif /* __ICorDebugHeapValue2_FWD_DEFINED__ */
+#endif /* __ICorDebugHeapValue2_FWD_DEFINED__ */
#ifndef __ICorDebugHeapValue3_FWD_DEFINED__
#define __ICorDebugHeapValue3_FWD_DEFINED__
typedef interface ICorDebugHeapValue3 ICorDebugHeapValue3;
-#endif /* __ICorDebugHeapValue3_FWD_DEFINED__ */
+#endif /* __ICorDebugHeapValue3_FWD_DEFINED__ */
#ifndef __ICorDebugObjectValue_FWD_DEFINED__
#define __ICorDebugObjectValue_FWD_DEFINED__
typedef interface ICorDebugObjectValue ICorDebugObjectValue;
-#endif /* __ICorDebugObjectValue_FWD_DEFINED__ */
+#endif /* __ICorDebugObjectValue_FWD_DEFINED__ */
#ifndef __ICorDebugObjectValue2_FWD_DEFINED__
#define __ICorDebugObjectValue2_FWD_DEFINED__
typedef interface ICorDebugObjectValue2 ICorDebugObjectValue2;
-#endif /* __ICorDebugObjectValue2_FWD_DEFINED__ */
+#endif /* __ICorDebugObjectValue2_FWD_DEFINED__ */
#ifndef __ICorDebugDelegateObjectValue_FWD_DEFINED__
#define __ICorDebugDelegateObjectValue_FWD_DEFINED__
typedef interface ICorDebugDelegateObjectValue ICorDebugDelegateObjectValue;
-#endif /* __ICorDebugDelegateObjectValue_FWD_DEFINED__ */
+#endif /* __ICorDebugDelegateObjectValue_FWD_DEFINED__ */
#ifndef __ICorDebugBoxValue_FWD_DEFINED__
#define __ICorDebugBoxValue_FWD_DEFINED__
typedef interface ICorDebugBoxValue ICorDebugBoxValue;
-#endif /* __ICorDebugBoxValue_FWD_DEFINED__ */
+#endif /* __ICorDebugBoxValue_FWD_DEFINED__ */
#ifndef __ICorDebugStringValue_FWD_DEFINED__
#define __ICorDebugStringValue_FWD_DEFINED__
typedef interface ICorDebugStringValue ICorDebugStringValue;
-#endif /* __ICorDebugStringValue_FWD_DEFINED__ */
+#endif /* __ICorDebugStringValue_FWD_DEFINED__ */
#ifndef __ICorDebugArrayValue_FWD_DEFINED__
#define __ICorDebugArrayValue_FWD_DEFINED__
typedef interface ICorDebugArrayValue ICorDebugArrayValue;
-#endif /* __ICorDebugArrayValue_FWD_DEFINED__ */
+#endif /* __ICorDebugArrayValue_FWD_DEFINED__ */
#ifndef __ICorDebugVariableHome_FWD_DEFINED__
#define __ICorDebugVariableHome_FWD_DEFINED__
typedef interface ICorDebugVariableHome ICorDebugVariableHome;
-#endif /* __ICorDebugVariableHome_FWD_DEFINED__ */
+#endif /* __ICorDebugVariableHome_FWD_DEFINED__ */
#ifndef __ICorDebugHandleValue_FWD_DEFINED__
#define __ICorDebugHandleValue_FWD_DEFINED__
typedef interface ICorDebugHandleValue ICorDebugHandleValue;
-#endif /* __ICorDebugHandleValue_FWD_DEFINED__ */
+#endif /* __ICorDebugHandleValue_FWD_DEFINED__ */
#ifndef __ICorDebugContext_FWD_DEFINED__
#define __ICorDebugContext_FWD_DEFINED__
typedef interface ICorDebugContext ICorDebugContext;
-#endif /* __ICorDebugContext_FWD_DEFINED__ */
+#endif /* __ICorDebugContext_FWD_DEFINED__ */
#ifndef __ICorDebugComObjectValue_FWD_DEFINED__
#define __ICorDebugComObjectValue_FWD_DEFINED__
typedef interface ICorDebugComObjectValue ICorDebugComObjectValue;
-#endif /* __ICorDebugComObjectValue_FWD_DEFINED__ */
+#endif /* __ICorDebugComObjectValue_FWD_DEFINED__ */
#ifndef __ICorDebugObjectEnum_FWD_DEFINED__
#define __ICorDebugObjectEnum_FWD_DEFINED__
typedef interface ICorDebugObjectEnum ICorDebugObjectEnum;
-#endif /* __ICorDebugObjectEnum_FWD_DEFINED__ */
+#endif /* __ICorDebugObjectEnum_FWD_DEFINED__ */
#ifndef __ICorDebugBreakpointEnum_FWD_DEFINED__
#define __ICorDebugBreakpointEnum_FWD_DEFINED__
typedef interface ICorDebugBreakpointEnum ICorDebugBreakpointEnum;
-#endif /* __ICorDebugBreakpointEnum_FWD_DEFINED__ */
+#endif /* __ICorDebugBreakpointEnum_FWD_DEFINED__ */
#ifndef __ICorDebugStepperEnum_FWD_DEFINED__
#define __ICorDebugStepperEnum_FWD_DEFINED__
typedef interface ICorDebugStepperEnum ICorDebugStepperEnum;
-#endif /* __ICorDebugStepperEnum_FWD_DEFINED__ */
+#endif /* __ICorDebugStepperEnum_FWD_DEFINED__ */
#ifndef __ICorDebugProcessEnum_FWD_DEFINED__
#define __ICorDebugProcessEnum_FWD_DEFINED__
typedef interface ICorDebugProcessEnum ICorDebugProcessEnum;
-#endif /* __ICorDebugProcessEnum_FWD_DEFINED__ */
+#endif /* __ICorDebugProcessEnum_FWD_DEFINED__ */
#ifndef __ICorDebugThreadEnum_FWD_DEFINED__
#define __ICorDebugThreadEnum_FWD_DEFINED__
typedef interface ICorDebugThreadEnum ICorDebugThreadEnum;
-#endif /* __ICorDebugThreadEnum_FWD_DEFINED__ */
+#endif /* __ICorDebugThreadEnum_FWD_DEFINED__ */
#ifndef __ICorDebugFrameEnum_FWD_DEFINED__
#define __ICorDebugFrameEnum_FWD_DEFINED__
typedef interface ICorDebugFrameEnum ICorDebugFrameEnum;
-#endif /* __ICorDebugFrameEnum_FWD_DEFINED__ */
+#endif /* __ICorDebugFrameEnum_FWD_DEFINED__ */
#ifndef __ICorDebugChainEnum_FWD_DEFINED__
#define __ICorDebugChainEnum_FWD_DEFINED__
typedef interface ICorDebugChainEnum ICorDebugChainEnum;
-#endif /* __ICorDebugChainEnum_FWD_DEFINED__ */
+#endif /* __ICorDebugChainEnum_FWD_DEFINED__ */
#ifndef __ICorDebugModuleEnum_FWD_DEFINED__
#define __ICorDebugModuleEnum_FWD_DEFINED__
typedef interface ICorDebugModuleEnum ICorDebugModuleEnum;
-#endif /* __ICorDebugModuleEnum_FWD_DEFINED__ */
+#endif /* __ICorDebugModuleEnum_FWD_DEFINED__ */
#ifndef __ICorDebugValueEnum_FWD_DEFINED__
#define __ICorDebugValueEnum_FWD_DEFINED__
typedef interface ICorDebugValueEnum ICorDebugValueEnum;
-#endif /* __ICorDebugValueEnum_FWD_DEFINED__ */
+#endif /* __ICorDebugValueEnum_FWD_DEFINED__ */
#ifndef __ICorDebugVariableHomeEnum_FWD_DEFINED__
#define __ICorDebugVariableHomeEnum_FWD_DEFINED__
typedef interface ICorDebugVariableHomeEnum ICorDebugVariableHomeEnum;
-#endif /* __ICorDebugVariableHomeEnum_FWD_DEFINED__ */
+#endif /* __ICorDebugVariableHomeEnum_FWD_DEFINED__ */
#ifndef __ICorDebugCodeEnum_FWD_DEFINED__
#define __ICorDebugCodeEnum_FWD_DEFINED__
typedef interface ICorDebugCodeEnum ICorDebugCodeEnum;
-#endif /* __ICorDebugCodeEnum_FWD_DEFINED__ */
+#endif /* __ICorDebugCodeEnum_FWD_DEFINED__ */
#ifndef __ICorDebugTypeEnum_FWD_DEFINED__
#define __ICorDebugTypeEnum_FWD_DEFINED__
typedef interface ICorDebugTypeEnum ICorDebugTypeEnum;
-#endif /* __ICorDebugTypeEnum_FWD_DEFINED__ */
+#endif /* __ICorDebugTypeEnum_FWD_DEFINED__ */
#ifndef __ICorDebugType_FWD_DEFINED__
#define __ICorDebugType_FWD_DEFINED__
typedef interface ICorDebugType ICorDebugType;
-#endif /* __ICorDebugType_FWD_DEFINED__ */
+#endif /* __ICorDebugType_FWD_DEFINED__ */
#ifndef __ICorDebugType2_FWD_DEFINED__
#define __ICorDebugType2_FWD_DEFINED__
typedef interface ICorDebugType2 ICorDebugType2;
-#endif /* __ICorDebugType2_FWD_DEFINED__ */
+#endif /* __ICorDebugType2_FWD_DEFINED__ */
#ifndef __ICorDebugErrorInfoEnum_FWD_DEFINED__
#define __ICorDebugErrorInfoEnum_FWD_DEFINED__
typedef interface ICorDebugErrorInfoEnum ICorDebugErrorInfoEnum;
-#endif /* __ICorDebugErrorInfoEnum_FWD_DEFINED__ */
+#endif /* __ICorDebugErrorInfoEnum_FWD_DEFINED__ */
#ifndef __ICorDebugAppDomainEnum_FWD_DEFINED__
#define __ICorDebugAppDomainEnum_FWD_DEFINED__
typedef interface ICorDebugAppDomainEnum ICorDebugAppDomainEnum;
-#endif /* __ICorDebugAppDomainEnum_FWD_DEFINED__ */
+#endif /* __ICorDebugAppDomainEnum_FWD_DEFINED__ */
#ifndef __ICorDebugAssemblyEnum_FWD_DEFINED__
#define __ICorDebugAssemblyEnum_FWD_DEFINED__
typedef interface ICorDebugAssemblyEnum ICorDebugAssemblyEnum;
-#endif /* __ICorDebugAssemblyEnum_FWD_DEFINED__ */
+#endif /* __ICorDebugAssemblyEnum_FWD_DEFINED__ */
#ifndef __ICorDebugBlockingObjectEnum_FWD_DEFINED__
#define __ICorDebugBlockingObjectEnum_FWD_DEFINED__
typedef interface ICorDebugBlockingObjectEnum ICorDebugBlockingObjectEnum;
-#endif /* __ICorDebugBlockingObjectEnum_FWD_DEFINED__ */
+#endif /* __ICorDebugBlockingObjectEnum_FWD_DEFINED__ */
#ifndef __ICorDebugMDA_FWD_DEFINED__
#define __ICorDebugMDA_FWD_DEFINED__
typedef interface ICorDebugMDA ICorDebugMDA;
-#endif /* __ICorDebugMDA_FWD_DEFINED__ */
+#endif /* __ICorDebugMDA_FWD_DEFINED__ */
#ifndef __ICorDebugEditAndContinueErrorInfo_FWD_DEFINED__
#define __ICorDebugEditAndContinueErrorInfo_FWD_DEFINED__
typedef interface ICorDebugEditAndContinueErrorInfo ICorDebugEditAndContinueErrorInfo;
-#endif /* __ICorDebugEditAndContinueErrorInfo_FWD_DEFINED__ */
+#endif /* __ICorDebugEditAndContinueErrorInfo_FWD_DEFINED__ */
#ifndef __ICorDebugEditAndContinueSnapshot_FWD_DEFINED__
#define __ICorDebugEditAndContinueSnapshot_FWD_DEFINED__
typedef interface ICorDebugEditAndContinueSnapshot ICorDebugEditAndContinueSnapshot;
-#endif /* __ICorDebugEditAndContinueSnapshot_FWD_DEFINED__ */
+#endif /* __ICorDebugEditAndContinueSnapshot_FWD_DEFINED__ */
#ifndef __ICorDebugExceptionObjectCallStackEnum_FWD_DEFINED__
#define __ICorDebugExceptionObjectCallStackEnum_FWD_DEFINED__
typedef interface ICorDebugExceptionObjectCallStackEnum ICorDebugExceptionObjectCallStackEnum;
-#endif /* __ICorDebugExceptionObjectCallStackEnum_FWD_DEFINED__ */
+#endif /* __ICorDebugExceptionObjectCallStackEnum_FWD_DEFINED__ */
#ifndef __ICorDebugExceptionObjectValue_FWD_DEFINED__
#define __ICorDebugExceptionObjectValue_FWD_DEFINED__
typedef interface ICorDebugExceptionObjectValue ICorDebugExceptionObjectValue;
-#endif /* __ICorDebugExceptionObjectValue_FWD_DEFINED__ */
+#endif /* __ICorDebugExceptionObjectValue_FWD_DEFINED__ */
#ifndef __CorDebug_FWD_DEFINED__
@@ -964,7 +978,7 @@ typedef class CorDebug CorDebug;
typedef struct CorDebug CorDebug;
#endif /* __cplusplus */
-#endif /* __CorDebug_FWD_DEFINED__ */
+#endif /* __CorDebug_FWD_DEFINED__ */
#ifndef __EmbeddedCLRCorDebug_FWD_DEFINED__
@@ -976,238 +990,238 @@ typedef class EmbeddedCLRCorDebug EmbeddedCLRCorDebug;
typedef struct EmbeddedCLRCorDebug EmbeddedCLRCorDebug;
#endif /* __cplusplus */
-#endif /* __EmbeddedCLRCorDebug_FWD_DEFINED__ */
+#endif /* __EmbeddedCLRCorDebug_FWD_DEFINED__ */
#ifndef __ICorDebugValue_FWD_DEFINED__
#define __ICorDebugValue_FWD_DEFINED__
typedef interface ICorDebugValue ICorDebugValue;
-#endif /* __ICorDebugValue_FWD_DEFINED__ */
+#endif /* __ICorDebugValue_FWD_DEFINED__ */
#ifndef __ICorDebugReferenceValue_FWD_DEFINED__
#define __ICorDebugReferenceValue_FWD_DEFINED__
typedef interface ICorDebugReferenceValue ICorDebugReferenceValue;
-#endif /* __ICorDebugReferenceValue_FWD_DEFINED__ */
+#endif /* __ICorDebugReferenceValue_FWD_DEFINED__ */
#ifndef __ICorDebugHeapValue_FWD_DEFINED__
#define __ICorDebugHeapValue_FWD_DEFINED__
typedef interface ICorDebugHeapValue ICorDebugHeapValue;
-#endif /* __ICorDebugHeapValue_FWD_DEFINED__ */
+#endif /* __ICorDebugHeapValue_FWD_DEFINED__ */
#ifndef __ICorDebugStringValue_FWD_DEFINED__
#define __ICorDebugStringValue_FWD_DEFINED__
typedef interface ICorDebugStringValue ICorDebugStringValue;
-#endif /* __ICorDebugStringValue_FWD_DEFINED__ */
+#endif /* __ICorDebugStringValue_FWD_DEFINED__ */
#ifndef __ICorDebugGenericValue_FWD_DEFINED__
#define __ICorDebugGenericValue_FWD_DEFINED__
typedef interface ICorDebugGenericValue ICorDebugGenericValue;
-#endif /* __ICorDebugGenericValue_FWD_DEFINED__ */
+#endif /* __ICorDebugGenericValue_FWD_DEFINED__ */
#ifndef __ICorDebugBoxValue_FWD_DEFINED__
#define __ICorDebugBoxValue_FWD_DEFINED__
typedef interface ICorDebugBoxValue ICorDebugBoxValue;
-#endif /* __ICorDebugBoxValue_FWD_DEFINED__ */
+#endif /* __ICorDebugBoxValue_FWD_DEFINED__ */
#ifndef __ICorDebugArrayValue_FWD_DEFINED__
#define __ICorDebugArrayValue_FWD_DEFINED__
typedef interface ICorDebugArrayValue ICorDebugArrayValue;
-#endif /* __ICorDebugArrayValue_FWD_DEFINED__ */
+#endif /* __ICorDebugArrayValue_FWD_DEFINED__ */
#ifndef __ICorDebugFrame_FWD_DEFINED__
#define __ICorDebugFrame_FWD_DEFINED__
typedef interface ICorDebugFrame ICorDebugFrame;
-#endif /* __ICorDebugFrame_FWD_DEFINED__ */
+#endif /* __ICorDebugFrame_FWD_DEFINED__ */
#ifndef __ICorDebugILFrame_FWD_DEFINED__
#define __ICorDebugILFrame_FWD_DEFINED__
typedef interface ICorDebugILFrame ICorDebugILFrame;
-#endif /* __ICorDebugILFrame_FWD_DEFINED__ */
+#endif /* __ICorDebugILFrame_FWD_DEFINED__ */
#ifndef __ICorDebugInternalFrame_FWD_DEFINED__
#define __ICorDebugInternalFrame_FWD_DEFINED__
typedef interface ICorDebugInternalFrame ICorDebugInternalFrame;
-#endif /* __ICorDebugInternalFrame_FWD_DEFINED__ */
+#endif /* __ICorDebugInternalFrame_FWD_DEFINED__ */
#ifndef __ICorDebugInternalFrame2_FWD_DEFINED__
#define __ICorDebugInternalFrame2_FWD_DEFINED__
typedef interface ICorDebugInternalFrame2 ICorDebugInternalFrame2;
-#endif /* __ICorDebugInternalFrame2_FWD_DEFINED__ */
+#endif /* __ICorDebugInternalFrame2_FWD_DEFINED__ */
#ifndef __ICorDebugNativeFrame_FWD_DEFINED__
#define __ICorDebugNativeFrame_FWD_DEFINED__
typedef interface ICorDebugNativeFrame ICorDebugNativeFrame;
-#endif /* __ICorDebugNativeFrame_FWD_DEFINED__ */
+#endif /* __ICorDebugNativeFrame_FWD_DEFINED__ */
#ifndef __ICorDebugNativeFrame2_FWD_DEFINED__
#define __ICorDebugNativeFrame2_FWD_DEFINED__
typedef interface ICorDebugNativeFrame2 ICorDebugNativeFrame2;
-#endif /* __ICorDebugNativeFrame2_FWD_DEFINED__ */
+#endif /* __ICorDebugNativeFrame2_FWD_DEFINED__ */
#ifndef __ICorDebugRuntimeUnwindableFrame_FWD_DEFINED__
#define __ICorDebugRuntimeUnwindableFrame_FWD_DEFINED__
typedef interface ICorDebugRuntimeUnwindableFrame ICorDebugRuntimeUnwindableFrame;
-#endif /* __ICorDebugRuntimeUnwindableFrame_FWD_DEFINED__ */
+#endif /* __ICorDebugRuntimeUnwindableFrame_FWD_DEFINED__ */
#ifndef __ICorDebugManagedCallback2_FWD_DEFINED__
#define __ICorDebugManagedCallback2_FWD_DEFINED__
typedef interface ICorDebugManagedCallback2 ICorDebugManagedCallback2;
-#endif /* __ICorDebugManagedCallback2_FWD_DEFINED__ */
+#endif /* __ICorDebugManagedCallback2_FWD_DEFINED__ */
#ifndef __ICorDebugAppDomain2_FWD_DEFINED__
#define __ICorDebugAppDomain2_FWD_DEFINED__
typedef interface ICorDebugAppDomain2 ICorDebugAppDomain2;
-#endif /* __ICorDebugAppDomain2_FWD_DEFINED__ */
+#endif /* __ICorDebugAppDomain2_FWD_DEFINED__ */
#ifndef __ICorDebugAppDomain3_FWD_DEFINED__
#define __ICorDebugAppDomain3_FWD_DEFINED__
typedef interface ICorDebugAppDomain3 ICorDebugAppDomain3;
-#endif /* __ICorDebugAppDomain3_FWD_DEFINED__ */
+#endif /* __ICorDebugAppDomain3_FWD_DEFINED__ */
#ifndef __ICorDebugAssembly2_FWD_DEFINED__
#define __ICorDebugAssembly2_FWD_DEFINED__
typedef interface ICorDebugAssembly2 ICorDebugAssembly2;
-#endif /* __ICorDebugAssembly2_FWD_DEFINED__ */
+#endif /* __ICorDebugAssembly2_FWD_DEFINED__ */
#ifndef __ICorDebugProcess2_FWD_DEFINED__
#define __ICorDebugProcess2_FWD_DEFINED__
typedef interface ICorDebugProcess2 ICorDebugProcess2;
-#endif /* __ICorDebugProcess2_FWD_DEFINED__ */
+#endif /* __ICorDebugProcess2_FWD_DEFINED__ */
#ifndef __ICorDebugStepper2_FWD_DEFINED__
#define __ICorDebugStepper2_FWD_DEFINED__
typedef interface ICorDebugStepper2 ICorDebugStepper2;
-#endif /* __ICorDebugStepper2_FWD_DEFINED__ */
+#endif /* __ICorDebugStepper2_FWD_DEFINED__ */
#ifndef __ICorDebugThread2_FWD_DEFINED__
#define __ICorDebugThread2_FWD_DEFINED__
typedef interface ICorDebugThread2 ICorDebugThread2;
-#endif /* __ICorDebugThread2_FWD_DEFINED__ */
+#endif /* __ICorDebugThread2_FWD_DEFINED__ */
#ifndef __ICorDebugThread3_FWD_DEFINED__
#define __ICorDebugThread3_FWD_DEFINED__
typedef interface ICorDebugThread3 ICorDebugThread3;
-#endif /* __ICorDebugThread3_FWD_DEFINED__ */
+#endif /* __ICorDebugThread3_FWD_DEFINED__ */
#ifndef __ICorDebugILFrame2_FWD_DEFINED__
#define __ICorDebugILFrame2_FWD_DEFINED__
typedef interface ICorDebugILFrame2 ICorDebugILFrame2;
-#endif /* __ICorDebugILFrame2_FWD_DEFINED__ */
+#endif /* __ICorDebugILFrame2_FWD_DEFINED__ */
#ifndef __ICorDebugModule2_FWD_DEFINED__
#define __ICorDebugModule2_FWD_DEFINED__
typedef interface ICorDebugModule2 ICorDebugModule2;
-#endif /* __ICorDebugModule2_FWD_DEFINED__ */
+#endif /* __ICorDebugModule2_FWD_DEFINED__ */
#ifndef __ICorDebugFunction2_FWD_DEFINED__
#define __ICorDebugFunction2_FWD_DEFINED__
typedef interface ICorDebugFunction2 ICorDebugFunction2;
-#endif /* __ICorDebugFunction2_FWD_DEFINED__ */
+#endif /* __ICorDebugFunction2_FWD_DEFINED__ */
#ifndef __ICorDebugClass2_FWD_DEFINED__
#define __ICorDebugClass2_FWD_DEFINED__
typedef interface ICorDebugClass2 ICorDebugClass2;
-#endif /* __ICorDebugClass2_FWD_DEFINED__ */
+#endif /* __ICorDebugClass2_FWD_DEFINED__ */
#ifndef __ICorDebugEval2_FWD_DEFINED__
#define __ICorDebugEval2_FWD_DEFINED__
typedef interface ICorDebugEval2 ICorDebugEval2;
-#endif /* __ICorDebugEval2_FWD_DEFINED__ */
+#endif /* __ICorDebugEval2_FWD_DEFINED__ */
#ifndef __ICorDebugValue2_FWD_DEFINED__
#define __ICorDebugValue2_FWD_DEFINED__
typedef interface ICorDebugValue2 ICorDebugValue2;
-#endif /* __ICorDebugValue2_FWD_DEFINED__ */
+#endif /* __ICorDebugValue2_FWD_DEFINED__ */
#ifndef __ICorDebugObjectValue2_FWD_DEFINED__
#define __ICorDebugObjectValue2_FWD_DEFINED__
typedef interface ICorDebugObjectValue2 ICorDebugObjectValue2;
-#endif /* __ICorDebugObjectValue2_FWD_DEFINED__ */
+#endif /* __ICorDebugObjectValue2_FWD_DEFINED__ */
#ifndef __ICorDebugHandleValue_FWD_DEFINED__
#define __ICorDebugHandleValue_FWD_DEFINED__
typedef interface ICorDebugHandleValue ICorDebugHandleValue;
-#endif /* __ICorDebugHandleValue_FWD_DEFINED__ */
+#endif /* __ICorDebugHandleValue_FWD_DEFINED__ */
#ifndef __ICorDebugHeapValue2_FWD_DEFINED__
#define __ICorDebugHeapValue2_FWD_DEFINED__
typedef interface ICorDebugHeapValue2 ICorDebugHeapValue2;
-#endif /* __ICorDebugHeapValue2_FWD_DEFINED__ */
+#endif /* __ICorDebugHeapValue2_FWD_DEFINED__ */
#ifndef __ICorDebugComObjectValue_FWD_DEFINED__
#define __ICorDebugComObjectValue_FWD_DEFINED__
typedef interface ICorDebugComObjectValue ICorDebugComObjectValue;
-#endif /* __ICorDebugComObjectValue_FWD_DEFINED__ */
+#endif /* __ICorDebugComObjectValue_FWD_DEFINED__ */
#ifndef __ICorDebugModule3_FWD_DEFINED__
#define __ICorDebugModule3_FWD_DEFINED__
typedef interface ICorDebugModule3 ICorDebugModule3;
-#endif /* __ICorDebugModule3_FWD_DEFINED__ */
+#endif /* __ICorDebugModule3_FWD_DEFINED__ */
/* header files for imported files */
@@ -1269,7 +1283,7 @@ typedef struct _COR_IL_MAP
ULONG32 oldOffset;
ULONG32 newOffset;
BOOL fAccurate;
- } COR_IL_MAP;
+ } COR_IL_MAP;
#endif //_COR_IL_MAP
#ifndef _COR_DEBUG_IL_TO_NATIVE_MAP_
@@ -1277,39 +1291,39 @@ typedef struct _COR_IL_MAP
typedef
enum CorDebugIlToNativeMappingTypes
{
- NO_MAPPING = -1,
- PROLOG = -2,
- EPILOG = -3
- } CorDebugIlToNativeMappingTypes;
+ NO_MAPPING = -1,
+ PROLOG = -2,
+ EPILOG = -3
+ } CorDebugIlToNativeMappingTypes;
typedef struct COR_DEBUG_IL_TO_NATIVE_MAP
{
ULONG32 ilOffset;
ULONG32 nativeStartOffset;
ULONG32 nativeEndOffset;
- } COR_DEBUG_IL_TO_NATIVE_MAP;
+ } COR_DEBUG_IL_TO_NATIVE_MAP;
#endif // _COR_DEBUG_IL_TO_NATIVE_MAP_
#define REMOTE_DEBUGGING_DLL_ENTRY L"Software\\Microsoft\\.NETFramework\\Debugger\\ActivateRemoteDebugging"
typedef
enum CorDebugJITCompilerFlags
{
- CORDEBUG_JIT_DEFAULT = 0x1,
- CORDEBUG_JIT_DISABLE_OPTIMIZATION = 0x3,
- CORDEBUG_JIT_ENABLE_ENC = 0x7
- } CorDebugJITCompilerFlags;
+ CORDEBUG_JIT_DEFAULT = 0x1,
+ CORDEBUG_JIT_DISABLE_OPTIMIZATION = 0x3,
+ CORDEBUG_JIT_ENABLE_ENC = 0x7
+ } CorDebugJITCompilerFlags;
typedef
enum CorDebugJITCompilerFlagsDecprecated
{
- CORDEBUG_JIT_TRACK_DEBUG_INFO = 0x1
- } CorDebugJITCompilerFlagsDeprecated;
+ CORDEBUG_JIT_TRACK_DEBUG_INFO = 0x1
+ } CorDebugJITCompilerFlagsDeprecated;
typedef
enum CorDebugNGENPolicy
{
- DISABLE_LOCAL_NIC = 1
- } CorDebugNGENPolicy;
+ DISABLE_LOCAL_NIC = 1
+ } CorDebugNGENPolicy;
#pragma warning(push)
#pragma warning(disable:28718)
@@ -1388,17 +1402,17 @@ typedef DWORD CORDB_CONTINUE_STATUS;
typedef
enum CorDebugBlockingReason
{
- BLOCKING_NONE = 0,
- BLOCKING_MONITOR_CRITICAL_SECTION = 0x1,
- BLOCKING_MONITOR_EVENT = 0x2
- } CorDebugBlockingReason;
+ BLOCKING_NONE = 0,
+ BLOCKING_MONITOR_CRITICAL_SECTION = 0x1,
+ BLOCKING_MONITOR_EVENT = 0x2
+ } CorDebugBlockingReason;
typedef struct CorDebugBlockingObject
{
ICorDebugValue *pBlockingObject;
DWORD dwTimeout;
CorDebugBlockingReason blockingReason;
- } CorDebugBlockingObject;
+ } CorDebugBlockingObject;
typedef struct CorDebugExceptionObjectStackFrame
{
@@ -1406,13 +1420,13 @@ typedef struct CorDebugExceptionObjectStackFrame
CORDB_ADDRESS ip;
mdMethodDef methodDef;
BOOL isLastForeignExceptionFrame;
- } CorDebugExceptionObjectStackFrame;
+ } CorDebugExceptionObjectStackFrame;
typedef struct CorDebugGuidToTypeMapping
{
GUID iid;
ICorDebugType *pType;
- } CorDebugGuidToTypeMapping;
+ } CorDebugGuidToTypeMapping;
@@ -1428,19 +1442,19 @@ extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0000_v0_0_s_ifspec;
typedef
enum CorDebugPlatform
{
- CORDB_PLATFORM_WINDOWS_X86 = 0,
- CORDB_PLATFORM_WINDOWS_AMD64 = ( CORDB_PLATFORM_WINDOWS_X86 + 1 ) ,
- CORDB_PLATFORM_WINDOWS_IA64 = ( CORDB_PLATFORM_WINDOWS_AMD64 + 1 ) ,
- CORDB_PLATFORM_MAC_PPC = ( CORDB_PLATFORM_WINDOWS_IA64 + 1 ) ,
- CORDB_PLATFORM_MAC_X86 = ( CORDB_PLATFORM_MAC_PPC + 1 ) ,
- CORDB_PLATFORM_WINDOWS_ARM = ( CORDB_PLATFORM_MAC_X86 + 1 ) ,
- CORDB_PLATFORM_MAC_AMD64 = ( CORDB_PLATFORM_WINDOWS_ARM + 1 ) ,
- CORDB_PLATFORM_WINDOWS_ARM64 = ( CORDB_PLATFORM_MAC_AMD64 + 1 ) ,
- CORDB_PLATFORM_POSIX_AMD64 = ( CORDB_PLATFORM_WINDOWS_ARM64 + 1 ) ,
- CORDB_PLATFORM_POSIX_X86 = ( CORDB_PLATFORM_POSIX_AMD64 + 1 ) ,
- CORDB_PLATFORM_POSIX_ARM = ( CORDB_PLATFORM_POSIX_X86 + 1 ) ,
- CORDB_PLATFORM_POSIX_ARM64 = ( CORDB_PLATFORM_POSIX_ARM + 1 )
- } CorDebugPlatform;
+ CORDB_PLATFORM_WINDOWS_X86 = 0,
+ CORDB_PLATFORM_WINDOWS_AMD64 = ( CORDB_PLATFORM_WINDOWS_X86 + 1 ) ,
+ CORDB_PLATFORM_WINDOWS_IA64 = ( CORDB_PLATFORM_WINDOWS_AMD64 + 1 ) ,
+ CORDB_PLATFORM_MAC_PPC = ( CORDB_PLATFORM_WINDOWS_IA64 + 1 ) ,
+ CORDB_PLATFORM_MAC_X86 = ( CORDB_PLATFORM_MAC_PPC + 1 ) ,
+ CORDB_PLATFORM_WINDOWS_ARM = ( CORDB_PLATFORM_MAC_X86 + 1 ) ,
+ CORDB_PLATFORM_MAC_AMD64 = ( CORDB_PLATFORM_WINDOWS_ARM + 1 ) ,
+ CORDB_PLATFORM_WINDOWS_ARM64 = ( CORDB_PLATFORM_MAC_AMD64 + 1 ) ,
+ CORDB_PLATFORM_POSIX_AMD64 = ( CORDB_PLATFORM_WINDOWS_ARM64 + 1 ) ,
+ CORDB_PLATFORM_POSIX_X86 = ( CORDB_PLATFORM_POSIX_AMD64 + 1 ) ,
+ CORDB_PLATFORM_POSIX_ARM = ( CORDB_PLATFORM_POSIX_X86 + 1 ) ,
+ CORDB_PLATFORM_POSIX_ARM64 = ( CORDB_PLATFORM_POSIX_ARM + 1 )
+ } CorDebugPlatform;
EXTERN_C const IID IID_ICorDebugDataTarget;
@@ -1469,7 +1483,7 @@ EXTERN_C const IID IID_ICorDebugDataTarget;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugDataTargetVtbl
{
@@ -1518,34 +1532,34 @@ EXTERN_C const IID IID_ICorDebugDataTarget;
#ifdef COBJMACROS
-#define ICorDebugDataTarget_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugDataTarget_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugDataTarget_AddRef(This) \
+#define ICorDebugDataTarget_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugDataTarget_Release(This) \
+#define ICorDebugDataTarget_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugDataTarget_GetPlatform(This,pTargetPlatform) \
+#define ICorDebugDataTarget_GetPlatform(This,pTargetPlatform) \
( (This)->lpVtbl -> GetPlatform(This,pTargetPlatform) )
-#define ICorDebugDataTarget_ReadVirtual(This,address,pBuffer,bytesRequested,pBytesRead) \
+#define ICorDebugDataTarget_ReadVirtual(This,address,pBuffer,bytesRequested,pBytesRead) \
( (This)->lpVtbl -> ReadVirtual(This,address,pBuffer,bytesRequested,pBytesRead) )
-#define ICorDebugDataTarget_GetThreadContext(This,dwThreadID,contextFlags,contextSize,pContext) \
+#define ICorDebugDataTarget_GetThreadContext(This,dwThreadID,contextFlags,contextSize,pContext) \
( (This)->lpVtbl -> GetThreadContext(This,dwThreadID,contextFlags,contextSize,pContext) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugDataTarget_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugDataTarget_INTERFACE_DEFINED__ */
#ifndef __ICorDebugStaticFieldSymbol_INTERFACE_DEFINED__
@@ -1577,7 +1591,7 @@ EXTERN_C const IID IID_ICorDebugStaticFieldSymbol;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugStaticFieldSymbolVtbl
{
@@ -1622,34 +1636,34 @@ EXTERN_C const IID IID_ICorDebugStaticFieldSymbol;
#ifdef COBJMACROS
-#define ICorDebugStaticFieldSymbol_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugStaticFieldSymbol_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugStaticFieldSymbol_AddRef(This) \
+#define ICorDebugStaticFieldSymbol_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugStaticFieldSymbol_Release(This) \
+#define ICorDebugStaticFieldSymbol_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugStaticFieldSymbol_GetName(This,cchName,pcchName,szName) \
+#define ICorDebugStaticFieldSymbol_GetName(This,cchName,pcchName,szName) \
( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) )
-#define ICorDebugStaticFieldSymbol_GetSize(This,pcbSize) \
+#define ICorDebugStaticFieldSymbol_GetSize(This,pcbSize) \
( (This)->lpVtbl -> GetSize(This,pcbSize) )
-#define ICorDebugStaticFieldSymbol_GetAddress(This,pRVA) \
+#define ICorDebugStaticFieldSymbol_GetAddress(This,pRVA) \
( (This)->lpVtbl -> GetAddress(This,pRVA) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugStaticFieldSymbol_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugStaticFieldSymbol_INTERFACE_DEFINED__ */
#ifndef __ICorDebugInstanceFieldSymbol_INTERFACE_DEFINED__
@@ -1681,7 +1695,7 @@ EXTERN_C const IID IID_ICorDebugInstanceFieldSymbol;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugInstanceFieldSymbolVtbl
{
@@ -1726,34 +1740,34 @@ EXTERN_C const IID IID_ICorDebugInstanceFieldSymbol;
#ifdef COBJMACROS
-#define ICorDebugInstanceFieldSymbol_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugInstanceFieldSymbol_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugInstanceFieldSymbol_AddRef(This) \
+#define ICorDebugInstanceFieldSymbol_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugInstanceFieldSymbol_Release(This) \
+#define ICorDebugInstanceFieldSymbol_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugInstanceFieldSymbol_GetName(This,cchName,pcchName,szName) \
+#define ICorDebugInstanceFieldSymbol_GetName(This,cchName,pcchName,szName) \
( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) )
-#define ICorDebugInstanceFieldSymbol_GetSize(This,pcbSize) \
+#define ICorDebugInstanceFieldSymbol_GetSize(This,pcbSize) \
( (This)->lpVtbl -> GetSize(This,pcbSize) )
-#define ICorDebugInstanceFieldSymbol_GetOffset(This,pcbOffset) \
+#define ICorDebugInstanceFieldSymbol_GetOffset(This,pcbOffset) \
( (This)->lpVtbl -> GetOffset(This,pcbOffset) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugInstanceFieldSymbol_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugInstanceFieldSymbol_INTERFACE_DEFINED__ */
#ifndef __ICorDebugVariableSymbol_INTERFACE_DEFINED__
@@ -1801,7 +1815,7 @@ EXTERN_C const IID IID_ICorDebugVariableSymbol;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugVariableSymbolVtbl
{
@@ -1864,40 +1878,40 @@ EXTERN_C const IID IID_ICorDebugVariableSymbol;
#ifdef COBJMACROS
-#define ICorDebugVariableSymbol_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugVariableSymbol_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugVariableSymbol_AddRef(This) \
+#define ICorDebugVariableSymbol_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugVariableSymbol_Release(This) \
+#define ICorDebugVariableSymbol_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugVariableSymbol_GetName(This,cchName,pcchName,szName) \
+#define ICorDebugVariableSymbol_GetName(This,cchName,pcchName,szName) \
( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) )
-#define ICorDebugVariableSymbol_GetSize(This,pcbValue) \
+#define ICorDebugVariableSymbol_GetSize(This,pcbValue) \
( (This)->lpVtbl -> GetSize(This,pcbValue) )
-#define ICorDebugVariableSymbol_GetValue(This,offset,cbContext,context,cbValue,pcbValue,pValue) \
+#define ICorDebugVariableSymbol_GetValue(This,offset,cbContext,context,cbValue,pcbValue,pValue) \
( (This)->lpVtbl -> GetValue(This,offset,cbContext,context,cbValue,pcbValue,pValue) )
-#define ICorDebugVariableSymbol_SetValue(This,offset,threadID,cbContext,context,cbValue,pValue) \
+#define ICorDebugVariableSymbol_SetValue(This,offset,threadID,cbContext,context,cbValue,pValue) \
( (This)->lpVtbl -> SetValue(This,offset,threadID,cbContext,context,cbValue,pValue) )
-#define ICorDebugVariableSymbol_GetSlotIndex(This,pSlotIndex) \
+#define ICorDebugVariableSymbol_GetSlotIndex(This,pSlotIndex) \
( (This)->lpVtbl -> GetSlotIndex(This,pSlotIndex) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugVariableSymbol_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugVariableSymbol_INTERFACE_DEFINED__ */
#ifndef __ICorDebugMemoryBuffer_INTERFACE_DEFINED__
@@ -1924,7 +1938,7 @@ EXTERN_C const IID IID_ICorDebugMemoryBuffer;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugMemoryBufferVtbl
{
@@ -1963,31 +1977,31 @@ EXTERN_C const IID IID_ICorDebugMemoryBuffer;
#ifdef COBJMACROS
-#define ICorDebugMemoryBuffer_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugMemoryBuffer_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugMemoryBuffer_AddRef(This) \
+#define ICorDebugMemoryBuffer_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugMemoryBuffer_Release(This) \
+#define ICorDebugMemoryBuffer_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugMemoryBuffer_GetStartAddress(This,address) \
+#define ICorDebugMemoryBuffer_GetStartAddress(This,address) \
( (This)->lpVtbl -> GetStartAddress(This,address) )
-#define ICorDebugMemoryBuffer_GetSize(This,pcbBufferLength) \
+#define ICorDebugMemoryBuffer_GetSize(This,pcbBufferLength) \
( (This)->lpVtbl -> GetSize(This,pcbBufferLength) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugMemoryBuffer_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugMemoryBuffer_INTERFACE_DEFINED__ */
#ifndef __ICorDebugMergedAssemblyRecord_INTERFACE_DEFINED__
@@ -2037,7 +2051,7 @@ EXTERN_C const IID IID_ICorDebugMergedAssemblyRecord;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugMergedAssemblyRecordVtbl
{
@@ -2103,43 +2117,43 @@ EXTERN_C const IID IID_ICorDebugMergedAssemblyRecord;
#ifdef COBJMACROS
-#define ICorDebugMergedAssemblyRecord_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugMergedAssemblyRecord_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugMergedAssemblyRecord_AddRef(This) \
+#define ICorDebugMergedAssemblyRecord_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugMergedAssemblyRecord_Release(This) \
+#define ICorDebugMergedAssemblyRecord_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugMergedAssemblyRecord_GetSimpleName(This,cchName,pcchName,szName) \
+#define ICorDebugMergedAssemblyRecord_GetSimpleName(This,cchName,pcchName,szName) \
( (This)->lpVtbl -> GetSimpleName(This,cchName,pcchName,szName) )
-#define ICorDebugMergedAssemblyRecord_GetVersion(This,pMajor,pMinor,pBuild,pRevision) \
+#define ICorDebugMergedAssemblyRecord_GetVersion(This,pMajor,pMinor,pBuild,pRevision) \
( (This)->lpVtbl -> GetVersion(This,pMajor,pMinor,pBuild,pRevision) )
-#define ICorDebugMergedAssemblyRecord_GetCulture(This,cchCulture,pcchCulture,szCulture) \
+#define ICorDebugMergedAssemblyRecord_GetCulture(This,cchCulture,pcchCulture,szCulture) \
( (This)->lpVtbl -> GetCulture(This,cchCulture,pcchCulture,szCulture) )
-#define ICorDebugMergedAssemblyRecord_GetPublicKey(This,cbPublicKey,pcbPublicKey,pbPublicKey) \
+#define ICorDebugMergedAssemblyRecord_GetPublicKey(This,cbPublicKey,pcbPublicKey,pbPublicKey) \
( (This)->lpVtbl -> GetPublicKey(This,cbPublicKey,pcbPublicKey,pbPublicKey) )
-#define ICorDebugMergedAssemblyRecord_GetPublicKeyToken(This,cbPublicKeyToken,pcbPublicKeyToken,pbPublicKeyToken) \
+#define ICorDebugMergedAssemblyRecord_GetPublicKeyToken(This,cbPublicKeyToken,pcbPublicKeyToken,pbPublicKeyToken) \
( (This)->lpVtbl -> GetPublicKeyToken(This,cbPublicKeyToken,pcbPublicKeyToken,pbPublicKeyToken) )
-#define ICorDebugMergedAssemblyRecord_GetIndex(This,pIndex) \
+#define ICorDebugMergedAssemblyRecord_GetIndex(This,pIndex) \
( (This)->lpVtbl -> GetIndex(This,pIndex) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugMergedAssemblyRecord_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugMergedAssemblyRecord_INTERFACE_DEFINED__ */
#ifndef __ICorDebugSymbolProvider_INTERFACE_DEFINED__
@@ -2223,7 +2237,7 @@ EXTERN_C const IID IID_ICorDebugSymbolProvider;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugSymbolProviderVtbl
{
@@ -2328,58 +2342,58 @@ EXTERN_C const IID IID_ICorDebugSymbolProvider;
#ifdef COBJMACROS
-#define ICorDebugSymbolProvider_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugSymbolProvider_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugSymbolProvider_AddRef(This) \
+#define ICorDebugSymbolProvider_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugSymbolProvider_Release(This) \
+#define ICorDebugSymbolProvider_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugSymbolProvider_GetStaticFieldSymbols(This,cbSignature,typeSig,cRequestedSymbols,pcFetchedSymbols,pSymbols) \
+#define ICorDebugSymbolProvider_GetStaticFieldSymbols(This,cbSignature,typeSig,cRequestedSymbols,pcFetchedSymbols,pSymbols) \
( (This)->lpVtbl -> GetStaticFieldSymbols(This,cbSignature,typeSig,cRequestedSymbols,pcFetchedSymbols,pSymbols) )
-#define ICorDebugSymbolProvider_GetInstanceFieldSymbols(This,cbSignature,typeSig,cRequestedSymbols,pcFetchedSymbols,pSymbols) \
+#define ICorDebugSymbolProvider_GetInstanceFieldSymbols(This,cbSignature,typeSig,cRequestedSymbols,pcFetchedSymbols,pSymbols) \
( (This)->lpVtbl -> GetInstanceFieldSymbols(This,cbSignature,typeSig,cRequestedSymbols,pcFetchedSymbols,pSymbols) )
-#define ICorDebugSymbolProvider_GetMethodLocalSymbols(This,nativeRVA,cRequestedSymbols,pcFetchedSymbols,pSymbols) \
+#define ICorDebugSymbolProvider_GetMethodLocalSymbols(This,nativeRVA,cRequestedSymbols,pcFetchedSymbols,pSymbols) \
( (This)->lpVtbl -> GetMethodLocalSymbols(This,nativeRVA,cRequestedSymbols,pcFetchedSymbols,pSymbols) )
-#define ICorDebugSymbolProvider_GetMethodParameterSymbols(This,nativeRVA,cRequestedSymbols,pcFetchedSymbols,pSymbols) \
+#define ICorDebugSymbolProvider_GetMethodParameterSymbols(This,nativeRVA,cRequestedSymbols,pcFetchedSymbols,pSymbols) \
( (This)->lpVtbl -> GetMethodParameterSymbols(This,nativeRVA,cRequestedSymbols,pcFetchedSymbols,pSymbols) )
-#define ICorDebugSymbolProvider_GetMergedAssemblyRecords(This,cRequestedRecords,pcFetchedRecords,pRecords) \
+#define ICorDebugSymbolProvider_GetMergedAssemblyRecords(This,cRequestedRecords,pcFetchedRecords,pRecords) \
( (This)->lpVtbl -> GetMergedAssemblyRecords(This,cRequestedRecords,pcFetchedRecords,pRecords) )
-#define ICorDebugSymbolProvider_GetMethodProps(This,codeRva,pMethodToken,pcGenericParams,cbSignature,pcbSignature,signature) \
+#define ICorDebugSymbolProvider_GetMethodProps(This,codeRva,pMethodToken,pcGenericParams,cbSignature,pcbSignature,signature) \
( (This)->lpVtbl -> GetMethodProps(This,codeRva,pMethodToken,pcGenericParams,cbSignature,pcbSignature,signature) )
-#define ICorDebugSymbolProvider_GetTypeProps(This,vtableRva,cbSignature,pcbSignature,signature) \
+#define ICorDebugSymbolProvider_GetTypeProps(This,vtableRva,cbSignature,pcbSignature,signature) \
( (This)->lpVtbl -> GetTypeProps(This,vtableRva,cbSignature,pcbSignature,signature) )
-#define ICorDebugSymbolProvider_GetCodeRange(This,codeRva,pCodeStartAddress,pCodeSize) \
+#define ICorDebugSymbolProvider_GetCodeRange(This,codeRva,pCodeStartAddress,pCodeSize) \
( (This)->lpVtbl -> GetCodeRange(This,codeRva,pCodeStartAddress,pCodeSize) )
-#define ICorDebugSymbolProvider_GetAssemblyImageBytes(This,rva,length,ppMemoryBuffer) \
+#define ICorDebugSymbolProvider_GetAssemblyImageBytes(This,rva,length,ppMemoryBuffer) \
( (This)->lpVtbl -> GetAssemblyImageBytes(This,rva,length,ppMemoryBuffer) )
-#define ICorDebugSymbolProvider_GetObjectSize(This,cbSignature,typeSig,pObjectSize) \
+#define ICorDebugSymbolProvider_GetObjectSize(This,cbSignature,typeSig,pObjectSize) \
( (This)->lpVtbl -> GetObjectSize(This,cbSignature,typeSig,pObjectSize) )
-#define ICorDebugSymbolProvider_GetAssemblyImageMetadata(This,ppMemoryBuffer) \
+#define ICorDebugSymbolProvider_GetAssemblyImageMetadata(This,ppMemoryBuffer) \
( (This)->lpVtbl -> GetAssemblyImageMetadata(This,ppMemoryBuffer) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugSymbolProvider_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugSymbolProvider_INTERFACE_DEFINED__ */
#ifndef __ICorDebugSymbolProvider2_INTERFACE_DEFINED__
@@ -2408,7 +2422,7 @@ EXTERN_C const IID IID_ICorDebugSymbolProvider2;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugSymbolProvider2Vtbl
{
@@ -2449,31 +2463,31 @@ EXTERN_C const IID IID_ICorDebugSymbolProvider2;
#ifdef COBJMACROS
-#define ICorDebugSymbolProvider2_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugSymbolProvider2_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugSymbolProvider2_AddRef(This) \
+#define ICorDebugSymbolProvider2_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugSymbolProvider2_Release(This) \
+#define ICorDebugSymbolProvider2_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugSymbolProvider2_GetGenericDictionaryInfo(This,ppMemoryBuffer) \
+#define ICorDebugSymbolProvider2_GetGenericDictionaryInfo(This,ppMemoryBuffer) \
( (This)->lpVtbl -> GetGenericDictionaryInfo(This,ppMemoryBuffer) )
-#define ICorDebugSymbolProvider2_GetFrameProps(This,codeRva,pCodeStartRva,pParentFrameStartRva) \
+#define ICorDebugSymbolProvider2_GetFrameProps(This,codeRva,pCodeStartRva,pParentFrameStartRva) \
( (This)->lpVtbl -> GetFrameProps(This,codeRva,pCodeStartRva,pParentFrameStartRva) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugSymbolProvider2_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugSymbolProvider2_INTERFACE_DEFINED__ */
#ifndef __ICorDebugVirtualUnwinder_INTERFACE_DEFINED__
@@ -2502,7 +2516,7 @@ EXTERN_C const IID IID_ICorDebugVirtualUnwinder;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugVirtualUnwinderVtbl
{
@@ -2543,31 +2557,31 @@ EXTERN_C const IID IID_ICorDebugVirtualUnwinder;
#ifdef COBJMACROS
-#define ICorDebugVirtualUnwinder_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugVirtualUnwinder_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugVirtualUnwinder_AddRef(This) \
+#define ICorDebugVirtualUnwinder_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugVirtualUnwinder_Release(This) \
+#define ICorDebugVirtualUnwinder_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugVirtualUnwinder_GetContext(This,contextFlags,cbContextBuf,contextSize,contextBuf) \
+#define ICorDebugVirtualUnwinder_GetContext(This,contextFlags,cbContextBuf,contextSize,contextBuf) \
( (This)->lpVtbl -> GetContext(This,contextFlags,cbContextBuf,contextSize,contextBuf) )
-#define ICorDebugVirtualUnwinder_Next(This) \
+#define ICorDebugVirtualUnwinder_Next(This) \
( (This)->lpVtbl -> Next(This) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugVirtualUnwinder_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugVirtualUnwinder_INTERFACE_DEFINED__ */
#ifndef __ICorDebugDataTarget2_INTERFACE_DEFINED__
@@ -2615,7 +2629,7 @@ EXTERN_C const IID IID_ICorDebugDataTarget2;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugDataTarget2Vtbl
{
@@ -2678,40 +2692,40 @@ EXTERN_C const IID IID_ICorDebugDataTarget2;
#ifdef COBJMACROS
-#define ICorDebugDataTarget2_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugDataTarget2_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugDataTarget2_AddRef(This) \
+#define ICorDebugDataTarget2_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugDataTarget2_Release(This) \
+#define ICorDebugDataTarget2_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugDataTarget2_GetImageFromPointer(This,addr,pImageBase,pSize) \
+#define ICorDebugDataTarget2_GetImageFromPointer(This,addr,pImageBase,pSize) \
( (This)->lpVtbl -> GetImageFromPointer(This,addr,pImageBase,pSize) )
-#define ICorDebugDataTarget2_GetImageLocation(This,baseAddress,cchName,pcchName,szName) \
+#define ICorDebugDataTarget2_GetImageLocation(This,baseAddress,cchName,pcchName,szName) \
( (This)->lpVtbl -> GetImageLocation(This,baseAddress,cchName,pcchName,szName) )
-#define ICorDebugDataTarget2_GetSymbolProviderForImage(This,imageBaseAddress,ppSymProvider) \
+#define ICorDebugDataTarget2_GetSymbolProviderForImage(This,imageBaseAddress,ppSymProvider) \
( (This)->lpVtbl -> GetSymbolProviderForImage(This,imageBaseAddress,ppSymProvider) )
-#define ICorDebugDataTarget2_EnumerateThreadIDs(This,cThreadIds,pcThreadIds,pThreadIds) \
+#define ICorDebugDataTarget2_EnumerateThreadIDs(This,cThreadIds,pcThreadIds,pThreadIds) \
( (This)->lpVtbl -> EnumerateThreadIDs(This,cThreadIds,pcThreadIds,pThreadIds) )
-#define ICorDebugDataTarget2_CreateVirtualUnwinder(This,nativeThreadID,contextFlags,cbContext,initialContext,ppUnwinder) \
+#define ICorDebugDataTarget2_CreateVirtualUnwinder(This,nativeThreadID,contextFlags,cbContext,initialContext,ppUnwinder) \
( (This)->lpVtbl -> CreateVirtualUnwinder(This,nativeThreadID,contextFlags,cbContext,initialContext,ppUnwinder) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugDataTarget2_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugDataTarget2_INTERFACE_DEFINED__ */
#ifndef __ICorDebugLoadedModule_INTERFACE_DEFINED__
@@ -2743,7 +2757,7 @@ EXTERN_C const IID IID_ICorDebugLoadedModule;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugLoadedModuleVtbl
{
@@ -2788,34 +2802,34 @@ EXTERN_C const IID IID_ICorDebugLoadedModule;
#ifdef COBJMACROS
-#define ICorDebugLoadedModule_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugLoadedModule_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugLoadedModule_AddRef(This) \
+#define ICorDebugLoadedModule_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugLoadedModule_Release(This) \
+#define ICorDebugLoadedModule_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugLoadedModule_GetBaseAddress(This,pAddress) \
+#define ICorDebugLoadedModule_GetBaseAddress(This,pAddress) \
( (This)->lpVtbl -> GetBaseAddress(This,pAddress) )
-#define ICorDebugLoadedModule_GetName(This,cchName,pcchName,szName) \
+#define ICorDebugLoadedModule_GetName(This,cchName,pcchName,szName) \
( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) )
-#define ICorDebugLoadedModule_GetSize(This,pcBytes) \
+#define ICorDebugLoadedModule_GetSize(This,pcBytes) \
( (This)->lpVtbl -> GetSize(This,pcBytes) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugLoadedModule_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugLoadedModule_INTERFACE_DEFINED__ */
#ifndef __ICorDebugDataTarget3_INTERFACE_DEFINED__
@@ -2841,7 +2855,7 @@ EXTERN_C const IID IID_ICorDebugDataTarget3;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugDataTarget3Vtbl
{
@@ -2878,28 +2892,28 @@ EXTERN_C const IID IID_ICorDebugDataTarget3;
#ifdef COBJMACROS
-#define ICorDebugDataTarget3_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugDataTarget3_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugDataTarget3_AddRef(This) \
+#define ICorDebugDataTarget3_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugDataTarget3_Release(This) \
+#define ICorDebugDataTarget3_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugDataTarget3_GetLoadedModules(This,cRequestedModules,pcFetchedModules,pLoadedModules) \
+#define ICorDebugDataTarget3_GetLoadedModules(This,cRequestedModules,pcFetchedModules,pLoadedModules) \
( (This)->lpVtbl -> GetLoadedModules(This,cRequestedModules,pcFetchedModules,pLoadedModules) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugDataTarget3_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugDataTarget3_INTERFACE_DEFINED__ */
#ifndef __ICorDebugDataTarget4_INTERFACE_DEFINED__
@@ -2925,7 +2939,7 @@ EXTERN_C const IID IID_ICorDebugDataTarget4;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugDataTarget4Vtbl
{
@@ -2962,28 +2976,28 @@ EXTERN_C const IID IID_ICorDebugDataTarget4;
#ifdef COBJMACROS
-#define ICorDebugDataTarget4_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugDataTarget4_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugDataTarget4_AddRef(This) \
+#define ICorDebugDataTarget4_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugDataTarget4_Release(This) \
+#define ICorDebugDataTarget4_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugDataTarget4_VirtualUnwind(This,threadId,contextSize,context) \
+#define ICorDebugDataTarget4_VirtualUnwind(This,threadId,contextSize,context) \
( (This)->lpVtbl -> VirtualUnwind(This,threadId,contextSize,context) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugDataTarget4_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugDataTarget4_INTERFACE_DEFINED__ */
#ifndef __ICorDebugMutableDataTarget_INTERFACE_DEFINED__
@@ -3018,7 +3032,7 @@ EXTERN_C const IID IID_ICorDebugMutableDataTarget;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugMutableDataTargetVtbl
{
@@ -3084,44 +3098,44 @@ EXTERN_C const IID IID_ICorDebugMutableDataTarget;
#ifdef COBJMACROS
-#define ICorDebugMutableDataTarget_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugMutableDataTarget_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugMutableDataTarget_AddRef(This) \
+#define ICorDebugMutableDataTarget_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugMutableDataTarget_Release(This) \
+#define ICorDebugMutableDataTarget_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugMutableDataTarget_GetPlatform(This,pTargetPlatform) \
+#define ICorDebugMutableDataTarget_GetPlatform(This,pTargetPlatform) \
( (This)->lpVtbl -> GetPlatform(This,pTargetPlatform) )
-#define ICorDebugMutableDataTarget_ReadVirtual(This,address,pBuffer,bytesRequested,pBytesRead) \
+#define ICorDebugMutableDataTarget_ReadVirtual(This,address,pBuffer,bytesRequested,pBytesRead) \
( (This)->lpVtbl -> ReadVirtual(This,address,pBuffer,bytesRequested,pBytesRead) )
-#define ICorDebugMutableDataTarget_GetThreadContext(This,dwThreadID,contextFlags,contextSize,pContext) \
+#define ICorDebugMutableDataTarget_GetThreadContext(This,dwThreadID,contextFlags,contextSize,pContext) \
( (This)->lpVtbl -> GetThreadContext(This,dwThreadID,contextFlags,contextSize,pContext) )
-#define ICorDebugMutableDataTarget_WriteVirtual(This,address,pBuffer,bytesRequested) \
+#define ICorDebugMutableDataTarget_WriteVirtual(This,address,pBuffer,bytesRequested) \
( (This)->lpVtbl -> WriteVirtual(This,address,pBuffer,bytesRequested) )
-#define ICorDebugMutableDataTarget_SetThreadContext(This,dwThreadID,contextSize,pContext) \
+#define ICorDebugMutableDataTarget_SetThreadContext(This,dwThreadID,contextSize,pContext) \
( (This)->lpVtbl -> SetThreadContext(This,dwThreadID,contextSize,pContext) )
-#define ICorDebugMutableDataTarget_ContinueStatusChanged(This,dwThreadId,continueStatus) \
+#define ICorDebugMutableDataTarget_ContinueStatusChanged(This,dwThreadId,continueStatus) \
( (This)->lpVtbl -> ContinueStatusChanged(This,dwThreadId,continueStatus) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugMutableDataTarget_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugMutableDataTarget_INTERFACE_DEFINED__ */
#ifndef __ICorDebugMetaDataLocator_INTERFACE_DEFINED__
@@ -3152,7 +3166,7 @@ EXTERN_C const IID IID_ICorDebugMetaDataLocator;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugMetaDataLocatorVtbl
{
@@ -3194,28 +3208,28 @@ EXTERN_C const IID IID_ICorDebugMetaDataLocator;
#ifdef COBJMACROS
-#define ICorDebugMetaDataLocator_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugMetaDataLocator_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugMetaDataLocator_AddRef(This) \
+#define ICorDebugMetaDataLocator_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugMetaDataLocator_Release(This) \
+#define ICorDebugMetaDataLocator_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugMetaDataLocator_GetMetaData(This,wszImagePath,dwImageTimeStamp,dwImageSize,cchPathBuffer,pcchPathBuffer,wszPathBuffer) \
+#define ICorDebugMetaDataLocator_GetMetaData(This,wszImagePath,dwImageTimeStamp,dwImageSize,cchPathBuffer,pcchPathBuffer,wszPathBuffer) \
( (This)->lpVtbl -> GetMetaData(This,wszImagePath,dwImageTimeStamp,dwImageSize,cchPathBuffer,pcchPathBuffer,wszPathBuffer) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugMetaDataLocator_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugMetaDataLocator_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_cordebug_0000_0015 */
@@ -3237,40 +3251,40 @@ extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0015_v0_0_s_ifspec;
typedef
enum CorDebugStepReason
{
- STEP_NORMAL = 0,
- STEP_RETURN = ( STEP_NORMAL + 1 ) ,
- STEP_CALL = ( STEP_RETURN + 1 ) ,
- STEP_EXCEPTION_FILTER = ( STEP_CALL + 1 ) ,
- STEP_EXCEPTION_HANDLER = ( STEP_EXCEPTION_FILTER + 1 ) ,
- STEP_INTERCEPT = ( STEP_EXCEPTION_HANDLER + 1 ) ,
- STEP_EXIT = ( STEP_INTERCEPT + 1 )
- } CorDebugStepReason;
+ STEP_NORMAL = 0,
+ STEP_RETURN = ( STEP_NORMAL + 1 ) ,
+ STEP_CALL = ( STEP_RETURN + 1 ) ,
+ STEP_EXCEPTION_FILTER = ( STEP_CALL + 1 ) ,
+ STEP_EXCEPTION_HANDLER = ( STEP_EXCEPTION_FILTER + 1 ) ,
+ STEP_INTERCEPT = ( STEP_EXCEPTION_HANDLER + 1 ) ,
+ STEP_EXIT = ( STEP_INTERCEPT + 1 )
+ } CorDebugStepReason;
typedef
enum LoggingLevelEnum
{
- LTraceLevel0 = 0,
- LTraceLevel1 = ( LTraceLevel0 + 1 ) ,
- LTraceLevel2 = ( LTraceLevel1 + 1 ) ,
- LTraceLevel3 = ( LTraceLevel2 + 1 ) ,
- LTraceLevel4 = ( LTraceLevel3 + 1 ) ,
- LStatusLevel0 = 20,
- LStatusLevel1 = ( LStatusLevel0 + 1 ) ,
- LStatusLevel2 = ( LStatusLevel1 + 1 ) ,
- LStatusLevel3 = ( LStatusLevel2 + 1 ) ,
- LStatusLevel4 = ( LStatusLevel3 + 1 ) ,
- LWarningLevel = 40,
- LErrorLevel = 50,
- LPanicLevel = 100
- } LoggingLevelEnum;
+ LTraceLevel0 = 0,
+ LTraceLevel1 = ( LTraceLevel0 + 1 ) ,
+ LTraceLevel2 = ( LTraceLevel1 + 1 ) ,
+ LTraceLevel3 = ( LTraceLevel2 + 1 ) ,
+ LTraceLevel4 = ( LTraceLevel3 + 1 ) ,
+ LStatusLevel0 = 20,
+ LStatusLevel1 = ( LStatusLevel0 + 1 ) ,
+ LStatusLevel2 = ( LStatusLevel1 + 1 ) ,
+ LStatusLevel3 = ( LStatusLevel2 + 1 ) ,
+ LStatusLevel4 = ( LStatusLevel3 + 1 ) ,
+ LWarningLevel = 40,
+ LErrorLevel = 50,
+ LPanicLevel = 100
+ } LoggingLevelEnum;
typedef
enum LogSwitchCallReason
{
- SWITCH_CREATE = 0,
- SWITCH_MODIFY = ( SWITCH_CREATE + 1 ) ,
- SWITCH_DELETE = ( SWITCH_MODIFY + 1 )
- } LogSwitchCallReason;
+ SWITCH_CREATE = 0,
+ SWITCH_MODIFY = ( SWITCH_CREATE + 1 ) ,
+ SWITCH_DELETE = ( SWITCH_MODIFY + 1 )
+ } LogSwitchCallReason;
EXTERN_C const IID IID_ICorDebugManagedCallback;
@@ -3404,7 +3418,7 @@ EXTERN_C const IID IID_ICorDebugManagedCallback;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugManagedCallbackVtbl
{
@@ -3581,103 +3595,103 @@ EXTERN_C const IID IID_ICorDebugManagedCallback;
#ifdef COBJMACROS
-#define ICorDebugManagedCallback_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugManagedCallback_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugManagedCallback_AddRef(This) \
+#define ICorDebugManagedCallback_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugManagedCallback_Release(This) \
+#define ICorDebugManagedCallback_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugManagedCallback_Breakpoint(This,pAppDomain,pThread,pBreakpoint) \
+#define ICorDebugManagedCallback_Breakpoint(This,pAppDomain,pThread,pBreakpoint) \
( (This)->lpVtbl -> Breakpoint(This,pAppDomain,pThread,pBreakpoint) )
-#define ICorDebugManagedCallback_StepComplete(This,pAppDomain,pThread,pStepper,reason) \
+#define ICorDebugManagedCallback_StepComplete(This,pAppDomain,pThread,pStepper,reason) \
( (This)->lpVtbl -> StepComplete(This,pAppDomain,pThread,pStepper,reason) )
-#define ICorDebugManagedCallback_Break(This,pAppDomain,thread) \
+#define ICorDebugManagedCallback_Break(This,pAppDomain,thread) \
( (This)->lpVtbl -> Break(This,pAppDomain,thread) )
-#define ICorDebugManagedCallback_Exception(This,pAppDomain,pThread,unhandled) \
+#define ICorDebugManagedCallback_Exception(This,pAppDomain,pThread,unhandled) \
( (This)->lpVtbl -> Exception(This,pAppDomain,pThread,unhandled) )
-#define ICorDebugManagedCallback_EvalComplete(This,pAppDomain,pThread,pEval) \
+#define ICorDebugManagedCallback_EvalComplete(This,pAppDomain,pThread,pEval) \
( (This)->lpVtbl -> EvalComplete(This,pAppDomain,pThread,pEval) )
-#define ICorDebugManagedCallback_EvalException(This,pAppDomain,pThread,pEval) \
+#define ICorDebugManagedCallback_EvalException(This,pAppDomain,pThread,pEval) \
( (This)->lpVtbl -> EvalException(This,pAppDomain,pThread,pEval) )
-#define ICorDebugManagedCallback_CreateProcess(This,pProcess) \
+#define ICorDebugManagedCallback_CreateProcess(This,pProcess) \
( (This)->lpVtbl -> CreateProcess(This,pProcess) )
-#define ICorDebugManagedCallback_ExitProcess(This,pProcess) \
+#define ICorDebugManagedCallback_ExitProcess(This,pProcess) \
( (This)->lpVtbl -> ExitProcess(This,pProcess) )
-#define ICorDebugManagedCallback_CreateThread(This,pAppDomain,thread) \
+#define ICorDebugManagedCallback_CreateThread(This,pAppDomain,thread) \
( (This)->lpVtbl -> CreateThread(This,pAppDomain,thread) )
-#define ICorDebugManagedCallback_ExitThread(This,pAppDomain,thread) \
+#define ICorDebugManagedCallback_ExitThread(This,pAppDomain,thread) \
( (This)->lpVtbl -> ExitThread(This,pAppDomain,thread) )
-#define ICorDebugManagedCallback_LoadModule(This,pAppDomain,pModule) \
+#define ICorDebugManagedCallback_LoadModule(This,pAppDomain,pModule) \
( (This)->lpVtbl -> LoadModule(This,pAppDomain,pModule) )
-#define ICorDebugManagedCallback_UnloadModule(This,pAppDomain,pModule) \
+#define ICorDebugManagedCallback_UnloadModule(This,pAppDomain,pModule) \
( (This)->lpVtbl -> UnloadModule(This,pAppDomain,pModule) )
-#define ICorDebugManagedCallback_LoadClass(This,pAppDomain,c) \
+#define ICorDebugManagedCallback_LoadClass(This,pAppDomain,c) \
( (This)->lpVtbl -> LoadClass(This,pAppDomain,c) )
-#define ICorDebugManagedCallback_UnloadClass(This,pAppDomain,c) \
+#define ICorDebugManagedCallback_UnloadClass(This,pAppDomain,c) \
( (This)->lpVtbl -> UnloadClass(This,pAppDomain,c) )
-#define ICorDebugManagedCallback_DebuggerError(This,pProcess,errorHR,errorCode) \
+#define ICorDebugManagedCallback_DebuggerError(This,pProcess,errorHR,errorCode) \
( (This)->lpVtbl -> DebuggerError(This,pProcess,errorHR,errorCode) )
-#define ICorDebugManagedCallback_LogMessage(This,pAppDomain,pThread,lLevel,pLogSwitchName,pMessage) \
+#define ICorDebugManagedCallback_LogMessage(This,pAppDomain,pThread,lLevel,pLogSwitchName,pMessage) \
( (This)->lpVtbl -> LogMessage(This,pAppDomain,pThread,lLevel,pLogSwitchName,pMessage) )
-#define ICorDebugManagedCallback_LogSwitch(This,pAppDomain,pThread,lLevel,ulReason,pLogSwitchName,pParentName) \
+#define ICorDebugManagedCallback_LogSwitch(This,pAppDomain,pThread,lLevel,ulReason,pLogSwitchName,pParentName) \
( (This)->lpVtbl -> LogSwitch(This,pAppDomain,pThread,lLevel,ulReason,pLogSwitchName,pParentName) )
-#define ICorDebugManagedCallback_CreateAppDomain(This,pProcess,pAppDomain) \
+#define ICorDebugManagedCallback_CreateAppDomain(This,pProcess,pAppDomain) \
( (This)->lpVtbl -> CreateAppDomain(This,pProcess,pAppDomain) )
-#define ICorDebugManagedCallback_ExitAppDomain(This,pProcess,pAppDomain) \
+#define ICorDebugManagedCallback_ExitAppDomain(This,pProcess,pAppDomain) \
( (This)->lpVtbl -> ExitAppDomain(This,pProcess,pAppDomain) )
-#define ICorDebugManagedCallback_LoadAssembly(This,pAppDomain,pAssembly) \
+#define ICorDebugManagedCallback_LoadAssembly(This,pAppDomain,pAssembly) \
( (This)->lpVtbl -> LoadAssembly(This,pAppDomain,pAssembly) )
-#define ICorDebugManagedCallback_UnloadAssembly(This,pAppDomain,pAssembly) \
+#define ICorDebugManagedCallback_UnloadAssembly(This,pAppDomain,pAssembly) \
( (This)->lpVtbl -> UnloadAssembly(This,pAppDomain,pAssembly) )
-#define ICorDebugManagedCallback_ControlCTrap(This,pProcess) \
+#define ICorDebugManagedCallback_ControlCTrap(This,pProcess) \
( (This)->lpVtbl -> ControlCTrap(This,pProcess) )
-#define ICorDebugManagedCallback_NameChange(This,pAppDomain,pThread) \
+#define ICorDebugManagedCallback_NameChange(This,pAppDomain,pThread) \
( (This)->lpVtbl -> NameChange(This,pAppDomain,pThread) )
-#define ICorDebugManagedCallback_UpdateModuleSymbols(This,pAppDomain,pModule,pSymbolStream) \
+#define ICorDebugManagedCallback_UpdateModuleSymbols(This,pAppDomain,pModule,pSymbolStream) \
( (This)->lpVtbl -> UpdateModuleSymbols(This,pAppDomain,pModule,pSymbolStream) )
-#define ICorDebugManagedCallback_EditAndContinueRemap(This,pAppDomain,pThread,pFunction,fAccurate) \
+#define ICorDebugManagedCallback_EditAndContinueRemap(This,pAppDomain,pThread,pFunction,fAccurate) \
( (This)->lpVtbl -> EditAndContinueRemap(This,pAppDomain,pThread,pFunction,fAccurate) )
-#define ICorDebugManagedCallback_BreakpointSetError(This,pAppDomain,pThread,pBreakpoint,dwError) \
+#define ICorDebugManagedCallback_BreakpointSetError(This,pAppDomain,pThread,pBreakpoint,dwError) \
( (This)->lpVtbl -> BreakpointSetError(This,pAppDomain,pThread,pBreakpoint,dwError) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugManagedCallback_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugManagedCallback_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_cordebug_0000_0016 */
@@ -3712,7 +3726,7 @@ EXTERN_C const IID IID_ICorDebugManagedCallback3;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugManagedCallback3Vtbl
{
@@ -3748,28 +3762,28 @@ EXTERN_C const IID IID_ICorDebugManagedCallback3;
#ifdef COBJMACROS
-#define ICorDebugManagedCallback3_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugManagedCallback3_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugManagedCallback3_AddRef(This) \
+#define ICorDebugManagedCallback3_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugManagedCallback3_Release(This) \
+#define ICorDebugManagedCallback3_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugManagedCallback3_CustomNotification(This,pThread,pAppDomain) \
+#define ICorDebugManagedCallback3_CustomNotification(This,pThread,pAppDomain) \
( (This)->lpVtbl -> CustomNotification(This,pThread,pAppDomain) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugManagedCallback3_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugManagedCallback3_INTERFACE_DEFINED__ */
#ifndef __ICorDebugManagedCallback4_INTERFACE_DEFINED__
@@ -3802,7 +3816,7 @@ EXTERN_C const IID IID_ICorDebugManagedCallback4;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugManagedCallback4Vtbl
{
@@ -3848,34 +3862,34 @@ EXTERN_C const IID IID_ICorDebugManagedCallback4;
#ifdef COBJMACROS
-#define ICorDebugManagedCallback4_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugManagedCallback4_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugManagedCallback4_AddRef(This) \
+#define ICorDebugManagedCallback4_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugManagedCallback4_Release(This) \
+#define ICorDebugManagedCallback4_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugManagedCallback4_BeforeGarbageCollection(This,pProcess) \
+#define ICorDebugManagedCallback4_BeforeGarbageCollection(This,pProcess) \
( (This)->lpVtbl -> BeforeGarbageCollection(This,pProcess) )
-#define ICorDebugManagedCallback4_AfterGarbageCollection(This,pProcess) \
+#define ICorDebugManagedCallback4_AfterGarbageCollection(This,pProcess) \
( (This)->lpVtbl -> AfterGarbageCollection(This,pProcess) )
-#define ICorDebugManagedCallback4_DataBreakpoint(This,pProcess,pThread,pContext,contextSize) \
+#define ICorDebugManagedCallback4_DataBreakpoint(This,pProcess,pThread,pContext,contextSize) \
( (This)->lpVtbl -> DataBreakpoint(This,pProcess,pThread,pContext,contextSize) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugManagedCallback4_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugManagedCallback4_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_cordebug_0000_0018 */
@@ -3896,25 +3910,25 @@ extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0018_v0_0_s_ifspec;
typedef
enum CorDebugExceptionCallbackType
{
- DEBUG_EXCEPTION_FIRST_CHANCE = 1,
- DEBUG_EXCEPTION_USER_FIRST_CHANCE = 2,
- DEBUG_EXCEPTION_CATCH_HANDLER_FOUND = 3,
- DEBUG_EXCEPTION_UNHANDLED = 4
- } CorDebugExceptionCallbackType;
+ DEBUG_EXCEPTION_FIRST_CHANCE = 1,
+ DEBUG_EXCEPTION_USER_FIRST_CHANCE = 2,
+ DEBUG_EXCEPTION_CATCH_HANDLER_FOUND = 3,
+ DEBUG_EXCEPTION_UNHANDLED = 4
+ } CorDebugExceptionCallbackType;
typedef
enum CorDebugExceptionFlags
{
- DEBUG_EXCEPTION_NONE = 0,
- DEBUG_EXCEPTION_CAN_BE_INTERCEPTED = 0x1
- } CorDebugExceptionFlags;
+ DEBUG_EXCEPTION_NONE = 0,
+ DEBUG_EXCEPTION_CAN_BE_INTERCEPTED = 0x1
+ } CorDebugExceptionFlags;
typedef
enum CorDebugExceptionUnwindCallbackType
{
- DEBUG_EXCEPTION_UNWIND_BEGIN = 1,
- DEBUG_EXCEPTION_INTERCEPTED = 2
- } CorDebugExceptionUnwindCallbackType;
+ DEBUG_EXCEPTION_UNWIND_BEGIN = 1,
+ DEBUG_EXCEPTION_INTERCEPTED = 2
+ } CorDebugExceptionUnwindCallbackType;
EXTERN_C const IID IID_ICorDebugManagedCallback2;
@@ -3972,7 +3986,7 @@ EXTERN_C const IID IID_ICorDebugManagedCallback2;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugManagedCallback2Vtbl
{
@@ -4055,49 +4069,49 @@ EXTERN_C const IID IID_ICorDebugManagedCallback2;
#ifdef COBJMACROS
-#define ICorDebugManagedCallback2_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugManagedCallback2_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugManagedCallback2_AddRef(This) \
+#define ICorDebugManagedCallback2_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugManagedCallback2_Release(This) \
+#define ICorDebugManagedCallback2_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugManagedCallback2_FunctionRemapOpportunity(This,pAppDomain,pThread,pOldFunction,pNewFunction,oldILOffset) \
+#define ICorDebugManagedCallback2_FunctionRemapOpportunity(This,pAppDomain,pThread,pOldFunction,pNewFunction,oldILOffset) \
( (This)->lpVtbl -> FunctionRemapOpportunity(This,pAppDomain,pThread,pOldFunction,pNewFunction,oldILOffset) )
-#define ICorDebugManagedCallback2_CreateConnection(This,pProcess,dwConnectionId,pConnName) \
+#define ICorDebugManagedCallback2_CreateConnection(This,pProcess,dwConnectionId,pConnName) \
( (This)->lpVtbl -> CreateConnection(This,pProcess,dwConnectionId,pConnName) )
-#define ICorDebugManagedCallback2_ChangeConnection(This,pProcess,dwConnectionId) \
+#define ICorDebugManagedCallback2_ChangeConnection(This,pProcess,dwConnectionId) \
( (This)->lpVtbl -> ChangeConnection(This,pProcess,dwConnectionId) )
-#define ICorDebugManagedCallback2_DestroyConnection(This,pProcess,dwConnectionId) \
+#define ICorDebugManagedCallback2_DestroyConnection(This,pProcess,dwConnectionId) \
( (This)->lpVtbl -> DestroyConnection(This,pProcess,dwConnectionId) )
-#define ICorDebugManagedCallback2_Exception(This,pAppDomain,pThread,pFrame,nOffset,dwEventType,dwFlags) \
+#define ICorDebugManagedCallback2_Exception(This,pAppDomain,pThread,pFrame,nOffset,dwEventType,dwFlags) \
( (This)->lpVtbl -> Exception(This,pAppDomain,pThread,pFrame,nOffset,dwEventType,dwFlags) )
-#define ICorDebugManagedCallback2_ExceptionUnwind(This,pAppDomain,pThread,dwEventType,dwFlags) \
+#define ICorDebugManagedCallback2_ExceptionUnwind(This,pAppDomain,pThread,dwEventType,dwFlags) \
( (This)->lpVtbl -> ExceptionUnwind(This,pAppDomain,pThread,dwEventType,dwFlags) )
-#define ICorDebugManagedCallback2_FunctionRemapComplete(This,pAppDomain,pThread,pFunction) \
+#define ICorDebugManagedCallback2_FunctionRemapComplete(This,pAppDomain,pThread,pFunction) \
( (This)->lpVtbl -> FunctionRemapComplete(This,pAppDomain,pThread,pFunction) )
-#define ICorDebugManagedCallback2_MDANotification(This,pController,pThread,pMDA) \
+#define ICorDebugManagedCallback2_MDANotification(This,pController,pThread,pMDA) \
( (This)->lpVtbl -> MDANotification(This,pController,pThread,pMDA) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugManagedCallback2_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugManagedCallback2_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_cordebug_0000_0019 */
@@ -4131,7 +4145,7 @@ EXTERN_C const IID IID_ICorDebugUnmanagedCallback;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugUnmanagedCallbackVtbl
{
@@ -4167,28 +4181,28 @@ EXTERN_C const IID IID_ICorDebugUnmanagedCallback;
#ifdef COBJMACROS
-#define ICorDebugUnmanagedCallback_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugUnmanagedCallback_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugUnmanagedCallback_AddRef(This) \
+#define ICorDebugUnmanagedCallback_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugUnmanagedCallback_Release(This) \
+#define ICorDebugUnmanagedCallback_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugUnmanagedCallback_DebugEvent(This,pDebugEvent,fOutOfBand) \
+#define ICorDebugUnmanagedCallback_DebugEvent(This,pDebugEvent,fOutOfBand) \
( (This)->lpVtbl -> DebugEvent(This,pDebugEvent,fOutOfBand) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugUnmanagedCallback_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugUnmanagedCallback_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_cordebug_0000_0020 */
@@ -4197,15 +4211,15 @@ EXTERN_C const IID IID_ICorDebugUnmanagedCallback;
typedef
enum CorDebugCreateProcessFlags
{
- DEBUG_NO_SPECIAL_OPTIONS = 0
- } CorDebugCreateProcessFlags;
+ DEBUG_NO_SPECIAL_OPTIONS = 0
+ } CorDebugCreateProcessFlags;
typedef
enum CorDebugHandleType
{
- HANDLE_STRONG = 1,
- HANDLE_WEAK_TRACK_RESURRECTION = 2
- } CorDebugHandleType;
+ HANDLE_STRONG = 1,
+ HANDLE_WEAK_TRACK_RESURRECTION = 2
+ } CorDebugHandleType;
#pragma warning(push)
#pragma warning(disable:28718)
@@ -4272,7 +4286,7 @@ EXTERN_C const IID IID_ICorDebug;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugVtbl
{
@@ -4352,52 +4366,52 @@ EXTERN_C const IID IID_ICorDebug;
#ifdef COBJMACROS
-#define ICorDebug_QueryInterface(This,riid,ppvObject) \
+#define ICorDebug_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebug_AddRef(This) \
+#define ICorDebug_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebug_Release(This) \
+#define ICorDebug_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebug_Initialize(This) \
+#define ICorDebug_Initialize(This) \
( (This)->lpVtbl -> Initialize(This) )
-#define ICorDebug_Terminate(This) \
+#define ICorDebug_Terminate(This) \
( (This)->lpVtbl -> Terminate(This) )
-#define ICorDebug_SetManagedHandler(This,pCallback) \
+#define ICorDebug_SetManagedHandler(This,pCallback) \
( (This)->lpVtbl -> SetManagedHandler(This,pCallback) )
-#define ICorDebug_SetUnmanagedHandler(This,pCallback) \
+#define ICorDebug_SetUnmanagedHandler(This,pCallback) \
( (This)->lpVtbl -> SetUnmanagedHandler(This,pCallback) )
-#define ICorDebug_CreateProcess(This,lpApplicationName,lpCommandLine,lpProcessAttributes,lpThreadAttributes,bInheritHandles,dwCreationFlags,lpEnvironment,lpCurrentDirectory,lpStartupInfo,lpProcessInformation,debuggingFlags,ppProcess) \
+#define ICorDebug_CreateProcess(This,lpApplicationName,lpCommandLine,lpProcessAttributes,lpThreadAttributes,bInheritHandles,dwCreationFlags,lpEnvironment,lpCurrentDirectory,lpStartupInfo,lpProcessInformation,debuggingFlags,ppProcess) \
( (This)->lpVtbl -> CreateProcess(This,lpApplicationName,lpCommandLine,lpProcessAttributes,lpThreadAttributes,bInheritHandles,dwCreationFlags,lpEnvironment,lpCurrentDirectory,lpStartupInfo,lpProcessInformation,debuggingFlags,ppProcess) )
-#define ICorDebug_DebugActiveProcess(This,id,win32Attach,ppProcess) \
+#define ICorDebug_DebugActiveProcess(This,id,win32Attach,ppProcess) \
( (This)->lpVtbl -> DebugActiveProcess(This,id,win32Attach,ppProcess) )
-#define ICorDebug_EnumerateProcesses(This,ppProcess) \
+#define ICorDebug_EnumerateProcesses(This,ppProcess) \
( (This)->lpVtbl -> EnumerateProcesses(This,ppProcess) )
-#define ICorDebug_GetProcess(This,dwProcessId,ppProcess) \
+#define ICorDebug_GetProcess(This,dwProcessId,ppProcess) \
( (This)->lpVtbl -> GetProcess(This,dwProcessId,ppProcess) )
-#define ICorDebug_CanLaunchOrAttach(This,dwProcessId,win32DebuggingEnabled) \
+#define ICorDebug_CanLaunchOrAttach(This,dwProcessId,win32DebuggingEnabled) \
( (This)->lpVtbl -> CanLaunchOrAttach(This,dwProcessId,win32DebuggingEnabled) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebug_INTERFACE_DEFINED__ */
+#endif /* __ICorDebug_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_cordebug_0000_0021 */
@@ -4434,7 +4448,7 @@ EXTERN_C const IID IID_ICorDebugRemoteTarget;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugRemoteTargetVtbl
{
@@ -4473,28 +4487,28 @@ EXTERN_C const IID IID_ICorDebugRemoteTarget;
#ifdef COBJMACROS
-#define ICorDebugRemoteTarget_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugRemoteTarget_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugRemoteTarget_AddRef(This) \
+#define ICorDebugRemoteTarget_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugRemoteTarget_Release(This) \
+#define ICorDebugRemoteTarget_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugRemoteTarget_GetHostName(This,cchHostName,pcchHostName,szHostName) \
+#define ICorDebugRemoteTarget_GetHostName(This,cchHostName,pcchHostName,szHostName) \
( (This)->lpVtbl -> GetHostName(This,cchHostName,pcchHostName,szHostName) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugRemoteTarget_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugRemoteTarget_INTERFACE_DEFINED__ */
#ifndef __ICorDebugRemote_INTERFACE_DEFINED__
@@ -4537,7 +4551,7 @@ EXTERN_C const IID IID_ICorDebugRemote;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugRemoteVtbl
{
@@ -4592,31 +4606,31 @@ EXTERN_C const IID IID_ICorDebugRemote;
#ifdef COBJMACROS
-#define ICorDebugRemote_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugRemote_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugRemote_AddRef(This) \
+#define ICorDebugRemote_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugRemote_Release(This) \
+#define ICorDebugRemote_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugRemote_CreateProcessEx(This,pRemoteTarget,lpApplicationName,lpCommandLine,lpProcessAttributes,lpThreadAttributes,bInheritHandles,dwCreationFlags,lpEnvironment,lpCurrentDirectory,lpStartupInfo,lpProcessInformation,debuggingFlags,ppProcess) \
+#define ICorDebugRemote_CreateProcessEx(This,pRemoteTarget,lpApplicationName,lpCommandLine,lpProcessAttributes,lpThreadAttributes,bInheritHandles,dwCreationFlags,lpEnvironment,lpCurrentDirectory,lpStartupInfo,lpProcessInformation,debuggingFlags,ppProcess) \
( (This)->lpVtbl -> CreateProcessEx(This,pRemoteTarget,lpApplicationName,lpCommandLine,lpProcessAttributes,lpThreadAttributes,bInheritHandles,dwCreationFlags,lpEnvironment,lpCurrentDirectory,lpStartupInfo,lpProcessInformation,debuggingFlags,ppProcess) )
-#define ICorDebugRemote_DebugActiveProcessEx(This,pRemoteTarget,dwProcessId,fWin32Attach,ppProcess) \
+#define ICorDebugRemote_DebugActiveProcessEx(This,pRemoteTarget,dwProcessId,fWin32Attach,ppProcess) \
( (This)->lpVtbl -> DebugActiveProcessEx(This,pRemoteTarget,dwProcessId,fWin32Attach,ppProcess) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugRemote_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugRemote_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_cordebug_0000_0023 */
@@ -4628,7 +4642,7 @@ typedef struct _COR_VERSION
DWORD dwMinor;
DWORD dwBuild;
DWORD dwSubBuild;
- } COR_VERSION;
+ } COR_VERSION;
@@ -4644,92 +4658,92 @@ extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0023_v0_0_s_ifspec;
typedef
enum CorDebugInterfaceVersion
{
- CorDebugInvalidVersion = 0,
- CorDebugVersion_1_0 = ( CorDebugInvalidVersion + 1 ) ,
- ver_ICorDebugManagedCallback = CorDebugVersion_1_0,
- ver_ICorDebugUnmanagedCallback = CorDebugVersion_1_0,
- ver_ICorDebug = CorDebugVersion_1_0,
- ver_ICorDebugController = CorDebugVersion_1_0,
- ver_ICorDebugAppDomain = CorDebugVersion_1_0,
- ver_ICorDebugAssembly = CorDebugVersion_1_0,
- ver_ICorDebugProcess = CorDebugVersion_1_0,
- ver_ICorDebugBreakpoint = CorDebugVersion_1_0,
- ver_ICorDebugFunctionBreakpoint = CorDebugVersion_1_0,
- ver_ICorDebugModuleBreakpoint = CorDebugVersion_1_0,
- ver_ICorDebugValueBreakpoint = CorDebugVersion_1_0,
- ver_ICorDebugStepper = CorDebugVersion_1_0,
- ver_ICorDebugRegisterSet = CorDebugVersion_1_0,
- ver_ICorDebugThread = CorDebugVersion_1_0,
- ver_ICorDebugChain = CorDebugVersion_1_0,
- ver_ICorDebugFrame = CorDebugVersion_1_0,
- ver_ICorDebugILFrame = CorDebugVersion_1_0,
- ver_ICorDebugNativeFrame = CorDebugVersion_1_0,
- ver_ICorDebugModule = CorDebugVersion_1_0,
- ver_ICorDebugFunction = CorDebugVersion_1_0,
- ver_ICorDebugCode = CorDebugVersion_1_0,
- ver_ICorDebugClass = CorDebugVersion_1_0,
- ver_ICorDebugEval = CorDebugVersion_1_0,
- ver_ICorDebugValue = CorDebugVersion_1_0,
- ver_ICorDebugGenericValue = CorDebugVersion_1_0,
- ver_ICorDebugReferenceValue = CorDebugVersion_1_0,
- ver_ICorDebugHeapValue = CorDebugVersion_1_0,
- ver_ICorDebugObjectValue = CorDebugVersion_1_0,
- ver_ICorDebugBoxValue = CorDebugVersion_1_0,
- ver_ICorDebugStringValue = CorDebugVersion_1_0,
- ver_ICorDebugArrayValue = CorDebugVersion_1_0,
- ver_ICorDebugContext = CorDebugVersion_1_0,
- ver_ICorDebugEnum = CorDebugVersion_1_0,
- ver_ICorDebugObjectEnum = CorDebugVersion_1_0,
- ver_ICorDebugBreakpointEnum = CorDebugVersion_1_0,
- ver_ICorDebugStepperEnum = CorDebugVersion_1_0,
- ver_ICorDebugProcessEnum = CorDebugVersion_1_0,
- ver_ICorDebugThreadEnum = CorDebugVersion_1_0,
- ver_ICorDebugFrameEnum = CorDebugVersion_1_0,
- ver_ICorDebugChainEnum = CorDebugVersion_1_0,
- ver_ICorDebugModuleEnum = CorDebugVersion_1_0,
- ver_ICorDebugValueEnum = CorDebugVersion_1_0,
- ver_ICorDebugCodeEnum = CorDebugVersion_1_0,
- ver_ICorDebugTypeEnum = CorDebugVersion_1_0,
- ver_ICorDebugErrorInfoEnum = CorDebugVersion_1_0,
- ver_ICorDebugAppDomainEnum = CorDebugVersion_1_0,
- ver_ICorDebugAssemblyEnum = CorDebugVersion_1_0,
- ver_ICorDebugEditAndContinueErrorInfo = CorDebugVersion_1_0,
- ver_ICorDebugEditAndContinueSnapshot = CorDebugVersion_1_0,
- CorDebugVersion_1_1 = ( CorDebugVersion_1_0 + 1 ) ,
- CorDebugVersion_2_0 = ( CorDebugVersion_1_1 + 1 ) ,
- ver_ICorDebugManagedCallback2 = CorDebugVersion_2_0,
- ver_ICorDebugAppDomain2 = CorDebugVersion_2_0,
- ver_ICorDebugAssembly2 = CorDebugVersion_2_0,
- ver_ICorDebugProcess2 = CorDebugVersion_2_0,
- ver_ICorDebugStepper2 = CorDebugVersion_2_0,
- ver_ICorDebugRegisterSet2 = CorDebugVersion_2_0,
- ver_ICorDebugThread2 = CorDebugVersion_2_0,
- ver_ICorDebugILFrame2 = CorDebugVersion_2_0,
- ver_ICorDebugInternalFrame = CorDebugVersion_2_0,
- ver_ICorDebugModule2 = CorDebugVersion_2_0,
- ver_ICorDebugFunction2 = CorDebugVersion_2_0,
- ver_ICorDebugCode2 = CorDebugVersion_2_0,
- ver_ICorDebugClass2 = CorDebugVersion_2_0,
- ver_ICorDebugValue2 = CorDebugVersion_2_0,
- ver_ICorDebugEval2 = CorDebugVersion_2_0,
- ver_ICorDebugObjectValue2 = CorDebugVersion_2_0,
- CorDebugVersion_4_0 = ( CorDebugVersion_2_0 + 1 ) ,
- ver_ICorDebugThread3 = CorDebugVersion_4_0,
- ver_ICorDebugThread4 = CorDebugVersion_4_0,
- ver_ICorDebugStackWalk = CorDebugVersion_4_0,
- ver_ICorDebugNativeFrame2 = CorDebugVersion_4_0,
- ver_ICorDebugInternalFrame2 = CorDebugVersion_4_0,
- ver_ICorDebugRuntimeUnwindableFrame = CorDebugVersion_4_0,
- ver_ICorDebugHeapValue3 = CorDebugVersion_4_0,
- ver_ICorDebugBlockingObjectEnum = CorDebugVersion_4_0,
- ver_ICorDebugValue3 = CorDebugVersion_4_0,
- CorDebugVersion_4_5 = ( CorDebugVersion_4_0 + 1 ) ,
- ver_ICorDebugComObjectValue = CorDebugVersion_4_5,
- ver_ICorDebugAppDomain3 = CorDebugVersion_4_5,
- ver_ICorDebugCode3 = CorDebugVersion_4_5,
- ver_ICorDebugILFrame3 = CorDebugVersion_4_5,
- CorDebugLatestVersion = CorDebugVersion_4_5
- } CorDebugInterfaceVersion;
+ CorDebugInvalidVersion = 0,
+ CorDebugVersion_1_0 = ( CorDebugInvalidVersion + 1 ) ,
+ ver_ICorDebugManagedCallback = CorDebugVersion_1_0,
+ ver_ICorDebugUnmanagedCallback = CorDebugVersion_1_0,
+ ver_ICorDebug = CorDebugVersion_1_0,
+ ver_ICorDebugController = CorDebugVersion_1_0,
+ ver_ICorDebugAppDomain = CorDebugVersion_1_0,
+ ver_ICorDebugAssembly = CorDebugVersion_1_0,
+ ver_ICorDebugProcess = CorDebugVersion_1_0,
+ ver_ICorDebugBreakpoint = CorDebugVersion_1_0,
+ ver_ICorDebugFunctionBreakpoint = CorDebugVersion_1_0,
+ ver_ICorDebugModuleBreakpoint = CorDebugVersion_1_0,
+ ver_ICorDebugValueBreakpoint = CorDebugVersion_1_0,
+ ver_ICorDebugStepper = CorDebugVersion_1_0,
+ ver_ICorDebugRegisterSet = CorDebugVersion_1_0,
+ ver_ICorDebugThread = CorDebugVersion_1_0,
+ ver_ICorDebugChain = CorDebugVersion_1_0,
+ ver_ICorDebugFrame = CorDebugVersion_1_0,
+ ver_ICorDebugILFrame = CorDebugVersion_1_0,
+ ver_ICorDebugNativeFrame = CorDebugVersion_1_0,
+ ver_ICorDebugModule = CorDebugVersion_1_0,
+ ver_ICorDebugFunction = CorDebugVersion_1_0,
+ ver_ICorDebugCode = CorDebugVersion_1_0,
+ ver_ICorDebugClass = CorDebugVersion_1_0,
+ ver_ICorDebugEval = CorDebugVersion_1_0,
+ ver_ICorDebugValue = CorDebugVersion_1_0,
+ ver_ICorDebugGenericValue = CorDebugVersion_1_0,
+ ver_ICorDebugReferenceValue = CorDebugVersion_1_0,
+ ver_ICorDebugHeapValue = CorDebugVersion_1_0,
+ ver_ICorDebugObjectValue = CorDebugVersion_1_0,
+ ver_ICorDebugBoxValue = CorDebugVersion_1_0,
+ ver_ICorDebugStringValue = CorDebugVersion_1_0,
+ ver_ICorDebugArrayValue = CorDebugVersion_1_0,
+ ver_ICorDebugContext = CorDebugVersion_1_0,
+ ver_ICorDebugEnum = CorDebugVersion_1_0,
+ ver_ICorDebugObjectEnum = CorDebugVersion_1_0,
+ ver_ICorDebugBreakpointEnum = CorDebugVersion_1_0,
+ ver_ICorDebugStepperEnum = CorDebugVersion_1_0,
+ ver_ICorDebugProcessEnum = CorDebugVersion_1_0,
+ ver_ICorDebugThreadEnum = CorDebugVersion_1_0,
+ ver_ICorDebugFrameEnum = CorDebugVersion_1_0,
+ ver_ICorDebugChainEnum = CorDebugVersion_1_0,
+ ver_ICorDebugModuleEnum = CorDebugVersion_1_0,
+ ver_ICorDebugValueEnum = CorDebugVersion_1_0,
+ ver_ICorDebugCodeEnum = CorDebugVersion_1_0,
+ ver_ICorDebugTypeEnum = CorDebugVersion_1_0,
+ ver_ICorDebugErrorInfoEnum = CorDebugVersion_1_0,
+ ver_ICorDebugAppDomainEnum = CorDebugVersion_1_0,
+ ver_ICorDebugAssemblyEnum = CorDebugVersion_1_0,
+ ver_ICorDebugEditAndContinueErrorInfo = CorDebugVersion_1_0,
+ ver_ICorDebugEditAndContinueSnapshot = CorDebugVersion_1_0,
+ CorDebugVersion_1_1 = ( CorDebugVersion_1_0 + 1 ) ,
+ CorDebugVersion_2_0 = ( CorDebugVersion_1_1 + 1 ) ,
+ ver_ICorDebugManagedCallback2 = CorDebugVersion_2_0,
+ ver_ICorDebugAppDomain2 = CorDebugVersion_2_0,
+ ver_ICorDebugAssembly2 = CorDebugVersion_2_0,
+ ver_ICorDebugProcess2 = CorDebugVersion_2_0,
+ ver_ICorDebugStepper2 = CorDebugVersion_2_0,
+ ver_ICorDebugRegisterSet2 = CorDebugVersion_2_0,
+ ver_ICorDebugThread2 = CorDebugVersion_2_0,
+ ver_ICorDebugILFrame2 = CorDebugVersion_2_0,
+ ver_ICorDebugInternalFrame = CorDebugVersion_2_0,
+ ver_ICorDebugModule2 = CorDebugVersion_2_0,
+ ver_ICorDebugFunction2 = CorDebugVersion_2_0,
+ ver_ICorDebugCode2 = CorDebugVersion_2_0,
+ ver_ICorDebugClass2 = CorDebugVersion_2_0,
+ ver_ICorDebugValue2 = CorDebugVersion_2_0,
+ ver_ICorDebugEval2 = CorDebugVersion_2_0,
+ ver_ICorDebugObjectValue2 = CorDebugVersion_2_0,
+ CorDebugVersion_4_0 = ( CorDebugVersion_2_0 + 1 ) ,
+ ver_ICorDebugThread3 = CorDebugVersion_4_0,
+ ver_ICorDebugThread4 = CorDebugVersion_4_0,
+ ver_ICorDebugStackWalk = CorDebugVersion_4_0,
+ ver_ICorDebugNativeFrame2 = CorDebugVersion_4_0,
+ ver_ICorDebugInternalFrame2 = CorDebugVersion_4_0,
+ ver_ICorDebugRuntimeUnwindableFrame = CorDebugVersion_4_0,
+ ver_ICorDebugHeapValue3 = CorDebugVersion_4_0,
+ ver_ICorDebugBlockingObjectEnum = CorDebugVersion_4_0,
+ ver_ICorDebugValue3 = CorDebugVersion_4_0,
+ CorDebugVersion_4_5 = ( CorDebugVersion_4_0 + 1 ) ,
+ ver_ICorDebugComObjectValue = CorDebugVersion_4_5,
+ ver_ICorDebugAppDomain3 = CorDebugVersion_4_5,
+ ver_ICorDebugCode3 = CorDebugVersion_4_5,
+ ver_ICorDebugILFrame3 = CorDebugVersion_4_5,
+ CorDebugLatestVersion = CorDebugVersion_4_5
+ } CorDebugInterfaceVersion;
EXTERN_C const IID IID_ICorDebug2;
@@ -4743,7 +4757,7 @@ EXTERN_C const IID IID_ICorDebug2;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebug2Vtbl
{
@@ -4774,25 +4788,25 @@ EXTERN_C const IID IID_ICorDebug2;
#ifdef COBJMACROS
-#define ICorDebug2_QueryInterface(This,riid,ppvObject) \
+#define ICorDebug2_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebug2_AddRef(This) \
+#define ICorDebug2_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebug2_Release(This) \
+#define ICorDebug2_Release(This) \
( (This)->lpVtbl -> Release(This) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebug2_INTERFACE_DEFINED__ */
+#endif /* __ICorDebug2_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_cordebug_0000_0024 */
@@ -4801,9 +4815,9 @@ EXTERN_C const IID IID_ICorDebug2;
typedef
enum CorDebugThreadState
{
- THREAD_RUN = 0,
- THREAD_SUSPEND = ( THREAD_RUN + 1 )
- } CorDebugThreadState;
+ THREAD_RUN = 0,
+ THREAD_SUSPEND = ( THREAD_RUN + 1 )
+ } CorDebugThreadState;
@@ -4863,7 +4877,7 @@ EXTERN_C const IID IID_ICorDebugController;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugControllerVtbl
{
@@ -4939,55 +4953,55 @@ EXTERN_C const IID IID_ICorDebugController;
#ifdef COBJMACROS
-#define ICorDebugController_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugController_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugController_AddRef(This) \
+#define ICorDebugController_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugController_Release(This) \
+#define ICorDebugController_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugController_Stop(This,dwTimeoutIgnored) \
+#define ICorDebugController_Stop(This,dwTimeoutIgnored) \
( (This)->lpVtbl -> Stop(This,dwTimeoutIgnored) )
-#define ICorDebugController_Continue(This,fIsOutOfBand) \
+#define ICorDebugController_Continue(This,fIsOutOfBand) \
( (This)->lpVtbl -> Continue(This,fIsOutOfBand) )
-#define ICorDebugController_IsRunning(This,pbRunning) \
+#define ICorDebugController_IsRunning(This,pbRunning) \
( (This)->lpVtbl -> IsRunning(This,pbRunning) )
-#define ICorDebugController_HasQueuedCallbacks(This,pThread,pbQueued) \
+#define ICorDebugController_HasQueuedCallbacks(This,pThread,pbQueued) \
( (This)->lpVtbl -> HasQueuedCallbacks(This,pThread,pbQueued) )
-#define ICorDebugController_EnumerateThreads(This,ppThreads) \
+#define ICorDebugController_EnumerateThreads(This,ppThreads) \
( (This)->lpVtbl -> EnumerateThreads(This,ppThreads) )
-#define ICorDebugController_SetAllThreadsDebugState(This,state,pExceptThisThread) \
+#define ICorDebugController_SetAllThreadsDebugState(This,state,pExceptThisThread) \
( (This)->lpVtbl -> SetAllThreadsDebugState(This,state,pExceptThisThread) )
-#define ICorDebugController_Detach(This) \
+#define ICorDebugController_Detach(This) \
( (This)->lpVtbl -> Detach(This) )
-#define ICorDebugController_Terminate(This,exitCode) \
+#define ICorDebugController_Terminate(This,exitCode) \
( (This)->lpVtbl -> Terminate(This,exitCode) )
-#define ICorDebugController_CanCommitChanges(This,cSnapshots,pSnapshots,pError) \
+#define ICorDebugController_CanCommitChanges(This,cSnapshots,pSnapshots,pError) \
( (This)->lpVtbl -> CanCommitChanges(This,cSnapshots,pSnapshots,pError) )
-#define ICorDebugController_CommitChanges(This,cSnapshots,pSnapshots,pError) \
+#define ICorDebugController_CommitChanges(This,cSnapshots,pSnapshots,pError) \
( (This)->lpVtbl -> CommitChanges(This,cSnapshots,pSnapshots,pError) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugController_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugController_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_cordebug_0000_0025 */
@@ -5050,7 +5064,7 @@ EXTERN_C const IID IID_ICorDebugAppDomain;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugAppDomainVtbl
{
@@ -5168,86 +5182,86 @@ EXTERN_C const IID IID_ICorDebugAppDomain;
#ifdef COBJMACROS
-#define ICorDebugAppDomain_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugAppDomain_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugAppDomain_AddRef(This) \
+#define ICorDebugAppDomain_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugAppDomain_Release(This) \
+#define ICorDebugAppDomain_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugAppDomain_Stop(This,dwTimeoutIgnored) \
+#define ICorDebugAppDomain_Stop(This,dwTimeoutIgnored) \
( (This)->lpVtbl -> Stop(This,dwTimeoutIgnored) )
-#define ICorDebugAppDomain_Continue(This,fIsOutOfBand) \
+#define ICorDebugAppDomain_Continue(This,fIsOutOfBand) \
( (This)->lpVtbl -> Continue(This,fIsOutOfBand) )
-#define ICorDebugAppDomain_IsRunning(This,pbRunning) \
+#define ICorDebugAppDomain_IsRunning(This,pbRunning) \
( (This)->lpVtbl -> IsRunning(This,pbRunning) )
-#define ICorDebugAppDomain_HasQueuedCallbacks(This,pThread,pbQueued) \
+#define ICorDebugAppDomain_HasQueuedCallbacks(This,pThread,pbQueued) \
( (This)->lpVtbl -> HasQueuedCallbacks(This,pThread,pbQueued) )
-#define ICorDebugAppDomain_EnumerateThreads(This,ppThreads) \
+#define ICorDebugAppDomain_EnumerateThreads(This,ppThreads) \
( (This)->lpVtbl -> EnumerateThreads(This,ppThreads) )
-#define ICorDebugAppDomain_SetAllThreadsDebugState(This,state,pExceptThisThread) \
+#define ICorDebugAppDomain_SetAllThreadsDebugState(This,state,pExceptThisThread) \
( (This)->lpVtbl -> SetAllThreadsDebugState(This,state,pExceptThisThread) )
-#define ICorDebugAppDomain_Detach(This) \
+#define ICorDebugAppDomain_Detach(This) \
( (This)->lpVtbl -> Detach(This) )
-#define ICorDebugAppDomain_Terminate(This,exitCode) \
+#define ICorDebugAppDomain_Terminate(This,exitCode) \
( (This)->lpVtbl -> Terminate(This,exitCode) )
-#define ICorDebugAppDomain_CanCommitChanges(This,cSnapshots,pSnapshots,pError) \
+#define ICorDebugAppDomain_CanCommitChanges(This,cSnapshots,pSnapshots,pError) \
( (This)->lpVtbl -> CanCommitChanges(This,cSnapshots,pSnapshots,pError) )
-#define ICorDebugAppDomain_CommitChanges(This,cSnapshots,pSnapshots,pError) \
+#define ICorDebugAppDomain_CommitChanges(This,cSnapshots,pSnapshots,pError) \
( (This)->lpVtbl -> CommitChanges(This,cSnapshots,pSnapshots,pError) )
-#define ICorDebugAppDomain_GetProcess(This,ppProcess) \
+#define ICorDebugAppDomain_GetProcess(This,ppProcess) \
( (This)->lpVtbl -> GetProcess(This,ppProcess) )
-#define ICorDebugAppDomain_EnumerateAssemblies(This,ppAssemblies) \
+#define ICorDebugAppDomain_EnumerateAssemblies(This,ppAssemblies) \
( (This)->lpVtbl -> EnumerateAssemblies(This,ppAssemblies) )
-#define ICorDebugAppDomain_GetModuleFromMetaDataInterface(This,pIMetaData,ppModule) \
+#define ICorDebugAppDomain_GetModuleFromMetaDataInterface(This,pIMetaData,ppModule) \
( (This)->lpVtbl -> GetModuleFromMetaDataInterface(This,pIMetaData,ppModule) )
-#define ICorDebugAppDomain_EnumerateBreakpoints(This,ppBreakpoints) \
+#define ICorDebugAppDomain_EnumerateBreakpoints(This,ppBreakpoints) \
( (This)->lpVtbl -> EnumerateBreakpoints(This,ppBreakpoints) )
-#define ICorDebugAppDomain_EnumerateSteppers(This,ppSteppers) \
+#define ICorDebugAppDomain_EnumerateSteppers(This,ppSteppers) \
( (This)->lpVtbl -> EnumerateSteppers(This,ppSteppers) )
-#define ICorDebugAppDomain_IsAttached(This,pbAttached) \
+#define ICorDebugAppDomain_IsAttached(This,pbAttached) \
( (This)->lpVtbl -> IsAttached(This,pbAttached) )
-#define ICorDebugAppDomain_GetName(This,cchName,pcchName,szName) \
+#define ICorDebugAppDomain_GetName(This,cchName,pcchName,szName) \
( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) )
-#define ICorDebugAppDomain_GetObject(This,ppObject) \
+#define ICorDebugAppDomain_GetObject(This,ppObject) \
( (This)->lpVtbl -> GetObject(This,ppObject) )
-#define ICorDebugAppDomain_Attach(This) \
+#define ICorDebugAppDomain_Attach(This) \
( (This)->lpVtbl -> Attach(This) )
-#define ICorDebugAppDomain_GetID(This,pId) \
+#define ICorDebugAppDomain_GetID(This,pId) \
( (This)->lpVtbl -> GetID(This,pId) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugAppDomain_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugAppDomain_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_cordebug_0000_0026 */
@@ -5288,7 +5302,7 @@ EXTERN_C const IID IID_ICorDebugAppDomain2;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugAppDomain2Vtbl
{
@@ -5332,31 +5346,31 @@ EXTERN_C const IID IID_ICorDebugAppDomain2;
#ifdef COBJMACROS
-#define ICorDebugAppDomain2_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugAppDomain2_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugAppDomain2_AddRef(This) \
+#define ICorDebugAppDomain2_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugAppDomain2_Release(This) \
+#define ICorDebugAppDomain2_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugAppDomain2_GetArrayOrPointerType(This,elementType,nRank,pTypeArg,ppType) \
+#define ICorDebugAppDomain2_GetArrayOrPointerType(This,elementType,nRank,pTypeArg,ppType) \
( (This)->lpVtbl -> GetArrayOrPointerType(This,elementType,nRank,pTypeArg,ppType) )
-#define ICorDebugAppDomain2_GetFunctionPointerType(This,nTypeArgs,ppTypeArgs,ppType) \
+#define ICorDebugAppDomain2_GetFunctionPointerType(This,nTypeArgs,ppTypeArgs,ppType) \
( (This)->lpVtbl -> GetFunctionPointerType(This,nTypeArgs,ppTypeArgs,ppType) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugAppDomain2_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugAppDomain2_INTERFACE_DEFINED__ */
#ifndef __ICorDebugEnum_INTERFACE_DEFINED__
@@ -5388,7 +5402,7 @@ EXTERN_C const IID IID_ICorDebugEnum;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugEnumVtbl
{
@@ -5434,37 +5448,37 @@ EXTERN_C const IID IID_ICorDebugEnum;
#ifdef COBJMACROS
-#define ICorDebugEnum_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugEnum_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugEnum_AddRef(This) \
+#define ICorDebugEnum_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugEnum_Release(This) \
+#define ICorDebugEnum_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugEnum_Skip(This,celt) \
+#define ICorDebugEnum_Skip(This,celt) \
( (This)->lpVtbl -> Skip(This,celt) )
-#define ICorDebugEnum_Reset(This) \
+#define ICorDebugEnum_Reset(This) \
( (This)->lpVtbl -> Reset(This) )
-#define ICorDebugEnum_Clone(This,ppEnum) \
+#define ICorDebugEnum_Clone(This,ppEnum) \
( (This)->lpVtbl -> Clone(This,ppEnum) )
-#define ICorDebugEnum_GetCount(This,pcelt) \
+#define ICorDebugEnum_GetCount(This,pcelt) \
( (This)->lpVtbl -> GetCount(This,pcelt) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugEnum_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugEnum_INTERFACE_DEFINED__ */
#ifndef __ICorDebugGuidToTypeEnum_INTERFACE_DEFINED__
@@ -5490,7 +5504,7 @@ EXTERN_C const IID IID_ICorDebugGuidToTypeEnum;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugGuidToTypeEnumVtbl
{
@@ -5542,41 +5556,41 @@ EXTERN_C const IID IID_ICorDebugGuidToTypeEnum;
#ifdef COBJMACROS
-#define ICorDebugGuidToTypeEnum_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugGuidToTypeEnum_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugGuidToTypeEnum_AddRef(This) \
+#define ICorDebugGuidToTypeEnum_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugGuidToTypeEnum_Release(This) \
+#define ICorDebugGuidToTypeEnum_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugGuidToTypeEnum_Skip(This,celt) \
+#define ICorDebugGuidToTypeEnum_Skip(This,celt) \
( (This)->lpVtbl -> Skip(This,celt) )
-#define ICorDebugGuidToTypeEnum_Reset(This) \
+#define ICorDebugGuidToTypeEnum_Reset(This) \
( (This)->lpVtbl -> Reset(This) )
-#define ICorDebugGuidToTypeEnum_Clone(This,ppEnum) \
+#define ICorDebugGuidToTypeEnum_Clone(This,ppEnum) \
( (This)->lpVtbl -> Clone(This,ppEnum) )
-#define ICorDebugGuidToTypeEnum_GetCount(This,pcelt) \
+#define ICorDebugGuidToTypeEnum_GetCount(This,pcelt) \
( (This)->lpVtbl -> GetCount(This,pcelt) )
-#define ICorDebugGuidToTypeEnum_Next(This,celt,values,pceltFetched) \
+#define ICorDebugGuidToTypeEnum_Next(This,celt,values,pceltFetched) \
( (This)->lpVtbl -> Next(This,celt,values,pceltFetched) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugGuidToTypeEnum_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugGuidToTypeEnum_INTERFACE_DEFINED__ */
#ifndef __ICorDebugAppDomain3_INTERFACE_DEFINED__
@@ -5605,7 +5619,7 @@ EXTERN_C const IID IID_ICorDebugAppDomain3;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugAppDomain3Vtbl
{
@@ -5646,31 +5660,31 @@ EXTERN_C const IID IID_ICorDebugAppDomain3;
#ifdef COBJMACROS
-#define ICorDebugAppDomain3_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugAppDomain3_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugAppDomain3_AddRef(This) \
+#define ICorDebugAppDomain3_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugAppDomain3_Release(This) \
+#define ICorDebugAppDomain3_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugAppDomain3_GetCachedWinRTTypesForIIDs(This,cReqTypes,iidsToResolve,ppTypesEnum) \
+#define ICorDebugAppDomain3_GetCachedWinRTTypesForIIDs(This,cReqTypes,iidsToResolve,ppTypesEnum) \
( (This)->lpVtbl -> GetCachedWinRTTypesForIIDs(This,cReqTypes,iidsToResolve,ppTypesEnum) )
-#define ICorDebugAppDomain3_GetCachedWinRTTypes(This,ppGuidToTypeEnum) \
+#define ICorDebugAppDomain3_GetCachedWinRTTypes(This,ppGuidToTypeEnum) \
( (This)->lpVtbl -> GetCachedWinRTTypes(This,ppGuidToTypeEnum) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugAppDomain3_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugAppDomain3_INTERFACE_DEFINED__ */
#ifndef __ICorDebugAppDomain4_INTERFACE_DEFINED__
@@ -5695,7 +5709,7 @@ EXTERN_C const IID IID_ICorDebugAppDomain4;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugAppDomain4Vtbl
{
@@ -5731,28 +5745,28 @@ EXTERN_C const IID IID_ICorDebugAppDomain4;
#ifdef COBJMACROS
-#define ICorDebugAppDomain4_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugAppDomain4_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugAppDomain4_AddRef(This) \
+#define ICorDebugAppDomain4_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugAppDomain4_Release(This) \
+#define ICorDebugAppDomain4_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugAppDomain4_GetObjectForCCW(This,ccwPointer,ppManagedObject) \
+#define ICorDebugAppDomain4_GetObjectForCCW(This,ccwPointer,ppManagedObject) \
( (This)->lpVtbl -> GetObjectForCCW(This,ccwPointer,ppManagedObject) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugAppDomain4_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugAppDomain4_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_cordebug_0000_0030 */
@@ -5802,7 +5816,7 @@ EXTERN_C const IID IID_ICorDebugAssembly;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugAssemblyVtbl
{
@@ -5857,40 +5871,40 @@ EXTERN_C const IID IID_ICorDebugAssembly;
#ifdef COBJMACROS
-#define ICorDebugAssembly_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugAssembly_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugAssembly_AddRef(This) \
+#define ICorDebugAssembly_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugAssembly_Release(This) \
+#define ICorDebugAssembly_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugAssembly_GetProcess(This,ppProcess) \
+#define ICorDebugAssembly_GetProcess(This,ppProcess) \
( (This)->lpVtbl -> GetProcess(This,ppProcess) )
-#define ICorDebugAssembly_GetAppDomain(This,ppAppDomain) \
+#define ICorDebugAssembly_GetAppDomain(This,ppAppDomain) \
( (This)->lpVtbl -> GetAppDomain(This,ppAppDomain) )
-#define ICorDebugAssembly_EnumerateModules(This,ppModules) \
+#define ICorDebugAssembly_EnumerateModules(This,ppModules) \
( (This)->lpVtbl -> EnumerateModules(This,ppModules) )
-#define ICorDebugAssembly_GetCodeBase(This,cchName,pcchName,szName) \
+#define ICorDebugAssembly_GetCodeBase(This,cchName,pcchName,szName) \
( (This)->lpVtbl -> GetCodeBase(This,cchName,pcchName,szName) )
-#define ICorDebugAssembly_GetName(This,cchName,pcchName,szName) \
+#define ICorDebugAssembly_GetName(This,cchName,pcchName,szName) \
( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugAssembly_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugAssembly_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_cordebug_0000_0031 */
@@ -5923,7 +5937,7 @@ EXTERN_C const IID IID_ICorDebugAssembly2;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugAssembly2Vtbl
{
@@ -5958,28 +5972,28 @@ EXTERN_C const IID IID_ICorDebugAssembly2;
#ifdef COBJMACROS
-#define ICorDebugAssembly2_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugAssembly2_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugAssembly2_AddRef(This) \
+#define ICorDebugAssembly2_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugAssembly2_Release(This) \
+#define ICorDebugAssembly2_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugAssembly2_IsFullyTrusted(This,pbFullyTrusted) \
+#define ICorDebugAssembly2_IsFullyTrusted(This,pbFullyTrusted) \
( (This)->lpVtbl -> IsFullyTrusted(This,pbFullyTrusted) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugAssembly2_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugAssembly2_INTERFACE_DEFINED__ */
#ifndef __ICorDebugAssembly3_INTERFACE_DEFINED__
@@ -6006,7 +6020,7 @@ EXTERN_C const IID IID_ICorDebugAssembly3;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugAssembly3Vtbl
{
@@ -6045,31 +6059,31 @@ EXTERN_C const IID IID_ICorDebugAssembly3;
#ifdef COBJMACROS
-#define ICorDebugAssembly3_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugAssembly3_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugAssembly3_AddRef(This) \
+#define ICorDebugAssembly3_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugAssembly3_Release(This) \
+#define ICorDebugAssembly3_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugAssembly3_GetContainerAssembly(This,ppAssembly) \
+#define ICorDebugAssembly3_GetContainerAssembly(This,ppAssembly) \
( (This)->lpVtbl -> GetContainerAssembly(This,ppAssembly) )
-#define ICorDebugAssembly3_EnumerateContainedAssemblies(This,ppAssemblies) \
+#define ICorDebugAssembly3_EnumerateContainedAssemblies(This,ppAssemblies) \
( (This)->lpVtbl -> EnumerateContainedAssemblies(This,ppAssemblies) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugAssembly3_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugAssembly3_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_cordebug_0000_0033 */
@@ -6081,7 +6095,7 @@ typedef struct COR_TYPEID
{
UINT64 token1;
UINT64 token2;
- } COR_TYPEID;
+ } COR_TYPEID;
#endif // _DEF_COR_TYPEID_
typedef struct _COR_HEAPOBJECT
@@ -6089,7 +6103,7 @@ typedef struct _COR_HEAPOBJECT
CORDB_ADDRESS address;
ULONG64 size;
COR_TYPEID type;
- } COR_HEAPOBJECT;
+ } COR_HEAPOBJECT;
@@ -6119,7 +6133,7 @@ EXTERN_C const IID IID_ICorDebugHeapEnum;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugHeapEnumVtbl
{
@@ -6171,41 +6185,41 @@ EXTERN_C const IID IID_ICorDebugHeapEnum;
#ifdef COBJMACROS
-#define ICorDebugHeapEnum_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugHeapEnum_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugHeapEnum_AddRef(This) \
+#define ICorDebugHeapEnum_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugHeapEnum_Release(This) \
+#define ICorDebugHeapEnum_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugHeapEnum_Skip(This,celt) \
+#define ICorDebugHeapEnum_Skip(This,celt) \
( (This)->lpVtbl -> Skip(This,celt) )
-#define ICorDebugHeapEnum_Reset(This) \
+#define ICorDebugHeapEnum_Reset(This) \
( (This)->lpVtbl -> Reset(This) )
-#define ICorDebugHeapEnum_Clone(This,ppEnum) \
+#define ICorDebugHeapEnum_Clone(This,ppEnum) \
( (This)->lpVtbl -> Clone(This,ppEnum) )
-#define ICorDebugHeapEnum_GetCount(This,pcelt) \
+#define ICorDebugHeapEnum_GetCount(This,pcelt) \
( (This)->lpVtbl -> GetCount(This,pcelt) )
-#define ICorDebugHeapEnum_Next(This,celt,objects,pceltFetched) \
+#define ICorDebugHeapEnum_Next(This,celt,objects,pceltFetched) \
( (This)->lpVtbl -> Next(This,celt,objects,pceltFetched) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugHeapEnum_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugHeapEnum_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_cordebug_0000_0034 */
@@ -6214,12 +6228,12 @@ EXTERN_C const IID IID_ICorDebugHeapEnum;
typedef
enum CorDebugGenerationTypes
{
- CorDebug_Gen0 = 0,
- CorDebug_Gen1 = 1,
- CorDebug_Gen2 = 2,
- CorDebug_LOH = 3,
- CorDebug_POH = 4
- } CorDebugGenerationTypes;
+ CorDebug_Gen0 = 0,
+ CorDebug_Gen1 = 1,
+ CorDebug_Gen2 = 2,
+ CorDebug_LOH = 3,
+ CorDebug_POH = 4
+ } CorDebugGenerationTypes;
typedef struct _COR_SEGMENT
{
@@ -6227,14 +6241,14 @@ typedef struct _COR_SEGMENT
CORDB_ADDRESS end;
CorDebugGenerationTypes type;
ULONG heap;
- } COR_SEGMENT;
+ } COR_SEGMENT;
typedef
enum CorDebugGCType
{
- CorDebugWorkstationGC = 0,
- CorDebugServerGC = ( CorDebugWorkstationGC + 1 )
- } CorDebugGCType;
+ CorDebugWorkstationGC = 0,
+ CorDebugServerGC = ( CorDebugWorkstationGC + 1 )
+ } CorDebugGCType;
typedef struct _COR_HEAPINFO
{
@@ -6243,7 +6257,7 @@ typedef struct _COR_HEAPINFO
DWORD numHeaps;
BOOL concurrent;
CorDebugGCType gcType;
- } COR_HEAPINFO;
+ } COR_HEAPINFO;
@@ -6273,7 +6287,7 @@ EXTERN_C const IID IID_ICorDebugHeapSegmentEnum;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugHeapSegmentEnumVtbl
{
@@ -6325,41 +6339,41 @@ EXTERN_C const IID IID_ICorDebugHeapSegmentEnum;
#ifdef COBJMACROS
-#define ICorDebugHeapSegmentEnum_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugHeapSegmentEnum_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugHeapSegmentEnum_AddRef(This) \
+#define ICorDebugHeapSegmentEnum_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugHeapSegmentEnum_Release(This) \
+#define ICorDebugHeapSegmentEnum_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugHeapSegmentEnum_Skip(This,celt) \
+#define ICorDebugHeapSegmentEnum_Skip(This,celt) \
( (This)->lpVtbl -> Skip(This,celt) )
-#define ICorDebugHeapSegmentEnum_Reset(This) \
+#define ICorDebugHeapSegmentEnum_Reset(This) \
( (This)->lpVtbl -> Reset(This) )
-#define ICorDebugHeapSegmentEnum_Clone(This,ppEnum) \
+#define ICorDebugHeapSegmentEnum_Clone(This,ppEnum) \
( (This)->lpVtbl -> Clone(This,ppEnum) )
-#define ICorDebugHeapSegmentEnum_GetCount(This,pcelt) \
+#define ICorDebugHeapSegmentEnum_GetCount(This,pcelt) \
( (This)->lpVtbl -> GetCount(This,pcelt) )
-#define ICorDebugHeapSegmentEnum_Next(This,celt,segments,pceltFetched) \
+#define ICorDebugHeapSegmentEnum_Next(This,celt,segments,pceltFetched) \
( (This)->lpVtbl -> Next(This,celt,segments,pceltFetched) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugHeapSegmentEnum_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugHeapSegmentEnum_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_cordebug_0000_0035 */
@@ -6368,23 +6382,23 @@ EXTERN_C const IID IID_ICorDebugHeapSegmentEnum;
typedef
enum CorGCReferenceType
{
- CorHandleStrong = ( 1 << 0 ) ,
- CorHandleStrongPinning = ( 1 << 1 ) ,
- CorHandleWeakShort = ( 1 << 2 ) ,
- CorHandleWeakLong = ( 1 << 3 ) ,
- CorHandleWeakRefCount = ( 1 << 4 ) ,
- CorHandleStrongRefCount = ( 1 << 5 ) ,
- CorHandleStrongDependent = ( 1 << 6 ) ,
- CorHandleStrongAsyncPinned = ( 1 << 7 ) ,
- CorHandleStrongSizedByref = ( 1 << 8 ) ,
- CorHandleWeakNativeCom = ( 1 << 9 ) ,
- CorHandleWeakWinRT = CorHandleWeakNativeCom,
- CorReferenceStack = 0x80000001,
- CorReferenceFinalizer = 80000002,
- CorHandleStrongOnly = 0x1e3,
- CorHandleWeakOnly = 0x21c,
- CorHandleAll = 0x7fffffff
- } CorGCReferenceType;
+ CorHandleStrong = ( 1 << 0 ) ,
+ CorHandleStrongPinning = ( 1 << 1 ) ,
+ CorHandleWeakShort = ( 1 << 2 ) ,
+ CorHandleWeakLong = ( 1 << 3 ) ,
+ CorHandleWeakRefCount = ( 1 << 4 ) ,
+ CorHandleStrongRefCount = ( 1 << 5 ) ,
+ CorHandleStrongDependent = ( 1 << 6 ) ,
+ CorHandleStrongAsyncPinned = ( 1 << 7 ) ,
+ CorHandleStrongSizedByref = ( 1 << 8 ) ,
+ CorHandleWeakNativeCom = ( 1 << 9 ) ,
+ CorHandleWeakWinRT = CorHandleWeakNativeCom,
+ CorReferenceStack = 0x80000001,
+ CorReferenceFinalizer = 80000002,
+ CorHandleStrongOnly = 0x1e3,
+ CorHandleWeakOnly = 0x21c,
+ CorHandleAll = 0x7fffffff
+ } CorGCReferenceType;
#ifndef _DEF_COR_GC_REFERENCE_
#define _DEF_COR_GC_REFERENCE_
@@ -6394,7 +6408,7 @@ typedef struct COR_GC_REFERENCE
ICorDebugValue *Location;
CorGCReferenceType Type;
UINT64 ExtraData;
- } COR_GC_REFERENCE;
+ } COR_GC_REFERENCE;
#endif // _DEF_COR_GC_REFERENCE_
@@ -6425,7 +6439,7 @@ EXTERN_C const IID IID_ICorDebugGCReferenceEnum;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugGCReferenceEnumVtbl
{
@@ -6477,41 +6491,41 @@ EXTERN_C const IID IID_ICorDebugGCReferenceEnum;
#ifdef COBJMACROS
-#define ICorDebugGCReferenceEnum_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugGCReferenceEnum_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugGCReferenceEnum_AddRef(This) \
+#define ICorDebugGCReferenceEnum_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugGCReferenceEnum_Release(This) \
+#define ICorDebugGCReferenceEnum_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugGCReferenceEnum_Skip(This,celt) \
+#define ICorDebugGCReferenceEnum_Skip(This,celt) \
( (This)->lpVtbl -> Skip(This,celt) )
-#define ICorDebugGCReferenceEnum_Reset(This) \
+#define ICorDebugGCReferenceEnum_Reset(This) \
( (This)->lpVtbl -> Reset(This) )
-#define ICorDebugGCReferenceEnum_Clone(This,ppEnum) \
+#define ICorDebugGCReferenceEnum_Clone(This,ppEnum) \
( (This)->lpVtbl -> Clone(This,ppEnum) )
-#define ICorDebugGCReferenceEnum_GetCount(This,pcelt) \
+#define ICorDebugGCReferenceEnum_GetCount(This,pcelt) \
( (This)->lpVtbl -> GetCount(This,pcelt) )
-#define ICorDebugGCReferenceEnum_Next(This,celt,roots,pceltFetched) \
+#define ICorDebugGCReferenceEnum_Next(This,celt,roots,pceltFetched) \
( (This)->lpVtbl -> Next(This,celt,roots,pceltFetched) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugGCReferenceEnum_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugGCReferenceEnum_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_cordebug_0000_0036 */
@@ -6529,7 +6543,7 @@ typedef struct COR_ARRAY_LAYOUT
ULONG32 rankSize;
ULONG32 numRanks;
ULONG32 rankOffset;
- } COR_ARRAY_LAYOUT;
+ } COR_ARRAY_LAYOUT;
#endif // _DEF_COR_ARRAY_LAYOUT_
#ifndef _DEF_COR_TYPE_LAYOUT_
@@ -6541,7 +6555,7 @@ typedef struct COR_TYPE_LAYOUT
ULONG32 numFields;
ULONG32 boxOffset;
CorElementType type;
- } COR_TYPE_LAYOUT;
+ } COR_TYPE_LAYOUT;
#endif // _DEF_COR_TYPE_LAYOUT_
#ifndef _DEF_COR_FIELD_
@@ -6552,7 +6566,7 @@ typedef struct COR_FIELD
ULONG32 offset;
COR_TYPEID id;
CorElementType fieldType;
- } COR_FIELD;
+ } COR_FIELD;
#endif // _DEF_COR_FIELD_
#pragma warning(push)
@@ -6647,7 +6661,7 @@ EXTERN_C const IID IID_ICorDebugProcess;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugProcessVtbl
{
@@ -6807,107 +6821,107 @@ EXTERN_C const IID IID_ICorDebugProcess;
#ifdef COBJMACROS
-#define ICorDebugProcess_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugProcess_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugProcess_AddRef(This) \
+#define ICorDebugProcess_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugProcess_Release(This) \
+#define ICorDebugProcess_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugProcess_Stop(This,dwTimeoutIgnored) \
+#define ICorDebugProcess_Stop(This,dwTimeoutIgnored) \
( (This)->lpVtbl -> Stop(This,dwTimeoutIgnored) )
-#define ICorDebugProcess_Continue(This,fIsOutOfBand) \
+#define ICorDebugProcess_Continue(This,fIsOutOfBand) \
( (This)->lpVtbl -> Continue(This,fIsOutOfBand) )
-#define ICorDebugProcess_IsRunning(This,pbRunning) \
+#define ICorDebugProcess_IsRunning(This,pbRunning) \
( (This)->lpVtbl -> IsRunning(This,pbRunning) )
-#define ICorDebugProcess_HasQueuedCallbacks(This,pThread,pbQueued) \
+#define ICorDebugProcess_HasQueuedCallbacks(This,pThread,pbQueued) \
( (This)->lpVtbl -> HasQueuedCallbacks(This,pThread,pbQueued) )
-#define ICorDebugProcess_EnumerateThreads(This,ppThreads) \
+#define ICorDebugProcess_EnumerateThreads(This,ppThreads) \
( (This)->lpVtbl -> EnumerateThreads(This,ppThreads) )
-#define ICorDebugProcess_SetAllThreadsDebugState(This,state,pExceptThisThread) \
+#define ICorDebugProcess_SetAllThreadsDebugState(This,state,pExceptThisThread) \
( (This)->lpVtbl -> SetAllThreadsDebugState(This,state,pExceptThisThread) )
-#define ICorDebugProcess_Detach(This) \
+#define ICorDebugProcess_Detach(This) \
( (This)->lpVtbl -> Detach(This) )
-#define ICorDebugProcess_Terminate(This,exitCode) \
+#define ICorDebugProcess_Terminate(This,exitCode) \
( (This)->lpVtbl -> Terminate(This,exitCode) )
-#define ICorDebugProcess_CanCommitChanges(This,cSnapshots,pSnapshots,pError) \
+#define ICorDebugProcess_CanCommitChanges(This,cSnapshots,pSnapshots,pError) \
( (This)->lpVtbl -> CanCommitChanges(This,cSnapshots,pSnapshots,pError) )
-#define ICorDebugProcess_CommitChanges(This,cSnapshots,pSnapshots,pError) \
+#define ICorDebugProcess_CommitChanges(This,cSnapshots,pSnapshots,pError) \
( (This)->lpVtbl -> CommitChanges(This,cSnapshots,pSnapshots,pError) )
-#define ICorDebugProcess_GetID(This,pdwProcessId) \
+#define ICorDebugProcess_GetID(This,pdwProcessId) \
( (This)->lpVtbl -> GetID(This,pdwProcessId) )
-#define ICorDebugProcess_GetHandle(This,phProcessHandle) \
+#define ICorDebugProcess_GetHandle(This,phProcessHandle) \
( (This)->lpVtbl -> GetHandle(This,phProcessHandle) )
-#define ICorDebugProcess_GetThread(This,dwThreadId,ppThread) \
+#define ICorDebugProcess_GetThread(This,dwThreadId,ppThread) \
( (This)->lpVtbl -> GetThread(This,dwThreadId,ppThread) )
-#define ICorDebugProcess_EnumerateObjects(This,ppObjects) \
+#define ICorDebugProcess_EnumerateObjects(This,ppObjects) \
( (This)->lpVtbl -> EnumerateObjects(This,ppObjects) )
-#define ICorDebugProcess_IsTransitionStub(This,address,pbTransitionStub) \
+#define ICorDebugProcess_IsTransitionStub(This,address,pbTransitionStub) \
( (This)->lpVtbl -> IsTransitionStub(This,address,pbTransitionStub) )
-#define ICorDebugProcess_IsOSSuspended(This,threadID,pbSuspended) \
+#define ICorDebugProcess_IsOSSuspended(This,threadID,pbSuspended) \
( (This)->lpVtbl -> IsOSSuspended(This,threadID,pbSuspended) )
-#define ICorDebugProcess_GetThreadContext(This,threadID,contextSize,context) \
+#define ICorDebugProcess_GetThreadContext(This,threadID,contextSize,context) \
( (This)->lpVtbl -> GetThreadContext(This,threadID,contextSize,context) )
-#define ICorDebugProcess_SetThreadContext(This,threadID,contextSize,context) \
+#define ICorDebugProcess_SetThreadContext(This,threadID,contextSize,context) \
( (This)->lpVtbl -> SetThreadContext(This,threadID,contextSize,context) )
-#define ICorDebugProcess_ReadMemory(This,address,size,buffer,read) \
+#define ICorDebugProcess_ReadMemory(This,address,size,buffer,read) \
( (This)->lpVtbl -> ReadMemory(This,address,size,buffer,read) )
-#define ICorDebugProcess_WriteMemory(This,address,size,buffer,written) \
+#define ICorDebugProcess_WriteMemory(This,address,size,buffer,written) \
( (This)->lpVtbl -> WriteMemory(This,address,size,buffer,written) )
-#define ICorDebugProcess_ClearCurrentException(This,threadID) \
+#define ICorDebugProcess_ClearCurrentException(This,threadID) \
( (This)->lpVtbl -> ClearCurrentException(This,threadID) )
-#define ICorDebugProcess_EnableLogMessages(This,fOnOff) \
+#define ICorDebugProcess_EnableLogMessages(This,fOnOff) \
( (This)->lpVtbl -> EnableLogMessages(This,fOnOff) )
-#define ICorDebugProcess_ModifyLogSwitch(This,pLogSwitchName,lLevel) \
+#define ICorDebugProcess_ModifyLogSwitch(This,pLogSwitchName,lLevel) \
( (This)->lpVtbl -> ModifyLogSwitch(This,pLogSwitchName,lLevel) )
-#define ICorDebugProcess_EnumerateAppDomains(This,ppAppDomains) \
+#define ICorDebugProcess_EnumerateAppDomains(This,ppAppDomains) \
( (This)->lpVtbl -> EnumerateAppDomains(This,ppAppDomains) )
-#define ICorDebugProcess_GetObject(This,ppObject) \
+#define ICorDebugProcess_GetObject(This,ppObject) \
( (This)->lpVtbl -> GetObject(This,ppObject) )
-#define ICorDebugProcess_ThreadForFiberCookie(This,fiberCookie,ppThread) \
+#define ICorDebugProcess_ThreadForFiberCookie(This,fiberCookie,ppThread) \
( (This)->lpVtbl -> ThreadForFiberCookie(This,fiberCookie,ppThread) )
-#define ICorDebugProcess_GetHelperThreadID(This,pThreadID) \
+#define ICorDebugProcess_GetHelperThreadID(This,pThreadID) \
( (This)->lpVtbl -> GetHelperThreadID(This,pThreadID) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugProcess_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugProcess_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_cordebug_0000_0037 */
@@ -6963,7 +6977,7 @@ EXTERN_C const IID IID_ICorDebugProcess2;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugProcess2Vtbl
{
@@ -7027,46 +7041,46 @@ EXTERN_C const IID IID_ICorDebugProcess2;
#ifdef COBJMACROS
-#define ICorDebugProcess2_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugProcess2_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugProcess2_AddRef(This) \
+#define ICorDebugProcess2_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugProcess2_Release(This) \
+#define ICorDebugProcess2_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugProcess2_GetThreadForTaskID(This,taskid,ppThread) \
+#define ICorDebugProcess2_GetThreadForTaskID(This,taskid,ppThread) \
( (This)->lpVtbl -> GetThreadForTaskID(This,taskid,ppThread) )
-#define ICorDebugProcess2_GetVersion(This,version) \
+#define ICorDebugProcess2_GetVersion(This,version) \
( (This)->lpVtbl -> GetVersion(This,version) )
-#define ICorDebugProcess2_SetUnmanagedBreakpoint(This,address,bufsize,buffer,bufLen) \
+#define ICorDebugProcess2_SetUnmanagedBreakpoint(This,address,bufsize,buffer,bufLen) \
( (This)->lpVtbl -> SetUnmanagedBreakpoint(This,address,bufsize,buffer,bufLen) )
-#define ICorDebugProcess2_ClearUnmanagedBreakpoint(This,address) \
+#define ICorDebugProcess2_ClearUnmanagedBreakpoint(This,address) \
( (This)->lpVtbl -> ClearUnmanagedBreakpoint(This,address) )
-#define ICorDebugProcess2_SetDesiredNGENCompilerFlags(This,pdwFlags) \
+#define ICorDebugProcess2_SetDesiredNGENCompilerFlags(This,pdwFlags) \
( (This)->lpVtbl -> SetDesiredNGENCompilerFlags(This,pdwFlags) )
-#define ICorDebugProcess2_GetDesiredNGENCompilerFlags(This,pdwFlags) \
+#define ICorDebugProcess2_GetDesiredNGENCompilerFlags(This,pdwFlags) \
( (This)->lpVtbl -> GetDesiredNGENCompilerFlags(This,pdwFlags) )
-#define ICorDebugProcess2_GetReferenceValueFromGCHandle(This,handle,pOutValue) \
+#define ICorDebugProcess2_GetReferenceValueFromGCHandle(This,handle,pOutValue) \
( (This)->lpVtbl -> GetReferenceValueFromGCHandle(This,handle,pOutValue) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugProcess2_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugProcess2_INTERFACE_DEFINED__ */
#ifndef __ICorDebugProcess3_INTERFACE_DEFINED__
@@ -7091,7 +7105,7 @@ EXTERN_C const IID IID_ICorDebugProcess3;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugProcess3Vtbl
{
@@ -7127,28 +7141,28 @@ EXTERN_C const IID IID_ICorDebugProcess3;
#ifdef COBJMACROS
-#define ICorDebugProcess3_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugProcess3_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugProcess3_AddRef(This) \
+#define ICorDebugProcess3_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugProcess3_Release(This) \
+#define ICorDebugProcess3_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugProcess3_SetEnableCustomNotification(This,pClass,fEnable) \
+#define ICorDebugProcess3_SetEnableCustomNotification(This,pClass,fEnable) \
( (This)->lpVtbl -> SetEnableCustomNotification(This,pClass,fEnable) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugProcess3_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugProcess3_INTERFACE_DEFINED__ */
#ifndef __ICorDebugProcess5_INTERFACE_DEFINED__
@@ -7215,7 +7229,7 @@ EXTERN_C const IID IID_ICorDebugProcess5;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugProcess5Vtbl
{
@@ -7304,61 +7318,61 @@ EXTERN_C const IID IID_ICorDebugProcess5;
#ifdef COBJMACROS
-#define ICorDebugProcess5_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugProcess5_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugProcess5_AddRef(This) \
+#define ICorDebugProcess5_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugProcess5_Release(This) \
+#define ICorDebugProcess5_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugProcess5_GetGCHeapInformation(This,pHeapInfo) \
+#define ICorDebugProcess5_GetGCHeapInformation(This,pHeapInfo) \
( (This)->lpVtbl -> GetGCHeapInformation(This,pHeapInfo) )
-#define ICorDebugProcess5_EnumerateHeap(This,ppObjects) \
+#define ICorDebugProcess5_EnumerateHeap(This,ppObjects) \
( (This)->lpVtbl -> EnumerateHeap(This,ppObjects) )
-#define ICorDebugProcess5_EnumerateHeapRegions(This,ppRegions) \
+#define ICorDebugProcess5_EnumerateHeapRegions(This,ppRegions) \
( (This)->lpVtbl -> EnumerateHeapRegions(This,ppRegions) )
-#define ICorDebugProcess5_GetObject(This,addr,pObject) \
+#define ICorDebugProcess5_GetObject(This,addr,pObject) \
( (This)->lpVtbl -> GetObject(This,addr,pObject) )
-#define ICorDebugProcess5_EnumerateGCReferences(This,enumerateWeakReferences,ppEnum) \
+#define ICorDebugProcess5_EnumerateGCReferences(This,enumerateWeakReferences,ppEnum) \
( (This)->lpVtbl -> EnumerateGCReferences(This,enumerateWeakReferences,ppEnum) )
-#define ICorDebugProcess5_EnumerateHandles(This,types,ppEnum) \
+#define ICorDebugProcess5_EnumerateHandles(This,types,ppEnum) \
( (This)->lpVtbl -> EnumerateHandles(This,types,ppEnum) )
-#define ICorDebugProcess5_GetTypeID(This,obj,pId) \
+#define ICorDebugProcess5_GetTypeID(This,obj,pId) \
( (This)->lpVtbl -> GetTypeID(This,obj,pId) )
-#define ICorDebugProcess5_GetTypeForTypeID(This,id,ppType) \
+#define ICorDebugProcess5_GetTypeForTypeID(This,id,ppType) \
( (This)->lpVtbl -> GetTypeForTypeID(This,id,ppType) )
-#define ICorDebugProcess5_GetArrayLayout(This,id,pLayout) \
+#define ICorDebugProcess5_GetArrayLayout(This,id,pLayout) \
( (This)->lpVtbl -> GetArrayLayout(This,id,pLayout) )
-#define ICorDebugProcess5_GetTypeLayout(This,id,pLayout) \
+#define ICorDebugProcess5_GetTypeLayout(This,id,pLayout) \
( (This)->lpVtbl -> GetTypeLayout(This,id,pLayout) )
-#define ICorDebugProcess5_GetTypeFields(This,id,celt,fields,pceltNeeded) \
+#define ICorDebugProcess5_GetTypeFields(This,id,celt,fields,pceltNeeded) \
( (This)->lpVtbl -> GetTypeFields(This,id,celt,fields,pceltNeeded) )
-#define ICorDebugProcess5_EnableNGENPolicy(This,ePolicy) \
+#define ICorDebugProcess5_EnableNGENPolicy(This,ePolicy) \
( (This)->lpVtbl -> EnableNGENPolicy(This,ePolicy) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugProcess5_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugProcess5_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_cordebug_0000_0040 */
@@ -7367,33 +7381,33 @@ EXTERN_C const IID IID_ICorDebugProcess5;
typedef
enum CorDebugRecordFormat
{
- FORMAT_WINDOWS_EXCEPTIONRECORD32 = 1,
- FORMAT_WINDOWS_EXCEPTIONRECORD64 = 2
- } CorDebugRecordFormat;
+ FORMAT_WINDOWS_EXCEPTIONRECORD32 = 1,
+ FORMAT_WINDOWS_EXCEPTIONRECORD64 = 2
+ } CorDebugRecordFormat;
typedef
enum CorDebugDecodeEventFlagsWindows
{
- IS_FIRST_CHANCE = 1
- } CorDebugDecodeEventFlagsWindows;
+ IS_FIRST_CHANCE = 1
+ } CorDebugDecodeEventFlagsWindows;
typedef
enum CorDebugDebugEventKind
{
- DEBUG_EVENT_KIND_MODULE_LOADED = 1,
- DEBUG_EVENT_KIND_MODULE_UNLOADED = 2,
- DEBUG_EVENT_KIND_MANAGED_EXCEPTION_FIRST_CHANCE = 3,
- DEBUG_EVENT_KIND_MANAGED_EXCEPTION_USER_FIRST_CHANCE = 4,
- DEBUG_EVENT_KIND_MANAGED_EXCEPTION_CATCH_HANDLER_FOUND = 5,
- DEBUG_EVENT_KIND_MANAGED_EXCEPTION_UNHANDLED = 6
- } CorDebugDebugEventKind;
+ DEBUG_EVENT_KIND_MODULE_LOADED = 1,
+ DEBUG_EVENT_KIND_MODULE_UNLOADED = 2,
+ DEBUG_EVENT_KIND_MANAGED_EXCEPTION_FIRST_CHANCE = 3,
+ DEBUG_EVENT_KIND_MANAGED_EXCEPTION_USER_FIRST_CHANCE = 4,
+ DEBUG_EVENT_KIND_MANAGED_EXCEPTION_CATCH_HANDLER_FOUND = 5,
+ DEBUG_EVENT_KIND_MANAGED_EXCEPTION_UNHANDLED = 6
+ } CorDebugDebugEventKind;
typedef
enum CorDebugStateChange
{
- PROCESS_RUNNING = 0x1,
- FLUSH_ALL = 0x2
- } CorDebugStateChange;
+ PROCESS_RUNNING = 0x1,
+ FLUSH_ALL = 0x2
+ } CorDebugStateChange;
@@ -7424,7 +7438,7 @@ EXTERN_C const IID IID_ICorDebugDebugEvent;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugDebugEventVtbl
{
@@ -7463,31 +7477,31 @@ EXTERN_C const IID IID_ICorDebugDebugEvent;
#ifdef COBJMACROS
-#define ICorDebugDebugEvent_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugDebugEvent_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugDebugEvent_AddRef(This) \
+#define ICorDebugDebugEvent_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugDebugEvent_Release(This) \
+#define ICorDebugDebugEvent_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugDebugEvent_GetEventKind(This,pDebugEventKind) \
+#define ICorDebugDebugEvent_GetEventKind(This,pDebugEventKind) \
( (This)->lpVtbl -> GetEventKind(This,pDebugEventKind) )
-#define ICorDebugDebugEvent_GetThread(This,ppThread) \
+#define ICorDebugDebugEvent_GetThread(This,ppThread) \
( (This)->lpVtbl -> GetThread(This,ppThread) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugDebugEvent_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugDebugEvent_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_cordebug_0000_0041 */
@@ -7496,19 +7510,19 @@ EXTERN_C const IID IID_ICorDebugDebugEvent;
typedef
enum CorDebugCodeInvokeKind
{
- CODE_INVOKE_KIND_NONE = 0,
- CODE_INVOKE_KIND_RETURN = ( CODE_INVOKE_KIND_NONE + 1 ) ,
- CODE_INVOKE_KIND_TAILCALL = ( CODE_INVOKE_KIND_RETURN + 1 )
- } CorDebugCodeInvokeKind;
+ CODE_INVOKE_KIND_NONE = 0,
+ CODE_INVOKE_KIND_RETURN = ( CODE_INVOKE_KIND_NONE + 1 ) ,
+ CODE_INVOKE_KIND_TAILCALL = ( CODE_INVOKE_KIND_RETURN + 1 )
+ } CorDebugCodeInvokeKind;
typedef
enum CorDebugCodeInvokePurpose
{
- CODE_INVOKE_PURPOSE_NONE = 0,
- CODE_INVOKE_PURPOSE_NATIVE_TO_MANAGED_TRANSITION = ( CODE_INVOKE_PURPOSE_NONE + 1 ) ,
- CODE_INVOKE_PURPOSE_CLASS_INIT = ( CODE_INVOKE_PURPOSE_NATIVE_TO_MANAGED_TRANSITION + 1 ) ,
- CODE_INVOKE_PURPOSE_INTERFACE_DISPATCH = ( CODE_INVOKE_PURPOSE_CLASS_INIT + 1 )
- } CorDebugCodeInvokePurpose;
+ CODE_INVOKE_PURPOSE_NONE = 0,
+ CODE_INVOKE_PURPOSE_NATIVE_TO_MANAGED_TRANSITION = ( CODE_INVOKE_PURPOSE_NONE + 1 ) ,
+ CODE_INVOKE_PURPOSE_CLASS_INIT = ( CODE_INVOKE_PURPOSE_NATIVE_TO_MANAGED_TRANSITION + 1 ) ,
+ CODE_INVOKE_PURPOSE_INTERFACE_DISPATCH = ( CODE_INVOKE_PURPOSE_CLASS_INIT + 1 )
+ } CorDebugCodeInvokePurpose;
@@ -7559,7 +7573,7 @@ EXTERN_C const IID IID_ICorDebugProcess6;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugProcess6Vtbl
{
@@ -7622,43 +7636,43 @@ EXTERN_C const IID IID_ICorDebugProcess6;
#ifdef COBJMACROS
-#define ICorDebugProcess6_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugProcess6_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugProcess6_AddRef(This) \
+#define ICorDebugProcess6_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugProcess6_Release(This) \
+#define ICorDebugProcess6_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugProcess6_DecodeEvent(This,pRecord,countBytes,format,dwFlags,dwThreadId,ppEvent) \
+#define ICorDebugProcess6_DecodeEvent(This,pRecord,countBytes,format,dwFlags,dwThreadId,ppEvent) \
( (This)->lpVtbl -> DecodeEvent(This,pRecord,countBytes,format,dwFlags,dwThreadId,ppEvent) )
-#define ICorDebugProcess6_ProcessStateChanged(This,change) \
+#define ICorDebugProcess6_ProcessStateChanged(This,change) \
( (This)->lpVtbl -> ProcessStateChanged(This,change) )
-#define ICorDebugProcess6_GetCode(This,codeAddress,ppCode) \
+#define ICorDebugProcess6_GetCode(This,codeAddress,ppCode) \
( (This)->lpVtbl -> GetCode(This,codeAddress,ppCode) )
-#define ICorDebugProcess6_EnableVirtualModuleSplitting(This,enableSplitting) \
+#define ICorDebugProcess6_EnableVirtualModuleSplitting(This,enableSplitting) \
( (This)->lpVtbl -> EnableVirtualModuleSplitting(This,enableSplitting) )
-#define ICorDebugProcess6_MarkDebuggerAttached(This,fIsAttached) \
+#define ICorDebugProcess6_MarkDebuggerAttached(This,fIsAttached) \
( (This)->lpVtbl -> MarkDebuggerAttached(This,fIsAttached) )
-#define ICorDebugProcess6_GetExportStepInfo(This,pszExportName,pInvokeKind,pInvokePurpose) \
+#define ICorDebugProcess6_GetExportStepInfo(This,pszExportName,pInvokeKind,pInvokePurpose) \
( (This)->lpVtbl -> GetExportStepInfo(This,pszExportName,pInvokeKind,pInvokePurpose) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugProcess6_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugProcess6_INTERFACE_DEFINED__ */
/* interface __MIDL_itf_cordebug_0000_0042 */
@@ -7667,9 +7681,9 @@ EXTERN_C const IID IID_ICorDebugProcess6;
typedef
enum WriteableMetadataUpdateMode
{
- LegacyCompatPolicy = 0,
- AlwaysShowUpdates = ( LegacyCompatPolicy + 1 )
- } WriteableMetadataUpdateMode;
+ LegacyCompatPolicy = 0,
+ AlwaysShowUpdates = ( LegacyCompatPolicy + 1 )
+ } WriteableMetadataUpdateMode;
@@ -7697,7 +7711,7 @@ EXTERN_C const IID IID_ICorDebugProcess7;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugProcess7Vtbl
{
@@ -7732,28 +7746,28 @@ EXTERN_C const IID IID_ICorDebugProcess7;
#ifdef COBJMACROS
-#define ICorDebugProcess7_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugProcess7_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugProcess7_AddRef(This) \
+#define ICorDebugProcess7_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugProcess7_Release(This) \
+#define ICorDebugProcess7_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugProcess7_SetWriteableMetadataUpdateMode(This,flags) \
+#define ICorDebugProcess7_SetWriteableMetadataUpdateMode(This,flags) \
( (This)->lpVtbl -> SetWriteableMetadataUpdateMode(This,flags) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugProcess7_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugProcess7_INTERFACE_DEFINED__ */
#ifndef __ICorDebugProcess8_INTERFACE_DEFINED__
@@ -7777,7 +7791,7 @@ EXTERN_C const IID IID_ICorDebugProcess8;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugProcess8Vtbl
{
@@ -7812,28 +7826,28 @@ EXTERN_C const IID IID_ICorDebugProcess8;
#ifdef COBJMACROS
-#define ICorDebugProcess8_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugProcess8_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugProcess8_AddRef(This) \
+#define ICorDebugProcess8_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugProcess8_Release(This) \
+#define ICorDebugProcess8_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugProcess8_EnableExceptionCallbacksOutsideOfMyCode(This,enableExceptionsOutsideOfJMC) \
+#define ICorDebugProcess8_EnableExceptionCallbacksOutsideOfMyCode(This,enableExceptionsOutsideOfJMC) \
( (This)->lpVtbl -> EnableExceptionCallbacksOutsideOfMyCode(This,enableExceptionsOutsideOfJMC) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugProcess8_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugProcess8_INTERFACE_DEFINED__ */
#ifndef __ICorDebugProcess10_INTERFACE_DEFINED__
@@ -7857,7 +7871,7 @@ EXTERN_C const IID IID_ICorDebugProcess10;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugProcess10Vtbl
{
@@ -7892,28 +7906,234 @@ EXTERN_C const IID IID_ICorDebugProcess10;
#ifdef COBJMACROS
-#define ICorDebugProcess10_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugProcess10_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugProcess10_AddRef(This) \
+#define ICorDebugProcess10_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugProcess10_Release(This) \
+#define ICorDebugProcess10_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugProcess10_EnableGCNotificationEvents(This,fEnable) \
+#define ICorDebugProcess10_EnableGCNotificationEvents(This,fEnable) \
( (This)->lpVtbl -> EnableGCNotificationEvents(This,fEnable) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
+
+
+
+
+#endif /* __ICorDebugProcess10_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_cordebug_0000_0045 */
+/* [local] */
+
+typedef struct _COR_MEMORY_RANGE
+ {
+ CORDB_ADDRESS start;
+ CORDB_ADDRESS end;
+ } COR_MEMORY_RANGE;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0045_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0045_v0_0_s_ifspec;
+
+#ifndef __ICorDebugMemoryRangeEnum_INTERFACE_DEFINED__
+#define __ICorDebugMemoryRangeEnum_INTERFACE_DEFINED__
+
+/* interface ICorDebugMemoryRangeEnum */
+/* [unique][uuid][local][object] */
+
+
+EXTERN_C const IID IID_ICorDebugMemoryRangeEnum;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("D1A0BCFC-5865-4437-BE3F-36F022951F8A")
+ ICorDebugMemoryRangeEnum : public ICorDebugEnum
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE Next(
+ /* [in] */ ULONG celt,
+ /* [length_is][size_is][out] */ COR_MEMORY_RANGE objects[ ],
+ /* [out] */ ULONG *pceltFetched) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ICorDebugMemoryRangeEnumVtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ICorDebugMemoryRangeEnum * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ICorDebugMemoryRangeEnum * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ICorDebugMemoryRangeEnum * This);
+
+ HRESULT ( STDMETHODCALLTYPE *Skip )(
+ ICorDebugMemoryRangeEnum * This,
+ /* [in] */ ULONG celt);
+
+ HRESULT ( STDMETHODCALLTYPE *Reset )(
+ ICorDebugMemoryRangeEnum * This);
+
+ HRESULT ( STDMETHODCALLTYPE *Clone )(
+ ICorDebugMemoryRangeEnum * This,
+ /* [out] */ ICorDebugEnum **ppEnum);
+
+ HRESULT ( STDMETHODCALLTYPE *GetCount )(
+ ICorDebugMemoryRangeEnum * This,
+ /* [out] */ ULONG *pcelt);
+
+ HRESULT ( STDMETHODCALLTYPE *Next )(
+ ICorDebugMemoryRangeEnum * This,
+ /* [in] */ ULONG celt,
+ /* [length_is][size_is][out] */ COR_MEMORY_RANGE objects[ ],
+ /* [out] */ ULONG *pceltFetched);
+
+ END_INTERFACE
+ } ICorDebugMemoryRangeEnumVtbl;
+
+ interface ICorDebugMemoryRangeEnum
+ {
+ CONST_VTBL struct ICorDebugMemoryRangeEnumVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ICorDebugMemoryRangeEnum_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ICorDebugMemoryRangeEnum_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ICorDebugMemoryRangeEnum_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ICorDebugMemoryRangeEnum_Skip(This,celt) \
+ ( (This)->lpVtbl -> Skip(This,celt) )
+
+#define ICorDebugMemoryRangeEnum_Reset(This) \
+ ( (This)->lpVtbl -> Reset(This) )
+
+#define ICorDebugMemoryRangeEnum_Clone(This,ppEnum) \
+ ( (This)->lpVtbl -> Clone(This,ppEnum) )
+
+#define ICorDebugMemoryRangeEnum_GetCount(This,pcelt) \
+ ( (This)->lpVtbl -> GetCount(This,pcelt) )
+
+
+#define ICorDebugMemoryRangeEnum_Next(This,celt,objects,pceltFetched) \
+ ( (This)->lpVtbl -> Next(This,celt,objects,pceltFetched) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ICorDebugMemoryRangeEnum_INTERFACE_DEFINED__ */
+
+
+#ifndef __ICorDebugProcess11_INTERFACE_DEFINED__
+#define __ICorDebugProcess11_INTERFACE_DEFINED__
+
+/* interface ICorDebugProcess11 */
+/* [unique][uuid][local][object] */
+
+
+EXTERN_C const IID IID_ICorDebugProcess11;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("344B37AA-F2C0-4D3B-9909-91CCF787DA8C")
+ ICorDebugProcess11 : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE EnumerateLoaderHeapMemoryRegions(
+ /* [out] */ ICorDebugMemoryRangeEnum **ppRanges) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ICorDebugProcess11Vtbl
+ {
+ BEGIN_INTERFACE
+
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ICorDebugProcess11 * This,
+ /* [in] */ REFIID riid,
+ /* [annotation][iid_is][out] */
+ _COM_Outptr_ void **ppvObject);
+
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ICorDebugProcess11 * This);
+
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ICorDebugProcess11 * This);
+
+ HRESULT ( STDMETHODCALLTYPE *EnumerateLoaderHeapMemoryRegions )(
+ ICorDebugProcess11 * This,
+ /* [out] */ ICorDebugMemoryRangeEnum **ppRanges);
+
+ END_INTERFACE
+ } ICorDebugProcess11Vtbl;
+
+ interface ICorDebugProcess11
+ {
+ CONST_VTBL struct ICorDebugProcess11Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ICorDebugProcess11_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ICorDebugProcess11_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ICorDebugProcess11_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ICorDebugProcess11_EnumerateLoaderHeapMemoryRegions(This,ppRanges) \
+ ( (This)->lpVtbl -> EnumerateLoaderHeapMemoryRegions(This,ppRanges) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
-#endif /* __ICorDebugProcess10_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugProcess11_INTERFACE_DEFINED__ */
#ifndef __ICorDebugModuleDebugEvent_INTERFACE_DEFINED__
@@ -7937,7 +8157,7 @@ EXTERN_C const IID IID_ICorDebugModuleDebugEvent;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugModuleDebugEventVtbl
{
@@ -7980,35 +8200,35 @@ EXTERN_C const IID IID_ICorDebugModuleDebugEvent;
#ifdef COBJMACROS
-#define ICorDebugModuleDebugEvent_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugModuleDebugEvent_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugModuleDebugEvent_AddRef(This) \
+#define ICorDebugModuleDebugEvent_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugModuleDebugEvent_Release(This) \
+#define ICorDebugModuleDebugEvent_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugModuleDebugEvent_GetEventKind(This,pDebugEventKind) \
+#define ICorDebugModuleDebugEvent_GetEventKind(This,pDebugEventKind) \
( (This)->lpVtbl -> GetEventKind(This,pDebugEventKind) )
-#define ICorDebugModuleDebugEvent_GetThread(This,ppThread) \
+#define ICorDebugModuleDebugEvent_GetThread(This,ppThread) \
( (This)->lpVtbl -> GetThread(This,ppThread) )
-#define ICorDebugModuleDebugEvent_GetModule(This,ppModule) \
+#define ICorDebugModuleDebugEvent_GetModule(This,ppModule) \
( (This)->lpVtbl -> GetModule(This,ppModule) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugModuleDebugEvent_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugModuleDebugEvent_INTERFACE_DEFINED__ */
#ifndef __ICorDebugExceptionDebugEvent_INTERFACE_DEFINED__
@@ -8038,7 +8258,7 @@ EXTERN_C const IID IID_ICorDebugExceptionDebugEvent;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugExceptionDebugEventVtbl
{
@@ -8089,41 +8309,41 @@ EXTERN_C const IID IID_ICorDebugExceptionDebugEvent;
#ifdef COBJMACROS
-#define ICorDebugExceptionDebugEvent_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugExceptionDebugEvent_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugExceptionDebugEvent_AddRef(This) \
+#define ICorDebugExceptionDebugEvent_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugExceptionDebugEvent_Release(This) \
+#define ICorDebugExceptionDebugEvent_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugExceptionDebugEvent_GetEventKind(This,pDebugEventKind) \
+#define ICorDebugExceptionDebugEvent_GetEventKind(This,pDebugEventKind) \
( (This)->lpVtbl -> GetEventKind(This,pDebugEventKind) )
-#define ICorDebugExceptionDebugEvent_GetThread(This,ppThread) \
+#define ICorDebugExceptionDebugEvent_GetThread(This,ppThread) \
( (This)->lpVtbl -> GetThread(This,ppThread) )
-#define ICorDebugExceptionDebugEvent_GetStackPointer(This,pStackPointer) \
+#define ICorDebugExceptionDebugEvent_GetStackPointer(This,pStackPointer) \
( (This)->lpVtbl -> GetStackPointer(This,pStackPointer) )
-#define ICorDebugExceptionDebugEvent_GetNativeIP(This,pIP) \
+#define ICorDebugExceptionDebugEvent_GetNativeIP(This,pIP) \
( (This)->lpVtbl -> GetNativeIP(This,pIP) )
-#define ICorDebugExceptionDebugEvent_GetFlags(This,pdwFlags) \
+#define ICorDebugExceptionDebugEvent_GetFlags(This,pdwFlags) \
( (This)->lpVtbl -> GetFlags(This,pdwFlags) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugExceptionDebugEvent_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugExceptionDebugEvent_INTERFACE_DEFINED__ */
#ifndef __ICorDebugBreakpoint_INTERFACE_DEFINED__
@@ -8150,7 +8370,7 @@ EXTERN_C const IID IID_ICorDebugBreakpoint;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugBreakpointVtbl
{
@@ -8189,31 +8409,31 @@ EXTERN_C const IID IID_ICorDebugBreakpoint;
#ifdef COBJMACROS
-#define ICorDebugBreakpoint_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugBreakpoint_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugBreakpoint_AddRef(This) \
+#define ICorDebugBreakpoint_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugBreakpoint_Release(This) \
+#define ICorDebugBreakpoint_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugBreakpoint_Activate(This,bActive) \
+#define ICorDebugBreakpoint_Activate(This,bActive) \
( (This)->lpVtbl -> Activate(This,bActive) )
-#define ICorDebugBreakpoint_IsActive(This,pbActive) \
+#define ICorDebugBreakpoint_IsActive(This,pbActive) \
( (This)->lpVtbl -> IsActive(This,pbActive) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugBreakpoint_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugBreakpoint_INTERFACE_DEFINED__ */
#ifndef __ICorDebugFunctionBreakpoint_INTERFACE_DEFINED__
@@ -8240,7 +8460,7 @@ EXTERN_C const IID IID_ICorDebugFunctionBreakpoint;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugFunctionBreakpointVtbl
{
@@ -8287,38 +8507,38 @@ EXTERN_C const IID IID_ICorDebugFunctionBreakpoint;
#ifdef COBJMACROS
-#define ICorDebugFunctionBreakpoint_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugFunctionBreakpoint_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugFunctionBreakpoint_AddRef(This) \
+#define ICorDebugFunctionBreakpoint_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugFunctionBreakpoint_Release(This) \
+#define ICorDebugFunctionBreakpoint_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugFunctionBreakpoint_Activate(This,bActive) \
+#define ICorDebugFunctionBreakpoint_Activate(This,bActive) \
( (This)->lpVtbl -> Activate(This,bActive) )
-#define ICorDebugFunctionBreakpoint_IsActive(This,pbActive) \
+#define ICorDebugFunctionBreakpoint_IsActive(This,pbActive) \
( (This)->lpVtbl -> IsActive(This,pbActive) )
-#define ICorDebugFunctionBreakpoint_GetFunction(This,ppFunction) \
+#define ICorDebugFunctionBreakpoint_GetFunction(This,ppFunction) \
( (This)->lpVtbl -> GetFunction(This,ppFunction) )
-#define ICorDebugFunctionBreakpoint_GetOffset(This,pnOffset) \
+#define ICorDebugFunctionBreakpoint_GetOffset(This,pnOffset) \
( (This)->lpVtbl -> GetOffset(This,pnOffset) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugFunctionBreakpoint_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugFunctionBreakpoint_INTERFACE_DEFINED__ */
#ifndef __ICorDebugModuleBreakpoint_INTERFACE_DEFINED__
@@ -8342,7 +8562,7 @@ EXTERN_C const IID IID_ICorDebugModuleBreakpoint;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugModuleBreakpointVtbl
{
@@ -8385,35 +8605,35 @@ EXTERN_C const IID IID_ICorDebugModuleBreakpoint;
#ifdef COBJMACROS
-#define ICorDebugModuleBreakpoint_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugModuleBreakpoint_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugModuleBreakpoint_AddRef(This) \
+#define ICorDebugModuleBreakpoint_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugModuleBreakpoint_Release(This) \
+#define ICorDebugModuleBreakpoint_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugModuleBreakpoint_Activate(This,bActive) \
+#define ICorDebugModuleBreakpoint_Activate(This,bActive) \
( (This)->lpVtbl -> Activate(This,bActive) )
-#define ICorDebugModuleBreakpoint_IsActive(This,pbActive) \
+#define ICorDebugModuleBreakpoint_IsActive(This,pbActive) \
( (This)->lpVtbl -> IsActive(This,pbActive) )
-#define ICorDebugModuleBreakpoint_GetModule(This,ppModule) \
+#define ICorDebugModuleBreakpoint_GetModule(This,ppModule) \
( (This)->lpVtbl -> GetModule(This,ppModule) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugModuleBreakpoint_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugModuleBreakpoint_INTERFACE_DEFINED__ */
#ifndef __ICorDebugValueBreakpoint_INTERFACE_DEFINED__
@@ -8437,7 +8657,7 @@ EXTERN_C const IID IID_ICorDebugValueBreakpoint;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugValueBreakpointVtbl
{
@@ -8480,35 +8700,35 @@ EXTERN_C const IID IID_ICorDebugValueBreakpoint;
#ifdef COBJMACROS
-#define ICorDebugValueBreakpoint_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugValueBreakpoint_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugValueBreakpoint_AddRef(This) \
+#define ICorDebugValueBreakpoint_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugValueBreakpoint_Release(This) \
+#define ICorDebugValueBreakpoint_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugValueBreakpoint_Activate(This,bActive) \
+#define ICorDebugValueBreakpoint_Activate(This,bActive) \
( (This)->lpVtbl -> Activate(This,bActive) )
-#define ICorDebugValueBreakpoint_IsActive(This,pbActive) \
+#define ICorDebugValueBreakpoint_IsActive(This,pbActive) \
( (This)->lpVtbl -> IsActive(This,pbActive) )
-#define ICorDebugValueBreakpoint_GetValue(This,ppValue) \
+#define ICorDebugValueBreakpoint_GetValue(This,ppValue) \
( (This)->lpVtbl -> GetValue(This,ppValue) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugValueBreakpoint_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugValueBreakpoint_INTERFACE_DEFINED__ */
#ifndef __ICorDebugStepper_INTERFACE_DEFINED__
@@ -8520,32 +8740,32 @@ EXTERN_C const IID IID_ICorDebugValueBreakpoint;
typedef
enum CorDebugIntercept
{
- INTERCEPT_NONE = 0,
- INTERCEPT_CLASS_INIT = 0x1,
- INTERCEPT_EXCEPTION_FILTER = 0x2,
- INTERCEPT_SECURITY = 0x4,
- INTERCEPT_CONTEXT_POLICY = 0x8,
- INTERCEPT_INTERCEPTION = 0x10,
- INTERCEPT_ALL = 0xffff
- } CorDebugIntercept;
+ INTERCEPT_NONE = 0,
+ INTERCEPT_CLASS_INIT = 0x1,
+ INTERCEPT_EXCEPTION_FILTER = 0x2,
+ INTERCEPT_SECURITY = 0x4,
+ INTERCEPT_CONTEXT_POLICY = 0x8,
+ INTERCEPT_INTERCEPTION = 0x10,
+ INTERCEPT_ALL = 0xffff
+ } CorDebugIntercept;
typedef
enum CorDebugUnmappedStop
{
- STOP_NONE = 0,
- STOP_PROLOG = 0x1,
- STOP_EPILOG = 0x2,
- STOP_NO_MAPPING_INFO = 0x4,
- STOP_OTHER_UNMAPPED = 0x8,
- STOP_UNMANAGED = 0x10,
- STOP_ALL = 0xffff
- } CorDebugUnmappedStop;
+ STOP_NONE = 0,
+ STOP_PROLOG = 0x1,
+ STOP_EPILOG = 0x2,
+ STOP_NO_MAPPING_INFO = 0x4,
+ STOP_OTHER_UNMAPPED = 0x8,
+ STOP_UNMANAGED = 0x10,
+ STOP_ALL = 0xffff
+ } CorDebugUnmappedStop;
typedef struct COR_DEBUG_STEP_RANGE
{
ULONG32 startOffset;
ULONG32 endOffset;
- } COR_DEBUG_STEP_RANGE;
+ } COR_DEBUG_STEP_RANGE;
EXTERN_C const IID IID_ICorDebugStepper;
@@ -8583,7 +8803,7 @@ EXTERN_C const IID IID_ICorDebugStepper;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugStepperVtbl
{
@@ -8646,49 +8866,49 @@ EXTERN_C const IID IID_ICorDebugStepper;
#ifdef COBJMACROS
-#define ICorDebugStepper_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugStepper_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugStepper_AddRef(This) \
+#define ICorDebugStepper_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugStepper_Release(This) \
+#define ICorDebugStepper_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugStepper_IsActive(This,pbActive) \
+#define ICorDebugStepper_IsActive(This,pbActive) \
( (This)->lpVtbl -> IsActive(This,pbActive) )
-#define ICorDebugStepper_Deactivate(This) \
+#define ICorDebugStepper_Deactivate(This) \
( (This)->lpVtbl -> Deactivate(This) )
-#define ICorDebugStepper_SetInterceptMask(This,mask) \
+#define ICorDebugStepper_SetInterceptMask(This,mask) \
( (This)->lpVtbl -> SetInterceptMask(This,mask) )
-#define ICorDebugStepper_SetUnmappedStopMask(This,mask) \
+#define ICorDebugStepper_SetUnmappedStopMask(This,mask) \
( (This)->lpVtbl -> SetUnmappedStopMask(This,mask) )
-#define ICorDebugStepper_Step(This,bStepIn) \
+#define ICorDebugStepper_Step(This,bStepIn) \
( (This)->lpVtbl -> Step(This,bStepIn) )
-#define ICorDebugStepper_StepRange(This,bStepIn,ranges,cRangeCount) \
+#define ICorDebugStepper_StepRange(This,bStepIn,ranges,cRangeCount) \
( (This)->lpVtbl -> StepRange(This,bStepIn,ranges,cRangeCount) )
-#define ICorDebugStepper_StepOut(This) \
+#define ICorDebugStepper_StepOut(This) \
( (This)->lpVtbl -> StepOut(This) )
-#define ICorDebugStepper_SetRangeIL(This,bIL) \
+#define ICorDebugStepper_SetRangeIL(This,bIL) \
( (This)->lpVtbl -> SetRangeIL(This,bIL) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugStepper_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugStepper_INTERFACE_DEFINED__ */
#ifndef __ICorDebugStepper2_INTERFACE_DEFINED__
@@ -8712,7 +8932,7 @@ EXTERN_C const IID IID_ICorDebugStepper2;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugStepper2Vtbl
{
@@ -8747,28 +8967,28 @@ EXTERN_C const IID IID_ICorDebugStepper2;
#ifdef COBJMACROS
-#define ICorDebugStepper2_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugStepper2_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugStepper2_AddRef(This) \
+#define ICorDebugStepper2_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugStepper2_Release(This) \
+#define ICorDebugStepper2_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugStepper2_SetJMC(This,fIsJMCStepper) \
+#define ICorDebugStepper2_SetJMC(This,fIsJMCStepper) \
( (This)->lpVtbl -> SetJMC(This,fIsJMCStepper) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugStepper2_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugStepper2_INTERFACE_DEFINED__ */
#ifndef __ICorDebugRegisterSet_INTERFACE_DEFINED__
@@ -8780,176 +9000,176 @@ EXTERN_C const IID IID_ICorDebugStepper2;
typedef
enum CorDebugRegister
{
- REGISTER_INSTRUCTION_POINTER = 0,
- REGISTER_STACK_POINTER = ( REGISTER_INSTRUCTION_POINTER + 1 ) ,
- REGISTER_FRAME_POINTER = ( REGISTER_STACK_POINTER + 1 ) ,
- REGISTER_X86_EIP = 0,
- REGISTER_X86_ESP = ( REGISTER_X86_EIP + 1 ) ,
- REGISTER_X86_EBP = ( REGISTER_X86_ESP + 1 ) ,
- REGISTER_X86_EAX = ( REGISTER_X86_EBP + 1 ) ,
- REGISTER_X86_ECX = ( REGISTER_X86_EAX + 1 ) ,
- REGISTER_X86_EDX = ( REGISTER_X86_ECX + 1 ) ,
- REGISTER_X86_EBX = ( REGISTER_X86_EDX + 1 ) ,
- REGISTER_X86_ESI = ( REGISTER_X86_EBX + 1 ) ,
- REGISTER_X86_EDI = ( REGISTER_X86_ESI + 1 ) ,
- REGISTER_X86_FPSTACK_0 = ( REGISTER_X86_EDI + 1 ) ,
- REGISTER_X86_FPSTACK_1 = ( REGISTER_X86_FPSTACK_0 + 1 ) ,
- REGISTER_X86_FPSTACK_2 = ( REGISTER_X86_FPSTACK_1 + 1 ) ,
- REGISTER_X86_FPSTACK_3 = ( REGISTER_X86_FPSTACK_2 + 1 ) ,
- REGISTER_X86_FPSTACK_4 = ( REGISTER_X86_FPSTACK_3 + 1 ) ,
- REGISTER_X86_FPSTACK_5 = ( REGISTER_X86_FPSTACK_4 + 1 ) ,
- REGISTER_X86_FPSTACK_6 = ( REGISTER_X86_FPSTACK_5 + 1 ) ,
- REGISTER_X86_FPSTACK_7 = ( REGISTER_X86_FPSTACK_6 + 1 ) ,
- REGISTER_AMD64_RIP = 0,
- REGISTER_AMD64_RSP = ( REGISTER_AMD64_RIP + 1 ) ,
- REGISTER_AMD64_RBP = ( REGISTER_AMD64_RSP + 1 ) ,
- REGISTER_AMD64_RAX = ( REGISTER_AMD64_RBP + 1 ) ,
- REGISTER_AMD64_RCX = ( REGISTER_AMD64_RAX + 1 ) ,
- REGISTER_AMD64_RDX = ( REGISTER_AMD64_RCX + 1 ) ,
- REGISTER_AMD64_RBX = ( REGISTER_AMD64_RDX + 1 ) ,
- REGISTER_AMD64_RSI = ( REGISTER_AMD64_RBX + 1 ) ,
- REGISTER_AMD64_RDI = ( REGISTER_AMD64_RSI + 1 ) ,
- REGISTER_AMD64_R8 = ( REGISTER_AMD64_RDI + 1 ) ,
- REGISTER_AMD64_R9 = ( REGISTER_AMD64_R8 + 1 ) ,
- REGISTER_AMD64_R10 = ( REGISTER_AMD64_R9 + 1 ) ,
- REGISTER_AMD64_R11 = ( REGISTER_AMD64_R10 + 1 ) ,
- REGISTER_AMD64_R12 = ( REGISTER_AMD64_R11 + 1 ) ,
- REGISTER_AMD64_R13 = ( REGISTER_AMD64_R12 + 1 ) ,
- REGISTER_AMD64_R14 = ( REGISTER_AMD64_R13 + 1 ) ,
- REGISTER_AMD64_R15 = ( REGISTER_AMD64_R14 + 1 ) ,
- REGISTER_AMD64_XMM0 = ( REGISTER_AMD64_R15 + 1 ) ,
- REGISTER_AMD64_XMM1 = ( REGISTER_AMD64_XMM0 + 1 ) ,
- REGISTER_AMD64_XMM2 = ( REGISTER_AMD64_XMM1 + 1 ) ,
- REGISTER_AMD64_XMM3 = ( REGISTER_AMD64_XMM2 + 1 ) ,
- REGISTER_AMD64_XMM4 = ( REGISTER_AMD64_XMM3 + 1 ) ,
- REGISTER_AMD64_XMM5 = ( REGISTER_AMD64_XMM4 + 1 ) ,
- REGISTER_AMD64_XMM6 = ( REGISTER_AMD64_XMM5 + 1 ) ,
- REGISTER_AMD64_XMM7 = ( REGISTER_AMD64_XMM6 + 1 ) ,
- REGISTER_AMD64_XMM8 = ( REGISTER_AMD64_XMM7 + 1 ) ,
- REGISTER_AMD64_XMM9 = ( REGISTER_AMD64_XMM8 + 1 ) ,
- REGISTER_AMD64_XMM10 = ( REGISTER_AMD64_XMM9 + 1 ) ,
- REGISTER_AMD64_XMM11 = ( REGISTER_AMD64_XMM10 + 1 ) ,
- REGISTER_AMD64_XMM12 = ( REGISTER_AMD64_XMM11 + 1 ) ,
- REGISTER_AMD64_XMM13 = ( REGISTER_AMD64_XMM12 + 1 ) ,
- REGISTER_AMD64_XMM14 = ( REGISTER_AMD64_XMM13 + 1 ) ,
- REGISTER_AMD64_XMM15 = ( REGISTER_AMD64_XMM14 + 1 ) ,
- REGISTER_IA64_BSP = REGISTER_FRAME_POINTER,
- REGISTER_IA64_R0 = ( REGISTER_IA64_BSP + 1 ) ,
- REGISTER_IA64_F0 = ( REGISTER_IA64_R0 + 128 ) ,
- REGISTER_ARM_PC = 0,
- REGISTER_ARM_SP = ( REGISTER_ARM_PC + 1 ) ,
- REGISTER_ARM_R0 = ( REGISTER_ARM_SP + 1 ) ,
- REGISTER_ARM_R1 = ( REGISTER_ARM_R0 + 1 ) ,
- REGISTER_ARM_R2 = ( REGISTER_ARM_R1 + 1 ) ,
- REGISTER_ARM_R3 = ( REGISTER_ARM_R2 + 1 ) ,
- REGISTER_ARM_R4 = ( REGISTER_ARM_R3 + 1 ) ,
- REGISTER_ARM_R5 = ( REGISTER_ARM_R4 + 1 ) ,
- REGISTER_ARM_R6 = ( REGISTER_ARM_R5 + 1 ) ,
- REGISTER_ARM_R7 = ( REGISTER_ARM_R6 + 1 ) ,
- REGISTER_ARM_R8 = ( REGISTER_ARM_R7 + 1 ) ,
- REGISTER_ARM_R9 = ( REGISTER_ARM_R8 + 1 ) ,
- REGISTER_ARM_R10 = ( REGISTER_ARM_R9 + 1 ) ,
- REGISTER_ARM_R11 = ( REGISTER_ARM_R10 + 1 ) ,
- REGISTER_ARM_R12 = ( REGISTER_ARM_R11 + 1 ) ,
- REGISTER_ARM_LR = ( REGISTER_ARM_R12 + 1 ) ,
- REGISTER_ARM_D0 = ( REGISTER_ARM_LR + 1 ) ,
- REGISTER_ARM_D1 = ( REGISTER_ARM_D0 + 1 ) ,
- REGISTER_ARM_D2 = ( REGISTER_ARM_D1 + 1 ) ,
- REGISTER_ARM_D3 = ( REGISTER_ARM_D2 + 1 ) ,
- REGISTER_ARM_D4 = ( REGISTER_ARM_D3 + 1 ) ,
- REGISTER_ARM_D5 = ( REGISTER_ARM_D4 + 1 ) ,
- REGISTER_ARM_D6 = ( REGISTER_ARM_D5 + 1 ) ,
- REGISTER_ARM_D7 = ( REGISTER_ARM_D6 + 1 ) ,
- REGISTER_ARM_D8 = ( REGISTER_ARM_D7 + 1 ) ,
- REGISTER_ARM_D9 = ( REGISTER_ARM_D8 + 1 ) ,
- REGISTER_ARM_D10 = ( REGISTER_ARM_D9 + 1 ) ,
- REGISTER_ARM_D11 = ( REGISTER_ARM_D10 + 1 ) ,
- REGISTER_ARM_D12 = ( REGISTER_ARM_D11 + 1 ) ,
- REGISTER_ARM_D13 = ( REGISTER_ARM_D12 + 1 ) ,
- REGISTER_ARM_D14 = ( REGISTER_ARM_D13 + 1 ) ,
- REGISTER_ARM_D15 = ( REGISTER_ARM_D14 + 1 ) ,
- REGISTER_ARM_D16 = ( REGISTER_ARM_D15 + 1 ) ,
- REGISTER_ARM_D17 = ( REGISTER_ARM_D16 + 1 ) ,
- REGISTER_ARM_D18 = ( REGISTER_ARM_D17 + 1 ) ,
- REGISTER_ARM_D19 = ( REGISTER_ARM_D18 + 1 ) ,
- REGISTER_ARM_D20 = ( REGISTER_ARM_D19 + 1 ) ,
- REGISTER_ARM_D21 = ( REGISTER_ARM_D20 + 1 ) ,
- REGISTER_ARM_D22 = ( REGISTER_ARM_D21 + 1 ) ,
- REGISTER_ARM_D23 = ( REGISTER_ARM_D22 + 1 ) ,
- REGISTER_ARM_D24 = ( REGISTER_ARM_D23 + 1 ) ,
- REGISTER_ARM_D25 = ( REGISTER_ARM_D24 + 1 ) ,
- REGISTER_ARM_D26 = ( REGISTER_ARM_D25 + 1 ) ,
- REGISTER_ARM_D27 = ( REGISTER_ARM_D26 + 1 ) ,
- REGISTER_ARM_D28 = ( REGISTER_ARM_D27 + 1 ) ,
- REGISTER_ARM_D29 = ( REGISTER_ARM_D28 + 1 ) ,
- REGISTER_ARM_D30 = ( REGISTER_ARM_D29 + 1 ) ,
- REGISTER_ARM_D31 = ( REGISTER_ARM_D30 + 1 ) ,
- REGISTER_ARM64_PC = 0,
- REGISTER_ARM64_SP = ( REGISTER_ARM64_PC + 1 ) ,
- REGISTER_ARM64_FP = ( REGISTER_ARM64_SP + 1 ) ,
- REGISTER_ARM64_X0 = ( REGISTER_ARM64_FP + 1 ) ,
- REGISTER_ARM64_X1 = ( REGISTER_ARM64_X0 + 1 ) ,
- REGISTER_ARM64_X2 = ( REGISTER_ARM64_X1 + 1 ) ,
- REGISTER_ARM64_X3 = ( REGISTER_ARM64_X2 + 1 ) ,
- REGISTER_ARM64_X4 = ( REGISTER_ARM64_X3 + 1 ) ,
- REGISTER_ARM64_X5 = ( REGISTER_ARM64_X4 + 1 ) ,
- REGISTER_ARM64_X6 = ( REGISTER_ARM64_X5 + 1 ) ,
- REGISTER_ARM64_X7 = ( REGISTER_ARM64_X6 + 1 ) ,
- REGISTER_ARM64_X8 = ( REGISTER_ARM64_X7 + 1 ) ,
- REGISTER_ARM64_X9 = ( REGISTER_ARM64_X8 + 1 ) ,
- REGISTER_ARM64_X10 = ( REGISTER_ARM64_X9 + 1 ) ,
- REGISTER_ARM64_X11 = ( REGISTER_ARM64_X10 + 1 ) ,
- REGISTER_ARM64_X12 = ( REGISTER_ARM64_X11 + 1 ) ,
- REGISTER_ARM64_X13 = ( REGISTER_ARM64_X12 + 1 ) ,
- REGISTER_ARM64_X14 = ( REGISTER_ARM64_X13 + 1 ) ,
- REGISTER_ARM64_X15 = ( REGISTER_ARM64_X14 + 1 ) ,
- REGISTER_ARM64_X16 = ( REGISTER_ARM64_X15 + 1 ) ,
- REGISTER_ARM64_X17 = ( REGISTER_ARM64_X16 + 1 ) ,
- REGISTER_ARM64_X18 = ( REGISTER_ARM64_X17 + 1 ) ,
- REGISTER_ARM64_X19 = ( REGISTER_ARM64_X18 + 1 ) ,
- REGISTER_ARM64_X20 = ( REGISTER_ARM64_X19 + 1 ) ,
- REGISTER_ARM64_X21 = ( REGISTER_ARM64_X20 + 1 ) ,
- REGISTER_ARM64_X22 = ( REGISTER_ARM64_X21 + 1 ) ,
- REGISTER_ARM64_X23 = ( REGISTER_ARM64_X22 + 1 ) ,
- REGISTER_ARM64_X24 = ( REGISTER_ARM64_X23 + 1 ) ,
- REGISTER_ARM64_X25 = ( REGISTER_ARM64_X24 + 1 ) ,
- REGISTER_ARM64_X26 = ( REGISTER_ARM64_X25 + 1 ) ,
- REGISTER_ARM64_X27 = ( REGISTER_ARM64_X26 + 1 ) ,
- REGISTER_ARM64_X28 = ( REGISTER_ARM64_X27 + 1 ) ,
- REGISTER_ARM64_LR = ( REGISTER_ARM64_X28 + 1 ) ,
- REGISTER_ARM64_V0 = ( REGISTER_ARM64_LR + 1 ) ,
- REGISTER_ARM64_V1 = ( REGISTER_ARM64_V0 + 1 ) ,
- REGISTER_ARM64_V2 = ( REGISTER_ARM64_V1 + 1 ) ,
- REGISTER_ARM64_V3 = ( REGISTER_ARM64_V2 + 1 ) ,
- REGISTER_ARM64_V4 = ( REGISTER_ARM64_V3 + 1 ) ,
- REGISTER_ARM64_V5 = ( REGISTER_ARM64_V4 + 1 ) ,
- REGISTER_ARM64_V6 = ( REGISTER_ARM64_V5 + 1 ) ,
- REGISTER_ARM64_V7 = ( REGISTER_ARM64_V6 + 1 ) ,
- REGISTER_ARM64_V8 = ( REGISTER_ARM64_V7 + 1 ) ,
- REGISTER_ARM64_V9 = ( REGISTER_ARM64_V8 + 1 ) ,
- REGISTER_ARM64_V10 = ( REGISTER_ARM64_V9 + 1 ) ,
- REGISTER_ARM64_V11 = ( REGISTER_ARM64_V10 + 1 ) ,
- REGISTER_ARM64_V12 = ( REGISTER_ARM64_V11 + 1 ) ,
- REGISTER_ARM64_V13 = ( REGISTER_ARM64_V12 + 1 ) ,
- REGISTER_ARM64_V14 = ( REGISTER_ARM64_V13 + 1 ) ,
- REGISTER_ARM64_V15 = ( REGISTER_ARM64_V14 + 1 ) ,
- REGISTER_ARM64_V16 = ( REGISTER_ARM64_V15 + 1 ) ,
- REGISTER_ARM64_V17 = ( REGISTER_ARM64_V16 + 1 ) ,
- REGISTER_ARM64_V18 = ( REGISTER_ARM64_V17 + 1 ) ,
- REGISTER_ARM64_V19 = ( REGISTER_ARM64_V18 + 1 ) ,
- REGISTER_ARM64_V20 = ( REGISTER_ARM64_V19 + 1 ) ,
- REGISTER_ARM64_V21 = ( REGISTER_ARM64_V20 + 1 ) ,
- REGISTER_ARM64_V22 = ( REGISTER_ARM64_V21 + 1 ) ,
- REGISTER_ARM64_V23 = ( REGISTER_ARM64_V22 + 1 ) ,
- REGISTER_ARM64_V24 = ( REGISTER_ARM64_V23 + 1 ) ,
- REGISTER_ARM64_V25 = ( REGISTER_ARM64_V24 + 1 ) ,
- REGISTER_ARM64_V26 = ( REGISTER_ARM64_V25 + 1 ) ,
- REGISTER_ARM64_V27 = ( REGISTER_ARM64_V26 + 1 ) ,
- REGISTER_ARM64_V28 = ( REGISTER_ARM64_V27 + 1 ) ,
- REGISTER_ARM64_V29 = ( REGISTER_ARM64_V28 + 1 ) ,
- REGISTER_ARM64_V30 = ( REGISTER_ARM64_V29 + 1 ) ,
- REGISTER_ARM64_V31 = ( REGISTER_ARM64_V30 + 1 )
- } CorDebugRegister;
+ REGISTER_INSTRUCTION_POINTER = 0,
+ REGISTER_STACK_POINTER = ( REGISTER_INSTRUCTION_POINTER + 1 ) ,
+ REGISTER_FRAME_POINTER = ( REGISTER_STACK_POINTER + 1 ) ,
+ REGISTER_X86_EIP = 0,
+ REGISTER_X86_ESP = ( REGISTER_X86_EIP + 1 ) ,
+ REGISTER_X86_EBP = ( REGISTER_X86_ESP + 1 ) ,
+ REGISTER_X86_EAX = ( REGISTER_X86_EBP + 1 ) ,
+ REGISTER_X86_ECX = ( REGISTER_X86_EAX + 1 ) ,
+ REGISTER_X86_EDX = ( REGISTER_X86_ECX + 1 ) ,
+ REGISTER_X86_EBX = ( REGISTER_X86_EDX + 1 ) ,
+ REGISTER_X86_ESI = ( REGISTER_X86_EBX + 1 ) ,
+ REGISTER_X86_EDI = ( REGISTER_X86_ESI + 1 ) ,
+ REGISTER_X86_FPSTACK_0 = ( REGISTER_X86_EDI + 1 ) ,
+ REGISTER_X86_FPSTACK_1 = ( REGISTER_X86_FPSTACK_0 + 1 ) ,
+ REGISTER_X86_FPSTACK_2 = ( REGISTER_X86_FPSTACK_1 + 1 ) ,
+ REGISTER_X86_FPSTACK_3 = ( REGISTER_X86_FPSTACK_2 + 1 ) ,
+ REGISTER_X86_FPSTACK_4 = ( REGISTER_X86_FPSTACK_3 + 1 ) ,
+ REGISTER_X86_FPSTACK_5 = ( REGISTER_X86_FPSTACK_4 + 1 ) ,
+ REGISTER_X86_FPSTACK_6 = ( REGISTER_X86_FPSTACK_5 + 1 ) ,
+ REGISTER_X86_FPSTACK_7 = ( REGISTER_X86_FPSTACK_6 + 1 ) ,
+ REGISTER_AMD64_RIP = 0,
+ REGISTER_AMD64_RSP = ( REGISTER_AMD64_RIP + 1 ) ,
+ REGISTER_AMD64_RBP = ( REGISTER_AMD64_RSP + 1 ) ,
+ REGISTER_AMD64_RAX = ( REGISTER_AMD64_RBP + 1 ) ,
+ REGISTER_AMD64_RCX = ( REGISTER_AMD64_RAX + 1 ) ,
+ REGISTER_AMD64_RDX = ( REGISTER_AMD64_RCX + 1 ) ,
+ REGISTER_AMD64_RBX = ( REGISTER_AMD64_RDX + 1 ) ,
+ REGISTER_AMD64_RSI = ( REGISTER_AMD64_RBX + 1 ) ,
+ REGISTER_AMD64_RDI = ( REGISTER_AMD64_RSI + 1 ) ,
+ REGISTER_AMD64_R8 = ( REGISTER_AMD64_RDI + 1 ) ,
+ REGISTER_AMD64_R9 = ( REGISTER_AMD64_R8 + 1 ) ,
+ REGISTER_AMD64_R10 = ( REGISTER_AMD64_R9 + 1 ) ,
+ REGISTER_AMD64_R11 = ( REGISTER_AMD64_R10 + 1 ) ,
+ REGISTER_AMD64_R12 = ( REGISTER_AMD64_R11 + 1 ) ,
+ REGISTER_AMD64_R13 = ( REGISTER_AMD64_R12 + 1 ) ,
+ REGISTER_AMD64_R14 = ( REGISTER_AMD64_R13 + 1 ) ,
+ REGISTER_AMD64_R15 = ( REGISTER_AMD64_R14 + 1 ) ,
+ REGISTER_AMD64_XMM0 = ( REGISTER_AMD64_R15 + 1 ) ,
+ REGISTER_AMD64_XMM1 = ( REGISTER_AMD64_XMM0 + 1 ) ,
+ REGISTER_AMD64_XMM2 = ( REGISTER_AMD64_XMM1 + 1 ) ,
+ REGISTER_AMD64_XMM3 = ( REGISTER_AMD64_XMM2 + 1 ) ,
+ REGISTER_AMD64_XMM4 = ( REGISTER_AMD64_XMM3 + 1 ) ,
+ REGISTER_AMD64_XMM5 = ( REGISTER_AMD64_XMM4 + 1 ) ,
+ REGISTER_AMD64_XMM6 = ( REGISTER_AMD64_XMM5 + 1 ) ,
+ REGISTER_AMD64_XMM7 = ( REGISTER_AMD64_XMM6 + 1 ) ,
+ REGISTER_AMD64_XMM8 = ( REGISTER_AMD64_XMM7 + 1 ) ,
+ REGISTER_AMD64_XMM9 = ( REGISTER_AMD64_XMM8 + 1 ) ,
+ REGISTER_AMD64_XMM10 = ( REGISTER_AMD64_XMM9 + 1 ) ,
+ REGISTER_AMD64_XMM11 = ( REGISTER_AMD64_XMM10 + 1 ) ,
+ REGISTER_AMD64_XMM12 = ( REGISTER_AMD64_XMM11 + 1 ) ,
+ REGISTER_AMD64_XMM13 = ( REGISTER_AMD64_XMM12 + 1 ) ,
+ REGISTER_AMD64_XMM14 = ( REGISTER_AMD64_XMM13 + 1 ) ,
+ REGISTER_AMD64_XMM15 = ( REGISTER_AMD64_XMM14 + 1 ) ,
+ REGISTER_IA64_BSP = REGISTER_FRAME_POINTER,
+ REGISTER_IA64_R0 = ( REGISTER_IA64_BSP + 1 ) ,
+ REGISTER_IA64_F0 = ( REGISTER_IA64_R0 + 128 ) ,
+ REGISTER_ARM_PC = 0,
+ REGISTER_ARM_SP = ( REGISTER_ARM_PC + 1 ) ,
+ REGISTER_ARM_R0 = ( REGISTER_ARM_SP + 1 ) ,
+ REGISTER_ARM_R1 = ( REGISTER_ARM_R0 + 1 ) ,
+ REGISTER_ARM_R2 = ( REGISTER_ARM_R1 + 1 ) ,
+ REGISTER_ARM_R3 = ( REGISTER_ARM_R2 + 1 ) ,
+ REGISTER_ARM_R4 = ( REGISTER_ARM_R3 + 1 ) ,
+ REGISTER_ARM_R5 = ( REGISTER_ARM_R4 + 1 ) ,
+ REGISTER_ARM_R6 = ( REGISTER_ARM_R5 + 1 ) ,
+ REGISTER_ARM_R7 = ( REGISTER_ARM_R6 + 1 ) ,
+ REGISTER_ARM_R8 = ( REGISTER_ARM_R7 + 1 ) ,
+ REGISTER_ARM_R9 = ( REGISTER_ARM_R8 + 1 ) ,
+ REGISTER_ARM_R10 = ( REGISTER_ARM_R9 + 1 ) ,
+ REGISTER_ARM_R11 = ( REGISTER_ARM_R10 + 1 ) ,
+ REGISTER_ARM_R12 = ( REGISTER_ARM_R11 + 1 ) ,
+ REGISTER_ARM_LR = ( REGISTER_ARM_R12 + 1 ) ,
+ REGISTER_ARM_D0 = ( REGISTER_ARM_LR + 1 ) ,
+ REGISTER_ARM_D1 = ( REGISTER_ARM_D0 + 1 ) ,
+ REGISTER_ARM_D2 = ( REGISTER_ARM_D1 + 1 ) ,
+ REGISTER_ARM_D3 = ( REGISTER_ARM_D2 + 1 ) ,
+ REGISTER_ARM_D4 = ( REGISTER_ARM_D3 + 1 ) ,
+ REGISTER_ARM_D5 = ( REGISTER_ARM_D4 + 1 ) ,
+ REGISTER_ARM_D6 = ( REGISTER_ARM_D5 + 1 ) ,
+ REGISTER_ARM_D7 = ( REGISTER_ARM_D6 + 1 ) ,
+ REGISTER_ARM_D8 = ( REGISTER_ARM_D7 + 1 ) ,
+ REGISTER_ARM_D9 = ( REGISTER_ARM_D8 + 1 ) ,
+ REGISTER_ARM_D10 = ( REGISTER_ARM_D9 + 1 ) ,
+ REGISTER_ARM_D11 = ( REGISTER_ARM_D10 + 1 ) ,
+ REGISTER_ARM_D12 = ( REGISTER_ARM_D11 + 1 ) ,
+ REGISTER_ARM_D13 = ( REGISTER_ARM_D12 + 1 ) ,
+ REGISTER_ARM_D14 = ( REGISTER_ARM_D13 + 1 ) ,
+ REGISTER_ARM_D15 = ( REGISTER_ARM_D14 + 1 ) ,
+ REGISTER_ARM_D16 = ( REGISTER_ARM_D15 + 1 ) ,
+ REGISTER_ARM_D17 = ( REGISTER_ARM_D16 + 1 ) ,
+ REGISTER_ARM_D18 = ( REGISTER_ARM_D17 + 1 ) ,
+ REGISTER_ARM_D19 = ( REGISTER_ARM_D18 + 1 ) ,
+ REGISTER_ARM_D20 = ( REGISTER_ARM_D19 + 1 ) ,
+ REGISTER_ARM_D21 = ( REGISTER_ARM_D20 + 1 ) ,
+ REGISTER_ARM_D22 = ( REGISTER_ARM_D21 + 1 ) ,
+ REGISTER_ARM_D23 = ( REGISTER_ARM_D22 + 1 ) ,
+ REGISTER_ARM_D24 = ( REGISTER_ARM_D23 + 1 ) ,
+ REGISTER_ARM_D25 = ( REGISTER_ARM_D24 + 1 ) ,
+ REGISTER_ARM_D26 = ( REGISTER_ARM_D25 + 1 ) ,
+ REGISTER_ARM_D27 = ( REGISTER_ARM_D26 + 1 ) ,
+ REGISTER_ARM_D28 = ( REGISTER_ARM_D27 + 1 ) ,
+ REGISTER_ARM_D29 = ( REGISTER_ARM_D28 + 1 ) ,
+ REGISTER_ARM_D30 = ( REGISTER_ARM_D29 + 1 ) ,
+ REGISTER_ARM_D31 = ( REGISTER_ARM_D30 + 1 ) ,
+ REGISTER_ARM64_PC = 0,
+ REGISTER_ARM64_SP = ( REGISTER_ARM64_PC + 1 ) ,
+ REGISTER_ARM64_FP = ( REGISTER_ARM64_SP + 1 ) ,
+ REGISTER_ARM64_X0 = ( REGISTER_ARM64_FP + 1 ) ,
+ REGISTER_ARM64_X1 = ( REGISTER_ARM64_X0 + 1 ) ,
+ REGISTER_ARM64_X2 = ( REGISTER_ARM64_X1 + 1 ) ,
+ REGISTER_ARM64_X3 = ( REGISTER_ARM64_X2 + 1 ) ,
+ REGISTER_ARM64_X4 = ( REGISTER_ARM64_X3 + 1 ) ,
+ REGISTER_ARM64_X5 = ( REGISTER_ARM64_X4 + 1 ) ,
+ REGISTER_ARM64_X6 = ( REGISTER_ARM64_X5 + 1 ) ,
+ REGISTER_ARM64_X7 = ( REGISTER_ARM64_X6 + 1 ) ,
+ REGISTER_ARM64_X8 = ( REGISTER_ARM64_X7 + 1 ) ,
+ REGISTER_ARM64_X9 = ( REGISTER_ARM64_X8 + 1 ) ,
+ REGISTER_ARM64_X10 = ( REGISTER_ARM64_X9 + 1 ) ,
+ REGISTER_ARM64_X11 = ( REGISTER_ARM64_X10 + 1 ) ,
+ REGISTER_ARM64_X12 = ( REGISTER_ARM64_X11 + 1 ) ,
+ REGISTER_ARM64_X13 = ( REGISTER_ARM64_X12 + 1 ) ,
+ REGISTER_ARM64_X14 = ( REGISTER_ARM64_X13 + 1 ) ,
+ REGISTER_ARM64_X15 = ( REGISTER_ARM64_X14 + 1 ) ,
+ REGISTER_ARM64_X16 = ( REGISTER_ARM64_X15 + 1 ) ,
+ REGISTER_ARM64_X17 = ( REGISTER_ARM64_X16 + 1 ) ,
+ REGISTER_ARM64_X18 = ( REGISTER_ARM64_X17 + 1 ) ,
+ REGISTER_ARM64_X19 = ( REGISTER_ARM64_X18 + 1 ) ,
+ REGISTER_ARM64_X20 = ( REGISTER_ARM64_X19 + 1 ) ,
+ REGISTER_ARM64_X21 = ( REGISTER_ARM64_X20 + 1 ) ,
+ REGISTER_ARM64_X22 = ( REGISTER_ARM64_X21 + 1 ) ,
+ REGISTER_ARM64_X23 = ( REGISTER_ARM64_X22 + 1 ) ,
+ REGISTER_ARM64_X24 = ( REGISTER_ARM64_X23 + 1 ) ,
+ REGISTER_ARM64_X25 = ( REGISTER_ARM64_X24 + 1 ) ,
+ REGISTER_ARM64_X26 = ( REGISTER_ARM64_X25 + 1 ) ,
+ REGISTER_ARM64_X27 = ( REGISTER_ARM64_X26 + 1 ) ,
+ REGISTER_ARM64_X28 = ( REGISTER_ARM64_X27 + 1 ) ,
+ REGISTER_ARM64_LR = ( REGISTER_ARM64_X28 + 1 ) ,
+ REGISTER_ARM64_V0 = ( REGISTER_ARM64_LR + 1 ) ,
+ REGISTER_ARM64_V1 = ( REGISTER_ARM64_V0 + 1 ) ,
+ REGISTER_ARM64_V2 = ( REGISTER_ARM64_V1 + 1 ) ,
+ REGISTER_ARM64_V3 = ( REGISTER_ARM64_V2 + 1 ) ,
+ REGISTER_ARM64_V4 = ( REGISTER_ARM64_V3 + 1 ) ,
+ REGISTER_ARM64_V5 = ( REGISTER_ARM64_V4 + 1 ) ,
+ REGISTER_ARM64_V6 = ( REGISTER_ARM64_V5 + 1 ) ,
+ REGISTER_ARM64_V7 = ( REGISTER_ARM64_V6 + 1 ) ,
+ REGISTER_ARM64_V8 = ( REGISTER_ARM64_V7 + 1 ) ,
+ REGISTER_ARM64_V9 = ( REGISTER_ARM64_V8 + 1 ) ,
+ REGISTER_ARM64_V10 = ( REGISTER_ARM64_V9 + 1 ) ,
+ REGISTER_ARM64_V11 = ( REGISTER_ARM64_V10 + 1 ) ,
+ REGISTER_ARM64_V12 = ( REGISTER_ARM64_V11 + 1 ) ,
+ REGISTER_ARM64_V13 = ( REGISTER_ARM64_V12 + 1 ) ,
+ REGISTER_ARM64_V14 = ( REGISTER_ARM64_V13 + 1 ) ,
+ REGISTER_ARM64_V15 = ( REGISTER_ARM64_V14 + 1 ) ,
+ REGISTER_ARM64_V16 = ( REGISTER_ARM64_V15 + 1 ) ,
+ REGISTER_ARM64_V17 = ( REGISTER_ARM64_V16 + 1 ) ,
+ REGISTER_ARM64_V18 = ( REGISTER_ARM64_V17 + 1 ) ,
+ REGISTER_ARM64_V19 = ( REGISTER_ARM64_V18 + 1 ) ,
+ REGISTER_ARM64_V20 = ( REGISTER_ARM64_V19 + 1 ) ,
+ REGISTER_ARM64_V21 = ( REGISTER_ARM64_V20 + 1 ) ,
+ REGISTER_ARM64_V22 = ( REGISTER_ARM64_V21 + 1 ) ,
+ REGISTER_ARM64_V23 = ( REGISTER_ARM64_V22 + 1 ) ,
+ REGISTER_ARM64_V24 = ( REGISTER_ARM64_V23 + 1 ) ,
+ REGISTER_ARM64_V25 = ( REGISTER_ARM64_V24 + 1 ) ,
+ REGISTER_ARM64_V26 = ( REGISTER_ARM64_V25 + 1 ) ,
+ REGISTER_ARM64_V27 = ( REGISTER_ARM64_V26 + 1 ) ,
+ REGISTER_ARM64_V28 = ( REGISTER_ARM64_V27 + 1 ) ,
+ REGISTER_ARM64_V29 = ( REGISTER_ARM64_V28 + 1 ) ,
+ REGISTER_ARM64_V30 = ( REGISTER_ARM64_V29 + 1 ) ,
+ REGISTER_ARM64_V31 = ( REGISTER_ARM64_V30 + 1 )
+ } CorDebugRegister;
EXTERN_C const IID IID_ICorDebugRegisterSet;
@@ -8984,7 +9204,7 @@ EXTERN_C const IID IID_ICorDebugRegisterSet;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugRegisterSetVtbl
{
@@ -9041,40 +9261,40 @@ EXTERN_C const IID IID_ICorDebugRegisterSet;
#ifdef COBJMACROS
-#define ICorDebugRegisterSet_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugRegisterSet_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugRegisterSet_AddRef(This) \
+#define ICorDebugRegisterSet_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugRegisterSet_Release(This) \
+#define ICorDebugRegisterSet_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugRegisterSet_GetRegistersAvailable(This,pAvailable) \
+#define ICorDebugRegisterSet_GetRegistersAvailable(This,pAvailable) \
( (This)->lpVtbl -> GetRegistersAvailable(This,pAvailable) )
-#define ICorDebugRegisterSet_GetRegisters(This,mask,regCount,regBuffer) \
+#define ICorDebugRegisterSet_GetRegisters(This,mask,regCount,regBuffer) \
( (This)->lpVtbl -> GetRegisters(This,mask,regCount,regBuffer) )
-#define ICorDebugRegisterSet_SetRegisters(This,mask,regCount,regBuffer) \
+#define ICorDebugRegisterSet_SetRegisters(This,mask,regCount,regBuffer) \
( (This)->lpVtbl -> SetRegisters(This,mask,regCount,regBuffer) )
-#define ICorDebugRegisterSet_GetThreadContext(This,contextSize,context) \
+#define ICorDebugRegisterSet_GetThreadContext(This,contextSize,context) \
( (This)->lpVtbl -> GetThreadContext(This,contextSize,context) )
-#define ICorDebugRegisterSet_SetThreadContext(This,contextSize,context) \
+#define ICorDebugRegisterSet_SetThreadContext(This,contextSize,context) \
( (This)->lpVtbl -> SetThreadContext(This,contextSize,context) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugRegisterSet_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugRegisterSet_INTERFACE_DEFINED__ */
#ifndef __ICorDebugRegisterSet2_INTERFACE_DEFINED__
@@ -9111,7 +9331,7 @@ EXTERN_C const IID IID_ICorDebugRegisterSet2;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugRegisterSet2Vtbl
{
@@ -9161,34 +9381,34 @@ EXTERN_C const IID IID_ICorDebugRegisterSet2;
#ifdef COBJMACROS
-#define ICorDebugRegisterSet2_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugRegisterSet2_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugRegisterSet2_AddRef(This) \
+#define ICorDebugRegisterSet2_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugRegisterSet2_Release(This) \
+#define ICorDebugRegisterSet2_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugRegisterSet2_GetRegistersAvailable(This,numChunks,availableRegChunks) \
+#define ICorDebugRegisterSet2_GetRegistersAvailable(This,numChunks,availableRegChunks) \
( (This)->lpVtbl -> GetRegistersAvailable(This,numChunks,availableRegChunks) )
-#define ICorDebugRegisterSet2_GetRegisters(This,maskCount,mask,regCount,regBuffer) \
+#define ICorDebugRegisterSet2_GetRegisters(This,maskCount,mask,regCount,regBuffer) \
( (This)->lpVtbl -> GetRegisters(This,maskCount,mask,regCount,regBuffer) )
-#define ICorDebugRegisterSet2_SetRegisters(This,maskCount,mask,regCount,regBuffer) \
+#define ICorDebugRegisterSet2_SetRegisters(This,maskCount,mask,regCount,regBuffer) \
( (This)->lpVtbl -> SetRegisters(This,maskCount,mask,regCount,regBuffer) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugRegisterSet2_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugRegisterSet2_INTERFACE_DEFINED__ */
#ifndef __ICorDebugThread_INTERFACE_DEFINED__
@@ -9200,16 +9420,16 @@ EXTERN_C const IID IID_ICorDebugRegisterSet2;
typedef
enum CorDebugUserState
{
- USER_STOP_REQUESTED = 0x1,
- USER_SUSPEND_REQUESTED = 0x2,
- USER_BACKGROUND = 0x4,
- USER_UNSTARTED = 0x8,
- USER_STOPPED = 0x10,
- USER_WAIT_SLEEP_JOIN = 0x20,
- USER_SUSPENDED = 0x40,
- USER_UNSAFE_POINT = 0x80,
- USER_THREADPOOL = 0x100
- } CorDebugUserState;
+ USER_STOP_REQUESTED = 0x1,
+ USER_SUSPEND_REQUESTED = 0x2,
+ USER_BACKGROUND = 0x4,
+ USER_UNSTARTED = 0x8,
+ USER_STOPPED = 0x10,
+ USER_WAIT_SLEEP_JOIN = 0x20,
+ USER_SUSPENDED = 0x40,
+ USER_UNSAFE_POINT = 0x80,
+ USER_THREADPOOL = 0x100
+ } CorDebugUserState;
EXTERN_C const IID IID_ICorDebugThread;
@@ -9270,7 +9490,7 @@ EXTERN_C const IID IID_ICorDebugThread;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugThreadVtbl
{
@@ -9364,73 +9584,73 @@ EXTERN_C const IID IID_ICorDebugThread;
#ifdef COBJMACROS
-#define ICorDebugThread_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugThread_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugThread_AddRef(This) \
+#define ICorDebugThread_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugThread_Release(This) \
+#define ICorDebugThread_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugThread_GetProcess(This,ppProcess) \
+#define ICorDebugThread_GetProcess(This,ppProcess) \
( (This)->lpVtbl -> GetProcess(This,ppProcess) )
-#define ICorDebugThread_GetID(This,pdwThreadId) \
+#define ICorDebugThread_GetID(This,pdwThreadId) \
( (This)->lpVtbl -> GetID(This,pdwThreadId) )
-#define ICorDebugThread_GetHandle(This,phThreadHandle) \
+#define ICorDebugThread_GetHandle(This,phThreadHandle) \
( (This)->lpVtbl -> GetHandle(This,phThreadHandle) )
-#define ICorDebugThread_GetAppDomain(This,ppAppDomain) \
+#define ICorDebugThread_GetAppDomain(This,ppAppDomain) \
( (This)->lpVtbl -> GetAppDomain(This,ppAppDomain) )
-#define ICorDebugThread_SetDebugState(This,state) \
+#define ICorDebugThread_SetDebugState(This,state) \
( (This)->lpVtbl -> SetDebugState(This,state) )
-#define ICorDebugThread_GetDebugState(This,pState) \
+#define ICorDebugThread_GetDebugState(This,pState) \
( (This)->lpVtbl -> GetDebugState(This,pState) )
-#define ICorDebugThread_GetUserState(This,pState) \
+#define ICorDebugThread_GetUserState(This,pState) \
( (This)->lpVtbl -> GetUserState(This,pState) )
-#define ICorDebugThread_GetCurrentException(This,ppExceptionObject) \
+#define ICorDebugThread_GetCurrentException(This,ppExceptionObject) \
( (This)->lpVtbl -> GetCurrentException(This,ppExceptionObject) )
-#define ICorDebugThread_ClearCurrentException(This) \
+#define ICorDebugThread_ClearCurrentException(This) \
( (This)->lpVtbl -> ClearCurrentException(This) )
-#define ICorDebugThread_CreateStepper(This,ppStepper) \
+#define ICorDebugThread_CreateStepper(This,ppStepper) \
( (This)->lpVtbl -> CreateStepper(This,ppStepper) )
-#define ICorDebugThread_EnumerateChains(This,ppChains) \
+#define ICorDebugThread_EnumerateChains(This,ppChains) \
( (This)->lpVtbl -> EnumerateChains(This,ppChains) )
-#define ICorDebugThread_GetActiveChain(This,ppChain) \
+#define ICorDebugThread_GetActiveChain(This,ppChain) \
( (This)->lpVtbl -> GetActiveChain(This,ppChain) )
-#define ICorDebugThread_GetActiveFrame(This,ppFrame) \
+#define ICorDebugThread_GetActiveFrame(This,ppFrame) \
( (This)->lpVtbl -> GetActiveFrame(This,ppFrame) )
-#define ICorDebugThread_GetRegisterSet(This,ppRegisters) \
+#define ICorDebugThread_GetRegisterSet(This,ppRegisters) \
( (This)->lpVtbl -> GetRegisterSet(This,ppRegisters) )
-#define ICorDebugThread_CreateEval(This,ppEval) \
+#define ICorDebugThread_CreateEval(This,ppEval) \
( (This)->lpVtbl -> CreateEval(This,ppEval) )
-#define ICorDebugThread_GetObject(This,ppObject) \
+#define ICorDebugThread_GetObject(This,ppObject) \
( (This)->lpVtbl -> GetObject(This,ppObject) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugThread_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugThread_INTERFACE_DEFINED__ */
#ifndef __ICorDebugThread2_INTERFACE_DEFINED__
@@ -9446,7 +9666,7 @@ typedef struct _COR_ACTIVE_FUNCTION
ICorDebugFunction2 *pFunction;
ULONG32 ilOffset;
ULONG32 flags;
- } COR_ACTIVE_FUNCTION;
+ } COR_ACTIVE_FUNCTION;
EXTERN_C const IID IID_ICorDebugThread2;
@@ -9477,7 +9697,7 @@ EXTERN_C const IID IID_ICorDebugThread2;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugThread2Vtbl
{
@@ -9530,40 +9750,40 @@ EXTERN_C const IID IID_ICorDebugThread2;
#ifdef COBJMACROS
-#define ICorDebugThread2_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugThread2_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugThread2_AddRef(This) \
+#define ICorDebugThread2_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugThread2_Release(This) \
+#define ICorDebugThread2_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugThread2_GetActiveFunctions(This,cFunctions,pcFunctions,pFunctions) \
+#define ICorDebugThread2_GetActiveFunctions(This,cFunctions,pcFunctions,pFunctions) \
( (This)->lpVtbl -> GetActiveFunctions(This,cFunctions,pcFunctions,pFunctions) )
-#define ICorDebugThread2_GetConnectionID(This,pdwConnectionId) \
+#define ICorDebugThread2_GetConnectionID(This,pdwConnectionId) \
( (This)->lpVtbl -> GetConnectionID(This,pdwConnectionId) )
-#define ICorDebugThread2_GetTaskID(This,pTaskId) \
+#define ICorDebugThread2_GetTaskID(This,pTaskId) \
( (This)->lpVtbl -> GetTaskID(This,pTaskId) )
-#define ICorDebugThread2_GetVolatileOSThreadID(This,pdwTid) \
+#define ICorDebugThread2_GetVolatileOSThreadID(This,pdwTid) \
( (This)->lpVtbl -> GetVolatileOSThreadID(This,pdwTid) )
-#define ICorDebugThread2_InterceptCurrentException(This,pFrame) \
+#define ICorDebugThread2_InterceptCurrentException(This,pFrame) \
( (This)->lpVtbl -> InterceptCurrentException(This,pFrame) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugThread2_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugThread2_INTERFACE_DEFINED__ */
#ifndef __ICorDebugThread3_INTERFACE_DEFINED__
@@ -9592,7 +9812,7 @@ EXTERN_C const IID IID_ICorDebugThread3;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugThread3Vtbl
{
@@ -9633,31 +9853,31 @@ EXTERN_C const IID IID_ICorDebugThread3;
#ifdef COBJMACROS
-#define ICorDebugThread3_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugThread3_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugThread3_AddRef(This) \
+#define ICorDebugThread3_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugThread3_Release(This) \
+#define ICorDebugThread3_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugThread3_CreateStackWalk(This,ppStackWalk) \
+#define ICorDebugThread3_CreateStackWalk(This,ppStackWalk) \
( (This)->lpVtbl -> CreateStackWalk(This,ppStackWalk) )
-#define ICorDebugThread3_GetActiveInternalFrames(This,cInternalFrames,pcInternalFrames,ppInternalFrames) \
+#define ICorDebugThread3_GetActiveInternalFrames(This,cInternalFrames,pcInternalFrames,ppInternalFrames) \
( (This)->lpVtbl -> GetActiveInternalFrames(This,cInternalFrames,pcInternalFrames,ppInternalFrames) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugThread3_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugThread3_INTERFACE_DEFINED__ */
#ifndef __ICorDebugThread4_INTERFACE_DEFINED__
@@ -9686,7 +9906,7 @@ EXTERN_C const IID IID_ICorDebugThread4;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugThread4Vtbl
{
@@ -9728,34 +9948,34 @@ EXTERN_C const IID IID_ICorDebugThread4;
#ifdef COBJMACROS
-#define ICorDebugThread4_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugThread4_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugThread4_AddRef(This) \
+#define ICorDebugThread4_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugThread4_Release(This) \
+#define ICorDebugThread4_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugThread4_HasUnhandledException(This) \
+#define ICorDebugThread4_HasUnhandledException(This) \
( (This)->lpVtbl -> HasUnhandledException(This) )
-#define ICorDebugThread4_GetBlockingObjects(This,ppBlockingObjectEnum) \
+#define ICorDebugThread4_GetBlockingObjects(This,ppBlockingObjectEnum) \
( (This)->lpVtbl -> GetBlockingObjects(This,ppBlockingObjectEnum) )
-#define ICorDebugThread4_GetCurrentCustomDebuggerNotification(This,ppNotificationObject) \
+#define ICorDebugThread4_GetCurrentCustomDebuggerNotification(This,ppNotificationObject) \
( (This)->lpVtbl -> GetCurrentCustomDebuggerNotification(This,ppNotificationObject) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugThread4_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugThread4_INTERFACE_DEFINED__ */
#ifndef __ICorDebugStackWalk_INTERFACE_DEFINED__
@@ -9767,9 +9987,9 @@ EXTERN_C const IID IID_ICorDebugThread4;
typedef
enum CorDebugSetContextFlag
{
- SET_CONTEXT_FLAG_ACTIVE_FRAME = 0x1,
- SET_CONTEXT_FLAG_UNWIND_FRAME = 0x2
- } CorDebugSetContextFlag;
+ SET_CONTEXT_FLAG_ACTIVE_FRAME = 0x1,
+ SET_CONTEXT_FLAG_UNWIND_FRAME = 0x2
+ } CorDebugSetContextFlag;
EXTERN_C const IID IID_ICorDebugStackWalk;
@@ -9799,7 +10019,7 @@ EXTERN_C const IID IID_ICorDebugStackWalk;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugStackWalkVtbl
{
@@ -9850,37 +10070,37 @@ EXTERN_C const IID IID_ICorDebugStackWalk;
#ifdef COBJMACROS
-#define ICorDebugStackWalk_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugStackWalk_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugStackWalk_AddRef(This) \
+#define ICorDebugStackWalk_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugStackWalk_Release(This) \
+#define ICorDebugStackWalk_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugStackWalk_GetContext(This,contextFlags,contextBufSize,contextSize,contextBuf) \
+#define ICorDebugStackWalk_GetContext(This,contextFlags,contextBufSize,contextSize,contextBuf) \
( (This)->lpVtbl -> GetContext(This,contextFlags,contextBufSize,contextSize,contextBuf) )
-#define ICorDebugStackWalk_SetContext(This,flag,contextSize,context) \
+#define ICorDebugStackWalk_SetContext(This,flag,contextSize,context) \
( (This)->lpVtbl -> SetContext(This,flag,contextSize,context) )
-#define ICorDebugStackWalk_Next(This) \
+#define ICorDebugStackWalk_Next(This) \
( (This)->lpVtbl -> Next(This) )
-#define ICorDebugStackWalk_GetFrame(This,pFrame) \
+#define ICorDebugStackWalk_GetFrame(This,pFrame) \
( (This)->lpVtbl -> GetFrame(This,pFrame) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugStackWalk_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugStackWalk_INTERFACE_DEFINED__ */
#ifndef __ICorDebugChain_INTERFACE_DEFINED__
@@ -9892,20 +10112,20 @@ EXTERN_C const IID IID_ICorDebugStackWalk;
typedef
enum CorDebugChainReason
{
- CHAIN_NONE = 0,
- CHAIN_CLASS_INIT = 0x1,
- CHAIN_EXCEPTION_FILTER = 0x2,
- CHAIN_SECURITY = 0x4,
- CHAIN_CONTEXT_POLICY = 0x8,
- CHAIN_INTERCEPTION = 0x10,
- CHAIN_PROCESS_START = 0x20,
- CHAIN_THREAD_START = 0x40,
- CHAIN_ENTER_MANAGED = 0x80,
- CHAIN_ENTER_UNMANAGED = 0x100,
- CHAIN_DEBUGGER_EVAL = 0x200,
- CHAIN_CONTEXT_SWITCH = 0x400,
- CHAIN_FUNC_EVAL = 0x800
- } CorDebugChainReason;
+ CHAIN_NONE = 0,
+ CHAIN_CLASS_INIT = 0x1,
+ CHAIN_EXCEPTION_FILTER = 0x2,
+ CHAIN_SECURITY = 0x4,
+ CHAIN_CONTEXT_POLICY = 0x8,
+ CHAIN_INTERCEPTION = 0x10,
+ CHAIN_PROCESS_START = 0x20,
+ CHAIN_THREAD_START = 0x40,
+ CHAIN_ENTER_MANAGED = 0x80,
+ CHAIN_ENTER_UNMANAGED = 0x100,
+ CHAIN_DEBUGGER_EVAL = 0x200,
+ CHAIN_CONTEXT_SWITCH = 0x400,
+ CHAIN_FUNC_EVAL = 0x800
+ } CorDebugChainReason;
EXTERN_C const IID IID_ICorDebugChain;
@@ -9956,7 +10176,7 @@ EXTERN_C const IID IID_ICorDebugChain;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugChainVtbl
{
@@ -10036,61 +10256,61 @@ EXTERN_C const IID IID_ICorDebugChain;
#ifdef COBJMACROS
-#define ICorDebugChain_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugChain_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugChain_AddRef(This) \
+#define ICorDebugChain_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugChain_Release(This) \
+#define ICorDebugChain_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugChain_GetThread(This,ppThread) \
+#define ICorDebugChain_GetThread(This,ppThread) \
( (This)->lpVtbl -> GetThread(This,ppThread) )
-#define ICorDebugChain_GetStackRange(This,pStart,pEnd) \
+#define ICorDebugChain_GetStackRange(This,pStart,pEnd) \
( (This)->lpVtbl -> GetStackRange(This,pStart,pEnd) )
-#define ICorDebugChain_GetContext(This,ppContext) \
+#define ICorDebugChain_GetContext(This,ppContext) \
( (This)->lpVtbl -> GetContext(This,ppContext) )
-#define ICorDebugChain_GetCaller(This,ppChain) \
+#define ICorDebugChain_GetCaller(This,ppChain) \
( (This)->lpVtbl -> GetCaller(This,ppChain) )
-#define ICorDebugChain_GetCallee(This,ppChain) \
+#define ICorDebugChain_GetCallee(This,ppChain) \
( (This)->lpVtbl -> GetCallee(This,ppChain) )
-#define ICorDebugChain_GetPrevious(This,ppChain) \
+#define ICorDebugChain_GetPrevious(This,ppChain) \
( (This)->lpVtbl -> GetPrevious(This,ppChain) )
-#define ICorDebugChain_GetNext(This,ppChain) \
+#define ICorDebugChain_GetNext(This,ppChain) \
( (This)->lpVtbl -> GetNext(This,ppChain) )
-#define ICorDebugChain_IsManaged(This,pManaged) \
+#define ICorDebugChain_IsManaged(This,pManaged) \
( (This)->lpVtbl -> IsManaged(This,pManaged) )
-#define ICorDebugChain_EnumerateFrames(This,ppFrames) \
+#define ICorDebugChain_EnumerateFrames(This,ppFrames) \
( (This)->lpVtbl -> EnumerateFrames(This,ppFrames) )
-#define ICorDebugChain_GetActiveFrame(This,ppFrame) \
+#define ICorDebugChain_GetActiveFrame(This,ppFrame) \
( (This)->lpVtbl -> GetActiveFrame(This,ppFrame) )
-#define ICorDebugChain_GetRegisterSet(This,ppRegisters) \
+#define ICorDebugChain_GetRegisterSet(This,ppRegisters) \
( (This)->lpVtbl -> GetRegisterSet(This,ppRegisters) )
-#define ICorDebugChain_GetReason(This,pReason) \
+#define ICorDebugChain_GetReason(This,pReason) \
( (This)->lpVtbl -> GetReason(This,pReason) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugChain_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugChain_INTERFACE_DEFINED__ */
#ifndef __ICorDebugFrame_INTERFACE_DEFINED__
@@ -10136,7 +10356,7 @@ EXTERN_C const IID IID_ICorDebugFrame;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugFrameVtbl
{
@@ -10200,49 +10420,49 @@ EXTERN_C const IID IID_ICorDebugFrame;
#ifdef COBJMACROS
-#define ICorDebugFrame_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugFrame_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugFrame_AddRef(This) \
+#define ICorDebugFrame_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugFrame_Release(This) \
+#define ICorDebugFrame_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugFrame_GetChain(This,ppChain) \
+#define ICorDebugFrame_GetChain(This,ppChain) \
( (This)->lpVtbl -> GetChain(This,ppChain) )
-#define ICorDebugFrame_GetCode(This,ppCode) \
+#define ICorDebugFrame_GetCode(This,ppCode) \
( (This)->lpVtbl -> GetCode(This,ppCode) )
-#define ICorDebugFrame_GetFunction(This,ppFunction) \
+#define ICorDebugFrame_GetFunction(This,ppFunction) \
( (This)->lpVtbl -> GetFunction(This,ppFunction) )
-#define ICorDebugFrame_GetFunctionToken(This,pToken) \
+#define ICorDebugFrame_GetFunctionToken(This,pToken) \
( (This)->lpVtbl -> GetFunctionToken(This,pToken) )
-#define ICorDebugFrame_GetStackRange(This,pStart,pEnd) \
+#define ICorDebugFrame_GetStackRange(This,pStart,pEnd) \
( (This)->lpVtbl -> GetStackRange(This,pStart,pEnd) )
-#define ICorDebugFrame_GetCaller(This,ppFrame) \
+#define ICorDebugFrame_GetCaller(This,ppFrame) \
( (This)->lpVtbl -> GetCaller(This,ppFrame) )
-#define ICorDebugFrame_GetCallee(This,ppFrame) \
+#define ICorDebugFrame_GetCallee(This,ppFrame) \
( (This)->lpVtbl -> GetCallee(This,ppFrame) )
-#define ICorDebugFrame_CreateStepper(This,ppStepper) \
+#define ICorDebugFrame_CreateStepper(This,ppStepper) \
( (This)->lpVtbl -> CreateStepper(This,ppStepper) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugFrame_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugFrame_INTERFACE_DEFINED__ */
#ifndef __ICorDebugInternalFrame_INTERFACE_DEFINED__
@@ -10254,18 +10474,18 @@ EXTERN_C const IID IID_ICorDebugFrame;
typedef
enum CorDebugInternalFrameType
{
- STUBFRAME_NONE = 0,
- STUBFRAME_M2U = 0x1,
- STUBFRAME_U2M = 0x2,
- STUBFRAME_APPDOMAIN_TRANSITION = 0x3,
- STUBFRAME_LIGHTWEIGHT_FUNCTION = 0x4,
- STUBFRAME_FUNC_EVAL = 0x5,
- STUBFRAME_INTERNALCALL = 0x6,
- STUBFRAME_CLASS_INIT = 0x7,
- STUBFRAME_EXCEPTION = 0x8,
- STUBFRAME_SECURITY = 0x9,
- STUBFRAME_JIT_COMPILATION = 0xa
- } CorDebugInternalFrameType;
+ STUBFRAME_NONE = 0,
+ STUBFRAME_M2U = 0x1,
+ STUBFRAME_U2M = 0x2,
+ STUBFRAME_APPDOMAIN_TRANSITION = 0x3,
+ STUBFRAME_LIGHTWEIGHT_FUNCTION = 0x4,
+ STUBFRAME_FUNC_EVAL = 0x5,
+ STUBFRAME_INTERNALCALL = 0x6,
+ STUBFRAME_CLASS_INIT = 0x7,
+ STUBFRAME_EXCEPTION = 0x8,
+ STUBFRAME_SECURITY = 0x9,
+ STUBFRAME_JIT_COMPILATION = 0xa
+ } CorDebugInternalFrameType;
EXTERN_C const IID IID_ICorDebugInternalFrame;
@@ -10282,7 +10502,7 @@ EXTERN_C const IID IID_ICorDebugInternalFrame;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugInternalFrameVtbl
{
@@ -10350,53 +10570,53 @@ EXTERN_C const IID IID_ICorDebugInternalFrame;
#ifdef COBJMACROS
-#define ICorDebugInternalFrame_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugInternalFrame_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugInternalFrame_AddRef(This) \
+#define ICorDebugInternalFrame_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugInternalFrame_Release(This) \
+#define ICorDebugInternalFrame_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugInternalFrame_GetChain(This,ppChain) \
+#define ICorDebugInternalFrame_GetChain(This,ppChain) \
( (This)->lpVtbl -> GetChain(This,ppChain) )
-#define ICorDebugInternalFrame_GetCode(This,ppCode) \
+#define ICorDebugInternalFrame_GetCode(This,ppCode) \
( (This)->lpVtbl -> GetCode(This,ppCode) )
-#define ICorDebugInternalFrame_GetFunction(This,ppFunction) \
+#define ICorDebugInternalFrame_GetFunction(This,ppFunction) \
( (This)->lpVtbl -> GetFunction(This,ppFunction) )
-#define ICorDebugInternalFrame_GetFunctionToken(This,pToken) \
+#define ICorDebugInternalFrame_GetFunctionToken(This,pToken) \
( (This)->lpVtbl -> GetFunctionToken(This,pToken) )
-#define ICorDebugInternalFrame_GetStackRange(This,pStart,pEnd) \
+#define ICorDebugInternalFrame_GetStackRange(This,pStart,pEnd) \
( (This)->lpVtbl -> GetStackRange(This,pStart,pEnd) )
-#define ICorDebugInternalFrame_GetCaller(This,ppFrame) \
+#define ICorDebugInternalFrame_GetCaller(This,ppFrame) \
( (This)->lpVtbl -> GetCaller(This,ppFrame) )
-#define ICorDebugInternalFrame_GetCallee(This,ppFrame) \
+#define ICorDebugInternalFrame_GetCallee(This,ppFrame) \
( (This)->lpVtbl -> GetCallee(This,ppFrame) )
-#define ICorDebugInternalFrame_CreateStepper(This,ppStepper) \
+#define ICorDebugInternalFrame_CreateStepper(This,ppStepper) \
( (This)->lpVtbl -> CreateStepper(This,ppStepper) )
-#define ICorDebugInternalFrame_GetFrameType(This,pType) \
+#define ICorDebugInternalFrame_GetFrameType(This,pType) \
( (This)->lpVtbl -> GetFrameType(This,pType) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugInternalFrame_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugInternalFrame_INTERFACE_DEFINED__ */
#ifndef __ICorDebugInternalFrame2_INTERFACE_DEFINED__
@@ -10424,7 +10644,7 @@ EXTERN_C const IID IID_ICorDebugInternalFrame2;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugInternalFrame2Vtbl
{
@@ -10464,31 +10684,31 @@ EXTERN_C const IID IID_ICorDebugInternalFrame2;
#ifdef COBJMACROS
-#define ICorDebugInternalFrame2_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugInternalFrame2_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugInternalFrame2_AddRef(This) \
+#define ICorDebugInternalFrame2_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugInternalFrame2_Release(This) \
+#define ICorDebugInternalFrame2_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugInternalFrame2_GetAddress(This,pAddress) \
+#define ICorDebugInternalFrame2_GetAddress(This,pAddress) \
( (This)->lpVtbl -> GetAddress(This,pAddress) )
-#define ICorDebugInternalFrame2_IsCloserToLeaf(This,pFrameToCompare,pIsCloser) \
+#define ICorDebugInternalFrame2_IsCloserToLeaf(This,pFrameToCompare,pIsCloser) \
( (This)->lpVtbl -> IsCloserToLeaf(This,pFrameToCompare,pIsCloser) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugInternalFrame2_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugInternalFrame2_INTERFACE_DEFINED__ */
#ifndef __ICorDebugILFrame_INTERFACE_DEFINED__
@@ -10500,13 +10720,13 @@ EXTERN_C const IID IID_ICorDebugInternalFrame2;
typedef
enum CorDebugMappingResult
{
- MAPPING_PROLOG = 0x1,
- MAPPING_EPILOG = 0x2,
- MAPPING_NO_INFO = 0x4,
- MAPPING_UNMAPPED_ADDRESS = 0x8,
- MAPPING_EXACT = 0x10,
- MAPPING_APPROXIMATE = 0x20
- } CorDebugMappingResult;
+ MAPPING_PROLOG = 0x1,
+ MAPPING_EPILOG = 0x2,
+ MAPPING_NO_INFO = 0x4,
+ MAPPING_UNMAPPED_ADDRESS = 0x8,
+ MAPPING_EXACT = 0x10,
+ MAPPING_APPROXIMATE = 0x20
+ } CorDebugMappingResult;
EXTERN_C const IID IID_ICorDebugILFrame;
@@ -10551,7 +10771,7 @@ EXTERN_C const IID IID_ICorDebugILFrame;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugILFrameVtbl
{
@@ -10655,77 +10875,77 @@ EXTERN_C const IID IID_ICorDebugILFrame;
#ifdef COBJMACROS
-#define ICorDebugILFrame_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugILFrame_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugILFrame_AddRef(This) \
+#define ICorDebugILFrame_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugILFrame_Release(This) \
+#define ICorDebugILFrame_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugILFrame_GetChain(This,ppChain) \
+#define ICorDebugILFrame_GetChain(This,ppChain) \
( (This)->lpVtbl -> GetChain(This,ppChain) )
-#define ICorDebugILFrame_GetCode(This,ppCode) \
+#define ICorDebugILFrame_GetCode(This,ppCode) \
( (This)->lpVtbl -> GetCode(This,ppCode) )
-#define ICorDebugILFrame_GetFunction(This,ppFunction) \
+#define ICorDebugILFrame_GetFunction(This,ppFunction) \
( (This)->lpVtbl -> GetFunction(This,ppFunction) )
-#define ICorDebugILFrame_GetFunctionToken(This,pToken) \
+#define ICorDebugILFrame_GetFunctionToken(This,pToken) \
( (This)->lpVtbl -> GetFunctionToken(This,pToken) )
-#define ICorDebugILFrame_GetStackRange(This,pStart,pEnd) \
+#define ICorDebugILFrame_GetStackRange(This,pStart,pEnd) \
( (This)->lpVtbl -> GetStackRange(This,pStart,pEnd) )
-#define ICorDebugILFrame_GetCaller(This,ppFrame) \
+#define ICorDebugILFrame_GetCaller(This,ppFrame) \
( (This)->lpVtbl -> GetCaller(This,ppFrame) )
-#define ICorDebugILFrame_GetCallee(This,ppFrame) \
+#define ICorDebugILFrame_GetCallee(This,ppFrame) \
( (This)->lpVtbl -> GetCallee(This,ppFrame) )
-#define ICorDebugILFrame_CreateStepper(This,ppStepper) \
+#define ICorDebugILFrame_CreateStepper(This,ppStepper) \
( (This)->lpVtbl -> CreateStepper(This,ppStepper) )
-#define ICorDebugILFrame_GetIP(This,pnOffset,pMappingResult) \
+#define ICorDebugILFrame_GetIP(This,pnOffset,pMappingResult) \
( (This)->lpVtbl -> GetIP(This,pnOffset,pMappingResult) )
-#define ICorDebugILFrame_SetIP(This,nOffset) \
+#define ICorDebugILFrame_SetIP(This,nOffset) \
( (This)->lpVtbl -> SetIP(This,nOffset) )
-#define ICorDebugILFrame_EnumerateLocalVariables(This,ppValueEnum) \
+#define ICorDebugILFrame_EnumerateLocalVariables(This,ppValueEnum) \
( (This)->lpVtbl -> EnumerateLocalVariables(This,ppValueEnum) )
-#define ICorDebugILFrame_GetLocalVariable(This,dwIndex,ppValue) \
+#define ICorDebugILFrame_GetLocalVariable(This,dwIndex,ppValue) \
( (This)->lpVtbl -> GetLocalVariable(This,dwIndex,ppValue) )
-#define ICorDebugILFrame_EnumerateArguments(This,ppValueEnum) \
+#define ICorDebugILFrame_EnumerateArguments(This,ppValueEnum) \
( (This)->lpVtbl -> EnumerateArguments(This,ppValueEnum) )
-#define ICorDebugILFrame_GetArgument(This,dwIndex,ppValue) \
+#define ICorDebugILFrame_GetArgument(This,dwIndex,ppValue) \
( (This)->lpVtbl -> GetArgument(This,dwIndex,ppValue) )
-#define ICorDebugILFrame_GetStackDepth(This,pDepth) \
+#define ICorDebugILFrame_GetStackDepth(This,pDepth) \
( (This)->lpVtbl -> GetStackDepth(This,pDepth) )
-#define ICorDebugILFrame_GetStackValue(This,dwIndex,ppValue) \
+#define ICorDebugILFrame_GetStackValue(This,dwIndex,ppValue) \
( (This)->lpVtbl -> GetStackValue(This,dwIndex,ppValue) )
-#define ICorDebugILFrame_CanSetIP(This,nOffset) \
+#define ICorDebugILFrame_CanSetIP(This,nOffset) \
( (This)->lpVtbl -> CanSetIP(This,nOffset) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugILFrame_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugILFrame_INTERFACE_DEFINED__ */
#ifndef __ICorDebugILFrame2_INTERFACE_DEFINED__
@@ -10752,7 +10972,7 @@ EXTERN_C const IID IID_ICorDebugILFrame2;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugILFrame2Vtbl
{
@@ -10791,31 +11011,31 @@ EXTERN_C const IID IID_ICorDebugILFrame2;
#ifdef COBJMACROS
-#define ICorDebugILFrame2_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugILFrame2_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugILFrame2_AddRef(This) \
+#define ICorDebugILFrame2_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugILFrame2_Release(This) \
+#define ICorDebugILFrame2_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugILFrame2_RemapFunction(This,newILOffset) \
+#define ICorDebugILFrame2_RemapFunction(This,newILOffset) \
( (This)->lpVtbl -> RemapFunction(This,newILOffset) )
-#define ICorDebugILFrame2_EnumerateTypeParameters(This,ppTyParEnum) \
+#define ICorDebugILFrame2_EnumerateTypeParameters(This,ppTyParEnum) \
( (This)->lpVtbl -> EnumerateTypeParameters(This,ppTyParEnum) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugILFrame2_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugILFrame2_INTERFACE_DEFINED__ */
#ifndef __ICorDebugILFrame3_INTERFACE_DEFINED__
@@ -10840,7 +11060,7 @@ EXTERN_C const IID IID_ICorDebugILFrame3;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugILFrame3Vtbl
{
@@ -10876,44 +11096,44 @@ EXTERN_C const IID IID_ICorDebugILFrame3;
#ifdef COBJMACROS
-#define ICorDebugILFrame3_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugILFrame3_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugILFrame3_AddRef(This) \
+#define ICorDebugILFrame3_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugILFrame3_Release(This) \
+#define ICorDebugILFrame3_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugILFrame3_GetReturnValueForILOffset(This,ILoffset,ppReturnValue) \
+#define ICorDebugILFrame3_GetReturnValueForILOffset(This,ILoffset,ppReturnValue) \
( (This)->lpVtbl -> GetReturnValueForILOffset(This,ILoffset,ppReturnValue) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugILFrame3_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugILFrame3_INTERFACE_DEFINED__ */
-/* interface __MIDL_itf_cordebug_0000_0067 */
+/* interface __MIDL_itf_cordebug_0000_0069 */
/* [local] */
typedef
enum ILCodeKind
{
- ILCODE_ORIGINAL_IL = 0x1,
- ILCODE_REJIT_IL = 0x2
- } ILCodeKind;
+ ILCODE_ORIGINAL_IL = 0x1,
+ ILCODE_REJIT_IL = 0x2
+ } ILCodeKind;
-extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0067_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0067_v0_0_s_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0069_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0069_v0_0_s_ifspec;
#ifndef __ICorDebugILFrame4_INTERFACE_DEFINED__
#define __ICorDebugILFrame4_INTERFACE_DEFINED__
@@ -10946,7 +11166,7 @@ EXTERN_C const IID IID_ICorDebugILFrame4;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugILFrame4Vtbl
{
@@ -10993,34 +11213,34 @@ EXTERN_C const IID IID_ICorDebugILFrame4;
#ifdef COBJMACROS
-#define ICorDebugILFrame4_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugILFrame4_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugILFrame4_AddRef(This) \
+#define ICorDebugILFrame4_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugILFrame4_Release(This) \
+#define ICorDebugILFrame4_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugILFrame4_EnumerateLocalVariablesEx(This,flags,ppValueEnum) \
+#define ICorDebugILFrame4_EnumerateLocalVariablesEx(This,flags,ppValueEnum) \
( (This)->lpVtbl -> EnumerateLocalVariablesEx(This,flags,ppValueEnum) )
-#define ICorDebugILFrame4_GetLocalVariableEx(This,flags,dwIndex,ppValue) \
+#define ICorDebugILFrame4_GetLocalVariableEx(This,flags,dwIndex,ppValue) \
( (This)->lpVtbl -> GetLocalVariableEx(This,flags,dwIndex,ppValue) )
-#define ICorDebugILFrame4_GetCodeEx(This,flags,ppCode) \
+#define ICorDebugILFrame4_GetCodeEx(This,flags,ppCode) \
( (This)->lpVtbl -> GetCodeEx(This,flags,ppCode) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugILFrame4_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugILFrame4_INTERFACE_DEFINED__ */
#ifndef __ICorDebugNativeFrame_INTERFACE_DEFINED__
@@ -11086,7 +11306,7 @@ EXTERN_C const IID IID_ICorDebugNativeFrame;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugNativeFrameVtbl
{
@@ -11204,88 +11424,88 @@ EXTERN_C const IID IID_ICorDebugNativeFrame;
#ifdef COBJMACROS
-#define ICorDebugNativeFrame_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugNativeFrame_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugNativeFrame_AddRef(This) \
+#define ICorDebugNativeFrame_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugNativeFrame_Release(This) \
+#define ICorDebugNativeFrame_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugNativeFrame_GetChain(This,ppChain) \
+#define ICorDebugNativeFrame_GetChain(This,ppChain) \
( (This)->lpVtbl -> GetChain(This,ppChain) )
-#define ICorDebugNativeFrame_GetCode(This,ppCode) \
+#define ICorDebugNativeFrame_GetCode(This,ppCode) \
( (This)->lpVtbl -> GetCode(This,ppCode) )
-#define ICorDebugNativeFrame_GetFunction(This,ppFunction) \
+#define ICorDebugNativeFrame_GetFunction(This,ppFunction) \
( (This)->lpVtbl -> GetFunction(This,ppFunction) )
-#define ICorDebugNativeFrame_GetFunctionToken(This,pToken) \
+#define ICorDebugNativeFrame_GetFunctionToken(This,pToken) \
( (This)->lpVtbl -> GetFunctionToken(This,pToken) )
-#define ICorDebugNativeFrame_GetStackRange(This,pStart,pEnd) \
+#define ICorDebugNativeFrame_GetStackRange(This,pStart,pEnd) \
( (This)->lpVtbl -> GetStackRange(This,pStart,pEnd) )
-#define ICorDebugNativeFrame_GetCaller(This,ppFrame) \
+#define ICorDebugNativeFrame_GetCaller(This,ppFrame) \
( (This)->lpVtbl -> GetCaller(This,ppFrame) )
-#define ICorDebugNativeFrame_GetCallee(This,ppFrame) \
+#define ICorDebugNativeFrame_GetCallee(This,ppFrame) \
( (This)->lpVtbl -> GetCallee(This,ppFrame) )
-#define ICorDebugNativeFrame_CreateStepper(This,ppStepper) \
+#define ICorDebugNativeFrame_CreateStepper(This,ppStepper) \
( (This)->lpVtbl -> CreateStepper(This,ppStepper) )
-#define ICorDebugNativeFrame_GetIP(This,pnOffset) \
+#define ICorDebugNativeFrame_GetIP(This,pnOffset) \
( (This)->lpVtbl -> GetIP(This,pnOffset) )
-#define ICorDebugNativeFrame_SetIP(This,nOffset) \
+#define ICorDebugNativeFrame_SetIP(This,nOffset) \
( (This)->lpVtbl -> SetIP(This,nOffset) )
-#define ICorDebugNativeFrame_GetRegisterSet(This,ppRegisters) \
+#define ICorDebugNativeFrame_GetRegisterSet(This,ppRegisters) \
( (This)->lpVtbl -> GetRegisterSet(This,ppRegisters) )
-#define ICorDebugNativeFrame_GetLocalRegisterValue(This,reg,cbSigBlob,pvSigBlob,ppValue) \
+#define ICorDebugNativeFrame_GetLocalRegisterValue(This,reg,cbSigBlob,pvSigBlob,ppValue) \
( (This)->lpVtbl -> GetLocalRegisterValue(This,reg,cbSigBlob,pvSigBlob,ppValue) )
-#define ICorDebugNativeFrame_GetLocalDoubleRegisterValue(This,highWordReg,lowWordReg,cbSigBlob,pvSigBlob,ppValue) \
+#define ICorDebugNativeFrame_GetLocalDoubleRegisterValue(This,highWordReg,lowWordReg,cbSigBlob,pvSigBlob,ppValue) \
( (This)->lpVtbl -> GetLocalDoubleRegisterValue(This,highWordReg,lowWordReg,cbSigBlob,pvSigBlob,ppValue) )
-#define ICorDebugNativeFrame_GetLocalMemoryValue(This,address,cbSigBlob,pvSigBlob,ppValue) \
+#define ICorDebugNativeFrame_GetLocalMemoryValue(This,address,cbSigBlob,pvSigBlob,ppValue) \
( (This)->lpVtbl -> GetLocalMemoryValue(This,address,cbSigBlob,pvSigBlob,ppValue) )
-#define ICorDebugNativeFrame_GetLocalRegisterMemoryValue(This,highWordReg,lowWordAddress,cbSigBlob,pvSigBlob,ppValue) \
+#define ICorDebugNativeFrame_GetLocalRegisterMemoryValue(This,highWordReg,lowWordAddress,cbSigBlob,pvSigBlob,ppValue) \
( (This)->lpVtbl -> GetLocalRegisterMemoryValue(This,highWordReg,lowWordAddress,cbSigBlob,pvSigBlob,ppValue) )
-#define ICorDebugNativeFrame_GetLocalMemoryRegisterValue(This,highWordAddress,lowWordRegister,cbSigBlob,pvSigBlob,ppValue) \
+#define ICorDebugNativeFrame_GetLocalMemoryRegisterValue(This,highWordAddress,lowWordRegister,cbSigBlob,pvSigBlob,ppValue) \
( (This)->lpVtbl -> GetLocalMemoryRegisterValue(This,highWordAddress,lowWordRegister,cbSigBlob,pvSigBlob,ppValue) )
-#define ICorDebugNativeFrame_CanSetIP(This,nOffset) \
+#define ICorDebugNativeFrame_CanSetIP(This,nOffset) \
( (This)->lpVtbl -> CanSetIP(This,nOffset) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugNativeFrame_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugNativeFrame_INTERFACE_DEFINED__ */
-/* interface __MIDL_itf_cordebug_0000_0069 */
+/* interface __MIDL_itf_cordebug_0000_0071 */
/* [local] */
#pragma warning(push)
#pragma warning(disable:28718)
-extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0069_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0069_v0_0_s_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0071_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0071_v0_0_s_ifspec;
#ifndef __ICorDebugNativeFrame2_INTERFACE_DEFINED__
#define __ICorDebugNativeFrame2_INTERFACE_DEFINED__
@@ -11315,7 +11535,7 @@ EXTERN_C const IID IID_ICorDebugNativeFrame2;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugNativeFrame2Vtbl
{
@@ -11359,34 +11579,34 @@ EXTERN_C const IID IID_ICorDebugNativeFrame2;
#ifdef COBJMACROS
-#define ICorDebugNativeFrame2_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugNativeFrame2_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugNativeFrame2_AddRef(This) \
+#define ICorDebugNativeFrame2_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugNativeFrame2_Release(This) \
+#define ICorDebugNativeFrame2_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugNativeFrame2_IsChild(This,pIsChild) \
+#define ICorDebugNativeFrame2_IsChild(This,pIsChild) \
( (This)->lpVtbl -> IsChild(This,pIsChild) )
-#define ICorDebugNativeFrame2_IsMatchingParentFrame(This,pPotentialParentFrame,pIsParent) \
+#define ICorDebugNativeFrame2_IsMatchingParentFrame(This,pPotentialParentFrame,pIsParent) \
( (This)->lpVtbl -> IsMatchingParentFrame(This,pPotentialParentFrame,pIsParent) )
-#define ICorDebugNativeFrame2_GetStackParameterSize(This,pSize) \
+#define ICorDebugNativeFrame2_GetStackParameterSize(This,pSize) \
( (This)->lpVtbl -> GetStackParameterSize(This,pSize) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugNativeFrame2_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugNativeFrame2_INTERFACE_DEFINED__ */
#ifndef __ICorDebugModule3_INTERFACE_DEFINED__
@@ -11411,7 +11631,7 @@ EXTERN_C const IID IID_ICorDebugModule3;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugModule3Vtbl
{
@@ -11447,28 +11667,28 @@ EXTERN_C const IID IID_ICorDebugModule3;
#ifdef COBJMACROS
-#define ICorDebugModule3_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugModule3_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugModule3_AddRef(This) \
+#define ICorDebugModule3_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugModule3_Release(This) \
+#define ICorDebugModule3_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugModule3_CreateReaderForInMemorySymbols(This,riid,ppObj) \
+#define ICorDebugModule3_CreateReaderForInMemorySymbols(This,riid,ppObj) \
( (This)->lpVtbl -> CreateReaderForInMemorySymbols(This,riid,ppObj) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugModule3_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugModule3_INTERFACE_DEFINED__ */
#ifndef __ICorDebugRuntimeUnwindableFrame_INTERFACE_DEFINED__
@@ -11489,7 +11709,7 @@ EXTERN_C const IID IID_ICorDebugRuntimeUnwindableFrame;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugRuntimeUnwindableFrameVtbl
{
@@ -11553,50 +11773,50 @@ EXTERN_C const IID IID_ICorDebugRuntimeUnwindableFrame;
#ifdef COBJMACROS
-#define ICorDebugRuntimeUnwindableFrame_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugRuntimeUnwindableFrame_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugRuntimeUnwindableFrame_AddRef(This) \
+#define ICorDebugRuntimeUnwindableFrame_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugRuntimeUnwindableFrame_Release(This) \
+#define ICorDebugRuntimeUnwindableFrame_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugRuntimeUnwindableFrame_GetChain(This,ppChain) \
+#define ICorDebugRuntimeUnwindableFrame_GetChain(This,ppChain) \
( (This)->lpVtbl -> GetChain(This,ppChain) )
-#define ICorDebugRuntimeUnwindableFrame_GetCode(This,ppCode) \
+#define ICorDebugRuntimeUnwindableFrame_GetCode(This,ppCode) \
( (This)->lpVtbl -> GetCode(This,ppCode) )
-#define ICorDebugRuntimeUnwindableFrame_GetFunction(This,ppFunction) \
+#define ICorDebugRuntimeUnwindableFrame_GetFunction(This,ppFunction) \
( (This)->lpVtbl -> GetFunction(This,ppFunction) )
-#define ICorDebugRuntimeUnwindableFrame_GetFunctionToken(This,pToken) \
+#define ICorDebugRuntimeUnwindableFrame_GetFunctionToken(This,pToken) \
( (This)->lpVtbl -> GetFunctionToken(This,pToken) )
-#define ICorDebugRuntimeUnwindableFrame_GetStackRange(This,pStart,pEnd) \
+#define ICorDebugRuntimeUnwindableFrame_GetStackRange(This,pStart,pEnd) \
( (This)->lpVtbl -> GetStackRange(This,pStart,pEnd) )
-#define ICorDebugRuntimeUnwindableFrame_GetCaller(This,ppFrame) \
+#define ICorDebugRuntimeUnwindableFrame_GetCaller(This,ppFrame) \
( (This)->lpVtbl -> GetCaller(This,ppFrame) )
-#define ICorDebugRuntimeUnwindableFrame_GetCallee(This,ppFrame) \
+#define ICorDebugRuntimeUnwindableFrame_GetCallee(This,ppFrame) \
( (This)->lpVtbl -> GetCallee(This,ppFrame) )
-#define ICorDebugRuntimeUnwindableFrame_CreateStepper(This,ppStepper) \
+#define ICorDebugRuntimeUnwindableFrame_CreateStepper(This,ppStepper) \
( (This)->lpVtbl -> CreateStepper(This,ppStepper) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugRuntimeUnwindableFrame_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugRuntimeUnwindableFrame_INTERFACE_DEFINED__ */
#ifndef __ICorDebugModule_INTERFACE_DEFINED__
@@ -11676,7 +11896,7 @@ EXTERN_C const IID IID_ICorDebugModule;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugModuleVtbl
{
@@ -11783,86 +12003,86 @@ EXTERN_C const IID IID_ICorDebugModule;
#ifdef COBJMACROS
-#define ICorDebugModule_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugModule_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugModule_AddRef(This) \
+#define ICorDebugModule_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugModule_Release(This) \
+#define ICorDebugModule_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugModule_GetProcess(This,ppProcess) \
+#define ICorDebugModule_GetProcess(This,ppProcess) \
( (This)->lpVtbl -> GetProcess(This,ppProcess) )
-#define ICorDebugModule_GetBaseAddress(This,pAddress) \
+#define ICorDebugModule_GetBaseAddress(This,pAddress) \
( (This)->lpVtbl -> GetBaseAddress(This,pAddress) )
-#define ICorDebugModule_GetAssembly(This,ppAssembly) \
+#define ICorDebugModule_GetAssembly(This,ppAssembly) \
( (This)->lpVtbl -> GetAssembly(This,ppAssembly) )
-#define ICorDebugModule_GetName(This,cchName,pcchName,szName) \
+#define ICorDebugModule_GetName(This,cchName,pcchName,szName) \
( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) )
-#define ICorDebugModule_EnableJITDebugging(This,bTrackJITInfo,bAllowJitOpts) \
+#define ICorDebugModule_EnableJITDebugging(This,bTrackJITInfo,bAllowJitOpts) \
( (This)->lpVtbl -> EnableJITDebugging(This,bTrackJITInfo,bAllowJitOpts) )
-#define ICorDebugModule_EnableClassLoadCallbacks(This,bClassLoadCallbacks) \
+#define ICorDebugModule_EnableClassLoadCallbacks(This,bClassLoadCallbacks) \
( (This)->lpVtbl -> EnableClassLoadCallbacks(This,bClassLoadCallbacks) )
-#define ICorDebugModule_GetFunctionFromToken(This,methodDef,ppFunction) \
+#define ICorDebugModule_GetFunctionFromToken(This,methodDef,ppFunction) \
( (This)->lpVtbl -> GetFunctionFromToken(This,methodDef,ppFunction) )
-#define ICorDebugModule_GetFunctionFromRVA(This,rva,ppFunction) \
+#define ICorDebugModule_GetFunctionFromRVA(This,rva,ppFunction) \
( (This)->lpVtbl -> GetFunctionFromRVA(This,rva,ppFunction) )
-#define ICorDebugModule_GetClassFromToken(This,typeDef,ppClass) \
+#define ICorDebugModule_GetClassFromToken(This,typeDef,ppClass) \
( (This)->lpVtbl -> GetClassFromToken(This,typeDef,ppClass) )
-#define ICorDebugModule_CreateBreakpoint(This,ppBreakpoint) \
+#define ICorDebugModule_CreateBreakpoint(This,ppBreakpoint) \
( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) )
-#define ICorDebugModule_GetEditAndContinueSnapshot(This,ppEditAndContinueSnapshot) \
+#define ICorDebugModule_GetEditAndContinueSnapshot(This,ppEditAndContinueSnapshot) \
( (This)->lpVtbl -> GetEditAndContinueSnapshot(This,ppEditAndContinueSnapshot) )
-#define ICorDebugModule_GetMetaDataInterface(This,riid,ppObj) \
+#define ICorDebugModule_GetMetaDataInterface(This,riid,ppObj) \
( (This)->lpVtbl -> GetMetaDataInterface(This,riid,ppObj) )
-#define ICorDebugModule_GetToken(This,pToken) \
+#define ICorDebugModule_GetToken(This,pToken) \
( (This)->lpVtbl -> GetToken(This,pToken) )
-#define ICorDebugModule_IsDynamic(This,pDynamic) \
+#define ICorDebugModule_IsDynamic(This,pDynamic) \
( (This)->lpVtbl -> IsDynamic(This,pDynamic) )
-#define ICorDebugModule_GetGlobalVariableValue(This,fieldDef,ppValue) \
+#define ICorDebugModule_GetGlobalVariableValue(This,fieldDef,ppValue) \
( (This)->lpVtbl -> GetGlobalVariableValue(This,fieldDef,ppValue) )
-#define ICorDebugModule_GetSize(This,pcBytes) \
+#define ICorDebugModule_GetSize(This,pcBytes) \
( (This)->lpVtbl -> GetSize(This,pcBytes) )
-#define ICorDebugModule_IsInMemory(This,pInMemory) \
+#define ICorDebugModule_IsInMemory(This,pInMemory) \
( (This)->lpVtbl -> IsInMemory(This,pInMemory) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugModule_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugModule_INTERFACE_DEFINED__ */
-/* interface __MIDL_itf_cordebug_0000_0073 */
+/* interface __MIDL_itf_cordebug_0000_0075 */
/* [local] */
#pragma warning(pop)
-extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0073_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0073_v0_0_s_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0075_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0075_v0_0_s_ifspec;
#ifndef __ICorDebugModule2_INTERFACE_DEFINED__
#define __ICorDebugModule2_INTERFACE_DEFINED__
@@ -11903,7 +12123,7 @@ EXTERN_C const IID IID_ICorDebugModule2;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugModule2Vtbl
{
@@ -11960,40 +12180,40 @@ EXTERN_C const IID IID_ICorDebugModule2;
#ifdef COBJMACROS
-#define ICorDebugModule2_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugModule2_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugModule2_AddRef(This) \
+#define ICorDebugModule2_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugModule2_Release(This) \
+#define ICorDebugModule2_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugModule2_SetJMCStatus(This,bIsJustMyCode,cTokens,pTokens) \
+#define ICorDebugModule2_SetJMCStatus(This,bIsJustMyCode,cTokens,pTokens) \
( (This)->lpVtbl -> SetJMCStatus(This,bIsJustMyCode,cTokens,pTokens) )
-#define ICorDebugModule2_ApplyChanges(This,cbMetadata,pbMetadata,cbIL,pbIL) \
+#define ICorDebugModule2_ApplyChanges(This,cbMetadata,pbMetadata,cbIL,pbIL) \
( (This)->lpVtbl -> ApplyChanges(This,cbMetadata,pbMetadata,cbIL,pbIL) )
-#define ICorDebugModule2_SetJITCompilerFlags(This,dwFlags) \
+#define ICorDebugModule2_SetJITCompilerFlags(This,dwFlags) \
( (This)->lpVtbl -> SetJITCompilerFlags(This,dwFlags) )
-#define ICorDebugModule2_GetJITCompilerFlags(This,pdwFlags) \
+#define ICorDebugModule2_GetJITCompilerFlags(This,pdwFlags) \
( (This)->lpVtbl -> GetJITCompilerFlags(This,pdwFlags) )
-#define ICorDebugModule2_ResolveAssembly(This,tkAssemblyRef,ppAssembly) \
+#define ICorDebugModule2_ResolveAssembly(This,tkAssemblyRef,ppAssembly) \
( (This)->lpVtbl -> ResolveAssembly(This,tkAssemblyRef,ppAssembly) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugModule2_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugModule2_INTERFACE_DEFINED__ */
#ifndef __ICorDebugFunction_INTERFACE_DEFINED__
@@ -12038,7 +12258,7 @@ EXTERN_C const IID IID_ICorDebugFunction;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugFunctionVtbl
{
@@ -12101,49 +12321,49 @@ EXTERN_C const IID IID_ICorDebugFunction;
#ifdef COBJMACROS
-#define ICorDebugFunction_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugFunction_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugFunction_AddRef(This) \
+#define ICorDebugFunction_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugFunction_Release(This) \
+#define ICorDebugFunction_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugFunction_GetModule(This,ppModule) \
+#define ICorDebugFunction_GetModule(This,ppModule) \
( (This)->lpVtbl -> GetModule(This,ppModule) )
-#define ICorDebugFunction_GetClass(This,ppClass) \
+#define ICorDebugFunction_GetClass(This,ppClass) \
( (This)->lpVtbl -> GetClass(This,ppClass) )
-#define ICorDebugFunction_GetToken(This,pMethodDef) \
+#define ICorDebugFunction_GetToken(This,pMethodDef) \
( (This)->lpVtbl -> GetToken(This,pMethodDef) )
-#define ICorDebugFunction_GetILCode(This,ppCode) \
+#define ICorDebugFunction_GetILCode(This,ppCode) \
( (This)->lpVtbl -> GetILCode(This,ppCode) )
-#define ICorDebugFunction_GetNativeCode(This,ppCode) \
+#define ICorDebugFunction_GetNativeCode(This,ppCode) \
( (This)->lpVtbl -> GetNativeCode(This,ppCode) )
-#define ICorDebugFunction_CreateBreakpoint(This,ppBreakpoint) \
+#define ICorDebugFunction_CreateBreakpoint(This,ppBreakpoint) \
( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) )
-#define ICorDebugFunction_GetLocalVarSigToken(This,pmdSig) \
+#define ICorDebugFunction_GetLocalVarSigToken(This,pmdSig) \
( (This)->lpVtbl -> GetLocalVarSigToken(This,pmdSig) )
-#define ICorDebugFunction_GetCurrentVersionNumber(This,pnCurrentVersion) \
+#define ICorDebugFunction_GetCurrentVersionNumber(This,pnCurrentVersion) \
( (This)->lpVtbl -> GetCurrentVersionNumber(This,pnCurrentVersion) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugFunction_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugFunction_INTERFACE_DEFINED__ */
#ifndef __ICorDebugFunction2_INTERFACE_DEFINED__
@@ -12176,7 +12396,7 @@ EXTERN_C const IID IID_ICorDebugFunction2;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugFunction2Vtbl
{
@@ -12223,37 +12443,37 @@ EXTERN_C const IID IID_ICorDebugFunction2;
#ifdef COBJMACROS
-#define ICorDebugFunction2_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugFunction2_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugFunction2_AddRef(This) \
+#define ICorDebugFunction2_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugFunction2_Release(This) \
+#define ICorDebugFunction2_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugFunction2_SetJMCStatus(This,bIsJustMyCode) \
+#define ICorDebugFunction2_SetJMCStatus(This,bIsJustMyCode) \
( (This)->lpVtbl -> SetJMCStatus(This,bIsJustMyCode) )
-#define ICorDebugFunction2_GetJMCStatus(This,pbIsJustMyCode) \
+#define ICorDebugFunction2_GetJMCStatus(This,pbIsJustMyCode) \
( (This)->lpVtbl -> GetJMCStatus(This,pbIsJustMyCode) )
-#define ICorDebugFunction2_EnumerateNativeCode(This,ppCodeEnum) \
+#define ICorDebugFunction2_EnumerateNativeCode(This,ppCodeEnum) \
( (This)->lpVtbl -> EnumerateNativeCode(This,ppCodeEnum) )
-#define ICorDebugFunction2_GetVersionNumber(This,pnVersion) \
+#define ICorDebugFunction2_GetVersionNumber(This,pnVersion) \
( (This)->lpVtbl -> GetVersionNumber(This,pnVersion) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugFunction2_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugFunction2_INTERFACE_DEFINED__ */
#ifndef __ICorDebugFunction3_INTERFACE_DEFINED__
@@ -12277,7 +12497,7 @@ EXTERN_C const IID IID_ICorDebugFunction3;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugFunction3Vtbl
{
@@ -12312,28 +12532,28 @@ EXTERN_C const IID IID_ICorDebugFunction3;
#ifdef COBJMACROS
-#define ICorDebugFunction3_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugFunction3_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugFunction3_AddRef(This) \
+#define ICorDebugFunction3_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugFunction3_Release(This) \
+#define ICorDebugFunction3_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugFunction3_GetActiveReJitRequestILCode(This,ppReJitedILCode) \
+#define ICorDebugFunction3_GetActiveReJitRequestILCode(This,ppReJitedILCode) \
( (This)->lpVtbl -> GetActiveReJitRequestILCode(This,ppReJitedILCode) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugFunction3_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugFunction3_INTERFACE_DEFINED__ */
#ifndef __ICorDebugFunction4_INTERFACE_DEFINED__
@@ -12357,7 +12577,7 @@ EXTERN_C const IID IID_ICorDebugFunction4;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugFunction4Vtbl
{
@@ -12392,28 +12612,28 @@ EXTERN_C const IID IID_ICorDebugFunction4;
#ifdef COBJMACROS
-#define ICorDebugFunction4_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugFunction4_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugFunction4_AddRef(This) \
+#define ICorDebugFunction4_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugFunction4_Release(This) \
+#define ICorDebugFunction4_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugFunction4_CreateNativeBreakpoint(This,ppBreakpoint) \
+#define ICorDebugFunction4_CreateNativeBreakpoint(This,ppBreakpoint) \
( (This)->lpVtbl -> CreateNativeBreakpoint(This,ppBreakpoint) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugFunction4_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugFunction4_INTERFACE_DEFINED__ */
#ifndef __ICorDebugCode_INTERFACE_DEFINED__
@@ -12470,7 +12690,7 @@ EXTERN_C const IID IID_ICorDebugCode;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugCodeVtbl
{
@@ -12546,52 +12766,52 @@ EXTERN_C const IID IID_ICorDebugCode;
#ifdef COBJMACROS
-#define ICorDebugCode_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugCode_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugCode_AddRef(This) \
+#define ICorDebugCode_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugCode_Release(This) \
+#define ICorDebugCode_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugCode_IsIL(This,pbIL) \
+#define ICorDebugCode_IsIL(This,pbIL) \
( (This)->lpVtbl -> IsIL(This,pbIL) )
-#define ICorDebugCode_GetFunction(This,ppFunction) \
+#define ICorDebugCode_GetFunction(This,ppFunction) \
( (This)->lpVtbl -> GetFunction(This,ppFunction) )
-#define ICorDebugCode_GetAddress(This,pStart) \
+#define ICorDebugCode_GetAddress(This,pStart) \
( (This)->lpVtbl -> GetAddress(This,pStart) )
-#define ICorDebugCode_GetSize(This,pcBytes) \
+#define ICorDebugCode_GetSize(This,pcBytes) \
( (This)->lpVtbl -> GetSize(This,pcBytes) )
-#define ICorDebugCode_CreateBreakpoint(This,offset,ppBreakpoint) \
+#define ICorDebugCode_CreateBreakpoint(This,offset,ppBreakpoint) \
( (This)->lpVtbl -> CreateBreakpoint(This,offset,ppBreakpoint) )
-#define ICorDebugCode_GetCode(This,startOffset,endOffset,cBufferAlloc,buffer,pcBufferSize) \
+#define ICorDebugCode_GetCode(This,startOffset,endOffset,cBufferAlloc,buffer,pcBufferSize) \
( (This)->lpVtbl -> GetCode(This,startOffset,endOffset,cBufferAlloc,buffer,pcBufferSize) )
-#define ICorDebugCode_GetVersionNumber(This,nVersion) \
+#define ICorDebugCode_GetVersionNumber(This,nVersion) \
( (This)->lpVtbl -> GetVersionNumber(This,nVersion) )
-#define ICorDebugCode_GetILToNativeMapping(This,cMap,pcMap,map) \
+#define ICorDebugCode_GetILToNativeMapping(This,cMap,pcMap,map) \
( (This)->lpVtbl -> GetILToNativeMapping(This,cMap,pcMap,map) )
-#define ICorDebugCode_GetEnCRemapSequencePoints(This,cMap,pcMap,offsets) \
+#define ICorDebugCode_GetEnCRemapSequencePoints(This,cMap,pcMap,offsets) \
( (This)->lpVtbl -> GetEnCRemapSequencePoints(This,cMap,pcMap,offsets) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugCode_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugCode_INTERFACE_DEFINED__ */
#ifndef __ICorDebugCode2_INTERFACE_DEFINED__
@@ -12604,7 +12824,7 @@ typedef struct _CodeChunkInfo
{
CORDB_ADDRESS startAddr;
ULONG32 length;
- } CodeChunkInfo;
+ } CodeChunkInfo;
EXTERN_C const IID IID_ICorDebugCode2;
@@ -12626,7 +12846,7 @@ EXTERN_C const IID IID_ICorDebugCode2;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugCode2Vtbl
{
@@ -12667,31 +12887,31 @@ EXTERN_C const IID IID_ICorDebugCode2;
#ifdef COBJMACROS
-#define ICorDebugCode2_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugCode2_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugCode2_AddRef(This) \
+#define ICorDebugCode2_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugCode2_Release(This) \
+#define ICorDebugCode2_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugCode2_GetCodeChunks(This,cbufSize,pcnumChunks,chunks) \
+#define ICorDebugCode2_GetCodeChunks(This,cbufSize,pcnumChunks,chunks) \
( (This)->lpVtbl -> GetCodeChunks(This,cbufSize,pcnumChunks,chunks) )
-#define ICorDebugCode2_GetCompilerFlags(This,pdwFlags) \
+#define ICorDebugCode2_GetCompilerFlags(This,pdwFlags) \
( (This)->lpVtbl -> GetCompilerFlags(This,pdwFlags) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugCode2_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugCode2_INTERFACE_DEFINED__ */
#ifndef __ICorDebugCode3_INTERFACE_DEFINED__
@@ -12718,7 +12938,7 @@ EXTERN_C const IID IID_ICorDebugCode3;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugCode3Vtbl
{
@@ -12756,28 +12976,28 @@ EXTERN_C const IID IID_ICorDebugCode3;
#ifdef COBJMACROS
-#define ICorDebugCode3_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugCode3_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugCode3_AddRef(This) \
+#define ICorDebugCode3_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugCode3_Release(This) \
+#define ICorDebugCode3_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugCode3_GetReturnValueLiveOffset(This,ILoffset,bufferSize,pFetched,pOffsets) \
+#define ICorDebugCode3_GetReturnValueLiveOffset(This,ILoffset,bufferSize,pFetched,pOffsets) \
( (This)->lpVtbl -> GetReturnValueLiveOffset(This,ILoffset,bufferSize,pFetched,pOffsets) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugCode3_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugCode3_INTERFACE_DEFINED__ */
#ifndef __ICorDebugCode4_INTERFACE_DEFINED__
@@ -12801,7 +13021,7 @@ EXTERN_C const IID IID_ICorDebugCode4;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugCode4Vtbl
{
@@ -12836,28 +13056,28 @@ EXTERN_C const IID IID_ICorDebugCode4;
#ifdef COBJMACROS
-#define ICorDebugCode4_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugCode4_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugCode4_AddRef(This) \
+#define ICorDebugCode4_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugCode4_Release(This) \
+#define ICorDebugCode4_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugCode4_EnumerateVariableHomes(This,ppEnum) \
+#define ICorDebugCode4_EnumerateVariableHomes(This,ppEnum) \
( (This)->lpVtbl -> EnumerateVariableHomes(This,ppEnum) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugCode4_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugCode4_INTERFACE_DEFINED__ */
#ifndef __ICorDebugILCode_INTERFACE_DEFINED__
@@ -12875,7 +13095,7 @@ typedef struct _CorDebugEHClause
ULONG32 HandlerLength;
ULONG32 ClassToken;
ULONG32 FilterOffset;
- } CorDebugEHClause;
+ } CorDebugEHClause;
EXTERN_C const IID IID_ICorDebugILCode;
@@ -12894,7 +13114,7 @@ EXTERN_C const IID IID_ICorDebugILCode;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugILCodeVtbl
{
@@ -12931,28 +13151,28 @@ EXTERN_C const IID IID_ICorDebugILCode;
#ifdef COBJMACROS
-#define ICorDebugILCode_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugILCode_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugILCode_AddRef(This) \
+#define ICorDebugILCode_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugILCode_Release(This) \
+#define ICorDebugILCode_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugILCode_GetEHClauses(This,cClauses,pcClauses,clauses) \
+#define ICorDebugILCode_GetEHClauses(This,cClauses,pcClauses,clauses) \
( (This)->lpVtbl -> GetEHClauses(This,cClauses,pcClauses,clauses) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugILCode_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugILCode_INTERFACE_DEFINED__ */
#ifndef __ICorDebugILCode2_INTERFACE_DEFINED__
@@ -12981,7 +13201,7 @@ EXTERN_C const IID IID_ICorDebugILCode2;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugILCode2Vtbl
{
@@ -13022,31 +13242,31 @@ EXTERN_C const IID IID_ICorDebugILCode2;
#ifdef COBJMACROS
-#define ICorDebugILCode2_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugILCode2_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugILCode2_AddRef(This) \
+#define ICorDebugILCode2_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugILCode2_Release(This) \
+#define ICorDebugILCode2_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugILCode2_GetLocalVarSigToken(This,pmdSig) \
+#define ICorDebugILCode2_GetLocalVarSigToken(This,pmdSig) \
( (This)->lpVtbl -> GetLocalVarSigToken(This,pmdSig) )
-#define ICorDebugILCode2_GetInstrumentedILMap(This,cMap,pcMap,map) \
+#define ICorDebugILCode2_GetInstrumentedILMap(This,cMap,pcMap,map) \
( (This)->lpVtbl -> GetInstrumentedILMap(This,cMap,pcMap,map) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugILCode2_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugILCode2_INTERFACE_DEFINED__ */
#ifndef __ICorDebugClass_INTERFACE_DEFINED__
@@ -13078,7 +13298,7 @@ EXTERN_C const IID IID_ICorDebugClass;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugClassVtbl
{
@@ -13123,34 +13343,34 @@ EXTERN_C const IID IID_ICorDebugClass;
#ifdef COBJMACROS
-#define ICorDebugClass_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugClass_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugClass_AddRef(This) \
+#define ICorDebugClass_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugClass_Release(This) \
+#define ICorDebugClass_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugClass_GetModule(This,pModule) \
+#define ICorDebugClass_GetModule(This,pModule) \
( (This)->lpVtbl -> GetModule(This,pModule) )
-#define ICorDebugClass_GetToken(This,pTypeDef) \
+#define ICorDebugClass_GetToken(This,pTypeDef) \
( (This)->lpVtbl -> GetToken(This,pTypeDef) )
-#define ICorDebugClass_GetStaticFieldValue(This,fieldDef,pFrame,ppValue) \
+#define ICorDebugClass_GetStaticFieldValue(This,fieldDef,pFrame,ppValue) \
( (This)->lpVtbl -> GetStaticFieldValue(This,fieldDef,pFrame,ppValue) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugClass_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugClass_INTERFACE_DEFINED__ */
#ifndef __ICorDebugClass2_INTERFACE_DEFINED__
@@ -13180,7 +13400,7 @@ EXTERN_C const IID IID_ICorDebugClass2;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugClass2Vtbl
{
@@ -13222,31 +13442,31 @@ EXTERN_C const IID IID_ICorDebugClass2;
#ifdef COBJMACROS
-#define ICorDebugClass2_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugClass2_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugClass2_AddRef(This) \
+#define ICorDebugClass2_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugClass2_Release(This) \
+#define ICorDebugClass2_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugClass2_GetParameterizedType(This,elementType,nTypeArgs,ppTypeArgs,ppType) \
+#define ICorDebugClass2_GetParameterizedType(This,elementType,nTypeArgs,ppTypeArgs,ppType) \
( (This)->lpVtbl -> GetParameterizedType(This,elementType,nTypeArgs,ppTypeArgs,ppType) )
-#define ICorDebugClass2_SetJMCStatus(This,bIsJustMyCode) \
+#define ICorDebugClass2_SetJMCStatus(This,bIsJustMyCode) \
( (This)->lpVtbl -> SetJMCStatus(This,bIsJustMyCode) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugClass2_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugClass2_INTERFACE_DEFINED__ */
#ifndef __ICorDebugEval_INTERFACE_DEFINED__
@@ -13306,7 +13526,7 @@ EXTERN_C const IID IID_ICorDebugEval;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugEvalVtbl
{
@@ -13386,55 +13606,55 @@ EXTERN_C const IID IID_ICorDebugEval;
#ifdef COBJMACROS
-#define ICorDebugEval_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugEval_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugEval_AddRef(This) \
+#define ICorDebugEval_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugEval_Release(This) \
+#define ICorDebugEval_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugEval_CallFunction(This,pFunction,nArgs,ppArgs) \
+#define ICorDebugEval_CallFunction(This,pFunction,nArgs,ppArgs) \
( (This)->lpVtbl -> CallFunction(This,pFunction,nArgs,ppArgs) )
-#define ICorDebugEval_NewObject(This,pConstructor,nArgs,ppArgs) \
+#define ICorDebugEval_NewObject(This,pConstructor,nArgs,ppArgs) \
( (This)->lpVtbl -> NewObject(This,pConstructor,nArgs,ppArgs) )
-#define ICorDebugEval_NewObjectNoConstructor(This,pClass) \
+#define ICorDebugEval_NewObjectNoConstructor(This,pClass) \
( (This)->lpVtbl -> NewObjectNoConstructor(This,pClass) )
-#define ICorDebugEval_NewString(This,string) \
+#define ICorDebugEval_NewString(This,string) \
( (This)->lpVtbl -> NewString(This,string) )
-#define ICorDebugEval_NewArray(This,elementType,pElementClass,rank,dims,lowBounds) \
+#define ICorDebugEval_NewArray(This,elementType,pElementClass,rank,dims,lowBounds) \
( (This)->lpVtbl -> NewArray(This,elementType,pElementClass,rank,dims,lowBounds) )
-#define ICorDebugEval_IsActive(This,pbActive) \
+#define ICorDebugEval_IsActive(This,pbActive) \
( (This)->lpVtbl -> IsActive(This,pbActive) )
-#define ICorDebugEval_Abort(This) \
+#define ICorDebugEval_Abort(This) \
( (This)->lpVtbl -> Abort(This) )
-#define ICorDebugEval_GetResult(This,ppResult) \
+#define ICorDebugEval_GetResult(This,ppResult) \
( (This)->lpVtbl -> GetResult(This,ppResult) )
-#define ICorDebugEval_GetThread(This,ppThread) \
+#define ICorDebugEval_GetThread(This,ppThread) \
( (This)->lpVtbl -> GetThread(This,ppThread) )
-#define ICorDebugEval_CreateValue(This,elementType,pElementClass,ppValue) \
+#define ICorDebugEval_CreateValue(This,elementType,pElementClass,ppValue) \
( (This)->lpVtbl -> CreateValue(This,elementType,pElementClass,ppValue) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugEval_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugEval_INTERFACE_DEFINED__ */
#ifndef __ICorDebugEval2_INTERFACE_DEFINED__
@@ -13490,7 +13710,7 @@ EXTERN_C const IID IID_ICorDebugEval2;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugEval2Vtbl
{
@@ -13563,46 +13783,46 @@ EXTERN_C const IID IID_ICorDebugEval2;
#ifdef COBJMACROS
-#define ICorDebugEval2_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugEval2_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugEval2_AddRef(This) \
+#define ICorDebugEval2_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugEval2_Release(This) \
+#define ICorDebugEval2_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugEval2_CallParameterizedFunction(This,pFunction,nTypeArgs,ppTypeArgs,nArgs,ppArgs) \
+#define ICorDebugEval2_CallParameterizedFunction(This,pFunction,nTypeArgs,ppTypeArgs,nArgs,ppArgs) \
( (This)->lpVtbl -> CallParameterizedFunction(This,pFunction,nTypeArgs,ppTypeArgs,nArgs,ppArgs) )
-#define ICorDebugEval2_CreateValueForType(This,pType,ppValue) \
+#define ICorDebugEval2_CreateValueForType(This,pType,ppValue) \
( (This)->lpVtbl -> CreateValueForType(This,pType,ppValue) )
-#define ICorDebugEval2_NewParameterizedObject(This,pConstructor,nTypeArgs,ppTypeArgs,nArgs,ppArgs) \
+#define ICorDebugEval2_NewParameterizedObject(This,pConstructor,nTypeArgs,ppTypeArgs,nArgs,ppArgs) \
( (This)->lpVtbl -> NewParameterizedObject(This,pConstructor,nTypeArgs,ppTypeArgs,nArgs,ppArgs) )
-#define ICorDebugEval2_NewParameterizedObjectNoConstructor(This,pClass,nTypeArgs,ppTypeArgs) \
+#define ICorDebugEval2_NewParameterizedObjectNoConstructor(This,pClass,nTypeArgs,ppTypeArgs) \
( (This)->lpVtbl -> NewParameterizedObjectNoConstructor(This,pClass,nTypeArgs,ppTypeArgs) )
-#define ICorDebugEval2_NewParameterizedArray(This,pElementType,rank,dims,lowBounds) \
+#define ICorDebugEval2_NewParameterizedArray(This,pElementType,rank,dims,lowBounds) \
( (This)->lpVtbl -> NewParameterizedArray(This,pElementType,rank,dims,lowBounds) )
-#define ICorDebugEval2_NewStringWithLength(This,string,uiLength) \
+#define ICorDebugEval2_NewStringWithLength(This,string,uiLength) \
( (This)->lpVtbl -> NewStringWithLength(This,string,uiLength) )
-#define ICorDebugEval2_RudeAbort(This) \
+#define ICorDebugEval2_RudeAbort(This) \
( (This)->lpVtbl -> RudeAbort(This) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugEval2_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugEval2_INTERFACE_DEFINED__ */
#ifndef __ICorDebugValue_INTERFACE_DEFINED__
@@ -13635,7 +13855,7 @@ EXTERN_C const IID IID_ICorDebugValue;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugValueVtbl
{
@@ -13682,37 +13902,37 @@ EXTERN_C const IID IID_ICorDebugValue;
#ifdef COBJMACROS
-#define ICorDebugValue_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugValue_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugValue_AddRef(This) \
+#define ICorDebugValue_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugValue_Release(This) \
+#define ICorDebugValue_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugValue_GetType(This,pType) \
+#define ICorDebugValue_GetType(This,pType) \
( (This)->lpVtbl -> GetType(This,pType) )
-#define ICorDebugValue_GetSize(This,pSize) \
+#define ICorDebugValue_GetSize(This,pSize) \
( (This)->lpVtbl -> GetSize(This,pSize) )
-#define ICorDebugValue_GetAddress(This,pAddress) \
+#define ICorDebugValue_GetAddress(This,pAddress) \
( (This)->lpVtbl -> GetAddress(This,pAddress) )
-#define ICorDebugValue_CreateBreakpoint(This,ppBreakpoint) \
+#define ICorDebugValue_CreateBreakpoint(This,ppBreakpoint) \
( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugValue_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugValue_INTERFACE_DEFINED__ */
#ifndef __ICorDebugValue2_INTERFACE_DEFINED__
@@ -13736,7 +13956,7 @@ EXTERN_C const IID IID_ICorDebugValue2;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugValue2Vtbl
{
@@ -13771,28 +13991,28 @@ EXTERN_C const IID IID_ICorDebugValue2;
#ifdef COBJMACROS
-#define ICorDebugValue2_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugValue2_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugValue2_AddRef(This) \
+#define ICorDebugValue2_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugValue2_Release(This) \
+#define ICorDebugValue2_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugValue2_GetExactType(This,ppType) \
+#define ICorDebugValue2_GetExactType(This,ppType) \
( (This)->lpVtbl -> GetExactType(This,ppType) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugValue2_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugValue2_INTERFACE_DEFINED__ */
#ifndef __ICorDebugValue3_INTERFACE_DEFINED__
@@ -13816,7 +14036,7 @@ EXTERN_C const IID IID_ICorDebugValue3;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugValue3Vtbl
{
@@ -13851,28 +14071,28 @@ EXTERN_C const IID IID_ICorDebugValue3;
#ifdef COBJMACROS
-#define ICorDebugValue3_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugValue3_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugValue3_AddRef(This) \
+#define ICorDebugValue3_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugValue3_Release(This) \
+#define ICorDebugValue3_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugValue3_GetSize64(This,pSize) \
+#define ICorDebugValue3_GetSize64(This,pSize) \
( (This)->lpVtbl -> GetSize64(This,pSize) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugValue3_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugValue3_INTERFACE_DEFINED__ */
#ifndef __ICorDebugGenericValue_INTERFACE_DEFINED__
@@ -13899,7 +14119,7 @@ EXTERN_C const IID IID_ICorDebugGenericValue;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugGenericValueVtbl
{
@@ -13954,44 +14174,44 @@ EXTERN_C const IID IID_ICorDebugGenericValue;
#ifdef COBJMACROS
-#define ICorDebugGenericValue_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugGenericValue_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugGenericValue_AddRef(This) \
+#define ICorDebugGenericValue_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugGenericValue_Release(This) \
+#define ICorDebugGenericValue_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugGenericValue_GetType(This,pType) \
+#define ICorDebugGenericValue_GetType(This,pType) \
( (This)->lpVtbl -> GetType(This,pType) )
-#define ICorDebugGenericValue_GetSize(This,pSize) \
+#define ICorDebugGenericValue_GetSize(This,pSize) \
( (This)->lpVtbl -> GetSize(This,pSize) )
-#define ICorDebugGenericValue_GetAddress(This,pAddress) \
+#define ICorDebugGenericValue_GetAddress(This,pAddress) \
( (This)->lpVtbl -> GetAddress(This,pAddress) )
-#define ICorDebugGenericValue_CreateBreakpoint(This,ppBreakpoint) \
+#define ICorDebugGenericValue_CreateBreakpoint(This,ppBreakpoint) \
( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) )
-#define ICorDebugGenericValue_GetValue(This,pTo) \
+#define ICorDebugGenericValue_GetValue(This,pTo) \
( (This)->lpVtbl -> GetValue(This,pTo) )
-#define ICorDebugGenericValue_SetValue(This,pFrom) \
+#define ICorDebugGenericValue_SetValue(This,pFrom) \
( (This)->lpVtbl -> SetValue(This,pFrom) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugGenericValue_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugGenericValue_INTERFACE_DEFINED__ */
#ifndef __ICorDebugReferenceValue_INTERFACE_DEFINED__
@@ -14027,7 +14247,7 @@ EXTERN_C const IID IID_ICorDebugReferenceValue;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugReferenceValueVtbl
{
@@ -14094,53 +14314,53 @@ EXTERN_C const IID IID_ICorDebugReferenceValue;
#ifdef COBJMACROS
-#define ICorDebugReferenceValue_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugReferenceValue_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugReferenceValue_AddRef(This) \
+#define ICorDebugReferenceValue_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugReferenceValue_Release(This) \
+#define ICorDebugReferenceValue_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugReferenceValue_GetType(This,pType) \
+#define ICorDebugReferenceValue_GetType(This,pType) \
( (This)->lpVtbl -> GetType(This,pType) )
-#define ICorDebugReferenceValue_GetSize(This,pSize) \
+#define ICorDebugReferenceValue_GetSize(This,pSize) \
( (This)->lpVtbl -> GetSize(This,pSize) )
-#define ICorDebugReferenceValue_GetAddress(This,pAddress) \
+#define ICorDebugReferenceValue_GetAddress(This,pAddress) \
( (This)->lpVtbl -> GetAddress(This,pAddress) )
-#define ICorDebugReferenceValue_CreateBreakpoint(This,ppBreakpoint) \
+#define ICorDebugReferenceValue_CreateBreakpoint(This,ppBreakpoint) \
( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) )
-#define ICorDebugReferenceValue_IsNull(This,pbNull) \
+#define ICorDebugReferenceValue_IsNull(This,pbNull) \
( (This)->lpVtbl -> IsNull(This,pbNull) )
-#define ICorDebugReferenceValue_GetValue(This,pValue) \
+#define ICorDebugReferenceValue_GetValue(This,pValue) \
( (This)->lpVtbl -> GetValue(This,pValue) )
-#define ICorDebugReferenceValue_SetValue(This,value) \
+#define ICorDebugReferenceValue_SetValue(This,value) \
( (This)->lpVtbl -> SetValue(This,value) )
-#define ICorDebugReferenceValue_Dereference(This,ppValue) \
+#define ICorDebugReferenceValue_Dereference(This,ppValue) \
( (This)->lpVtbl -> Dereference(This,ppValue) )
-#define ICorDebugReferenceValue_DereferenceStrong(This,ppValue) \
+#define ICorDebugReferenceValue_DereferenceStrong(This,ppValue) \
( (This)->lpVtbl -> DereferenceStrong(This,ppValue) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugReferenceValue_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugReferenceValue_INTERFACE_DEFINED__ */
#ifndef __ICorDebugHeapValue_INTERFACE_DEFINED__
@@ -14167,7 +14387,7 @@ EXTERN_C const IID IID_ICorDebugHeapValue;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugHeapValueVtbl
{
@@ -14222,44 +14442,44 @@ EXTERN_C const IID IID_ICorDebugHeapValue;
#ifdef COBJMACROS
-#define ICorDebugHeapValue_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugHeapValue_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugHeapValue_AddRef(This) \
+#define ICorDebugHeapValue_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugHeapValue_Release(This) \
+#define ICorDebugHeapValue_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugHeapValue_GetType(This,pType) \
+#define ICorDebugHeapValue_GetType(This,pType) \
( (This)->lpVtbl -> GetType(This,pType) )
-#define ICorDebugHeapValue_GetSize(This,pSize) \
+#define ICorDebugHeapValue_GetSize(This,pSize) \
( (This)->lpVtbl -> GetSize(This,pSize) )
-#define ICorDebugHeapValue_GetAddress(This,pAddress) \
+#define ICorDebugHeapValue_GetAddress(This,pAddress) \
( (This)->lpVtbl -> GetAddress(This,pAddress) )
-#define ICorDebugHeapValue_CreateBreakpoint(This,ppBreakpoint) \
+#define ICorDebugHeapValue_CreateBreakpoint(This,ppBreakpoint) \
( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) )
-#define ICorDebugHeapValue_IsValid(This,pbValid) \
+#define ICorDebugHeapValue_IsValid(This,pbValid) \
( (This)->lpVtbl -> IsValid(This,pbValid) )
-#define ICorDebugHeapValue_CreateRelocBreakpoint(This,ppBreakpoint) \
+#define ICorDebugHeapValue_CreateRelocBreakpoint(This,ppBreakpoint) \
( (This)->lpVtbl -> CreateRelocBreakpoint(This,ppBreakpoint) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugHeapValue_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugHeapValue_INTERFACE_DEFINED__ */
#ifndef __ICorDebugHeapValue2_INTERFACE_DEFINED__
@@ -14284,7 +14504,7 @@ EXTERN_C const IID IID_ICorDebugHeapValue2;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugHeapValue2Vtbl
{
@@ -14320,28 +14540,28 @@ EXTERN_C const IID IID_ICorDebugHeapValue2;
#ifdef COBJMACROS
-#define ICorDebugHeapValue2_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugHeapValue2_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugHeapValue2_AddRef(This) \
+#define ICorDebugHeapValue2_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugHeapValue2_Release(This) \
+#define ICorDebugHeapValue2_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugHeapValue2_CreateHandle(This,type,ppHandle) \
+#define ICorDebugHeapValue2_CreateHandle(This,type,ppHandle) \
( (This)->lpVtbl -> CreateHandle(This,type,ppHandle) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugHeapValue2_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugHeapValue2_INTERFACE_DEFINED__ */
#ifndef __ICorDebugHeapValue3_INTERFACE_DEFINED__
@@ -14369,7 +14589,7 @@ EXTERN_C const IID IID_ICorDebugHeapValue3;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugHeapValue3Vtbl
{
@@ -14409,31 +14629,31 @@ EXTERN_C const IID IID_ICorDebugHeapValue3;
#ifdef COBJMACROS
-#define ICorDebugHeapValue3_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugHeapValue3_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugHeapValue3_AddRef(This) \
+#define ICorDebugHeapValue3_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugHeapValue3_Release(This) \
+#define ICorDebugHeapValue3_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugHeapValue3_GetThreadOwningMonitorLock(This,ppThread,pAcquisitionCount) \
+#define ICorDebugHeapValue3_GetThreadOwningMonitorLock(This,ppThread,pAcquisitionCount) \
( (This)->lpVtbl -> GetThreadOwningMonitorLock(This,ppThread,pAcquisitionCount) )
-#define ICorDebugHeapValue3_GetMonitorEventWaitList(This,ppThreadEnum) \
+#define ICorDebugHeapValue3_GetMonitorEventWaitList(This,ppThreadEnum) \
( (This)->lpVtbl -> GetMonitorEventWaitList(This,ppThreadEnum) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugHeapValue3_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugHeapValue3_INTERFACE_DEFINED__ */
#ifndef __ICorDebugObjectValue_INTERFACE_DEFINED__
@@ -14478,7 +14698,7 @@ EXTERN_C const IID IID_ICorDebugObjectValue;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugObjectValueVtbl
{
@@ -14556,59 +14776,59 @@ EXTERN_C const IID IID_ICorDebugObjectValue;
#ifdef COBJMACROS
-#define ICorDebugObjectValue_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugObjectValue_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugObjectValue_AddRef(This) \
+#define ICorDebugObjectValue_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugObjectValue_Release(This) \
+#define ICorDebugObjectValue_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugObjectValue_GetType(This,pType) \
+#define ICorDebugObjectValue_GetType(This,pType) \
( (This)->lpVtbl -> GetType(This,pType) )
-#define ICorDebugObjectValue_GetSize(This,pSize) \
+#define ICorDebugObjectValue_GetSize(This,pSize) \
( (This)->lpVtbl -> GetSize(This,pSize) )
-#define ICorDebugObjectValue_GetAddress(This,pAddress) \
+#define ICorDebugObjectValue_GetAddress(This,pAddress) \
( (This)->lpVtbl -> GetAddress(This,pAddress) )
-#define ICorDebugObjectValue_CreateBreakpoint(This,ppBreakpoint) \
+#define ICorDebugObjectValue_CreateBreakpoint(This,ppBreakpoint) \
( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) )
-#define ICorDebugObjectValue_GetClass(This,ppClass) \
+#define ICorDebugObjectValue_GetClass(This,ppClass) \
( (This)->lpVtbl -> GetClass(This,ppClass) )
-#define ICorDebugObjectValue_GetFieldValue(This,pClass,fieldDef,ppValue) \
+#define ICorDebugObjectValue_GetFieldValue(This,pClass,fieldDef,ppValue) \
( (This)->lpVtbl -> GetFieldValue(This,pClass,fieldDef,ppValue) )
-#define ICorDebugObjectValue_GetVirtualMethod(This,memberRef,ppFunction) \
+#define ICorDebugObjectValue_GetVirtualMethod(This,memberRef,ppFunction) \
( (This)->lpVtbl -> GetVirtualMethod(This,memberRef,ppFunction) )
-#define ICorDebugObjectValue_GetContext(This,ppContext) \
+#define ICorDebugObjectValue_GetContext(This,ppContext) \
( (This)->lpVtbl -> GetContext(This,ppContext) )
-#define ICorDebugObjectValue_IsValueClass(This,pbIsValueClass) \
+#define ICorDebugObjectValue_IsValueClass(This,pbIsValueClass) \
( (This)->lpVtbl -> IsValueClass(This,pbIsValueClass) )
-#define ICorDebugObjectValue_GetManagedCopy(This,ppObject) \
+#define ICorDebugObjectValue_GetManagedCopy(This,ppObject) \
( (This)->lpVtbl -> GetManagedCopy(This,ppObject) )
-#define ICorDebugObjectValue_SetFromManagedCopy(This,pObject) \
+#define ICorDebugObjectValue_SetFromManagedCopy(This,pObject) \
( (This)->lpVtbl -> SetFromManagedCopy(This,pObject) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugObjectValue_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugObjectValue_INTERFACE_DEFINED__ */
#ifndef __ICorDebugObjectValue2_INTERFACE_DEFINED__
@@ -14634,7 +14854,7 @@ EXTERN_C const IID IID_ICorDebugObjectValue2;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugObjectValue2Vtbl
{
@@ -14671,28 +14891,28 @@ EXTERN_C const IID IID_ICorDebugObjectValue2;
#ifdef COBJMACROS
-#define ICorDebugObjectValue2_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugObjectValue2_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugObjectValue2_AddRef(This) \
+#define ICorDebugObjectValue2_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugObjectValue2_Release(This) \
+#define ICorDebugObjectValue2_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugObjectValue2_GetVirtualMethodAndType(This,memberRef,ppFunction,ppType) \
+#define ICorDebugObjectValue2_GetVirtualMethodAndType(This,memberRef,ppFunction,ppType) \
( (This)->lpVtbl -> GetVirtualMethodAndType(This,memberRef,ppFunction,ppType) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugObjectValue2_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugObjectValue2_INTERFACE_DEFINED__ */
#ifndef __ICorDebugDelegateObjectValue_INTERFACE_DEFINED__
@@ -14719,7 +14939,7 @@ EXTERN_C const IID IID_ICorDebugDelegateObjectValue;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugDelegateObjectValueVtbl
{
@@ -14758,31 +14978,31 @@ EXTERN_C const IID IID_ICorDebugDelegateObjectValue;
#ifdef COBJMACROS
-#define ICorDebugDelegateObjectValue_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugDelegateObjectValue_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugDelegateObjectValue_AddRef(This) \
+#define ICorDebugDelegateObjectValue_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugDelegateObjectValue_Release(This) \
+#define ICorDebugDelegateObjectValue_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugDelegateObjectValue_GetTarget(This,ppObject) \
+#define ICorDebugDelegateObjectValue_GetTarget(This,ppObject) \
( (This)->lpVtbl -> GetTarget(This,ppObject) )
-#define ICorDebugDelegateObjectValue_GetFunction(This,ppFunction) \
+#define ICorDebugDelegateObjectValue_GetFunction(This,ppFunction) \
( (This)->lpVtbl -> GetFunction(This,ppFunction) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugDelegateObjectValue_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugDelegateObjectValue_INTERFACE_DEFINED__ */
#ifndef __ICorDebugBoxValue_INTERFACE_DEFINED__
@@ -14806,7 +15026,7 @@ EXTERN_C const IID IID_ICorDebugBoxValue;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugBoxValueVtbl
{
@@ -14865,59 +15085,59 @@ EXTERN_C const IID IID_ICorDebugBoxValue;
#ifdef COBJMACROS
-#define ICorDebugBoxValue_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugBoxValue_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugBoxValue_AddRef(This) \
+#define ICorDebugBoxValue_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugBoxValue_Release(This) \
+#define ICorDebugBoxValue_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugBoxValue_GetType(This,pType) \
+#define ICorDebugBoxValue_GetType(This,pType) \
( (This)->lpVtbl -> GetType(This,pType) )
-#define ICorDebugBoxValue_GetSize(This,pSize) \
+#define ICorDebugBoxValue_GetSize(This,pSize) \
( (This)->lpVtbl -> GetSize(This,pSize) )
-#define ICorDebugBoxValue_GetAddress(This,pAddress) \
+#define ICorDebugBoxValue_GetAddress(This,pAddress) \
( (This)->lpVtbl -> GetAddress(This,pAddress) )
-#define ICorDebugBoxValue_CreateBreakpoint(This,ppBreakpoint) \
+#define ICorDebugBoxValue_CreateBreakpoint(This,ppBreakpoint) \
( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) )
-#define ICorDebugBoxValue_IsValid(This,pbValid) \
+#define ICorDebugBoxValue_IsValid(This,pbValid) \
( (This)->lpVtbl -> IsValid(This,pbValid) )
-#define ICorDebugBoxValue_CreateRelocBreakpoint(This,ppBreakpoint) \
+#define ICorDebugBoxValue_CreateRelocBreakpoint(This,ppBreakpoint) \
( (This)->lpVtbl -> CreateRelocBreakpoint(This,ppBreakpoint) )
-#define ICorDebugBoxValue_GetObject(This,ppObject) \
+#define ICorDebugBoxValue_GetObject(This,ppObject) \
( (This)->lpVtbl -> GetObject(This,ppObject) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugBoxValue_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugBoxValue_INTERFACE_DEFINED__ */
-/* interface __MIDL_itf_cordebug_0000_0100 */
+/* interface __MIDL_itf_cordebug_0000_0102 */
/* [local] */
#pragma warning(push)
#pragma warning(disable:28718)
-extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0100_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0100_v0_0_s_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0102_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0102_v0_0_s_ifspec;
#ifndef __ICorDebugStringValue_INTERFACE_DEFINED__
#define __ICorDebugStringValue_INTERFACE_DEFINED__
@@ -14945,7 +15165,7 @@ EXTERN_C const IID IID_ICorDebugStringValue;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugStringValueVtbl
{
@@ -15010,61 +15230,61 @@ EXTERN_C const IID IID_ICorDebugStringValue;
#ifdef COBJMACROS
-#define ICorDebugStringValue_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugStringValue_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugStringValue_AddRef(This) \
+#define ICorDebugStringValue_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugStringValue_Release(This) \
+#define ICorDebugStringValue_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugStringValue_GetType(This,pType) \
+#define ICorDebugStringValue_GetType(This,pType) \
( (This)->lpVtbl -> GetType(This,pType) )
-#define ICorDebugStringValue_GetSize(This,pSize) \
+#define ICorDebugStringValue_GetSize(This,pSize) \
( (This)->lpVtbl -> GetSize(This,pSize) )
-#define ICorDebugStringValue_GetAddress(This,pAddress) \
+#define ICorDebugStringValue_GetAddress(This,pAddress) \
( (This)->lpVtbl -> GetAddress(This,pAddress) )
-#define ICorDebugStringValue_CreateBreakpoint(This,ppBreakpoint) \
+#define ICorDebugStringValue_CreateBreakpoint(This,ppBreakpoint) \
( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) )
-#define ICorDebugStringValue_IsValid(This,pbValid) \
+#define ICorDebugStringValue_IsValid(This,pbValid) \
( (This)->lpVtbl -> IsValid(This,pbValid) )
-#define ICorDebugStringValue_CreateRelocBreakpoint(This,ppBreakpoint) \
+#define ICorDebugStringValue_CreateRelocBreakpoint(This,ppBreakpoint) \
( (This)->lpVtbl -> CreateRelocBreakpoint(This,ppBreakpoint) )
-#define ICorDebugStringValue_GetLength(This,pcchString) \
+#define ICorDebugStringValue_GetLength(This,pcchString) \
( (This)->lpVtbl -> GetLength(This,pcchString) )
-#define ICorDebugStringValue_GetString(This,cchString,pcchString,szString) \
+#define ICorDebugStringValue_GetString(This,cchString,pcchString,szString) \
( (This)->lpVtbl -> GetString(This,cchString,pcchString,szString) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugStringValue_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugStringValue_INTERFACE_DEFINED__ */
-/* interface __MIDL_itf_cordebug_0000_0101 */
+/* interface __MIDL_itf_cordebug_0000_0103 */
/* [local] */
#pragma warning(pop)
-extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0101_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0101_v0_0_s_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0103_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0103_v0_0_s_ifspec;
#ifndef __ICorDebugArrayValue_INTERFACE_DEFINED__
#define __ICorDebugArrayValue_INTERFACE_DEFINED__
@@ -15113,7 +15333,7 @@ EXTERN_C const IID IID_ICorDebugArrayValue;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugArrayValueVtbl
{
@@ -15205,69 +15425,69 @@ EXTERN_C const IID IID_ICorDebugArrayValue;
#ifdef COBJMACROS
-#define ICorDebugArrayValue_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugArrayValue_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugArrayValue_AddRef(This) \
+#define ICorDebugArrayValue_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugArrayValue_Release(This) \
+#define ICorDebugArrayValue_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugArrayValue_GetType(This,pType) \
+#define ICorDebugArrayValue_GetType(This,pType) \
( (This)->lpVtbl -> GetType(This,pType) )
-#define ICorDebugArrayValue_GetSize(This,pSize) \
+#define ICorDebugArrayValue_GetSize(This,pSize) \
( (This)->lpVtbl -> GetSize(This,pSize) )
-#define ICorDebugArrayValue_GetAddress(This,pAddress) \
+#define ICorDebugArrayValue_GetAddress(This,pAddress) \
( (This)->lpVtbl -> GetAddress(This,pAddress) )
-#define ICorDebugArrayValue_CreateBreakpoint(This,ppBreakpoint) \
+#define ICorDebugArrayValue_CreateBreakpoint(This,ppBreakpoint) \
( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) )
-#define ICorDebugArrayValue_IsValid(This,pbValid) \
+#define ICorDebugArrayValue_IsValid(This,pbValid) \
( (This)->lpVtbl -> IsValid(This,pbValid) )
-#define ICorDebugArrayValue_CreateRelocBreakpoint(This,ppBreakpoint) \
+#define ICorDebugArrayValue_CreateRelocBreakpoint(This,ppBreakpoint) \
( (This)->lpVtbl -> CreateRelocBreakpoint(This,ppBreakpoint) )
-#define ICorDebugArrayValue_GetElementType(This,pType) \
+#define ICorDebugArrayValue_GetElementType(This,pType) \
( (This)->lpVtbl -> GetElementType(This,pType) )
-#define ICorDebugArrayValue_GetRank(This,pnRank) \
+#define ICorDebugArrayValue_GetRank(This,pnRank) \
( (This)->lpVtbl -> GetRank(This,pnRank) )
-#define ICorDebugArrayValue_GetCount(This,pnCount) \
+#define ICorDebugArrayValue_GetCount(This,pnCount) \
( (This)->lpVtbl -> GetCount(This,pnCount) )
-#define ICorDebugArrayValue_GetDimensions(This,cdim,dims) \
+#define ICorDebugArrayValue_GetDimensions(This,cdim,dims) \
( (This)->lpVtbl -> GetDimensions(This,cdim,dims) )
-#define ICorDebugArrayValue_HasBaseIndicies(This,pbHasBaseIndicies) \
+#define ICorDebugArrayValue_HasBaseIndicies(This,pbHasBaseIndicies) \
( (This)->lpVtbl -> HasBaseIndicies(This,pbHasBaseIndicies) )
-#define ICorDebugArrayValue_GetBaseIndicies(This,cdim,indicies) \
+#define ICorDebugArrayValue_GetBaseIndicies(This,cdim,indicies) \
( (This)->lpVtbl -> GetBaseIndicies(This,cdim,indicies) )
-#define ICorDebugArrayValue_GetElement(This,cdim,indices,ppValue) \
+#define ICorDebugArrayValue_GetElement(This,cdim,indices,ppValue) \
( (This)->lpVtbl -> GetElement(This,cdim,indices,ppValue) )
-#define ICorDebugArrayValue_GetElementAtPosition(This,nPosition,ppValue) \
+#define ICorDebugArrayValue_GetElementAtPosition(This,nPosition,ppValue) \
( (This)->lpVtbl -> GetElementAtPosition(This,nPosition,ppValue) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugArrayValue_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugArrayValue_INTERFACE_DEFINED__ */
#ifndef __ICorDebugVariableHome_INTERFACE_DEFINED__
@@ -15279,10 +15499,10 @@ EXTERN_C const IID IID_ICorDebugArrayValue;
typedef
enum VariableLocationType
{
- VLT_REGISTER = 0,
- VLT_REGISTER_RELATIVE = ( VLT_REGISTER + 1 ) ,
- VLT_INVALID = ( VLT_REGISTER_RELATIVE + 1 )
- } VariableLocationType;
+ VLT_REGISTER = 0,
+ VLT_REGISTER_RELATIVE = ( VLT_REGISTER + 1 ) ,
+ VLT_INVALID = ( VLT_REGISTER_RELATIVE + 1 )
+ } VariableLocationType;
EXTERN_C const IID IID_ICorDebugVariableHome;
@@ -15318,7 +15538,7 @@ EXTERN_C const IID IID_ICorDebugVariableHome;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugVariableHomeVtbl
{
@@ -15378,46 +15598,46 @@ EXTERN_C const IID IID_ICorDebugVariableHome;
#ifdef COBJMACROS
-#define ICorDebugVariableHome_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugVariableHome_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugVariableHome_AddRef(This) \
+#define ICorDebugVariableHome_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugVariableHome_Release(This) \
+#define ICorDebugVariableHome_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugVariableHome_GetCode(This,ppCode) \
+#define ICorDebugVariableHome_GetCode(This,ppCode) \
( (This)->lpVtbl -> GetCode(This,ppCode) )
-#define ICorDebugVariableHome_GetSlotIndex(This,pSlotIndex) \
+#define ICorDebugVariableHome_GetSlotIndex(This,pSlotIndex) \
( (This)->lpVtbl -> GetSlotIndex(This,pSlotIndex) )
-#define ICorDebugVariableHome_GetArgumentIndex(This,pArgumentIndex) \
+#define ICorDebugVariableHome_GetArgumentIndex(This,pArgumentIndex) \
( (This)->lpVtbl -> GetArgumentIndex(This,pArgumentIndex) )
-#define ICorDebugVariableHome_GetLiveRange(This,pStartOffset,pEndOffset) \
+#define ICorDebugVariableHome_GetLiveRange(This,pStartOffset,pEndOffset) \
( (This)->lpVtbl -> GetLiveRange(This,pStartOffset,pEndOffset) )
-#define ICorDebugVariableHome_GetLocationType(This,pLocationType) \
+#define ICorDebugVariableHome_GetLocationType(This,pLocationType) \
( (This)->lpVtbl -> GetLocationType(This,pLocationType) )
-#define ICorDebugVariableHome_GetRegister(This,pRegister) \
+#define ICorDebugVariableHome_GetRegister(This,pRegister) \
( (This)->lpVtbl -> GetRegister(This,pRegister) )
-#define ICorDebugVariableHome_GetOffset(This,pOffset) \
+#define ICorDebugVariableHome_GetOffset(This,pOffset) \
( (This)->lpVtbl -> GetOffset(This,pOffset) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugVariableHome_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugVariableHome_INTERFACE_DEFINED__ */
#ifndef __ICorDebugHandleValue_INTERFACE_DEFINED__
@@ -15443,7 +15663,7 @@ EXTERN_C const IID IID_ICorDebugHandleValue;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugHandleValueVtbl
{
@@ -15517,60 +15737,60 @@ EXTERN_C const IID IID_ICorDebugHandleValue;
#ifdef COBJMACROS
-#define ICorDebugHandleValue_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugHandleValue_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugHandleValue_AddRef(This) \
+#define ICorDebugHandleValue_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugHandleValue_Release(This) \
+#define ICorDebugHandleValue_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugHandleValue_GetType(This,pType) \
+#define ICorDebugHandleValue_GetType(This,pType) \
( (This)->lpVtbl -> GetType(This,pType) )
-#define ICorDebugHandleValue_GetSize(This,pSize) \
+#define ICorDebugHandleValue_GetSize(This,pSize) \
( (This)->lpVtbl -> GetSize(This,pSize) )
-#define ICorDebugHandleValue_GetAddress(This,pAddress) \
+#define ICorDebugHandleValue_GetAddress(This,pAddress) \
( (This)->lpVtbl -> GetAddress(This,pAddress) )
-#define ICorDebugHandleValue_CreateBreakpoint(This,ppBreakpoint) \
+#define ICorDebugHandleValue_CreateBreakpoint(This,ppBreakpoint) \
( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) )
-#define ICorDebugHandleValue_IsNull(This,pbNull) \
+#define ICorDebugHandleValue_IsNull(This,pbNull) \
( (This)->lpVtbl -> IsNull(This,pbNull) )
-#define ICorDebugHandleValue_GetValue(This,pValue) \
+#define ICorDebugHandleValue_GetValue(This,pValue) \
( (This)->lpVtbl -> GetValue(This,pValue) )
-#define ICorDebugHandleValue_SetValue(This,value) \
+#define ICorDebugHandleValue_SetValue(This,value) \
( (This)->lpVtbl -> SetValue(This,value) )
-#define ICorDebugHandleValue_Dereference(This,ppValue) \
+#define ICorDebugHandleValue_Dereference(This,ppValue) \
( (This)->lpVtbl -> Dereference(This,ppValue) )
-#define ICorDebugHandleValue_DereferenceStrong(This,ppValue) \
+#define ICorDebugHandleValue_DereferenceStrong(This,ppValue) \
( (This)->lpVtbl -> DereferenceStrong(This,ppValue) )
-#define ICorDebugHandleValue_GetHandleType(This,pType) \
+#define ICorDebugHandleValue_GetHandleType(This,pType) \
( (This)->lpVtbl -> GetHandleType(This,pType) )
-#define ICorDebugHandleValue_Dispose(This) \
+#define ICorDebugHandleValue_Dispose(This) \
( (This)->lpVtbl -> Dispose(This) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugHandleValue_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugHandleValue_INTERFACE_DEFINED__ */
#ifndef __ICorDebugContext_INTERFACE_DEFINED__
@@ -15591,7 +15811,7 @@ EXTERN_C const IID IID_ICorDebugContext;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugContextVtbl
{
@@ -15669,60 +15889,60 @@ EXTERN_C const IID IID_ICorDebugContext;
#ifdef COBJMACROS
-#define ICorDebugContext_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugContext_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugContext_AddRef(This) \
+#define ICorDebugContext_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugContext_Release(This) \
+#define ICorDebugContext_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugContext_GetType(This,pType) \
+#define ICorDebugContext_GetType(This,pType) \
( (This)->lpVtbl -> GetType(This,pType) )
-#define ICorDebugContext_GetSize(This,pSize) \
+#define ICorDebugContext_GetSize(This,pSize) \
( (This)->lpVtbl -> GetSize(This,pSize) )
-#define ICorDebugContext_GetAddress(This,pAddress) \
+#define ICorDebugContext_GetAddress(This,pAddress) \
( (This)->lpVtbl -> GetAddress(This,pAddress) )
-#define ICorDebugContext_CreateBreakpoint(This,ppBreakpoint) \
+#define ICorDebugContext_CreateBreakpoint(This,ppBreakpoint) \
( (This)->lpVtbl -> CreateBreakpoint(This,ppBreakpoint) )
-#define ICorDebugContext_GetClass(This,ppClass) \
+#define ICorDebugContext_GetClass(This,ppClass) \
( (This)->lpVtbl -> GetClass(This,ppClass) )
-#define ICorDebugContext_GetFieldValue(This,pClass,fieldDef,ppValue) \
+#define ICorDebugContext_GetFieldValue(This,pClass,fieldDef,ppValue) \
( (This)->lpVtbl -> GetFieldValue(This,pClass,fieldDef,ppValue) )
-#define ICorDebugContext_GetVirtualMethod(This,memberRef,ppFunction) \
+#define ICorDebugContext_GetVirtualMethod(This,memberRef,ppFunction) \
( (This)->lpVtbl -> GetVirtualMethod(This,memberRef,ppFunction) )
-#define ICorDebugContext_GetContext(This,ppContext) \
+#define ICorDebugContext_GetContext(This,ppContext) \
( (This)->lpVtbl -> GetContext(This,ppContext) )
-#define ICorDebugContext_IsValueClass(This,pbIsValueClass) \
+#define ICorDebugContext_IsValueClass(This,pbIsValueClass) \
( (This)->lpVtbl -> IsValueClass(This,pbIsValueClass) )
-#define ICorDebugContext_GetManagedCopy(This,ppObject) \
+#define ICorDebugContext_GetManagedCopy(This,ppObject) \
( (This)->lpVtbl -> GetManagedCopy(This,ppObject) )
-#define ICorDebugContext_SetFromManagedCopy(This,pObject) \
+#define ICorDebugContext_SetFromManagedCopy(This,pObject) \
( (This)->lpVtbl -> SetFromManagedCopy(This,pObject) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugContext_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugContext_INTERFACE_DEFINED__ */
#ifndef __ICorDebugComObjectValue_INTERFACE_DEFINED__
@@ -15753,7 +15973,7 @@ EXTERN_C const IID IID_ICorDebugComObjectValue;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugComObjectValueVtbl
{
@@ -15796,31 +16016,31 @@ EXTERN_C const IID IID_ICorDebugComObjectValue;
#ifdef COBJMACROS
-#define ICorDebugComObjectValue_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugComObjectValue_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugComObjectValue_AddRef(This) \
+#define ICorDebugComObjectValue_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugComObjectValue_Release(This) \
+#define ICorDebugComObjectValue_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugComObjectValue_GetCachedInterfaceTypes(This,bIInspectableOnly,ppInterfacesEnum) \
+#define ICorDebugComObjectValue_GetCachedInterfaceTypes(This,bIInspectableOnly,ppInterfacesEnum) \
( (This)->lpVtbl -> GetCachedInterfaceTypes(This,bIInspectableOnly,ppInterfacesEnum) )
-#define ICorDebugComObjectValue_GetCachedInterfacePointers(This,bIInspectableOnly,celt,pcEltFetched,ptrs) \
+#define ICorDebugComObjectValue_GetCachedInterfacePointers(This,bIInspectableOnly,celt,pcEltFetched,ptrs) \
( (This)->lpVtbl -> GetCachedInterfacePointers(This,bIInspectableOnly,celt,pcEltFetched,ptrs) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugComObjectValue_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugComObjectValue_INTERFACE_DEFINED__ */
#ifndef __ICorDebugObjectEnum_INTERFACE_DEFINED__
@@ -15846,7 +16066,7 @@ EXTERN_C const IID IID_ICorDebugObjectEnum;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugObjectEnumVtbl
{
@@ -15898,41 +16118,41 @@ EXTERN_C const IID IID_ICorDebugObjectEnum;
#ifdef COBJMACROS
-#define ICorDebugObjectEnum_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugObjectEnum_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugObjectEnum_AddRef(This) \
+#define ICorDebugObjectEnum_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugObjectEnum_Release(This) \
+#define ICorDebugObjectEnum_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugObjectEnum_Skip(This,celt) \
+#define ICorDebugObjectEnum_Skip(This,celt) \
( (This)->lpVtbl -> Skip(This,celt) )
-#define ICorDebugObjectEnum_Reset(This) \
+#define ICorDebugObjectEnum_Reset(This) \
( (This)->lpVtbl -> Reset(This) )
-#define ICorDebugObjectEnum_Clone(This,ppEnum) \
+#define ICorDebugObjectEnum_Clone(This,ppEnum) \
( (This)->lpVtbl -> Clone(This,ppEnum) )
-#define ICorDebugObjectEnum_GetCount(This,pcelt) \
+#define ICorDebugObjectEnum_GetCount(This,pcelt) \
( (This)->lpVtbl -> GetCount(This,pcelt) )
-#define ICorDebugObjectEnum_Next(This,celt,objects,pceltFetched) \
+#define ICorDebugObjectEnum_Next(This,celt,objects,pceltFetched) \
( (This)->lpVtbl -> Next(This,celt,objects,pceltFetched) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugObjectEnum_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugObjectEnum_INTERFACE_DEFINED__ */
#ifndef __ICorDebugBreakpointEnum_INTERFACE_DEFINED__
@@ -15958,7 +16178,7 @@ EXTERN_C const IID IID_ICorDebugBreakpointEnum;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugBreakpointEnumVtbl
{
@@ -16010,41 +16230,41 @@ EXTERN_C const IID IID_ICorDebugBreakpointEnum;
#ifdef COBJMACROS
-#define ICorDebugBreakpointEnum_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugBreakpointEnum_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugBreakpointEnum_AddRef(This) \
+#define ICorDebugBreakpointEnum_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugBreakpointEnum_Release(This) \
+#define ICorDebugBreakpointEnum_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugBreakpointEnum_Skip(This,celt) \
+#define ICorDebugBreakpointEnum_Skip(This,celt) \
( (This)->lpVtbl -> Skip(This,celt) )
-#define ICorDebugBreakpointEnum_Reset(This) \
+#define ICorDebugBreakpointEnum_Reset(This) \
( (This)->lpVtbl -> Reset(This) )
-#define ICorDebugBreakpointEnum_Clone(This,ppEnum) \
+#define ICorDebugBreakpointEnum_Clone(This,ppEnum) \
( (This)->lpVtbl -> Clone(This,ppEnum) )
-#define ICorDebugBreakpointEnum_GetCount(This,pcelt) \
+#define ICorDebugBreakpointEnum_GetCount(This,pcelt) \
( (This)->lpVtbl -> GetCount(This,pcelt) )
-#define ICorDebugBreakpointEnum_Next(This,celt,breakpoints,pceltFetched) \
+#define ICorDebugBreakpointEnum_Next(This,celt,breakpoints,pceltFetched) \
( (This)->lpVtbl -> Next(This,celt,breakpoints,pceltFetched) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugBreakpointEnum_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugBreakpointEnum_INTERFACE_DEFINED__ */
#ifndef __ICorDebugStepperEnum_INTERFACE_DEFINED__
@@ -16070,7 +16290,7 @@ EXTERN_C const IID IID_ICorDebugStepperEnum;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugStepperEnumVtbl
{
@@ -16122,41 +16342,41 @@ EXTERN_C const IID IID_ICorDebugStepperEnum;
#ifdef COBJMACROS
-#define ICorDebugStepperEnum_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugStepperEnum_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugStepperEnum_AddRef(This) \
+#define ICorDebugStepperEnum_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugStepperEnum_Release(This) \
+#define ICorDebugStepperEnum_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugStepperEnum_Skip(This,celt) \
+#define ICorDebugStepperEnum_Skip(This,celt) \
( (This)->lpVtbl -> Skip(This,celt) )
-#define ICorDebugStepperEnum_Reset(This) \
+#define ICorDebugStepperEnum_Reset(This) \
( (This)->lpVtbl -> Reset(This) )
-#define ICorDebugStepperEnum_Clone(This,ppEnum) \
+#define ICorDebugStepperEnum_Clone(This,ppEnum) \
( (This)->lpVtbl -> Clone(This,ppEnum) )
-#define ICorDebugStepperEnum_GetCount(This,pcelt) \
+#define ICorDebugStepperEnum_GetCount(This,pcelt) \
( (This)->lpVtbl -> GetCount(This,pcelt) )
-#define ICorDebugStepperEnum_Next(This,celt,steppers,pceltFetched) \
+#define ICorDebugStepperEnum_Next(This,celt,steppers,pceltFetched) \
( (This)->lpVtbl -> Next(This,celt,steppers,pceltFetched) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugStepperEnum_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugStepperEnum_INTERFACE_DEFINED__ */
#ifndef __ICorDebugProcessEnum_INTERFACE_DEFINED__
@@ -16182,7 +16402,7 @@ EXTERN_C const IID IID_ICorDebugProcessEnum;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugProcessEnumVtbl
{
@@ -16234,41 +16454,41 @@ EXTERN_C const IID IID_ICorDebugProcessEnum;
#ifdef COBJMACROS
-#define ICorDebugProcessEnum_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugProcessEnum_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugProcessEnum_AddRef(This) \
+#define ICorDebugProcessEnum_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugProcessEnum_Release(This) \
+#define ICorDebugProcessEnum_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugProcessEnum_Skip(This,celt) \
+#define ICorDebugProcessEnum_Skip(This,celt) \
( (This)->lpVtbl -> Skip(This,celt) )
-#define ICorDebugProcessEnum_Reset(This) \
+#define ICorDebugProcessEnum_Reset(This) \
( (This)->lpVtbl -> Reset(This) )
-#define ICorDebugProcessEnum_Clone(This,ppEnum) \
+#define ICorDebugProcessEnum_Clone(This,ppEnum) \
( (This)->lpVtbl -> Clone(This,ppEnum) )
-#define ICorDebugProcessEnum_GetCount(This,pcelt) \
+#define ICorDebugProcessEnum_GetCount(This,pcelt) \
( (This)->lpVtbl -> GetCount(This,pcelt) )
-#define ICorDebugProcessEnum_Next(This,celt,processes,pceltFetched) \
+#define ICorDebugProcessEnum_Next(This,celt,processes,pceltFetched) \
( (This)->lpVtbl -> Next(This,celt,processes,pceltFetched) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugProcessEnum_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugProcessEnum_INTERFACE_DEFINED__ */
#ifndef __ICorDebugThreadEnum_INTERFACE_DEFINED__
@@ -16294,7 +16514,7 @@ EXTERN_C const IID IID_ICorDebugThreadEnum;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugThreadEnumVtbl
{
@@ -16346,41 +16566,41 @@ EXTERN_C const IID IID_ICorDebugThreadEnum;
#ifdef COBJMACROS
-#define ICorDebugThreadEnum_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugThreadEnum_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugThreadEnum_AddRef(This) \
+#define ICorDebugThreadEnum_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugThreadEnum_Release(This) \
+#define ICorDebugThreadEnum_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugThreadEnum_Skip(This,celt) \
+#define ICorDebugThreadEnum_Skip(This,celt) \
( (This)->lpVtbl -> Skip(This,celt) )
-#define ICorDebugThreadEnum_Reset(This) \
+#define ICorDebugThreadEnum_Reset(This) \
( (This)->lpVtbl -> Reset(This) )
-#define ICorDebugThreadEnum_Clone(This,ppEnum) \
+#define ICorDebugThreadEnum_Clone(This,ppEnum) \
( (This)->lpVtbl -> Clone(This,ppEnum) )
-#define ICorDebugThreadEnum_GetCount(This,pcelt) \
+#define ICorDebugThreadEnum_GetCount(This,pcelt) \
( (This)->lpVtbl -> GetCount(This,pcelt) )
-#define ICorDebugThreadEnum_Next(This,celt,threads,pceltFetched) \
+#define ICorDebugThreadEnum_Next(This,celt,threads,pceltFetched) \
( (This)->lpVtbl -> Next(This,celt,threads,pceltFetched) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugThreadEnum_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugThreadEnum_INTERFACE_DEFINED__ */
#ifndef __ICorDebugFrameEnum_INTERFACE_DEFINED__
@@ -16406,7 +16626,7 @@ EXTERN_C const IID IID_ICorDebugFrameEnum;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugFrameEnumVtbl
{
@@ -16458,41 +16678,41 @@ EXTERN_C const IID IID_ICorDebugFrameEnum;
#ifdef COBJMACROS
-#define ICorDebugFrameEnum_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugFrameEnum_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugFrameEnum_AddRef(This) \
+#define ICorDebugFrameEnum_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugFrameEnum_Release(This) \
+#define ICorDebugFrameEnum_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugFrameEnum_Skip(This,celt) \
+#define ICorDebugFrameEnum_Skip(This,celt) \
( (This)->lpVtbl -> Skip(This,celt) )
-#define ICorDebugFrameEnum_Reset(This) \
+#define ICorDebugFrameEnum_Reset(This) \
( (This)->lpVtbl -> Reset(This) )
-#define ICorDebugFrameEnum_Clone(This,ppEnum) \
+#define ICorDebugFrameEnum_Clone(This,ppEnum) \
( (This)->lpVtbl -> Clone(This,ppEnum) )
-#define ICorDebugFrameEnum_GetCount(This,pcelt) \
+#define ICorDebugFrameEnum_GetCount(This,pcelt) \
( (This)->lpVtbl -> GetCount(This,pcelt) )
-#define ICorDebugFrameEnum_Next(This,celt,frames,pceltFetched) \
+#define ICorDebugFrameEnum_Next(This,celt,frames,pceltFetched) \
( (This)->lpVtbl -> Next(This,celt,frames,pceltFetched) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugFrameEnum_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugFrameEnum_INTERFACE_DEFINED__ */
#ifndef __ICorDebugChainEnum_INTERFACE_DEFINED__
@@ -16518,7 +16738,7 @@ EXTERN_C const IID IID_ICorDebugChainEnum;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugChainEnumVtbl
{
@@ -16570,41 +16790,41 @@ EXTERN_C const IID IID_ICorDebugChainEnum;
#ifdef COBJMACROS
-#define ICorDebugChainEnum_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugChainEnum_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugChainEnum_AddRef(This) \
+#define ICorDebugChainEnum_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugChainEnum_Release(This) \
+#define ICorDebugChainEnum_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugChainEnum_Skip(This,celt) \
+#define ICorDebugChainEnum_Skip(This,celt) \
( (This)->lpVtbl -> Skip(This,celt) )
-#define ICorDebugChainEnum_Reset(This) \
+#define ICorDebugChainEnum_Reset(This) \
( (This)->lpVtbl -> Reset(This) )
-#define ICorDebugChainEnum_Clone(This,ppEnum) \
+#define ICorDebugChainEnum_Clone(This,ppEnum) \
( (This)->lpVtbl -> Clone(This,ppEnum) )
-#define ICorDebugChainEnum_GetCount(This,pcelt) \
+#define ICorDebugChainEnum_GetCount(This,pcelt) \
( (This)->lpVtbl -> GetCount(This,pcelt) )
-#define ICorDebugChainEnum_Next(This,celt,chains,pceltFetched) \
+#define ICorDebugChainEnum_Next(This,celt,chains,pceltFetched) \
( (This)->lpVtbl -> Next(This,celt,chains,pceltFetched) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugChainEnum_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugChainEnum_INTERFACE_DEFINED__ */
#ifndef __ICorDebugModuleEnum_INTERFACE_DEFINED__
@@ -16630,7 +16850,7 @@ EXTERN_C const IID IID_ICorDebugModuleEnum;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugModuleEnumVtbl
{
@@ -16682,41 +16902,41 @@ EXTERN_C const IID IID_ICorDebugModuleEnum;
#ifdef COBJMACROS
-#define ICorDebugModuleEnum_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugModuleEnum_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugModuleEnum_AddRef(This) \
+#define ICorDebugModuleEnum_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugModuleEnum_Release(This) \
+#define ICorDebugModuleEnum_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugModuleEnum_Skip(This,celt) \
+#define ICorDebugModuleEnum_Skip(This,celt) \
( (This)->lpVtbl -> Skip(This,celt) )
-#define ICorDebugModuleEnum_Reset(This) \
+#define ICorDebugModuleEnum_Reset(This) \
( (This)->lpVtbl -> Reset(This) )
-#define ICorDebugModuleEnum_Clone(This,ppEnum) \
+#define ICorDebugModuleEnum_Clone(This,ppEnum) \
( (This)->lpVtbl -> Clone(This,ppEnum) )
-#define ICorDebugModuleEnum_GetCount(This,pcelt) \
+#define ICorDebugModuleEnum_GetCount(This,pcelt) \
( (This)->lpVtbl -> GetCount(This,pcelt) )
-#define ICorDebugModuleEnum_Next(This,celt,modules,pceltFetched) \
+#define ICorDebugModuleEnum_Next(This,celt,modules,pceltFetched) \
( (This)->lpVtbl -> Next(This,celt,modules,pceltFetched) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugModuleEnum_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugModuleEnum_INTERFACE_DEFINED__ */
#ifndef __ICorDebugValueEnum_INTERFACE_DEFINED__
@@ -16742,7 +16962,7 @@ EXTERN_C const IID IID_ICorDebugValueEnum;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugValueEnumVtbl
{
@@ -16794,41 +17014,41 @@ EXTERN_C const IID IID_ICorDebugValueEnum;
#ifdef COBJMACROS
-#define ICorDebugValueEnum_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugValueEnum_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugValueEnum_AddRef(This) \
+#define ICorDebugValueEnum_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugValueEnum_Release(This) \
+#define ICorDebugValueEnum_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugValueEnum_Skip(This,celt) \
+#define ICorDebugValueEnum_Skip(This,celt) \
( (This)->lpVtbl -> Skip(This,celt) )
-#define ICorDebugValueEnum_Reset(This) \
+#define ICorDebugValueEnum_Reset(This) \
( (This)->lpVtbl -> Reset(This) )
-#define ICorDebugValueEnum_Clone(This,ppEnum) \
+#define ICorDebugValueEnum_Clone(This,ppEnum) \
( (This)->lpVtbl -> Clone(This,ppEnum) )
-#define ICorDebugValueEnum_GetCount(This,pcelt) \
+#define ICorDebugValueEnum_GetCount(This,pcelt) \
( (This)->lpVtbl -> GetCount(This,pcelt) )
-#define ICorDebugValueEnum_Next(This,celt,values,pceltFetched) \
+#define ICorDebugValueEnum_Next(This,celt,values,pceltFetched) \
( (This)->lpVtbl -> Next(This,celt,values,pceltFetched) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugValueEnum_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugValueEnum_INTERFACE_DEFINED__ */
#ifndef __ICorDebugVariableHomeEnum_INTERFACE_DEFINED__
@@ -16854,7 +17074,7 @@ EXTERN_C const IID IID_ICorDebugVariableHomeEnum;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugVariableHomeEnumVtbl
{
@@ -16906,41 +17126,41 @@ EXTERN_C const IID IID_ICorDebugVariableHomeEnum;
#ifdef COBJMACROS
-#define ICorDebugVariableHomeEnum_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugVariableHomeEnum_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugVariableHomeEnum_AddRef(This) \
+#define ICorDebugVariableHomeEnum_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugVariableHomeEnum_Release(This) \
+#define ICorDebugVariableHomeEnum_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugVariableHomeEnum_Skip(This,celt) \
+#define ICorDebugVariableHomeEnum_Skip(This,celt) \
( (This)->lpVtbl -> Skip(This,celt) )
-#define ICorDebugVariableHomeEnum_Reset(This) \
+#define ICorDebugVariableHomeEnum_Reset(This) \
( (This)->lpVtbl -> Reset(This) )
-#define ICorDebugVariableHomeEnum_Clone(This,ppEnum) \
+#define ICorDebugVariableHomeEnum_Clone(This,ppEnum) \
( (This)->lpVtbl -> Clone(This,ppEnum) )
-#define ICorDebugVariableHomeEnum_GetCount(This,pcelt) \
+#define ICorDebugVariableHomeEnum_GetCount(This,pcelt) \
( (This)->lpVtbl -> GetCount(This,pcelt) )
-#define ICorDebugVariableHomeEnum_Next(This,celt,homes,pceltFetched) \
+#define ICorDebugVariableHomeEnum_Next(This,celt,homes,pceltFetched) \
( (This)->lpVtbl -> Next(This,celt,homes,pceltFetched) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugVariableHomeEnum_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugVariableHomeEnum_INTERFACE_DEFINED__ */
#ifndef __ICorDebugCodeEnum_INTERFACE_DEFINED__
@@ -16966,7 +17186,7 @@ EXTERN_C const IID IID_ICorDebugCodeEnum;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugCodeEnumVtbl
{
@@ -17018,41 +17238,41 @@ EXTERN_C const IID IID_ICorDebugCodeEnum;
#ifdef COBJMACROS
-#define ICorDebugCodeEnum_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugCodeEnum_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugCodeEnum_AddRef(This) \
+#define ICorDebugCodeEnum_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugCodeEnum_Release(This) \
+#define ICorDebugCodeEnum_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugCodeEnum_Skip(This,celt) \
+#define ICorDebugCodeEnum_Skip(This,celt) \
( (This)->lpVtbl -> Skip(This,celt) )
-#define ICorDebugCodeEnum_Reset(This) \
+#define ICorDebugCodeEnum_Reset(This) \
( (This)->lpVtbl -> Reset(This) )
-#define ICorDebugCodeEnum_Clone(This,ppEnum) \
+#define ICorDebugCodeEnum_Clone(This,ppEnum) \
( (This)->lpVtbl -> Clone(This,ppEnum) )
-#define ICorDebugCodeEnum_GetCount(This,pcelt) \
+#define ICorDebugCodeEnum_GetCount(This,pcelt) \
( (This)->lpVtbl -> GetCount(This,pcelt) )
-#define ICorDebugCodeEnum_Next(This,celt,values,pceltFetched) \
+#define ICorDebugCodeEnum_Next(This,celt,values,pceltFetched) \
( (This)->lpVtbl -> Next(This,celt,values,pceltFetched) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugCodeEnum_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugCodeEnum_INTERFACE_DEFINED__ */
#ifndef __ICorDebugTypeEnum_INTERFACE_DEFINED__
@@ -17078,7 +17298,7 @@ EXTERN_C const IID IID_ICorDebugTypeEnum;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugTypeEnumVtbl
{
@@ -17130,41 +17350,41 @@ EXTERN_C const IID IID_ICorDebugTypeEnum;
#ifdef COBJMACROS
-#define ICorDebugTypeEnum_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugTypeEnum_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugTypeEnum_AddRef(This) \
+#define ICorDebugTypeEnum_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugTypeEnum_Release(This) \
+#define ICorDebugTypeEnum_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugTypeEnum_Skip(This,celt) \
+#define ICorDebugTypeEnum_Skip(This,celt) \
( (This)->lpVtbl -> Skip(This,celt) )
-#define ICorDebugTypeEnum_Reset(This) \
+#define ICorDebugTypeEnum_Reset(This) \
( (This)->lpVtbl -> Reset(This) )
-#define ICorDebugTypeEnum_Clone(This,ppEnum) \
+#define ICorDebugTypeEnum_Clone(This,ppEnum) \
( (This)->lpVtbl -> Clone(This,ppEnum) )
-#define ICorDebugTypeEnum_GetCount(This,pcelt) \
+#define ICorDebugTypeEnum_GetCount(This,pcelt) \
( (This)->lpVtbl -> GetCount(This,pcelt) )
-#define ICorDebugTypeEnum_Next(This,celt,values,pceltFetched) \
+#define ICorDebugTypeEnum_Next(This,celt,values,pceltFetched) \
( (This)->lpVtbl -> Next(This,celt,values,pceltFetched) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugTypeEnum_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugTypeEnum_INTERFACE_DEFINED__ */
#ifndef __ICorDebugType_INTERFACE_DEFINED__
@@ -17208,7 +17428,7 @@ EXTERN_C const IID IID_ICorDebugType;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugTypeVtbl
{
@@ -17269,46 +17489,46 @@ EXTERN_C const IID IID_ICorDebugType;
#ifdef COBJMACROS
-#define ICorDebugType_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugType_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugType_AddRef(This) \
+#define ICorDebugType_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugType_Release(This) \
+#define ICorDebugType_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugType_GetType(This,ty) \
+#define ICorDebugType_GetType(This,ty) \
( (This)->lpVtbl -> GetType(This,ty) )
-#define ICorDebugType_GetClass(This,ppClass) \
+#define ICorDebugType_GetClass(This,ppClass) \
( (This)->lpVtbl -> GetClass(This,ppClass) )
-#define ICorDebugType_EnumerateTypeParameters(This,ppTyParEnum) \
+#define ICorDebugType_EnumerateTypeParameters(This,ppTyParEnum) \
( (This)->lpVtbl -> EnumerateTypeParameters(This,ppTyParEnum) )
-#define ICorDebugType_GetFirstTypeParameter(This,value) \
+#define ICorDebugType_GetFirstTypeParameter(This,value) \
( (This)->lpVtbl -> GetFirstTypeParameter(This,value) )
-#define ICorDebugType_GetBase(This,pBase) \
+#define ICorDebugType_GetBase(This,pBase) \
( (This)->lpVtbl -> GetBase(This,pBase) )
-#define ICorDebugType_GetStaticFieldValue(This,fieldDef,pFrame,ppValue) \
+#define ICorDebugType_GetStaticFieldValue(This,fieldDef,pFrame,ppValue) \
( (This)->lpVtbl -> GetStaticFieldValue(This,fieldDef,pFrame,ppValue) )
-#define ICorDebugType_GetRank(This,pnRank) \
+#define ICorDebugType_GetRank(This,pnRank) \
( (This)->lpVtbl -> GetRank(This,pnRank) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugType_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugType_INTERFACE_DEFINED__ */
#ifndef __ICorDebugType2_INTERFACE_DEFINED__
@@ -17332,7 +17552,7 @@ EXTERN_C const IID IID_ICorDebugType2;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugType2Vtbl
{
@@ -17367,28 +17587,28 @@ EXTERN_C const IID IID_ICorDebugType2;
#ifdef COBJMACROS
-#define ICorDebugType2_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugType2_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugType2_AddRef(This) \
+#define ICorDebugType2_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugType2_Release(This) \
+#define ICorDebugType2_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugType2_GetTypeID(This,id) \
+#define ICorDebugType2_GetTypeID(This,id) \
( (This)->lpVtbl -> GetTypeID(This,id) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugType2_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugType2_INTERFACE_DEFINED__ */
#ifndef __ICorDebugErrorInfoEnum_INTERFACE_DEFINED__
@@ -17414,7 +17634,7 @@ EXTERN_C const IID IID_ICorDebugErrorInfoEnum;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugErrorInfoEnumVtbl
{
@@ -17466,41 +17686,41 @@ EXTERN_C const IID IID_ICorDebugErrorInfoEnum;
#ifdef COBJMACROS
-#define ICorDebugErrorInfoEnum_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugErrorInfoEnum_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugErrorInfoEnum_AddRef(This) \
+#define ICorDebugErrorInfoEnum_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugErrorInfoEnum_Release(This) \
+#define ICorDebugErrorInfoEnum_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugErrorInfoEnum_Skip(This,celt) \
+#define ICorDebugErrorInfoEnum_Skip(This,celt) \
( (This)->lpVtbl -> Skip(This,celt) )
-#define ICorDebugErrorInfoEnum_Reset(This) \
+#define ICorDebugErrorInfoEnum_Reset(This) \
( (This)->lpVtbl -> Reset(This) )
-#define ICorDebugErrorInfoEnum_Clone(This,ppEnum) \
+#define ICorDebugErrorInfoEnum_Clone(This,ppEnum) \
( (This)->lpVtbl -> Clone(This,ppEnum) )
-#define ICorDebugErrorInfoEnum_GetCount(This,pcelt) \
+#define ICorDebugErrorInfoEnum_GetCount(This,pcelt) \
( (This)->lpVtbl -> GetCount(This,pcelt) )
-#define ICorDebugErrorInfoEnum_Next(This,celt,errors,pceltFetched) \
+#define ICorDebugErrorInfoEnum_Next(This,celt,errors,pceltFetched) \
( (This)->lpVtbl -> Next(This,celt,errors,pceltFetched) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugErrorInfoEnum_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugErrorInfoEnum_INTERFACE_DEFINED__ */
#ifndef __ICorDebugAppDomainEnum_INTERFACE_DEFINED__
@@ -17526,7 +17746,7 @@ EXTERN_C const IID IID_ICorDebugAppDomainEnum;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugAppDomainEnumVtbl
{
@@ -17578,41 +17798,41 @@ EXTERN_C const IID IID_ICorDebugAppDomainEnum;
#ifdef COBJMACROS
-#define ICorDebugAppDomainEnum_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugAppDomainEnum_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugAppDomainEnum_AddRef(This) \
+#define ICorDebugAppDomainEnum_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugAppDomainEnum_Release(This) \
+#define ICorDebugAppDomainEnum_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugAppDomainEnum_Skip(This,celt) \
+#define ICorDebugAppDomainEnum_Skip(This,celt) \
( (This)->lpVtbl -> Skip(This,celt) )
-#define ICorDebugAppDomainEnum_Reset(This) \
+#define ICorDebugAppDomainEnum_Reset(This) \
( (This)->lpVtbl -> Reset(This) )
-#define ICorDebugAppDomainEnum_Clone(This,ppEnum) \
+#define ICorDebugAppDomainEnum_Clone(This,ppEnum) \
( (This)->lpVtbl -> Clone(This,ppEnum) )
-#define ICorDebugAppDomainEnum_GetCount(This,pcelt) \
+#define ICorDebugAppDomainEnum_GetCount(This,pcelt) \
( (This)->lpVtbl -> GetCount(This,pcelt) )
-#define ICorDebugAppDomainEnum_Next(This,celt,values,pceltFetched) \
+#define ICorDebugAppDomainEnum_Next(This,celt,values,pceltFetched) \
( (This)->lpVtbl -> Next(This,celt,values,pceltFetched) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugAppDomainEnum_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugAppDomainEnum_INTERFACE_DEFINED__ */
#ifndef __ICorDebugAssemblyEnum_INTERFACE_DEFINED__
@@ -17638,7 +17858,7 @@ EXTERN_C const IID IID_ICorDebugAssemblyEnum;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugAssemblyEnumVtbl
{
@@ -17690,41 +17910,41 @@ EXTERN_C const IID IID_ICorDebugAssemblyEnum;
#ifdef COBJMACROS
-#define ICorDebugAssemblyEnum_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugAssemblyEnum_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugAssemblyEnum_AddRef(This) \
+#define ICorDebugAssemblyEnum_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugAssemblyEnum_Release(This) \
+#define ICorDebugAssemblyEnum_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugAssemblyEnum_Skip(This,celt) \
+#define ICorDebugAssemblyEnum_Skip(This,celt) \
( (This)->lpVtbl -> Skip(This,celt) )
-#define ICorDebugAssemblyEnum_Reset(This) \
+#define ICorDebugAssemblyEnum_Reset(This) \
( (This)->lpVtbl -> Reset(This) )
-#define ICorDebugAssemblyEnum_Clone(This,ppEnum) \
+#define ICorDebugAssemblyEnum_Clone(This,ppEnum) \
( (This)->lpVtbl -> Clone(This,ppEnum) )
-#define ICorDebugAssemblyEnum_GetCount(This,pcelt) \
+#define ICorDebugAssemblyEnum_GetCount(This,pcelt) \
( (This)->lpVtbl -> GetCount(This,pcelt) )
-#define ICorDebugAssemblyEnum_Next(This,celt,values,pceltFetched) \
+#define ICorDebugAssemblyEnum_Next(This,celt,values,pceltFetched) \
( (This)->lpVtbl -> Next(This,celt,values,pceltFetched) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugAssemblyEnum_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugAssemblyEnum_INTERFACE_DEFINED__ */
#ifndef __ICorDebugBlockingObjectEnum_INTERFACE_DEFINED__
@@ -17750,7 +17970,7 @@ EXTERN_C const IID IID_ICorDebugBlockingObjectEnum;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugBlockingObjectEnumVtbl
{
@@ -17802,52 +18022,52 @@ EXTERN_C const IID IID_ICorDebugBlockingObjectEnum;
#ifdef COBJMACROS
-#define ICorDebugBlockingObjectEnum_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugBlockingObjectEnum_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugBlockingObjectEnum_AddRef(This) \
+#define ICorDebugBlockingObjectEnum_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugBlockingObjectEnum_Release(This) \
+#define ICorDebugBlockingObjectEnum_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugBlockingObjectEnum_Skip(This,celt) \
+#define ICorDebugBlockingObjectEnum_Skip(This,celt) \
( (This)->lpVtbl -> Skip(This,celt) )
-#define ICorDebugBlockingObjectEnum_Reset(This) \
+#define ICorDebugBlockingObjectEnum_Reset(This) \
( (This)->lpVtbl -> Reset(This) )
-#define ICorDebugBlockingObjectEnum_Clone(This,ppEnum) \
+#define ICorDebugBlockingObjectEnum_Clone(This,ppEnum) \
( (This)->lpVtbl -> Clone(This,ppEnum) )
-#define ICorDebugBlockingObjectEnum_GetCount(This,pcelt) \
+#define ICorDebugBlockingObjectEnum_GetCount(This,pcelt) \
( (This)->lpVtbl -> GetCount(This,pcelt) )
-#define ICorDebugBlockingObjectEnum_Next(This,celt,values,pceltFetched) \
+#define ICorDebugBlockingObjectEnum_Next(This,celt,values,pceltFetched) \
( (This)->lpVtbl -> Next(This,celt,values,pceltFetched) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugBlockingObjectEnum_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugBlockingObjectEnum_INTERFACE_DEFINED__ */
-/* interface __MIDL_itf_cordebug_0000_0125 */
+/* interface __MIDL_itf_cordebug_0000_0127 */
/* [local] */
#pragma warning(push)
#pragma warning(disable:28718)
-extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0125_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0125_v0_0_s_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0127_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0127_v0_0_s_ifspec;
#ifndef __ICorDebugMDA_INTERFACE_DEFINED__
#define __ICorDebugMDA_INTERFACE_DEFINED__
@@ -17858,8 +18078,8 @@ extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0125_v0_0_s_ifspec;
typedef
enum CorDebugMDAFlags
{
- MDA_FLAG_SLIP = 0x2
- } CorDebugMDAFlags;
+ MDA_FLAG_SLIP = 0x2
+ } CorDebugMDAFlags;
EXTERN_C const IID IID_ICorDebugMDA;
@@ -17894,7 +18114,7 @@ EXTERN_C const IID IID_ICorDebugMDA;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugMDAVtbl
{
@@ -17951,43 +18171,43 @@ EXTERN_C const IID IID_ICorDebugMDA;
#ifdef COBJMACROS
-#define ICorDebugMDA_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugMDA_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugMDA_AddRef(This) \
+#define ICorDebugMDA_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugMDA_Release(This) \
+#define ICorDebugMDA_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugMDA_GetName(This,cchName,pcchName,szName) \
+#define ICorDebugMDA_GetName(This,cchName,pcchName,szName) \
( (This)->lpVtbl -> GetName(This,cchName,pcchName,szName) )
-#define ICorDebugMDA_GetDescription(This,cchName,pcchName,szName) \
+#define ICorDebugMDA_GetDescription(This,cchName,pcchName,szName) \
( (This)->lpVtbl -> GetDescription(This,cchName,pcchName,szName) )
-#define ICorDebugMDA_GetXML(This,cchName,pcchName,szName) \
+#define ICorDebugMDA_GetXML(This,cchName,pcchName,szName) \
( (This)->lpVtbl -> GetXML(This,cchName,pcchName,szName) )
-#define ICorDebugMDA_GetFlags(This,pFlags) \
+#define ICorDebugMDA_GetFlags(This,pFlags) \
( (This)->lpVtbl -> GetFlags(This,pFlags) )
-#define ICorDebugMDA_GetOSThreadId(This,pOsTid) \
+#define ICorDebugMDA_GetOSThreadId(This,pOsTid) \
( (This)->lpVtbl -> GetOSThreadId(This,pOsTid) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugMDA_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugMDA_INTERFACE_DEFINED__ */
-/* interface __MIDL_itf_cordebug_0000_0126 */
+/* interface __MIDL_itf_cordebug_0000_0128 */
/* [local] */
#pragma warning(pop)
@@ -17995,8 +18215,8 @@ EXTERN_C const IID IID_ICorDebugMDA;
#pragma warning(disable:28718)
-extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0126_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0126_v0_0_s_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0128_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0128_v0_0_s_ifspec;
#ifndef __ICorDebugEditAndContinueErrorInfo_INTERFACE_DEFINED__
#define __ICorDebugEditAndContinueErrorInfo_INTERFACE_DEFINED__
@@ -18030,7 +18250,7 @@ EXTERN_C const IID IID_ICorDebugEditAndContinueErrorInfo;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugEditAndContinueErrorInfoVtbl
{
@@ -18079,47 +18299,47 @@ EXTERN_C const IID IID_ICorDebugEditAndContinueErrorInfo;
#ifdef COBJMACROS
-#define ICorDebugEditAndContinueErrorInfo_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugEditAndContinueErrorInfo_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugEditAndContinueErrorInfo_AddRef(This) \
+#define ICorDebugEditAndContinueErrorInfo_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugEditAndContinueErrorInfo_Release(This) \
+#define ICorDebugEditAndContinueErrorInfo_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugEditAndContinueErrorInfo_GetModule(This,ppModule) \
+#define ICorDebugEditAndContinueErrorInfo_GetModule(This,ppModule) \
( (This)->lpVtbl -> GetModule(This,ppModule) )
-#define ICorDebugEditAndContinueErrorInfo_GetToken(This,pToken) \
+#define ICorDebugEditAndContinueErrorInfo_GetToken(This,pToken) \
( (This)->lpVtbl -> GetToken(This,pToken) )
-#define ICorDebugEditAndContinueErrorInfo_GetErrorCode(This,pHr) \
+#define ICorDebugEditAndContinueErrorInfo_GetErrorCode(This,pHr) \
( (This)->lpVtbl -> GetErrorCode(This,pHr) )
-#define ICorDebugEditAndContinueErrorInfo_GetString(This,cchString,pcchString,szString) \
+#define ICorDebugEditAndContinueErrorInfo_GetString(This,cchString,pcchString,szString) \
( (This)->lpVtbl -> GetString(This,cchString,pcchString,szString) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugEditAndContinueErrorInfo_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugEditAndContinueErrorInfo_INTERFACE_DEFINED__ */
-/* interface __MIDL_itf_cordebug_0000_0127 */
+/* interface __MIDL_itf_cordebug_0000_0129 */
/* [local] */
#pragma warning(pop)
-extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0127_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0127_v0_0_s_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0129_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_cordebug_0000_0129_v0_0_s_ifspec;
#ifndef __ICorDebugEditAndContinueSnapshot_INTERFACE_DEFINED__
#define __ICorDebugEditAndContinueSnapshot_INTERFACE_DEFINED__
@@ -18163,7 +18383,7 @@ EXTERN_C const IID IID_ICorDebugEditAndContinueSnapshot;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugEditAndContinueSnapshotVtbl
{
@@ -18225,46 +18445,46 @@ EXTERN_C const IID IID_ICorDebugEditAndContinueSnapshot;
#ifdef COBJMACROS
-#define ICorDebugEditAndContinueSnapshot_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugEditAndContinueSnapshot_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugEditAndContinueSnapshot_AddRef(This) \
+#define ICorDebugEditAndContinueSnapshot_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugEditAndContinueSnapshot_Release(This) \
+#define ICorDebugEditAndContinueSnapshot_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugEditAndContinueSnapshot_CopyMetaData(This,pIStream,pMvid) \
+#define ICorDebugEditAndContinueSnapshot_CopyMetaData(This,pIStream,pMvid) \
( (This)->lpVtbl -> CopyMetaData(This,pIStream,pMvid) )
-#define ICorDebugEditAndContinueSnapshot_GetMvid(This,pMvid) \
+#define ICorDebugEditAndContinueSnapshot_GetMvid(This,pMvid) \
( (This)->lpVtbl -> GetMvid(This,pMvid) )
-#define ICorDebugEditAndContinueSnapshot_GetRoDataRVA(This,pRoDataRVA) \
+#define ICorDebugEditAndContinueSnapshot_GetRoDataRVA(This,pRoDataRVA) \
( (This)->lpVtbl -> GetRoDataRVA(This,pRoDataRVA) )
-#define ICorDebugEditAndContinueSnapshot_GetRwDataRVA(This,pRwDataRVA) \
+#define ICorDebugEditAndContinueSnapshot_GetRwDataRVA(This,pRwDataRVA) \
( (This)->lpVtbl -> GetRwDataRVA(This,pRwDataRVA) )
-#define ICorDebugEditAndContinueSnapshot_SetPEBytes(This,pIStream) \
+#define ICorDebugEditAndContinueSnapshot_SetPEBytes(This,pIStream) \
( (This)->lpVtbl -> SetPEBytes(This,pIStream) )
-#define ICorDebugEditAndContinueSnapshot_SetILMap(This,mdFunction,cMapSize,map) \
+#define ICorDebugEditAndContinueSnapshot_SetILMap(This,mdFunction,cMapSize,map) \
( (This)->lpVtbl -> SetILMap(This,mdFunction,cMapSize,map) )
-#define ICorDebugEditAndContinueSnapshot_SetPESymbolBytes(This,pIStream) \
+#define ICorDebugEditAndContinueSnapshot_SetPESymbolBytes(This,pIStream) \
( (This)->lpVtbl -> SetPESymbolBytes(This,pIStream) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugEditAndContinueSnapshot_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugEditAndContinueSnapshot_INTERFACE_DEFINED__ */
#ifndef __ICorDebugExceptionObjectCallStackEnum_INTERFACE_DEFINED__
@@ -18290,7 +18510,7 @@ EXTERN_C const IID IID_ICorDebugExceptionObjectCallStackEnum;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugExceptionObjectCallStackEnumVtbl
{
@@ -18342,41 +18562,41 @@ EXTERN_C const IID IID_ICorDebugExceptionObjectCallStackEnum;
#ifdef COBJMACROS
-#define ICorDebugExceptionObjectCallStackEnum_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugExceptionObjectCallStackEnum_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugExceptionObjectCallStackEnum_AddRef(This) \
+#define ICorDebugExceptionObjectCallStackEnum_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugExceptionObjectCallStackEnum_Release(This) \
+#define ICorDebugExceptionObjectCallStackEnum_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugExceptionObjectCallStackEnum_Skip(This,celt) \
+#define ICorDebugExceptionObjectCallStackEnum_Skip(This,celt) \
( (This)->lpVtbl -> Skip(This,celt) )
-#define ICorDebugExceptionObjectCallStackEnum_Reset(This) \
+#define ICorDebugExceptionObjectCallStackEnum_Reset(This) \
( (This)->lpVtbl -> Reset(This) )
-#define ICorDebugExceptionObjectCallStackEnum_Clone(This,ppEnum) \
+#define ICorDebugExceptionObjectCallStackEnum_Clone(This,ppEnum) \
( (This)->lpVtbl -> Clone(This,ppEnum) )
-#define ICorDebugExceptionObjectCallStackEnum_GetCount(This,pcelt) \
+#define ICorDebugExceptionObjectCallStackEnum_GetCount(This,pcelt) \
( (This)->lpVtbl -> GetCount(This,pcelt) )
-#define ICorDebugExceptionObjectCallStackEnum_Next(This,celt,values,pceltFetched) \
+#define ICorDebugExceptionObjectCallStackEnum_Next(This,celt,values,pceltFetched) \
( (This)->lpVtbl -> Next(This,celt,values,pceltFetched) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugExceptionObjectCallStackEnum_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugExceptionObjectCallStackEnum_INTERFACE_DEFINED__ */
#ifndef __ICorDebugExceptionObjectValue_INTERFACE_DEFINED__
@@ -18400,7 +18620,7 @@ EXTERN_C const IID IID_ICorDebugExceptionObjectValue;
};
-#else /* C style interface */
+#else /* C style interface */
typedef struct ICorDebugExceptionObjectValueVtbl
{
@@ -18435,28 +18655,28 @@ EXTERN_C const IID IID_ICorDebugExceptionObjectValue;
#ifdef COBJMACROS
-#define ICorDebugExceptionObjectValue_QueryInterface(This,riid,ppvObject) \
+#define ICorDebugExceptionObjectValue_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-#define ICorDebugExceptionObjectValue_AddRef(This) \
+#define ICorDebugExceptionObjectValue_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
-#define ICorDebugExceptionObjectValue_Release(This) \
+#define ICorDebugExceptionObjectValue_Release(This) \
( (This)->lpVtbl -> Release(This) )
-#define ICorDebugExceptionObjectValue_EnumerateExceptionCallStack(This,ppCallStackEnum) \
+#define ICorDebugExceptionObjectValue_EnumerateExceptionCallStack(This,ppCallStackEnum) \
( (This)->lpVtbl -> EnumerateExceptionCallStack(This,ppCallStackEnum) )
#endif /* COBJMACROS */
-#endif /* C style interface */
+#endif /* C style interface */
-#endif /* __ICorDebugExceptionObjectValue_INTERFACE_DEFINED__ */
+#endif /* __ICorDebugExceptionObjectValue_INTERFACE_DEFINED__ */
@@ -18525,5 +18745,3 @@ EmbeddedCLRCorDebug;
#endif
#endif
-
-
diff --git a/src/coreclr/src/pal/src/CMakeLists.txt b/src/coreclr/src/pal/src/CMakeLists.txt
index 89c3ed934454..094f14cabf82 100644
--- a/src/coreclr/src/pal/src/CMakeLists.txt
+++ b/src/coreclr/src/pal/src/CMakeLists.txt
@@ -18,6 +18,8 @@ if(NOT CLR_CMAKE_USE_SYSTEM_LIBUNWIND)
add_subdirectory(libunwind)
elseif(NOT CLR_CMAKE_TARGET_OSX)
find_unwind_libs(UNWIND_LIBS)
+else()
+ add_subdirectory(libunwind)
endif(NOT CLR_CMAKE_USE_SYSTEM_LIBUNWIND)
include(configure.cmake)
@@ -39,6 +41,10 @@ include_directories(include)
# Compile options
+if(CLR_CMAKE_USE_SYSTEM_LIBUNWIND)
+ add_definitions(-DFEATURE_USE_SYSTEM_LIBUNWIND)
+endif(CLR_CMAKE_USE_SYSTEM_LIBUNWIND)
+
if(CLR_CMAKE_TARGET_OSX)
add_definitions(-DTARGET_OSX)
add_definitions(-DXSTATE_SUPPORTED)
@@ -131,7 +137,6 @@ set(SOURCES
debug/debug.cpp
exception/seh.cpp
exception/signal.cpp
- exception/remote-unwind.cpp
file/directory.cpp
file/file.cpp
file/filetime.cpp
@@ -214,6 +219,12 @@ set(SOURCES
thread/threadsusp.cpp
)
+if(NOT CLR_CMAKE_TARGET_OSX)
+ list(APPEND SOURCES
+ exception/remote-unwind.cpp
+ )
+endif(NOT CLR_CMAKE_TARGET_OSX)
+
if(NOT CLR_CMAKE_USE_SYSTEM_LIBUNWIND)
set(LIBUNWIND_OBJECTS $)
endif(NOT CLR_CMAKE_USE_SYSTEM_LIBUNWIND)
@@ -226,6 +237,29 @@ add_library(coreclrpal
${LIBUNWIND_OBJECTS}
)
+# Build separate pal library for DAC (addition to regular pal library)
+if(CLR_CMAKE_TARGET_OSX)
+ set(LIBUNWIND_DAC_OBJECTS $)
+
+ add_library(coreclrpal_dac STATIC
+ exception/remote-unwind.cpp
+ ${LIBUNWIND_DAC_OBJECTS}
+ )
+
+ target_compile_definitions(coreclrpal_dac PUBLIC
+ "-D_XOPEN_SOURCE"
+ "-DUNW_REMOTE_ONLY"
+ )
+
+ target_include_directories(coreclrpal_dac PUBLIC
+ ${CMAKE_CURRENT_SOURCE_DIR}/libunwind/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/libunwind/include/tdep
+ ${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}/libunwind/include
+ ${CMAKE_CURRENT_BINARY_DIR}/libunwind/include/tdep
+ )
+endif(CLR_CMAKE_TARGET_OSX)
+
# There is only one function exported in 'tracepointprovider.cpp' namely 'PAL_InitializeTracing',
# which is guarded with '#if defined(__linux__)'. On macOS, Xcode issues the following warning:
#
@@ -309,6 +343,5 @@ if(FEATURE_EVENT_TRACE)
add_subdirectory(eventprovider)
endif(FEATURE_EVENT_TRACE)
-
# Install the static PAL library for VS
_install (TARGETS coreclrpal DESTINATION lib)
diff --git a/src/coreclr/src/pal/src/arch/arm64/context2.S b/src/coreclr/src/pal/src/arch/arm64/context2.S
index f7d6d3fe059d..2ebce4b44004 100644
--- a/src/coreclr/src/pal/src/arch/arm64/context2.S
+++ b/src/coreclr/src/pal/src/arch/arm64/context2.S
@@ -13,7 +13,9 @@
// x0: Context*
//
LEAF_ENTRY CONTEXT_CaptureContext, _TEXT
- sub sp, sp, #32
+ PROLOG_STACK_ALLOC 32
+ .cfi_adjust_cfa_offset 32
+
// save x1, x2 and x3 on stack so we can use them as scratch
stp x1, x2, [sp]
str x3, [sp, 16]
@@ -103,7 +105,7 @@ LOCAL_LABEL(Done_CONTEXT_INTEGER):
LOCAL_LABEL(Done_CONTEXT_FLOATING_POINT):
- add sp, sp, #32
+ EPILOG_STACK_FREE 32
ret
LEAF_END CONTEXT_CaptureContext, _TEXT
@@ -111,7 +113,8 @@ LEAF_END CONTEXT_CaptureContext, _TEXT
// x0: Context*
LEAF_ENTRY RtlCaptureContext, _TEXT
- sub sp, sp, #16
+ PROLOG_STACK_ALLOC 16
+ .cfi_adjust_cfa_offset 16
str x1, [sp]
// same as above, clang doesn't like mov with #imm32
// keep this in sync if CONTEXT_FULL changes
@@ -122,7 +125,7 @@ LEAF_ENTRY RtlCaptureContext, _TEXT
orr w1, w1, #0x8
str w1, [x0, CONTEXT_ContextFlags]
ldr x1, [sp]
- add sp, sp, #16
+ EPILOG_STACK_FREE 16
b C_FUNC(CONTEXT_CaptureContext)
LEAF_END RtlCaptureContext, _TEXT
diff --git a/src/coreclr/src/pal/src/exception/compact_unwind_encoding.h b/src/coreclr/src/pal/src/exception/compact_unwind_encoding.h
new file mode 100644
index 000000000000..3e9b0546e973
--- /dev/null
+++ b/src/coreclr/src/pal/src/exception/compact_unwind_encoding.h
@@ -0,0 +1,474 @@
+//===------------------ mach-o/compact_unwind_encoding.h ------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//
+// Darwin's alternative to dwarf based unwind encodings.
+//
+//===----------------------------------------------------------------------===//
+
+
+#ifndef __COMPACT_UNWIND_ENCODING__
+#define __COMPACT_UNWIND_ENCODING__
+
+#include
+
+//
+// Compilers can emit standard Dwarf FDEs in the __TEXT,__eh_frame section
+// of object files. Or compilers can emit compact unwind information in
+// the __LD,__compact_unwind section.
+//
+// When the linker creates a final linked image, it will create a
+// __TEXT,__unwind_info section. This section is a small and fast way for the
+// runtime to access unwind info for any given function. If the compiler
+// emitted compact unwind info for the function, that compact unwind info will
+// be encoded in the __TEXT,__unwind_info section. If the compiler emitted
+// dwarf unwind info, the __TEXT,__unwind_info section will contain the offset
+// of the FDE in the __TEXT,__eh_frame section in the final linked image.
+//
+// Note: Previously, the linker would transform some dwarf unwind infos into
+// compact unwind info. But that is fragile and no longer done.
+
+
+//
+// The compact unwind endoding is a 32-bit value which encoded in an
+// architecture specific way, which registers to restore from where, and how
+// to unwind out of the function.
+//
+typedef uint32_t compact_unwind_encoding_t;
+
+
+// architecture independent bits
+enum {
+ UNWIND_IS_NOT_FUNCTION_START = 0x80000000,
+ UNWIND_HAS_LSDA = 0x40000000,
+ UNWIND_PERSONALITY_MASK = 0x30000000,
+};
+
+
+
+
+//
+// x86
+//
+// 1-bit: start
+// 1-bit: has lsda
+// 2-bit: personality index
+//
+// 4-bits: 0=old, 1=ebp based, 2=stack-imm, 3=stack-ind, 4=dwarf
+// ebp based:
+// 15-bits (5*3-bits per reg) register permutation
+// 8-bits for stack offset
+// frameless:
+// 8-bits stack size
+// 3-bits stack adjust
+// 3-bits register count
+// 10-bits register permutation
+//
+enum {
+ UNWIND_X86_MODE_MASK = 0x0F000000,
+ UNWIND_X86_MODE_EBP_FRAME = 0x01000000,
+ UNWIND_X86_MODE_STACK_IMMD = 0x02000000,
+ UNWIND_X86_MODE_STACK_IND = 0x03000000,
+ UNWIND_X86_MODE_DWARF = 0x04000000,
+
+ UNWIND_X86_EBP_FRAME_REGISTERS = 0x00007FFF,
+ UNWIND_X86_EBP_FRAME_OFFSET = 0x00FF0000,
+
+ UNWIND_X86_FRAMELESS_STACK_SIZE = 0x00FF0000,
+ UNWIND_X86_FRAMELESS_STACK_ADJUST = 0x0000E000,
+ UNWIND_X86_FRAMELESS_STACK_REG_COUNT = 0x00001C00,
+ UNWIND_X86_FRAMELESS_STACK_REG_PERMUTATION = 0x000003FF,
+
+ UNWIND_X86_DWARF_SECTION_OFFSET = 0x00FFFFFF,
+};
+
+enum {
+ UNWIND_X86_REG_NONE = 0,
+ UNWIND_X86_REG_EBX = 1,
+ UNWIND_X86_REG_ECX = 2,
+ UNWIND_X86_REG_EDX = 3,
+ UNWIND_X86_REG_EDI = 4,
+ UNWIND_X86_REG_ESI = 5,
+ UNWIND_X86_REG_EBP = 6,
+};
+
+//
+// For x86 there are four modes for the compact unwind encoding:
+// UNWIND_X86_MODE_EBP_FRAME:
+// EBP based frame where EBP is push on stack immediately after return address,
+// then ESP is moved to EBP. Thus, to unwind ESP is restored with the current
+// EPB value, then EBP is restored by popping off the stack, and the return
+// is done by popping the stack once more into the pc.
+// All non-volatile registers that need to be restored must have been saved
+// in a small range in the stack that starts EBP-4 to EBP-1020. The offset/4
+// is encoded in the UNWIND_X86_EBP_FRAME_OFFSET bits. The registers saved
+// are encoded in the UNWIND_X86_EBP_FRAME_REGISTERS bits as five 3-bit entries.
+// Each entry contains which register to restore.
+// UNWIND_X86_MODE_STACK_IMMD:
+// A "frameless" (EBP not used as frame pointer) function with a small
+// constant stack size. To return, a constant (encoded in the compact
+// unwind encoding) is added to the ESP. Then the return is done by
+// popping the stack into the pc.
+// All non-volatile registers that need to be restored must have been saved
+// on the stack immediately after the return address. The stack_size/4 is
+// encoded in the UNWIND_X86_FRAMELESS_STACK_SIZE (max stack size is 1024).
+// The number of registers saved is encoded in UNWIND_X86_FRAMELESS_STACK_REG_COUNT.
+// UNWIND_X86_FRAMELESS_STACK_REG_PERMUTATION constains which registers were
+// saved and their order.
+// UNWIND_X86_MODE_STACK_IND:
+// A "frameless" (EBP not used as frame pointer) function large constant
+// stack size. This case is like the previous, except the stack size is too
+// large to encode in the compact unwind encoding. Instead it requires that
+// the function contains "subl $nnnnnnnn,ESP" in its prolog. The compact
+// encoding contains the offset to the nnnnnnnn value in the function in
+// UNWIND_X86_FRAMELESS_STACK_SIZE.
+// UNWIND_X86_MODE_DWARF:
+// No compact unwind encoding is available. Instead the low 24-bits of the
+// compact encoding is the offset of the dwarf FDE in the __eh_frame section.
+// This mode is never used in object files. It is only generated by the
+// linker in final linked images which have only dwarf unwind info for a
+// function.
+//
+// The following is the algorithm used to create the permutation encoding used
+// with frameless stacks. It is passed the number of registers to be saved and
+// an array of the register numbers saved.
+//
+//uint32_t permute_encode(uint32_t registerCount, const uint32_t registers[6])
+//{
+// uint32_t renumregs[6];
+// for (int i=6-registerCount; i < 6; ++i) {
+// int countless = 0;
+// for (int j=6-registerCount; j < i; ++j) {
+// if ( registers[j] < registers[i] )
+// ++countless;
+// }
+// renumregs[i] = registers[i] - countless -1;
+// }
+// uint32_t permutationEncoding = 0;
+// switch ( registerCount ) {
+// case 6:
+// permutationEncoding |= (120*renumregs[0] + 24*renumregs[1]
+// + 6*renumregs[2] + 2*renumregs[3]
+// + renumregs[4]);
+// break;
+// case 5:
+// permutationEncoding |= (120*renumregs[1] + 24*renumregs[2]
+// + 6*renumregs[3] + 2*renumregs[4]
+// + renumregs[5]);
+// break;
+// case 4:
+// permutationEncoding |= (60*renumregs[2] + 12*renumregs[3]
+// + 3*renumregs[4] + renumregs[5]);
+// break;
+// case 3:
+// permutationEncoding |= (20*renumregs[3] + 4*renumregs[4]
+// + renumregs[5]);
+// break;
+// case 2:
+// permutationEncoding |= (5*renumregs[4] + renumregs[5]);
+// break;
+// case 1:
+// permutationEncoding |= (renumregs[5]);
+// break;
+// }
+// return permutationEncoding;
+//}
+//
+
+
+
+
+//
+// x86_64
+//
+// 1-bit: start
+// 1-bit: has lsda
+// 2-bit: personality index
+//
+// 4-bits: 0=old, 1=rbp based, 2=stack-imm, 3=stack-ind, 4=dwarf
+// rbp based:
+// 15-bits (5*3-bits per reg) register permutation
+// 8-bits for stack offset
+// frameless:
+// 8-bits stack size
+// 3-bits stack adjust
+// 3-bits register count
+// 10-bits register permutation
+//
+enum {
+ UNWIND_X86_64_MODE_MASK = 0x0F000000,
+ UNWIND_X86_64_MODE_RBP_FRAME = 0x01000000,
+ UNWIND_X86_64_MODE_STACK_IMMD = 0x02000000,
+ UNWIND_X86_64_MODE_STACK_IND = 0x03000000,
+ UNWIND_X86_64_MODE_DWARF = 0x04000000,
+
+ UNWIND_X86_64_RBP_FRAME_REGISTERS = 0x00007FFF,
+ UNWIND_X86_64_RBP_FRAME_OFFSET = 0x00FF0000,
+
+ UNWIND_X86_64_FRAMELESS_STACK_SIZE = 0x00FF0000,
+ UNWIND_X86_64_FRAMELESS_STACK_ADJUST = 0x0000E000,
+ UNWIND_X86_64_FRAMELESS_STACK_REG_COUNT = 0x00001C00,
+ UNWIND_X86_64_FRAMELESS_STACK_REG_PERMUTATION = 0x000003FF,
+
+ UNWIND_X86_64_DWARF_SECTION_OFFSET = 0x00FFFFFF,
+};
+
+enum {
+ UNWIND_X86_64_REG_NONE = 0,
+ UNWIND_X86_64_REG_RBX = 1,
+ UNWIND_X86_64_REG_R12 = 2,
+ UNWIND_X86_64_REG_R13 = 3,
+ UNWIND_X86_64_REG_R14 = 4,
+ UNWIND_X86_64_REG_R15 = 5,
+ UNWIND_X86_64_REG_RBP = 6,
+};
+//
+// For x86_64 there are four modes for the compact unwind encoding:
+// UNWIND_X86_64_MODE_RBP_FRAME:
+// RBP based frame where RBP is push on stack immediately after return address,
+// then RSP is moved to RBP. Thus, to unwind RSP is restored with the current
+// EPB value, then RBP is restored by popping off the stack, and the return
+// is done by popping the stack once more into the pc.
+// All non-volatile registers that need to be restored must have been saved
+// in a small range in the stack that starts RBP-8 to RBP-1020. The offset/4
+// is encoded in the UNWIND_X86_64_RBP_FRAME_OFFSET bits. The registers saved
+// are encoded in the UNWIND_X86_64_RBP_FRAME_REGISTERS bits as five 3-bit entries.
+// Each entry contains which register to restore.
+// UNWIND_X86_64_MODE_STACK_IMMD:
+// A "frameless" (RBP not used as frame pointer) function with a small
+// constant stack size. To return, a constant (encoded in the compact
+// unwind encoding) is added to the RSP. Then the return is done by
+// popping the stack into the pc.
+// All non-volatile registers that need to be restored must have been saved
+// on the stack immediately after the return address. The stack_size/4 is
+// encoded in the UNWIND_X86_64_FRAMELESS_STACK_SIZE (max stack size is 1024).
+// The number of registers saved is encoded in UNWIND_X86_64_FRAMELESS_STACK_REG_COUNT.
+// UNWIND_X86_64_FRAMELESS_STACK_REG_PERMUTATION constains which registers were
+// saved and their order.
+// UNWIND_X86_64_MODE_STACK_IND:
+// A "frameless" (RBP not used as frame pointer) function large constant
+// stack size. This case is like the previous, except the stack size is too
+// large to encode in the compact unwind encoding. Instead it requires that
+// the function contains "subq $nnnnnnnn,RSP" in its prolog. The compact
+// encoding contains the offset to the nnnnnnnn value in the function in
+// UNWIND_X86_64_FRAMELESS_STACK_SIZE.
+// UNWIND_X86_64_MODE_DWARF:
+// No compact unwind encoding is available. Instead the low 24-bits of the
+// compact encoding is the offset of the dwarf FDE in the __eh_frame section.
+// This mode is never used in object files. It is only generated by the
+// linker in final linked images which have only dwarf unwind info for a
+// function.
+//
+
+
+// ARM64
+//
+// 1-bit: start
+// 1-bit: has lsda
+// 2-bit: personality index
+//
+// 4-bits: 4=frame-based, 3=dwarf, 2=frameless
+// frameless:
+// 12-bits of stack size
+// frame-based:
+// 4-bits D reg pairs saved
+// 5-bits X reg pairs saved
+// dwarf:
+// 24-bits offset of dwarf FDE in __eh_frame section
+//
+enum {
+ UNWIND_ARM64_MODE_MASK = 0x0F000000,
+ UNWIND_ARM64_MODE_FRAMELESS = 0x02000000,
+ UNWIND_ARM64_MODE_DWARF = 0x03000000,
+ UNWIND_ARM64_MODE_FRAME = 0x04000000,
+
+ UNWIND_ARM64_FRAME_X19_X20_PAIR = 0x00000001,
+ UNWIND_ARM64_FRAME_X21_X22_PAIR = 0x00000002,
+ UNWIND_ARM64_FRAME_X23_X24_PAIR = 0x00000004,
+ UNWIND_ARM64_FRAME_X25_X26_PAIR = 0x00000008,
+ UNWIND_ARM64_FRAME_X27_X28_PAIR = 0x00000010,
+ UNWIND_ARM64_FRAME_D8_D9_PAIR = 0x00000100,
+ UNWIND_ARM64_FRAME_D10_D11_PAIR = 0x00000200,
+ UNWIND_ARM64_FRAME_D12_D13_PAIR = 0x00000400,
+ UNWIND_ARM64_FRAME_D14_D15_PAIR = 0x00000800,
+
+ UNWIND_ARM64_FRAMELESS_STACK_SIZE_MASK = 0x00FFF000,
+ UNWIND_ARM64_DWARF_SECTION_OFFSET = 0x00FFFFFF,
+};
+// For arm64 there are three modes for the compact unwind encoding:
+// UNWIND_ARM64_MODE_FRAME:
+// This is a standard arm64 prolog where FP/LR are immediately pushed on the
+// stack, then SP is copied to FP. If there are any non-volatile registers
+// saved, then are copied into the stack frame in pairs in a contiguous
+// range right below the saved FP/LR pair. Any subset of the five X pairs
+// and four D pairs can be saved, but the memory layout must be in register
+// number order.
+// UNWIND_ARM64_MODE_FRAMELESS:
+// A "frameless" leaf function, where FP/LR are not saved. The return address
+// remains in LR throughout the function. If any non-volatile registers
+// are saved, they must be pushed onto the stack before any stack space is
+// allocated for local variables. The stack sized (including any saved
+// non-volatile registers) divided by 16 is encoded in the bits
+// UNWIND_ARM64_FRAMELESS_STACK_SIZE_MASK.
+// UNWIND_ARM64_MODE_DWARF:
+// No compact unwind encoding is available. Instead the low 24-bits of the
+// compact encoding is the offset of the dwarf FDE in the __eh_frame section.
+// This mode is never used in object files. It is only generated by the
+// linker in final linked images which have only dwarf unwind info for a
+// function.
+//
+
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Relocatable Object Files: __LD,__compact_unwind
+//
+////////////////////////////////////////////////////////////////////////////////
+
+//
+// A compiler can generated compact unwind information for a function by adding
+// a "row" to the __LD,__compact_unwind section. This section has the
+// S_ATTR_DEBUG bit set, so the section will be ignored by older linkers.
+// It is removed by the new linker, so never ends up in final executables.
+// This section is a table, initially with one row per function (that needs
+// unwind info). The table columns and some conceptual entries are:
+//
+// range-start pointer to start of function/range
+// range-length
+// compact-unwind-encoding 32-bit encoding
+// personality-function or zero if no personality function
+// lsda or zero if no LSDA data
+//
+// The length and encoding fields are 32-bits. The other are all pointer sized.
+//
+// In x86_64 assembly, these entry would look like:
+//
+// .section __LD,__compact_unwind,regular,debug
+//
+// #compact unwind for _foo
+// .quad _foo
+// .set L1,LfooEnd-_foo
+// .long L1
+// .long 0x01010001
+// .quad 0
+// .quad 0
+//
+// #compact unwind for _bar
+// .quad _bar
+// .set L2,LbarEnd-_bar
+// .long L2
+// .long 0x01020011
+// .quad __gxx_personality
+// .quad except_tab1
+//
+//
+// Notes: There is no need for any labels in the the __compact_unwind section.
+// The use of the .set directive is to force the evaluation of the
+// range-length at assembly time, instead of generating relocations.
+//
+// To support future compiler optimizations where which non-volatile registers
+// are saved changes within a function (e.g. delay saving non-volatiles until
+// necessary), there can by multiple lines in the __compact_unwind table for one
+// function, each with a different (non-overlapping) range and each with
+// different compact unwind encodings that correspond to the non-volatiles
+// saved at that range of the function.
+//
+// If a particular function is so wacky that there is no compact unwind way
+// to encode it, then the compiler can emit traditional dwarf unwind info.
+// The runtime will use which ever is available.
+//
+// Runtime support for compact unwind encodings are only available on 10.6
+// and later. So, the compiler should not generate it when targeting pre-10.6.
+
+
+
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// Final Linked Images: __TEXT,__unwind_info
+//
+////////////////////////////////////////////////////////////////////////////////
+
+//
+// The __TEXT,__unwind_info section is laid out for an efficient two level lookup.
+// The header of the section contains a coarse index that maps function address
+// to the page (4096 byte block) containing the unwind info for that function.
+//
+
+#define UNWIND_SECTION_VERSION 1
+struct unwind_info_section_header
+{
+ uint32_t version; // UNWIND_SECTION_VERSION
+ uint32_t commonEncodingsArraySectionOffset;
+ uint32_t commonEncodingsArrayCount;
+ uint32_t personalityArraySectionOffset;
+ uint32_t personalityArrayCount;
+ uint32_t indexSectionOffset;
+ uint32_t indexCount;
+ // compact_unwind_encoding_t[]
+ // uintptr_t personalities[]
+ // unwind_info_section_header_index_entry[]
+ // unwind_info_section_header_lsda_index_entry[]
+};
+
+struct unwind_info_section_header_index_entry
+{
+ uint32_t functionOffset;
+ uint32_t secondLevelPagesSectionOffset; // section offset to start of regular or compress page
+ uint32_t lsdaIndexArraySectionOffset; // section offset to start of lsda_index array for this range
+};
+
+struct unwind_info_section_header_lsda_index_entry
+{
+ uint32_t functionOffset;
+ uint32_t lsdaOffset;
+};
+
+//
+// There are two kinds of second level index pages: regular and compressed.
+// A compressed page can hold up to 1021 entries, but it cannot be used
+// if too many different encoding types are used. The regular page holds
+// 511 entries.
+//
+
+struct unwind_info_regular_second_level_entry
+{
+ uint32_t functionOffset;
+ compact_unwind_encoding_t encoding;
+};
+
+#define UNWIND_SECOND_LEVEL_REGULAR 2
+struct unwind_info_regular_second_level_page_header
+{
+ uint32_t kind; // UNWIND_SECOND_LEVEL_REGULAR
+ uint16_t entryPageOffset;
+ uint16_t entryCount;
+ // entry array
+};
+
+#define UNWIND_SECOND_LEVEL_COMPRESSED 3
+struct unwind_info_compressed_second_level_page_header
+{
+ uint32_t kind; // UNWIND_SECOND_LEVEL_COMPRESSED
+ uint16_t entryPageOffset;
+ uint16_t entryCount;
+ uint16_t encodingsPageOffset;
+ uint16_t encodingsCount;
+ // 32-bit entry array
+ // encodings array
+};
+
+#define UNWIND_INFO_COMPRESSED_ENTRY_FUNC_OFFSET(entry) (entry & 0x00FFFFFF)
+#define UNWIND_INFO_COMPRESSED_ENTRY_ENCODING_INDEX(entry) ((entry >> 24) & 0xFF)
+
+
+
+#endif
+
diff --git a/src/coreclr/src/pal/src/exception/remote-unwind.cpp b/src/coreclr/src/pal/src/exception/remote-unwind.cpp
index 7adfb57803bc..91f819370f40 100644
--- a/src/coreclr/src/pal/src/exception/remote-unwind.cpp
+++ b/src/coreclr/src/pal/src/exception/remote-unwind.cpp
@@ -39,6 +39,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--*/
#ifdef HOST_UNIX
+
#include "config.h"
#include "pal/palinternal.h"
#include "pal/dbgmsg.h"
@@ -50,6 +51,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include
#include
+#ifdef __APPLE__
+#include
+#include
+#include
+#include
+#include "compact_unwind_encoding.h"
+#endif
+
// Sub-headers included from the libunwind.h contain an empty struct
// and clang issues a warning. Until the libunwind is fixed, disable
// the warning.
@@ -64,6 +73,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
SET_DEFAULT_DEBUG_CHANNEL(EXCEPT);
+#define TRACE_VERBOSE
+
#else // HOST_UNIX
#include
@@ -83,7 +94,6 @@ typedef BOOL(*UnwindReadMemoryCallback)(PVOID address, PVOID buffer, SIZE_T size
#undef ERROR
#define ERROR(x, ...)
-
#ifdef TARGET_64BIT
#define ElfW(foo) Elf64_ ## foo
#else // TARGET_64BIT
@@ -94,7 +104,7 @@ typedef BOOL(*UnwindReadMemoryCallback)(PVOID address, PVOID buffer, SIZE_T size
#endif // HOST_UNIX
-#if defined(HAVE_UNW_GET_ACCESSORS)
+#ifdef HAVE_UNW_GET_ACCESSORS
#ifdef HOST_UNIX
#include
@@ -125,7 +135,7 @@ typedef BOOL(*UnwindReadMemoryCallback)(PVOID address, PVOID buffer, SIZE_T size
#define Nhdr ElfW(Nhdr)
#define Dyn ElfW(Dyn)
-
+#ifndef FEATURE_USE_SYSTEM_LIBUNWIND
extern "C" int
_OOP_find_proc_info(
unw_word_t start_ip,
@@ -139,11 +149,11 @@ _OOP_find_proc_info(
unw_proc_info_t *pi,
int need_unwind_info,
void *arg);
+#endif // FEATURE_USE_SYSTEM_LIBUNWIND
+
+#endif // HAVE_UNW_GET_ACCESSORS
-extern void GetContextPointers(
- unw_cursor_t *cursor,
- unw_context_t *unwContext,
- KNONVOLATILE_CONTEXT_POINTERS *contextPointers);
+#if defined(__APPLE__) || defined(HAVE_UNW_GET_ACCESSORS)
typedef struct _libunwindInfo
{
@@ -152,6 +162,1293 @@ typedef struct _libunwindInfo
UnwindReadMemoryCallback ReadMemory;
} libunwindInfo;
+#if defined(__APPLE__) || defined(FEATURE_USE_SYSTEM_LIBUNWIND)
+
+#define EXTRACT_BITS(value, mask) ((value >> __builtin_ctz(mask)) & (((1 << __builtin_popcount(mask))) - 1))
+
+#define DW_EH_VERSION 1
+
+// DWARF Pointer-Encoding (PEs).
+//
+// Pointer-Encodings were invented for the GCC exception-handling
+// support for C++, but they represent a rather generic way of
+// describing the format in which an address/pointer is stored.
+// The Pointer-Encoding format is partially documented in Linux Base
+// Spec v1.3 (http://www.linuxbase.org/spec/).
+
+// These defines and struct (dwarf_cie_info) were copied from libunwind's dwarf.h
+
+#define DW_EH_PE_FORMAT_MASK 0x0f // format of the encoded value
+#define DW_EH_PE_APPL_MASK 0x70 // how the value is to be applied
+#define DW_EH_PE_indirect 0x80 // Flag bit. If set, the resulting pointer is the
+ // address of the word that contains the final address
+// Pointer-encoding formats
+#define DW_EH_PE_omit 0xff
+#define DW_EH_PE_ptr 0x00 // pointer-sized unsigned value
+#define DW_EH_PE_uleb128 0x01 // unsigned LE base-128 value
+#define DW_EH_PE_udata2 0x02 // unsigned 16-bit value
+#define DW_EH_PE_udata4 0x03 // unsigned 32-bit value
+#define DW_EH_PE_udata8 0x04 // unsigned 64-bit value
+#define DW_EH_PE_sleb128 0x09 // signed LE base-128 value
+#define DW_EH_PE_sdata2 0x0a // signed 16-bit value
+#define DW_EH_PE_sdata4 0x0b // signed 32-bit value
+#define DW_EH_PE_sdata8 0x0c // signed 64-bit value
+
+// Pointer-encoding application
+#define DW_EH_PE_absptr 0x00 // absolute value
+#define DW_EH_PE_pcrel 0x10 // rel. to addr. of encoded value
+#define DW_EH_PE_textrel 0x20 // text-relative (GCC-specific???)
+#define DW_EH_PE_datarel 0x30 // data-relative
+
+// The following are not documented by LSB v1.3, yet they are used by
+// GCC, presumably they aren't documented by LSB since they aren't
+// used on Linux
+#define DW_EH_PE_funcrel 0x40 // start-of-procedure-relative
+#define DW_EH_PE_aligned 0x50 // aligned pointer
+
+#define DWARF_CIE_VERSION 3 // GCC emits version 1???
+
+// DWARF frame header
+typedef struct __attribute__((packed)) _eh_frame_hdr
+{
+ unsigned char version;
+ unsigned char eh_frame_ptr_enc;
+ unsigned char fde_count_enc;
+ unsigned char table_enc;
+ // The rest of the header is variable-length and consists of the
+ // following members:
+ //
+ // encoded_t eh_frame_ptr;
+ // encoded_t fde_count;
+ // struct
+ // {
+ // encoded_t start_ip; // first address covered by this FDE
+ // encoded_t fde_offset; // offset of the FDE
+ // } binary_search_table[fde_count];
+} eh_frame_hdr;
+
+// "DW_EH_PE_datarel|DW_EH_PE_sdata4" encoded fde table entry
+typedef struct table_entry
+{
+ int32_t start_ip;
+ int32_t fde_offset;
+} table_entry_t;
+
+// DWARF unwind info
+typedef struct dwarf_cie_info
+{
+ unw_word_t cie_instr_start; // start addr. of CIE "initial_instructions"
+ unw_word_t cie_instr_end; // end addr. of CIE "initial_instructions"
+ unw_word_t fde_instr_start; // start addr. of FDE "instructions"
+ unw_word_t fde_instr_end; // end addr. of FDE "instructions"
+ unw_word_t code_align; // code-alignment factor
+ unw_word_t data_align; // data-alignment factor
+ unw_word_t ret_addr_column; // column of return-address register
+ unw_word_t handler; // address of personality-routine
+ uint16_t abi;
+ uint16_t tag;
+ uint8_t fde_encoding;
+ uint8_t lsda_encoding;
+ unsigned int sized_augmentation : 1;
+ unsigned int have_abi_marker : 1;
+ unsigned int signal_frame : 1;
+} dwarf_cie_info_t;
+
+static bool
+ReadValue8(
+ const libunwindInfo* info,
+ unw_word_t* addr,
+ uint8_t* valp)
+{
+ uint8_t value;
+ if (!info->ReadMemory((PVOID)*addr, &value, sizeof(value))) {
+ return false;
+ }
+ *addr += sizeof(value);
+ *valp = value;
+ return true;
+}
+
+static bool
+ReadValue16(
+ const libunwindInfo* info,
+ unw_word_t* addr,
+ uint16_t* valp)
+{
+ uint16_t value;
+ if (!info->ReadMemory((PVOID)*addr, &value, sizeof(value))) {
+ return false;
+ }
+ *addr += sizeof(value);
+ *valp = VAL16(value);
+ return true;
+}
+
+static bool
+ReadValue32(
+ const libunwindInfo* info,
+ unw_word_t* addr,
+ uint32_t* valp)
+{
+ uint32_t value;
+ if (!info->ReadMemory((PVOID)*addr, &value, sizeof(value))) {
+ return false;
+ }
+ *addr += sizeof(value);
+ *valp = VAL32(value);
+ return true;
+}
+
+static bool
+ReadValue64(
+ const libunwindInfo* info,
+ unw_word_t* addr,
+ uint64_t* valp)
+{
+ uint64_t value;
+ if (!info->ReadMemory((PVOID)*addr, &value, sizeof(value))) {
+ return false;
+ }
+ *addr += sizeof(value);
+ *valp = VAL64(value);
+ return true;
+}
+
+static bool
+ReadPointer(
+ const libunwindInfo* info,
+ unw_word_t* addr,
+ unw_word_t* valp)
+{
+#ifdef TARGET_64BIT
+ uint64_t val64;
+ if (ReadValue64(info, addr, &val64)) {
+ *valp = val64;
+ return true;
+ }
+#else
+ uint32_t val32;
+ if (ReadValue32(info, addr, &val32)) {
+ *valp = val32;
+ return true;
+ }
+#endif
+ return false;
+}
+
+// Read a unsigned "little-endian base 128" value. See Chapter 7.6 of DWARF spec v3.
+static bool
+ReadULEB128(
+ const libunwindInfo* info,
+ unw_word_t* addr,
+ unw_word_t* valp)
+{
+ unw_word_t value = 0;
+ unsigned char byte;
+ int shift = 0;
+
+ do
+ {
+ if (!ReadValue8(info, addr, &byte)) {
+ return false;
+ }
+ value |= ((unw_word_t)byte & 0x7f) << shift;
+ shift += 7;
+ } while (byte & 0x80);
+
+ *valp = value;
+ return true;
+}
+
+// Read a signed "little-endian base 128" value. See Chapter 7.6 of DWARF spec v3.
+static bool
+ReadSLEB128(
+ const libunwindInfo* info,
+ unw_word_t* addr,
+ unw_word_t* valp)
+{
+ unw_word_t value = 0;
+ unsigned char byte;
+ int shift = 0;
+
+ do
+ {
+ if (!ReadValue8(info, addr, &byte)) {
+ return false;
+ }
+ value |= ((unw_word_t)byte & 0x7f) << shift;
+ shift += 7;
+ } while (byte & 0x80);
+
+ if (((size_t)shift < (8 * sizeof(unw_word_t))) && ((byte & 0x40) != 0)) {
+ value |= ((unw_word_t)-1) << shift;
+ }
+
+ *valp = value;
+ return true;
+}
+
+static bool
+ReadEncodedPointer(
+ const libunwindInfo* info,
+ unw_word_t* addr,
+ unsigned char encoding,
+ unw_word_t funcRel,
+ unw_word_t* valp)
+{
+ unw_word_t initialAddr = *addr;
+ uint16_t value16;
+ uint32_t value32;
+ uint64_t value64;
+ unw_word_t value;
+
+ if (encoding == DW_EH_PE_omit)
+ {
+ *valp = 0;
+ return true;
+ }
+ else if (encoding == DW_EH_PE_aligned)
+ {
+ int size = sizeof(unw_word_t);
+ *addr = (initialAddr + size - 1) & -size;
+ return ReadPointer(info, addr, valp);
+ }
+
+ switch (encoding & DW_EH_PE_FORMAT_MASK)
+ {
+ case DW_EH_PE_ptr:
+ if (!ReadPointer(info, addr, &value)) {
+ return false;
+ }
+ break;
+
+ case DW_EH_PE_uleb128:
+ if (!ReadULEB128(info, addr, &value)) {
+ return false;
+ }
+ break;
+
+ case DW_EH_PE_sleb128:
+ if (!ReadSLEB128(info, addr, &value)) {
+ return false;
+ }
+ break;
+
+ case DW_EH_PE_udata2:
+ if (!ReadValue16(info, addr, &value16)) {
+ return false;
+ }
+ value = value16;
+ break;
+
+ case DW_EH_PE_udata4:
+ if (!ReadValue32(info, addr, &value32)) {
+ return false;
+ }
+ value = value32;
+ break;
+
+ case DW_EH_PE_udata8:
+ if (!ReadValue64(info, addr, &value64)) {
+ return false;
+ }
+ value = value64;
+ break;
+
+ case DW_EH_PE_sdata2:
+ if (!ReadValue16(info, addr, &value16)) {
+ return false;
+ }
+ value = (int16_t)value16;
+ break;
+
+ case DW_EH_PE_sdata4:
+ if (!ReadValue32(info, addr, &value32)) {
+ return false;
+ }
+ value = (int32_t)value32;
+ break;
+
+ case DW_EH_PE_sdata8:
+ if (!ReadValue64(info, addr, &value64)) {
+ return false;
+ }
+ value = (int64_t)value64;
+ break;
+
+ default:
+ ASSERT("ReadEncodedPointer: invalid encoding format %x\n", encoding);
+ return false;
+ }
+
+ // 0 is a special value and always absolute
+ if (value == 0) {
+ *valp = 0;
+ return true;
+ }
+
+ switch (encoding & DW_EH_PE_APPL_MASK)
+ {
+ case DW_EH_PE_absptr:
+ break;
+
+ case DW_EH_PE_pcrel:
+ value += initialAddr;
+ break;
+
+ case DW_EH_PE_funcrel:
+ _ASSERTE(funcRel != UINTPTR_MAX);
+ value += funcRel;
+ break;
+
+ case DW_EH_PE_textrel:
+ case DW_EH_PE_datarel:
+ default:
+ ASSERT("ReadEncodedPointer: invalid application type %x\n", encoding);
+ return false;
+ }
+
+ if (encoding & DW_EH_PE_indirect)
+ {
+ unw_word_t indirect_addr = value;
+ if (!ReadPointer(info, &indirect_addr, &value)) {
+ return false;
+ }
+ }
+
+ *valp = value;
+ return true;
+}
+
+template
+static bool
+BinarySearchEntries(
+ const libunwindInfo* info,
+ int32_t ip,
+ unw_word_t tableAddr,
+ size_t tableCount,
+ T* entry,
+ T* entryNext,
+ bool compressed,
+ bool* found)
+{
+ size_t low, high, mid;
+ unw_word_t addr;
+ int32_t functionOffset;
+
+ *found = false;
+
+ static_assert_no_msg(sizeof(T) >= sizeof(uint32_t));
+
+#ifdef __APPLE__
+ static_assert_no_msg(offsetof(unwind_info_section_header_index_entry, functionOffset) == 0);
+ static_assert_no_msg(sizeof(unwind_info_section_header_index_entry::functionOffset) == sizeof(uint32_t));
+
+ static_assert_no_msg(offsetof(unwind_info_regular_second_level_entry, functionOffset) == 0);
+ static_assert_no_msg(sizeof(unwind_info_regular_second_level_entry::functionOffset) == sizeof(uint32_t));
+
+ static_assert_no_msg(offsetof(unwind_info_section_header_lsda_index_entry, functionOffset) == 0);
+ static_assert_no_msg(sizeof(unwind_info_section_header_lsda_index_entry::functionOffset) == sizeof(uint32_t));
+#endif // __APPLE__
+
+ // Do a binary search on table
+ for (low = 0, high = tableCount; low < high;)
+ {
+ mid = (low + high) / 2;
+
+ // Assumes that the first uint32_t in T is the offset to compare
+ addr = tableAddr + (mid * sizeof(T));
+ if (!ReadValue32(info, &addr, (uint32_t*)&functionOffset)) {
+ return false;
+ }
+#ifdef __APPLE__
+ if (compressed) {
+ functionOffset = UNWIND_INFO_COMPRESSED_ENTRY_FUNC_OFFSET(functionOffset);
+ }
+#endif // __APPLE__
+ if (ip < functionOffset) {
+ high = mid;
+ }
+ else {
+ low = mid + 1;
+ }
+ }
+
+ if (high > 0)
+ {
+ *found = true;
+
+ addr = tableAddr + (high * sizeof(T));
+ if (!info->ReadMemory((PVOID)addr, entryNext, sizeof(T))) {
+ return false;
+ }
+ }
+ else
+ {
+ // When the ip isn't found return the last entry in the table
+ high = tableCount;
+
+ // No next entry
+ memset(entryNext, 0, sizeof(T));
+ }
+
+ addr = tableAddr + ((high - 1) * sizeof(T));
+ if (!info->ReadMemory((PVOID)addr, entry, sizeof(T))) {
+ return false;
+ }
+
+ return true;
+}
+
+static bool
+ParseCie(
+ const libunwindInfo* info,
+ unw_word_t addr,
+ dwarf_cie_info_t* dci)
+{
+ uint8_t ch, version, fdeEncoding, handlerEncoding;
+ unw_word_t cieLength, cieEndAddr;
+ uint32_t value32;
+ uint64_t value64;
+
+ memset(dci, 0, sizeof(dwarf_cie_info_t));
+
+ // Pick appropriate default for FDE-encoding. DWARF spec says
+ // start-IP (initial_location) and the code-size (address_range) are
+ // "address-unit sized constants". The `R' augmentation can be used
+ // to override this, but by default, we pick an address-sized unit
+ // for fde_encoding.
+#if TARGET_64BIT
+ fdeEncoding = DW_EH_PE_udata8;
+#else
+ fdeEncoding = DW_EH_PE_udata4;
+#endif
+
+ dci->lsda_encoding = DW_EH_PE_omit;
+ dci->handler = 0;
+
+ if (!ReadValue32(info, &addr, &value32)) {
+ return false;
+ }
+
+ if (value32 != 0xffffffff)
+ {
+ // The CIE is in the 32-bit DWARF format
+ uint32_t cieId;
+
+ // DWARF says CIE id should be 0xffffffff, but in .eh_frame, it's 0
+ const uint32_t expectedId = 0;
+
+ cieLength = value32;
+ cieEndAddr = addr + cieLength;
+
+ if (!ReadValue32(info, &addr, &cieId)) {
+ return false;
+ }
+ if (cieId != expectedId) {
+ ASSERT("ParseCie: unexpected cie id %x\n", cieId);
+ return false;
+ }
+ }
+ else
+ {
+ // The CIE is in the 64-bit DWARF format
+ uint64_t cieId;
+
+ // DWARF says CIE id should be 0xffffffffffffffff, but in .eh_frame, it's 0
+ const uint64_t expectedId = 0;
+
+ if (!ReadValue64(info, &addr, &value64)) {
+ return false;
+ }
+ cieLength = value64;
+ cieEndAddr = addr + cieLength;
+
+ if (!ReadValue64(info, &addr, &cieId)) {
+ return false;
+ }
+ if (cieId != expectedId) {
+ ASSERT("ParseCie: unexpected cie id %lx\n", cieId);
+ return false;
+ }
+ }
+ dci->cie_instr_end = cieEndAddr;
+
+ if (!ReadValue8(info, &addr, &version)) {
+ return false;
+ }
+ if (version != 1 && version != DWARF_CIE_VERSION) {
+ ASSERT("ParseCie: invalid cie version %x\n", version);
+ return false;
+ }
+
+ // Read the augmentation string
+ uint8_t augmentationString[8];
+ memset(augmentationString, 0, sizeof(augmentationString));
+
+ for (size_t i = 0; i < sizeof(augmentationString); i++)
+ {
+ if (!ReadValue8(info, &addr, &ch)) {
+ return false;
+ }
+ if (ch == 0) {
+ break;
+ }
+ augmentationString[i] = ch;
+ }
+
+ // Read the code and data alignment
+ if (!ReadULEB128(info, &addr, &dci->code_align)) {
+ return false;
+ }
+ if (!ReadSLEB128(info, &addr, &dci->data_align)) {
+ return false;
+ }
+
+ // Read the return-address column either as a u8 or as a uleb128
+ if (version == 1)
+ {
+ if (!ReadValue8(info, &addr, &ch)) {
+ return false;
+ }
+ dci->ret_addr_column = ch;
+ }
+ else
+ {
+ if (!ReadULEB128(info, &addr, &dci->ret_addr_column)) {
+ return false;
+ }
+ }
+
+ // Parse the augmentation string
+ for (size_t i = 0; i < sizeof(augmentationString); i++)
+ {
+ bool done = false;
+ unw_word_t augmentationSize;
+
+ switch (augmentationString[i])
+ {
+ case '\0':
+ done = true;
+ break;
+
+ case 'z':
+ dci->sized_augmentation = 1;
+ if (!ReadULEB128(info, &addr, &augmentationSize)) {
+ return false;
+ }
+ break;
+
+ case 'L':
+ // read the LSDA pointer-encoding format
+ if (!ReadValue8(info, &addr, &ch)) {
+ return false;
+ }
+ dci->lsda_encoding = ch;
+ break;
+
+ case 'R':
+ // read the FDE pointer-encoding format
+ if (!ReadValue8(info, &addr, &fdeEncoding)) {
+ return false;
+ }
+ break;
+
+ case 'P':
+ // read the personality-routine pointer-encoding format
+ if (!ReadValue8(info, &addr, &handlerEncoding)) {
+ return false;
+ }
+ if (!ReadEncodedPointer(info, &addr, handlerEncoding, UINTPTR_MAX, &dci->handler)) {
+ return false;
+ }
+ break;
+
+ case 'S':
+ // This is a signal frame
+ dci->signal_frame = 1;
+
+ // Temporarily set it to one so dwarf_parse_fde() knows that
+ // it should fetch the actual ABI/TAG pair from the FDE.
+ dci->have_abi_marker = 1;
+ break;
+
+ default:
+ if (dci->sized_augmentation) {
+ // If we have the size of the augmentation body, we can skip
+ // over the parts that we don't understand, so we're OK
+ done = true;
+ break;
+ }
+ ASSERT("ParseCie: unexpected argumentation string '%s'\n", augmentationString[i]);
+ return false;
+ }
+
+ if (done) {
+ break;
+ }
+ }
+ dci->fde_encoding = fdeEncoding;
+ dci->cie_instr_start = addr;
+ return true;
+}
+
+static bool
+ExtractFde(
+ const libunwindInfo* info,
+ unw_word_t* addr,
+ unw_word_t* fdeEndAddr,
+ unw_word_t* ipStart,
+ unw_word_t* ipEnd,
+ dwarf_cie_info_t* dci)
+{
+ unw_word_t cieOffsetAddr, cieAddr;
+ uint32_t value32;
+ uint64_t value64;
+
+ *fdeEndAddr = 0;
+ *ipStart = UINT64_MAX;
+ *ipEnd = 0;
+
+ if (!ReadValue32(info, addr, &value32)) {
+ return false;
+ }
+ if (value32 != 0xffffffff)
+ {
+ int32_t cieOffset = 0;
+
+ // In some configurations, an FDE with a 0 length indicates the end of the FDE-table
+ if (value32 == 0) {
+ return false;
+ }
+ // the FDE is in the 32-bit DWARF format */
+ *fdeEndAddr = *addr + value32;
+ cieOffsetAddr = *addr;
+
+ if (!ReadValue32(info, addr, (uint32_t*)&cieOffset)) {
+ return false;
+ }
+ // Ignore CIEs (happens during linear search)
+ if (cieOffset == 0) {
+ return true;
+ }
+ // DWARF says that the CIE_pointer in the FDE is a .debug_frame-relative offset,
+ // but the GCC-generated .eh_frame sections instead store a "pcrelative" offset,
+ // which is just as fine as it's self-contained
+ cieAddr = cieOffsetAddr - cieOffset;
+ }
+ else
+ {
+ int64_t cieOffset = 0;
+
+ // the FDE is in the 64-bit DWARF format */
+ if (!ReadValue64(info, addr, (uint64_t*)&value64)) {
+ return false;
+ }
+ *fdeEndAddr = *addr + value64;
+ cieOffsetAddr = *addr;
+
+ if (!ReadValue64(info, addr, (uint64_t*)&cieOffset)) {
+ return false;
+ }
+ // Ignore CIEs (happens during linear search)
+ if (cieOffset == 0) {
+ return true;
+ }
+ // DWARF says that the CIE_pointer in the FDE is a .debug_frame-relative offset,
+ // but the GCC-generated .eh_frame sections instead store a "pcrelative" offset,
+ // which is just as fine as it's self-contained
+ cieAddr = (unw_word_t)((uint64_t)cieOffsetAddr - cieOffset);
+ }
+
+ if (!ParseCie(info, cieAddr, dci)) {
+ return false;
+ }
+
+ unw_word_t start, range;
+ if (!ReadEncodedPointer(info, addr, dci->fde_encoding, UINTPTR_MAX, &start)) {
+ return false;
+ }
+
+ // IP-range has same encoding as FDE pointers, except that it's always an absolute value
+ uint8_t ipRangeEncoding = dci->fde_encoding & DW_EH_PE_FORMAT_MASK;
+ if (!ReadEncodedPointer(info, addr, ipRangeEncoding, UINTPTR_MAX, &range)) {
+ return false;
+ }
+
+ *ipStart = start;
+ *ipEnd = start + range;
+
+ return true;
+}
+
+static bool
+ExtractProcInfoFromFde(
+ const libunwindInfo* info,
+ unw_word_t* addrp,
+ unw_proc_info_t *pip,
+ int need_unwind_info)
+{
+ unw_word_t addr = *addrp;
+
+ unw_word_t ipStart, ipEnd;
+ unw_word_t fdeEndAddr;
+ dwarf_cie_info_t dci;
+ if (!ExtractFde(info, &addr, &fdeEndAddr, &ipStart, &ipEnd, &dci)) {
+ return false;
+ }
+ *addrp = fdeEndAddr;
+
+ pip->start_ip = ipStart;
+ pip->end_ip = ipEnd;
+ pip->handler = dci.handler;
+
+ unw_word_t augmentationSize, augmentationEndAddr;
+ if (dci.sized_augmentation) {
+ if (!ReadULEB128(info, &addr, &augmentationSize)) {
+ return false;
+ }
+ augmentationEndAddr = addr + augmentationSize;
+ }
+
+ // Read language specific data area address
+ if (!ReadEncodedPointer(info, &addr, dci.lsda_encoding, pip->start_ip, &pip->lsda)) {
+ return false;
+ }
+
+ // Now fill out the proc info if requested
+ if (need_unwind_info)
+ {
+ if (dci.have_abi_marker)
+ {
+ if (!ReadValue16(info, &addr, &dci.abi)) {
+ return false;
+ }
+ if (!ReadValue16(info, &addr, &dci.tag)) {
+ return false;
+ }
+ }
+ if (dci.sized_augmentation) {
+ dci.fde_instr_start = augmentationEndAddr;
+ }
+ else {
+ dci.fde_instr_start = addr;
+ }
+ dci.fde_instr_end = fdeEndAddr;
+
+ pip->format = UNW_INFO_FORMAT_TABLE;
+ pip->unwind_info_size = sizeof(dci);
+ pip->unwind_info = malloc(sizeof(dci));
+ if (pip->unwind_info == nullptr) {
+ return -UNW_ENOMEM;
+ }
+ memcpy(pip->unwind_info, &dci, sizeof(dci));
+ }
+
+ return true;
+}
+
+#ifdef __APPLE__
+
+static bool
+SearchCompactEncodingSection(
+ const libunwindInfo* info,
+ unw_word_t ip,
+ unw_word_t compactUnwindSectionAddr,
+ unw_proc_info_t *pip)
+{
+ unwind_info_section_header sectionHeader;
+ if (!info->ReadMemory((PVOID)compactUnwindSectionAddr, §ionHeader, sizeof(sectionHeader))) {
+ return false;
+ }
+ TRACE("Unwind ver %d common off: %08x common cnt: %d pers off: %08x pers cnt: %d index off: %08x index cnt: %d\n",
+ sectionHeader.version,
+ sectionHeader.commonEncodingsArraySectionOffset,
+ sectionHeader.commonEncodingsArrayCount,
+ sectionHeader.personalityArraySectionOffset,
+ sectionHeader.personalityArrayCount,
+ sectionHeader.indexSectionOffset,
+ sectionHeader.indexCount);
+
+ if (sectionHeader.version != UNWIND_SECTION_VERSION) {
+ return false;
+ }
+
+ int32_t offset = ip - info->BaseAddress;
+ unwind_info_section_header_index_entry entry;
+ unwind_info_section_header_index_entry entryNext;
+ bool found;
+ if (!BinarySearchEntries(info, offset, compactUnwindSectionAddr + sectionHeader.indexSectionOffset, sectionHeader.indexCount, &entry, &entryNext, false, &found)) {
+ return false;
+ }
+ if (!found) {
+ ERROR("Top level index not found\n");
+ return false;
+ }
+
+ uint32_t firstLevelFunctionOffset = entry.functionOffset;
+ uint32_t firstLevelNextPageFunctionOffset = entryNext.functionOffset;
+
+ unw_word_t secondLevelAddr = compactUnwindSectionAddr + entry.secondLevelPagesSectionOffset;
+ unw_word_t lsdaArrayStartAddr = compactUnwindSectionAddr + entry.lsdaIndexArraySectionOffset;
+ unw_word_t lsdaArrayEndAddr = compactUnwindSectionAddr + entryNext.lsdaIndexArraySectionOffset;
+
+ uint32_t encoding = 0;
+ unw_word_t funcStart = 0;
+ unw_word_t funcEnd = 0;
+ unw_word_t lsda = 0;
+ unw_word_t personality = 0;
+
+ uint32_t pageKind;
+ if (!info->ReadMemory((PVOID)secondLevelAddr, &pageKind, sizeof(pageKind))) {
+ return false;
+ }
+ if (pageKind == UNWIND_SECOND_LEVEL_REGULAR)
+ {
+ unwind_info_regular_second_level_page_header pageHeader;
+ if (!info->ReadMemory((PVOID)secondLevelAddr, &pageHeader, sizeof(pageHeader))) {
+ return false;
+ }
+
+ unwind_info_regular_second_level_entry pageEntry;
+ unwind_info_regular_second_level_entry pageEntryNext;
+ if (!BinarySearchEntries(info, offset, secondLevelAddr + pageHeader.entryPageOffset, pageHeader.entryCount, &pageEntry, &pageEntryNext, false, &found)) {
+ return false;
+ }
+
+ encoding = pageEntry.encoding;
+ TRACE("Second level regular: %08x for offset %08x\n", encoding, offset);
+ funcStart = pageEntry.functionOffset + info->BaseAddress;
+ if (found) {
+ funcEnd = pageEntryNext.functionOffset + info->BaseAddress;
+ }
+ else {
+ funcEnd = firstLevelNextPageFunctionOffset + info->BaseAddress;
+ TRACE("Second level regular pageEntry not found start %p end %p\n", (void*)funcStart, (void*)funcEnd);
+ }
+
+ if (ip < funcStart || ip > funcEnd) {
+ ERROR("ip %p not in regular second level\n", (void*)ip);
+ return false;
+ }
+ }
+ else if (pageKind == UNWIND_SECOND_LEVEL_COMPRESSED)
+ {
+ unwind_info_compressed_second_level_page_header pageHeader;
+ if (!info->ReadMemory((PVOID)secondLevelAddr, &pageHeader, sizeof(pageHeader))) {
+ return false;
+ }
+
+ uint32_t pageOffset = offset - firstLevelFunctionOffset;
+ uint32_t pageEntry;
+ uint32_t pageEntryNext;
+ if (!BinarySearchEntries(info, pageOffset, secondLevelAddr + pageHeader.entryPageOffset, pageHeader.entryCount, &pageEntry, &pageEntryNext, true, &found)) {
+ return false;
+ }
+
+ funcStart = UNWIND_INFO_COMPRESSED_ENTRY_FUNC_OFFSET(pageEntry) + firstLevelFunctionOffset + info->BaseAddress;
+ if (found) {
+ funcEnd = UNWIND_INFO_COMPRESSED_ENTRY_FUNC_OFFSET(pageEntryNext) + firstLevelFunctionOffset + info->BaseAddress;
+ }
+ else {
+ funcEnd = firstLevelNextPageFunctionOffset + info->BaseAddress;
+ TRACE("Second level compressed pageEntry not found start %p end %p\n", (void*)funcStart, (void*)funcEnd);
+ }
+
+ if (ip < funcStart || ip > funcEnd) {
+ ERROR("ip %p not in compressed second level\n", (void*)ip);
+ return false;
+ }
+
+ uint16_t encodingIndex = UNWIND_INFO_COMPRESSED_ENTRY_ENCODING_INDEX(pageEntry);
+ if (encodingIndex < sectionHeader.commonEncodingsArrayCount)
+ {
+ // Encoding is in common table in section header
+ unw_word_t addr = compactUnwindSectionAddr + sectionHeader.commonEncodingsArraySectionOffset + (encodingIndex * sizeof(uint32_t));
+ if (!ReadValue32(info, &addr, &encoding)) {
+ return false;
+ }
+ TRACE("Second level compressed common table: %08x for offset %08x\n", encoding, pageOffset);
+ }
+ else
+ {
+ // Encoding is in page specific table
+ uint16_t pageEncodingIndex = encodingIndex - (uint16_t)sectionHeader.commonEncodingsArrayCount;
+ if (pageEncodingIndex >= pageHeader.encodingsCount) {
+ ERROR("pageEncodingIndex(%d) > page specific table encodingsCount(%d)\n", pageEncodingIndex, pageHeader.encodingsCount);
+ return false;
+ }
+ unw_word_t addr = secondLevelAddr + pageHeader.encodingsPageOffset + (pageEncodingIndex * sizeof(uint32_t));
+ if (!ReadValue32(info, &addr, &encoding)) {
+ return false;
+ }
+ TRACE("Second level compressed page specific table: %08x for offset %08x\n", encoding, pageOffset);
+ }
+ }
+ else
+ {
+ ERROR("Invalid __unwind_info\n");
+ return false;
+ }
+
+ if (encoding & UNWIND_HAS_LSDA)
+ {
+ uint32_t funcStartOffset = funcStart - info->BaseAddress;
+ size_t lsdaArrayCount = (lsdaArrayEndAddr - lsdaArrayStartAddr) / sizeof(unwind_info_section_header_lsda_index_entry);
+
+ unwind_info_section_header_lsda_index_entry lsdaEntry;
+ unwind_info_section_header_lsda_index_entry lsdaEntryNext;
+ if (!BinarySearchEntries(info, funcStartOffset, lsdaArrayStartAddr, lsdaArrayCount, &lsdaEntry, &lsdaEntryNext, false, &found)) {
+ return false;
+ }
+ if (!found || funcStartOffset != lsdaEntry.functionOffset || lsdaEntry.lsdaOffset == 0) {
+ ERROR("lsda not found(%d), not exact match (%08x != %08x) or lsda(%08x) == 0\n",
+ found, funcStartOffset, lsdaEntry.functionOffset, lsdaEntry.lsdaOffset);
+ return false;
+ }
+ lsda = lsdaEntry.lsdaOffset + info->BaseAddress;
+ }
+
+ uint32_t personalityIndex = (encoding & UNWIND_PERSONALITY_MASK) >> (__builtin_ctz(UNWIND_PERSONALITY_MASK));
+ if (personalityIndex != 0)
+ {
+ --personalityIndex; // change 1-based to zero-based index
+ if (personalityIndex > sectionHeader.personalityArrayCount)
+ {
+ ERROR("Invalid personality index\n");
+ return false;
+ }
+ int32_t personalityDelta;
+ unw_word_t addr = compactUnwindSectionAddr + sectionHeader.personalityArraySectionOffset + personalityIndex * sizeof(uint32_t);
+ if (!ReadValue32(info, &addr, (uint32_t*)&personalityDelta)) {
+ return false;
+ }
+ addr = personalityDelta + info->BaseAddress;
+ if (!ReadPointer(info, &addr, &personality)) {
+ return false;
+ }
+ }
+
+ pip->start_ip = funcStart;
+ pip->end_ip = funcEnd;
+ pip->lsda = lsda;
+ pip->handler = personality;
+ pip->gp = 0;
+ pip->flags = 0;
+ pip->format = encoding;
+ pip->unwind_info = 0;
+ pip->unwind_info_size = 0;
+
+ TRACE("Encoding %08x start %p end %p found for ip %p\n", encoding, (void*)funcStart, (void*)funcEnd, (void*)ip);
+ return true;
+}
+
+static bool
+SearchDwarfSection(
+ const libunwindInfo* info,
+ unw_word_t ip,
+ unw_word_t dwarfSectionAddr,
+ unw_word_t dwarfSectionSize,
+ uint32_t fdeSectionHint,
+ unw_proc_info_t *pip,
+ int need_unwind_info)
+{
+ unw_word_t addr = dwarfSectionAddr + fdeSectionHint;
+ unw_word_t fdeAddr;
+ while (addr < (dwarfSectionAddr + dwarfSectionSize))
+ {
+ fdeAddr = addr;
+
+ unw_word_t ipStart, ipEnd;
+ unw_word_t fdeEndAddr;
+ dwarf_cie_info_t dci;
+ if (!ExtractFde(info, &addr, &fdeEndAddr, &ipStart, &ipEnd, &dci)) {
+ ERROR("ExtractFde FAILED for ip %p\n", (void*)ip);
+ break;
+ }
+ if (ip >= ipStart && ip < ipEnd) {
+ if (!ExtractProcInfoFromFde(info, &fdeAddr, pip, need_unwind_info)) {
+ ERROR("ExtractProcInfoFromFde FAILED for ip %p\n", (void*)ip);
+ break;
+ }
+ return true;
+ }
+ addr = fdeEndAddr;
+ }
+ return false;
+}
+
+
+static bool
+GetProcInfo(unw_word_t ip, unw_proc_info_t *pip, const libunwindInfo* info, bool* step, int need_unwind_info)
+{
+ memset(pip, 0, sizeof(*pip));
+ *step = false;
+
+ mach_header_64 header;
+ if (!info->ReadMemory((void*)info->BaseAddress, &header, sizeof(mach_header_64))) {
+ ERROR("Reading header %p\n", (void*)info->BaseAddress);
+ return false;
+ }
+ // Read load commands
+ void* commandsAddress = (void*)(info->BaseAddress + sizeof(mach_header_64));
+ load_command* commands = (load_command*)malloc(header.sizeofcmds);
+ if (commands == nullptr)
+ {
+ ERROR("Failed to allocate %d byte load commands\n", header.sizeofcmds);
+ return false;
+ }
+ if (!info->ReadMemory(commandsAddress, commands, header.sizeofcmds))
+ {
+ ERROR("Failed to read load commands at %p of %d\n", commandsAddress, header.sizeofcmds);
+ return false;
+ }
+ unw_word_t compactUnwindSectionAddr = 0;
+ unw_word_t compactUnwindSectionSize = 0;
+ unw_word_t ehframeSectionAddr = 0;
+ unw_word_t ehframeSectionSize = 0;
+ mach_vm_address_t loadBias = 0;
+
+ load_command* command = commands;
+ for (int i = 0; i < header.ncmds; i++)
+ {
+ if (command->cmd == LC_SEGMENT_64)
+ {
+ segment_command_64* segment = (segment_command_64*)command;
+
+ // Calculate the load bias for the module. This is the value to add to the vmaddr of a
+ // segment to get the actual address.
+ if (strcmp(segment->segname, SEG_TEXT) == 0)
+ {
+ loadBias = info->BaseAddress - segment->vmaddr;
+ TRACE_VERBOSE("CMD: load bias %016llx\n", loadBias);
+ }
+
+ section_64* section = (section_64*)((uint64_t)segment + sizeof(segment_command_64));
+ for (int s = 0; s < segment->nsects; s++, section++)
+ {
+ TRACE_VERBOSE(" addr %016llx size %016llx off %08x align %02x flags %02x %s %s\n",
+ section->addr,
+ section->size,
+ section->offset,
+ section->align,
+ section->flags,
+ section->segname,
+ section->sectname);
+
+ if (strcmp(section->sectname, "__unwind_info") == 0)
+ {
+ compactUnwindSectionAddr = section->addr + loadBias;
+ compactUnwindSectionSize = section->size;
+ }
+ if (strcmp(section->sectname, "__eh_frame") == 0)
+ {
+ ehframeSectionAddr = section->addr + loadBias;
+ ehframeSectionSize = section->size;
+ }
+ }
+ }
+ // Get next load command
+ command = (load_command*)((char*)command + command->cmdsize);
+ }
+
+ // If there is a compact unwind encoding table, look there first
+ if (compactUnwindSectionAddr != 0)
+ {
+ if (SearchCompactEncodingSection(info, ip, compactUnwindSectionAddr, pip))
+ {
+ if (ehframeSectionAddr != 0)
+ {
+#ifdef TARGET_AMD64
+ if ((pip->format & UNWIND_X86_64_MODE_MASK) == UNWIND_X86_64_MODE_DWARF)
+ {
+ uint32_t dwarfOffsetHint = pip->format & UNWIND_X86_64_DWARF_SECTION_OFFSET;
+#elif TARGET_ARM64
+ if ((pip->format & UNWIND_ARM64_MODE_MASK) == UNWIND_ARM64_MODE_DWARF)
+ {
+ uint32_t dwarfOffsetHint = pip->format & UNWIND_ARM64_DWARF_SECTION_OFFSET;
+#else
+#error unsupported architecture
+#endif
+ if (SearchDwarfSection(info, ip, ehframeSectionAddr, ehframeSectionSize, dwarfOffsetHint, pip, need_unwind_info)) {
+ TRACE("SUCCESS: found in eh frame from compact hint for %p\n", (void*)ip);
+ return true;
+ }
+ }
+ }
+ // Need to do a compact step based on pip->format and pip->start_ip
+ TRACE("Compact step %p format %08x start_ip %p\n", (void*)ip, pip->format, (void*)pip->start_ip);
+ *step = true;
+ return true;
+ }
+ }
+
+ // Look in dwarf unwind info next
+ if (ehframeSectionAddr != 0)
+ {
+ if (SearchDwarfSection(info, ip, ehframeSectionAddr, ehframeSectionSize, 0, pip, need_unwind_info)) {
+ TRACE("SUCCESS: found in eh frame for %p\n", (void*)ip);
+ return true;
+ }
+ }
+
+ ERROR("Unwind info not found for %p format %08x\n", (void*)ip, pip->format);
+ return false;
+}
+
+static bool
+StepWithCompactEncodingRBPFrame(const libunwindInfo* info, compact_unwind_encoding_t compactEncoding)
+{
+ CONTEXT* context = info->Context;
+ uint32_t savedRegistersOffset = EXTRACT_BITS(compactEncoding, UNWIND_X86_64_RBP_FRAME_OFFSET);
+ uint32_t savedRegistersLocations = EXTRACT_BITS(compactEncoding, UNWIND_X86_64_RBP_FRAME_REGISTERS);
+ unw_word_t savedRegisters = context->Rbp - (sizeof(uint64_t) * savedRegistersOffset);
+
+ // See compact_unwind_encoding.h for the format bit layout details
+ for (int i = 0; i < 5; ++i)
+ {
+ switch (savedRegistersLocations & 0x7)
+ {
+ case UNWIND_X86_64_REG_NONE:
+ // no register saved in this slot
+ break;
+ case UNWIND_X86_64_REG_RBX:
+ if (!ReadValue64(info, &savedRegisters, (uint64_t*)&context->Rbx)) {
+ return false;
+ }
+ break;
+ case UNWIND_X86_64_REG_R12:
+ if (!ReadValue64(info, &savedRegisters, (uint64_t*)&context->R12)) {
+ return false;
+ }
+ break;
+ case UNWIND_X86_64_REG_R13:
+ if (!ReadValue64(info, &savedRegisters, (uint64_t*)&context->R13)) {
+ return false;
+ }
+ break;
+ case UNWIND_X86_64_REG_R14:
+ if (!ReadValue64(info, &savedRegisters, (uint64_t*)&context->R14)) {
+ return false;
+ }
+ break;
+ case UNWIND_X86_64_REG_R15:
+ if (!ReadValue64(info, &savedRegisters, (uint64_t*)&context->R15)) {
+ return false;
+ }
+ break;
+ default:
+ ERROR("Invalid register for RBP frame %08x\n", compactEncoding);
+ return false;
+ }
+ savedRegistersLocations = (savedRegistersLocations >> 3);
+ }
+ uint64_t rbp = context->Rbp;
+
+ // ebp points to old ebp
+ unw_word_t addr = rbp;
+ if (!ReadValue64(info, &addr, (uint64_t*)&context->Rbp)) {
+ return false;
+ }
+
+ // old esp is ebp less saved ebp and return address
+ context->Rsp = rbp + (sizeof(uint64_t) * 2);
+
+ // pop return address into eip
+ addr = rbp + sizeof(uint64_t);
+ if (!ReadValue64(info, &addr, (uint64_t*)&context->Rip)) {
+ return false;
+ }
+
+ TRACE("SUCCESS: compact step encoding %08x rip %p rsp %p rbp %p\n",
+ compactEncoding, (void*)context->Rip, (void*)context->Rsp, (void*)context->Rbp);
+ return true;
+}
+
+static bool
+StepWithCompactEncoding(const libunwindInfo* info, compact_unwind_encoding_t compactEncoding, unw_word_t functionStart)
+{
+ if (compactEncoding == 0)
+ {
+ TRACE("Compact unwind missing for %p\n", (void*)info->Context->Rip);
+ return false;
+ }
+ switch (compactEncoding & UNWIND_X86_64_MODE_MASK)
+ {
+ case UNWIND_X86_64_MODE_RBP_FRAME:
+ return StepWithCompactEncodingRBPFrame(info, compactEncoding);
+
+ case UNWIND_X86_64_MODE_STACK_IMMD:
+ case UNWIND_X86_64_MODE_STACK_IND:
+ break;
+
+ }
+ ERROR("Invalid encoding %08x\n", compactEncoding);
+ return false;
+}
+
+#endif // __APPLE__
+
+#endif // defined(__APPLE__) || defined(FEATURE_USE_SYSTEM_LIBUNWIND)
+
+static void GetContextPointer(unw_cursor_t *cursor, unw_context_t *unwContext, int reg, SIZE_T **contextPointer)
+{
+#if defined(HAVE_UNW_GET_SAVE_LOC)
+ unw_save_loc_t saveLoc;
+ unw_get_save_loc(cursor, reg, &saveLoc);
+ if (saveLoc.type == UNW_SLT_MEMORY)
+ {
+ SIZE_T *pLoc = (SIZE_T *)saveLoc.u.addr;
+ // Filter out fake save locations that point to unwContext
+ if (unwContext == NULL || (pLoc < (SIZE_T *)unwContext) || ((SIZE_T *)(unwContext + 1) <= pLoc))
+ *contextPointer = (SIZE_T *)saveLoc.u.addr;
+ }
+#else
+ // Returning NULL indicates that we don't have context pointers available
+ *contextPointer = NULL;
+#endif
+}
+
+static void GetContextPointers(unw_cursor_t *cursor, unw_context_t *unwContext, KNONVOLATILE_CONTEXT_POINTERS *contextPointers)
+{
+#if (defined(HOST_UNIX) && defined(HOST_AMD64)) || (defined(HOST_WINDOWS) && defined(TARGET_AMD64))
+ GetContextPointer(cursor, unwContext, UNW_X86_64_RBP, &contextPointers->Rbp);
+ GetContextPointer(cursor, unwContext, UNW_X86_64_RBX, &contextPointers->Rbx);
+ GetContextPointer(cursor, unwContext, UNW_X86_64_R12, &contextPointers->R12);
+ GetContextPointer(cursor, unwContext, UNW_X86_64_R13, &contextPointers->R13);
+ GetContextPointer(cursor, unwContext, UNW_X86_64_R14, &contextPointers->R14);
+ GetContextPointer(cursor, unwContext, UNW_X86_64_R15, &contextPointers->R15);
+#elif (defined(HOST_UNIX) && defined(HOST_X86)) || (defined(HOST_WINDOWS) && defined(TARGET_X86))
+ GetContextPointer(cursor, unwContext, UNW_X86_EBX, &contextPointers->Ebx);
+ GetContextPointer(cursor, unwContext, UNW_X86_EBP, &contextPointers->Ebp);
+ GetContextPointer(cursor, unwContext, UNW_X86_ESI, &contextPointers->Esi);
+ GetContextPointer(cursor, unwContext, UNW_X86_EDI, &contextPointers->Edi);
+#elif (defined(HOST_UNIX) && defined(HOST_ARM)) || (defined(HOST_WINDOWS) && defined(TARGET_ARM))
+ GetContextPointer(cursor, unwContext, UNW_ARM_R4, &contextPointers->R4);
+ GetContextPointer(cursor, unwContext, UNW_ARM_R5, &contextPointers->R5);
+ GetContextPointer(cursor, unwContext, UNW_ARM_R6, &contextPointers->R6);
+ GetContextPointer(cursor, unwContext, UNW_ARM_R7, &contextPointers->R7);
+ GetContextPointer(cursor, unwContext, UNW_ARM_R8, &contextPointers->R8);
+ GetContextPointer(cursor, unwContext, UNW_ARM_R9, &contextPointers->R9);
+ GetContextPointer(cursor, unwContext, UNW_ARM_R10, &contextPointers->R10);
+ GetContextPointer(cursor, unwContext, UNW_ARM_R11, &contextPointers->R11);
+#elif (defined(HOST_UNIX) && defined(HOST_ARM64)) || (defined(HOST_WINDOWS) && defined(TARGET_ARM64))
+ GetContextPointer(cursor, unwContext, UNW_AARCH64_X19, &contextPointers->X19);
+ GetContextPointer(cursor, unwContext, UNW_AARCH64_X20, &contextPointers->X20);
+ GetContextPointer(cursor, unwContext, UNW_AARCH64_X21, &contextPointers->X21);
+ GetContextPointer(cursor, unwContext, UNW_AARCH64_X22, &contextPointers->X22);
+ GetContextPointer(cursor, unwContext, UNW_AARCH64_X23, &contextPointers->X23);
+ GetContextPointer(cursor, unwContext, UNW_AARCH64_X24, &contextPointers->X24);
+ GetContextPointer(cursor, unwContext, UNW_AARCH64_X25, &contextPointers->X25);
+ GetContextPointer(cursor, unwContext, UNW_AARCH64_X26, &contextPointers->X26);
+ GetContextPointer(cursor, unwContext, UNW_AARCH64_X27, &contextPointers->X27);
+ GetContextPointer(cursor, unwContext, UNW_AARCH64_X28, &contextPointers->X28);
+ GetContextPointer(cursor, unwContext, UNW_AARCH64_X29, &contextPointers->Fp);
+#else
+#error unsupported architecture
+#endif
+}
+
static void UnwindContextToContext(unw_cursor_t *cursor, CONTEXT *winContext)
{
#if (defined(HOST_UNIX) && defined(HOST_AMD64)) || (defined(HOST_WINDOWS) && defined(TARGET_AMD64))
@@ -294,7 +1591,7 @@ access_reg(unw_addr_space_t as, unw_regnum_t regnum, unw_word_t *valp, int write
ASSERT("Attempt to read an unknown register %d\n", regnum);
return -UNW_EBADREG;
}
- TRACE("REG: %d %p\n", regnum, *valp);
+ TRACE("REG: %d %p\n", regnum, (void*)*valp);
return UNW_ESUCCESS;
}
@@ -323,6 +1620,14 @@ static int
find_proc_info(unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pip, int need_unwind_info, void *arg)
{
const auto *info = (libunwindInfo*)arg;
+#ifdef __APPLE__
+ bool step;
+ if (!GetProcInfo(ip, pip, info, &step, need_unwind_info)) {
+ return -UNW_EINVAL;
+ }
+ _ASSERTE(!step);
+ return UNW_ESUCCESS;
+#else
memset(pip, 0, sizeof(*pip));
Ehdr ehdr;
@@ -423,7 +1728,82 @@ find_proc_info(unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pip, int nee
}
}
+#ifdef FEATURE_USE_SYSTEM_LIBUNWIND
+ if (ehFrameHdrAddr == 0) {
+ ASSERT("ELF: No PT_GNU_EH_FRAME program header\n");
+ return -UNW_EINVAL;
+ }
+ eh_frame_hdr ehFrameHdr;
+ if (!info->ReadMemory((PVOID)ehFrameHdrAddr, &ehFrameHdr, sizeof(eh_frame_hdr))) {
+ ERROR("ELF: reading ehFrameHdrAddr %p\n", ehFrameHdrAddr);
+ return -UNW_EINVAL;
+ }
+ TRACE("ehFrameHdrAddr %p version %d eh_frame_ptr_enc %d fde_count_enc %d table_enc %d\n",
+ ehFrameHdrAddr, ehFrameHdr.version, ehFrameHdr.eh_frame_ptr_enc, ehFrameHdr.fde_count_enc, ehFrameHdr.table_enc);
+
+ if (ehFrameHdr.version != DW_EH_VERSION) {
+ ASSERT("ehFrameHdr version %x not supported\n", ehFrameHdr.version);
+ return -UNW_EBADVERSION;
+ }
+ unw_word_t addr = ehFrameHdrAddr + sizeof(eh_frame_hdr);
+ unw_word_t ehFrameStart;
+ unw_word_t fdeCount;
+
+ // Decode the eh_frame_hdr info
+ if (!ReadEncodedPointer(info, &addr, ehFrameHdr.eh_frame_ptr_enc, UINTPTR_MAX, &ehFrameStart)) {
+ ERROR("decoding eh_frame_ptr\n");
+ return -UNW_EINVAL;
+ }
+ if (!ReadEncodedPointer(info, &addr, ehFrameHdr.fde_count_enc, UINTPTR_MAX, &fdeCount)) {
+ ERROR("decoding fde_count_enc\n");
+ return -UNW_EINVAL;
+ }
+ TRACE("ehFrameStart %p fdeCount %p ip offset %08x\n", ehFrameStart, fdeCount, (int32_t)(ip - ehFrameHdrAddr));
+
+ // If there are no frame table entries
+ if (fdeCount == 0) {
+ TRACE("No frame table entries\n");
+ return -UNW_ENOINFO;
+ }
+
+ // We assume this encoding
+ if (ehFrameHdr.table_enc != (DW_EH_PE_datarel | DW_EH_PE_sdata4)) {
+ ASSERT("Table encoding not supported %x\n", ehFrameHdr.table_enc);
+ return -UNW_EINVAL;
+ }
+
+ // Find the fde using a binary search on the frame table
+ table_entry_t entry;
+ table_entry_t entryNext;
+ bool found;
+ if (!BinarySearchEntries(info, ip - ehFrameHdrAddr, addr, fdeCount, &entry, &entryNext, false, &found)) {
+ ERROR("LookupTableEntry\n");
+ return -UNW_EINVAL;
+ }
+ unw_word_t fdeAddr = entry.fde_offset + ehFrameHdrAddr;
+ TRACE("start_ip %08x fde_offset %08x fdeAddr %p found %d\n", entry.start_ip, entry.fde_offset, fdeAddr, found);
+
+ // Unwind info not found
+ if (!found) {
+ return -UNW_ENOINFO;
+ }
+
+ // Now get the unwind info
+ if (!ExtractProcInfoFromFde(info, &fdeAddr, pip, need_unwind_info)) {
+ ERROR("ExtractProcInfoFromFde\n");
+ return -UNW_EINVAL;
+ }
+
+ if (ip < pip->start_ip || ip >= pip->end_ip) {
+ TRACE("ip %p not in range start_ip %p end_ip %p\n", ip, pip->start_ip, pip->end_ip);
+ return -UNW_ENOINFO;
+ }
+ return UNW_ESUCCESS;
+#else
return _OOP_find_proc_info(start_ip, end_ip, ehFrameHdrAddr, ehFrameHdrLen, exidxFrameHdrAddr, exidxFrameHdrLen, as, ip, pip, need_unwind_info, arg);
+#endif // FEATURE_USE_SYSTEM_LIBUNWIND
+
+#endif // __APPLE__
}
static void
@@ -472,6 +1852,22 @@ PAL_VirtualUnwindOutOfProc(CONTEXT *context, KNONVOLATILE_CONTEXT_POINTERS *cont
info.Context = context;
info.ReadMemory = readMemoryCallback;
+#ifdef __APPLE__
+ TRACE("Unwind: rip %p rsp %p rbp %p\n", (void*)context->Rip, (void*)context->Rsp, (void*)context->Rbp);
+ unw_proc_info_t procInfo;
+ bool step;
+ result = GetProcInfo(context->Rip, &procInfo, &info, &step, false);
+ if (!result)
+ {
+ goto exit;
+ }
+ if (step)
+ {
+ result = StepWithCompactEncoding(&info, procInfo.format, procInfo.start_ip);
+ goto exit;
+ }
+#endif
+
addrSpace = unw_create_addr_space(&unwind_accessors, 0);
st = unw_init_remote(&cursor, addrSpace, &info);
@@ -513,4 +1909,4 @@ PAL_VirtualUnwindOutOfProc(CONTEXT *context, KNONVOLATILE_CONTEXT_POINTERS *cont
return FALSE;
}
-#endif // defined(HAVE_UNW_GET_ACCESSORS)
+#endif // defined(__APPLE__) || defined(HAVE_UNW_GET_ACCESSORS)
diff --git a/src/coreclr/src/pal/src/libunwind/CMakeLists.txt b/src/coreclr/src/pal/src/libunwind/CMakeLists.txt
index 169023e12b8f..bf26aca20235 100644
--- a/src/coreclr/src/pal/src/libunwind/CMakeLists.txt
+++ b/src/coreclr/src/pal/src/libunwind/CMakeLists.txt
@@ -1,6 +1,5 @@
# This is a custom file written for .NET Core's build system
# It overwrites the one found in upstream
-
project(unwind)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
@@ -69,6 +68,28 @@ if(CLR_CMAKE_HOST_UNIX)
# Disable warning for a bug in the libunwind source src/x86/Gos-linux.c, but not in code that we exercise
add_compile_options(-Wno-incompatible-pointer-types)
endif()
+
+ if (CLR_CMAKE_HOST_OSX)
+ add_definitions(-D_XOPEN_SOURCE)
+ add_definitions(-DUNW_REMOTE_ONLY)
+ add_definitions(-D__APPLE__)
+ add_compile_options(-Wno-sometimes-uninitialized)
+ add_compile_options(-Wno-implicit-function-declaration)
+
+ # Our posix abstraction layer will provide these headers
+ set(HAVE_ELF_H 1)
+ set(HAVE_ENDIAN_H 1)
+
+ # include paths
+ include_directories(include/tdep)
+ include_directories(include)
+ include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/tdep)
+ include_directories(${CMAKE_CURRENT_BINARY_DIR}/include)
+
+ # files for macos compilation
+ include_directories(../libunwind_mac/include)
+ endif(CLR_CMAKE_HOST_OSX)
+
endif(CLR_CMAKE_HOST_UNIX)
if(CLR_CMAKE_HOST_WIN32)
diff --git a/src/coreclr/src/pal/src/libunwind/src/CMakeLists.txt b/src/coreclr/src/pal/src/libunwind/src/CMakeLists.txt
index c7cc497f3109..656f913ab073 100644
--- a/src/coreclr/src/pal/src/libunwind/src/CMakeLists.txt
+++ b/src/coreclr/src/pal/src/libunwind/src/CMakeLists.txt
@@ -299,15 +299,26 @@ if(CLR_CMAKE_HOST_UNIX)
list(APPEND libunwind_setjmp_la_SOURCES x86_64/longjmp.S x86_64/siglongjmp.SA)
endif()
- add_library(libunwind
- OBJECT
- ${libunwind_la_SOURCES}
- ${libunwind_remote_la_SOURCES}
- ${libunwind_dwarf_local_la_SOURCES}
- ${libunwind_dwarf_common_la_SOURCES}
- ${libunwind_dwarf_generic_la_SOURCES}
- ${libunwind_elf_la_SOURCES}
- )
+ if(CLR_CMAKE_HOST_OSX)
+ add_library(libunwind_dac
+ OBJECT
+ ../../libunwind_mac/src/missing-functions.c
+ ${libunwind_remote_la_SOURCES}
+ ${libunwind_dwarf_common_la_SOURCES}
+ ${libunwind_dwarf_generic_la_SOURCES}
+ )
+ else()
+ add_library(libunwind
+ OBJECT
+ ${libunwind_la_SOURCES}
+ ${libunwind_remote_la_SOURCES}
+ ${libunwind_dwarf_local_la_SOURCES}
+ ${libunwind_dwarf_common_la_SOURCES}
+ ${libunwind_dwarf_generic_la_SOURCES}
+ ${libunwind_elf_la_SOURCES}
+ )
+ endif(CLR_CMAKE_HOST_OSX)
+
else(CLR_CMAKE_HOST_UNIX)
if(CLR_CMAKE_TARGET_ARCH_ARM64)
SET(libunwind_la_SOURCES ${libunwind_la_SOURCES_aarch64})
@@ -332,11 +343,10 @@ else(CLR_CMAKE_HOST_UNIX)
endif()
set_source_files_properties(${CLR_DIR}/src/pal/src/exception/remote-unwind.cpp PROPERTIES COMPILE_FLAGS /TP INCLUDE_DIRECTORIES ${CLR_DIR}/src/inc)
- set_source_files_properties(${CLR_DIR}/src/pal/src/exception/seh-unwind.cpp PROPERTIES COMPILE_FLAGS /TP INCLUDE_DIRECTORIES ${CLR_DIR}/src/inc)
+
add_library(libunwind_xdac
OBJECT
../../exception/remote-unwind.cpp
- ../../exception/seh-unwind.cpp
win/pal-single-threaded.c
# ${libunwind_la_SOURCES} Local...
${libunwind_remote_la_SOURCES}
@@ -348,4 +358,3 @@ else(CLR_CMAKE_HOST_UNIX)
${libunwind_elf_la_SOURCES}
)
endif(CLR_CMAKE_HOST_UNIX)
-
diff --git a/src/coreclr/src/pal/src/libunwind_mac/include/elf.h b/src/coreclr/src/pal/src/libunwind_mac/include/elf.h
new file mode 100644
index 000000000000..d843777e426a
--- /dev/null
+++ b/src/coreclr/src/pal/src/libunwind_mac/include/elf.h
@@ -0,0 +1,10 @@
+// This is an incomplete & imprecice implementation
+// It defers to the open source freebsd-elf implementations.
+
+#pragma once
+
+#include
+
+#include "freebsd-elf_common.h"
+#include "freebsd-elf32.h"
+#include "freebsd-elf64.h"
diff --git a/src/coreclr/src/pal/src/libunwind_mac/include/endian.h b/src/coreclr/src/pal/src/libunwind_mac/include/endian.h
new file mode 100644
index 000000000000..409750756069
--- /dev/null
+++ b/src/coreclr/src/pal/src/libunwind_mac/include/endian.h
@@ -0,0 +1,9 @@
+// This is an incomplete & imprecice implementation of the
+// standard file by the same name
+
+#pragma once
+
+#define __LITTLE_ENDIAN 1234
+#define __BIG_ENDIAN 4321
+
+#define __BYTE_ORDER __LITTLE_ENDIAN
diff --git a/src/coreclr/src/pal/src/libunwind_mac/include/fakestdalign.h.in b/src/coreclr/src/pal/src/libunwind_mac/include/fakestdalign.h.in
new file mode 100644
index 000000000000..3e94006d8cae
--- /dev/null
+++ b/src/coreclr/src/pal/src/libunwind_mac/include/fakestdalign.h.in
@@ -0,0 +1,9 @@
+// This is a fake implementatino of stdaliagn.h for when
+// compiler C11 stdaliagn.h support is missing
+
+#ifndef FAKE_STD_ALIGN_H
+#define FAKE_STD_ALIGN_H
+
+#define alignas(x)
+
+#endif // FAKE_STD_ALIGN_H
diff --git a/src/coreclr/src/pal/src/libunwind_mac/include/fakestdatomic.h.in b/src/coreclr/src/pal/src/libunwind_mac/include/fakestdatomic.h.in
new file mode 100644
index 000000000000..7b9dcd5a9d8a
--- /dev/null
+++ b/src/coreclr/src/pal/src/libunwind_mac/include/fakestdatomic.h.in
@@ -0,0 +1,36 @@
+// This is a non-atomic fake implementatino of stdatomics for when
+// compiler C11 stdatomic support is missing and only single threaded
+// operation is required
+
+#ifndef FAKE_STD_ATOMICS_H
+#define FAKE_STD_ATOMICS_H
+
+#include
+
+#define _Atomic volatile
+#define ATOMIC_FLAG_INIT 0
+
+typedef uint8_t atomic_bool;
+typedef uint8_t atomic_flag;
+
+#define atomic_compare_and_exchange_strong(x, y, z) return ((*(x) == *(y)) ? ((*(x) = z), true) : ((*(y) = *(x)),false))
+
+#define atomic_fetch_add(x, y) *(x) += (y), (*(x) - (y))
+
+static inline void atomic_flag_clear(volatile atomic_flag* flag)
+{
+ *flag = ATOMIC_FLAG_INIT;
+}
+
+static inline atomic_bool atomic_flag_test_and_set( volatile atomic_flag* flag )
+{
+ atomic_bool result = *flag;
+ *flag = 1;
+ return result;
+}
+
+#define atomic_load(x) (*(x))
+#define atomic_store(x, y) do { *(x) = (y); } while (0)
+
+
+#endif // FAKE_STD_ATOMICS_H
diff --git a/src/coreclr/src/pal/src/libunwind_mac/include/freebsd-elf32.h b/src/coreclr/src/pal/src/libunwind_mac/include/freebsd-elf32.h
new file mode 100644
index 000000000000..b4c0d94210d9
--- /dev/null
+++ b/src/coreclr/src/pal/src/libunwind_mac/include/freebsd-elf32.h
@@ -0,0 +1,245 @@
+/*-
+ * Copyright (c) 1996-1998 John D. Polstra.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: src/sys/sys/elf32.h,v 1.8.14.2.2.1 2008/10/02 02:57:24 kensmith Exp $
+ */
+
+#ifndef _SYS_ELF32_H_
+#define _SYS_ELF32_H_ 1
+
+#include "freebsd-elf_common.h"
+
+/*
+ * ELF definitions common to all 32-bit architectures.
+ */
+
+typedef uint32_t Elf32_Addr;
+typedef uint16_t Elf32_Half;
+typedef uint32_t Elf32_Off;
+typedef int32_t Elf32_Sword;
+typedef uint32_t Elf32_Word;
+typedef uint64_t Elf32_Lword;
+
+typedef Elf32_Word Elf32_Hashelt;
+
+/* Non-standard class-dependent datatype used for abstraction. */
+typedef Elf32_Word Elf32_Size;
+typedef Elf32_Sword Elf32_Ssize;
+
+/*
+ * ELF header.
+ */
+
+typedef struct {
+ unsigned char e_ident[EI_NIDENT]; /* File identification. */
+ Elf32_Half e_type; /* File type. */
+ Elf32_Half e_machine; /* Machine architecture. */
+ Elf32_Word e_version; /* ELF format version. */
+ Elf32_Addr e_entry; /* Entry point. */
+ Elf32_Off e_phoff; /* Program header file offset. */
+ Elf32_Off e_shoff; /* Section header file offset. */
+ Elf32_Word e_flags; /* Architecture-specific flags. */
+ Elf32_Half e_ehsize; /* Size of ELF header in bytes. */
+ Elf32_Half e_phentsize; /* Size of program header entry. */
+ Elf32_Half e_phnum; /* Number of program header entries. */
+ Elf32_Half e_shentsize; /* Size of section header entry. */
+ Elf32_Half e_shnum; /* Number of section header entries. */
+ Elf32_Half e_shstrndx; /* Section name strings section. */
+} Elf32_Ehdr;
+
+/*
+ * Section header.
+ */
+
+typedef struct {
+ Elf32_Word sh_name; /* Section name (index into the
+ section header string table). */
+ Elf32_Word sh_type; /* Section type. */
+ Elf32_Word sh_flags; /* Section flags. */
+ Elf32_Addr sh_addr; /* Address in memory image. */
+ Elf32_Off sh_offset; /* Offset in file. */
+ Elf32_Word sh_size; /* Size in bytes. */
+ Elf32_Word sh_link; /* Index of a related section. */
+ Elf32_Word sh_info; /* Depends on section type. */
+ Elf32_Word sh_addralign; /* Alignment in bytes. */
+ Elf32_Word sh_entsize; /* Size of each entry in section. */
+} Elf32_Shdr;
+
+/*
+ * Program header.
+ */
+
+typedef struct {
+ Elf32_Word p_type; /* Entry type. */
+ Elf32_Off p_offset; /* File offset of contents. */
+ Elf32_Addr p_vaddr; /* Virtual address in memory image. */
+ Elf32_Addr p_paddr; /* Physical address (not used). */
+ Elf32_Word p_filesz; /* Size of contents in file. */
+ Elf32_Word p_memsz; /* Size of contents in memory. */
+ Elf32_Word p_flags; /* Access permission flags. */
+ Elf32_Word p_align; /* Alignment in memory and file. */
+} Elf32_Phdr;
+
+/*
+ * Dynamic structure. The ".dynamic" section contains an array of them.
+ */
+
+typedef struct {
+ Elf32_Sword d_tag; /* Entry type. */
+ union {
+ Elf32_Word d_val; /* Integer value. */
+ Elf32_Addr d_ptr; /* Address value. */
+ } d_un;
+} Elf32_Dyn;
+
+/*
+ * Relocation entries.
+ */
+
+/* Relocations that don't need an addend field. */
+typedef struct {
+ Elf32_Addr r_offset; /* Location to be relocated. */
+ Elf32_Word r_info; /* Relocation type and symbol index. */
+} Elf32_Rel;
+
+/* Relocations that need an addend field. */
+typedef struct {
+ Elf32_Addr r_offset; /* Location to be relocated. */
+ Elf32_Word r_info; /* Relocation type and symbol index. */
+ Elf32_Sword r_addend; /* Addend. */
+} Elf32_Rela;
+
+/* Macros for accessing the fields of r_info. */
+#define ELF32_R_SYM(info) ((info) >> 8)
+#define ELF32_R_TYPE(info) ((unsigned char)(info))
+
+/* Macro for constructing r_info from field values. */
+#define ELF32_R_INFO(sym, type) (((sym) << 8) + (unsigned char)(type))
+
+/*
+ * Note entry header
+ */
+typedef Elf_Note Elf32_Nhdr;
+
+/*
+ * Move entry
+ */
+typedef struct {
+ Elf32_Lword m_value; /* symbol value */
+ Elf32_Word m_info; /* size + index */
+ Elf32_Word m_poffset; /* symbol offset */
+ Elf32_Half m_repeat; /* repeat count */
+ Elf32_Half m_stride; /* stride info */
+} Elf32_Move;
+
+/*
+ * The macros compose and decompose values for Move.r_info
+ *
+ * sym = ELF32_M_SYM(M.m_info)
+ * size = ELF32_M_SIZE(M.m_info)
+ * M.m_info = ELF32_M_INFO(sym, size)
+ */
+#define ELF32_M_SYM(info) ((info)>>8)
+#define ELF32_M_SIZE(info) ((unsigned char)(info))
+#define ELF32_M_INFO(sym, size) (((sym)<<8)+(unsigned char)(size))
+
+/*
+ * Hardware/Software capabilities entry
+ */
+typedef struct {
+ Elf32_Word c_tag; /* how to interpret value */
+ union {
+ Elf32_Word c_val;
+ Elf32_Addr c_ptr;
+ } c_un;
+} Elf32_Cap;
+
+/*
+ * Symbol table entries.
+ */
+
+typedef struct {
+ Elf32_Word st_name; /* String table index of name. */
+ Elf32_Addr st_value; /* Symbol value. */
+ Elf32_Word st_size; /* Size of associated object. */
+ unsigned char st_info; /* Type and binding information. */
+ unsigned char st_other; /* Reserved (not used). */
+ Elf32_Half st_shndx; /* Section index of symbol. */
+} Elf32_Sym;
+
+/* Macros for accessing the fields of st_info. */
+#define ELF32_ST_BIND(info) ((info) >> 4)
+#define ELF32_ST_TYPE(info) ((info) & 0xf)
+
+/* Macro for constructing st_info from field values. */
+#define ELF32_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf))
+
+/* Macro for accessing the fields of st_other. */
+#define ELF32_ST_VISIBILITY(oth) ((oth) & 0x3)
+
+/* Structures used by Sun & GNU symbol versioning. */
+typedef struct
+{
+ Elf32_Half vd_version;
+ Elf32_Half vd_flags;
+ Elf32_Half vd_ndx;
+ Elf32_Half vd_cnt;
+ Elf32_Word vd_hash;
+ Elf32_Word vd_aux;
+ Elf32_Word vd_next;
+} Elf32_Verdef;
+
+typedef struct
+{
+ Elf32_Word vda_name;
+ Elf32_Word vda_next;
+} Elf32_Verdaux;
+
+typedef struct
+{
+ Elf32_Half vn_version;
+ Elf32_Half vn_cnt;
+ Elf32_Word vn_file;
+ Elf32_Word vn_aux;
+ Elf32_Word vn_next;
+} Elf32_Verneed;
+
+typedef struct
+{
+ Elf32_Word vna_hash;
+ Elf32_Half vna_flags;
+ Elf32_Half vna_other;
+ Elf32_Word vna_name;
+ Elf32_Word vna_next;
+} Elf32_Vernaux;
+
+typedef Elf32_Half Elf32_Versym;
+
+typedef struct {
+ Elf32_Half si_boundto; /* direct bindings - symbol bound to */
+ Elf32_Half si_flags; /* per symbol flags */
+} Elf32_Syminfo;
+
+#endif /* !_SYS_ELF32_H_ */
diff --git a/src/coreclr/src/pal/src/libunwind_mac/include/freebsd-elf64.h b/src/coreclr/src/pal/src/libunwind_mac/include/freebsd-elf64.h
new file mode 100644
index 000000000000..0991fe356f97
--- /dev/null
+++ b/src/coreclr/src/pal/src/libunwind_mac/include/freebsd-elf64.h
@@ -0,0 +1,252 @@
+/*-
+ * Copyright (c) 1996-1998 John D. Polstra.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: src/sys/sys/elf64.h,v 1.10.14.2.2.1 2008/10/02 02:57:24 kensmith Exp $
+ */
+
+#ifndef _SYS_ELF64_H_
+#define _SYS_ELF64_H_ 1
+
+#include "freebsd-elf_common.h"
+
+/*
+ * ELF definitions common to all 64-bit architectures.
+ */
+
+typedef uint64_t Elf64_Addr;
+typedef uint16_t Elf64_Half;
+typedef uint64_t Elf64_Off;
+typedef int32_t Elf64_Sword;
+typedef int64_t Elf64_Sxword;
+typedef uint32_t Elf64_Word;
+typedef uint64_t Elf64_Lword;
+typedef uint64_t Elf64_Xword;
+
+/*
+ * Types of dynamic symbol hash table bucket and chain elements.
+ *
+ * This is inconsistent among 64 bit architectures, so a machine dependent
+ * typedef is required.
+ */
+
+#ifdef __alpha__
+typedef Elf64_Off Elf64_Hashelt;
+#else
+typedef Elf64_Word Elf64_Hashelt;
+#endif
+
+/* Non-standard class-dependent datatype used for abstraction. */
+typedef Elf64_Xword Elf64_Size;
+typedef Elf64_Sxword Elf64_Ssize;
+
+/*
+ * ELF header.
+ */
+
+typedef struct {
+ unsigned char e_ident[EI_NIDENT]; /* File identification. */
+ Elf64_Half e_type; /* File type. */
+ Elf64_Half e_machine; /* Machine architecture. */
+ Elf64_Word e_version; /* ELF format version. */
+ Elf64_Addr e_entry; /* Entry point. */
+ Elf64_Off e_phoff; /* Program header file offset. */
+ Elf64_Off e_shoff; /* Section header file offset. */
+ Elf64_Word e_flags; /* Architecture-specific flags. */
+ Elf64_Half e_ehsize; /* Size of ELF header in bytes. */
+ Elf64_Half e_phentsize; /* Size of program header entry. */
+ Elf64_Half e_phnum; /* Number of program header entries. */
+ Elf64_Half e_shentsize; /* Size of section header entry. */
+ Elf64_Half e_shnum; /* Number of section header entries. */
+ Elf64_Half e_shstrndx; /* Section name strings section. */
+} Elf64_Ehdr;
+
+/*
+ * Section header.
+ */
+
+typedef struct {
+ Elf64_Word sh_name; /* Section name (index into the
+ section header string table). */
+ Elf64_Word sh_type; /* Section type. */
+ Elf64_Xword sh_flags; /* Section flags. */
+ Elf64_Addr sh_addr; /* Address in memory image. */
+ Elf64_Off sh_offset; /* Offset in file. */
+ Elf64_Xword sh_size; /* Size in bytes. */
+ Elf64_Word sh_link; /* Index of a related section. */
+ Elf64_Word sh_info; /* Depends on section type. */
+ Elf64_Xword sh_addralign; /* Alignment in bytes. */
+ Elf64_Xword sh_entsize; /* Size of each entry in section. */
+} Elf64_Shdr;
+
+/*
+ * Program header.
+ */
+
+typedef struct {
+ Elf64_Word p_type; /* Entry type. */
+ Elf64_Word p_flags; /* Access permission flags. */
+ Elf64_Off p_offset; /* File offset of contents. */
+ Elf64_Addr p_vaddr; /* Virtual address in memory image. */
+ Elf64_Addr p_paddr; /* Physical address (not used). */
+ Elf64_Xword p_filesz; /* Size of contents in file. */
+ Elf64_Xword p_memsz; /* Size of contents in memory. */
+ Elf64_Xword p_align; /* Alignment in memory and file. */
+} Elf64_Phdr;
+
+/*
+ * Dynamic structure. The ".dynamic" section contains an array of them.
+ */
+
+typedef struct {
+ Elf64_Sxword d_tag; /* Entry type. */
+ union {
+ Elf64_Xword d_val; /* Integer value. */
+ Elf64_Addr d_ptr; /* Address value. */
+ } d_un;
+} Elf64_Dyn;
+
+/*
+ * Relocation entries.
+ */
+
+/* Relocations that don't need an addend field. */
+typedef struct {
+ Elf64_Addr r_offset; /* Location to be relocated. */
+ Elf64_Xword r_info; /* Relocation type and symbol index. */
+} Elf64_Rel;
+
+/* Relocations that need an addend field. */
+typedef struct {
+ Elf64_Addr r_offset; /* Location to be relocated. */
+ Elf64_Xword r_info; /* Relocation type and symbol index. */
+ Elf64_Sxword r_addend; /* Addend. */
+} Elf64_Rela;
+
+/* Macros for accessing the fields of r_info. */
+#define ELF64_R_SYM(info) ((info) >> 32)
+#define ELF64_R_TYPE(info) ((info) & 0xffffffffL)
+
+/* Macro for constructing r_info from field values. */
+#define ELF64_R_INFO(sym, type) (((sym) << 32) + ((type) & 0xffffffffL))
+
+#define ELF64_R_TYPE_DATA(info) (((Elf64_Xword)(info)<<32)>>40)
+#define ELF64_R_TYPE_ID(info) (((Elf64_Xword)(info)<<56)>>56)
+#define ELF64_R_TYPE_INFO(data, type) \
+ (((Elf64_Xword)(data)<<8)+(Elf64_Xword)(type))
+
+/*
+ * Note entry header
+ */
+typedef Elf_Note Elf64_Nhdr;
+
+/*
+ * Move entry
+ */
+typedef struct {
+ Elf64_Lword m_value; /* symbol value */
+ Elf64_Xword m_info; /* size + index */
+ Elf64_Xword m_poffset; /* symbol offset */
+ Elf64_Half m_repeat; /* repeat count */
+ Elf64_Half m_stride; /* stride info */
+} Elf64_Move;
+
+#define ELF64_M_SYM(info) ((info)>>8)
+#define ELF64_M_SIZE(info) ((unsigned char)(info))
+#define ELF64_M_INFO(sym, size) (((sym)<<8)+(unsigned char)(size))
+
+/*
+ * Hardware/Software capabilities entry
+ */
+typedef struct {
+ Elf64_Xword c_tag; /* how to interpret value */
+ union {
+ Elf64_Xword c_val;
+ Elf64_Addr c_ptr;
+ } c_un;
+} Elf64_Cap;
+
+/*
+ * Symbol table entries.
+ */
+
+typedef struct {
+ Elf64_Word st_name; /* String table index of name. */
+ unsigned char st_info; /* Type and binding information. */
+ unsigned char st_other; /* Reserved (not used). */
+ Elf64_Half st_shndx; /* Section index of symbol. */
+ Elf64_Addr st_value; /* Symbol value. */
+ Elf64_Xword st_size; /* Size of associated object. */
+} Elf64_Sym;
+
+/* Macros for accessing the fields of st_info. */
+#define ELF64_ST_BIND(info) ((info) >> 4)
+#define ELF64_ST_TYPE(info) ((info) & 0xf)
+
+/* Macro for constructing st_info from field values. */
+#define ELF64_ST_INFO(bind, type) (((bind) << 4) + ((type) & 0xf))
+
+/* Macro for accessing the fields of st_other. */
+#define ELF64_ST_VISIBILITY(oth) ((oth) & 0x3)
+
+/* Structures used by Sun & GNU-style symbol versioning. */
+typedef struct {
+ Elf64_Half vd_version;
+ Elf64_Half vd_flags;
+ Elf64_Half vd_ndx;
+ Elf64_Half vd_cnt;
+ Elf64_Word vd_hash;
+ Elf64_Word vd_aux;
+ Elf64_Word vd_next;
+} Elf64_Verdef;
+
+typedef struct {
+ Elf64_Word vda_name;
+ Elf64_Word vda_next;
+} Elf64_Verdaux;
+
+typedef struct {
+ Elf64_Half vn_version;
+ Elf64_Half vn_cnt;
+ Elf64_Word vn_file;
+ Elf64_Word vn_aux;
+ Elf64_Word vn_next;
+} Elf64_Verneed;
+
+typedef struct {
+ Elf64_Word vna_hash;
+ Elf64_Half vna_flags;
+ Elf64_Half vna_other;
+ Elf64_Word vna_name;
+ Elf64_Word vna_next;
+} Elf64_Vernaux;
+
+typedef Elf64_Half Elf64_Versym;
+
+typedef struct {
+ Elf64_Half si_boundto; /* direct bindings - symbol bound to */
+ Elf64_Half si_flags; /* per symbol flags */
+} Elf64_Syminfo;
+
+#endif /* !_SYS_ELF64_H_ */
diff --git a/src/coreclr/src/pal/src/libunwind_mac/include/freebsd-elf_common.h b/src/coreclr/src/pal/src/libunwind_mac/include/freebsd-elf_common.h
new file mode 100644
index 000000000000..7aef2d49667e
--- /dev/null
+++ b/src/coreclr/src/pal/src/libunwind_mac/include/freebsd-elf_common.h
@@ -0,0 +1,865 @@
+/*-
+ * Copyright (c) 1998 John D. Polstra.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD: src/sys/sys/elf_common.h,v 1.24 2008/08/02 01:20:10 imp Exp $
+ */
+
+#ifndef _SYS_ELF_COMMON_H_
+#define _SYS_ELF_COMMON_H_ 1
+
+/*
+ * ELF definitions that are independent of architecture or word size.
+ */
+
+/*
+ * Note header. The ".note" section contains an array of notes. Each
+ * begins with this header, aligned to a word boundary. Immediately
+ * following the note header is n_namesz bytes of name, padded to the
+ * next word boundary. Then comes n_descsz bytes of descriptor, again
+ * padded to a word boundary. The values of n_namesz and n_descsz do
+ * not include the padding.
+ */
+
+typedef struct {
+ uint32_t n_namesz; /* Length of name. */
+ uint32_t n_descsz; /* Length of descriptor. */
+ uint32_t n_type; /* Type of this note. */
+} Elf_Note;
+
+/* Indexes into the e_ident array. Keep synced with
+ http://www.sco.com/developers/gabi/latest/ch4.eheader.html */
+#define EI_MAG0 0 /* Magic number, byte 0. */
+#define EI_MAG1 1 /* Magic number, byte 1. */
+#define EI_MAG2 2 /* Magic number, byte 2. */
+#define EI_MAG3 3 /* Magic number, byte 3. */
+#define EI_CLASS 4 /* Class of machine. */
+#define EI_DATA 5 /* Data format. */
+#define EI_VERSION 6 /* ELF format version. */
+#define EI_OSABI 7 /* Operating system / ABI identification */
+#define EI_ABIVERSION 8 /* ABI version */
+#define OLD_EI_BRAND 8 /* Start of architecture identification. */
+#define EI_PAD 9 /* Start of padding (per SVR4 ABI). */
+#define EI_NIDENT 16 /* Size of e_ident array. */
+
+/* Values for the magic number bytes. */
+#define ELFMAG0 0x7f
+#define ELFMAG1 'E'
+#define ELFMAG2 'L'
+#define ELFMAG3 'F'
+#define ELFMAG "\177ELF" /* magic string */
+#define SELFMAG 4 /* magic string size */
+
+/* Values for e_ident[EI_VERSION] and e_version. */
+#define EV_NONE 0
+#define EV_CURRENT 1
+
+/* Values for e_ident[EI_CLASS]. */
+#define ELFCLASSNONE 0 /* Unknown class. */
+#define ELFCLASS32 1 /* 32-bit architecture. */
+#define ELFCLASS64 2 /* 64-bit architecture. */
+
+/* Values for e_ident[EI_DATA]. */
+#define ELFDATANONE 0 /* Unknown data format. */
+#define ELFDATA2LSB 1 /* 2's complement little-endian. */
+#define ELFDATA2MSB 2 /* 2's complement big-endian. */
+
+/* Values for e_ident[EI_OSABI]. */
+#define ELFOSABI_NONE 0 /* UNIX System V ABI */
+#define ELFOSABI_HPUX 1 /* HP-UX operating system */
+#define ELFOSABI_NETBSD 2 /* NetBSD */
+#define ELFOSABI_LINUX 3 /* GNU/Linux */
+#define ELFOSABI_HURD 4 /* GNU/Hurd */
+#define ELFOSABI_86OPEN 5 /* 86Open common IA32 ABI */
+#define ELFOSABI_SOLARIS 6 /* Solaris */
+#define ELFOSABI_AIX 7 /* AIX */
+#define ELFOSABI_IRIX 8 /* IRIX */
+#define ELFOSABI_FREEBSD 9 /* FreeBSD */
+#define ELFOSABI_TRU64 10 /* TRU64 UNIX */
+#define ELFOSABI_MODESTO 11 /* Novell Modesto */
+#define ELFOSABI_OPENBSD 12 /* OpenBSD */
+#define ELFOSABI_OPENVMS 13 /* Open VMS */
+#define ELFOSABI_NSK 14 /* HP Non-Stop Kernel */
+#define ELFOSABI_ARM 97 /* ARM */
+#define ELFOSABI_STANDALONE 255 /* Standalone (embedded) application */
+
+#define ELFOSABI_SYSV ELFOSABI_NONE /* symbol used in old spec */
+#define ELFOSABI_MONTEREY ELFOSABI_AIX /* Monterey */
+
+/* e_ident */
+#define IS_ELF(ehdr) ((ehdr).e_ident[EI_MAG0] == ELFMAG0 && \
+ (ehdr).e_ident[EI_MAG1] == ELFMAG1 && \
+ (ehdr).e_ident[EI_MAG2] == ELFMAG2 && \
+ (ehdr).e_ident[EI_MAG3] == ELFMAG3)
+
+/* Values for e_type. */
+#define ET_NONE 0 /* Unknown type. */
+#define ET_REL 1 /* Relocatable. */
+#define ET_EXEC 2 /* Executable. */
+#define ET_DYN 3 /* Shared object. */
+#define ET_CORE 4 /* Core file. */
+#define ET_LOOS 0xfe00 /* First operating system specific. */
+#define ET_HIOS 0xfeff /* Last operating system-specific. */
+#define ET_LOPROC 0xff00 /* First processor-specific. */
+#define ET_HIPROC 0xffff /* Last processor-specific. */
+
+/* Values for e_machine. */
+#define EM_NONE 0 /* Unknown machine. */
+#define EM_M32 1 /* AT&T WE32100. */
+#define EM_SPARC 2 /* Sun SPARC. */
+#define EM_386 3 /* Intel i386. */
+#define EM_68K 4 /* Motorola 68000. */
+#define EM_88K 5 /* Motorola 88000. */
+#define EM_860 7 /* Intel i860. */
+#define EM_MIPS 8 /* MIPS R3000 Big-Endian only. */
+#define EM_S370 9 /* IBM System/370. */
+#define EM_MIPS_RS3_LE 10 /* MIPS R3000 Little-Endian. */
+#define EM_PARISC 15 /* HP PA-RISC. */
+#define EM_VPP500 17 /* Fujitsu VPP500. */
+#define EM_SPARC32PLUS 18 /* SPARC v8plus. */
+#define EM_960 19 /* Intel 80960. */
+#define EM_PPC 20 /* PowerPC 32-bit. */
+#define EM_PPC64 21 /* PowerPC 64-bit. */
+#define EM_S390 22 /* IBM System/390. */
+#define EM_V800 36 /* NEC V800. */
+#define EM_FR20 37 /* Fujitsu FR20. */
+#define EM_RH32 38 /* TRW RH-32. */
+#define EM_RCE 39 /* Motorola RCE. */
+#define EM_ARM 40 /* ARM. */
+#define EM_SH 42 /* Hitachi SH. */
+#define EM_SPARCV9 43 /* SPARC v9 64-bit. */
+#define EM_TRICORE 44 /* Siemens TriCore embedded processor. */
+#define EM_ARC 45 /* Argonaut RISC Core. */
+#define EM_H8_300 46 /* Hitachi H8/300. */
+#define EM_H8_300H 47 /* Hitachi H8/300H. */
+#define EM_H8S 48 /* Hitachi H8S. */
+#define EM_H8_500 49 /* Hitachi H8/500. */
+#define EM_IA_64 50 /* Intel IA-64 Processor. */
+#define EM_MIPS_X 51 /* Stanford MIPS-X. */
+#define EM_COLDFIRE 52 /* Motorola ColdFire. */
+#define EM_68HC12 53 /* Motorola M68HC12. */
+#define EM_MMA 54 /* Fujitsu MMA. */
+#define EM_PCP 55 /* Siemens PCP. */
+#define EM_NCPU 56 /* Sony nCPU. */
+#define EM_NDR1 57 /* Denso NDR1 microprocessor. */
+#define EM_STARCORE 58 /* Motorola Star*Core processor. */
+#define EM_ME16 59 /* Toyota ME16 processor. */
+#define EM_ST100 60 /* STMicroelectronics ST100 processor. */
+#define EM_TINYJ 61 /* Advanced Logic Corp. TinyJ processor. */
+#define EM_X86_64 62 /* Advanced Micro Devices x86-64 */
+#define EM_AMD64 EM_X86_64 /* Advanced Micro Devices x86-64 (compat) */
+
+/* Non-standard or deprecated. */
+#define EM_486 6 /* Intel i486. */
+#define EM_MIPS_RS4_BE 10 /* MIPS R4000 Big-Endian */
+#define EM_ALPHA_STD 41 /* Digital Alpha (standard value). */
+#define EM_ALPHA 0x9026 /* Alpha (written in the absence of an ABI) */
+
+/* Special section indexes. */
+#define SHN_UNDEF 0 /* Undefined, missing, irrelevant. */
+#define SHN_LORESERVE 0xff00 /* First of reserved range. */
+#define SHN_LOPROC 0xff00 /* First processor-specific. */
+#define SHN_HIPROC 0xff1f /* Last processor-specific. */
+#define SHN_LOOS 0xff20 /* First operating system-specific. */
+#define SHN_HIOS 0xff3f /* Last operating system-specific. */
+#define SHN_ABS 0xfff1 /* Absolute values. */
+#define SHN_COMMON 0xfff2 /* Common data. */
+#define SHN_XINDEX 0xffff /* Escape -- index stored elsewhere. */
+#define SHN_HIRESERVE 0xffff /* Last of reserved range. */
+
+/* sh_type */
+#define SHT_NULL 0 /* inactive */
+#define SHT_PROGBITS 1 /* program defined information */
+#define SHT_SYMTAB 2 /* symbol table section */
+#define SHT_STRTAB 3 /* string table section */
+#define SHT_RELA 4 /* relocation section with addends */
+#define SHT_HASH 5 /* symbol hash table section */
+#define SHT_DYNAMIC 6 /* dynamic section */
+#define SHT_NOTE 7 /* note section */
+#define SHT_NOBITS 8 /* no space section */
+#define SHT_REL 9 /* relocation section - no addends */
+#define SHT_SHLIB 10 /* reserved - purpose unknown */
+#define SHT_DYNSYM 11 /* dynamic symbol table section */
+#define SHT_INIT_ARRAY 14 /* Initialization function pointers. */
+#define SHT_FINI_ARRAY 15 /* Termination function pointers. */
+#define SHT_PREINIT_ARRAY 16 /* Pre-initialization function ptrs. */
+#define SHT_GROUP 17 /* Section group. */
+#define SHT_SYMTAB_SHNDX 18 /* Section indexes (see SHN_XINDEX). */
+#define SHT_LOOS 0x60000000 /* First of OS specific semantics */
+#define SHT_LOSUNW 0x6ffffff4
+#define SHT_SUNW_dof 0x6ffffff4
+#define SHT_SUNW_cap 0x6ffffff5
+#define SHT_SUNW_SIGNATURE 0x6ffffff6
+#define SHT_SUNW_ANNOTATE 0x6ffffff7
+#define SHT_SUNW_DEBUGSTR 0x6ffffff8
+#define SHT_SUNW_DEBUG 0x6ffffff9
+#define SHT_SUNW_move 0x6ffffffa
+#define SHT_SUNW_COMDAT 0x6ffffffb
+#define SHT_SUNW_syminfo 0x6ffffffc
+#define SHT_SUNW_verdef 0x6ffffffd
+#define SHT_GNU_verdef 0x6ffffffd /* Symbol versions provided */
+#define SHT_SUNW_verneed 0x6ffffffe
+#define SHT_GNU_verneed 0x6ffffffe /* Symbol versions required */
+#define SHT_SUNW_versym 0x6fffffff
+#define SHT_GNU_versym 0x6fffffff /* Symbol version table */
+#define SHT_HISUNW 0x6fffffff
+#define SHT_HIOS 0x6fffffff /* Last of OS specific semantics */
+#define SHT_LOPROC 0x70000000 /* reserved range for processor */
+#define SHT_AMD64_UNWIND 0x70000001 /* unwind information */
+#define SHT_HIPROC 0x7fffffff /* specific section header types */
+#define SHT_LOUSER 0x80000000 /* reserved range for application */
+#define SHT_HIUSER 0xffffffff /* specific indexes */
+
+/* Flags for sh_flags. */
+#define SHF_WRITE 0x1 /* Section contains writable data. */
+#define SHF_ALLOC 0x2 /* Section occupies memory. */
+#define SHF_EXECINSTR 0x4 /* Section contains instructions. */
+#define SHF_MERGE 0x10 /* Section may be merged. */
+#define SHF_STRINGS 0x20 /* Section contains strings. */
+#define SHF_INFO_LINK 0x40 /* sh_info holds section index. */
+#define SHF_LINK_ORDER 0x80 /* Special ordering requirements. */
+#define SHF_OS_NONCONFORMING 0x100 /* OS-specific processing required. */
+#define SHF_GROUP 0x200 /* Member of section group. */
+#define SHF_TLS 0x400 /* Section contains TLS data. */
+#define SHF_MASKOS 0x0ff00000 /* OS-specific semantics. */
+#define SHF_MASKPROC 0xf0000000 /* Processor-specific semantics. */
+
+/* Values for p_type. */
+#define PT_NULL 0 /* Unused entry. */
+#define PT_LOAD 1 /* Loadable segment. */
+#define PT_DYNAMIC 2 /* Dynamic linking information segment. */
+#define PT_INTERP 3 /* Pathname of interpreter. */
+#define PT_NOTE 4 /* Auxiliary information. */
+#define PT_SHLIB 5 /* Reserved (not used). */
+#define PT_PHDR 6 /* Location of program header itself. */
+#define PT_TLS 7 /* Thread local storage segment */
+#define PT_LOOS 0x60000000 /* First OS-specific. */
+#define PT_SUNW_UNWIND 0x6464e550 /* amd64 UNWIND program header */
+#define PT_GNU_EH_FRAME 0x6474e550
+#define PT_GNU_STACK 0x6474e551
+#define PT_LOSUNW 0x6ffffffa
+#define PT_SUNWBSS 0x6ffffffa /* Sun Specific segment */
+#define PT_SUNWSTACK 0x6ffffffb /* describes the stack segment */
+#define PT_SUNWDTRACE 0x6ffffffc /* private */
+#define PT_SUNWCAP 0x6ffffffd /* hard/soft capabilities segment */
+#define PT_HISUNW 0x6fffffff
+#define PT_HIOS 0x6fffffff /* Last OS-specific. */
+#define PT_LOPROC 0x70000000 /* First processor-specific type. */
+#define PT_HIPROC 0x7fffffff /* Last processor-specific type. */
+
+/* Values for p_flags. */
+#define PF_X 0x1 /* Executable. */
+#define PF_W 0x2 /* Writable. */
+#define PF_R 0x4 /* Readable. */
+#define PF_MASKOS 0x0ff00000 /* Operating system-specific. */
+#define PF_MASKPROC 0xf0000000 /* Processor-specific. */
+
+/* Extended program header index. */
+#define PN_XNUM 0xffff
+
+/* Values for d_tag. */
+#define DT_NULL 0 /* Terminating entry. */
+#define DT_NEEDED 1 /* String table offset of a needed shared
+ library. */
+#define DT_PLTRELSZ 2 /* Total size in bytes of PLT relocations. */
+#define DT_PLTGOT 3 /* Processor-dependent address. */
+#define DT_HASH 4 /* Address of symbol hash table. */
+#define DT_STRTAB 5 /* Address of string table. */
+#define DT_SYMTAB 6 /* Address of symbol table. */
+#define DT_RELA 7 /* Address of ElfNN_Rela relocations. */
+#define DT_RELASZ 8 /* Total size of ElfNN_Rela relocations. */
+#define DT_RELAENT 9 /* Size of each ElfNN_Rela relocation entry. */
+#define DT_STRSZ 10 /* Size of string table. */
+#define DT_SYMENT 11 /* Size of each symbol table entry. */
+#define DT_INIT 12 /* Address of initialization function. */
+#define DT_FINI 13 /* Address of finalization function. */
+#define DT_SONAME 14 /* String table offset of shared object
+ name. */
+#define DT_RPATH 15 /* String table offset of library path. [sup] */
+#define DT_SYMBOLIC 16 /* Indicates "symbolic" linking. [sup] */
+#define DT_REL 17 /* Address of ElfNN_Rel relocations. */
+#define DT_RELSZ 18 /* Total size of ElfNN_Rel relocations. */
+#define DT_RELENT 19 /* Size of each ElfNN_Rel relocation. */
+#define DT_PLTREL 20 /* Type of relocation used for PLT. */
+#define DT_DEBUG 21 /* Reserved (not used). */
+#define DT_TEXTREL 22 /* Indicates there may be relocations in
+ non-writable segments. [sup] */
+#define DT_JMPREL 23 /* Address of PLT relocations. */
+#define DT_BIND_NOW 24 /* [sup] */
+#define DT_INIT_ARRAY 25 /* Address of the array of pointers to
+ initialization functions */
+#define DT_FINI_ARRAY 26 /* Address of the array of pointers to
+ termination functions */
+#define DT_INIT_ARRAYSZ 27 /* Size in bytes of the array of
+ initialization functions. */
+#define DT_FINI_ARRAYSZ 28 /* Size in bytes of the array of
+ terminationfunctions. */
+#define DT_RUNPATH 29 /* String table offset of a null-terminated
+ library search path string. */
+#define DT_FLAGS 30 /* Object specific flag values. */
+#define DT_ENCODING 32 /* Values greater than or equal to DT_ENCODING
+ and less than DT_LOOS follow the rules for
+ the interpretation of the d_un union
+ as follows: even == 'd_ptr', even == 'd_val'
+ or none */
+#define DT_PREINIT_ARRAY 32 /* Address of the array of pointers to
+ pre-initialization functions. */
+#define DT_PREINIT_ARRAYSZ 33 /* Size in bytes of the array of
+ pre-initialization functions. */
+#define DT_MAXPOSTAGS 34 /* number of positive tags */
+#define DT_LOOS 0x6000000d /* First OS-specific */
+#define DT_SUNW_AUXILIARY 0x6000000d /* symbol auxiliary name */
+#define DT_SUNW_RTLDINF 0x6000000e /* ld.so.1 info (private) */
+#define DT_SUNW_FILTER 0x6000000f /* symbol filter name */
+#define DT_SUNW_CAP 0x60000010 /* hardware/software */
+#define DT_HIOS 0x6ffff000 /* Last OS-specific */
+
+/*
+ * DT_* entries which fall between DT_VALRNGHI & DT_VALRNGLO use the
+ * Dyn.d_un.d_val field of the Elf*_Dyn structure.
+ */
+#define DT_VALRNGLO 0x6ffffd00
+#define DT_CHECKSUM 0x6ffffdf8 /* elf checksum */
+#define DT_PLTPADSZ 0x6ffffdf9 /* pltpadding size */
+#define DT_MOVEENT 0x6ffffdfa /* move table entry size */
+#define DT_MOVESZ 0x6ffffdfb /* move table size */
+#define DT_FEATURE_1 0x6ffffdfc /* feature holder */
+#define DT_POSFLAG_1 0x6ffffdfd /* flags for DT_* entries, effecting */
+ /* the following DT_* entry. */
+ /* See DF_P1_* definitions */
+#define DT_SYMINSZ 0x6ffffdfe /* syminfo table size (in bytes) */
+#define DT_SYMINENT 0x6ffffdff /* syminfo entry size (in bytes) */
+#define DT_VALRNGHI 0x6ffffdff
+
+/*
+ * DT_* entries which fall between DT_ADDRRNGHI & DT_ADDRRNGLO use the
+ * Dyn.d_un.d_ptr field of the Elf*_Dyn structure.
+ *
+ * If any adjustment is made to the ELF object after it has been
+ * built, these entries will need to be adjusted.
+ */
+#define DT_ADDRRNGLO 0x6ffffe00
+#define DT_CONFIG 0x6ffffefa /* configuration information */
+#define DT_DEPAUDIT 0x6ffffefb /* dependency auditing */
+#define DT_AUDIT 0x6ffffefc /* object auditing */
+#define DT_PLTPAD 0x6ffffefd /* pltpadding (sparcv9) */
+#define DT_MOVETAB 0x6ffffefe /* move table */
+#define DT_SYMINFO 0x6ffffeff /* syminfo table */
+#define DT_ADDRRNGHI 0x6ffffeff
+
+#define DT_VERSYM 0x6ffffff0 /* Address of versym section. */
+#define DT_RELACOUNT 0x6ffffff9 /* number of RELATIVE relocations */
+#define DT_RELCOUNT 0x6ffffffa /* number of RELATIVE relocations */
+#define DT_FLAGS_1 0x6ffffffb /* state flags - see DF_1_* defs */
+#define DT_VERDEF 0x6ffffffc /* Address of verdef section. */
+#define DT_VERDEFNUM 0x6ffffffd /* Number of elems in verdef section */
+#define DT_VERNEED 0x6ffffffe /* Address of verneed section. */
+#define DT_VERNEEDNUM 0x6fffffff /* Number of elems in verneed section */
+
+#define DT_LOPROC 0x70000000 /* First processor-specific type. */
+#define DT_DEPRECATED_SPARC_REGISTER 0x7000001
+#define DT_AUXILIARY 0x7ffffffd /* shared library auxiliary name */
+#define DT_USED 0x7ffffffe /* ignored - same as needed */
+#define DT_FILTER 0x7fffffff /* shared library filter name */
+#define DT_HIPROC 0x7fffffff /* Last processor-specific type. */
+
+/* Values for DT_FLAGS */
+#define DF_ORIGIN 0x0001 /* Indicates that the object being loaded may
+ make reference to the $ORIGIN substitution
+ string */
+#define DF_SYMBOLIC 0x0002 /* Indicates "symbolic" linking. */
+#define DF_TEXTREL 0x0004 /* Indicates there may be relocations in
+ non-writable segments. */
+#define DF_BIND_NOW 0x0008 /* Indicates that the dynamic linker should
+ process all relocations for the object
+ containing this entry before transferring
+ control to the program. */
+#define DF_STATIC_TLS 0x0010 /* Indicates that the shared object or
+ executable contains code using a static
+ thread-local storage scheme. */
+
+/* Values for n_type. Used in core files. */
+#define NT_PRSTATUS 1 /* Process status. */
+#define NT_FPREGSET 2 /* Floating point registers. */
+#define NT_PRPSINFO 3 /* Process state info. */
+
+/* Symbol Binding - ELFNN_ST_BIND - st_info */
+#define STB_LOCAL 0 /* Local symbol */
+#define STB_GLOBAL 1 /* Global symbol */
+#define STB_WEAK 2 /* like global - lower precedence */
+#define STB_LOOS 10 /* Reserved range for operating system */
+#define STB_HIOS 12 /* specific semantics. */
+#define STB_LOPROC 13 /* reserved range for processor */
+#define STB_HIPROC 15 /* specific semantics. */
+
+/* Symbol type - ELFNN_ST_TYPE - st_info */
+#define STT_NOTYPE 0 /* Unspecified type. */
+#define STT_OBJECT 1 /* Data object. */
+#define STT_FUNC 2 /* Function. */
+#define STT_SECTION 3 /* Section. */
+#define STT_FILE 4 /* Source file. */
+#define STT_COMMON 5 /* Uninitialized common block. */
+#define STT_TLS 6 /* TLS object. */
+#define STT_NUM 7
+#define STT_LOOS 10 /* Reserved range for operating system */
+#define STT_HIOS 12 /* specific semantics. */
+#define STT_LOPROC 13 /* reserved range for processor */
+#define STT_HIPROC 15 /* specific semantics. */
+
+/* Symbol visibility - ELFNN_ST_VISIBILITY - st_other */
+#define STV_DEFAULT 0x0 /* Default visibility (see binding). */
+#define STV_INTERNAL 0x1 /* Special meaning in relocatable objects. */
+#define STV_HIDDEN 0x2 /* Not visible. */
+#define STV_PROTECTED 0x3 /* Visible but not preemptible. */
+#define STV_EXPORTED 0x4
+#define STV_SINGLETON 0x5
+#define STV_ELIMINATE 0x6
+
+/* Special symbol table indexes. */
+#define STN_UNDEF 0 /* Undefined symbol index. */
+
+/* Symbol versioning flags. */
+#define VER_DEF_CURRENT 1
+#define VER_DEF_IDX(x) VER_NDX(x)
+
+#define VER_FLG_BASE 0x01
+#define VER_FLG_WEAK 0x02
+
+#define VER_NEED_CURRENT 1
+#define VER_NEED_WEAK (1u << 15)
+#define VER_NEED_HIDDEN VER_NDX_HIDDEN
+#define VER_NEED_IDX(x) VER_NDX(x)
+
+#define VER_NDX_LOCAL 0
+#define VER_NDX_GLOBAL 1
+#define VER_NDX_GIVEN 2
+
+#define VER_NDX_HIDDEN (1u << 15)
+#define VER_NDX(x) ((x) & ~(1u << 15))
+
+#define CA_SUNW_NULL 0
+#define CA_SUNW_HW_1 1 /* first hardware capabilities entry */
+#define CA_SUNW_SF_1 2 /* first software capabilities entry */
+
+/*
+ * Syminfo flag values
+ */
+#define SYMINFO_FLG_DIRECT 0x0001 /* symbol ref has direct association */
+ /* to object containing defn. */
+#define SYMINFO_FLG_PASSTHRU 0x0002 /* ignored - see SYMINFO_FLG_FILTER */
+#define SYMINFO_FLG_COPY 0x0004 /* symbol is a copy-reloc */
+#define SYMINFO_FLG_LAZYLOAD 0x0008 /* object containing defn should be */
+ /* lazily-loaded */
+#define SYMINFO_FLG_DIRECTBIND 0x0010 /* ref should be bound directly to */
+ /* object containing defn. */
+#define SYMINFO_FLG_NOEXTDIRECT 0x0020 /* don't let an external reference */
+ /* directly bind to this symbol */
+#define SYMINFO_FLG_FILTER 0x0002 /* symbol ref is associated to a */
+#define SYMINFO_FLG_AUXILIARY 0x0040 /* standard or auxiliary filter */
+
+/*
+ * Syminfo.si_boundto values.
+ */
+#define SYMINFO_BT_SELF 0xffff /* symbol bound to self */
+#define SYMINFO_BT_PARENT 0xfffe /* symbol bound to parent */
+#define SYMINFO_BT_NONE 0xfffd /* no special symbol binding */
+#define SYMINFO_BT_EXTERN 0xfffc /* symbol defined as external */
+#define SYMINFO_BT_LOWRESERVE 0xff00 /* beginning of reserved entries */
+
+/*
+ * Syminfo version values.
+ */
+#define SYMINFO_NONE 0 /* Syminfo version */
+#define SYMINFO_CURRENT 1
+#define SYMINFO_NUM 2
+
+/*
+ * Relocation types.
+ *
+ * All machine architectures are defined here to allow tools on one to
+ * handle others.
+ */
+
+#define R_386_NONE 0 /* No relocation. */
+#define R_386_32 1 /* Add symbol value. */
+#define R_386_PC32 2 /* Add PC-relative symbol value. */
+#define R_386_GOT32 3 /* Add PC-relative GOT offset. */
+#define R_386_PLT32 4 /* Add PC-relative PLT offset. */
+#define R_386_COPY 5 /* Copy data from shared object. */
+#define R_386_GLOB_DAT 6 /* Set GOT entry to data address. */
+#define R_386_JMP_SLOT 7 /* Set GOT entry to code address. */
+#define R_386_RELATIVE 8 /* Add load address of shared object. */
+#define R_386_GOTOFF 9 /* Add GOT-relative symbol address. */
+#define R_386_GOTPC 10 /* Add PC-relative GOT table address. */
+#define R_386_TLS_TPOFF 14 /* Negative offset in static TLS block */
+#define R_386_TLS_IE 15 /* Absolute address of GOT for -ve static TLS */
+#define R_386_TLS_GOTIE 16 /* GOT entry for negative static TLS block */
+#define R_386_TLS_LE 17 /* Negative offset relative to static TLS */
+#define R_386_TLS_GD 18 /* 32 bit offset to GOT (index,off) pair */
+#define R_386_TLS_LDM 19 /* 32 bit offset to GOT (index,zero) pair */
+#define R_386_TLS_GD_32 24 /* 32 bit offset to GOT (index,off) pair */
+#define R_386_TLS_GD_PUSH 25 /* pushl instruction for Sun ABI GD sequence */
+#define R_386_TLS_GD_CALL 26 /* call instruction for Sun ABI GD sequence */
+#define R_386_TLS_GD_POP 27 /* popl instruction for Sun ABI GD sequence */
+#define R_386_TLS_LDM_32 28 /* 32 bit offset to GOT (index,zero) pair */
+#define R_386_TLS_LDM_PUSH 29 /* pushl instruction for Sun ABI LD sequence */
+#define R_386_TLS_LDM_CALL 30 /* call instruction for Sun ABI LD sequence */
+#define R_386_TLS_LDM_POP 31 /* popl instruction for Sun ABI LD sequence */
+#define R_386_TLS_LDO_32 32 /* 32 bit offset from start of TLS block */
+#define R_386_TLS_IE_32 33 /* 32 bit offset to GOT static TLS offset entry */
+#define R_386_TLS_LE_32 34 /* 32 bit offset within static TLS block */
+#define R_386_TLS_DTPMOD32 35 /* GOT entry containing TLS index */
+#define R_386_TLS_DTPOFF32 36 /* GOT entry containing TLS offset */
+#define R_386_TLS_TPOFF32 37 /* GOT entry of -ve static TLS offset */
+
+#define R_ARM_NONE 0 /* No relocation. */
+#define R_ARM_PC24 1
+#define R_ARM_ABS32 2
+#define R_ARM_REL32 3
+#define R_ARM_PC13 4
+#define R_ARM_ABS16 5
+#define R_ARM_ABS12 6
+#define R_ARM_THM_ABS5 7
+#define R_ARM_ABS8 8
+#define R_ARM_SBREL32 9
+#define R_ARM_THM_PC22 10
+#define R_ARM_THM_PC8 11
+#define R_ARM_AMP_VCALL9 12
+#define R_ARM_SWI24 13
+#define R_ARM_THM_SWI8 14
+#define R_ARM_XPC25 15
+#define R_ARM_THM_XPC22 16
+#define R_ARM_COPY 20 /* Copy data from shared object. */
+#define R_ARM_GLOB_DAT 21 /* Set GOT entry to data address. */
+#define R_ARM_JUMP_SLOT 22 /* Set GOT entry to code address. */
+#define R_ARM_RELATIVE 23 /* Add load address of shared object. */
+#define R_ARM_GOTOFF 24 /* Add GOT-relative symbol address. */
+#define R_ARM_GOTPC 25 /* Add PC-relative GOT table address. */
+#define R_ARM_GOT32 26 /* Add PC-relative GOT offset. */
+#define R_ARM_PLT32 27 /* Add PC-relative PLT offset. */
+#define R_ARM_GNU_VTENTRY 100
+#define R_ARM_GNU_VTINHERIT 101
+#define R_ARM_RSBREL32 250
+#define R_ARM_THM_RPC22 251
+#define R_ARM_RREL32 252
+#define R_ARM_RABS32 253
+#define R_ARM_RPC24 254
+#define R_ARM_RBASE 255
+
+/* Name Value Field Calculation */
+#define R_IA_64_NONE 0 /* None */
+#define R_IA_64_IMM14 0x21 /* immediate14 S + A */
+#define R_IA_64_IMM22 0x22 /* immediate22 S + A */
+#define R_IA_64_IMM64 0x23 /* immediate64 S + A */
+#define R_IA_64_DIR32MSB 0x24 /* word32 MSB S + A */
+#define R_IA_64_DIR32LSB 0x25 /* word32 LSB S + A */
+#define R_IA_64_DIR64MSB 0x26 /* word64 MSB S + A */
+#define R_IA_64_DIR64LSB 0x27 /* word64 LSB S + A */
+#define R_IA_64_GPREL22 0x2a /* immediate22 @gprel(S + A) */
+#define R_IA_64_GPREL64I 0x2b /* immediate64 @gprel(S + A) */
+#define R_IA_64_GPREL32MSB 0x2c /* word32 MSB @gprel(S + A) */
+#define R_IA_64_GPREL32LSB 0x2d /* word32 LSB @gprel(S + A) */
+#define R_IA_64_GPREL64MSB 0x2e /* word64 MSB @gprel(S + A) */
+#define R_IA_64_GPREL64LSB 0x2f /* word64 LSB @gprel(S + A) */
+#define R_IA_64_LTOFF22 0x32 /* immediate22 @ltoff(S + A) */
+#define R_IA_64_LTOFF64I 0x33 /* immediate64 @ltoff(S + A) */
+#define R_IA_64_PLTOFF22 0x3a /* immediate22 @pltoff(S + A) */
+#define R_IA_64_PLTOFF64I 0x3b /* immediate64 @pltoff(S + A) */
+#define R_IA_64_PLTOFF64MSB 0x3e /* word64 MSB @pltoff(S + A) */
+#define R_IA_64_PLTOFF64LSB 0x3f /* word64 LSB @pltoff(S + A) */
+#define R_IA_64_FPTR64I 0x43 /* immediate64 @fptr(S + A) */
+#define R_IA_64_FPTR32MSB 0x44 /* word32 MSB @fptr(S + A) */
+#define R_IA_64_FPTR32LSB 0x45 /* word32 LSB @fptr(S + A) */
+#define R_IA_64_FPTR64MSB 0x46 /* word64 MSB @fptr(S + A) */
+#define R_IA_64_FPTR64LSB 0x47 /* word64 LSB @fptr(S + A) */
+#define R_IA_64_PCREL60B 0x48 /* immediate60 form1 S + A - P */
+#define R_IA_64_PCREL21B 0x49 /* immediate21 form1 S + A - P */
+#define R_IA_64_PCREL21M 0x4a /* immediate21 form2 S + A - P */
+#define R_IA_64_PCREL21F 0x4b /* immediate21 form3 S + A - P */
+#define R_IA_64_PCREL32MSB 0x4c /* word32 MSB S + A - P */
+#define R_IA_64_PCREL32LSB 0x4d /* word32 LSB S + A - P */
+#define R_IA_64_PCREL64MSB 0x4e /* word64 MSB S + A - P */
+#define R_IA_64_PCREL64LSB 0x4f /* word64 LSB S + A - P */
+#define R_IA_64_LTOFF_FPTR22 0x52 /* immediate22 @ltoff(@fptr(S + A)) */
+#define R_IA_64_LTOFF_FPTR64I 0x53 /* immediate64 @ltoff(@fptr(S + A)) */
+#define R_IA_64_LTOFF_FPTR32MSB 0x54 /* word32 MSB @ltoff(@fptr(S + A)) */
+#define R_IA_64_LTOFF_FPTR32LSB 0x55 /* word32 LSB @ltoff(@fptr(S + A)) */
+#define R_IA_64_LTOFF_FPTR64MSB 0x56 /* word64 MSB @ltoff(@fptr(S + A)) */
+#define R_IA_64_LTOFF_FPTR64LSB 0x57 /* word64 LSB @ltoff(@fptr(S + A)) */
+#define R_IA_64_SEGREL32MSB 0x5c /* word32 MSB @segrel(S + A) */
+#define R_IA_64_SEGREL32LSB 0x5d /* word32 LSB @segrel(S + A) */
+#define R_IA_64_SEGREL64MSB 0x5e /* word64 MSB @segrel(S + A) */
+#define R_IA_64_SEGREL64LSB 0x5f /* word64 LSB @segrel(S + A) */
+#define R_IA_64_SECREL32MSB 0x64 /* word32 MSB @secrel(S + A) */
+#define R_IA_64_SECREL32LSB 0x65 /* word32 LSB @secrel(S + A) */
+#define R_IA_64_SECREL64MSB 0x66 /* word64 MSB @secrel(S + A) */
+#define R_IA_64_SECREL64LSB 0x67 /* word64 LSB @secrel(S + A) */
+#define R_IA_64_REL32MSB 0x6c /* word32 MSB BD + A */
+#define R_IA_64_REL32LSB 0x6d /* word32 LSB BD + A */
+#define R_IA_64_REL64MSB 0x6e /* word64 MSB BD + A */
+#define R_IA_64_REL64LSB 0x6f /* word64 LSB BD + A */
+#define R_IA_64_LTV32MSB 0x74 /* word32 MSB S + A */
+#define R_IA_64_LTV32LSB 0x75 /* word32 LSB S + A */
+#define R_IA_64_LTV64MSB 0x76 /* word64 MSB S + A */
+#define R_IA_64_LTV64LSB 0x77 /* word64 LSB S + A */
+#define R_IA_64_PCREL21BI 0x79 /* immediate21 form1 S + A - P */
+#define R_IA_64_PCREL22 0x7a /* immediate22 S + A - P */
+#define R_IA_64_PCREL64I 0x7b /* immediate64 S + A - P */
+#define R_IA_64_IPLTMSB 0x80 /* function descriptor MSB special */
+#define R_IA_64_IPLTLSB 0x81 /* function descriptor LSB speciaal */
+#define R_IA_64_SUB 0x85 /* immediate64 A - S */
+#define R_IA_64_LTOFF22X 0x86 /* immediate22 special */
+#define R_IA_64_LDXMOV 0x87 /* immediate22 special */
+#define R_IA_64_TPREL14 0x91 /* imm14 @tprel(S + A) */
+#define R_IA_64_TPREL22 0x92 /* imm22 @tprel(S + A) */
+#define R_IA_64_TPREL64I 0x93 /* imm64 @tprel(S + A) */
+#define R_IA_64_TPREL64MSB 0x96 /* word64 MSB @tprel(S + A) */
+#define R_IA_64_TPREL64LSB 0x97 /* word64 LSB @tprel(S + A) */
+#define R_IA_64_LTOFF_TPREL22 0x9a /* imm22 @ltoff(@tprel(S+A)) */
+#define R_IA_64_DTPMOD64MSB 0xa6 /* word64 MSB @dtpmod(S + A) */
+#define R_IA_64_DTPMOD64LSB 0xa7 /* word64 LSB @dtpmod(S + A) */
+#define R_IA_64_LTOFF_DTPMOD22 0xaa /* imm22 @ltoff(@dtpmod(S+A)) */
+#define R_IA_64_DTPREL14 0xb1 /* imm14 @dtprel(S + A) */
+#define R_IA_64_DTPREL22 0xb2 /* imm22 @dtprel(S + A) */
+#define R_IA_64_DTPREL64I 0xb3 /* imm64 @dtprel(S + A) */
+#define R_IA_64_DTPREL32MSB 0xb4 /* word32 MSB @dtprel(S + A) */
+#define R_IA_64_DTPREL32LSB 0xb5 /* word32 LSB @dtprel(S + A) */
+#define R_IA_64_DTPREL64MSB 0xb6 /* word64 MSB @dtprel(S + A) */
+#define R_IA_64_DTPREL64LSB 0xb7 /* word64 LSB @dtprel(S + A) */
+#define R_IA_64_LTOFF_DTPREL22 0xba /* imm22 @ltoff(@dtprel(S+A)) */
+
+#define R_MIPS_NONE 0 /* No reloc */
+#define R_MIPS_16 1 /* Direct 16 bit */
+#define R_MIPS_32 2 /* Direct 32 bit */
+#define R_MIPS_REL32 3 /* PC relative 32 bit */
+#define R_MIPS_26 4 /* Direct 26 bit shifted */
+#define R_MIPS_HI16 5 /* High 16 bit */
+#define R_MIPS_LO16 6 /* Low 16 bit */
+#define R_MIPS_GPREL16 7 /* GP relative 16 bit */
+#define R_MIPS_LITERAL 8 /* 16 bit literal entry */
+#define R_MIPS_GOT16 9 /* 16 bit GOT entry */
+#define R_MIPS_PC16 10 /* PC relative 16 bit */
+#define R_MIPS_CALL16 11 /* 16 bit GOT entry for function */
+#define R_MIPS_GPREL32 12 /* GP relative 32 bit */
+#define R_MIPS_GOTHI16 21 /* GOT HI 16 bit */
+#define R_MIPS_GOTLO16 22 /* GOT LO 16 bit */
+#define R_MIPS_CALLHI16 30 /* upper 16 bit GOT entry for function */
+#define R_MIPS_CALLLO16 31 /* lower 16 bit GOT entry for function */
+
+#define R_PPC_NONE 0 /* No relocation. */
+#define R_PPC_ADDR32 1
+#define R_PPC_ADDR24 2
+#define R_PPC_ADDR16 3
+#define R_PPC_ADDR16_LO 4
+#define R_PPC_ADDR16_HI 5
+#define R_PPC_ADDR16_HA 6
+#define R_PPC_ADDR14 7
+#define R_PPC_ADDR14_BRTAKEN 8
+#define R_PPC_ADDR14_BRNTAKEN 9
+#define R_PPC_REL24 10
+#define R_PPC_REL14 11
+#define R_PPC_REL14_BRTAKEN 12
+#define R_PPC_REL14_BRNTAKEN 13
+#define R_PPC_GOT16 14
+#define R_PPC_GOT16_LO 15
+#define R_PPC_GOT16_HI 16
+#define R_PPC_GOT16_HA 17
+#define R_PPC_PLTREL24 18
+#define R_PPC_COPY 19
+#define R_PPC_GLOB_DAT 20
+#define R_PPC_JMP_SLOT 21
+#define R_PPC_RELATIVE 22
+#define R_PPC_LOCAL24PC 23
+#define R_PPC_UADDR32 24
+#define R_PPC_UADDR16 25
+#define R_PPC_REL32 26
+#define R_PPC_PLT32 27
+#define R_PPC_PLTREL32 28
+#define R_PPC_PLT16_LO 29
+#define R_PPC_PLT16_HI 30
+#define R_PPC_PLT16_HA 31
+#define R_PPC_SDAREL16 32
+#define R_PPC_SECTOFF 33
+#define R_PPC_SECTOFF_LO 34
+#define R_PPC_SECTOFF_HI 35
+#define R_PPC_SECTOFF_HA 36
+
+/*
+ * TLS relocations
+ */
+#define R_PPC_TLS 67
+#define R_PPC_DTPMOD32 68
+#define R_PPC_TPREL16 69
+#define R_PPC_TPREL16_LO 70
+#define R_PPC_TPREL16_HI 71
+#define R_PPC_TPREL16_HA 72
+#define R_PPC_TPREL32 73
+#define R_PPC_DTPREL16 74
+#define R_PPC_DTPREL16_LO 75
+#define R_PPC_DTPREL16_HI 76
+#define R_PPC_DTPREL16_HA 77
+#define R_PPC_DTPREL32 78
+#define R_PPC_GOT_TLSGD16 79
+#define R_PPC_GOT_TLSGD16_LO 80
+#define R_PPC_GOT_TLSGD16_HI 81
+#define R_PPC_GOT_TLSGD16_HA 82
+#define R_PPC_GOT_TLSLD16 83
+#define R_PPC_GOT_TLSLD16_LO 84
+#define R_PPC_GOT_TLSLD16_HI 85
+#define R_PPC_GOT_TLSLD16_HA 86
+#define R_PPC_GOT_TPREL16 87
+#define R_PPC_GOT_TPREL16_LO 88
+#define R_PPC_GOT_TPREL16_HI 89
+#define R_PPC_GOT_TPREL16_HA 90
+
+/*
+ * The remaining relocs are from the Embedded ELF ABI, and are not in the
+ * SVR4 ELF ABI.
+ */
+
+#define R_PPC_EMB_NADDR32 101
+#define R_PPC_EMB_NADDR16 102
+#define R_PPC_EMB_NADDR16_LO 103
+#define R_PPC_EMB_NADDR16_HI 104
+#define R_PPC_EMB_NADDR16_HA 105
+#define R_PPC_EMB_SDAI16 106
+#define R_PPC_EMB_SDA2I16 107
+#define R_PPC_EMB_SDA2REL 108
+#define R_PPC_EMB_SDA21 109
+#define R_PPC_EMB_MRKREF 110
+#define R_PPC_EMB_RELSEC16 111
+#define R_PPC_EMB_RELST_LO 112
+#define R_PPC_EMB_RELST_HI 113
+#define R_PPC_EMB_RELST_HA 114
+#define R_PPC_EMB_BIT_FLD 115
+#define R_PPC_EMB_RELSDA 116
+
+#define R_SPARC_NONE 0
+#define R_SPARC_8 1
+#define R_SPARC_16 2
+#define R_SPARC_32 3
+#define R_SPARC_DISP8 4
+#define R_SPARC_DISP16 5
+#define R_SPARC_DISP32 6
+#define R_SPARC_WDISP30 7
+#define R_SPARC_WDISP22 8
+#define R_SPARC_HI22 9
+#define R_SPARC_22 10
+#define R_SPARC_13 11
+#define R_SPARC_LO10 12
+#define R_SPARC_GOT10 13
+#define R_SPARC_GOT13 14
+#define R_SPARC_GOT22 15
+#define R_SPARC_PC10 16
+#define R_SPARC_PC22 17
+#define R_SPARC_WPLT30 18
+#define R_SPARC_COPY 19
+#define R_SPARC_GLOB_DAT 20
+#define R_SPARC_JMP_SLOT 21
+#define R_SPARC_RELATIVE 22
+#define R_SPARC_UA32 23
+#define R_SPARC_PLT32 24
+#define R_SPARC_HIPLT22 25
+#define R_SPARC_LOPLT10 26
+#define R_SPARC_PCPLT32 27
+#define R_SPARC_PCPLT22 28
+#define R_SPARC_PCPLT10 29
+#define R_SPARC_10 30
+#define R_SPARC_11 31
+#define R_SPARC_64 32
+#define R_SPARC_OLO10 33
+#define R_SPARC_HH22 34
+#define R_SPARC_HM10 35
+#define R_SPARC_LM22 36
+#define R_SPARC_PC_HH22 37
+#define R_SPARC_PC_HM10 38
+#define R_SPARC_PC_LM22 39
+#define R_SPARC_WDISP16 40
+#define R_SPARC_WDISP19 41
+#define R_SPARC_GLOB_JMP 42
+#define R_SPARC_7 43
+#define R_SPARC_5 44
+#define R_SPARC_6 45
+#define R_SPARC_DISP64 46
+#define R_SPARC_PLT64 47
+#define R_SPARC_HIX22 48
+#define R_SPARC_LOX10 49
+#define R_SPARC_H44 50
+#define R_SPARC_M44 51
+#define R_SPARC_L44 52
+#define R_SPARC_REGISTER 53
+#define R_SPARC_UA64 54
+#define R_SPARC_UA16 55
+#define R_SPARC_TLS_GD_HI22 56
+#define R_SPARC_TLS_GD_LO10 57
+#define R_SPARC_TLS_GD_ADD 58
+#define R_SPARC_TLS_GD_CALL 59
+#define R_SPARC_TLS_LDM_HI22 60
+#define R_SPARC_TLS_LDM_LO10 61
+#define R_SPARC_TLS_LDM_ADD 62
+#define R_SPARC_TLS_LDM_CALL 63
+#define R_SPARC_TLS_LDO_HIX22 64
+#define R_SPARC_TLS_LDO_LOX10 65
+#define R_SPARC_TLS_LDO_ADD 66
+#define R_SPARC_TLS_IE_HI22 67
+#define R_SPARC_TLS_IE_LO10 68
+#define R_SPARC_TLS_IE_LD 69
+#define R_SPARC_TLS_IE_LDX 70
+#define R_SPARC_TLS_IE_ADD 71
+#define R_SPARC_TLS_LE_HIX22 72
+#define R_SPARC_TLS_LE_LOX10 73
+#define R_SPARC_TLS_DTPMOD32 74
+#define R_SPARC_TLS_DTPMOD64 75
+#define R_SPARC_TLS_DTPOFF32 76
+#define R_SPARC_TLS_DTPOFF64 77
+#define R_SPARC_TLS_TPOFF32 78
+#define R_SPARC_TLS_TPOFF64 79
+
+#define R_X86_64_NONE 0 /* No relocation. */
+#define R_X86_64_64 1 /* Add 64 bit symbol value. */
+#define R_X86_64_PC32 2 /* PC-relative 32 bit signed sym value. */
+#define R_X86_64_GOT32 3 /* PC-relative 32 bit GOT offset. */
+#define R_X86_64_PLT32 4 /* PC-relative 32 bit PLT offset. */
+#define R_X86_64_COPY 5 /* Copy data from shared object. */
+#define R_X86_64_GLOB_DAT 6 /* Set GOT entry to data address. */
+#define R_X86_64_JMP_SLOT 7 /* Set GOT entry to code address. */
+#define R_X86_64_RELATIVE 8 /* Add load address of shared object. */
+#define R_X86_64_GOTPCREL 9 /* Add 32 bit signed pcrel offset to GOT. */
+#define R_X86_64_32 10 /* Add 32 bit zero extended symbol value */
+#define R_X86_64_32S 11 /* Add 32 bit sign extended symbol value */
+#define R_X86_64_16 12 /* Add 16 bit zero extended symbol value */
+#define R_X86_64_PC16 13 /* Add 16 bit signed extended pc relative symbol value */
+#define R_X86_64_8 14 /* Add 8 bit zero extended symbol value */
+#define R_X86_64_PC8 15 /* Add 8 bit signed extended pc relative symbol value */
+#define R_X86_64_DTPMOD64 16 /* ID of module containing symbol */
+#define R_X86_64_DTPOFF64 17 /* Offset in TLS block */
+#define R_X86_64_TPOFF64 18 /* Offset in static TLS block */
+#define R_X86_64_TLSGD 19 /* PC relative offset to GD GOT entry */
+#define R_X86_64_TLSLD 20 /* PC relative offset to LD GOT entry */
+#define R_X86_64_DTPOFF32 21 /* Offset in TLS block */
+#define R_X86_64_GOTTPOFF 22 /* PC relative offset to IE GOT entry */
+#define R_X86_64_TPOFF32 23 /* Offset in static TLS block */
+
+
+#endif /* !_SYS_ELF_COMMON_H_ */
diff --git a/src/coreclr/src/pal/src/libunwind_mac/include/ucontext.h b/src/coreclr/src/pal/src/libunwind_mac/include/ucontext.h
new file mode 100644
index 000000000000..e759833309e8
--- /dev/null
+++ b/src/coreclr/src/pal/src/libunwind_mac/include/ucontext.h
@@ -0,0 +1,47 @@
+/* Copyright (C) 2004 Hewlett-Packard Co.
+ Contributed by David Mosberger-Tang .
+
+This file is part of libunwind.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+#define UC_MCONTEXT_GREGS_R8 0x28
+#define UC_MCONTEXT_GREGS_R9 0x30
+#define UC_MCONTEXT_GREGS_R10 0x38
+#define UC_MCONTEXT_GREGS_R11 0x40
+#define UC_MCONTEXT_GREGS_R12 0x48
+#define UC_MCONTEXT_GREGS_R13 0x50
+#define UC_MCONTEXT_GREGS_R14 0x58
+#define UC_MCONTEXT_GREGS_R15 0x60
+#define UC_MCONTEXT_GREGS_RDI 0x68
+#define UC_MCONTEXT_GREGS_RSI 0x70
+#define UC_MCONTEXT_GREGS_RBP 0x78
+#define UC_MCONTEXT_GREGS_RBX 0x80
+#define UC_MCONTEXT_GREGS_RDX 0x88
+#define UC_MCONTEXT_GREGS_RAX 0x90
+#define UC_MCONTEXT_GREGS_RCX 0x98
+#define UC_MCONTEXT_GREGS_RSP 0xa0
+#define UC_MCONTEXT_GREGS_RIP 0xa8
+#define UC_MCONTEXT_FPREGS_PTR 0x1a8
+#define UC_MCONTEXT_FPREGS_MEM 0xe0
+#define UC_SIGMASK 0x128
+#define FPREGS_OFFSET_MXCSR 0x18
+
+#include
diff --git a/src/coreclr/src/pal/src/libunwind_mac/src/missing-functions.c b/src/coreclr/src/pal/src/libunwind_mac/src/missing-functions.c
new file mode 100644
index 000000000000..8399214e4952
--- /dev/null
+++ b/src/coreclr/src/pal/src/libunwind_mac/src/missing-functions.c
@@ -0,0 +1,61 @@
+/* libunwind - a platform-independent unwind library
+ Copyright (c) 2003, 2005 Hewlett-Packard Development Company, L.P.
+ Contributed by David Mosberger-Tang
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+
+// This is minimal implementation functions files required to cross compile
+// libunwind on MacOS for UNW_REMOTE_ONLY application.
+
+#include
+#include
+#include
+#include
+#include "libunwind_i.h"
+#include "compiler.h"
+
+unw_addr_space_t UNW_OBJ(local_addr_space);
+
+unw_accessors_t *
+unw_get_accessors (unw_addr_space_t as)
+{
+ if (!atomic_load(&tdep_init_done))
+ tdep_init ();
+ return &as->acc;
+}
+
+unw_accessors_t *
+unw_get_accessors_int (unw_addr_space_t as)
+{
+ return unw_get_accessors(as);
+}
+
+int
+unw_is_signal_frame (unw_cursor_t *cursor)
+{
+ struct cursor *c = (struct cursor *) cursor;
+ return c->sigcontext_format != X86_64_SCF_NONE;
+}
+
+int
+UNW_OBJ(handle_signal_frame) (unw_cursor_t *cursor)
+{
+ return -UNW_EBADFRAME;
+}
diff --git a/src/coreclr/src/pal/src/loader/module.cpp b/src/coreclr/src/pal/src/loader/module.cpp
index 68675ac848a4..58126e1cc5a0 100644
--- a/src/coreclr/src/pal/src/loader/module.cpp
+++ b/src/coreclr/src/pal/src/loader/module.cpp
@@ -603,6 +603,13 @@ PAL_LoadLibraryDirect(
lpLibFileName ? lpLibFileName : W16_NULLSTRING,
lpLibFileName ? lpLibFileName : W16_NULLSTRING);
+ // Getting nullptr as name indicates redirection to current library
+ if (lpLibFileName == nullptr)
+ {
+ dl_handle = dlopen(NULL, RTLD_LAZY);
+ goto done;
+ }
+
if (!LOADVerifyLibraryPath(lpLibFileName))
{
goto done;
@@ -1436,18 +1443,6 @@ static LPWSTR LOADGetModuleFileName(MODSTRUCT *module)
return module->lib_name;
}
-static bool ShouldRedirectToCurrentLibrary(LPCSTR libraryNameOrPath)
-{
- if (!g_running_in_exe)
- return false;
-
- // Getting nullptr as name indicates redirection to current library
- if (libraryNameOrPath == nullptr)
- return true;
-
- return false;
-}
-
/*
Function:
LOADLoadLibraryDirect [internal]
@@ -1464,7 +1459,8 @@ static NATIVE_LIBRARY_HANDLE LOADLoadLibraryDirect(LPCSTR libraryNameOrPath)
{
NATIVE_LIBRARY_HANDLE dl_handle;
- if (ShouldRedirectToCurrentLibrary(libraryNameOrPath))
+ // Getting nullptr as name indicates redirection to current library
+ if (libraryNameOrPath == nullptr)
{
dl_handle = dlopen(NULL, RTLD_LAZY);
}
diff --git a/src/coreclr/src/pal/src/map/map.cpp b/src/coreclr/src/pal/src/map/map.cpp
index 154329885679..75405c7407c8 100644
--- a/src/coreclr/src/pal/src/map/map.cpp
+++ b/src/coreclr/src/pal/src/map/map.cpp
@@ -2137,6 +2137,18 @@ MAPRecordMapping(
return palError;
}
+static size_t OffsetWithinPage(off_t addr)
+{
+ return addr & (GetVirtualPageSize() - 1);
+}
+
+static size_t RoundToPage(size_t size, off_t offset)
+{
+ size_t result = size + OffsetWithinPage(offset);
+ _ASSERTE(result >= size);
+ return result;
+}
+
// Do the actual mmap() call, and record the mapping in the MappedViewList list.
// This call assumes the mapping_critsec has already been taken.
static PAL_ERROR
@@ -2155,9 +2167,13 @@ MAPmmapAndRecord(
_ASSERTE(pPEBaseAddress != NULL);
PAL_ERROR palError = NO_ERROR;
- off_t adjust = offset & (GetVirtualPageSize() - 1);
+ off_t adjust = OffsetWithinPage(offset);
LPVOID pvBaseAddress = static_cast(addr) - adjust;
+ // Ensure address and offset arguments mmap() are page-aligned.
+ _ASSERTE(OffsetWithinPage(offset - adjust) == 0);
+ _ASSERTE(OffsetWithinPage((off_t)pvBaseAddress) == 0);
+
#ifdef __APPLE__
if ((prot & PROT_EXEC) != 0 && IsRunningOnMojaveHardenedRuntime())
{
@@ -2176,7 +2192,7 @@ MAPmmapAndRecord(
else
#endif
{
- pvBaseAddress = mmap(static_cast(addr) - adjust, len + adjust, prot, flags, fd, offset - adjust);
+ pvBaseAddress = mmap(pvBaseAddress, len + adjust, prot, flags, fd, offset - adjust);
if (MAP_FAILED == pvBaseAddress)
{
ERROR_(LOADER)( "mmap failed with code %d: %s.\n", errno, strerror( errno ) );
@@ -2360,7 +2376,7 @@ void * MAPMapPEFile(HANDLE hFile, off_t offset)
// We're going to start adding mappings to the mapping list, so take the critical section
InternalEnterCriticalSection(pThread, &mapping_critsec);
- reserveSize = virtualSize;
+ reserveSize = RoundToPage(virtualSize, offset);
if ((ntHeader.OptionalHeader.SectionAlignment) > GetVirtualPageSize())
{
reserveSize += ntHeader.OptionalHeader.SectionAlignment;
@@ -2441,11 +2457,19 @@ void * MAPMapPEFile(HANDLE hFile, off_t offset)
//we have now reserved memory (potentially we got rebased). Walk the PE sections and map each part
//separately.
+ _ASSERTE(OffsetWithinPage((off_t)loadedBase) == 0);
//first, map the PE header to the first page in the image. Get pointers to the section headers
+ loadedHeader = (IMAGE_DOS_HEADER*)(static_cast(loadedBase) + OffsetWithinPage(offset));
+
+ LPVOID loadedHeaderBase;
+ // initialize this on a separate line to prevent a false error about the goto done; jumping over this
+ loadedHeaderBase = NULL;
+
+ _ASSERTE(OffsetWithinPage(offset) == OffsetWithinPage((off_t)loadedHeader));
palError = MAPmmapAndRecord(pFileObject, loadedBase,
- loadedBase, headerSize, PROT_READ, readOnlyFlags, fd, offset,
- (void**)&loadedHeader);
+ (LPVOID)loadedHeader, headerSize, PROT_READ, readOnlyFlags, fd, offset,
+ &loadedHeaderBase);
if (NO_ERROR != palError)
{
ERROR_(LOADER)( "mmap of PE header failed\n" );
@@ -2453,7 +2477,7 @@ void * MAPMapPEFile(HANDLE hFile, off_t offset)
}
TRACE_(LOADER)("PE header loaded @ %p\n", loadedHeader);
- _ASSERTE(loadedHeader == loadedBase); // we already preallocated the space, and we used MAP_FIXED, so we should have gotten this address
+ _ASSERTE(loadedHeaderBase == loadedBase); // we already preallocated the space, and we used MAP_FIXED, so we should have gotten this address
IMAGE_SECTION_HEADER * firstSection;
firstSection = (IMAGE_SECTION_HEADER*)(((char *)loadedHeader)
+ loadedHeader->e_lfanew
@@ -2465,9 +2489,9 @@ void * MAPMapPEFile(HANDLE hFile, off_t offset)
// Validation
char* sectionHeaderEnd;
sectionHeaderEnd = (char*)firstSection + numSections * sizeof(IMAGE_SECTION_HEADER);
- if ( ((void*)firstSection < loadedBase)
+ if ( ((void*)firstSection < loadedHeader)
|| ((char*)firstSection > sectionHeaderEnd)
- || (sectionHeaderEnd > (char*)loadedBase + virtualSize)
+ || (sectionHeaderEnd > (char*)loadedHeader + virtualSize)
)
{
ERROR_(LOADER)( "image is corrupt\n" );
@@ -2476,7 +2500,8 @@ void * MAPMapPEFile(HANDLE hFile, off_t offset)
}
void* prevSectionEnd;
- prevSectionEnd = (char*)loadedBase + headerSize; // the first "section" for our purposes is the header
+ prevSectionEnd = (char*)loadedHeader + headerSize; // the first "section" for our purposes is the header
+
for (unsigned i = 0; i < numSections; ++i)
{
//for each section, map the section of the file to the correct virtual offset. Gather the
@@ -2485,13 +2510,13 @@ void * MAPMapPEFile(HANDLE hFile, off_t offset)
int prot = 0;
IMAGE_SECTION_HEADER ¤tHeader = firstSection[i];
- void* sectionBase = (char*)loadedBase + currentHeader.VirtualAddress;
+ void* sectionBase = (char*)loadedHeader + currentHeader.VirtualAddress;
void* sectionBaseAligned = ALIGN_DOWN(sectionBase, GetVirtualPageSize());
// Validate the section header
- if ( (sectionBase < loadedBase) // Did computing the section base overflow?
+ if ( (sectionBase < loadedHeader) // Did computing the section base overflow?
|| ((char*)sectionBase + currentHeader.SizeOfRawData < (char*)sectionBase) // Does the section overflow?
- || ((char*)sectionBase + currentHeader.SizeOfRawData > (char*)loadedBase + virtualSize) // Does the section extend past the end of the image as the header stated?
+ || ((char*)sectionBase + currentHeader.SizeOfRawData > (char*)loadedHeader + virtualSize) // Does the section extend past the end of the image as the header stated?
|| (prevSectionEnd > sectionBase) // Does this section overlap the previous one?
)
{
@@ -2499,6 +2524,7 @@ void * MAPMapPEFile(HANDLE hFile, off_t offset)
palError = ERROR_INVALID_PARAMETER;
goto doneReleaseMappingCriticalSection;
}
+
if (currentHeader.Misc.VirtualSize > currentHeader.SizeOfRawData)
{
ERROR_(LOADER)( "no support for zero-padded sections, section %d\n", i );
@@ -2506,6 +2532,13 @@ void * MAPMapPEFile(HANDLE hFile, off_t offset)
goto doneReleaseMappingCriticalSection;
}
+ if (OffsetWithinPage((off_t)sectionBase) != OffsetWithinPage(offset + currentHeader.PointerToRawData))
+ {
+ ERROR_(LOADER)("can't map section if data and VA hint have different page alignment %d\n", i);
+ palError = ERROR_INVALID_PARAMETER;
+ goto doneReleaseMappingCriticalSection;
+ }
+
// Is there space between the previous section and this one? If so, add a PROT_NONE mapping to cover it.
if (prevSectionEnd < sectionBaseAligned)
{
@@ -2600,7 +2633,7 @@ void * MAPMapPEFile(HANDLE hFile, off_t offset)
if (palError == ERROR_SUCCESS)
{
- retval = loadedBase;
+ retval = loadedHeader;
LOGEXIT("MAPMapPEFile returns %p\n", retval);
}
else
diff --git a/src/coreclr/src/pal/src/misc/jitsupport.cpp b/src/coreclr/src/pal/src/misc/jitsupport.cpp
index 83ed940567c4..68af6aa1bd6d 100644
--- a/src/coreclr/src/pal/src/misc/jitsupport.cpp
+++ b/src/coreclr/src/pal/src/misc/jitsupport.cpp
@@ -50,8 +50,8 @@ PAL_GetJitCpuCapabilityFlags(CORJIT_FLAGS *flags)
// CPUCompileFlags.Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_DCPOP);
#endif
#ifdef HWCAP_ASIMDDP
-// if (hwCap & HWCAP_ASIMDDP)
-// CPUCompileFlags.Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_DP);
+ if (hwCap & HWCAP_ASIMDDP)
+ CPUCompileFlags.Set(InstructionSet_Dp);
#endif
#ifdef HWCAP_FCMA
// if (hwCap & HWCAP_FCMA)
@@ -98,8 +98,8 @@ PAL_GetJitCpuCapabilityFlags(CORJIT_FLAGS *flags)
CPUCompileFlags.Set(InstructionSet_AdvSimd);
#endif
#ifdef HWCAP_ASIMDRDM
-// if (hwCap & HWCAP_ASIMDRDM)
-// CPUCompileFlags.Set(CORJIT_FLAGS::CORJIT_FLAG_HAS_ARM64_ADVSIMD_V81);
+ if (hwCap & HWCAP_ASIMDRDM)
+ CPUCompileFlags.Set(InstructionSet_Rdm);
#endif
#ifdef HWCAP_ASIMDHP
// if (hwCap & HWCAP_ASIMDHP)
diff --git a/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunConstants.cs b/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunConstants.cs
index be037341870d..ce6de5de37ca 100644
--- a/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunConstants.cs
+++ b/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunConstants.cs
@@ -140,6 +140,7 @@ public enum ReadyToRunHelper
// Not a real helper - handle to current module passed to delay load helpers.
Module = 0x01,
GSCookie = 0x02,
+ IndirectTrapThreads = 0x03,
//
// Delay load helpers
diff --git a/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunInstructionSet.cs b/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunInstructionSet.cs
index 0c51d7d79a8a..c4b646cb22d9 100644
--- a/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunInstructionSet.cs
+++ b/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunInstructionSet.cs
@@ -34,6 +34,8 @@ public enum ReadyToRunInstructionSet
Sha256=20,
Atomics=21,
X86Base=22,
+ Dp=23,
+ Rdm=24,
}
}
diff --git a/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunInstructionSetHelper.cs b/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunInstructionSetHelper.cs
index 76e6e79a6cd6..0a9726239b72 100644
--- a/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunInstructionSetHelper.cs
+++ b/src/coreclr/src/tools/Common/Internal/Runtime/ReadyToRunInstructionSetHelper.cs
@@ -31,6 +31,10 @@ public static class ReadyToRunInstructionSetHelper
case InstructionSet.ARM64_Aes_Arm64: return ReadyToRunInstructionSet.Aes;
case InstructionSet.ARM64_Crc32: return ReadyToRunInstructionSet.Crc32;
case InstructionSet.ARM64_Crc32_Arm64: return ReadyToRunInstructionSet.Crc32;
+ case InstructionSet.ARM64_Dp: return ReadyToRunInstructionSet.Dp;
+ case InstructionSet.ARM64_Dp_Arm64: return ReadyToRunInstructionSet.Dp;
+ case InstructionSet.ARM64_Rdm: return ReadyToRunInstructionSet.Rdm;
+ case InstructionSet.ARM64_Rdm_Arm64: return ReadyToRunInstructionSet.Rdm;
case InstructionSet.ARM64_Sha1: return ReadyToRunInstructionSet.Sha1;
case InstructionSet.ARM64_Sha1_Arm64: return ReadyToRunInstructionSet.Sha1;
case InstructionSet.ARM64_Sha256: return ReadyToRunInstructionSet.Sha256;
diff --git a/src/coreclr/src/tools/Common/JitInterface/CorInfoImpl.cs b/src/coreclr/src/tools/Common/JitInterface/CorInfoImpl.cs
index 2be99788f34a..da5d691a39cf 100644
--- a/src/coreclr/src/tools/Common/JitInterface/CorInfoImpl.cs
+++ b/src/coreclr/src/tools/Common/JitInterface/CorInfoImpl.cs
@@ -135,21 +135,17 @@ public TextWriter Log
private CORINFO_MODULE_STRUCT_* _methodScope; // Needed to resolve CORINFO_EH_CLAUSE tokens
- private bool _isFallbackBodyCompilation; // True if we're compiling a fallback method body after compiling the real body failed
-
- private void CompileMethodInternal(IMethodNode methodCodeNodeNeedingCode, MethodIL methodIL = null)
+ private void CompileMethodInternal(IMethodNode methodCodeNodeNeedingCode, MethodIL methodIL)
{
- _isFallbackBodyCompilation = methodIL != null;
-
- CORINFO_METHOD_INFO methodInfo;
- methodIL = Get_CORINFO_METHOD_INFO(MethodBeingCompiled, methodIL, &methodInfo);
-
- // This is e.g. an "extern" method in C# without a DllImport or InternalCall.
+ // methodIL must not be null
if (methodIL == null)
{
ThrowHelper.ThrowInvalidProgramException(ExceptionStringID.InvalidProgramSpecific, MethodBeingCompiled);
}
+ CORINFO_METHOD_INFO methodInfo;
+ Get_CORINFO_METHOD_INFO(MethodBeingCompiled, methodIL, &methodInfo);
+
_methodScope = methodInfo.scope;
#if !READYTORUN
@@ -428,16 +424,12 @@ private Object HandleToObject(IntPtr handle)
private FieldDesc HandleToObject(CORINFO_FIELD_STRUCT_* field) { return (FieldDesc)HandleToObject((IntPtr)field); }
private CORINFO_FIELD_STRUCT_* ObjectToHandle(FieldDesc field) { return (CORINFO_FIELD_STRUCT_*)ObjectToHandle((Object)field); }
- private MethodIL Get_CORINFO_METHOD_INFO(MethodDesc method, MethodIL methodIL, CORINFO_METHOD_INFO* methodInfo)
+ private bool Get_CORINFO_METHOD_INFO(MethodDesc method, MethodIL methodIL, CORINFO_METHOD_INFO* methodInfo)
{
- // MethodIL can be provided externally for the case of a method whose IL was replaced because we couldn't compile it.
- if (methodIL == null)
- methodIL = _compilation.GetMethodIL(method);
-
if (methodIL == null)
{
*methodInfo = default(CORINFO_METHOD_INFO);
- return null;
+ return false;
}
methodInfo->ftn = ObjectToHandle(method);
@@ -465,7 +457,7 @@ private MethodIL Get_CORINFO_METHOD_INFO(MethodDesc method, MethodIL methodIL, C
Get_CORINFO_SIG_INFO(method, &methodInfo->args);
Get_CORINFO_SIG_INFO(methodIL.GetLocals(), &methodInfo->locals);
- return methodIL;
+ return true;
}
private void Get_CORINFO_SIG_INFO(MethodDesc method, CORINFO_SIG_INFO* sig, bool suppressHiddenArgument = false)
@@ -510,6 +502,49 @@ private void Get_CORINFO_SIG_INFO(MethodDesc method, CORINFO_SIG_INFO* sig, bool
}
}
+ private bool TryGetUnmanagedCallingConventionFromModOpt(MethodSignature signature, out CorInfoCallConv callConv)
+ {
+ callConv = CorInfoCallConv.CORINFO_CALLCONV_UNMANAGED;
+ if (!signature.HasEmbeddedSignatureData || signature.GetEmbeddedSignatureData() == null)
+ return false;
+
+ foreach (EmbeddedSignatureData data in signature.GetEmbeddedSignatureData())
+ {
+ if (data.kind != EmbeddedSignatureDataKind.OptionalCustomModifier)
+ continue;
+
+ // We only care about the modifiers for the return type. These will be at the start of
+ // the signature, so will be first in the array of embedded signature data.
+ if (data.index != MethodSignature.IndexOfCustomModifiersOnReturnType)
+ break;
+
+ if (!(data.type is DefType defType))
+ continue;
+
+ if (defType.Namespace != "System.Runtime.CompilerServices")
+ continue;
+
+ // Take the first recognized calling convention in metadata.
+ switch (defType.Name)
+ {
+ case "CallConvCdecl":
+ callConv = CorInfoCallConv.CORINFO_CALLCONV_C;
+ return true;
+ case "CallConvStdcall":
+ callConv = CorInfoCallConv.CORINFO_CALLCONV_STDCALL;
+ return true;
+ case "CallConvFastcall":
+ callConv = CorInfoCallConv.CORINFO_CALLCONV_FASTCALL;
+ return true;
+ case "CallConvThiscall":
+ callConv = CorInfoCallConv.CORINFO_CALLCONV_THISCALL;
+ return true;
+ }
+ }
+
+ return false;
+ }
+
private void Get_CORINFO_SIG_INFO(MethodSignature signature, CORINFO_SIG_INFO* sig)
{
sig->callConv = (CorInfoCallConv)(signature.Flags & MethodSignatureFlags.UnmanagedCallingConventionMask);
@@ -520,6 +555,22 @@ private void Get_CORINFO_SIG_INFO(MethodSignature signature, CORINFO_SIG_INFO* s
if (!signature.IsStatic) sig->callConv |= CorInfoCallConv.CORINFO_CALLCONV_HASTHIS;
+ // Unmanaged calling convention indicates modopt should be read
+ if (sig->callConv == CorInfoCallConv.CORINFO_CALLCONV_UNMANAGED)
+ {
+ if (TryGetUnmanagedCallingConventionFromModOpt(signature, out CorInfoCallConv callConvMaybe))
+ {
+ sig->callConv = callConvMaybe;
+ }
+ else
+ {
+ // Use platform default
+ sig->callConv = _compilation.TypeSystemContext.Target.IsWindows
+ ? CorInfoCallConv.CORINFO_CALLCONV_STDCALL
+ : CorInfoCallConv.CORINFO_CALLCONV_C;
+ }
+ }
+
TypeDesc returnType = signature.ReturnType;
CorInfoType corInfoRetType = asCorInfoType(signature.ReturnType, &sig->retTypeClass);
@@ -803,8 +854,9 @@ private void getMethodSig(CORINFO_METHOD_STRUCT_* ftn, CORINFO_SIG_INFO* sig, CO
private bool getMethodInfo(CORINFO_METHOD_STRUCT_* ftn, CORINFO_METHOD_INFO* info)
{
- MethodIL methodIL = Get_CORINFO_METHOD_INFO(HandleToObject(ftn), null, info);
- return methodIL != null;
+ MethodDesc method = HandleToObject(ftn);
+ MethodIL methodIL = _compilation.GetMethodIL(method);
+ return Get_CORINFO_METHOD_INFO(method, methodIL, info);
}
private CorInfoInline canInline(CORINFO_METHOD_STRUCT_* callerHnd, CORINFO_METHOD_STRUCT_* calleeHnd, ref uint pRestrictions)
@@ -1663,10 +1715,11 @@ private CorInfoInitClassResult initClass(CORINFO_FIELD_STRUCT_* field, CORINFO_M
MethodDesc md = method == null ? MethodBeingCompiled : HandleToObject(method);
TypeDesc type = fd != null ? fd.OwningType : typeFromContext(context);
- if (_isFallbackBodyCompilation ||
+ if (
#if READYTORUN
IsClassPreInited(type)
#else
+ _isFallbackBodyCompilation ||
!_compilation.HasLazyStaticConstructor(type)
#endif
)
@@ -2443,12 +2496,6 @@ private uint getThreadTLSIndex(ref void* ppIndirection)
private void* getInlinedCallFrameVptr(ref void* ppIndirection)
{ throw new NotImplementedException("getInlinedCallFrameVptr"); }
- private int* getAddrOfCaptureThreadGlobal(ref void* ppIndirection)
- {
- ppIndirection = null;
- return null;
- }
-
private Dictionary _helperCache = new Dictionary();
private void* getHelperFtn(CorInfoHelpFunc ftnNum, ref void* ppIndirection)
{
diff --git a/src/coreclr/src/tools/Common/JitInterface/CorInfoInstructionSet.cs b/src/coreclr/src/tools/Common/JitInterface/CorInfoInstructionSet.cs
index 5257d470e377..c04ffa4bd941 100644
--- a/src/coreclr/src/tools/Common/JitInterface/CorInfoInstructionSet.cs
+++ b/src/coreclr/src/tools/Common/JitInterface/CorInfoInstructionSet.cs
@@ -21,17 +21,21 @@ public enum InstructionSet
ARM64_AdvSimd=2,
ARM64_Aes=3,
ARM64_Crc32=4,
- ARM64_Sha1=5,
- ARM64_Sha256=6,
- ARM64_Atomics=7,
- ARM64_Vector64=8,
- ARM64_Vector128=9,
- ARM64_ArmBase_Arm64=10,
- ARM64_AdvSimd_Arm64=11,
- ARM64_Aes_Arm64=12,
- ARM64_Crc32_Arm64=13,
- ARM64_Sha1_Arm64=14,
- ARM64_Sha256_Arm64=15,
+ ARM64_Dp=5,
+ ARM64_Rdm=6,
+ ARM64_Sha1=7,
+ ARM64_Sha256=8,
+ ARM64_Atomics=9,
+ ARM64_Vector64=10,
+ ARM64_Vector128=11,
+ ARM64_ArmBase_Arm64=12,
+ ARM64_AdvSimd_Arm64=13,
+ ARM64_Aes_Arm64=14,
+ ARM64_Crc32_Arm64=15,
+ ARM64_Dp_Arm64=16,
+ ARM64_Rdm_Arm64=17,
+ ARM64_Sha1_Arm64=18,
+ ARM64_Sha256_Arm64=19,
X64_X86Base=1,
X64_SSE=2,
X64_SSE2=3,
@@ -196,6 +200,14 @@ public static InstructionSetFlags ExpandInstructionSetByImplicationHelper(Target
resultflags.AddInstructionSet(InstructionSet.ARM64_Crc32_Arm64);
if (resultflags.HasInstructionSet(InstructionSet.ARM64_Crc32_Arm64))
resultflags.AddInstructionSet(InstructionSet.ARM64_Crc32);
+ if (resultflags.HasInstructionSet(InstructionSet.ARM64_Dp))
+ resultflags.AddInstructionSet(InstructionSet.ARM64_Dp_Arm64);
+ if (resultflags.HasInstructionSet(InstructionSet.ARM64_Dp_Arm64))
+ resultflags.AddInstructionSet(InstructionSet.ARM64_Dp);
+ if (resultflags.HasInstructionSet(InstructionSet.ARM64_Rdm))
+ resultflags.AddInstructionSet(InstructionSet.ARM64_Rdm_Arm64);
+ if (resultflags.HasInstructionSet(InstructionSet.ARM64_Rdm_Arm64))
+ resultflags.AddInstructionSet(InstructionSet.ARM64_Rdm);
if (resultflags.HasInstructionSet(InstructionSet.ARM64_Sha1))
resultflags.AddInstructionSet(InstructionSet.ARM64_Sha1_Arm64);
if (resultflags.HasInstructionSet(InstructionSet.ARM64_Sha1_Arm64))
@@ -210,6 +222,10 @@ public static InstructionSetFlags ExpandInstructionSetByImplicationHelper(Target
resultflags.AddInstructionSet(InstructionSet.ARM64_ArmBase);
if (resultflags.HasInstructionSet(InstructionSet.ARM64_Crc32))
resultflags.AddInstructionSet(InstructionSet.ARM64_ArmBase);
+ if (resultflags.HasInstructionSet(InstructionSet.ARM64_Dp))
+ resultflags.AddInstructionSet(InstructionSet.ARM64_AdvSimd);
+ if (resultflags.HasInstructionSet(InstructionSet.ARM64_Rdm))
+ resultflags.AddInstructionSet(InstructionSet.ARM64_AdvSimd);
if (resultflags.HasInstructionSet(InstructionSet.ARM64_Sha1))
resultflags.AddInstructionSet(InstructionSet.ARM64_ArmBase);
if (resultflags.HasInstructionSet(InstructionSet.ARM64_Sha256))
@@ -375,6 +391,10 @@ private static InstructionSetFlags ExpandInstructionSetByReverseImplicationHelpe
resultflags.AddInstructionSet(InstructionSet.ARM64_Aes);
if (resultflags.HasInstructionSet(InstructionSet.ARM64_Crc32_Arm64))
resultflags.AddInstructionSet(InstructionSet.ARM64_Crc32);
+ if (resultflags.HasInstructionSet(InstructionSet.ARM64_Dp_Arm64))
+ resultflags.AddInstructionSet(InstructionSet.ARM64_Dp);
+ if (resultflags.HasInstructionSet(InstructionSet.ARM64_Rdm_Arm64))
+ resultflags.AddInstructionSet(InstructionSet.ARM64_Rdm);
if (resultflags.HasInstructionSet(InstructionSet.ARM64_Sha1_Arm64))
resultflags.AddInstructionSet(InstructionSet.ARM64_Sha1);
if (resultflags.HasInstructionSet(InstructionSet.ARM64_Sha256_Arm64))
@@ -385,6 +405,10 @@ private static InstructionSetFlags ExpandInstructionSetByReverseImplicationHelpe
resultflags.AddInstructionSet(InstructionSet.ARM64_Aes);
if (resultflags.HasInstructionSet(InstructionSet.ARM64_ArmBase))
resultflags.AddInstructionSet(InstructionSet.ARM64_Crc32);
+ if (resultflags.HasInstructionSet(InstructionSet.ARM64_AdvSimd))
+ resultflags.AddInstructionSet(InstructionSet.ARM64_Dp);
+ if (resultflags.HasInstructionSet(InstructionSet.ARM64_AdvSimd))
+ resultflags.AddInstructionSet(InstructionSet.ARM64_Rdm);
if (resultflags.HasInstructionSet(InstructionSet.ARM64_ArmBase))
resultflags.AddInstructionSet(InstructionSet.ARM64_Sha1);
if (resultflags.HasInstructionSet(InstructionSet.ARM64_ArmBase))
@@ -520,6 +544,8 @@ public static IEnumerable ArchitectureToValidInstructionSets
yield return new InstructionSetInfo("neon", "AdvSimd", InstructionSet.ARM64_AdvSimd, true);
yield return new InstructionSetInfo("aes", "Aes", InstructionSet.ARM64_Aes, true);
yield return new InstructionSetInfo("crc", "Crc32", InstructionSet.ARM64_Crc32, true);
+ yield return new InstructionSetInfo("dotprod", "Dp", InstructionSet.ARM64_Dp, true);
+ yield return new InstructionSetInfo("rdma", "Rdm", InstructionSet.ARM64_Rdm, true);
yield return new InstructionSetInfo("sha1", "Sha1", InstructionSet.ARM64_Sha1, true);
yield return new InstructionSetInfo("sha2", "Sha256", InstructionSet.ARM64_Sha256, true);
yield return new InstructionSetInfo("lse", "", InstructionSet.ARM64_Atomics, true);
@@ -586,6 +612,10 @@ public void Set64BitInstructionSetVariants(TargetArchitecture architecture)
AddInstructionSet(InstructionSet.ARM64_Aes_Arm64);
if (HasInstructionSet(InstructionSet.ARM64_Crc32))
AddInstructionSet(InstructionSet.ARM64_Crc32_Arm64);
+ if (HasInstructionSet(InstructionSet.ARM64_Dp))
+ AddInstructionSet(InstructionSet.ARM64_Dp_Arm64);
+ if (HasInstructionSet(InstructionSet.ARM64_Rdm))
+ AddInstructionSet(InstructionSet.ARM64_Rdm_Arm64);
if (HasInstructionSet(InstructionSet.ARM64_Sha1))
AddInstructionSet(InstructionSet.ARM64_Sha1_Arm64);
if (HasInstructionSet(InstructionSet.ARM64_Sha256))
diff --git a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/InstructionSetDesc.txt b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/InstructionSetDesc.txt
index 73f529419bb5..615fc9648ed5 100644
--- a/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/InstructionSetDesc.txt
+++ b/src/coreclr/src/tools/Common/JitInterface/ThunkGenerator/InstructionSetDesc.txt
@@ -82,6 +82,8 @@ instructionset ,ARM64 ,ArmBase , ,16 ,ArmBase ,base
instructionset ,ARM64 ,AdvSimd , ,17 ,AdvSimd ,neon
instructionset ,ARM64 ,Aes , ,9 ,Aes ,aes
instructionset ,ARM64 ,Crc32 , ,18 ,Crc32 ,crc
+instructionset ,ARM64 ,Dp , ,23 ,Dp ,dotprod
+instructionset ,ARM64 ,Rdm , ,24 ,Rdm ,rdma
instructionset ,ARM64 ,Sha1 , ,19 ,Sha1 ,sha1
instructionset ,ARM64 ,Sha256 , ,20 ,Sha256 ,sha2
instructionset ,ARM64 , ,Atomics ,21 ,Atomics ,lse
@@ -92,11 +94,15 @@ instructionset64bit,ARM64 ,ArmBase
instructionset64bit,ARM64 ,AdvSimd
instructionset64bit,ARM64 ,Aes
instructionset64bit,ARM64 ,Crc32
+instructionset64bit,ARM64 ,Dp
+instructionset64bit,ARM64 ,Rdm
instructionset64bit,ARM64 ,Sha1
instructionset64bit,ARM64 ,Sha256
implication ,ARM64 ,AdvSimd ,ArmBase
implication ,ARM64 ,Aes ,ArmBase
implication ,ARM64 ,Crc32 ,ArmBase
+implication ,ARM64 ,Dp ,AdvSimd
+implication ,ARM64 ,Rdm ,AdvSimd
implication ,ARM64 ,Sha1 ,ArmBase
implication ,ARM64 ,Sha256 ,ArmBase
diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs
index abbb1db11af6..c0b317e201ee 100644
--- a/src/coreclr/src/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs
+++ b/src/coreclr/src/tools/Common/TypeSystem/Common/MetadataFieldLayoutAlgorithm.cs
@@ -632,7 +632,8 @@ protected ComputedInstanceFieldLayout ComputeAutoFieldLayout(MetadataType type,
}
else
{
- cumulativeInstanceFieldPos = LayoutInt.AlignUp(cumulativeInstanceFieldPos, context.Target.LayoutPointerSize, context.Target);
+ LayoutInt AlignmentRequired = LayoutInt.Max(fieldSizeAndAlignment.Alignment, context.Target.LayoutPointerSize);
+ cumulativeInstanceFieldPos = LayoutInt.AlignUp(cumulativeInstanceFieldPos, AlignmentRequired, context.Target);
}
offsets[fieldOrdinal] = new FieldAndOffset(instanceValueClassFieldsArr[i], cumulativeInstanceFieldPos);
diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/MethodDesc.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/MethodDesc.cs
index 66143d073a03..0545857397ba 100644
--- a/src/coreclr/src/tools/Common/TypeSystem/Common/MethodDesc.cs
+++ b/src/coreclr/src/tools/Common/TypeSystem/Common/MethodDesc.cs
@@ -48,6 +48,9 @@ public sealed partial class MethodSignature : TypeSystemEntity
internal TypeDesc[] _parameters;
internal EmbeddedSignatureData[] _embeddedSignatureData;
+ // Value of for any custom modifiers on the return type
+ public const string IndexOfCustomModifiersOnReturnType = "0.1.1.1";
+
public MethodSignature(MethodSignatureFlags flags, int genericParameterCount, TypeDesc returnType, TypeDesc[] parameters, EmbeddedSignatureData[] embeddedSignatureData = null)
{
_flags = flags;
diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/Properties/Resources.resx b/src/coreclr/src/tools/Common/TypeSystem/Common/Properties/Resources.resx
new file mode 100644
index 000000000000..368145929e05
--- /dev/null
+++ b/src/coreclr/src/tools/Common/TypeSystem/Common/Properties/Resources.resx
@@ -0,0 +1,180 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Failed to load type '{0}' from assembly '{1}'
+
+
+ Failed to load type '{0}' from assembly '{1}' because the format is invalid
+
+
+ Failed to load type '{0}' from assembly '{1}' because generic types cannot have explicit layout
+
+
+ Failed to load type '{0}' from assembly '{1}' because of field offset '{2}'
+
+
+ Array of type '{0}' from assembly '{1}' cannot be created because base value type is too large
+
+
+ '{0}' from assembly '{1}' has too many dimensions
+
+
+ Missing method '{0}'
+
+
+ Missing field '{0}'
+
+
+ Failed to load assembly '{0}'
+
+
+ Invalid IL or CLR metadata
+
+
+ Invalid IL or CLR metadata in '{0}'
+
+
+ Vararg call to '{0}' not supported
+
+
+ Callvirt of '{0}' not supported
+
+
+ UnmanagedCallersOnly method '{0}' cannot be called from managed code
+
+
+ Direct call to abstract method '{0}' not allowed
+
+
+ Callvirt of static method '{0}' not allowed
+
+
+ UnmanagedCallersOnly attribute specified on non-static method '{0}'
+
+
+ UnmanagedCallersOnly attribute specified on generic method '{0}'
+
+
+ UnmanagedCallersOnly attribute specified on method with non-blittable parameters '{0}'
+
+
+ The format of a DLL or executable being loaded is invalid
+
+
\ No newline at end of file
diff --git a/src/coreclr/src/tools/Common/TypeSystem/Common/TypeSystemException.cs b/src/coreclr/src/tools/Common/TypeSystem/Common/TypeSystemException.cs
index 331556a6af13..c9a71236c4da 100644
--- a/src/coreclr/src/tools/Common/TypeSystem/Common/TypeSystemException.cs
+++ b/src/coreclr/src/tools/Common/TypeSystem/Common/TypeSystemException.cs
@@ -43,10 +43,53 @@ internal TypeSystemException(ExceptionStringID id, params string[] args)
_arguments = args;
}
+ private static string GetFormatString(ExceptionStringID id)
+ {
+ switch (id)
+ {
+ case ExceptionStringID.ClassLoadGeneral: return SR.ClassLoadGeneral;
+ case ExceptionStringID.ClassLoadBadFormat: return SR.ClassLoadBadFormat;
+ case ExceptionStringID.ClassLoadExplicitGeneric: return SR.ClassLoadExplicitGeneric;
+ case ExceptionStringID.ClassLoadExplicitLayout: return SR.ClassLoadExplicitLayout;
+ case ExceptionStringID.ClassLoadValueClassTooLarge: return SR.ClassLoadValueClassTooLarge;
+ case ExceptionStringID.ClassLoadRankTooLarge: return SR.ClassLoadRankTooLarge;
+ case ExceptionStringID.MissingMethod: return SR.MissingMethod;
+ case ExceptionStringID.MissingField: return SR.MissingField;
+ case ExceptionStringID.InvalidProgramDefault: return SR.InvalidProgramDefault;
+ case ExceptionStringID.InvalidProgramSpecific: return SR.InvalidProgramSpecific;
+ case ExceptionStringID.InvalidProgramVararg: return SR.InvalidProgramVararg;
+ case ExceptionStringID.InvalidProgramCallVirtFinalize: return SR.InvalidProgramCallVirtFinalize;
+ case ExceptionStringID.InvalidProgramUnmanagedCallersOnly: return SR.InvalidProgramUnmanagedCallersOnly;
+ case ExceptionStringID.InvalidProgramCallAbstractMethod: return SR.InvalidProgramCallAbstractMethod;
+ case ExceptionStringID.InvalidProgramCallVirtStatic: return SR.InvalidProgramCallVirtStatic;
+ case ExceptionStringID.InvalidProgramNonStaticMethod: return SR.InvalidProgramNonStaticMethod;
+ case ExceptionStringID.InvalidProgramGenericMethod: return SR.InvalidProgramGenericMethod;
+ case ExceptionStringID.InvalidProgramNonBlittableTypes: return SR.InvalidProgramNonBlittableTypes;
+ case ExceptionStringID.BadImageFormatGeneric: return SR.BadImageFormatGeneric;
+ case ExceptionStringID.FileLoadErrorGeneric: return SR.FileLoadErrorGeneric;
+ }
+#if !DEBUG
+ throw new Exception($"Unknown Exception string id {id}");
+#else
+ return null;
+#endif
+ }
+
private static string GetExceptionString(ExceptionStringID id, string[] args)
{
- // TODO: Share the strings and lookup logic with System.Private.CoreLib.
- return "[TEMPORARY EXCEPTION MESSAGE] " + id.ToString() + ": " + String.Join(", ", args);
+ string formatString = GetFormatString(id);
+#if !DEBUG
+ try
+ {
+#endif
+ return String.Format(formatString, (object[])args);
+#if !DEBUG
+ }
+ catch
+ {
+ return "[TEMPORARY EXCEPTION MESSAGE] " + id.ToString() + ": " + String.Join(", ", args);
+ }
+#endif
}
///
diff --git a/src/coreclr/src/tools/ILVerification/ILVerification.projitems b/src/coreclr/src/tools/ILVerification/ILVerification.projitems
index 69ee3651a751..bc5bda42bc03 100644
--- a/src/coreclr/src/tools/ILVerification/ILVerification.projitems
+++ b/src/coreclr/src/tools/ILVerification/ILVerification.projitems
@@ -17,6 +17,10 @@
ILVerification.Strings.resources
+
+ true
+ Internal.TypeSystem.SR
+
$(MSBuildThisFileDirectory)..\Common\
diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/CodeGen/ReadyToRunObjectWriter.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/CodeGen/ReadyToRunObjectWriter.cs
index 18f7ffbb9003..20d6dac16b8a 100644
--- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/CodeGen/ReadyToRunObjectWriter.cs
+++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/CodeGen/ReadyToRunObjectWriter.cs
@@ -138,6 +138,9 @@ public void EmitPortableExecutable()
_customPESectionAlignment);
NativeDebugDirectoryEntryNode nativeDebugDirectoryEntryNode = null;
+ ISymbolDefinitionNode firstImportThunk = null;
+ ISymbolDefinitionNode lastImportThunk = null;
+ ObjectNode lastWrittenObjectNode = null;
int nodeIndex = -1;
foreach (var depNode in _nodes)
@@ -162,6 +165,18 @@ public void EmitPortableExecutable()
nativeDebugDirectoryEntryNode = nddeNode;
}
+ if (node is ImportThunk importThunkNode)
+ {
+ Debug.Assert(firstImportThunk == null || lastWrittenObjectNode is ImportThunk,
+ "All the import thunks must be in single contiguous run");
+
+ if (firstImportThunk == null)
+ {
+ firstImportThunk = importThunkNode;
+ }
+ lastImportThunk = importThunkNode;
+ }
+
string name = null;
if (_mapFileBuilder != null)
@@ -180,10 +195,16 @@ public void EmitPortableExecutable()
}
EmitObjectData(r2rPeBuilder, nodeContents, nodeIndex, name, node.Section, _mapFileBuilder);
+ lastWrittenObjectNode = node;
}
r2rPeBuilder.SetCorHeader(_nodeFactory.CopiedCorHeaderNode, _nodeFactory.CopiedCorHeaderNode.Size);
r2rPeBuilder.SetDebugDirectory(_nodeFactory.DebugDirectoryNode, _nodeFactory.DebugDirectoryNode.Size);
+ if (firstImportThunk != null)
+ {
+ r2rPeBuilder.AddSymbolForRange(_nodeFactory.DelayLoadMethodCallThunks, firstImportThunk, lastImportThunk);
+ }
+
if (_nodeFactory.Win32ResourcesNode != null)
{
diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DelayLoadMethodCallThunkNodeRange.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DelayLoadMethodCallThunkNodeRange.cs
new file mode 100644
index 000000000000..b0463ee3de8b
--- /dev/null
+++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/DelayLoadMethodCallThunkNodeRange.cs
@@ -0,0 +1,36 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System.Collections.Generic;
+
+using ILCompiler.DependencyAnalysisFramework;
+
+using Internal.Text;
+
+namespace ILCompiler.DependencyAnalysis.ReadyToRun
+{
+ ///
+ /// Provides an ISymbolNode for the R2R header table to relocate against when looking up the delay load method call thunks.
+ /// They are emitted in a contiguous run of object nodes. This symbol is used in the object writer to represent the range
+ /// of bytes containing all the thunks.
+ ///
+ public class DelayLoadMethodCallThunkNodeRange : DependencyNodeCore, ISymbolDefinitionNode
+ {
+ public override bool InterestingForDynamicDependencyAnalysis => false;
+ public override bool HasDynamicDependencies => false;
+ public override bool HasConditionalStaticDependencies => false;
+ public override bool StaticDependenciesAreComputed => true;
+ public int Offset => 0;
+ public bool RepresentsIndirectionCell => false;
+ public override IEnumerable GetConditionalStaticDependencies(NodeFactory context) => null;
+ public override IEnumerable GetStaticDependencies(NodeFactory context) => null;
+ public override IEnumerable SearchDynamicDependencies(List> markedNodes, int firstNode, NodeFactory context) => null;
+ protected override string GetName(NodeFactory context) => "DelayLoadMethodCallThunkNodeRange";
+
+ public void AppendMangledName(NameMangler nameMangler, Utf8StringBuilder sb)
+ {
+ sb.Append(GetName(null));
+ }
+ }
+}
diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/HeaderNode.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/HeaderNode.cs
index fe33cebfbe58..5ff1eeccad72 100644
--- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/HeaderNode.cs
+++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/HeaderNode.cs
@@ -7,6 +7,7 @@
using Internal.Text;
using Internal.TypeSystem;
using Internal.ReadyToRunConstants;
+using ILCompiler.DependencyAnalysisFramework;
namespace ILCompiler.DependencyAnalysis.ReadyToRun
{
@@ -45,7 +46,7 @@ public abstract class HeaderNode : ObjectNode, ISymbolDefinitionNode
{
struct HeaderItem
{
- public HeaderItem(ReadyToRunSectionType id, ObjectNode node, ISymbolNode startSymbol)
+ public HeaderItem(ReadyToRunSectionType id, DependencyNodeCore node, ISymbolNode startSymbol)
{
Id = id;
Node = node;
@@ -53,7 +54,7 @@ public HeaderItem(ReadyToRunSectionType id, ObjectNode node, ISymbolNode startSy
}
public readonly ReadyToRunSectionType Id;
- public readonly ObjectNode Node;
+ public readonly DependencyNodeCore Node;
public readonly ISymbolNode StartSymbol;
}
@@ -67,7 +68,7 @@ public HeaderNode(TargetDetails target, ReadyToRunFlags flags)
_flags = flags;
}
- public void Add(ReadyToRunSectionType id, ObjectNode node, ISymbolNode startSymbol)
+ public void Add(ReadyToRunSectionType id, DependencyNodeCore node, ISymbolNode startSymbol)
{
_items.Add(new HeaderItem(id, node, startSymbol));
}
@@ -116,13 +117,17 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false)
foreach (var item in _items)
{
// Skip empty entries
- if (!relocsOnly && item.Node.ShouldSkipEmittingObjectNode(factory))
+ if (!relocsOnly && item.Node is ObjectNode on && on.ShouldSkipEmittingObjectNode(factory))
continue;
builder.EmitInt((int)item.Id);
builder.EmitReloc(item.StartSymbol, RelocType.IMAGE_REL_BASED_ADDR32NB);
- builder.EmitReloc(item.StartSymbol, RelocType.IMAGE_REL_SYMBOL_SIZE);
+
+ // The header entry for the runtime functions table should not include the 4 byte 0xffffffff sentinel
+ // value in the covered range.
+ int delta = item.Id == ReadyToRunSectionType.RuntimeFunctions ? RuntimeFunctionsTableNode.SentinelSizeAdjustment : 0;
+ builder.EmitReloc(item.StartSymbol, RelocType.IMAGE_REL_SYMBOL_SIZE, delta);
count++;
}
diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/RuntimeFunctionsTableNode.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/RuntimeFunctionsTableNode.cs
index 24dd8d91c5a1..c2ab705ef5c2 100644
--- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/RuntimeFunctionsTableNode.cs
+++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/RuntimeFunctionsTableNode.cs
@@ -103,15 +103,22 @@ public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false)
return runtimeFunctionsBuilder.ToObjectData();
}
- public int TableSize
+ ///
+ /// Returns the runtime functions table size and excludes the 4 byte sentinel entry at the end (used by
+ /// the runtime in NativeUnwindInfoLookupTable::LookupUnwindInfoForMethod) so that it's not treated as
+ /// part of the table itself.
+ ///
+ public int TableSizeExcludingSentinel
{
get
{
Debug.Assert(_tableSize >= 0);
- return _tableSize;
+ return _tableSize + SentinelSizeAdjustment;
}
}
public override int ClassCode => -855231428;
+
+ internal const int SentinelSizeAdjustment = -4;
}
}
diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRunCodegenNodeFactory.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRunCodegenNodeFactory.cs
index 0a29f3ff689b..9f9ebf936628 100644
--- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRunCodegenNodeFactory.cs
+++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRunCodegenNodeFactory.cs
@@ -305,6 +305,7 @@ private void CreateNodeCaches()
public RuntimeFunctionsGCInfoNode RuntimeFunctionsGCInfo;
public ProfileDataSectionNode ProfileDataSection;
+ public DelayLoadMethodCallThunkNodeRange DelayLoadMethodCallThunks;
public InstanceEntryPointTableNode InstanceEntryPointTable;
@@ -502,6 +503,9 @@ public void AttachToDependencyGraph(DependencyAnalyzerBase graph)
ProfileDataSection = new ProfileDataSectionNode();
Header.Add(Internal.Runtime.ReadyToRunSectionType.ProfileDataInfo, ProfileDataSection, ProfileDataSection.StartSymbol);
+ DelayLoadMethodCallThunks = new DelayLoadMethodCallThunkNodeRange();
+ Header.Add(Internal.Runtime.ReadyToRunSectionType.DelayLoadMethodCallThunks, DelayLoadMethodCallThunks, DelayLoadMethodCallThunks);
+
ExceptionInfoLookupTableNode exceptionInfoLookupTableNode = new ExceptionInfoLookupTableNode(this);
Header.Add(Internal.Runtime.ReadyToRunSectionType.ExceptionInfo, exceptionInfoLookupTableNode, exceptionInfoLookupTableNode);
graph.AddRoot(exceptionInfoLookupTableNode, "ExceptionInfoLookupTable is always generated");
diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs
index 7062b6782452..d7d134ac77bd 100644
--- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs
+++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunCodegenCompilation.cs
@@ -310,9 +310,9 @@ public override void Compile(string outputFile)
foreach (string inputFile in _inputFiles)
{
string relativeMsilPath = Path.GetRelativePath(_compositeRootPath, inputFile);
- if (relativeMsilPath.StartsWith(s_folderUpPrefix))
+ if (relativeMsilPath == inputFile || relativeMsilPath.StartsWith(s_folderUpPrefix, StringComparison.Ordinal))
{
- // Input file not in the composite root, emit to root output folder
+ // Input file not under the composite root, emit to root output folder
relativeMsilPath = Path.GetFileName(inputFile);
}
string standaloneMsilOutputFile = Path.Combine(outputDirectory, relativeMsilPath);
@@ -484,15 +484,18 @@ protected override void ComputeDependencyNodeDependencies(List
+
diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs
index 3c42b86ccb57..2c2085635f34 100644
--- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs
+++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/JitInterface/CorInfoImpl.ReadyToRun.cs
@@ -226,8 +226,12 @@ public void CompileMethod(MethodWithGCInfo methodCodeNodeNeedingCode)
{
if (!ShouldSkipCompilation(MethodBeingCompiled))
{
- CompileMethodInternal(methodCodeNodeNeedingCode);
- codeGotPublished = true;
+ MethodIL methodIL = _compilation.GetMethodIL(MethodBeingCompiled);
+ if (methodIL != null)
+ {
+ CompileMethodInternal(methodCodeNodeNeedingCode, methodIL);
+ codeGotPublished = true;
+ }
}
}
finally
@@ -2025,6 +2029,12 @@ private void getGSCookie(IntPtr* pCookieVal, IntPtr** ppCookieVal)
*ppCookieVal = (IntPtr *)ObjectToHandle(_compilation.NodeFactory.GetReadyToRunHelperCell(ReadyToRunHelper.GSCookie));
}
+ private int* getAddrOfCaptureThreadGlobal(ref void* ppIndirection)
+ {
+ ppIndirection = (void*)ObjectToHandle(_compilation.NodeFactory.GetReadyToRunHelperCell(ReadyToRunHelper.IndirectTrapThreads));
+ return null;
+ }
+
private void getMethodVTableOffset(CORINFO_METHOD_STRUCT_* method, ref uint offsetOfIndirection, ref uint offsetAfterIndirection, ref bool isRelative)
{ throw new NotImplementedException("getMethodVTableOffset"); }
private void expandRawHandleIntrinsic(ref CORINFO_RESOLVED_TOKEN pResolvedToken, ref CORINFO_GENERICHANDLE_RESULT pResult)
diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/ObjectWriter/R2RPEBuilder.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/ObjectWriter/R2RPEBuilder.cs
index 95b4035178d3..839b1f21d110 100644
--- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/ObjectWriter/R2RPEBuilder.cs
+++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/ObjectWriter/R2RPEBuilder.cs
@@ -268,6 +268,16 @@ public void AddObjectData(ObjectNode.ObjectData objectData, ObjectNodeSection se
_sectionBuilder.AddObjectData(objectData, targetSectionIndex, name, mapFileBuilder);
}
+ ///
+ /// Add a symbol to the symbol map which defines the area of the binary between the two emitted symbols.
+ /// This allows relocations (both position and size) to regions of the image. Both nodes must be in the
+ /// same section and firstNode must be emitted before secondNode.
+ ///
+ public void AddSymbolForRange(ISymbolNode symbol, ISymbolNode firstNode, ISymbolNode secondNode)
+ {
+ _sectionBuilder.AddSymbolForRange(symbol, firstNode, secondNode);
+ }
+
public int GetSymbolFilePosition(ISymbolNode symbol)
{
return _sectionBuilder.GetSymbolFilePosition(symbol);
@@ -497,7 +507,7 @@ protected override PEDirectoriesBuilder GetDirectories()
RuntimeFunctionsTableNode runtimeFunctionsTable = _getRuntimeFunctionsTable();
builder.ExceptionTable = new DirectoryEntry(
relativeVirtualAddress: _sectionBuilder.GetSymbolRVA(runtimeFunctionsTable),
- size: runtimeFunctionsTable.TableSize);
+ size: runtimeFunctionsTable.TableSizeExcludingSentinel);
}
return builder;
diff --git a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/ObjectWriter/SectionBuilder.cs b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/ObjectWriter/SectionBuilder.cs
index 3d31687cccf7..dd82ab79c76e 100644
--- a/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/ObjectWriter/SectionBuilder.cs
+++ b/src/coreclr/src/tools/aot/ILCompiler.ReadyToRun/ObjectWriter/SectionBuilder.cs
@@ -518,6 +518,20 @@ public void AddObjectData(ObjectNode.ObjectData objectData, int sectionIndex, st
}
}
+ public void AddSymbolForRange(ISymbolNode symbol, ISymbolNode firstNode, ISymbolNode secondNode)
+ {
+ SymbolTarget firstSymbolTarget = _symbolMap[firstNode];
+ SymbolTarget secondSymbolTarget = _symbolMap[secondNode];
+ Debug.Assert(firstSymbolTarget.SectionIndex == secondSymbolTarget.SectionIndex);
+ Debug.Assert(firstSymbolTarget.Offset <= secondSymbolTarget.Offset);
+
+ _symbolMap.Add(symbol, new SymbolTarget(
+ sectionIndex: firstSymbolTarget.SectionIndex,
+ offset: firstSymbolTarget.Offset,
+ size: secondSymbolTarget.Offset - firstSymbolTarget.Offset + secondSymbolTarget.Size
+ ));
+ }
+
///
/// Get the list of sections that need to be emitted to the output PE file.
/// We filter out name duplicates as we'll end up merging builder sections with the same name
diff --git a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/DebugInfo.cs b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/DebugInfo.cs
index ff07f31d0b86..706e98780acb 100644
--- a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/DebugInfo.cs
+++ b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/DebugInfo.cs
@@ -68,6 +68,7 @@ public static string GetPlatformSpecificRegister(Machine machine, int regnum)
case Machine.Amd64:
return ((Amd64.Registers)regnum).ToString();
case Machine.Arm:
+ case Machine.ArmThumb2:
return ((Arm.Registers)regnum).ToString();
case Machine.Arm64:
return ((Arm64.Registers)regnum).ToString();
diff --git a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunSignature.cs b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunSignature.cs
index 5f7175ef4e2d..c8fca51fa4be 100644
--- a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunSignature.cs
+++ b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunSignature.cs
@@ -1472,6 +1472,9 @@ private void ParseHelper(StringBuilder builder)
builder.Append("GC_COOKIE");
break;
+ case ReadyToRunHelper.IndirectTrapThreads:
+ builder.Append("INDIRECT_TRAP_THREADS");
+ break;
//
// Delay load helpers
diff --git a/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun/ILCompiler.TypeSystem.ReadyToRun.csproj b/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun/ILCompiler.TypeSystem.ReadyToRun.csproj
index c6266c64df3b..733bd833c140 100644
--- a/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun/ILCompiler.TypeSystem.ReadyToRun.csproj
+++ b/src/coreclr/src/tools/aot/ILCompiler.TypeSystem.ReadyToRun/ILCompiler.TypeSystem.ReadyToRun.csproj
@@ -16,6 +16,14 @@
false
Debug;Release;Checked
+
+
+
+ true
+ Internal.TypeSystem.SR
+
+
+
4.3.0
diff --git a/src/coreclr/src/utilcode/pedecoder.cpp b/src/coreclr/src/utilcode/pedecoder.cpp
index 32e228cd8039..d0854bbc043f 100644
--- a/src/coreclr/src/utilcode/pedecoder.cpp
+++ b/src/coreclr/src/utilcode/pedecoder.cpp
@@ -288,9 +288,9 @@ CHECK PEDecoder::CheckNTHeaders() const
if (IsMapped())
{
// Ideally we would require the layout address to honor the section alignment constraints.
- // However, we do have 8K aligned IL only images which we load on 32 bit platforms. In this
- // case, we can only guarantee OS page alignment (which after all, is good enough.)
- CHECK(CheckAligned(m_base, GetOsPageSize()));
+ // However, we do have 8K aligned IL only images which we load on 32 bit platforms.
+ // Also in the case of files embedded within a single-file app, the default alignment for assemblies is 16 bytes.
+ CHECK(CheckAligned(m_base, 16));
}
// @todo: check NumberOfSections for overflow of SizeOfHeaders
diff --git a/src/coreclr/src/vm/CMakeLists.txt b/src/coreclr/src/vm/CMakeLists.txt
index 3af09016309a..81d0e8c21b10 100644
--- a/src/coreclr/src/vm/CMakeLists.txt
+++ b/src/coreclr/src/vm/CMakeLists.txt
@@ -544,6 +544,20 @@ set(GC_SOURCES_WKS
../gc/softwarewritewatch.cpp
../gc/handletablecache.cpp)
+if (CLR_CMAKE_TARGET_ARCH_AMD64 AND CLR_CMAKE_TARGET_WIN32)
+ set ( GC_SOURCES_WKS
+ ${GC_SOURCES_WKS}
+ ../gc/vxsort/isa_detection.cpp
+ ../gc/vxsort/do_vxsort_avx2.cpp
+ ../gc/vxsort/do_vxsort_avx512.cpp
+ ../gc/vxsort/machine_traits.avx2.cpp
+ ../gc/vxsort/smallsort/bitonic_sort.AVX2.int64_t.generated.cpp
+ ../gc/vxsort/smallsort/bitonic_sort.AVX2.int32_t.generated.cpp
+ ../gc/vxsort/smallsort/bitonic_sort.AVX512.int64_t.generated.cpp
+ ../gc/vxsort/smallsort/bitonic_sort.AVX512.int32_t.generated.cpp
+)
+endif (CLR_CMAKE_TARGET_ARCH_AMD64 AND CLR_CMAKE_TARGET_WIN32)
+
set(GC_HEADERS_WKS
${GC_HEADERS_DAC_AND_WKS_COMMON}
../gc/gceventstatus.h
diff --git a/src/coreclr/src/vm/array.h b/src/coreclr/src/vm/array.h
index 17cb3dff4c6b..51a7c988c4af 100644
--- a/src/coreclr/src/vm/array.h
+++ b/src/coreclr/src/vm/array.h
@@ -5,12 +5,11 @@
#ifndef _ARRAY_H_
#define _ARRAY_H_
-#define MAX_RANK 32 // If you make this bigger, you need to make MAX_CLASSNAME_LENGTH bigger too.
- // if you have an 32 dim array with at least 2 elements in each dim that
- // takes up 4Gig!!! Thus this is a reasonable maximum.
-// (Note: at the time of the above comment, the rank was 32, and
-// MAX_CLASSNAME_LENGTH was 256. I'm now changing MAX_CLASSNAME_LENGTH
-// to 1024, but not changing MAX_RANK.)
+// A 32 dimension array with at least 2 elements in each dimension requires
+// 4gb of memory. Limit the maximum number of dimensions to a value that
+// requires 4gb of memory.
+// If you make this bigger, you need to make MAX_CLASSNAME_LENGTH bigger too.
+#define MAX_RANK 32
class MethodTable;
diff --git a/src/coreclr/src/vm/ceemain.cpp b/src/coreclr/src/vm/ceemain.cpp
index 0401160ab17b..5c763f86039d 100644
--- a/src/coreclr/src/vm/ceemain.cpp
+++ b/src/coreclr/src/vm/ceemain.cpp
@@ -484,13 +484,6 @@ void InitGSCookie()
}
CONTRACTL_END;
-#if defined(TARGET_OSX) && defined(CORECLR_EMBEDDED)
- // OSX does not like the way we change section protection when running in a superhost bundle
- // disabling this for now
- // https://github.com/dotnet/runtime/issues/38184
- return;
-#endif
-
volatile GSCookie * pGSCookiePtr = GetProcessGSCookiePtr();
#ifdef TARGET_UNIX
diff --git a/src/coreclr/src/vm/clsload.cpp b/src/coreclr/src/vm/clsload.cpp
index de2530b87b76..851266f47576 100644
--- a/src/coreclr/src/vm/clsload.cpp
+++ b/src/coreclr/src/vm/clsload.cpp
@@ -3260,7 +3260,6 @@ TypeHandle ClassLoader::CreateTypeHandleForTypeKey(TypeKey* pKey, AllocMemTracke
}
}
- // We really don't need this check anymore.
if (rank > MAX_RANK)
{
ThrowTypeLoadException(pKey, IDS_CLASSLOAD_RANK_TOOLARGE);
diff --git a/src/coreclr/src/vm/codeman.cpp b/src/coreclr/src/vm/codeman.cpp
index 7af2850b83d4..a04894fa77ed 100644
--- a/src/coreclr/src/vm/codeman.cpp
+++ b/src/coreclr/src/vm/codeman.cpp
@@ -6610,14 +6610,15 @@ StubCodeBlockKind ReadyToRunJitManager::GetStubCodeBlockKind(RangeSection * pRan
NOTHROW;
GC_NOTRIGGER;
MODE_ANY;
+ SUPPORTS_DAC;
}
CONTRACTL_END;
DWORD rva = (DWORD)(currentPC - pRangeSection->LowAddress);
- ReadyToRunInfo * pReadyToRunInfo = dac_cast(pRangeSection->pHeapListOrZapModule)->GetReadyToRunInfo();
+ PTR_ReadyToRunInfo pReadyToRunInfo = dac_cast(pRangeSection->pHeapListOrZapModule)->GetReadyToRunInfo();
- IMAGE_DATA_DIRECTORY * pDelayLoadMethodCallThunksDir = pReadyToRunInfo->FindSection(ReadyToRunSectionType::DelayLoadMethodCallThunks);
+ PTR_IMAGE_DATA_DIRECTORY pDelayLoadMethodCallThunksDir = pReadyToRunInfo->GetDelayMethodCallThunksSection();
if (pDelayLoadMethodCallThunksDir != NULL)
{
if (pDelayLoadMethodCallThunksDir->VirtualAddress <= rva
@@ -6778,6 +6779,12 @@ BOOL ReadyToRunJitManager::JitCodeToMethodInfo(RangeSection * pRangeSection,
// READYTORUN: FUTURE: Hot-cold spliting
+ // If the address is in a thunk, return NULL.
+ if (GetStubCodeBlockKind(pRangeSection, currentPC) != STUB_CODE_BLOCK_UNKNOWN)
+ {
+ return FALSE;
+ }
+
TADDR currentInstr = PCODEToPINSTR(currentPC);
TADDR ImageBase = pRangeSection->LowAddress;
diff --git a/src/coreclr/src/vm/codeman.h b/src/coreclr/src/vm/codeman.h
index ae76b6939da0..cba802dc03b6 100644
--- a/src/coreclr/src/vm/codeman.h
+++ b/src/coreclr/src/vm/codeman.h
@@ -876,6 +876,7 @@ class EEJitManager : public IJitManager
{
#ifdef DACCESS_COMPILE
friend class ClrDataAccess;
+ friend class DacDbiInterfaceImpl;
#endif
friend class CheckDuplicatedStructLayouts;
friend class CodeHeapIterator;
@@ -1619,7 +1620,7 @@ class NativeUnwindInfoLookupTable
#ifdef FEATURE_READYTORUN
-class ReadyToRunJitManager : public IJitManager
+class ReadyToRunJitManager final: public IJitManager
{
VPTR_VTABLE_CLASS(ReadyToRunJitManager, IJitManager)
diff --git a/src/coreclr/src/vm/dllimport.cpp b/src/coreclr/src/vm/dllimport.cpp
index 1debfb2b4aae..2fd2fefd1bc8 100644
--- a/src/coreclr/src/vm/dllimport.cpp
+++ b/src/coreclr/src/vm/dllimport.cpp
@@ -51,6 +51,9 @@
#include "clr/fs/path.h"
using namespace clr::fs;
+// Specifies whether coreclr is embedded or standalone
+extern bool g_coreclr_embedded;
+
// remove when we get an updated SDK
#define LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR 0x00000100
#define LOAD_LIBRARY_SEARCH_DEFAULT_DIRS 0x00001000
@@ -2923,6 +2926,57 @@ inline CorPinvokeMap GetDefaultCallConv(BOOL bIsVarArg)
#endif // !TARGET_UNIX
}
+namespace
+{
+ bool TryConvertCallConvValueToPInvokeCallConv(_In_ BYTE callConv, _Out_ CorPinvokeMap *pPinvokeMapOut)
+ {
+ LIMITED_METHOD_CONTRACT;
+
+ switch (callConv)
+ {
+ case IMAGE_CEE_CS_CALLCONV_C:
+ *pPinvokeMapOut = pmCallConvCdecl;
+ return true;
+ case IMAGE_CEE_CS_CALLCONV_STDCALL:
+ *pPinvokeMapOut = pmCallConvStdcall;
+ return true;
+ case IMAGE_CEE_CS_CALLCONV_THISCALL:
+ *pPinvokeMapOut = pmCallConvThiscall;
+ return true;
+ case IMAGE_CEE_CS_CALLCONV_FASTCALL:
+ *pPinvokeMapOut = pmCallConvFastcall;
+ return true;
+ }
+
+ return false;
+ }
+
+ HRESULT GetUnmanagedPInvokeCallingConvention(
+ _In_ Module *pModule,
+ _In_ PCCOR_SIGNATURE pSig,
+ _In_ ULONG cSig,
+ _Out_ CorPinvokeMap *pPinvokeMapOut)
+ {
+ CONTRACTL
+ {
+ NOTHROW;
+ GC_NOTRIGGER;
+ MODE_ANY;
+ }
+ CONTRACTL_END
+
+ CorUnmanagedCallingConvention callConvMaybe;
+ HRESULT hr = MetaSig::TryGetUnmanagedCallingConventionFromModOpt(pModule, pSig, cSig, &callConvMaybe);
+ if (hr != S_OK)
+ return hr;
+
+ if (!TryConvertCallConvValueToPInvokeCallConv(callConvMaybe, pPinvokeMapOut))
+ return S_FALSE;
+
+ return hr;
+ }
+}
+
void PInvokeStaticSigInfo::InitCallConv(CorPinvokeMap callConv, BOOL bIsVarArg)
{
CONTRACTL
@@ -2938,9 +2992,8 @@ void PInvokeStaticSigInfo::InitCallConv(CorPinvokeMap callConv, BOOL bIsVarArg)
callConv = GetDefaultCallConv(bIsVarArg);
CorPinvokeMap sigCallConv = (CorPinvokeMap)0;
- BOOL fSuccess = MetaSig::GetUnmanagedCallingConvention(m_pModule, m_sig.GetRawSig(), m_sig.GetRawSigLen(), &sigCallConv);
-
- if (!fSuccess)
+ HRESULT hr = GetUnmanagedPInvokeCallingConvention(m_pModule, m_sig.GetRawSig(), m_sig.GetRawSigLen(), &sigCallConv);
+ if (FAILED(hr))
{
SetError(IDS_EE_NDIRECT_BADNATL); //Bad metadata format
}
@@ -6253,6 +6306,28 @@ namespace
}
#endif // FEATURE_CORESYSTEM && !TARGET_UNIX
+#if defined(TARGET_LINUX)
+ if (g_coreclr_embedded)
+ {
+ // this matches exactly the names in Interop.Libraries.cs
+ static const LPCWSTR toRedirect[] = {
+ W("libSystem.Native"),
+ W("libSystem.IO.Compression.Native"),
+ W("libSystem.Net.Security.Native"),
+ W("libSystem.Security.Cryptography.Native.OpenSsl")
+ };
+
+ int count = lengthof(toRedirect);
+ for (int i = 0; i < count; ++i)
+ {
+ if (wcscmp(wszLibName, toRedirect[i]) == 0)
+ {
+ return PAL_LoadLibraryDirect(NULL);
+ }
+ }
+ }
+#endif
+
AppDomain* pDomain = GetAppDomain();
DWORD loadWithAlteredPathFlags = GetLoadWithAlteredSearchPathFlag();
bool libNameIsRelativePath = Path::IsRelative(wszLibName);
@@ -6778,26 +6853,25 @@ PCODE GetILStubForCalli(VASigCookie *pVASigCookie, MethodDesc *pMD)
dwStubFlags |= NDIRECTSTUB_FL_UNMANAGED_CALLI;
// need to convert the CALLI signature to stub signature with managed calling convention
- switch (MetaSig::GetCallingConvention(pVASigCookie->pModule, pVASigCookie->signature))
+ BYTE callConv = MetaSig::GetCallingConvention(pVASigCookie->pModule, signature);
+
+ // Unmanaged calling convention indicates modopt should be read
+ if (callConv == IMAGE_CEE_CS_CALLCONV_UNMANAGED)
{
- case IMAGE_CEE_CS_CALLCONV_C:
- unmgdCallConv = pmCallConvCdecl;
- break;
- case IMAGE_CEE_CS_CALLCONV_STDCALL:
- unmgdCallConv = pmCallConvStdcall;
- break;
- case IMAGE_CEE_CS_CALLCONV_THISCALL:
- unmgdCallConv = pmCallConvThiscall;
- break;
- case IMAGE_CEE_CS_CALLCONV_FASTCALL:
- unmgdCallConv = pmCallConvFastcall;
- break;
- case IMAGE_CEE_CS_CALLCONV_UNMANAGED:
- COMPlusThrow(kNotImplementedException);
- default:
- COMPlusThrow(kTypeLoadException, IDS_INVALID_PINVOKE_CALLCONV);
+ CorUnmanagedCallingConvention callConvMaybe;
+ if (S_OK == MetaSig::TryGetUnmanagedCallingConventionFromModOpt(pVASigCookie->pModule, signature.GetRawSig(), signature.GetRawSigLen(), &callConvMaybe))
+ {
+ callConv = callConvMaybe;
+ }
+ else
+ {
+ callConv = MetaSig::GetDefaultUnmanagedCallingConvention();
+ }
}
+ if (!TryConvertCallConvValueToPInvokeCallConv(callConv, &unmgdCallConv))
+ COMPlusThrow(kTypeLoadException, IDS_INVALID_PINVOKE_CALLCONV);
+
LoaderHeap *pHeap = pVASigCookie->pModule->GetLoaderAllocator()->GetHighFrequencyHeap();
PCOR_SIGNATURE new_sig = (PCOR_SIGNATURE)(void *)pHeap->AllocMem(S_SIZE_T(signature.GetRawSigLen()));
CopyMemory(new_sig, signature.GetRawSig(), signature.GetRawSigLen());
diff --git a/src/coreclr/src/vm/ilmarshalers.cpp b/src/coreclr/src/vm/ilmarshalers.cpp
index 4905061335ca..8f57b1cf1569 100644
--- a/src/coreclr/src/vm/ilmarshalers.cpp
+++ b/src/coreclr/src/vm/ilmarshalers.cpp
@@ -2374,21 +2374,15 @@ void ILBlittablePtrMarshaler::EmitConvertContentsNativeToCLR(ILCodeStream* pslIL
pslILEmit->EmitLabel(pNullRefLabel);
}
-bool ILBlittablePtrMarshaler::CanUsePinnedLayoutClass()
+bool ILBlittablePtrMarshaler::CanMarshalViaPinning()
{
return IsCLRToNative(m_dwMarshalFlags) && !IsByref(m_dwMarshalFlags) && !IsFieldMarshal(m_dwMarshalFlags);
}
-void ILBlittablePtrMarshaler::EmitConvertSpaceAndContentsCLRToNativeTemp(ILCodeStream* pslILEmit)
+void ILBlittablePtrMarshaler::EmitMarshalViaPinning(ILCodeStream* pslILEmit)
{
STANDARD_VM_CONTRACT;
- if (!CanUsePinnedLayoutClass())
- {
- ILLayoutClassPtrMarshalerBase::EmitConvertSpaceAndContentsCLRToNativeTemp(pslILEmit);
- return;
- }
-
ILCodeLabel* pSkipAddLabel = pslILEmit->NewCodeLabel();
LocalDesc managedTypePinned = GetManagedType();
managedTypePinned.MakePinned();
diff --git a/src/coreclr/src/vm/ilmarshalers.h b/src/coreclr/src/vm/ilmarshalers.h
index be1e23e37ccf..2b4e6078518e 100644
--- a/src/coreclr/src/vm/ilmarshalers.h
+++ b/src/coreclr/src/vm/ilmarshalers.h
@@ -2942,9 +2942,8 @@ class ILBlittablePtrMarshaler : public ILLayoutClassPtrMarshalerBase
protected:
void EmitConvertContentsCLRToNative(ILCodeStream* pslILEmit) override;
void EmitConvertContentsNativeToCLR(ILCodeStream* pslILEmit) override;
- void EmitConvertSpaceAndContentsCLRToNativeTemp(ILCodeStream* pslILEmit) override;
-private:
- bool CanUsePinnedLayoutClass();
+ bool CanMarshalViaPinning() override;
+ void EmitMarshalViaPinning(ILCodeStream* pslILEmit) override;
};
class ILLayoutClassMarshaler : public ILMarshaler
diff --git a/src/coreclr/src/vm/jitinterface.cpp b/src/coreclr/src/vm/jitinterface.cpp
index 99073bec81fa..09c077665fe6 100644
--- a/src/coreclr/src/vm/jitinterface.cpp
+++ b/src/coreclr/src/vm/jitinterface.cpp
@@ -465,10 +465,10 @@ CEEInfo::ConvToJitSig(
SigTypeContext::InitTypeContext(contextType, &typeContext);
}
- _ASSERTE(CORINFO_CALLCONV_DEFAULT == (CorInfoCallConv) IMAGE_CEE_CS_CALLCONV_DEFAULT);
- _ASSERTE(CORINFO_CALLCONV_VARARG == (CorInfoCallConv) IMAGE_CEE_CS_CALLCONV_VARARG);
- _ASSERTE(CORINFO_CALLCONV_MASK == (CorInfoCallConv) IMAGE_CEE_CS_CALLCONV_MASK);
- _ASSERTE(CORINFO_CALLCONV_HASTHIS == (CorInfoCallConv) IMAGE_CEE_CS_CALLCONV_HASTHIS);
+ static_assert_no_msg(CORINFO_CALLCONV_DEFAULT == (CorInfoCallConv) IMAGE_CEE_CS_CALLCONV_DEFAULT);
+ static_assert_no_msg(CORINFO_CALLCONV_VARARG == (CorInfoCallConv) IMAGE_CEE_CS_CALLCONV_VARARG);
+ static_assert_no_msg(CORINFO_CALLCONV_MASK == (CorInfoCallConv) IMAGE_CEE_CS_CALLCONV_MASK);
+ static_assert_no_msg(CORINFO_CALLCONV_HASTHIS == (CorInfoCallConv) IMAGE_CEE_CS_CALLCONV_HASTHIS);
TypeHandle typeHnd = TypeHandle();
@@ -506,6 +506,25 @@ CEEInfo::ConvToJitSig(
}
#endif // defined(TARGET_UNIX) || defined(TARGET_ARM)
+ // Unmanaged calling convention indicates modopt should be read
+ if (sigRet->callConv == CORINFO_CALLCONV_UNMANAGED)
+ {
+ static_assert_no_msg(CORINFO_CALLCONV_C == (CorInfoCallConv)IMAGE_CEE_UNMANAGED_CALLCONV_C);
+ static_assert_no_msg(CORINFO_CALLCONV_STDCALL == (CorInfoCallConv)IMAGE_CEE_UNMANAGED_CALLCONV_STDCALL);
+ static_assert_no_msg(CORINFO_CALLCONV_THISCALL == (CorInfoCallConv)IMAGE_CEE_UNMANAGED_CALLCONV_THISCALL);
+ static_assert_no_msg(CORINFO_CALLCONV_FASTCALL == (CorInfoCallConv)IMAGE_CEE_UNMANAGED_CALLCONV_FASTCALL);
+
+ CorUnmanagedCallingConvention callConvMaybe;
+ if (S_OK == MetaSig::TryGetUnmanagedCallingConventionFromModOpt(module, pSig, cbSig, &callConvMaybe))
+ {
+ sigRet->callConv = (CorInfoCallConv)callConvMaybe;
+ }
+ else
+ {
+ sigRet->callConv = (CorInfoCallConv)MetaSig::GetDefaultUnmanagedCallingConvention();
+ }
+ }
+
// Skip number of type arguments
if (sigRet->callConv & IMAGE_CEE_CS_CALLCONV_GENERIC)
IfFailThrow(sig.GetData(NULL));
@@ -566,10 +585,7 @@ CEEInfo::ConvToJitSig(
sigRet->args = (CORINFO_ARG_LIST_HANDLE)sig.GetPtr();
}
- if (sigRet->callConv == CORINFO_CALLCONV_UNMANAGED)
- {
- COMPlusThrowHR(E_NOTIMPL);
- }
+ _ASSERTE(sigRet->callConv != CORINFO_CALLCONV_UNMANAGED);
// Set computed flags
sigRet->flags = sigRetFlags;
@@ -13709,6 +13725,10 @@ BOOL LoadDynamicInfoEntry(Module *currentModule,
result = (size_t)GetProcessGSCookie();
break;
+ case READYTORUN_HELPER_IndirectTrapThreads:
+ result = (size_t)&g_TrapReturningThreads;
+ break;
+
case READYTORUN_HELPER_DelayLoad_MethodCall:
result = (size_t)GetEEFuncEntryPoint(DelayLoad_MethodCall);
break;
diff --git a/src/coreclr/src/vm/method.cpp b/src/coreclr/src/vm/method.cpp
index c8d3f6cb7aa9..9c247d6284a0 100644
--- a/src/coreclr/src/vm/method.cpp
+++ b/src/coreclr/src/vm/method.cpp
@@ -5594,7 +5594,15 @@ MethodDesc::EnumMemoryRegions(CLRDataEnumMemoryFlags flags)
#ifdef FEATURE_CODE_VERSIONING
// Make sure the active IL and native code version are in triage dumps.
- GetCodeVersionManager()->GetActiveILCodeVersion(dac_cast(this)).GetActiveNativeCodeVersion(dac_cast(this));
+ CodeVersionManager* pCodeVersionManager = GetCodeVersionManager();
+ ILCodeVersion ilVersion = pCodeVersionManager->GetActiveILCodeVersion(dac_cast(this));
+ if (!ilVersion.IsNull())
+ {
+ ilVersion.GetActiveNativeCodeVersion(dac_cast(this));
+ ilVersion.GetVersionId();
+ ilVersion.GetRejitState();
+ ilVersion.GetIL();
+ }
#endif
// Also, call DacValidateMD to dump the memory it needs. !clrstack calls
diff --git a/src/coreclr/src/vm/pefile.inl b/src/coreclr/src/vm/pefile.inl
index 349b755b5fc1..981c2cb8e5a3 100644
--- a/src/coreclr/src/vm/pefile.inl
+++ b/src/coreclr/src/vm/pefile.inl
@@ -180,7 +180,7 @@ inline const SString &PEFile::GetPath()
}
CONTRACTL_END;
- if (IsDynamic())
+ if (IsDynamic() || m_identity->IsInBundle ())
{
return SString::Empty();
}
diff --git a/src/coreclr/src/vm/peimage.h b/src/coreclr/src/vm/peimage.h
index 47d518319899..96b3ea0882cb 100644
--- a/src/coreclr/src/vm/peimage.h
+++ b/src/coreclr/src/vm/peimage.h
@@ -237,9 +237,7 @@ class PEImage
// Private routines
// ------------------------------------------------------------
- void Init(LPCWSTR pPath, BundleFileLocation bundleFileLocation);
- void Init(IStream* pStream, UINT64 uStreamAsmId,
- DWORD dwModuleId, BOOL resourceFile);
+ void Init(LPCWSTR pPath, BundleFileLocation bundleFileLocation);
void VerifyIsILOrNIAssembly(BOOL fIL);
diff --git a/src/coreclr/src/vm/readytoruninfo.cpp b/src/coreclr/src/vm/readytoruninfo.cpp
index b5b69edaac27..06d238b44b6c 100644
--- a/src/coreclr/src/vm/readytoruninfo.cpp
+++ b/src/coreclr/src/vm/readytoruninfo.cpp
@@ -683,6 +683,8 @@ ReadyToRunInfo::ReadyToRunInfo(Module * pModule, PEImageLayout * pLayout, READYT
m_methodDefEntryPoints = NativeArray(&m_nativeReader, pEntryPointsDir->VirtualAddress);
}
+ m_pSectionDelayLoadMethodCallThunks = m_component.FindSection(ReadyToRunSectionType::DelayLoadMethodCallThunks);
+
IMAGE_DATA_DIRECTORY * pinstMethodsDir = m_pComposite->FindSection(ReadyToRunSectionType::InstanceMethodEntryPoints);
if (pinstMethodsDir != NULL)
{
diff --git a/src/coreclr/src/vm/readytoruninfo.h b/src/coreclr/src/vm/readytoruninfo.h
index b7ec74769bd9..7a1919aa04b9 100644
--- a/src/coreclr/src/vm/readytoruninfo.h
+++ b/src/coreclr/src/vm/readytoruninfo.h
@@ -61,6 +61,8 @@ class ReadyToRunInfo
PTR_RUNTIME_FUNCTION m_pRuntimeFunctions;
DWORD m_nRuntimeFunctions;
+ PTR_IMAGE_DATA_DIRECTORY m_pSectionDelayLoadMethodCallThunks;
+
PTR_CORCOMPILE_IMPORT_SECTION m_pImportSections;
DWORD m_nImportSections;
@@ -92,6 +94,8 @@ class ReadyToRunInfo
PTR_READYTORUN_HEADER GetReadyToRunHeader() const { return m_pHeader; }
+ PTR_IMAGE_DATA_DIRECTORY GetDelayMethodCallThunksSection() const { return m_pSectionDelayLoadMethodCallThunks; }
+
PTR_NativeImage GetNativeImage() const { return m_pNativeImage; }
PTR_PEImageLayout GetImage() const { return m_pComposite->GetImage(); }
diff --git a/src/coreclr/src/vm/siginfo.cpp b/src/coreclr/src/vm/siginfo.cpp
index 1148d53196f5..ba2906f385ea 100644
--- a/src/coreclr/src/vm/siginfo.cpp
+++ b/src/coreclr/src/vm/siginfo.cpp
@@ -5219,16 +5219,55 @@ BOOL MetaSig::IsReturnTypeVoid() const
#ifndef DACCESS_COMPILE
+namespace
+{
+ HRESULT GetNameOfTypeRefOrDef(
+ _In_ const Module *pModule,
+ _In_ mdToken token,
+ _Out_ LPCSTR *namespaceOut,
+ _Out_ LPCSTR *nameOut)
+ {
+ CONTRACTL
+ {
+ NOTHROW;
+ GC_NOTRIGGER;
+ FORBID_FAULT;
+ MODE_ANY;
+ }
+ CONTRACTL_END
+
+ IMDInternalImport *pInternalImport = pModule->GetMDImport();
+ if (TypeFromToken(token) == mdtTypeDef)
+ {
+ HRESULT hr = pInternalImport->GetNameOfTypeDef(token, nameOut, namespaceOut);
+ if (FAILED(hr))
+ return hr;
+ }
+ else if (TypeFromToken(token) == mdtTypeRef)
+ {
+ HRESULT hr = pInternalImport->GetNameOfTypeRef(token, namespaceOut, nameOut);
+ if (FAILED(hr))
+ return hr;
+ }
+ else
+ {
+ return E_INVALIDARG;
+ }
+
+ return S_OK;
+ }
+}
+
//----------------------------------------------------------
// Returns the unmanaged calling convention.
//----------------------------------------------------------
/*static*/
-BOOL
-MetaSig::GetUnmanagedCallingConvention(
- Module * pModule,
- PCCOR_SIGNATURE pSig,
- ULONG cSig,
- CorPinvokeMap * pPinvokeMapOut)
+HRESULT
+MetaSig::TryGetUnmanagedCallingConventionFromModOpt(
+ _In_ Module *pModule,
+ _In_ PCCOR_SIGNATURE pSig,
+ _In_ ULONG cSig,
+ _Out_ CorUnmanagedCallingConvention *callConvOut)
{
CONTRACTL
{
@@ -5236,53 +5275,61 @@ MetaSig::GetUnmanagedCallingConvention(
GC_NOTRIGGER;
FORBID_FAULT;
MODE_ANY;
+ PRECONDITION(callConvOut != NULL);
}
CONTRACTL_END
-
// Instantiations aren't relevant here
MetaSig msig(pSig, cSig, pModule, NULL);
PCCOR_SIGNATURE pWalk = msig.m_pRetType.GetPtr();
_ASSERTE(pWalk <= pSig + cSig);
+
+ *callConvOut = (CorUnmanagedCallingConvention)0;
while ((pWalk < (pSig + cSig)) && ((*pWalk == ELEMENT_TYPE_CMOD_OPT) || (*pWalk == ELEMENT_TYPE_CMOD_REQD)))
{
BOOL fIsOptional = (*pWalk == ELEMENT_TYPE_CMOD_OPT);
pWalk++;
if (pWalk + CorSigUncompressedDataSize(pWalk) > pSig + cSig)
- {
- return FALSE; // Bad formatting
- }
+ return E_FAIL; // Bad formatting
+
mdToken tk;
pWalk += CorSigUncompressToken(pWalk, &tk);
- if (fIsOptional)
+ if (!fIsOptional)
+ continue;
+
+ LPCSTR typeNamespace;
+ LPCSTR typeName;
+
+ // Check for CallConv types specified in modopt
+ if (FAILED(GetNameOfTypeRefOrDef(pModule, tk, &typeNamespace, &typeName)))
+ continue;
+
+ if (::strcmp(typeNamespace, CMOD_CALLCONV_NAMESPACE) != 0)
+ continue;
+
+ const struct {
+ LPCSTR name;
+ CorUnmanagedCallingConvention value;
+ } knownCallConvs[] = {
+ { CMOD_CALLCONV_NAME_CDECL, IMAGE_CEE_UNMANAGED_CALLCONV_C },
+ { CMOD_CALLCONV_NAME_STDCALL, IMAGE_CEE_UNMANAGED_CALLCONV_STDCALL },
+ { CMOD_CALLCONV_NAME_THISCALL, IMAGE_CEE_UNMANAGED_CALLCONV_THISCALL },
+ { CMOD_CALLCONV_NAME_FASTCALL, IMAGE_CEE_UNMANAGED_CALLCONV_FASTCALL } };
+
+ for (const auto &callConv : knownCallConvs)
{
- if (IsTypeRefOrDef("System.Runtime.CompilerServices.CallConvCdecl", pModule, tk))
+ // Take the first recognized calling convention in metadata.
+ if (::strcmp(typeName, callConv.name) == 0)
{
- *pPinvokeMapOut = pmCallConvCdecl;
- return TRUE;
- }
- else if (IsTypeRefOrDef("System.Runtime.CompilerServices.CallConvStdcall", pModule, tk))
- {
- *pPinvokeMapOut = pmCallConvStdcall;
- return TRUE;
- }
- else if (IsTypeRefOrDef("System.Runtime.CompilerServices.CallConvThiscall", pModule, tk))
- {
- *pPinvokeMapOut = pmCallConvThiscall;
- return TRUE;
- }
- else if (IsTypeRefOrDef("System.Runtime.CompilerServices.CallConvFastcall", pModule, tk))
- {
- *pPinvokeMapOut = pmCallConvFastcall;
- return TRUE;
+ *callConvOut = callConv.value;
+ return S_OK;
}
}
}
- *pPinvokeMapOut = (CorPinvokeMap)0;
- return TRUE;
+ return S_FALSE;
}
//---------------------------------------------------------------------------------------
diff --git a/src/coreclr/src/vm/siginfo.hpp b/src/coreclr/src/vm/siginfo.hpp
index 91e51fc68c5e..64c9341e693e 100644
--- a/src/coreclr/src/vm/siginfo.hpp
+++ b/src/coreclr/src/vm/siginfo.hpp
@@ -780,9 +780,30 @@ class MetaSig
}
//----------------------------------------------------------
- // Returns the unmanaged calling convention.
+ // Gets the unmanaged calling convention by reading any modopts.
+ // If there are multiple modopts specifying recognized calling
+ // conventions, the first one that is found in the metadata wins.
+ // Note: the order in the metadata is the reverse of that in IL.
+ //
+ // Returns:
+ // E_FAIL - Signature had an invalid format
+ // S_OK - Calling convention was read from modopt
+ // S_FALSE - Calling convention was not read from modopt
//----------------------------------------------------------
- static BOOL GetUnmanagedCallingConvention(Module *pModule, PCCOR_SIGNATURE pSig, ULONG cSig, CorPinvokeMap *pPinvokeMapOut);
+ static HRESULT TryGetUnmanagedCallingConventionFromModOpt(
+ _In_ Module *pModule,
+ _In_ PCCOR_SIGNATURE pSig,
+ _In_ ULONG cSig,
+ _Out_ CorUnmanagedCallingConvention *callConvOut);
+
+ static CorUnmanagedCallingConvention GetDefaultUnmanagedCallingConvention()
+ {
+#ifdef TARGET_UNIX
+ return IMAGE_CEE_UNMANAGED_CALLCONV_C;
+#else // TARGET_UNIX
+ return IMAGE_CEE_UNMANAGED_CALLCONV_STDCALL;
+#endif // !TARGET_UNIX
+ }
//------------------------------------------------------------------
// Like NextArg, but return only normalized type (enums flattned to
diff --git a/src/coreclr/src/vm/typestring.cpp b/src/coreclr/src/vm/typestring.cpp
index 2b414736defe..76e31bbbf175 100644
--- a/src/coreclr/src/vm/typestring.cpp
+++ b/src/coreclr/src/vm/typestring.cpp
@@ -368,7 +368,7 @@ HRESULT TypeNameBuilder::AddArray(DWORD rank)
Append(W("[*]"));
else if (rank > 64)
{
- // Only taken in an error path, runtime will not load arrays of more than 32 dimentions
+ // Only taken in an error path, runtime will not load arrays of more than 32 dimensions
WCHAR wzDim[128];
_snwprintf_s(wzDim, 128, _TRUNCATE, W("[%d]"), rank);
Append(wzDim);
diff --git a/src/coreclr/src/vm/vars.hpp b/src/coreclr/src/vm/vars.hpp
index 57ac31a285ca..ccf9289abab0 100644
--- a/src/coreclr/src/vm/vars.hpp
+++ b/src/coreclr/src/vm/vars.hpp
@@ -694,7 +694,7 @@ typedef DPTR(GSCookie) PTR_GSCookie;
#define READONLY_ATTR
#else
#ifdef __APPLE__
-#define READONLY_ATTR_ARGS section("__TEXT,__const")
+#define READONLY_ATTR_ARGS section("__DATA,__const")
#else
#define READONLY_ATTR_ARGS section(".rodata")
#endif
diff --git a/src/coreclr/src/vm/virtualcallstub.h b/src/coreclr/src/vm/virtualcallstub.h
index 19e2cc3c1e21..48f81cc13eb1 100644
--- a/src/coreclr/src/vm/virtualcallstub.h
+++ b/src/coreclr/src/vm/virtualcallstub.h
@@ -220,10 +220,14 @@ typedef VPTR(class VirtualCallStubManager) PTR_VirtualCallStubManager;
// see code:#StubDispatchNotes for more
class VirtualCallStubManager : public StubManager
{
- friend class ClrDataAccess;
friend class VirtualCallStubManagerManager;
friend class VirtualCallStubManagerIterator;
+#if defined(DACCESS_COMPILE)
+ friend class ClrDataAccess;
+ friend class DacDbiInterfaceImpl;
+#endif // DACCESS_COMPILE
+
VPTR_VTABLE_CLASS(VirtualCallStubManager, StubManager)
public:
diff --git a/src/coreclr/src/zap/zapinfo.cpp b/src/coreclr/src/zap/zapinfo.cpp
index 310c0b93cb05..203196851cc1 100644
--- a/src/coreclr/src/zap/zapinfo.cpp
+++ b/src/coreclr/src/zap/zapinfo.cpp
@@ -1430,9 +1430,13 @@ LONG * ZapInfo::getAddrOfCaptureThreadGlobal(void **ppIndirection)
_ASSERTE(ppIndirection != NULL);
*ppIndirection = NULL;
- if (!IsReadyToRunCompilation())
+ if (IsReadyToRunCompilation())
+ {
+ *ppIndirection = m_pImage->GetImportTable()->GetHelperImport(READYTORUN_HELPER_IndirectTrapThreads);
+ }
+ else
{
- *ppIndirection = (LONG*)m_pImage->GetInnerPtr(m_pImage->m_pEEInfoTable,
+ *ppIndirection = m_pImage->GetInnerPtr(m_pImage->m_pEEInfoTable,
offsetof(CORCOMPILE_EE_INFO_TABLE, addrOfCaptureThreadGlobal));
}
diff --git a/src/coreclr/tests/issues.targets b/src/coreclr/tests/issues.targets
index 4e8fd381e42c..e19d521e42a4 100644
--- a/src/coreclr/tests/issues.targets
+++ b/src/coreclr/tests/issues.targets
@@ -5,6 +5,9 @@
https://github.com/dotnet/runtime/issues/11204
+
+ https://github.com/dotnet/runtime/issues/39361
+
timeout
@@ -984,6 +987,95 @@
+
+ Crashes during LLVM AOT compilation.
+
+
+ Crashes during LLVM AOT compilation.
+
+
+ Crashes during LLVM AOT compilation.
+
+
+
+ Crashes during LLVM AOT compilation.
+
+
+ Crashes during LLVM AOT compilation.
+
+
+
+ Crashes during LLVM AOT compilation.
+
+
+ Crashes during LLVM AOT compilation.
+
+
+ Crashes during LLVM AOT compilation.
+
+
+ Crashes during LLVM AOT compilation.
+
+
+ Crashes during LLVM AOT compilation.
+
+
+ Crashes during LLVM AOT compilation.
+
+
+
+ Crashes during LLVM AOT compilation.
+
+
+ Crashes during LLVM AOT compilation.
+
+
+ Crashes during LLVM AOT compilation.
+
+
+
+ Doesn't pass after LLVM AOT compilation.
+
+
+ Doesn't pass after LLVM AOT compilation.
+
+
+ Doesn't pass after LLVM AOT compilation.
+
+
+ Doesn't pass after LLVM AOT compilation.
+
+
+ Doesn't pass after LLVM AOT compilation.
+
+
+ Doesn't pass after LLVM AOT compilation.
+
+
+ Doesn't pass after LLVM AOT compilation.
+
+
+ Doesn't pass after LLVM AOT compilation.
+
+
+ Doesn't pass after LLVM AOT compilation.
+
+
+ Doesn't pass after LLVM AOT compilation.
+
+
+ Doesn't pass after LLVM AOT compilation.
+
+
+ Doesn't pass after LLVM AOT compilation.
+
+
+ Doesn't pass after LLVM AOT compilation.
+
+
+ Doesn't pass after LLVM AOT compilation.
+
+
PlatformDetection.IsPreciseGcSupported false on mono
@@ -2625,6 +2717,24 @@
needs triage
+
+ needs triage
+
+
+ needs triage
+
+
+ needs triage
+
+
+ needs triage
+
+
+ needs triage
+
+
+ needs triage
+
needs triage
diff --git a/src/coreclr/tests/src/runtest.proj b/src/coreclr/tests/src/runtest.proj
index adc7433ebd98..f4d3e4b88571 100644
--- a/src/coreclr/tests/src/runtest.proj
+++ b/src/coreclr/tests/src/runtest.proj
@@ -348,6 +348,37 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\","").
+
+
+
+
+
+
+
+
+
+ $(CORE_ROOT)\corerun
+ $(CORE_ROOT)\corerun.exe
+
+
+
+
+
+ @(AotEnvVar)
+
+
+
+ _CorerunExecutable=$(CorerunExecutable);_TestDll=%(TestDlls.Identity);AotEnvVars=@(AotEnvVar)
+
+
+
+
+
@@ -374,6 +405,11 @@ namespace $([System.String]::Copy($(Category)).Replace(".","_").Replace("\","").
+
+
$(BuildArgs) $(Compiler)
$(BuildArgs) $(CMakeArgs)
$(BuildArgs) -coreclrartifacts $(CoreCLRArtifactsPath)
+ $(BuildArgs) -nativelibsartifacts $(LibrariesArtifactsPath)/bin/native/$(NetCoreAppCurrent)-$(TargetOS)-$(LibrariesConfiguration)-$(TargetArchitecture)
-
-
-
-
+
@@ -25,7 +21,9 @@
-
+
+
+
diff --git a/src/installer/publish/prepare-artifacts.proj b/src/installer/publish/prepare-artifacts.proj
index 1bf2b52c6a52..bd2abccb57a8 100644
--- a/src/installer/publish/prepare-artifacts.proj
+++ b/src/installer/publish/prepare-artifacts.proj
@@ -7,6 +7,33 @@
true
+
+
+ $(SYSTEM_TEAMFOUNDATIONCOLLECTIONURI)
+
+
+ $(CollectionUri.Split('/')[3])
+
+
+ $(CollectionUri.Split('.')[0].Split('/')[2])
+
+
+
+
+
+
+
+
+
+
+
+
+
+
)
+ Command.Create(singleFile)
+ .CaptureStdErr()
+ .CaptureStdOut()
+ .EnvironmentVariable(BundleHelper.DotnetBundleExtractBaseEnvVariable, relativePath)
+ .Execute()
+ .Should()
+ .Pass()
+ .And
+ .HaveStdOutContaining("Hello World");
+ }
+
[Fact]
private void Bundle_extraction_is_reused()
{
diff --git a/src/libraries/Common/src/Interop/Interop.Calendar.cs b/src/libraries/Common/src/Interop/Interop.Calendar.cs
index 494648f1b1ce..9be426d367a6 100644
--- a/src/libraries/Common/src/Interop/Interop.Calendar.cs
+++ b/src/libraries/Common/src/Interop/Interop.Calendar.cs
@@ -9,8 +9,8 @@ internal static partial class Interop
{
internal static partial class Globalization
{
- internal delegate void EnumCalendarInfoCallback(
- [MarshalAs(UnmanagedType.LPWStr)] string calendarString,
+ internal unsafe delegate void EnumCalendarInfoCallback(
+ char* calendarString,
IntPtr context);
[DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetCalendars")]
@@ -19,8 +19,15 @@ internal delegate void EnumCalendarInfoCallback(
[DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetCalendarInfo")]
internal static extern unsafe ResultCode GetCalendarInfo(string localeName, CalendarId calendarId, CalendarDataType calendarDataType, char* result, int resultCapacity);
+#if TARGET_BROWSER
+ // Temp workaround for pinvoke callbacks for Mono-Wasm-Interpreter
+ // https://github.com/dotnet/runtime/issues/39100
+ [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_EnumCalendarInfo")]
+ internal static extern bool EnumCalendarInfo(IntPtr callback, string localeName, CalendarId calendarId, CalendarDataType calendarDataType, IntPtr context);
+#else
[DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_EnumCalendarInfo")]
internal static extern bool EnumCalendarInfo(EnumCalendarInfoCallback callback, string localeName, CalendarId calendarId, CalendarDataType calendarDataType, IntPtr context);
+#endif
[DllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetLatestJapaneseEra")]
internal static extern int GetLatestJapaneseEra();
diff --git a/src/libraries/Common/src/Interop/Interop.TimeZoneDisplayNameType.cs b/src/libraries/Common/src/Interop/Interop.TimeZoneDisplayNameType.cs
new file mode 100644
index 000000000000..f46072196eb9
--- /dev/null
+++ b/src/libraries/Common/src/Interop/Interop.TimeZoneDisplayNameType.cs
@@ -0,0 +1,16 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+internal static partial class Interop
+{
+ internal static partial class Globalization
+ {
+ // needs to be kept in sync with TimeZoneDisplayNameType in System.Globalization.Native
+ internal enum TimeZoneDisplayNameType
+ {
+ Generic = 0,
+ Standard = 1,
+ DaylightSavings = 2,
+ }
+ }
+}
diff --git a/src/libraries/Common/src/Interop/Interop.TimeZoneInfo.cs b/src/libraries/Common/src/Interop/Interop.TimeZoneInfo.cs
index 5d848e11ed46..d1ab917229f2 100644
--- a/src/libraries/Common/src/Interop/Interop.TimeZoneInfo.cs
+++ b/src/libraries/Common/src/Interop/Interop.TimeZoneInfo.cs
@@ -7,14 +7,6 @@ internal static partial class Interop
{
internal static partial class Globalization
{
- // needs to be kept in sync with TimeZoneDisplayNameType in System.Globalization.Native
- internal enum TimeZoneDisplayNameType
- {
- Generic = 0,
- Standard = 1,
- DaylightSavings = 2,
- }
-
[DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetTimeZoneDisplayName")]
internal static extern unsafe ResultCode GetTimeZoneDisplayName(
string localeName,
diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Digest.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Digest.cs
index 799a5d629635..a4f6e52ee9be 100644
--- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Digest.cs
+++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Digest.cs
@@ -32,6 +32,9 @@ internal static int DigestCurrent(SafeDigestCtxHandle ctx, Span output) =>
[DllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestCurrent")]
private static extern int DigestCurrent(SafeDigestCtxHandle ctx, ref byte pbOutput, int cbOutput);
+
+ [DllImport(Libraries.AppleCryptoNative, EntryPoint = "AppleCryptoNative_DigestOneShot")]
+ internal static unsafe extern int DigestOneShot(PAL_HashAlgorithm algorithm, byte* pbData, int cbData, byte* pbOutput, int cbOutput, out int cbDigest);
}
}
diff --git a/src/libraries/Common/src/Interop/Unix/Interop.Errors.cs b/src/libraries/Common/src/Interop/Unix/Interop.Errors.cs
index 6b855f2de21b..4e9b16098dca 100644
--- a/src/libraries/Common/src/Interop/Unix/Interop.Errors.cs
+++ b/src/libraries/Common/src/Interop/Unix/Interop.Errors.cs
@@ -193,9 +193,11 @@ internal static unsafe string StrError(int platformErrno)
private static extern unsafe byte* StrErrorR(int platformErrno, byte* buffer, int bufferSize);
#else
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ConvertErrorPlatformToPal")]
+ [SuppressGCTransition]
internal static extern Error ConvertErrorPlatformToPal(int platformErrno);
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ConvertErrorPalToPlatform")]
+ [SuppressGCTransition]
internal static extern int ConvertErrorPalToPlatform(Error error);
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_StrErrorR")]
diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Fcntl.Pipe.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Fcntl.Pipe.cs
index 47827f9e1673..9e86930ec284 100644
--- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Fcntl.Pipe.cs
+++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.Fcntl.Pipe.cs
@@ -20,6 +20,7 @@ internal static partial class Fcntl
internal static extern int SetPipeSz(SafePipeHandle fd, int size);
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_FcntlCanGetSetPipeSz")]
+ [SuppressGCTransition]
private static extern int FcntlCanGetSetPipeSz();
}
}
diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetDomainSocketSizes.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetDomainSocketSizes.cs
index 55020265184e..3748ebfe148f 100644
--- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetDomainSocketSizes.cs
+++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetDomainSocketSizes.cs
@@ -9,6 +9,7 @@ internal static partial class Interop
internal static partial class Sys
{
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetDomainSocketSizes")]
+ [SuppressGCTransition]
internal static extern void GetDomainSocketSizes(out int pathOffset, out int pathSize, out int addressSize);
}
}
diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetMaximumAddressSize.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetMaximumAddressSize.cs
index f6ae1a0c3049..44617551080a 100644
--- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetMaximumAddressSize.cs
+++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetMaximumAddressSize.cs
@@ -9,6 +9,7 @@ internal static partial class Interop
internal static partial class Sys
{
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetMaximumAddressSize")]
+ [SuppressGCTransition]
internal static extern int GetMaximumAddressSize();
}
}
diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetOSArchitecture.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetOSArchitecture.cs
index e98e6fe3d3b6..de7b9cd37ad2 100644
--- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetOSArchitecture.cs
+++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetOSArchitecture.cs
@@ -8,6 +8,7 @@ internal static partial class Interop
{
internal static partial class Sys
{
+ [SuppressGCTransition]
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetOSArchitecture")]
internal static extern int GetOSArchitecture();
}
diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetProcessArchitecture.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetProcessArchitecture.cs
index c5b23b691d1c..2dbb0b1eed13 100644
--- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetProcessArchitecture.cs
+++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.GetProcessArchitecture.cs
@@ -8,6 +8,7 @@ internal static partial class Interop
{
internal static partial class Sys
{
+ [SuppressGCTransition]
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetProcessArchitecture")]
internal static extern int GetProcessArchitecture();
}
diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.IPPacketInformation.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.IPPacketInformation.cs
index 6156c3e96521..76c992748b62 100644
--- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.IPPacketInformation.cs
+++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.IPPacketInformation.cs
@@ -17,7 +17,8 @@ internal struct IPPacketInformation
}
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetControlMessageBufferSize")]
- internal static extern int GetControlMessageBufferSize(bool isIPv4, bool isIPv6);
+ [SuppressGCTransition]
+ internal static extern int GetControlMessageBufferSize(int isIPv4, int isIPv6);
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_TryGetIPPacketInformation")]
internal static extern unsafe bool TryGetIPPacketInformation(MessageHeader* messageHeader, bool isIPv4, IPPacketInformation* packetInfo);
diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LChflags.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LChflags.cs
index a19526c8b925..03afef646f08 100644
--- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LChflags.cs
+++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LChflags.cs
@@ -20,6 +20,7 @@ internal enum UserFlags : uint
internal static readonly bool CanSetHiddenFlag = (LChflagsCanSetHiddenFlag() != 0);
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_LChflagsCanSetHiddenFlag")]
+ [SuppressGCTransition]
private static extern int LChflagsCanSetHiddenFlag();
}
}
diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MapTcpState.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MapTcpState.cs
index 05926e86f699..d16be7edf49a 100644
--- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MapTcpState.cs
+++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.MapTcpState.cs
@@ -9,6 +9,7 @@ internal static partial class Interop
internal static partial class Sys
{
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_MapTcpState")]
+ [SuppressGCTransition]
internal static extern TcpState MapTcpState(int nativeState);
}
}
diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PlatformSocketSupport.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PlatformSocketSupport.cs
index 1e67ff7ee9d3..0e406162f9ac 100644
--- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PlatformSocketSupport.cs
+++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.PlatformSocketSupport.cs
@@ -8,6 +8,7 @@ internal static partial class Interop
internal static partial class Sys
{
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_PlatformSupportsDualModeIPv4PacketInfo")]
- internal static extern bool PlatformSupportsDualModeIPv4PacketInfo();
+ [SuppressGCTransition]
+ internal static extern int PlatformSupportsDualModeIPv4PacketInfo();
}
}
diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadDir.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadDir.cs
index 01de4fc1bcb3..67a8a6bfc9bd 100644
--- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadDir.cs
+++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.ReadDir.cs
@@ -57,6 +57,7 @@ internal ReadOnlySpan GetName(Span buffer)
internal static extern IntPtr OpenDir(string path);
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetReadDirRBufferSize", SetLastError = false)]
+ [SuppressGCTransition]
internal static extern int GetReadDirRBufferSize();
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_ReadDirR", SetLastError = false)]
diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.RegisterForCtrlC.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.RegisterForCtrlC.cs
index f3c5b60e40c9..058ea46e22e0 100644
--- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.RegisterForCtrlC.cs
+++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.RegisterForCtrlC.cs
@@ -16,9 +16,11 @@ internal enum CtrlCode
internal delegate void CtrlCallback(CtrlCode ctrlCode);
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_RegisterForCtrl")]
+ [SuppressGCTransition]
internal static extern void RegisterForCtrl(CtrlCallback handler);
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_UnregisterForCtrl")]
+ [SuppressGCTransition]
internal static extern void UnregisterForCtrl();
}
}
diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetSignalForBreak.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetSignalForBreak.cs
index 37c892bb370a..51603d6d1e4a 100644
--- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetSignalForBreak.cs
+++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetSignalForBreak.cs
@@ -8,9 +8,10 @@ internal static partial class Interop
internal static partial class Sys
{
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetSignalForBreak")]
- internal static extern bool GetSignalForBreak();
+ [SuppressGCTransition]
+ internal static extern int GetSignalForBreak();
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetSignalForBreak")]
- internal static extern bool SetSignalForBreak(bool signalForBreak);
+ internal static extern int SetSignalForBreak(int signalForBreak);
}
}
diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetTerminalInvalidationHandler.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetTerminalInvalidationHandler.cs
index a4ccb94186b7..85b3a8587183 100644
--- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetTerminalInvalidationHandler.cs
+++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SetTerminalInvalidationHandler.cs
@@ -10,6 +10,7 @@ internal partial class Sys
internal delegate void TerminalInvalidationCallback();
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetTerminalInvalidationHandler")]
+ [SuppressGCTransition]
internal static extern void SetTerminalInvalidationHandler(TerminalInvalidationCallback handler);
}
}
diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SocketAddress.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SocketAddress.cs
index 7c1dffc241ff..5770afbf197b 100644
--- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SocketAddress.cs
+++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.SocketAddress.cs
@@ -10,24 +10,31 @@ internal static partial class Interop
internal static partial class Sys
{
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPSocketAddressSizes")]
+ [SuppressGCTransition]
internal static extern unsafe Error GetIPSocketAddressSizes(int* ipv4SocketAddressSize, int* ipv6SocketAddressSize);
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetAddressFamily")]
+ [SuppressGCTransition]
internal static extern unsafe Error GetAddressFamily(byte* socketAddress, int socketAddressLen, int* addressFamily);
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetAddressFamily")]
+ [SuppressGCTransition]
internal static extern unsafe Error SetAddressFamily(byte* socketAddress, int socketAddressLen, int addressFamily);
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetPort")]
+ [SuppressGCTransition]
internal static extern unsafe Error GetPort(byte* socketAddress, int socketAddressLen, ushort* port);
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetPort")]
+ [SuppressGCTransition]
internal static extern unsafe Error SetPort(byte* socketAddress, int socketAddressLen, ushort port);
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv4Address")]
+ [SuppressGCTransition]
internal static extern unsafe Error GetIPv4Address(byte* socketAddress, int socketAddressLen, uint* address);
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_SetIPv4Address")]
+ [SuppressGCTransition]
internal static extern unsafe Error SetIPv4Address(byte* socketAddress, int socketAddressLen, uint address);
[DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_GetIPv6Address")]
diff --git a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.cs b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.cs
index e1dc2e0cd58c..ab184581dbcb 100644
--- a/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.cs
+++ b/src/libraries/Common/src/Interop/Unix/System.Security.Cryptography.Native/Interop.EVP.cs
@@ -30,6 +30,9 @@ internal static int EvpDigestUpdate(SafeEvpMdCtxHandle ctx, ReadOnlySpan d
[DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestCurrent")]
internal static extern int EvpDigestCurrent(SafeEvpMdCtxHandle ctx, ref byte md, ref uint s);
+ [DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpDigestOneShot")]
+ internal static unsafe extern int EvpDigestOneShot(IntPtr type, byte* source, int sourceSize, byte* md, ref uint mdSize);
+
[DllImport(Libraries.CryptoNative, EntryPoint = "CryptoNative_EvpMdSize")]
internal static extern int EvpMdSize(IntPtr md);
diff --git a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptHash.cs b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptHash.cs
new file mode 100644
index 000000000000..f7384436f694
--- /dev/null
+++ b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptHash.cs
@@ -0,0 +1,16 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using System;
+using System.Runtime.InteropServices;
+
+using Microsoft.Win32.SafeHandles;
+
+internal partial class Interop
+{
+ internal partial class BCrypt
+ {
+ [DllImport(Libraries.BCrypt, CharSet = CharSet.Unicode)]
+ internal static unsafe extern NTSTATUS BCryptHash(SafeBCryptAlgorithmHandle hAlgorithm, byte* pbSecret, int cbSecret, byte* pbInput, int cbInput, byte* pbOutput, int cbOutput);
+ }
+}
diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleMode.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleMode.cs
index f081fec91943..f71ac5b154ae 100644
--- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleMode.cs
+++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetConsoleMode.cs
@@ -21,5 +21,7 @@ internal static bool IsGetConsoleModeCallSuccessful(IntPtr handle)
internal static extern bool SetConsoleMode(IntPtr handle, int mode);
internal const int ENABLE_PROCESSED_INPUT = 0x0001;
+ internal const uint ENABLE_VIRTUAL_TERMINAL_PROCESSING = 0x0004;
+ internal const int STD_OUTPUT_HANDLE = -11;
}
}
diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetStdHandle.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetStdHandle.cs
index 1bd75631ba1e..b317b13e5499 100644
--- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetStdHandle.cs
+++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.GetStdHandle.cs
@@ -9,7 +9,9 @@ internal static partial class Interop
internal static partial class Kernel32
{
[DllImport(Libraries.Kernel32)]
+#if !NO_SUPPRESS_GC_TRANSITION
[SuppressGCTransition]
+#endif
internal static extern IntPtr GetStdHandle(int nStdHandle); // param is NOT a handle, but it returns one!
}
}
diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/ISSPIInterface.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/ISSPIInterface.cs
index b1d82a736d58..62daefd267e7 100644
--- a/src/libraries/Common/src/Interop/Windows/SspiCli/ISSPIInterface.cs
+++ b/src/libraries/Common/src/Interop/Windows/SspiCli/ISSPIInterface.cs
@@ -14,6 +14,7 @@ internal interface ISSPIInterface
int EnumerateSecurityPackages(out int pkgnum, out SafeFreeContextBuffer pkgArray);
int AcquireCredentialsHandle(string moduleName, Interop.SspiCli.CredentialUse usage, ref SafeSspiAuthDataHandle authdata, out SafeFreeCredentials outCredential);
int AcquireCredentialsHandle(string moduleName, Interop.SspiCli.CredentialUse usage, ref Interop.SspiCli.SCHANNEL_CRED authdata, out SafeFreeCredentials outCredential);
+ unsafe int AcquireCredentialsHandle(string moduleName, Interop.SspiCli.CredentialUse usage, Interop.SspiCli.SCH_CREDENTIALS* authdata, out SafeFreeCredentials outCredential);
int AcquireDefaultCredential(string moduleName, Interop.SspiCli.CredentialUse usage, out SafeFreeCredentials outCredential);
int AcceptSecurityContext(SafeFreeCredentials? credential, ref SafeDeleteSslContext? context, InputSecurityBuffers inputBuffers, Interop.SspiCli.ContextFlags inFlags, Interop.SspiCli.Endianness endianness, ref SecurityBuffer outputBuffer, ref Interop.SspiCli.ContextFlags outFlags);
int InitializeSecurityContext(ref SafeFreeCredentials? credential, ref SafeDeleteSslContext? context, string? targetName, Interop.SspiCli.ContextFlags inFlags, Interop.SspiCli.Endianness endianness, InputSecurityBuffers inputBuffers, ref SecurityBuffer outputBuffer, ref Interop.SspiCli.ContextFlags outFlags);
diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.SSPI.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.SSPI.cs
index 9db80f3ae965..9556c5054533 100644
--- a/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.SSPI.cs
+++ b/src/libraries/Common/src/Interop/Windows/SspiCli/Interop.SSPI.cs
@@ -214,6 +214,92 @@ public enum Flags
}
}
+ [StructLayout(LayoutKind.Sequential)]
+ internal unsafe struct SCH_CREDENTIALS
+ {
+ public const int CurrentVersion = 0x5;
+
+ public int dwVersion;
+ public int dwCredformat;
+ public int cCreds;
+
+ // This is pointer to arry of CERT_CONTEXT*
+ // We do not use it directly in .NET. Instead, we wrap returned OS pointer in safe handle.
+ public void* paCred;
+
+ public IntPtr hRootStore; // == always null, OTHERWISE NOT RELIABLE
+ public int cMappers;
+ public IntPtr aphMappers; // == always null, OTHERWISE NOT RELIABLE
+
+ public int dwSessionLifespan;
+ public SCH_CREDENTIALS.Flags dwFlags;
+ public int cTlsParameters;
+ public TLS_PARAMETERS* pTlsParameters;
+
+ [Flags]
+ public enum Flags
+ {
+ Zero = 0,
+ SCH_CRED_NO_SYSTEM_MAPPER = 0x02,
+ SCH_CRED_NO_SERVERNAME_CHECK = 0x04,
+ SCH_CRED_MANUAL_CRED_VALIDATION = 0x08,
+ SCH_CRED_NO_DEFAULT_CREDS = 0x10,
+ SCH_CRED_AUTO_CRED_VALIDATION = 0x20,
+ SCH_CRED_USE_DEFAULT_CREDS = 0x40,
+ SCH_DISABLE_RECONNECTS = 0x80,
+ SCH_CRED_REVOCATION_CHECK_END_CERT = 0x100,
+ SCH_CRED_REVOCATION_CHECK_CHAIN = 0x200,
+ SCH_CRED_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT = 0x400,
+ SCH_CRED_IGNORE_NO_REVOCATION_CHECK = 0x800,
+ SCH_CRED_IGNORE_REVOCATION_OFFLINE = 0x1000,
+ SCH_CRED_CACHE_ONLY_URL_RETRIEVAL_ON_CREATE = 0x2000,
+ SCH_SEND_ROOT_CERT = 0x40000,
+ SCH_SEND_AUX_RECORD = 0x00200000,
+ SCH_USE_STRONG_CRYPTO = 0x00400000,
+ SCH_USE_PRESHAREDKEY_ONLY = 0x800000,
+ SCH_ALLOW_NULL_ENCRYPTION = 0x02000000,
+ }
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal unsafe struct TLS_PARAMETERS
+ {
+ public int cAlpnIds; // Valid for server applications only. Must be zero otherwise. Number of ALPN IDs in rgstrAlpnIds; set to 0 if applies to all.
+ public IntPtr rgstrAlpnIds; // Valid for server applications only. Must be NULL otherwise. Array of ALPN IDs that the following settings apply to; set to NULL if applies to all.
+ public uint grbitDisabledProtocols; // List protocols you DO NOT want negotiated.
+ public int cDisabledCrypto; // Number of CRYPTO_SETTINGS structures; set to 0 if there are none.
+ public CRYPTO_SETTINGS* pDisabledCrypto; // Array of CRYPTO_SETTINGS structures; set to NULL if there are none;
+ public TLS_PARAMETERS.Flags dwFlags; // Optional flags to pass; set to 0 if there are none.
+
+ [Flags]
+ public enum Flags
+ {
+ Zero = 0,
+ TLS_PARAMS_OPTIONAL = 0x01, // Valid for server applications only. Must be zero otherwise.
+ // TLS_PARAMETERS that will only be honored if they do not cause this server to terminate the handshake.
+ }
+ }
+
+ [StructLayout(LayoutKind.Sequential)]
+ internal unsafe struct CRYPTO_SETTINGS
+ {
+ public TlsAlgorithmUsage eAlgorithmUsage; // How this algorithm is being used.
+ public UNICODE_STRING* strCngAlgId; // CNG algorithm identifier.
+ public int cChainingModes; // Set to 0 if CNG algorithm does not have a chaining mode.
+ public UNICODE_STRING* rgstrChainingModes; // Set to NULL if CNG algorithm does not have a chaining mode.
+ public int dwMinBitLength; // Blacklist key sizes less than this. Set to 0 if not defined or CNG algorithm implies bit length.
+ public int dwMaxBitLength; // Blacklist key sizes greater than this. Set to 0 if not defined or CNG algorithm implies bit length.
+
+ public enum TlsAlgorithmUsage
+ {
+ TlsParametersCngAlgUsageKeyExchange, // Key exchange algorithm. RSA, ECHDE, DHE, etc.
+ TlsParametersCngAlgUsageSignature, // Signature algorithm. RSA, DSA, ECDSA, etc.
+ TlsParametersCngAlgUsageCipher, // Encryption algorithm. AES, DES, RC4, etc.
+ TlsParametersCngAlgUsageDigest, // Digest of cipher suite. SHA1, SHA256, SHA384, etc.
+ TlsParametersCngAlgUsageCertSig // Signature and/or hash used to sign certificate. RSA, DSA, ECDSA, SHA1, SHA256, etc.
+ }
+ }
+
[StructLayout(LayoutKind.Sequential)]
internal unsafe struct SecBuffer
{
@@ -344,6 +430,20 @@ internal static extern unsafe int AcquireCredentialsHandleW(
[Out] out long timeStamp
);
+ [DllImport(Interop.Libraries.SspiCli, ExactSpelling = true, CharSet = CharSet.Unicode, SetLastError = true)]
+ internal static extern unsafe int AcquireCredentialsHandleW(
+ [In] string? principal,
+ [In] string moduleName,
+ [In] int usage,
+ [In] void* logonID,
+ [In] SCH_CREDENTIALS* authData,
+ [In] void* keyCallback,
+ [In] void* keyArgument,
+ ref CredHandle handlePtr,
+ [Out] out long timeStamp
+ );
+
+
[DllImport(Interop.Libraries.SspiCli, ExactSpelling = true, SetLastError = true)]
internal static extern unsafe int InitializeSecurityContextW(
ref CredHandle credentialHandle,
diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/SSPIAuthType.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/SSPIAuthType.cs
index a29658dd67c4..7d359791a0fe 100644
--- a/src/libraries/Common/src/Interop/Windows/SspiCli/SSPIAuthType.cs
+++ b/src/libraries/Common/src/Interop/Windows/SspiCli/SSPIAuthType.cs
@@ -45,6 +45,11 @@ public int AcquireCredentialsHandle(string moduleName, Interop.SspiCli.Credentia
return SafeFreeCredentials.AcquireCredentialsHandle(moduleName, usage, ref authdata, out outCredential);
}
+ public unsafe int AcquireCredentialsHandle(string moduleName, Interop.SspiCli.CredentialUse usage, Interop.SspiCli.SCH_CREDENTIALS* authdata, out SafeFreeCredentials outCredential)
+ {
+ return SafeFreeCredentials.AcquireCredentialsHandle(moduleName, usage, authdata, out outCredential);
+ }
+
public int AcceptSecurityContext(SafeFreeCredentials? credential, ref SafeDeleteSslContext? context, InputSecurityBuffers inputBuffers, Interop.SspiCli.ContextFlags inFlags, Interop.SspiCli.Endianness endianness, ref SecurityBuffer outputBuffer, ref Interop.SspiCli.ContextFlags outFlags)
{
return SafeDeleteContext.AcceptSecurityContext(ref credential, ref context, inFlags, endianness, inputBuffers, ref outputBuffer, ref outFlags);
diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/SSPISecureChannelType.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/SSPISecureChannelType.cs
index 0e9bc6275aa9..e30e53d27262 100644
--- a/src/libraries/Common/src/Interop/Windows/SspiCli/SSPISecureChannelType.cs
+++ b/src/libraries/Common/src/Interop/Windows/SspiCli/SSPISecureChannelType.cs
@@ -45,6 +45,11 @@ public int AcquireCredentialsHandle(string moduleName, Interop.SspiCli.Credentia
return SafeFreeCredentials.AcquireCredentialsHandle(moduleName, usage, ref authdata, out outCredential);
}
+ public unsafe int AcquireCredentialsHandle(string moduleName, Interop.SspiCli.CredentialUse usage, Interop.SspiCli.SCH_CREDENTIALS* authdata, out SafeFreeCredentials outCredential)
+ {
+ return SafeFreeCredentials.AcquireCredentialsHandle(moduleName, usage, authdata, out outCredential);
+ }
+
public int AcceptSecurityContext(SafeFreeCredentials? credential, ref SafeDeleteSslContext? context, InputSecurityBuffers inputBuffers, Interop.SspiCli.ContextFlags inFlags, Interop.SspiCli.Endianness endianness, ref SecurityBuffer outputBuffer, ref Interop.SspiCli.ContextFlags outFlags)
{
return SafeDeleteContext.AcceptSecurityContext(ref credential, ref context, inFlags, endianness, inputBuffers, ref outputBuffer, ref outFlags);
diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/SSPIWrapper.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/SSPIWrapper.cs
index 74772416a15c..eaf912697a91 100644
--- a/src/libraries/Common/src/Interop/Windows/SspiCli/SSPIWrapper.cs
+++ b/src/libraries/Common/src/Interop/Windows/SspiCli/SSPIWrapper.cs
@@ -110,14 +110,28 @@ public static SafeFreeCredentials AcquireCredentialsHandle(ISSPIInterface secMod
public static SafeFreeCredentials AcquireCredentialsHandle(ISSPIInterface secModule, string package, Interop.SspiCli.CredentialUse intent, Interop.SspiCli.SCHANNEL_CRED scc)
{
- if (NetEventSource.Log.IsEnabled()) NetEventSource.Log.AcquireCredentialsHandle(package, intent, scc);
-
- SafeFreeCredentials? outCredential = null;
int errorCode = secModule.AcquireCredentialsHandle(
package,
intent,
ref scc,
- out outCredential);
+ out SafeFreeCredentials outCredential);
+
+ if (errorCode != 0)
+ {
+ if (NetEventSource.IsEnabled) NetEventSource.Error(null, SR.Format(SR.net_log_operation_failed_with_error, nameof(AcquireCredentialsHandle), $"0x{errorCode:X}"));
+ throw new Win32Exception(errorCode);
+ }
+
+ return outCredential;
+ }
+
+ public static unsafe SafeFreeCredentials AcquireCredentialsHandle(ISSPIInterface secModule, string package, Interop.SspiCli.CredentialUse intent, Interop.SspiCli.SCH_CREDENTIALS* scc)
+ {
+ int errorCode = secModule.AcquireCredentialsHandle(
+ package,
+ intent,
+ scc,
+ out SafeFreeCredentials outCredential);
if (errorCode != 0)
{
diff --git a/src/libraries/Common/src/Interop/Windows/SspiCli/SecuritySafeHandles.cs b/src/libraries/Common/src/Interop/Windows/SspiCli/SecuritySafeHandles.cs
index b4f3eb526723..bef2693adb88 100644
--- a/src/libraries/Common/src/Interop/Windows/SspiCli/SecuritySafeHandles.cs
+++ b/src/libraries/Common/src/Interop/Windows/SspiCli/SecuritySafeHandles.cs
@@ -301,6 +301,38 @@ public static unsafe int AcquireCredentialsHandle(
return errorCode;
}
+
+ public static unsafe int AcquireCredentialsHandle(
+ string package,
+ Interop.SspiCli.CredentialUse intent,
+ Interop.SspiCli.SCH_CREDENTIALS* authdata,
+ out SafeFreeCredentials outCredential)
+ {
+ long timeStamp;
+
+ outCredential = new SafeFreeCredential_SECURITY();
+
+ int errorCode = Interop.SspiCli.AcquireCredentialsHandleW(
+ null,
+ package,
+ (int)intent,
+ null,
+ authdata,
+ null,
+ null,
+ ref outCredential._handle,
+ out timeStamp);
+
+ if (NetEventSource.IsEnabled) NetEventSource.Verbose(null, $"{nameof(Interop.SspiCli.AcquireCredentialsHandleW)} returns 0x{errorCode:x}, handle = {outCredential}");
+
+ if (errorCode != 0)
+ {
+ outCredential.SetHandleAsInvalid();
+ }
+
+ return errorCode;
+ }
+
}
//
diff --git a/src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp_types.cs b/src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp_types.cs
index 720afa5aab05..9dd0d81b56cf 100644
--- a/src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp_types.cs
+++ b/src/libraries/Common/src/Interop/Windows/WinHttp/Interop.winhttp_types.cs
@@ -153,6 +153,7 @@ internal partial class WinHttp
public const uint WINHTTP_OPTION_HTTP_PROTOCOL_USED = 134;
public const uint WINHTTP_PROTOCOL_FLAG_HTTP2 = 0x1;
public const uint WINHTTP_HTTP2_PLUS_CLIENT_CERT_FLAG = 0x1;
+ public const uint WINHTTP_OPTION_DISABLE_STREAM_QUEUE = 139;
public const uint WINHTTP_OPTION_UPGRADE_TO_WEB_SOCKET = 114;
public const uint WINHTTP_OPTION_WEB_SOCKET_CLOSE_TIMEOUT = 115;
diff --git a/src/libraries/Common/src/System/LocalAppContextSwitches.Common.cs b/src/libraries/Common/src/System/LocalAppContextSwitches.Common.cs
index 4457c0820d01..bcbc8d56093a 100644
--- a/src/libraries/Common/src/System/LocalAppContextSwitches.Common.cs
+++ b/src/libraries/Common/src/System/LocalAppContextSwitches.Common.cs
@@ -51,6 +51,11 @@ private static bool GetSwitchDefaultValue(string switchName)
return true;
}
+ if (switchName == "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization")
+ {
+ return true;
+ }
+
return false;
}
}
diff --git a/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockConnection.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockConnection.cs
index 361474bcb1c8..cba2f936ef8d 100644
--- a/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockConnection.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockConnection.cs
@@ -93,7 +93,7 @@ internal override async ValueTask ConnectAsync(CancellationToken cancellationTok
int bytesRead = 0;
do
{
- bytesRead += await socket.ReceiveAsync(buffer.AsMemory().Slice(bytesRead), SocketFlags.None).ConfigureAwait(false);
+ bytesRead += await socket.ReceiveAsync(buffer.AsMemory().Slice(bytesRead), SocketFlags.None, cancellationToken).ConfigureAwait(false);
} while (bytesRead != buffer.Length);
int peerListenPort = BinaryPrimitives.ReadInt32LittleEndian(buffer);
@@ -163,7 +163,7 @@ internal override async ValueTask AcceptStreamAsync(Cancella
int bytesRead = 0;
do
{
- bytesRead += await socket.ReceiveAsync(buffer.AsMemory().Slice(bytesRead), SocketFlags.None).ConfigureAwait(false);
+ bytesRead += await socket.ReceiveAsync(buffer.AsMemory().Slice(bytesRead), SocketFlags.None, cancellationToken).ConfigureAwait(false);
} while (bytesRead != buffer.Length);
long streamId = BinaryPrimitives.ReadInt64LittleEndian(buffer);
diff --git a/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockListener.cs b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockListener.cs
index f4c0cfdf2c2f..e7b24548d2cf 100644
--- a/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockListener.cs
+++ b/src/libraries/Common/src/System/Net/Http/aspnetcore/Quic/Implementations/Mock/MockListener.cs
@@ -45,7 +45,7 @@ internal override async ValueTask AcceptConnectionAsync(
int bytesRead = 0;
do
{
- bytesRead += await socket.ReceiveAsync(buffer.AsMemory().Slice(bytesRead), SocketFlags.None).ConfigureAwait(false);
+ bytesRead += await socket.ReceiveAsync(buffer.AsMemory().Slice(bytesRead), SocketFlags.None, cancellationToken).ConfigureAwait(false);
} while (bytesRead != buffer.Length);
int peerListenPort = BinaryPrimitives.ReadInt32LittleEndian(buffer);
diff --git a/src/libraries/Common/src/System/Net/WebSockets/ManagedWebSocket.cs b/src/libraries/Common/src/System/Net/WebSockets/ManagedWebSocket.cs
index 219439ba721c..77e89ea60a97 100644
--- a/src/libraries/Common/src/System/Net/WebSockets/ManagedWebSocket.cs
+++ b/src/libraries/Common/src/System/Net/WebSockets/ManagedWebSocket.cs
@@ -368,7 +368,7 @@ private ValueTask SendFrameAsync(MessageOpcode opcode, bool endOfMessage, ReadOn
// pass around (the CancellationTokenRegistration), so if it is cancelable, just immediately go to the fallback path.
// Similarly, it should be rare that there are multiple outstanding calls to SendFrameAsync, but if there are, again
// fall back to the fallback path.
- return cancellationToken.CanBeCanceled || !_sendFrameAsyncLock.Wait(0) ?
+ return cancellationToken.CanBeCanceled || !_sendFrameAsyncLock.Wait(0, default) ?
SendFrameFallbackAsync(opcode, endOfMessage, payloadBuffer, cancellationToken) :
SendFrameLockAcquiredNonCancelableAsync(opcode, endOfMessage, payloadBuffer);
}
@@ -384,7 +384,7 @@ private ValueTask SendFrameLockAcquiredNonCancelableAsync(MessageOpcode opcode,
// If we get here, the cancellation token is not cancelable so we don't have to worry about it,
// and we own the semaphore, so we don't need to asynchronously wait for it.
ValueTask writeTask = default;
- bool releaseSemaphoreAndSendBuffer = true;
+ bool releaseSendBufferAndSemaphore = true;
try
{
// Write the payload synchronously to the buffer, then write that buffer out to the network.
@@ -402,7 +402,7 @@ private ValueTask SendFrameLockAcquiredNonCancelableAsync(MessageOpcode opcode,
// Up until this point, if an exception occurred (such as when accessing _stream or when
// calling GetResult), we want to release the semaphore and the send buffer. After this point,
// both need to be held until writeTask completes.
- releaseSemaphoreAndSendBuffer = false;
+ releaseSendBufferAndSemaphore = false;
}
catch (Exception exc)
{
@@ -413,10 +413,10 @@ private ValueTask SendFrameLockAcquiredNonCancelableAsync(MessageOpcode opcode,
}
finally
{
- if (releaseSemaphoreAndSendBuffer)
+ if (releaseSendBufferAndSemaphore)
{
- _sendFrameAsyncLock.Release();
ReleaseSendBuffer();
+ _sendFrameAsyncLock.Release();
}
}
@@ -437,8 +437,8 @@ private async ValueTask WaitForWriteTaskAsync(ValueTask writeTask)
}
finally
{
- _sendFrameAsyncLock.Release();
ReleaseSendBuffer();
+ _sendFrameAsyncLock.Release();
}
}
@@ -461,8 +461,8 @@ private async ValueTask SendFrameFallbackAsync(MessageOpcode opcode, bool endOfM
}
finally
{
- _sendFrameAsyncLock.Release();
ReleaseSendBuffer();
+ _sendFrameAsyncLock.Release();
}
}
@@ -1277,6 +1277,8 @@ private void AllocateSendBuffer(int minLength)
/// Releases the send buffer to the pool.
private void ReleaseSendBuffer()
{
+ Debug.Assert(_sendFrameAsyncLock.CurrentCount == 0, "Caller should hold the _sendFrameAsyncLock");
+
byte[]? old = _sendBuffer;
if (old != null)
{
diff --git a/src/libraries/Common/src/System/Runtime/InteropServices/SuppressGCTransitionAttribute.internal.cs b/src/libraries/Common/src/System/Runtime/InteropServices/SuppressGCTransitionAttribute.internal.cs
deleted file mode 100644
index e9fbb73111d2..000000000000
--- a/src/libraries/Common/src/System/Runtime/InteropServices/SuppressGCTransitionAttribute.internal.cs
+++ /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.
-
-// Internal copy of SuppressGCTransitionAttribute used only to enable files
-// that use this to compile. On any platforms that support this attribute,
-// the real one exposed from CoreLib should be used.
-
-namespace System.Runtime.InteropServices
-{
- [AttributeUsage(AttributeTargets.Method)]
- internal sealed class SuppressGCTransitionAttribute : Attribute { }
-}
diff --git a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/PooledByteBufferWriter.cs b/src/libraries/Common/src/System/Text/Json/PooledByteBufferWriter.cs
similarity index 91%
rename from src/libraries/System.Text.Json/src/System/Text/Json/Serialization/PooledByteBufferWriter.cs
rename to src/libraries/Common/src/System/Text/Json/PooledByteBufferWriter.cs
index 3c3b5e169bd7..6d6feee2aec4 100644
--- a/src/libraries/System.Text.Json/src/System/Text/Json/Serialization/PooledByteBufferWriter.cs
+++ b/src/libraries/Common/src/System/Text/Json/PooledByteBufferWriter.cs
@@ -3,7 +3,9 @@
using System.Buffers;
using System.Diagnostics;
+using System.Diagnostics.CodeAnalysis;
using System.IO;
+using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
@@ -166,4 +168,14 @@ private void CheckAndResizeBuffer(int sizeHint)
Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
}
}
+
+ 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/System/Collections/IEnumerable.Generic.Serialization.Tests.cs b/src/libraries/Common/tests/System/Collections/IEnumerable.Generic.Serialization.Tests.cs
index aa20a9a68547..ce3bca0f9fb3 100644
--- a/src/libraries/Common/tests/System/Collections/IEnumerable.Generic.Serialization.Tests.cs
+++ b/src/libraries/Common/tests/System/Collections/IEnumerable.Generic.Serialization.Tests.cs
@@ -9,7 +9,7 @@ namespace System.Collections.Tests
{
public abstract partial class IEnumerable_Generic_Tests : TestBase
{
- [Theory]
+ [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported))]
[MemberData(nameof(ValidCollectionSizes))]
public void IGenericSharedAPI_SerializeDeserialize(int count)
{
diff --git a/src/libraries/Common/tests/System/Collections/IEnumerable.NonGeneric.Serialization.Tests.cs b/src/libraries/Common/tests/System/Collections/IEnumerable.NonGeneric.Serialization.Tests.cs
index 8fbdfd9cbe1b..8ad921ce7264 100644
--- a/src/libraries/Common/tests/System/Collections/IEnumerable.NonGeneric.Serialization.Tests.cs
+++ b/src/libraries/Common/tests/System/Collections/IEnumerable.NonGeneric.Serialization.Tests.cs
@@ -11,7 +11,7 @@ namespace System.Collections.Tests
{
public abstract partial class IEnumerable_NonGeneric_Tests : TestBase
{
- [Theory]
+ [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsBinaryFormatterSupported))]
[MemberData(nameof(ValidCollectionSizes))]
public void IGenericSharedAPI_SerializeDeserialize(int count)
{
diff --git a/src/libraries/Common/tests/System/IO/Compression/CompressionStreamUnitTestBase.cs b/src/libraries/Common/tests/System/IO/Compression/CompressionStreamUnitTestBase.cs
index e8aeadb85765..90a6c35c0f2a 100644
--- a/src/libraries/Common/tests/System/IO/Compression/CompressionStreamUnitTestBase.cs
+++ b/src/libraries/Common/tests/System/IO/Compression/CompressionStreamUnitTestBase.cs
@@ -14,7 +14,7 @@ public abstract class CompressionStreamUnitTestBase : CompressionStreamTestBase
{
private const int TaskTimeout = 30 * 1000; // Generous timeout for official test runs
- [Fact]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public virtual void FlushAsync_DuringWriteAsync()
{
if (FlushNoOps)
@@ -49,7 +49,7 @@ public virtual void FlushAsync_DuringWriteAsync()
}
}
- [Fact]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task FlushAsync_DuringReadAsync()
{
if (FlushNoOps)
@@ -78,7 +78,7 @@ public async Task FlushAsync_DuringReadAsync()
}
}
- [Fact]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task FlushAsync_DuringFlushAsync()
{
if (FlushNoOps)
@@ -121,7 +121,7 @@ public async Task FlushAsync_DuringFlushAsync()
}
}
- [Fact]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public virtual void WriteAsync_DuringWriteAsync()
{
byte[] buffer = new byte[100000];
@@ -154,7 +154,7 @@ public virtual void WriteAsync_DuringWriteAsync()
}
}
- [Fact]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task ReadAsync_DuringReadAsync()
{
byte[] buffer = new byte[32];
@@ -179,7 +179,7 @@ public async Task ReadAsync_DuringReadAsync()
}
}
- [Fact]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public virtual async Task Dispose_WithUnfinishedReadAsync()
{
string compressedPath = CompressedTestFile(UncompressedTestFile());
diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs
index a4a74cdc9ee4..a04299384915 100644
--- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs
+++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.Unix.cs
@@ -47,9 +47,9 @@ public static partial class PlatformDetection
public static bool IsNotFedoraOrRedHatFamily => !IsFedora && !IsRedHatFamily;
public static bool IsNotDebian10 => !IsDebian10;
- public static bool IsSuperUser => !IsWindows ?
+ public static bool IsSuperUser => IsBrowser ? false : (!IsWindows ?
libc.geteuid() == 0 :
- throw new PlatformNotSupportedException();
+ throw new PlatformNotSupportedException());
public static Version OpenSslVersion => !IsOSXLike && !IsWindows ?
GetOpenSslVersion() :
diff --git a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs
index 48a2f5ccfe32..68d07741e57a 100644
--- a/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs
+++ b/src/libraries/Common/tests/TestUtilities/System/PlatformDetection.cs
@@ -74,9 +74,9 @@ public static bool IsDrawingSupported
public static bool SupportsSsl2 => IsWindows && !PlatformDetection.IsWindows10Version1607OrGreater;
#if NETCOREAPP
- public static bool IsReflectionEmitSupported = RuntimeFeature.IsDynamicCodeSupported;
+ public static bool IsReflectionEmitSupported => RuntimeFeature.IsDynamicCodeSupported;
#else
- public static bool IsReflectionEmitSupported = true;
+ public static bool IsReflectionEmitSupported => true;
#endif
public static bool IsInvokingStaticConstructorsSupported => true;
diff --git a/src/libraries/Common/tests/Tests/System/StringTests.cs b/src/libraries/Common/tests/Tests/System/StringTests.cs
index 547e4fd249c0..74ceefc4cc6a 100644
--- a/src/libraries/Common/tests/Tests/System/StringTests.cs
+++ b/src/libraries/Common/tests/Tests/System/StringTests.cs
@@ -482,144 +482,149 @@ public static void CopyTo_Invalid()
AssertExtensions.Throws("sourceIndex", () => s.CopyTo(0, dst, 0, 6));
}
+ public static IEnumerable
+
+
+
+
+
+
diff --git a/src/libraries/Microsoft.Extensions.Configuration.CommandLine/src/Microsoft.Extensions.Configuration.CommandLine.csproj b/src/libraries/Microsoft.Extensions.Configuration.CommandLine/src/Microsoft.Extensions.Configuration.CommandLine.csproj
index 779f84028323..980c31e3b203 100644
--- a/src/libraries/Microsoft.Extensions.Configuration.CommandLine/src/Microsoft.Extensions.Configuration.CommandLine.csproj
+++ b/src/libraries/Microsoft.Extensions.Configuration.CommandLine/src/Microsoft.Extensions.Configuration.CommandLine.csproj
@@ -1,7 +1,8 @@
- netstandard2.0;$(DefaultNetCoreTargetFramework)
+ netstandard2.0;$(DefaultNetCoreTargetFramework);net461;$(NetFrameworkCurrent)
+ true
true
@@ -10,4 +11,8 @@
+
+
+
+
diff --git a/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/src/Microsoft.Extensions.Configuration.EnvironmentVariables.csproj b/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/src/Microsoft.Extensions.Configuration.EnvironmentVariables.csproj
index 0a40aca7a509..7debc9c3c30e 100644
--- a/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/src/Microsoft.Extensions.Configuration.EnvironmentVariables.csproj
+++ b/src/libraries/Microsoft.Extensions.Configuration.EnvironmentVariables/src/Microsoft.Extensions.Configuration.EnvironmentVariables.csproj
@@ -1,7 +1,8 @@
- netstandard2.0
+ netstandard2.0;net461;$(NetFrameworkCurrent)
+ true
true
@@ -10,4 +11,9 @@
+
+
+
+
+
diff --git a/src/libraries/Microsoft.Extensions.Configuration.FileExtensions/src/Microsoft.Extensions.Configuration.FileExtensions.csproj b/src/libraries/Microsoft.Extensions.Configuration.FileExtensions/src/Microsoft.Extensions.Configuration.FileExtensions.csproj
index 798c6584af88..9c7df603e519 100644
--- a/src/libraries/Microsoft.Extensions.Configuration.FileExtensions/src/Microsoft.Extensions.Configuration.FileExtensions.csproj
+++ b/src/libraries/Microsoft.Extensions.Configuration.FileExtensions/src/Microsoft.Extensions.Configuration.FileExtensions.csproj
@@ -1,7 +1,8 @@
- netstandard2.0
+ netstandard2.0;net461;$(NetFrameworkCurrent)
+ true
true
@@ -13,4 +14,8 @@
+
+
+
+
diff --git a/src/libraries/Microsoft.Extensions.Configuration.Ini/src/Microsoft.Extensions.Configuration.Ini.csproj b/src/libraries/Microsoft.Extensions.Configuration.Ini/src/Microsoft.Extensions.Configuration.Ini.csproj
index bcf7dc105d4d..88f10cc47d33 100644
--- a/src/libraries/Microsoft.Extensions.Configuration.Ini/src/Microsoft.Extensions.Configuration.Ini.csproj
+++ b/src/libraries/Microsoft.Extensions.Configuration.Ini/src/Microsoft.Extensions.Configuration.Ini.csproj
@@ -1,7 +1,8 @@
- netstandard2.0
+ netstandard2.0;net461;$(NetFrameworkCurrent)
+ true
true
@@ -12,4 +13,8 @@
+
+
+
+
diff --git a/src/libraries/Microsoft.Extensions.Configuration.Json/src/Microsoft.Extensions.Configuration.Json.csproj b/src/libraries/Microsoft.Extensions.Configuration.Json/src/Microsoft.Extensions.Configuration.Json.csproj
index f26210a6e991..d313804efd7d 100644
--- a/src/libraries/Microsoft.Extensions.Configuration.Json/src/Microsoft.Extensions.Configuration.Json.csproj
+++ b/src/libraries/Microsoft.Extensions.Configuration.Json/src/Microsoft.Extensions.Configuration.Json.csproj
@@ -1,7 +1,8 @@
- $(NetCoreAppCurrent);netstandard2.0
+ $(NetCoreAppCurrent);netstandard2.0;net461;$(NetFrameworkCurrent)
+ true
true
true
@@ -21,4 +22,10 @@
+
+
+
+
+
+
diff --git a/src/libraries/Microsoft.Extensions.Configuration.UserSecrets/src/Microsoft.Extensions.Configuration.UserSecrets.csproj b/src/libraries/Microsoft.Extensions.Configuration.UserSecrets/src/Microsoft.Extensions.Configuration.UserSecrets.csproj
index 654d0f9f53be..5df32c910337 100644
--- a/src/libraries/Microsoft.Extensions.Configuration.UserSecrets/src/Microsoft.Extensions.Configuration.UserSecrets.csproj
+++ b/src/libraries/Microsoft.Extensions.Configuration.UserSecrets/src/Microsoft.Extensions.Configuration.UserSecrets.csproj
@@ -1,7 +1,8 @@
- $(NetCoreAppCurrent);netstandard2.0
+ $(NetCoreAppCurrent);netstandard2.0;net461;$(NetFrameworkCurrent)
+ true
true
@@ -25,5 +26,8 @@
+
+
+
diff --git a/src/libraries/Microsoft.Extensions.Configuration.Xml/src/Microsoft.Extensions.Configuration.Xml.csproj b/src/libraries/Microsoft.Extensions.Configuration.Xml/src/Microsoft.Extensions.Configuration.Xml.csproj
index 33d909eeb983..9260eb9ec9d0 100644
--- a/src/libraries/Microsoft.Extensions.Configuration.Xml/src/Microsoft.Extensions.Configuration.Xml.csproj
+++ b/src/libraries/Microsoft.Extensions.Configuration.Xml/src/Microsoft.Extensions.Configuration.Xml.csproj
@@ -1,7 +1,8 @@
- $(NetCoreAppCurrent);netstandard2.0
+ $(NetCoreAppCurrent);netstandard2.0;net461;$(NetFrameworkCurrent)
+ true
true
@@ -20,4 +21,12 @@
+
+
+
+
+
+
+
+
diff --git a/src/libraries/Microsoft.Extensions.Configuration/src/Microsoft.Extensions.Configuration.csproj b/src/libraries/Microsoft.Extensions.Configuration/src/Microsoft.Extensions.Configuration.csproj
index 4a83026e0d99..0c4d78a16ea3 100644
--- a/src/libraries/Microsoft.Extensions.Configuration/src/Microsoft.Extensions.Configuration.csproj
+++ b/src/libraries/Microsoft.Extensions.Configuration/src/Microsoft.Extensions.Configuration.csproj
@@ -1,7 +1,8 @@
- netstandard2.0
+ netstandard2.0;net461;$(NetFrameworkCurrent)
+ true
true
@@ -10,4 +11,9 @@
+
+
+
+
+
diff --git a/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/Microsoft.Extensions.DependencyInjection.Abstractions.csproj b/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/Microsoft.Extensions.DependencyInjection.Abstractions.csproj
index 17654fa1889d..0d3119d83d6b 100644
--- a/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/Microsoft.Extensions.DependencyInjection.Abstractions.csproj
+++ b/src/libraries/Microsoft.Extensions.DependencyInjection.Abstractions/src/Microsoft.Extensions.DependencyInjection.Abstractions.csproj
@@ -1,7 +1,8 @@
- netstandard2.0
+ netstandard2.0;net461;$(NetFrameworkCurrent)
+ true
$(DefineConstants);ActivatorUtilities_In_DependencyInjection
true
enable
@@ -18,4 +19,10 @@
Link="Common\src\Extensions\ActivatorUtilities\ObjectFactory.cs" />
+
+
+
+
+
+
diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/ref/Microsoft.Extensions.DependencyModel.cs b/src/libraries/Microsoft.Extensions.DependencyModel/ref/Microsoft.Extensions.DependencyModel.cs
index 93477fdf17ec..7ca797e7d0a8 100644
--- a/src/libraries/Microsoft.Extensions.DependencyModel/ref/Microsoft.Extensions.DependencyModel.cs
+++ b/src/libraries/Microsoft.Extensions.DependencyModel/ref/Microsoft.Extensions.DependencyModel.cs
@@ -6,7 +6,7 @@
namespace Microsoft.DotNet.PlatformAbstractions
{
- [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)]
+ [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
[System.ObsoleteAttribute("This type is obsolete and will be removed in a future version. The recommended alternative is System.HashCode.")]
public partial struct HashCodeCombiner
{
diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/src/Microsoft.Extensions.DependencyModel.csproj b/src/libraries/Microsoft.Extensions.DependencyModel/src/Microsoft.Extensions.DependencyModel.csproj
index a164401909d9..b6794fc1c8e8 100644
--- a/src/libraries/Microsoft.Extensions.DependencyModel/src/Microsoft.Extensions.DependencyModel.csproj
+++ b/src/libraries/Microsoft.Extensions.DependencyModel/src/Microsoft.Extensions.DependencyModel.csproj
@@ -4,6 +4,10 @@
true
true
+
+
+ $(NuGetPackageRoot)\microsoft.targetingpack.netframework.v4.6.1\1.0.1\lib\net461\;$(AssemblySearchPaths)
+
-
+
+
diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/src/RuntimeLibrary.cs b/src/libraries/Microsoft.Extensions.DependencyModel/src/RuntimeLibrary.cs
index 336a57b9ed54..417d68f83490 100644
--- a/src/libraries/Microsoft.Extensions.DependencyModel/src/RuntimeLibrary.cs
+++ b/src/libraries/Microsoft.Extensions.DependencyModel/src/RuntimeLibrary.cs
@@ -58,6 +58,31 @@ public RuntimeLibrary(string type,
{
}
+
+ ///
+ /// Initializes a new .
+ ///
+ /// The library's type.
+ /// The library's name.
+ /// The library's version.
+ /// The library package's hash.
+ /// The library's runtime assemblies.
+ /// The library's native libraries.
+ /// The library's resource assemblies.
+ /// The library's dependencies.
+ /// Whether the library is serviceable.
+ /// The library package's path.
+ /// The library package's hash path.
+ /// The library's runtime store manifest name.
+ ///
+ /// The argument is null.
+ /// The argument is null.
+ /// The argument is null.
+ /// The argument is null.
+ /// The argument is null.
+ /// The argument is null.
+ /// The argument is null.
+ ///
public RuntimeLibrary(string type,
string name,
string version,
diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonReaderTest.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonReaderTest.cs
index cf3b27e965b7..ecafadcc0a9b 100644
--- a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonReaderTest.cs
+++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonReaderTest.cs
@@ -665,6 +665,46 @@ public void IgnoresUnknownPropertiesInRuntimeTargets()
.Which.AssetPaths.Should().BeEmpty();
}
+ [Fact]
+ public void ReadsRuntimePackLibrary()
+ {
+ var context = Read(
+@"{
+ ""runtimeTarget"": {
+ ""name"": "".NETCoreApp,Version=v5.0/win-x86"",
+ ""signature"": """"
+ },
+ ""targets"": {
+ "".NETCoreApp,Version=v5.0/win-x86"": {
+ ""runtimepack.Microsoft.NETCore.App.Runtime.win-x86/5.0.0-preview.5.20251.1"": {
+ ""runtime"": {
+ ""System.Private.CoreLib.dll"": {
+ ""assemblyVersion"": ""5.0.0.0"",
+ ""fileVersion"": ""5.0.20.25101""
+ }
+ },
+ ""native"": {
+ ""coreclr.dll"": {
+ ""fileVersion"": ""5.0.20.25101""
+ }
+ }
+ }
+ }
+ },
+ ""libraries"": {
+ ""runtimepack.Microsoft.NETCore.App.Runtime.win-x86/5.0.0-preview.5.20251.1"": {
+ ""type"": ""runtimepack"",
+ ""serviceable"": false,
+ ""sha512"": """"
+ }
+ }
+}");
+
+ var runtimeLibrary = context.RuntimeLibraries.Should().ContainSingle().Subject;
+ runtimeLibrary.Type.Should().Be("runtimepack");
+ runtimeLibrary.Serviceable.Should().Be(false);
+ }
+
[Fact]
public void ReadsCompilationOptions()
{
diff --git a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonWriterTests.cs b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonWriterTests.cs
index 0762b3ef3db2..c6c752c6fbb0 100644
--- a/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonWriterTests.cs
+++ b/src/libraries/Microsoft.Extensions.DependencyModel/tests/DependencyContextJsonWriterTests.cs
@@ -299,6 +299,68 @@ private JObject WritesRuntimeLibrariesToRuntimeTargetCore(RuntimeAssetGroup grou
return runtimeAssembly;
}
+ [Fact]
+ public void WritesRuntimePackLibrariesWithFrameworkName()
+ {
+ var result = Save(Create(
+ "Target",
+ "win-x86",
+ false,
+ runtimeLibraries: new[]
+ {
+ new RuntimeLibrary(
+ "runtimepack",
+ "RuntimePackName",
+ "1.2.3",
+ "HASH",
+ new [] {
+ new RuntimeAssetGroup(
+ string.Empty,
+ new []
+ {
+ new RuntimeFile("System.Private.CoreLib.dll", "2.3.4", "3.4.5"),
+ }),
+ },
+ new [] {
+ new RuntimeAssetGroup(
+ string.Empty,
+ new []
+ {
+ new RuntimeFile("coreclr.dll", "4.5.6", "5.6.7"),
+ }),
+ },
+ new ResourceAssembly[0],
+ new Dependency[0],
+ false,
+ "PackagePath",
+ "PackageHashPath",
+ "placeHolderManifest.xml"
+ ),
+ }));
+
+ // targets
+ var targets = result.Should().HavePropertyAsObject("targets").Subject;
+ var target = targets.Should().HavePropertyAsObject("Target/win-x86").Subject;
+ var library = target.Should().HavePropertyAsObject("RuntimePackName/1.2.3").Subject;
+ library.Should().NotHaveProperty("dependencies");
+ library.Should().NotHaveProperty("resources");
+
+ library.Should().HavePropertyAsObject("runtime")
+ .Subject.Should().HaveProperty("System.Private.CoreLib.dll");
+ library.Should().HavePropertyAsObject("native")
+ .Subject.Should().HaveProperty("coreclr.dll");
+
+ //libraries
+ var libraries = result.Should().HavePropertyAsObject("libraries").Subject;
+ library = libraries.Should().HavePropertyAsObject("RuntimePackName/1.2.3").Subject;
+ library.Should().HavePropertyValue("sha512", "HASH");
+ library.Should().HavePropertyValue("type", "runtimepack");
+ library.Should().HavePropertyValue("serviceable", false);
+ library.Should().HavePropertyValue("path", "PackagePath");
+ library.Should().HavePropertyValue("hashPath", "PackageHashPath");
+ library.Should().HavePropertyValue("runtimeStoreManifestName", "placeHolderManifest.xml");
+ }
+
[Fact]
public void MergesRuntimeAndCompileLibrariesForPortable()
{
diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Abstractions/src/Microsoft.Extensions.FileProviders.Abstractions.csproj b/src/libraries/Microsoft.Extensions.FileProviders.Abstractions/src/Microsoft.Extensions.FileProviders.Abstractions.csproj
index c165dfa6e216..8c16ef3ce824 100644
--- a/src/libraries/Microsoft.Extensions.FileProviders.Abstractions/src/Microsoft.Extensions.FileProviders.Abstractions.csproj
+++ b/src/libraries/Microsoft.Extensions.FileProviders.Abstractions/src/Microsoft.Extensions.FileProviders.Abstractions.csproj
@@ -2,7 +2,8 @@
Microsoft.Extensions.FileProviders
- netstandard2.0
+ netstandard2.0;net461;$(NetFrameworkCurrent)
+ true
true
@@ -16,4 +17,9 @@
+
+
+
+
+
diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Composite/src/Microsoft.Extensions.FileProviders.Composite.csproj b/src/libraries/Microsoft.Extensions.FileProviders.Composite/src/Microsoft.Extensions.FileProviders.Composite.csproj
index b9d2299128c3..898fe2fbd58c 100644
--- a/src/libraries/Microsoft.Extensions.FileProviders.Composite/src/Microsoft.Extensions.FileProviders.Composite.csproj
+++ b/src/libraries/Microsoft.Extensions.FileProviders.Composite/src/Microsoft.Extensions.FileProviders.Composite.csproj
@@ -2,7 +2,8 @@
Microsoft.Extensions.FileProviders
- netstandard2.0
+ netstandard2.0;net461;$(NetFrameworkCurrent)
+ true
true
@@ -11,4 +12,9 @@
+
+
+
+
+
diff --git a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/Microsoft.Extensions.FileProviders.Physical.csproj b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/Microsoft.Extensions.FileProviders.Physical.csproj
index 865c7a92183e..ba390655fe15 100644
--- a/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/Microsoft.Extensions.FileProviders.Physical.csproj
+++ b/src/libraries/Microsoft.Extensions.FileProviders.Physical/src/Microsoft.Extensions.FileProviders.Physical.csproj
@@ -2,11 +2,17 @@
Microsoft.Extensions.FileProviders
- netstandard2.0
+ netstandard2.0;net461;$(NetFrameworkCurrent)
+ true
true
true
+
+
+ $(NuGetPackageRoot)\microsoft.targetingpack.netframework.v4.6.1\1.0.1\lib\net461\;$(AssemblySearchPaths)
+
+
@@ -20,4 +26,12 @@
+
+
+
+
+
+
+
+
diff --git a/src/libraries/Microsoft.Extensions.FileSystemGlobbing/src/Microsoft.Extensions.FileSystemGlobbing.csproj b/src/libraries/Microsoft.Extensions.FileSystemGlobbing/src/Microsoft.Extensions.FileSystemGlobbing.csproj
index 4bb4e62e3d33..ab4b23464b4d 100644
--- a/src/libraries/Microsoft.Extensions.FileSystemGlobbing/src/Microsoft.Extensions.FileSystemGlobbing.csproj
+++ b/src/libraries/Microsoft.Extensions.FileSystemGlobbing/src/Microsoft.Extensions.FileSystemGlobbing.csproj
@@ -1,7 +1,8 @@
- netstandard2.0
+ netstandard2.0;net461;$(NetFrameworkCurrent)
+ true
true
@@ -10,4 +11,10 @@
Link="Common\src\Extensions\HashCodeCombiner\HashCodeCombiner.cs" />
+
+
+
+
+
+
diff --git a/src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/HostingAbstractionsHostExtensions.cs b/src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/HostingAbstractionsHostExtensions.cs
index ac0368b913c0..f97c65284b1d 100644
--- a/src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/HostingAbstractionsHostExtensions.cs
+++ b/src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/HostingAbstractionsHostExtensions.cs
@@ -26,9 +26,10 @@ public static void Start(this IHost host)
/// The timeout for stopping gracefully. Once expired the
/// server may terminate any remaining active connections.
/// The that represents the asynchronous operation.
- public static Task StopAsync(this IHost host, TimeSpan timeout)
+ public static async Task StopAsync(this IHost host, TimeSpan timeout)
{
- return host.StopAsync(new CancellationTokenSource(timeout).Token);
+ using CancellationTokenSource cts = new CancellationTokenSource(timeout);
+ await host.StopAsync(cts.Token).ConfigureAwait(false);
}
///
@@ -103,7 +104,8 @@ public static async Task WaitForShutdownAsync(this IHost host, CancellationToken
await waitForStop.Task.ConfigureAwait(false);
// Host will use its default ShutdownTimeout if none is specified.
- await host.StopAsync().ConfigureAwait(false);
+ // The cancellation token may have been triggered to unblock waitForStop. Don't pass it here because that would trigger an abortive shutdown.
+ await host.StopAsync(CancellationToken.None).ConfigureAwait(false);
}
}
}
diff --git a/src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/Microsoft.Extensions.Hosting.Abstractions.csproj b/src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/Microsoft.Extensions.Hosting.Abstractions.csproj
index 04ca6e349f2e..3de7d53d9c9e 100644
--- a/src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/Microsoft.Extensions.Hosting.Abstractions.csproj
+++ b/src/libraries/Microsoft.Extensions.Hosting.Abstractions/src/Microsoft.Extensions.Hosting.Abstractions.csproj
@@ -1,7 +1,8 @@
- $(NetCoreAppCurrent);netstandard2.0
+ $(NetCoreAppCurrent);netstandard2.0;net461;$(NetFrameworkCurrent)
+ true
Microsoft.Extensions.Hosting
true
@@ -15,9 +16,13 @@
-
+
+
+
+
+
diff --git a/src/libraries/Microsoft.Extensions.Hosting/src/Microsoft.Extensions.Hosting.csproj b/src/libraries/Microsoft.Extensions.Hosting/src/Microsoft.Extensions.Hosting.csproj
index 86257a71d216..d384aae9cc35 100644
--- a/src/libraries/Microsoft.Extensions.Hosting/src/Microsoft.Extensions.Hosting.csproj
+++ b/src/libraries/Microsoft.Extensions.Hosting/src/Microsoft.Extensions.Hosting.csproj
@@ -1,9 +1,14 @@
- $(NetCoreAppCurrent);netstandard2.0;netstandard2.1
+ $(NetCoreAppCurrent);netstandard2.0;netstandard2.1;net461;$(NetFrameworkCurrent)
+ true
true
+
+
+ $(NuGetPackageRoot)\microsoft.targetingpack.netframework.v4.6.1\1.0.1\lib\net461\;$(AssemblySearchPaths)
+
@@ -40,9 +45,16 @@
-
+
+
+
+
+
+
+
+
diff --git a/src/libraries/Microsoft.Extensions.Http/src/Microsoft.Extensions.Http.csproj b/src/libraries/Microsoft.Extensions.Http/src/Microsoft.Extensions.Http.csproj
index 5fb5c618016b..47eeebc131c9 100644
--- a/src/libraries/Microsoft.Extensions.Http/src/Microsoft.Extensions.Http.csproj
+++ b/src/libraries/Microsoft.Extensions.Http/src/Microsoft.Extensions.Http.csproj
@@ -1,9 +1,14 @@
- netstandard2.0
+ netstandard2.0;net461;$(NetFrameworkCurrent)
+ true
true
+
+
+ $(NuGetPackageRoot)\microsoft.targetingpack.netframework.v4.6.1\1.0.1\lib\net461\;$(AssemblySearchPaths)
+
+
+
+
+
+
+
+
diff --git a/src/libraries/Microsoft.Extensions.Logging.Abstractions/ref/Microsoft.Extensions.Logging.Abstractions.cs b/src/libraries/Microsoft.Extensions.Logging.Abstractions/ref/Microsoft.Extensions.Logging.Abstractions.cs
index aa32585b1a76..ce0feb995008 100644
--- a/src/libraries/Microsoft.Extensions.Logging.Abstractions/ref/Microsoft.Extensions.Logging.Abstractions.cs
+++ b/src/libraries/Microsoft.Extensions.Logging.Abstractions/ref/Microsoft.Extensions.Logging.Abstractions.cs
@@ -125,6 +125,19 @@ public enum LogLevel
}
namespace Microsoft.Extensions.Logging.Abstractions
{
+ public readonly partial struct LogEntry
+ {
+ private readonly TState _State_k__BackingField;
+ private readonly object _dummy;
+ private readonly int _dummyPrimitive;
+ public LogEntry(Microsoft.Extensions.Logging.LogLevel logLevel, string category, Microsoft.Extensions.Logging.EventId eventId, TState state, System.Exception exception, System.Func formatter) { throw null; }
+ public string Category { get { throw null; } }
+ public Microsoft.Extensions.Logging.EventId EventId { get { throw null; } }
+ public System.Exception Exception { get { throw null; } }
+ public System.Func Formatter { get { throw null; } }
+ public Microsoft.Extensions.Logging.LogLevel LogLevel { get { throw null; } }
+ public TState State { get { throw null; } }
+ }
public partial class NullLogger : Microsoft.Extensions.Logging.ILogger
{
internal NullLogger() { }
diff --git a/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/LogEntry.cs b/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/LogEntry.cs
new file mode 100644
index 000000000000..e0cab847a156
--- /dev/null
+++ b/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/LogEntry.cs
@@ -0,0 +1,62 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using System;
+
+namespace Microsoft.Extensions.Logging.Abstractions
+{
+ ///
+ /// Holds the information for a single log entry.
+ ///
+ public readonly struct LogEntry
+ {
+ ///
+ /// Initializes an instance of the LogEntry struct.
+ ///
+ /// The log level.
+ /// The category name for the log.
+ /// The log event Id.
+ /// The state for which log is being written.
+ /// The log exception.
+ /// The formatter.
+ public LogEntry(LogLevel logLevel, string category, EventId eventId, TState state, Exception exception, Func formatter)
+ {
+ LogLevel = logLevel;
+ Category = category;
+ EventId = eventId;
+ State = state;
+ Exception = exception;
+ Formatter = formatter;
+ }
+
+ ///
+ /// Gets the LogLevel
+ ///
+ public LogLevel LogLevel { get; }
+
+ ///
+ /// Gets the log category
+ ///
+ public string Category { get; }
+
+ ///
+ /// Gets the log EventId
+ ///
+ public EventId EventId { get; }
+
+ ///
+ /// Gets the TState
+ ///
+ public TState State { get; }
+
+ ///
+ /// Gets the log exception
+ ///
+ public Exception Exception { get; }
+
+ ///
+ /// Gets the formatter
+ ///
+ public Func Formatter { get; }
+ }
+}
diff --git a/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/Microsoft.Extensions.Logging.Abstractions.csproj b/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/Microsoft.Extensions.Logging.Abstractions.csproj
index 5896926dec8d..1462166794f3 100644
--- a/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/Microsoft.Extensions.Logging.Abstractions.csproj
+++ b/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/Microsoft.Extensions.Logging.Abstractions.csproj
@@ -1,7 +1,8 @@
- netstandard2.0
+ netstandard2.0;net461;$(NetFrameworkCurrent)
+ true
true
@@ -14,4 +15,9 @@
Link="Common\src\Extensions\Logging\NullScope.cs" />
+
+
+
+
+
diff --git a/src/libraries/Microsoft.Extensions.Logging.Configuration/src/Microsoft.Extensions.Logging.Configuration.csproj b/src/libraries/Microsoft.Extensions.Logging.Configuration/src/Microsoft.Extensions.Logging.Configuration.csproj
index d45b23a82569..31d6673acd76 100644
--- a/src/libraries/Microsoft.Extensions.Logging.Configuration/src/Microsoft.Extensions.Logging.Configuration.csproj
+++ b/src/libraries/Microsoft.Extensions.Logging.Configuration/src/Microsoft.Extensions.Logging.Configuration.csproj
@@ -1,7 +1,8 @@
- $(NetCoreAppCurrent);netstandard2.0
+ $(NetCoreAppCurrent);netstandard2.0;net461;$(NetFrameworkCurrent)
+ true
true
@@ -26,4 +27,8 @@
+
+
+
+
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/Microsoft.Extensions.Logging.Console.sln b/src/libraries/Microsoft.Extensions.Logging.Console/Microsoft.Extensions.Logging.Console.sln
index 67d90a8d3639..a7cab36d8df3 100644
--- a/src/libraries/Microsoft.Extensions.Logging.Console/Microsoft.Extensions.Logging.Console.sln
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/Microsoft.Extensions.Logging.Console.sln
@@ -11,6 +11,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Loggin
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Logging.Console", "src\Microsoft.Extensions.Logging.Console.csproj", "{CDEDF61A-4D74-4EAA-B31E-AF5CAAA7B974}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{56A299FB-3733-4AF5-AE10-66AB73D6FC13}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Logging.Console.Tests", "tests\Microsoft.Extensions.Logging.Console.Tests.csproj", "{9B344154-013F-4D6B-99A5-77DFA1CB8CC0}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -25,6 +29,10 @@ Global
{CDEDF61A-4D74-4EAA-B31E-AF5CAAA7B974}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CDEDF61A-4D74-4EAA-B31E-AF5CAAA7B974}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CDEDF61A-4D74-4EAA-B31E-AF5CAAA7B974}.Release|Any CPU.Build.0 = Release|Any CPU
+ {9B344154-013F-4D6B-99A5-77DFA1CB8CC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {9B344154-013F-4D6B-99A5-77DFA1CB8CC0}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9B344154-013F-4D6B-99A5-77DFA1CB8CC0}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {9B344154-013F-4D6B-99A5-77DFA1CB8CC0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -32,6 +40,7 @@ Global
GlobalSection(NestedProjects) = preSolution
{6D191D5A-572C-4BFA-B73B-C24AF80E8016} = {A12B6049-11A7-4E2B-857B-620B917B4A46}
{CDEDF61A-4D74-4EAA-B31E-AF5CAAA7B974} = {A1F1D16A-5787-45E5-AF85-617702C216C6}
+ {9B344154-013F-4D6B-99A5-77DFA1CB8CC0} = {56A299FB-3733-4AF5-AE10-66AB73D6FC13}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E75E4D9D-8919-409F-8FF1-67DD9C346EA7}
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/ref/Microsoft.Extensions.Logging.Console.cs b/src/libraries/Microsoft.Extensions.Logging.Console/ref/Microsoft.Extensions.Logging.Console.cs
index 105b55c70d0d..13f7dfa6c3bd 100644
--- a/src/libraries/Microsoft.Extensions.Logging.Console/ref/Microsoft.Extensions.Logging.Console.cs
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/ref/Microsoft.Extensions.Logging.Console.cs
@@ -10,10 +10,35 @@ public static partial class ConsoleLoggerExtensions
{
public static Microsoft.Extensions.Logging.ILoggingBuilder AddConsole(this Microsoft.Extensions.Logging.ILoggingBuilder builder) { throw null; }
public static Microsoft.Extensions.Logging.ILoggingBuilder AddConsole(this Microsoft.Extensions.Logging.ILoggingBuilder builder, System.Action configure) { throw null; }
+ public static Microsoft.Extensions.Logging.ILoggingBuilder AddConsoleFormatter(this Microsoft.Extensions.Logging.ILoggingBuilder builder) where TFormatter : Microsoft.Extensions.Logging.Console.ConsoleFormatter where TOptions : Microsoft.Extensions.Logging.Console.ConsoleFormatterOptions { throw null; }
+ public static Microsoft.Extensions.Logging.ILoggingBuilder AddConsoleFormatter(this Microsoft.Extensions.Logging.ILoggingBuilder builder, System.Action configure) where TFormatter : Microsoft.Extensions.Logging.Console.ConsoleFormatter where TOptions : Microsoft.Extensions.Logging.Console.ConsoleFormatterOptions { throw null; }
+ public static Microsoft.Extensions.Logging.ILoggingBuilder AddJsonConsole(this Microsoft.Extensions.Logging.ILoggingBuilder builder, System.Action configure) { throw null; }
+ public static Microsoft.Extensions.Logging.ILoggingBuilder AddSimpleConsole(this Microsoft.Extensions.Logging.ILoggingBuilder builder, System.Action configure) { throw null; }
+ public static Microsoft.Extensions.Logging.ILoggingBuilder AddSystemdConsole(this Microsoft.Extensions.Logging.ILoggingBuilder builder, System.Action configure) { throw null; }
}
}
namespace Microsoft.Extensions.Logging.Console
{
+ public abstract partial class ConsoleFormatter
+ {
+ protected ConsoleFormatter(string name) { }
+ public string Name { get { throw null; } }
+ public abstract void Write(in Microsoft.Extensions.Logging.Abstractions.LogEntry logEntry, Microsoft.Extensions.Logging.IExternalScopeProvider scopeProvider, System.IO.TextWriter textWriter);
+ }
+ public static partial class ConsoleFormatterNames
+ {
+ public const string Json = "json";
+ public const string Simple = "simple";
+ public const string Systemd = "systemd";
+ }
+ public partial class ConsoleFormatterOptions
+ {
+ public ConsoleFormatterOptions() { }
+ public bool IncludeScopes { get { throw null; } set { } }
+ public string TimestampFormat { get { throw null; } set { } }
+ public bool UseUtcTimestamp { get { throw null; } set { } }
+ }
+ [System.ObsoleteAttribute("ConsoleLoggerFormat has been deprecated.", false)]
public enum ConsoleLoggerFormat
{
Default = 0,
@@ -22,19 +47,37 @@ public enum ConsoleLoggerFormat
public partial class ConsoleLoggerOptions
{
public ConsoleLoggerOptions() { }
+ [System.ObsoleteAttribute("ConsoleLoggerOptions.DisableColors has been deprecated. Please use SimpleConsoleFormatterOptions.DisableColors instead.", false)]
public bool DisableColors { get { throw null; } set { } }
+ [System.ObsoleteAttribute("ConsoleLoggerOptions.Format has been deprecated. Please use ConsoleLoggerOptions.FormatterName instead.", false)]
public Microsoft.Extensions.Logging.Console.ConsoleLoggerFormat Format { get { throw null; } set { } }
+ public string FormatterName { get { throw null; } set { } }
+ [System.ObsoleteAttribute("ConsoleLoggerOptions.IncludeScopes has been deprecated. Please use ConsoleFormatterOptions.IncludeScopes instead.", false)]
public bool IncludeScopes { get { throw null; } set { } }
public Microsoft.Extensions.Logging.LogLevel LogToStandardErrorThreshold { get { throw null; } set { } }
+ [System.ObsoleteAttribute("ConsoleLoggerOptions.TimestampFormat has been deprecated. Please use ConsoleFormatterOptions.TimestampFormat instead.", false)]
public string TimestampFormat { get { throw null; } set { } }
+ [System.ObsoleteAttribute("ConsoleLoggerOptions.UseUtcTimestamp has been deprecated. Please use ConsoleFormatterOptions.UseUtcTimestamp instead.", false)]
public bool UseUtcTimestamp { get { throw null; } set { } }
}
[Microsoft.Extensions.Logging.ProviderAliasAttribute("Console")]
public partial class ConsoleLoggerProvider : Microsoft.Extensions.Logging.ILoggerProvider, Microsoft.Extensions.Logging.ISupportExternalScope, System.IDisposable
{
public ConsoleLoggerProvider(Microsoft.Extensions.Options.IOptionsMonitor options) { }
+ public ConsoleLoggerProvider(Microsoft.Extensions.Options.IOptionsMonitor options, System.Collections.Generic.IEnumerable formatters) { }
public Microsoft.Extensions.Logging.ILogger CreateLogger(string name) { throw null; }
public void Dispose() { }
public void SetScopeProvider(Microsoft.Extensions.Logging.IExternalScopeProvider scopeProvider) { }
}
+ public partial class JsonConsoleFormatterOptions : Microsoft.Extensions.Logging.Console.ConsoleFormatterOptions
+ {
+ public JsonConsoleFormatterOptions() { }
+ public System.Text.Json.JsonWriterOptions JsonWriterOptions { get { throw null; } set { } }
+ }
+ public partial class SimpleConsoleFormatterOptions : Microsoft.Extensions.Logging.Console.ConsoleFormatterOptions
+ {
+ public SimpleConsoleFormatterOptions() { }
+ public bool DisableColors { get { throw null; } set { } }
+ public bool SingleLine { get { throw null; } set { } }
+ }
}
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/ref/Microsoft.Extensions.Logging.Console.csproj b/src/libraries/Microsoft.Extensions.Logging.Console/ref/Microsoft.Extensions.Logging.Console.csproj
index 17f4ef6d337e..0756d569fde5 100644
--- a/src/libraries/Microsoft.Extensions.Logging.Console/ref/Microsoft.Extensions.Logging.Console.csproj
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/ref/Microsoft.Extensions.Logging.Console.csproj
@@ -5,6 +5,7 @@
+
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiLogConsole.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiLogConsole.cs
index a2413615e551..9943da694c28 100644
--- a/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiLogConsole.cs
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiLogConsole.cs
@@ -1,125 +1,25 @@
// 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.Text;
+using System.IO;
namespace Microsoft.Extensions.Logging.Console
{
///
- /// For non-Windows platform consoles which understand the ANSI escape code sequences to represent color
+ /// For consoles which understand the ANSI escape code sequences to represent color
///
internal class AnsiLogConsole : IConsole
{
- private readonly StringBuilder _outputBuilder;
- private readonly IAnsiSystemConsole _systemConsole;
+ private readonly TextWriter _textWriter;
- public AnsiLogConsole(IAnsiSystemConsole systemConsole)
+ public AnsiLogConsole(bool stdErr = false)
{
- _outputBuilder = new StringBuilder();
- _systemConsole = systemConsole;
+ _textWriter = stdErr ? System.Console.Error : System.Console.Out;
}
- public void Write(string message, ConsoleColor? background, ConsoleColor? foreground)
+ public void Write(string message)
{
- // Order: backgroundcolor, foregroundcolor, Message, reset foregroundcolor, reset backgroundcolor
- if (background.HasValue)
- {
- _outputBuilder.Append(GetBackgroundColorEscapeCode(background.Value));
- }
-
- if (foreground.HasValue)
- {
- _outputBuilder.Append(GetForegroundColorEscapeCode(foreground.Value));
- }
-
- _outputBuilder.Append(message);
-
- if (foreground.HasValue)
- {
- _outputBuilder.Append("\x1B[39m\x1B[22m"); // reset to default foreground color
- }
-
- if (background.HasValue)
- {
- _outputBuilder.Append("\x1B[49m"); // reset to the background color
- }
- }
-
- public void WriteLine(string message, ConsoleColor? background, ConsoleColor? foreground)
- {
- Write(message, background, foreground);
- _outputBuilder.AppendLine();
- }
-
- public void Flush()
- {
- _systemConsole.Write(_outputBuilder.ToString());
- _outputBuilder.Clear();
- }
-
- private static string GetForegroundColorEscapeCode(ConsoleColor color)
- {
- switch (color)
- {
- case ConsoleColor.Black:
- return "\x1B[30m";
- case ConsoleColor.DarkRed:
- return "\x1B[31m";
- case ConsoleColor.DarkGreen:
- return "\x1B[32m";
- case ConsoleColor.DarkYellow:
- return "\x1B[33m";
- case ConsoleColor.DarkBlue:
- return "\x1B[34m";
- case ConsoleColor.DarkMagenta:
- return "\x1B[35m";
- case ConsoleColor.DarkCyan:
- return "\x1B[36m";
- case ConsoleColor.Gray:
- return "\x1B[37m";
- case ConsoleColor.Red:
- return "\x1B[1m\x1B[31m";
- case ConsoleColor.Green:
- return "\x1B[1m\x1B[32m";
- case ConsoleColor.Yellow:
- return "\x1B[1m\x1B[33m";
- case ConsoleColor.Blue:
- return "\x1B[1m\x1B[34m";
- case ConsoleColor.Magenta:
- return "\x1B[1m\x1B[35m";
- case ConsoleColor.Cyan:
- return "\x1B[1m\x1B[36m";
- case ConsoleColor.White:
- return "\x1B[1m\x1B[37m";
- default:
- return "\x1B[39m\x1B[22m"; // default foreground color
- }
- }
-
- private static string GetBackgroundColorEscapeCode(ConsoleColor color)
- {
- switch (color)
- {
- case ConsoleColor.Black:
- return "\x1B[40m";
- case ConsoleColor.Red:
- return "\x1B[41m";
- case ConsoleColor.Green:
- return "\x1B[42m";
- case ConsoleColor.Yellow:
- return "\x1B[43m";
- case ConsoleColor.Blue:
- return "\x1B[44m";
- case ConsoleColor.Magenta:
- return "\x1B[45m";
- case ConsoleColor.Cyan:
- return "\x1B[46m";
- case ConsoleColor.White:
- return "\x1B[47m";
- default:
- return "\x1B[49m"; // Use default background color
- }
+ _textWriter.Write(message);
}
}
}
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiParser.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiParser.cs
new file mode 100644
index 000000000000..665093b40866
--- /dev/null
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiParser.cs
@@ -0,0 +1,207 @@
+// 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.IO;
+
+namespace Microsoft.Extensions.Logging.Console
+{
+ internal class AnsiParser
+ {
+ private readonly Action _onParseWrite;
+ public AnsiParser(Action onParseWrite)
+ {
+ if (onParseWrite == null)
+ {
+ throw new ArgumentNullException(nameof(onParseWrite));
+ }
+ _onParseWrite = onParseWrite;
+ }
+
+ ///
+ /// Parses a subset of display attributes
+ /// Set Display Attributes
+ /// Set Attribute Mode [{attr1};...;{attrn}m
+ /// Sets multiple display attribute settings. The following lists standard attributes that are getting parsed:
+ /// 1 Bright
+ /// Foreground Colours
+ /// 30 Black
+ /// 31 Red
+ /// 32 Green
+ /// 33 Yellow
+ /// 34 Blue
+ /// 35 Magenta
+ /// 36 Cyan
+ /// 37 White
+ /// Background Colours
+ /// 40 Black
+ /// 41 Red
+ /// 42 Green
+ /// 43 Yellow
+ /// 44 Blue
+ /// 45 Magenta
+ /// 46 Cyan
+ /// 47 White
+ ///
+ public void Parse(string message)
+ {
+ int startIndex = -1;
+ int length = 0;
+ ConsoleColor? foreground = null;
+ ConsoleColor? background = null;
+ var span = message.AsSpan();
+ const char EscapeChar = '\x1B';
+ ConsoleColor? color = null;
+ bool isBright = false;
+ for (int i = 0; i < span.Length; i++)
+ {
+ if (span[i] == EscapeChar && span.Length >= i + 4 && span[i + 1] == '[')
+ {
+ if (span[i + 3] == 'm')
+ {
+#if NETCOREAPP
+ if (ushort.TryParse(span.Slice(i + 2, length: 1), out ushort escapeCode))
+#else
+ if (ushort.TryParse(span.Slice(i + 2, length: 1).ToString(), out ushort escapeCode))
+#endif
+ {
+ if (startIndex != -1)
+ {
+ _onParseWrite(message, startIndex, length, background, foreground);
+ startIndex = -1;
+ length = 0;
+ }
+ if (escapeCode == 1)
+ isBright = true;
+ i += 3;
+ continue;
+ }
+ }
+ else if (span.Length >= i + 5 && span[i + 4] == 'm')
+ {
+#if NETCOREAPP
+ if (ushort.TryParse(span.Slice(i + 2, length: 2), out ushort escapeCode))
+#else
+ if (ushort.TryParse(span.Slice(i + 2, length: 2).ToString(), out ushort escapeCode))
+#endif
+ {
+ if (startIndex != -1)
+ {
+ _onParseWrite(message, startIndex, length, background, foreground);
+ startIndex = -1;
+ length = 0;
+ }
+ if (TryGetForegroundColor(escapeCode, isBright, out color))
+ {
+ foreground = color;
+ isBright = false;
+ }
+ else if (TryGetBackgroundColor(escapeCode, out color))
+ {
+ background = color;
+ }
+ i += 4;
+ continue;
+ }
+ }
+ }
+ if (startIndex == -1)
+ {
+ startIndex = i;
+ }
+ int nextEscapeIndex = -1;
+ if (i < message.Length - 1)
+ {
+ nextEscapeIndex = message.IndexOf(EscapeChar, i + 1);
+ }
+ if (nextEscapeIndex < 0)
+ {
+ length = message.Length - startIndex;
+ break;
+ }
+ length = nextEscapeIndex - startIndex;
+ i = nextEscapeIndex - 1;
+ }
+ if (startIndex != -1)
+ {
+ _onParseWrite(message, startIndex, length, background, foreground);
+ }
+ }
+
+ internal const string DefaultForegroundColor = "\x1B[39m\x1B[22m"; // reset to default foreground color
+ internal const string DefaultBackgroundColor = "\x1B[49m"; // reset to the background color
+
+ internal static string GetForegroundColorEscapeCode(ConsoleColor color)
+ {
+ return color switch
+ {
+ ConsoleColor.Black => "\x1B[30m",
+ ConsoleColor.DarkRed => "\x1B[31m",
+ ConsoleColor.DarkGreen => "\x1B[32m",
+ ConsoleColor.DarkYellow => "\x1B[33m",
+ ConsoleColor.DarkBlue => "\x1B[34m",
+ ConsoleColor.DarkMagenta => "\x1B[35m",
+ ConsoleColor.DarkCyan => "\x1B[36m",
+ ConsoleColor.Gray => "\x1B[37m",
+ ConsoleColor.Red => "\x1B[1m\x1B[31m",
+ ConsoleColor.Green => "\x1B[1m\x1B[32m",
+ ConsoleColor.Yellow => "\x1B[1m\x1B[33m",
+ ConsoleColor.Blue => "\x1B[1m\x1B[34m",
+ ConsoleColor.Magenta => "\x1B[1m\x1B[35m",
+ ConsoleColor.Cyan => "\x1B[1m\x1B[36m",
+ ConsoleColor.White => "\x1B[1m\x1B[37m",
+ _ => DefaultForegroundColor // default foreground color
+ };
+ }
+
+ internal static string GetBackgroundColorEscapeCode(ConsoleColor color)
+ {
+ return color switch
+ {
+ ConsoleColor.Black => "\x1B[40m",
+ ConsoleColor.DarkRed => "\x1B[41m",
+ ConsoleColor.DarkGreen => "\x1B[42m",
+ ConsoleColor.DarkYellow => "\x1B[43m",
+ ConsoleColor.DarkBlue => "\x1B[44m",
+ ConsoleColor.DarkMagenta => "\x1B[45m",
+ ConsoleColor.DarkCyan => "\x1B[46m",
+ ConsoleColor.Gray => "\x1B[47m",
+ _ => DefaultBackgroundColor // Use default background color
+ };
+ }
+
+ private static bool TryGetForegroundColor(int number, bool isBright, out ConsoleColor? color)
+ {
+ color = number switch
+ {
+ 30 => ConsoleColor.Black,
+ 31 => isBright ? ConsoleColor.Red: ConsoleColor.DarkRed,
+ 32 => isBright ? ConsoleColor.Green: ConsoleColor.DarkGreen,
+ 33 => isBright ? ConsoleColor.Yellow: ConsoleColor.DarkYellow,
+ 34 => isBright ? ConsoleColor.Blue: ConsoleColor.DarkBlue,
+ 35 => isBright ? ConsoleColor.Magenta: ConsoleColor.DarkMagenta,
+ 36 => isBright ? ConsoleColor.Cyan: ConsoleColor.DarkCyan,
+ 37 => isBright ? ConsoleColor.White: ConsoleColor.Gray,
+ _ => null
+ };
+ return color != null || number == 39;
+ }
+
+ private static bool TryGetBackgroundColor(int number, out ConsoleColor? color)
+ {
+ color = number switch
+ {
+ 40 => ConsoleColor.Black,
+ 41 => ConsoleColor.DarkRed,
+ 42 => ConsoleColor.DarkGreen,
+ 43 => ConsoleColor.DarkYellow,
+ 44 => ConsoleColor.DarkBlue,
+ 45 => ConsoleColor.DarkMagenta,
+ 46 => ConsoleColor.DarkCyan,
+ 47 => ConsoleColor.Gray,
+ _ => null
+ };
+ return color != null || number == 49;
+ }
+ }
+}
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiParsingLogConsole.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiParsingLogConsole.cs
new file mode 100644
index 000000000000..9f42ec630293
--- /dev/null
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiParsingLogConsole.cs
@@ -0,0 +1,71 @@
+// 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.IO;
+
+namespace Microsoft.Extensions.Logging.Console
+{
+ internal class AnsiParsingLogConsole : IConsole
+ {
+ private readonly TextWriter _textWriter;
+ private readonly AnsiParser _parser;
+
+ public AnsiParsingLogConsole(bool stdErr = false)
+ {
+ _textWriter = stdErr ? System.Console.Error : System.Console.Out;
+ _parser = new AnsiParser(WriteToConsole);
+ }
+
+ public void Write(string message)
+ {
+ _parser.Parse(message);
+ }
+
+ private bool SetColor(ConsoleColor? background, ConsoleColor? foreground)
+ {
+ var backgroundChanged = SetBackgroundColor(background);
+ return SetForegroundColor(foreground) || backgroundChanged;
+ }
+
+ private bool SetBackgroundColor(ConsoleColor? background)
+ {
+ if (background.HasValue)
+ {
+ System.Console.BackgroundColor = background.Value;
+ return true;
+ }
+ return false;
+ }
+
+ private bool SetForegroundColor(ConsoleColor? foreground)
+ {
+ if (foreground.HasValue)
+ {
+ System.Console.ForegroundColor = foreground.Value;
+ return true;
+ }
+ return false;
+ }
+
+ private void ResetColor()
+ {
+ System.Console.ResetColor();
+ }
+
+ private void WriteToConsole(string message, int startIndex, int length, ConsoleColor? background, ConsoleColor? foreground)
+ {
+ ReadOnlySpan span = message.AsSpan().Slice(startIndex, length);
+ var colorChanged = SetColor(background, foreground);
+#if NETCOREAPP
+ _textWriter.Write(span);
+#else
+ _textWriter.Write(span.ToString());
+#endif
+ if (colorChanged)
+ {
+ ResetColor();
+ }
+ }
+ }
+}
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiSystemConsole.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiSystemConsole.cs
deleted file mode 100644
index a44af3e2bf1e..000000000000
--- a/src/libraries/Microsoft.Extensions.Logging.Console/src/AnsiSystemConsole.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System.IO;
-
-namespace Microsoft.Extensions.Logging.Console
-{
- internal class AnsiSystemConsole : IAnsiSystemConsole
- {
- private readonly TextWriter _textWriter;
-
- public AnsiSystemConsole(bool stdErr = false)
- {
- _textWriter = stdErr ? System.Console.Error : System.Console.Out;
- }
-
- public void Write(string message)
- {
- _textWriter.Write(message);
- }
- }
-}
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleFormatter.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleFormatter.cs
new file mode 100644
index 000000000000..716502fb33fa
--- /dev/null
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleFormatter.cs
@@ -0,0 +1,37 @@
+// 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.IO;
+using Microsoft.Extensions.Logging.Abstractions;
+
+namespace Microsoft.Extensions.Logging.Console
+{
+ ///
+ /// Allows custom log messages formatting
+ ///
+ public abstract class ConsoleFormatter
+ {
+ protected ConsoleFormatter(string name)
+ {
+ Name = name ?? throw new ArgumentNullException(nameof(name));
+ }
+
+ ///
+ /// Gets the name associated with the console log formatter.
+ ///
+ public string Name { get; }
+
+ ///
+ /// Writes the log message to the specified TextWriter.
+ ///
+ ///
+ /// if the formatter wants to write colors to the console, it can do so by embedding ANSI color codes into the string
+ ///
+ /// The log entry.
+ /// The provider of scope data.
+ /// The string writer embedding ansi code for colors.
+ /// The type of the object to be written.
+ public abstract void Write(in LogEntry logEntry, IExternalScopeProvider scopeProvider, TextWriter textWriter);
+ }
+}
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleFormatterNames.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleFormatterNames.cs
new file mode 100644
index 000000000000..f2c71c197177
--- /dev/null
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleFormatterNames.cs
@@ -0,0 +1,26 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+namespace Microsoft.Extensions.Logging.Console
+{
+ ///
+ /// Reserved formatter names for the built-in console formatters.
+ ///
+ public static class ConsoleFormatterNames
+ {
+ ///
+ /// Reserved name for simple console formatter
+ ///
+ public const string Simple = "simple";
+
+ ///
+ /// Reserved name for json console formatter
+ ///
+ public const string Json = "json";
+
+ ///
+ /// Reserved name for systemd console formatter
+ ///
+ public const string Systemd = "systemd";
+ }
+}
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleFormatterOptions.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleFormatterOptions.cs
new file mode 100644
index 000000000000..7513ba874231
--- /dev/null
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleFormatterOptions.cs
@@ -0,0 +1,31 @@
+// 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.Text;
+
+namespace Microsoft.Extensions.Logging.Console
+{
+ ///
+ /// Options for the built-in console log formatter.
+ ///
+ public class ConsoleFormatterOptions
+ {
+ public ConsoleFormatterOptions() { }
+
+ ///
+ /// Includes scopes when .
+ ///
+ public bool IncludeScopes { get; set; }
+
+ ///
+ /// Gets or sets format string used to format timestamp in logging messages. Defaults to null.
+ ///
+ public string TimestampFormat { get; set; }
+
+ ///
+ /// Gets or sets indication whether or not UTC timezone should be used to for timestamps in logging messages. Defaults to false.
+ ///
+ public bool UseUtcTimestamp { get; set; }
+ }
+}
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLogger.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLogger.cs
index e790eeb1c053..1d544f322810 100644
--- a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLogger.cs
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLogger.cs
@@ -2,23 +2,16 @@
// The .NET Foundation licenses this file to you under the MIT license.
using System;
-using System.Diagnostics;
-using System.Text;
+using System.IO;
+using Microsoft.Extensions.Logging.Abstractions;
namespace Microsoft.Extensions.Logging.Console
{
internal class ConsoleLogger : ILogger
{
- private const string LoglevelPadding = ": ";
- private static readonly string _messagePadding = new string(' ', GetLogLevelString(LogLevel.Information).Length + LoglevelPadding.Length);
- private static readonly string _newLineWithMessagePadding = Environment.NewLine + _messagePadding;
-
private readonly string _name;
private readonly ConsoleLoggerProcessor _queueProcessor;
- [ThreadStatic]
- private static StringBuilder _logBuilder;
-
internal ConsoleLogger(string name, ConsoleLoggerProcessor loggerProcessor)
{
if (name == null)
@@ -30,186 +23,40 @@ internal ConsoleLogger(string name, ConsoleLoggerProcessor loggerProcessor)
_queueProcessor = loggerProcessor;
}
+ internal ConsoleFormatter Formatter { get; set; }
internal IExternalScopeProvider ScopeProvider { get; set; }
internal ConsoleLoggerOptions Options { get; set; }
+ [ThreadStatic]
+ private static StringWriter t_stringWriter;
+
public void Log(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func formatter)
{
if (!IsEnabled(logLevel))
{
return;
}
-
if (formatter == null)
{
throw new ArgumentNullException(nameof(formatter));
}
+ t_stringWriter ??= new StringWriter();
+ LogEntry logEntry = new LogEntry(logLevel, _name, eventId, state, exception, formatter);
+ Formatter.Write(in logEntry, ScopeProvider, t_stringWriter);
- string message = formatter(state, exception);
-
- if (!string.IsNullOrEmpty(message) || exception != null)
- {
- WriteMessage(logLevel, _name, eventId.Id, message, exception);
- }
- }
-
- public virtual void WriteMessage(LogLevel logLevel, string logName, int eventId, string message, Exception exception)
- {
- ConsoleLoggerFormat format = Options.Format;
- Debug.Assert(format >= ConsoleLoggerFormat.Default && format <= ConsoleLoggerFormat.Systemd);
-
- StringBuilder logBuilder = _logBuilder;
- _logBuilder = null;
-
- if (logBuilder == null)
- {
- logBuilder = new StringBuilder();
- }
-
- LogMessageEntry entry;
- if (format == ConsoleLoggerFormat.Default)
- {
- entry = CreateDefaultLogMessage(logBuilder, logLevel, logName, eventId, message, exception);
- }
- else if (format == ConsoleLoggerFormat.Systemd)
- {
- entry = CreateSystemdLogMessage(logBuilder, logLevel, logName, eventId, message, exception);
- }
- else
- {
- entry = default;
- }
- _queueProcessor.EnqueueMessage(entry);
-
- logBuilder.Clear();
- if (logBuilder.Capacity > 1024)
- {
- logBuilder.Capacity = 1024;
- }
- _logBuilder = logBuilder;
- }
-
- private LogMessageEntry CreateDefaultLogMessage(StringBuilder logBuilder, LogLevel logLevel, string logName, int eventId, string message, Exception exception)
- {
- // Example:
- // info: ConsoleApp.Program[10]
- // Request received
-
- ConsoleColors logLevelColors = GetLogLevelConsoleColors(logLevel);
- string logLevelString = GetLogLevelString(logLevel);
- // category and event id
- logBuilder.Append(LoglevelPadding);
- logBuilder.Append(logName);
- logBuilder.Append('[');
- logBuilder.Append(eventId);
- logBuilder.AppendLine("]");
-
- // scope information
- GetScopeInformation(logBuilder, multiLine: true);
-
- if (!string.IsNullOrEmpty(message))
- {
- // message
- logBuilder.Append(_messagePadding);
-
- int len = logBuilder.Length;
- logBuilder.AppendLine(message);
- logBuilder.Replace(Environment.NewLine, _newLineWithMessagePadding, len, message.Length);
- }
-
- // Example:
- // System.InvalidOperationException
- // at Namespace.Class.Function() in File:line X
- if (exception != null)
- {
- // exception message
- logBuilder.AppendLine(exception.ToString());
- }
-
- string timestamp = null;
- string timestampFormat = Options.TimestampFormat;
- if (timestampFormat != null)
- {
- DateTime dateTime = GetCurrentDateTime();
- timestamp = dateTime.ToString(timestampFormat);
- }
-
- return new LogMessageEntry(
- message: logBuilder.ToString(),
- timeStamp: timestamp,
- levelString: logLevelString,
- levelBackground: logLevelColors.Background,
- levelForeground: logLevelColors.Foreground,
- messageColor: null,
- logAsError: logLevel >= Options.LogToStandardErrorThreshold
- );
- }
-
- private LogMessageEntry CreateSystemdLogMessage(StringBuilder logBuilder, LogLevel logLevel, string logName, int eventId, string message, Exception exception)
- {
- // systemd reads messages from standard out line-by-line in a 'message' format.
- // newline characters are treated as message delimiters, so we must replace them.
- // Messages longer than the journal LineMax setting (default: 48KB) are cropped.
- // Example:
- // <6>ConsoleApp.Program[10] Request received
-
- // loglevel
- string logLevelString = GetSyslogSeverityString(logLevel);
- logBuilder.Append(logLevelString);
-
- // timestamp
- string timestampFormat = Options.TimestampFormat;
- if (timestampFormat != null)
- {
- DateTime dateTime = GetCurrentDateTime();
- logBuilder.Append(dateTime.ToString(timestampFormat));
- }
-
- // category and event id
- logBuilder.Append(logName);
- logBuilder.Append('[');
- logBuilder.Append(eventId);
- logBuilder.Append(']');
-
- // scope information
- GetScopeInformation(logBuilder, multiLine: false);
-
- // message
- if (!string.IsNullOrEmpty(message))
+ var sb = t_stringWriter.GetStringBuilder();
+ if (sb.Length == 0)
{
- logBuilder.Append(' ');
- // message
- AppendAndReplaceNewLine(logBuilder, message);
+ return;
}
-
- // exception
- // System.InvalidOperationException at Namespace.Class.Function() in File:line X
- if (exception != null)
+ string computedAnsiString = sb.ToString();
+ sb.Clear();
+ if (sb.Capacity > 1024)
{
- logBuilder.Append(' ');
- AppendAndReplaceNewLine(logBuilder, exception.ToString());
+ sb.Capacity = 1024;
}
-
- // newline delimiter
- logBuilder.Append(Environment.NewLine);
-
- return new LogMessageEntry(
- message: logBuilder.ToString(),
- logAsError: logLevel >= Options.LogToStandardErrorThreshold
- );
-
- static void AppendAndReplaceNewLine(StringBuilder sb, string message)
- {
- int len = sb.Length;
- sb.Append(message);
- sb.Replace(Environment.NewLine, " ", len, message.Length);
- }
- }
-
- private DateTime GetCurrentDateTime()
- {
- return Options.UseUtcTimestamp ? DateTime.UtcNow : DateTime.Now;
+ _queueProcessor.EnqueueMessage(new LogMessageEntry(computedAnsiString, logAsError: logLevel >= Options.LogToStandardErrorThreshold));
}
public bool IsEnabled(LogLevel logLevel)
@@ -218,116 +65,5 @@ public bool IsEnabled(LogLevel logLevel)
}
public IDisposable BeginScope(TState state) => ScopeProvider?.Push(state) ?? NullScope.Instance;
-
- private static string GetLogLevelString(LogLevel logLevel)
- {
- switch (logLevel)
- {
- case LogLevel.Trace:
- return "trce";
- case LogLevel.Debug:
- return "dbug";
- case LogLevel.Information:
- return "info";
- case LogLevel.Warning:
- return "warn";
- case LogLevel.Error:
- return "fail";
- case LogLevel.Critical:
- return "crit";
- default:
- throw new ArgumentOutOfRangeException(nameof(logLevel));
- }
- }
-
- private static string GetSyslogSeverityString(LogLevel logLevel)
- {
- // 'Syslog Message Severities' from https://tools.ietf.org/html/rfc5424.
- switch (logLevel)
- {
- case LogLevel.Trace:
- case LogLevel.Debug:
- return "<7>"; // debug-level messages
- case LogLevel.Information:
- return "<6>"; // informational messages
- case LogLevel.Warning:
- return "<4>"; // warning conditions
- case LogLevel.Error:
- return "<3>"; // error conditions
- case LogLevel.Critical:
- return "<2>"; // critical conditions
- default:
- throw new ArgumentOutOfRangeException(nameof(logLevel));
- }
- }
-
- private ConsoleColors GetLogLevelConsoleColors(LogLevel logLevel)
- {
- if (!Options.DisableColors)
- {
- // We must explicitly set the background color if we are setting the foreground color,
- // since just setting one can look bad on the users console.
- switch (logLevel)
- {
- case LogLevel.Critical:
- return new ConsoleColors(ConsoleColor.White, ConsoleColor.Red);
- case LogLevel.Error:
- return new ConsoleColors(ConsoleColor.Black, ConsoleColor.Red);
- case LogLevel.Warning:
- return new ConsoleColors(ConsoleColor.Yellow, ConsoleColor.Black);
- case LogLevel.Information:
- return new ConsoleColors(ConsoleColor.DarkGreen, ConsoleColor.Black);
- case LogLevel.Debug:
- return new ConsoleColors(ConsoleColor.Gray, ConsoleColor.Black);
- case LogLevel.Trace:
- return new ConsoleColors(ConsoleColor.Gray, ConsoleColor.Black);
- }
- }
-
- return new ConsoleColors(null, null);
- }
-
- private void GetScopeInformation(StringBuilder stringBuilder, bool multiLine)
- {
- IExternalScopeProvider scopeProvider = ScopeProvider;
- if (Options.IncludeScopes && scopeProvider != null)
- {
- int initialLength = stringBuilder.Length;
-
- scopeProvider.ForEachScope((scope, state) =>
- {
- (StringBuilder builder, int paddAt) = state;
- bool padd = paddAt == builder.Length;
- if (padd)
- {
- builder.Append(_messagePadding);
- builder.Append("=> ");
- }
- else
- {
- builder.Append(" => ");
- }
- builder.Append(scope);
- }, (stringBuilder, multiLine ? initialLength : -1));
-
- if (stringBuilder.Length > initialLength && multiLine)
- {
- stringBuilder.AppendLine();
- }
- }
- }
-
- private readonly struct ConsoleColors
- {
- public ConsoleColors(ConsoleColor? foreground, ConsoleColor? background)
- {
- Foreground = foreground;
- Background = background;
- }
-
- public ConsoleColor? Foreground { get; }
-
- public ConsoleColor? Background { get; }
- }
}
}
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerFactoryExtensions.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerFactoryExtensions.cs
index ea764972e329..9dbea88f9b25 100644
--- a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerFactoryExtensions.cs
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerFactoryExtensions.cs
@@ -2,10 +2,12 @@
// The .NET Foundation licenses this file to you under the MIT license.
using System;
+using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Logging.Configuration;
using Microsoft.Extensions.Logging.Console;
+using Microsoft.Extensions.Options;
namespace Microsoft.Extensions.Logging
{
@@ -19,8 +21,13 @@ public static ILoggingBuilder AddConsole(this ILoggingBuilder builder)
{
builder.AddConfiguration();
+ builder.AddConsoleFormatter();
+ builder.AddConsoleFormatter();
+ builder.AddConsoleFormatter();
+
builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton());
LoggerProviderOptions.RegisterProviderOptions(builder.Services);
+
return builder;
}
@@ -41,5 +48,104 @@ public static ILoggingBuilder AddConsole(this ILoggingBuilder builder, Action
+ /// Add and configure a console log formatter named 'simple' to the factory.
+ ///
+ /// The to use.
+ /// A delegate to configure the options for the built-in default log formatter.
+ public static ILoggingBuilder AddSimpleConsole(this ILoggingBuilder builder, Action configure)
+ {
+ return builder.AddConsoleWithFormatter(ConsoleFormatterNames.Simple, configure);
+ }
+
+ ///
+ /// Add and configure a console log formatter named 'json' to the factory.
+ ///
+ /// The to use.
+ /// A delegate to configure the options for the built-in json log formatter.
+ public static ILoggingBuilder AddJsonConsole(this ILoggingBuilder builder, Action configure)
+ {
+ return builder.AddConsoleWithFormatter(ConsoleFormatterNames.Json, configure);
+ }
+
+ ///
+ /// Add and configure a console log formatter named 'systemd' to the factory.
+ ///
+ /// The to use.
+ /// A delegate to configure the options for the built-in systemd log formatter.
+ public static ILoggingBuilder AddSystemdConsole(this ILoggingBuilder builder, Action configure)
+ {
+ return builder.AddConsoleWithFormatter(ConsoleFormatterNames.Systemd, configure);
+ }
+
+ internal static ILoggingBuilder AddConsoleWithFormatter(this ILoggingBuilder builder, string name, Action configure)
+ where TOptions : ConsoleFormatterOptions
+ {
+ if (configure == null)
+ {
+ throw new ArgumentNullException(nameof(configure));
+ }
+ builder.AddConsole((ConsoleLoggerOptions options) => options.FormatterName = name);
+ builder.Services.Configure(configure);
+
+ return builder;
+ }
+
+ ///
+ /// Adds a custom console logger formatter 'TFormatter' to be configured with options 'TOptions'.
+ ///
+ /// The to use.
+ public static ILoggingBuilder AddConsoleFormatter(this ILoggingBuilder builder)
+ where TOptions : ConsoleFormatterOptions
+ where TFormatter : ConsoleFormatter
+ {
+ builder.AddConfiguration();
+
+ builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton());
+ builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton, ConsoleLoggerFormatterConfigureOptions>());
+ builder.Services.TryAddEnumerable(ServiceDescriptor.Singleton, ConsoleLoggerFormatterOptionsChangeTokenSource>());
+
+ return builder;
+ }
+
+ ///
+ /// Adds a custom console logger formatter 'TFormatter' to be configured with options 'TOptions'.
+ ///
+ /// The to use.
+ /// A delegate to configure options 'TOptions' for custom formatter 'TFormatter'.
+ public static ILoggingBuilder AddConsoleFormatter(this ILoggingBuilder builder, Action configure)
+ where TOptions : ConsoleFormatterOptions
+ where TFormatter : ConsoleFormatter
+ {
+ if (configure == null)
+ {
+ throw new ArgumentNullException(nameof(configure));
+ }
+
+ builder.AddConsoleFormatter();
+ builder.Services.Configure(configure);
+ return builder;
+ }
+ }
+
+ internal class ConsoleLoggerFormatterConfigureOptions : ConfigureFromConfigurationOptions
+ where TOptions : ConsoleFormatterOptions
+ where TFormatter : ConsoleFormatter
+ {
+ public ConsoleLoggerFormatterConfigureOptions(ILoggerProviderConfiguration providerConfiguration) :
+ base(providerConfiguration.Configuration.GetSection("FormatterOptions"))
+ {
+ }
+ }
+
+ internal class ConsoleLoggerFormatterOptionsChangeTokenSource : ConfigurationChangeTokenSource
+ where TOptions : ConsoleFormatterOptions
+ where TFormatter : ConsoleFormatter
+ {
+ public ConsoleLoggerFormatterOptionsChangeTokenSource(ILoggerProviderConfiguration providerConfiguration)
+ : base(providerConfiguration.Configuration.GetSection("FormatterOptions"))
+ {
+ }
}
}
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerFormat.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerFormat.cs
index 818b56c3cdbb..d5baee2d57c6 100644
--- a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerFormat.cs
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerFormat.cs
@@ -6,6 +6,7 @@ namespace Microsoft.Extensions.Logging.Console
///
/// Format of messages.
///
+ [System.ObsoleteAttribute("ConsoleLoggerFormat has been deprecated.", false)]
public enum ConsoleLoggerFormat
{
///
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerOptions.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerOptions.cs
index 6b675398f3b1..cda6f89e52c1 100644
--- a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerOptions.cs
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerOptions.cs
@@ -10,21 +10,18 @@ namespace Microsoft.Extensions.Logging.Console
///
public class ConsoleLoggerOptions
{
- private ConsoleLoggerFormat _format = ConsoleLoggerFormat.Default;
-
- ///
- /// Includes scopes when .
- ///
- public bool IncludeScopes { get; set; }
-
///
/// Disables colors when .
///
+ [System.ObsoleteAttribute("ConsoleLoggerOptions.DisableColors has been deprecated. Please use SimpleConsoleFormatterOptions.DisableColors instead.", false)]
public bool DisableColors { get; set; }
+#pragma warning disable CS0618
+ private ConsoleLoggerFormat _format = ConsoleLoggerFormat.Default;
///
/// Gets or sets log message format. Defaults to .
///
+ [System.ObsoleteAttribute("ConsoleLoggerOptions.Format has been deprecated. Please use ConsoleLoggerOptions.FormatterName instead.", false)]
public ConsoleLoggerFormat Format
{
get => _format;
@@ -36,8 +33,20 @@ public ConsoleLoggerFormat Format
}
_format = value;
}
+#pragma warning restore CS0618
}
+ ///
+ /// Name of the log message formatter to use. Defaults to "simple" />.
+ ///
+ public string FormatterName { get; set; }
+
+ ///
+ /// Includes scopes when .
+ ///
+ [System.ObsoleteAttribute("ConsoleLoggerOptions.IncludeScopes has been deprecated. Please use ConsoleFormatterOptions.IncludeScopes instead.", false)]
+ public bool IncludeScopes { get; set; }
+
///
/// Gets or sets value indicating the minimum level of messages that would get written to Console.Error.
///
@@ -46,11 +55,13 @@ public ConsoleLoggerFormat Format
///
/// Gets or sets format string used to format timestamp in logging messages. Defaults to null.
///
+ [System.ObsoleteAttribute("ConsoleLoggerOptions.TimestampFormat has been deprecated. Please use ConsoleFormatterOptions.TimestampFormat instead.", false)]
public string TimestampFormat { get; set; }
///
/// Gets or sets indication whether or not UTC timezone should be used to for timestamps in logging messages. Defaults to false.
///
+ [System.ObsoleteAttribute("ConsoleLoggerOptions.UseUtcTimestamp has been deprecated. Please use ConsoleFormatterOptions.UseUtcTimestamp instead.", false)]
public bool UseUtcTimestamp { get; set; }
}
-}
+}
\ No newline at end of file
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerProcessor.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerProcessor.cs
index 4c5109a86819..83a49c20d4c8 100644
--- a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerProcessor.cs
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerProcessor.cs
@@ -49,22 +49,10 @@ public virtual void EnqueueMessage(LogMessageEntry message)
}
// for testing
- internal virtual void WriteMessage(LogMessageEntry message)
+ internal virtual void WriteMessage(LogMessageEntry entry)
{
- IConsole console = message.LogAsError ? ErrorConsole : Console;
-
- if (message.TimeStamp != null)
- {
- console.Write(message.TimeStamp, message.MessageColor, message.MessageColor);
- }
-
- if (message.LevelString != null)
- {
- console.Write(message.LevelString, message.LevelBackground, message.LevelForeground);
- }
-
- console.Write(message.Message, message.MessageColor, message.MessageColor);
- console.Flush();
+ IConsole console = entry.LogAsError ? ErrorConsole : Console;
+ console.Write(entry.Message);
}
private void ProcessLogQueue()
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerProvider.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerProvider.cs
index 2a9d02b3bc72..4c5c596a4467 100644
--- a/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerProvider.cs
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLoggerProvider.cs
@@ -3,6 +3,8 @@
using System;
using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.Linq;
using System.Runtime.InteropServices;
using Microsoft.Extensions.Options;
@@ -16,6 +18,7 @@ public class ConsoleLoggerProvider : ILoggerProvider, ISupportExternalScope
{
private readonly IOptionsMonitor _options;
private readonly ConcurrentDictionary _loggers;
+ private ConcurrentDictionary _formatters;
private readonly ConsoleLoggerProcessor _messageQueue;
private IDisposable _optionsReloadToken;
@@ -26,43 +29,148 @@ public class ConsoleLoggerProvider : ILoggerProvider, ISupportExternalScope
///
/// The options to create instances with.
public ConsoleLoggerProvider(IOptionsMonitor options)
+ : this(options, Enumerable.Empty()) { }
+
+ ///
+ /// Creates an instance of .
+ ///
+ /// The options to create instances with.
+ /// Log formatters added for insteaces.
+ public ConsoleLoggerProvider(IOptionsMonitor options, IEnumerable formatters)
{
_options = options;
_loggers = new ConcurrentDictionary();
+ SetFormatters(formatters);
ReloadLoggerOptions(options.CurrentValue);
_optionsReloadToken = _options.OnChange(ReloadLoggerOptions);
_messageQueue = new ConsoleLoggerProcessor();
- if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ if (DoesConsoleSupportAnsi())
+ {
+ _messageQueue.Console = new AnsiLogConsole();
+ _messageQueue.ErrorConsole = new AnsiLogConsole(stdErr: true);
+ }
+ else
+ {
+ _messageQueue.Console = new AnsiParsingLogConsole();
+ _messageQueue.ErrorConsole = new AnsiParsingLogConsole(stdErr: true);
+ }
+ }
+
+ private static bool DoesConsoleSupportAnsi()
+ {
+ if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ {
+ return true;
+ }
+ // for Windows, check the console mode
+ var stdOutHandle = Interop.Kernel32.GetStdHandle(Interop.Kernel32.STD_OUTPUT_HANDLE);
+ if (!Interop.Kernel32.GetConsoleMode(stdOutHandle, out int consoleMode))
+ {
+ return false;
+ }
+
+ return (consoleMode & Interop.Kernel32.ENABLE_VIRTUAL_TERMINAL_PROCESSING) == Interop.Kernel32.ENABLE_VIRTUAL_TERMINAL_PROCESSING;
+ }
+
+ private void SetFormatters(IEnumerable formatters = null)
+ {
+ _formatters = new ConcurrentDictionary(StringComparer.OrdinalIgnoreCase);
+ if (formatters == null || !formatters.Any())
{
- _messageQueue.Console = new WindowsLogConsole();
- _messageQueue.ErrorConsole = new WindowsLogConsole(stdErr: true);
+ var defaultMonitor = new FormatterOptionsMonitor(new SimpleConsoleFormatterOptions());
+ var systemdMonitor = new FormatterOptionsMonitor(new ConsoleFormatterOptions());
+ var jsonMonitor = new FormatterOptionsMonitor(new JsonConsoleFormatterOptions());
+ _formatters.GetOrAdd(ConsoleFormatterNames.Simple, formatterName => new SimpleConsoleFormatter(defaultMonitor));
+ _formatters.GetOrAdd(ConsoleFormatterNames.Systemd, formatterName => new SystemdConsoleFormatter(systemdMonitor));
+ _formatters.GetOrAdd(ConsoleFormatterNames.Json, formatterName => new JsonConsoleFormatter(jsonMonitor));
}
else
{
- _messageQueue.Console = new AnsiLogConsole(new AnsiSystemConsole());
- _messageQueue.ErrorConsole = new AnsiLogConsole(new AnsiSystemConsole(stdErr: true));
+ foreach (ConsoleFormatter formatter in formatters)
+ {
+ _formatters.GetOrAdd(formatter.Name, formatterName => formatter);
+ }
}
}
+ // warning: ReloadLoggerOptions can be called before the ctor completed,... before registering all of the state used in this method need to be initialized
private void ReloadLoggerOptions(ConsoleLoggerOptions options)
{
- foreach (System.Collections.Generic.KeyValuePair logger in _loggers)
+ if (options.FormatterName == null || !_formatters.TryGetValue(options.FormatterName, out ConsoleFormatter logFormatter))
+ {
+#pragma warning disable CS0618
+ logFormatter = options.Format switch
+ {
+ ConsoleLoggerFormat.Systemd => _formatters[ConsoleFormatterNames.Systemd],
+ _ => _formatters[ConsoleFormatterNames.Simple],
+ };
+ if (options.FormatterName == null)
+ {
+ UpdateFormatterOptions(logFormatter, options);
+ }
+#pragma warning restore CS0618
+ }
+
+ foreach (KeyValuePair logger in _loggers)
{
logger.Value.Options = options;
+ logger.Value.Formatter = logFormatter;
}
}
///
public ILogger CreateLogger(string name)
{
+ if (_options.CurrentValue.FormatterName == null || !_formatters.TryGetValue(_options.CurrentValue.FormatterName, out ConsoleFormatter logFormatter))
+ {
+#pragma warning disable CS0618
+ logFormatter = _options.CurrentValue.Format switch
+ {
+ ConsoleLoggerFormat.Systemd => _formatters[ConsoleFormatterNames.Systemd],
+ _ => _formatters[ConsoleFormatterNames.Simple],
+ };
+ if (_options.CurrentValue.FormatterName == null)
+ {
+ UpdateFormatterOptions(logFormatter, _options.CurrentValue);
+ }
+#pragma warning disable CS0618
+ }
+
return _loggers.GetOrAdd(name, loggerName => new ConsoleLogger(name, _messageQueue)
{
Options = _options.CurrentValue,
- ScopeProvider = _scopeProvider
+ ScopeProvider = _scopeProvider,
+ Formatter = logFormatter,
});
}
+#pragma warning disable CS0618
+ private void UpdateFormatterOptions(ConsoleFormatter formatter, ConsoleLoggerOptions deprecatedFromOptions)
+ {
+ // kept for deprecated apis:
+ if (formatter is SimpleConsoleFormatter defaultFormatter)
+ {
+ defaultFormatter.FormatterOptions = new SimpleConsoleFormatterOptions()
+ {
+ DisableColors = deprecatedFromOptions.DisableColors,
+ IncludeScopes = deprecatedFromOptions.IncludeScopes,
+ TimestampFormat = deprecatedFromOptions.TimestampFormat,
+ UseUtcTimestamp = deprecatedFromOptions.UseUtcTimestamp,
+ };
+ }
+ else
+ if (formatter is SystemdConsoleFormatter systemdFormatter)
+ {
+ systemdFormatter.FormatterOptions = new ConsoleFormatterOptions()
+ {
+ IncludeScopes = deprecatedFromOptions.IncludeScopes,
+ TimestampFormat = deprecatedFromOptions.TimestampFormat,
+ UseUtcTimestamp = deprecatedFromOptions.UseUtcTimestamp,
+ };
+ }
+ }
+#pragma warning restore CS0618
///
public void Dispose()
@@ -80,7 +188,6 @@ public void SetScopeProvider(IExternalScopeProvider scopeProvider)
{
logger.Value.ScopeProvider = _scopeProvider;
}
-
}
}
}
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/FormatterOptionsMonitor.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/FormatterOptionsMonitor.cs
new file mode 100644
index 000000000000..d29376cb9b84
--- /dev/null
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/FormatterOptionsMonitor.cs
@@ -0,0 +1,26 @@
+// 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 Microsoft.Extensions.Options;
+
+namespace Microsoft.Extensions.Logging.Console
+{
+ internal class FormatterOptionsMonitor : IOptionsMonitor where TOptions : ConsoleFormatterOptions
+ {
+ private TOptions _options;
+ public FormatterOptionsMonitor(TOptions options)
+ {
+ _options = options;
+ }
+
+ public TOptions Get(string name) => _options;
+
+ public IDisposable OnChange(Action listener)
+ {
+ return null;
+ }
+
+ public TOptions CurrentValue => _options;
+ }
+}
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/IAnsiSystemConsole.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/IAnsiSystemConsole.cs
deleted file mode 100644
index d2f2d040dbcd..000000000000
--- a/src/libraries/Microsoft.Extensions.Logging.Console/src/IAnsiSystemConsole.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-namespace Microsoft.Extensions.Logging.Console
-{
- internal interface IAnsiSystemConsole
- {
- void Write(string message);
- }
-}
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/IConsole.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/IConsole.cs
index b1a4ae5de4c8..5285cc7ea5b9 100644
--- a/src/libraries/Microsoft.Extensions.Logging.Console/src/IConsole.cs
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/IConsole.cs
@@ -1,14 +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;
-
namespace Microsoft.Extensions.Logging.Console
{
internal interface IConsole
{
- void Write(string message, ConsoleColor? background, ConsoleColor? foreground);
- void WriteLine(string message, ConsoleColor? background, ConsoleColor? foreground);
- void Flush();
+ void Write(string message);
}
}
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/JsonConsoleFormatter.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/JsonConsoleFormatter.cs
new file mode 100644
index 000000000000..68aa95a92504
--- /dev/null
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/JsonConsoleFormatter.cs
@@ -0,0 +1,150 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Text.Json;
+using Microsoft.Extensions.Logging.Abstractions;
+using Microsoft.Extensions.Options;
+
+namespace Microsoft.Extensions.Logging.Console
+{
+ internal class JsonConsoleFormatter : ConsoleFormatter, IDisposable
+ {
+ private IDisposable _optionsReloadToken;
+
+ public JsonConsoleFormatter(IOptionsMonitor options)
+ : base (ConsoleFormatterNames.Json)
+ {
+ ReloadLoggerOptions(options.CurrentValue);
+ _optionsReloadToken = options.OnChange(ReloadLoggerOptions);
+ }
+
+ public override void Write(in LogEntry logEntry, IExternalScopeProvider scopeProvider, TextWriter textWriter)
+ {
+ string message = logEntry.Formatter(logEntry.State, logEntry.Exception);
+ if (logEntry.Exception == null && message == null)
+ {
+ return;
+ }
+ LogLevel logLevel = logEntry.LogLevel;
+ string category = logEntry.Category;
+ int eventId = logEntry.EventId.Id;
+ Exception exception = logEntry.Exception;
+ const int DefaultBufferSize = 1024;
+ using (var output = new PooledByteBufferWriter(DefaultBufferSize))
+ {
+ using (var writer = new Utf8JsonWriter(output, FormatterOptions.JsonWriterOptions))
+ {
+ writer.WriteStartObject();
+ string timestamp = null;
+ var timestampFormat = FormatterOptions.TimestampFormat;
+ if (timestampFormat != null)
+ {
+ var dateTime = FormatterOptions.UseUtcTimestamp ? DateTime.UtcNow : DateTime.Now;
+ timestamp = dateTime.ToString(timestampFormat);
+ }
+ writer.WriteString("Timestamp", timestamp);
+ writer.WriteNumber(nameof(logEntry.EventId), eventId);
+ writer.WriteString(nameof(logEntry.LogLevel), GetLogLevelString(logLevel));
+ writer.WriteString(nameof(logEntry.Category), category);
+ writer.WriteString("Message", message);
+
+ if (exception != null)
+ {
+ writer.WriteStartObject(nameof(Exception));
+ writer.WriteString(nameof(exception.Message), exception.Message.ToString());
+ writer.WriteString("Type", exception.GetType().ToString());
+ writer.WriteStartArray(nameof(exception.StackTrace));
+ string stackTrace = exception?.StackTrace;
+ if (stackTrace != null)
+ {
+#if NETCOREAPP
+ foreach (var stackTraceLines in stackTrace?.Split(Environment.NewLine))
+#else
+ foreach (var stackTraceLines in stackTrace?.Split(new string[] { Environment.NewLine }, StringSplitOptions.None))
+#endif
+ {
+ writer.WriteStringValue(stackTraceLines);
+ }
+ }
+ writer.WriteEndArray();
+ writer.WriteNumber(nameof(exception.HResult), exception.HResult);
+ writer.WriteEndObject();
+ }
+
+ if (logEntry.State is IReadOnlyCollection> stateDictionary)
+ {
+ foreach (KeyValuePair item in stateDictionary)
+ {
+ writer.WriteString(item.Key, Convert.ToString(item.Value, CultureInfo.InvariantCulture));
+ }
+ }
+ WriteScopeInformation(writer, scopeProvider);
+ writer.WriteEndObject();
+ writer.Flush();
+ }
+#if NETCOREAPP
+ textWriter.Write(Encoding.UTF8.GetString(output.WrittenMemory.Span));
+#else
+ textWriter.Write(Encoding.UTF8.GetString(output.WrittenMemory.Span.ToArray()));
+#endif
+ }
+ textWriter.Write(Environment.NewLine);
+ }
+
+ private static string GetLogLevelString(LogLevel logLevel)
+ {
+ return logLevel switch
+ {
+ LogLevel.Trace => "Trace",
+ LogLevel.Debug => "Debug",
+ LogLevel.Information => "Information",
+ LogLevel.Warning => "Warning",
+ LogLevel.Error => "Error",
+ LogLevel.Critical => "Critical",
+ _ => throw new ArgumentOutOfRangeException(nameof(logLevel))
+ };
+ }
+
+ private void WriteScopeInformation(Utf8JsonWriter writer, IExternalScopeProvider scopeProvider)
+ {
+ if (FormatterOptions.IncludeScopes && scopeProvider != null)
+ {
+ int numScopes = 0;
+ writer.WriteStartObject("Scopes");
+ scopeProvider.ForEachScope((scope, state) =>
+ {
+ if (scope is IReadOnlyCollection> scopeDictionary)
+ {
+ foreach (KeyValuePair item in scopeDictionary)
+ {
+ state.WriteString(item.Key, Convert.ToString(item.Value, CultureInfo.InvariantCulture));
+ }
+ }
+ else
+ {
+ state.WriteString(numScopes++.ToString(), scope.ToString());
+ }
+ }, writer);
+ writer.WriteEndObject();
+ }
+ }
+
+ internal JsonConsoleFormatterOptions FormatterOptions { get; set; }
+
+ private void ReloadLoggerOptions(JsonConsoleFormatterOptions options)
+ {
+ FormatterOptions = options;
+ }
+
+ public void Dispose()
+ {
+ _optionsReloadToken?.Dispose();
+ }
+ }
+}
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/JsonConsoleFormatterOptions.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/JsonConsoleFormatterOptions.cs
new file mode 100644
index 000000000000..3603cc97e8a5
--- /dev/null
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/JsonConsoleFormatterOptions.cs
@@ -0,0 +1,20 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using System.Text.Json;
+
+namespace Microsoft.Extensions.Logging.Console
+{
+ ///
+ /// Options for the built-in json console log formatter.
+ ///
+ public class JsonConsoleFormatterOptions : ConsoleFormatterOptions
+ {
+ public JsonConsoleFormatterOptions() { }
+
+ ///
+ /// Gets or sets JsonWriterOptions.
+ ///
+ public JsonWriterOptions JsonWriterOptions { get; set; }
+ }
+}
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/LogMessageEntry.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/LogMessageEntry.cs
index 6297b01c5b9d..e070ee946d59 100644
--- a/src/libraries/Microsoft.Extensions.Logging.Console/src/LogMessageEntry.cs
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/LogMessageEntry.cs
@@ -1,28 +1,16 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-
namespace Microsoft.Extensions.Logging.Console
{
internal readonly struct LogMessageEntry
{
- public LogMessageEntry(string message, string timeStamp = null, string levelString = null, ConsoleColor? levelBackground = null, ConsoleColor? levelForeground = null, ConsoleColor? messageColor = null, bool logAsError = false)
+ public LogMessageEntry(string message, bool logAsError = false)
{
- TimeStamp = timeStamp;
- LevelString = levelString;
- LevelBackground = levelBackground;
- LevelForeground = levelForeground;
- MessageColor = messageColor;
Message = message;
LogAsError = logAsError;
}
- public readonly string TimeStamp;
- public readonly string LevelString;
- public readonly ConsoleColor? LevelBackground;
- public readonly ConsoleColor? LevelForeground;
- public readonly ConsoleColor? MessageColor;
public readonly string Message;
public readonly bool LogAsError;
}
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 0096f0711660..3afd1b9ed232 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
@@ -1,8 +1,15 @@
- $(NetCoreAppCurrent);netstandard2.0
+ $(NetCoreAppCurrent);netstandard2.0;net461;$(NetFrameworkCurrent)
+ true
true
+ annotations
+ $(DefineConstants);NO_SUPPRESS_GC_TRANSITION
+
+
+
+ $(NuGetPackageRoot)\microsoft.targetingpack.netframework.v4.6.1\1.0.1\lib\net461\;$(AssemblySearchPaths)
@@ -18,14 +25,47 @@
Link="Common\src\Extensions\Logging\NullExternalScopeProvider.cs" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/Properties/InternalsVisibleTo.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/Properties/InternalsVisibleTo.cs
index c9d3b5185197..401c4ac78875 100644
--- a/src/libraries/Microsoft.Extensions.Logging.Console/src/Properties/InternalsVisibleTo.cs
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/Properties/InternalsVisibleTo.cs
@@ -3,4 +3,4 @@
using System.Runtime.CompilerServices;
-[assembly: InternalsVisibleTo("Microsoft.Extensions.Logging.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
+[assembly: InternalsVisibleTo("Microsoft.Extensions.Logging.Console.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/Resources/Strings.resx b/src/libraries/Microsoft.Extensions.Logging.Console/src/Resources/Strings.resx
new file mode 100644
index 000000000000..5ef4b889b114
--- /dev/null
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/Resources/Strings.resx
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Cannot allocate a buffer of size {0}.
+
+
\ No newline at end of file
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/SimpleConsoleFormatter.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/SimpleConsoleFormatter.cs
new file mode 100644
index 000000000000..e92aa0c27840
--- /dev/null
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/SimpleConsoleFormatter.cs
@@ -0,0 +1,210 @@
+// 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.IO;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using System.Text;
+using Microsoft.Extensions.Logging.Abstractions;
+using Microsoft.Extensions.Options;
+
+namespace Microsoft.Extensions.Logging.Console
+{
+ internal class SimpleConsoleFormatter : ConsoleFormatter, IDisposable
+ {
+ private const string LoglevelPadding = ": ";
+ private static readonly string _messagePadding = new string(' ', GetLogLevelString(LogLevel.Information).Length + LoglevelPadding.Length);
+ private static readonly string _newLineWithMessagePadding = Environment.NewLine + _messagePadding;
+ private IDisposable _optionsReloadToken;
+
+ public SimpleConsoleFormatter(IOptionsMonitor options)
+ : base (ConsoleFormatterNames.Simple)
+ {
+ ReloadLoggerOptions(options.CurrentValue);
+ _optionsReloadToken = options.OnChange(ReloadLoggerOptions);
+ }
+
+ private void ReloadLoggerOptions(SimpleConsoleFormatterOptions options)
+ {
+ FormatterOptions = options;
+ }
+
+ public void Dispose()
+ {
+ _optionsReloadToken?.Dispose();
+ }
+
+ internal SimpleConsoleFormatterOptions FormatterOptions { get; set; }
+
+ public override void Write(in LogEntry logEntry, IExternalScopeProvider scopeProvider, TextWriter textWriter)
+ {
+ string message = logEntry.Formatter(logEntry.State, logEntry.Exception);
+ if (logEntry.Exception == null && message == null)
+ {
+ return;
+ }
+ LogLevel logLevel = logEntry.LogLevel;
+ ConsoleColors logLevelColors = GetLogLevelConsoleColors(logLevel);
+ string logLevelString = GetLogLevelString(logLevel);
+
+ string timestamp = null;
+ string timestampFormat = FormatterOptions.TimestampFormat;
+ if (timestampFormat != null)
+ {
+ DateTime dateTime = GetCurrentDateTime();
+ timestamp = dateTime.ToString(timestampFormat);
+ }
+ if (timestamp != null)
+ {
+ textWriter.Write(timestamp);
+ }
+ if (logLevelString != null)
+ {
+ textWriter.WriteColoredMessage(logLevelString, logLevelColors.Background, logLevelColors.Foreground);
+ }
+ CreateDefaultLogMessage(textWriter, logEntry, message, scopeProvider);
+ }
+
+ private void CreateDefaultLogMessage(TextWriter textWriter, in LogEntry logEntry, string message, IExternalScopeProvider scopeProvider)
+ {
+ bool singleLine = FormatterOptions.SingleLine;
+ int eventId = logEntry.EventId.Id;
+ Exception exception = logEntry.Exception;
+
+ // Example:
+ // info: ConsoleApp.Program[10]
+ // Request received
+
+ // category and event id
+ textWriter.Write(LoglevelPadding + logEntry.Category + '[' + eventId + "]");
+ if (!singleLine)
+ {
+ textWriter.Write(Environment.NewLine);
+ }
+
+ // scope information
+ WriteScopeInformation(textWriter, scopeProvider, singleLine);
+ if (singleLine)
+ {
+ textWriter.Write(' ');
+ }
+ WriteMessage(textWriter, message, singleLine);
+
+ // Example:
+ // System.InvalidOperationException
+ // at Namespace.Class.Function() in File:line X
+ if (exception != null)
+ {
+ // exception message
+ WriteMessage(textWriter, exception.ToString(), singleLine);
+ }
+ if (singleLine)
+ {
+ textWriter.Write(Environment.NewLine);
+ }
+ }
+
+ private void WriteMessage(TextWriter textWriter, string message, bool singleLine)
+ {
+ if (!string.IsNullOrEmpty(message))
+ {
+ if (singleLine)
+ {
+ WriteReplacing(textWriter, Environment.NewLine, " ", message);
+ }
+ else
+ {
+ textWriter.Write(_messagePadding);
+ WriteReplacing(textWriter, Environment.NewLine, _newLineWithMessagePadding, message);
+ textWriter.Write(Environment.NewLine);
+ }
+ }
+
+ static void WriteReplacing(TextWriter writer, string oldValue, string newValue, string message)
+ {
+ string newMessage = message.Replace(oldValue, newValue);
+ writer.Write(newMessage);
+ }
+ }
+
+ private DateTime GetCurrentDateTime()
+ {
+ return FormatterOptions.UseUtcTimestamp ? DateTime.UtcNow : DateTime.Now;
+ }
+
+ private static string GetLogLevelString(LogLevel logLevel)
+ {
+ return logLevel switch
+ {
+ LogLevel.Trace => "trce",
+ LogLevel.Debug => "dbug",
+ LogLevel.Information => "info",
+ LogLevel.Warning => "warn",
+ LogLevel.Error => "fail",
+ LogLevel.Critical => "crit",
+ _ => throw new ArgumentOutOfRangeException(nameof(logLevel))
+ };
+ }
+
+ private ConsoleColors GetLogLevelConsoleColors(LogLevel logLevel)
+ {
+ if (FormatterOptions.DisableColors)
+ {
+ return new ConsoleColors(null, null);
+ }
+ // We must explicitly set the background color if we are setting the foreground color,
+ // since just setting one can look bad on the users console.
+ return logLevel switch
+ {
+ LogLevel.Trace => new ConsoleColors(ConsoleColor.Gray, ConsoleColor.Black),
+ LogLevel.Debug => new ConsoleColors(ConsoleColor.Gray, ConsoleColor.Black),
+ LogLevel.Information => new ConsoleColors(ConsoleColor.DarkGreen, ConsoleColor.Black),
+ LogLevel.Warning => new ConsoleColors(ConsoleColor.Yellow, ConsoleColor.Black),
+ LogLevel.Error => new ConsoleColors(ConsoleColor.Black, ConsoleColor.DarkRed),
+ LogLevel.Critical => new ConsoleColors(ConsoleColor.White, ConsoleColor.DarkRed),
+ _ => new ConsoleColors(null, null)
+ };
+ }
+
+ private void WriteScopeInformation(TextWriter textWriter, IExternalScopeProvider scopeProvider, bool singleLine)
+ {
+ if (FormatterOptions.IncludeScopes && scopeProvider != null)
+ {
+ bool paddingNeeded = !singleLine;
+ scopeProvider.ForEachScope((scope, state) =>
+ {
+ if (paddingNeeded)
+ {
+ paddingNeeded = false;
+ state.Write(_messagePadding + "=> ");
+ }
+ else
+ {
+ state.Write(" => ");
+ }
+ state.Write(scope);
+ }, textWriter);
+
+ if (!paddingNeeded && !singleLine)
+ {
+ textWriter.Write(Environment.NewLine);
+ }
+ }
+ }
+
+ private readonly struct ConsoleColors
+ {
+ public ConsoleColors(ConsoleColor? foreground, ConsoleColor? background)
+ {
+ Foreground = foreground;
+ Background = background;
+ }
+
+ public ConsoleColor? Foreground { get; }
+
+ public ConsoleColor? Background { get; }
+ }
+ }
+}
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/SimpleConsoleFormatterOptions.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/SimpleConsoleFormatterOptions.cs
new file mode 100644
index 000000000000..9ee51c149389
--- /dev/null
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/SimpleConsoleFormatterOptions.cs
@@ -0,0 +1,23 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+namespace Microsoft.Extensions.Logging.Console
+{
+ ///
+ /// Options for the built-in default console log formatter.
+ ///
+ public class SimpleConsoleFormatterOptions : ConsoleFormatterOptions
+ {
+ public SimpleConsoleFormatterOptions() { }
+
+ ///
+ /// Disables colors when .
+ ///
+ public bool DisableColors { get; set; }
+
+ ///
+ /// When , the entire message gets logged in a single line.
+ ///
+ public bool SingleLine { get; set; }
+ }
+}
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/SystemdConsoleFormatter.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/SystemdConsoleFormatter.cs
new file mode 100644
index 000000000000..0140adf51356
--- /dev/null
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/SystemdConsoleFormatter.cs
@@ -0,0 +1,131 @@
+// 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.IO;
+using System.Text;
+using Microsoft.Extensions.Logging.Abstractions;
+using Microsoft.Extensions.Options;
+
+namespace Microsoft.Extensions.Logging.Console
+{
+ internal class SystemdConsoleFormatter : ConsoleFormatter, IDisposable
+ {
+ private IDisposable _optionsReloadToken;
+
+ public SystemdConsoleFormatter(IOptionsMonitor options)
+ : base(ConsoleFormatterNames.Systemd)
+ {
+ ReloadLoggerOptions(options.CurrentValue);
+ _optionsReloadToken = options.OnChange(ReloadLoggerOptions);
+ }
+
+ private void ReloadLoggerOptions(ConsoleFormatterOptions options)
+ {
+ FormatterOptions = options;
+ }
+
+ public void Dispose()
+ {
+ _optionsReloadToken?.Dispose();
+ }
+
+ internal ConsoleFormatterOptions FormatterOptions { get; set; }
+
+ public override void Write(in LogEntry logEntry, IExternalScopeProvider scopeProvider, TextWriter textWriter)
+ {
+ string message = logEntry.Formatter(logEntry.State, logEntry.Exception);
+ if (logEntry.Exception == null && message == null)
+ {
+ return;
+ }
+ LogLevel logLevel = logEntry.LogLevel;
+ string category = logEntry.Category;
+ int eventId = logEntry.EventId.Id;
+ Exception exception = logEntry.Exception;
+ // systemd reads messages from standard out line-by-line in a 'message' format.
+ // newline characters are treated as message delimiters, so we must replace them.
+ // Messages longer than the journal LineMax setting (default: 48KB) are cropped.
+ // Example:
+ // <6>ConsoleApp.Program[10] Request received
+
+ // loglevel
+ string logLevelString = GetSyslogSeverityString(logLevel);
+ textWriter.Write(logLevelString);
+
+ // timestamp
+ string timestampFormat = FormatterOptions.TimestampFormat;
+ if (timestampFormat != null)
+ {
+ DateTime dateTime = GetCurrentDateTime();
+ textWriter.Write(dateTime.ToString(timestampFormat));
+ }
+
+ // category and event id
+ textWriter.Write(category);
+ textWriter.Write('[');
+ textWriter.Write(eventId);
+ textWriter.Write(']');
+
+ // scope information
+ WriteScopeInformation(textWriter, scopeProvider);
+
+ // message
+ if (!string.IsNullOrEmpty(message))
+ {
+ textWriter.Write(' ');
+ // message
+ WriteReplacingNewLine(textWriter, message);
+ }
+
+ // exception
+ // System.InvalidOperationException at Namespace.Class.Function() in File:line X
+ if (exception != null)
+ {
+ textWriter.Write(' ');
+ WriteReplacingNewLine(textWriter, exception.ToString());
+ }
+
+ // newline delimiter
+ textWriter.Write(Environment.NewLine);
+
+ static void WriteReplacingNewLine(TextWriter writer, string message)
+ {
+ string newMessage = message.Replace(Environment.NewLine, " ");
+ writer.Write(newMessage);
+ }
+ }
+
+ private DateTime GetCurrentDateTime()
+ {
+ return FormatterOptions.UseUtcTimestamp ? DateTime.UtcNow : DateTime.Now;
+ }
+
+ private static string GetSyslogSeverityString(LogLevel logLevel)
+ {
+ // 'Syslog Message Severities' from https://tools.ietf.org/html/rfc5424.
+ return logLevel switch
+ {
+ LogLevel.Trace => "<7>",
+ LogLevel.Debug => "<7>", // debug-level messages
+ LogLevel.Information => "<6>", // informational messages
+ LogLevel.Warning => "<4>", // warning conditions
+ LogLevel.Error => "<3>", // error conditions
+ LogLevel.Critical => "<2>", // critical conditions
+ _ => throw new ArgumentOutOfRangeException(nameof(logLevel))
+ };
+ }
+
+ private void WriteScopeInformation(TextWriter textWriter, IExternalScopeProvider scopeProvider)
+ {
+ if (FormatterOptions.IncludeScopes && scopeProvider != null)
+ {
+ scopeProvider.ForEachScope((scope, state) =>
+ {
+ state.Write(" => ");
+ state.Write(scope);
+ }, textWriter);
+ }
+ }
+ }
+}
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/TextWriterExtensions.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/TextWriterExtensions.cs
new file mode 100644
index 000000000000..b7afe29d278e
--- /dev/null
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/src/TextWriterExtensions.cs
@@ -0,0 +1,33 @@
+// 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.IO;
+
+namespace Microsoft.Extensions.Logging.Console
+{
+ internal static class TextWriterExtensions
+ {
+ public static void WriteColoredMessage(this TextWriter textWriter, string message, ConsoleColor? background, ConsoleColor? foreground)
+ {
+ // Order: backgroundcolor, foregroundcolor, Message, reset foregroundcolor, reset backgroundcolor
+ if (background.HasValue)
+ {
+ textWriter.Write(AnsiParser.GetBackgroundColorEscapeCode(background.Value));
+ }
+ if (foreground.HasValue)
+ {
+ textWriter.Write(AnsiParser.GetForegroundColorEscapeCode(foreground.Value));
+ }
+ textWriter.Write(message);
+ if (foreground.HasValue)
+ {
+ textWriter.Write(AnsiParser.DefaultForegroundColor); // reset to default foreground color
+ }
+ if (background.HasValue)
+ {
+ textWriter.Write(AnsiParser.DefaultBackgroundColor); // reset to the background color
+ }
+ }
+ }
+}
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/src/WindowsLogConsole.cs b/src/libraries/Microsoft.Extensions.Logging.Console/src/WindowsLogConsole.cs
deleted file mode 100644
index 9bbc8f99c165..000000000000
--- a/src/libraries/Microsoft.Extensions.Logging.Console/src/WindowsLogConsole.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-using System.IO;
-
-namespace Microsoft.Extensions.Logging.Console
-{
- internal class WindowsLogConsole : IConsole
- {
- private readonly TextWriter _textWriter;
-
- public WindowsLogConsole(bool stdErr = false)
- {
- _textWriter = stdErr ? System.Console.Error : System.Console.Out;
- }
-
- private bool SetColor(ConsoleColor? background, ConsoleColor? foreground)
- {
- if (background.HasValue)
- {
- System.Console.BackgroundColor = background.Value;
- }
-
- if (foreground.HasValue)
- {
- System.Console.ForegroundColor = foreground.Value;
- }
-
- return background.HasValue || foreground.HasValue;
- }
-
- private void ResetColor()
- {
- System.Console.ResetColor();
- }
-
- public void Write(string message, ConsoleColor? background, ConsoleColor? foreground)
- {
- bool colorChanged = SetColor(background, foreground);
- _textWriter.Write(message);
- if (colorChanged)
- {
- ResetColor();
- }
- }
-
- public void WriteLine(string message, ConsoleColor? background, ConsoleColor? foreground)
- {
- bool colorChanged = SetColor(background, foreground);
- _textWriter.WriteLine(message);
- if (colorChanged)
- {
- ResetColor();
- }
- }
-
- public void Flush()
- {
- // No action required as for every write, data is sent directly to the console
- // output stream
- }
- }
-}
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/tests/AnsiParserTests.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/AnsiParserTests.cs
new file mode 100644
index 000000000000..fbe579c07645
--- /dev/null
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/tests/AnsiParserTests.cs
@@ -0,0 +1,262 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.Extensions.Logging.Test.Console;
+using Xunit;
+
+namespace Microsoft.Extensions.Logging.Console.Test
+{
+ public class AnsiParserTests
+ {
+ private const char EscapeChar = '\x1B';
+
+ [Theory]
+ [InlineData(1, "No Color", "No Color")]
+ [InlineData(2, "\x1B[41mColored\x1B[49mNo Color", "No Color")]
+ [InlineData(2, "\x1B[41m\x1B[1m\x1B[31mmColored\x1B[39m\x1B[49mNo Color", "No Color")]
+ public void Parse_CheckTimesWrittenToConsole(int numSegments, string message, string lastSegment)
+ {
+ // Arrange
+ var segments = new List();
+ Action onParseWrite = (message, startIndex, length, bg, fg) => {
+ segments.Add(new ConsoleContext() {
+ BackgroundColor = bg,
+ ForegroundColor = fg,
+ Message = message.AsSpan().Slice(startIndex, length).ToString()
+ });
+ };
+ var parser = new AnsiParser(onParseWrite);
+
+ // Act
+ parser.Parse(message);
+
+ // Assert
+ Assert.Equal(numSegments, segments.Count);
+ Assert.Equal(lastSegment, segments.Last().Message);
+ }
+
+ [Theory]
+ [MemberData(nameof(Colors))]
+ public void Parse_SetBackgroundForegroundAndMessageThenReset_Success(ConsoleColor background, ConsoleColor foreground)
+ {
+ // Arrange
+ var message = AnsiParser.GetBackgroundColorEscapeCode(background)
+ + AnsiParser.GetForegroundColorEscapeCode(foreground)
+ + "Request received"
+ + AnsiParser.DefaultForegroundColor //resets foreground color
+ + AnsiParser.DefaultBackgroundColor; //resets background color
+ var segments = new List();
+ Action onParseWrite = (message, startIndex, length, bg, fg) => {
+ segments.Add(new ConsoleContext() {
+ BackgroundColor = bg,
+ ForegroundColor = fg,
+ Message = message.AsSpan().Slice(startIndex, length).ToString()
+ });
+ };
+ var parser = new AnsiParser(onParseWrite);
+
+ // Act
+ parser.Parse(message);
+
+ // Assert
+ Assert.Equal(1, segments.Count);
+ Assert.Equal("Request received", segments[0].Message);
+ VerifyForeground(foreground, segments[0]);
+ VerifyBackground(background, segments[0]);
+ }
+
+ [Fact]
+ public void Parse_MessageWithMultipleColors_ParsedIntoMultipleSegments()
+ {
+ // Arrange
+ var message = AnsiParser.GetBackgroundColorEscapeCode(ConsoleColor.DarkRed)
+ + AnsiParser.GetForegroundColorEscapeCode(ConsoleColor.Gray)
+ + "Message1"
+ + AnsiParser.DefaultForegroundColor
+ + AnsiParser.DefaultBackgroundColor
+ + "NoColor"
+ + AnsiParser.GetBackgroundColorEscapeCode(ConsoleColor.DarkGreen)
+ + AnsiParser.GetForegroundColorEscapeCode(ConsoleColor.Cyan)
+ + "Message2"
+ + AnsiParser.GetBackgroundColorEscapeCode(ConsoleColor.DarkBlue)
+ + AnsiParser.GetForegroundColorEscapeCode(ConsoleColor.Yellow)
+ + "Message3"
+ + AnsiParser.DefaultForegroundColor
+ + AnsiParser.DefaultBackgroundColor;
+ var segments = new List();
+ Action onParseWrite = (message, startIndex, length, bg, fg) => {
+ segments.Add(new ConsoleContext() {
+ BackgroundColor = bg,
+ ForegroundColor = fg,
+ Message = message.AsSpan().Slice(startIndex, length).ToString()
+ });
+ };
+ var parser = new AnsiParser(onParseWrite);
+
+ // Act
+ parser.Parse(message);
+
+ // Assert
+ Assert.Equal(4, segments.Count);
+ Assert.Equal("NoColor", segments[1].Message);
+ Assert.Null(segments[1].ForegroundColor);
+ Assert.Null(segments[1].BackgroundColor);
+
+ Assert.Equal("Message1", segments[0].Message);
+ Assert.Equal("Message2", segments[2].Message);
+ Assert.Equal("Message3", segments[3].Message);
+ VerifyBackground(ConsoleColor.DarkRed, segments[0]);
+ VerifyBackground(ConsoleColor.DarkGreen, segments[2]);
+ VerifyBackground(ConsoleColor.DarkBlue, segments[3]);
+ VerifyForeground(ConsoleColor.Gray, segments[0]);
+ VerifyForeground(ConsoleColor.Cyan, segments[2]);
+ VerifyForeground(ConsoleColor.Yellow, segments[3]);
+ }
+
+ [Fact]
+ public void Parse_RepeatedColorChange_PicksLastSet()
+ {
+ // Arrange
+ var message = AnsiParser.GetBackgroundColorEscapeCode(ConsoleColor.DarkRed)
+ + AnsiParser.GetBackgroundColorEscapeCode(ConsoleColor.DarkGreen)
+ + AnsiParser.GetBackgroundColorEscapeCode(ConsoleColor.DarkBlue)
+ + AnsiParser.GetForegroundColorEscapeCode(ConsoleColor.Gray)
+ + AnsiParser.GetForegroundColorEscapeCode(ConsoleColor.Cyan)
+ + AnsiParser.GetForegroundColorEscapeCode(ConsoleColor.Yellow)
+ + "Request received"
+ + AnsiParser.DefaultForegroundColor //resets foreground color
+ + AnsiParser.DefaultBackgroundColor; //resets background color
+ var segments = new List();
+ Action onParseWrite = (message, startIndex, length, bg, fg) => {
+ segments.Add(new ConsoleContext() {
+ BackgroundColor = bg,
+ ForegroundColor = fg,
+ Message = message.AsSpan().Slice(startIndex, length).ToString()
+ });
+ };
+ var parser = new AnsiParser(onParseWrite);
+
+ // Act
+ parser.Parse(message);
+
+ // Assert
+ Assert.Equal(1, segments.Count);
+ Assert.Equal("Request received", segments[0].Message);
+ VerifyBackground(ConsoleColor.DarkBlue, segments[0]);
+ VerifyForeground(ConsoleColor.Yellow, segments[0]);
+ }
+
+ [Theory]
+ // supported
+ [InlineData("\x1B[77mInfo", "Info")]
+ [InlineData("\x1B[77m\x1B[1m\x1B[2m\x1B[0mInfo\x1B[1m", "Info")]
+ [InlineData("\x1B[7mInfo", "Info")]
+ [InlineData("\x1B[40m\x1B[1m\x1B[33mwarn\x1B[39m\x1B[22m\x1B[49m:", "warn", ":")]
+ // unsupported: skips
+ [InlineData("Info\x1B[77m:", "Info", ":")]
+ [InlineData("Info\x1B[7m:", "Info", ":")]
+ // treats as content
+ [InlineData("\x1B", "\x1B")]
+ [InlineData("\x1B ", "\x1B ")]
+ [InlineData("\x1Bm", "\x1Bm")]
+ [InlineData("\x1B m", "\x1B m")]
+ [InlineData("\x1Bxym", "\x1Bxym")]
+ [InlineData("\x1B[", "\x1B[")]
+ [InlineData("\x1B[m", "\x1B[m")]
+ [InlineData("\x1B[ ", "\x1B[ ")]
+ [InlineData("\x1B[ m", "\x1B[ m")]
+ [InlineData("\x1B[xym", "\x1B[xym")]
+ [InlineData("\x1B[7777m", "\x1B[7777m")]
+ [InlineData("\x1B\x1B\x1B", "\x1B\x1B\x1B")]
+ [InlineData("Message\x1B\x1B\x1B", "Message\x1B\x1B\x1B")]
+ [InlineData("\x1B\x1BMessage\x1B", "\x1B\x1BMessage\x1B")]
+ [InlineData("\x1B\x1B\x1BMessage", "\x1B\x1B\x1BMessage")]
+ [InlineData("Message\x1B ", "Message\x1B ")]
+ [InlineData("\x1BmMessage", "\x1BmMessage")]
+ [InlineData("\x1B[77m\x1B m\x1B[40m", "\x1B m")]
+ [InlineData("\x1B mMessage\x1Bxym", "\x1B mMessage\x1Bxym")]
+ public void Parse_ValidSupportedOrUnsupportedCodesInMessage_MessageParsedSuccessfully(string messageWithUnsupportedCode, params string[] output)
+ {
+ // Arrange
+ var message = messageWithUnsupportedCode;
+ var segments = new List();
+ Action onParseWrite = (message, startIndex, length, bg, fg) => {
+ segments.Add(new ConsoleContext() {
+ BackgroundColor = bg,
+ ForegroundColor = fg,
+ Message = message.AsSpan().Slice(startIndex, length).ToString()
+ });
+ };
+ var parser = new AnsiParser(onParseWrite);
+
+ // Act
+ parser.Parse(messageWithUnsupportedCode);
+
+ // Assert
+ Assert.Equal(output.Length, segments.Count);
+ for (int i = 0; i < output.Length; i++)
+ Assert.Equal(output[i], segments[i].Message);
+ }
+
+ [Fact]
+ public void NullDelegate_Throws()
+ {
+ Assert.Throws(() => new AnsiParser(null));
+ }
+
+ public static TheoryData Colors
+ {
+ get
+ {
+ var data = new TheoryData();
+ foreach (ConsoleColor background in Enum.GetValues(typeof(ConsoleColor)))
+ {
+ foreach (ConsoleColor foreground in Enum.GetValues(typeof(ConsoleColor)))
+ {
+ data.Add(background, foreground);
+ }
+ }
+ return data;
+ }
+ }
+
+ private void VerifyBackground(ConsoleColor background, ConsoleContext segment)
+ {
+ if (IsBackgroundColorNotSupported(background))
+ {
+ Assert.Null(segment.BackgroundColor);
+ }
+ else
+ {
+ Assert.Equal(background, segment.BackgroundColor);
+ }
+ }
+
+ private void VerifyForeground(ConsoleColor foreground, ConsoleContext segment)
+ {
+ if (IsForegroundColorNotSupported(foreground))
+ {
+ Assert.Null(segment.ForegroundColor);
+ }
+ else
+ {
+ Assert.Equal(foreground, segment.ForegroundColor);
+ }
+ }
+
+ private static bool IsBackgroundColorNotSupported(ConsoleColor color)
+ {
+ return AnsiParser.GetBackgroundColorEscapeCode(color).Equals(
+ AnsiParser.DefaultBackgroundColor, StringComparison.OrdinalIgnoreCase);
+ }
+
+ private static bool IsForegroundColorNotSupported(ConsoleColor color)
+ {
+ return AnsiParser.GetForegroundColorEscapeCode(color).Equals(
+ AnsiParser.DefaultForegroundColor, StringComparison.OrdinalIgnoreCase);
+ }
+ }
+}
diff --git a/src/libraries/Microsoft.Extensions.Logging/tests/Common/Console/ConsoleContext.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Console/ConsoleContext.cs
similarity index 100%
rename from src/libraries/Microsoft.Extensions.Logging/tests/Common/Console/ConsoleContext.cs
rename to src/libraries/Microsoft.Extensions.Logging.Console/tests/Console/ConsoleContext.cs
diff --git a/src/libraries/Microsoft.Extensions.Logging/tests/Common/Console/ConsoleSink.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Console/ConsoleSink.cs
similarity index 100%
rename from src/libraries/Microsoft.Extensions.Logging/tests/Common/Console/ConsoleSink.cs
rename to src/libraries/Microsoft.Extensions.Logging.Console/tests/Console/ConsoleSink.cs
diff --git a/src/libraries/Microsoft.Extensions.Logging/tests/Common/Console/TestConsole.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Console/TestConsole.cs
similarity index 78%
rename from src/libraries/Microsoft.Extensions.Logging/tests/Common/Console/TestConsole.cs
rename to src/libraries/Microsoft.Extensions.Logging.Console/tests/Console/TestConsole.cs
index 5c26251cd5d4..c6040753d9c9 100644
--- a/src/libraries/Microsoft.Extensions.Logging/tests/Common/Console/TestConsole.cs
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Console/TestConsole.cs
@@ -12,10 +12,12 @@ public class TestConsole : IConsole
public static readonly ConsoleColor? DefaultForegroundColor;
private ConsoleSink _sink;
+ private AnsiParser _parser;
public TestConsole(ConsoleSink sink)
{
_sink = sink;
+ _parser = new AnsiParser(OnParseWrite);
BackgroundColor = DefaultBackgroundColor;
ForegroundColor = DefaultForegroundColor;
}
@@ -24,10 +26,15 @@ public TestConsole(ConsoleSink sink)
public ConsoleColor? ForegroundColor { get; private set; }
- public void Write(string message, ConsoleColor? background, ConsoleColor? foreground)
+ public void Write(string message)
+ {
+ _parser.Parse(message);
+ }
+
+ public void OnParseWrite(string message, int startIndex, int length, ConsoleColor? background, ConsoleColor? foreground)
{
var consoleContext = new ConsoleContext();
- consoleContext.Message = message;
+ consoleContext.Message = message.AsSpan().Slice(startIndex, length).ToString();
if (background.HasValue)
{
@@ -44,15 +51,6 @@ public void Write(string message, ConsoleColor? background, ConsoleColor? foregr
ResetColor();
}
- public void WriteLine(string message, ConsoleColor? background, ConsoleColor? foreground)
- {
- Write(message + Environment.NewLine, background, foreground);
- }
-
- public void Flush()
- {
- }
-
private void ResetColor()
{
BackgroundColor = DefaultBackgroundColor;
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/tests/ConsoleFormatterTests.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/ConsoleFormatterTests.cs
new file mode 100644
index 000000000000..580a745a12d8
--- /dev/null
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/tests/ConsoleFormatterTests.cs
@@ -0,0 +1,272 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using System;
+using System.Collections.Concurrent;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text.Encodings.Web;
+using System.Text.Json;
+using System.Text.RegularExpressions;
+using Microsoft.Extensions.Logging.Abstractions;
+using Microsoft.Extensions.Logging.Test.Console;
+using Microsoft.Extensions.Options;
+using Xunit;
+
+namespace Microsoft.Extensions.Logging.Console.Test
+{
+ public class ConsoleFormatterTests
+ {
+ protected const string _loggerName = "test";
+ protected const string _state = "This is a test, and {curly braces} are just fine!";
+ protected readonly Func _defaultFormatter = (state, exception) => state.ToString();
+
+ protected string GetMessage(List contexts)
+ {
+ return string.Join("", contexts.Select(c => c.Message));
+ }
+
+ internal static (ConsoleLogger Logger, ConsoleSink Sink, ConsoleSink ErrorSink, Func GetLevelPrefix, int WritesPerMsg) SetUp(
+ ConsoleLoggerOptions options = null,
+ SimpleConsoleFormatterOptions simpleOptions = null,
+ ConsoleFormatterOptions systemdOptions = null,
+ JsonConsoleFormatterOptions jsonOptions = null)
+ {
+ // Arrange
+ var sink = new ConsoleSink();
+ var errorSink = new ConsoleSink();
+ var console = new TestConsole(sink);
+ var errorConsole = new TestConsole(errorSink);
+ var consoleLoggerProcessor = new TestLoggerProcessor();
+ consoleLoggerProcessor.Console = console;
+ consoleLoggerProcessor.ErrorConsole = errorConsole;
+
+ var logger = new ConsoleLogger(_loggerName, consoleLoggerProcessor);
+ logger.ScopeProvider = new LoggerExternalScopeProvider();
+ logger.Options = options ?? new ConsoleLoggerOptions();
+ var formatters = new ConcurrentDictionary(ConsoleLoggerTest.GetFormatters(simpleOptions, systemdOptions, jsonOptions).ToDictionary(f => f.Name));
+
+ Func levelAsString;
+ int writesPerMsg;
+ switch (logger.Options.FormatterName)
+ {
+ case ConsoleFormatterNames.Simple:
+ levelAsString = ConsoleLoggerTest.LogLevelAsStringDefault;
+ writesPerMsg = 2;
+ logger.Formatter = formatters[ConsoleFormatterNames.Simple];
+ break;
+ case ConsoleFormatterNames.Systemd:
+ levelAsString = ConsoleLoggerTest.GetSyslogSeverityString;
+ writesPerMsg = 1;
+ logger.Formatter = formatters[ConsoleFormatterNames.Systemd];
+ break;
+ case ConsoleFormatterNames.Json:
+ levelAsString = ConsoleLoggerTest.GetJsonLogLevelString;
+ writesPerMsg = 1;
+ logger.Formatter = formatters[ConsoleFormatterNames.Json];
+ break;
+ default:
+ throw new ArgumentOutOfRangeException(nameof(logger.Options.FormatterName));
+ }
+
+ return (logger, sink, errorSink, levelAsString, writesPerMsg);
+ }
+
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ public void ConsoleLoggerOptions_TimeStampFormat_IsReloaded()
+ {
+ // Arrange
+ var monitor = new TestOptionsMonitor(new ConsoleLoggerOptions() { FormatterName = "NonExistentFormatter" });
+ var loggerProvider = new ConsoleLoggerProvider(monitor, ConsoleLoggerTest.GetFormatters());
+ var logger = (ConsoleLogger)loggerProvider.CreateLogger("Name");
+
+ // Act & Assert
+ Assert.Equal("NonExistentFormatter", logger.Options.FormatterName);
+ Assert.Equal(ConsoleFormatterNames.Simple, logger.Formatter.Name);
+ }
+
+ [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [MemberData(nameof(FormatterNames))]
+ public void InvalidLogLevel_Throws(string formatterName)
+ {
+ // Arrange
+ var t = SetUp(
+ new ConsoleLoggerOptions { FormatterName = formatterName }
+ );
+ var logger = (ILogger)t.Logger;
+
+ // Act/Assert
+ Assert.Throws(() => logger.Log((LogLevel)8, 0, _state, null, _defaultFormatter));
+ }
+
+ [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [MemberData(nameof(FormatterNamesAndLevels))]
+ public void NoMessageOrException_Noop(string formatterName, LogLevel level)
+ {
+ // Arrange
+ var t = SetUp(new ConsoleLoggerOptions { FormatterName = formatterName });
+ var levelPrefix = t.GetLevelPrefix(level);
+ var logger = t.Logger;
+ var sink = t.Sink;
+ var ex = new Exception("Exception message" + Environment.NewLine + "with a second line");
+
+ // Act
+ Func formatter = (state, exception) => null;
+ logger.Log(level, 0, _state, null, formatter);
+
+ // Assert
+ Assert.Equal(0, sink.Writes.Count);
+ }
+
+ [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [MemberData(nameof(FormatterNamesAndLevels))]
+ public void Log_LogsCorrectTimestamp(string formatterName, LogLevel level)
+ {
+ // Arrange
+ var t = SetUp(
+ new ConsoleLoggerOptions { FormatterName = formatterName },
+ new SimpleConsoleFormatterOptions { TimestampFormat = "yyyy-MM-ddTHH:mm:sszz ", UseUtcTimestamp = false },
+ new ConsoleFormatterOptions { TimestampFormat = "yyyy-MM-ddTHH:mm:sszz ", UseUtcTimestamp = false },
+ new JsonConsoleFormatterOptions {
+ TimestampFormat = "yyyy-MM-ddTHH:mm:sszz ",
+ UseUtcTimestamp = false,
+ JsonWriterOptions = new JsonWriterOptions()
+ {
+ // otherwise escapes for timezone formatting from + to \u002b
+ Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
+ Indented = true
+ }
+ });
+ var levelPrefix = t.GetLevelPrefix(level);
+ var logger = t.Logger;
+ var sink = t.Sink;
+ var ex = new Exception("Exception message" + Environment.NewLine + "with a second line");
+
+ // Act
+ logger.Log(level, 0, _state, ex, _defaultFormatter);
+
+ // Assert
+ switch (formatterName)
+ {
+ case ConsoleFormatterNames.Simple:
+ {
+ Assert.Equal(3, sink.Writes.Count);
+ Assert.StartsWith(levelPrefix, sink.Writes[1].Message);
+ Assert.Matches(@"^\d{4}\D\d{2}\D\d{2}\D\d{2}\D\d{2}\D\d{2}\D\d{2}\s$", sink.Writes[0].Message);
+ var parsedDateTime = DateTimeOffset.Parse(sink.Writes[0].Message.Trim());
+ Assert.Equal(DateTimeOffset.Now.Offset, parsedDateTime.Offset);
+ }
+ break;
+ case ConsoleFormatterNames.Systemd:
+ {
+ Assert.Single(sink.Writes);
+ Assert.StartsWith(levelPrefix, sink.Writes[0].Message);
+ var regexMatch = Regex.Match(sink.Writes[0].Message, @"^<\d>(\d{4}\D\d{2}\D\d{2}\D\d{2}\D\d{2}\D\d{2}\D\d{2})\s[^\s]");
+ Assert.True(regexMatch.Success);
+ var parsedDateTime = DateTimeOffset.Parse(regexMatch.Groups[1].Value);
+ Assert.Equal(DateTimeOffset.Now.Offset, parsedDateTime.Offset);
+ }
+ break;
+ case ConsoleFormatterNames.Json:
+ {
+ Assert.Single(sink.Writes);
+ var regexMatch = Regex.Match(sink.Writes[0].Message, @"(\d{4}\D\d{2}\D\d{2}\D\d{2}\D\d{2}\D\d{2}\D\d{2})");
+ Assert.True(regexMatch.Success, sink.Writes[0].Message);
+ var parsedDateTime = DateTimeOffset.Parse(regexMatch.Groups[1].Value);
+ Assert.Equal(DateTimeOffset.Now.Offset, parsedDateTime.Offset);
+ }
+ break;
+ default:
+ throw new ArgumentOutOfRangeException(nameof(formatterName));
+ }
+ }
+
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ public void NullFormatterName_Throws()
+ {
+ // Arrange
+ Assert.Throws(() => new NullNameConsoleFormatter());
+ }
+
+ private class NullNameConsoleFormatter : ConsoleFormatter
+ {
+ public NullNameConsoleFormatter() : base(null) { }
+ public override void Write(in LogEntry logEntry, IExternalScopeProvider scopeProvider, TextWriter textWriter) { }
+ }
+
+ public static TheoryData FormatterNamesAndLevels
+ {
+ get
+ {
+ var data = new TheoryData();
+ foreach (LogLevel level in Enum.GetValues(typeof(LogLevel)))
+ {
+ if (level == LogLevel.None)
+ {
+ continue;
+ }
+ data.Add(ConsoleFormatterNames.Simple, level);
+ data.Add(ConsoleFormatterNames.Systemd, level);
+ data.Add(ConsoleFormatterNames.Json, level);
+ }
+ return data;
+ }
+ }
+
+ public static TheoryData FormatterNames
+ {
+ get
+ {
+ var data = new TheoryData();
+ data.Add(ConsoleFormatterNames.Simple);
+ data.Add(ConsoleFormatterNames.Systemd);
+ data.Add(ConsoleFormatterNames.Json);
+ return data;
+ }
+ }
+
+ public static TheoryData Levels
+ {
+ get
+ {
+ var data = new TheoryData();
+ foreach (LogLevel value in Enum.GetValues(typeof(LogLevel)))
+ {
+ data.Add(value);
+ }
+ return data;
+ }
+ }
+
+ }
+
+ public class TestFormatter : ConsoleFormatter, IDisposable
+ {
+ private IDisposable _optionsReloadToken;
+
+ public TestFormatter(IOptionsMonitor options)
+ : base ("TestFormatter")
+ {
+ FormatterOptions = options.CurrentValue;
+ ReloadLoggerOptions(options.CurrentValue);
+ _optionsReloadToken = options.OnChange(ReloadLoggerOptions);
+ }
+
+ private void ReloadLoggerOptions(SimpleConsoleFormatterOptions options)
+ {
+ FormatterOptions = options;
+ }
+
+ public void Dispose()
+ {
+ _optionsReloadToken?.Dispose();
+ }
+
+ internal SimpleConsoleFormatterOptions FormatterOptions { get; set; }
+ public override void Write(in LogEntry logEntry, IExternalScopeProvider scopeProvider, TextWriter textWriter)
+ {
+ ;
+ }
+ }
+}
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/tests/ConsoleLoggerExtensionsTests.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/ConsoleLoggerExtensionsTests.cs
new file mode 100644
index 000000000000..85a643012c82
--- /dev/null
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/tests/ConsoleLoggerExtensionsTests.cs
@@ -0,0 +1,476 @@
+
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Text.Encodings.Web;
+using System.Text.Json;
+using Microsoft.Extensions.Logging.Abstractions;
+using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Logging.Console;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Options;
+using Xunit;
+
+namespace Microsoft.Extensions.Logging.Test
+{
+ public class ConsoleLoggerExtensionsTests
+ {
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ public void AddConsole_NullConfigure_Throws()
+ {
+ Assert.Throws(() =>
+ new ServiceCollection()
+ .AddLogging(builder =>
+ {
+ builder.AddConsole(null);
+ }));
+ }
+
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ public void AddSimpleConsole_NullConfigure_Throws()
+ {
+ Assert.Throws(() =>
+ new ServiceCollection()
+ .AddLogging(builder =>
+ {
+ builder.AddSimpleConsole(null);
+ }));
+ }
+
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ public void AddSystemdConsole_NullConfigure_Throws()
+ {
+ Assert.Throws(() =>
+ new ServiceCollection()
+ .AddLogging(builder =>
+ {
+ builder.AddSystemdConsole(null);
+ }));
+ }
+
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ public void AddJsonConsole_NullConfigure_Throws()
+ {
+ Assert.Throws(() =>
+ new ServiceCollection()
+ .AddLogging(builder =>
+ {
+ builder.AddJsonConsole(null);
+ }));
+ }
+
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ public void AddConsoleFormatter_NullConfigure_Throws()
+ {
+ Assert.Throws(() =>
+ new ServiceCollection()
+ .AddLogging(builder =>
+ {
+ builder.AddConsoleFormatter(null);
+ }));
+ }
+
+ [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [MemberData(nameof(FormatterNames))]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/38337", TestPlatforms.Browser)]
+ public void AddConsole_ConsoleLoggerOptionsFromConfigFile_IsReadFromLoggingConfiguration(string formatterName)
+ {
+ var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] {
+ new KeyValuePair("Console:FormatterName", formatterName)
+ }).Build();
+
+ var loggerProvider = new ServiceCollection()
+ .AddLogging(builder => builder
+ .AddConfiguration(configuration)
+ .AddConsole())
+ .BuildServiceProvider()
+ .GetRequiredService();
+
+ var consoleLoggerProvider = Assert.IsType(loggerProvider);
+ var logger = (ConsoleLogger)consoleLoggerProvider.CreateLogger("Category");
+ Assert.Equal(formatterName, logger.Options.FormatterName);
+ }
+
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/38337", TestPlatforms.Browser)]
+ public void AddConsoleFormatter_CustomFormatter_IsReadFromLoggingConfiguration()
+ {
+ var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] {
+ new KeyValuePair("Console:FormatterName", "custom"),
+ new KeyValuePair("Console:FormatterOptions:CustomLabel", "random"),
+ }).Build();
+
+ var loggerProvider = new ServiceCollection()
+ .AddLogging(builder => builder
+ .AddConfiguration(configuration)
+ .AddConsoleFormatter(fOptions => { fOptions.CustomLabel = "random"; })
+ .AddConsole(o => { o.FormatterName = "custom"; })
+ )
+ .BuildServiceProvider()
+ .GetRequiredService();
+
+ var consoleLoggerProvider = Assert.IsType(loggerProvider);
+ var logger = (ConsoleLogger)consoleLoggerProvider.CreateLogger("Category");
+ Assert.Equal("custom", logger.Options.FormatterName);
+ var formatter = Assert.IsType(logger.Formatter);
+ Assert.Equal("random", formatter.FormatterOptions.CustomLabel);
+ }
+
+ private class CustomFormatter : ConsoleFormatter, IDisposable
+ {
+ private IDisposable _optionsReloadToken;
+
+ public CustomFormatter(IOptionsMonitor options)
+ : base("custom")
+ {
+ ReloadLoggerOptions(options.CurrentValue);
+ _optionsReloadToken = options.OnChange(ReloadLoggerOptions);
+ }
+
+ private void ReloadLoggerOptions(CustomOptions options)
+ {
+ FormatterOptions = options;
+ }
+
+ public CustomOptions FormatterOptions { get; set; }
+ public string CustomLog { get; set; }
+
+ public override void Write(in LogEntry logEntry, IExternalScopeProvider scopeProvider, TextWriter textWriter)
+ {
+ CustomLog = logEntry.Formatter(logEntry.State, logEntry.Exception);
+ }
+
+ public void Dispose()
+ {
+ _optionsReloadToken?.Dispose();
+ }
+ }
+
+ private class CustomOptions : ConsoleFormatterOptions
+ {
+ public string CustomLabel { get; set; }
+ }
+
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/38337", TestPlatforms.Browser)]
+ public void AddSimpleConsole_ChangeProperties_IsReadFromLoggingConfiguration()
+ {
+ var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] {
+ new KeyValuePair("Console:FormatterOptions:DisableColors", "true"),
+ new KeyValuePair("Console:FormatterOptions:SingleLine", "true"),
+ new KeyValuePair("Console:FormatterOptions:TimestampFormat", "HH:mm "),
+ new KeyValuePair("Console:FormatterOptions:UseUtcTimestamp", "true"),
+ new KeyValuePair("Console:FormatterOptions:IncludeScopes", "true"),
+ }).Build();
+
+ var loggerProvider = new ServiceCollection()
+ .AddLogging(builder => builder
+ .AddConfiguration(configuration)
+ .AddSimpleConsole(o => {})
+ )
+ .BuildServiceProvider()
+ .GetRequiredService();
+
+ var consoleLoggerProvider = Assert.IsType(loggerProvider);
+ var logger = (ConsoleLogger)consoleLoggerProvider.CreateLogger("Category");
+ Assert.Equal(ConsoleFormatterNames.Simple, logger.Options.FormatterName);
+ var formatter = Assert.IsType(logger.Formatter);
+ Assert.True(formatter.FormatterOptions.DisableColors);
+ Assert.True(formatter.FormatterOptions.SingleLine);
+ Assert.Equal("HH:mm ", formatter.FormatterOptions.TimestampFormat);
+ Assert.True(formatter.FormatterOptions.UseUtcTimestamp);
+ Assert.True(formatter.FormatterOptions.IncludeScopes);
+ }
+
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/38337", TestPlatforms.Browser)]
+ public void AddSystemdConsole_ChangeProperties_IsReadFromLoggingConfiguration()
+ {
+ var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] {
+ new KeyValuePair("Console:FormatterOptions:TimestampFormat", "HH:mm "),
+ new KeyValuePair("Console:FormatterOptions:UseUtcTimestamp", "true"),
+ new KeyValuePair("Console:FormatterOptions:IncludeScopes", "true"),
+ }).Build();
+
+ var loggerProvider = new ServiceCollection()
+ .AddLogging(builder => builder
+ .AddConfiguration(configuration)
+ .AddSystemdConsole(o => {})
+ )
+ .BuildServiceProvider()
+ .GetRequiredService();
+
+ var consoleLoggerProvider = Assert.IsType(loggerProvider);
+ var logger = (ConsoleLogger)consoleLoggerProvider.CreateLogger("Category");
+ Assert.Equal(ConsoleFormatterNames.Systemd, logger.Options.FormatterName);
+ var formatter = Assert.IsType(logger.Formatter);
+ Assert.Equal("HH:mm ", formatter.FormatterOptions.TimestampFormat);
+ Assert.True(formatter.FormatterOptions.UseUtcTimestamp);
+ Assert.True(formatter.FormatterOptions.IncludeScopes);
+ }
+
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/38337", TestPlatforms.Browser)]
+ public void AddJsonConsole_ChangeProperties_IsReadFromLoggingConfiguration()
+ {
+ var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] {
+ new KeyValuePair("Console:FormatterOptions:TimestampFormat", "HH:mm "),
+ new KeyValuePair("Console:FormatterOptions:UseUtcTimestamp", "true"),
+ new KeyValuePair("Console:FormatterOptions:IncludeScopes", "true"),
+ new KeyValuePair("Console:FormatterOptions:JsonWriterOptions:Indented", "true"),
+ }).Build();
+
+ var loggerProvider = new ServiceCollection()
+ .AddLogging(builder => builder
+ .AddConfiguration(configuration)
+ .AddJsonConsole(o => {})
+ )
+ .BuildServiceProvider()
+ .GetRequiredService();
+
+ var consoleLoggerProvider = Assert.IsType(loggerProvider);
+ var logger = (ConsoleLogger)consoleLoggerProvider.CreateLogger("Category");
+ Assert.Equal(ConsoleFormatterNames.Json, logger.Options.FormatterName);
+ var formatter = Assert.IsType(logger.Formatter);
+ Assert.Equal("HH:mm ", formatter.FormatterOptions.TimestampFormat);
+ Assert.True(formatter.FormatterOptions.UseUtcTimestamp);
+ Assert.True(formatter.FormatterOptions.IncludeScopes);
+ Assert.True(formatter.FormatterOptions.JsonWriterOptions.Indented);
+ }
+
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/38337", TestPlatforms.Browser)]
+ public void AddJsonConsole_OutsideConfig_TakesProperty()
+ {
+ var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] {
+ new KeyValuePair("Console:FormatterOptions:TimestampFormat", "HH:mm "),
+ new KeyValuePair("Console:FormatterOptions:UseUtcTimestamp", "true"),
+ new KeyValuePair("Console:FormatterOptions:IncludeScopes", "true"),
+ }).Build();
+
+ var loggerProvider = new ServiceCollection()
+ .AddLogging(builder => builder
+ .AddConfiguration(configuration)
+ .AddJsonConsole(o => {
+ o.JsonWriterOptions = new JsonWriterOptions()
+ {
+ Indented = false,
+ Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping
+ };
+ })
+ )
+ .BuildServiceProvider()
+ .GetRequiredService();
+
+ var consoleLoggerProvider = Assert.IsType(loggerProvider);
+ var logger = (ConsoleLogger)consoleLoggerProvider.CreateLogger("Category");
+ Assert.Equal(ConsoleFormatterNames.Json, logger.Options.FormatterName);
+ var formatter = Assert.IsType(logger.Formatter);
+ Assert.Equal("HH:mm ", formatter.FormatterOptions.TimestampFormat);
+ Assert.True(formatter.FormatterOptions.UseUtcTimestamp);
+ Assert.True(formatter.FormatterOptions.IncludeScopes);
+ Assert.False(formatter.FormatterOptions.JsonWriterOptions.Indented);
+ Assert.Equal(JavaScriptEncoder.UnsafeRelaxedJsonEscaping, formatter.FormatterOptions.JsonWriterOptions.Encoder);
+ }
+
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/38337", TestPlatforms.Browser)]
+ public void AddConsole_NullFormatterNameUsingSystemdFormat_AnyDeprecatedPropertiesOverwriteFormatterOptions()
+ {
+ var configs = new[] {
+ new KeyValuePair("Console:Format", "Systemd"),
+ new KeyValuePair("Console:TimestampFormat", "HH:mm:ss "),
+ new KeyValuePair("Console:FormatterOptions:TimestampFormat", "HH:mm "),
+ };
+ var configuration = new ConfigurationBuilder().AddInMemoryCollection(configs).Build();
+
+ var loggerProvider = new ServiceCollection()
+ .AddLogging(builder => builder
+ .AddConfiguration(configuration)
+ .AddConsole(o => { })
+ )
+ .BuildServiceProvider()
+ .GetRequiredService();
+
+ var consoleLoggerProvider = Assert.IsType(loggerProvider);
+ var logger = (ConsoleLogger)consoleLoggerProvider.CreateLogger("Category");
+ Assert.Null(logger.Options.FormatterName);
+ var formatter = Assert.IsType(logger.Formatter);
+ Assert.Equal("HH:mm:ss ", formatter.FormatterOptions.TimestampFormat);
+ }
+
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/38337", TestPlatforms.Browser)]
+ public void AddConsole_NullFormatterName_UsingSystemdFormat_IgnoreFormatterOptionsAndUseDeprecatedInstead()
+ {
+ var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] {
+ new KeyValuePair("Console:Format", "Systemd"),
+ new KeyValuePair("Console:IncludeScopes", "true"),
+ new KeyValuePair("Console:TimestampFormat", "HH:mm:ss "),
+ new KeyValuePair("Console:FormatterOptions:TimestampFormat", "HH:mm "),
+ }).Build();
+
+ var loggerProvider = new ServiceCollection()
+ .AddLogging(builder => builder
+ .AddConfiguration(configuration)
+ .AddConsole(o => {
+#pragma warning disable CS0618
+ o.IncludeScopes = false;
+#pragma warning restore CS0618
+ })
+ )
+ .BuildServiceProvider()
+ .GetRequiredService();
+
+ var consoleLoggerProvider = Assert.IsType(loggerProvider);
+ var logger = (ConsoleLogger)consoleLoggerProvider.CreateLogger("Category");
+ Assert.Null(logger.Options.FormatterName);
+ var formatter = Assert.IsType(logger.Formatter);
+
+ Assert.Equal("HH:mm:ss ", formatter.FormatterOptions.TimestampFormat); // ignore FormatterOptions, using deprecated one
+ Assert.False(formatter.FormatterOptions.UseUtcTimestamp); // not set anywhere, defaulted to false
+ Assert.False(formatter.FormatterOptions.IncludeScopes); // setup using lambda wins over config
+ }
+
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/38337", TestPlatforms.Browser)]
+ public void AddConsole_NullFormatterName_UsingDefaultFormat_IgnoreFormatterOptionsAndUseDeprecatedInstead()
+ {
+ var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] {
+ new KeyValuePair("Console:Format", "Default"),
+ new KeyValuePair("Console:IncludeScopes", "true"),
+ new KeyValuePair("Console:TimestampFormat", "HH:mm:ss "),
+ new KeyValuePair("Console:FormatterOptions:SingleLine", "true"),
+ new KeyValuePair("Console:FormatterOptions:TimestampFormat", "HH:mm "),
+ }).Build();
+
+ var loggerProvider = new ServiceCollection()
+ .AddLogging(builder => builder
+ .AddConfiguration(configuration)
+ .AddConsole(o => {
+#pragma warning disable CS0618
+ o.DisableColors = true;
+ o.IncludeScopes = false;
+#pragma warning restore CS0618
+ })
+ )
+ .BuildServiceProvider()
+ .GetRequiredService();
+
+ var consoleLoggerProvider = Assert.IsType(loggerProvider);
+ var logger = (ConsoleLogger)consoleLoggerProvider.CreateLogger("Category");
+ Assert.Null(logger.Options.FormatterName);
+#pragma warning disable CS0618
+ Assert.True(logger.Options.DisableColors);
+#pragma warning restore CS0618
+ var formatter = Assert.IsType(logger.Formatter);
+
+ Assert.False(formatter.FormatterOptions.SingleLine); // ignored
+ Assert.Equal("HH:mm:ss ", formatter.FormatterOptions.TimestampFormat); // ignore FormatterOptions, using deprecated one
+ Assert.False(formatter.FormatterOptions.UseUtcTimestamp); // not set anywhere, defaulted to false
+ Assert.False(formatter.FormatterOptions.IncludeScopes); // setup using lambda wins over config
+ Assert.True(formatter.FormatterOptions.DisableColors); // setup using lambda
+ }
+
+ [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [InlineData("missingFormatter")]
+ [InlineData("simple")]
+ [InlineData("Simple")]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/38337", TestPlatforms.Browser)]
+ public void AddConsole_FormatterNameIsSet_UsingDefaultFormat_IgnoreDeprecatedAndUseFormatterOptionsInstead(string formatterName)
+ {
+ var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] {
+ new KeyValuePair("Console:Format", "Default"),
+ new KeyValuePair("Console:FormatterName", formatterName),
+ new KeyValuePair("Console:TimestampFormat", "HH:mm:ss "),
+ new KeyValuePair("Console:FormatterOptions:IncludeScopes", "true"),
+ new KeyValuePair("Console:FormatterOptions:SingleLine", "true"),
+ new KeyValuePair("Console:FormatterOptions:TimestampFormat", "HH:mm "),
+ }).Build();
+
+ var loggerProvider = new ServiceCollection()
+ .AddLogging(builder => builder
+ .AddConfiguration(configuration)
+ .AddConsole(o => {
+#pragma warning disable CS0618
+ o.DisableColors = true;
+ o.IncludeScopes = false;
+#pragma warning restore CS0618
+ })
+ )
+ .BuildServiceProvider()
+ .GetRequiredService();
+
+ var consoleLoggerProvider = Assert.IsType(loggerProvider);
+ var logger = (ConsoleLogger)consoleLoggerProvider.CreateLogger("Category");
+ Assert.Equal(formatterName, logger.Options.FormatterName);
+#pragma warning disable CS0618
+ Assert.True(logger.Options.DisableColors);
+#pragma warning restore CS0618
+ var formatter = Assert.IsType(logger.Formatter);
+
+ Assert.True(formatter.FormatterOptions.SingleLine); // picked from FormatterOptions
+ Assert.Equal("HH:mm ", formatter.FormatterOptions.TimestampFormat); // ignore deprecated, using FormatterOptions instead
+ Assert.False(formatter.FormatterOptions.UseUtcTimestamp); // not set anywhere, defaulted to false
+ Assert.True(formatter.FormatterOptions.IncludeScopes); // ignore deprecated set in lambda use FormatterOptions instead
+ Assert.False(formatter.FormatterOptions.DisableColors); // ignore deprecated set in lambda, defaulted to false
+ }
+
+ [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [InlineData("missingFormatter")]
+ [InlineData("systemd")]
+ [InlineData("Systemd")]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/38337", TestPlatforms.Browser)]
+ public void AddConsole_FormatterNameIsSet_UsingSystemdFormat_IgnoreDeprecatedAndUseFormatterOptionsInstead(string formatterName)
+ {
+ var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] {
+ new KeyValuePair("Console:Format", "Systemd"),
+ new KeyValuePair("Console:FormatterName", formatterName),
+ new KeyValuePair("Console:TimestampFormat", "HH:mm:ss "),
+ new KeyValuePair("Console:FormatterOptions:IncludeScopes", "true"),
+ new KeyValuePair("Console:FormatterOptions:TimestampFormat", "HH:mm "),
+ }).Build();
+
+ var loggerProvider = new ServiceCollection()
+ .AddLogging(builder => builder
+ .AddConfiguration(configuration)
+ .AddConsole(o => {
+#pragma warning disable CS0618
+ o.UseUtcTimestamp = true;
+ o.IncludeScopes = false;
+#pragma warning restore CS0618
+ })
+ )
+ .BuildServiceProvider()
+ .GetRequiredService();
+
+ var consoleLoggerProvider = Assert.IsType(loggerProvider);
+ var logger = (ConsoleLogger)consoleLoggerProvider.CreateLogger("Category");
+ Assert.Equal(formatterName, logger.Options.FormatterName);
+#pragma warning disable CS0618
+ Assert.True(logger.Options.UseUtcTimestamp);
+#pragma warning restore CS0618
+ var formatter = Assert.IsType(logger.Formatter);
+
+ Assert.Equal("HH:mm ", formatter.FormatterOptions.TimestampFormat); // ignore deprecated, using FormatterOptions instead
+ Assert.True(formatter.FormatterOptions.IncludeScopes); // ignore deprecated set in lambda use FormatterOptions instead
+ Assert.False(formatter.FormatterOptions.UseUtcTimestamp); // ignore deprecated set in lambda, defaulted to false
+ }
+
+ public static TheoryData FormatterNames
+ {
+ get
+ {
+ var data = new TheoryData();
+ data.Add(ConsoleFormatterNames.Simple);
+ data.Add(ConsoleFormatterNames.Systemd);
+ data.Add(ConsoleFormatterNames.Json);
+ return data;
+ }
+ }
+ }
+}
diff --git a/src/libraries/Microsoft.Extensions.Logging/tests/Common/ConsoleLoggerTest.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/ConsoleLoggerTest.cs
similarity index 83%
rename from src/libraries/Microsoft.Extensions.Logging/tests/Common/ConsoleLoggerTest.cs
rename to src/libraries/Microsoft.Extensions.Logging.Console/tests/ConsoleLoggerTest.cs
index dfbf0927117e..9f6a99f5d7d9 100644
--- a/src/libraries/Microsoft.Extensions.Logging/tests/Common/ConsoleLoggerTest.cs
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/tests/ConsoleLoggerTest.cs
@@ -2,17 +2,18 @@
// The .NET Foundation licenses this file to you under the MIT license.
using System;
+using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Logging.Console;
using Microsoft.Extensions.Logging.Test.Console;
using Microsoft.Extensions.Options;
using Xunit;
+#pragma warning disable CS0618
-namespace Microsoft.Extensions.Logging.Test
+namespace Microsoft.Extensions.Logging.Console.Test
{
public class ConsoleLoggerTest
{
@@ -21,6 +22,22 @@ public class ConsoleLoggerTest
private const string _state = "This is a test, and {curly braces} are just fine!";
private readonly Func _defaultFormatter = (state, exception) => state.ToString();
+ internal static IEnumerable GetFormatters(
+ SimpleConsoleFormatterOptions simpleOptions = null,
+ ConsoleFormatterOptions systemdOptions = null,
+ JsonConsoleFormatterOptions jsonOptions = null)
+ {
+ var defaultMonitor = new TestFormatterOptionsMonitor(simpleOptions ?? new SimpleConsoleFormatterOptions());
+ var systemdMonitor = new TestFormatterOptionsMonitor(systemdOptions ?? new ConsoleFormatterOptions());
+ var jsonMonitor = new TestFormatterOptionsMonitor(jsonOptions ?? new JsonConsoleFormatterOptions());
+ var formatters = new List() {
+ new SimpleConsoleFormatter(defaultMonitor),
+ new SystemdConsoleFormatter(systemdMonitor),
+ new JsonConsoleFormatter(jsonMonitor)
+ };
+ return formatters;
+ }
+
private static (ConsoleLogger Logger, ConsoleSink Sink, ConsoleSink ErrorSink, Func GetLevelPrefix, int WritesPerMsg) SetUp(ConsoleLoggerOptions options = null)
{
// Arrange
@@ -35,6 +52,8 @@ private static (ConsoleLogger Logger, ConsoleSink Sink, ConsoleSink ErrorSink, F
var logger = new ConsoleLogger(_loggerName, consoleLoggerProcessor);
logger.ScopeProvider = new LoggerExternalScopeProvider();
logger.Options = options ?? new ConsoleLoggerOptions();
+ var formatters = new ConcurrentDictionary(GetFormatters().ToDictionary(f => f.Name));
+
Func levelAsString;
int writesPerMsg;
switch (logger.Options.Format)
@@ -42,18 +61,62 @@ private static (ConsoleLogger Logger, ConsoleSink Sink, ConsoleSink ErrorSink, F
case ConsoleLoggerFormat.Default:
levelAsString = LogLevelAsStringDefault;
writesPerMsg = 2;
+ logger.Formatter = formatters[ConsoleFormatterNames.Simple];
break;
case ConsoleLoggerFormat.Systemd:
levelAsString = GetSyslogSeverityString;
writesPerMsg = 1;
+ logger.Formatter = formatters[ConsoleFormatterNames.Systemd];
break;
default:
throw new ArgumentOutOfRangeException(nameof(logger.Options.Format));
}
+
+ UpdateFormatterOptions(logger.Formatter, logger.Options);
+ VerifyDeprecatedPropertiesUsedOnNullFormatterName(logger);
return (logger, sink, errorSink, levelAsString, writesPerMsg);
}
- private static string LogLevelAsStringDefault(LogLevel level)
+ private static void VerifyDeprecatedPropertiesUsedOnNullFormatterName(ConsoleLogger logger)
+ {
+ Assert.Null(logger.Options.FormatterName);
+ if (ConsoleLoggerFormat.Default == logger.Options.Format)
+ {
+ var formatter = Assert.IsType(logger.Formatter);
+ Assert.Equal(formatter.FormatterOptions.IncludeScopes, logger.Options.IncludeScopes);
+ Assert.Equal(formatter.FormatterOptions.UseUtcTimestamp, logger.Options.UseUtcTimestamp);
+ Assert.Equal(formatter.FormatterOptions.TimestampFormat, logger.Options.TimestampFormat);
+ Assert.Equal(formatter.FormatterOptions.DisableColors, logger.Options.DisableColors);
+ }
+ else
+ {
+ var formatter = Assert.IsType(logger.Formatter);
+ Assert.Equal(formatter.FormatterOptions.IncludeScopes, logger.Options.IncludeScopes);
+ Assert.Equal(formatter.FormatterOptions.UseUtcTimestamp, logger.Options.UseUtcTimestamp);
+ Assert.Equal(formatter.FormatterOptions.TimestampFormat, logger.Options.TimestampFormat);
+ }
+ }
+
+ private static void UpdateFormatterOptions(ConsoleFormatter formatter, ConsoleLoggerOptions deprecatedFromOptions)
+ {
+ // kept for deprecated apis:
+ if (formatter is SimpleConsoleFormatter defaultFormatter)
+ {
+ defaultFormatter.FormatterOptions.DisableColors = deprecatedFromOptions.DisableColors;
+ defaultFormatter.FormatterOptions.IncludeScopes = deprecatedFromOptions.IncludeScopes;
+ defaultFormatter.FormatterOptions.TimestampFormat = deprecatedFromOptions.TimestampFormat;
+ defaultFormatter.FormatterOptions.UseUtcTimestamp = deprecatedFromOptions.UseUtcTimestamp;
+ }
+ else
+ if (formatter is SystemdConsoleFormatter systemdFormatter)
+ {
+ systemdFormatter.FormatterOptions.IncludeScopes = deprecatedFromOptions.IncludeScopes;
+ systemdFormatter.FormatterOptions.TimestampFormat = deprecatedFromOptions.TimestampFormat;
+ systemdFormatter.FormatterOptions.UseUtcTimestamp = deprecatedFromOptions.UseUtcTimestamp;
+ }
+ }
+
+ internal static string LogLevelAsStringDefault(LogLevel level)
{
switch (level)
{
@@ -74,7 +137,7 @@ private static string LogLevelAsStringDefault(LogLevel level)
}
}
- private static string GetSyslogSeverityString(LogLevel level)
+ internal static string GetSyslogSeverityString(LogLevel level)
{
switch (level)
{
@@ -94,6 +157,20 @@ private static string GetSyslogSeverityString(LogLevel level)
}
}
+ internal static string GetJsonLogLevelString(LogLevel logLevel)
+ {
+ return logLevel switch
+ {
+ LogLevel.Trace => "Trace",
+ LogLevel.Debug => "Debug",
+ LogLevel.Information => "Information",
+ LogLevel.Warning => "Warning",
+ LogLevel.Error => "Error",
+ LogLevel.Critical => "Critical",
+ _ => throw new ArgumentOutOfRangeException(nameof(logLevel))
+ };
+ }
+
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public void LogsWhenMessageIsNotProvided()
{
@@ -112,17 +189,17 @@ public void LogsWhenMessageIsNotProvided()
Assert.Equal(6, sink.Writes.Count);
Assert.Equal(
"crit: test[0]" + Environment.NewLine +
- " [null]" + Environment.NewLine,
+ _paddingString + "[null]" + Environment.NewLine,
GetMessage(sink.Writes.GetRange(0 * t.WritesPerMsg, t.WritesPerMsg)));
Assert.Equal(
"crit: test[0]" + Environment.NewLine +
- " [null]" + Environment.NewLine,
+ _paddingString + "[null]" + Environment.NewLine,
GetMessage(sink.Writes.GetRange(1 * t.WritesPerMsg, t.WritesPerMsg)));
Assert.Equal(
"crit: test[0]" + Environment.NewLine +
- " [null]" + Environment.NewLine +
- "System.InvalidOperationException: Invalid value" + Environment.NewLine,
+ _paddingString + "[null]" + Environment.NewLine +
+ _paddingString + "System.InvalidOperationException: Invalid value" + Environment.NewLine,
GetMessage(sink.Writes.GetRange(2 * t.WritesPerMsg, t.WritesPerMsg)));
}
@@ -133,12 +210,12 @@ public void DoesNotLog_NewLine_WhenNoExceptionIsProvided()
var t = SetUp();
var logger = (ILogger)t.Logger;
var sink = t.Sink;
- var logMessage = "Route with name 'Default' was not found.";
+ var logMessage = "Route with name 'Simple' was not found.";
var expected1 = @"crit: test[0]" + Environment.NewLine +
- " Route with name 'Default' was not found." + Environment.NewLine;
+ _paddingString + "Route with name 'Simple' was not found." + Environment.NewLine;
var expected2 = @"crit: test[10]" + Environment.NewLine +
- " Route with name 'Default' was not found." + Environment.NewLine;
+ _paddingString + "Route with name 'Simple' was not found." + Environment.NewLine;
// Act
logger.LogCritical(logMessage);
@@ -155,7 +232,49 @@ public void DoesNotLog_NewLine_WhenNoExceptionIsProvided()
}
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
- [InlineData("Route with name 'Default' was not found.")]
+ [InlineData(null, 0)]
+ [InlineData(null, 1)]
+ [InlineData("missingFormatter", 0)]
+ [InlineData("missingFormatter", 1)]
+ public void Options_FormatterNameNull_UsesDeprecatedProperties(string formatterName, int formatNumber)
+ {
+ // Arrange
+ ConsoleLoggerFormat format = (ConsoleLoggerFormat)formatNumber;
+ var options = new ConsoleLoggerOptions() { FormatterName = formatterName };
+ var monitor = new TestOptionsMonitor(options);
+ var loggerProvider = new ConsoleLoggerProvider(monitor, GetFormatters());
+ var logger = (ConsoleLogger)loggerProvider.CreateLogger("Name");
+
+ // Act
+ monitor.Set(new ConsoleLoggerOptions() { FormatterName = null, Format = format, TimestampFormat = "HH:mm:ss " });
+
+ // Assert
+ switch (format)
+ {
+ case ConsoleLoggerFormat.Default:
+ {
+ Assert.Null(logger.Options.FormatterName);
+ Assert.Equal(ConsoleFormatterNames.Simple, logger.Formatter.Name);
+ var formatter = Assert.IsType(logger.Formatter);
+ Assert.Equal("HH:mm:ss ", formatter.FormatterOptions.TimestampFormat);
+ }
+ break;
+ case ConsoleLoggerFormat.Systemd:
+ {
+ Assert.Null(logger.Options.FormatterName);
+ Assert.Equal(ConsoleFormatterNames.Systemd, logger.Formatter.Name);
+ var formatter = Assert.IsType(logger.Formatter);
+ Assert.Equal("HH:mm:ss ", formatter.FormatterOptions.TimestampFormat);
+ }
+ break;
+ default:
+ throw new ArgumentOutOfRangeException(nameof(format));
+ }
+ loggerProvider?.Dispose();
+ }
+
+ [ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ [InlineData("Route with name 'Simple' was not found.")]
public void Writes_NewLine_WhenExceptionIsProvided(string message)
{
// Arrange
@@ -168,7 +287,7 @@ public void Writes_NewLine_WhenExceptionIsProvided(string message)
var expectedMessage =
_paddingString + message + Environment.NewLine;
var expectedExceptionMessage =
- exception.ToString() + Environment.NewLine;
+ _paddingString + exception.ToString() + Environment.NewLine;
// Act
logger.LogCritical(eventId, exception, message);
@@ -224,7 +343,7 @@ public void WriteCritical_LogsCorrectColors()
// Assert
Assert.Equal(2, sink.Writes.Count);
var write = sink.Writes[0];
- Assert.Equal(ConsoleColor.Red, write.BackgroundColor);
+ Assert.Equal(ConsoleColor.DarkRed, write.BackgroundColor);
Assert.Equal(ConsoleColor.White, write.ForegroundColor);
write = sink.Writes[1];
Assert.Equal(TestConsole.DefaultBackgroundColor, write.BackgroundColor);
@@ -245,7 +364,7 @@ public void WriteError_LogsCorrectColors()
// Assert
Assert.Equal(2, sink.Writes.Count);
var write = sink.Writes[0];
- Assert.Equal(ConsoleColor.Red, write.BackgroundColor);
+ Assert.Equal(ConsoleColor.DarkRed, write.BackgroundColor);
Assert.Equal(ConsoleColor.Black, write.ForegroundColor);
write = sink.Writes[1];
Assert.Equal(TestConsole.DefaultBackgroundColor, write.BackgroundColor);
@@ -352,7 +471,7 @@ public void WriteAllLevelsDisabledColors_LogsNoColors()
}
// Assert
- Assert.Equal(2 * levelSequence, sink.Writes.Count);
+ Assert.Equal(levelSequence, sink.Writes.Count);
foreach (ConsoleContext write in sink.Writes)
{
Assert.Null(write.ForegroundColor);
@@ -362,7 +481,7 @@ public void WriteAllLevelsDisabledColors_LogsNoColors()
[ConditionalTheory(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
[MemberData(nameof(FormatsAndLevels))]
- public void WriteCore_LogsCorrectTimestamp(ConsoleLoggerFormat format, LogLevel level)
+ public void Log_LogsCorrectTimestamp(ConsoleLoggerFormat format, LogLevel level)
{
// Arrange
var t = SetUp(new ConsoleLoggerOptions { TimestampFormat = "yyyy-MM-ddTHH:mm:sszz ", Format = format, UseUtcTimestamp = false });
@@ -464,9 +583,9 @@ public void WriteCore_LogsCorrectMessages(ConsoleLoggerFormat format, LogLevel l
Assert.Equal(2, sink.Writes.Count);
Assert.Equal(
levelPrefix + ": test[0]" + Environment.NewLine +
- " This is a test, and {curly braces} are just fine!" + Environment.NewLine +
- "System.Exception: Exception message" + Environment.NewLine +
- "with a second line" + Environment.NewLine,
+ _paddingString + "This is a test, and {curly braces} are just fine!" + Environment.NewLine +
+ _paddingString + "System.Exception: Exception message" + Environment.NewLine +
+ _paddingString + "with a second line" + Environment.NewLine,
GetMessage(sink.Writes));
}
break;
@@ -662,6 +781,8 @@ public void WritingNestedScopes_LogsExpectedMessage(ConsoleLoggerFormat format)
{
// Assert
Assert.Equal(2, sink.Writes.Count);
+ var formatter = Assert.IsType(logger.Formatter);
+ Assert.True(formatter.FormatterOptions.IncludeScopes);
// scope
var write = sink.Writes[1];
Assert.Equal(header + Environment.NewLine
@@ -675,6 +796,8 @@ public void WritingNestedScopes_LogsExpectedMessage(ConsoleLoggerFormat format)
{
// Assert
Assert.Single(sink.Writes);
+ var formatter = Assert.IsType(logger.Formatter);
+ Assert.True(formatter.FormatterOptions.IncludeScopes);
// scope
var write = sink.Writes[0];
Assert.Equal(levelPrefix + header + " " + scope + " " + message + Environment.NewLine, write.Message);
@@ -811,13 +934,13 @@ public void ConsoleLoggerLogsToError_WhenOverErrorLevel(ConsoleLoggerFormat form
Assert.Equal(2, sink.Writes.Count);
Assert.Equal(
"info: test[0]" + Environment.NewLine +
- " Info" + Environment.NewLine,
+ _paddingString + "Info" + Environment.NewLine,
GetMessage(sink.Writes));
Assert.Equal(2, errorSink.Writes.Count);
Assert.Equal(
"warn: test[0]" + Environment.NewLine +
- " Warn" + Environment.NewLine,
+ _paddingString + "Warn" + Environment.NewLine,
GetMessage(errorSink.Writes));
}
break;
@@ -863,8 +986,8 @@ public void WriteCore_NullMessageWithException(ConsoleLoggerFormat format, LogLe
Assert.Equal(2, sink.Writes.Count);
Assert.Equal(
levelPrefix + ": test[0]" + Environment.NewLine +
- "System.Exception: Exception message" + Environment.NewLine +
- "with a second line" + Environment.NewLine,
+ _paddingString + "System.Exception: Exception message" + Environment.NewLine +
+ _paddingString + "with a second line" + Environment.NewLine,
GetMessage(sink.Writes));
}
break;
@@ -906,8 +1029,8 @@ public void WriteCore_EmptyMessageWithException(ConsoleLoggerFormat format, LogL
Assert.Equal(2, sink.Writes.Count);
Assert.Equal(
levelPrefix + ": test[0]" + Environment.NewLine +
- "System.Exception: Exception message" + Environment.NewLine +
- "with a second line" + Environment.NewLine,
+ _paddingString + "System.Exception: Exception message" + Environment.NewLine +
+ _paddingString + "with a second line" + Environment.NewLine,
GetMessage(sink.Writes));
}
break;
@@ -948,7 +1071,7 @@ public void WriteCore_MessageWithNullException(ConsoleLoggerFormat format, LogLe
Assert.Equal(2, sink.Writes.Count);
Assert.Equal(
levelPrefix + ": test[0]" + Environment.NewLine +
- " This is a test, and {curly braces} are just fine!" + Environment.NewLine,
+ _paddingString + "This is a test, and {curly braces} are just fine!" + Environment.NewLine,
GetMessage(sink.Writes));
}
break;
@@ -992,9 +1115,13 @@ public void LogAfterDisposeWritesLog()
var console = new TestConsole(sink);
var processor = new ConsoleLoggerProcessor();
processor.Console = console;
+ var formatters = new ConcurrentDictionary(GetFormatters().ToDictionary(f => f.Name));
var logger = new ConsoleLogger(_loggerName, loggerProcessor: processor);
logger.Options = new ConsoleLoggerOptions();
+ Assert.Null(logger.Options.FormatterName);
+ logger.Formatter = formatters[ConsoleFormatterNames.Simple];
+ UpdateFormatterOptions(logger.Formatter, logger.Options);
// Act
processor.Dispose();
logger.LogInformation("Logging after dispose");
@@ -1031,8 +1158,13 @@ public void ConsoleLoggerOptions_DisableColors_IsAppliedToLoggers()
Assert.False(logger.Options.DisableColors);
}
- [Fact]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/38337", TestPlatforms.Browser)]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ public void ConsoleLoggerOptions_InvalidFormat_Throws()
+ {
+ Assert.Throws(() => new ConsoleLoggerOptions() { Format = (ConsoleLoggerFormat)10 });
+ }
+
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public void ConsoleLoggerOptions_DisableColors_IsReadFromLoggingConfiguration()
{
var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { new KeyValuePair("Console:DisableColors", "true") }).Build();
@@ -1063,8 +1195,7 @@ public void ConsoleLoggerOptions_TimeStampFormat_IsReloaded()
Assert.Equal("yyyyMMddHHmmss", logger.Options.TimestampFormat);
}
- [Fact]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/38337", TestPlatforms.Browser)]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public void ConsoleLoggerOptions_TimeStampFormat_IsReadFromLoggingConfiguration()
{
var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { new KeyValuePair("Console:TimeStampFormat", "yyyyMMddHHmmss") }).Build();
@@ -1109,8 +1240,7 @@ public void ConsoleLoggerOptions_IncludeScopes_IsAppliedToLoggers()
Assert.False(logger.Options.IncludeScopes);
}
- [Fact]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/38337", TestPlatforms.Browser)]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public void ConsoleLoggerOptions_LogAsErrorLevel_IsReadFromLoggingConfiguration()
{
var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { new KeyValuePair("Console:LogToStandardErrorThreshold", "Warning") }).Build();
@@ -1155,8 +1285,7 @@ public void ConsoleLoggerOptions_UseUtcTimestamp_IsAppliedToLoggers()
Assert.True(logger.Options.UseUtcTimestamp);
}
- [Fact]
- [ActiveIssue("https://github.com/dotnet/runtime/issues/38337", TestPlatforms.Browser)]
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public void ConsoleLoggerOptions_IncludeScopes_IsReadFromLoggingConfiguration()
{
var configuration = new ConfigurationBuilder().AddInMemoryCollection(new[] { new KeyValuePair("Console:IncludeScopes", "true") }).Build();
@@ -1171,6 +1300,8 @@ public void ConsoleLoggerOptions_IncludeScopes_IsReadFromLoggingConfiguration()
var consoleLoggerProvider = Assert.IsType(loggerProvider);
var logger = (ConsoleLogger)consoleLoggerProvider.CreateLogger("Category");
Assert.NotNull(logger.ScopeProvider);
+ var formatter = Assert.IsType(logger.Formatter);
+ Assert.True(formatter.FormatterOptions.IncludeScopes);
}
public static TheoryData FormatsAndLevels
@@ -1237,18 +1368,17 @@ private string CreateHeader(ConsoleLoggerFormat format, int eventId = 0)
throw new ArgumentOutOfRangeException(nameof(format));
}
}
+ }
-
- private class TestLoggerProcessor : ConsoleLoggerProcessor
+ internal class TestLoggerProcessor : ConsoleLoggerProcessor
+ {
+ public TestLoggerProcessor()
{
- public TestLoggerProcessor()
- {
- }
+ }
- public override void EnqueueMessage(LogMessageEntry message)
- {
- WriteMessage(message);
- }
+ public override void EnqueueMessage(LogMessageEntry message)
+ {
+ WriteMessage(message);
}
}
@@ -1279,3 +1409,4 @@ public void Set(ConsoleLoggerOptions options)
}
}
}
+#pragma warning restore CS0618
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/tests/JsonConsoleFormatterTests.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/JsonConsoleFormatterTests.cs
new file mode 100644
index 000000000000..f5e536d94adb
--- /dev/null
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/tests/JsonConsoleFormatterTests.cs
@@ -0,0 +1,48 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using System;
+using System.Text.Json;
+using Microsoft.Extensions.Logging.Abstractions;
+using Microsoft.Extensions.Logging.Console;
+using Microsoft.Extensions.Logging.Test.Console;
+using Xunit;
+
+namespace Microsoft.Extensions.Logging.Console.Test
+{
+ public class JsonConsoleFormatterTests : ConsoleFormatterTests
+ {
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ public void NoLogScope_DoesNotWriteAnyScopeContentToOutput_Json()
+ {
+ // Arrange
+ var t = ConsoleFormatterTests.SetUp(
+ new ConsoleLoggerOptions { FormatterName = ConsoleFormatterNames.Json },
+ new SimpleConsoleFormatterOptions { IncludeScopes = true },
+ new ConsoleFormatterOptions { IncludeScopes = true },
+ new JsonConsoleFormatterOptions {
+ IncludeScopes = true,
+ JsonWriterOptions = new JsonWriterOptions() { Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping }
+ });
+ var logger = t.Logger;
+ var sink = t.Sink;
+
+ // Act
+ using (logger.BeginScope("Scope with named parameter {namedParameter}", 123))
+ using (logger.BeginScope("SimpleScope"))
+ logger.Log(LogLevel.Warning, 0, "Message with {args}", 73, _defaultFormatter);
+
+ // Assert
+ Assert.Equal(1, sink.Writes.Count);
+ var write = sink.Writes[0];
+ Assert.Equal(TestConsole.DefaultBackgroundColor, write.BackgroundColor);
+ Assert.Equal(TestConsole.DefaultForegroundColor, write.ForegroundColor);
+ Assert.Contains("Message with {args}", write.Message);
+ Assert.Contains("73", write.Message);
+ Assert.Contains("{OriginalFormat}", write.Message);
+ Assert.Contains("namedParameter", write.Message);
+ Assert.Contains("123", write.Message);
+ Assert.Contains("SimpleScope", write.Message);
+ }
+ }
+}
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests.csproj b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests.csproj
new file mode 100644
index 000000000000..2524f77b4b46
--- /dev/null
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/tests/Microsoft.Extensions.Logging.Console.Tests.csproj
@@ -0,0 +1,13 @@
+
+
+
+ $(NetCoreAppCurrent);$(NetFrameworkCurrent)
+ true
+ true
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/tests/SimpleConsoleFormatterTests.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/SimpleConsoleFormatterTests.cs
new file mode 100644
index 000000000000..d92c8af95148
--- /dev/null
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/tests/SimpleConsoleFormatterTests.cs
@@ -0,0 +1,96 @@
+// 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 Microsoft.Extensions.Logging.Test.Console;
+using Xunit;
+
+namespace Microsoft.Extensions.Logging.Console.Test
+{
+ public class SimpleConsoleFormatterTests : ConsoleFormatterTests
+ {
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ public void Log_WritingScopes_LogsWithCorrectColors()
+ {
+ // Arrange
+ var t = SetUp(
+ new ConsoleLoggerOptions { FormatterName = ConsoleFormatterNames.Simple },
+ new SimpleConsoleFormatterOptions { IncludeScopes = true }
+ );
+ var logger = t.Logger;
+ var sink = t.Sink;
+ var id = Guid.NewGuid();
+ var scopeMessage = "RequestId: {RequestId}";
+
+ // Act
+ using (logger.BeginScope(scopeMessage, id))
+ {
+ logger.Log(LogLevel.Information, 0, _state, null, _defaultFormatter);
+ }
+
+ // Assert
+ Assert.Equal(2, sink.Writes.Count);
+ var write = sink.Writes[0];
+ Assert.Equal(ConsoleColor.Black, write.BackgroundColor);
+ Assert.Equal(ConsoleColor.DarkGreen, write.ForegroundColor);
+ write = sink.Writes[1];
+ Assert.Equal(TestConsole.DefaultBackgroundColor, write.BackgroundColor);
+ Assert.Equal(TestConsole.DefaultForegroundColor, write.ForegroundColor);
+ }
+
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ public void Log_NoLogScope_DoesNotWriteAnyScopeContentToOutput()
+ {
+ // Arrange
+ var t = SetUp(
+ new ConsoleLoggerOptions { FormatterName = ConsoleFormatterNames.Simple },
+ new SimpleConsoleFormatterOptions { IncludeScopes = true }
+ );
+ var logger = t.Logger;
+ var sink = t.Sink;
+
+ // Act
+ logger.Log(LogLevel.Warning, 0, _state, null, _defaultFormatter);
+
+ // Assert
+ Assert.Equal(2, sink.Writes.Count);
+ var write = sink.Writes[0];
+ Assert.Equal(ConsoleColor.Black, write.BackgroundColor);
+ Assert.Equal(ConsoleColor.Yellow, write.ForegroundColor);
+ write = sink.Writes[1];
+ Assert.Equal(TestConsole.DefaultBackgroundColor, write.BackgroundColor);
+ Assert.Equal(TestConsole.DefaultForegroundColor, write.ForegroundColor);
+ }
+
+ [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
+ public void Log_SingleLine_LogsWhenMessageIsNotProvided()
+ {
+ // Arrange
+ var t = SetUp(
+ new ConsoleLoggerOptions { FormatterName = ConsoleFormatterNames.Simple },
+ new SimpleConsoleFormatterOptions { SingleLine = true }
+ );
+ var logger = (ILogger)t.Logger;
+ var sink = t.Sink;
+ var exception = new InvalidOperationException("Invalid value");
+
+ // Act
+ logger.LogCritical(eventId: 0, exception: null, message: null);
+ logger.LogCritical(eventId: 0, message: null);
+ logger.LogCritical(eventId: 0, message: null, exception: exception);
+
+ // Assert
+ Assert.Equal(6, sink.Writes.Count);
+ Assert.Equal(
+ "crit: test[0]" + " " + "[null]" + Environment.NewLine,
+ GetMessage(sink.Writes.GetRange(0 * t.WritesPerMsg, t.WritesPerMsg)));
+ Assert.Equal(
+ "crit: test[0]" + " " + "[null]" + Environment.NewLine,
+ GetMessage(sink.Writes.GetRange(1 * t.WritesPerMsg, t.WritesPerMsg)));
+
+ Assert.Equal(
+ "crit: test[0]" + " " + "[null]" + "System.InvalidOperationException: Invalid value" + Environment.NewLine,
+ GetMessage(sink.Writes.GetRange(2 * t.WritesPerMsg, t.WritesPerMsg)));
+ }
+ }
+}
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/tests/TestFormatterOptionsMonitor.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/TestFormatterOptionsMonitor.cs
new file mode 100644
index 000000000000..90ee21e3439e
--- /dev/null
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/tests/TestFormatterOptionsMonitor.cs
@@ -0,0 +1,34 @@
+// 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 Microsoft.Extensions.Options;
+
+namespace Microsoft.Extensions.Logging.Console.Test
+{
+ internal class TestFormatterOptionsMonitor : IOptionsMonitor where TOptions : ConsoleFormatterOptions
+ {
+ private TOptions _options;
+ private event Action _onChange;
+ public TestFormatterOptionsMonitor(TOptions options)
+ {
+ _options = options;
+ }
+
+ public TOptions Get(string name) => _options;
+
+ public IDisposable OnChange(Action listener)
+ {
+ _onChange += listener;
+ return null;
+ }
+
+ public TOptions CurrentValue => _options;
+
+ public void Set(TOptions options)
+ {
+ _options = options;
+ _onChange?.Invoke(options, "");
+ }
+ }
+}
diff --git a/src/libraries/Microsoft.Extensions.Logging.Console/tests/TextWriterExtensionsTests.cs b/src/libraries/Microsoft.Extensions.Logging.Console/tests/TextWriterExtensionsTests.cs
new file mode 100644
index 000000000000..3c6520ebb9bf
--- /dev/null
+++ b/src/libraries/Microsoft.Extensions.Logging.Console/tests/TextWriterExtensionsTests.cs
@@ -0,0 +1,79 @@
+// 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.IO;
+using Xunit;
+
+namespace Microsoft.Extensions.Logging.Console.Test
+{
+ public class TextWriterExtensionsTests
+ {
+ [Fact]
+ public void WriteColoredMessage_WithForegroundEscapeCode_AndNoBackgroundColorSpecified()
+ {
+ // Arrange
+ var message = "Request received";
+ var expectedMessage = AnsiParser.GetForegroundColorEscapeCode(ConsoleColor.DarkGreen)
+ + message
+ + "\x1B[39m\x1B[22m"; //resets foreground color
+ var textWriter = new StringWriter();
+
+ // Act
+ textWriter.WriteColoredMessage(message, background: null, foreground: ConsoleColor.DarkGreen);
+
+ // Assert
+ Assert.Equal(expectedMessage, textWriter.ToString());
+ }
+
+ [Fact]
+ public void WriteColoredMessage_WithBackgroundEscapeCode_AndNoForegroundColorSpecified()
+ {
+ // Arrange
+ var message = "Request received";
+ var expectedMessage = AnsiParser.GetBackgroundColorEscapeCode(ConsoleColor.Red)
+ + message
+ + "\x1B[49m"; //resets background color
+ var textWriter = new StringWriter();
+
+ // Act
+ textWriter.WriteColoredMessage(message, background: ConsoleColor.Red, foreground: null);
+
+ // Assert
+ Assert.Equal(expectedMessage, textWriter.ToString());
+ }
+
+ [Fact]
+ public void WriteColoredMessage_InOrder_WhenBothForegroundOrBackgroundColorsSpecified()
+ {
+ // Arrange
+ var message = "Request received";
+ var expectedMessage = AnsiParser.GetBackgroundColorEscapeCode(ConsoleColor.Red)
+ + AnsiParser.GetForegroundColorEscapeCode(ConsoleColor.DarkGreen)
+ + "Request received"
+ + "\x1B[39m\x1B[22m" //resets foreground color
+ + "\x1B[49m"; //resets background color
+ var textWriter = new StringWriter();
+
+ // Act
+ textWriter.WriteColoredMessage(message, ConsoleColor.Red, ConsoleColor.DarkGreen);
+
+ // Assert
+ Assert.Equal(expectedMessage, textWriter.ToString());
+ }
+
+ [Fact]
+ public void WriteColoredMessage_NullColors_NoAnsiEmbedded()
+ {
+ // Arrange
+ var message = "Request received";
+ var textWriter = new StringWriter();
+
+ // Act
+ textWriter.WriteColoredMessage(message, null, null);
+
+ // Assert
+ Assert.Equal(message, textWriter.ToString());
+ }
+ }
+}
diff --git a/src/libraries/Microsoft.Extensions.Logging.Debug/src/Microsoft.Extensions.Logging.Debug.csproj b/src/libraries/Microsoft.Extensions.Logging.Debug/src/Microsoft.Extensions.Logging.Debug.csproj
index 048869e72d2f..d1d2c4274e5b 100644
--- a/src/libraries/Microsoft.Extensions.Logging.Debug/src/Microsoft.Extensions.Logging.Debug.csproj
+++ b/src/libraries/Microsoft.Extensions.Logging.Debug/src/Microsoft.Extensions.Logging.Debug.csproj
@@ -1,7 +1,7 @@
- $(NetCoreAppCurrent);netstandard2.0
+ $(NetCoreAppCurrent);netstandard2.0;net461;$(NetFrameworkCurrent)
true
@@ -22,4 +22,9 @@
+
+
+
+
+
diff --git a/src/libraries/Microsoft.Extensions.Logging.EventLog/src/Microsoft.Extensions.Logging.EventLog.csproj b/src/libraries/Microsoft.Extensions.Logging.EventLog/src/Microsoft.Extensions.Logging.EventLog.csproj
index 159cbede9d37..fca2aa1bcf1a 100644
--- a/src/libraries/Microsoft.Extensions.Logging.EventLog/src/Microsoft.Extensions.Logging.EventLog.csproj
+++ b/src/libraries/Microsoft.Extensions.Logging.EventLog/src/Microsoft.Extensions.Logging.EventLog.csproj
@@ -2,6 +2,7 @@
$(NetCoreAppCurrent);$(NetFrameworkCurrent);net461;netstandard2.0;netstandard2.1
+ true
true
diff --git a/src/libraries/Microsoft.Extensions.Logging.EventSource/src/Microsoft.Extensions.Logging.EventSource.csproj b/src/libraries/Microsoft.Extensions.Logging.EventSource/src/Microsoft.Extensions.Logging.EventSource.csproj
index ac39c2475843..d55f53f867f6 100644
--- a/src/libraries/Microsoft.Extensions.Logging.EventSource/src/Microsoft.Extensions.Logging.EventSource.csproj
+++ b/src/libraries/Microsoft.Extensions.Logging.EventSource/src/Microsoft.Extensions.Logging.EventSource.csproj
@@ -1,7 +1,8 @@
- $(NetCoreAppCurrent);netstandard2.0
+ $(NetCoreAppCurrent);netstandard2.0;net461;$(NetFrameworkCurrent)
+ true
true
true
@@ -30,8 +31,13 @@
-
+
+
+
+
+
+
diff --git a/src/libraries/Microsoft.Extensions.Logging.TraceSource/src/Microsoft.Extensions.Logging.TraceSource.csproj b/src/libraries/Microsoft.Extensions.Logging.TraceSource/src/Microsoft.Extensions.Logging.TraceSource.csproj
index cfdb67e93d30..ca883dd4c7dd 100644
--- a/src/libraries/Microsoft.Extensions.Logging.TraceSource/src/Microsoft.Extensions.Logging.TraceSource.csproj
+++ b/src/libraries/Microsoft.Extensions.Logging.TraceSource/src/Microsoft.Extensions.Logging.TraceSource.csproj
@@ -1,7 +1,8 @@
- $(NetCoreAppCurrent);netstandard2.0
+ $(NetCoreAppCurrent);netstandard2.0;net461;$(NetFrameworkCurrent)
+ true
true
@@ -18,4 +19,9 @@
+
+
+
+
+
diff --git a/src/libraries/Microsoft.Extensions.Logging/src/Microsoft.Extensions.Logging.csproj b/src/libraries/Microsoft.Extensions.Logging/src/Microsoft.Extensions.Logging.csproj
index 6c22af6efd16..5d4787254c6b 100644
--- a/src/libraries/Microsoft.Extensions.Logging/src/Microsoft.Extensions.Logging.csproj
+++ b/src/libraries/Microsoft.Extensions.Logging/src/Microsoft.Extensions.Logging.csproj
@@ -1,7 +1,8 @@
- $(NetCoreAppCurrent);netstandard2.0
+ $(NetCoreAppCurrent);netstandard2.0;net461;$(NetFrameworkCurrent)
+ true
true
@@ -29,7 +30,7 @@
-
+
@@ -37,4 +38,11 @@
+
+
+
+
+
+
+
diff --git a/src/libraries/Microsoft.Extensions.Logging/tests/Common/AnsiLogConsoleTest.cs b/src/libraries/Microsoft.Extensions.Logging/tests/Common/AnsiLogConsoleTest.cs
deleted file mode 100644
index cc84f5d03bd5..000000000000
--- a/src/libraries/Microsoft.Extensions.Logging/tests/Common/AnsiLogConsoleTest.cs
+++ /dev/null
@@ -1,179 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-using System;
-using Microsoft.Extensions.Logging.Console;
-using Xunit;
-
-namespace Microsoft.Extensions.Logging
-{
- public class AnsiLogConsoleTest
- {
- [Fact]
- public void DoesNotAddNewLine()
- {
- // Arrange
- var systemConsole = new TestAnsiSystemConsole();
- var console = new AnsiLogConsole(systemConsole);
- var message = "Request received";
- var expectedMessage = message;
-
- // Act
- console.Write(message, background: null, foreground: null);
- console.Flush();
-
- // Assert
- Assert.Equal(expectedMessage, systemConsole.Message);
- }
-
- [Fact]
- public void NotCallingFlush_DoesNotWriteData_ToSystemConsole()
- {
- // Arrange
- var systemConsole = new TestAnsiSystemConsole();
- var console = new AnsiLogConsole(systemConsole);
- var message = "Request received";
- var expectedMessage = message + Environment.NewLine;
-
- // Act
- console.WriteLine(message, background: null, foreground: null);
-
- // Assert
- Assert.Null(systemConsole.Message);
- }
-
- [Fact]
- public void CallingFlush_ClearsData_FromOutputBuilder()
- {
- // Arrange
- var systemConsole = new TestAnsiSystemConsole();
- var console = new AnsiLogConsole(systemConsole);
- var message = "Request received";
- var expectedMessage = message + Environment.NewLine;
-
- // Act
- console.WriteLine(message, background: null, foreground: null);
- console.Flush();
- console.WriteLine(message, background: null, foreground: null);
- console.Flush();
-
- // Assert
- Assert.Equal(expectedMessage, systemConsole.Message);
- }
-
- [Fact]
- public void WritesMessage_WithoutEscapeCodes_AndNoForegroundOrBackgroundColorsSpecified()
- {
- // Arrange
- var systemConsole = new TestAnsiSystemConsole();
- var console = new AnsiLogConsole(systemConsole);
- var message = "Request received";
- var expectedMessage = message + Environment.NewLine;
-
- // Act
- console.WriteLine(message, background: null, foreground: null);
- console.Flush();
-
- // Assert
- Assert.Equal(expectedMessage, systemConsole.Message);
- }
-
- [Fact]
- public void WritesMessage_WithForegroundEscapeCode_AndNoBackgroundColorSpecified()
- {
- // Arrange
- var systemConsole = new TestAnsiSystemConsole();
- var console = new AnsiLogConsole(systemConsole);
- var message = "Request received";
- var expectedMessage = GetForegroundColorEscapeCode(ConsoleColor.DarkGreen)
- + message
- + "\x1B[39m\x1B[22m"; //resets foreground color
-
- // Act
- console.WriteLine(message, background: null, foreground: ConsoleColor.DarkGreen);
- console.Flush();
-
- // Assert
- Assert.Equal(expectedMessage + Environment.NewLine, systemConsole.Message);
- }
-
- [Fact]
- public void WritesMessage_WithBackgroundEscapeCode_AndNoForegroundColorSpecified()
- {
- // Arrange
- var systemConsole = new TestAnsiSystemConsole();
- var console = new AnsiLogConsole(systemConsole);
- var message = "Request received";
- var expectedMessage = GetBackgroundColorEscapeCode(ConsoleColor.Red)
- + message
- + "\x1B[49m"; //resets background color
-
- // Act
- console.WriteLine(message, background: ConsoleColor.Red, foreground: null);
- console.Flush();
-
- // Assert
- Assert.Equal(expectedMessage + Environment.NewLine, systemConsole.Message);
- }
-
- [Fact]
- public void WriteMessage_InOrder_WhenBothForegroundOrBackgroundColorsSpecified()
- {
- // Arrange
- var systemConsole = new TestAnsiSystemConsole();
- var console = new AnsiLogConsole(systemConsole);
- var message = "Request received";
- var expectedMessage = GetBackgroundColorEscapeCode(ConsoleColor.Red)
- + GetForegroundColorEscapeCode(ConsoleColor.DarkGreen)
- + "Request received"
- + "\x1B[39m\x1B[22m" //resets foreground color
- + "\x1B[49m" //resets background color
- + Environment.NewLine;
-
- // Act
- console.WriteLine(message, background: ConsoleColor.Red, foreground: ConsoleColor.DarkGreen);
- console.Flush();
-
- // Assert
- Assert.Equal(expectedMessage, systemConsole.Message);
- }
-
- private class TestAnsiSystemConsole : IAnsiSystemConsole
- {
- public string Message { get; private set; }
-
- public void Write(string message)
- {
- Message = message;
- }
- }
-
- private static string GetForegroundColorEscapeCode(ConsoleColor color)
- {
- switch (color)
- {
- case ConsoleColor.Red:
- return "\x1B[31m";
- case ConsoleColor.DarkGreen:
- return "\x1B[32m";
- case ConsoleColor.DarkYellow:
- return "\x1B[33m";
- case ConsoleColor.Gray:
- return "\x1B[37m";
- default:
- return "\x1B[39m";
- }
- }
-
- private static string GetBackgroundColorEscapeCode(ConsoleColor color)
- {
- switch (color)
- {
- case ConsoleColor.Red:
- return "\x1B[41m";
- default:
- return "\x1B[49m";
- }
- }
- }
-}
diff --git a/src/libraries/Microsoft.Extensions.Options.ConfigurationExtensions/src/Microsoft.Extensions.Options.ConfigurationExtensions.csproj b/src/libraries/Microsoft.Extensions.Options.ConfigurationExtensions/src/Microsoft.Extensions.Options.ConfigurationExtensions.csproj
index 9feb20a52838..3d9e3c322e96 100644
--- a/src/libraries/Microsoft.Extensions.Options.ConfigurationExtensions/src/Microsoft.Extensions.Options.ConfigurationExtensions.csproj
+++ b/src/libraries/Microsoft.Extensions.Options.ConfigurationExtensions/src/Microsoft.Extensions.Options.ConfigurationExtensions.csproj
@@ -1,7 +1,8 @@
- $(NetCoreAppCurrent);netstandard2.0
+ $(NetCoreAppCurrent);netstandard2.0;net461;$(NetFrameworkCurrent)
+ true
true
@@ -18,4 +19,8 @@
+
+
+
+
diff --git a/src/libraries/Microsoft.Extensions.Options.DataAnnotations/src/Microsoft.Extensions.Options.DataAnnotations.csproj b/src/libraries/Microsoft.Extensions.Options.DataAnnotations/src/Microsoft.Extensions.Options.DataAnnotations.csproj
index 8dadd0c88af1..9adaadcc69d5 100644
--- a/src/libraries/Microsoft.Extensions.Options.DataAnnotations/src/Microsoft.Extensions.Options.DataAnnotations.csproj
+++ b/src/libraries/Microsoft.Extensions.Options.DataAnnotations/src/Microsoft.Extensions.Options.DataAnnotations.csproj
@@ -1,7 +1,8 @@
- $(NetCoreAppCurrent);netstandard2.0
+ $(NetCoreAppCurrent);netstandard2.0;net461;$(NetFrameworkCurrent)
+ true
true
@@ -20,4 +21,9 @@
+
+
+
+
+
diff --git a/src/libraries/Microsoft.Extensions.Options/src/Microsoft.Extensions.Options.csproj b/src/libraries/Microsoft.Extensions.Options/src/Microsoft.Extensions.Options.csproj
index fcc42385829f..eda46678ac44 100644
--- a/src/libraries/Microsoft.Extensions.Options/src/Microsoft.Extensions.Options.csproj
+++ b/src/libraries/Microsoft.Extensions.Options/src/Microsoft.Extensions.Options.csproj
@@ -1,7 +1,8 @@
- $(NetCoreAppCurrent);netstandard2.0
+ $(NetCoreAppCurrent);netstandard2.0;net461;$(NetFrameworkCurrent)
+ true
true
@@ -19,8 +20,13 @@
-
+
+
+
+
+
+
diff --git a/src/libraries/Microsoft.Extensions.Options/src/OptionsServiceCollectionExtensions.cs b/src/libraries/Microsoft.Extensions.Options/src/OptionsServiceCollectionExtensions.cs
index f91460871b76..2a1aec0395ab 100644
--- a/src/libraries/Microsoft.Extensions.Options/src/OptionsServiceCollectionExtensions.cs
+++ b/src/libraries/Microsoft.Extensions.Options/src/OptionsServiceCollectionExtensions.cs
@@ -133,7 +133,9 @@ public static IServiceCollection PostConfigureAll(this IServiceCollect
=> services.PostConfigure(name: null, configureOptions: configureOptions);
///
- /// Registers a type that will have all of its I[Post]ConfigureOptions registered.
+ /// Registers a type that will have all of its ,
+ /// , and
+ /// registered.
///
/// The type that will configure options.
/// The to add the services to.
@@ -144,24 +146,30 @@ public static IServiceCollection ConfigureOptions(this IServi
private static bool IsAction(Type type)
=> (type.GetTypeInfo().IsGenericType && type.GetGenericTypeDefinition() == typeof(Action<>));
- private static IEnumerable FindIConfigureOptions(Type type)
+ private static IEnumerable FindConfigurationServices(Type type)
{
- IEnumerable serviceTypes = type.GetTypeInfo().ImplementedInterfaces
- .Where(t => t.GetTypeInfo().IsGenericType &&
- (t.GetGenericTypeDefinition() == typeof(IConfigureOptions<>)
- || t.GetGenericTypeDefinition() == typeof(IPostConfigureOptions<>)));
+ IEnumerable serviceTypes = type
+ .GetTypeInfo()
+ .ImplementedInterfaces
+ .Where(t => t.GetTypeInfo().IsGenericType)
+ .Where(t =>
+ t.GetGenericTypeDefinition() == typeof(IConfigureOptions<>) ||
+ t.GetGenericTypeDefinition() == typeof(IPostConfigureOptions<>) ||
+ t.GetGenericTypeDefinition() == typeof(IValidateOptions<>));
if (!serviceTypes.Any())
{
throw new InvalidOperationException(
IsAction(type)
- ? SR.Error_NoIConfigureOptionsAndAction
- : SR.Error_NoIConfigureOptions);
+ ? SR.Error_NoConfigurationServicesAndAction
+ : SR.Error_NoConfigurationServices);
}
return serviceTypes;
}
///
- /// Registers a type that will have all of its I[Post]ConfigureOptions registered.
+ /// Registers a type that will have all of its ,
+ /// , and
+ /// registered.
///
/// The to add the services to.
/// The type that will configure options.
@@ -169,7 +177,7 @@ private static IEnumerable FindIConfigureOptions(Type type)
public static IServiceCollection ConfigureOptions(this IServiceCollection services, Type configureType)
{
services.AddOptions();
- IEnumerable serviceTypes = FindIConfigureOptions(configureType);
+ IEnumerable serviceTypes = FindConfigurationServices(configureType);
foreach (Type serviceType in serviceTypes)
{
services.AddTransient(serviceType, configureType);
@@ -178,7 +186,9 @@ public static IServiceCollection ConfigureOptions(this IServiceCollection servic
}
///
- /// Registers an object that will have all of its I[Post]ConfigureOptions registered.
+ /// Registers an object that will have all of its ,
+ /// , and
+ /// registered.
///
/// The to add the services to.
/// The instance that will configure options.
@@ -186,7 +196,7 @@ public static IServiceCollection ConfigureOptions(this IServiceCollection servic
public static IServiceCollection ConfigureOptions(this IServiceCollection services, object configureInstance)
{
services.AddOptions();
- IEnumerable serviceTypes = FindIConfigureOptions(configureInstance.GetType());
+ IEnumerable serviceTypes = FindConfigurationServices(configureInstance.GetType());
foreach (Type serviceType in serviceTypes)
{
services.AddSingleton(serviceType, configureInstance);
diff --git a/src/libraries/Microsoft.Extensions.Options/src/Resources/Strings.resx b/src/libraries/Microsoft.Extensions.Options/src/Resources/Strings.resx
index 7804a76ee22c..60292ad6dbca 100644
--- a/src/libraries/Microsoft.Extensions.Options/src/Resources/Strings.resx
+++ b/src/libraries/Microsoft.Extensions.Options/src/Resources/Strings.resx
@@ -129,10 +129,10 @@
Cannot create instance of type '{0}' because it is missing a public parameterless constructor.
-
- No IConfigureOptions<> or IPostConfigureOptions<> implementations were found.
+
+ No IConfigureOptions<>, IPostConfigureOptions<>, or IValidateOptions<> implementations were found.
-
- No IConfigureOptions<> or IPostConfigureOptions<> implementations were found, did you mean to call Configure<> or PostConfigure<>?
+
+ No IConfigureOptions<>, IPostConfigureOptions<>, or IValidateOptions<> implementations were found, did you mean to call Configure<> or PostConfigure<>?
\ No newline at end of file
diff --git a/src/libraries/Microsoft.Extensions.Options/tests/OptionsFactoryTests.cs b/src/libraries/Microsoft.Extensions.Options/tests/OptionsFactoryTests.cs
index b432bec729a9..e49c65ed6a01 100644
--- a/src/libraries/Microsoft.Extensions.Options/tests/OptionsFactoryTests.cs
+++ b/src/libraries/Microsoft.Extensions.Options/tests/OptionsFactoryTests.cs
@@ -191,7 +191,34 @@ public void CanConfigureOptionsOnlyDefault()
Assert.Equal("", factory.Create("anything").Message);
}
- public class UberBothSetup : IConfigureNamedOptions, IConfigureNamedOptions, IPostConfigureOptions, IPostConfigureOptions
+ public class FakeOptionsValidation : IValidateOptions
+ {
+ public ValidateOptionsResult Validate(string name, FakeOptions options)
+ {
+ return ValidateOptionsResult.Fail("Hello world");
+ }
+ }
+
+ [Fact]
+ public void CanValidateOptionsWithConfigureOptions()
+ {
+ var factory = new ServiceCollection()
+ .ConfigureOptions()
+ .BuildServiceProvider()
+ .GetRequiredService>();
+
+ var ex = Assert.Throws(() => factory.Create(Options.DefaultName));
+ var message = Assert.Single(ex.Failures);
+ Assert.Equal("Hello world", message);
+ }
+
+ public class UberSetup
+ : IConfigureNamedOptions
+ , IConfigureNamedOptions
+ , IPostConfigureOptions
+ , IPostConfigureOptions
+ , IValidateOptions
+ , IValidateOptions