diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
index d706d96a00e0..05c59ac350c7 100644
--- a/.config/dotnet-tools.json
+++ b/.config/dotnet-tools.json
@@ -15,7 +15,7 @@
]
},
"microsoft.dotnet.xharness.cli": {
- "version": "1.0.0-prerelease.20530.4",
+ "version": "1.0.0-prerelease.20555.2",
"commands": [
"xharness"
]
diff --git a/.gitattributes b/.gitattributes
index 7ead819fab55..04518684225a 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -69,12 +69,9 @@
# CLR specific
src/coreclr/src/pal/tests/palsuite/paltestlist.txt text eol=lf
src/coreclr/src/pal/tests/palsuite/paltestlist_to_be_reviewed.txt text eol=lf
-src/coreclr/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/regexdna/regexdna-input25.txt text eol=lf
-src/coreclr/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/regexdna/regexdna-input25000.txt text eol=lf
-src/coreclr/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/regex-redux/regexdna-input25.txt text eol=lf
-src/coreclr/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/regex-redux/regexdna-input25000.txt text eol=lf
-src/coreclr/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/reverse-complement/revcomp-input25.txt text eol=lf
-src/coreclr/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/reverse-complement/revcomp-input25000.txt text eol=lf
-src/coreclr/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/k-nucleotide/knucleotide-input.txt text eol=lf
-src/coreclr/tests/src/JIT/Performance/CodeQuality/BenchmarksGame/k-nucleotide/knucleotide-input-big.txt text eol=lf
-src/coreclr/tests/src/performance/Scenario/JitBench/Resources/word2vecnet.patch text eol=lf
+src/tests/JIT/Performance/CodeQuality/BenchmarksGame/regex-redux/regexdna-input25.txt text eol=lf
+src/tests/JIT/Performance/CodeQuality/BenchmarksGame/regex-redux/regexdna-input25000.txt text eol=lf
+src/tests/JIT/Performance/CodeQuality/BenchmarksGame/reverse-complement/revcomp-input25.txt text eol=lf
+src/tests/JIT/Performance/CodeQuality/BenchmarksGame/reverse-complement/revcomp-input25000.txt text eol=lf
+src/tests/JIT/Performance/CodeQuality/BenchmarksGame/k-nucleotide/knucleotide-input.txt text eol=lf
+src/tests/JIT/Performance/CodeQuality/BenchmarksGame/k-nucleotide/knucleotide-input-big.txt text eol=lf
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 769b0081686d..515707b1e073 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -59,4 +59,4 @@
/src/mono/msvc @lateralusX @kg @akoeplinger
/src/mono/msvc/scripts @akoeplinger @kg
-/src/mono/netcore @marek-safar @akoeplinger @egorbo @vargaz @steveisok
\ No newline at end of file
+/src/mono/netcore @marek-safar @akoeplinger @egorbo @vargaz @steveisok
diff --git a/docs/coding-guidelines/interop-guidelines.md b/docs/coding-guidelines/interop-guidelines.md
index 7dff0711a8d3..5ce81404073f 100644
--- a/docs/coding-guidelines/interop-guidelines.md
+++ b/docs/coding-guidelines/interop-guidelines.md
@@ -120,7 +120,7 @@ internal static partial class Interop // contents of Common\src\Interop\Windows\
```
### Build System
-When building dotnet/runtime, we use the "TargetOS" property to control what target platform we are building for. The valid values for this property are Windows_NT (which is the default value from MSBuild when running on Windows), Linux and OSX.
+When building dotnet/runtime, we use the "TargetOS" property to control what target platform we are building for. The valid values for this property are windows (which is the default value from MSBuild when running on Windows), Linux and OSX.
#### Project Files
Whenever possible, a single .csproj should be used per assembly, spanning all target platforms, e.g. System.Console.csproj includes conditional entries for when targeting Windows vs when targeting Linux. A property can be passed to dotnet build to control which flavor is built, e.g. `dotnet build /p:TargetOS=OSX System.Console.csproj`.
diff --git a/docs/coding-guidelines/project-guidelines.md b/docs/coding-guidelines/project-guidelines.md
index afc05f4037b2..69ba1fd53014 100644
--- a/docs/coding-guidelines/project-guidelines.md
+++ b/docs/coding-guidelines/project-guidelines.md
@@ -16,7 +16,7 @@ Below is a list of all the various options we pivot the project builds on:
- **Target Frameworks:** .NETFramework, .NETStandard, .NETCoreApp
- **Platform Runtimes:** .NETFramework (aka CLR/Desktop), CoreCLR, Mono
-- **OS:** Windows_NT, Linux, OSX, FreeBSD, AnyOS
+- **OS:** windows, Linux, OSX, FreeBSD, AnyOS
- **Flavor:** Debug, Release
## Individual build properties
@@ -52,7 +52,7 @@ Pure netstandard configuration:
All supported targets with unique windows/unix build for netcoreapp:
```
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;net461-Windows_NT
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;net461-windows
```
@@ -73,7 +73,7 @@ When building an individual project the `BuildTargetFramework` and `TargetOS` wi
## Supported full build settings
- .NET Core latest on current OS (default) -> `$(NetCoreAppCurrent)-[RunningOS]`
-- .NET Framework latest -> `net48-Windows_NT`
+- .NET Framework latest -> `net48-windows`
# Library project guidelines
@@ -100,7 +100,7 @@ Example:
Example:
```
- netstandard2.0-Windows_NT;netstandard2.0-Unix
+ netstandard2.0-windows;netstandard2.0-Unix
$(Platform) $(Configuration) skiptests
$(BuildArguments) -nopgooptimize
- $(BuildArguments) msbuildonunsupportedplatform
+ $(BuildArguments) msbuildonunsupportedplatform
+ $(BuildArguments) -clang6.0
$(BuildArguments) cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE
$(BuildArguments) skipnuget cross -skiprestore cmakeargs -DFEATURE_GDBJIT=TRUE
diff --git a/docs/workflow/debugging/coreclr/debugging.md b/docs/workflow/debugging/coreclr/debugging.md
index 580032545d29..d8db911b2dc4 100644
--- a/docs/workflow/debugging/coreclr/debugging.md
+++ b/docs/workflow/debugging/coreclr/debugging.md
@@ -9,17 +9,17 @@ Debugging CoreCLR on Windows
============================
1. Perform a build of the repo.
-2. Open solution \\artifacts\obj\coreclr\Windows_NT.\.\\CoreCLR.sln in Visual Studio. \ and \ are based
+2. Open solution \\artifacts\obj\coreclr\windows.\.\\CoreCLR.sln in Visual Studio. \ and \ are based
on type of build you did. By default they are 'x64' and 'Debug'.
3. Right-click the INSTALL project and choose ‘Set as StartUp Project’
4. Bring up the properties page for the INSTALL project
5. Select Configuration Properties->Debugging from the left side tree control
-6. Set Command=`$(SolutionDir)\..\..\..\bin\coreclr\Windows_NT.$(Platform).$(Configuration)\corerun.exe`
+6. Set Command=`$(SolutionDir)\..\..\..\bin\coreclr\windows.$(Platform).$(Configuration)\corerun.exe`
1. This points to the folder where the built runtime binaries are present.
7. Set Command Arguments=`` (e.g. HelloWorld.dll)
-8. Set Working Directory=`$(SolutionDir)\..\..\..\bin\coreclr\Windows_NT.$(Platform).$(Configuration)`
+8. Set Working Directory=`$(SolutionDir)\..\..\..\bin\coreclr\windows.$(Platform).$(Configuration)`
1. This points to the folder containing CoreCLR binaries.
-9. Set Environment=`CORE_LIBRARIES=$(SolutionDir)\..\..\..\bin\runtime\-Windows_NT-$(Configuration)-$(Platform)`,
+9. Set Environment=`CORE_LIBRARIES=$(SolutionDir)\..\..\..\bin\runtime\-windows-$(Configuration)-$(Platform)`,
where '\' is the target framework of current branch, for example `netcoreapp3.1` `net5.0`.
1. This points to the folder containing core libraries except `System.Private.CoreLib`.
2. This step can be skipped if you are debugging CLR tests that references only `System.Private.CoreLib`.
diff --git a/docs/workflow/debugging/libraries/debugging-packages.md b/docs/workflow/debugging/libraries/debugging-packages.md
index f72887149b7f..7a57a2219cea 100644
--- a/docs/workflow/debugging/libraries/debugging-packages.md
+++ b/docs/workflow/debugging/libraries/debugging-packages.md
@@ -101,5 +101,5 @@ dotnet build System.Net.ServicePoint.Tests.csproj -f netcoreapp2.0 /t:test /p:Ou
Will run the test using the following pivot values:
* Architecture: AnyCPU
* Flavor: Debug
-* OS: Windows_NT
+* OS: windows
* Target: netstandard2.0
diff --git a/docs/workflow/debugging/libraries/windows-instructions.md b/docs/workflow/debugging/libraries/windows-instructions.md
index 46d916e74da8..5a1bedd45d91 100644
--- a/docs/workflow/debugging/libraries/windows-instructions.md
+++ b/docs/workflow/debugging/libraries/windows-instructions.md
@@ -33,15 +33,15 @@ To run a single test from command line:
* Locate the test binary folder based on the CSPROJ name.
-For example: `src\System.Net.Sockets\tests\Functional\System.Net.Sockets.Tests.csproj` will build and output binaries at `bin\tests\Windows_NT.AnyCPU.Debug\System.Net.Sockets.Tests\netcoreapp1.0`.
+For example: `src\System.Net.Sockets\tests\Functional\System.Net.Sockets.Tests.csproj` will build and output binaries at `bin\tests\windows.AnyCPU.Debug\System.Net.Sockets.Tests\netcoreapp1.0`.
* Execute the test
Assuming that your repo is at `C:\corefx`:
```
-cd C:\corefx\bin\tests\Windows_NT.AnyCPU.Debug\System.Net.Sockets.Tests\netcoreapp1.0
-C:\corefx\bin\tests\Windows_NT.AnyCPU.Debug\System.Net.Sockets.Tests\netcoreapp1.0\CoreRun.exe xunit.console.dll System.Net.Sockets.Tests.dll -xml testResults.xml -notrait category=nonwindowstests -notrait category=OuterLoop -notrait category=failing
+cd C:\corefx\bin\tests\windows.AnyCPU.Debug\System.Net.Sockets.Tests\netcoreapp1.0
+C:\corefx\bin\tests\windows.AnyCPU.Debug\System.Net.Sockets.Tests\netcoreapp1.0\CoreRun.exe xunit.console.dll System.Net.Sockets.Tests.dll -xml testResults.xml -notrait category=nonwindowstests -notrait category=OuterLoop -notrait category=failing
```
* If the test crashes or encounters a `Debugger.Launch()` method call, WinDBG will automatically start and attach to the `CoreRun.exe` process
diff --git a/docs/workflow/editing-and-debugging.md b/docs/workflow/editing-and-debugging.md
index 5143ca82b240..8297b10d2873 100644
--- a/docs/workflow/editing-and-debugging.md
+++ b/docs/workflow/editing-and-debugging.md
@@ -20,7 +20,7 @@ what are in the repository. In particular
* `src\coreclr\src\System.Private.CoreLib\System.Private.CorLib.sln` - This solution is for all managed (C#) code that is defined
in the runtime itself. This is all class library support of one form or another.
- * `artifacts\obj\coreclr\Windows_NT..\CoreCLR.sln` - this solution contains most native (C++) projects
+ * `artifacts\obj\coreclr\windows..\CoreCLR.sln` - this solution contains most native (C++) projects
associated with the repository, including
* `coreclr` - This is the main runtime DLL (the GC, class loader, interop are all here)
* `corjit` - This is the Just In Time (JIT) compiler that compiles .NET Intermediate language to native code.
diff --git a/docs/workflow/testing/coreclr/running-aspnet-benchmarks-with-crossgen2.md b/docs/workflow/testing/coreclr/running-aspnet-benchmarks-with-crossgen2.md
index b68e3cebc080..5e8dd20ac8af 100644
--- a/docs/workflow/testing/coreclr/running-aspnet-benchmarks-with-crossgen2.md
+++ b/docs/workflow/testing/coreclr/running-aspnet-benchmarks-with-crossgen2.md
@@ -185,7 +185,7 @@ using the following command.
On Windows:
```powershell
-CoreRun.exe \runtime\artifacts\bin\coreclr\Windows_NT.x64.Release\crossgen2\crossgen2.dll
+CoreRun.exe \runtime\artifacts\bin\coreclr\windows.x64.Release\crossgen2\crossgen2.dll
--Os --composite -o \path\to\results\composite\TotalComposite.dll \path\to\results\application\*.dll
```
diff --git a/docs/workflow/testing/coreclr/windows-test-instructions.md b/docs/workflow/testing/coreclr/windows-test-instructions.md
index c581c3529e96..540c0794fa89 100644
--- a/docs/workflow/testing/coreclr/windows-test-instructions.md
+++ b/docs/workflow/testing/coreclr/windows-test-instructions.md
@@ -61,13 +61,13 @@ In order to run all of the tests using your checked build:
> src\tests\run.cmd checked
```
-This will generate a report named `TestRun__.html` (e.g. `TestRun_Windows_NT_x64_Checked.html`) in the subdirectory `\artifacts\log`. Any tests that failed will be listed in `TestRunResults_Windows_NT_x64_Checked.err`.
+This will generate a report named `TestRun__.html` (e.g. `TestRun_windows_x64_Checked.html`) in the subdirectory `\artifacts\log`. Any tests that failed will be listed in `TestRunResults_windows_x64_Checked.err`.
### Investigating Test Failures
Upon completing a test run, you may find one or more tests have failed.
-The output of the test will be available in `Test` reports directory, but by default the directory will be something like `\artifacts\tests\coreclr\Windows_NT.x64.Checked\Reports\Exceptions\Finalization`.
+The output of the test will be available in `Test` reports directory, but by default the directory will be something like `\artifacts\tests\coreclr\windows.x64.Checked\Reports\Exceptions\Finalization`.
There are 2 files of interest:
@@ -79,16 +79,16 @@ There are 2 files of interest:
If you wish to re-run a failed test, follow the following steps:
1) Set an environment variable, `CORE_ROOT`, pointing to the path to product binaries that was passed to run.cmd.
-For example using a checked build the location would be: `\artifacts\tests\coreclr\Windows_NT.x64.Checked\Tests\Core_Root`
+For example using a checked build the location would be: `\artifacts\tests\coreclr\windows.x64.Checked\Tests\Core_Root`
-2) Run the failed test, the command to which is also present in the test report for a failed test. It will be something like `\artifacts\tests\coreclr\Windows_NT.x64.Checked\Exceptions\Finalization\Finalizer.cmd`.
+2) Run the failed test, the command to which is also present in the test report for a failed test. It will be something like `\artifacts\tests\coreclr\windows.x64.Checked\Exceptions\Finalization\Finalizer.cmd`.
If you wish to run the test under a debugger (e.g. [WinDbg](http://msdn.microsoft.com/library/windows/hardware/ff551063(v=vs.85).aspx)), append `-debug ` to the test command. For example:
```
-> artifacts\tests\coreclr\Windows_NT.x64.Checked\Exceptions\Finalization\Finalizer.cmd -debug
+> artifacts\tests\coreclr\windows.x64.Checked\Exceptions\Finalization\Finalizer.cmd -debug
```
### Modifying a test
-If test changes are needed, make the change, and build the test project. This will binplace the binaries in the test binaries folder (e.g. `\artifacts\tests\coreclr\Windows_NT.x64.Checked\Exceptions\Finalization`). Then re-run the test following the instructions above.
+If test changes are needed, make the change, and build the test project. This will binplace the binaries in the test binaries folder (e.g. `\artifacts\tests\coreclr\windows.x64.Checked\Exceptions\Finalization`). Then re-run the test following the instructions above.
diff --git a/docs/workflow/testing/libraries/filtering-tests.md b/docs/workflow/testing/libraries/filtering-tests.md
index 2b1b3d9867b4..7f9b9ec8c7cd 100644
--- a/docs/workflow/testing/libraries/filtering-tests.md
+++ b/docs/workflow/testing/libraries/filtering-tests.md
@@ -148,7 +148,7 @@ _**A few common examples with the above attributes:**_
- Run all tests acceptable on Windows that are not failing:
```cmd
-dotnet build /t:Test /p:TargetOS=Windows_NT
+dotnet build /t:Test /p:TargetOS=windows
```
- Run all outer loop tests acceptable on OS X that are currently associated with active issues:
```sh
diff --git a/docs/workflow/testing/using-corerun.md b/docs/workflow/testing/using-corerun.md
index 01a2aedffa1b..33e4d1fdb3a3 100644
--- a/docs/workflow/testing/using-corerun.md
+++ b/docs/workflow/testing/using-corerun.md
@@ -31,7 +31,7 @@ Consider that you already have a .NET application DLL called HelloWorld.dll and
If you execute the following
```bat
- set PATH=%PATH%;%CoreCLR%\artifacts\tests\coreclr\Windows_NT.x64.Debug\Tests\Core_Root\
+ set PATH=%PATH%;%CoreCLR%\artifacts\tests\coreclr\windows.x64.Debug\Tests\Core_Root\
set CORE_LIBRARIES=%ProgramFiles%\dotnet\shared\Microsoft.NETCore.App\1.0.0
@@ -73,11 +73,11 @@ variable CORE_ROOT to this directory
(running src\tests\build from the repository base) and running 'src\tests\run') you can do the following
```bat
- set PATH=%PATH%;%CoreCLR%\artifacts\Product\Windows_NT.x64.Debug
- set CORE_ROOT=%CoreCLR%\artifacts\tests\coreclr\Windows_NT.x64.Debug\Tests\Core_Root
+ set PATH=%PATH%;%CoreCLR%\artifacts\Product\windows.x64.Debug
+ set CORE_ROOT=%CoreCLR%\artifacts\tests\coreclr\windows.x64.Debug\Tests\Core_Root
```
sets you up so that corerun can run any of the test. For example
```bat
- corerun artifacts\tests\coreclr\Windows_NT.X64.Debug\GC\Features\Finalizer\finalizeio\finalizeio\finalizeio.exe
+ corerun artifacts\tests\coreclr\windows.X64.Debug\GC\Features\Finalizer\finalizeio\finalizeio\finalizeio.exe
```
runs the finalizerio test.
diff --git a/docs/workflow/using-dotnet-cli.md b/docs/workflow/using-dotnet-cli.md
index 8090f0eddc2c..ce410d738291 100644
--- a/docs/workflow/using-dotnet-cli.md
+++ b/docs/workflow/using-dotnet-cli.md
@@ -179,7 +179,7 @@ which should make things work (but is fragile, confirm file timestamps that you
Get this by simply listing the name of the `runtime.win-x64.Microsoft.NETCore.Runtime.CoreCLR` you built.
```bat
- dir artifacts\bin\coreclr\Product\Windows_NT.x64.Release\.nuget\pkg
+ dir artifacts\bin\coreclr\Product\windows.x64.Release\.nuget\pkg
```
and you will get name of the which looks something like this
diff --git a/eng/BeforeTargetFrameworkInference.targets b/eng/BeforeTargetFrameworkInference.targets
index abef4c8981a2..93609381fb4b 100644
--- a/eng/BeforeTargetFrameworkInference.targets
+++ b/eng/BeforeTargetFrameworkInference.targets
@@ -3,17 +3,18 @@
<_OriginalTargetFramework>$(TargetFramework)
$(TargetFramework.SubString($([MSBuild]::Add($(TargetFramework.IndexOf('-')), 1))))
- $(TargetFramework.SubString(0, $(TargetFramework.IndexOf('-'))))
+
+ $([System.Text.RegularExpressions.Regex]::Replace('$(TargetFramework)', '$(TargetFrameworkPattern)', '${1}'))
- $([MSBuild]::NormalizeDirectory('$(BaseIntermediateOutputPath)', '$(TargetFramework)-$(TargetFrameworkSuffix)-$(Configuration)'))
- $([MSBuild]::NormalizeDirectory('$(BaseIntermediateOutputPath)', '$(TargetFramework)-$(Configuration)'))
+ $([MSBuild]::NormalizeDirectory('$(BaseIntermediateOutputPath)', '$(TargetFramework)-$(Configuration)'))
+ $([MSBuild]::NormalizeDirectory('$(BaseIntermediateOutputPath)', '$(TargetFramework)-$(TargetFrameworkSuffix)-$(Configuration)'))
- $([MSBuild]::NormalizeDirectory('$(BaseOutputPath)', '$(TargetFramework)-$(TargetFrameworkSuffix)-$(Configuration)'))
- $([MSBuild]::NormalizeDirectory('$(BaseOutputPath)', '$(TargetFramework)-$(Configuration)'))
+ $([MSBuild]::NormalizeDirectory('$(BaseOutputPath)', '$(TargetFramework)-$(Configuration)'))
+ $([MSBuild]::NormalizeDirectory('$(BaseOutputPath)', '$(TargetFramework)-$(TargetFrameworkSuffix)-$(Configuration)'))
diff --git a/eng/Configurations.props b/eng/Configurations.props
index 352e32f6cab0..d26beec0e3e6 100644
--- a/eng/Configurations.props
+++ b/eng/Configurations.props
@@ -58,7 +58,7 @@
illumos
Solaris
Linux
- Windows_NT
+ windows
$(TargetOS)
$(TargetOS)
$(TargetOS)
diff --git a/eng/Subsets.props b/eng/Subsets.props
index e2c4d1602f5b..43843ea21393 100644
--- a/eng/Subsets.props
+++ b/eng/Subsets.props
@@ -149,7 +149,7 @@
-
+
diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index a769f55ebd2b..9d0f96269f1e 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -4,67 +4,67 @@
https://github.com/dotnet/standard
cfe95a23647c7de1fe1a349343115bd7720d6949
-
+
https://github.com/dotnet/icu
- ba48e6f5e60aa200a567f9dadef1046f7bf374ec
+ a39deb47c8f20ed5adb57cddbc83ac587413c4e4
-
+
https://github.com/dotnet/arcade
- 19e7e769f7ca2ece42221f7ff951e7ec705498ec
+ 72b28b7e023d4c3fffa0a0b9748a7d4e8cc799be
-
+
https://github.com/dotnet/arcade
- 19e7e769f7ca2ece42221f7ff951e7ec705498ec
+ 72b28b7e023d4c3fffa0a0b9748a7d4e8cc799be
-
+
https://github.com/dotnet/arcade
- 19e7e769f7ca2ece42221f7ff951e7ec705498ec
+ 72b28b7e023d4c3fffa0a0b9748a7d4e8cc799be
-
+
https://github.com/dotnet/arcade
- 19e7e769f7ca2ece42221f7ff951e7ec705498ec
+ 72b28b7e023d4c3fffa0a0b9748a7d4e8cc799be
-
+
https://github.com/dotnet/arcade
- 19e7e769f7ca2ece42221f7ff951e7ec705498ec
+ 72b28b7e023d4c3fffa0a0b9748a7d4e8cc799be
-
+
https://github.com/dotnet/arcade
- 19e7e769f7ca2ece42221f7ff951e7ec705498ec
+ 72b28b7e023d4c3fffa0a0b9748a7d4e8cc799be
-
+
https://github.com/dotnet/arcade
- 19e7e769f7ca2ece42221f7ff951e7ec705498ec
+ 72b28b7e023d4c3fffa0a0b9748a7d4e8cc799be
-
+
https://github.com/dotnet/arcade
- 19e7e769f7ca2ece42221f7ff951e7ec705498ec
+ 72b28b7e023d4c3fffa0a0b9748a7d4e8cc799be
-
+
https://github.com/dotnet/arcade
- 19e7e769f7ca2ece42221f7ff951e7ec705498ec
+ 72b28b7e023d4c3fffa0a0b9748a7d4e8cc799be
-
+
https://github.com/dotnet/arcade
- 19e7e769f7ca2ece42221f7ff951e7ec705498ec
+ 72b28b7e023d4c3fffa0a0b9748a7d4e8cc799be
-
+
https://github.com/dotnet/arcade
- 19e7e769f7ca2ece42221f7ff951e7ec705498ec
+ 72b28b7e023d4c3fffa0a0b9748a7d4e8cc799be
-
+
https://github.com/dotnet/arcade
- 19e7e769f7ca2ece42221f7ff951e7ec705498ec
+ 72b28b7e023d4c3fffa0a0b9748a7d4e8cc799be
-
+
https://github.com/dotnet/arcade
- 19e7e769f7ca2ece42221f7ff951e7ec705498ec
+ 72b28b7e023d4c3fffa0a0b9748a7d4e8cc799be
-
+
https://github.com/dotnet/arcade
- 19e7e769f7ca2ece42221f7ff951e7ec705498ec
+ 72b28b7e023d4c3fffa0a0b9748a7d4e8cc799be
https://dev.azure.com/dnceng/internal/_git/dotnet-optimization
@@ -126,37 +126,37 @@
https://github.com/dotnet/runtime-assets
edc9df4021be1dff54b8d8be88b4bee7626cb6a5
-
+
https://github.com/dotnet/llvm-project
- 69cf173ab66c68e4282c1da56628b36d4ae2acc2
+ d6c16bf3ec8315049ad0412a7d41e8858b5d0d13
-
+
https://github.com/dotnet/llvm-project
- 69cf173ab66c68e4282c1da56628b36d4ae2acc2
+ d6c16bf3ec8315049ad0412a7d41e8858b5d0d13
-
+
https://github.com/dotnet/llvm-project
- 69cf173ab66c68e4282c1da56628b36d4ae2acc2
+ d6c16bf3ec8315049ad0412a7d41e8858b5d0d13
-
+
https://github.com/dotnet/llvm-project
- 69cf173ab66c68e4282c1da56628b36d4ae2acc2
+ d6c16bf3ec8315049ad0412a7d41e8858b5d0d13
-
+
https://github.com/dotnet/llvm-project
- 69cf173ab66c68e4282c1da56628b36d4ae2acc2
+ d6c16bf3ec8315049ad0412a7d41e8858b5d0d13
-
+
https://github.com/dotnet/llvm-project
- 69cf173ab66c68e4282c1da56628b36d4ae2acc2
+ d6c16bf3ec8315049ad0412a7d41e8858b5d0d13
-
+
https://github.com/dotnet/llvm-project
- 69cf173ab66c68e4282c1da56628b36d4ae2acc2
+ d6c16bf3ec8315049ad0412a7d41e8858b5d0d13
-
+
https://github.com/dotnet/llvm-project
- 69cf173ab66c68e4282c1da56628b36d4ae2acc2
+ d6c16bf3ec8315049ad0412a7d41e8858b5d0d13
https://github.com/dotnet/runtime
@@ -186,17 +186,17 @@
https://github.com/dotnet/runtime
38017c3935de95d0335bac04f4901ddfc2718656
-
+
https://github.com/mono/linker
- 57974c1f5790e6fb33f5fce161707be5cd86c4d3
+ ebc61551b11132ecf868ce69435dec413ccfa5e7
-
+
https://github.com/dotnet/xharness
- bdad61dfc3d09ae826ba940d92e43a7441ec83b0
+ ab2eee629494e7a17592feda257b4ede4ff2fc82
-
+
https://github.com/dotnet/xharness
- bdad61dfc3d09ae826ba940d92e43a7441ec83b0
+ ab2eee629494e7a17592feda257b4ede4ff2fc82
diff --git a/eng/Versions.props b/eng/Versions.props
index 23dcbf43496e..86b457b15692 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -53,16 +53,16 @@
6.0.0-preview1.20513.4
3.8.0-4.20503.2
- 6.0.0-beta.20529.1
- 6.0.0-beta.20529.1
- 6.0.0-beta.20529.1
- 6.0.0-beta.20529.1
- 6.0.0-beta.20529.1
- 6.0.0-beta.20529.1
- 2.5.1-beta.20529.1
- 6.0.0-beta.20529.1
- 6.0.0-beta.20529.1
- 6.0.0-beta.20529.1
+ 6.0.0-beta.20552.5
+ 6.0.0-beta.20552.5
+ 6.0.0-beta.20552.5
+ 6.0.0-beta.20552.5
+ 6.0.0-beta.20552.5
+ 6.0.0-beta.20552.5
+ 2.5.1-beta.20552.5
+ 6.0.0-beta.20552.5
+ 6.0.0-beta.20552.5
+ 6.0.0-beta.20552.5
5.0.0-rc.1.20451.14
6.0.0-alpha.1.20501.4
@@ -141,8 +141,8 @@
4.9.4
16.8.0-release-20201022-02
- 1.0.0-prerelease.20530.4
- 1.0.0-prerelease.20530.4
+ 1.0.0-prerelease.20555.2
+ 1.0.0-prerelease.20555.2
2.4.1
2.4.2
1.3.0
@@ -153,18 +153,18 @@
5.0.0-preview-20201009.2
- 6.0.0-alpha.1.20527.2
+ 6.0.0-alpha.1.20556.1
- 6.0.0-alpha.1.20526.1
+ 6.0.0-alpha.1.20552.1
- 9.0.1-alpha.1.20530.2
- 9.0.1-alpha.1.20530.2
- 9.0.1-alpha.1.20530.2
- 9.0.1-alpha.1.20530.2
- 9.0.1-alpha.1.20530.2
- 9.0.1-alpha.1.20530.2
- 9.0.1-alpha.1.20530.2
- 9.0.1-alpha.1.20530.2
+ 9.0.1-alpha.1.20552.1
+ 9.0.1-alpha.1.20552.1
+ 9.0.1-alpha.1.20552.1
+ 9.0.1-alpha.1.20552.1
+ 9.0.1-alpha.1.20552.1
+ 9.0.1-alpha.1.20552.1
+ 9.0.1-alpha.1.20552.1
+ 9.0.1-alpha.1.20552.1
diff --git a/eng/build.ps1 b/eng/build.ps1
index df1750a87103..4faea7ff30c3 100644
--- a/eng/build.ps1
+++ b/eng/build.ps1
@@ -6,7 +6,7 @@ Param(
[string][Alias('f')]$framework,
[string]$vs,
[string][Alias('v')]$verbosity = "minimal",
- [ValidateSet("Windows_NT","Linux","OSX","Browser")][string]$os,
+ [ValidateSet("windows","Linux","OSX","Browser")][string]$os,
[switch]$allconfigurations,
[switch]$coverage,
[string]$testscope,
@@ -34,7 +34,7 @@ function Get-Help() {
Write-Host " -help (-h) Print help and exit."
Write-Host " -librariesConfiguration (-lc) Libraries build configuration: Debug or Release."
Write-Host " [Default: Debug]"
- Write-Host " -os Target operating system: Windows_NT, Linux, OSX, or Browser."
+ Write-Host " -os Target operating system: windows, Linux, OSX, or Browser."
Write-Host " [Default: Your machine's OS.]"
Write-Host " -runtimeConfiguration (-rc) Runtime build configuration: Debug, Release or Checked."
Write-Host " Checked is exclusive to the CLR runtime. It is the same as Debug, except code is"
@@ -129,7 +129,7 @@ if ($vs) {
if ($runtimeConfiguration) {
$configToOpen = $runtimeConfiguration
}
- $vs = Split-Path $PSScriptRoot -Parent | Join-Path -ChildPath "artifacts\obj\coreclr" | Join-Path -ChildPath "Windows_NT.$archToOpen.$((Get-Culture).TextInfo.ToTitleCase($configToOpen))" | Join-Path -ChildPath "CoreCLR.sln"
+ $vs = Split-Path $PSScriptRoot -Parent | Join-Path -ChildPath "artifacts\obj\coreclr" | Join-Path -ChildPath "windows.$archToOpen.$((Get-Culture).TextInfo.ToTitleCase($configToOpen))" | Join-Path -ChildPath "CoreCLR.sln"
if (-Not (Test-Path $vs)) {
$repoRoot = Split-Path $PSScriptRoot -Parent
Invoke-Expression "& `"$repoRoot/src/coreclr/build-runtime.cmd`" -configureonly -$archToOpen -$configToOpen"
diff --git a/eng/build.sh b/eng/build.sh
index 5904565f9143..e3d495687c95 100755
--- a/eng/build.sh
+++ b/eng/build.sh
@@ -28,7 +28,7 @@ usage()
echo " --help (-h) Print help and exit."
echo " --librariesConfiguration (-lc) Libraries build configuration: Debug or Release."
echo " [Default: Debug]"
- echo " --os Target operating system: Windows_NT, Linux, FreeBSD, OSX, tvOS, iOS, Android,"
+ echo " --os Target operating system: windows, Linux, FreeBSD, OSX, tvOS, iOS, Android,"
echo " Browser, NetBSD, illumos or Solaris."
echo " [Default: Your machine's OS.]"
echo " --projects Project or solution file(s) to build."
@@ -254,8 +254,8 @@ while [[ $# > 0 ]]; do
fi
passedOS="$(echo "$2" | awk '{print tolower($0)}')"
case "$passedOS" in
- windows_nt)
- os="Windows_NT" ;;
+ windows)
+ os="windows" ;;
linux)
os="Linux" ;;
freebsd)
@@ -276,7 +276,7 @@ while [[ $# > 0 ]]; do
os="Solaris" ;;
*)
echo "Unsupported target OS '$2'."
- echo "The allowed values are Windows_NT, Linux, FreeBSD, OSX, tvOS, iOS, Android, Browser, illumos and Solaris."
+ echo "The allowed values are windows, Linux, FreeBSD, OSX, tvOS, iOS, Android, Browser, illumos and Solaris."
exit 1
;;
esac
diff --git a/eng/codeOptimization.targets b/eng/codeOptimization.targets
index 6ed7e997487b..f0766c2c6e3a 100644
--- a/eng/codeOptimization.targets
+++ b/eng/codeOptimization.targets
@@ -17,7 +17,7 @@
BeforeTargets="CoreCompile">
$(IbcOptimizationDataDir)Linux\
- $(IbcOptimizationDataDir)Windows\
+ $(IbcOptimizationDataDir)Windows\
<_optimizationDataAssembly Include="$(IbcOptimizationDataDir)**\$(TargetFileName)" />
diff --git a/eng/common/performance/crossgen_perf.proj b/eng/common/performance/crossgen_perf.proj
index 79a5486546ea..48455e7aa804 100644
--- a/eng/common/performance/crossgen_perf.proj
+++ b/eng/common/performance/crossgen_perf.proj
@@ -68,9 +68,9 @@
$(WorkItemDirectory)
- $(Python) pre.py crossgen --core-root $(CoreRoot) --single %(Identity)
- $(Python) test.py sod --scenario-name "Crossgen %(Identity) Size" --dirs ./crossgen/
- $(Python) post.py
+ $(Python) $(CrossgenDirectory)pre.py crossgen --core-root $(CoreRoot) --single %(Identity)
+ $(Python) $(CrossgenDirectory)test.py sod --scenario-name "Crossgen %(Identity) Size" --dirs ./crossgen.out/
+ $(Python) $(CrossgenDirectory)post.py
@@ -78,8 +78,8 @@
$(WorkItemDirectory)
$(Python) $(Crossgen2Directory)pre.py crossgen2 --core-root $(CoreRoot) --single %(Identity)
- $(Python) test.py sod --scenario-name "Crossgen2 %(Identity) Size" --dirs ./crossgen/
- $(Python) post.py
+ $(Python) $(Crossgen2Directory)test.py sod --scenario-name "Crossgen2 %(Identity) Size" --dirs ./crossgen.out/
+ $(Python) $(Crossgen2Directory)post.py
diff --git a/eng/common/performance/performance-setup.ps1 b/eng/common/performance/performance-setup.ps1
index 656c0bd9022c..0edb2ae276ed 100644
--- a/eng/common/performance/performance-setup.ps1
+++ b/eng/common/performance/performance-setup.ps1
@@ -82,7 +82,9 @@ $SetupArguments = "--repository https://github.com/$Repository --branch $Branch
#This grabs the LKG version number of dotnet and passes it to our scripts
$VersionJSON = Get-Content global.json | ConvertFrom-Json
$DotNetVersion = $VersionJSON.tools.dotnet
-$SetupArguments = "--dotnet-versions $DotNetVersion $SetupArguments"
+# TODO: Change this back to parsing when we have a good story for dealing with TFM changes or when the LKG in runtime gets updated to include net6.0
+# $SetupArguments = "--dotnet-versions $DotNetVersion $SetupArguments"
+$SetupArguments = "--dotnet-versions 6.0.100-alpha.1.20553.6 $SetupArguments"
if ($RunFromPerformanceRepo) {
diff --git a/eng/common/performance/performance-setup.sh b/eng/common/performance/performance-setup.sh
index 9c0f6c909145..315815a96777 100755
--- a/eng/common/performance/performance-setup.sh
+++ b/eng/common/performance/performance-setup.sh
@@ -223,7 +223,9 @@ if [[ "$use_latest_dotnet" = false ]]; then
# Get the tools section from the global.json.
# This grabs the LKG version number of dotnet and passes it to our scripts
dotnet_version=`cat global.json | python3 -c 'import json,sys;obj=json.load(sys.stdin);print(obj["tools"]["dotnet"])'`
- setup_arguments="--dotnet-versions $dotnet_version $setup_arguments"
+ # TODO: Change this back to parsing when we have a good story for dealing with TFM changes or when the LKG in runtime gets updated to include net6.0
+ # setup_arguments="--dotnet-versions $dotnet_version $setup_arguments"
+ setup_arguments="--dotnet-versions 6.0.100-alpha.1.20553.6 $setup_arguments"
fi
if [[ "$run_from_perf_repo" = true ]]; then
diff --git a/eng/docker/libraries-sdk-aspnetcore.windows.Dockerfile b/eng/docker/libraries-sdk-aspnetcore.windows.Dockerfile
index 584c1e838e66..dd306fc4ff12 100644
--- a/eng/docker/libraries-sdk-aspnetcore.windows.Dockerfile
+++ b/eng/docker/libraries-sdk-aspnetcore.windows.Dockerfile
@@ -5,7 +5,7 @@ FROM $SDK_BASE_IMAGE as target
ARG TESTHOST_LOCATION=".\\artifacts\\bin\\testhost"
ARG TFM=net6.0
-ARG OS=Windows_NT
+ARG OS=windows
ARG ARCH=x64
ARG CONFIGURATION=Release
diff --git a/eng/docker/libraries-sdk.windows.Dockerfile b/eng/docker/libraries-sdk.windows.Dockerfile
index adbf17302fef..564378f44672 100644
--- a/eng/docker/libraries-sdk.windows.Dockerfile
+++ b/eng/docker/libraries-sdk.windows.Dockerfile
@@ -5,7 +5,7 @@ FROM $SDK_BASE_IMAGE as target
ARG TESTHOST_LOCATION=".\\artifacts\\bin\\testhost"
ARG TFM=net6.0
-ARG OS=Windows_NT
+ARG OS=windows
ARG ARCH=x64
ARG CONFIGURATION=Release
diff --git a/eng/illink.targets b/eng/illink.targets
index e5814573953d..b27457517846 100644
--- a/eng/illink.targets
+++ b/eng/illink.targets
@@ -89,7 +89,7 @@
Include="$(ILLinkSuppressionsConfigurationSpecificXmlFile)" />
-
@@ -231,6 +231,8 @@
$(ILLinkArgs) --skip-unresolved true
$(ILLinkArgs) --disable-opt unusedinterfaces
+
+ $(ILLinkArgs) --disable-opt unusedtypechecks
diff --git a/eng/liveBuilds.targets b/eng/liveBuilds.targets
index 5135de072544..097941761a36 100644
--- a/eng/liveBuilds.targets
+++ b/eng/liveBuilds.targets
@@ -27,7 +27,7 @@
'$(AllArtifactsDownloadPath)' != ''">
$(RuntimeIdentifier)
- $(ArtifactPlatform.Replace('win-', 'Windows_NT-'))
+ $(ArtifactPlatform.Replace('win-', 'windows-'))
$(ArtifactPlatform.Replace('unix-', 'Unix-'))
$(ArtifactPlatform.Replace('linux-', 'Linux-'))
$(ArtifactPlatform.Replace('osx-', 'OSX-'))
@@ -197,6 +197,17 @@
$(LibrariesNativeArtifactsPath)dotnet.timezones.blat;
$(LibrariesNativeArtifactsPath)*.dat;"
IsNative="true" />
+
+
diff --git a/eng/native/configureplatform.cmake b/eng/native/configureplatform.cmake
index 0d4ee0dae6de..f8b1a10c0e8f 100644
--- a/eng/native/configureplatform.cmake
+++ b/eng/native/configureplatform.cmake
@@ -178,7 +178,7 @@ if(CLR_CMAKE_HOST_OS STREQUAL SunOS)
endif(CLR_CMAKE_HOST_OS STREQUAL SunOS)
if(CLR_CMAKE_HOST_OS STREQUAL Windows)
- set(CLR_CMAKE_HOST_OS Windows_NT)
+ set(CLR_CMAKE_HOST_OS windows)
set(CLR_CMAKE_HOST_WIN32 1)
endif(CLR_CMAKE_HOST_OS STREQUAL Windows)
@@ -369,7 +369,7 @@ if (CLR_CMAKE_TARGET_OS STREQUAL CLR_CMAKE_HOST_OS)
endif()
endif()
else()
- if(NOT (CLR_CMAKE_HOST_OS STREQUAL Windows_NT))
+ if(NOT (CLR_CMAKE_HOST_OS STREQUAL windows))
message(FATAL_ERROR "Invalid host and target os/arch combination. Host OS: ${CLR_CMAKE_HOST_OS}")
endif()
if(NOT (CLR_CMAKE_TARGET_LINUX OR CLR_CMAKE_TARGET_ALPINE_LINUX))
diff --git a/eng/native/functions.cmake b/eng/native/functions.cmake
index e8f4a6f24186..10c17e692641 100644
--- a/eng/native/functions.cmake
+++ b/eng/native/functions.cmake
@@ -187,7 +187,7 @@ function(compile_asm)
foreach(ASM_FILE ${COMPILE_ASM_ASM_FILES})
get_filename_component(name ${ASM_FILE} NAME_WE)
# Produce object file where CMake would store .obj files for an OBJECT library.
- # ex: artifacts\obj\coreclr\Windows_NT.arm64.Debug\src\vm\wks\cee_wks.dir\Debug\AsmHelpers.obj
+ # ex: artifacts\obj\coreclr\windows.arm64.Debug\src\vm\wks\cee_wks.dir\Debug\AsmHelpers.obj
set (OBJ_FILE "${CMAKE_CURRENT_BINARY_DIR}/${COMPILE_ASM_TARGET}.dir/${CMAKE_CFG_INTDIR}/${name}.obj")
# Need to compile asm file using custom command as include directories are not provided to asm compiler
diff --git a/eng/pipelines/common/global-build-job.yml b/eng/pipelines/common/global-build-job.yml
index 6d6ca9397ab4..d002de384703 100644
--- a/eng/pipelines/common/global-build-job.yml
+++ b/eng/pipelines/common/global-build-job.yml
@@ -88,6 +88,7 @@ jobs:
du -sh $(Build.SourcesDirectory)/*
df -h
displayName: Disk Usage after Build
+ condition: always()
# If intended to send extra steps after regular build add them here.
- ${{ if ne(parameters.extraStepsTemplate, '') }}:
diff --git a/eng/pipelines/common/platform-matrix.yml b/eng/pipelines/common/platform-matrix.yml
index dc77a165d8d6..109caf7cb228 100644
--- a/eng/pipelines/common/platform-matrix.yml
+++ b/eng/pipelines/common/platform-matrix.yml
@@ -452,7 +452,7 @@ jobs:
# macOS arm64
-- ${{ if or(containsValue(parameters.platforms, 'OSX_arm64'), eq(parameters.platformGroup, 'all')) }}:
+- ${{ if containsValue(parameters.platforms, 'OSX_arm64') }}:
- template: xplat-setup.yml
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
@@ -495,16 +495,16 @@ jobs:
# Windows x64
-- ${{ if or(containsValue(parameters.platforms, 'Windows_NT_x64'), in(parameters.platformGroup, 'all', 'gcstress')) }}:
+- ${{ if or(containsValue(parameters.platforms, 'windows_x64'), in(parameters.platformGroup, 'all', 'gcstress')) }}:
- template: xplat-setup.yml
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
variables: ${{ parameters.variables }}
- osGroup: Windows_NT
+ osGroup: windows
archType: x64
targetRid: win-x64
- platform: Windows_NT_x64
+ platform: windows_x64
jobParameters:
runtimeFlavor: ${{ parameters.runtimeFlavor }}
stagedBuild: ${{ parameters.stagedBuild }}
@@ -516,16 +516,16 @@ jobs:
# Windows x86
-- ${{ if or(containsValue(parameters.platforms, 'Windows_NT_x86'), in(parameters.platformGroup, 'all', 'gcstress')) }}:
+- ${{ if or(containsValue(parameters.platforms, 'windows_x86'), in(parameters.platformGroup, 'all', 'gcstress')) }}:
- template: xplat-setup.yml
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
variables: ${{ parameters.variables }}
- osGroup: Windows_NT
+ osGroup: windows
archType: x86
targetRid: win-x86
- platform: Windows_NT_x86
+ platform: windows_x86
jobParameters:
runtimeFlavor: ${{ parameters.runtimeFlavor }}
stagedBuild: ${{ parameters.stagedBuild }}
@@ -536,16 +536,16 @@ jobs:
${{ insert }}: ${{ parameters.jobParameters }}
# Windows arm
-- ${{ if or(containsValue(parameters.platforms, 'Windows_NT_arm'), eq(parameters.platformGroup, 'all')) }}:
+- ${{ if or(containsValue(parameters.platforms, 'windows_arm'), eq(parameters.platformGroup, 'all')) }}:
- template: xplat-setup.yml
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
variables: ${{ parameters.variables }}
- osGroup: Windows_NT
+ osGroup: windows
archType: arm
targetRid: win-arm
- platform: Windows_NT_arm
+ platform: windows_arm
jobParameters:
runtimeFlavor: ${{ parameters.runtimeFlavor }}
stagedBuild: ${{ parameters.stagedBuild }}
@@ -557,16 +557,16 @@ jobs:
# Windows arm64
-- ${{ if or(containsValue(parameters.platforms, 'Windows_NT_arm64'), in(parameters.platformGroup, 'all', 'gcstress')) }}:
+- ${{ if or(containsValue(parameters.platforms, 'windows_arm64'), in(parameters.platformGroup, 'all', 'gcstress')) }}:
- template: xplat-setup.yml
parameters:
jobTemplate: ${{ parameters.jobTemplate }}
helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
variables: ${{ parameters.variables }}
- osGroup: Windows_NT
+ osGroup: windows
archType: arm64
targetRid: win-arm64
- platform: Windows_NT_arm64
+ platform: windows_arm64
jobParameters:
runtimeFlavor: ${{ parameters.runtimeFlavor }}
stagedBuild: ${{ parameters.stagedBuild }}
diff --git a/eng/pipelines/common/templates/runtimes/build-test-job.yml b/eng/pipelines/common/templates/runtimes/build-test-job.yml
index a658bba42fa9..f28ce14ce2cc 100644
--- a/eng/pipelines/common/templates/runtimes/build-test-job.yml
+++ b/eng/pipelines/common/templates/runtimes/build-test-job.yml
@@ -89,7 +89,7 @@ jobs:
- ${{ if eq(parameters.osGroup, 'OSX') }}:
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} azDO
displayName: Install native dependencies
- - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if eq(parameters.osGroup, 'windows') }}:
# Necessary to install correct cmake version
- script: $(Build.SourcesDirectory)\eng\common\init-tools-native.cmd -InstallDirectory $(Build.SourcesDirectory)\native-tools -Force
displayName: Install native dependencies
diff --git a/eng/pipelines/common/templates/runtimes/send-to-helix-inner-step.yml b/eng/pipelines/common/templates/runtimes/send-to-helix-inner-step.yml
index 647778511370..1427e68a273e 100644
--- a/eng/pipelines/common/templates/runtimes/send-to-helix-inner-step.yml
+++ b/eng/pipelines/common/templates/runtimes/send-to-helix-inner-step.yml
@@ -7,7 +7,7 @@ parameters:
environment: {}
steps:
-- ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+- ${{ if eq(parameters.osGroup, 'windows') }}:
# TODO: Remove and consolidate this when we move to arcade via init-tools.cmd.
- powershell: $(Build.SourcesDirectory)\eng\common\build.ps1 -ci ${{ parameters.restoreParams }}
displayName: Restore blob feed tasks (Windows)
@@ -18,7 +18,7 @@ steps:
condition: ${{ and(ne(parameters.condition, false), ne(parameters.sendParams, '')) }}
env: ${{ parameters.environment }}
-- ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
+- ${{ if ne(parameters.osGroup, 'windows') }}:
# TODO: Remove and consolidate this when we move to arcade via init-tools.sh.
- script: $(Build.SourcesDirectory)/eng/common/build.sh --ci ${{ parameters.restoreParams }}
displayName: Restore blob feed tasks (Unix)
diff --git a/eng/pipelines/common/xplat-setup.yml b/eng/pipelines/common/xplat-setup.yml
index c449f3f14e64..d8df89ed73ac 100644
--- a/eng/pipelines/common/xplat-setup.yml
+++ b/eng/pipelines/common/xplat-setup.yml
@@ -43,7 +43,7 @@ jobs:
- name: _BuildConfig
value: $(buildConfigUpper)
- - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if eq(parameters.osGroup, 'windows') }}:
- name: archiveExtension
value: '.zip'
- name: archiveType
@@ -59,7 +59,7 @@ jobs:
- name: setScriptToEchoAndFailOnNonZero
value: ''
- - ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if ne(parameters.osGroup, 'windows') }}:
- name: archiveExtension
value: '.tar.gz'
- name: archiveType
@@ -119,12 +119,12 @@ jobs:
vmImage: 'macOS-10.15'
# Official Build Windows Pool
- ${{ if and(eq(parameters.osGroup, 'Windows_NT'), ne(variables['System.TeamProject'], 'public')) }}:
+ ${{ if and(eq(parameters.osGroup, 'windows'), ne(variables['System.TeamProject'], 'public')) }}:
name: NetCoreInternal-Pool
queue: BuildPool.Windows.10.Amd64.VS2019
# Public Windows Build Pool
- ${{ if and(eq(parameters.osGroup, 'Windows_NT'), eq(variables['System.TeamProject'], 'public')) }}:
+ ${{ if and(eq(parameters.osGroup, 'windows'), eq(variables['System.TeamProject'], 'public')) }}:
name: NetCorePublic-Pool
queue: BuildPool.Windows.10.Amd64.VS2019.Open
diff --git a/eng/pipelines/coreclr/ci.yml b/eng/pipelines/coreclr/ci.yml
index 2c0cba802d91..ea79101e9b43 100644
--- a/eng/pipelines/coreclr/ci.yml
+++ b/eng/pipelines/coreclr/ci.yml
@@ -46,8 +46,8 @@ jobs:
- Linux_x64
- OSX_arm64
- OSX_x64
- - Windows_NT_arm
- - Windows_NT_arm64
+ - windows_arm
+ - windows_arm64
jobParameters:
testGroup: outerloop
@@ -75,7 +75,7 @@ jobs:
- Linux_x64
- OSX_arm64
- OSX_x64
- - Windows_NT_x86
+ - windows_x86
jobParameters:
testGroup: outerloop
@@ -131,10 +131,10 @@ jobs:
- Linux_musl_arm64
- Linux_x64
- OSX_x64
- - Windows_NT_x64
- - Windows_NT_x86
- - Windows_NT_arm
- - Windows_NT_arm64
+ - windows_x64
+ - windows_x86
+ - windows_arm
+ - windows_arm64
helixQueueGroup: ci
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
jobParameters:
@@ -166,4 +166,4 @@ jobs:
platforms:
- Linux_x64
# Issue: https://github.com/dotnet/runtime/issues/40034
- #- Windows_NT_x64
+ #- windows_x64
diff --git a/eng/pipelines/coreclr/clrinterpreter.yml b/eng/pipelines/coreclr/clrinterpreter.yml
index 9506af301012..05d2418e8449 100644
--- a/eng/pipelines/coreclr/clrinterpreter.yml
+++ b/eng/pipelines/coreclr/clrinterpreter.yml
@@ -24,9 +24,9 @@ jobs:
- Linux_arm
- Linux_arm64
- Linux_x64
- - Windows_NT_x64
- - Windows_NT_x86
- - Windows_NT_arm64
+ - windows_x64
+ - windows_x86
+ - windows_arm64
- CoreClrTestBuildHost # Either OSX_x64 or Linux_x64
jobParameters:
testGroup: clrinterpreter
@@ -49,9 +49,9 @@ jobs:
- Linux_arm
- Linux_arm64
- Linux_x64
- - Windows_NT_x64
- - Windows_NT_x86
- - Windows_NT_arm64
+ - windows_x64
+ - windows_x86
+ - windows_arm64
helixQueueGroup: ci
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
jobParameters:
diff --git a/eng/pipelines/coreclr/crossgen2-composite.yml b/eng/pipelines/coreclr/crossgen2-composite.yml
index 49dd16efcf62..7e60b582eade 100644
--- a/eng/pipelines/coreclr/crossgen2-composite.yml
+++ b/eng/pipelines/coreclr/crossgen2-composite.yml
@@ -23,9 +23,9 @@ jobs:
- Linux_x64
- Linux_arm64
- OSX_x64
- - Windows_NT_x86
- - Windows_NT_x64
- - Windows_NT_arm64
+ - windows_x86
+ - windows_x64
+ - windows_arm64
- CoreClrTestBuildHost # Either OSX_x64 or Linux_x64
jobParameters:
testGroup: innerloop
@@ -50,9 +50,9 @@ jobs:
- Linux_x64
- Linux_arm64
- OSX_x64
- - Windows_NT_x86
- - Windows_NT_x64
- - Windows_NT_arm64
+ - windows_x86
+ - windows_x64
+ - windows_arm64
jobParameters:
testGroup: innerloop
readyToRun: true
diff --git a/eng/pipelines/coreclr/crossgen2-gcstress.yml b/eng/pipelines/coreclr/crossgen2-gcstress.yml
index f1b4fd23bf89..b0eccd168ca6 100644
--- a/eng/pipelines/coreclr/crossgen2-gcstress.yml
+++ b/eng/pipelines/coreclr/crossgen2-gcstress.yml
@@ -22,8 +22,8 @@ jobs:
- Linux_x64
- Linux_arm64
- OSX_x64
- - Windows_NT_x64
- - Windows_NT_arm64
+ - windows_x64
+ - windows_arm64
- CoreClrTestBuildHost # Either OSX_x64 or Linux_x64
jobParameters:
testGroup: gcstress-extra
@@ -47,8 +47,8 @@ jobs:
- Linux_x64
- Linux_arm64
- OSX_x64
- - Windows_NT_x64
- - Windows_NT_arm64
+ - windows_x64
+ - windows_arm64
jobParameters:
testGroup: gcstress-extra
readyToRun: true
diff --git a/eng/pipelines/coreclr/crossgen2-outerloop.yml b/eng/pipelines/coreclr/crossgen2-outerloop.yml
index e5b55caca997..e7f7d12b4baf 100644
--- a/eng/pipelines/coreclr/crossgen2-outerloop.yml
+++ b/eng/pipelines/coreclr/crossgen2-outerloop.yml
@@ -22,8 +22,8 @@ jobs:
- Linux_x64
- Linux_arm64
- OSX_x64
- - Windows_NT_x64
- - Windows_NT_arm64
+ - windows_x64
+ - windows_arm64
- CoreClrTestBuildHost # Either OSX_x64 or Linux_x64
jobParameters:
testGroup: outerloop
@@ -36,8 +36,8 @@ jobs:
- Linux_arm
- Linux_arm64
- Linux_x64
- - Windows_NT_x86
- - Windows_NT_x64
+ - windows_x86
+ - windows_x64
jobParameters:
testGroup: outerloop
@@ -50,9 +50,9 @@ jobs:
- Linux_arm64
- Linux_x64
- OSX_x64
- - Windows_NT_x86
- - Windows_NT_x64
- - Windows_NT_arm64
+ - windows_x86
+ - windows_x64
+ - windows_arm64
- CoreClrTestBuildHost # Either OSX_x64 or Linux_x64
jobParameters:
isOfficialBuild: false
@@ -78,8 +78,8 @@ jobs:
- Linux_x64
- Linux_arm64
- OSX_x64
- - Windows_NT_x64
- - Windows_NT_arm64
+ - windows_x64
+ - windows_arm64
jobParameters:
testGroup: outerloop
readyToRun: true
@@ -114,8 +114,8 @@ jobs:
- Linux_arm
- Linux_arm64
- Linux_x64
- - Windows_NT_x86
- - Windows_NT_x64
+ - windows_x86
+ - windows_x64
jobParameters:
testGroup: outerloop
liveLibrariesBuildConfig: Release
@@ -129,13 +129,13 @@ jobs:
buildConfig: Release
platforms:
- Linux_x64
- - Windows_NT_x86
+ - windows_x86
helixQueueGroup: pr
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
jobParameters:
testGroup: outerloop
liveLibrariesBuildConfig: Release
- targetos: Windows_NT
+ targetos: windows
targetarch: x86
# test target Linux X64
@@ -145,7 +145,7 @@ jobs:
jobTemplate: /eng/pipelines/coreclr/templates/crossgen2-comparison-job.yml
buildConfig: Release
platforms:
- - Windows_NT_x64
+ - windows_x64
helixQueueGroup: pr
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
jobParameters:
@@ -167,7 +167,7 @@ jobs:
jobParameters:
testGroup: outerloop
liveLibrariesBuildConfig: Release
- targetos: Windows_NT
+ targetos: windows
targetarch: x64
# test target Linux arm
diff --git a/eng/pipelines/coreclr/crossgen2.yml b/eng/pipelines/coreclr/crossgen2.yml
index e2623babf1e3..01c84fa43b41 100644
--- a/eng/pipelines/coreclr/crossgen2.yml
+++ b/eng/pipelines/coreclr/crossgen2.yml
@@ -22,8 +22,8 @@ jobs:
- Linux_x64
- Linux_arm64
- OSX_x64
- - Windows_NT_x64
- - Windows_NT_arm64
+ - windows_x64
+ - windows_arm64
- CoreClrTestBuildHost # Either OSX_x64 or Linux_x64
jobParameters:
testGroup: innerloop
@@ -47,8 +47,8 @@ jobs:
- Linux_x64
- Linux_arm64
- OSX_x64
- - Windows_NT_x64
- - Windows_NT_arm64
+ - windows_x64
+ - windows_arm64
jobParameters:
testGroup: innerloop
readyToRun: true
diff --git a/eng/pipelines/coreclr/gc-longrunning.yml b/eng/pipelines/coreclr/gc-longrunning.yml
index c2dc2e07dfd1..a45dcdc868f1 100644
--- a/eng/pipelines/coreclr/gc-longrunning.yml
+++ b/eng/pipelines/coreclr/gc-longrunning.yml
@@ -23,8 +23,8 @@ jobs:
platforms:
- Linux_x64
- Linux_arm64
- - Windows_NT_x64
- - Windows_NT_arm64
+ - windows_x64
+ - windows_arm64
- OSX_x64
- CoreClrTestBuildHost # Either OSX_x64 or Linux_x64
jobParameters:
@@ -47,8 +47,8 @@ jobs:
platforms:
- Linux_x64
- Linux_arm64
- - Windows_NT_x64
- - Windows_NT_arm64
+ - windows_x64
+ - windows_arm64
helixQueueGroup: ci
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
jobParameters:
diff --git a/eng/pipelines/coreclr/gc-simulator.yml b/eng/pipelines/coreclr/gc-simulator.yml
index bb8daf817272..c2250084b67f 100644
--- a/eng/pipelines/coreclr/gc-simulator.yml
+++ b/eng/pipelines/coreclr/gc-simulator.yml
@@ -24,8 +24,8 @@ jobs:
# disable Linux x64 for now untill OOMs are resolved.
# - Linux_x64
- Linux_arm64
- - Windows_NT_x64
- - Windows_NT_arm64
+ - windows_x64
+ - windows_arm64
- OSX_x64
- CoreClrTestBuildHost # Either OSX_x64 or Linux_x64
jobParameters:
@@ -49,8 +49,8 @@ jobs:
# disable Linux x64 for now untill OOMs are resolved.
# - Linux_x64
- Linux_arm64
- - Windows_NT_x64
- - Windows_NT_arm64
+ - windows_x64
+ - windows_arm64
helixQueueGroup: ci
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
jobParameters:
diff --git a/eng/pipelines/coreclr/ilasm.yml b/eng/pipelines/coreclr/ilasm.yml
index 130f36938e47..ebf13e901195 100644
--- a/eng/pipelines/coreclr/ilasm.yml
+++ b/eng/pipelines/coreclr/ilasm.yml
@@ -33,9 +33,9 @@ jobs:
- Linux_arm
- Linux_arm64
- Linux_x64
- - Windows_NT_x64
- - Windows_NT_x86
- - Windows_NT_arm64
+ - windows_x64
+ - windows_x86
+ - windows_arm64
- CoreClrTestBuildHost # Either OSX_x64 or Linux_x64
jobParameters:
testGroup: ilasm
@@ -60,9 +60,9 @@ jobs:
- Linux_arm
- Linux_arm64
- Linux_x64
- - Windows_NT_x64
- - Windows_NT_x86
- - Windows_NT_arm64
+ - windows_x64
+ - windows_x86
+ - windows_arm64
helixQueueGroup: ci
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
jobParameters:
diff --git a/eng/pipelines/coreclr/jit-experimental.yml b/eng/pipelines/coreclr/jit-experimental.yml
index 70790dddb9e2..f4bd8a36dce2 100644
--- a/eng/pipelines/coreclr/jit-experimental.yml
+++ b/eng/pipelines/coreclr/jit-experimental.yml
@@ -20,7 +20,7 @@ jobs:
buildConfig: checked
platforms:
- Linux_x64
- - Windows_NT_x64
+ - windows_x64
- CoreClrTestBuildHost # Either OSX_x64 or Linux_x64
jobParameters:
testGroup: jit-experimental
@@ -41,7 +41,7 @@ jobs:
buildConfig: checked
platforms:
- Linux_x64
- - Windows_NT_x64
+ - windows_x64
helixQueueGroup: ci
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
jobParameters:
diff --git a/eng/pipelines/coreclr/jitrollingbuild.yml b/eng/pipelines/coreclr/jitrollingbuild.yml
index 68be50e4e2a9..9d608216059f 100644
--- a/eng/pipelines/coreclr/jitrollingbuild.yml
+++ b/eng/pipelines/coreclr/jitrollingbuild.yml
@@ -27,6 +27,6 @@ jobs:
# - Linux_arm
# - Linux_arm64
- Linux_x64
- - Windows_NT_x64
- - Windows_NT_x86
- - Windows_NT_arm64
+ - windows_x64
+ - windows_x86
+ - windows_arm64
diff --git a/eng/pipelines/coreclr/jitstress-isas-arm.yml b/eng/pipelines/coreclr/jitstress-isas-arm.yml
index 6a9c1b00425c..f7fda9231f18 100644
--- a/eng/pipelines/coreclr/jitstress-isas-arm.yml
+++ b/eng/pipelines/coreclr/jitstress-isas-arm.yml
@@ -22,7 +22,7 @@ jobs:
buildConfig: checked
platforms:
- Linux_arm64
- - Windows_NT_arm64
+ - windows_arm64
- CoreClrTestBuildHost # Either OSX_x64 or Linux_x64
jobParameters:
testGroup: jitstress-isas-arm
@@ -43,7 +43,7 @@ jobs:
buildConfig: checked
platforms:
- Linux_arm64
- - Windows_NT_arm64
+ - windows_arm64
helixQueueGroup: ci
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
jobParameters:
diff --git a/eng/pipelines/coreclr/jitstress-isas-x86.yml b/eng/pipelines/coreclr/jitstress-isas-x86.yml
index 98beca7b6fa7..4f9978f75d72 100644
--- a/eng/pipelines/coreclr/jitstress-isas-x86.yml
+++ b/eng/pipelines/coreclr/jitstress-isas-x86.yml
@@ -23,8 +23,8 @@ jobs:
platforms:
- Linux_x64
- OSX_x64
- - Windows_NT_x64
- - Windows_NT_x86
+ - windows_x64
+ - windows_x86
- CoreClrTestBuildHost # Either OSX_x64 or Linux_x64
jobParameters:
testGroup: jitstress-isas-x86
@@ -46,8 +46,8 @@ jobs:
platforms:
- Linux_x64
- OSX_x64
- - Windows_NT_x64
- - Windows_NT_x86
+ - windows_x64
+ - windows_x86
helixQueueGroup: ci
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
jobParameters:
diff --git a/eng/pipelines/coreclr/jitstress.yml b/eng/pipelines/coreclr/jitstress.yml
index a78aaa620f0f..bad86b7c5b7e 100644
--- a/eng/pipelines/coreclr/jitstress.yml
+++ b/eng/pipelines/coreclr/jitstress.yml
@@ -32,9 +32,9 @@ jobs:
- Linux_arm
- Linux_arm64
- Linux_x64
- - Windows_NT_x64
- - Windows_NT_x86
- - Windows_NT_arm64
+ - windows_x64
+ - windows_x86
+ - windows_arm64
- CoreClrTestBuildHost # Either OSX_x64 or Linux_x64
jobParameters:
testGroup: jitstress
@@ -59,9 +59,9 @@ jobs:
- Linux_arm
- Linux_arm64
- Linux_x64
- - Windows_NT_x64
- - Windows_NT_x86
- - Windows_NT_arm64
+ - windows_x64
+ - windows_x86
+ - windows_arm64
helixQueueGroup: ci
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
jobParameters:
diff --git a/eng/pipelines/coreclr/jitstress2-jitstressregs.yml b/eng/pipelines/coreclr/jitstress2-jitstressregs.yml
index 743e071e08e8..3510c09abcd5 100644
--- a/eng/pipelines/coreclr/jitstress2-jitstressregs.yml
+++ b/eng/pipelines/coreclr/jitstress2-jitstressregs.yml
@@ -26,9 +26,9 @@ jobs:
- Linux_arm
- Linux_arm64
- Linux_x64
- - Windows_NT_x64
- - Windows_NT_x86
- - Windows_NT_arm64
+ - windows_x64
+ - windows_x86
+ - windows_arm64
- CoreClrTestBuildHost # Either OSX_x64 or Linux_x64
jobParameters:
testGroup: jitstress2-jitstressregs
@@ -53,9 +53,9 @@ jobs:
- Linux_arm
- Linux_arm64
- Linux_x64
- - Windows_NT_x64
- - Windows_NT_x86
- - Windows_NT_arm64
+ - windows_x64
+ - windows_x86
+ - windows_arm64
helixQueueGroup: ci
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
jobParameters:
diff --git a/eng/pipelines/coreclr/jitstressregs-x86.yml b/eng/pipelines/coreclr/jitstressregs-x86.yml
index 9de11695b46a..387e159499d5 100644
--- a/eng/pipelines/coreclr/jitstressregs-x86.yml
+++ b/eng/pipelines/coreclr/jitstressregs-x86.yml
@@ -22,8 +22,8 @@ jobs:
buildConfig: checked
platforms:
- Linux_x64
- - Windows_NT_x64
- - Windows_NT_x86
+ - windows_x64
+ - windows_x86
- CoreClrTestBuildHost # Either OSX_x64 or Linux_x64
jobParameters:
testGroup: jitstressregs-x86
@@ -44,8 +44,8 @@ jobs:
buildConfig: checked
platforms:
- Linux_x64
- - Windows_NT_x64
- - Windows_NT_x86
+ - windows_x64
+ - windows_x86
helixQueueGroup: ci
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
jobParameters:
diff --git a/eng/pipelines/coreclr/jitstressregs.yml b/eng/pipelines/coreclr/jitstressregs.yml
index 12c8fc515887..337261e7d5ee 100644
--- a/eng/pipelines/coreclr/jitstressregs.yml
+++ b/eng/pipelines/coreclr/jitstressregs.yml
@@ -26,9 +26,9 @@ jobs:
- Linux_arm
- Linux_arm64
- Linux_x64
- - Windows_NT_x64
- - Windows_NT_x86
- - Windows_NT_arm64
+ - windows_x64
+ - windows_x86
+ - windows_arm64
- CoreClrTestBuildHost # Either OSX_x64 or Linux_x64
jobParameters:
testGroup: jitstressregs
@@ -53,9 +53,9 @@ jobs:
- Linux_arm
- Linux_arm64
- Linux_x64
- - Windows_NT_x64
- - Windows_NT_x86
- - Windows_NT_arm64
+ - windows_x64
+ - windows_x86
+ - windows_arm64
helixQueueGroup: ci
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
jobParameters:
diff --git a/eng/pipelines/coreclr/libraries-gcstress-extra.yml b/eng/pipelines/coreclr/libraries-gcstress-extra.yml
index 4063b0a8ffb9..e3869102b2d7 100644
--- a/eng/pipelines/coreclr/libraries-gcstress-extra.yml
+++ b/eng/pipelines/coreclr/libraries-gcstress-extra.yml
@@ -29,7 +29,7 @@ jobs:
# libraries test build platforms
testBuildPlatforms:
- Linux_x64
- - Windows_NT_x64
+ - windows_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 d5df152153db..5d49cb6f13a8 100644
--- a/eng/pipelines/coreclr/libraries-gcstress0x3-gcstress0xc.yml
+++ b/eng/pipelines/coreclr/libraries-gcstress0x3-gcstress0xc.yml
@@ -29,7 +29,7 @@ jobs:
# libraries test build platforms
testBuildPlatforms:
- Linux_x64
- - Windows_NT_x64
+ - windows_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 91fae482d447..4d12e1ccb8ed 100644
--- a/eng/pipelines/coreclr/libraries-jitstress.yml
+++ b/eng/pipelines/coreclr/libraries-jitstress.yml
@@ -33,14 +33,14 @@ jobs:
- Linux_x64
- Linux_arm
- Linux_arm64
- - Windows_NT_x86
- - Windows_NT_x64
- - Windows_NT_arm64
+ - windows_x86
+ - windows_x64
+ - windows_arm64
jobParameters:
# libraries test build platforms
testBuildPlatforms:
- Linux_x64
- - Windows_NT_x64
+ - windows_x64
#
# Libraries Test Run using Release libraries, Checked CoreCLR, and stress modes
@@ -53,9 +53,9 @@ jobs:
- Linux_arm
- Linux_arm64
- Linux_x64
- - Windows_NT_arm64
- - Windows_NT_x64
- - Windows_NT_x86
+ - windows_arm64
+ - windows_x64
+ - windows_x86
helixQueueGroup: libraries
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
jobParameters:
diff --git a/eng/pipelines/coreclr/libraries-jitstress2-jitstressregs.yml b/eng/pipelines/coreclr/libraries-jitstress2-jitstressregs.yml
index d1a2a0afd0e5..b558def3d53e 100644
--- a/eng/pipelines/coreclr/libraries-jitstress2-jitstressregs.yml
+++ b/eng/pipelines/coreclr/libraries-jitstress2-jitstressregs.yml
@@ -27,14 +27,14 @@ jobs:
- Linux_x64
- Linux_arm
- Linux_arm64
- - Windows_NT_x86
- - Windows_NT_x64
- - Windows_NT_arm64
+ - windows_x86
+ - windows_x64
+ - windows_arm64
jobParameters:
# libraries test build platforms
testBuildPlatforms:
- Linux_x64
- - Windows_NT_x64
+ - windows_x64
#
# Libraries Test Run using Release libraries, Checked CoreCLR, and stress modes
@@ -47,9 +47,9 @@ jobs:
- Linux_arm
- Linux_arm64
- Linux_x64
- - Windows_NT_arm64
- - Windows_NT_x64
- - Windows_NT_x86
+ - windows_arm64
+ - windows_x64
+ - windows_x86
helixQueueGroup: libraries
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
jobParameters:
diff --git a/eng/pipelines/coreclr/libraries-jitstressregs.yml b/eng/pipelines/coreclr/libraries-jitstressregs.yml
index 691cb29b0d9f..b4f9386b8a1b 100644
--- a/eng/pipelines/coreclr/libraries-jitstressregs.yml
+++ b/eng/pipelines/coreclr/libraries-jitstressregs.yml
@@ -27,14 +27,14 @@ jobs:
- Linux_x64
- Linux_arm
- Linux_arm64
- - Windows_NT_x86
- - Windows_NT_x64
- - Windows_NT_arm64
+ - windows_x86
+ - windows_x64
+ - windows_arm64
jobParameters:
# libraries test build platforms
testBuildPlatforms:
- Linux_x64
- - Windows_NT_x64
+ - windows_x64
#
# Libraries Test Run using Release libraries, Checked CoreCLR, and stress modes
@@ -47,9 +47,9 @@ jobs:
- Linux_arm
- Linux_arm64
- Linux_x64
- - Windows_NT_arm64
- - Windows_NT_x64
- - Windows_NT_x86
+ - windows_arm64
+ - windows_x64
+ - windows_x86
helixQueueGroup: libraries
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
jobParameters:
diff --git a/eng/pipelines/coreclr/perf.yml b/eng/pipelines/coreclr/perf.yml
index 8b12dae2dd1d..a80e985fef1d 100644
--- a/eng/pipelines/coreclr/perf.yml
+++ b/eng/pipelines/coreclr/perf.yml
@@ -34,8 +34,8 @@ jobs:
buildConfig: release
platforms:
- Linux_x64
- - Windows_NT_x64
- - Windows_NT_x86
+ - windows_x64
+ - windows_x86
jobParameters:
testGroup: perf
@@ -128,8 +128,8 @@ jobs:
runtimeFlavor: coreclr
platforms:
- Linux_x64
- - Windows_NT_x64
- - Windows_NT_x86
+ - windows_x64
+ - windows_x86
jobParameters:
testGroup: perf
liveLibrariesBuildConfig: Release
@@ -145,8 +145,8 @@ jobs:
runtimeFlavor: coreclr
platforms:
- Linux_x64
- - Windows_NT_x64
- - Windows_NT_x86
+ - windows_x64
+ - windows_x86
jobParameters:
testGroup: perf
liveLibrariesBuildConfig: Release
diff --git a/eng/pipelines/coreclr/r2r.yml b/eng/pipelines/coreclr/r2r.yml
index a3b76e9d8e3f..e8bde2dd259c 100644
--- a/eng/pipelines/coreclr/r2r.yml
+++ b/eng/pipelines/coreclr/r2r.yml
@@ -22,10 +22,10 @@ jobs:
- Linux_arm
- Linux_arm64
- Linux_x64
- - Windows_NT_arm
- - Windows_NT_arm64
- - Windows_NT_x64
- - Windows_NT_x86
+ - windows_arm
+ - windows_arm64
+ - windows_x64
+ - windows_x86
- CoreClrTestBuildHost # Either OSX_x64 or Linux_x64
jobParameters:
testGroup: outerloop
@@ -48,10 +48,10 @@ jobs:
- Linux_arm
- Linux_arm64
- Linux_x64
- - Windows_NT_arm
- - Windows_NT_arm64
- - Windows_NT_x64
- - Windows_NT_x86
+ - windows_arm
+ - windows_arm64
+ - windows_x64
+ - windows_x86
helixQueueGroup: ci
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
jobParameters:
diff --git a/eng/pipelines/coreclr/runincontext.yml b/eng/pipelines/coreclr/runincontext.yml
index 64e6fe6205a3..037dad2a3f16 100644
--- a/eng/pipelines/coreclr/runincontext.yml
+++ b/eng/pipelines/coreclr/runincontext.yml
@@ -20,8 +20,8 @@ jobs:
buildConfig: checked
platforms:
- Linux_x64
- - Windows_NT_x64
- - Windows_NT_x86
+ - windows_x64
+ - windows_x86
- CoreClrTestBuildHost # Either OSX_x64 or Linux_x64
jobParameters:
testGroup: outerloop
@@ -42,8 +42,8 @@ jobs:
buildConfig: checked
platforms:
- Linux_x64
- - Windows_NT_x64
- - Windows_NT_x86
+ - windows_x64
+ - windows_x86
helixQueueGroup: ci
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
jobParameters:
diff --git a/eng/pipelines/coreclr/superpmi.yml b/eng/pipelines/coreclr/superpmi.yml
index 5fb435365182..3ae264540b1f 100644
--- a/eng/pipelines/coreclr/superpmi.yml
+++ b/eng/pipelines/coreclr/superpmi.yml
@@ -27,9 +27,9 @@ jobs:
- Linux_arm
- Linux_arm64
- Linux_x64
- - Windows_NT_x64
- - Windows_NT_x86
- - Windows_NT_arm64
+ - windows_x64
+ - windows_x86
+ - windows_arm64
- CoreClrTestBuildHost # Either OSX_x64 or Linux_x64
jobParameters:
testGroup: outerloop
@@ -54,9 +54,9 @@ jobs:
- Linux_arm
- Linux_arm64
- Linux_x64
- - Windows_NT_x64
- - Windows_NT_x86
- - Windows_NT_arm64
+ - windows_x64
+ - windows_x86
+ - windows_arm64
helixQueueGroup: ci
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
jobParameters:
@@ -74,9 +74,9 @@ jobs:
- Linux_arm
- Linux_arm64
- Linux_x64
- - Windows_NT_x64
- - Windows_NT_x86
- - Windows_NT_arm64
+ - windows_x64
+ - windows_x86
+ - windows_arm64
- CoreClrTestBuildHost # Either OSX_x64 or Linux_x64
helixQueueGroup: ci
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
diff --git a/eng/pipelines/coreclr/templates/build-jit-job.yml b/eng/pipelines/coreclr/templates/build-jit-job.yml
index a5f31d4d3b55..e07a0d272ab7 100644
--- a/eng/pipelines/coreclr/templates/build-jit-job.yml
+++ b/eng/pipelines/coreclr/templates/build-jit-job.yml
@@ -50,7 +50,7 @@ jobs:
- name: compilerArg
value: ''
- - ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if ne(parameters.osGroup, 'windows') }}:
- name: compilerArg
value: '-clang9'
# Building for x64 MUSL happens on Alpine Linux and we need to use the stable version available there
@@ -62,12 +62,12 @@ jobs:
- name: compilerArg
value: ''
- - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if eq(parameters.osGroup, 'windows') }}:
- name: PythonScript
value: 'py -3'
- name: PipScript
value: 'py -3 -m pip'
- - ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if ne(parameters.osGroup, 'windows') }}:
- name: PythonScript
value: 'python3'
- name: PipScript
@@ -84,7 +84,7 @@ jobs:
- ${{ if eq(parameters.osGroup, 'OSX') }}:
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} azDO
displayName: Install native dependencies
- - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if eq(parameters.osGroup, 'windows') }}:
# Necessary to install python
- script: $(Build.SourcesDirectory)\eng\common\init-tools-native.cmd -InstallDirectory $(Build.SourcesDirectory)\native-tools -Force
displayName: Install native dependencies
@@ -97,10 +97,10 @@ jobs:
- template: /eng/pipelines/common/restore-internal-tools.yml
# Build CoreCLR JIT
- - ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if ne(parameters.osGroup, 'windows') }}:
- script: $(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) $(crossArg) -ci $(compilerArg) -skipruntime -nopgooptimize
displayName: Build CoreCLR JIT
- - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if eq(parameters.osGroup, 'windows') }}:
- script: set __TestIntermediateDir=int&&$(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) -ci -skipruntime -nopgooptimize -skiprestoreoptdata
displayName: Build CoreCLR JIT
diff --git a/eng/pipelines/coreclr/templates/build-job.yml b/eng/pipelines/coreclr/templates/build-job.yml
index de501480b767..beb779bc605b 100644
--- a/eng/pipelines/coreclr/templates/build-job.yml
+++ b/eng/pipelines/coreclr/templates/build-job.yml
@@ -74,7 +74,7 @@ jobs:
value: '-gcc'
- name: publishLogsArtifactPrefix
value: 'BuildLogs_CoreCLR_GCC'
- - ${{ if and(ne(parameters.osGroup, 'Windows_NT'), ne(parameters.compilerName, 'gcc')) }}:
+ - ${{ if and(ne(parameters.osGroup, 'windows'), ne(parameters.compilerName, 'gcc')) }}:
- name: compilerArg
value: '-clang9'
# Building for x64 MUSL happens on Alpine Linux and we need to use the stable version available there
@@ -102,7 +102,7 @@ jobs:
- name: enforcePgoArg
value: ''
# The EnforcePGO script is only supported on Windows and is not supported on arm or arm64.
- - ${{ if and(eq(parameters.buildConfig, 'Release'), and(eq(parameters.osGroup, 'Windows_NT'), not(or(eq(parameters.archType, 'arm64'), eq(parameters.archType, 'arm'))))) }}:
+ - ${{ if and(eq(parameters.buildConfig, 'Release'), and(eq(parameters.osGroup, 'windows'), not(or(eq(parameters.archType, 'arm64'), eq(parameters.archType, 'arm'))))) }}:
- name: enforcePgoArg
value: '-enforcepgo'
@@ -120,7 +120,7 @@ jobs:
- name: ninjaArg
value: ''
- - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if eq(parameters.osGroup, 'windows') }}:
- name: ninjaArg
value: '-ninja'
@@ -135,7 +135,7 @@ jobs:
- ${{ if eq(parameters.osGroup, 'OSX') }}:
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} azDO
displayName: Install native dependencies
- - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if eq(parameters.osGroup, 'windows') }}:
# Necessary to install python
- script: $(Build.SourcesDirectory)\eng\common\init-tools-native.cmd -InstallDirectory $(Build.SourcesDirectory)\native-tools -Force
displayName: Install native dependencies
@@ -154,15 +154,15 @@ jobs:
displayName: Disk Usage before Build
# Build DacTableGen (Windows-only)
- - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if eq(parameters.osGroup, 'windows') }}:
- script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -subset clr.dactools $(crossArg) -arch $(archType) $(osArg) -c $(buildConfig) $(officialBuildIdArg) -ci /bl:$(Build.SourcesDirectory)artifacts/logs/$(buildConfig)/DacTools.binlog
displayName: Build managed product components and packages
# Build CoreCLR Runtime
- - ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if ne(parameters.osGroup, 'windows') }}:
- script: $(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) $(crossArg) $(osArg) -ci $(compilerArg) $(clrBuildPALTestsBuildArg) $(ninjaArg) $(officialBuildIdArg) $(clrInterpreterBuildArg)
displayName: Build CoreCLR Runtime
- - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if eq(parameters.osGroup, 'windows') }}:
- script: set __TestIntermediateDir=int&&$(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) -ci $(ninjaArg) $(enforcePgoArg) $(officialBuildIdArg) $(clrInterpreterBuildArg)
displayName: Build CoreCLR Runtime
@@ -209,7 +209,7 @@ jobs:
overWrite: true
# Sign on Windows
- - ${{ if and(eq(parameters.osGroup, 'Windows_NT'), eq(parameters.signBinaries, 'true'), ne(parameters.testGroup, 'clrTools')) }}:
+ - ${{ if and(eq(parameters.osGroup, 'windows'), eq(parameters.signBinaries, 'true'), ne(parameters.testGroup, 'clrTools')) }}:
- powershell: eng\common\build.ps1 -ci -sign -restore -configuration:$(buildConfig) -warnaserror:0 /p:ArcadeBuild=true /p:OfficialBuild=true /p:TargetOS=$(osGroup) /p:TargetArchitecture=$(archType) /p:Configuration=$(_BuildConfig) /p:DotNetSignType=$env:_SignType -projects $(Build.SourcesDirectory)\eng\empty.csproj
displayName: Sign Binaries
@@ -234,7 +234,7 @@ jobs:
artifactName: $(buildProductArtifactName)
displayName: 'product build'
- - ${{ if and(in(parameters.osGroup, 'Windows_NT', 'Linux'), ne(parameters.archType, 'x86'), ne(parameters.compilerName, 'gcc'), ne(parameters.testGroup, 'clrTools')) }}:
+ - ${{ if and(in(parameters.osGroup, 'windows', 'Linux'), ne(parameters.archType, 'x86'), ne(parameters.compilerName, 'gcc'), ne(parameters.testGroup, 'clrTools')) }}:
- template: /eng/pipelines/coreclr/templates/crossdac-build.yml
parameters:
archType: ${{ parameters.archType }}
diff --git a/eng/pipelines/coreclr/templates/crossdac-build.yml b/eng/pipelines/coreclr/templates/crossdac-build.yml
index 44fd80157f96..216485692c64 100644
--- a/eng/pipelines/coreclr/templates/crossdac-build.yml
+++ b/eng/pipelines/coreclr/templates/crossdac-build.yml
@@ -5,13 +5,13 @@ parameters:
steps:
# Always build the crossdac, that way we know in CI/PR if things break to build.
- - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if eq(parameters.osGroup, 'windows') }}:
- ${{ if notin(parameters.archType, 'x86') }}:
- script: set __TestIntermediateDir=int&&$(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) -ci -linuxdac $(officialBuildIdArg)
displayName: Build Cross OS Linux DAC for Windows
- - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if eq(parameters.osGroup, 'windows') }}:
- ${{ if notin(parameters.archType, 'x86') }}:
- script: set __TestIntermediateDir=int&&$(Build.SourcesDirectory)/src/coreclr/build-runtime$(scriptExt) $(buildConfig) $(archType) -ci -alpinedac $(officialBuildIdArg)
displayName: Build Cross OS Linux-musl DAC for Windows
diff --git a/eng/pipelines/coreclr/templates/crossgen-comparison-job.yml b/eng/pipelines/coreclr/templates/crossgen-comparison-job.yml
index 3faae1209c10..5275bb19dd9f 100644
--- a/eng/pipelines/coreclr/templates/crossgen-comparison-job.yml
+++ b/eng/pipelines/coreclr/templates/crossgen-comparison-job.yml
@@ -53,7 +53,7 @@ jobs:
value: $(osGroup).$(archType).$(buildConfigUpper)
- name: crossFlavor
value: $(osGroup).$(hostArchType)_$(archType).$(buildConfigUpper)
- - ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if ne(parameters.osGroup, 'windows') }}:
- name: artifactsDirectory
value: $(Build.SourcesDirectory)/artifacts
- name: binDirectory
@@ -62,7 +62,7 @@ jobs:
value: $(binDirectory)/coreclr
- name: workItemDirectory
value: $(artifactsDirectory)/tests/coreclr/$(targetFlavor)/Tests/Core_Root
- - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if eq(parameters.osGroup, 'windows') }}:
- name: artifactsDirectory
value: $(Build.SourcesDirectory)\artifacts
- name: binDirectory
@@ -110,12 +110,12 @@ jobs:
displayName: Populate Core_Root
# Create directories and ensure crossgen is executable
- - ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if ne(parameters.osGroup, 'windows') }}:
- script: |
chmod +x $(workItemDirectory)/crossgen
mkdir -p $(workItemDirectory)/log/$(crossFlavor)
displayName: Create directories and ensure crossgen is executable
- - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if eq(parameters.osGroup, 'windows') }}:
- script: |
mkdir $(workItemDirectory)\log\$(crossFlavor)
displayName: Create directories
@@ -127,14 +127,14 @@ jobs:
scriptSource: 'filePath'
scriptPath: $(Build.SourcesDirectory)/src/tests/Common/scripts/crossgen_comparison.py
pythonInterpreter: /usr/bin/python3
- ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
+ ${{ if ne(parameters.osGroup, 'windows') }}:
arguments:
crossgen_framework
--crossgen $(productDirectory)/$(targetFlavor)/$(hostArchType)/crossgen
--il_corelib $(productDirectory)/$(targetFlavor)/IL/System.Private.CoreLib.dll
--core_root $(workItemDirectory)
--result_dir $(workItemDirectory)/log/$(crossFlavor)
- ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ ${{ if eq(parameters.osGroup, 'windows') }}:
arguments:
crossgen_framework
--crossgen $(productDirectory)\$(targetFlavor)\$(hostArchType)\crossgen
@@ -143,12 +143,12 @@ jobs:
--result_dir $(workItemDirectory)\log\$(crossFlavor)
# Dump contents and payload information
- - ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if ne(parameters.osGroup, 'windows') }}:
- script: |
ls $(workItemDirectory)
du -sh $(workItemDirectory)
displayName: Dump contents and payload information
- - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if eq(parameters.osGroup, 'windows') }}:
- script: |
dir $(workItemDirectory)
displayName: Dump contents and payload information
@@ -167,7 +167,7 @@ jobs:
WorkItemTimeout: 3:00 # 3 hours
WorkItemDirectory: '$(workItemDirectory)'
CorrelationPayloadDirectory: '$(Build.SourcesDirectory)/src/tests/Common/scripts'
- ${{ if ne(parameters.osName, 'Windows_NT') }}:
+ ${{ if ne(parameters.osName, 'windows') }}:
WorkItemCommand:
chmod +x $HELIX_WORKITEM_PAYLOAD/crossgen;
mkdir -p $HELIX_WORKITEM_PAYLOAD/log/$(targetFlavor);
@@ -179,7 +179,7 @@ jobs:
python3 -u $HELIX_CORRELATION_PAYLOAD/crossgen_comparison.py compare
--base_dir $HELIX_WORKITEM_PAYLOAD/log/$(crossFlavor)
--diff_dir $HELIX_WORKITEM_PAYLOAD/log/$(targetFlavor)
- ${{ if eq(parameters.osName, 'Windows_NT') }}:
+ ${{ if eq(parameters.osName, 'windows') }}:
WorkItemCommand:
mkdir %HELIX_WORKITEM_PAYLOAD%\log\$(targetFlavor);
python3 -u %HELIX_CORRELATION_PAYLOAD%\crossgen_comparison.py crossgen_framework
diff --git a/eng/pipelines/coreclr/templates/crossgen2-comparison-build-job.yml b/eng/pipelines/coreclr/templates/crossgen2-comparison-build-job.yml
index 9bcd11057ed3..106ce3804753 100644
--- a/eng/pipelines/coreclr/templates/crossgen2-comparison-build-job.yml
+++ b/eng/pipelines/coreclr/templates/crossgen2-comparison-build-job.yml
@@ -63,7 +63,7 @@ jobs:
value: $(artifactsDirectory)$(dir)tests$(dir)coreclr$(dir)$(targetFlavor)$(dir)Tests$(dir)CrossCompileRoot
- name: crossgencompare_build_artifact
value: crossgen_comparison_build_$(osGroup)$(osSubgroup)_$(archType)
- - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if eq(parameters.osGroup, 'windows') }}:
- name: target_crossgen2_os
value: windows
- ${{ if eq(parameters.osGroup, 'Linux') }}:
@@ -118,7 +118,7 @@ jobs:
displayName: Populate Core_Root
# Create work item directory and populate with assemblies
- - ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if ne(parameters.osGroup, 'windows') }}:
- script: |
mkdir -p $(workItemDirectory)
mkdir -p $(workItemDirectory)/log
@@ -127,7 +127,7 @@ jobs:
cp $(productDirectory)/$(targetFlavor)/IL/System.Private.CoreLib.dll $(workItemDirectory)/dlls
displayName: Create directories
failOnStderr: true
- - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if eq(parameters.osGroup, 'windows') }}:
- script: |
md $(workItemDirectory)\log
md $(workItemDirectory)\dlls
@@ -144,7 +144,7 @@ jobs:
inputs:
scriptSource: 'filePath'
scriptPath: $(Build.SourcesDirectory)/src/tests/Common/scripts/crossgen2_comparison.py
- ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
+ ${{ if ne(parameters.osGroup, 'windows') }}:
pythonInterpreter: /usr/bin/python3
arguments:
crossgen_framework
@@ -154,7 +154,7 @@ jobs:
--result_dir $(workItemDirectory)/log
--target_os $(target_crossgen2_os)
--target_arch $(archType)
- ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ ${{ if eq(parameters.osGroup, 'windows') }}:
arguments:
crossgen_framework
--crossgen $(crossgen2location)
diff --git a/eng/pipelines/coreclr/templates/crossgen2-comparison-job.yml b/eng/pipelines/coreclr/templates/crossgen2-comparison-job.yml
index 7d825e93f541..ccb447e5ebfc 100644
--- a/eng/pipelines/coreclr/templates/crossgen2-comparison-job.yml
+++ b/eng/pipelines/coreclr/templates/crossgen2-comparison-job.yml
@@ -67,7 +67,9 @@ jobs:
value: ${{ parameters.targetarch }}
- name: crossgencompare_build_artifact
value: crossgen_comparison_build_${{ parameters.targetos }}_${{ parameters.targetarch }}
- - ${{ if eq(parameters.targetos, 'Windows_NT') }}:
+ - name: displayname_comparison_job
+ value: ${{ format('Test crossgen2-comparison {0}{1} {2} {3} to {4} {5}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig, parameters.targetarch, parameters.targetos) }}
+ - ${{ if eq(parameters.targetos, 'windows') }}:
- name: target_crossgen2_os
value: windows
- ${{ if eq(parameters.targetos, 'Linux') }}:
@@ -136,8 +138,9 @@ jobs:
WorkItemTimeout: 3:00 # 3 hours
WorkItemDirectory: '$(workItemDirectory)'
CorrelationPayloadDirectory: '$(Build.SourcesDirectory)/src/tests/Common/scripts'
- ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
+ ${{ if ne(parameters.osGroup, 'windows') }}:
WorkItemCommand:
+ echo $(displayname_comparison_job) ;
echo Targeting $(targetFlavor) ;
chmod +x $HELIX_WORKITEM_PAYLOAD/corerun;
mkdir -p $HELIX_WORKITEM_PAYLOAD/log;
@@ -152,8 +155,9 @@ jobs:
python3 -u $HELIX_CORRELATION_PAYLOAD/crossgen2_comparison.py compare
--base_dir $HELIX_WORKITEM_PAYLOAD/prebuiltWork/log
--diff_dir $HELIX_WORKITEM_PAYLOAD/log
- ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ ${{ if eq(parameters.osGroup, 'windows') }}:
WorkItemCommand:
+ echo $(displayname_comparison_job) &
echo Targeting $(targetFlavor) &
md %HELIX_WORKITEM_PAYLOAD%\log &
set CORE_ROOT=%HELIX_CORRELATION_PAYLOAD% &
diff --git a/eng/pipelines/coreclr/templates/format-job.yml b/eng/pipelines/coreclr/templates/format-job.yml
index 18aaf6ea34d7..5699ccb1d3d3 100644
--- a/eng/pipelines/coreclr/templates/format-job.yml
+++ b/eng/pipelines/coreclr/templates/format-job.yml
@@ -28,10 +28,10 @@ jobs:
name: ${{ format('format_{0}{1}_{2}', parameters.osGroup, parameters.osSubgroup, parameters.archType) }}
displayName: ${{ format('Formatting {0}{1} {2}', parameters.osGroup, parameters.osSubgroup, parameters.archType) }}
helixType: 'format'
- ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ ${{ if eq(parameters.osGroup, 'windows') }}:
pool:
vmImage: 'windows-2019'
- ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
+ ${{ if ne(parameters.osGroup, 'windows') }}:
pool: ${{ parameters.pool }}
variables: ${{ parameters.variables }}
condition: ${{ parameters.condition }}
@@ -49,7 +49,7 @@ jobs:
versionSpec: '3.x'
addToPath: true
architecture: 'x64'
- condition: ${{ eq(parameters.osGroup, 'Windows_NT') }}
+ condition: ${{ eq(parameters.osGroup, 'windows') }}
- task: PythonScript@0
displayName: Run tests/scripts/format.py
inputs:
diff --git a/eng/pipelines/coreclr/templates/helix-queues-setup.yml b/eng/pipelines/coreclr/templates/helix-queues-setup.yml
index 6bcef8752c2e..dfd5f9bd3ef0 100644
--- a/eng/pipelines/coreclr/templates/helix-queues-setup.yml
+++ b/eng/pipelines/coreclr/templates/helix-queues-setup.yml
@@ -99,8 +99,8 @@ jobs:
- OSX.1014.Amd64
- OSX.1015.Amd64
- # Windows_NT x64
- - ${{ if eq(parameters.platform, 'Windows_NT_x64') }}:
+ # windows x64
+ - ${{ if eq(parameters.platform, 'windows_x64') }}:
- ${{ if and(eq(variables['System.TeamProject'], 'public'), in(parameters.jobParameters.helixQueueGroup, 'pr', 'ci', 'libraries')) }}:
- Windows.10.Amd64.Open
- ${{ if and(eq(variables['System.TeamProject'], 'public'), notIn(parameters.jobParameters.helixQueueGroup, 'pr', 'ci', 'libraries')) }}:
@@ -115,8 +115,8 @@ jobs:
- Windows.10.Amd64.Core
- (Windows.Nano.1809.Amd64.Open)windows.10.amd64.serverrs5.open@mcr.microsoft.com/dotnet-buildtools/prereqs:nanoserver-1809-helix-amd64-08e8e40-20200107182504
- # Windows_NT x86
- - ${{ if eq(parameters.platform, 'Windows_NT_x86') }}:
+ # windows x86
+ - ${{ if eq(parameters.platform, 'windows_x86') }}:
- ${{ if and(eq(variables['System.TeamProject'], 'public'), in(parameters.jobParameters.helixQueueGroup, 'pr', 'ci', 'libraries')) }}:
- Windows.10.Amd64.Open
- ${{ if and(eq(variables['System.TeamProject'], 'public'), notIn(parameters.jobParameters.helixQueueGroup, 'pr', 'ci', 'libraries')) }}:
@@ -129,15 +129,15 @@ jobs:
- Windows.10.Amd64
- Windows.10.Amd64.Core
- # Windows_NT arm
- - ${{ if eq(parameters.platform, 'Windows_NT_arm') }}:
+ # windows arm
+ - ${{ if eq(parameters.platform, 'windows_arm') }}:
- ${{ if and(eq(variables['System.TeamProject'], 'public'), in(parameters.jobParameters.helixQueueGroup, 'pr', 'ci', 'libraries')) }}:
- Windows.10.Arm64v8.Open
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
- Windows.10.Arm64
- # Windows_NT arm64
- - ${{ if eq(parameters.platform, 'Windows_NT_arm64') }}:
+ # windows arm64
+ - ${{ if eq(parameters.platform, 'windows_arm64') }}:
- ${{ if and(eq(variables['System.TeamProject'], 'public'), in(parameters.jobParameters.helixQueueGroup, 'pr', 'ci', 'libraries')) }}:
- Windows.10.Arm64v8.Open
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
diff --git a/eng/pipelines/coreclr/templates/perf-job.yml b/eng/pipelines/coreclr/templates/perf-job.yml
index b6101f39dc19..74a3015ed15d 100644
--- a/eng/pipelines/coreclr/templates/perf-job.yml
+++ b/eng/pipelines/coreclr/templates/perf-job.yml
@@ -49,12 +49,12 @@ jobs:
- ${{ if eq(parameters.runtimeType, 'wasm') }}:
- ${{ format('build_{0}{1}_{2}_{3}_{4}', 'Browser', '', 'wasm', parameters.buildConfig, parameters.runtimeType) }}
- ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ ${{ if eq(parameters.osGroup, 'windows') }}:
${{ if eq(parameters.runtimeType, 'mono') }}:
extraSetupParameters: -Architecture ${{ parameters.archType }} -MonoDotnet $(Build.SourcesDirectory)\.dotnet-mono
${{ if eq(parameters.runtimeType, 'coreclr') }}:
extraSetupParameters: -CoreRootDirectory $(Build.SourcesDirectory)\artifacts\tests\coreclr\${{ parameters.osGroup }}.${{ parameters.archType }}.Release\Tests\Core_Root -Architecture ${{ parameters.archType }}
- ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
+ ${{ if ne(parameters.osGroup, 'windows') }}:
${{ if eq(parameters.runtimeType, 'mono') }}:
extraSetupParameters: --architecture ${{ parameters.archType }} --monodotnet $(Build.SourcesDirectory)/.dotnet-mono
${{ if eq(parameters.runtimeType, 'wasm') }}:
@@ -117,8 +117,8 @@ jobs:
# Copy the runtime directory into the testhost folder to include OOBs.
- script: "build.cmd -subset libs.pretest -configuration release -ci -arch $(archType) -testscope innerloop /p:RuntimeArtifactsPath=$(librariesDownloadDir)\\bin\\mono\\$(osGroup).$(archType).$(buildConfigUpper) /p:RuntimeFlavor=mono;xcopy $(Build.SourcesDirectory)\\artifacts\\bin\\runtime\\$(_Framework)-$(osGroup)-$(buildConfigUpper)-$(archType)\\* $(Build.SourcesDirectory)\\artifacts\\bin\\testhost\\$(_Framework)-$(osGroup)-$(buildConfigUpper)-$(archType)\\shared\\Microsoft.NETCore.App\\6.0.0 /E /I /Y;xcopy $(Build.SourcesDirectory)\\artifacts\\bin\\testhost\\$(_Framework)-$(osGroup)-$(buildConfigUpper)-$(archType)\\* $(Build.SourcesDirectory)\\.dotnet-mono /E /I /Y;copy $(Build.SourcesDirectory)\\artifacts\\bin\\coreclr\\$(osGroup).$(archType).$(buildConfigUpper)\\corerun.exe $(Build.SourcesDirectory)\\.dotnet-mono\\shared\\Microsoft.NETCore.App\\6.0.0\\corerun.exe"
displayName: "Create mono dotnet (Windows)"
- condition: and(and(succeeded(), eq(variables.runtimeFlavorName, 'Mono')), eq(variables.osGroup, 'Windows_NT'))
+ condition: and(and(succeeded(), eq(variables.runtimeFlavorName, 'Mono')), eq(variables.osGroup, 'windows'))
- script: "mkdir $(Build.SourcesDirectory)/.dotnet-mono;./build.sh -subset libs.pretest -configuration release -ci -arch $(archType) -testscope innerloop /p:RuntimeArtifactsPath=$(librariesDownloadDir)/bin/mono/$(osGroup).$(archType).$(buildConfigUpper) /p:RuntimeFlavor=mono;cp $(Build.SourcesDirectory)/artifacts/bin/runtime/$(_Framework)-$(osGroup)-$(buildConfigUpper)-$(archType)/* $(Build.SourcesDirectory)/artifacts/bin/testhost/$(_Framework)-$(osGroup)-$(buildConfigUpper)-$(archType)/shared/Microsoft.NETCore.App/6.0.0 -rf;cp $(Build.SourcesDirectory)/artifacts/bin/testhost/$(_Framework)-$(osGroup)-$(buildConfigUpper)-$(archType)/* $(Build.SourcesDirectory)/.dotnet-mono -r;cp $(Build.SourcesDirectory)/artifacts/bin/coreclr/$(osGroup).$(archType).$(buildConfigUpper)/corerun $(Build.SourcesDirectory)/.dotnet-mono/shared/Microsoft.NETCore.App/6.0.0/corerun"
displayName: "Create mono dotnet (Linux)"
- condition: and(and(succeeded(), eq(variables.runtimeFlavorName, 'Mono')), ne(variables.osGroup, 'Windows_NT'))
+ condition: and(and(succeeded(), eq(variables.runtimeFlavorName, 'Mono')), ne(variables.osGroup, 'windows'))
diff --git a/eng/pipelines/coreclr/templates/run-performance-job.yml b/eng/pipelines/coreclr/templates/run-performance-job.yml
index 7cbead38035f..3517eabedfe1 100644
--- a/eng/pipelines/coreclr/templates/run-performance-job.yml
+++ b/eng/pipelines/coreclr/templates/run-performance-job.yml
@@ -60,31 +60,31 @@ jobs:
- Interpreter: ''
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- - ${{ if eq( parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if eq( parameters.osGroup, 'windows') }}:
- HelixPreCommand: $(HelixPreCommandStemWindows);$(ExtraMSBuildLogsWindows)
- IsInternal: -Internal
- - ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if ne(parameters.osGroup, 'windows') }}:
- 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') }}:
+ - ${{ if eq( parameters.osGroup, 'windows') }}:
- HelixPreCommand: $(ExtraMSBuildLogsWindows)
- - ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if ne(parameters.osGroup, 'windows') }}:
- HelixPreCommand: $(ExtraMSBuildLogsLinux);npm install --prefix $HELIX_WORKITEM_PAYLOAD jsvu -g;$HELIX_WORKITEM_PAYLOAD/bin/jsvu --os=linux64 --engines=v8
- ${{ if and(eq(parameters.codeGenType, 'Interpreter'), eq(parameters.runtimeType, 'mono')) }}:
- - ${{ if eq( parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if eq( parameters.osGroup, 'windows') }}:
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- HelixPreCommand: '$(HelixPreCommandStemWindows);set MONO_ENV_OPTIONS="--interpreter";$(ExtraMSBuildLogsWindows)'
- Interpreter: ' -MonoInterpreter'
- ${{ if not(and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'))) }}:
- HelixPreCommand: 'set MONO_ENV_OPTIONS="--interpreter";$(ExtraMSBuildLogsWindows)'
- Interpreter: ' -MonoInterpreter'
- - ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if ne(parameters.osGroup, 'windows') }}:
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- HelixPreCommand: '$(HelixPreCommandStemLinux);export MONO_ENV_OPTIONS="--interpreter";$(ExtraMSBuildLogsLinux)'
- Interpreter: ' --monointerpreter'
diff --git a/eng/pipelines/coreclr/templates/run-scenarios-job.yml b/eng/pipelines/coreclr/templates/run-scenarios-job.yml
index 84451af18576..de22968e287b 100644
--- a/eng/pipelines/coreclr/templates/run-scenarios-job.yml
+++ b/eng/pipelines/coreclr/templates/run-scenarios-job.yml
@@ -55,17 +55,17 @@ jobs:
- SharedHelixPreCommands: ''
- AdditionalHelixPreCommands: ''
# run machine-setup and set PYTHONPATH for both public and private jobs
- - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if eq(parameters.osGroup, 'windows') }}:
- SharedHelixPreCommands: 'call %HELIX_WORKITEM_PAYLOAD%\machine-setup.cmd;set PYTHONPATH=%HELIX_WORKITEM_PAYLOAD%\scripts%3B%HELIX_WORKITEM_PAYLOAD%'
- - ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if ne(parameters.osGroup, 'windows') }}:
- SharedHelixPreCommands: 'chmod +x $HELIX_WORKITEM_PAYLOAD/machine-setup.sh;. $HELIX_WORKITEM_PAYLOAD/machine-setup.sh;export PYTHONPATH=$HELIX_WORKITEM_PAYLOAD/scripts:$HELIX_WORKITEM_PAYLOAD'
# extra private job settings
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if eq(parameters.osGroup, 'windows') }}:
- AdditionalHelixPreCommands: 'py -3 -m venv %HELIX_WORKITEM_PAYLOAD%\.venv;call %HELIX_WORKITEM_PAYLOAD%\.venv\Scripts\activate.bat;set PYTHONPATH=;py -3 -m pip install --user azure.storage.blob==12.0.0 --force-reinstall;py -3 -m pip install --user azure.storage.queue==12.0.0 --force-reinstall;set "PERFLAB_UPLOAD_TOKEN=$(PerfCommandUploadToken)"'
- IsInternal: -Internal
- - ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if ne(parameters.osGroup, 'windows') }}:
- AdditionalHelixPreCommands: 'sudo apt-get -y install python3-venv;python3 -m venv $HELIX_WORKITEM_PAYLOAD/.venv;source $HELIX_WORKITEM_PAYLOAD/.venv/Scripts/activate;export PYTHONPATH=;pip3 install --user azure.storage.blob==12.0.0 --force-reinstall;pip3 install --user azure.storage.queue==12.0.0 --force-reinstall;export PERFLAB_UPLOAD_TOKEN="$(PerfCommandUploadTokenLinux)"'
- IsInternal: --internal
- group: DotNet-HelixApi-Access
@@ -127,7 +127,7 @@ jobs:
PERFLAB_TARGET_FRAMEWORKS: netcoreapp3.1
condition: and(succeeded(), ne(variables['Agent.Os'], 'Windows_NT'))
# build SizeOnDisk
- - script: $(PayloadDirectory)\dotnet\dotnet.exe publish -c Release -o $(WorkItemDirectory)SOD -f netcoreapp3.1 -r win-$(Architecture) $(PerformanceDirectory)\src\tools\ScenarioMeasurement\SizeOnDisk\SizeOnDisk.csproj
+ - script: $(PayloadDirectory)\dotnet\dotnet.exe publish -c Release -o $(WorkItemDirectory)\SOD -f netcoreapp3.1 -r win-$(Architecture) $(PerformanceDirectory)\src\tools\ScenarioMeasurement\SizeOnDisk\SizeOnDisk.csproj
displayName: Build SizeOnDisk tool (Windows)
env:
PERFLAB_TARGET_FRAMEWORKS: netcoreapp3.1
diff --git a/eng/pipelines/coreclr/templates/run-superpmi-job.yml b/eng/pipelines/coreclr/templates/run-superpmi-job.yml
index 9f835a16b486..02c37e86294c 100644
--- a/eng/pipelines/coreclr/templates/run-superpmi-job.yml
+++ b/eng/pipelines/coreclr/templates/run-superpmi-job.yml
@@ -61,7 +61,7 @@ jobs:
- MchFileTag: '${{ parameters.osGroup }}.${{ parameters.archType }}.${{ parameters.buildConfig }}'
- CollectionName: ${{ parameters.collectionName }}
- - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if eq(parameters.osGroup, 'windows') }}:
- name: PythonScript
value: 'py -3'
- name: PipScript
@@ -70,7 +70,7 @@ jobs:
value: '$(Build.SourcesDirectory)\artifacts\tests\coreclr\${{ parameters.osGroup }}.${{ parameters.archType }}.${{ parameters.buildConfig }}\Tests\Core_Root'
- name: MchFilesLocation
value: '$(Build.SourcesDirectory)\artifacts\helixresults\'
- - ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if ne(parameters.osGroup, 'windows') }}:
- name: PythonScript
value: 'python3'
- name: PipScript
@@ -105,7 +105,7 @@ jobs:
- template: /eng/pipelines/coreclr/templates/superpmi-send-to-helix.yml
parameters:
HelixSource: '$(HelixSourcePrefix)/$(Build.Repository.Name)/$(Build.SourceBranch)' # sources must start with pr/, official/, prodcon/, or agent/
- HelixType: 'test/superpmi/$(Kind)/$(_Framework)/$(Architecture)'
+ HelixType: 'test/superpmi/$(CollectionName)/$(_Framework)/$(Architecture)'
HelixAccessToken: $(HelixApiAccessToken)
HelixTargetQueues: $(Queue)
HelixPreCommands: $(HelixPreCommand)
diff --git a/eng/pipelines/coreclr/templates/xplat-job.yml b/eng/pipelines/coreclr/templates/xplat-job.yml
index 7dde73e23b25..7a2a0cd7ca84 100644
--- a/eng/pipelines/coreclr/templates/xplat-job.yml
+++ b/eng/pipelines/coreclr/templates/xplat-job.yml
@@ -61,8 +61,8 @@ jobs:
agentOs: FreeBSD
${{ if eq(parameters.osGroup, 'OSX') }}:
agentOs: MacOS
- ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
- agentOs: Windows_NT
+ ${{ if eq(parameters.osGroup, 'windows') }}:
+ agentOs: windows
# Setting this results in the arcade job template including a step
# that gathers asset manifests and publishes them to pipeline
diff --git a/eng/pipelines/coreclr/templates/xplat-pipeline-job.yml b/eng/pipelines/coreclr/templates/xplat-pipeline-job.yml
index ad5088d8999b..00ae63eb25bd 100644
--- a/eng/pipelines/coreclr/templates/xplat-pipeline-job.yml
+++ b/eng/pipelines/coreclr/templates/xplat-pipeline-job.yml
@@ -127,10 +127,10 @@ jobs:
# 'innerloop' and 'clrinterpreter' jobs run the Priority 0 tests; everything else runs the Priority 1 tests.
- ${{ if and(ne(parameters.testGroup, 'innerloop'), ne(parameters.testGroup, 'clrinterpreter')) }}:
- - ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if ne(parameters.osGroup, 'windows') }}:
- name: priorityArg
value: 'priority1'
- - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if eq(parameters.osGroup, 'windows') }}:
- name: priorityArg
value: '-priority=1'
diff --git a/eng/pipelines/global-build.yml b/eng/pipelines/global-build.yml
index 9721eb4b9f47..0f3f3e64f646 100644
--- a/eng/pipelines/global-build.yml
+++ b/eng/pipelines/global-build.yml
@@ -42,7 +42,7 @@ jobs:
jobTemplate: /eng/pipelines/common/global-build-job.yml
buildConfig: release
platforms:
- - Windows_NT_x86
+ - windows_x86
- OSX_x64
jobParameters:
testGroup: innerloop
@@ -87,7 +87,7 @@ jobs:
jobTemplate: /eng/pipelines/common/global-build-job.yml
buildConfig: debug
platforms:
- - Windows_NT_x64
+ - windows_x64
jobParameters:
testGroup: innerloop
nameSuffix: Mono_Libraries
diff --git a/eng/pipelines/installer/jobs/base-job.yml b/eng/pipelines/installer/jobs/base-job.yml
index a769413019d6..5ace7f310d47 100644
--- a/eng/pipelines/installer/jobs/base-job.yml
+++ b/eng/pipelines/installer/jobs/base-job.yml
@@ -98,7 +98,7 @@ jobs:
### Platform-specific variable setup
###
- - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if eq(parameters.osGroup, 'windows') }}:
- name: CommonMSBuildArgs
value: >-
@@ -354,7 +354,7 @@ jobs:
parameters.archType,
parameters.liveLibrariesBuildConfig) }}
- ${{ if eq(parameters.useOfficialAllConfigurations, true) }}:
- - libraries_build_allconfigurations_Windows_NT_x64_Release
+ - libraries_build_allconfigurations_windows_x64_Release
- ${{ if eq(parameters.buildFullPlatformManifest, true) }}:
- ${{ each platform in parameters.platforms }}:
- ${{ parameters.runtimeFlavor }}_${{ parameters.runtimeVariant }}_product_build_${{ platform }}_${{ parameters.liveRuntimeBuildConfig }}
@@ -369,7 +369,7 @@ jobs:
parameters.liveRuntimeBuildConfig,
parameters.globalBuildSuffix) }}
- ${{ if eq(parameters.useOfficialAllConfigurations, true) }}:
- - build_Windows_NT_x64_${{ parameters.liveLibrariesBuildConfig }}_AllConfigurations
+ - build_windows_x64_${{ parameters.liveLibrariesBuildConfig }}_AllConfigurations
steps:
@@ -391,7 +391,7 @@ jobs:
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- task: NuGetAuthenticate@0
- - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if eq(parameters.osGroup, 'windows') }}:
# NuGet's http cache lasts 30 minutes. If we're on a static machine, this may interfere with
# auto-update PRs by preventing the CI build from fetching the new version. Delete the cache.
- powershell: Remove-Item -Recurse -ErrorAction Ignore "$env:LocalAppData\NuGet\v3-cache"
@@ -549,7 +549,7 @@ jobs:
continueOnError: true
condition: succeededOrFailed()
- - ${{ if and(eq(parameters.osGroup, 'Windows_NT'), eq(parameters.isOfficialBuild, true)) }}:
+ - ${{ if and(eq(parameters.osGroup, 'windows'), eq(parameters.isOfficialBuild, true)) }}:
- task: NuGetCommand@2
displayName: Push Visual Studio NuPkgs
inputs:
@@ -570,7 +570,7 @@ jobs:
skipTests: $(SkipTests)
isOfficialBuild: ${{ eq(parameters.isOfficialBuild, true) }}
- - ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if ne(parameters.osGroup, 'windows') }}:
- script: set -x && df -h
displayName: Check remaining storage space
condition: always()
diff --git a/eng/pipelines/libraries/base-job.yml b/eng/pipelines/libraries/base-job.yml
index 7a034f5ee4a2..38c08558e977 100644
--- a/eng/pipelines/libraries/base-job.yml
+++ b/eng/pipelines/libraries/base-job.yml
@@ -44,6 +44,7 @@ jobs:
- _msbuildCommonParameters: ''
# rename this variable, due to collision with build-native.proj
- _runtimeOSArg: ''
+ - _osArg: ''
- _finalFrameworkArg: ''
- _testModeArg: ''
- _buildScript: $(_buildScriptFileName)$(scriptExt)
@@ -68,7 +69,7 @@ jobs:
# force a value for OS when cross-building
- ${{ if in(parameters.osGroup, 'Browser', 'iOS', 'tvOS', 'Android', 'FreeBSD') }}:
- - _runtimeOSArg: -os ${{ parameters.osGroup }}
+ - _osArg: -os ${{ parameters.osGroup }}
- ${{ if ne(parameters.framework, '') }}:
- _finalFrameworkArg: -framework ${{ parameters.framework }}
@@ -102,14 +103,14 @@ jobs:
- _testRunNamePrefixSuffix: ${{ parameters.testDisplayName }}
# Windows variables
- - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if eq(parameters.osGroup, 'windows') }}:
- _runtimeOSArg: /p:RuntimeOS=win10
# Non-Windows variables
- - ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if ne(parameters.osGroup, 'windows') }}:
- _buildScript: ./$(_buildScriptFileName)$(scriptExt)
- - _buildArguments: $(_runtimeConfigurationArg) -configuration ${{ parameters.buildConfig }} -ci -arch ${{ parameters.archType }} $(_finalFrameworkArg) $(_testModeArg) $(_testScopeArg) $(_runtimeOSArg) $(_msbuildCommonParameters) $(_runtimeArtifactsPathArg) $(_crossBuildPropertyArg)
+ - _buildArguments: $(_runtimeConfigurationArg) -configuration ${{ parameters.buildConfig }} -ci -arch ${{ parameters.archType }} $(_finalFrameworkArg) $(_testModeArg) $(_testScopeArg) $(_osArg) $(_runtimeOSArg) $(_msbuildCommonParameters) $(_runtimeArtifactsPathArg) $(_crossBuildPropertyArg)
- ${{ parameters.variables }}
# we need to override this value to support build-coreclr-and-libraries-job.yml
diff --git a/eng/pipelines/libraries/helix-queues-setup.yml b/eng/pipelines/libraries/helix-queues-setup.yml
index c0e13a2ca68e..84f09c6ba8fc 100644
--- a/eng/pipelines/libraries/helix-queues-setup.yml
+++ b/eng/pipelines/libraries/helix-queues-setup.yml
@@ -101,8 +101,8 @@ jobs:
- ${{ if in(parameters.platform, 'iOS_x64', 'iOS_x86') }}:
- OSX.1015.Amd64.Open
- # Windows_NT x64
- - ${{ if eq(parameters.platform, 'Windows_NT_x64') }}:
+ # windows x64
+ - ${{ if eq(parameters.platform, 'windows_x64') }}:
# netcoreapp
- ${{ if notIn(parameters.jobParameters.framework, 'allConfigurations', 'net48') }}:
- ${{ if and(eq(parameters.jobParameters.testScope, 'outerloop'), eq(parameters.jobParameters.runtimeFlavor, 'mono')) }}:
@@ -130,8 +130,8 @@ jobs:
- ${{ if eq(parameters.jobParameters.framework, 'allConfigurations') }}:
- Windows.10.Amd64.Server19H1.Open
- # Windows_NT x86
- - ${{ if eq(parameters.platform, 'Windows_NT_x86') }}:
+ # windows x86
+ - ${{ if eq(parameters.platform, 'windows_x86') }}:
# netcoreapp
- ${{ if notIn(parameters.jobParameters.framework, 'allConfigurations', 'net48') }}:
- ${{ if and(eq(parameters.jobParameters.testScope, 'outerloop'), eq(parameters.jobParameters.runtimeFlavor, 'mono')) }}:
@@ -153,12 +153,12 @@ jobs:
- ${{ if eq(parameters.jobParameters.framework, 'net48') }}:
- Windows.10.Amd64.Client19H1.Open
- # Windows_NT arm
- - ${{ if eq(parameters.platform, 'Windows_NT_arm') }}:
+ # windows arm
+ - ${{ if eq(parameters.platform, 'windows_arm') }}:
- Windows.10.Arm64v8.Open
- # Windows_NT arm64
- - ${{ if eq(parameters.platform, 'Windows_NT_arm64') }}:
+ # windows arm64
+ - ${{ if eq(parameters.platform, 'windows_arm64') }}:
- Windows.10.Arm64.Open
# WebAssembly
diff --git a/eng/pipelines/libraries/outerloop-mono.yml b/eng/pipelines/libraries/outerloop-mono.yml
index a7eb7dfe3afd..3bf80f8b9db3 100644
--- a/eng/pipelines/libraries/outerloop-mono.yml
+++ b/eng/pipelines/libraries/outerloop-mono.yml
@@ -22,10 +22,10 @@ jobs:
buildConfig: Release
runtimeFlavor: mono
platforms:
- - Windows_NT_x86
+ - windows_x86
- Browser_wasm
- ${{ if eq(variables['isFullMatrix'], true) }}:
- - Windows_NT_x64
+ - windows_x64
- Linux_x64
- Linux_arm
- Linux_musl_x64
@@ -51,7 +51,7 @@ jobs:
buildConfig: Debug
runtimeFlavor: mono
platforms:
- - Windows_NT_x64
+ - windows_x64
- Linux_x64
- Linux_musl_x64
- OSX_x64
diff --git a/eng/pipelines/libraries/outerloop.yml b/eng/pipelines/libraries/outerloop.yml
index 1718d174bf85..62ed9459c9d3 100644
--- a/eng/pipelines/libraries/outerloop.yml
+++ b/eng/pipelines/libraries/outerloop.yml
@@ -23,8 +23,8 @@ jobs:
buildConfig: release
platforms:
- ${{ if eq(variables['includeWindowsOuterloop'], true) }}:
- - Windows_NT_x64
- - Windows_NT_x86
+ - windows_x64
+ - windows_x86
- ${{ if eq(variables['includeLinuxOuterloop'], true) }}:
- Linux_x64
- Linux_musl_x64
@@ -45,9 +45,9 @@ jobs:
buildConfig: Release
platforms:
- ${{ if eq(variables['includeWindowsOuterloop'], true) }}:
- - Windows_NT_x86
+ - windows_x86
- ${{ if eq(variables['isFullMatrix'], true) }}:
- - Windows_NT_x64
+ - windows_x64
- ${{ if eq(variables['includeLinuxOuterloop'], true) }}:
- ${{ if eq(variables['isFullMatrix'], true) }}:
- Linux_x64
@@ -72,7 +72,7 @@ jobs:
buildConfig: Debug
platforms:
- ${{ if eq(variables['includeWindowsOuterloop'], true) }}:
- - Windows_NT_x64
+ - windows_x64
- ${{ if eq(variables['includeLinuxOuterloop'], true) }}:
- Linux_x64
- Linux_musl_x64
@@ -92,9 +92,9 @@ jobs:
jobTemplate: /eng/pipelines/libraries/build-job.yml
buildConfig: Release
platforms:
- - Windows_NT_x86
+ - windows_x86
- ${{ if eq(variables['isFullMatrix'], true) }}:
- - Windows_NT_x64
+ - windows_x64
helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
jobParameters:
isOfficialBuild: ${{ variables['isOfficialBuild'] }}
diff --git a/eng/pipelines/libraries/prepare-publish-for-tests.yml b/eng/pipelines/libraries/prepare-publish-for-tests.yml
deleted file mode 100644
index 835cdfb0eb2c..000000000000
--- a/eng/pipelines/libraries/prepare-publish-for-tests.yml
+++ /dev/null
@@ -1,55 +0,0 @@
-# Steps used to prepare the Artifacts Staging Directory with required files for
-# executing libraries tests as well as shared framework assets
-parameters:
- isOfficialBuild: ''
-
-steps:
- - ${{ 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:
- sourceFolder: $(Build.SourcesDirectory)/artifacts/bin/runtime
- targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/bin/runtime
-
- - task: CopyFiles@2
- displayName: Prepare ref folder to publish
- inputs:
- sourceFolder: $(Build.SourcesDirectory)/artifacts/bin/ref
- targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/bin/ref
-
- - task: CopyFiles@2
- displayName: Prepare shared framework ref assemblies to publish
- inputs:
- sourceFolder: $(Build.SourcesDirectory)/artifacts/bin/ref/microsoft.netcore.app
- targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/bin/ref/microsoft.netcore.app
-
- - task: CopyFiles@2
- displayName: Prepare shared framework runtime folder to publish
- inputs:
- sourceFolder: $(Build.SourcesDirectory)/artifacts/bin/pkg
- targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/bin/pkg
-
- - task: CopyFiles@2
- displayName: Prepare native folder to publish
- inputs:
- sourceFolder: $(Build.SourcesDirectory)/artifacts/bin/native
- targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/bin/native
-
- - task: CopyFiles@2
- displayName: Prepare artifacts packages folder to publish
- inputs:
- sourceFolder: $(Build.SourcesDirectory)/artifacts/packages
- targetFolder: $(Build.ArtifactStagingDirectory)/artifacts/packages
- condition: and(succeeded(), eq(variables['_librariesBuildProducedPackages'], true))
diff --git a/eng/pipelines/libraries/run-test-job.yml b/eng/pipelines/libraries/run-test-job.yml
index e0f0e1e91196..11e4341c7af9 100644
--- a/eng/pipelines/libraries/run-test-job.yml
+++ b/eng/pipelines/libraries/run-test-job.yml
@@ -91,12 +91,12 @@ jobs:
# We need to find and download the GC stress dependencies (namely, coredistools). Put them
# in the 'sharedFramework' directory where we unpacked the CoreCLR build artifacts. The 'sharedFramework'
# directory is what is copied into the testhost.
- - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if eq(parameters.osGroup, 'windows') }}:
- script: $(Build.SourcesDirectory)\src\coreclr\tests\setup-stress-dependencies.cmd
/arch ${{ parameters.archType }}
/outputdir $(_runtimeDownloadPath)/sharedFramework
displayName: Download GC stress dependencies
- - ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if ne(parameters.osGroup, 'windows') }}:
- script: $(Build.SourcesDirectory)/src/coreclr/tests/setup-stress-dependencies.sh
--arch=${{ parameters.archType }}
--outputDir=$(_runtimeDownloadPath)/sharedFramework
diff --git a/eng/pipelines/mono/templates/build-job.yml b/eng/pipelines/mono/templates/build-job.yml
index a6f149d093af..6b601d83c050 100644
--- a/eng/pipelines/mono/templates/build-job.yml
+++ b/eng/pipelines/mono/templates/build-job.yml
@@ -94,7 +94,7 @@ jobs:
- ${{ if in(parameters.osGroup, 'OSX', 'iOS', 'tvOS') }}:
- script: $(Build.SourcesDirectory)/eng/install-native-dependencies.sh $(osGroup) ${{ parameters.archType }} azDO
displayName: Install native dependencies
- - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if eq(parameters.osGroup, 'windows') }}:
# Necessary to install python
- script: $(Build.SourcesDirectory)\eng\common\init-tools-native.cmd -InstallDirectory $(Build.SourcesDirectory)\native-tools -Force
displayName: Install native dependencies
@@ -106,10 +106,10 @@ jobs:
displayName: Disk Usage before Build
# Build
- - ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if ne(parameters.osGroup, 'windows') }}:
- script: ./build$(scriptExt) -subset mono -c $(buildConfig) -arch $(archType) $(osOverride) -ci $(officialBuildIdArg) $(llvmParameter)
displayName: Build product
- - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if eq(parameters.osGroup, 'windows') }}:
- script: build$(scriptExt) -subset mono -c $(buildConfig) -arch $(archType) $(osOverride) -ci $(officialBuildIdArg) $(llvmParameter)
displayName: Build product
@@ -131,16 +131,16 @@ jobs:
displayName: 'product build'
# Build packages
- - ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if ne(parameters.osGroup, 'windows') }}:
- script: ./build$(scriptExt) -subset mono -c $(buildConfig) -arch $(archType) $(osOverride) -ci $(officialBuildIdArg) $(llvmParameter) -pack $(OutputRidArg)
displayName: Build nupkg
- - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if eq(parameters.osGroup, 'windows') }}:
- script: build$(scriptExt) -subset mono -c $(buildConfig) -arch $(archType) $(osOverride) -ci $(officialBuildIdArg) $(llvmParameter) -pack $(OutputRidArg)
displayName: Build nupkg
# Publish official build
- ${{ if eq(parameters.publishToBlobFeed, 'true') }}:
- - ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if ne(parameters.osGroup, 'windows') }}:
- script: $(Build.SourcesDirectory)/eng/common/build.sh --ci --restore --publish --configuration $(_BuildConfig) /p:DotNetPublishUsingPipelines=true /p:DotNetPublishToBlobFeed=true /p:DotNetPublishBlobFeedUrl=$(dotnetfeedUrl) /p:DotNetPublishBlobFeedKey=$(dotnetfeedPAT) /p:Configuration=$(_BuildConfig) /p:TargetArchitecture=$(archType) /p:TargetOS=$(osGroup) /p:OSIdentifier=$(osGroup)$(osSubgroup) /bl:"$(Build.SourcesDirectory)/artifacts/log/publish-pkgs.binlog" --projects $(Build.SourcesDirectory)/eng/empty.csproj
displayName: Publish packages to blob feed
env:
@@ -149,7 +149,7 @@ jobs:
${{ if eq(parameters.osGroup, 'FreeBSD') }}:
# Arcade uses this SDK instead of trying to restore one.
DotNetCoreSdkDir: /usr/local/dotnet
- - ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
+ - ${{ if eq(parameters.osGroup, 'windows') }}:
# TODO: pass publish feed url and access token in from the internal pipeline
- powershell: eng\common\build.ps1 -ci -restore -publish -configuration $(_BuildConfig) /p:DotNetPublishUsingPipelines=true /p:DotNetPublishToBlobFeed=true /p:DotNetPublishBlobFeedUrl=$(dotnetfeedUrl) /p:DotNetPublishBlobFeedKey=$(dotnetfeedPAT) /p:Configuration=$(_BuildConfig) /p:TargetArchitecture=$(archType) /p:TargetOS=$(osGroup) /p:OSIdentifier=$(osGroup)$(osSubgroup) /bl:"$(Build.SourcesDirectory)\artifacts\log\publish-pkgs.binlog" -projects $(Build.SourcesDirectory)\eng\empty.csproj
displayName: Publish packages to blob feed
diff --git a/eng/pipelines/mono/templates/xplat-job.yml b/eng/pipelines/mono/templates/xplat-job.yml
index 01d12d859f9a..58366dde638b 100644
--- a/eng/pipelines/mono/templates/xplat-job.yml
+++ b/eng/pipelines/mono/templates/xplat-job.yml
@@ -59,8 +59,8 @@ jobs:
agentOs: FreeBSD
${{ if in(parameters.osGroup, 'OSX', 'iOS') }}:
agentOs: MacOS
- ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
- agentOs: Windows_NT
+ ${{ if eq(parameters.osGroup, 'windows') }}:
+ agentOs: windows
# Setting this results in the arcade job template including a step
# that gathers asset manifests and publishes them to pipeline
diff --git a/eng/pipelines/official/stages/publish.yml b/eng/pipelines/official/stages/publish.yml
index fc453209702a..5507dc2b1beb 100644
--- a/eng/pipelines/official/stages/publish.yml
+++ b/eng/pipelines/official/stages/publish.yml
@@ -1,5 +1,5 @@
parameters:
- PublishRidAgnosticPackagesFromPlatform: Windows_NT_x64
+ PublishRidAgnosticPackagesFromPlatform: windows_x64
publishingInfraVersion: 3
stages:
diff --git a/eng/pipelines/runtime-linker-tests.yml b/eng/pipelines/runtime-linker-tests.yml
index bb51f3c0c736..b78db5fca3fc 100644
--- a/eng/pipelines/runtime-linker-tests.yml
+++ b/eng/pipelines/runtime-linker-tests.yml
@@ -59,7 +59,7 @@ jobs:
jobTemplate: /eng/pipelines/common/global-build-job.yml
buildConfig: release
platforms:
- - Windows_NT_x64
+ - windows_x64
- OSX_x64
- Linux_x64
jobParameters:
diff --git a/eng/pipelines/runtime-official.yml b/eng/pipelines/runtime-official.yml
index 80141273f93c..62c07cbd896b 100644
--- a/eng/pipelines/runtime-official.yml
+++ b/eng/pipelines/runtime-official.yml
@@ -57,10 +57,10 @@ stages:
- Linux_musl_x64
- Linux_musl_arm
- Linux_musl_arm64
- - Windows_NT_x86
- - Windows_NT_x64
- - Windows_NT_arm
- - Windows_NT_arm64
+ - windows_x86
+ - windows_x64
+ - windows_arm
+ - windows_arm64
jobParameters:
isOfficialBuild: ${{ variables.isOfficialBuild }}
@@ -79,9 +79,9 @@ stages:
- Linux_musl_x64
- Linux_musl_arm
- Linux_musl_arm64
- - Windows_NT_x64
- - Windows_NT_arm
- - Windows_NT_arm64
+ - windows_x64
+ - windows_arm
+ - windows_arm64
#
# Build Mono runtime packs
#
@@ -109,10 +109,10 @@ stages:
- Browser_wasm
# - Linux_musl_arm
# - Linux_musl_arm64
- # - Windows_NT_x64 enable once coreclr.dll has a version header: https://github.com/dotnet/runtime/issues/37503
- # - Windows_NT_x86
- # - Windows_NT_arm
- # - Windows_NT_arm64
+ # - windows_x64 enable once coreclr.dll has a version header: https://github.com/dotnet/runtime/issues/37503
+ # - windows_x86
+ # - windows_arm
+ # - windows_arm64
jobParameters:
buildArgs: -s mono+libs+installer -c $(_BuildConfig)
nameSuffix: AllSubsets_Mono
@@ -133,10 +133,10 @@ stages:
- Linux_arm64
# - Linux_musl_x64
# - Linux_musl_arm64
- # - Windows_NT_x64
- # - Windows_NT_x86
- # - Windows_NT_arm
- # - Windows_NT_arm64
+ # - windows_x64
+ # - windows_x86
+ # - windows_arm
+ # - windows_arm64
jobTemplates:
# LLVMJIT
- jobTemplate: /eng/pipelines/common/global-build-job.yml
@@ -181,10 +181,10 @@ stages:
- Linux_musl_x64
- Linux_musl_arm
- Linux_musl_arm64
- - Windows_NT_x86
- - Windows_NT_x64
- - Windows_NT_arm
- - Windows_NT_arm64
+ - windows_x86
+ - windows_x64
+ - windows_arm
+ - windows_arm64
jobParameters:
isOfficialBuild: ${{ variables.isOfficialBuild }}
liveRuntimeBuildConfig: release
@@ -197,7 +197,7 @@ stages:
jobTemplate: /eng/pipelines/libraries/build-job.yml
buildConfig: Release
platforms:
- - Windows_NT_x64
+ - windows_x64
jobParameters:
framework: allConfigurations
isOfficialBuild: ${{ variables.isOfficialBuild }}
@@ -224,10 +224,10 @@ stages:
- Linux_musl_x64
- Linux_musl_arm
- Linux_musl_arm64
- - Windows_NT_x86
- - Windows_NT_x64
- - Windows_NT_arm
- - Windows_NT_arm64
+ - windows_x86
+ - windows_x64
+ - windows_arm
+ - windows_arm64
- ${{ if eq(variables.isOfficialBuild, true) }}:
- template: /eng/pipelines/official/stages/publish.yml
diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml
index e28c814872ba..dd43cb33606d 100644
--- a/eng/pipelines/runtime.yml
+++ b/eng/pipelines/runtime.yml
@@ -144,10 +144,10 @@ jobs:
- Linux_musl_arm64
- Linux_musl_x64
- OSX_arm64
- - Windows_NT_x86
- - Windows_NT_x64
- - Windows_NT_arm
- - Windows_NT_arm64
+ - windows_x86
+ - windows_x64
+ - windows_arm
+ - windows_arm64
jobParameters:
testGroup: innerloop
condition: >-
@@ -210,10 +210,10 @@ jobs:
- Linux_musl_x64
- Linux_musl_arm
- Linux_musl_arm64
- - Windows_NT_x64
- - Windows_NT_x86
- - Windows_NT_arm
- - Windows_NT_arm64
+ - windows_x64
+ - windows_x86
+ - windows_arm
+ - windows_arm64
- FreeBSD_x64
jobParameters:
testGroup: innerloop
@@ -229,7 +229,7 @@ jobs:
platforms:
- Linux_x64
# Issue: https://github.com/dotnet/runtime/issues/40034
- #- Windows_NT_x64
+ #- windows_x64
jobParameters:
condition: >-
and(
@@ -558,10 +558,10 @@ jobs:
- Linux_x64
- Linux_arm64
# - Linux_musl_arm64
- - Windows_NT_x64
- # - Windows_NT_x86
- # - Windows_NT_arm
- # - Windows_NT_arm64
+ - windows_x64
+ # - windows_x86
+ # - windows_arm
+ # - windows_arm64
jobParameters:
condition: >-
or(
@@ -581,10 +581,10 @@ jobs:
platforms:
- Linux_x64
# - Linux_musl_arm64
- - Windows_NT_x64
- # - Windows_NT_x86
- # - Windows_NT_arm
- # - Windows_NT_arm64
+ - windows_x64
+ # - windows_x86
+ # - windows_arm
+ # - windows_arm64
jobParameters:
condition: >-
or(
@@ -646,9 +646,9 @@ jobs:
- Linux_arm
- Linux_musl_arm
- Linux_musl_arm64
- - Windows_NT_arm
- - Windows_NT_arm64
- - Windows_NT_x86
+ - windows_arm
+ - windows_arm64
+ - windows_x86
jobParameters:
liveRuntimeBuildConfig: release
@@ -662,13 +662,13 @@ jobs:
- Linux_x64
- OSX_arm64
- OSX_x64
- - Windows_NT_x64
+ - windows_x64
- FreeBSD_x64
jobParameters:
testScope: innerloop
testBuildPlatforms:
- Linux_x64
- - Windows_NT_x64
+ - windows_x64
- OSX_x64
liveRuntimeBuildConfig: release
@@ -681,7 +681,7 @@ jobs:
buildConfig: ${{ variables.debugOnPrReleaseOnRolling }}
platforms:
- ${{ if eq(variables['isFullMatrix'], false) }}:
- - Windows_NT_x86
+ - windows_x86
jobParameters:
liveRuntimeBuildConfig: release
condition: >-
@@ -694,9 +694,9 @@ jobs:
jobTemplate: /eng/pipelines/libraries/build-job.yml
buildConfig: Release
platforms:
- - Windows_NT_x86
+ - windows_x86
- ${{ if eq(variables['isFullMatrix'], true) }}:
- - Windows_NT_x64
+ - windows_x64
helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
jobParameters:
isFullMatrix: ${{ variables.isFullMatrix }}
@@ -713,7 +713,7 @@ jobs:
jobTemplate: /eng/pipelines/libraries/build-job.yml
buildConfig: ${{ variables.debugOnPrReleaseOnRolling }}
platforms:
- - Windows_NT_x64
+ - windows_x64
helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
jobParameters:
isFullMatrix: ${{ variables.isFullMatrix }}
@@ -736,9 +736,9 @@ jobs:
- Linux_arm
- Linux_musl_arm
- Linux_musl_arm64
- - Windows_NT_x86
- - Windows_NT_arm
- - Windows_NT_arm64
+ - windows_x86
+ - windows_arm
+ - windows_arm64
jobParameters:
liveRuntimeBuildConfig: release
liveLibrariesBuildConfig: Release
@@ -752,7 +752,7 @@ jobs:
- Linux_x64
- Linux_arm64
- Linux_musl_x64
- - Windows_NT_x64
+ - windows_x64
- FreeBSD_x64
jobParameters:
liveRuntimeBuildConfig: release
@@ -806,8 +806,8 @@ jobs:
buildConfig: checked
platforms:
- Linux_arm
- - Windows_NT_x86
- - Windows_NT_arm64
+ - windows_x86
+ - windows_arm64
helixQueueGroup: pr
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
jobParameters:
@@ -827,7 +827,7 @@ jobs:
- OSX_x64
- Linux_x64
- Linux_arm64
- - Windows_NT_x64
+ - windows_x64
helixQueueGroup: pr
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
jobParameters:
@@ -916,7 +916,7 @@ jobs:
runtimeFlavor: mono
buildConfig: ${{ variables.debugOnPrReleaseOnRolling }}
platforms:
- - Windows_NT_x64
+ - windows_x64
- OSX_x64
- Linux_arm64
- Linux_x64
@@ -945,7 +945,7 @@ jobs:
runtimeFlavor: mono
buildConfig: ${{ variables.debugOnPrReleaseOnRolling }}
platforms:
- # - Windows_NT_x64
+ # - windows_x64
#- OSX_x64
- Linux_x64
helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
@@ -973,9 +973,9 @@ jobs:
jobTemplate: /eng/pipelines/libraries/run-test-job.yml
buildConfig: Release
platforms:
- - Windows_NT_x86
+ - windows_x86
- ${{ if eq(variables['isFullMatrix'], true) }}:
- - Windows_NT_arm64
+ - windows_arm64
helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
jobParameters:
isOfficialBuild: false
@@ -998,14 +998,14 @@ jobs:
jobTemplate: /eng/pipelines/libraries/run-test-job.yml
buildConfig: ${{ variables.debugOnPrReleaseOnRolling }}
platforms:
- - Windows_NT_x64
+ - windows_x64
- OSX_x64
- Linux_x64
- Linux_musl_x64
- ${{ if eq(variables['isFullMatrix'], true) }}:
- Linux_arm64
- ${{ if eq(variables['isFullMatrix'], false) }}:
- - Windows_NT_x86
+ - windows_x86
helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
jobParameters:
isOfficialBuild: false
@@ -1028,11 +1028,11 @@ jobs:
jobTemplate: /eng/pipelines/libraries/run-test-job.yml
buildConfig: Release
platforms:
- # - Windows_NT_arm return this when https://github.com/dotnet/runtime/issues/1097 is fixed.
+ # - windows_arm return this when https://github.com/dotnet/runtime/issues/1097 is fixed.
- Linux_arm
- Linux_musl_arm
- Linux_musl_arm64
- - Windows_NT_x86
+ - windows_x86
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
helixQueueGroup: libraries
jobParameters:
@@ -1050,7 +1050,7 @@ jobs:
jobTemplate: /eng/pipelines/libraries/run-test-job.yml
buildConfig: ${{ variables.debugOnPrReleaseOnRolling }}
platforms:
- - Windows_NT_x64
+ - windows_x64
- Linux_x64
- Linux_musl_x64
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
diff --git a/eng/pipelines/runtimelab.yml b/eng/pipelines/runtimelab.yml
index 57e2edf25af2..9757c7e5fa7b 100644
--- a/eng/pipelines/runtimelab.yml
+++ b/eng/pipelines/runtimelab.yml
@@ -67,7 +67,7 @@ stages:
buildConfig: Checked
platforms:
- Linux_x64
- - Windows_NT_x64
+ - windows_x64
jobParameters:
timeoutInMinutes: 100
testGroup: innerloop
@@ -85,7 +85,7 @@ stages:
buildConfig: Release
platforms:
- Linux_x64
- - Windows_NT_x64
+ - windows_x64
jobParameters:
isOfficialBuild: ${{ variables.isOfficialBuild }}
testGroup: innerloop
@@ -106,7 +106,7 @@ stages:
jobTemplate: /eng/pipelines/common/global-build-job.yml
buildConfig: Release
platforms:
- - Windows_NT_x64
+ - windows_x64
jobParameters:
isOfficialBuild: ${{ variables.isOfficialBuild }}
testGroup: innerloop
@@ -131,7 +131,7 @@ stages:
dependsOnGlobalBuild: true
platforms:
- Linux_x64
- - Windows_NT_x64
+ - windows_x64
- ${{ if ne(variables.isOfficialBuild, true) }}:
#
@@ -172,7 +172,7 @@ stages:
jobTemplate: /eng/pipelines/common/templates/runtimes/run-test-job.yml
buildConfig: Checked
platforms:
- - Windows_NT_x64
+ - windows_x64
helixQueueGroup: pr
helixQueuesTemplate: /eng/pipelines/coreclr/templates/helix-queues-setup.yml
jobParameters:
@@ -180,8 +180,8 @@ stages:
liveLibrariesBuildConfig: Release
dependsOn:
- coreclr_common_test_build_p0_AnyOS_AnyCPU_Checked
- - build_Windows_NT_x64_Checked_
- - build_Windows_NT_x64_Release_
+ - build_windows_x64_Checked_
+ - build_windows_x64_Release_
#
# Libraries Release Test Execution against a release coreclr runtime
@@ -208,7 +208,7 @@ stages:
jobTemplate: /eng/pipelines/libraries/run-test-job.yml
buildConfig: Release
platforms:
- - Windows_NT_x64
+ - windows_x64
helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
jobParameters:
isFullMatrix: false
@@ -218,7 +218,7 @@ stages:
dependsOnTestBuildConfiguration: Release
dependsOnTestArchitecture: x64
dependsOn:
- - build_Windows_NT_x64_Release_
+ - build_windows_x64_Release_
- ${{ if eq(variables.isOfficialBuild, true) }}:
- template: /eng/pipelines/official/stages/publish.yml
diff --git a/eng/resolveContract.targets b/eng/resolveContract.targets
index 6f4bb0e253ee..06084755937f 100644
--- a/eng/resolveContract.targets
+++ b/eng/resolveContract.targets
@@ -12,8 +12,8 @@
$(NetCoreAppCurrentRefPath)$(TargetFileName)
- $([MSBuild]::NormalizePath('$(BaseOutputPath)', 'ref', '$(TargetFramework)-$(Configuration)', '$(TargetFileName)'))
-
+ <_TargetFrameworkWithoutPlatform>$([System.Text.RegularExpressions.Regex]::Replace('$(TargetFramework)', '(-[^;]+)', ''))
+ $([MSBuild]::NormalizePath('$(BaseOutputPath)', 'ref', '$(_TargetFrameworkWithoutPlatform)-$(Configuration)', '$(TargetFileName)'))
false
@@ -59,4 +59,4 @@
ReferenceAssembly="" />
-
\ No newline at end of file
+
diff --git a/eng/targetframeworksuffix.props b/eng/targetframeworksuffix.props
index 96cd8db859c3..2525ce954a35 100644
--- a/eng/targetframeworksuffix.props
+++ b/eng/targetframeworksuffix.props
@@ -1,6 +1,18 @@
+
+
+ true
+ true
+
+
+
+ $(TargetFrameworkSuffix)
+ 0.0
+ $(TargetFrameworkSuffix),Version=$(TargetPlatformVersion)
+
+
-
+
true
win
diff --git a/eng/testing/debug-dump-template.md b/eng/testing/debug-dump-template.md
new file mode 100644
index 000000000000..bc8a29617b59
--- /dev/null
+++ b/eng/testing/debug-dump-template.md
@@ -0,0 +1,127 @@
+# Debugging a CI dump
+
+This document describes how to debug a CI/PR test dump by downloading assets from helix, using a dotnet tool called `runfo`.
+
+## What is runfo?
+
+Runfo is a dotnet global tool that helps get information about helix test runs and azure devops builds. For more information see [this](https://github.com/jaredpar/runfo/tree/master/runfo#runfo)
+
+### How do I install it?
+
+You just need to run:
+
+```script
+dotnet tool install --global runfo
+```
+
+If you already have it installed, make sure you have at least version `0.6.1` installed, which contains support to download helix payloads. If you don't have the latest version just run:
+
+```script
+dotnet tool update --global runfo
+```
+
+## Download helix payload containing symbols:
+
+You can just achieve this by running:
+
+```script
+runfo get-helix-payload -j %JOBID% -w %WORKITEM% -o
+```
+
+> NOTE: if the helix job is an internal job, you need to pass down a [helix authentication token](https://helix.dot.net/Account/Tokens) using the `--helix-token` argument.
+
+This will download the workitem contents under `\workitems\` and the correlation payload under: `\correlation-payload\`.
+
+> The correlation payload is usually the testhost or core root, which contain the runtime and dotnet host that we use to run tests.
+
+Once you have those assets, you will need to extract the testhost or core root. Then extract the workitem assets into the same location where coreclr binary is.
+
+## Windows dump on Windows
+
+### Debug with WinDbg
+
+1. Install [dotnet-sos global tool](https://docs.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-sos).
+2. Run `dotnet sos install` (This has an architecture flag to install diferent plugin versions for specific arch scenarios).
+3. Load the dump with a recent WinDbg version for it to load sos automatically (if not you can run `.update sos`). It is important that bitness of WinDbg matches the bitness of the dump.
+4. Then run the following commands:
+
+```script
+!setclrpath
+.sympath+
+```
+### Analyze with dotnet-dump
+
+1. Install [dotnet-dump global tool](https://docs.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-dump).
+2. Run: `dotnet-dump analyze `
+3. Then run the following commands:
+
+```script
+setclrpath (To verify an incorrect DAC hasn't been loaded).
+setclrpath
+setsymbolserver -directory
+```
+
+## Linux dumps on Windows
+
+In order to debug a Linux dump on Windows, you will have to first go to the PR/CI build
+that sent the test run and download the cross DAC.
+
+Download the [`CoreCLRCrossDacArtifacts`](https://dev.azure.com/dnceng/public/_apis/build/builds/%BUILDID%/artifacts?artifactName=CoreCLRCrossDacArtifacts&api-version=6.0&%24format=zip), then extract it, and copy the matching flavor of the DAC with your dump and extract it in the same location where coreclr binary is.
+
+### Debug with WinDbg
+
+1. Install [dotnet-sos global tool](https://docs.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-sos).
+2. Run `dotnet sos install` (This has an architecture flag to install diferent plugin versions for specific arch scenarios).
+3. Load the dump with a recent WinDbg version for it to load sos automatically (if not you can run `.update sos`). It is important that bitness of WinDbg matches the bitness of the dump.
+4. Then run the following commands:
+
+```script
+!setclrpath
+.sympath+
+```
+### Analyze with dotnet-dump
+
+1. Install [dotnet-dump global tool](https://docs.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-dump).
+2. Run: `dotnet-dump analyze `
+3. Then run the following commands:
+
+```script
+setclrpath (To verify an incorrect DAC hasn't been loaded).
+setclrpath
+setsymbolserver -directory
+```
+
+## Linux dumps on Linux
+
+### Debug with LLDB
+
+1. Install [dotnet-sos global tool](https://docs.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-sos).
+2. Run `dotnet sos install` (This has an architecture flag to install diferent plugin versions for specific arch scenarios).
+3. Load the dump by running `lldb -c `
+4. Run the following commands:
+
+```script
+setclrpath
+sethostruntime ''
+setsymbolserver -directory
+loadsymbols (if you want to resolve native symbols)
+```
+
+### Analyze with dotnet-dump
+
+1. Install [dotnet-dump global tool](https://docs.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-dump).
+2. Run: `dotnet-dump analyze `
+3. Then run the following commands:
+
+```script
+setclrpath (To verify an incorrect DAC hasn't been loaded).
+setclrpath
+setsymbolserver -directory
+```
+
+## MacOS dumps
+
+Instructions for debugging dumps on MacOS the same as [Linux](#linux-dumps-on-linux); however there are a couple of caveats.
+
+1. It's only supported to debug them in `dotnet-dump` if it's a runtime generated dump. This includes hang dumps and dumps generated by `createdump`, `dotnet-dump` and the runtime itself.
+2. If it's a system dump, then only `lldb` works.
diff --git a/eng/testing/gen-debug-dump-docs.py b/eng/testing/gen-debug-dump-docs.py
new file mode 100644
index 000000000000..bd6798b14a67
--- /dev/null
+++ b/eng/testing/gen-debug-dump-docs.py
@@ -0,0 +1,104 @@
+import os
+import sys
+import platform
+
+build_id = ''
+job_id = ''
+workitem = ''
+dump_dir = ''
+template_dir = os.getcwd()
+out_dir = template_dir
+idx = 0
+args_len = len(sys.argv)
+while idx < args_len:
+ arg = sys.argv[idx]
+ idx += 1
+ if arg == '-buildid':
+ if idx >= args_len or sys.argv[idx].startswith('-'):
+ print("Must specify a value for -buildid")
+ exit(1)
+
+ build_id = sys.argv[idx]
+ idx += 1
+
+ if arg == '-jobid':
+ if idx >= args_len or sys.argv[idx].startswith('-'):
+ print("Must specify a value for -jobid")
+ exit(1)
+
+ job_id = sys.argv[idx]
+ idx += 1
+
+ if arg == '-workitem':
+ if idx >= args_len or sys.argv[idx].startswith('-'):
+ print("Must specify a value for -workitem")
+ exit(1)
+
+ workitem = sys.argv[idx]
+ idx += 1
+
+ if arg == '-templatedir':
+ if idx >= args_len or sys.argv[idx].startswith('-'):
+ print("Must specify a value for -templatedir")
+ exit(1)
+
+ template_dir = sys.argv[idx]
+ idx += 1
+
+ if arg == '-outdir':
+ if idx >= args_len or sys.argv[idx].startswith('-'):
+ print("Must specify a value for -outdir")
+ exit(1)
+
+ out_dir = sys.argv[idx]
+ idx += 1
+
+ if arg == '-dumpdir':
+ if idx >= args_len or sys.argv[idx].startswith('-'):
+ print("Must specify a value for -dumpdir")
+ exit(1)
+
+ dump_dir = sys.argv[idx]
+ idx += 1
+
+found_dumps = False
+if dump_dir != '':
+ for filename in os.listdir(dump_dir):
+ if filename.endswith('.dmp') or 'core.' in filename:
+ found_dumps = True
+ break
+
+if not found_dumps:
+ print("Did not find dumps, skipping dump docs generation.")
+ exit(0)
+
+if build_id == '':
+ print("ERROR: unespecified required argument -buildid")
+ exit(1)
+
+if workitem == '':
+ print("ERROR: unespecified required argument -workitem")
+ exit(1)
+
+if job_id == '':
+ print("ERROR: unespecified required argument -jobid")
+ exit(1)
+
+replace_string = ''
+dir_separator = '/' if platform.system() != 'Windows' else '\\'
+source_file = template_dir + dir_separator + 'debug-dump-template.md'
+with open(source_file, 'r+') as f:
+ file_text = f.read()
+
+ print('read file: ' + source_file)
+
+ replace_string = file_text.replace('%JOBID%', job_id)
+ replace_string = replace_string.replace('%WORKITEM%', workitem)
+ replace_string = replace_string.replace('%BUILDID%', build_id)
+
+output_file = out_dir + dir_separator + 'how-to-debug-dump.md'
+with open(output_file, 'w+') as output:
+ print('writing output file: ' + output_file)
+ write_file = output.write(replace_string)
+
+print('done writing debug dump information')
diff --git a/eng/testing/tests.targets b/eng/testing/tests.targets
index 2fe669a10ba0..be296d75f02b 100644
--- a/eng/testing/tests.targets
+++ b/eng/testing/tests.targets
@@ -1,22 +1,22 @@
- RunnerTemplate.cmd
- RunnerTemplate.sh
+ RunnerTemplate.cmd
+ RunnerTemplate.sh
AppleRunnerTemplate.sh
AndroidRunnerTemplate.sh
WasmRunnerTemplate.sh
$(MSBuildThisFileDirectory)$(RunScriptInputName)
- RunTests.cmd
- RunTests.sh
+ RunTests.cmd
+ RunTests.sh
$([MSBuild]::NormalizePath('$(OutDir)', '$(RunScriptOutputName)'))
- %RUNTIME_PATH%\
- $RUNTIME_PATH/
+ %RUNTIME_PATH%\
+ $RUNTIME_PATH/
- $(RunScriptHostDir)dotnet.exe
- $(RunScriptHostDir)dotnet
+ $(RunScriptHostDir)dotnet.exe
+ $(RunScriptHostDir)dotnet
@@ -52,8 +52,8 @@
- $(RunScriptCommand) %RSP_FILE%
- $(RunScriptCommand) $RSP_FILE
+ $(RunScriptCommand) %RSP_FILE%
+ $(RunScriptCommand) $RSP_FILE
$([MSBuild]::Escape('$(RunScriptCommand)'))
@@ -86,7 +86,7 @@
TemplatePath="$(RunScriptInputPath)"
OutputPath="$(RunScriptOutputPath)" />
-
+
diff --git a/eng/versioning.targets b/eng/versioning.targets
index 61789747403d..3177b48b0ba6 100644
--- a/eng/versioning.targets
+++ b/eng/versioning.targets
@@ -155,4 +155,14 @@
WriteOnlyWhenDifferent="true" />
+
+
+
+
+
+
+
+
+
diff --git a/global.json b/global.json
index 712486f620a0..d969cf5dbfc3 100644
--- a/global.json
+++ b/global.json
@@ -12,10 +12,10 @@
"python3": "3.7.1"
},
"msbuild-sdks": {
- "Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk": "6.0.0-beta.20529.1",
- "Microsoft.DotNet.Arcade.Sdk": "6.0.0-beta.20529.1",
- "Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk": "6.0.0-beta.20529.1",
- "Microsoft.DotNet.Helix.Sdk": "6.0.0-beta.20529.1",
+ "Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk": "6.0.0-beta.20552.5",
+ "Microsoft.DotNet.Arcade.Sdk": "6.0.0-beta.20552.5",
+ "Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk": "6.0.0-beta.20552.5",
+ "Microsoft.DotNet.Helix.Sdk": "6.0.0-beta.20552.5",
"Microsoft.FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0",
"Microsoft.NET.Sdk.IL": "5.0.0-preview.8.20359.4",
"Microsoft.Build.NoTargets": "2.0.1",
diff --git a/src/coreclr/build-runtime.cmd b/src/coreclr/build-runtime.cmd
index 730e8d0f94fa..ca32712554db 100644
--- a/src/coreclr/build-runtime.cmd
+++ b/src/coreclr/build-runtime.cmd
@@ -26,7 +26,7 @@ if defined VS160COMNTOOLS (
:: Note that the msbuild project files (specifically, dir.proj) will use the following variables, if set:
:: __BuildArch -- default: x64
:: __BuildType -- default: Debug
-:: __TargetOS -- default: Windows_NT
+:: __TargetOS -- default: windows
:: __ProjectDir -- default: directory of the dir.props file
:: __RepoRootDir -- default: directory two levels above the dir.props file
:: __SourceDir -- default: %__ProjectDir%\src\
@@ -40,7 +40,7 @@ if defined VS160COMNTOOLS (
:: Set the default arguments for build
set __BuildArch=x64
set __BuildType=Debug
-set __TargetOS=Windows_NT
+set __TargetOS=windows
:: Set the various build properties here so that CMake and MSBuild can pick them up
set "__ProjectDir=%~dp0"
diff --git a/src/coreclr/crossgen-corelib.cmd b/src/coreclr/crossgen-corelib.cmd
index c153745ea91c..14a018ae88a4 100644
--- a/src/coreclr/crossgen-corelib.cmd
+++ b/src/coreclr/crossgen-corelib.cmd
@@ -13,7 +13,7 @@ set __ThisScriptDir=%~dp0
:: Note that the msbuild project files (specifically, dir.proj) will use the following variables, if set:
:: __BuildArch -- default: x64
:: __BuildType -- default: Debug
-:: __TargetOS -- default: Windows_NT
+:: __TargetOS -- default: windows
:: __ProjectDir -- default: directory of the dir.props file
:: __RepoRootDir -- default: directory two levels above the dir.props file
:: __RootBinDir -- default: %__RepoRootDir%\artifacts\
@@ -26,7 +26,7 @@ set __ThisScriptDir=%~dp0
:: Set the default arguments for build
set __BuildArch=x64
set __BuildType=Debug
-set __TargetOS=Windows_NT
+set __TargetOS=windows
set "__ProjectDir=%~dp0"
:: remove trailing slash
diff --git a/src/coreclr/dir.common.props b/src/coreclr/dir.common.props
index b4494a50ac17..ebaf9645134a 100644
--- a/src/coreclr/dir.common.props
+++ b/src/coreclr/dir.common.props
@@ -58,7 +58,7 @@
true
true
true
- true
+ true
true
diff --git a/src/coreclr/scripts/coreclr_arguments.py b/src/coreclr/scripts/coreclr_arguments.py
index 441c44790302..aab997306f19 100644
--- a/src/coreclr/scripts/coreclr_arguments.py
+++ b/src/coreclr/scripts/coreclr_arguments.py
@@ -65,7 +65,7 @@ def __init__(self,
self.valid_arches = ["x64", "x86", "arm", "arm64", "wasm"]
self.valid_build_types = ["Debug", "Checked", "Release"]
- self.valid_host_os = ["Windows_NT", "OSX", "Linux", "illumos", "Solaris", "Browser", "Android"]
+ self.valid_host_os = ["windows", "OSX", "Linux", "illumos", "Solaris", "Browser", "Android"]
self.__initialize__(args)
@@ -175,7 +175,7 @@ def verify(self,
def provide_default_host_os():
""" Return a string representing the current host operating system.
- Returns one of: Linux, OSX, Windows_NT, illumos, Solaris
+ Returns one of: Linux, OSX, windows, illumos, Solaris
"""
if sys.platform == "linux" or sys.platform == "linux2":
@@ -183,7 +183,7 @@ def provide_default_host_os():
elif sys.platform == "darwin":
return "OSX"
elif sys.platform == "win32":
- return "Windows_NT"
+ return "windows"
elif sys.platform.startswith("sunos"):
is_illumos = ('illumos' in subprocess.Popen(["uname", "-o"], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0].decode('utf-8'))
return 'illumos' if is_illumos else 'Solaris'
diff --git a/src/coreclr/scripts/jitrollingbuild.py b/src/coreclr/scripts/jitrollingbuild.py
index d947c7a5d2fd..83434438dac1 100644
--- a/src/coreclr/scripts/jitrollingbuild.py
+++ b/src/coreclr/scripts/jitrollingbuild.py
@@ -57,7 +57,7 @@
List clrjit in SuperPMI Azure storage.
"""
-host_os_help = "OS (Windows_NT, OSX, Linux). Default: current OS."
+host_os_help = "OS (windows, OSX, Linux). Default: current OS."
arch_help = "Architecture (x64, x86, arm, arm64). Default: current architecture."
@@ -166,7 +166,7 @@ def determine_jit_name(coreclr_args):
return "lib" + jit_base_name + ".dylib"
elif coreclr_args.host_os == "Linux":
return "lib" + jit_base_name + ".so"
- elif coreclr_args.host_os == "Windows_NT":
+ elif coreclr_args.host_os == "windows":
return jit_base_name + ".dll"
else:
raise RuntimeError("Unknown OS.")
@@ -299,7 +299,7 @@ def upload_blob(file, blob_name):
elif coreclr_args.host_os == "Linux":
allowed_extensions = [ ".so" ]
# Add .dbg for debug info
- elif coreclr_args.host_os == "Windows_NT":
+ elif coreclr_args.host_os == "windows":
allowed_extensions = [ ".dll" ]
else:
raise RuntimeError("Unknown OS.")
@@ -310,7 +310,7 @@ def upload_blob(file, blob_name):
files += cross_jit_paths
# On Windows, grab the PDB files from a sub-directory.
- # if coreclr_args.host_os == "Windows_NT":
+ # if coreclr_args.host_os == "windows":
# pdb_dir = os.path.join(coreclr_args.product_location, "PDB")
# if os.path.isdir(pdb_dir):
# pdb_paths = [os.path.join(pdb_dir, item) for item in os.listdir(pdb_dir) if re.match(r'.*clrjit.*', item)]
diff --git a/src/coreclr/scripts/superpmi-setup.py b/src/coreclr/scripts/superpmi-setup.py
index 48e72d5de774..10365804de8b 100644
--- a/src/coreclr/scripts/superpmi-setup.py
+++ b/src/coreclr/scripts/superpmi-setup.py
@@ -23,7 +23,7 @@
# 4. Lastly, it sets the pipeline variables.
# Below are the helix queues it sets depending on the OS/architecture:
-# | Arch | Windows_NT | Linux |
+# | Arch | windows | Linux |
# |-------|------------------|--------------------------------------------------------------------------------------------------------------------------------------|
# | x86 | Windows.10.Amd64 | - |
# | x64 | Windows.10.Amd64 | Ubuntu.1804.Amd64 |
@@ -89,7 +89,7 @@
"superpmi-shim-counter.dll",
"superpmi-shim-simple.dll",
]
-
+MAX_FILES_COUNT = 1500
def setup_args(args):
""" Setup the args for SuperPMI to use.
@@ -206,7 +206,7 @@ def first_fit(sorted_by_size, max_size):
if file_size < max_size:
for p_index in partitions:
total_in_curr_par = sum(n for _, n in partitions[p_index])
- if (total_in_curr_par + file_size) < max_size:
+ if (((total_in_curr_par + file_size) < max_size) and (len(partitions[p_index]) < MAX_FILES_COUNT)):
partitions[p_index].append(curr_file)
found_bucket = True
break
@@ -217,7 +217,7 @@ def first_fit(sorted_by_size, max_size):
total_size = 0
for p_index in partitions:
partition_size = sum(n for _, n in partitions[p_index])
- print("Partition {0}: {1} bytes.".format(p_index, partition_size))
+ print("Partition {0}: {1} files with {2} bytes.".format(p_index, len(partitions[p_index]), partition_size))
total_size += partition_size
print("Total {0} partitions with {1} bytes.".format(str(len(partitions)), total_size))
diff --git a/src/coreclr/scripts/superpmi.md b/src/coreclr/scripts/superpmi.md
index a72ee2f06a95..5e80f70f663b 100644
--- a/src/coreclr/scripts/superpmi.md
+++ b/src/coreclr/scripts/superpmi.md
@@ -58,7 +58,7 @@ If you want to use a specific MCH file collection, use the `-mch_files` argument
one or more MCH files on your machine:
```
-python f:\gh\runtime\src\coreclr\scripts\superpmi.py replay -mch_files f:\spmi\collections\tests.pmi.Windows_NT.x64.Release.mch
+python f:\gh\runtime\src\coreclr\scripts\superpmi.py replay -mch_files f:\spmi\collections\tests.pmi.windows.x64.Release.mch
```
The `-mch_files` argument takes a list of one or more directories or files to use. For
diff --git a/src/coreclr/scripts/superpmi.py b/src/coreclr/scripts/superpmi.py
index 85bdcb974c9a..2540559eff58 100755
--- a/src/coreclr/scripts/superpmi.py
+++ b/src/coreclr/scripts/superpmi.py
@@ -114,7 +114,7 @@
to get that version. Otherwise, use "unknown-jit-ee-version".
"""
-host_os_help = "OS (Windows_NT, OSX, Linux). Default: current OS."
+host_os_help = "OS (windows, OSX, Linux). Default: current OS."
arch_help = "Architecture (x64, x86, arm, arm64). Default: current architecture."
@@ -625,7 +625,7 @@ def __init__(self, coreclr_args):
elif coreclr_args.host_os == "Linux":
self.collection_shim_name = "libsuperpmi-shim-collector.so"
self.corerun_tool_name = "corerun"
- elif coreclr_args.host_os == "Windows_NT":
+ elif coreclr_args.host_os == "windows":
self.collection_shim_name = "superpmi-shim-collector.dll"
self.corerun_tool_name = "corerun.exe"
else:
@@ -975,7 +975,7 @@ def print_superpmi_failure_code(return_code, coreclr_args):
logging.warning("Compilation failures")
elif return_code == 2:
logging.warning("Asm diffs found")
- elif return_code == 139 and coreclr_args.host_os != "Windows_NT":
+ elif return_code == 139 and coreclr_args.host_os != "windows":
logging.error("Fatal error, SuperPMI has returned SIGSEGV (segmentation fault)")
else:
logging.error("Unknown error code %s", return_code)
@@ -1621,7 +1621,7 @@ def determine_coredis_tools(coreclr_args):
coredistools_dll_name = "libcoredistools.dylib"
elif coreclr_args.host_os.lower() == "linux":
coredistools_dll_name = "libcoredistools.so"
- elif coreclr_args.host_os.lower() == "windows_nt":
+ elif coreclr_args.host_os.lower() == "windows":
coredistools_dll_name = "coredistools.dll"
else:
raise RuntimeError("Unknown host os: {}".format(coreclr_args.host_os))
@@ -1703,7 +1703,7 @@ def determine_jit_name(coreclr_args):
return "lib" + jit_base_name + ".dylib"
elif coreclr_args.host_os == "Linux":
return "lib" + jit_base_name + ".so"
- elif coreclr_args.host_os == "Windows_NT":
+ elif coreclr_args.host_os == "windows":
return jit_base_name + ".dll"
else:
raise RuntimeError("Unknown OS.")
@@ -1762,7 +1762,7 @@ def determine_superpmi_tool_name(coreclr_args):
if coreclr_args.host_os == "OSX" or coreclr_args.host_os == "Linux":
return "superpmi"
- elif coreclr_args.host_os == "Windows_NT":
+ elif coreclr_args.host_os == "windows":
return "superpmi.exe"
else:
raise RuntimeError("Unknown OS.")
@@ -1794,7 +1794,7 @@ def determine_mcs_tool_name(coreclr_args):
if coreclr_args.host_os == "OSX" or coreclr_args.host_os == "Linux":
return "mcs"
- elif coreclr_args.host_os == "Windows_NT":
+ elif coreclr_args.host_os == "windows":
return "mcs.exe"
else:
raise RuntimeError("Unsupported OS.")
@@ -1883,7 +1883,7 @@ def print_platform_specific_environment_vars(loglevel, coreclr_args, var, value)
value (str): value being set.
"""
- if coreclr_args.host_os == "Windows_NT":
+ if coreclr_args.host_os == "windows":
logging.log(loglevel, "set %s=%s", var, value)
else:
logging.log(loglevel, "export %s=%s", var, value)
@@ -1975,7 +1975,7 @@ def process_mch_files_arg(coreclr_args):
for item in coreclr_args.mch_files:
# On Windows only, see if any of the mch_files are UNC paths (i.e., "\\server\share\...").
# If so, download and cache all the files found there to our usual local cache location, to avoid future network access.
- if coreclr_args.host_os == "Windows_NT" and item.startswith("\\\\"):
+ if coreclr_args.host_os == "windows" and item.startswith("\\\\"):
# Special case: if the user specifies a .mch file, we'll also look for and cache a .mch.mct file next to it, if one exists.
# This happens naturally if a directory is passed and we search for all .mch and .mct files in that directory.
mch_file = os.path.abspath(item)
@@ -2175,19 +2175,20 @@ def upload_blob(file, blob_name):
files = []
for item in coreclr_args.mch_files:
- files += get_files_from_path(item, match_func=lambda path: any(path.endswith(extension) for extension in [".mch", ".mct"]))
+ files += get_files_from_path(item, match_func=lambda path: any(path.endswith(extension) for extension in [".mch"]))
+ files_to_upload = []
# Special case: walk the files list and for every ".mch" file, check to see that either the associated ".mct" file is already
# in the list, or add it if the ".mct" file exists.
for file in files.copy():
- if file.endswith(".mch"):
+ if file.endswith(".mch") and os.stat(file).st_size > 0:
+ files_to_upload.append(file)
mct_file = file + ".mct"
- if mct_file not in files:
- if os.path.isfile(mct_file):
- files.append(mct_file)
+ if os.path.isfile(mct_file) and os.stat(mct_file).st_size > 0:
+ files_to_upload.append(mct_file)
logging.info("Uploading:")
- for item in files:
+ for item in files_to_upload:
logging.info(" %s", item)
try:
@@ -2205,7 +2206,7 @@ def upload_blob(file, blob_name):
total_bytes_uploaded = 0
with TempDir() as temp_location:
- for file in files:
+ for file in files_to_upload:
# Zip compress the file we will upload
zip_name = os.path.basename(file) + ".zip"
zip_path = os.path.join(temp_location, zip_name)
@@ -2293,8 +2294,8 @@ def list_collections_local_command(coreclr_args):
default_mch_dir = os.path.join(default_mch_root_dir, "{}.{}.{}".format(coreclr_args.jit_ee_version, coreclr_args.host_os, coreclr_args.arch))
# Determine if a file should be allowed. The filenames look like:
- # c:\gh\runtime\artifacts\spmi\mch\a5eec3a4-4176-43a7-8c2b-a05b551d4f49.Windows_NT.x64\corelib.Windows_NT.x64.Checked.mch
- # c:\gh\runtime\artifacts\spmi\mch\a5eec3a4-4176-43a7-8c2b-a05b551d4f49.Windows_NT.x64\corelib.Windows_NT.x64.Checked.mch.mct
+ # c:\gh\runtime\artifacts\spmi\mch\a5eec3a4-4176-43a7-8c2b-a05b551d4f49.windows.x64\corelib.windows.x64.Checked.mch
+ # c:\gh\runtime\artifacts\spmi\mch\a5eec3a4-4176-43a7-8c2b-a05b551d4f49.windows.x64\corelib.windows.x64.Checked.mch.mct
# Only include MCH files, not clrjit.dll or MCT (TOC) files.
def filter_superpmi_collections(path: str):
return path.lower().endswith(".mch")
@@ -2788,18 +2789,18 @@ def verify_replay_common_args():
determined_arch = None
determined_build_type = None
if jit_in_product_location:
- # Get os/arch/flavor directory, e.g. split "F:\gh\runtime\artifacts\bin\coreclr\Windows_NT.x64.Checked" with "F:\gh\runtime\artifacts\bin\coreclr"
+ # Get os/arch/flavor directory, e.g. split "F:\gh\runtime\artifacts\bin\coreclr\windows.x64.Checked" with "F:\gh\runtime\artifacts\bin\coreclr"
# yielding
# [0]: ""
- # [1]: "\Windows_NT.x64.Checked"
+ # [1]: "\windows.x64.Checked"
standard_location_split = os.path.dirname(coreclr_args.jit_path).split(os.path.dirname(coreclr_args.product_location))
assert coreclr_args.host_os in standard_location_split[1]
# Get arch/flavor. Remove leading slash.
specialized_path = standard_location_split[1].split(os.path.sep)[1]
- # Split components: "Windows_NT.x64.Checked" into:
- # [0]: "Windows_NT"
+ # Split components: "windows.x64.Checked" into:
+ # [0]: "windows"
# [1]: "x64"
# [2]: "Checked"
determined_split = specialized_path.split(".")
@@ -2894,18 +2895,18 @@ def verify_replay_common_args():
determined_arch = None
determined_build_type = None
if jit_in_product_location:
- # Get os/arch/flavor directory, e.g. split "F:\gh\runtime\artifacts\bin\coreclr\Windows_NT.x64.Checked" with "F:\gh\runtime\artifacts\bin\coreclr"
+ # Get os/arch/flavor directory, e.g. split "F:\gh\runtime\artifacts\bin\coreclr\windows.x64.Checked" with "F:\gh\runtime\artifacts\bin\coreclr"
# yielding
# [0]: ""
- # [1]: "\Windows_NT.x64.Checked"
+ # [1]: "\windows.x64.Checked"
standard_location_split = os.path.dirname(coreclr_args.base_jit_path).split(os.path.dirname(coreclr_args.product_location))
assert coreclr_args.host_os in standard_location_split[1]
# Get arch/flavor. Remove leading slash.
specialized_path = standard_location_split[1].split(os.path.sep)[1]
- # Split components: "Windows_NT.x64.Checked" into:
- # [0]: "Windows_NT"
+ # Split components: "windows.x64.Checked" into:
+ # [0]: "windows"
# [1]: "x64"
# [2]: "Checked"
determined_split = specialized_path.split(".")
diff --git a/src/coreclr/src/.nuget/Directory.Build.props b/src/coreclr/src/.nuget/Directory.Build.props
index e44f8de0a11c..3473cbf83b52 100644
--- a/src/coreclr/src/.nuget/Directory.Build.props
+++ b/src/coreclr/src/.nuget/Directory.Build.props
@@ -33,7 +33,7 @@
$(OSRid)
- Windows_NT;OSX;Android;Linux;FreeBSD;NetBSD;illumos;Solaris
+ windows;OSX;Android;Linux;FreeBSD;NetBSD;illumos;Solaris
;$(SupportedPackageOSGroups);
diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Attribute.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Attribute.CoreCLR.cs
index 9a6c6d44c509..7a44e3cce019 100644
--- a/src/coreclr/src/System.Private.CoreLib/src/System/Attribute.CoreCLR.cs
+++ b/src/coreclr/src/System.Private.CoreLib/src/System/Attribute.CoreCLR.cs
@@ -287,9 +287,9 @@ private static Attribute[] InternalParamGetCustomAttributes(ParameterInfo param,
count = 0;
for (int i = 0; i < objAttr.Length; i++)
{
- if (objAttr[i] != null)
+ if (objAttr[i] is object attr)
{
- attributes[count] = (Attribute)objAttr[i]!; // TODO-NULLABLE: Indexer nullability tracked (https://github.com/dotnet/roslyn/issues/34644)
+ attributes[count] = (Attribute)attr;
count++;
}
}
diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Collections/Generic/EqualityComparer.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Collections/Generic/EqualityComparer.CoreCLR.cs
index 252627d27633..ef5ec5948211 100644
--- a/src/coreclr/src/System.Private.CoreLib/src/System/Collections/Generic/EqualityComparer.CoreCLR.cs
+++ b/src/coreclr/src/System.Private.CoreLib/src/System/Collections/Generic/EqualityComparer.CoreCLR.cs
@@ -116,7 +116,7 @@ internal override int IndexOf(T[] array, T value, int startIndex, int count)
{
for (int i = startIndex; i < endIndex; i++)
{
- if (array[i] != null && array[i]!.Equals(value)) return i; // TODO-NULLABLE: Indexer nullability tracked (https://github.com/dotnet/roslyn/issues/34644)
+ if (array[i] != null && array[i]!.Equals(value)) return i;
}
}
return -1;
@@ -136,7 +136,7 @@ internal override int LastIndexOf(T[] array, T value, int startIndex, int count)
{
for (int i = startIndex; i >= endIndex; i--)
{
- if (array[i] != null && array[i]!.Equals(value)) return i; // TODO-NULLABLE: Indexer nullability tracked (https://github.com/dotnet/roslyn/issues/34644)
+ if (array[i] != null && array[i]!.Equals(value)) return i;
}
}
return -1;
diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/MulticastDelegate.cs b/src/coreclr/src/System.Private.CoreLib/src/System/MulticastDelegate.cs
index bba499737c27..34d08a8b056b 100644
--- a/src/coreclr/src/System.Private.CoreLib/src/System/MulticastDelegate.cs
+++ b/src/coreclr/src/System.Private.CoreLib/src/System/MulticastDelegate.cs
@@ -160,10 +160,10 @@ private static bool TrySetSlot(object?[] a, int index, object o)
// The slot may be already set because we have added and removed the same method before.
// Optimize this case, because it's cheaper than copying the array.
- if (a[index] != null)
+ if (a[index] is object ai)
{
MulticastDelegate d = (MulticastDelegate)o;
- MulticastDelegate dd = (MulticastDelegate)a[index]!; // TODO-NULLABLE: Indexer nullability tracked (https://github.com/dotnet/roslyn/issues/34644)
+ MulticastDelegate dd = (MulticastDelegate)ai;
if (dd._methodPtr == d._methodPtr &&
dd._target == d._target &&
diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/ILGenerator.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/ILGenerator.cs
index acdf1663b80c..23a973f15ae3 100644
--- a/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/ILGenerator.cs
+++ b/src/coreclr/src/System.Private.CoreLib/src/System/Reflection/Emit/ILGenerator.cs
@@ -1622,14 +1622,14 @@ internal void AddLocalSymInfoToCurrentScope(
{
int i = GetCurrentActiveScopeIndex();
m_localSymInfos[i] ??= new LocalSymInfo();
- m_localSymInfos[i]!.AddLocalSymInfo(strName, signature, slot, startOffset, endOffset); // TODO-NULLABLE: Indexer nullability tracked (https://github.com/dotnet/roslyn/issues/34644)
+ m_localSymInfos[i]!.AddLocalSymInfo(strName, signature, slot, startOffset, endOffset);
}
internal void AddUsingNamespaceToCurrentScope(string strNamespace)
{
int i = GetCurrentActiveScopeIndex();
m_localSymInfos[i] ??= new LocalSymInfo();
- m_localSymInfos[i]!.AddUsingNamespace(strNamespace); // TODO-NULLABLE: Indexer nullability tracked (https://github.com/dotnet/roslyn/issues/34644)
+ m_localSymInfos[i]!.AddUsingNamespace(strNamespace);
}
internal void AddScopeInfo(ScopeAction sa, int iOffset)
@@ -1693,9 +1693,9 @@ internal void EmitScopeTree(ISymbolWriter symWriter)
{
symWriter.CloseScope(m_iOffsets[i]);
}
- if (m_localSymInfos[i] != null)
+ if (m_localSymInfos[i] is LocalSymInfo lsi)
{
- m_localSymInfos[i]!.EmitLocalSymInfo(symWriter); // TODO-NULLABLE: Indexer nullability tracked (https://github.com/dotnet/roslyn/issues/34644)
+ lsi.EmitLocalSymInfo(symWriter);
}
}
}
diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs
index 744efa515e3c..f76df3efa491 100644
--- a/src/coreclr/src/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs
+++ b/src/coreclr/src/System.Private.CoreLib/src/System/RuntimeType.CoreCLR.cs
@@ -3900,9 +3900,9 @@ private void CreateInstanceCheckThis()
Type[] argsType = new Type[args.Length];
for (int i = 0; i < args.Length; i++)
{
- if (args[i] != null)
+ if (args[i] is object arg)
{
- argsType[i] = args[i]!.GetType(); // TODO-NULLABLE: Indexer nullability tracked (https://github.com/dotnet/roslyn/issues/34644)
+ argsType[i] = arg.GetType();
}
}
diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/StubHelpers.cs b/src/coreclr/src/System.Private.CoreLib/src/System/StubHelpers.cs
index 1c4a5649c251..a12b3f211d74 100644
--- a/src/coreclr/src/System.Private.CoreLib/src/System/StubHelpers.cs
+++ b/src/coreclr/src/System.Private.CoreLib/src/System/StubHelpers.cs
@@ -584,7 +584,7 @@ internal static class InterfaceMarshaler
internal static extern IntPtr ConvertToNative(object objSrc, IntPtr itfMT, IntPtr classMT, int flags);
[MethodImpl(MethodImplOptions.InternalCall)]
- internal static extern object ConvertToManaged(IntPtr ppUnk, IntPtr itfMT, IntPtr classMT, int flags);
+ internal static extern object ConvertToManaged(ref IntPtr ppUnk, IntPtr itfMT, IntPtr classMT, int flags);
[DllImport(RuntimeHelpers.QCall)]
internal static extern void ClearNative(IntPtr pUnk);
diff --git a/src/coreclr/src/ToolBox/superpmi/readme.md b/src/coreclr/src/ToolBox/superpmi/readme.md
index 7b6be5693b93..e5e64514dd20 100644
--- a/src/coreclr/src/ToolBox/superpmi/readme.md
+++ b/src/coreclr/src/ToolBox/superpmi/readme.md
@@ -78,7 +78,7 @@ To manually do a collection (not using the `superpmi.py` script or
First, build the `dotnet/runtime` repo, which builds the `superpmi`, `mcs`,
and `superpmi-shim-collector` programs, along with the rest of coreclr,
and places them in the same native code directory as the JIT and the rest
-of coreclr, e.g., `f:\gh\runtime\artifacts\bin\coreclr\Windows_NT.x64.Checked\superpmi.exe`
+of coreclr, e.g., `f:\gh\runtime\artifacts\bin\coreclr\windows.x64.Checked\superpmi.exe`
for a `dotnet/runtime` repo rooted at the `f:\gh\runtime` directory, and
built on Windows for the x64 Checked architecture / build flavor combination.
@@ -131,7 +131,7 @@ for example, on Windows:
```
mkdir f:\spmi\temp
set SuperPMIShimLogPath=f:\spmi\temp
-set SuperPMIShimPath=f:\gh\runtime\artifacts\tests\coreclr\Windows_NT.x64.Checked\Tests\Core_Root\clrjit.dll
+set SuperPMIShimPath=f:\gh\runtime\artifacts\tests\coreclr\windows.x64.Checked\Tests\Core_Root\clrjit.dll
set COMPlus_AltJit=*
set COMPlus_AltJitNgen=*
set COMPlus_AltJitName=superpmi-shim-collector.dll
@@ -181,7 +181,7 @@ the initial collection).
So, for the example above, you might use:
```
-f:\gh\runtime\artifacts\bin\coreclr\Windows_NT.x64.Checked\mcs.exe -merge f:\spmi\base.mch f:\spmi\temp\*.mc -recursive -dedup -thin
+f:\gh\runtime\artifacts\bin\coreclr\windows.x64.Checked\mcs.exe -merge f:\spmi\base.mch f:\spmi\temp\*.mc -recursive -dedup -thin
```
Note that `mcs -merge` without `-dedup -thin` is literally just a file concatenation
@@ -210,7 +210,7 @@ the ways in which we normally use SuperPMI.
For the continuing example, you might use:
```
-f:\gh\runtime\artifacts\bin\coreclr\Windows_NT.x64.Checked\mcs.exe -removeDup -thin f:\spmi\base.mch f:\spmi\unique.mch
+f:\gh\runtime\artifacts\bin\coreclr\windows.x64.Checked\mcs.exe -removeDup -thin f:\spmi\base.mch f:\spmi\unique.mch
```
After this step, you can remove the base.mch file (unless you want to debug
@@ -234,8 +234,8 @@ mcs.exe -strip basefail.mcl unique.mch final.mch
Or, continuing the example above, giving full paths, we have:
```
-f:\gh\runtime\artifacts\bin\coreclr\Windows_NT.x64.Checked\superpmi.exe -p -f f:\spmi\basefail.mcl f:\spmi\unique.mch f:\gh\runtime\artifacts\bin\coreclr\Windows_NT.x64.Checked\clrjit.dll
-f:\gh\runtime\artifacts\bin\coreclr\Windows_NT.x64.Checked\mcs.exe -strip f:\spmi\basefail.mcl f:\spmi\unique.mch f:\spmi\final.mch
+f:\gh\runtime\artifacts\bin\coreclr\windows.x64.Checked\superpmi.exe -p -f f:\spmi\basefail.mcl f:\spmi\unique.mch f:\gh\runtime\artifacts\bin\coreclr\windows.x64.Checked\clrjit.dll
+f:\gh\runtime\artifacts\bin\coreclr\windows.x64.Checked\mcs.exe -strip f:\spmi\basefail.mcl f:\spmi\unique.mch f:\spmi\final.mch
```
@@ -250,7 +250,7 @@ mcs -toc final.mch
or, using the full paths from above:
```
-f:\gh\runtime\artifacts\bin\coreclr\Windows_NT.x64.Checked\mcs.exe -toc f:\spmi\final.mch
+f:\gh\runtime\artifacts\bin\coreclr\windows.x64.Checked\mcs.exe -toc f:\spmi\final.mch
```
@@ -265,7 +265,7 @@ superpmi -p -f finalfail.mcl final.mch clrjit.dll
Or, continuing the example above, giving full paths, we have:
```
-f:\gh\runtime\artifacts\bin\coreclr\Windows_NT.x64.Checked\superpmi.exe -p -f f:\spmi\finalfail.mcl f:\spmi\final.mch f:\gh\runtime\artifacts\bin\coreclr\Windows_NT.x64.Checked\clrjit.dll
+f:\gh\runtime\artifacts\bin\coreclr\windows.x64.Checked\superpmi.exe -p -f f:\spmi\finalfail.mcl f:\spmi\final.mch f:\gh\runtime\artifacts\bin\coreclr\windows.x64.Checked\clrjit.dll
```
In this case, if `finalfail.mcl` is not empty, there was a failure in the final "check" replay.
diff --git a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/standardpch.h b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/standardpch.h
index 8aa6a1acbbdd..e6ba1478e42b 100644
--- a/src/coreclr/src/ToolBox/superpmi/superpmi-shared/standardpch.h
+++ b/src/coreclr/src/ToolBox/superpmi/superpmi-shared/standardpch.h
@@ -3,6 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
+#ifndef STANDARDPCH_H
+#define STANDARDPCH_H
+
// The point of a PCH file is to never reparse files that never change.
// Only include files here that will almost NEVER change. Headers for the project
// itself are probably inappropriate, because if you change them, the entire
@@ -117,3 +120,4 @@ static inline void __debugbreak()
}
#endif
+#endif // STANDARDPCH_H
diff --git a/src/coreclr/src/classlibnative/bcltype/system.cpp b/src/coreclr/src/classlibnative/bcltype/system.cpp
index 74623125fdf4..3660c14963df 100644
--- a/src/coreclr/src/classlibnative/bcltype/system.cpp
+++ b/src/coreclr/src/classlibnative/bcltype/system.cpp
@@ -590,23 +590,6 @@ FCIMPL0(FC_BOOL_RET, SystemNative::IsServerGC)
}
FCIMPLEND
-#ifdef FEATURE_COMINTEROP
-
-BOOL QCALLTYPE SystemNative::WinRTSupported()
-{
- QCALL_CONTRACT;
-
- BOOL hasWinRT = FALSE;
-
- BEGIN_QCALL;
- hasWinRT = ::WinRTSupported();
- END_QCALL;
-
- return hasWinRT;
-}
-
-#endif // FEATURE_COMINTEROP
-
#if defined(TARGET_X86) || defined(TARGET_AMD64)
void QCALLTYPE SystemNative::X86BaseCpuId(int cpuInfo[4], int functionId, int subFunctionId)
diff --git a/src/coreclr/src/classlibnative/bcltype/system.h b/src/coreclr/src/classlibnative/bcltype/system.h
index ff6720f0a8c0..5bbf73d4a104 100644
--- a/src/coreclr/src/classlibnative/bcltype/system.h
+++ b/src/coreclr/src/classlibnative/bcltype/system.h
@@ -73,11 +73,6 @@ class SystemNative
static FCDECL0(FC_BOOL_RET, IsServerGC);
-#ifdef FEATURE_COMINTEROP
- static
- BOOL QCALLTYPE WinRTSupported();
-#endif // FEATURE_COMINTEROP
-
// Return a method info for the method were the exception was thrown
static FCDECL1(ReflectMethodObject*, GetMethodFromStackTrace, ArrayBase* pStackTraceUNSAFE);
diff --git a/src/coreclr/src/debug/daccess/daccess.cpp b/src/coreclr/src/debug/daccess/daccess.cpp
index 0344ddc1a3fb..424cff1b9148 100644
--- a/src/coreclr/src/debug/daccess/daccess.cpp
+++ b/src/coreclr/src/debug/daccess/daccess.cpp
@@ -40,7 +40,6 @@ extern bool TryGetSymbol(ICorDebugDataTarget* dataTarget, uint64_t baseAddress,
CRITICAL_SECTION g_dacCritSec;
ClrDataAccess* g_dacImpl;
-HINSTANCE g_thisModule;
EXTERN_C
#ifdef TARGET_UNIX
@@ -75,9 +74,6 @@ BOOL WINAPI DllMain(HANDLE instance, DWORD reason, LPVOID reserved)
#endif
InitializeCriticalSection(&g_dacCritSec);
- // Save the module handle.
- g_thisModule = (HINSTANCE)instance;
-
g_procInitialized = true;
break;
}
@@ -95,12 +91,6 @@ BOOL WINAPI DllMain(HANDLE instance, DWORD reason, LPVOID reserved)
return TRUE;
}
-HINSTANCE
-GetModuleInst(void)
-{
- return g_thisModule;
-}
-
HRESULT
ConvertUtf8(__in LPCUTF8 utf8,
ULONG32 bufLen,
@@ -5622,16 +5612,6 @@ ClrDataAccess::Initialize(void)
// Do some validation
IfFailRet(VerifyDlls());
- // To support EH SxS, utilcode requires the base address of the runtime
- // as part of its initialization so that functions like "WasThrownByUs" work correctly since
- // they use the CLR base address to check if an exception was raised by a given instance of the runtime
- // or not.
- //
- // Thus, when DAC is initialized, initialize utilcode with the base address of the runtime loaded in the
- // target process. This is similar to work done in CorDB::SetTargetCLR for mscordbi.
-
- g_hmodCoreCLR = (HINSTANCE)m_globalBase; // Base address of the runtime in the target process
-
return S_OK;
}
diff --git a/src/coreclr/src/debug/daccess/dacimpl.h b/src/coreclr/src/debug/daccess/dacimpl.h
index fdea07159d26..717c6cf07ed5 100644
--- a/src/coreclr/src/debug/daccess/dacimpl.h
+++ b/src/coreclr/src/debug/daccess/dacimpl.h
@@ -127,9 +127,6 @@ enum DAC_USAGE_TYPE
DAC_PAL,
};
-// mscordacwks's module handle
-extern HINSTANCE g_thisModule;
-
class ReflectionModule;
struct DAC_MD_IMPORT
diff --git a/src/coreclr/src/debug/daccess/request.cpp b/src/coreclr/src/debug/daccess/request.cpp
index 99366e980e26..6523b40f2413 100644
--- a/src/coreclr/src/debug/daccess/request.cpp
+++ b/src/coreclr/src/debug/daccess/request.cpp
@@ -3889,12 +3889,22 @@ HRESULT ClrDataAccess::GetTLSIndex(ULONG *pIndex)
return hr;
}
+#ifndef TARGET_UNIX
+extern "C" IMAGE_DOS_HEADER __ImageBase;
+#endif
+
HRESULT ClrDataAccess::GetDacModuleHandle(HMODULE *phModule)
{
if(phModule == NULL)
return E_INVALIDARG;
- *phModule = GetModuleInst();
+
+#ifndef TARGET_UNIX
+ *phModule = (HMODULE)&__ImageBase;
return S_OK;
+#else
+ // hModule is not available under TARGET_UNIX
+ return E_FAIL;
+#endif
}
HRESULT ClrDataAccess::GetRCWData(CLRDATA_ADDRESS addr, struct DacpRCWData *rcwData)
diff --git a/src/coreclr/src/debug/debug-pal/win/diagnosticsipc.cpp b/src/coreclr/src/debug/debug-pal/win/diagnosticsipc.cpp
index 9a28e482342f..fe7828daf78b 100644
--- a/src/coreclr/src/debug/debug-pal/win/diagnosticsipc.cpp
+++ b/src/coreclr/src/debug/debug-pal/win/diagnosticsipc.cpp
@@ -134,6 +134,7 @@ IpcStream *IpcStream::DiagnosticsIpc::Accept(ErrorCallback callback)
_ASSERTE(mode == ConnectionMode::LISTEN);
DWORD dwDummy = 0;
+ IpcStream *pStream = nullptr;
bool fSuccess = GetOverlappedResult(
_hPipe, // handle
&_oOverlap, // overlapped
@@ -144,11 +145,14 @@ IpcStream *IpcStream::DiagnosticsIpc::Accept(ErrorCallback callback)
{
if (callback != nullptr)
callback("Failed to GetOverlappedResults for NamedPipe server", ::GetLastError());
- return nullptr;
+ // close the pipe (cleaned up and reset below)
+ ::CloseHandle(_hPipe);
+ }
+ else
+ {
+ // create new IpcStream using handle (passes ownership to pStream)
+ pStream = new IpcStream(_hPipe, ConnectionMode::LISTEN);
}
-
- // create new IpcStream using handle and reset the Server object so it can listen again
- IpcStream *pStream = new IpcStream(_hPipe, ConnectionMode::LISTEN);
// reset the server
_hPipe = INVALID_HANDLE_VALUE;
@@ -159,7 +163,7 @@ IpcStream *IpcStream::DiagnosticsIpc::Accept(ErrorCallback callback)
if (!fSuccess)
{
delete pStream;
- return nullptr;
+ pStream = nullptr;
}
return pStream;
@@ -434,43 +438,42 @@ bool IpcStream::Read(void *lpBuffer, const uint32_t nBytesToRead, uint32_t &nByt
if (!fSuccess)
{
+ DWORD dwError = GetLastError();
+
// if we're waiting infinitely, only make one syscall
- if (timeoutMs == InfiniteTimeout)
+ if (timeoutMs == InfiniteTimeout && dwError == ERROR_IO_PENDING)
{
fSuccess = GetOverlappedResult(_hPipe, // pipe
overlap, // overlapped
&nNumberOfBytesRead, // out actual number of bytes read
true) != 0; // block until async IO completes
}
- else
+ else if (dwError == ERROR_IO_PENDING)
{
- DWORD dwError = GetLastError();
- if (dwError == ERROR_IO_PENDING)
+ // Wait on overlapped IO event (triggers when async IO is complete regardless of success)
+ // or timeout
+ DWORD dwWait = WaitForSingleObject(_oOverlap.hEvent, (DWORD)timeoutMs);
+ if (dwWait == WAIT_OBJECT_0)
{
- // Wait on overlapped IO event (triggers when async IO is complete regardless of success)
- // or timeout
- DWORD dwWait = WaitForSingleObject(_oOverlap.hEvent, (DWORD)timeoutMs);
- if (dwWait == WAIT_OBJECT_0)
- {
- // async IO compelted, get the result
- fSuccess = GetOverlappedResult(_hPipe, // pipe
- overlap, // overlapped
- &nNumberOfBytesRead, // out actual number of bytes read
- true) != 0; // block until async IO completes
- }
- else
+ // async IO compelted, get the result
+ fSuccess = GetOverlappedResult(_hPipe, // pipe
+ overlap, // overlapped
+ &nNumberOfBytesRead, // out actual number of bytes read
+ true) != 0; // block until async IO completes
+ }
+ else
+ {
+ // We either timed out or something else went wrong.
+ // For any error, attempt to cancel IO and ensure the cancel happened
+ if (CancelIoEx(_hPipe, overlap) != 0)
{
- // We either timed out or something else went wrong.
- // For any error, attempt to cancel IO and ensure the cancel happened
- if (CancelIoEx(_hPipe, overlap) != 0)
- {
- // check if the async write beat the cancellation
- fSuccess = GetOverlappedResult(_hPipe, overlap, &nNumberOfBytesRead, true) != 0;
- // Failure here isn't recoverable, so return as such
- }
+ // check if the async write beat the cancellation
+ fSuccess = GetOverlappedResult(_hPipe, overlap, &nNumberOfBytesRead, true) != 0;
+ // Failure here isn't recoverable, so return as such
}
}
}
+ // error is unrecoverable, so return as such
}
nBytesRead = static_cast(nNumberOfBytesRead);
@@ -492,43 +495,42 @@ bool IpcStream::Write(const void *lpBuffer, const uint32_t nBytesToWrite, uint32
if (!fSuccess)
{
+ DWORD dwError = GetLastError();
+
// if we're waiting infinitely, only make one syscall
- if (timeoutMs == InfiniteTimeout)
+ if (timeoutMs == InfiniteTimeout && dwError == ERROR_IO_PENDING)
{
fSuccess = GetOverlappedResult(_hPipe, // pipe
overlap, // overlapped
&nNumberOfBytesWritten, // out actual number of bytes written
true) != 0; // block until async IO completes
}
- else
+ else if (dwError == ERROR_IO_PENDING)
{
- DWORD dwError = GetLastError();
- if (dwError == ERROR_IO_PENDING)
+ // Wait on overlapped IO event (triggers when async IO is complete regardless of success)
+ // or timeout
+ DWORD dwWait = WaitForSingleObject(_oOverlap.hEvent, (DWORD)timeoutMs);
+ if (dwWait == WAIT_OBJECT_0)
{
- // Wait on overlapped IO event (triggers when async IO is complete regardless of success)
- // or timeout
- DWORD dwWait = WaitForSingleObject(_oOverlap.hEvent, (DWORD)timeoutMs);
- if (dwWait == WAIT_OBJECT_0)
- {
- // async IO compelted, get the result
- fSuccess = GetOverlappedResult(_hPipe, // pipe
- overlap, // overlapped
- &nNumberOfBytesWritten, // out actual number of bytes written
- true) != 0; // block until async IO completes
- }
- else
+ // async IO compelted, get the result
+ fSuccess = GetOverlappedResult(_hPipe, // pipe
+ overlap, // overlapped
+ &nNumberOfBytesWritten, // out actual number of bytes written
+ true) != 0; // block until async IO completes
+ }
+ else
+ {
+ // We either timed out or something else went wrong.
+ // For any error, attempt to cancel IO and ensure the cancel happened
+ if (CancelIoEx(_hPipe, overlap) != 0)
{
- // We either timed out or something else went wrong.
- // For any error, attempt to cancel IO and ensure the cancel happened
- if (CancelIoEx(_hPipe, overlap) != 0)
- {
- // check if the async write beat the cancellation
- fSuccess = GetOverlappedResult(_hPipe, overlap, &nNumberOfBytesWritten, true) != 0;
- // Failure here isn't recoverable, so return as such
- }
+ // check if the async write beat the cancellation
+ fSuccess = GetOverlappedResult(_hPipe, overlap, &nNumberOfBytesWritten, true) != 0;
+ // Failure here isn't recoverable, so return as such
}
}
}
+ // error is unrecoverable, so return as such
}
nBytesWritten = static_cast(nNumberOfBytesWritten);
diff --git a/src/coreclr/src/debug/di/cordb.cpp b/src/coreclr/src/debug/di/cordb.cpp
index 673d48c8ab8f..2c11397fcd3b 100644
--- a/src/coreclr/src/debug/di/cordb.cpp
+++ b/src/coreclr/src/debug/di/cordb.cpp
@@ -26,11 +26,6 @@
#define SUPPORT_LOCAL_DEBUGGING 1
#endif
-//********** Globals. *********************************************************
-#ifndef HOST_UNIX
-HINSTANCE g_hInst; // Instance handle to this piece of code.
-#endif
-
//-----------------------------------------------------------------------------
// SxS Versioning story for Mscordbi (ICorDebug + friends)
//-----------------------------------------------------------------------------
@@ -200,9 +195,7 @@ BOOL WINAPI DbgDllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
case DLL_PROCESS_ATTACH:
{
-#ifndef HOST_UNIX
- g_hInst = hInstance;
-#else
+#ifdef HOST_UNIX
int err = PAL_InitializeDLL();
if(err != 0)
{
@@ -438,17 +431,6 @@ HRESULT STDMETHODCALLTYPE CClassFactory::LockServer(
}
-//*****************************************************************************
-// This helper provides access to the instance handle of the loaded image.
-//*****************************************************************************
-#ifndef TARGET_UNIX
-HINSTANCE GetModuleInst()
-{
- return g_hInst;
-}
-#endif
-
-
//-----------------------------------------------------------------------------
// Substitute for mscoree
//
diff --git a/src/coreclr/src/debug/di/module.cpp b/src/coreclr/src/debug/di/module.cpp
index 39f306f7c0f4..88a6e366286b 100644
--- a/src/coreclr/src/debug/di/module.cpp
+++ b/src/coreclr/src/debug/di/module.cpp
@@ -2565,7 +2565,7 @@ HRESULT CordbModule::CreateReaderForInMemorySymbols(REFIID riid, void** ppObj)
#ifndef TARGET_UNIX
// PDB format - use diasymreader.dll with COM activation
InlineSString<_MAX_PATH> ssBuf;
- IfFailThrow(GetHModuleDirectory(GetModuleInst(), ssBuf));
+ IfFailThrow(GetClrModuleDirectory(ssBuf));
IfFailThrow(FakeCoCreateInstanceEx(CLSID_CorSymBinder_SxS,
ssBuf.GetUnicode(),
IID_ISymUnmanagedBinder,
diff --git a/src/coreclr/src/debug/di/rsmain.cpp b/src/coreclr/src/debug/di/rsmain.cpp
index 11d5fcf4b1a8..779a6eac56d2 100644
--- a/src/coreclr/src/debug/di/rsmain.cpp
+++ b/src/coreclr/src/debug/di/rsmain.cpp
@@ -456,6 +456,7 @@ void LeftSideResourceCleanupList::SweepNeuterLeftSideResources(CordbProcess * pP
/* ------------------------------------------------------------------------- *
* CordbBase class
* ------------------------------------------------------------------------- */
+extern void* GetClrModuleBase();
// Do any initialization necessary for both CorPublish and CorDebug
// This includes enabling logging and adding the SEDebug priv.
@@ -488,11 +489,7 @@ void CordbCommonBase::InitializeCommon()
unsigned level = REGUTIL::GetConfigDWORD_DontUse_(CLRConfig::EXTERNAL_LogLevel, LL_INFO1000);
unsigned bytesPerThread = REGUTIL::GetConfigDWORD_DontUse_(CLRConfig::UNSUPPORTED_StressLogSize, STRESSLOG_CHUNK_SIZE * 2);
unsigned totalBytes = REGUTIL::GetConfigDWORD_DontUse_(CLRConfig::UNSUPPORTED_TotalStressLogSize, STRESSLOG_CHUNK_SIZE * 1024);
-#ifndef TARGET_UNIX
- StressLog::Initialize(facilities, level, bytesPerThread, totalBytes, GetModuleInst());
-#else
- StressLog::Initialize(facilities, level, bytesPerThread, totalBytes, NULL);
-#endif
+ StressLog::Initialize(facilities, level, bytesPerThread, totalBytes, GetClrModuleBase());
}
}
@@ -1427,13 +1424,6 @@ HRESULT Cordb::SetTargetCLR(HMODULE hmodTargetCLR)
m_targetCLR = hmodTargetCLR;
#endif
- // @REVIEW: are we happy with this workaround? It allows us to use the existing
- // infrastructure for instance name decoration, but it really doesn't fit
- // the same model because coreclr.dll isn't in this process and hmodTargetCLR
- // is the debuggee target, not the coreclr.dll to bind utilcode to..
-
- g_hmodCoreCLR = hmodTargetCLR;
-
return S_OK;
}
diff --git a/src/coreclr/src/debug/di/rspriv.h b/src/coreclr/src/debug/di/rspriv.h
index 5cbba66aaf18..5777f29f233f 100644
--- a/src/coreclr/src/debug/di/rspriv.h
+++ b/src/coreclr/src/debug/di/rspriv.h
@@ -134,12 +134,6 @@ class DbgTransportSession;
// These hooks must be removed before shipping.
class ShimProcess;
-
-#ifndef TARGET_UNIX
-extern HINSTANCE GetModuleInst();
-#endif
-
-
template
class CordbSafeHashTable;
diff --git a/src/coreclr/src/debug/di/shimprocess.cpp b/src/coreclr/src/debug/di/shimprocess.cpp
index 685c4f2b3018..72da6068e823 100644
--- a/src/coreclr/src/debug/di/shimprocess.cpp
+++ b/src/coreclr/src/debug/di/shimprocess.cpp
@@ -1824,34 +1824,19 @@ HMODULE ShimProcess::GetDacModule()
HModuleHolder hDacDll;
PathString wszAccessDllPath;
-#ifdef TARGET_UNIX
- if (!PAL_GetPALDirectoryWrapper(wszAccessDllPath))
- {
- ThrowLastError();
- }
- PCWSTR eeFlavor = MAKEDLLNAME_W(W("mscordaccore"));
-#else
//
// Load the access DLL from the same directory as the the current CLR Debugging Services DLL.
//
-
- if (!WszGetModuleFileName(GetModuleInst(), wszAccessDllPath))
+ if (GetClrModuleDirectory(wszAccessDllPath) != S_OK)
{
ThrowLastError();
}
- if (!SUCCEEDED(CopySystemDirectory(wszAccessDllPath, wszAccessDllPath)))
- {
- ThrowHR(E_INVALIDARG);
- }
-
// Dac Dll is named:
// mscordaccore.dll <-- coreclr
// mscordacwks.dll <-- desktop
- PCWSTR eeFlavor =
- W("mscordaccore.dll");
+ PCWSTR eeFlavor = MAKEDLLNAME_W(W("mscordaccore"));
-#endif // TARGET_UNIX
wszAccessDllPath.Append(eeFlavor);
hDacDll.Assign(WszLoadLibrary(wszAccessDllPath));
diff --git a/src/coreclr/src/debug/ee/debugger.cpp b/src/coreclr/src/debug/ee/debugger.cpp
index 79d8dd0e6af2..a84b6d6ef613 100644
--- a/src/coreclr/src/debug/ee/debugger.cpp
+++ b/src/coreclr/src/debug/ee/debugger.cpp
@@ -1750,7 +1750,7 @@ void Debugger::SendRawEvent(const DebuggerIPCEvent * pManagedEvent)
// The debugger can then use ReadProcessMemory to read through this array.
ULONG_PTR rgData [] = {
CLRDBG_EXCEPTION_DATA_CHECKSUM,
- (ULONG_PTR) g_hThisInst,
+ (ULONG_PTR)GetClrModuleBase(),
(ULONG_PTR) pManagedEvent
};
@@ -5668,7 +5668,7 @@ bool Debugger::FirstChanceNativeException(EXCEPTION_RECORD *exception,
// Ignore any notification exceptions sent from code:Debugger.SendRawEvent.
// This is not a common case, but could happen in some cases described
// in SendRawEvent. Either way, Left-Side and VM should just ignore these.
- if (IsEventDebuggerNotification(exception, PTR_TO_CORDB_ADDRESS(g_hThisInst)))
+ if (IsEventDebuggerNotification(exception, PTR_TO_CORDB_ADDRESS(GetClrModuleBase())))
{
return true;
}
@@ -12363,7 +12363,7 @@ void Debugger::GetAndSendTransitionStubInfo(CORDB_ADDRESS_TYPE *stubAddress)
// If its not a stub, then maybe its an address in mscoree?
if (result == false)
{
- result = (IsIPInModule(g_hThisInst, (PCODE)stubAddress) == TRUE);
+ result = (IsIPInModule(GetClrModuleBase(), (PCODE)stubAddress) == TRUE);
}
// This is a synchronous event (reply required)
diff --git a/src/coreclr/src/dlls/mscordac/mscordac_unixexports.src b/src/coreclr/src/dlls/mscordac/mscordac_unixexports.src
index a7e6a8786ed7..911ba406042a 100644
--- a/src/coreclr/src/dlls/mscordac/mscordac_unixexports.src
+++ b/src/coreclr/src/dlls/mscordac/mscordac_unixexports.src
@@ -30,7 +30,6 @@ nativeStringResourceTable_mscorrc
#PAL_fwprintf
#PAL_GetLogicalCpuCountFromOS
#PAL_GetNumaProcessorNode
-#PAL_GetPALDirectoryW
#PAL_get_stdout
#PAL_get_stderr
#PAL_GetApplicationGroupId
@@ -38,6 +37,7 @@ nativeStringResourceTable_mscorrc
#PAL_GetCurrentThread
#PAL_GetCpuLimit
#PAL_GetNativeExceptionHolderHead
+#PAL_GetPalHostModule
#PAL_GetSymbolModuleBase
#PAL_GetTransportPipeName
#PAL_InitializeDLL
diff --git a/src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt b/src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt
index 11dee9f699a5..7835929afc1c 100644
--- a/src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt
+++ b/src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt
@@ -207,7 +207,7 @@ if(CLR_CMAKE_TARGET_WIN32)
DEPENDS coreclr mscordaccore mscordbi ${CLR_DIR}/src/debug/daccess/daccess.cpp
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/inject_debug_resources.timestamp
COMMAND ${CMAKE_CXX_COMPILER} /P /EP /TP ${PREPROCESS_DEFINITIONS} ${INC_DIR} /Fi${CMAKE_CURRENT_BINARY_DIR}/daccess.i ${CLR_DIR}/src/debug/daccess/daccess.cpp
- COMMAND ${CLR_REPO_ROOT_DIR}/dotnet.cmd exec ${CMAKE_INSTALL_PREFIX}/DacTableGen/DacTableGen.dll /dac:${CMAKE_CURRENT_BINARY_DIR}/daccess.i /pdb:$ /dll:$ /bin:${CMAKE_CURRENT_BINARY_DIR}/wks.bin
+ COMMAND cmd /c ${CLR_REPO_ROOT_DIR}/dotnet.cmd exec ${CMAKE_INSTALL_PREFIX}/DacTableGen/DacTableGen.dll /dac:${CMAKE_CURRENT_BINARY_DIR}/daccess.i /pdb:$ /dll:$ /bin:${CMAKE_CURRENT_BINARY_DIR}/wks.bin
COMMAND InjectResource /bin:${CMAKE_CURRENT_BINARY_DIR}/wks.bin /dll:$
COMMAND GenClrDebugResource /dac:$ /dbi:$ /sku:onecoreclr /out:${CMAKE_CURRENT_BINARY_DIR}/clrDebugResource.bin
COMMAND InjectResource /bin:${CMAKE_CURRENT_BINARY_DIR}/clrDebugResource.bin /dll:$ /name:CLRDEBUGINFO
diff --git a/src/coreclr/src/dlls/mscoree/mscoree.cpp b/src/coreclr/src/dlls/mscoree/mscoree.cpp
index c610e9e91a10..4219910a6b3f 100644
--- a/src/coreclr/src/dlls/mscoree/mscoree.cpp
+++ b/src/coreclr/src/dlls/mscoree/mscoree.cpp
@@ -47,14 +47,7 @@ BOOL WINAPI DllMain(HANDLE hInstance, DWORD dwReason, LPVOID lpReserved)
#endif // !defined(CROSSGEN_COMPILE) && !defined(CORECLR_EMBEDDED)
-// Globals
-extern HINSTANCE g_hThisInst;
-
-HINSTANCE GetModuleInst()
-{
- LIMITED_METHOD_CONTRACT;
- return (g_hThisInst);
-}
+extern void* GetClrModuleBase();
// ---------------------------------------------------------------------------
// %%Function: MetaDataGetDispenser
@@ -222,39 +215,6 @@ STDAPI ReOpenMetaDataWithMemoryEx(
return hr;
}
-STDAPI GetCORSystemDirectoryInternaL(SString& pBuffer)
-{
- CONTRACTL {
- NOTHROW;
- GC_NOTRIGGER;
- ENTRY_POINT;
- } CONTRACTL_END;
-
- HRESULT hr = S_OK;
- BEGIN_ENTRYPOINT_NOTHROW;
-
-
-#ifdef CROSSGEN_COMPILE
-
- if (WszGetModuleFileName(NULL, pBuffer) > 0)
- {
- hr = CopySystemDirectory(pBuffer, pBuffer);
- }
- else {
- hr = HRESULT_FROM_GetLastError();
- }
-
-#else
-
- if (!PAL_GetPALDirectoryWrapper(pBuffer)) {
- hr = HRESULT_FROM_GetLastError();
- }
-#endif
-
- END_ENTRYPOINT_NOTHROW;
- return hr;
-}
-
static DWORD g_dwSystemDirectory = 0;
static WCHAR * g_pSystemDirectory = NULL;
@@ -326,8 +286,7 @@ HRESULT SetInternalSystemDirectory()
// use local buffer for thread safety
PathString wzSystemDirectory;
-
- hr = GetCORSystemDirectoryInternaL(wzSystemDirectory);
+ hr = GetClrModuleDirectory(wzSystemDirectory);
if (FAILED(hr)) {
wzSystemDirectory.Set(W('\0'));
diff --git a/src/coreclr/src/dlls/mscoree/stdafx.h b/src/coreclr/src/dlls/mscoree/stdafx.h
index 1573727298fe..1e29b9f0597e 100644
--- a/src/coreclr/src/dlls/mscoree/stdafx.h
+++ b/src/coreclr/src/dlls/mscoree/stdafx.h
@@ -17,8 +17,4 @@
#include "intrinsic.h" // Functions to make intrinsic.
-
-// Helper function returns the instance handle of this module.
-HINSTANCE GetModuleInst();
-
#endif // __STDAFX_H__
diff --git a/src/coreclr/src/gc/env/etmdummy.h b/src/coreclr/src/gc/env/etmdummy.h
index 3d0e220f436f..0605f03a98ed 100644
--- a/src/coreclr/src/gc/env/etmdummy.h
+++ b/src/coreclr/src/gc/env/etmdummy.h
@@ -129,6 +129,7 @@
#define FireEtwMethodJitInliningFailed(MethodBeingCompiledNamespace, MethodBeingCompiledName, MethodBeingCompiledNameSignature, InlinerNamespace, InlinerName, InlinerNameSignature, InlineeNamespace, InlineeName, InlineeNameSignature, FailAlways, FailReason, ClrInstanceID) 0
#define FireEtwMethodJitTailCallSucceeded(MethodBeingCompiledNamespace, MethodBeingCompiledName, MethodBeingCompiledNameSignature, CallerNamespace, CallerName, CallerNameSignature, CalleeNamespace, CalleeName, CalleeNameSignature, TailPrefix, TailCallType, ClrInstanceID) 0
#define FireEtwMethodJitTailCallFailed(MethodBeingCompiledNamespace, MethodBeingCompiledName, MethodBeingCompiledNameSignature, CallerNamespace, CallerName, CallerNameSignature, CalleeNamespace, CalleeName, CalleeNameSignature, TailPrefix, FailReason, ClrInstanceID) 0
+#define FireEtwMethodJitMemoryAllocatedForCode(MethodID, ModuleID, JitHotCodeRequestSize, JitRODataRequestSize, AllocatedSizeForJitCode, JitAllocFlag, ClrInstanceID) 0
#define FireEtwMethodILToNativeMap(MethodID, ReJITID, MethodExtent, CountOfMapEntries, ILOffsets, NativeOffsets, ClrInstanceID) 0
#define FireEtwModuleDCStartV2(ModuleID, AssemblyID, ModuleFlags, Reserved1, ModuleILPath, ModuleNativePath) 0
#define FireEtwModuleDCEndV2(ModuleID, AssemblyID, ModuleFlags, Reserved1, ModuleILPath, ModuleNativePath) 0
diff --git a/src/coreclr/src/gc/gc.cpp b/src/coreclr/src/gc/gc.cpp
index 9f022df84657..38b6d8e97d56 100644
--- a/src/coreclr/src/gc/gc.cpp
+++ b/src/coreclr/src/gc/gc.cpp
@@ -2616,6 +2616,7 @@ alloc_list gc_heap::poh_alloc_list [NUM_POH_ALIST-1];
#ifdef DOUBLY_LINKED_FL
// size we removed with no undo; only for recording purpose
size_t gc_heap::gen2_removed_no_undo = 0;
+size_t gc_heap::saved_pinned_plug_index = 0;
#endif //DOUBLY_LINKED_FL
dynamic_data gc_heap::dynamic_data_table [total_generation_count];
@@ -3795,6 +3796,10 @@ class CObjectHeader : public Object
}
void ClearFreeObjInCompactBit()
{
+#ifdef _DEBUG
+ // check this looks like an object
+ Validate();
+#endif //_DEBUG
RawSetMethodTable((MethodTable *)(((size_t) RawGetMethodTable()) & (~MAKE_FREE_OBJ_IN_COMPACT)));
}
#endif //DOUBLY_LINKED_FL
@@ -11783,7 +11788,7 @@ void gc_heap::adjust_limit (uint8_t* start, size_t limit_size, generation* gen)
// This means we cannot simply make a filler free object right after what's allocated in this alloc context if
// that's < 5-ptr sized.
//
- if (allocated_size < min_free_item_no_prev)
+ if (allocated_size <= min_free_item_no_prev)
{
// We can't make the free object just yet. Need to record the size.
size_t* filler_free_obj_size_location = (size_t*)(generation_allocation_context_start_region (gen) + min_free_item_no_prev);
@@ -11803,7 +11808,26 @@ void gc_heap::adjust_limit (uint8_t* start, size_t limit_size, generation* gen)
generation_free_obj_space (gen) += filler_free_obj_size;
*filler_free_obj_size_location = filler_free_obj_size;
uint8_t* old_loc = generation_last_free_list_allocated (gen);
- set_free_obj_in_compact_bit (old_loc);
+
+ // check if old_loc happens to be in a saved plug_and_gap with a pinned plug after it
+ uint8_t* saved_plug_and_gap = pinned_plug (pinned_plug_of (saved_pinned_plug_index)) - sizeof(plug_and_gap);
+ size_t offset = old_loc - saved_plug_and_gap;
+ if (offset < sizeof(gap_reloc_pair))
+ {
+ // the object at old_loc must be at least min_obj_size
+ assert (offset <= sizeof(plug_and_gap) - min_obj_size);
+
+ // if so, set the bit in the saved info instead
+ set_free_obj_in_compact_bit ((uint8_t*)(&pinned_plug_of (saved_pinned_plug_index)->saved_pre_plug_reloc) + offset);
+ }
+ else
+ {
+#ifdef _DEBUG
+ // check this looks like an object
+ header(old_loc)->Validate();
+#endif //_DEBUG
+ set_free_obj_in_compact_bit (old_loc);
+ }
dprintf (3333, ("[h%d] ac: %Ix->%Ix((%Id < %Id), Pset %Ix s->%Id", heap_number,
generation_allocation_context_start_region (gen), generation_allocation_pointer (gen),
@@ -23334,6 +23358,12 @@ void gc_heap::store_plug_gap_info (uint8_t* plug_start,
if (save_pre_plug_info_p)
{
+#ifdef DOUBLY_LINKED_FL
+ if (last_object_in_last_plug == generation_last_free_list_allocated(generation_of(max_generation)))
+ {
+ saved_pinned_plug_index = mark_stack_tos;
+ }
+#endif //DOUBLY_LINKED_FL
set_gap_size (plug_start, sizeof (gap_reloc_pair));
}
}
@@ -23718,6 +23748,7 @@ void gc_heap::plan_phase (int condemned_gen_number)
#ifdef DOUBLY_LINKED_FL
gen2_removed_no_undo = 0;
+ saved_pinned_plug_index = 0;
#endif //DOUBLY_LINKED_FL
while (1)
@@ -26606,7 +26637,7 @@ void gc_heap::gcmemcopy (uint8_t* dest, uint8_t* src, size_t len, BOOL copy_car
}
BOOL make_free_obj_p = FALSE;
- if (len < min_free_item_no_prev)
+ if (len <= min_free_item_no_prev)
{
make_free_obj_p = is_free_obj_in_compact_bit_set (src);
@@ -26869,6 +26900,7 @@ void gc_heap::compact_in_brick (uint8_t* tree, compact_args* args)
uint8_t* gap = (plug - gap_size);
uint8_t* last_plug_end = gap;
size_t last_plug_size = (last_plug_end - args->last_plug);
+ assert ((last_plug_size & (sizeof(PTR_PTR) - 1)) == 0);
dprintf (3, ("tree: %Ix, last_plug: %Ix, gap: %Ix(%Ix), last_plug_end: %Ix, size: %Ix",
tree, args->last_plug, gap, gap_size, last_plug_end, last_plug_size));
@@ -34705,6 +34737,12 @@ void gc_heap::background_sweep()
current_bgc_state = bgc_sweep_soh;
verify_soh_segment_list();
+#ifdef DOUBLY_LINKED_FL
+ // set the initial segment and position so that foreground GC knows where BGC is with the sweep
+ current_sweep_seg = heap_segment_rw (generation_start_segment (generation_of (max_generation)));
+ current_sweep_pos = 0;
+#endif //DOUBLY_LINKED_FL
+
#ifdef FEATURE_BASICFREEZE
generation* max_gen = generation_of (max_generation);
if ((generation_start_segment (max_gen) != ephemeral_heap_segment) &&
diff --git a/src/coreclr/src/gc/gchandletable.cpp b/src/coreclr/src/gc/gchandletable.cpp
index 9934889e58e4..3f69dbd1ef03 100644
--- a/src/coreclr/src/gc/gchandletable.cpp
+++ b/src/coreclr/src/gc/gchandletable.cpp
@@ -99,7 +99,7 @@ IGCHandleStore* GCHandleManager::CreateHandleStore()
return store;
#else
- assert("CreateHandleStore is not implemented when FEATURE_REDHAWK is defined!");
+ assert(!"CreateHandleStore is not implemented when FEATURE_REDHAWK is defined!");
return nullptr;
#endif
}
diff --git a/src/coreclr/src/gc/gcpriv.h b/src/coreclr/src/gc/gcpriv.h
index 189ad57bc069..23f5bc836339 100644
--- a/src/coreclr/src/gc/gcpriv.h
+++ b/src/coreclr/src/gc/gcpriv.h
@@ -66,7 +66,7 @@ inline void FATAL_GC_ERROR()
// We need the lower 3 bits in the MT to do our bookkeeping so doubly linked free list is only for 64-bit
#ifdef HOST_64BIT
// To be enabled.
-//#define DOUBLY_LINKED_FL
+// #define DOUBLY_LINKED_FL
#endif //HOST_64BIT
#ifndef FEATURE_REDHAWK
@@ -4091,6 +4091,9 @@ class gc_heap
// accounting into the alloc_list class.
PER_HEAP
size_t gen2_removed_no_undo;
+
+ PER_HEAP
+ size_t saved_pinned_plug_index;
#endif //DOUBLY_LINKED_FL
PER_HEAP
diff --git a/src/coreclr/src/gcdump/i386/gcdumpx86.cpp b/src/coreclr/src/gcdump/i386/gcdumpx86.cpp
index 92b64430aece..1bf3e61011bd 100644
--- a/src/coreclr/src/gcdump/i386/gcdumpx86.cpp
+++ b/src/coreclr/src/gcdump/i386/gcdumpx86.cpp
@@ -255,7 +255,7 @@ size_t GCDump::DumpGCTable(PTR_CBYTE table,
table = DumpEncoding(table, sz);
- _ASSERTE(0 == ~OFFSET_MASK % sizeof(void*));
+ _ASSERTE(0 == ~OFFSET_MASK % sizeof(uint32_t));
lowBits = OFFSET_MASK & stkOffs;
stkOffs &= ~OFFSET_MASK;
@@ -304,7 +304,7 @@ size_t GCDump::DumpGCTable(PTR_CBYTE table,
DumpEncoding(bp, table-bp);
- _ASSERTE(0 == ~OFFSET_MASK % sizeof(void*));
+ _ASSERTE(0 == ~OFFSET_MASK % sizeof(uint32_t));
lowBits = varOffs & 0x3;
varOffs &= ~OFFSET_MASK;
diff --git a/src/coreclr/src/inc/clrhost.h b/src/coreclr/src/inc/clrhost.h
index 8f5f3ff03fb7..f70382cf17da 100644
--- a/src/coreclr/src/inc/clrhost.h
+++ b/src/coreclr/src/inc/clrhost.h
@@ -92,7 +92,7 @@ typedef Holder, VoidClrDeleteCriticalSection, NULL> CRITSEC_AllocationHolder;
-HMODULE GetCLRModule ();
+DWORD GetClrModulePathName(SString& buffer);
extern thread_local int t_CantAllocCount;
diff --git a/src/coreclr/src/inc/corcompile.h b/src/coreclr/src/inc/corcompile.h
index 38e837a4ad53..8226fba3d8f0 100644
--- a/src/coreclr/src/inc/corcompile.h
+++ b/src/coreclr/src/inc/corcompile.h
@@ -814,10 +814,6 @@ typedef enum
extern LPCWSTR CorCompileGetRuntimeDllName(CorCompileRuntimeDlls id);
-// Will always return a valid HMODULE for CLR_INFO, but will return NULL for NGEN_COMPILER_INFO
-// if the DLL has not yet been loaded (it does not try to cause a load).
-extern HMODULE CorCompileGetRuntimeDll(CorCompileRuntimeDlls id);
-
struct CORCOMPILE_RUNTIME_DLL_INFO
{
// This structure can only contain information not updated by authenticode signing. It is required
diff --git a/src/coreclr/src/inc/corpriv.h b/src/coreclr/src/inc/corpriv.h
index fb0b39924cc8..003386c4d177 100644
--- a/src/coreclr/src/inc/corpriv.h
+++ b/src/coreclr/src/inc/corpriv.h
@@ -382,21 +382,6 @@ struct CORCOMPILE_VERSION_INFO;
struct CORCOMPILE_DEPENDENCY;
typedef GUID CORCOMPILE_NGEN_SIGNATURE;
-
-//**********************************************************************
-// Internal versions of shim functions for use by the CLR.
-
-STDAPI GetCORSystemDirectoryInternaL(
- SString& pBuffer
- );
-
-//LONGPATH:TODO: Remove this once Desktop usage has been removed
-STDAPI GetCORSystemDirectoryInternal(
- __out_ecount_part_opt(cchBuffer, *pdwLength) LPWSTR pBuffer,
- DWORD cchBuffer,
- __out_opt DWORD* pdwLength
- );
-
#endif // _CORPRIV_H_
// EOF =======================================================================
diff --git a/src/coreclr/src/inc/longfilepathwrappers.h b/src/coreclr/src/inc/longfilepathwrappers.h
index 76aec1a86594..149cdcf4443a 100644
--- a/src/coreclr/src/inc/longfilepathwrappers.h
+++ b/src/coreclr/src/inc/longfilepathwrappers.h
@@ -106,7 +106,5 @@ DWORD WINAPI GetEnvironmentVariableWrapper(
_Out_opt_ SString& lpBuffer
);
-BOOL PAL_GetPALDirectoryWrapper(SString& pbuffer);
-
#endif //_WIN_PATH_APIS_WRAPPER_
diff --git a/src/coreclr/src/inc/readme.md b/src/coreclr/src/inc/readme.md
index e8f3405859e0..ee47be8e514e 100644
--- a/src/coreclr/src/inc/readme.md
+++ b/src/coreclr/src/inc/readme.md
@@ -4,9 +4,9 @@ This directory has a variety of .idl files (such as corprof.idl) that need a lit
the build rules would automatically convert the idls into corresponding .h/.c files and include them in compilations. On non-windows platforms we don't have an equivalent
for midl.exe which did that conversion so we work around the issue by doing:
-- Build on Windows as normal, which will generate files in artifacts\obj\Windows_NT.x64.Debug\src\inc\idls_out\
+- Build on Windows as normal, which will generate files in artifacts\obj\windows.x64.Debug\src\inc\idls_out\
- Copy any updated headers into src\pal\prebuilt\inc\
-- If needed, adjust any of the .cpp files in src\pal\prebuilt\idl\ by hand, using the corresponding artifacts\obj\Windows_NT.x64.Debug\src\inc\idls_out\*_i.c as a guide. Typically
+- If needed, adjust any of the .cpp files in src\pal\prebuilt\idl\ by hand, using the corresponding artifacts\obj\windows.x64.Debug\src\inc\idls_out\*_i.c as a guide. Typically
this is just adding MIDL_DEFINE_GUID(...) for any new classes/interfaces that have been added to the idl file.
Include these src changes with the remainder of your work when you submit a PR.
diff --git a/src/coreclr/src/inc/stresslog.h b/src/coreclr/src/inc/stresslog.h
index e162dae9bcea..4858f6fd02b8 100644
--- a/src/coreclr/src/inc/stresslog.h
+++ b/src/coreclr/src/inc/stresslog.h
@@ -263,7 +263,7 @@ class ThreadStressLog;
class StressLog {
public:
static void Initialize(unsigned facilities, unsigned level, unsigned maxBytesPerThread,
- unsigned maxBytesTotal, HMODULE hMod);
+ unsigned maxBytesTotal, void* moduleBase);
static void Terminate(BOOL fProcessDetach=FALSE);
static void ThreadDetach(); // call at DllMain THREAD_DETACH if you want to recycle thread logs
static int NewChunk ()
diff --git a/src/coreclr/src/inc/utilcode.h b/src/coreclr/src/inc/utilcode.h
index 56bbd0dd2bac..84a7b89b69a7 100644
--- a/src/coreclr/src/inc/utilcode.h
+++ b/src/coreclr/src/inc/utilcode.h
@@ -4707,19 +4707,7 @@ FORCEINLINE void HolderSysFreeString(BSTR str) { CONTRACT_VIOLATION(ThrowsViolat
typedef Wrapper BSTRHolder;
-// HMODULE_TGT represents a handle to a module in the target process. In non-DAC builds this is identical
-// to HMODULE (HINSTANCE), which is the base address of the module. In DAC builds this must be a target address,
-// and so is represented by TADDR.
-
-#ifdef DACCESS_COMPILE
-typedef TADDR HMODULE_TGT;
-#else
-typedef HMODULE HMODULE_TGT;
-#endif
-
-BOOL IsIPInModule(HMODULE_TGT hModule, PCODE ip);
-
-extern HINSTANCE g_hmodCoreCLR;
+BOOL IsIPInModule(PTR_VOID pModuleBaseAddress, PCODE ip);
namespace UtilCode
{
@@ -4906,9 +4894,9 @@ inline T* InterlockedCompareExchangeT(
#undef InterlockedCompareExchangePointer
#define InterlockedCompareExchangePointer Use_InterlockedCompareExchangeT
-// Returns the directory for HMODULE. So, if HMODULE was for "C:\Dir1\Dir2\Filename.DLL",
+// Returns the directory for clr module. So, if path was for "C:\Dir1\Dir2\Filename.DLL",
// then this would return "C:\Dir1\Dir2\" (note the trailing backslash).
-HRESULT GetHModuleDirectory(HMODULE hMod, SString& wszPath);
+HRESULT GetClrModuleDirectory(SString& wszPath);
HRESULT CopySystemDirectory(const SString& pPathString, SString& pbuffer);
HMODULE LoadLocalizedResourceDLLForSDK(_In_z_ LPCWSTR wzResourceDllName, _In_opt_z_ LPCWSTR modulePath=NULL, bool trySelf=true);
diff --git a/src/coreclr/src/jit/assertionprop.cpp b/src/coreclr/src/jit/assertionprop.cpp
index de6439fc0d8d..135bc1e5083f 100644
--- a/src/coreclr/src/jit/assertionprop.cpp
+++ b/src/coreclr/src/jit/assertionprop.cpp
@@ -3203,18 +3203,175 @@ GenTree* Compiler::optAssertionProp_RelOp(ASSERT_VALARG_TP assertions, GenTree*
return optAssertionPropLocal_RelOp(assertions, tree, stmt);
}
-/*************************************************************************************
- *
- * Given the set of "assertions" to look up a relop assertion about the relop "tree",
- * perform Value numbering based relop assertion propagation on the tree.
- *
- */
+//------------------------------------------------------------------------
+// optAssertionProp: try and optimize a relop via assertion propagation
+// (and dominator based redundant branch elimination)
+//
+// Arguments:
+// assertions - set of live assertions
+// tree - tree to possibly optimize
+// stmt - statement containing the tree
+//
+// Returns:
+// The modified tree, or nullptr if no assertion prop took place.
+//
+// Notes:
+// Redundant branch elimination doesn't rely on assertions currently,
+// it is done here out of convenience.
+//
GenTree* Compiler::optAssertionPropGlobal_RelOp(ASSERT_VALARG_TP assertions, GenTree* tree, Statement* stmt)
{
GenTree* newTree = tree;
GenTree* op1 = tree->AsOp()->gtOp1;
GenTree* op2 = tree->AsOp()->gtOp2;
+ // First, walk up the dom tree and see if any dominating block has branched on
+ // exactly this tree's VN...
+ //
+ BasicBlock* prevBlock = compCurBB;
+ BasicBlock* domBlock = compCurBB->bbIDom;
+ int relopValue = -1;
+
+ while (domBlock != nullptr)
+ {
+ if (prevBlock == compCurBB)
+ {
+ JITDUMP("\nVN relop, checking " FMT_BB " for redundancy\n", compCurBB->bbNum);
+ }
+
+ // Check the current dominator
+ //
+ JITDUMP(" ... checking dom " FMT_BB "\n", domBlock->bbNum);
+
+ if (domBlock->bbJumpKind == BBJ_COND)
+ {
+ Statement* const domJumpStmt = domBlock->lastStmt();
+ GenTree* const domJumpTree = domJumpStmt->GetRootNode();
+ assert(domJumpTree->OperIs(GT_JTRUE));
+ GenTree* const domCmpTree = domJumpTree->AsOp()->gtGetOp1();
+
+ if (domCmpTree->OperKind() & GTK_RELOP)
+ {
+ ValueNum domCmpVN = domCmpTree->GetVN(VNK_Conservative);
+
+ // Note we could also infer the tree relop's value from similar relops higher in the dom tree.
+ // For example, (x >= 0) dominating (x > 0), or (x < 0) dominating (x > 0).
+ //
+ // That is left as a future enhancement.
+ //
+ if (domCmpVN == tree->GetVN(VNK_Conservative))
+ {
+ // Thes compare in "tree" is redundant.
+ // Is there a unique path from the dominating compare?
+ JITDUMP(" Redundant compare; current relop:\n");
+ DISPTREE(tree);
+ JITDUMP(" dominating relop in " FMT_BB " with same VN:\n", domBlock->bbNum);
+ DISPTREE(domCmpTree);
+
+ BasicBlock* trueSuccessor = domBlock->bbJumpDest;
+ BasicBlock* falseSuccessor = domBlock->bbNext;
+
+ const bool trueReaches = fgReachable(trueSuccessor, compCurBB);
+ const bool falseReaches = fgReachable(falseSuccessor, compCurBB);
+
+ if (trueReaches && falseReaches)
+ {
+ // Both dominating compare outcomes reach the current block so we can't infer the
+ // value of the relop.
+ //
+ // If the dominating compare is close to the current compare, this may be a missed
+ // opportunity to tail duplicate.
+ //
+ JITDUMP("Both successors of " FMT_BB " reach, can't optimize\n", domBlock->bbNum);
+
+ if ((trueSuccessor->GetUniqueSucc() == compCurBB) ||
+ (falseSuccessor->GetUniqueSucc() == compCurBB))
+ {
+ JITDUMP("Perhaps we should have tail duplicated " FMT_BB "\n", compCurBB->bbNum);
+ }
+ }
+ else if (trueReaches)
+ {
+ // Taken jump in dominator reaches, fall through doesn't; relop must be true.
+ //
+ JITDUMP("Jump successor " FMT_BB " of " FMT_BB " reaches, relop must be true\n",
+ domBlock->bbJumpDest->bbNum, domBlock->bbNum);
+ relopValue = 1;
+ break;
+ }
+ else if (falseReaches)
+ {
+ // Fall through from dominator reaches, taken jump doesn't; relop must be false.
+ //
+ JITDUMP("Fall through successor " FMT_BB " of " FMT_BB " reaches, relop must be false\n",
+ domBlock->bbNext->bbNum, domBlock->bbNum);
+ relopValue = 0;
+ break;
+ }
+ else
+ {
+ // No apparent path from the dominating BB.
+ //
+ // If domBlock or compCurBB is in an EH handler we may fail to find a path.
+ // Just ignore those cases.
+ //
+ // No point in looking further up the tree.
+ //
+ break;
+ }
+ }
+ }
+ }
+
+ // Keep looking higher up in the tree
+ //
+ prevBlock = domBlock;
+ domBlock = domBlock->bbIDom;
+ }
+
+ // Did we determine the relop value via dominance checks? If so, optimize.
+ //
+ if (relopValue == -1)
+ {
+ JITDUMP("Failed to find a suitable dominating compare, so we won't optimize\n");
+ }
+ else
+ {
+ // Bail out if tree is has certain side effects
+ //
+ // Note we really shouldn't get here if the tree has non-exception effects,
+ // as they should have impacted the value number.
+ //
+ if ((tree->gtFlags & GTF_SIDE_EFFECT) != 0)
+ {
+ // Bail if there is a non-exception effect.
+ //
+ if ((tree->gtFlags & GTF_SIDE_EFFECT) != GTF_EXCEPT)
+ {
+ JITDUMP("Current relop has non-exception side effects, so we won't optimize\n");
+ return nullptr;
+ }
+
+ // Be conservative if there is an exception effect and we're in an EH region
+ // as we might not model the full extent of EH flow.
+ //
+ if (compCurBB->hasTryIndex())
+ {
+ JITDUMP("Current relop has exception side effect and is in a try, so we won't optimize\n");
+ return nullptr;
+ }
+ }
+
+ JITDUMP("\nVN relop based redundant branch opt in " FMT_BB ":\n", compCurBB->bbNum);
+
+ tree->ChangeOperConst(GT_CNS_INT);
+ tree->AsIntCon()->gtIconVal = relopValue;
+
+ newTree = fgMorphTree(tree);
+ DISPTREE(newTree);
+ return optAssertionProp_Update(newTree, tree, stmt);
+ }
+
// Look for assertions of the form (tree EQ/NE 0)
AssertionIndex index = optGlobalAssertionIsEqualOrNotEqualZero(assertions, tree);
diff --git a/src/coreclr/src/jit/compiler.cpp b/src/coreclr/src/jit/compiler.cpp
index 0c6ef1ddd1a7..89da77e1653f 100644
--- a/src/coreclr/src/jit/compiler.cpp
+++ b/src/coreclr/src/jit/compiler.cpp
@@ -5508,6 +5508,12 @@ int Compiler::compCompile(CORINFO_MODULE_HANDLE classPtr,
}
#if defined(DEBUG) || defined(INLINE_DATA)
+//------------------------------------------------------------------------
+// compMethodHash: get hash code for currently jitted method
+//
+// Returns:
+// Hash based on method's full name
+//
unsigned Compiler::Info::compMethodHash() const
{
if (compMethodHashPrivate == 0)
@@ -5521,6 +5527,42 @@ unsigned Compiler::Info::compMethodHash() const
}
return compMethodHashPrivate;
}
+
+//------------------------------------------------------------------------
+// compMethodHash: get hash code for specified method
+//
+// Arguments:
+// methodHnd - method of interest
+//
+// Returns:
+// Hash based on method's full name
+//
+unsigned Compiler::compMethodHash(CORINFO_METHOD_HANDLE methodHnd)
+{
+ // If this is the root method, delegate to the caching version
+ //
+ if (methodHnd == info.compMethodHnd)
+ {
+ return info.compMethodHash();
+ }
+
+ // Else compute from scratch. Might consider caching this too.
+ //
+ unsigned methodHash = 0;
+ const char* calleeName = eeGetMethodFullName(methodHnd);
+
+ if (calleeName != nullptr)
+ {
+ methodHash = HashStringA(calleeName);
+ }
+ else
+ {
+ methodHash = info.compCompHnd->getMethodHash(methodHnd);
+ }
+
+ return methodHash;
+}
+
#endif // defined(DEBUG) || defined(INLINE_DATA)
void Compiler::compCompileFinish()
diff --git a/src/coreclr/src/jit/compiler.h b/src/coreclr/src/jit/compiler.h
index 05743b159c28..0770b2821a4d 100644
--- a/src/coreclr/src/jit/compiler.h
+++ b/src/coreclr/src/jit/compiler.h
@@ -3094,8 +3094,8 @@ class Compiler
void gtDispClassLayout(ClassLayout* layout, var_types type);
void gtDispStmt(Statement* stmt, const char* msg = nullptr);
void gtDispBlockStmts(BasicBlock* block);
- void gtGetArgMsg(GenTreeCall* call, GenTree* arg, unsigned argNum, int listCount, char* bufp, unsigned bufLength);
- void gtGetLateArgMsg(GenTreeCall* call, GenTree* arg, int argNum, int listCount, char* bufp, unsigned bufLength);
+ void gtGetArgMsg(GenTreeCall* call, GenTree* arg, unsigned argNum, char* bufp, unsigned bufLength);
+ void gtGetLateArgMsg(GenTreeCall* call, GenTree* arg, int argNum, char* bufp, unsigned bufLength);
void gtDispArgList(GenTreeCall* call, IndentStack* indentStack);
void gtDispFieldSeq(FieldSeqNode* pfsn);
@@ -4121,6 +4121,8 @@ class Compiler
GenTreeCall::Use* impPopCallArgs(unsigned count, CORINFO_SIG_INFO* sig, GenTreeCall::Use* prefixArgs = nullptr);
+ bool impCheckImplicitArgumentCoercion(var_types sigType, var_types nodeType) const;
+
GenTreeCall::Use* impPopReverseCallArgs(unsigned count, CORINFO_SIG_INFO* sig, unsigned skipReverseCount = 0);
/*
@@ -7370,6 +7372,7 @@ class Compiler
const char* eeGetMethodName(CORINFO_METHOD_HANDLE hnd, const char** className);
const char* eeGetMethodFullName(CORINFO_METHOD_HANDLE hnd);
+ unsigned compMethodHash(CORINFO_METHOD_HANDLE methodHandle);
bool eeIsNativeMethod(CORINFO_METHOD_HANDLE method);
CORINFO_METHOD_HANDLE eeGetMethodHandleForNative(CORINFO_METHOD_HANDLE method);
diff --git a/src/coreclr/src/jit/compiler.hpp b/src/coreclr/src/jit/compiler.hpp
index ebb55a7ebdf3..c9bd49172442 100644
--- a/src/coreclr/src/jit/compiler.hpp
+++ b/src/coreclr/src/jit/compiler.hpp
@@ -1301,6 +1301,7 @@ inline GenTree* Compiler::gtNewIndir(var_types typ, GenTree* addr)
inline GenTree* Compiler::gtNewNullCheck(GenTree* addr, BasicBlock* basicBlock)
{
+ assert(fgAddrCouldBeNull(addr));
GenTree* nullCheck = gtNewOperNode(GT_NULLCHECK, TYP_BYTE, addr);
nullCheck->gtFlags |= GTF_EXCEPT;
basicBlock->bbFlags |= BBF_HAS_NULLCHECK;
diff --git a/src/coreclr/src/jit/dllmain.cpp b/src/coreclr/src/jit/dllmain.cpp
index 7fcf274e5b64..fcc829f054a8 100644
--- a/src/coreclr/src/jit/dllmain.cpp
+++ b/src/coreclr/src/jit/dllmain.cpp
@@ -14,14 +14,11 @@
extern void jitShutdown(bool processIsTerminating);
-HINSTANCE g_hInst = nullptr;
-
/*****************************************************************************/
extern "C" DLLEXPORT BOOL WINAPI DllMain(HANDLE hInstance, DWORD dwReason, LPVOID pvReserved)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
- g_hInst = (HINSTANCE)hInstance;
DisableThreadLibraryCalls((HINSTANCE)hInstance);
}
else if (dwReason == DLL_PROCESS_DETACH)
@@ -34,8 +31,3 @@ extern "C" DLLEXPORT BOOL WINAPI DllMain(HANDLE hInstance, DWORD dwReason, LPVOI
return TRUE;
}
-
-HINSTANCE GetModuleInst()
-{
- return (g_hInst);
-}
diff --git a/src/coreclr/src/jit/flowgraph.cpp b/src/coreclr/src/jit/flowgraph.cpp
index ee8bee39cd56..8ee9e69ac5c8 100644
--- a/src/coreclr/src/jit/flowgraph.cpp
+++ b/src/coreclr/src/jit/flowgraph.cpp
@@ -122,6 +122,9 @@ void Compiler::fgInit()
/* This global flag is set whenever we add a throw block for a RngChk */
fgRngChkThrowAdded = false; /* reset flag for fgIsCodeAdded() */
+ /* Keep track of whether or not EH statements have been optimized */
+ fgOptimizedFinally = false;
+
/* We will record a list of all BBJ_RETURN blocks here */
fgReturnBlocks = nullptr;
@@ -23773,7 +23776,7 @@ Statement* Compiler::fgInlinePrependStatements(InlineInfo* inlineInfo)
GenTree* thisOp = impInlineFetchArg(0, inlArgInfo, lclVarInfo);
if (fgAddrCouldBeNull(thisOp))
{
- nullcheck = gtNewNullCheck(impInlineFetchArg(0, inlArgInfo, lclVarInfo), block);
+ nullcheck = gtNewNullCheck(thisOp, block);
// The NULL-check statement will be inserted to the statement list after those statements
// that assign arguments to temps and before the actual body of the inlinee method.
}
@@ -25436,6 +25439,7 @@ PhaseStatus Compiler::fgCloneFinally()
if (cloneCount > 0)
{
JITDUMP("fgCloneFinally() cloned %u finally handlers\n", cloneCount);
+ fgOptimizedFinally = true;
#ifdef DEBUG
if (verbose)
diff --git a/src/coreclr/src/jit/gentree.cpp b/src/coreclr/src/jit/gentree.cpp
index ef83a02a0536..e2ae7339c6d5 100644
--- a/src/coreclr/src/jit/gentree.cpp
+++ b/src/coreclr/src/jit/gentree.cpp
@@ -11854,7 +11854,7 @@ void Compiler::gtDispTree(GenTree* tree,
for (GenTreeCall::Use& use : call->LateArgs())
{
IndentInfo arcType = (use.GetNext() == nullptr) ? IIArcBottom : IIArc;
- gtGetLateArgMsg(call, use.GetNode(), lateArgIndex, -1, bufp, sizeof(buf));
+ gtGetLateArgMsg(call, use.GetNode(), lateArgIndex, bufp, sizeof(buf));
gtDispChild(use.GetNode(), indentStack, arcType, bufp, topOnly);
lateArgIndex++;
}
@@ -11953,8 +11953,6 @@ void Compiler::gtDispTree(GenTree* tree,
// call - The call for which 'arg' is an argument
// arg - The argument for which a message should be constructed
// argNum - The ordinal number of the arg in the argument list
-// listCount - When printing in LIR form this is the count for a GT_FIELD_LIST
-// or -1 if we are not printing in LIR form
// bufp - A pointer to the buffer into which the message is written
// bufLength - The length of the buffer pointed to by bufp
//
@@ -11965,8 +11963,7 @@ void Compiler::gtDispTree(GenTree* tree,
// 'call' must be a call node
// 'arg' must be an argument to 'call' (else gtArgEntryByNode will assert)
-void Compiler::gtGetArgMsg(
- GenTreeCall* call, GenTree* arg, unsigned argNum, int listCount, char* bufp, unsigned bufLength)
+void Compiler::gtGetArgMsg(GenTreeCall* call, GenTree* arg, unsigned argNum, char* bufp, unsigned bufLength)
{
if (call->gtCallLateArgs != nullptr)
{
@@ -11983,77 +11980,36 @@ void Compiler::gtGetArgMsg(
if (curArgTabEntry->IsSplit())
{
regNumber firstReg = curArgTabEntry->GetRegNum();
- if (listCount == -1)
+ if (curArgTabEntry->numRegs == 1)
{
- if (curArgTabEntry->numRegs == 1)
- {
- sprintf_s(bufp, bufLength, "arg%d %s out+%02x%c", argNum, compRegVarName(firstReg),
- (curArgTabEntry->slotNum) * TARGET_POINTER_SIZE, 0);
- }
- else
- {
- regNumber lastReg = REG_STK;
- char separator = (curArgTabEntry->numRegs == 2) ? ',' : '-';
- if (curArgTabEntry->IsHfaRegArg())
- {
- unsigned lastRegNum = genMapFloatRegNumToRegArgNum(firstReg) + curArgTabEntry->numRegs - 1;
- lastReg = genMapFloatRegArgNumToRegNum(lastRegNum);
- }
- else
- {
- unsigned lastRegNum = genMapIntRegNumToRegArgNum(firstReg) + curArgTabEntry->numRegs - 1;
- lastReg = genMapIntRegArgNumToRegNum(lastRegNum);
- }
- sprintf_s(bufp, bufLength, "arg%d %s%c%s out+%02x%c", argNum, compRegVarName(firstReg),
- separator, compRegVarName(lastReg), (curArgTabEntry->slotNum) * TARGET_POINTER_SIZE,
- 0);
- }
+ sprintf_s(bufp, bufLength, "arg%d %s out+%02x%c", argNum, compRegVarName(firstReg),
+ (curArgTabEntry->slotNum) * TARGET_POINTER_SIZE, 0);
}
else
{
- unsigned curArgNum = BAD_VAR_NUM;
- bool isFloat = curArgTabEntry->IsHfaRegArg();
- if (isFloat)
- {
- curArgNum = genMapFloatRegNumToRegArgNum(firstReg) + listCount;
- }
- else
- {
- curArgNum = genMapIntRegNumToRegArgNum(firstReg) + listCount;
- }
-
- if (!isFloat && curArgNum < MAX_REG_ARG)
- {
- regNumber curReg = genMapIntRegArgNumToRegNum(curArgNum);
- sprintf_s(bufp, bufLength, "arg%d m%d %s%c", argNum, listCount, compRegVarName(curReg), 0);
- }
- else if (isFloat && curArgNum < MAX_FLOAT_REG_ARG)
+ regNumber lastReg = REG_STK;
+ char separator = (curArgTabEntry->numRegs == 2) ? ',' : '-';
+ if (curArgTabEntry->IsHfaRegArg())
{
- regNumber curReg = genMapFloatRegArgNumToRegNum(curArgNum);
- sprintf_s(bufp, bufLength, "arg%d m%d %s%c", argNum, listCount, compRegVarName(curReg), 0);
+ unsigned lastRegNum = genMapFloatRegNumToRegArgNum(firstReg) + curArgTabEntry->numRegs - 1;
+ lastReg = genMapFloatRegArgNumToRegNum(lastRegNum);
}
else
{
- unsigned stackSlot = listCount - curArgTabEntry->numRegs;
- sprintf_s(bufp, bufLength, "arg%d m%d out+%02x%c", argNum, listCount,
- stackSlot * TARGET_POINTER_SIZE, 0);
+ unsigned lastRegNum = genMapIntRegNumToRegArgNum(firstReg) + curArgTabEntry->numRegs - 1;
+ lastReg = genMapIntRegArgNumToRegNum(lastRegNum);
}
+ sprintf_s(bufp, bufLength, "arg%d %s%c%s out+%02x%c", argNum, compRegVarName(firstReg), separator,
+ compRegVarName(lastReg), (curArgTabEntry->slotNum) * TARGET_POINTER_SIZE, 0);
}
+
return;
}
#endif // TARGET_ARM
#if FEATURE_FIXED_OUT_ARGS
- if (listCount == -1)
- {
- sprintf_s(bufp, bufLength, "arg%d out+%02x%c", argNum, curArgTabEntry->slotNum * TARGET_POINTER_SIZE,
- 0);
- }
- else // listCount is 0,1,2 or 3
- {
- assert(listCount <= MAX_ARG_REG_COUNT);
- sprintf_s(bufp, bufLength, "arg%d out+%02x%c", argNum,
- (curArgTabEntry->slotNum + listCount) * TARGET_POINTER_SIZE, 0);
- }
+
+ sprintf_s(bufp, bufLength, "arg%d out+%02x%c", argNum, curArgTabEntry->slotNum * TARGET_POINTER_SIZE, 0);
+
#else
sprintf_s(bufp, bufLength, "arg%d on STK%c", argNum, 0);
#endif
@@ -12072,8 +12028,6 @@ void Compiler::gtGetArgMsg(
// call - The call for which 'arg' is an argument
// argx - The argument for which a message should be constructed
// lateArgIndex - The ordinal number of the arg in the lastArg list
-// listCount - When printing in LIR form this is the count for a multireg GT_FIELD_LIST
-// or -1 if we are not printing in LIR form
// bufp - A pointer to the buffer into which the message is written
// bufLength - The length of the buffer pointed to by bufp
//
@@ -12084,8 +12038,7 @@ void Compiler::gtGetArgMsg(
// 'call' must be a call node
// 'arg' must be an argument to 'call' (else gtArgEntryByNode will assert)
-void Compiler::gtGetLateArgMsg(
- GenTreeCall* call, GenTree* argx, int lateArgIndex, int listCount, char* bufp, unsigned bufLength)
+void Compiler::gtGetLateArgMsg(GenTreeCall* call, GenTree* argx, int lateArgIndex, char* bufp, unsigned bufLength)
{
assert(!argx->IsArgPlaceHolderNode()); // No place holders nodes are in gtCallLateArgs;
@@ -12114,60 +12067,27 @@ void Compiler::gtGetLateArgMsg(
{
regNumber firstReg = curArgTabEntry->GetRegNum();
unsigned argNum = curArgTabEntry->argNum;
- if (listCount == -1)
+ if (curArgTabEntry->numRegs == 1)
{
- if (curArgTabEntry->numRegs == 1)
- {
- sprintf_s(bufp, bufLength, "arg%d %s out+%02x%c", argNum, compRegVarName(firstReg),
- (curArgTabEntry->slotNum) * TARGET_POINTER_SIZE, 0);
- }
- else
- {
- regNumber lastReg = REG_STK;
- char separator = (curArgTabEntry->numRegs == 2) ? ',' : '-';
- if (curArgTabEntry->IsHfaRegArg())
- {
- unsigned lastRegNum = genMapFloatRegNumToRegArgNum(firstReg) + curArgTabEntry->numRegs - 1;
- lastReg = genMapFloatRegArgNumToRegNum(lastRegNum);
- }
- else
- {
- unsigned lastRegNum = genMapIntRegNumToRegArgNum(firstReg) + curArgTabEntry->numRegs - 1;
- lastReg = genMapIntRegArgNumToRegNum(lastRegNum);
- }
- sprintf_s(bufp, bufLength, "arg%d %s%c%s out+%02x%c", argNum, compRegVarName(firstReg), separator,
- compRegVarName(lastReg), (curArgTabEntry->slotNum) * TARGET_POINTER_SIZE, 0);
- }
+ sprintf_s(bufp, bufLength, "arg%d %s out+%02x%c", argNum, compRegVarName(firstReg),
+ (curArgTabEntry->slotNum) * TARGET_POINTER_SIZE, 0);
}
else
{
- unsigned curArgNum = BAD_VAR_NUM;
- bool isFloat = curArgTabEntry->IsHfaRegArg();
- if (isFloat)
+ regNumber lastReg = REG_STK;
+ char separator = (curArgTabEntry->numRegs == 2) ? ',' : '-';
+ if (curArgTabEntry->IsHfaRegArg())
{
- curArgNum = genMapFloatRegNumToRegArgNum(firstReg) + listCount;
+ unsigned lastRegNum = genMapFloatRegNumToRegArgNum(firstReg) + curArgTabEntry->numRegs - 1;
+ lastReg = genMapFloatRegArgNumToRegNum(lastRegNum);
}
else
{
- curArgNum = genMapIntRegNumToRegArgNum(firstReg) + listCount;
- }
-
- if (!isFloat && curArgNum < MAX_REG_ARG)
- {
- regNumber curReg = genMapIntRegArgNumToRegNum(curArgNum);
- sprintf_s(bufp, bufLength, "arg%d m%d %s%c", argNum, listCount, compRegVarName(curReg), 0);
- }
- else if (isFloat && curArgNum < MAX_FLOAT_REG_ARG)
- {
- regNumber curReg = genMapFloatRegArgNumToRegNum(curArgNum);
- sprintf_s(bufp, bufLength, "arg%d m%d %s%c", argNum, listCount, compRegVarName(curReg), 0);
- }
- else
- {
- unsigned stackSlot = listCount - curArgTabEntry->numRegs;
- sprintf_s(bufp, bufLength, "arg%d m%d out+%02x%c", argNum, listCount,
- stackSlot * TARGET_POINTER_SIZE, 0);
+ unsigned lastRegNum = genMapIntRegNumToRegArgNum(firstReg) + curArgTabEntry->numRegs - 1;
+ lastReg = genMapIntRegArgNumToRegNum(lastRegNum);
}
+ sprintf_s(bufp, bufLength, "arg%d %s%c%s out+%02x%c", argNum, compRegVarName(firstReg), separator,
+ compRegVarName(lastReg), (curArgTabEntry->slotNum) * TARGET_POINTER_SIZE, 0);
}
return;
}
@@ -12177,8 +12097,6 @@ void Compiler::gtGetLateArgMsg(
#if FEATURE_MULTIREG_ARGS
if (curArgTabEntry->numRegs >= 2)
{
- // listCount could be -1 but it is signed, so this comparison is OK.
- assert(listCount <= MAX_ARG_REG_COUNT);
char separator = (curArgTabEntry->numRegs == 2) ? ',' : '-';
sprintf_s(bufp, bufLength, "arg%d %s%c%s%c", curArgTabEntry->argNum, compRegVarName(argReg), separator,
compRegVarName(curArgTabEntry->GetRegNum(curArgTabEntry->numRegs - 1)), 0);
@@ -12220,7 +12138,7 @@ void Compiler::gtDispArgList(GenTreeCall* call, IndentStack* indentStack)
if (!argNode->IsNothingNode() && !argNode->IsArgPlaceHolderNode())
{
char buf[256];
- gtGetArgMsg(call, argNode, argnum, -1, buf, sizeof(buf));
+ gtGetArgMsg(call, argNode, argnum, buf, sizeof(buf));
gtDispChild(argNode, indentStack, (argNode == lastArgNode) ? IIArcBottom : IIArc, buf, false);
}
argnum++;
@@ -12393,40 +12311,18 @@ void Compiler::gtDispLIRNode(GenTree* node, const char* prefixMsg /* = nullptr *
{
fgArgTabEntry* curArgTabEntry = gtArgEntryByNode(call, operand);
assert(curArgTabEntry);
+ assert(operand->OperGet() != GT_LIST);
- if (operand->OperGet() == GT_LIST)
+ if (!curArgTabEntry->isLateArg())
{
- int listIndex = 0;
- for (GenTreeArgList* element = operand->AsArgList(); element != nullptr; element = element->Rest())
- {
- operand = element->Current();
- if (curArgTabEntry->GetLateArgInx() == (unsigned)-1)
- {
- gtGetArgMsg(call, operand, curArgTabEntry->argNum, listIndex, buf, sizeof(buf));
- }
- else
- {
- gtGetLateArgMsg(call, operand, curArgTabEntry->GetLateArgInx(), listIndex, buf,
- sizeof(buf));
- }
-
- displayOperand(operand, buf, operandArc, indentStack, prefixIndent);
- operandArc = IIArc;
- }
+ gtGetArgMsg(call, operand, curArgTabEntry->argNum, buf, sizeof(buf));
}
else
{
- if (!curArgTabEntry->isLateArg())
- {
- gtGetArgMsg(call, operand, curArgTabEntry->argNum, -1, buf, sizeof(buf));
- }
- else
- {
- gtGetLateArgMsg(call, operand, curArgTabEntry->GetLateArgInx(), -1, buf, sizeof(buf));
- }
-
- displayOperand(operand, buf, operandArc, indentStack, prefixIndent);
+ gtGetLateArgMsg(call, operand, curArgTabEntry->GetLateArgInx(), buf, sizeof(buf));
}
+
+ displayOperand(operand, buf, operandArc, indentStack, prefixIndent);
}
}
else if (node->OperIsDynBlkOp())
diff --git a/src/coreclr/src/jit/importer.cpp b/src/coreclr/src/jit/importer.cpp
index c408667db7c6..d5b909d4002b 100644
--- a/src/coreclr/src/jit/importer.cpp
+++ b/src/coreclr/src/jit/importer.cpp
@@ -946,20 +946,27 @@ GenTreeCall::Use* Compiler::impPopCallArgs(unsigned count, CORINFO_SIG_INFO* sig
CorInfoType corType = strip(info.compCompHnd->getArgType(sig, argLst, &argClass));
+ var_types jitSigType = JITtype2varType(corType);
+
+ if (!impCheckImplicitArgumentCoercion(jitSigType, arg->GetNode()->TypeGet()))
+ {
+ BADCODE("the call argument has a type that can't be implicitly converted to the signature type");
+ }
+
// insert implied casts (from float to double or double to float)
- if ((corType == CORINFO_TYPE_DOUBLE) && (arg->GetNode()->TypeGet() == TYP_FLOAT))
+ if ((jitSigType == TYP_DOUBLE) && (arg->GetNode()->TypeGet() == TYP_FLOAT))
{
arg->SetNode(gtNewCastNode(TYP_DOUBLE, arg->GetNode(), false, TYP_DOUBLE));
}
- else if ((corType == CORINFO_TYPE_FLOAT) && (arg->GetNode()->TypeGet() == TYP_DOUBLE))
+ else if ((jitSigType == TYP_FLOAT) && (arg->GetNode()->TypeGet() == TYP_DOUBLE))
{
arg->SetNode(gtNewCastNode(TYP_FLOAT, arg->GetNode(), false, TYP_FLOAT));
}
// insert any widening or narrowing casts for backwards compatibility
- arg->SetNode(impImplicitIorI4Cast(arg->GetNode(), JITtype2varType(corType)));
+ arg->SetNode(impImplicitIorI4Cast(arg->GetNode(), jitSigType));
if (corType != CORINFO_TYPE_CLASS && corType != CORINFO_TYPE_BYREF && corType != CORINFO_TYPE_PTR &&
corType != CORINFO_TYPE_VAR && (argRealClass = info.compCompHnd->getArgClass(sig, argLst)) != nullptr)
@@ -993,6 +1000,111 @@ GenTreeCall::Use* Compiler::impPopCallArgs(unsigned count, CORINFO_SIG_INFO* sig
return argList;
}
+static bool TypeIs(var_types type1, var_types type2)
+{
+ return type1 == type2;
+}
+
+// Check if type1 matches any type from the list.
+template
+static bool TypeIs(var_types type1, var_types type2, T... rest)
+{
+ return TypeIs(type1, type2) || TypeIs(type1, rest...);
+}
+
+//------------------------------------------------------------------------
+// impCheckImplicitArgumentCoercion: check that the node's type is compatible with
+// the signature's type using ECMA implicit argument coercion table.
+//
+// Arguments:
+// sigType - the type in the call signature;
+// nodeType - the node type.
+//
+// Return Value:
+// true if they are compatible, false otherwise.
+//
+// Notes:
+// - it is currently allowing byref->long passing, should be fixed in VM;
+// - it can't check long -> native int case on 64-bit platforms,
+// so the behavior is different depending on the target bitness.
+//
+bool Compiler::impCheckImplicitArgumentCoercion(var_types sigType, var_types nodeType) const
+{
+ if (sigType == nodeType)
+ {
+ return true;
+ }
+
+ if (TypeIs(sigType, TYP_BOOL, TYP_UBYTE, TYP_BYTE, TYP_USHORT, TYP_SHORT, TYP_UINT, TYP_INT))
+ {
+ if (TypeIs(nodeType, TYP_BOOL, TYP_UBYTE, TYP_BYTE, TYP_USHORT, TYP_SHORT, TYP_UINT, TYP_INT, TYP_I_IMPL))
+ {
+ return true;
+ }
+ }
+ else if (TypeIs(sigType, TYP_ULONG, TYP_LONG))
+ {
+ if (TypeIs(nodeType, TYP_LONG))
+ {
+ return true;
+ }
+ }
+ else if (TypeIs(sigType, TYP_FLOAT, TYP_DOUBLE))
+ {
+ if (TypeIs(nodeType, TYP_FLOAT, TYP_DOUBLE))
+ {
+ return true;
+ }
+ }
+ else if (TypeIs(sigType, TYP_BYREF))
+ {
+ if (TypeIs(nodeType, TYP_I_IMPL))
+ {
+ return true;
+ }
+
+ // This condition tolerates such IL:
+ // ; V00 this ref this class-hnd
+ // ldarg.0
+ // call(byref)
+ if (TypeIs(nodeType, TYP_REF))
+ {
+ return true;
+ }
+ }
+ else if (varTypeIsStruct(sigType))
+ {
+ if (varTypeIsStruct(nodeType))
+ {
+ return true;
+ }
+ }
+
+ // This condition should not be under `else` because `TYP_I_IMPL`
+ // intersects with `TYP_LONG` or `TYP_INT`.
+ if (TypeIs(sigType, TYP_I_IMPL, TYP_U_IMPL))
+ {
+ // Note that it allows `ldc.i8 1; call(nint)` on 64-bit platforms,
+ // but we can't distinguish `nint` from `long` there.
+ if (TypeIs(nodeType, TYP_I_IMPL, TYP_U_IMPL, TYP_INT, TYP_UINT))
+ {
+ return true;
+ }
+
+ // It tolerates IL that ECMA does not allow but that is commonly used.
+ // Example:
+ // V02 loc1 struct
+ // ldloca.s 0x2
+ // call(native int)
+ if (TypeIs(nodeType, TYP_BYREF))
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
+
/*****************************************************************************
*
* Pop the given number of values from the stack in reverse order (STDCALL/CDECL etc.)
@@ -6175,8 +6287,12 @@ int Compiler::impBoxPatternMatch(CORINFO_RESOLVED_TOKEN* pResolvedToken, const B
if (((treeToBox->gtFlags & GTF_SIDE_EFFECT) == GTF_EXCEPT) &&
treeToBox->OperIs(GT_OBJ, GT_BLK, GT_IND))
{
- // Yes, we just need to perform a null check.
- treeToNullcheck = treeToBox->AsOp()->gtOp1;
+ // Yes, we just need to perform a null check if needed.
+ GenTree* const addr = treeToBox->AsOp()->gtGetOp1();
+ if (fgAddrCouldBeNull(addr))
+ {
+ treeToNullcheck = addr;
+ }
}
else
{
diff --git a/src/coreclr/src/jit/inline.cpp b/src/coreclr/src/jit/inline.cpp
index 759a6e366181..050214e188b2 100644
--- a/src/coreclr/src/jit/inline.cpp
+++ b/src/coreclr/src/jit/inline.cpp
@@ -495,9 +495,8 @@ void InlineContext::DumpXml(FILE* file, unsigned indent)
{
Compiler* compiler = m_InlineStrategy->GetCompiler();
- mdMethodDef calleeToken = compiler->info.compCompHnd->getMethodDefFromMethod(m_Callee);
- unsigned calleeHash = compiler->info.compCompHnd->getMethodHash(m_Callee);
-
+ mdMethodDef calleeToken = compiler->info.compCompHnd->getMethodDefFromMethod(m_Callee);
+ unsigned calleeHash = compiler->compMethodHash(m_Callee);
const char* inlineReason = InlGetObservationString(m_Observation);
int offset = -1;
diff --git a/src/coreclr/src/jit/inline.h b/src/coreclr/src/jit/inline.h
index 8302356c6e8f..b2c414d13705 100644
--- a/src/coreclr/src/jit/inline.h
+++ b/src/coreclr/src/jit/inline.h
@@ -239,6 +239,7 @@ class InlinePolicy
// Policy determinations
virtual void DetermineProfitability(CORINFO_METHOD_INFO* methodInfo) = 0;
+ virtual bool BudgetCheck() const = 0;
// Policy policies
virtual bool PropagateNeverToRuntime() const = 0;
diff --git a/src/coreclr/src/jit/inlinepolicy.cpp b/src/coreclr/src/jit/inlinepolicy.cpp
index cb113e646e82..487fbe688dd3 100644
--- a/src/coreclr/src/jit/inlinepolicy.cpp
+++ b/src/coreclr/src/jit/inlinepolicy.cpp
@@ -369,35 +369,13 @@ void DefaultPolicy::NoteBool(InlineObservation obs, bool value)
// "reestablishes" candidacy rather than alters
// candidacy ... so instead we bail out here.
//
- if (!m_IsPrejitRoot)
- {
- InlineStrategy* strategy = m_RootCompiler->m_inlineStrategy;
- const bool overBudget = strategy->BudgetCheck(m_CodeSize);
+ bool overBudget = this->BudgetCheck();
- if (overBudget)
- {
- // If the candidate is a forceinline and the callsite is
- // not too deep, allow the inline even if it goes over budget.
- //
- // For now, "not too deep" means a top-level inline. Note
- // depth 0 is used for the root method, so inline candidate depth
- // will be 1 or more.
- //
- assert(m_IsForceInlineKnown);
- assert(m_CallsiteDepth > 0);
- const bool allowOverBudget = m_IsForceInline && (m_CallsiteDepth == 1);
-
- if (allowOverBudget)
- {
- JITDUMP("Allowing over-budget top-level forceinline\n");
- }
- else
- {
- SetFailure(InlineObservation::CALLSITE_OVER_BUDGET);
- }
- }
+ if (overBudget)
+ {
+ SetFailure(InlineObservation::CALLSITE_OVER_BUDGET);
+ return;
}
-
break;
}
@@ -461,6 +439,53 @@ void DefaultPolicy::NoteBool(InlineObservation obs, bool value)
}
}
+//------------------------------------------------------------------------
+// BudgetCheck: see if this inline would exceed the current budget
+//
+// Returns:
+// True if inline would exceed the budget.
+//
+bool DefaultPolicy::BudgetCheck() const
+{
+ // Only relevant if we're actually inlining.
+ //
+ if (m_IsPrejitRoot)
+ {
+ return false;
+ }
+
+ // The strategy tracks the amout of inlining done so far,
+ // so it performs the actual check.
+ //
+ InlineStrategy* strategy = m_RootCompiler->m_inlineStrategy;
+ const bool overBudget = strategy->BudgetCheck(m_CodeSize);
+
+ if (overBudget)
+ {
+ // If the candidate is a forceinline and the callsite is
+ // not too deep, allow the inline even if it goes over budget.
+ //
+ // For now, "not too deep" means a top-level inline. Note
+ // depth 0 is used for the root method, so inline candidate depth
+ // will be 1 or more.
+ //
+ assert(m_IsForceInlineKnown);
+ assert(m_CallsiteDepth > 0);
+ const bool allowOverBudget = m_IsForceInline && (m_CallsiteDepth == 1);
+
+ if (allowOverBudget)
+ {
+ JITDUMP("Allowing over-budget top-level forceinline\n");
+ }
+ else
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
+
//------------------------------------------------------------------------
// NoteInt: handle an observed integer value
//
@@ -1012,15 +1037,11 @@ void RandomPolicy::DetermineProfitability(CORINFO_METHOD_INFO* methodInfo)
assert(m_Observation == InlineObservation::CALLEE_IS_DISCRETIONARY_INLINE);
// Budget check.
- if (!m_IsPrejitRoot)
+ const bool overBudget = this->BudgetCheck();
+ if (overBudget)
{
- InlineStrategy* strategy = m_RootCompiler->m_inlineStrategy;
- bool overBudget = strategy->BudgetCheck(m_CodeSize);
- if (overBudget)
- {
- SetFailure(InlineObservation::CALLSITE_OVER_BUDGET);
- return;
- }
+ SetFailure(InlineObservation::CALLSITE_OVER_BUDGET);
+ return;
}
// If we're also dumping inline data, make additional observations
@@ -2180,6 +2201,19 @@ FullPolicy::FullPolicy(Compiler* compiler, bool isPrejitRoot) : DiscretionaryPol
// Empty
}
+//------------------------------------------------------------------------
+// BudgetCheck: see if this inline would exceed the current budget
+//
+// Returns:
+// True if inline would exceed the budget.
+//
+bool FullPolicy::BudgetCheck() const
+{
+ // There are no budget restrictions for the full policy.
+ //
+ return false;
+}
+
//------------------------------------------------------------------------
// DetermineProfitability: determine if this inline is profitable
//
@@ -2482,7 +2516,7 @@ bool ReplayPolicy::FindContext(InlineContext* context)
//
// Token and Hash we're looking for.
mdMethodDef contextToken = m_RootCompiler->info.compCompHnd->getMethodDefFromMethod(context->GetCallee());
- unsigned contextHash = m_RootCompiler->info.compCompHnd->getMethodHash(context->GetCallee());
+ unsigned contextHash = m_RootCompiler->compMethodHash(context->GetCallee());
unsigned contextOffset = (unsigned)context->GetOffset();
return FindInline(contextToken, contextHash, contextOffset);
@@ -2666,7 +2700,7 @@ bool ReplayPolicy::FindInline(CORINFO_METHOD_HANDLE callee)
{
// Token and Hash we're looking for
mdMethodDef calleeToken = m_RootCompiler->info.compCompHnd->getMethodDefFromMethod(callee);
- unsigned calleeHash = m_RootCompiler->info.compCompHnd->getMethodHash(callee);
+ unsigned calleeHash = m_RootCompiler->compMethodHash(callee);
// Abstract this or just pass through raw bits
// See matching code in xml writer
diff --git a/src/coreclr/src/jit/inlinepolicy.h b/src/coreclr/src/jit/inlinepolicy.h
index 9024996521a3..7bd6557b2511 100644
--- a/src/coreclr/src/jit/inlinepolicy.h
+++ b/src/coreclr/src/jit/inlinepolicy.h
@@ -119,6 +119,7 @@ class DefaultPolicy : public LegalPolicy
// Policy determinations
void DetermineProfitability(CORINFO_METHOD_INFO* methodInfo) override;
+ bool BudgetCheck() const override;
// Policy policies
bool PropagateNeverToRuntime() const override;
@@ -350,6 +351,7 @@ class FullPolicy : public DiscretionaryPolicy
// Policy determinations
void DetermineProfitability(CORINFO_METHOD_INFO* methodInfo) override;
+ bool BudgetCheck() const override;
// Miscellaneous
const char* GetName() const override
diff --git a/src/coreclr/src/jit/lower.cpp b/src/coreclr/src/jit/lower.cpp
index 6494b9515626..d047083e763f 100644
--- a/src/coreclr/src/jit/lower.cpp
+++ b/src/coreclr/src/jit/lower.cpp
@@ -2549,7 +2549,7 @@ GenTree* Lowering::OptimizeConstCompare(GenTree* cmp)
// into ((x AND mask) NE|EQ 0) when mask is a single bit.
//
- if (isPow2(static_cast(op2Value)) && andOp2->IsIntegralConst(op2Value))
+ if (isPow2(static_cast(op2Value)) && andOp2->IsIntegralConst(op2Value))
{
op2Value = 0;
op2->SetIconValue(0);
diff --git a/src/coreclr/src/jit/lowerxarch.cpp b/src/coreclr/src/jit/lowerxarch.cpp
index 971424e64c96..8a02933bfc64 100644
--- a/src/coreclr/src/jit/lowerxarch.cpp
+++ b/src/coreclr/src/jit/lowerxarch.cpp
@@ -5464,9 +5464,30 @@ void Lowering::ContainCheckHWIntrinsic(GenTreeHWIntrinsic* node)
break;
}
+ case NI_SSE2_ShiftLeftLogical128BitLane:
+ case NI_SSE2_ShiftRightLogical128BitLane:
+ case NI_AVX2_ShiftLeftLogical128BitLane:
+ case NI_AVX2_ShiftRightLogical128BitLane:
+ {
+#if DEBUG
+ // These intrinsics should have been marked contained by the general-purpose handling
+ // earlier in the method.
+
+ GenTree* lastOp = HWIntrinsicInfo::lookupLastOp(node);
+ assert(lastOp != nullptr);
+
+ if (HWIntrinsicInfo::isImmOp(intrinsicId, lastOp) && lastOp->IsCnsIntOrI())
+ {
+ assert(lastOp->isContained());
+ }
+#endif
+
+ break;
+ }
+
default:
{
- assert("Unhandled containment for binary hardware intrinsic with immediate operand");
+ assert(!"Unhandled containment for binary hardware intrinsic with immediate operand");
break;
}
}
@@ -5643,7 +5664,7 @@ void Lowering::ContainCheckHWIntrinsic(GenTreeHWIntrinsic* node)
default:
{
- assert("Unhandled containment for ternary hardware intrinsic with immediate operand");
+ assert(!"Unhandled containment for ternary hardware intrinsic with immediate operand");
break;
}
}
diff --git a/src/coreclr/src/jit/morph.cpp b/src/coreclr/src/jit/morph.cpp
index d74e851be899..e172a9c21db5 100644
--- a/src/coreclr/src/jit/morph.cpp
+++ b/src/coreclr/src/jit/morph.cpp
@@ -13354,9 +13354,10 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac)
/* Check for "op1 - cns2" , we change it to "op1 + (-cns2)" */
noway_assert(op2);
- if (op2->IsCnsIntOrI())
+ if (op2->IsCnsIntOrI() && !op2->IsIconHandle())
{
- /* Negate the constant and change the node to be "+" */
+ // Negate the constant and change the node to be "+",
+ // except when `op2` is a const byref.
op2->AsIntConCommon()->SetIconValue(-op2->AsIntConCommon()->IconValue());
op2->AsIntConRef().gtFieldSeq = FieldSeqStore::NotAField();
@@ -13386,6 +13387,56 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac)
/* No match - exit */
}
+
+ // Skip optimization if non-NEG operand is constant.
+ // Both op1 and op2 are not constant because it was already checked above.
+ if (opts.OptimizationEnabled() && fgGlobalMorph &&
+ (((op1->gtFlags & GTF_EXCEPT) == 0) || ((op2->gtFlags & GTF_EXCEPT) == 0)))
+ {
+ // a - -b = > a + b
+ // SUB(a, (NEG(b)) => ADD(a, b)
+
+ if (!op1->OperIs(GT_NEG) && op2->OperIs(GT_NEG))
+ {
+ // tree: SUB
+ // op1: a
+ // op2: NEG
+ // op2Child: b
+
+ GenTree* op2Child = op2->AsOp()->gtOp1; // b
+ oper = GT_ADD;
+ tree->SetOper(oper, GenTree::PRESERVE_VN);
+ tree->AsOp()->gtOp2 = op2Child;
+
+ DEBUG_DESTROY_NODE(op2);
+
+ op2 = op2Child;
+ }
+
+ // -a - -b = > b - a
+ // SUB(NEG(a), (NEG(b)) => SUB(b, a)
+
+ if (op1->OperIs(GT_NEG) && op2->OperIs(GT_NEG))
+ {
+ // tree: SUB
+ // op1: NEG
+ // op1Child: a
+ // op2: NEG
+ // op2Child: b
+
+ GenTree* op1Child = op1->AsOp()->gtOp1; // a
+ GenTree* op2Child = op2->AsOp()->gtOp1; // b
+ tree->AsOp()->gtOp1 = op2Child;
+ tree->AsOp()->gtOp2 = op1Child;
+
+ DEBUG_DESTROY_NODE(op1);
+ DEBUG_DESTROY_NODE(op2);
+
+ op1 = op2Child;
+ op2 = op1Child;
+ }
+ }
+
break;
#ifdef TARGET_ARM64
@@ -13554,6 +13605,57 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac)
}
}
}
+
+ if (opts.OptimizationEnabled() && fgGlobalMorph &&
+ (((op1->gtFlags & GTF_EXCEPT) == 0) || ((op2->gtFlags & GTF_EXCEPT) == 0)))
+ {
+ // - a + b = > b - a
+ // ADD((NEG(a), b) => SUB(b, a)
+
+ // Skip optimization if non-NEG operand is constant.
+ if (op1->OperIs(GT_NEG) && !op2->OperIs(GT_NEG) &&
+ !(op2->IsCnsIntOrI() && varTypeIsIntegralOrI(typ)))
+ {
+ // tree: ADD
+ // op1: NEG
+ // op2: b
+ // op1Child: a
+
+ GenTree* op1Child = op1->AsOp()->gtOp1; // a
+ oper = GT_SUB;
+ tree->SetOper(oper, GenTree::PRESERVE_VN);
+ tree->AsOp()->gtOp1 = op2;
+ tree->AsOp()->gtOp2 = op1Child;
+
+ DEBUG_DESTROY_NODE(op1);
+
+ op1 = op2;
+ op2 = op1Child;
+ }
+
+ // a + -b = > a - b
+ // ADD(a, (NEG(b)) => SUB(a, b)
+
+ if (!op1->OperIs(GT_NEG) && op2->OperIs(GT_NEG))
+ {
+ // a is non cosntant because it was already canonicalized to have
+ // variable on the left and constant on the right.
+
+ // tree: ADD
+ // op1: a
+ // op2: NEG
+ // op2Child: b
+
+ GenTree* op2Child = op2->AsOp()->gtOp1; // a
+ oper = GT_SUB;
+ tree->SetOper(oper, GenTree::PRESERVE_VN);
+ tree->AsOp()->gtOp2 = op2Child;
+
+ DEBUG_DESTROY_NODE(op2);
+
+ op2 = op2Child;
+ }
+ }
}
/* See if we can fold GT_MUL by const nodes */
else if (oper == GT_MUL && op2->IsCnsIntOrI() && !optValnumCSE_phase)
diff --git a/src/coreclr/src/jit/utils.cpp b/src/coreclr/src/jit/utils.cpp
index de1fd4a880b2..133b49f701a1 100644
--- a/src/coreclr/src/jit/utils.cpp
+++ b/src/coreclr/src/jit/utils.cpp
@@ -846,9 +846,6 @@ void ConfigMethodRange::InitRanges(const WCHAR* rangeStr, unsigned capacity)
//------------------------------------------------------------------------
// Dump: dump hash ranges to stdout
//
-// Arguments:
-// hash -- hash value to check
-
void ConfigMethodRange::Dump()
{
if (m_inited != 1)
@@ -866,7 +863,14 @@ void ConfigMethodRange::Dump()
printf("\n", m_lastRange);
for (unsigned i = 0; i < m_lastRange; i++)
{
- printf("%i [%u-%u]\n", i, m_ranges[i].m_low, m_ranges[i].m_high);
+ if (m_ranges[i].m_low == m_ranges[i].m_high)
+ {
+ printf("%i [0x%08x]\n", i, m_ranges[i].m_low);
+ }
+ else
+ {
+ printf("%i [0x%08x-0x%08x]\n", i, m_ranges[i].m_low, m_ranges[i].m_high);
+ }
}
}
diff --git a/src/coreclr/src/md/compiler/classfactory.cpp b/src/coreclr/src/md/compiler/classfactory.cpp
index 1506cb00e277..46b9775e4401 100644
--- a/src/coreclr/src/md/compiler/classfactory.cpp
+++ b/src/coreclr/src/md/compiler/classfactory.cpp
@@ -23,9 +23,6 @@
#include "mscoree.h"
#include "corhost.h"
-//********** Locals. **********************************************************
-HINSTANCE GetModuleInst();
-
// @telesto - why does Telesto export any Co-classes at all?
// This map contains the list of coclasses which are exported from this module.
diff --git a/src/coreclr/src/md/staticmd/stdafx.h b/src/coreclr/src/md/staticmd/stdafx.h
index ab95ea1f3d62..65812f46ffa6 100644
--- a/src/coreclr/src/md/staticmd/stdafx.h
+++ b/src/coreclr/src/md/staticmd/stdafx.h
@@ -8,7 +8,3 @@
#include "intrinsic.h" // Functions to make intrinsic.
-
-
-// Helper function returns the instance handle of this module.
-HINSTANCE GetModuleInst();
diff --git a/src/coreclr/src/pal/inc/pal.h b/src/coreclr/src/pal/inc/pal.h
index 19e64091018c..8aa0fe32f2e2 100644
--- a/src/coreclr/src/pal/inc/pal.h
+++ b/src/coreclr/src/pal/inc/pal.h
@@ -504,15 +504,6 @@ PALAPI
PAL_UnregisterModule(
IN HINSTANCE hInstance);
-PALIMPORT
-BOOL
-PALAPI
-PAL_GetPALDirectoryW(
- OUT LPWSTR lpDirectoryName,
- IN OUT UINT* cchDirectoryName);
-
-#define PAL_GetPALDirectory PAL_GetPALDirectoryW
-
PALIMPORT
VOID
PALAPI
diff --git a/src/coreclr/src/pal/src/include/pal/stackstring.hpp b/src/coreclr/src/pal/src/include/pal/stackstring.hpp
index 30aa6fa379c7..38c4b84b6672 100644
--- a/src/coreclr/src/pal/src/include/pal/stackstring.hpp
+++ b/src/coreclr/src/pal/src/include/pal/stackstring.hpp
@@ -253,10 +253,6 @@ typedef StackString PathWCharString;
#endif
// Some Helper Definitions
-BOOL
-PAL_GetPALDirectoryW(
- PathWCharString& lpDirectoryName);
-
DWORD
GetCurrentDirectoryA(
PathCharString& lpBuffer);
diff --git a/src/coreclr/src/pal/src/init/pal.cpp b/src/coreclr/src/pal/src/init/pal.cpp
index 488ff6a4d79b..708d369f1dd1 100644
--- a/src/coreclr/src/pal/src/init/pal.cpp
+++ b/src/coreclr/src/pal/src/init/pal.cpp
@@ -776,8 +776,7 @@ exit :
Abstract:
A replacement for PAL_Initialize when loading CoreCLR. Instead of taking a command line (which CoreCLR
- instances aren't given anyway) the path into which the CoreCLR is installed is supplied instead. This is
- cached so that PAL_GetPALDirectoryW can return it later.
+ instances aren't given anyway) the path into which the CoreCLR is installed is supplied instead.
This routine also makes sure the psuedo dynamic libraries PALRT and mscorwks have their initialization
methods called.
diff --git a/src/coreclr/src/pal/src/misc/miscpalapi.cpp b/src/coreclr/src/pal/src/misc/miscpalapi.cpp
index 090261187813..06129210ef9c 100644
--- a/src/coreclr/src/pal/src/misc/miscpalapi.cpp
+++ b/src/coreclr/src/pal/src/misc/miscpalapi.cpp
@@ -43,115 +43,6 @@ SET_DEFAULT_DEBUG_CHANNEL(MISC);
static const char URANDOM_DEVICE_NAME[]="/dev/urandom";
-/*++
-
-Function :
-
- PAL_GetPALDirectoryW
-
- Returns the fully qualified path name
- where the PALL DLL was loaded from.
-
- On failure it returns FALSE and sets the
- proper LastError code.
-
---*/
-BOOL
-PAL_GetPALDirectoryW(PathWCharString& lpDirectoryName)
-{
- LPCWSTR lpFullPathAndName = NULL;
- LPCWSTR lpEndPoint = NULL;
- BOOL bRet = FALSE;
-
- PERF_ENTRY(PAL_GetPALDirectoryW);
-
- MODSTRUCT *module = LOADGetPalLibrary();
- if (!module)
- {
- SetLastError(ERROR_INTERNAL_ERROR);
- goto EXIT;
- }
- lpFullPathAndName = module->lib_name;
- if (lpFullPathAndName == NULL)
- {
- SetLastError(ERROR_INTERNAL_ERROR);
- goto EXIT;
- }
- lpEndPoint = PAL_wcsrchr( lpFullPathAndName, '/' );
- if ( lpEndPoint )
- {
- /* The path that we return is required to have
- the trailing slash on the end.*/
- lpEndPoint++;
-
-
- if(!lpDirectoryName.Set(lpFullPathAndName,lpEndPoint - lpFullPathAndName))
- {
- ASSERT( "The buffer was not large enough.\n" );
- SetLastError( ERROR_INSUFFICIENT_BUFFER );
- goto EXIT;
- }
-
- bRet = TRUE;
- }
- else
- {
- ASSERT( "Unable to determine the path.\n" );
- /* Error path, should not be executed. */
- SetLastError( ERROR_INTERNAL_ERROR );
- }
-
-EXIT:
- PERF_EXIT(PAL_GetPALDirectoryW);
- return bRet;
-}
-
-/*++
-
-Function :
-
- PAL_GetPALDirectoryW
-
- Returns the fully qualified path name
- where the PALL DLL was loaded from.
-
- On failure it returns FALSE and sets the
- proper LastError code.
-
---*/
-PALIMPORT
-BOOL
-PALAPI
-PAL_GetPALDirectoryW( OUT LPWSTR lpDirectoryName, IN OUT UINT* cchDirectoryName )
-{
- PathWCharString directory;
- BOOL bRet;
- PERF_ENTRY(PAL_GetPALDirectoryW);
- ENTRY( "PAL_GetPALDirectoryW( %p, %d )\n", lpDirectoryName, *cchDirectoryName );
-
- bRet = PAL_GetPALDirectoryW(directory);
-
- if (bRet) {
-
- if (directory.GetCount() > *cchDirectoryName)
- {
- SetLastError( ERROR_INSUFFICIENT_BUFFER );
- bRet = FALSE;
- }
- else
- {
- PAL_wcscpy(lpDirectoryName, directory.GetString());
- }
-
- *cchDirectoryName = directory.GetCount();
- }
-
- LOGEXIT( "PAL_GetPALDirectoryW returns BOOL %d.\n", bRet);
- PERF_EXIT(PAL_GetPALDirectoryW);
- return bRet;
-
-}
-
VOID
PALAPI
PAL_Random(
diff --git a/src/coreclr/src/pal/tests/palsuite/CMakeLists.txt b/src/coreclr/src/pal/tests/palsuite/CMakeLists.txt
index 722a32a3fa59..4f0d615deb49 100644
--- a/src/coreclr/src/pal/tests/palsuite/CMakeLists.txt
+++ b/src/coreclr/src/pal/tests/palsuite/CMakeLists.txt
@@ -800,7 +800,6 @@ _add_executable(paltests
miscellaneous/SetLastError/test1/test.cpp
miscellaneous/_i64tow/test1/test1.cpp
pal_specific/PAL_errno/test1/PAL_errno.cpp
- pal_specific/PAL_GetPALDirectoryW/test1/PAL_GetPALDirectoryW.cpp
# pal_specific/PAL_GetUserTempDirectoryW/test1/PAL_GetUserTempDirectoryW.cpp
#pal_specific/PAL_get_stderr/test1/PAL_get_stderr.cpp
#pal_specific/PAL_get_stdin/test1/PAL_get_stdin.cpp
diff --git a/src/coreclr/src/pal/tests/palsuite/compilableTests.txt b/src/coreclr/src/pal/tests/palsuite/compilableTests.txt
index 40e1d573e572..49b99c59c665 100644
--- a/src/coreclr/src/pal/tests/palsuite/compilableTests.txt
+++ b/src/coreclr/src/pal/tests/palsuite/compilableTests.txt
@@ -695,7 +695,6 @@ miscellaneous/SetEnvironmentVariableW/test4/paltest_setenvironmentvariablew_test
miscellaneous/SetLastError/test1/paltest_setlasterror_test1
miscellaneous/_i64tow/test1/paltest_i64tow_test1
pal_specific/PAL_errno/test1/paltest_pal_errno_test1
-pal_specific/PAL_GetPALDirectoryW/test1/paltest_pal_getpaldirectoryw_test1
pal_specific/PAL_GetUserTempDirectoryW/test1/paltest_pal_getusertempdirectoryw_test1
pal_specific/PAL_Initialize_Terminate/test1/paltest_pal_initialize_terminate_test1
pal_specific/PAL_Initialize_Terminate/test2/paltest_pal_initialize_terminate_test2
diff --git a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_GetPALDirectoryW/test1/PAL_GetPALDirectoryW.cpp b/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_GetPALDirectoryW/test1/PAL_GetPALDirectoryW.cpp
deleted file mode 100644
index 21a1bb3f0aa5..000000000000
--- a/src/coreclr/src/pal/tests/palsuite/pal_specific/PAL_GetPALDirectoryW/test1/PAL_GetPALDirectoryW.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT license.
-
-/*=============================================================
-**
-** Source: pal_getpaldirectoryw.c
-**
-** Purpose: Positive test the PAL_GetPALDirectoryW API.
-** Call this API to retrieve a fully-qualified
-** directory name where the PAL DLL is loaded from.
-**
-**
-**============================================================*/
-#define UNICODE
-#include
-
-PALTEST(pal_specific_PAL_GetPALDirectoryW_test1_paltest_pal_getpaldirectoryw_test1, "pal_specific/PAL_GetPALDirectoryW/test1/paltest_pal_getpaldirectoryw_test1")
-{
- int err;
- BOOL bValue;
- DWORD dwFileAttribute;
- WCHAR *wpDirectoryName = NULL;
- char *pDirectoryName = NULL;
-
- /*Initialize the PAL environment*/
- err = PAL_Initialize(argc, argv);
- if(0 != err)
- {
- return FAIL;
- }
-
- /*allocate momory to store the directory name*/
- wpDirectoryName = (WCHAR*)malloc(MAX_PATH*sizeof(WCHAR));
- if(NULL == wpDirectoryName)
- {
- Fail("\nFailed to allocate memory for storing directory name!\n");
- }
-
- UINT size = MAX_PATH;
- /*retrieve the machine configuration directory*/
- bValue = PAL_GetPALDirectoryW(wpDirectoryName, &size);
- if(FALSE == bValue)
- {
- free(wpDirectoryName);
- Fail("Failed to call PAL_GetPALDirectoryW API, "
- "error code =%u\n", GetLastError());
- }
-
-
- /*convert wide char string to a standard one*/
- pDirectoryName = convertC(wpDirectoryName);
- if(0 == strlen(pDirectoryName))
- {
- free(wpDirectoryName);
- free(pDirectoryName);
- Fail("The retrieved directory name string is empty!\n");
- }
-
- /*free the memory*/
- free(pDirectoryName);
-
- /*retrieve the attribute of a file or directory*/
- dwFileAttribute = GetFileAttributesW(wpDirectoryName);
-
- /*free the memory*/
- free(wpDirectoryName);
-
- /*check if the attribute indicates a directory*/
- if(FILE_ATTRIBUTE_DIRECTORY !=
- (dwFileAttribute & FILE_ATTRIBUTE_DIRECTORY))
- {
- Fail("The retrieved directory name is not a valid directory!\n");
- }
-
- PAL_Terminate();
- return PASS;
-}
diff --git a/src/coreclr/src/pal/tests/palsuite/paltestlist_to_be_reviewed.txt b/src/coreclr/src/pal/tests/palsuite/paltestlist_to_be_reviewed.txt
index 37c7d6ed8e01..6533c5bc9cc5 100644
--- a/src/coreclr/src/pal/tests/palsuite/paltestlist_to_be_reviewed.txt
+++ b/src/coreclr/src/pal/tests/palsuite/paltestlist_to_be_reviewed.txt
@@ -111,7 +111,6 @@ miscellaneous/MessageBoxW/test1/paltest_messageboxw_test1
miscellaneous/MessageBoxW/test2/paltest_messageboxw_test2
miscellaneous/wsprintfW/test2/paltest_wsprintfw_test2
miscellaneous/wsprintfW/test7/paltest_wsprintfw_test7
-pal_specific/PAL_GetPALDirectoryW/test1/paltest_pal_getpaldirectoryw_test1
pal_specific/PAL_GetUserTempDirectoryW/test1/paltest_pal_getusertempdirectoryw_test1
pal_specific/PAL_get_stderr/test1/paltest_pal_get_stderr_test1
pal_specific/PAL_get_stdin/test1/paltest_pal_get_stdin_test1
diff --git a/src/coreclr/src/scripts/genEventing.py b/src/coreclr/src/scripts/genEventing.py
index a7919768c3ab..09b0c3d4b84a 100644
--- a/src/coreclr/src/scripts/genEventing.py
+++ b/src/coreclr/src/scripts/genEventing.py
@@ -274,9 +274,9 @@ def generateClrallEvents(eventNodes,allTemplates):
clrallEvents.append("EventPipeEventEnabled" + eventName + "()")
if os.name == 'posix':
- clrallEvents.append("|| (XplatEventLogger::IsEventLoggingEnabled() && EventXplatEnabled" + eventName + "());}\n\n")
+ clrallEvents.append(" || (XplatEventLogger::IsEventLoggingEnabled() && EventXplatEnabled" + eventName + "());}\n\n")
else:
- clrallEvents.append(";}\n\n")
+ clrallEvents.append(" || EventXplatEnabled" + eventName + "();}\n\n")
#generate FireEtw functions
fnptype = []
fnbody = []
diff --git a/src/coreclr/src/tools/ILVerification/ILImporter.Verify.cs b/src/coreclr/src/tools/ILVerification/ILImporter.Verify.cs
index 787afb52578b..6540aafca606 100644
--- a/src/coreclr/src/tools/ILVerification/ILImporter.Verify.cs
+++ b/src/coreclr/src/tools/ILVerification/ILImporter.Verify.cs
@@ -201,11 +201,9 @@ public ILImporter(MethodDesc method, MethodIL methodIL)
}
}
- public Action ReportVerificationError
- {
- set;
- private get;
- }
+ public Action ReportVerificationError { set; private get; }
+
+ public bool SanityChecks { set; private get; }
public void Verify()
{
@@ -509,9 +507,9 @@ void VerificationError(VerifierError error)
if (_currentBasicBlock != null)
_currentBasicBlock.IncrementErrorCount();
- var args = new ErrorArgument[]
- {
- new ErrorArgument("Offset", _currentInstructionOffset)
+ var args = new ErrorArgument[]
+ {
+ new ErrorArgument("Offset", _currentInstructionOffset)
};
ReportVerificationError(args, error);
}
@@ -566,7 +564,7 @@ bool Check(bool cond, VerifierError error, StackValue found, StackValue expected
void CheckIsNumeric(StackValue value)
{
- if (!Check(StackValueKind.Int32 <= value.Kind && value.Kind <= StackValueKind.Float,
+ if (!Check(StackValueKind.Int32 <= value.Kind && value.Kind <= StackValueKind.Float,
VerifierError.ExpectedNumericType, value))
{
AbortBasicBlockVerification();
@@ -601,14 +599,14 @@ void CheckIsByRef(StackValue value)
void CheckIsArray(StackValue value)
{
- Check((value.Kind == StackValueKind.ObjRef) && ((value.Type == null) || value.Type.IsSzArray),
+ Check((value.Kind == StackValueKind.ObjRef) && ((value.Type == null) || value.Type.IsSzArray),
VerifierError.ExpectedArray /* , value */);
}
- void CheckIsAssignable(StackValue src, StackValue dst)
+ void CheckIsAssignable(StackValue src, StackValue dst, VerifierError error = VerifierError.StackUnexpected)
{
if (!IsAssignable(src, dst))
- VerificationError(VerifierError.StackUnexpected, src, dst);
+ VerificationError(error, src, dst);
}
private void CheckIsValidLeaveTarget(BasicBlock src, BasicBlock target)
@@ -647,7 +645,7 @@ private void CheckIsValidLeaveTarget(BasicBlock src, BasicBlock target)
ref var targetRegion = ref _exceptionRegions[target.TryIndex.Value].ILRegion;
// Target is not enclosing source
- if (targetRegion.TryOffset > srcRegion.TryOffset ||
+ if (targetRegion.TryOffset > srcRegion.TryOffset ||
src.StartOffset >= targetRegion.TryOffset + targetRegion.TryLength)
{
// Target is not first instruction
@@ -687,8 +685,8 @@ private void CheckIsValidLeaveTarget(BasicBlock src, BasicBlock target)
ref var targetRegion = ref _exceptionRegions[target.TryIndex.Value].ILRegion;
// If target is not associated try block, and not enclosing srcRegion
- if (target.TryIndex != src.HandlerIndex &&
- (targetRegion.TryOffset > srcRegion.HandlerOffset ||
+ if (target.TryIndex != src.HandlerIndex &&
+ (targetRegion.TryOffset > srcRegion.HandlerOffset ||
targetRegion.TryOffset + targetRegion.TryLength < srcRegion.HandlerOffset))
{
// If target is not first instruction of try, or not a direct sibling
@@ -771,7 +769,7 @@ bool IsValidBranchTarget(BasicBlock src, BasicBlock target, bool isFallthrough,
ref var srcRegion = ref _exceptionRegions[src.TryIndex.Value].ILRegion;
ref var targetRegion = ref _exceptionRegions[target.TryIndex.Value].ILRegion;
// If target is inside source region
- if (srcRegion.TryOffset <= targetRegion.TryOffset &&
+ if (srcRegion.TryOffset <= targetRegion.TryOffset &&
target.StartOffset < srcRegion.TryOffset + srcRegion.TryLength)
{
// Only branching to first instruction of try-block is valid
@@ -919,7 +917,7 @@ bool IsValidBranchTarget(BasicBlock src, BasicBlock target, bool isFallthrough,
}
///
- /// Checks whether the given enclosed try block is a direct child try-region of
+ /// Checks whether the given enclosed try block is a direct child try-region of
/// the given enclosing try block.
///
/// The block enclosing the try block given by .
@@ -1008,11 +1006,11 @@ static string TypeToStringForIsAssignable(TypeDesc type)
case TypeFlags.Char: return "Char";
case TypeFlags.SByte:
case TypeFlags.Byte: return "Byte";
- case TypeFlags.Int16:
+ case TypeFlags.Int16:
case TypeFlags.UInt16: return "Short";
case TypeFlags.Int32:
case TypeFlags.UInt32: return "Int32";
- case TypeFlags.Int64:
+ case TypeFlags.Int64:
case TypeFlags.UInt64: return "Long";
case TypeFlags.Single: return "Single";
case TypeFlags.Double: return "Double";
@@ -1302,6 +1300,12 @@ void StartImportingBasicBlock(BasicBlock basicBlock)
var exceptionType = ResolveTypeToken(r.ILRegion.ClassToken);
Check(!exceptionType.IsByRef, VerifierError.CatchByRef);
basicBlock.EntryStack[0] = StackValue.CreateObjRef(exceptionType);
+
+ if (SanityChecks && basicBlock.EntryStack[0] != StackValue.CreateObjRef(GetWellKnownType(WellKnownType.Object)))
+ {
+ CheckIsAssignable(basicBlock.EntryStack[0], StackValue.CreateObjRef(GetWellKnownType(WellKnownType.Exception)),
+ VerifierError.ThrowOrCatchOnlyExceptionType);
+ }
}
}
else
@@ -1606,21 +1610,21 @@ void ImportCall(ILOpcode opcode, int token)
{
// Rules for non-virtual call to a non-final virtual method (ECMA III.3.19: Verifiability of 'call'):
- // Define:
+ // Define:
// The "this" pointer is considered to be "possibly written" if
// 1. Its address have been taken (LDARGA 0) anywhere in the method.
// (or)
// 2. It has been stored to (STARG.0) anywhere in the method.
// A non-virtual call to a non-final virtual method is only allowed if
- // 1. The this pointer passed to the callee is an instance of a boxed value type.
+ // 1. The this pointer passed to the callee is an instance of a boxed value type.
// (or)
// 2. The this pointer passed to the callee is the current method's this pointer.
// (and) The current method's this pointer is not "possibly written".
- // Thus the rule is that if you assign to this ANYWHERE you can't make "base" calls to
- // virtual methods. (Luckily this does not affect .ctors, since they are not virtual).
- // This is stronger than is strictly needed, but implementing a laxer rule is significantly
+ // Thus the rule is that if you assign to this ANYWHERE you can't make "base" calls to
+ // virtual methods. (Luckily this does not affect .ctors, since they are not virtual).
+ // This is stronger than is strictly needed, but implementing a laxer rule is significantly
// harder and more error prone.
if (method.IsVirtual && !method.IsFinal && !actualThis.IsBoxedValueType)
{
@@ -1636,7 +1640,7 @@ void ImportCall(ILOpcode opcode, int token)
Check(!IsByRefLike(declaredThis), VerifierError.TailByRef, declaredThis);
// Tail calls on constrained calls should be illegal too:
- // when instantiated at a value type, a constrained call may pass the address of a stack allocated value
+ // when instantiated at a value type, a constrained call may pass the address of a stack allocated value
Check(constrained == null, VerifierError.TailByRef);
}
}
@@ -1832,7 +1836,7 @@ void PropagateThisState(BasicBlock current, BasicBlock next)
{
if (next.IsThisInitialized && !_isThisInitialized)
{
- // Next block has 'this' initialized, but current state has not
+ // Next block has 'this' initialized, but current state has not
// therefore next block must be reverified with 'this' uninitialized
if (next.State == BasicBlock.ImportState.WasVerified && next.ErrorCount == 0)
next.State = BasicBlock.ImportState.Unmarked;
@@ -2218,6 +2222,12 @@ void ImportThrow()
CheckIsObjRef(value);
+ if (SanityChecks && value != StackValue.CreateObjRef(GetWellKnownType(WellKnownType.Object)))
+ {
+ CheckIsAssignable(value, StackValue.CreateFromType(GetWellKnownType(WellKnownType.Exception)),
+ VerifierError.ThrowOrCatchOnlyExceptionType);
+ }
+
EmptyTheStack();
}
@@ -2250,7 +2260,7 @@ void ImportBox(int token)
Check(!IsByRefLike(targetType), VerifierError.BoxByRef, targetType);
- Check(type.IsPrimitive || targetType.Kind == StackValueKind.ObjRef ||
+ Check(type.IsPrimitive || targetType.Kind == StackValueKind.ObjRef ||
type.IsGenericParameter || type.IsValueType, VerifierError.ExpectedValClassObjRefVariable);
Check(type.CheckConstraints(), VerifierError.UnsatisfiedBoxOperand);
diff --git a/src/coreclr/src/tools/ILVerification/Strings.resx b/src/coreclr/src/tools/ILVerification/Strings.resx
index 82f096b8eb49..726cf6dd46c0 100644
--- a/src/coreclr/src/tools/ILVerification/Strings.resx
+++ b/src/coreclr/src/tools/ILVerification/Strings.resx
@@ -171,6 +171,9 @@
ByRef not allowed as catch type.
+
+ The type caught or thrown must be derived from System.Exception.
+
Code size is zero.
diff --git a/src/coreclr/src/tools/ILVerification/Verifier.cs b/src/coreclr/src/tools/ILVerification/Verifier.cs
index db15494289a0..032c386c84fd 100644
--- a/src/coreclr/src/tools/ILVerification/Verifier.cs
+++ b/src/coreclr/src/tools/ILVerification/Verifier.cs
@@ -179,7 +179,10 @@ private IEnumerable VerifyMethod(EcmaModule module, MethodIL
try
{
- var importer = new ILImporter(method, methodIL);
+ var importer = new ILImporter(method, methodIL)
+ {
+ SanityChecks = _verifierOptions.SanityChecks
+ };
importer.ReportVerificationError = (args, code) =>
{
@@ -321,5 +324,6 @@ private void ThrowMissingSystemModule()
public class VerifierOptions
{
public bool IncludeMetadataTokensInErrorMessages { get; set; }
+ public bool SanityChecks { get; set; }
}
}
diff --git a/src/coreclr/src/tools/ILVerification/VerifierError.cs b/src/coreclr/src/tools/ILVerification/VerifierError.cs
index 331d0a88544e..4be09b1ce021 100644
--- a/src/coreclr/src/tools/ILVerification/VerifierError.cs
+++ b/src/coreclr/src/tools/ILVerification/VerifierError.cs
@@ -145,6 +145,7 @@ public enum VerifierError
DelegateCtorSigO, // Unrecognized delegate .ctor signature; expected Object.
//E_RA_PTR_TO_STACK "Mkrefany on TypedReference, ArgHandle, or ArgIterator."
CatchByRef, // ByRef not allowed as catch type.
+ ThrowOrCatchOnlyExceptionType, // The type caught or thrown must be derived from System.Exception.
LdvirtftnOnStatic, // ldvirtftn on static.
CallVirtOnStatic, // callvirt on static.
InitLocals, // initlocals must be set for verifiable methods with one or more local variables.
@@ -189,6 +190,6 @@ public enum VerifierError
//IDS_E_GLOBAL ""
//IDS_E_MDTOKEN "[mdToken=0x%x]"
InterfaceImplHasDuplicate, // InterfaceImpl has a duplicate
- InterfaceMethodNotImplemented // Class implements interface but not method
+ InterfaceMethodNotImplemented // Class implements interface but not method
}
}
diff --git a/src/coreclr/src/tools/ILVerify/Program.cs b/src/coreclr/src/tools/ILVerify/Program.cs
index b9fbf35d8276..a5b380778cfa 100644
--- a/src/coreclr/src/tools/ILVerify/Program.cs
+++ b/src/coreclr/src/tools/ILVerify/Program.cs
@@ -46,6 +46,7 @@ public class Options
public string[] InputFilePath { get; set; }
public string[] Reference { get; set; }
public string SystemModule { get; set; }
+ public bool SanityChecks { get; set; }
public string[] Include { get; set; }
public FileInfo IncludeFile { get; set; }
public string[] Exclude { get; set; }
@@ -63,6 +64,7 @@ public static RootCommand RootCommand()
command.AddArgument(new Argument("input-file-path", "Input file(s)") { Arity = new ArgumentArity(1, Int32.MaxValue) });
command.AddOption(new Option(new[] { "--reference", "-r" }, "Reference metadata from the specified assembly"));
command.AddOption(new Option(new[] { "--system-module", "-s" }, "System module name (default: mscorlib)"));
+ command.AddOption(new Option(new[] { "--sanity-checks", "-c" }, "Check for valid constructs that are likely mistakes"));
command.AddOption(new Option(new[] { "--include", "-i" }, "Use only methods/types/namespaces, which match the given regular expression(s)"));
command.AddOption(new Option(new[] { "--include-file" }, "Same as --include, but the regular expression(s) are declared line by line in the specified file.").ExistingOnly());
command.AddOption(new Option(new[] { "--exclude", "-e" }, "Skip methods/types/namespaces, which match the given regular expression(s)"));
@@ -144,7 +146,11 @@ private Program(Options options)
private int Run()
{
- _verifier = new Verifier(this, GetVerifierOptions());
+ _verifier = new Verifier(this, new VerifierOptions
+ {
+ IncludeMetadataTokensInErrorMessages = _options.Tokens,
+ SanityChecks = _options.SanityChecks
+ });
_verifier.SetSystemModuleName(new AssemblyName(_options.SystemModule ?? "mscorlib"));
int numErrors = 0;
@@ -164,11 +170,6 @@ private int Run()
}
}
- private VerifierOptions GetVerifierOptions()
- {
- return new VerifierOptions { IncludeMetadataTokensInErrorMessages = _options.Tokens };
- }
-
private void PrintVerifyMethodsResult(VerificationResult result, EcmaModule module, string pathOrModuleName)
{
Write("[IL]: Error [");
@@ -257,7 +258,7 @@ private static void PrintMethod(EcmaMethod method)
}
}
}
- catch
+ catch
{
Write("Error while getting method signature");
}
@@ -409,7 +410,7 @@ private string GetQualifiedClassName(MetadataReader metadataReader, TypeDefiniti
///
/// This method returns the fully qualified method name by concatenating assembly, type and method name.
- /// This method exists to avoid additional assembly resolving, which might be triggered by calling
+ /// This method exists to avoid additional assembly resolving, which might be triggered by calling
/// MethodDesc.ToString().
///
private string GetQualifiedMethodName(MetadataReader metadataReader, MethodDefinitionHandle methodHandle)
diff --git a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunMethod.cs b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunMethod.cs
index 10b4af9a61c2..4d0840836efd 100644
--- a/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunMethod.cs
+++ b/src/coreclr/src/tools/aot/ILCompiler.Reflection.ReadyToRun/ReadyToRunMethod.cs
@@ -100,6 +100,11 @@ public class RuntimeFunction
///
public int StartAddress { get; }
+ ///
+ /// The relative virtual address to the end of the code block
+ ///
+ public int EndAddress { get; }
+
///
/// The size of the code block in bytes
///
@@ -107,7 +112,16 @@ public class RuntimeFunction
/// The EndAddress field in the runtime functions section is conditional on machine type
/// Size is -1 for images without the EndAddress field
///
- public int Size { get; }
+ public int Size
+ {
+ get
+ {
+ EnsureInitialized();
+ return _size;
+ }
+ }
+
+ private int _size = -1;
///
/// The relative virtual address to the unwind info
@@ -171,41 +185,54 @@ public RuntimeFunction(
int codeOffset,
ReadyToRunMethod method,
BaseUnwindInfo unwindInfo,
- BaseGcInfo gcInfo)
+ Func gcInfo)
{
_readyToRunReader = readyToRunReader;
+
Id = id;
StartAddress = startRva;
+ EndAddress = endRva;
UnwindRVA = unwindRva;
Method = method;
UnwindInfo = unwindInfo;
+ CodeOffset = codeOffset;
+ method.GetGcInfo = gcInfo;
+ }
+
+ private void EnsureInitialized()
+ {
+ if (_size < 0)
+ {
+ _size = GetSize();
+ }
+ }
- if (endRva != -1)
+ private int GetSize()
+ {
+ if (EndAddress != -1)
{
- Size = endRva - startRva;
+ return EndAddress - StartAddress;
}
- else if (unwindInfo is x86.UnwindInfo)
+ else if (UnwindInfo is x86.UnwindInfo)
{
- Size = (int)((x86.UnwindInfo)unwindInfo).FunctionLength;
+ return (int)((x86.UnwindInfo)UnwindInfo).FunctionLength;
}
- else if (unwindInfo is Arm.UnwindInfo)
+ else if (UnwindInfo is Arm.UnwindInfo)
{
- Size = (int)((Arm.UnwindInfo)unwindInfo).FunctionLength;
+ return (int)((Arm.UnwindInfo)UnwindInfo).FunctionLength;
}
- else if (unwindInfo is Arm64.UnwindInfo)
+ else if (UnwindInfo is Arm64.UnwindInfo)
{
- Size = (int)((Arm64.UnwindInfo)unwindInfo).FunctionLength;
+ return (int)((Arm64.UnwindInfo)UnwindInfo).FunctionLength;
}
- else if (gcInfo != null)
+ else if (Method.GcInfo != null)
{
- Size = gcInfo.CodeLength;
+ return Method.GcInfo.CodeLength;
}
else
{
- Size = -1;
+ return -1;
}
- CodeOffset = codeOffset;
- method.GcInfo = gcInfo;
}
}
@@ -273,7 +300,19 @@ private void EnsureRuntimeFunctions()
///
public int EntryPointRuntimeFunctionId { get; set; }
- public BaseGcInfo GcInfo { get; set; }
+ public Func GetGcInfo { get; set; }
+
+ public BaseGcInfo GcInfo
+ {
+ get
+ {
+ EnsureInitialized();
+ return _gcInfo;
+ }
+ }
+
+ private BaseGcInfo _gcInfo;
+
private ReadyToRunReader _readyToRunReader;
private List _fixupCells;
@@ -404,6 +443,14 @@ public ReadyToRunMethod(
SignatureString = sb.ToString();
}
+ private void EnsureInitialized()
+ {
+ if (_gcInfo == null && GetGcInfo != null)
+ {
+ _gcInfo = GetGcInfo();
+ }
+ }
+
private void EnsureFixupCells()
{
if (_fixupCells != null)
@@ -460,7 +507,7 @@ private void ParseRuntimeFunctions()
int runtimeFunctionSize = _readyToRunReader.CalculateRuntimeFunctionSize();
int runtimeFunctionOffset = _readyToRunReader.CompositeReader.GetOffset(_readyToRunReader.ReadyToRunHeader.Sections[ReadyToRunSectionType.RuntimeFunctions].RelativeVirtualAddress);
int curOffset = runtimeFunctionOffset + runtimeFunctionId * runtimeFunctionSize;
- BaseGcInfo gcInfo = null;
+ Func gcInfo = default(Func);
int codeOffset = 0;
for (int i = 0; i < RuntimeFunctionCount; i++)
{
@@ -485,7 +532,7 @@ private void ParseRuntimeFunctions()
unwindInfo = new Amd64.UnwindInfo(_readyToRunReader.Image, unwindOffset);
if (i == 0)
{
- gcInfo = new Amd64.GcInfo(_readyToRunReader.Image, unwindOffset + unwindInfo.Size, _readyToRunReader.Machine, _readyToRunReader.ReadyToRunHeader.MajorVersion);
+ gcInfo = new Func(() => new Amd64.GcInfo(_readyToRunReader.Image, unwindOffset + unwindInfo.Size, _readyToRunReader.Machine, _readyToRunReader.ReadyToRunHeader.MajorVersion));
}
}
else if (_readyToRunReader.Machine == Machine.I386)
@@ -493,7 +540,7 @@ private void ParseRuntimeFunctions()
unwindInfo = new x86.UnwindInfo(_readyToRunReader.Image, unwindOffset);
if (i == 0)
{
- gcInfo = new x86.GcInfo(_readyToRunReader.Image, unwindOffset, _readyToRunReader.Machine, _readyToRunReader.ReadyToRunHeader.MajorVersion);
+ gcInfo = new Func(() => new x86.GcInfo(_readyToRunReader.Image, unwindOffset, _readyToRunReader.Machine, _readyToRunReader.ReadyToRunHeader.MajorVersion));
}
}
else if (_readyToRunReader.Machine == Machine.ArmThumb2)
@@ -501,7 +548,7 @@ private void ParseRuntimeFunctions()
unwindInfo = new Arm.UnwindInfo(_readyToRunReader.Image, unwindOffset);
if (i == 0)
{
- gcInfo = new Amd64.GcInfo(_readyToRunReader.Image, unwindOffset + unwindInfo.Size, _readyToRunReader.Machine, _readyToRunReader.ReadyToRunHeader.MajorVersion); // Arm and Arm64 use the same GcInfo format as x64
+ gcInfo = new Func(() => new Amd64.GcInfo(_readyToRunReader.Image, unwindOffset + unwindInfo.Size, _readyToRunReader.Machine, _readyToRunReader.ReadyToRunHeader.MajorVersion)); // Arm and Arm64 use the same GcInfo format as x6
}
}
else if (_readyToRunReader.Machine == Machine.Arm64)
@@ -509,7 +556,7 @@ private void ParseRuntimeFunctions()
unwindInfo = new Arm64.UnwindInfo(_readyToRunReader.Image, unwindOffset);
if (i == 0)
{
- gcInfo = new Amd64.GcInfo(_readyToRunReader.Image, unwindOffset + unwindInfo.Size, _readyToRunReader.Machine, _readyToRunReader.ReadyToRunHeader.MajorVersion);
+ gcInfo = new Func(() => new Amd64.GcInfo(_readyToRunReader.Image, unwindOffset + unwindInfo.Size, _readyToRunReader.Machine, _readyToRunReader.ReadyToRunHeader.MajorVersion));
}
}
diff --git a/src/coreclr/src/tools/aot/crossgen2/CommandLineOptions.cs b/src/coreclr/src/tools/aot/crossgen2/CommandLineOptions.cs
index 1c8bcd4e63ed..7fc55e36aaf6 100644
--- a/src/coreclr/src/tools/aot/crossgen2/CommandLineOptions.cs
+++ b/src/coreclr/src/tools/aot/crossgen2/CommandLineOptions.cs
@@ -53,6 +53,7 @@ internal class CommandLineOptions
public string SingleMethodTypeName;
public string SingleMethodName;
+ public int SingleMethodIndex;
public IReadOnlyList SingleMethodGenericArg;
public IReadOnlyList CodegenOptions;
@@ -107,6 +108,7 @@ public CommandLineOptions(string[] args)
syntax.DefineOption("singlemethodtypename", ref SingleMethodTypeName, SR.SingleMethodTypeName);
syntax.DefineOption("singlemethodname", ref SingleMethodName, SR.SingleMethodMethodName);
+ syntax.DefineOption("singlemethodindex", ref SingleMethodIndex, SR.SingleMethodIndex);
syntax.DefineOptionList("singlemethodgenericarg", ref SingleMethodGenericArg, SR.SingleMethodGenericArgs);
syntax.DefineOption("parallelism", ref Parallelism, SR.ParalellismOption);
diff --git a/src/coreclr/src/tools/aot/crossgen2/Program.cs b/src/coreclr/src/tools/aot/crossgen2/Program.cs
index 86122bec482f..751e10b19087 100644
--- a/src/coreclr/src/tools/aot/crossgen2/Program.cs
+++ b/src/coreclr/src/tools/aot/crossgen2/Program.cs
@@ -634,7 +634,50 @@ private MethodDesc CheckAndParseSingleMethodModeArguments(CompilerTypeSystemCont
TypeDesc owningType = FindType(context, _commandLineOptions.SingleMethodTypeName);
// TODO: allow specifying signature to distinguish overloads
- MethodDesc method = owningType.GetMethod(_commandLineOptions.SingleMethodName, null);
+ MethodDesc method = null;
+ bool printMethodList = false;
+ int curIndex = 0;
+ foreach (var searchMethod in owningType.GetMethods())
+ {
+ if (searchMethod.Name != _commandLineOptions.SingleMethodName)
+ continue;
+
+ curIndex++;
+ if (_commandLineOptions.SingleMethodIndex != 0)
+ {
+ if (curIndex == _commandLineOptions.SingleMethodIndex)
+ {
+ method = searchMethod;
+ break;
+ }
+ }
+ else
+ {
+ if (method == null)
+ {
+ method = searchMethod;
+ }
+ else
+ {
+ printMethodList = true;
+ }
+ }
+ }
+
+ if (printMethodList)
+ {
+ curIndex = 0;
+ foreach (var searchMethod in owningType.GetMethods())
+ {
+ if (searchMethod.Name != _commandLineOptions.SingleMethodName)
+ continue;
+
+ curIndex++;
+ Console.WriteLine($"{curIndex} - {searchMethod}");
+ }
+ throw new CommandLineException(SR.SingleMethodIndexNeeded);
+ }
+
if (method == null)
throw new CommandLineException(string.Format(SR.MethodNotFoundOnType, _commandLineOptions.SingleMethodName, _commandLineOptions.SingleMethodTypeName));
@@ -666,6 +709,20 @@ private static bool DumpReproArguments(CodeGenerationFailedException ex)
Console.Write($"--singlemethodtypename \"{formatter.FormatName(failingMethod.OwningType, true)}\"");
Console.Write($" --singlemethodname {failingMethod.Name}");
+ {
+ int curIndex = 0;
+ foreach (var searchMethod in failingMethod.OwningType.GetMethods())
+ {
+ if (searchMethod.Name != failingMethod.Name)
+ continue;
+
+ curIndex++;
+ if (searchMethod == failingMethod.GetMethodDefinition())
+ {
+ Console.Write($" --singlemethodindex {curIndex}");
+ }
+ }
+ }
for (int i = 0; i < failingMethod.Instantiation.Length; i++)
Console.Write($" --singlemethodgenericarg \"{formatter.FormatName(failingMethod.Instantiation[i], true)}\"");
diff --git a/src/coreclr/src/tools/aot/crossgen2/Properties/Resources.resx b/src/coreclr/src/tools/aot/crossgen2/Properties/Resources.resx
index 687e7818f337..6020c7a61f97 100644
--- a/src/coreclr/src/tools/aot/crossgen2/Properties/Resources.resx
+++ b/src/coreclr/src/tools/aot/crossgen2/Properties/Resources.resx
@@ -226,7 +226,10 @@
Single method compilation: generic arguments to the method
- Single method compilation: generic arguments to the method
+ Single method compilation: method name
+
+
+ Single method compilation: Index of method if there are multiple with the same name
Single method compilation: name of the owning type
@@ -252,6 +255,9 @@
Both method name and type name are required parameters for single method mode
+
+ There are multiple methods with the same name. Specify --singlemethodindex [index] with the correct index.
+
Type '{0}' not found
diff --git a/src/coreclr/src/tools/aot/crossgen2/crossgen2.csproj b/src/coreclr/src/tools/aot/crossgen2/crossgen2.csproj
index 2d41acad35a5..ad11c3afa816 100644
--- a/src/coreclr/src/tools/aot/crossgen2/crossgen2.csproj
+++ b/src/coreclr/src/tools/aot/crossgen2/crossgen2.csproj
@@ -59,7 +59,7 @@
x64
unix
- win
+ win
$(TargetOSComponent)_$(TargetArchitecture)_$(TargetArchitecture)
$(TargetOSComponent)_$(TargetArchitecture)_$(CrossHostArch)
@@ -88,7 +88,7 @@
-
+
.a
- .lib
+ .lib
diff --git a/src/coreclr/src/tools/crossgen/CMakeLists.txt b/src/coreclr/src/tools/crossgen/CMakeLists.txt
index 4af88ce4dc1f..eff97b01a882 100644
--- a/src/coreclr/src/tools/crossgen/CMakeLists.txt
+++ b/src/coreclr/src/tools/crossgen/CMakeLists.txt
@@ -57,8 +57,8 @@ target_link_libraries(crossgen
if(CLR_CMAKE_HOST_UNIX)
target_link_libraries(crossgen
mscorrc
- coreclrpal
palrt
+ coreclrpal
)
else()
target_link_libraries(crossgen
diff --git a/src/coreclr/src/tools/crossgen/crossgen.cpp b/src/coreclr/src/tools/crossgen/crossgen.cpp
index 803ea5aff6e7..61faeb761a6b 100644
--- a/src/coreclr/src/tools/crossgen/crossgen.cpp
+++ b/src/coreclr/src/tools/crossgen/crossgen.cpp
@@ -398,14 +398,8 @@ void ComputeTPAListFromPlatformAssembliesPath(LPCWSTR pwzPlatformAssembliesPaths
}
}
-extern HMODULE g_hThisInst;
-
int _cdecl wmain(int argc, __in_ecount(argc) WCHAR **argv)
{
-#ifndef TARGET_UNIX
- g_hThisInst = WszGetModuleHandle(NULL);
-#endif
-
/////////////////////////////////////////////////////////////////////////
//
// Parse the arguments
diff --git a/src/coreclr/src/tools/r2rdump/TextDumper.cs b/src/coreclr/src/tools/r2rdump/TextDumper.cs
index dc0608b991ab..682abd7c05f6 100644
--- a/src/coreclr/src/tools/r2rdump/TextDumper.cs
+++ b/src/coreclr/src/tools/r2rdump/TextDumper.cs
@@ -155,12 +155,13 @@ internal override void DumpMethod(ReadyToRunMethod method)
if (_options.GC && method.GcInfo != null)
{
+ BaseGcInfo gcInfo = method.GcInfo;
_writer.WriteLine("GC info:");
- _writer.Write(method.GcInfo);
+ _writer.Write(gcInfo);
if (_options.Raw)
{
- DumpBytes(method.GcInfo.Offset, (uint)method.GcInfo.Size, "", false);
+ DumpBytes(gcInfo.Offset, (uint)gcInfo.Size, "", false);
}
}
SkipLine();
@@ -226,7 +227,8 @@ internal override void DumpDisasm(RuntimeFunction rtf, int imageOffset)
_writer.WriteLine();
}
- if (!_options.HideTransitions && rtf.Method.GcInfo?.Transitions != null && rtf.Method.GcInfo.Transitions.TryGetValue(codeOffset, out List transitionsForOffset))
+ BaseGcInfo gcInfo = (_options.HideTransitions ? null : rtf.Method?.GcInfo);
+ if (gcInfo != null && gcInfo.Transitions.TryGetValue(codeOffset, out List transitionsForOffset))
{
string[] formattedTransitions = new string[transitionsForOffset.Count];
for (int transitionIndex = 0; transitionIndex < formattedTransitions.Length; transitionIndex++)
diff --git a/src/coreclr/src/utilcode/ccomprc.cpp b/src/coreclr/src/utilcode/ccomprc.cpp
index a3d669bcb949..1b38edf419e8 100644
--- a/src/coreclr/src/utilcode/ccomprc.cpp
+++ b/src/coreclr/src/utilcode/ccomprc.cpp
@@ -18,7 +18,7 @@ __attribute__((visibility("default"))) DECLARE_NATIVE_STRING_RESOURCE_TABLE(NATI
#include
// External prototypes.
-extern HINSTANCE GetModuleInst();
+extern void* GetClrModuleBase();
//*****************************************************************************
// Do the mapping from an langId to an hinstance node
@@ -677,7 +677,7 @@ HRESULT CCompRC::LoadLibraryThrows(HRESOURCEDLL * pHInst)
#ifdef CROSSGEN_COMPILE
// The resources are embeded into the .exe itself for crossgen
- *pHInst = GetModuleInst();
+ *pHInst = (HINSTANCE)GetClrModuleBase();
#else
#ifdef SELF_NO_HOST
@@ -688,7 +688,7 @@ HRESULT CCompRC::LoadLibraryThrows(HRESOURCEDLL * pHInst)
// Try first in the same directory as this dll.
- hr = GetCORSystemDirectoryInternaL(rcPath);
+ hr = GetClrModuleDirectory(rcPath);
if (FAILED(hr))
return hr;
diff --git a/src/coreclr/src/utilcode/clrhost.cpp b/src/coreclr/src/utilcode/clrhost.cpp
index 5aa3a35c2e3f..188418fccdfa 100644
--- a/src/coreclr/src/utilcode/clrhost.cpp
+++ b/src/coreclr/src/utilcode/clrhost.cpp
@@ -12,7 +12,30 @@
#include "clrnt.h"
#include "contract.h"
-HINSTANCE g_hmodCoreCLR;
+#if HOST_WINDOWS
+extern "C" IMAGE_DOS_HEADER __ImageBase;
+#else
+static void* pImageBase = NULL;
+#endif
+
+void* GetClrModuleBase()
+{
+ LIMITED_METHOD_CONTRACT;
+
+#if HOST_WINDOWS
+ return (void*)&__ImageBase;
+#else // HOST_WINDOWS
+ // PAL_GetSymbolModuleBase defers to dladdr, which is typically a hash lookup through symbols.
+ // It should be fairly fast, however it may take a loader lock, so we will cache the result.
+ void* pRet = VolatileLoadWithoutBarrier(&pImageBase);
+ if (!pRet)
+ {
+ pImageBase = pRet = (void*)PAL_GetSymbolModuleBase((void*)GetClrModuleBase);
+ }
+
+ return pRet;
+#endif // HOST_WINDOWS
+}
thread_local int t_CantAllocCount;
@@ -89,39 +112,15 @@ int RFS_HashStack ()
#endif // FAILPOINTS_ENABLED
-
-
-//-----------------------------------------------------------------------------------
-// This is the approved way to get a module handle to mscorwks.dll (or coreclr.dll).
-// Never call GetModuleHandle(mscorwks) yourself as this will break side-by-side inproc.
-//
-// This function is safe to call before or during CRT initialization. It can not
-// legally return NULL (it only does so in the case of a broken build invariant.)
-//
-// TODO puCLR SxS utilcode work: Since this is never supposed to return NULL, it should
-// not be present in SELF_NO_HOST builds of utilcode where there isn't necessarily a
-// CLR in the process. We should also ASSERT that GetModuleHandleA isn't returning
-// NULL below - we've probably been getting away with this in SELF_NO_HOST cases like
-// mscordbi.dll.
-//-----------------------------------------------------------------------------------
-HMODULE GetCLRModule ()
+DWORD GetClrModulePathName(SString& buffer)
{
- //! WARNING: At the time this function is invoked, the C Runtime has NOT been fully initialized, let alone the CLR.
- //! So don't put in a runtime contract and don't invoke other functions in the CLR (not even _ASSERTE!)
-
- STATIC_CONTRACT_NOTHROW;
- STATIC_CONTRACT_SUPPORTS_DAC; // DAC can call in here since we initialize the SxS callbacks in ClrDataAccess::Initialize.
-
- // You got here because the dll that included this copy of utilcode.lib.
- // did not set g_hmodCoreCLR. The most likely cause is that you're running
- // a dll (other than coreclr.dll) that links to utilcode.lib.
- _ASSERTE(g_hmodCoreCLR != NULL);
-
- return g_hmodCoreCLR;
+#ifdef HOST_WINDOWS
+ return WszGetModuleFileName((HINSTANCE)GetClrModuleBase(), buffer);
+#else
+ return WszGetModuleFileName(PAL_GetPalHostModule(), buffer);
+#endif
}
-
-
#if defined(SELF_NO_HOST)
HMODULE CLRLoadLibrary(LPCWSTR lpLibFileName)
diff --git a/src/coreclr/src/utilcode/ex.cpp b/src/coreclr/src/utilcode/ex.cpp
index 56c1b552eead..7b15e4a98a24 100644
--- a/src/coreclr/src/utilcode/ex.cpp
+++ b/src/coreclr/src/utilcode/ex.cpp
@@ -31,6 +31,9 @@ GVAL_IMPL_INIT(HRESULT, g_hrFatalError, S_OK);
// and it will do nothing.
void GetLastThrownObjectExceptionFromThread(Exception **ppException);
+// Helper function to get pointer to clr module base
+void* GetClrModuleBase();
+
Exception *Exception::g_OOMException = NULL;
// avoid global constructors
@@ -1269,7 +1272,7 @@ static DWORD MarkAsThrownByUsWorker(UINT numArgs, /*out*/ ULONG_PTR exceptionArg
exceptionArgs[0] = arg0;
#if !defined(FEATURE_UTILCODE_NO_DEPENDENCIES)
- exceptionArgs[INSTANCE_TAGGED_SEH_PARAM_ARRAY_SIZE - 1] = (ULONG_PTR) (GetCLRModule());
+ exceptionArgs[INSTANCE_TAGGED_SEH_PARAM_ARRAY_SIZE - 1] = (ULONG_PTR)GetClrModuleBase();
#endif // !defined(FEATURE_UTILCODE_NO_DEPENDENCIES)
return INSTANCE_TAGGED_SEH_PARAM_ARRAY_SIZE;
@@ -1317,7 +1320,7 @@ BOOL WasThrownByUs(const EXCEPTION_RECORD *pcER, DWORD dwExceptionCode)
return FALSE;
}
#if!defined(FEATURE_UTILCODE_NO_DEPENDENCIES)
- if ( ((ULONG_PTR)(GetCLRModule())) != pcER->ExceptionInformation[INSTANCE_TAGGED_SEH_PARAM_ARRAY_SIZE - 1] )
+ if ((ULONG_PTR)GetClrModuleBase() != pcER->ExceptionInformation[INSTANCE_TAGGED_SEH_PARAM_ARRAY_SIZE - 1] )
{
return FALSE;
}
diff --git a/src/coreclr/src/utilcode/longfilepathwrappers.cpp b/src/coreclr/src/utilcode/longfilepathwrappers.cpp
index 365d91b61d87..3afc611c3b21 100644
--- a/src/coreclr/src/utilcode/longfilepathwrappers.cpp
+++ b/src/coreclr/src/utilcode/longfilepathwrappers.cpp
@@ -765,65 +765,6 @@ FindFirstFileExWrapper(
}
#endif // HOST_WINDOWS
-
-#ifdef HOST_WINDOWS
-
-#if ! defined(DACCESS_COMPILE) && !defined(SELF_NO_HOST)
-extern HINSTANCE g_hThisInst;
-#endif// ! defined(DACCESS_COMPILE) && !defined(SELF_NO_HOST)
-
-BOOL PAL_GetPALDirectoryWrapper(SString& pbuffer)
-{
-
- HRESULT hr = S_OK;
-
- PathString pPath;
- DWORD dwPath;
- HINSTANCE hinst = NULL;
-
-#if ! defined(DACCESS_COMPILE) && !defined(SELF_NO_HOST)
- hinst = g_hThisInst;
-#endif// ! defined(DACCESS_COMPILE) && !defined(SELF_NO_HOST)
-
-#ifndef CROSSGEN_COMPILE
- _ASSERTE(hinst != NULL);
-#endif
-
- dwPath = WszGetModuleFileName(hinst, pPath);
-
- if(dwPath == 0)
- {
- hr = HRESULT_FROM_GetLastErrorNA();
- }
- else
- {
- hr = CopySystemDirectory(pPath, pbuffer);
- }
-
- return (hr == S_OK);
-}
-
-#else
-
-BOOL PAL_GetPALDirectoryWrapper(SString& pbuffer)
-{
- BOOL retval = FALSE;
- COUNT_T size = MAX_LONGPATH;
-
- if(!(retval = PAL_GetPALDirectoryW(pbuffer.OpenUnicodeBuffer(size - 1), &size)))
- {
- pbuffer.CloseBuffer(0);
- retval = PAL_GetPALDirectoryW(pbuffer.OpenUnicodeBuffer(size - 1), &size);
- }
-
- pbuffer.CloseBuffer(size);
-
- return retval;
-}
-
-#endif // HOST_WINDOWS
-
-
//Implementation of LongFile Helpers
const WCHAR LongFile::DirectorySeparatorChar = W('\\');
const WCHAR LongFile::AltDirectorySeparatorChar = W('/');
diff --git a/src/coreclr/src/utilcode/makepath.cpp b/src/coreclr/src/utilcode/makepath.cpp
index 374cda432dba..4bf8787242a1 100644
--- a/src/coreclr/src/utilcode/makepath.cpp
+++ b/src/coreclr/src/utilcode/makepath.cpp
@@ -151,11 +151,9 @@ void MakePath (
}
-// Returns the directory for HMODULE. So, if HMODULE was for "C:\Dir1\Dir2\Filename.DLL",
-// then this would return "C:\Dir1\Dir2\" (note the trailing backslash).
-HRESULT GetHModuleDirectory(
- __in HMODULE hMod,
- SString& wszPath)
+// Returns the directory for clr module. So, if path was for "C:\Dir1\Dir2\Filename.DLL",
+// then this would return "C:\Dir1\Dir2\" (note the trailing backslash).HRESULT GetClrModuleDirectory(SString& wszPath)
+HRESULT GetClrModuleDirectory(SString& wszPath)
{
CONTRACTL
{
@@ -165,16 +163,14 @@ HRESULT GetHModuleDirectory(
}
CONTRACTL_END;
- DWORD dwRet = WszGetModuleFileName(hMod, wszPath);
+ DWORD dwRet = GetClrModulePathName(wszPath);
- if (dwRet == 0)
+ if (dwRet == 0)
{ // Some other error.
return HRESULT_FROM_GetLastError();
}
- CopySystemDirectory(wszPath, wszPath);
-
-
+ CopySystemDirectory(wszPath, wszPath);
return S_OK;
}
diff --git a/src/coreclr/src/utilcode/stresslog.cpp b/src/coreclr/src/utilcode/stresslog.cpp
index 7d5562bef51f..7d01fc09ca6b 100644
--- a/src/coreclr/src/utilcode/stresslog.cpp
+++ b/src/coreclr/src/utilcode/stresslog.cpp
@@ -141,7 +141,7 @@ void StressLog::Leave(CRITSEC_COOKIE) {
/*********************************************************************************/
void StressLog::Initialize(unsigned facilities, unsigned level, unsigned maxBytesPerThread,
- unsigned maxBytesTotal, HMODULE hMod)
+ unsigned maxBytesTotal, void* moduleBase)
{
STATIC_CONTRACT_LEAF;
@@ -173,18 +173,14 @@ void StressLog::Initialize(unsigned facilities, unsigned level, unsigned maxByt
GetSystemTimeAsFileTime (&theLog.startTime);
theLog.startTimeStamp = getTimeStamp();
+ theLog.moduleOffset = (SIZE_T)moduleBase;
#ifndef HOST_UNIX
- theLog.moduleOffset = (SIZE_T)hMod; // HMODULES are base addresses.
-
#ifdef _DEBUG
HMODULE hModNtdll = GetModuleHandleA("ntdll.dll");
theLog.RtlCaptureStackBackTrace = reinterpret_cast(
GetProcAddress(hModNtdll, "RtlCaptureStackBackTrace"));
#endif // _DEBUG
-
-#else // !HOST_UNIX
- theLog.moduleOffset = (SIZE_T)PAL_GetSymbolModuleBase((void *)StressLog::Initialize);
#endif // !HOST_UNIX
#if !defined (STRESS_LOG_READONLY) && defined(HOST_WINDOWS)
diff --git a/src/coreclr/src/utilcode/util.cpp b/src/coreclr/src/utilcode/util.cpp
index d9cdedbd7f4f..c034ae193185 100644
--- a/src/coreclr/src/utilcode/util.cpp
+++ b/src/coreclr/src/utilcode/util.cpp
@@ -2951,20 +2951,18 @@ LPWSTR *SegmentCommandLine(LPCWSTR lpCmdLine, DWORD *pNumArgs)
//======================================================================
// This function returns true, if it can determine that the instruction pointer
// refers to a code address that belongs in the range of the given image.
-// @TODO: Merge with IsIPInModule from vm\util.hpp
-
-BOOL IsIPInModule(HMODULE_TGT hModule, PCODE ip)
+BOOL IsIPInModule(PTR_VOID pModuleBaseAddress, PCODE ip)
{
STATIC_CONTRACT_LEAF;
SUPPORTS_DAC;
struct Param
{
- HMODULE_TGT hModule;
+ PTR_VOID pModuleBaseAddress;
PCODE ip;
BOOL fRet;
} param;
- param.hModule = hModule;
+ param.pModuleBaseAddress = pModuleBaseAddress;
param.ip = ip;
param.fRet = FALSE;
@@ -2972,7 +2970,7 @@ BOOL IsIPInModule(HMODULE_TGT hModule, PCODE ip)
#ifdef HOST_WINDOWS
PAL_TRY(Param *, pParam, ¶m)
{
- PTR_BYTE pBase = dac_cast(pParam->hModule);
+ PTR_BYTE pBase = dac_cast(pParam->pModuleBaseAddress);
PTR_IMAGE_DOS_HEADER pDOS = NULL;
PTR_IMAGE_NT_HEADERS pNT = NULL;
diff --git a/src/coreclr/src/vm/.vscode/c_cpp_properties.json b/src/coreclr/src/vm/.vscode/c_cpp_properties.json
index 86adb9feee34..6cf89552d9d2 100644
--- a/src/coreclr/src/vm/.vscode/c_cpp_properties.json
+++ b/src/coreclr/src/vm/.vscode/c_cpp_properties.json
@@ -3,7 +3,7 @@
{
"name": "Win32-Debug",
"includePath": [
- "../../../../artifacts/obj/coreclr/Windows_NT.x64.Debug/src/vm/dac",
+ "../../../../artifacts/obj/coreclr/windows.x64.Debug/src/vm/dac",
"../../src/vm/dac",
"../../src/vm",
"../../src/pal/prebuilt/inc",
@@ -16,8 +16,8 @@
"../../src/md/inc",
"../../src/classlibnative/bcltype",
"../../src/classlibnative/inc",
- "../../../../artifacts/obj/coreclr/Windows_NT.x64.Debug/src/inc",
- "../../../../artifacts/obj/coreclr/Windows_NT.x64.Debug/src/inc/etw",
+ "../../../../artifacts/obj/coreclr/windows.x64.Debug/src/inc",
+ "../../../../artifacts/obj/coreclr/windows.x64.Debug/src/inc/etw",
"../../src/vm/amd64"
],
"defines": [
diff --git a/src/coreclr/src/vm/ClrEtwAll.man b/src/coreclr/src/vm/ClrEtwAll.man
index f7fdca03d6b8..cf3666a9abc6 100644
--- a/src/coreclr/src/vm/ClrEtwAll.man
+++ b/src/coreclr/src/vm/ClrEtwAll.man
@@ -227,6 +227,7 @@
+
@@ -2356,6 +2357,28 @@
+
+
+
+
+
+
+
+
+
+
+
+ %1
+ %2
+ %3
+ %4
+ %5
+ %6
+ %7
+
+
+
+
@@ -3505,6 +3528,11 @@
task="CLRMethod"
symbol="MethodJittingStarted_V1" message="$(string.RuntimePublisher.MethodJittingStarted_V1EventMessage)"/>
+
+
+
@@ -7654,6 +7683,7 @@
+
diff --git a/src/coreclr/src/vm/ceeload.cpp b/src/coreclr/src/vm/ceeload.cpp
index 2c74d593b5fe..2de5b75ca000 100644
--- a/src/coreclr/src/vm/ceeload.cpp
+++ b/src/coreclr/src/vm/ceeload.cpp
@@ -3441,7 +3441,7 @@ ISymUnmanagedReader *Module::GetISymUnmanagedReader(void)
if (FAILED(hr))
{
PathString symbolReaderPath;
- hr = GetHModuleDirectory(GetModuleInst(), symbolReaderPath);
+ hr = GetClrModuleDirectory(symbolReaderPath);
if (FAILED(hr))
{
RETURN (NULL);
diff --git a/src/coreclr/src/vm/ceemain.cpp b/src/coreclr/src/vm/ceemain.cpp
index e975195d9150..914a3eea380d 100644
--- a/src/coreclr/src/vm/ceemain.cpp
+++ b/src/coreclr/src/vm/ceemain.cpp
@@ -637,18 +637,6 @@ void EEStartupHelper()
{
g_fEEInit = true;
-#if CORECLR_EMBEDDED
-
-#ifdef TARGET_WINDOWS
- HINSTANCE curModule = WszGetModuleHandle(NULL);
-#else
- HINSTANCE curModule = PAL_GetPalHostModule();
-#endif
-
- g_hmodCoreCLR = curModule;
- g_hThisInst = curModule;
-#endif
-
#ifndef CROSSGEN_COMPILE
// We cache the SystemInfo for anyone to use throughout the life of the EE.
@@ -717,7 +705,7 @@ void EEStartupHelper()
unsigned level = REGUTIL::GetConfigDWORD_DontUse_(CLRConfig::EXTERNAL_LogLevel, LL_INFO1000);
unsigned bytesPerThread = REGUTIL::GetConfigDWORD_DontUse_(CLRConfig::UNSUPPORTED_StressLogSize, STRESSLOG_CHUNK_SIZE * 4);
unsigned totalBytes = REGUTIL::GetConfigDWORD_DontUse_(CLRConfig::UNSUPPORTED_TotalStressLogSize, STRESSLOG_CHUNK_SIZE * 1024);
- StressLog::Initialize(facilities, level, bytesPerThread, totalBytes, GetModuleInst());
+ StressLog::Initialize(facilities, level, bytesPerThread, totalBytes, GetClrModuleBase());
g_pStressLog = &StressLog::theLog;
}
#endif
@@ -842,7 +830,7 @@ void EEStartupHelper()
#ifndef TARGET_UNIX
{
// Record mscorwks geometry
- PEDecoder pe(g_hThisInst);
+ PEDecoder pe(GetClrModuleBase());
g_runtimeLoadedBaseAddress = (SIZE_T)pe.GetBase();
g_runtimeVirtualSize = (SIZE_T)pe.GetVirtualSize();
@@ -1847,14 +1835,6 @@ BOOL STDMETHODCALLTYPE EEDllMain( // TRUE on success, FALSE on error.
switch (pParam->dwReason)
{
- case DLL_PROCESS_ATTACH:
- {
- g_hmodCoreCLR = pParam->hInst;
- // Save the module handle.
- g_hThisInst = pParam->hInst;
- break;
- }
-
case DLL_PROCESS_DETACH:
{
// lpReserved is NULL if we're here because someone called FreeLibrary
diff --git a/src/coreclr/src/vm/codeman.cpp b/src/coreclr/src/vm/codeman.cpp
index d81e83d71c2e..8fb9fdea1197 100644
--- a/src/coreclr/src/vm/codeman.cpp
+++ b/src/coreclr/src/vm/codeman.cpp
@@ -1592,10 +1592,9 @@ static void LoadAndInitializeJIT(LPCWSTR pwzJitName, OUT HINSTANCE* phJit, OUT I
HRESULT hr = E_FAIL;
PathString CoreClrFolderHolder;
- extern HINSTANCE g_hThisInst;
bool havePath = false;
- if (WszGetModuleFileName(g_hThisInst, CoreClrFolderHolder))
+ if (GetClrModulePathName(CoreClrFolderHolder))
{
// Load JIT from next to CoreCLR binary
havePath = true;
diff --git a/src/coreclr/src/vm/common.h b/src/coreclr/src/vm/common.h
index 992c6a70b2cc..f01ec501bb67 100644
--- a/src/coreclr/src/vm/common.h
+++ b/src/coreclr/src/vm/common.h
@@ -368,7 +368,9 @@ namespace Loader
#include "gcstress.h"
HRESULT EnsureRtlFunctions();
-HINSTANCE GetModuleInst();
+
+// Helper function returns the base of clr module.
+void* GetClrModuleBase();
#if defined(TARGET_X86) || defined(TARGET_AMD64)
//
diff --git a/src/coreclr/src/vm/corelib.h b/src/coreclr/src/vm/corelib.h
index 5b6e7fec6597..21c8a6c4332f 100644
--- a/src/coreclr/src/vm/corelib.h
+++ b/src/coreclr/src/vm/corelib.h
@@ -1061,7 +1061,7 @@ DEFINE_METHOD(OBJECTMARSHALER, CLEAR_NATIVE, ClearNative,
DEFINE_CLASS(INTERFACEMARSHALER, StubHelpers, InterfaceMarshaler)
DEFINE_METHOD(INTERFACEMARSHALER, CONVERT_TO_NATIVE, ConvertToNative, SM_Obj_IntPtr_IntPtr_Int_RetIntPtr)
-DEFINE_METHOD(INTERFACEMARSHALER, CONVERT_TO_MANAGED, ConvertToManaged, SM_IntPtr_IntPtr_IntPtr_Int_RetObj)
+DEFINE_METHOD(INTERFACEMARSHALER, CONVERT_TO_MANAGED, ConvertToManaged, SM_RefIntPtr_IntPtr_IntPtr_Int_RetObj)
DEFINE_METHOD(INTERFACEMARSHALER, CLEAR_NATIVE, ClearNative, SM_IntPtr_RetVoid)
diff --git a/src/coreclr/src/vm/dwreport.cpp b/src/coreclr/src/vm/dwreport.cpp
index 58aadd134e81..0370edd68f10 100644
--- a/src/coreclr/src/vm/dwreport.cpp
+++ b/src/coreclr/src/vm/dwreport.cpp
@@ -139,10 +139,10 @@ BOOL RegisterOutOfProcessWatsonCallbacks()
EX_TRY
{
PathString wszDACPath;
- if (SUCCEEDED(::GetCORSystemDirectoryInternaL(wszDACPath)))
+ if (SUCCEEDED(::GetClrModuleDirectory(wszDACPath)))
{
wszDACPath.Append(wszDACName);
- hr = (*pFnWerRegisterRuntimeExceptionModule)(wszDACPath, (PDWORD)g_hThisInst);
+ hr = (*pFnWerRegisterRuntimeExceptionModule)(wszDACPath, (PDWORD)GetClrModuleBase());
}
else {
hr = E_FAIL;
diff --git a/src/coreclr/src/vm/ecalllist.h b/src/coreclr/src/vm/ecalllist.h
index 76a1ccc3ad5d..804c0619e887 100644
--- a/src/coreclr/src/vm/ecalllist.h
+++ b/src/coreclr/src/vm/ecalllist.h
@@ -164,9 +164,6 @@ FCFuncStart(gEnvironmentFuncs)
QCFuncElement("GetProcessorCount", SystemNative::GetProcessorCount)
FCFuncElement("GetCommandLineArgsNative", SystemNative::GetCommandLineArgs)
-#if defined(FEATURE_COMINTEROP)
- QCFuncElement("WinRTSupported", SystemNative::WinRTSupported)
-#endif // FEATURE_COMINTEROP
FCFuncElementSig("FailFast", &gsig_SM_Str_RetVoid, SystemNative::FailFast)
FCFuncElementSig("FailFast", &gsig_SM_Str_Exception_RetVoid, SystemNative::FailFastWithException)
FCFuncElementSig("FailFast", &gsig_SM_Str_Exception_Str_RetVoid, SystemNative::FailFastWithExceptionAndSource)
diff --git a/src/coreclr/src/vm/eepolicy.cpp b/src/coreclr/src/vm/eepolicy.cpp
index 04eea4019da7..13645dfdd92f 100644
--- a/src/coreclr/src/vm/eepolicy.cpp
+++ b/src/coreclr/src/vm/eepolicy.cpp
@@ -468,13 +468,13 @@ void EEPolicy::LogFatalError(UINT exitCode, UINT_PTR address, LPCWSTR pszMessage
addressString.Printf(W("%p"), pExceptionInfo? (UINT_PTR)pExceptionInfo->ExceptionRecord->ExceptionAddress : address);
// We should always have the reference to the runtime's instance
- _ASSERTE(g_hThisInst != NULL);
+ _ASSERTE(GetClrModuleBase() != NULL);
// Setup the string to contain the runtime's base address. Thus, when customers report FEEE with just
// the event log entry containing this string, we can use the absolute and base addresses to determine
// where the fault happened inside the runtime.
SmallStackSString runtimeBaseAddressString;
- runtimeBaseAddressString.Printf(W("%p"), g_hThisInst);
+ runtimeBaseAddressString.Printf(W("%p"), GetClrModuleBase());
SmallStackSString exitCodeString;
exitCodeString.Printf(W("%x"), exitCode);
diff --git a/src/coreclr/src/vm/eventtrace.cpp b/src/coreclr/src/vm/eventtrace.cpp
index 802c5211ab71..ef7d0cd36597 100644
--- a/src/coreclr/src/vm/eventtrace.cpp
+++ b/src/coreclr/src/vm/eventtrace.cpp
@@ -5066,12 +5066,11 @@ VOID ETW::InfoLog::RuntimeInformation(INT32 type)
PCWSTR lpwszCommandLine = W("");
- // if WszGetModuleFileName fails, we return an empty string
- if (!WszGetModuleFileName(GetCLRModule(), dllPath)) {
+ // if GetClrModulePathName fails, we return an empty string
+ if (!GetClrModulePathName(dllPath)) {
dllPath.Set(W("\0"));
}
-
if(type == ETW::InfoLog::InfoStructs::Callback)
{
FireEtwRuntimeInformationDCStart( GetClrInstanceId(),
diff --git a/src/coreclr/src/vm/excep.cpp b/src/coreclr/src/vm/excep.cpp
index 0b5a4ad58826..3ca6f802ed31 100644
--- a/src/coreclr/src/vm/excep.cpp
+++ b/src/coreclr/src/vm/excep.cpp
@@ -4041,7 +4041,7 @@ BuildCreateDumpCommandLine(
const char* DumpGeneratorName = "createdump.exe";
PathString coreclrPath;
- if (WszGetModuleFileName(GetCLRModule(), coreclrPath))
+ if (GetClrModulePathName(coreclrPath))
{
SString::CIterator lastBackslash = coreclrPath.End();
if (coreclrPath.FindBack(lastBackslash, W('\\')))
@@ -7306,7 +7306,7 @@ LONG WINAPI CLRVectoredExceptionHandlerPhase2(PEXCEPTION_POINTERS pExceptionInfo
CONTRACT_VIOLATION(TakesLockViolation);
fExternalException = (!ExecutionManager::IsManagedCode(GetIP(pExceptionInfo->ContextRecord)) &&
- !IsIPInModule(g_hThisInst, GetIP(pExceptionInfo->ContextRecord)));
+ !IsIPInModule(GetClrModuleBase(), GetIP(pExceptionInfo->ContextRecord)));
}
if (fExternalException)
@@ -7473,7 +7473,7 @@ VEH_ACTION WINAPI CLRVectoredExceptionHandlerPhase3(PEXCEPTION_POINTERS pExcepti
if ((!fAVisOk) && !(pExceptionRecord->ExceptionFlags & EXCEPTION_UNWINDING))
{
PCODE ip = (PCODE)GetIP(pContext);
- if (IsIPInModule(g_hThisInst, ip) || IsIPInModule(GCHeapUtilities::GetGCModule(), ip))
+ if (IsIPInModule(GetClrModuleBase(), ip) || IsIPInModule(GCHeapUtilities::GetGCModuleBase(), ip))
{
CONTRACT_VIOLATION(ThrowsViolation|FaultViolation);
diff --git a/src/coreclr/src/vm/exceptionhandling.cpp b/src/coreclr/src/vm/exceptionhandling.cpp
index 7d329902e42a..3d3b90257e25 100644
--- a/src/coreclr/src/vm/exceptionhandling.cpp
+++ b/src/coreclr/src/vm/exceptionhandling.cpp
@@ -975,7 +975,7 @@ ProcessCLRException(IN PEXCEPTION_RECORD pExceptionRecord
BOOL fExternalException;
fExternalException = (!ExecutionManager::IsManagedCode(ip) &&
- !IsIPInModule(g_hThisInst, ip));
+ !IsIPInModule(GetClrModuleBase(), ip));
if (fExternalException)
{
@@ -6719,11 +6719,11 @@ StackFrame ExceptionTracker::FindParentStackFrameHelper(CrawlFrame* pCF,
fIsCallerInVM = !ExecutionManager::IsManagedCode(callerIP);
#else
#if defined(DACCESS_COMPILE)
- HMODULE_TGT hEE = DacGlobalBase();
+ PTR_VOID eeBase = DacGlobalBase();
#else // !DACCESS_COMPILE
- HMODULE_TGT hEE = g_hThisInst;
+ PTR_VOID eeBase = GetClrModuleBase();
#endif // !DACCESS_COMPILE
- fIsCallerInVM = IsIPInModule(hEE, callerIP);
+ fIsCallerInVM = IsIPInModule(eeBase, callerIP);
#endif // TARGET_UNIX
if (!fIsCallerInVM)
diff --git a/src/coreclr/src/vm/gcheaputilities.cpp b/src/coreclr/src/vm/gcheaputilities.cpp
index 606706050958..3432a00110e4 100644
--- a/src/coreclr/src/vm/gcheaputilities.cpp
+++ b/src/coreclr/src/vm/gcheaputilities.cpp
@@ -56,7 +56,7 @@ GC_LOAD_STATUS g_gc_load_status = GC_LOAD_STATUS_BEFORE_START;
VersionInfo g_gc_version_info;
// The module that contains the GC.
-HMODULE g_gc_module;
+PTR_VOID g_gc_module_base;
// GC entrypoints for the the linked-in GC. These symbols are invoked
// directly if we are not using a standalone GC.
@@ -70,10 +70,10 @@ extern "C" HRESULT GC_Initialize(
#ifndef DACCESS_COMPILE
-HMODULE GCHeapUtilities::GetGCModule()
+PTR_VOID GCHeapUtilities::GetGCModuleBase()
{
- assert(g_gc_module);
- return g_gc_module;
+ assert(g_gc_module_base);
+ return g_gc_module_base;
}
namespace
@@ -101,7 +101,7 @@ BOOL g_gcEventTracingInitialized = FALSE;
// to "publish" it by assigning it to g_pGCHeap.
//
// This function can proceed concurrently with StashKeywordAndLevel below.
-void FinalizeLoad(IGCHeap* gcHeap, IGCHandleManager* handleMgr, HMODULE gcModule)
+void FinalizeLoad(IGCHeap* gcHeap, IGCHandleManager* handleMgr, PTR_VOID pGcModuleBase)
{
g_pGCHeap = gcHeap;
@@ -118,7 +118,7 @@ void FinalizeLoad(IGCHeap* gcHeap, IGCHandleManager* handleMgr, HMODULE gcModule
g_pGCHandleManager = handleMgr;
g_gcDacGlobals = &g_gc_dac_vars;
g_gc_load_status = GC_LOAD_STATUS_LOAD_COMPLETE;
- g_gc_module = gcModule;
+ g_gc_module_base = pGcModuleBase;
LOG((LF_GC, LL_INFO100, "GC load successful\n"));
}
@@ -238,7 +238,15 @@ HRESULT LoadAndInitializeGC(LPWSTR standaloneGcLocation)
HRESULT initResult = initFunc(gcToClr, &heap, &manager, &g_gc_dac_vars);
if (initResult == S_OK)
{
- FinalizeLoad(heap, manager, hMod);
+ PTR_VOID pGcModuleBase;
+
+#if TARGET_WINDOWS
+ pGcModuleBase = (PTR_VOID)hMod;
+#else
+ pGcModuleBase = (PTR_VOID)PAL_GetSymbolModuleBase((PVOID)initFunc);
+#endif
+
+ FinalizeLoad(heap, manager, pGcModuleBase);
}
else
{
@@ -277,7 +285,7 @@ HRESULT InitializeDefaultGC()
HRESULT initResult = GC_Initialize(nullptr, &heap, &manager, &g_gc_dac_vars);
if (initResult == S_OK)
{
- FinalizeLoad(heap, manager, GetModuleInst());
+ FinalizeLoad(heap, manager, GetClrModuleBase());
}
else
{
diff --git a/src/coreclr/src/vm/gcheaputilities.h b/src/coreclr/src/vm/gcheaputilities.h
index ab1f931d0e30..3d648862740a 100644
--- a/src/coreclr/src/vm/gcheaputilities.h
+++ b/src/coreclr/src/vm/gcheaputilities.h
@@ -198,8 +198,8 @@ class GCHeapUtilities {
#endif // FEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP
#ifndef DACCESS_COMPILE
- // Gets the module that contains the GC.
- static HMODULE GetGCModule();
+ // Gets a pointer to the module that contains the GC.
+ static PTR_VOID GetGCModuleBase();
// Loads (if using a standalone GC) and initializes the GC.
static HRESULT LoadAndInitialize();
diff --git a/src/coreclr/src/vm/hosting.cpp b/src/coreclr/src/vm/hosting.cpp
index 92ab9613ae67..f8439265d735 100644
--- a/src/coreclr/src/vm/hosting.cpp
+++ b/src/coreclr/src/vm/hosting.cpp
@@ -173,7 +173,7 @@ BOOL ClrVirtualProtect(LPVOID lpAddress, SIZE_T dwSize, DWORD flNewProtect, PDWO
CONTRACT_VIOLATION(ThrowsViolation);
// Get reference to MSCORWKS image in memory...
- PEDecoder pe(g_hThisInst);
+ PEDecoder pe(GetClrModuleBase());
// Find the UEF section from the image
IMAGE_SECTION_HEADER* pUEFSection = pe.FindSection(CLR_UEF_SECTION_NAME);
diff --git a/src/coreclr/src/vm/ipcstreamfactory.cpp b/src/coreclr/src/vm/ipcstreamfactory.cpp
index 1116f84dee2b..dfaf4b93feae 100644
--- a/src/coreclr/src/vm/ipcstreamfactory.cpp
+++ b/src/coreclr/src/vm/ipcstreamfactory.cpp
@@ -325,6 +325,10 @@ IpcStream *IpcStreamFactory::GetNextAvailableStream(ErrorCallback callback)
if (pStream == nullptr) // only use first signaled stream; will get others on subsequent calls
{
pStream = ((DiagnosticPort*)(rgIpcPollHandles[i].pUserData))->GetConnectedStream(callback);
+ if (pStream == nullptr)
+ {
+ fSawError = true;
+ }
s_currentPort = (DiagnosticPort*)(rgIpcPollHandles[i].pUserData);
}
STRESS_LOG2(LF_DIAGNOSTICS_PORT, LL_INFO10, "IpcStreamFactory::GetNextAvailableStream - SIG :: Poll attempt: %d, connection %d signalled.\n", nPollAttempts, i);
diff --git a/src/coreclr/src/vm/jithelpers.cpp b/src/coreclr/src/vm/jithelpers.cpp
index e122cfc2af10..435f8ca18ed0 100644
--- a/src/coreclr/src/vm/jithelpers.cpp
+++ b/src/coreclr/src/vm/jithelpers.cpp
@@ -5624,10 +5624,10 @@ void InitJitHelperLogging()
{
#ifdef TARGET_X86
- IMAGE_DOS_HEADER *pDOS = (IMAGE_DOS_HEADER *)g_hThisInst;
+ IMAGE_DOS_HEADER *pDOS = (IMAGE_DOS_HEADER *)GetClrModuleBase();
_ASSERTE(pDOS->e_magic == VAL16(IMAGE_DOS_SIGNATURE) && pDOS->e_lfanew != 0);
- IMAGE_NT_HEADERS *pNT = (IMAGE_NT_HEADERS*)((LPBYTE)g_hThisInst + VAL32(pDOS->e_lfanew));
+ IMAGE_NT_HEADERS *pNT = (IMAGE_NT_HEADERS*)((LPBYTE)GetClrModuleBase() + VAL32(pDOS->e_lfanew));
#ifdef HOST_64BIT
_ASSERTE(pNT->Signature == VAL32(IMAGE_NT_SIGNATURE)
&& pNT->FileHeader.SizeOfOptionalHeader == VAL16(sizeof(IMAGE_OPTIONAL_HEADER64))
@@ -5731,7 +5731,7 @@ void InitJitHelperLogging()
#else // TARGET_X86
// Is the address in mscoree.dll at all? (All helpers are in
// mscoree.dll)
- if (dynamicHlpFunc->pfnHelper >= (LPBYTE*)g_hThisInst && dynamicHlpFunc->pfnHelper < (LPBYTE*)g_hThisInst + VAL32(pNT->OptionalHeader.SizeOfImage))
+ if (dynamicHlpFunc->pfnHelper >= (LPBYTE*)GetClrModuleBase() && dynamicHlpFunc->pfnHelper < (LPBYTE*)GetClrModuleBase() + VAL32(pNT->OptionalHeader.SizeOfImage))
{
// See note above. How do I get the size on x86 for a static method?
hlpFuncCount->helperSize = 0;
diff --git a/src/coreclr/src/vm/jitinterface.cpp b/src/coreclr/src/vm/jitinterface.cpp
index 2ff02534ba74..b8274eb3344e 100644
--- a/src/coreclr/src/vm/jitinterface.cpp
+++ b/src/coreclr/src/vm/jitinterface.cpp
@@ -12009,6 +12009,22 @@ void CEEJitInfo::allocMem (
COMPlusThrowHR(CORJIT_OUTOFMEM);
}
+ if (ETW_EVENT_ENABLED(MICROSOFT_WINDOWS_DOTNETRUNTIME_PROVIDER_DOTNET_Context, MethodJitMemoryAllocatedForCode))
+ {
+ ULONGLONG ullMethodIdentifier = 0;
+ ULONGLONG ullModuleID = 0;
+
+ if (m_pMethodBeingCompiled)
+ {
+ Module* pModule = m_pMethodBeingCompiled->GetModule_NoLogging();
+ ullModuleID = (ULONGLONG)(TADDR)pModule;
+ ullMethodIdentifier = (ULONGLONG)m_pMethodBeingCompiled;
+ }
+
+ FireEtwMethodJitMemoryAllocatedForCode(ullMethodIdentifier, ullModuleID,
+ hotCodeSize + coldCodeSize, roDataSize, totalSize.Value(), flag, GetClrInstanceId());
+ }
+
m_CodeHeader = m_jitManager->allocCode(m_pMethodBeingCompiled, totalSize.Value(), GetReserveForJumpStubs(), flag
#ifdef FEATURE_EH_FUNCLETS
, m_totalUnwindInfos
diff --git a/src/coreclr/src/vm/metasig.h b/src/coreclr/src/vm/metasig.h
index ca09519dfb92..03b2e457271b 100644
--- a/src/coreclr/src/vm/metasig.h
+++ b/src/coreclr/src/vm/metasig.h
@@ -174,7 +174,7 @@
DEFINE_METASIG_T(SM(Int_IntPtr_Obj_RetException, i I j, C(EXCEPTION)))
DEFINE_METASIG_T(SM(Type_ArrType_IntPtr_int_RetType, C(TYPE) a(C(TYPE)) I i, C(TYPE) ))
DEFINE_METASIG_T(SM(Type_RetIntPtr, C(TYPE), I))
-DEFINE_METASIG(SM(IntPtr_IntPtr_IntPtr_Int_RetObj, I I I i, j))
+DEFINE_METASIG(SM(RefIntPtr_IntPtr_IntPtr_Int_RetObj, r(I) I I i, j))
DEFINE_METASIG(SM(Obj_IntPtr_RetIntPtr, j I, I))
DEFINE_METASIG(SM(Obj_IntPtr_RetObj, j I, j))
DEFINE_METASIG(SM(Obj_RefIntPtr_RetVoid, j r(I), v))
diff --git a/src/coreclr/src/vm/pefile.cpp b/src/coreclr/src/vm/pefile.cpp
index 9966c4c1d2e5..406d76c11c1c 100644
--- a/src/coreclr/src/vm/pefile.cpp
+++ b/src/coreclr/src/vm/pefile.cpp
@@ -1067,46 +1067,6 @@ LPCWSTR CorCompileGetRuntimeDllName(CorCompileRuntimeDlls id)
return CorCompileRuntimeDllNames[id];
}
-#ifndef CROSSGEN_COMPILE
-
-//==============================================================================
-// Will always return a valid HMODULE for CLR_INFO, but will return NULL for NGEN_COMPILER_INFO
-// if the DLL has not yet been loaded (it does not try to cause a load).
-
-extern HMODULE CorCompileGetRuntimeDll(CorCompileRuntimeDlls id)
-{
- CONTRACTL
- {
- THROWS;
- GC_NOTRIGGER;
- MODE_ANY;
- INJECT_FAULT(COMPlusThrowOM(););
- }
- CONTRACTL_END;
-
- // Currently special cased for every entry.
- static_assert_no_msg(NUM_RUNTIME_DLLS == 2);
- static_assert_no_msg(CORECLR_INFO == 0);
-
- HMODULE hMod = NULL;
-
- // Try to load the correct DLL
- switch (id)
- {
- case CORECLR_INFO:
- hMod = GetCLRModule();
- break;
-
- default:
- COMPlusThrowNonLocalized(kExecutionEngineException,
- W("Invalid runtime DLL ID"));
- break;
- }
-
- return hMod;
-}
-#endif // CROSSGEN_COMPILE
-
//===========================================================================================================
// Validates that an NI matches the running CLR, OS, CPU, etc.
//
diff --git a/src/coreclr/src/vm/proftoeeinterfaceimpl.cpp b/src/coreclr/src/vm/proftoeeinterfaceimpl.cpp
index 124c703bc938..04105ce3ae33 100644
--- a/src/coreclr/src/vm/proftoeeinterfaceimpl.cpp
+++ b/src/coreclr/src/vm/proftoeeinterfaceimpl.cpp
@@ -4122,7 +4122,7 @@ HRESULT ProfToEEInterfaceImpl::GetModuleInfo2(ModuleID moduleId,
// Return the parent assembly for this module if desired.
if (pAssemblyId != NULL)
{
- // Lie and say the assembly isn't avaialable until we are loaded (even though it is.)
+ // Lie and say the assembly isn't available until we are loaded (even though it is.)
// This is for backward compatibilty - we may want to change it
if (pModule->IsProfilerNotified())
{
diff --git a/src/coreclr/src/vm/threads.cpp b/src/coreclr/src/vm/threads.cpp
index f6ffe1bb7203..b013e42351e9 100644
--- a/src/coreclr/src/vm/threads.cpp
+++ b/src/coreclr/src/vm/threads.cpp
@@ -6142,7 +6142,7 @@ size_t getStackHash(size_t* stackTrace, size_t* stackTop, size_t* stackStop, siz
NULL
);
- if (((UINT_PTR)g_hThisInst) != uImageBase)
+ if (((UINT_PTR)GetClrModuleBase()) != uImageBase)
{
break;
}
diff --git a/src/coreclr/src/vm/vars.cpp b/src/coreclr/src/vm/vars.cpp
index 6239469294e9..b684583c7d97 100644
--- a/src/coreclr/src/vm/vars.cpp
+++ b/src/coreclr/src/vm/vars.cpp
@@ -29,7 +29,6 @@ const char g_psBaseLibrarySatelliteAssemblyName[] = CoreLibSatelliteName_A;
Volatile g_TrapReturningThreads;
-HINSTANCE g_hThisInst;
BBSweep g_BBSweep;
#ifdef _DEBUG
diff --git a/src/coreclr/src/vm/vars.hpp b/src/coreclr/src/vm/vars.hpp
index ccf9289abab0..3b85c93adc5e 100644
--- a/src/coreclr/src/vm/vars.hpp
+++ b/src/coreclr/src/vm/vars.hpp
@@ -346,7 +346,6 @@ GARY_DECL(TypeHandle, g_pPredefinedArrayTypes, ELEMENT_TYPE_MAX);
extern "C" Volatile g_TrapReturningThreads;
-EXTERN HINSTANCE g_hThisInst;
EXTERN BBSweep g_BBSweep;
EXTERN IBCLogger g_IBCLogger;
diff --git a/src/coreclr/src/zap/zapper.cpp b/src/coreclr/src/zap/zapper.cpp
index c2e7308b7210..97b47cba71b7 100644
--- a/src/coreclr/src/zap/zapper.cpp
+++ b/src/coreclr/src/zap/zapper.cpp
@@ -450,7 +450,6 @@ void Zapper::LoadAndInitializeJITForNgen(LPCWSTR pwzJitName, OUT HINSTANCE* phJi
// Note: FEATURE_MERGE_JIT_AND_ENGINE is defined for the Desktop crossgen compilation as well.
//
PathString CoreClrFolder;
- extern HINSTANCE g_hThisInst;
#if !defined(FEATURE_MERGE_JIT_AND_ENGINE)
if (m_fDontLoadJit)
@@ -466,13 +465,11 @@ void Zapper::LoadAndInitializeJITForNgen(LPCWSTR pwzJitName, OUT HINSTANCE* phJi
}
else
#endif // !defined(FEATURE_MERGE_JIT_AND_ENGINE)
- if (WszGetModuleFileName(g_hThisInst, CoreClrFolder))
{
- hr = CopySystemDirectory(CoreClrFolder, CoreClrFolder);
+ hr = GetClrModuleDirectory(CoreClrFolder);
if (SUCCEEDED(hr))
{
CoreClrFolder.Append(pwzJitName);
-
}
}
diff --git a/src/installer/Directory.Build.props b/src/installer/Directory.Build.props
index 5d7e74fb27a4..319906aef654 100644
--- a/src/installer/Directory.Build.props
+++ b/src/installer/Directory.Build.props
@@ -58,7 +58,7 @@
- .exe
+ .exe
@@ -67,7 +67,7 @@
- win-$(TargetArchitecture)
+ win-$(TargetArchitecture)
osx-$(TargetArchitecture)
linux-$(TargetArchitecture)
freebsd-$(TargetArchitecture)
@@ -305,14 +305,14 @@
- .zip
- .tar.gz
- .msi
+ .zip
+ .tar.gz
+ .msi
.pkg
.deb
.rpm
- .exe
- $(InstallerExtension)
+ .exe
+ $(InstallerExtension)
@@ -331,18 +331,18 @@
- lib
+ lib
.so
- .dll
+ .dll
.dylib
lib
.a
- .lib
+ .lib
.map
- .ni.pdb
+ .ni.pdb
diff --git a/src/installer/corehost/cli/apphost/static/CMakeLists.txt b/src/installer/corehost/cli/apphost/static/CMakeLists.txt
index e1275f3289d4..bc91c6fffa0d 100644
--- a/src/installer/corehost/cli/apphost/static/CMakeLists.txt
+++ b/src/installer/corehost/cli/apphost/static/CMakeLists.txt
@@ -58,7 +58,7 @@ add_definitions(-DFEATURE_STATIC_HOST=1)
if(CLR_CMAKE_TARGET_WIN32)
# Disable manifest generation into the file .exe on Windows
add_linker_flag("/MANIFEST:NO")
-
+
get_property(ALL_COMPILE_OPTIONS TARGET ${PROJECT_NAME} PROPERTY COMPILE_OPTIONS)
string(TOUPPER ${RUNTIME_CONFIG} UPPERCASE_RUNTIME_CONFIG)
@@ -106,7 +106,7 @@ if (CLR_CMAKE_TARGET_WIN32 AND (CLR_CMAKE_TARGET_ARCH_ARM OR CLR_CMAKE_TARGET_AR
target_link_libraries(singlefilehost Advapi32.lib shell32.lib)
endif()
-# Path like: artifacts/bin/coreclr/Windows_NT.x64.Release/lib or
+# Path like: artifacts/bin/coreclr/windows.x64.Release/lib or
# /root/runtime/artifacts/transport/coreclr/lib
set(CORECLR_STATIC_LIB_LOCATION "${CORECLR_ARTIFACTS}/lib")
@@ -131,8 +131,8 @@ else()
set(CORECLR_LIBRARIES
${CORECLR_STATIC_LIB_LOCATION}/libcoreclr_static.a
${CORECLR_STATIC_LIB_LOCATION}/libSystem.Globalization.Native.a
- ${CORECLR_STATIC_LIB_LOCATION}/libcoreclrpal.a
${CORECLR_STATIC_LIB_LOCATION}/libpalrt.a
+ ${CORECLR_STATIC_LIB_LOCATION}/libcoreclrpal.a
${CORECLR_STATIC_LIB_LOCATION}/libeventprovider.a
${CORECLR_STATIC_LIB_LOCATION}/libnativeresourcestring.a
)
@@ -143,22 +143,24 @@ if(CLR_CMAKE_TARGET_OSX)
find_library(CORESERVICES CoreServices)
find_library(SECURITY Security)
find_library(SYSTEM System)
-
+
LIST(APPEND CORECLR_LIBRARIES
${COREFOUNDATION}
${CORESERVICES}
${SECURITY}
${SYSTEM}
)
-endif(CLR_CMAKE_TARGET_OSX)
-
-if(CLR_CMAKE_TARGET_NETBSD)
+elseif(CLR_CMAKE_TARGET_NETBSD)
find_library(KVM kvm)
-
+
LIST(APPEND CORECLR_LIBRARIES
${KVM}
)
-endif(CLR_CMAKE_TARGET_NETBSD)
+elseif (CLR_CMAKE_TARGET_SUNOS)
+ LIST(APPEND CORECLR_LIBRARIES
+ socket
+ )
+endif(CLR_CMAKE_TARGET_OSX)
# On *BSD, we always use the libunwind that's part of the OS
if(CLR_CMAKE_TARGET_FREEBSD)
@@ -199,7 +201,7 @@ else()
# elseif (CLR_CMAKE_TARGET_UNIX)
# find_package(ZLIB REQUIRED)
# endif ()
-
+
# Additional requirements for System.Net.Security.Native
if (HAVE_GSSFW_HEADERS)
find_library(LIBGSS NAMES GSS)
@@ -217,7 +219,7 @@ else()
message(FATAL_ERROR "Cannot find libgssapi_krb5 and System.Net.Security.Native cannot build without it. Try installing libkrb5-dev (or the appropriate package for your platform)")
endif()
endif()
-
+
# Additional requirements for System.Native
if (CLR_CMAKE_TARGET_LINUX AND NOT CLR_CMAKE_TARGET_ANDROID)
set(NATIVE_LIBS_EXTRA
diff --git a/src/installer/corehost/cli/hostpolicy/args.cpp b/src/installer/corehost/cli/hostpolicy/args.cpp
index abe478509fd5..01c5b48c40de 100644
--- a/src/installer/corehost/cli/hostpolicy/args.cpp
+++ b/src/installer/corehost/cli/hostpolicy/args.cpp
@@ -90,7 +90,7 @@ bool parse_arguments(
args.app_argv = &argv[2];
}
- return init_arguments(
+ bool success = init_arguments(
managed_application_path,
init.host_info,
init.tfm,
@@ -100,6 +100,10 @@ bool parse_arguments(
init.probe_paths,
/* init_from_file_system */ false,
args);
+ if (success)
+ args.trace();
+
+ return success;
}
bool set_root_from_app(const pal::string_t& managed_application_path,
diff --git a/src/installer/corehost/cli/hostpolicy/hostpolicy.cpp b/src/installer/corehost/cli/hostpolicy/hostpolicy.cpp
index 3c9c84ed42b1..c2ce9db4a07a 100644
--- a/src/installer/corehost/cli/hostpolicy/hostpolicy.cpp
+++ b/src/installer/corehost/cli/hostpolicy/hostpolicy.cpp
@@ -123,7 +123,6 @@ namespace
if (!parse_arguments(hostpolicy_init, argc, argv, args))
return StatusCode::LibHostInvalidArgs;
- args.trace();
if (out_args != nullptr)
*out_args = args;
@@ -443,8 +442,6 @@ SHARED_API int HOSTPOLICY_CALLTYPE corehost_main_with_output_buffer(const int ar
if (!parse_arguments(g_init, argc, argv, args))
return StatusCode::LibHostInvalidArgs;
- args.trace();
-
pal::string_t output_string;
rc = run_host_command(g_init, args, &output_string);
if (rc != StatusCode::Success)
@@ -476,7 +473,7 @@ SHARED_API int HOSTPOLICY_CALLTYPE corehost_main_with_output_buffer(const int ar
return rc;
}
-int corehost_libhost_init(const hostpolicy_init_t &hostpolicy_init, const pal::string_t& location)
+void trace_corehost_libhost_init(const hostpolicy_init_t &hostpolicy_init, const pal::string_t& location)
{
// Host info should always be valid in the delegate scenario
assert(hostpolicy_init.host_info.is_valid(host_mode_t::libhost));
@@ -485,7 +482,6 @@ int corehost_libhost_init(const hostpolicy_init_t &hostpolicy_init, const pal::s
assert(!bundle::info_t::is_single_file_bundle());
trace_corehost_init(hostpolicy_init, 0, nullptr, location);
- return StatusCode::Success;
}
namespace
@@ -736,10 +732,9 @@ SHARED_API int HOSTPOLICY_CALLTYPE corehost_initialize(const corehost_initialize
// Trace entry point information using previously set init information.
// This function does not modify any global state.
- int rc = corehost_libhost_init(g_init, _X("corehost_initialize"));
- if (rc != StatusCode::Success)
- return rc;
+ trace_corehost_libhost_init(g_init, _X("corehost_initialize"));
+ int rc;
if (wait_for_initialized)
{
// Wait for context initialization to complete
diff --git a/src/installer/corehost/corehost.proj b/src/installer/corehost/corehost.proj
index d2f49622c3e7..43346190a843 100644
--- a/src/installer/corehost/corehost.proj
+++ b/src/installer/corehost/corehost.proj
@@ -23,7 +23,7 @@
BuildCoreHostWindows" />
$(IntermediateOutputRootPath)corehost\cmake\
@@ -50,7 +50,7 @@
@@ -108,7 +108,7 @@
#include <Windows.h>
diff --git a/src/installer/pkg/packaging/installers.proj b/src/installer/pkg/packaging/installers.proj
index dbae53d0852e..a3494e48efae 100644
--- a/src/installer/pkg/packaging/installers.proj
+++ b/src/installer/pkg/packaging/installers.proj
@@ -32,7 +32,7 @@
-
+
-
+
-
+
-
+
@@ -137,22 +137,22 @@
-
+
-
-
-
-
@@ -195,7 +195,7 @@
+ Condition="'$(TargetOS)'=='windows'">
+ Condition="'$(TargetOS)'!='windows'">
diff --git a/src/installer/pkg/projects/Microsoft.NETCore.DotNetAppHost/Microsoft.NETCore.DotNetAppHost.props b/src/installer/pkg/projects/Microsoft.NETCore.DotNetAppHost/Microsoft.NETCore.DotNetAppHost.props
index abf841cbd26e..3f6f90f8cf47 100644
--- a/src/installer/pkg/projects/Microsoft.NETCore.DotNetAppHost/Microsoft.NETCore.DotNetAppHost.props
+++ b/src/installer/pkg/projects/Microsoft.NETCore.DotNetAppHost/Microsoft.NETCore.DotNetAppHost.props
@@ -10,7 +10,7 @@
-
+
diff --git a/src/installer/pkg/projects/netcoreapp/Directory.Build.props b/src/installer/pkg/projects/netcoreapp/Directory.Build.props
index 63ce1c404aba..36885e8e8b63 100644
--- a/src/installer/pkg/projects/netcoreapp/Directory.Build.props
+++ b/src/installer/pkg/projects/netcoreapp/Directory.Build.props
@@ -6,7 +6,7 @@
Installer uses Unix when applicable, but others go straight to Linux.
-->
- Windows_NT
+ windows
Linux
OSX
iOS
diff --git a/src/installer/pkg/projects/netcoreapp/pkg/Microsoft.NETCore.App.Crossgen2.pkgproj b/src/installer/pkg/projects/netcoreapp/pkg/Microsoft.NETCore.App.Crossgen2.pkgproj
index 84db7659fd67..32a1ce3ac47d 100644
--- a/src/installer/pkg/projects/netcoreapp/pkg/Microsoft.NETCore.App.Crossgen2.pkgproj
+++ b/src/installer/pkg/projects/netcoreapp/pkg/Microsoft.NETCore.App.Crossgen2.pkgproj
@@ -44,7 +44,7 @@
unix
- win
+ win
diff --git a/src/installer/signing/Directory.Build.targets b/src/installer/signing/Directory.Build.targets
index 91473940ef2c..7d95c6c7b7f9 100644
--- a/src/installer/signing/Directory.Build.targets
+++ b/src/installer/signing/Directory.Build.targets
@@ -47,7 +47,7 @@
diff --git a/src/installer/tests/Assets/TestProjects/AppWithSubDirs/Directory.Build.props b/src/installer/tests/Assets/TestProjects/AppWithSubDirs/Directory.Build.props
deleted file mode 100644
index de2e4580b9be..000000000000
--- a/src/installer/tests/Assets/TestProjects/AppWithSubDirs/Directory.Build.props
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
- false
-
-
-
-
-
diff --git a/src/installer/tests/Assets/TestProjects/AppWithWait/Directory.Build.props b/src/installer/tests/Assets/TestProjects/AppWithWait/Directory.Build.props
deleted file mode 100644
index de2e4580b9be..000000000000
--- a/src/installer/tests/Assets/TestProjects/AppWithWait/Directory.Build.props
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
- false
-
-
-
-
-
diff --git a/src/installer/tests/Assets/TestProjects/SingleFileApiTests/Directory.Build.props b/src/installer/tests/Assets/TestProjects/SingleFileApiTests/Directory.Build.props
deleted file mode 100644
index de2e4580b9be..000000000000
--- a/src/installer/tests/Assets/TestProjects/SingleFileApiTests/Directory.Build.props
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
- false
-
-
-
-
-
diff --git a/src/installer/tests/Assets/TestProjects/StandaloneApp20/Directory.Build.props b/src/installer/tests/Assets/TestProjects/StandaloneApp20/Directory.Build.props
deleted file mode 100644
index 1162811d9202..000000000000
--- a/src/installer/tests/Assets/TestProjects/StandaloneApp20/Directory.Build.props
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
- false
-
-
-
-
-
diff --git a/src/installer/tests/Assets/TestProjects/StandaloneApp21/Directory.Build.props b/src/installer/tests/Assets/TestProjects/StandaloneApp21/Directory.Build.props
deleted file mode 100644
index 1162811d9202..000000000000
--- a/src/installer/tests/Assets/TestProjects/StandaloneApp21/Directory.Build.props
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
- false
-
-
-
-
-
diff --git a/src/installer/tests/Assets/TestProjects/StandaloneApp3x/Directory.Build.props b/src/installer/tests/Assets/TestProjects/StandaloneApp3x/Directory.Build.props
deleted file mode 100644
index 1162811d9202..000000000000
--- a/src/installer/tests/Assets/TestProjects/StandaloneApp3x/Directory.Build.props
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-
-
- false
-
-
-
-
-
diff --git a/src/installer/tests/Assets/TestUtils/MNADeprecationWorkaround.props b/src/installer/tests/Assets/TestUtils/MNADeprecationWorkaround.props
deleted file mode 100644
index e852ac840f12..000000000000
--- a/src/installer/tests/Assets/TestUtils/MNADeprecationWorkaround.props
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
- true
- true
- true
-
-
-
diff --git a/src/installer/tests/Assets/TestUtils/TestProjects.props b/src/installer/tests/Assets/TestUtils/TestProjects.props
index 46ff75003576..72150d0f0b52 100644
--- a/src/installer/tests/Assets/TestUtils/TestProjects.props
+++ b/src/installer/tests/Assets/TestUtils/TestProjects.props
@@ -7,7 +7,6 @@
-->
-
ha
true
diff --git a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LockFileRegion.cs b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LockFileRegion.cs
index 42da9643d9cc..3276275f284c 100644
--- a/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LockFileRegion.cs
+++ b/src/libraries/Common/src/Interop/Unix/System.Native/Interop.LockFileRegion.cs
@@ -9,6 +9,7 @@ internal static partial class Sys
{
internal enum LockType : short
{
+ F_RDLCK = 0, // shared or read lock
F_WRLCK = 1, // exclusive or write lock
F_UNLCK = 2 // unlock
}
diff --git a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptHash.cs b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptHash.cs
index 9de166a66fb3..e018062b9c7d 100644
--- a/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptHash.cs
+++ b/src/libraries/Common/src/Interop/Windows/BCrypt/Interop.BCryptHash.cs
@@ -12,7 +12,7 @@ internal partial class BCrypt
internal static unsafe extern NTSTATUS BCryptHash(nuint hAlgorithm, byte* pbSecret, int cbSecret, byte* pbInput, int cbInput, byte* pbOutput, int cbOutput);
// Pseudo-handles, as defined in bcrypt.h
- // TODO: This really should be backed by 'nuint' (see https://github.com/dotnet/roslyn/issues/44651)
+ // TODO: This really should be backed by 'nuint' (see https://github.com/dotnet/roslyn/issues/44110)
public enum BCryptAlgPseudoHandle : uint
{
BCRYPT_MD5_ALG_HANDLE = 0x00000021,
diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FILE_END_OF_FILE_INFO.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FILE_END_OF_FILE_INFO.cs
new file mode 100644
index 000000000000..5683bb20653c
--- /dev/null
+++ b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.FILE_END_OF_FILE_INFO.cs
@@ -0,0 +1,17 @@
+// 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 Kernel32
+ {
+ // From FILE_INFO_BY_HANDLE_CLASS
+ // Use for SetFileInformationByHandle
+ internal const int FileEndOfFileInfo = 6;
+
+ internal struct FILE_END_OF_FILE_INFO
+ {
+ internal long EndOfFile;
+ }
+ }
+}
diff --git a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetEndOfFile.cs b/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetEndOfFile.cs
deleted file mode 100644
index 7ba5014d62fe..000000000000
--- a/src/libraries/Common/src/Interop/Windows/Kernel32/Interop.SetEndOfFile.cs
+++ /dev/null
@@ -1,14 +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 Microsoft.Win32.SafeHandles;
-using System.Runtime.InteropServices;
-
-internal static partial class Interop
-{
- internal static partial class Kernel32
- {
- [DllImport(Libraries.Kernel32, SetLastError = true)]
- internal static extern bool SetEndOfFile(SafeFileHandle hFile);
- }
-}
diff --git a/src/libraries/Common/src/System/Runtime/InteropServices/ComEventsMethod.cs b/src/libraries/Common/src/System/Runtime/InteropServices/ComEventsMethod.cs
index d30c4114f6a6..22281c58e316 100644
--- a/src/libraries/Common/src/System/Runtime/InteropServices/ComEventsMethod.cs
+++ b/src/libraries/Common/src/System/Runtime/InteropServices/ComEventsMethod.cs
@@ -57,9 +57,9 @@ public DelegateWrapper(Delegate d, bool wrapArgs)
{
for (int i = 0; i < _expectedParamsCount; i++)
{
- if (_cachedTargetTypes[i] != null)
+ if (_cachedTargetTypes[i] is Type t)
{
- args[i] = Enum.ToObject(_cachedTargetTypes[i]!, args[i]); // TODO-NULLABLE: Indexer nullability tracked (https://github.com/dotnet/roslyn/issues/34644)
+ args[i] = Enum.ToObject(t, args[i]);
}
}
}
diff --git a/src/libraries/Common/src/System/Security/Cryptography/Asn1/AsnXml.targets b/src/libraries/Common/src/System/Security/Cryptography/Asn1/AsnXml.targets
index 071432c841e8..5190f7be8f83 100644
--- a/src/libraries/Common/src/System/Security/Cryptography/Asn1/AsnXml.targets
+++ b/src/libraries/Common/src/System/Security/Cryptography/Asn1/AsnXml.targets
@@ -21,7 +21,7 @@
XmlInputPaths="@(AsnXml)"
OutputPaths="@(AsnXml -> '$(IntermediateOutputPath)asnxml\%(filename).cs')" />
-
@@ -29,7 +29,7 @@
-
+
<_AsnXmlDiffCode Include="1" />
diff --git a/src/libraries/Common/tests/Common.Tests.csproj b/src/libraries/Common/tests/Common.Tests.csproj
index 12e815eb4a55..9dd6f6fe48cd 100644
--- a/src/libraries/Common/tests/Common.Tests.csproj
+++ b/src/libraries/Common/tests/Common.Tests.csproj
@@ -2,7 +2,7 @@
true
true
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)-OSX
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-Browser;$(NetCoreAppCurrent)-OSX
annotations
diff --git a/src/libraries/Common/tests/StaticTestGenerator/Program.cs b/src/libraries/Common/tests/StaticTestGenerator/Program.cs
index 2ad4fd66d592..1c25d5ccd4cd 100644
--- a/src/libraries/Common/tests/StaticTestGenerator/Program.cs
+++ b/src/libraries/Common/tests/StaticTestGenerator/Program.cs
@@ -273,7 +273,7 @@ from part in line.Split(' ')
// Invalid command line arguments.
Console.WriteLine("Usage: ");
Console.WriteLine(" Example:");
- Console.WriteLine(@" dotnet run d:\tmpoutput d:\repos\runtime\artifacts\bin\testhost\net6.0-Windows_NT-Debug-x64\shared\Microsoft.NETCore.App\6.0.0\ d:\repos\runtime\artifacts\bin\System.Runtime.Tests\net6.0-Windows_NT-Debug\System.Runtime.Tests.dll");
+ Console.WriteLine(@" dotnet run d:\tmpoutput d:\repos\runtime\artifacts\bin\testhost\net6.0-windows-Debug-x64\shared\Microsoft.NETCore.App\6.0.0\ d:\repos\runtime\artifacts\bin\System.Runtime.Tests\net6.0-windows-Debug\System.Runtime.Tests.dll");
testAssemblyPath = string.Empty;
runtimeAssembliesPath = string.Empty;
outputPath = string.Empty;
diff --git a/src/libraries/Common/tests/StaticTestGenerator/README.md b/src/libraries/Common/tests/StaticTestGenerator/README.md
index 73a82c4d4258..141f3602edfb 100644
--- a/src/libraries/Common/tests/StaticTestGenerator/README.md
+++ b/src/libraries/Common/tests/StaticTestGenerator/README.md
@@ -22,16 +22,16 @@ From within the utility directory, run the utility with the arguments:
For example:
```
-dotnet run d:\output "d:\repos\runtime\artifacts\bin\testhost\net5.0-Windows_NT-Debug-x64\shared\Microsoft.NETCore.App\5.0.0" "d:\repos\runtime\artifacts\bin\System.Runtime.Tests\net5.0-Windows_NT-Debug\System.Runtime.Tests.dll"
+dotnet run d:\output "d:\repos\runtime\artifacts\bin\testhost\net5.0-windows-Debug-x64\shared\Microsoft.NETCore.App\5.0.0" "d:\repos\runtime\artifacts\bin\System.Runtime.Tests\net5.0-windows-Debug\System.Runtime.Tests.dll"
```
This will run the tool and result in output written to the console like:
```
-3/27/2019 10:55:37 PM | Test assembly path : d:\repos\runtime\artifacts\bin\System.Runtime.Tests\net5.0-Windows_NT-Debug\System.Runtime.Tests.dll
-3/27/2019 10:55:37 PM | Helper assemblies path: d:\repos\runtime\artifacts\bin\testhost\net5.0-Windows_NT-Debug-x64\shared\Microsoft.NETCore.App\3.0.0\
+3/27/2019 10:55:37 PM | Test assembly path : d:\repos\runtime\artifacts\bin\System.Runtime.Tests\net5.0-windows-Debug\System.Runtime.Tests.dll
+3/27/2019 10:55:37 PM | Helper assemblies path: d:\repos\runtime\artifacts\bin\testhost\net5.0-windows-Debug-x64\shared\Microsoft.NETCore.App\3.0.0\
3/27/2019 10:55:37 PM | Output path : d:\output\System.Runtime.Tests\
-3/27/2019 10:55:37 PM | Xunit arguments : d:\repos\runtime\artifacts\bin\System.Runtime.Tests\net5.0-Windows_NT-Debug\System.Runtime.Tests.dll -notrait category=nonnetcoreapptests -notrait category=nonwindowstests -notrait category=IgnoreForCI -notrait category=failing -notrait category=OuterLoop
+3/27/2019 10:55:37 PM | Xunit arguments : d:\repos\runtime\artifacts\bin\System.Runtime.Tests\net5.0-windows-Debug\System.Runtime.Tests.dll -notrait category=nonnetcoreapptests -notrait category=nonwindowstests -notrait category=IgnoreForCI -notrait category=failing -notrait category=OuterLoop
3/27/2019 10:55:37 PM |
-3/27/2019 10:55:37 PM | Loaded System.Runtime.Tests from d:\repos\runtime\artifacts\bin\System.Runtime.Tests\net5.0-Windows_NT-Debug\System.Runtime.Tests.dll
+3/27/2019 10:55:37 PM | Loaded System.Runtime.Tests from d:\repos\runtime\artifacts\bin\System.Runtime.Tests\net5.0-windows-Debug\System.Runtime.Tests.dll
3/27/2019 10:55:37 PM | Found 5322 test methods.
3/27/2019 10:55:38 PM | Found 3469 InlineDatas / 949 MethodDatas across 5322 test methods.
3/27/2019 10:55:38 PM |
diff --git a/src/libraries/Common/tests/System/Net/Http/DribbleStream.cs b/src/libraries/Common/tests/System/Net/Http/DribbleStream.cs
index ed8a938d41ab..d2e12d8cb99f 100644
--- a/src/libraries/Common/tests/System/Net/Http/DribbleStream.cs
+++ b/src/libraries/Common/tests/System/Net/Http/DribbleStream.cs
@@ -10,42 +10,28 @@ namespace System.Net.Http.Functional.Tests
public sealed class DribbleStream : Stream
{
private readonly Stream _wrapped;
- private readonly bool _clientDisconnectAllowed;
- public DribbleStream(Stream wrapped, bool clientDisconnectAllowed = false)
+ public DribbleStream(Stream wrapped)
{
_wrapped = wrapped;
- _clientDisconnectAllowed = clientDisconnectAllowed;
}
public override async Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
{
- try
- {
- for (int i = 0; i < count; i++)
- {
- await _wrapped.WriteAsync(buffer, offset + i, 1);
- await _wrapped.FlushAsync();
- await Task.Yield(); // introduce short delays, enough to send packets individually but not so long as to extend test duration significantly
- }
- }
- catch (IOException) when (_clientDisconnectAllowed)
+ for (int i = 0; i < count; i++)
{
+ await _wrapped.WriteAsync(buffer, offset + i, 1);
+ await _wrapped.FlushAsync();
+ await Task.Yield(); // introduce short delays, enough to send packets individually but not so long as to extend test duration significantly
}
}
public override void Write(byte[] buffer, int offset, int count)
{
- try
- {
- for (int i = 0; i < count; i++)
- {
- _wrapped.Write(buffer, offset + i, 1);
- _wrapped.Flush();
- }
- }
- catch (IOException) when (_clientDisconnectAllowed)
+ for (int i = 0; i < count; i++)
{
+ _wrapped.Write(buffer, offset + i, 1);
+ _wrapped.Flush();
}
}
diff --git a/src/libraries/Common/tests/System/Net/Http/HttpProtocolTests.cs b/src/libraries/Common/tests/System/Net/Http/HttpProtocolTests.cs
index 0baba0fe43b8..4eb602cb55f0 100644
--- a/src/libraries/Common/tests/System/Net/Http/HttpProtocolTests.cs
+++ b/src/libraries/Common/tests/System/Net/Http/HttpProtocolTests.cs
@@ -15,7 +15,6 @@ namespace System.Net.Http.Functional.Tests
public abstract class HttpProtocolTests : HttpClientHandlerTestBase
{
protected virtual Stream GetStream(Stream s) => s;
- protected virtual Stream GetStream_ClientDisconnectOk(Stream s) => s;
public HttpProtocolTests(ITestOutputHelper output) : base(output) { }
@@ -70,31 +69,22 @@ await LoopbackServer.CreateServerAsync(async (server, url) =>
[InlineData(0)]
[InlineData(1)]
[InlineData(9)]
- public async Task GetAsync_RequestVersion0X_ThrowsOr11(int minorVersion)
+ public async Task GetAsync_RequestVersion0X_ThrowsNotSupportedException(int minorVersion)
{
- await LoopbackServer.CreateServerAsync(async (server, url) =>
+ if (IsWinHttpHandler)
{
- using (HttpClient client = CreateHttpClient())
- {
- HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, url);
- request.Version = new Version(0, minorVersion);
+ return;
+ }
- Task getResponseTask = client.SendAsync(TestAsync, request);
- Task> serverTask = server.AcceptConnectionSendResponseAndCloseAsync();
+ using (HttpClient client = CreateHttpClient())
+ {
+ HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, "http://nosuchhost.invalid");
+ request.Version = new Version(0, minorVersion);
- if (IsWinHttpHandler)
- {
- await TestHelper.WhenAllCompletedOrAnyFailed(getResponseTask, serverTask);
- var requestLines = await serverTask;
- Assert.Equal($"GET {url.PathAndQuery} HTTP/1.1", requestLines[0]);
- }
- else
- {
- // Await only client side that will throw. Nothing will get to the server side due to this exception thus do not await it at all.
- await Assert.ThrowsAsync(() => getResponseTask);
- }
- }
- }, new LoopbackServer.Options { StreamWrapper = GetStream_ClientDisconnectOk});
+ Task getResponseTask = client.SendAsync(TestAsync, request);
+
+ await Assert.ThrowsAsync(() => getResponseTask);
+ }
}
[Theory]
@@ -105,7 +95,7 @@ await LoopbackServer.CreateServerAsync(async (server, url) =>
[InlineData(2, 7)]
[InlineData(3, 0)]
[InlineData(4, 2)]
- public async Task GetAsync_UnknownRequestVersion_ThrowsOrDegradesTo11(int majorVersion, int minorVersion)
+ public async Task GetAsync_UnknownRequestVersion_DegradesTo11(int majorVersion, int minorVersion)
{
// Sync API supported only up to HTTP/1.1
if (!TestAsync && majorVersion >= 2)
@@ -113,8 +103,6 @@ public async Task GetAsync_UnknownRequestVersion_ThrowsOrDegradesTo11(int majorV
return;
}
- Type exceptionType = null;
-
await LoopbackServer.CreateServerAsync(async (server, url) =>
{
using (HttpClient client = CreateHttpClient())
@@ -125,18 +113,11 @@ await LoopbackServer.CreateServerAsync(async (server, url) =>
Task getResponseTask = client.SendAsync(TestAsync, request);
Task> serverTask = server.AcceptConnectionSendResponseAndCloseAsync();
- if (exceptionType == null)
- {
- await TestHelper.WhenAllCompletedOrAnyFailed(getResponseTask, serverTask);
- var requestLines = await serverTask;
- Assert.Equal($"GET {url.PathAndQuery} HTTP/1.1", requestLines[0]);
- }
- else
- {
- await Assert.ThrowsAsync(exceptionType, (() => TestHelper.WhenAllCompletedOrAnyFailed(getResponseTask, serverTask)));
- }
+ await TestHelper.WhenAllCompletedOrAnyFailed(getResponseTask, serverTask);
+ var requestLines = await serverTask;
+ Assert.Equal($"GET {url.PathAndQuery} HTTP/1.1", requestLines[0]);
}
- }, new LoopbackServer.Options { StreamWrapper = GetStream_ClientDisconnectOk });
+ }, new LoopbackServer.Options { StreamWrapper = GetStream });
}
[Theory]
@@ -204,44 +185,9 @@ await LoopbackServer.CreateServerAsync(async (server, url) =>
}
[Theory]
- [InlineData(0)]
- [InlineData(1)]
- [InlineData(9)]
- public async Task GetAsync_ResponseVersion0X_ThrowsOr10(int responseMinorVersion)
- {
- bool reportAs10 = false;
-
- await LoopbackServer.CreateServerAsync(async (server, url) =>
- {
- using (HttpClient client = CreateHttpClient())
- {
- HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, url);
- request.Version = HttpVersion.Version11;
-
- Task getResponseTask = client.SendAsync(TestAsync, request);
- Task> serverTask =
- server.AcceptConnectionSendCustomResponseAndCloseAsync(
- $"HTTP/0.{responseMinorVersion} 200 OK\r\nConnection: close\r\nDate: {DateTimeOffset.UtcNow:R}\r\nContent-Length: 0\r\n\r\n");
-
- if (reportAs10)
- {
- await TestHelper.WhenAllCompletedOrAnyFailed(getResponseTask, serverTask);
-
- using (HttpResponseMessage response = await getResponseTask)
- {
- Assert.Equal(1, response.Version.Major);
- Assert.Equal(0, response.Version.Minor);
- }
- }
- else
- {
- await Assert.ThrowsAsync(async () => await TestHelper.WhenAllCompletedOrAnyFailed(getResponseTask, serverTask));
- }
- }
- }, new LoopbackServer.Options { StreamWrapper = GetStream_ClientDisconnectOk });
- }
-
- [Theory]
+ [InlineData(0, 0)]
+ [InlineData(0, 1)]
+ [InlineData(0, 9)]
[InlineData(2, 0)]
[InlineData(2, 1)]
[InlineData(3, 0)]
@@ -260,9 +206,9 @@ await LoopbackServer.CreateServerAsync(async (server, url) =>
server.AcceptConnectionSendCustomResponseAndCloseAsync(
$"HTTP/{responseMajorVersion}.{responseMinorVersion} 200 OK\r\nConnection: close\r\nDate: {DateTimeOffset.UtcNow:R}\r\nContent-Length: 0\r\n\r\n");
- await Assert.ThrowsAsync(async () => await TestHelper.WhenAllCompletedOrAnyFailed(getResponseTask, serverTask));
+ await Assert.ThrowsAsync(() => getResponseTask);
}
- }, new LoopbackServer.Options { StreamWrapper = GetStream_ClientDisconnectOk });
+ }, new LoopbackServer.Options { StreamWrapper = GetStream });
}
[Theory]
@@ -547,6 +493,5 @@ public abstract class HttpProtocolTests_Dribble : HttpProtocolTests
public HttpProtocolTests_Dribble(ITestOutputHelper output) : base(output) { }
protected override Stream GetStream(Stream s) => new DribbleStream(s);
- protected override Stream GetStream_ClientDisconnectOk(Stream s) => new DribbleStream(s, true);
}
}
diff --git a/src/libraries/Common/tests/System/Net/Sockets/TestSettings.cs b/src/libraries/Common/tests/System/Net/Sockets/TestSettings.cs
index fc126133d2c8..0accade3d3f4 100644
--- a/src/libraries/Common/tests/System/Net/Sockets/TestSettings.cs
+++ b/src/libraries/Common/tests/System/Net/Sockets/TestSettings.cs
@@ -11,14 +11,6 @@ public static class TestSettings
public const int PassingTestTimeout = 10000;
public const int FailingTestTimeout = 100;
- // Number of redundant UDP packets to send to increase test reliability
- // Update: was 10, changing to 1 to measure impact of random test failures occurring on *nix.
- // Certain random failures appear to be caused by a UDP client sending in a loop (based on UDPRedundancy)
- // to a server which was closed but another server created (on a different thread \ test) that happens to
- // have the same port #.
- // This occurs on *nix but not Windows because *nix uses random values (1024-65535) while Windows increments.
- public const int UDPRedundancy = 1;
-
public static Task WhenAllOrAnyFailedWithTimeout(params Task[] tasks) => tasks.WhenAllOrAnyFailed(PassingTestTimeout);
}
}
diff --git a/src/libraries/Common/tests/Tests/System/IO/StreamConformanceTests.cs b/src/libraries/Common/tests/Tests/System/IO/StreamConformanceTests.cs
index 9df2a9c3062a..cdee18345390 100644
--- a/src/libraries/Common/tests/Tests/System/IO/StreamConformanceTests.cs
+++ b/src/libraries/Common/tests/Tests/System/IO/StreamConformanceTests.cs
@@ -1,10 +1,14 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+#nullable enable
+using System.Buffers;
using System.Collections;
using System.Collections.Generic;
+using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
using System.Security.Cryptography;
using System.Text;
using System.Threading;
@@ -15,7 +19,7 @@ namespace System.IO.Tests
{
/// Base class providing tests for any Stream-derived type.
[PlatformSpecific(~TestPlatforms.Browser)] // lots of operations aren't supported on browser
- public abstract class StreamConformanceTests
+ public abstract class StreamConformanceTests : FileCleanupTestBase
{
/// Gets the name of the byte[] argument to Read/Write methods.
protected virtual string ReadWriteBufferName => "buffer";
@@ -52,11 +56,15 @@ public abstract class StreamConformanceTests
protected virtual bool CanGetPositionWhenCanSeekIsFalse => false;
/// Gets whether read/write operations fully support cancellation.
protected virtual bool FullyCancelableOperations => true;
+ /// Gets whether a read operation will always try to fill the full buffer provided.
+ protected virtual bool ReadsReadUntilSizeOrEof => true;
/// Gets whether the stream's CanRead/Write/etc properties are expected to return false once the stream is disposed.
protected virtual bool CansReturnFalseAfterDispose => true;
/// Gets whether the Stream may be used for additional operations after a read is canceled.
protected virtual bool UsableAfterCanceledReads => true;
+ protected virtual bool CanSetLength => CanSeek;
+ protected virtual bool CanSetLengthGreaterThanCapacity => CanSetLength;
/// Specifies the form of the read/write operation to use.
public enum ReadWriteMode
@@ -77,6 +85,180 @@ public enum ReadWriteMode
AsyncAPM
}
+ public static IEnumerable
-
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 21f02af2c4f4..e8315bf8ae6d 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
@@ -15,7 +15,6 @@
-
.
///
public TimeSpan ShutdownTimeout { get; set; } = TimeSpan.FromSeconds(5);
+
+ internal void Initialize(IConfiguration configuration)
+ {
+ var timeoutSeconds = configuration["shutdownTimeoutSeconds"];
+ if (!string.IsNullOrEmpty(timeoutSeconds)
+ && int.TryParse(timeoutSeconds, NumberStyles.None, CultureInfo.InvariantCulture, out var seconds))
+ {
+ ShutdownTimeout = TimeSpan.FromSeconds(seconds);
+ }
+ }
}
}
diff --git a/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/HostTests.cs b/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/HostTests.cs
index 258eb06dce33..5f273875a4f1 100644
--- a/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/HostTests.cs
+++ b/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/HostTests.cs
@@ -13,6 +13,7 @@
using Microsoft.Extensions.Configuration.UserSecrets;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Options;
using Xunit;
namespace Microsoft.Extensions.Hosting.Tests
@@ -251,6 +252,24 @@ string SaveRandomSecret()
Assert.Equal(dynamicSecretMessage2, config["Hello"]);
}
+ [Fact]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/34580", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
+ public void CreateDefaultBuilder_RespectShutdownTimeout()
+ {
+ var notDefaultTimeoutSeconds = 99;
+ Assert.True(notDefaultTimeoutSeconds != new HostOptions().ShutdownTimeout.TotalSeconds, "Test value must be not equal to default");
+ var host = Host.CreateDefaultBuilder().ConfigureHostConfiguration(configBuilder =>
+ {
+ configBuilder.AddInMemoryCollection(new KeyValuePair[]
+ {
+ new KeyValuePair("SHUTDOWNTIMEOUTSECONDS", notDefaultTimeoutSeconds.ToString())
+ });
+ }).Build();
+
+ var hostOptions = host.Services.GetRequiredService>();
+ Assert.Equal(notDefaultTimeoutSeconds, hostOptions.Value.ShutdownTimeout.TotalSeconds);
+ }
+
internal class ServiceA { }
internal class ServiceB
diff --git a/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/Microsoft.Extensions.Hosting.Unit.Tests.csproj b/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/Microsoft.Extensions.Hosting.Unit.Tests.csproj
index b5365cdda844..8038a16a4d5a 100644
--- a/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/Microsoft.Extensions.Hosting.Unit.Tests.csproj
+++ b/src/libraries/Microsoft.Extensions.Hosting/tests/UnitTests/Microsoft.Extensions.Hosting.Unit.Tests.csproj
@@ -1,7 +1,7 @@
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent);net461
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);net461
true
diff --git a/src/libraries/Microsoft.Extensions.Logging/tests/Common/Microsoft.Extensions.Logging.Tests.csproj b/src/libraries/Microsoft.Extensions.Logging/tests/Common/Microsoft.Extensions.Logging.Tests.csproj
index 83ceb2b24735..58364d61b28e 100644
--- a/src/libraries/Microsoft.Extensions.Logging/tests/Common/Microsoft.Extensions.Logging.Tests.csproj
+++ b/src/libraries/Microsoft.Extensions.Logging/tests/Common/Microsoft.Extensions.Logging.Tests.csproj
@@ -1,7 +1,7 @@
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent);net461
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);net461
true
diff --git a/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft.VisualBasic.Core.vbproj b/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft.VisualBasic.Core.vbproj
index 4a43d5cc1140..0243aff0faea 100644
--- a/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft.VisualBasic.Core.vbproj
+++ b/src/libraries/Microsoft.VisualBasic.Core/src/Microsoft.VisualBasic.Core.vbproj
@@ -17,7 +17,7 @@
Microsoft.VisualBasic.Core
false
- $(NetCoreAppCurrent);$(NetCoreAppCurrent)-Windows_NT
+ $(NetCoreAppCurrent);$(NetCoreAppCurrent)-windows
diff --git a/src/libraries/Microsoft.Win32.Primitives/src/Microsoft.Win32.Primitives.csproj b/src/libraries/Microsoft.Win32.Primitives/src/Microsoft.Win32.Primitives.csproj
index e266af65df13..5b8b97b8c98e 100644
--- a/src/libraries/Microsoft.Win32.Primitives/src/Microsoft.Win32.Primitives.csproj
+++ b/src/libraries/Microsoft.Win32.Primitives/src/Microsoft.Win32.Primitives.csproj
@@ -1,7 +1,7 @@
true
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser
enable
diff --git a/src/libraries/Microsoft.Win32.Primitives/tests/Microsoft.Win32.Primitives.Tests.csproj b/src/libraries/Microsoft.Win32.Primitives/tests/Microsoft.Win32.Primitives.Tests.csproj
index fd58739e8f12..aa61641a9fa9 100644
--- a/src/libraries/Microsoft.Win32.Primitives/tests/Microsoft.Win32.Primitives.Tests.csproj
+++ b/src/libraries/Microsoft.Win32.Primitives/tests/Microsoft.Win32.Primitives.Tests.csproj
@@ -1,6 +1,6 @@
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser
diff --git a/src/libraries/Microsoft.Win32.Registry.AccessControl/src/Microsoft.Win32.Registry.AccessControl.csproj b/src/libraries/Microsoft.Win32.Registry.AccessControl/src/Microsoft.Win32.Registry.AccessControl.csproj
index f93606b6a960..6ce1218ec14c 100644
--- a/src/libraries/Microsoft.Win32.Registry.AccessControl/src/Microsoft.Win32.Registry.AccessControl.csproj
+++ b/src/libraries/Microsoft.Win32.Registry.AccessControl/src/Microsoft.Win32.Registry.AccessControl.csproj
@@ -1,7 +1,7 @@
true
- netstandard2.0-Windows_NT;netstandard2.0;net461-Windows_NT
+ netstandard2.0-windows;netstandard2.0;net461-windows
enable
diff --git a/src/libraries/Microsoft.Win32.Registry.AccessControl/tests/Microsoft.Win32.Registry.AccessControl.Tests.csproj b/src/libraries/Microsoft.Win32.Registry.AccessControl/tests/Microsoft.Win32.Registry.AccessControl.Tests.csproj
index c7ded4394f35..1752e89bc52e 100644
--- a/src/libraries/Microsoft.Win32.Registry.AccessControl/tests/Microsoft.Win32.Registry.AccessControl.Tests.csproj
+++ b/src/libraries/Microsoft.Win32.Registry.AccessControl/tests/Microsoft.Win32.Registry.AccessControl.Tests.csproj
@@ -1,6 +1,6 @@
- $(NetCoreAppCurrent)-Windows_NT;net461-Windows_NT
+ $(NetCoreAppCurrent)-windows;net461-windows
diff --git a/src/libraries/Microsoft.Win32.Registry/src/Microsoft.Win32.Registry.csproj b/src/libraries/Microsoft.Win32.Registry/src/Microsoft.Win32.Registry.csproj
index ab962d316335..845a6e4ab2f5 100644
--- a/src/libraries/Microsoft.Win32.Registry/src/Microsoft.Win32.Registry.csproj
+++ b/src/libraries/Microsoft.Win32.Registry/src/Microsoft.Win32.Registry.csproj
@@ -2,7 +2,7 @@
true
$(DefineConstants);REGISTRY_ASSEMBLY
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent);netstandard2.0-Windows_NT;netstandard2.0;net461-Windows_NT
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent);netstandard2.0-windows;netstandard2.0;net461-windows
true
$(NoWarn);CA2249
enable
diff --git a/src/libraries/Microsoft.Win32.Registry/tests/Microsoft.Win32.Registry.Tests.csproj b/src/libraries/Microsoft.Win32.Registry/tests/Microsoft.Win32.Registry.Tests.csproj
index 36f086dad552..bfe24efad015 100644
--- a/src/libraries/Microsoft.Win32.Registry/tests/Microsoft.Win32.Registry.Tests.csproj
+++ b/src/libraries/Microsoft.Win32.Registry/tests/Microsoft.Win32.Registry.Tests.csproj
@@ -1,7 +1,7 @@
$(DefineConstants);REGISTRY_ASSEMBLY
- $(NetCoreAppCurrent)-Windows_NT;net461-Windows_NT
+ $(NetCoreAppCurrent)-windows;net461-windows
true
enable
- $(NetCoreAppCurrent)-Windows_NT;netstandard2.0;netcoreapp2.0-Windows_NT;netcoreapp3.0-Windows_NT;net461
+ $(NetCoreAppCurrent)-windows;netstandard2.0;netcoreapp2.0-windows;netcoreapp3.0-windows;net461
true
diff --git a/src/libraries/Microsoft.Win32.SystemEvents/tests/Microsoft.Win32.SystemEvents.Tests.csproj b/src/libraries/Microsoft.Win32.SystemEvents/tests/Microsoft.Win32.SystemEvents.Tests.csproj
index dd4771652224..c8efc5731d0d 100644
--- a/src/libraries/Microsoft.Win32.SystemEvents/tests/Microsoft.Win32.SystemEvents.Tests.csproj
+++ b/src/libraries/Microsoft.Win32.SystemEvents/tests/Microsoft.Win32.SystemEvents.Tests.csproj
@@ -1,6 +1,6 @@
- $(NetCoreAppCurrent)-Windows_NT;net461-Windows_NT
+ $(NetCoreAppCurrent)-windows;net461-windows
$(MSBuildThisFileDirectory)..\pkg\build\dotnet-Microsoft.XmlSerializer.Generator.runtimeconfig.json
"$(DotNetTool)"
- set DOTNET_MULTILEVEL_LOOKUP=0 & $(GeneratorCommand)
- export DOTNET_MULTILEVEL_LOOKUP=0 && $(GeneratorCommand)
+ set DOTNET_MULTILEVEL_LOOKUP=0 & $(GeneratorCommand)
+ export DOTNET_MULTILEVEL_LOOKUP=0 && $(GeneratorCommand)
-
@@ -28,18 +27,19 @@
-
+
+
- $(AssemblyName).XmlSerializers
+ SerializableAssembly.XmlSerializers
-
+
diff --git a/src/libraries/Microsoft.XmlSerializer.Generator/tests/SGenTests.cs b/src/libraries/Microsoft.XmlSerializer.Generator/tests/SGenTests.cs
index 4b2fce408165..44cd798e899e 100644
--- a/src/libraries/Microsoft.XmlSerializer.Generator/tests/SGenTests.cs
+++ b/src/libraries/Microsoft.XmlSerializer.Generator/tests/SGenTests.cs
@@ -15,12 +15,12 @@ public static class SgenTests
[Fact]
public static void SgenCommandTest()
{
- const string CodeFile = "Microsoft.XmlSerializer.Generator.Tests.XmlSerializers.cs";
+ const string CodeFile = "SerializableAssembly.XmlSerializers.cs";
const string LKGCodeFile = "LKG." + CodeFile;
var type = Type.GetType("Microsoft.XmlSerializer.Generator.Sgen, dotnet-Microsoft.XmlSerializer.Generator");
MethodInfo md = type.GetMethod("Main", BindingFlags.Static | BindingFlags.Public);
- string[] args = new string[] { "Microsoft.XmlSerializer.Generator.Tests.dll", "--force", "--quiet" };
+ string[] args = new string[] { "SerializableAssembly.dll", "--force", "--quiet" };
int n = (int)md.Invoke(null, new object[] { args });
Assert.Equal(0, n);
diff --git a/src/libraries/Microsoft.XmlSerializer.Generator/tests/SerializableAssembly.csproj b/src/libraries/Microsoft.XmlSerializer.Generator/tests/SerializableAssembly.csproj
new file mode 100644
index 000000000000..a65c1cf92dde
--- /dev/null
+++ b/src/libraries/Microsoft.XmlSerializer.Generator/tests/SerializableAssembly.csproj
@@ -0,0 +1,14 @@
+
+
+
+ netstandard2.1
+
+
+
+
+
+
+
diff --git a/src/libraries/Native/AnyOS/brotli-version.txt b/src/libraries/Native/AnyOS/brotli-version.txt
index fb86402f6b4b..ea196f8138c2 100644
--- a/src/libraries/Native/AnyOS/brotli-version.txt
+++ b/src/libraries/Native/AnyOS/brotli-version.txt
@@ -1,2 +1,2 @@
-1.0.7
-https://github.com/google/brotli/releases/tag/v1.0.7
+1.0.9
+https://github.com/google/brotli/releases/tag/v1.0.9
diff --git a/src/libraries/Native/AnyOS/brotli/common/constants.c b/src/libraries/Native/AnyOS/brotli/common/constants.c
new file mode 100644
index 000000000000..6bad9f613ca5
--- /dev/null
+++ b/src/libraries/Native/AnyOS/brotli/common/constants.c
@@ -0,0 +1,15 @@
+/* Copyright 2013 Google Inc. All Rights Reserved.
+
+ Distributed under MIT license.
+ See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
+*/
+
+#include "./constants.h"
+
+const BrotliPrefixCodeRange
+ _kBrotliPrefixCodeRanges[BROTLI_NUM_BLOCK_LEN_SYMBOLS] = {
+ {1, 2}, {5, 2}, {9, 2}, {13, 2}, {17, 3}, {25, 3},
+ {33, 3}, {41, 3}, {49, 4}, {65, 4}, {81, 4}, {97, 4},
+ {113, 5}, {145, 5}, {177, 5}, {209, 5}, {241, 6}, {305, 6},
+ {369, 7}, {497, 8}, {753, 9}, {1265, 10}, {2289, 11}, {4337, 12},
+ {8433, 13}, {16625, 24}};
diff --git a/src/libraries/Native/AnyOS/brotli/common/constants.h b/src/libraries/Native/AnyOS/brotli/common/constants.h
index d1b88d12af38..e848195a0dc2 100644
--- a/src/libraries/Native/AnyOS/brotli/common/constants.h
+++ b/src/libraries/Native/AnyOS/brotli/common/constants.h
@@ -4,9 +4,18 @@
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/
+/**
+ * @file
+ * Common constants used in decoder and encoder API.
+ */
+
#ifndef BROTLI_COMMON_CONSTANTS_H_
#define BROTLI_COMMON_CONSTANTS_H_
+#include "./platform.h"
+#include
+#include
+
/* Specification: 7.3. Encoding of the context map */
#define BROTLI_CONTEXT_MAP_MAX_RLE 16
@@ -29,12 +38,31 @@
#define BROTLI_INITIAL_REPEATED_CODE_LENGTH 8
/* "Large Window Brotli" */
+
+/**
+ * The theoretical maximum number of distance bits specified for large window
+ * brotli, for 64-bit encoders and decoders. Even when in practice 32-bit
+ * encoders and decoders only support up to 30 max distance bits, the value is
+ * set to 62 because it affects the large window brotli file format.
+ * Specifically, it affects the encoding of simple huffman tree for distances,
+ * see Specification RFC 7932 chapter 3.4.
+ */
#define BROTLI_LARGE_MAX_DISTANCE_BITS 62U
#define BROTLI_LARGE_MIN_WBITS 10
+/**
+ * The maximum supported large brotli window bits by the encoder and decoder.
+ * Large window brotli allows up to 62 bits, however the current encoder and
+ * decoder, designed for 32-bit integers, only support up to 30 bits maximum.
+ */
#define BROTLI_LARGE_MAX_WBITS 30
/* Specification: 4. Encoding of distances */
#define BROTLI_NUM_DISTANCE_SHORT_CODES 16
+/**
+ * Maximal number of "postfix" bits.
+ *
+ * Number of "postfix" bits is stored as 2 bits in meta-block header.
+ */
#define BROTLI_MAX_NPOSTFIX 3
#define BROTLI_MAX_NDIRECT 120
#define BROTLI_MAX_DISTANCE_BITS 24U
@@ -45,9 +73,22 @@
#define BROTLI_NUM_DISTANCE_SYMBOLS \
BROTLI_DISTANCE_ALPHABET_SIZE( \
BROTLI_MAX_NDIRECT, BROTLI_MAX_NPOSTFIX, BROTLI_LARGE_MAX_DISTANCE_BITS)
+
+/* ((1 << 26) - 4) is the maximal distance that can be expressed in RFC 7932
+ brotli stream using NPOSTFIX = 0 and NDIRECT = 0. With other NPOSTFIX and
+ NDIRECT values distances up to ((1 << 29) + 88) could be expressed. */
#define BROTLI_MAX_DISTANCE 0x3FFFFFC
+
+/* ((1 << 31) - 4) is the safe distance limit. Using this number as a limit
+ allows safe distance calculation without overflows, given the distance
+ alphabet size is limited to corresponding size
+ (see kLargeWindowDistanceCodeLimits). */
#define BROTLI_MAX_ALLOWED_DISTANCE 0x7FFFFFFC
+
+/* Specification: 4. Encoding of Literal Insertion Lengths and Copy Lengths */
+#define BROTLI_NUM_INS_COPY_CODES 24
+
/* 7.1. Context modes and context ID lookup for literals */
/* "context IDs for literals are in the range of 0..63" */
#define BROTLI_LITERAL_CONTEXT_BITS 6
@@ -61,4 +102,99 @@
#define BROTLI_WINDOW_GAP 16
#define BROTLI_MAX_BACKWARD_LIMIT(W) (((size_t)1 << (W)) - BROTLI_WINDOW_GAP)
+typedef struct BrotliDistanceCodeLimit {
+ uint32_t max_alphabet_size;
+ uint32_t max_distance;
+} BrotliDistanceCodeLimit;
+
+/* This function calculates maximal size of distance alphabet, such that the
+ distances greater than the given values can not be represented.
+
+ This limits are designed to support fast and safe 32-bit decoders.
+ "32-bit" means that signed integer values up to ((1 << 31) - 1) could be
+ safely expressed.
+
+ Brotli distance alphabet symbols do not represent consecutive distance
+ ranges. Each distance alphabet symbol (excluding direct distances and short
+ codes), represent interleaved (for NPOSTFIX > 0) range of distances.
+ A "group" of consecutive (1 << NPOSTFIX) symbols represent non-interleaved
+ range. Two consecutive groups require the same amount of "extra bits".
+
+ It is important that distance alphabet represents complete "groups".
+ To avoid complex logic on encoder side about interleaved ranges
+ it was decided to restrict both sides to complete distance code "groups".
+ */
+BROTLI_UNUSED_FUNCTION BrotliDistanceCodeLimit BrotliCalculateDistanceCodeLimit(
+ uint32_t max_distance, uint32_t npostfix, uint32_t ndirect) {
+ BrotliDistanceCodeLimit result;
+ /* Marking this function as unused, because not all files
+ including "constants.h" use it -> compiler warns about that. */
+ BROTLI_UNUSED(&BrotliCalculateDistanceCodeLimit);
+ if (max_distance <= ndirect) {
+ /* This case never happens / exists only for the sake of completeness. */
+ result.max_alphabet_size = max_distance + BROTLI_NUM_DISTANCE_SHORT_CODES;
+ result.max_distance = max_distance;
+ return result;
+ } else {
+ /* The first prohibited value. */
+ uint32_t forbidden_distance = max_distance + 1;
+ /* Subtract "directly" encoded region. */
+ uint32_t offset = forbidden_distance - ndirect - 1;
+ uint32_t ndistbits = 0;
+ uint32_t tmp;
+ uint32_t half;
+ uint32_t group;
+ /* Postfix for the last dcode in the group. */
+ uint32_t postfix = (1u << npostfix) - 1;
+ uint32_t extra;
+ uint32_t start;
+ /* Remove postfix and "head-start". */
+ offset = (offset >> npostfix) + 4;
+ /* Calculate the number of distance bits. */
+ tmp = offset / 2;
+ /* Poor-man's log2floor, to avoid extra dependencies. */
+ while (tmp != 0) {ndistbits++; tmp = tmp >> 1;}
+ /* One bit is covered with subrange addressing ("half"). */
+ ndistbits--;
+ /* Find subrange. */
+ half = (offset >> ndistbits) & 1;
+ /* Calculate the "group" part of dcode. */
+ group = ((ndistbits - 1) << 1) | half;
+ /* Calculated "group" covers the prohibited distance value. */
+ if (group == 0) {
+ /* This case is added for correctness; does not occur for limit > 128. */
+ result.max_alphabet_size = ndirect + BROTLI_NUM_DISTANCE_SHORT_CODES;
+ result.max_distance = ndirect;
+ return result;
+ }
+ /* Decrement "group", so it is the last permitted "group". */
+ group--;
+ /* After group was decremented, ndistbits and half must be recalculated. */
+ ndistbits = (group >> 1) + 1;
+ /* The last available distance in the subrange has all extra bits set. */
+ extra = (1u << ndistbits) - 1;
+ /* Calculate region start. NB: ndistbits >= 1. */
+ start = (1u << (ndistbits + 1)) - 4;
+ /* Move to subregion. */
+ start += (group & 1) << ndistbits;
+ /* Calculate the alphabet size. */
+ result.max_alphabet_size = ((group << npostfix) | postfix) + ndirect +
+ BROTLI_NUM_DISTANCE_SHORT_CODES + 1;
+ /* Calculate the maximal distance representable by alphabet. */
+ result.max_distance = ((start + extra) << npostfix) + postfix + ndirect + 1;
+ return result;
+ }
+}
+
+/* Represents the range of values belonging to a prefix code:
+ [offset, offset + 2^nbits) */
+typedef struct {
+ uint16_t offset;
+ uint8_t nbits;
+} BrotliPrefixCodeRange;
+
+/* "Soft-private", it is exported, but not "advertised" as API. */
+BROTLI_COMMON_API extern const BrotliPrefixCodeRange
+ _kBrotliPrefixCodeRanges[BROTLI_NUM_BLOCK_LEN_SYMBOLS];
+
#endif /* BROTLI_COMMON_CONSTANTS_H_ */
diff --git a/src/libraries/Native/AnyOS/brotli/common/context.c b/src/libraries/Native/AnyOS/brotli/common/context.c
new file mode 100644
index 000000000000..2c2dceba9b62
--- /dev/null
+++ b/src/libraries/Native/AnyOS/brotli/common/context.c
@@ -0,0 +1,156 @@
+#include "./context.h"
+
+#include
+
+/* Common context lookup table for all context modes. */
+const uint8_t _kBrotliContextLookupTable[2048] = {
+ /* CONTEXT_LSB6, last byte. */
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
+ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
+ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
+ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
+ 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
+ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
+
+ /* CONTEXT_LSB6, second last byte, */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0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 19, 19, 19,
+ 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23,
+ 24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27,
+ 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31,
+ 32, 32, 32, 32, 33, 33, 33, 33, 34, 34, 34, 34, 35, 35, 35, 35,
+ 36, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 39,
+ 40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 43,
+ 44, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47,
+ 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 51,
+ 52, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55,
+ 56, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58, 58, 59, 59, 59, 59,
+ 60, 60, 60, 60, 61, 61, 61, 61, 62, 62, 62, 62, 63, 63, 63, 63,
+
+ /* CONTEXT_MSB6, second last byte, */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+
+ /* CONTEXT_UTF8, last byte. */
+ /* ASCII range. */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 4, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 8, 12, 16, 12, 12, 20, 12, 16, 24, 28, 12, 12, 32, 12, 36, 12,
+ 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 32, 32, 24, 40, 28, 12,
+ 12, 48, 52, 52, 52, 48, 52, 52, 52, 48, 52, 52, 52, 52, 52, 48,
+ 52, 52, 52, 52, 52, 48, 52, 52, 52, 52, 52, 24, 12, 28, 12, 12,
+ 12, 56, 60, 60, 60, 56, 60, 60, 60, 56, 60, 60, 60, 60, 60, 56,
+ 60, 60, 60, 60, 60, 56, 60, 60, 60, 60, 60, 24, 12, 28, 12, 0,
+ /* UTF8 continuation byte range. */
+ 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
+ 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
+ 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
+ 0, 1, 0, 1, 0, 1, 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 0, 0, 0, 0,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+
+ /* CONTEXT_SIGNED, last byte, same as the above values shifted by 3 bits. */
+ 0, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
+ 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
+ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
+ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
+ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 56,
+
+ /* CONTEXT_SIGNED, second last byte. */
+ 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7,
+};
diff --git a/src/libraries/Native/AnyOS/brotli/common/context.h b/src/libraries/Native/AnyOS/brotli/common/context.h
index 24b3eb48f533..685a279dc069 100644
--- a/src/libraries/Native/AnyOS/brotli/common/context.h
+++ b/src/libraries/Native/AnyOS/brotli/common/context.h
@@ -88,6 +88,7 @@
#ifndef BROTLI_COMMON_CONTEXT_H_
#define BROTLI_COMMON_CONTEXT_H_
+#include
#include
typedef enum ContextType {
@@ -97,163 +98,14 @@ typedef enum ContextType {
CONTEXT_SIGNED = 3
} ContextType;
+/* "Soft-private", it is exported, but not "advertised" as API. */
/* Common context lookup table for all context modes. */
-static const uint8_t kContextLookup[2048] = {
- /* CONTEXT_LSB6, last byte. */
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
- 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
- 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
- 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
- 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
- 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
- 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
- 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
- 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
-
- /* CONTEXT_LSB6, second last byte, */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 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, 22, 22, 22, 23, 23, 23, 23,
- 24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27,
- 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31,
- 32, 32, 32, 32, 33, 33, 33, 33, 34, 34, 34, 34, 35, 35, 35, 35,
- 36, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 39,
- 40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 43,
- 44, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47,
- 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 51,
- 52, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55, 55,
- 56, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58, 58, 59, 59, 59, 59,
- 60, 60, 60, 60, 61, 61, 61, 61, 62, 62, 62, 62, 63, 63, 63, 63,
-
- /* CONTEXT_MSB6, second last byte, */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-
- /* CONTEXT_UTF8, last byte. */
- /* ASCII range. */
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 0, 0, 4, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 8, 12, 16, 12, 12, 20, 12, 16, 24, 28, 12, 12, 32, 12, 36, 12,
- 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 32, 32, 24, 40, 28, 12,
- 12, 48, 52, 52, 52, 48, 52, 52, 52, 48, 52, 52, 52, 52, 52, 48,
- 52, 52, 52, 52, 52, 48, 52, 52, 52, 52, 52, 24, 12, 28, 12, 12,
- 12, 56, 60, 60, 60, 56, 60, 60, 60, 56, 60, 60, 60, 60, 60, 56,
- 60, 60, 60, 60, 60, 56, 60, 60, 60, 60, 60, 24, 12, 28, 12, 0,
- /* UTF8 continuation byte range. */
- 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
- 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
- 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
- 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,
- /* UTF8 lead byte range. */
- 2, 3, 2, 3, 2, 3, 2, 3, 2, 3, 2,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 2, 2, 2,
-
- /* CONTEXT_SIGNED, last byte, same as the above values shifted by 3 bits. */
- 0, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
- 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
- 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
- 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
- 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
- 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
- 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
- 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,
- 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
- 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
- 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
- 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 56,
-
- /* CONTEXT_SIGNED, second last byte. */
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7,
-};
+BROTLI_COMMON_API extern const uint8_t _kBrotliContextLookupTable[2048];
typedef const uint8_t* ContextLut;
/* typeof(MODE) == ContextType; returns ContextLut */
-#define BROTLI_CONTEXT_LUT(MODE) (&kContextLookup[(MODE) << 9])
+#define BROTLI_CONTEXT_LUT(MODE) (&_kBrotliContextLookupTable[(MODE) << 9])
/* typeof(LUT) == ContextLut */
#define BROTLI_CONTEXT(P1, P2, LUT) ((LUT)[P1] | ((LUT) + 256)[P2])
diff --git a/src/libraries/Native/AnyOS/brotli/common/dictionary.c b/src/libraries/Native/AnyOS/brotli/common/dictionary.c
index 64822a381bbf..f9e30417c00b 100644
--- a/src/libraries/Native/AnyOS/brotli/common/dictionary.c
+++ b/src/libraries/Native/AnyOS/brotli/common/dictionary.c
@@ -5,12 +5,13 @@
*/
#include "./dictionary.h"
+#include "./platform.h"
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
#endif
-#ifndef BROTLI_EXTERNAL_DICTIONARY_DATA
+#if !defined(BROTLI_EXTERNAL_DICTIONARY_DATA)
static const uint8_t kBrotliDictionaryData[] =
{
116,105,109,101,100,111,119,110,108,105,102,101,108,101,102,116,98,97,99,107,99,
@@ -5862,7 +5863,11 @@ static const uint8_t kBrotliDictionaryData[] =
;
#endif /* !BROTLI_EXTERNAL_DICTIONARY_DATA */
+#if !defined(BROTLI_EXTERNAL_DICTIONARY_DATA)
+static const BrotliDictionary kBrotliDictionary = {
+#else
static BrotliDictionary kBrotliDictionary = {
+#endif
/* size_bits_by_length */
{
0, 0, 0, 0, 10, 10, 11, 11,
@@ -5895,9 +5900,13 @@ const BrotliDictionary* BrotliGetDictionary() {
}
void BrotliSetDictionaryData(const uint8_t* data) {
+#if defined(BROTLI_EXTERNAL_DICTIONARY_DATA)
if (!!data && !kBrotliDictionary.data) {
kBrotliDictionary.data = data;
}
+#else
+ BROTLI_UNUSED(data); // Appease -Werror=unused-parameter
+#endif
}
#if defined(__cplusplus) || defined(c_plusplus)
diff --git a/src/libraries/Native/AnyOS/brotli/common/platform.c b/src/libraries/Native/AnyOS/brotli/common/platform.c
new file mode 100644
index 000000000000..aef39e93c469
--- /dev/null
+++ b/src/libraries/Native/AnyOS/brotli/common/platform.c
@@ -0,0 +1,22 @@
+/* Copyright 2016 Google Inc. All Rights Reserved.
+
+ Distributed under MIT license.
+ See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
+*/
+
+#include
+
+#include "./platform.h"
+#include
+
+/* Default brotli_alloc_func */
+void* BrotliDefaultAllocFunc(void* opaque, size_t size) {
+ BROTLI_UNUSED(opaque);
+ return malloc(size);
+}
+
+/* Default brotli_free_func */
+void BrotliDefaultFreeFunc(void* opaque, void* address) {
+ BROTLI_UNUSED(opaque);
+ free(address);
+}
diff --git a/src/libraries/Native/AnyOS/brotli/common/platform.h b/src/libraries/Native/AnyOS/brotli/common/platform.h
index 84c448c4cf8c..f5ca4435bc00 100644
--- a/src/libraries/Native/AnyOS/brotli/common/platform.h
+++ b/src/libraries/Native/AnyOS/brotli/common/platform.h
@@ -24,12 +24,11 @@
#define BROTLI_COMMON_PLATFORM_H_
#include /* memcpy */
-#include /* malloc, free */
#include
#include
-#if defined(OS_LINUX) || defined(OS_CYGWIN)
+#if defined(OS_LINUX) || defined(OS_CYGWIN) || defined(__EMSCRIPTEN__)
#include
#elif defined(OS_FREEBSD)
#include
@@ -41,6 +40,10 @@
#define BROTLI_X_BIG_ENDIAN BIG_ENDIAN
#endif
+#if BROTLI_MSVC_VERSION_CHECK(12, 0, 0)
+#include
+#endif
+
#if defined(BROTLI_ENABLE_LOG) || defined(BROTLI_DEBUG)
#include
#include
@@ -308,8 +311,7 @@ static BROTLI_INLINE void BrotliUnalignedWrite64(void* p, uint64_t v) {
}
#else /* BROTLI_ALIGNED_READ */
/* Unaligned memory access is allowed: just cast pointer to requested type. */
-#if defined(ADDRESS_SANITIZER) || defined(THREAD_SANITIZER) || \
- defined(MEMORY_SANITIZER)
+#if BROTLI_SANITIZED
/* Consider we have an unaligned load/store of 4 bytes from address 0x...05.
AddressSanitizer will treat it as a 3-byte access to the range 05:07 and
will miss a bug if 08 is the first unaddressable byte.
@@ -334,7 +336,7 @@ extern "C" {
#define BrotliUnalignedRead32 __sanitizer_unaligned_load32
#define BrotliUnalignedRead64 __sanitizer_unaligned_load64
#define BrotliUnalignedWrite64 __sanitizer_unaligned_store64
-#else
+#else /* BROTLI_SANITIZED */
static BROTLI_INLINE uint16_t BrotliUnalignedRead16(const void* p) {
return *(const uint16_t*)p;
}
@@ -356,7 +358,7 @@ static BROTLI_INLINE void BrotliUnalignedWrite64(void* p, uint64_t v) {
typedef BROTLI_ALIGNED(1) uint64_t brotli_unaligned_uint64_t;
static BROTLI_INLINE uint64_t BrotliUnalignedRead64(const void* p) {
- return (uint64_t) ((brotli_unaligned_uint64_t*) p)[0];
+ return (uint64_t) ((const brotli_unaligned_uint64_t*) p)[0];
}
static BROTLI_INLINE void BrotliUnalignedWrite64(void* p, uint64_t v) {
brotli_unaligned_uint64_t* dwords = (brotli_unaligned_uint64_t*) p;
@@ -374,7 +376,7 @@ static BROTLI_INLINE void BrotliUnalignedWrite64(void* p, uint64_t v) {
}
#endif /* BROTLI_GNUC_HAS_ATTRIBUTE(aligned, 2, 7, 0) */
#endif /* BROTLI_64_BITS */
-#endif /* ASAN / TSAN / MSAN */
+#endif /* BROTLI_SANITIZED */
#endif /* BROTLI_ALIGNED_READ */
#if BROTLI_LITTLE_ENDIAN
@@ -466,20 +468,20 @@ static BROTLI_INLINE void BROTLI_UNALIGNED_STORE64LE(void* p, uint64_t v) {
#endif
#if defined(BROTLI_ENABLE_LOG)
-#define BROTLI_DCHECK(x) assert(x)
#define BROTLI_LOG(x) printf x
#else
-#define BROTLI_DCHECK(x)
#define BROTLI_LOG(x)
#endif
#if defined(BROTLI_DEBUG) || defined(BROTLI_ENABLE_LOG)
+#define BROTLI_DCHECK(x) assert(x)
static BROTLI_INLINE void BrotliDump(const char* f, int l, const char* fn) {
fprintf(stderr, "%s:%d (%s)\n", f, l, fn);
fflush(stderr);
}
#define BROTLI_DUMP() BrotliDump(__FILE__, __LINE__, __FUNCTION__)
#else
+#define BROTLI_DCHECK(x)
#define BROTLI_DUMP() (void)(0)
#endif
@@ -523,17 +525,41 @@ BROTLI_MIN_MAX(size_t) BROTLI_MIN_MAX(uint32_t) BROTLI_MIN_MAX(uint8_t)
(A)[(J)] = __brotli_swap_tmp; \
}
-/* Default brotli_alloc_func */
-static void* BrotliDefaultAllocFunc(void* opaque, size_t size) {
- BROTLI_UNUSED(opaque);
- return malloc(size);
+#if BROTLI_64_BITS
+#if BROTLI_GNUC_HAS_BUILTIN(__builtin_ctzll, 3, 4, 0) || \
+ BROTLI_INTEL_VERSION_CHECK(16, 0, 0)
+#define BROTLI_TZCNT64 __builtin_ctzll
+#elif BROTLI_MSVC_VERSION_CHECK(12, 0, 0)
+#if defined(BROTLI_TARGET_X64)
+#define BROTLI_TZCNT64 _tzcnt_u64
+#else /* BROTLI_TARGET_X64 */
+static BROTLI_INLINE uint32_t BrotliBsf64Msvc(uint64_t x) {
+ uint32_t lsb;
+ _BitScanForward64(&lsb, x);
+ return lsb;
}
+#define BROTLI_TZCNT64 BrotliBsf64Msvc
+#endif /* BROTLI_TARGET_X64 */
+#endif /* __builtin_ctzll */
+#endif /* BROTLI_64_BITS */
-/* Default brotli_free_func */
-static void BrotliDefaultFreeFunc(void* opaque, void* address) {
- BROTLI_UNUSED(opaque);
- free(address);
+#if BROTLI_GNUC_HAS_BUILTIN(__builtin_clz, 3, 4, 0) || \
+ BROTLI_INTEL_VERSION_CHECK(16, 0, 0)
+#define BROTLI_BSR32(x) (31u ^ (uint32_t)__builtin_clz(x))
+#elif BROTLI_MSVC_VERSION_CHECK(12, 0, 0)
+static BROTLI_INLINE uint32_t BrotliBsr32Msvc(uint32_t x) {
+ unsigned long msb;
+ _BitScanReverse(&msb, x);
+ return (uint32_t)msb;
}
+#define BROTLI_BSR32 BrotliBsr32Msvc
+#endif /* __builtin_clz */
+
+/* Default brotli_alloc_func */
+BROTLI_COMMON_API void* BrotliDefaultAllocFunc(void* opaque, size_t size);
+
+/* Default brotli_free_func */
+BROTLI_COMMON_API void BrotliDefaultFreeFunc(void* opaque, void* address);
BROTLI_UNUSED_FUNCTION void BrotliSuppressUnusedFunctions(void) {
BROTLI_UNUSED(&BrotliSuppressUnusedFunctions);
diff --git a/src/libraries/Native/AnyOS/brotli/common/transform.c b/src/libraries/Native/AnyOS/brotli/common/transform.c
index 426e635fd3d0..f8fa4335e1c2 100644
--- a/src/libraries/Native/AnyOS/brotli/common/transform.c
+++ b/src/libraries/Native/AnyOS/brotli/common/transform.c
@@ -24,8 +24,8 @@ static const char kPrefixSuffix[217] =
/* 8x _0 _ _3 _8 _C _E _ _1 _7 _F */
" not \3er \3al \4ful \4ive \5less \4es"
/* Ax _5 _9 _D _2 _7 _D */
- "t \4ize \2\xc2\xa0\4ous \5 the \2e \0";
-/* Cx _2 _7___ ___ _A _F _5 _8 */
+ "t \4ize \2\xc2\xa0\4ous \5 the \2e "; /* \0 - implicit trailing zero. */
+/* Cx _2 _7___ ___ _A _F _5 _8 */
static const uint16_t kPrefixSuffixMap[50] = {
0x00, 0x02, 0x05, 0x0E, 0x13, 0x16, 0x18, 0x1E, 0x23, 0x25,
@@ -160,12 +160,13 @@ static const uint8_t kTransformsData[] = {
0, BROTLI_TRANSFORM_UPPERCASE_FIRST, 34,
};
-static BrotliTransforms kBrotliTransforms = {
+static const BrotliTransforms kBrotliTransforms = {
sizeof(kPrefixSuffix),
(const uint8_t*)kPrefixSuffix,
kPrefixSuffixMap,
sizeof(kTransformsData) / (3 * sizeof(kTransformsData[0])),
kTransformsData,
+ NULL, /* no extra parameters */
{0, 12, 27, 23, 42, 63, 56, 48, 59, 64}
};
@@ -190,6 +191,48 @@ static int ToUpperCase(uint8_t* p) {
return 3;
}
+static int Shift(uint8_t* word, int word_len, uint16_t parameter) {
+ /* Limited sign extension: scalar < (1 << 24). */
+ uint32_t scalar =
+ (parameter & 0x7FFFu) + (0x1000000u - (parameter & 0x8000u));
+ if (word[0] < 0x80) {
+ /* 1-byte rune / 0sssssss / 7 bit scalar (ASCII). */
+ scalar += (uint32_t)word[0];
+ word[0] = (uint8_t)(scalar & 0x7Fu);
+ return 1;
+ } else if (word[0] < 0xC0) {
+ /* Continuation / 10AAAAAA. */
+ return 1;
+ } else if (word[0] < 0xE0) {
+ /* 2-byte rune / 110sssss AAssssss / 11 bit scalar. */
+ if (word_len < 2) return 1;
+ scalar += (uint32_t)((word[1] & 0x3Fu) | ((word[0] & 0x1Fu) << 6u));
+ word[0] = (uint8_t)(0xC0 | ((scalar >> 6u) & 0x1F));
+ word[1] = (uint8_t)((word[1] & 0xC0) | (scalar & 0x3F));
+ return 2;
+ } else if (word[0] < 0xF0) {
+ /* 3-byte rune / 1110ssss AAssssss BBssssss / 16 bit scalar. */
+ if (word_len < 3) return word_len;
+ scalar += (uint32_t)((word[2] & 0x3Fu) | ((word[1] & 0x3Fu) << 6u) |
+ ((word[0] & 0x0Fu) << 12u));
+ word[0] = (uint8_t)(0xE0 | ((scalar >> 12u) & 0x0F));
+ word[1] = (uint8_t)((word[1] & 0xC0) | ((scalar >> 6u) & 0x3F));
+ word[2] = (uint8_t)((word[2] & 0xC0) | (scalar & 0x3F));
+ return 3;
+ } else if (word[0] < 0xF8) {
+ /* 4-byte rune / 11110sss AAssssss BBssssss CCssssss / 21 bit scalar. */
+ if (word_len < 4) return word_len;
+ scalar += (uint32_t)((word[3] & 0x3Fu) | ((word[2] & 0x3Fu) << 6u) |
+ ((word[1] & 0x3Fu) << 12u) | ((word[0] & 0x07u) << 18u));
+ word[0] = (uint8_t)(0xF0 | ((scalar >> 18u) & 0x07));
+ word[1] = (uint8_t)((word[1] & 0xC0) | ((scalar >> 12u) & 0x3F));
+ word[2] = (uint8_t)((word[2] & 0xC0) | ((scalar >> 6u) & 0x3F));
+ word[3] = (uint8_t)((word[3] & 0xC0) | (scalar & 0x3F));
+ return 4;
+ }
+ return 1;
+}
+
int BrotliTransformDictionaryWord(uint8_t* dst, const uint8_t* word, int len,
const BrotliTransforms* transforms, int transform_idx) {
int idx = 0;
@@ -221,6 +264,19 @@ int BrotliTransformDictionaryWord(uint8_t* dst, const uint8_t* word, int len,
uppercase += step;
len -= step;
}
+ } else if (t == BROTLI_TRANSFORM_SHIFT_FIRST) {
+ uint16_t param = (uint16_t)(transforms->params[transform_idx * 2]
+ + (transforms->params[transform_idx * 2 + 1] << 8u));
+ Shift(&dst[idx - len], len, param);
+ } else if (t == BROTLI_TRANSFORM_SHIFT_ALL) {
+ uint16_t param = (uint16_t)(transforms->params[transform_idx * 2]
+ + (transforms->params[transform_idx * 2 + 1] << 8u));
+ uint8_t* shift = &dst[idx - len];
+ while (len > 0) {
+ int step = Shift(shift, len, param);
+ shift += step;
+ len -= step;
+ }
}
}
{
diff --git a/src/libraries/Native/AnyOS/brotli/common/transform.h b/src/libraries/Native/AnyOS/brotli/common/transform.h
index 456c12db9b2b..b6f86cc7d5ad 100644
--- a/src/libraries/Native/AnyOS/brotli/common/transform.h
+++ b/src/libraries/Native/AnyOS/brotli/common/transform.h
@@ -37,6 +37,8 @@ enum BrotliWordTransformType {
BROTLI_TRANSFORM_OMIT_FIRST_7 = 18,
BROTLI_TRANSFORM_OMIT_FIRST_8 = 19,
BROTLI_TRANSFORM_OMIT_FIRST_9 = 20,
+ BROTLI_TRANSFORM_SHIFT_FIRST = 21,
+ BROTLI_TRANSFORM_SHIFT_ALL = 22,
BROTLI_NUM_TRANSFORM_TYPES /* Counts transforms, not a transform itself. */
};
@@ -50,6 +52,9 @@ typedef struct BrotliTransforms {
uint32_t num_transforms;
/* Each entry is a [prefix_id, transform, suffix_id] triplet. */
const uint8_t* transforms;
+ /* Shift for BROTLI_TRANSFORM_SHIFT_FIRST and BROTLI_TRANSFORM_SHIFT_ALL,
+ must be NULL if and only if no such transforms are present. */
+ const uint8_t* params;
/* Indices of transforms like ["", BROTLI_TRANSFORM_OMIT_LAST_#, ""].
0-th element corresponds to ["", BROTLI_TRANSFORM_IDENTITY, ""].
-1, if cut-off transform does not exist. */
diff --git a/src/libraries/Native/AnyOS/brotli/common/version.h b/src/libraries/Native/AnyOS/brotli/common/version.h
index 0d0d0c796768..01b2998e25d7 100644
--- a/src/libraries/Native/AnyOS/brotli/common/version.h
+++ b/src/libraries/Native/AnyOS/brotli/common/version.h
@@ -14,13 +14,13 @@
BrotliEncoderVersion methods. */
/* Semantic version, calculated as (MAJOR << 24) | (MINOR << 12) | PATCH */
-#define BROTLI_VERSION 0x1000007
+#define BROTLI_VERSION 0x1000009
/* This macro is used by build system to produce Libtool-friendly soname. See
https://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html
*/
/* ABI version, calculated as (CURRENT << 24) | (REVISION << 12) | AGE */
-#define BROTLI_ABI_VERSION 0x1007000
+#define BROTLI_ABI_VERSION 0x1009000
#endif /* BROTLI_COMMON_VERSION_H_ */
diff --git a/src/libraries/Native/AnyOS/brotli/dec/bit_reader.c b/src/libraries/Native/AnyOS/brotli/dec/bit_reader.c
index 722fd906dd43..7f7b256a40ce 100644
--- a/src/libraries/Native/AnyOS/brotli/dec/bit_reader.c
+++ b/src/libraries/Native/AnyOS/brotli/dec/bit_reader.c
@@ -15,6 +15,17 @@
extern "C" {
#endif
+const uint32_t kBrotliBitMask[33] = { 0x00000000,
+ 0x00000001, 0x00000003, 0x00000007, 0x0000000F,
+ 0x0000001F, 0x0000003F, 0x0000007F, 0x000000FF,
+ 0x000001FF, 0x000003FF, 0x000007FF, 0x00000FFF,
+ 0x00001FFF, 0x00003FFF, 0x00007FFF, 0x0000FFFF,
+ 0x0001FFFF, 0x0003FFFF, 0x0007FFFF, 0x000FFFFF,
+ 0x001FFFFF, 0x003FFFFF, 0x007FFFFF, 0x00FFFFFF,
+ 0x01FFFFFF, 0x03FFFFFF, 0x07FFFFFF, 0x0FFFFFFF,
+ 0x1FFFFFFF, 0x3FFFFFFF, 0x7FFFFFFF, 0xFFFFFFFF
+};
+
void BrotliInitBitReader(BrotliBitReader* const br) {
br->val_ = 0;
br->bit_pos_ = sizeof(br->val_) << 3;
@@ -43,6 +54,23 @@ BROTLI_BOOL BrotliWarmupBitReader(BrotliBitReader* const br) {
return BROTLI_TRUE;
}
+BROTLI_BOOL BrotliSafeReadBits32Slow(BrotliBitReader* const br,
+ uint32_t n_bits, uint32_t* val) {
+ uint32_t low_val;
+ uint32_t high_val;
+ BrotliBitReaderState memento;
+ BROTLI_DCHECK(n_bits <= 32);
+ BROTLI_DCHECK(n_bits > 24);
+ BrotliBitReaderSaveState(br, &memento);
+ if (!BrotliSafeReadBits(br, 16, &low_val) ||
+ !BrotliSafeReadBits(br, n_bits - 16, &high_val)) {
+ BrotliBitReaderRestoreState(br, &memento);
+ return BROTLI_FALSE;
+ }
+ *val = low_val | (high_val << 16);
+ return BROTLI_TRUE;
+}
+
#if defined(__cplusplus) || defined(c_plusplus)
} /* extern "C" */
#endif
diff --git a/src/libraries/Native/AnyOS/brotli/dec/bit_reader.h b/src/libraries/Native/AnyOS/brotli/dec/bit_reader.h
index c06e91419f28..22bc060cad1e 100644
--- a/src/libraries/Native/AnyOS/brotli/dec/bit_reader.h
+++ b/src/libraries/Native/AnyOS/brotli/dec/bit_reader.h
@@ -11,6 +11,7 @@
#include /* memcpy */
+#include "../common/constants.h"
#include "../common/platform.h"
#include
@@ -20,16 +21,7 @@ extern "C" {
#define BROTLI_SHORT_FILL_BIT_WINDOW_READ (sizeof(brotli_reg_t) >> 1)
-static const uint32_t kBitMask[33] = { 0x00000000,
- 0x00000001, 0x00000003, 0x00000007, 0x0000000F,
- 0x0000001F, 0x0000003F, 0x0000007F, 0x000000FF,
- 0x000001FF, 0x000003FF, 0x000007FF, 0x00000FFF,
- 0x00001FFF, 0x00003FFF, 0x00007FFF, 0x0000FFFF,
- 0x0001FFFF, 0x0003FFFF, 0x0007FFFF, 0x000FFFFF,
- 0x001FFFFF, 0x003FFFFF, 0x007FFFFF, 0x00FFFFFF,
- 0x01FFFFFF, 0x03FFFFFF, 0x07FFFFFF, 0x0FFFFFFF,
- 0x1FFFFFFF, 0x3FFFFFFF, 0x7FFFFFFF, 0xFFFFFFFF
-};
+BROTLI_INTERNAL extern const uint32_t kBrotliBitMask[33];
static BROTLI_INLINE uint32_t BitMask(uint32_t n) {
if (BROTLI_IS_CONSTANT(n) || BROTLI_HAS_UBFX) {
@@ -37,7 +29,7 @@ static BROTLI_INLINE uint32_t BitMask(uint32_t n) {
"Unsigned Bit Field Extract" UBFX instruction on ARM. */
return ~((0xFFFFFFFFu) << n);
} else {
- return kBitMask[n];
+ return kBrotliBitMask[n];
}
}
@@ -65,6 +57,12 @@ BROTLI_INTERNAL void BrotliInitBitReader(BrotliBitReader* const br);
reading. */
BROTLI_INTERNAL BROTLI_BOOL BrotliWarmupBitReader(BrotliBitReader* const br);
+/* Fallback for BrotliSafeReadBits32. Extracted as noninlined method to unburden
+ the main code-path. Never called for RFC brotli streams, required only for
+ "large-window" mode and other extensions. */
+BROTLI_INTERNAL BROTLI_NOINLINE BROTLI_BOOL BrotliSafeReadBits32Slow(
+ BrotliBitReader* const br, uint32_t n_bits, uint32_t* val);
+
static BROTLI_INLINE void BrotliBitReaderSaveState(
BrotliBitReader* const from, BrotliBitReaderState* to) {
to->val_ = from->val_;
@@ -87,8 +85,11 @@ static BROTLI_INLINE uint32_t BrotliGetAvailableBits(
}
/* Returns amount of unread bytes the bit reader still has buffered from the
- BrotliInput, including whole bytes in br->val_. */
+ BrotliInput, including whole bytes in br->val_. Result is capped with
+ maximal ring-buffer size (larger number won't be utilized anyway). */
static BROTLI_INLINE size_t BrotliGetRemainingBytes(BrotliBitReader* br) {
+ static const size_t kCap = (size_t)1 << BROTLI_LARGE_MAX_WBITS;
+ if (br->avail_in > kCap) return kCap;
return br->avail_in + (BrotliGetAvailableBits(br) >> 3);
}
@@ -237,15 +238,17 @@ static BROTLI_INLINE void BrotliBitReaderUnload(BrotliBitReader* br) {
static BROTLI_INLINE void BrotliTakeBits(
BrotliBitReader* const br, uint32_t n_bits, uint32_t* val) {
*val = (uint32_t)BrotliGetBitsUnmasked(br) & BitMask(n_bits);
- BROTLI_LOG(("[BrotliReadBits] %d %d %d val: %6x\n",
+ BROTLI_LOG(("[BrotliTakeBits] %d %d %d val: %6x\n",
(int)br->avail_in, (int)br->bit_pos_, (int)n_bits, (int)*val));
BrotliDropBits(br, n_bits);
}
/* Reads the specified number of bits from |br| and advances the bit pos.
- Assumes that there is enough input to perform BrotliFillBitWindow. */
-static BROTLI_INLINE uint32_t BrotliReadBits(
+ Assumes that there is enough input to perform BrotliFillBitWindow.
+ Up to 24 bits are allowed to be requested from this method. */
+static BROTLI_INLINE uint32_t BrotliReadBits24(
BrotliBitReader* const br, uint32_t n_bits) {
+ BROTLI_DCHECK(n_bits <= 24);
if (BROTLI_64_BITS || (n_bits <= 16)) {
uint32_t val;
BrotliFillBitWindow(br, n_bits);
@@ -262,10 +265,32 @@ static BROTLI_INLINE uint32_t BrotliReadBits(
}
}
+/* Same as BrotliReadBits24, but allows reading up to 32 bits. */
+static BROTLI_INLINE uint32_t BrotliReadBits32(
+ BrotliBitReader* const br, uint32_t n_bits) {
+ BROTLI_DCHECK(n_bits <= 32);
+ if (BROTLI_64_BITS || (n_bits <= 16)) {
+ uint32_t val;
+ BrotliFillBitWindow(br, n_bits);
+ BrotliTakeBits(br, n_bits, &val);
+ return val;
+ } else {
+ uint32_t low_val;
+ uint32_t high_val;
+ BrotliFillBitWindow(br, 16);
+ BrotliTakeBits(br, 16, &low_val);
+ BrotliFillBitWindow(br, 16);
+ BrotliTakeBits(br, n_bits - 16, &high_val);
+ return low_val | (high_val << 16);
+ }
+}
+
/* Tries to read the specified amount of bits. Returns BROTLI_FALSE, if there
- is not enough input. |n_bits| MUST be positive. */
+ is not enough input. |n_bits| MUST be positive.
+ Up to 24 bits are allowed to be requested from this method. */
static BROTLI_INLINE BROTLI_BOOL BrotliSafeReadBits(
BrotliBitReader* const br, uint32_t n_bits, uint32_t* val) {
+ BROTLI_DCHECK(n_bits <= 24);
while (BrotliGetAvailableBits(br) < n_bits) {
if (!BrotliPullByte(br)) {
return BROTLI_FALSE;
@@ -275,6 +300,23 @@ static BROTLI_INLINE BROTLI_BOOL BrotliSafeReadBits(
return BROTLI_TRUE;
}
+/* Same as BrotliSafeReadBits, but allows reading up to 32 bits. */
+static BROTLI_INLINE BROTLI_BOOL BrotliSafeReadBits32(
+ BrotliBitReader* const br, uint32_t n_bits, uint32_t* val) {
+ BROTLI_DCHECK(n_bits <= 32);
+ if (BROTLI_64_BITS || (n_bits <= 24)) {
+ while (BrotliGetAvailableBits(br) < n_bits) {
+ if (!BrotliPullByte(br)) {
+ return BROTLI_FALSE;
+ }
+ }
+ BrotliTakeBits(br, n_bits, val);
+ return BROTLI_TRUE;
+ } else {
+ return BrotliSafeReadBits32Slow(br, n_bits, val);
+ }
+}
+
/* Advances the bit reader position to the next byte boundary and verifies
that any skipped bits are set to zero. */
static BROTLI_INLINE BROTLI_BOOL BrotliJumpToByteBoundary(BrotliBitReader* br) {
diff --git a/src/libraries/Native/AnyOS/brotli/dec/decode.c b/src/libraries/Native/AnyOS/brotli/dec/decode.c
index 08bd76ca16e2..ae5a3d3fa359 100644
--- a/src/libraries/Native/AnyOS/brotli/dec/decode.c
+++ b/src/libraries/Native/AnyOS/brotli/dec/decode.c
@@ -41,7 +41,8 @@ extern "C" {
/* We need the slack region for the following reasons:
- doing up to two 16-byte copies for fast backward copying
- - inserting transformed dictionary word (5 prefix + 24 base + 8 suffix) */
+ - inserting transformed dictionary word:
+ 5 prefix + 24 base + 8 suffix */
static const uint32_t kRingBufferWriteAheadSlack = 42;
static const uint8_t kCodeLengthCodeOrder[BROTLI_CODE_LENGTH_CODES] = {
@@ -274,7 +275,8 @@ static BrotliDecoderErrorCode BROTLI_NOINLINE DecodeMetaBlockLength(
s->loop_counter = i;
return BROTLI_DECODER_NEEDS_MORE_INPUT;
}
- if (i + 1 == s->size_nibbles && s->size_nibbles > 4 && bits == 0) {
+ if (i + 1 == (int)s->size_nibbles && s->size_nibbles > 4 &&
+ bits == 0) {
return BROTLI_FAILURE(BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE);
}
s->meta_block_remaining_len |= (int)(bits << (i * 4));
@@ -323,7 +325,8 @@ static BrotliDecoderErrorCode BROTLI_NOINLINE DecodeMetaBlockLength(
s->loop_counter = i;
return BROTLI_DECODER_NEEDS_MORE_INPUT;
}
- if (i + 1 == s->size_nibbles && s->size_nibbles > 1 && bits == 0) {
+ if (i + 1 == (int)s->size_nibbles && s->size_nibbles > 1 &&
+ bits == 0) {
return BROTLI_FAILURE(
BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE);
}
@@ -470,32 +473,34 @@ static BROTLI_INLINE uint32_t Log2Floor(uint32_t x) {
Totally 1..4 symbols are read, 1..11 bits each.
The list of symbols MUST NOT contain duplicates. */
static BrotliDecoderErrorCode ReadSimpleHuffmanSymbols(
- uint32_t alphabet_size, uint32_t max_symbol, BrotliDecoderState* s) {
+ uint32_t alphabet_size_max, uint32_t alphabet_size_limit,
+ BrotliDecoderState* s) {
/* max_bits == 1..11; symbol == 0..3; 1..44 bits will be read. */
BrotliBitReader* br = &s->br;
- uint32_t max_bits = Log2Floor(alphabet_size - 1);
- uint32_t i = s->sub_loop_counter;
- uint32_t num_symbols = s->symbol;
+ BrotliMetablockHeaderArena* h = &s->arena.header;
+ uint32_t max_bits = Log2Floor(alphabet_size_max - 1);
+ uint32_t i = h->sub_loop_counter;
+ uint32_t num_symbols = h->symbol;
while (i <= num_symbols) {
uint32_t v;
if (BROTLI_PREDICT_FALSE(!BrotliSafeReadBits(br, max_bits, &v))) {
- s->sub_loop_counter = i;
- s->substate_huffman = BROTLI_STATE_HUFFMAN_SIMPLE_READ;
+ h->sub_loop_counter = i;
+ h->substate_huffman = BROTLI_STATE_HUFFMAN_SIMPLE_READ;
return BROTLI_DECODER_NEEDS_MORE_INPUT;
}
- if (v >= max_symbol) {
+ if (v >= alphabet_size_limit) {
return
BROTLI_FAILURE(BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET);
}
- s->symbols_lists_array[i] = (uint16_t)v;
- BROTLI_LOG_UINT(s->symbols_lists_array[i]);
+ h->symbols_lists_array[i] = (uint16_t)v;
+ BROTLI_LOG_UINT(h->symbols_lists_array[i]);
++i;
}
for (i = 0; i < num_symbols; ++i) {
uint32_t k = i + 1;
for (; k <= num_symbols; ++k) {
- if (s->symbols_lists_array[i] == s->symbols_lists_array[k]) {
+ if (h->symbols_lists_array[i] == h->symbols_lists_array[k]) {
return BROTLI_FAILURE(BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME);
}
}
@@ -588,27 +593,28 @@ static BROTLI_INLINE void ProcessRepeatedCodeLength(uint32_t code_len,
static BrotliDecoderErrorCode ReadSymbolCodeLengths(
uint32_t alphabet_size, BrotliDecoderState* s) {
BrotliBitReader* br = &s->br;
- uint32_t symbol = s->symbol;
- uint32_t repeat = s->repeat;
- uint32_t space = s->space;
- uint32_t prev_code_len = s->prev_code_len;
- uint32_t repeat_code_len = s->repeat_code_len;
- uint16_t* symbol_lists = s->symbol_lists;
- uint16_t* code_length_histo = s->code_length_histo;
- int* next_symbol = s->next_symbol;
+ BrotliMetablockHeaderArena* h = &s->arena.header;
+ uint32_t symbol = h->symbol;
+ uint32_t repeat = h->repeat;
+ uint32_t space = h->space;
+ uint32_t prev_code_len = h->prev_code_len;
+ uint32_t repeat_code_len = h->repeat_code_len;
+ uint16_t* symbol_lists = h->symbol_lists;
+ uint16_t* code_length_histo = h->code_length_histo;
+ int* next_symbol = h->next_symbol;
if (!BrotliWarmupBitReader(br)) {
return BROTLI_DECODER_NEEDS_MORE_INPUT;
}
while (symbol < alphabet_size && space > 0) {
- const HuffmanCode* p = s->table;
+ const HuffmanCode* p = h->table;
uint32_t code_len;
BROTLI_HC_MARK_TABLE_FOR_FAST_LOAD(p);
if (!BrotliCheckInputAmount(br, BROTLI_SHORT_FILL_BIT_WINDOW_READ)) {
- s->symbol = symbol;
- s->repeat = repeat;
- s->prev_code_len = prev_code_len;
- s->repeat_code_len = repeat_code_len;
- s->space = space;
+ h->symbol = symbol;
+ h->repeat = repeat;
+ h->prev_code_len = prev_code_len;
+ h->repeat_code_len = repeat_code_len;
+ h->space = space;
return BROTLI_DECODER_NEEDS_MORE_INPUT;
}
BrotliFillBitWindow16(br);
@@ -630,16 +636,17 @@ static BrotliDecoderErrorCode ReadSymbolCodeLengths(
symbol_lists, code_length_histo, next_symbol);
}
}
- s->space = space;
+ h->space = space;
return BROTLI_DECODER_SUCCESS;
}
static BrotliDecoderErrorCode SafeReadSymbolCodeLengths(
uint32_t alphabet_size, BrotliDecoderState* s) {
BrotliBitReader* br = &s->br;
+ BrotliMetablockHeaderArena* h = &s->arena.header;
BROTLI_BOOL get_byte = BROTLI_FALSE;
- while (s->symbol < alphabet_size && s->space > 0) {
- const HuffmanCode* p = s->table;
+ while (h->symbol < alphabet_size && h->space > 0) {
+ const HuffmanCode* p = h->table;
uint32_t code_len;
uint32_t available_bits;
uint32_t bits = 0;
@@ -659,9 +666,9 @@ static BrotliDecoderErrorCode SafeReadSymbolCodeLengths(
code_len = BROTLI_HC_FAST_LOAD_VALUE(p); /* code_len == 0..17 */
if (code_len < BROTLI_REPEAT_PREVIOUS_CODE_LENGTH) {
BrotliDropBits(br, BROTLI_HC_FAST_LOAD_BITS(p));
- ProcessSingleCodeLength(code_len, &s->symbol, &s->repeat, &s->space,
- &s->prev_code_len, s->symbol_lists, s->code_length_histo,
- s->next_symbol);
+ ProcessSingleCodeLength(code_len, &h->symbol, &h->repeat, &h->space,
+ &h->prev_code_len, h->symbol_lists, h->code_length_histo,
+ h->next_symbol);
} else { /* code_len == 16..17, extra_bits == 2..3 */
uint32_t extra_bits = code_len - 14U;
uint32_t repeat_delta = (bits >> BROTLI_HC_FAST_LOAD_BITS(p)) &
@@ -672,9 +679,9 @@ static BrotliDecoderErrorCode SafeReadSymbolCodeLengths(
}
BrotliDropBits(br, BROTLI_HC_FAST_LOAD_BITS(p) + extra_bits);
ProcessRepeatedCodeLength(code_len, repeat_delta, alphabet_size,
- &s->symbol, &s->repeat, &s->space, &s->prev_code_len,
- &s->repeat_code_len, s->symbol_lists, s->code_length_histo,
- s->next_symbol);
+ &h->symbol, &h->repeat, &h->space, &h->prev_code_len,
+ &h->repeat_code_len, h->symbol_lists, h->code_length_histo,
+ h->next_symbol);
}
}
return BROTLI_DECODER_SUCCESS;
@@ -684,9 +691,10 @@ static BrotliDecoderErrorCode SafeReadSymbolCodeLengths(
Each code is 2..4 bits long. In total 30..72 bits are used. */
static BrotliDecoderErrorCode ReadCodeLengthCodeLengths(BrotliDecoderState* s) {
BrotliBitReader* br = &s->br;
- uint32_t num_codes = s->repeat;
- unsigned space = s->space;
- uint32_t i = s->sub_loop_counter;
+ BrotliMetablockHeaderArena* h = &s->arena.header;
+ uint32_t num_codes = h->repeat;
+ unsigned space = h->space;
+ uint32_t i = h->sub_loop_counter;
for (; i < BROTLI_CODE_LENGTH_CODES; ++i) {
const uint8_t code_len_idx = kCodeLengthCodeOrder[i];
uint32_t ix;
@@ -699,21 +707,21 @@ static BrotliDecoderErrorCode ReadCodeLengthCodeLengths(BrotliDecoderState* s) {
ix = 0;
}
if (kCodeLengthPrefixLength[ix] > available_bits) {
- s->sub_loop_counter = i;
- s->repeat = num_codes;
- s->space = space;
- s->substate_huffman = BROTLI_STATE_HUFFMAN_COMPLEX;
+ h->sub_loop_counter = i;
+ h->repeat = num_codes;
+ h->space = space;
+ h->substate_huffman = BROTLI_STATE_HUFFMAN_COMPLEX;
return BROTLI_DECODER_NEEDS_MORE_INPUT;
}
}
v = kCodeLengthPrefixValue[ix];
BrotliDropBits(br, kCodeLengthPrefixLength[ix]);
- s->code_length_code_lengths[code_len_idx] = (uint8_t)v;
- BROTLI_LOG_ARRAY_INDEX(s->code_length_code_lengths, code_len_idx);
+ h->code_length_code_lengths[code_len_idx] = (uint8_t)v;
+ BROTLI_LOG_ARRAY_INDEX(h->code_length_code_lengths, code_len_idx);
if (v != 0) {
space = space - (32U >> v);
++num_codes;
- ++s->code_length_histo[v];
+ ++h->code_length_histo[v];
if (space - 1U >= 32U) {
/* space is 0 or wrapped around. */
break;
@@ -737,49 +745,48 @@ static BrotliDecoderErrorCode ReadCodeLengthCodeLengths(BrotliDecoderState* s) {
encoded with predefined entropy code. 32 - 74 bits are used.
B.2) Decoded table is used to decode code lengths of symbols in resulting
Huffman table. In worst case 3520 bits are read. */
-static BrotliDecoderErrorCode ReadHuffmanCode(uint32_t alphabet_size,
- uint32_t max_symbol,
+static BrotliDecoderErrorCode ReadHuffmanCode(uint32_t alphabet_size_max,
+ uint32_t alphabet_size_limit,
HuffmanCode* table,
uint32_t* opt_table_size,
BrotliDecoderState* s) {
BrotliBitReader* br = &s->br;
- /* Unnecessary masking, but might be good for safety. */
- alphabet_size &= 0x7FF;
+ BrotliMetablockHeaderArena* h = &s->arena.header;
/* State machine. */
for (;;) {
- switch (s->substate_huffman) {
+ switch (h->substate_huffman) {
case BROTLI_STATE_HUFFMAN_NONE:
- if (!BrotliSafeReadBits(br, 2, &s->sub_loop_counter)) {
+ if (!BrotliSafeReadBits(br, 2, &h->sub_loop_counter)) {
return BROTLI_DECODER_NEEDS_MORE_INPUT;
}
- BROTLI_LOG_UINT(s->sub_loop_counter);
+ BROTLI_LOG_UINT(h->sub_loop_counter);
/* The value is used as follows:
1 for simple code;
0 for no skipping, 2 skips 2 code lengths, 3 skips 3 code lengths */
- if (s->sub_loop_counter != 1) {
- s->space = 32;
- s->repeat = 0; /* num_codes */
- memset(&s->code_length_histo[0], 0, sizeof(s->code_length_histo[0]) *
+ if (h->sub_loop_counter != 1) {
+ h->space = 32;
+ h->repeat = 0; /* num_codes */
+ memset(&h->code_length_histo[0], 0, sizeof(h->code_length_histo[0]) *
(BROTLI_HUFFMAN_MAX_CODE_LENGTH_CODE_LENGTH + 1));
- memset(&s->code_length_code_lengths[0], 0,
- sizeof(s->code_length_code_lengths));
- s->substate_huffman = BROTLI_STATE_HUFFMAN_COMPLEX;
+ memset(&h->code_length_code_lengths[0], 0,
+ sizeof(h->code_length_code_lengths));
+ h->substate_huffman = BROTLI_STATE_HUFFMAN_COMPLEX;
continue;
}
/* Fall through. */
case BROTLI_STATE_HUFFMAN_SIMPLE_SIZE:
/* Read symbols, codes & code lengths directly. */
- if (!BrotliSafeReadBits(br, 2, &s->symbol)) { /* num_symbols */
- s->substate_huffman = BROTLI_STATE_HUFFMAN_SIMPLE_SIZE;
+ if (!BrotliSafeReadBits(br, 2, &h->symbol)) { /* num_symbols */
+ h->substate_huffman = BROTLI_STATE_HUFFMAN_SIMPLE_SIZE;
return BROTLI_DECODER_NEEDS_MORE_INPUT;
}
- s->sub_loop_counter = 0;
+ h->sub_loop_counter = 0;
/* Fall through. */
case BROTLI_STATE_HUFFMAN_SIMPLE_READ: {
BrotliDecoderErrorCode result =
- ReadSimpleHuffmanSymbols(alphabet_size, max_symbol, s);
+ ReadSimpleHuffmanSymbols(alphabet_size_max, alphabet_size_limit, s);
if (result != BROTLI_DECODER_SUCCESS) {
return result;
}
@@ -788,21 +795,21 @@ static BrotliDecoderErrorCode ReadHuffmanCode(uint32_t alphabet_size,
case BROTLI_STATE_HUFFMAN_SIMPLE_BUILD: {
uint32_t table_size;
- if (s->symbol == 3) {
+ if (h->symbol == 3) {
uint32_t bits;
if (!BrotliSafeReadBits(br, 1, &bits)) {
- s->substate_huffman = BROTLI_STATE_HUFFMAN_SIMPLE_BUILD;
+ h->substate_huffman = BROTLI_STATE_HUFFMAN_SIMPLE_BUILD;
return BROTLI_DECODER_NEEDS_MORE_INPUT;
}
- s->symbol += bits;
+ h->symbol += bits;
}
- BROTLI_LOG_UINT(s->symbol);
+ BROTLI_LOG_UINT(h->symbol);
table_size = BrotliBuildSimpleHuffmanTable(
- table, HUFFMAN_TABLE_BITS, s->symbols_lists_array, s->symbol);
+ table, HUFFMAN_TABLE_BITS, h->symbols_lists_array, h->symbol);
if (opt_table_size) {
*opt_table_size = table_size;
}
- s->substate_huffman = BROTLI_STATE_HUFFMAN_NONE;
+ h->substate_huffman = BROTLI_STATE_HUFFMAN_NONE;
return BROTLI_DECODER_SUCCESS;
}
@@ -813,44 +820,45 @@ static BrotliDecoderErrorCode ReadHuffmanCode(uint32_t alphabet_size,
if (result != BROTLI_DECODER_SUCCESS) {
return result;
}
- BrotliBuildCodeLengthsHuffmanTable(s->table,
- s->code_length_code_lengths,
- s->code_length_histo);
- memset(&s->code_length_histo[0], 0, sizeof(s->code_length_histo));
+ BrotliBuildCodeLengthsHuffmanTable(h->table,
+ h->code_length_code_lengths,
+ h->code_length_histo);
+ memset(&h->code_length_histo[0], 0, sizeof(h->code_length_histo));
for (i = 0; i <= BROTLI_HUFFMAN_MAX_CODE_LENGTH; ++i) {
- s->next_symbol[i] = (int)i - (BROTLI_HUFFMAN_MAX_CODE_LENGTH + 1);
- s->symbol_lists[s->next_symbol[i]] = 0xFFFF;
+ h->next_symbol[i] = (int)i - (BROTLI_HUFFMAN_MAX_CODE_LENGTH + 1);
+ h->symbol_lists[h->next_symbol[i]] = 0xFFFF;
}
- s->symbol = 0;
- s->prev_code_len = BROTLI_INITIAL_REPEATED_CODE_LENGTH;
- s->repeat = 0;
- s->repeat_code_len = 0;
- s->space = 32768;
- s->substate_huffman = BROTLI_STATE_HUFFMAN_LENGTH_SYMBOLS;
+ h->symbol = 0;
+ h->prev_code_len = BROTLI_INITIAL_REPEATED_CODE_LENGTH;
+ h->repeat = 0;
+ h->repeat_code_len = 0;
+ h->space = 32768;
+ h->substate_huffman = BROTLI_STATE_HUFFMAN_LENGTH_SYMBOLS;
}
/* Fall through. */
case BROTLI_STATE_HUFFMAN_LENGTH_SYMBOLS: {
uint32_t table_size;
- BrotliDecoderErrorCode result = ReadSymbolCodeLengths(max_symbol, s);
+ BrotliDecoderErrorCode result = ReadSymbolCodeLengths(
+ alphabet_size_limit, s);
if (result == BROTLI_DECODER_NEEDS_MORE_INPUT) {
- result = SafeReadSymbolCodeLengths(max_symbol, s);
+ result = SafeReadSymbolCodeLengths(alphabet_size_limit, s);
}
if (result != BROTLI_DECODER_SUCCESS) {
return result;
}
- if (s->space != 0) {
- BROTLI_LOG(("[ReadHuffmanCode] space = %d\n", (int)s->space));
+ if (h->space != 0) {
+ BROTLI_LOG(("[ReadHuffmanCode] space = %d\n", (int)h->space));
return BROTLI_FAILURE(BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE);
}
table_size = BrotliBuildHuffmanTable(
- table, HUFFMAN_TABLE_BITS, s->symbol_lists, s->code_length_histo);
+ table, HUFFMAN_TABLE_BITS, h->symbol_lists, h->code_length_histo);
if (opt_table_size) {
*opt_table_size = table_size;
}
- s->substate_huffman = BROTLI_STATE_HUFFMAN_NONE;
+ h->substate_huffman = BROTLI_STATE_HUFFMAN_NONE;
return BROTLI_DECODER_SUCCESS;
}
@@ -867,8 +875,8 @@ static BROTLI_INLINE uint32_t ReadBlockLength(const HuffmanCode* table,
uint32_t code;
uint32_t nbits;
code = ReadSymbol(table, br);
- nbits = kBlockLengthPrefixCode[code].nbits; /* nbits == 2..24 */
- return kBlockLengthPrefixCode[code].offset + BrotliReadBits(br, nbits);
+ nbits = _kBrotliPrefixCodeRanges[code].nbits; /* nbits == 2..24 */
+ return _kBrotliPrefixCodeRanges[code].offset + BrotliReadBits24(br, nbits);
}
/* WARNING: if state is not BROTLI_STATE_READ_BLOCK_LENGTH_NONE, then
@@ -886,13 +894,14 @@ static BROTLI_INLINE BROTLI_BOOL SafeReadBlockLength(
}
{
uint32_t bits;
- uint32_t nbits = kBlockLengthPrefixCode[index].nbits; /* nbits == 2..24 */
+ uint32_t nbits = _kBrotliPrefixCodeRanges[index].nbits;
+ uint32_t offset = _kBrotliPrefixCodeRanges[index].offset;
if (!BrotliSafeReadBits(br, nbits, &bits)) {
s->block_length_index = index;
s->substate_read_block_length = BROTLI_STATE_READ_BLOCK_LENGTH_SUFFIX;
return BROTLI_FALSE;
}
- *result = kBlockLengthPrefixCode[index].offset + bits;
+ *result = offset + bits;
s->substate_read_block_length = BROTLI_STATE_READ_BLOCK_LENGTH_NONE;
return BROTLI_TRUE;
}
@@ -952,22 +961,22 @@ static BROTLI_NOINLINE void InverseMoveToFrontTransform(
/* Decodes a series of Huffman table using ReadHuffmanCode function. */
static BrotliDecoderErrorCode HuffmanTreeGroupDecode(
HuffmanTreeGroup* group, BrotliDecoderState* s) {
- if (s->substate_tree_group != BROTLI_STATE_TREE_GROUP_LOOP) {
- s->next = group->codes;
- s->htree_index = 0;
- s->substate_tree_group = BROTLI_STATE_TREE_GROUP_LOOP;
+ BrotliMetablockHeaderArena* h = &s->arena.header;
+ if (h->substate_tree_group != BROTLI_STATE_TREE_GROUP_LOOP) {
+ h->next = group->codes;
+ h->htree_index = 0;
+ h->substate_tree_group = BROTLI_STATE_TREE_GROUP_LOOP;
}
- while (s->htree_index < group->num_htrees) {
+ while (h->htree_index < group->num_htrees) {
uint32_t table_size;
- BrotliDecoderErrorCode result =
- ReadHuffmanCode(group->alphabet_size, group->max_symbol,
- s->next, &table_size, s);
+ BrotliDecoderErrorCode result = ReadHuffmanCode(group->alphabet_size_max,
+ group->alphabet_size_limit, h->next, &table_size, s);
if (result != BROTLI_DECODER_SUCCESS) return result;
- group->htrees[s->htree_index] = s->next;
- s->next += table_size;
- ++s->htree_index;
+ group->htrees[h->htree_index] = h->next;
+ h->next += table_size;
+ ++h->htree_index;
}
- s->substate_tree_group = BROTLI_STATE_TREE_GROUP_NONE;
+ h->substate_tree_group = BROTLI_STATE_TREE_GROUP_NONE;
return BROTLI_DECODER_SUCCESS;
}
@@ -985,15 +994,16 @@ static BrotliDecoderErrorCode DecodeContextMap(uint32_t context_map_size,
BrotliDecoderState* s) {
BrotliBitReader* br = &s->br;
BrotliDecoderErrorCode result = BROTLI_DECODER_SUCCESS;
+ BrotliMetablockHeaderArena* h = &s->arena.header;
- switch ((int)s->substate_context_map) {
+ switch ((int)h->substate_context_map) {
case BROTLI_STATE_CONTEXT_MAP_NONE:
result = DecodeVarLenUint8(s, br, num_htrees);
if (result != BROTLI_DECODER_SUCCESS) {
return result;
}
(*num_htrees)++;
- s->context_index = 0;
+ h->context_index = 0;
BROTLI_LOG_UINT(context_map_size);
BROTLI_LOG_UINT(*num_htrees);
*context_map_arg =
@@ -1005,7 +1015,7 @@ static BrotliDecoderErrorCode DecodeContextMap(uint32_t context_map_size,
memset(*context_map_arg, 0, (size_t)context_map_size);
return BROTLI_DECODER_SUCCESS;
}
- s->substate_context_map = BROTLI_STATE_CONTEXT_MAP_READ_PREFIX;
+ h->substate_context_map = BROTLI_STATE_CONTEXT_MAP_READ_PREFIX;
/* Fall through. */
case BROTLI_STATE_CONTEXT_MAP_READ_PREFIX: {
@@ -1016,38 +1026,38 @@ static BrotliDecoderErrorCode DecodeContextMap(uint32_t context_map_size,
return BROTLI_DECODER_NEEDS_MORE_INPUT;
}
if ((bits & 1) != 0) { /* Use RLE for zeros. */
- s->max_run_length_prefix = (bits >> 1) + 1;
+ h->max_run_length_prefix = (bits >> 1) + 1;
BrotliDropBits(br, 5);
} else {
- s->max_run_length_prefix = 0;
+ h->max_run_length_prefix = 0;
BrotliDropBits(br, 1);
}
- BROTLI_LOG_UINT(s->max_run_length_prefix);
- s->substate_context_map = BROTLI_STATE_CONTEXT_MAP_HUFFMAN;
+ BROTLI_LOG_UINT(h->max_run_length_prefix);
+ h->substate_context_map = BROTLI_STATE_CONTEXT_MAP_HUFFMAN;
}
/* Fall through. */
case BROTLI_STATE_CONTEXT_MAP_HUFFMAN: {
- uint32_t alphabet_size = *num_htrees + s->max_run_length_prefix;
+ uint32_t alphabet_size = *num_htrees + h->max_run_length_prefix;
result = ReadHuffmanCode(alphabet_size, alphabet_size,
- s->context_map_table, NULL, s);
+ h->context_map_table, NULL, s);
if (result != BROTLI_DECODER_SUCCESS) return result;
- s->code = 0xFFFF;
- s->substate_context_map = BROTLI_STATE_CONTEXT_MAP_DECODE;
+ h->code = 0xFFFF;
+ h->substate_context_map = BROTLI_STATE_CONTEXT_MAP_DECODE;
}
/* Fall through. */
case BROTLI_STATE_CONTEXT_MAP_DECODE: {
- uint32_t context_index = s->context_index;
- uint32_t max_run_length_prefix = s->max_run_length_prefix;
+ uint32_t context_index = h->context_index;
+ uint32_t max_run_length_prefix = h->max_run_length_prefix;
uint8_t* context_map = *context_map_arg;
- uint32_t code = s->code;
+ uint32_t code = h->code;
BROTLI_BOOL skip_preamble = (code != 0xFFFF);
while (context_index < context_map_size || skip_preamble) {
if (!skip_preamble) {
- if (!SafeReadSymbol(s->context_map_table, br, &code)) {
- s->code = 0xFFFF;
- s->context_index = context_index;
+ if (!SafeReadSymbol(h->context_map_table, br, &code)) {
+ h->code = 0xFFFF;
+ h->context_index = context_index;
return BROTLI_DECODER_NEEDS_MORE_INPUT;
}
BROTLI_LOG_UINT(code);
@@ -1068,8 +1078,8 @@ static BrotliDecoderErrorCode DecodeContextMap(uint32_t context_map_size,
{
uint32_t reps;
if (!BrotliSafeReadBits(br, code, &reps)) {
- s->code = code;
- s->context_index = context_index;
+ h->code = code;
+ h->context_index = context_index;
return BROTLI_DECODER_NEEDS_MORE_INPUT;
}
reps += 1U << code;
@@ -1089,13 +1099,13 @@ static BrotliDecoderErrorCode DecodeContextMap(uint32_t context_map_size,
case BROTLI_STATE_CONTEXT_MAP_TRANSFORM: {
uint32_t bits;
if (!BrotliSafeReadBits(br, 1, &bits)) {
- s->substate_context_map = BROTLI_STATE_CONTEXT_MAP_TRANSFORM;
+ h->substate_context_map = BROTLI_STATE_CONTEXT_MAP_TRANSFORM;
return BROTLI_DECODER_NEEDS_MORE_INPUT;
}
if (bits != 0) {
InverseMoveToFrontTransform(*context_map_arg, context_map_size, s);
}
- s->substate_context_map = BROTLI_STATE_CONTEXT_MAP_NONE;
+ h->substate_context_map = BROTLI_STATE_CONTEXT_MAP_NONE;
return BROTLI_DECODER_SUCCESS;
}
@@ -1457,32 +1467,28 @@ static BrotliDecoderErrorCode ReadContextModes(BrotliDecoderState* s) {
}
static BROTLI_INLINE void TakeDistanceFromRingBuffer(BrotliDecoderState* s) {
- if (s->distance_code == 0) {
- --s->dist_rb_idx;
- s->distance_code = s->dist_rb[s->dist_rb_idx & 3];
+ int offset = s->distance_code - 3;
+ if (s->distance_code <= 3) {
/* Compensate double distance-ring-buffer roll for dictionary items. */
- s->distance_context = 1;
+ s->distance_context = 1 >> s->distance_code;
+ s->distance_code = s->dist_rb[(s->dist_rb_idx - offset) & 3];
+ s->dist_rb_idx -= s->distance_context;
} else {
- int distance_code = s->distance_code << 1;
- /* kDistanceShortCodeIndexOffset has 2-bit values from LSB:
- 3, 2, 1, 0, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2 */
- const uint32_t kDistanceShortCodeIndexOffset = 0xAAAFFF1B;
- /* kDistanceShortCodeValueOffset has 2-bit values from LSB:
- -0, 0,-0, 0,-1, 1,-2, 2,-3, 3,-1, 1,-2, 2,-3, 3 */
- const uint32_t kDistanceShortCodeValueOffset = 0xFA5FA500;
- int v = (s->dist_rb_idx +
- (int)(kDistanceShortCodeIndexOffset >> distance_code)) & 0x3;
- s->distance_code = s->dist_rb[v];
- v = (int)(kDistanceShortCodeValueOffset >> distance_code) & 0x3;
- if ((distance_code & 0x3) != 0) {
- s->distance_code += v;
+ int index_delta = 3;
+ int delta;
+ int base = s->distance_code - 10;
+ if (s->distance_code < 10) {
+ base = s->distance_code - 4;
} else {
- s->distance_code -= v;
- if (s->distance_code <= 0) {
- /* A huge distance will cause a BROTLI_FAILURE() soon.
- This is a little faster than failing here. */
- s->distance_code = 0x7FFFFFFF;
- }
+ index_delta = 2;
+ }
+ /* Unpack one of six 4-bit values. */
+ delta = ((0x605142 >> (4 * base)) & 0xF) - 3;
+ s->distance_code = s->dist_rb[(s->dist_rb_idx + index_delta) & 0x3] + delta;
+ if (s->distance_code <= 0) {
+ /* A huge distance will cause a BROTLI_FAILURE() soon.
+ This is a little faster than failing here. */
+ s->distance_code = 0x7FFFFFFF;
}
}
}
@@ -1497,62 +1503,153 @@ static BROTLI_INLINE BROTLI_BOOL SafeReadBits(
}
}
+static BROTLI_INLINE BROTLI_BOOL SafeReadBits32(
+ BrotliBitReader* const br, uint32_t n_bits, uint32_t* val) {
+ if (n_bits != 0) {
+ return BrotliSafeReadBits32(br, n_bits, val);
+ } else {
+ *val = 0;
+ return BROTLI_TRUE;
+ }
+}
+
+/*
+ RFC 7932 Section 4 with "..." shortenings and "[]" emendations.
+
+ Each distance ... is represented with a pair ...
+ The distance code is encoded using a prefix code... The number of extra bits
+ can be 0..24... Two additional parameters: NPOSTFIX (0..3), and ...
+ NDIRECT (0..120) ... are encoded in the meta-block header...
+
+ The first 16 distance symbols ... reference past distances... ring buffer ...
+ Next NDIRECT distance symbols ... represent distances from 1 to NDIRECT...
+ [For] distance symbols 16 + NDIRECT and greater ... the number of extra bits
+ ... is given by the following formula:
+
+ [ xcode = dcode - NDIRECT - 16 ]
+ ndistbits = 1 + [ xcode ] >> (NPOSTFIX + 1)
+
+ ...
+*/
+
+/*
+ RFC 7932 Section 9.2 with "..." shortenings and "[]" emendations.
+
+ ... to get the actual value of the parameter NDIRECT, left-shift this
+ four-bit number by NPOSTFIX bits ...
+*/
+
+/* Remaining formulas from RFC 7932 Section 4 could be rewritten as following:
+
+ alphabet_size = 16 + NDIRECT + (max_distbits << (NPOSTFIX + 1))
+
+ half = ((xcode >> NPOSTFIX) & 1) << ndistbits
+ postfix = xcode & ((1 << NPOSTFIX) - 1)
+ range_start = 2 * (1 << ndistbits - 1 - 1)
+
+ distance = (range_start + half + extra) << NPOSTFIX + postfix + NDIRECT + 1
+
+ NB: ndistbits >= 1 -> range_start >= 0
+ NB: range_start has factor 2, as the range is covered by 2 "halves"
+ NB: extra -1 offset in range_start formula covers the absence of
+ ndistbits = 0 case
+ NB: when NPOSTFIX = 0, NDIRECT is not greater than 15
+
+ In other words, xcode has the following binary structure - XXXHPPP:
+ - XXX represent the number of extra distance bits
+ - H selects upper / lower range of distances
+ - PPP represent "postfix"
+
+ "Regular" distance encoding has NPOSTFIX = 0; omitting the postfix part
+ simplifies distance calculation.
+
+ Using NPOSTFIX > 0 allows cheaper encoding of regular structures, e.g. where
+ most of distances have the same reminder of division by 2/4/8. For example,
+ the table of int32_t values that come from different sources; if it is likely
+ that 3 highest bytes of values from the same source are the same, then
+ copy distance often looks like 4x + y.
+
+ Distance calculation could be rewritten to:
+
+ ndistbits = NDISTBITS(NDIRECT, NPOSTFIX)[dcode]
+ distance = OFFSET(NDIRECT, NPOSTFIX)[dcode] + extra << NPOSTFIX
+
+ NDISTBITS and OFFSET could be pre-calculated, as NDIRECT and NPOSTFIX could
+ change only once per meta-block.
+*/
+
+/* Calculates distance lookup table.
+ NB: it is possible to have all 64 tables precalculated. */
+static void CalculateDistanceLut(BrotliDecoderState* s) {
+ BrotliMetablockBodyArena* b = &s->arena.body;
+ uint32_t npostfix = s->distance_postfix_bits;
+ uint32_t ndirect = s->num_direct_distance_codes;
+ uint32_t alphabet_size_limit = s->distance_hgroup.alphabet_size_limit;
+ uint32_t postfix = 1u << npostfix;
+ uint32_t j;
+ uint32_t bits = 1;
+ uint32_t half = 0;
+
+ /* Skip short codes. */
+ uint32_t i = BROTLI_NUM_DISTANCE_SHORT_CODES;
+
+ /* Fill direct codes. */
+ for (j = 0; j < ndirect; ++j) {
+ b->dist_extra_bits[i] = 0;
+ b->dist_offset[i] = j + 1;
+ ++i;
+ }
+
+ /* Fill regular distance codes. */
+ while (i < alphabet_size_limit) {
+ uint32_t base = ndirect + ((((2 + half) << bits) - 4) << npostfix) + 1;
+ /* Always fill the complete group. */
+ for (j = 0; j < postfix; ++j) {
+ b->dist_extra_bits[i] = (uint8_t)bits;
+ b->dist_offset[i] = base + j;
+ ++i;
+ }
+ bits = bits + half;
+ half = half ^ 1;
+ }
+}
+
/* Precondition: s->distance_code < 0. */
static BROTLI_INLINE BROTLI_BOOL ReadDistanceInternal(
int safe, BrotliDecoderState* s, BrotliBitReader* br) {
- int distval;
+ BrotliMetablockBodyArena* b = &s->arena.body;
+ uint32_t code;
+ uint32_t bits;
BrotliBitReaderState memento;
HuffmanCode* distance_tree = s->distance_hgroup.htrees[s->dist_htree_index];
if (!safe) {
- s->distance_code = (int)ReadSymbol(distance_tree, br);
+ code = ReadSymbol(distance_tree, br);
} else {
- uint32_t code;
BrotliBitReaderSaveState(br, &memento);
if (!SafeReadSymbol(distance_tree, br, &code)) {
return BROTLI_FALSE;
}
- s->distance_code = (int)code;
}
+ --s->block_length[2];
/* Convert the distance code to the actual distance by possibly
- looking up past distances from the s->ringbuffer. */
+ looking up past distances from the s->dist_rb. */
s->distance_context = 0;
- if ((s->distance_code & ~0xF) == 0) {
+ if ((code & ~0xFu) == 0) {
+ s->distance_code = (int)code;
TakeDistanceFromRingBuffer(s);
- --s->block_length[2];
return BROTLI_TRUE;
}
- distval = s->distance_code - (int)s->num_direct_distance_codes;
- if (distval >= 0) {
- uint32_t nbits;
- int postfix;
- int offset;
- if (!safe && (s->distance_postfix_bits == 0)) {
- nbits = ((uint32_t)distval >> 1) + 1;
- offset = ((2 + (distval & 1)) << nbits) - 4;
- s->distance_code = (int)s->num_direct_distance_codes + offset +
- (int)BrotliReadBits(br, nbits);
- } else {
- /* This branch also works well when s->distance_postfix_bits == 0. */
- uint32_t bits;
- postfix = distval & s->distance_postfix_mask;
- distval >>= s->distance_postfix_bits;
- nbits = ((uint32_t)distval >> 1) + 1;
- if (safe) {
- if (!SafeReadBits(br, nbits, &bits)) {
- s->distance_code = -1; /* Restore precondition. */
- BrotliBitReaderRestoreState(br, &memento);
- return BROTLI_FALSE;
- }
- } else {
- bits = BrotliReadBits(br, nbits);
- }
- offset = ((2 + (distval & 1)) << nbits) - 4;
- s->distance_code = (int)s->num_direct_distance_codes +
- ((offset + (int)bits) << s->distance_postfix_bits) + postfix;
+ if (!safe) {
+ bits = BrotliReadBits32(br, b->dist_extra_bits[code]);
+ } else {
+ if (!SafeReadBits32(br, b->dist_extra_bits[code], &bits)) {
+ ++s->block_length[2];
+ BrotliBitReaderRestoreState(br, &memento);
+ return BROTLI_FALSE;
}
}
- s->distance_code = s->distance_code - BROTLI_NUM_DISTANCE_SHORT_CODES + 1;
- --s->block_length[2];
+ s->distance_code =
+ (int)(b->dist_offset[code] + (bits << s->distance_postfix_bits));
return BROTLI_TRUE;
}
@@ -1588,9 +1685,9 @@ static BROTLI_INLINE BROTLI_BOOL ReadCommandInternal(
*insert_length = v.insert_len_offset;
if (!safe) {
if (BROTLI_PREDICT_FALSE(v.insert_len_extra_bits != 0)) {
- insert_len_extra = BrotliReadBits(br, v.insert_len_extra_bits);
+ insert_len_extra = BrotliReadBits24(br, v.insert_len_extra_bits);
}
- copy_length = BrotliReadBits(br, v.copy_len_extra_bits);
+ copy_length = BrotliReadBits24(br, v.copy_len_extra_bits);
} else {
if (!SafeReadBits(br, v.insert_len_extra_bits, &insert_len_extra) ||
!SafeReadBits(br, v.copy_len_extra_bits, ©_length)) {
@@ -1935,21 +2032,6 @@ static BROTLI_NOINLINE BrotliDecoderErrorCode SafeProcessCommands(
return ProcessCommandsInternal(1, s);
}
-/* Returns the maximum number of distance symbols which can only represent
- distances not exceeding BROTLI_MAX_ALLOWED_DISTANCE. */
-static uint32_t BrotliMaxDistanceSymbol(uint32_t ndirect, uint32_t npostfix) {
- static const uint32_t bound[BROTLI_MAX_NPOSTFIX + 1] = {0, 4, 12, 28};
- static const uint32_t diff[BROTLI_MAX_NPOSTFIX + 1] = {73, 126, 228, 424};
- uint32_t postfix = 1U << npostfix;
- if (ndirect < bound[npostfix]) {
- return ndirect + diff[npostfix] + postfix;
- } else if (ndirect > bound[npostfix] + postfix) {
- return ndirect + diff[npostfix];
- } else {
- return bound[npostfix] + diff[npostfix] + postfix;
- }
-}
-
BrotliDecoderResult BrotliDecoderDecompress(
size_t encoded_size, const uint8_t* encoded_buffer, size_t* decoded_size,
uint8_t* decoded_buffer) {
@@ -2167,33 +2249,23 @@ BrotliDecoderResult BrotliDecoderDecompressStream(
s->state = BROTLI_STATE_UNCOMPRESSED;
break;
}
+ s->state = BROTLI_STATE_BEFORE_COMPRESSED_METABLOCK_HEADER;
+ /* Fall through. */
+
+ case BROTLI_STATE_BEFORE_COMPRESSED_METABLOCK_HEADER: {
+ BrotliMetablockHeaderArena* h = &s->arena.header;
s->loop_counter = 0;
+ /* Initialize compressed metablock header arena. */
+ h->sub_loop_counter = 0;
+ /* Make small negative indexes addressable. */
+ h->symbol_lists =
+ &h->symbols_lists_array[BROTLI_HUFFMAN_MAX_CODE_LENGTH + 1];
+ h->substate_huffman = BROTLI_STATE_HUFFMAN_NONE;
+ h->substate_tree_group = BROTLI_STATE_TREE_GROUP_NONE;
+ h->substate_context_map = BROTLI_STATE_CONTEXT_MAP_NONE;
s->state = BROTLI_STATE_HUFFMAN_CODE_0;
- break;
-
- case BROTLI_STATE_UNCOMPRESSED: {
- result = CopyUncompressedBlockToOutput(
- available_out, next_out, total_out, s);
- if (result != BROTLI_DECODER_SUCCESS) {
- break;
- }
- s->state = BROTLI_STATE_METABLOCK_DONE;
- break;
}
-
- case BROTLI_STATE_METADATA:
- for (; s->meta_block_remaining_len > 0; --s->meta_block_remaining_len) {
- uint32_t bits;
- /* Read one byte and ignore it. */
- if (!BrotliSafeReadBits(br, 8, &bits)) {
- result = BROTLI_DECODER_NEEDS_MORE_INPUT;
- break;
- }
- }
- if (result == BROTLI_DECODER_SUCCESS) {
- s->state = BROTLI_STATE_METABLOCK_DONE;
- }
- break;
+ /* Fall through. */
case BROTLI_STATE_HUFFMAN_CODE_0:
if (s->loop_counter >= 3) {
@@ -2247,6 +2319,30 @@ BrotliDecoderResult BrotliDecoderDecompressStream(
break;
}
+ case BROTLI_STATE_UNCOMPRESSED: {
+ result = CopyUncompressedBlockToOutput(
+ available_out, next_out, total_out, s);
+ if (result != BROTLI_DECODER_SUCCESS) {
+ break;
+ }
+ s->state = BROTLI_STATE_METABLOCK_DONE;
+ break;
+ }
+
+ case BROTLI_STATE_METADATA:
+ for (; s->meta_block_remaining_len > 0; --s->meta_block_remaining_len) {
+ uint32_t bits;
+ /* Read one byte and ignore it. */
+ if (!BrotliSafeReadBits(br, 8, &bits)) {
+ result = BROTLI_DECODER_NEEDS_MORE_INPUT;
+ break;
+ }
+ }
+ if (result == BROTLI_DECODER_SUCCESS) {
+ s->state = BROTLI_STATE_METABLOCK_DONE;
+ }
+ break;
+
case BROTLI_STATE_METABLOCK_HEADER_2: {
uint32_t bits;
if (!BrotliSafeReadBits(br, 6, &bits)) {
@@ -2255,11 +2351,9 @@ BrotliDecoderResult BrotliDecoderDecompressStream(
}
s->distance_postfix_bits = bits & BitMask(2);
bits >>= 2;
- s->num_direct_distance_codes = BROTLI_NUM_DISTANCE_SHORT_CODES +
- (bits << s->distance_postfix_bits);
+ s->num_direct_distance_codes = bits << s->distance_postfix_bits;
BROTLI_LOG_UINT(s->num_direct_distance_codes);
BROTLI_LOG_UINT(s->distance_postfix_bits);
- s->distance_postfix_mask = (int)BitMask(s->distance_postfix_bits);
s->context_modes =
(uint8_t*)BROTLI_DECODER_ALLOC(s, (size_t)s->num_block_types[0]);
if (s->context_modes == 0) {
@@ -2291,17 +2385,19 @@ BrotliDecoderResult BrotliDecoderDecompressStream(
/* Fall through. */
case BROTLI_STATE_CONTEXT_MAP_2: {
- uint32_t num_direct_codes =
- s->num_direct_distance_codes - BROTLI_NUM_DISTANCE_SHORT_CODES;
- uint32_t num_distance_codes = BROTLI_DISTANCE_ALPHABET_SIZE(
- s->distance_postfix_bits, num_direct_codes,
- (s->large_window ? BROTLI_LARGE_MAX_DISTANCE_BITS :
- BROTLI_MAX_DISTANCE_BITS));
- uint32_t max_distance_symbol = (s->large_window ?
- BrotliMaxDistanceSymbol(
- num_direct_codes, s->distance_postfix_bits) :
- num_distance_codes);
+ uint32_t npostfix = s->distance_postfix_bits;
+ uint32_t ndirect = s->num_direct_distance_codes;
+ uint32_t distance_alphabet_size_max = BROTLI_DISTANCE_ALPHABET_SIZE(
+ npostfix, ndirect, BROTLI_MAX_DISTANCE_BITS);
+ uint32_t distance_alphabet_size_limit = distance_alphabet_size_max;
BROTLI_BOOL allocation_success = BROTLI_TRUE;
+ if (s->large_window) {
+ BrotliDistanceCodeLimit limit = BrotliCalculateDistanceCodeLimit(
+ BROTLI_MAX_ALLOWED_DISTANCE, npostfix, ndirect);
+ distance_alphabet_size_max = BROTLI_DISTANCE_ALPHABET_SIZE(
+ npostfix, ndirect, BROTLI_LARGE_MAX_DISTANCE_BITS);
+ distance_alphabet_size_limit = limit.max_alphabet_size;
+ }
result = DecodeContextMap(
s->num_block_types[2] << BROTLI_DISTANCE_CONTEXT_BITS,
&s->num_dist_htrees, &s->dist_context_map, s);
@@ -2315,8 +2411,8 @@ BrotliDecoderResult BrotliDecoderDecompressStream(
s, &s->insert_copy_hgroup, BROTLI_NUM_COMMAND_SYMBOLS,
BROTLI_NUM_COMMAND_SYMBOLS, s->num_block_types[1]);
allocation_success &= BrotliDecoderHuffmanTreeGroupInit(
- s, &s->distance_hgroup, num_distance_codes,
- max_distance_symbol, s->num_dist_htrees);
+ s, &s->distance_hgroup, distance_alphabet_size_max,
+ distance_alphabet_size_limit, s->num_dist_htrees);
if (!allocation_success) {
return SaveErrorCode(s,
BROTLI_FAILURE(BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS));
@@ -2338,18 +2434,24 @@ BrotliDecoderResult BrotliDecoderDecompressStream(
result = HuffmanTreeGroupDecode(hgroup, s);
if (result != BROTLI_DECODER_SUCCESS) break;
s->loop_counter++;
- if (s->loop_counter >= 3) {
- PrepareLiteralDecoding(s);
- s->dist_context_map_slice = s->dist_context_map;
- s->htree_command = s->insert_copy_hgroup.htrees[0];
- if (!BrotliEnsureRingBuffer(s)) {
- result = BROTLI_FAILURE(BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2);
- break;
- }
- s->state = BROTLI_STATE_COMMAND_BEGIN;
+ if (s->loop_counter < 3) {
+ break;
}
- break;
+ s->state = BROTLI_STATE_BEFORE_COMPRESSED_METABLOCK_BODY;
}
+ /* Fall through. */
+
+ case BROTLI_STATE_BEFORE_COMPRESSED_METABLOCK_BODY:
+ PrepareLiteralDecoding(s);
+ s->dist_context_map_slice = s->dist_context_map;
+ s->htree_command = s->insert_copy_hgroup.htrees[0];
+ if (!BrotliEnsureRingBuffer(s)) {
+ result = BROTLI_FAILURE(BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2);
+ break;
+ }
+ CalculateDistanceLut(s);
+ s->state = BROTLI_STATE_COMMAND_BEGIN;
+ /* Fall through. */
case BROTLI_STATE_COMMAND_BEGIN:
/* Fall through. */
diff --git a/src/libraries/Native/AnyOS/brotli/dec/huffman.h b/src/libraries/Native/AnyOS/brotli/dec/huffman.h
index b9f0716c1604..a8fbc453479e 100644
--- a/src/libraries/Native/AnyOS/brotli/dec/huffman.h
+++ b/src/libraries/Native/AnyOS/brotli/dec/huffman.h
@@ -18,12 +18,6 @@ extern "C" {
#define BROTLI_HUFFMAN_MAX_CODE_LENGTH 15
-/* Maximum possible Huffman table size for an alphabet size of (index * 32),
- max code length 15 and root table bits 8. */
-static const uint16_t kMaxHuffmanTableSize[] = {
- 256, 402, 436, 468, 500, 534, 566, 598, 630, 662, 694, 726, 758, 790, 822,
- 854, 886, 920, 952, 984, 1016, 1048, 1080, 1112, 1144, 1176, 1208, 1240, 1272,
- 1304, 1336, 1368, 1400, 1432, 1464, 1496, 1528};
/* BROTLI_NUM_BLOCK_LEN_SYMBOLS == 26 */
#define BROTLI_HUFFMAN_MAX_SIZE_26 396
/* BROTLI_MAX_BLOCK_TYPE_SYMBOLS == 258 */
@@ -82,7 +76,7 @@ typedef BROTLI_ALIGNED(4) uint32_t HuffmanCode;
static BROTLI_INLINE HuffmanCode ConstructHuffmanCode(const uint8_t bits,
const uint16_t value) {
- return ((value & 0xFFFF) << 16) | (bits & 0xFF);
+ return (HuffmanCode) ((value & 0xFFFF) << 16) | (bits & 0xFF);
}
#define BROTLI_HC_MARK_TABLE_FOR_FAST_LOAD(H) uint32_t __fastload_##H = (*H)
@@ -100,7 +94,7 @@ BROTLI_INTERNAL void BrotliBuildCodeLengthsHuffmanTable(HuffmanCode* root_table,
/* Builds Huffman lookup table assuming code lengths are in symbol order.
Returns size of resulting table. */
BROTLI_INTERNAL uint32_t BrotliBuildHuffmanTable(HuffmanCode* root_table,
- int root_bits, const uint16_t* const symbol_lists, uint16_t* count_arg);
+ int root_bits, const uint16_t* const symbol_lists, uint16_t* count);
/* Builds a simple Huffman table. The |num_symbols| parameter is to be
interpreted as follows: 0 means 1 symbol, 1 means 2 symbols,
@@ -110,13 +104,13 @@ BROTLI_INTERNAL uint32_t BrotliBuildSimpleHuffmanTable(HuffmanCode* table,
int root_bits, uint16_t* symbols, uint32_t num_symbols);
/* Contains a collection of Huffman trees with the same alphabet size. */
-/* max_symbol is needed due to simple codes since log2(alphabet_size) could be
- greater than log2(max_symbol). */
+/* alphabet_size_limit is needed due to simple codes, since
+ log2(alphabet_size_max) could be greater than log2(alphabet_size_limit). */
typedef struct {
HuffmanCode** htrees;
HuffmanCode* codes;
- uint16_t alphabet_size;
- uint16_t max_symbol;
+ uint16_t alphabet_size_max;
+ uint16_t alphabet_size_limit;
uint16_t num_htrees;
} HuffmanTreeGroup;
diff --git a/src/libraries/Native/AnyOS/brotli/dec/prefix.h b/src/libraries/Native/AnyOS/brotli/dec/prefix.h
index 3ea062d84a2e..481a2c791706 100644
--- a/src/libraries/Native/AnyOS/brotli/dec/prefix.h
+++ b/src/libraries/Native/AnyOS/brotli/dec/prefix.h
@@ -13,24 +13,6 @@
#include "../common/constants.h"
#include
-/* Represents the range of values belonging to a prefix code:
- [offset, offset + 2^nbits) */
-struct PrefixCodeRange {
- uint16_t offset;
- uint8_t nbits;
-};
-
-static const struct PrefixCodeRange
- kBlockLengthPrefixCode[BROTLI_NUM_BLOCK_LEN_SYMBOLS] = {
- { 1, 2}, { 5, 2}, { 9, 2}, { 13, 2},
- { 17, 3}, { 25, 3}, { 33, 3}, { 41, 3},
- { 49, 4}, { 65, 4}, { 81, 4}, { 97, 4},
- { 113, 5}, { 145, 5}, { 177, 5}, { 209, 5},
- { 241, 6}, { 305, 6}, { 369, 7}, { 497, 8},
- { 753, 9}, { 1265, 10}, {2289, 11}, {4337, 12},
- {8433, 13}, {16625, 24}
-};
-
typedef struct CmdLutElement {
uint8_t insert_len_extra_bits;
uint8_t copy_len_extra_bits;
diff --git a/src/libraries/Native/AnyOS/brotli/dec/state.c b/src/libraries/Native/AnyOS/brotli/dec/state.c
index e0b37c2dcd03..f847836dda46 100644
--- a/src/libraries/Native/AnyOS/brotli/dec/state.c
+++ b/src/libraries/Native/AnyOS/brotli/dec/state.c
@@ -33,10 +33,7 @@ BROTLI_BOOL BrotliDecoderStateInit(BrotliDecoderState* s,
s->state = BROTLI_STATE_UNINITED;
s->large_window = 0;
s->substate_metablock_header = BROTLI_STATE_METABLOCK_HEADER_NONE;
- s->substate_tree_group = BROTLI_STATE_TREE_GROUP_NONE;
- s->substate_context_map = BROTLI_STATE_CONTEXT_MAP_NONE;
s->substate_uncompressed = BROTLI_STATE_UNCOMPRESSED_NONE;
- s->substate_huffman = BROTLI_STATE_HUFFMAN_NONE;
s->substate_decode_uint8 = BROTLI_STATE_DECODE_UINT8_NONE;
s->substate_read_block_length = BROTLI_STATE_READ_BLOCK_LENGTH_NONE;
@@ -59,8 +56,6 @@ BROTLI_BOOL BrotliDecoderStateInit(BrotliDecoderState* s,
s->context_map_slice = NULL;
s->dist_context_map_slice = NULL;
- s->sub_loop_counter = 0;
-
s->literal_hgroup.codes = NULL;
s->literal_hgroup.htrees = NULL;
s->insert_copy_hgroup.codes = NULL;
@@ -84,9 +79,6 @@ BROTLI_BOOL BrotliDecoderStateInit(BrotliDecoderState* s,
s->block_type_trees = NULL;
s->block_len_trees = NULL;
- /* Make small negative indexes addressable. */
- s->symbol_lists = &s->symbols_lists_array[BROTLI_HUFFMAN_MAX_CODE_LENGTH + 1];
-
s->mtf_upper_bound = 63;
s->dictionary = BrotliGetDictionary();
@@ -142,17 +134,20 @@ void BrotliDecoderStateCleanup(BrotliDecoderState* s) {
}
BROTLI_BOOL BrotliDecoderHuffmanTreeGroupInit(BrotliDecoderState* s,
- HuffmanTreeGroup* group, uint32_t alphabet_size, uint32_t max_symbol,
- uint32_t ntrees) {
- /* Pack two allocations into one */
- const size_t max_table_size = kMaxHuffmanTableSize[(alphabet_size + 31) >> 5];
+ HuffmanTreeGroup* group, uint32_t alphabet_size_max,
+ uint32_t alphabet_size_limit, uint32_t ntrees) {
+ /* 376 = 256 (1-st level table) + 4 + 7 + 15 + 31 + 63 (2-nd level mix-tables)
+ This number is discovered "unlimited" "enough" calculator; it is actually
+ a wee bigger than required in several cases (especially for alphabets with
+ less than 16 symbols). */
+ const size_t max_table_size = alphabet_size_limit + 376;
const size_t code_size = sizeof(HuffmanCode) * ntrees * max_table_size;
const size_t htree_size = sizeof(HuffmanCode*) * ntrees;
/* Pointer alignment is, hopefully, wider than sizeof(HuffmanCode). */
HuffmanCode** p = (HuffmanCode**)BROTLI_DECODER_ALLOC(s,
code_size + htree_size);
- group->alphabet_size = (uint16_t)alphabet_size;
- group->max_symbol = (uint16_t)max_symbol;
+ group->alphabet_size_max = (uint16_t)alphabet_size_max;
+ group->alphabet_size_limit = (uint16_t)alphabet_size_limit;
group->num_htrees = (uint16_t)ntrees;
group->htrees = p;
group->codes = (HuffmanCode*)(&p[ntrees]);
diff --git a/src/libraries/Native/AnyOS/brotli/dec/state.h b/src/libraries/Native/AnyOS/brotli/dec/state.h
index d28b63920ef4..54dab698ba44 100644
--- a/src/libraries/Native/AnyOS/brotli/dec/state.h
+++ b/src/libraries/Native/AnyOS/brotli/dec/state.h
@@ -21,6 +21,95 @@
extern "C" {
#endif
+/* Graphviz diagram that describes state transitions:
+
+digraph States {
+ graph [compound=true]
+ concentrate=true
+ node [shape="box"]
+
+ UNINITED -> {LARGE_WINDOW_BITS -> INITIALIZE}
+ subgraph cluster_metablock_workflow {
+ style="rounded"
+ label=< METABLOCK CYCLE >
+ METABLOCK_BEGIN -> METABLOCK_HEADER
+ METABLOCK_HEADER:sw -> METADATA
+ METABLOCK_HEADER:s -> UNCOMPRESSED
+ METABLOCK_HEADER:se -> METABLOCK_DONE:ne
+ METADATA:s -> METABLOCK_DONE:w
+ UNCOMPRESSED:s -> METABLOCK_DONE:n
+ METABLOCK_DONE:e -> METABLOCK_BEGIN:e [constraint="false"]
+ }
+ INITIALIZE -> METABLOCK_BEGIN
+ METABLOCK_DONE -> DONE
+
+ subgraph cluster_compressed_metablock {
+ style="rounded"
+ label=< COMPRESSED METABLOCK >
+
+ subgraph cluster_command {
+ style="rounded"
+ label=< HOT LOOP >
+
+ _METABLOCK_DONE_PORT_ [shape=point style=invis]
+
+ {
+ // Set different shape for nodes returning from "compressed metablock".
+ node [shape=invhouse]; CMD_INNER CMD_POST_DECODE_LITERALS;
+ CMD_POST_WRAP_COPY; CMD_INNER_WRITE; CMD_POST_WRITE_1;
+ }
+
+ CMD_BEGIN -> CMD_INNER -> CMD_POST_DECODE_LITERALS -> CMD_POST_WRAP_COPY
+
+ // IO ("write") nodes are not in the hot loop!
+ CMD_INNER_WRITE [style=dashed]
+ CMD_INNER -> CMD_INNER_WRITE
+ CMD_POST_WRITE_1 [style=dashed]
+ CMD_POST_DECODE_LITERALS -> CMD_POST_WRITE_1
+ CMD_POST_WRITE_2 [style=dashed]
+ CMD_POST_WRAP_COPY -> CMD_POST_WRITE_2
+
+ CMD_POST_WRITE_1 -> CMD_BEGIN:s [constraint="false"]
+ CMD_INNER_WRITE -> {CMD_INNER CMD_POST_DECODE_LITERALS}
+ [constraint="false"]
+ CMD_BEGIN:ne -> CMD_POST_DECODE_LITERALS [constraint="false"]
+ CMD_POST_WRAP_COPY -> CMD_BEGIN [constraint="false"]
+ CMD_POST_DECODE_LITERALS -> CMD_BEGIN:ne [constraint="false"]
+ CMD_POST_WRITE_2 -> CMD_POST_WRAP_COPY [constraint="false"]
+ {rank=same; CMD_BEGIN; CMD_INNER; CMD_POST_DECODE_LITERALS;
+ CMD_POST_WRAP_COPY}
+ {rank=same; CMD_INNER_WRITE; CMD_POST_WRITE_1; CMD_POST_WRITE_2}
+
+ {CMD_INNER CMD_POST_DECODE_LITERALS CMD_POST_WRAP_COPY} ->
+ _METABLOCK_DONE_PORT_ [style=invis]
+ {CMD_INNER_WRITE CMD_POST_WRITE_1} -> _METABLOCK_DONE_PORT_
+ [constraint="false" style=invis]
+ }
+
+ BEFORE_COMPRESSED_METABLOCK_HEADER:s -> HUFFMAN_CODE_0:n
+ HUFFMAN_CODE_0 -> HUFFMAN_CODE_1 -> HUFFMAN_CODE_2 -> HUFFMAN_CODE_3
+ HUFFMAN_CODE_0 -> METABLOCK_HEADER_2 -> CONTEXT_MODES -> CONTEXT_MAP_1
+ CONTEXT_MAP_1 -> CONTEXT_MAP_2 -> TREE_GROUP
+ TREE_GROUP -> BEFORE_COMPRESSED_METABLOCK_BODY:e
+ BEFORE_COMPRESSED_METABLOCK_BODY:s -> CMD_BEGIN:n
+
+ HUFFMAN_CODE_3:e -> HUFFMAN_CODE_0:ne [constraint="false"]
+ {rank=same; HUFFMAN_CODE_0; HUFFMAN_CODE_1; HUFFMAN_CODE_2; HUFFMAN_CODE_3}
+ {rank=same; METABLOCK_HEADER_2; CONTEXT_MODES; CONTEXT_MAP_1; CONTEXT_MAP_2;
+ TREE_GROUP}
+ }
+ METABLOCK_HEADER:e -> BEFORE_COMPRESSED_METABLOCK_HEADER:n
+
+ _METABLOCK_DONE_PORT_ -> METABLOCK_DONE:se
+ [constraint="false" ltail=cluster_command]
+
+ UNINITED [shape=Mdiamond];
+ DONE [shape=Msquare];
+}
+
+
+ */
+
typedef enum {
BROTLI_STATE_UNINITED,
BROTLI_STATE_LARGE_WINDOW_BITS,
@@ -39,6 +128,7 @@ typedef enum {
BROTLI_STATE_METABLOCK_DONE,
BROTLI_STATE_COMMAND_POST_WRITE_1,
BROTLI_STATE_COMMAND_POST_WRITE_2,
+ BROTLI_STATE_BEFORE_COMPRESSED_METABLOCK_HEADER,
BROTLI_STATE_HUFFMAN_CODE_0,
BROTLI_STATE_HUFFMAN_CODE_1,
BROTLI_STATE_HUFFMAN_CODE_2,
@@ -46,6 +136,7 @@ typedef enum {
BROTLI_STATE_CONTEXT_MAP_1,
BROTLI_STATE_CONTEXT_MAP_2,
BROTLI_STATE_TREE_GROUP,
+ BROTLI_STATE_BEFORE_COMPRESSED_METABLOCK_BODY,
BROTLI_STATE_DONE
} BrotliRunningState;
@@ -98,6 +189,50 @@ typedef enum {
BROTLI_STATE_READ_BLOCK_LENGTH_SUFFIX
} BrotliRunningReadBlockLengthState;
+typedef struct BrotliMetablockHeaderArena {
+ BrotliRunningTreeGroupState substate_tree_group;
+ BrotliRunningContextMapState substate_context_map;
+ BrotliRunningHuffmanState substate_huffman;
+
+ uint32_t sub_loop_counter;
+
+ uint32_t repeat_code_len;
+ uint32_t prev_code_len;
+
+ /* For ReadHuffmanCode. */
+ uint32_t symbol;
+ uint32_t repeat;
+ uint32_t space;
+
+ /* Huffman table for "histograms". */
+ HuffmanCode table[32];
+ /* List of heads of symbol chains. */
+ uint16_t* symbol_lists;
+ /* Storage from symbol_lists. */
+ uint16_t symbols_lists_array[BROTLI_HUFFMAN_MAX_CODE_LENGTH + 1 +
+ BROTLI_NUM_COMMAND_SYMBOLS];
+ /* Tails of symbol chains. */
+ int next_symbol[32];
+ uint8_t code_length_code_lengths[BROTLI_CODE_LENGTH_CODES];
+ /* Population counts for the code lengths. */
+ uint16_t code_length_histo[16];
+
+ /* For HuffmanTreeGroupDecode. */
+ int htree_index;
+ HuffmanCode* next;
+
+ /* For DecodeContextMap. */
+ uint32_t context_index;
+ uint32_t max_run_length_prefix;
+ uint32_t code;
+ HuffmanCode context_map_table[BROTLI_HUFFMAN_MAX_SIZE_272];
+} BrotliMetablockHeaderArena;
+
+typedef struct BrotliMetablockBodyArena {
+ uint8_t dist_extra_bits[544];
+ uint32_t dist_offset[544];
+} BrotliMetablockBodyArena;
+
struct BrotliDecoderStateStruct {
BrotliRunningState state;
@@ -110,7 +245,8 @@ struct BrotliDecoderStateStruct {
brotli_free_func free_func;
void* memory_manager_opaque;
- /* Temporary storage for remaining input. */
+ /* Temporary storage for remaining input. Brotli stream format is designed in
+ a way, that 64 bits are enough to make progress in decoding. */
union {
uint64_t u64;
uint8_t u8[8];
@@ -125,7 +261,6 @@ struct BrotliDecoderStateStruct {
int dist_rb_idx;
int dist_rb[4];
int error_code;
- uint32_t sub_loop_counter;
uint8_t* ringbuffer;
uint8_t* ringbuffer_end;
HuffmanCode* htree_command;
@@ -153,13 +288,10 @@ struct BrotliDecoderStateStruct {
uint32_t block_type_rb[6];
uint32_t distance_postfix_bits;
uint32_t num_direct_distance_codes;
- int distance_postfix_mask;
uint32_t num_dist_htrees;
uint8_t* dist_context_map;
HuffmanCode* literal_htree;
uint8_t dist_htree_index;
- uint32_t repeat_code_len;
- uint32_t prev_code_len;
int copy_length;
int distance_code;
@@ -168,33 +300,6 @@ struct BrotliDecoderStateStruct {
size_t rb_roundtrips; /* how many times we went around the ring-buffer */
size_t partial_pos_out; /* how much output to the user in total */
- /* For ReadHuffmanCode. */
- uint32_t symbol;
- uint32_t repeat;
- uint32_t space;
-
- HuffmanCode table[32];
- /* List of heads of symbol chains. */
- uint16_t* symbol_lists;
- /* Storage from symbol_lists. */
- uint16_t symbols_lists_array[BROTLI_HUFFMAN_MAX_CODE_LENGTH + 1 +
- BROTLI_NUM_COMMAND_SYMBOLS];
- /* Tails of symbol chains. */
- int next_symbol[32];
- uint8_t code_length_code_lengths[BROTLI_CODE_LENGTH_CODES];
- /* Population counts for the code lengths. */
- uint16_t code_length_histo[16];
-
- /* For HuffmanTreeGroupDecode. */
- int htree_index;
- HuffmanCode* next;
-
- /* For DecodeContextMap. */
- uint32_t context_index;
- uint32_t max_run_length_prefix;
- uint32_t code;
- HuffmanCode context_map_table[BROTLI_HUFFMAN_MAX_SIZE_272];
-
/* For InverseMoveToFrontTransform. */
uint32_t mtf_upper_bound;
uint32_t mtf[64 + 1];
@@ -203,10 +308,7 @@ struct BrotliDecoderStateStruct {
/* States inside function calls. */
BrotliRunningMetablockHeaderState substate_metablock_header;
- BrotliRunningTreeGroupState substate_tree_group;
- BrotliRunningContextMapState substate_context_map;
BrotliRunningUncompressedState substate_uncompressed;
- BrotliRunningHuffmanState substate_huffman;
BrotliRunningDecodeUint8State substate_decode_uint8;
BrotliRunningReadBlockLengthState substate_read_block_length;
@@ -229,6 +331,11 @@ struct BrotliDecoderStateStruct {
const BrotliTransforms* transforms;
uint32_t trivial_literal_contexts[8]; /* 256 bits */
+
+ union {
+ BrotliMetablockHeaderArena header;
+ BrotliMetablockBodyArena body;
+ } arena;
};
typedef struct BrotliDecoderStateStruct BrotliDecoderStateInternal;
@@ -241,8 +348,8 @@ BROTLI_INTERNAL void BrotliDecoderStateMetablockBegin(BrotliDecoderState* s);
BROTLI_INTERNAL void BrotliDecoderStateCleanupAfterMetablock(
BrotliDecoderState* s);
BROTLI_INTERNAL BROTLI_BOOL BrotliDecoderHuffmanTreeGroupInit(
- BrotliDecoderState* s, HuffmanTreeGroup* group, uint32_t alphabet_size,
- uint32_t max_symbol, uint32_t ntrees);
+ BrotliDecoderState* s, HuffmanTreeGroup* group, uint32_t alphabet_size_max,
+ uint32_t alphabet_size_limit, uint32_t ntrees);
#define BROTLI_DECODER_ALLOC(S, L) S->alloc_func(S->memory_manager_opaque, L)
diff --git a/src/libraries/Native/AnyOS/brotli/enc/backward_references.c b/src/libraries/Native/AnyOS/brotli/enc/backward_references.c
index cd023d9b41ce..a07a617a097c 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/backward_references.c
+++ b/src/libraries/Native/AnyOS/brotli/enc/backward_references.c
@@ -9,6 +9,7 @@
#include "./backward_references.h"
#include "../common/constants.h"
+#include "../common/context.h"
#include "../common/dictionary.h"
#include "../common/platform.h"
#include
@@ -119,17 +120,17 @@ static BROTLI_INLINE size_t ComputeDistanceCode(size_t distance,
#undef CAT
#undef EXPAND_CAT
-void BrotliCreateBackwardReferences(
- size_t num_bytes, size_t position, const uint8_t* ringbuffer,
- size_t ringbuffer_mask, const BrotliEncoderParams* params,
- HasherHandle hasher, int* dist_cache, size_t* last_insert_len,
+void BrotliCreateBackwardReferences(size_t num_bytes,
+ size_t position, const uint8_t* ringbuffer, size_t ringbuffer_mask,
+ ContextLut literal_context_lut, const BrotliEncoderParams* params,
+ Hasher* hasher, int* dist_cache, size_t* last_insert_len,
Command* commands, size_t* num_commands, size_t* num_literals) {
switch (params->hasher.type) {
#define CASE_(N) \
case N: \
- CreateBackwardReferencesNH ## N( \
- num_bytes, position, ringbuffer, \
- ringbuffer_mask, params, hasher, dist_cache, \
+ CreateBackwardReferencesNH ## N(num_bytes, \
+ position, ringbuffer, ringbuffer_mask, \
+ literal_context_lut, params, hasher, dist_cache, \
last_insert_len, commands, num_commands, num_literals); \
return;
FOR_GENERIC_HASHERS(CASE_)
diff --git a/src/libraries/Native/AnyOS/brotli/enc/backward_references.h b/src/libraries/Native/AnyOS/brotli/enc/backward_references.h
index 3a4146647c47..9589cc15419b 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/backward_references.h
+++ b/src/libraries/Native/AnyOS/brotli/enc/backward_references.h
@@ -10,6 +10,7 @@
#define BROTLI_ENC_BACKWARD_REFERENCES_H_
#include "../common/constants.h"
+#include "../common/context.h"
#include "../common/dictionary.h"
#include "../common/platform.h"
#include
@@ -25,10 +26,10 @@ extern "C" {
initially the total amount of commands output by previous
CreateBackwardReferences calls, and must be incremented by the amount written
by this call. */
-BROTLI_INTERNAL void BrotliCreateBackwardReferences(
- size_t num_bytes, size_t position, const uint8_t* ringbuffer,
- size_t ringbuffer_mask, const BrotliEncoderParams* params,
- HasherHandle hasher, int* dist_cache, size_t* last_insert_len,
+BROTLI_INTERNAL void BrotliCreateBackwardReferences(size_t num_bytes,
+ size_t position, const uint8_t* ringbuffer, size_t ringbuffer_mask,
+ ContextLut literal_context_lut, const BrotliEncoderParams* params,
+ Hasher* hasher, int* dist_cache, size_t* last_insert_len,
Command* commands, size_t* num_commands, size_t* num_literals);
#if defined(__cplusplus) || defined(c_plusplus)
diff --git a/src/libraries/Native/AnyOS/brotli/enc/backward_references_hq.c b/src/libraries/Native/AnyOS/brotli/enc/backward_references_hq.c
index 96b0e708de4b..5651caeb7aca 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/backward_references_hq.c
+++ b/src/libraries/Native/AnyOS/brotli/enc/backward_references_hq.c
@@ -11,6 +11,7 @@
#include /* memcpy, memset */
#include "../common/constants.h"
+#include "../common/context.h"
#include "../common/platform.h"
#include
#include "./command.h"
@@ -26,6 +27,7 @@
extern "C" {
#endif
+/* BrotliCalculateDistanceCodeLimit(BROTLI_MAX_ALLOWED_DISTANCE, 3, 120). */
#define BROTLI_MAX_EFFECTIVE_DISTANCE_ALPHABET_SIZE 544
static const float kInfinity = 1.7e38f; /* ~= 2 ^ 127 */
@@ -86,14 +88,10 @@ typedef struct ZopfliCostModel {
static void InitZopfliCostModel(
MemoryManager* m, ZopfliCostModel* self, const BrotliDistanceParams* dist,
size_t num_bytes) {
- uint32_t distance_histogram_size = dist->alphabet_size;
- if (distance_histogram_size > BROTLI_MAX_EFFECTIVE_DISTANCE_ALPHABET_SIZE) {
- distance_histogram_size = BROTLI_MAX_EFFECTIVE_DISTANCE_ALPHABET_SIZE;
- }
self->num_bytes_ = num_bytes;
self->literal_costs_ = BROTLI_ALLOC(m, float, num_bytes + 2);
- self->cost_dist_ = BROTLI_ALLOC(m, float, dist->alphabet_size);
- self->distance_histogram_size = distance_histogram_size;
+ self->cost_dist_ = BROTLI_ALLOC(m, float, dist->alphabet_size_limit);
+ self->distance_histogram_size = dist->alphabet_size_limit;
if (BROTLI_IS_OOM(m)) return;
}
@@ -408,9 +406,12 @@ static size_t UpdateNodes(
const int* starting_dist_cache, const size_t num_matches,
const BackwardMatch* matches, const ZopfliCostModel* model,
StartPosQueue* queue, ZopfliNode* nodes) {
+ const size_t stream_offset = params->stream_offset;
const size_t cur_ix = block_start + pos;
const size_t cur_ix_masked = cur_ix & ringbuffer_mask;
const size_t max_distance = BROTLI_MIN(size_t, cur_ix, max_backward_limit);
+ const size_t dictionary_start = BROTLI_MIN(size_t,
+ cur_ix + stream_offset, max_backward_limit);
const size_t max_len = num_bytes - pos;
const size_t max_zopfli_len = MaxZopfliLen(params);
const size_t max_iters = MaxZopfliCandidates(params);
@@ -419,8 +420,8 @@ static size_t UpdateNodes(
size_t k;
size_t gap = 0;
- EvaluateNode(block_start, pos, max_backward_limit, gap, starting_dist_cache,
- model, queue, nodes);
+ EvaluateNode(block_start + stream_offset, pos, max_backward_limit, gap,
+ starting_dist_cache, model, queue, nodes);
{
const PosData* posdata = StartPosQueueAt(queue, 0);
@@ -453,7 +454,7 @@ static size_t UpdateNodes(
if (cur_ix_masked + best_len > ringbuffer_mask) {
break;
}
- if (BROTLI_PREDICT_FALSE(backward > max_distance + gap)) {
+ if (BROTLI_PREDICT_FALSE(backward > dictionary_start + gap)) {
/* Word dictionary -> ignore. */
continue;
}
@@ -472,6 +473,8 @@ static size_t UpdateNodes(
&ringbuffer[cur_ix_masked],
max_len);
} else {
+ /* "Gray" area. It is addressable by decoder, but this encoder
+ instance does not have that data -> should not touch it. */
continue;
}
{
@@ -506,7 +509,7 @@ static size_t UpdateNodes(
BackwardMatch match = matches[j];
size_t dist = match.distance;
BROTLI_BOOL is_dictionary_match =
- TO_BROTLI_BOOL(dist > max_distance + gap);
+ TO_BROTLI_BOOL(dist > dictionary_start + gap);
/* We already tried all possible last distance matches, so we can use
normal distance code here. */
size_t dist_code = dist + BROTLI_NUM_DISTANCE_SHORT_CODES - 1;
@@ -569,6 +572,7 @@ void BrotliZopfliCreateCommands(const size_t num_bytes,
const size_t block_start, const ZopfliNode* nodes, int* dist_cache,
size_t* last_insert_len, const BrotliEncoderParams* params,
Command* commands, size_t* num_literals) {
+ const size_t stream_offset = params->stream_offset;
const size_t max_backward_limit = BROTLI_MAX_BACKWARD_LIMIT(params->lgwin);
size_t pos = 0;
uint32_t offset = nodes[0].u.next;
@@ -587,9 +591,10 @@ void BrotliZopfliCreateCommands(const size_t num_bytes,
{
size_t distance = ZopfliNodeCopyDistance(next);
size_t len_code = ZopfliNodeLengthCode(next);
- size_t max_distance =
- BROTLI_MIN(size_t, block_start + pos, max_backward_limit);
- BROTLI_BOOL is_dictionary = TO_BROTLI_BOOL(distance > max_distance + gap);
+ size_t dictionary_start = BROTLI_MIN(size_t,
+ block_start + pos + stream_offset, max_backward_limit);
+ BROTLI_BOOL is_dictionary =
+ TO_BROTLI_BOOL(distance > dictionary_start + gap);
size_t dist_code = ZopfliNodeDistanceCode(next);
InitCommand(&commands[i], ¶ms->dist, insert_length,
copy_length, (int)len_code - (int)copy_length, dist_code);
@@ -613,6 +618,7 @@ static size_t ZopfliIterate(size_t num_bytes, size_t position,
const BrotliEncoderParams* params, const size_t gap, const int* dist_cache,
const ZopfliCostModel* model, const uint32_t* num_matches,
const BackwardMatch* matches, ZopfliNode* nodes) {
+ const size_t stream_offset = params->stream_offset;
const size_t max_backward_limit = BROTLI_MAX_BACKWARD_LIMIT(params->lgwin);
const size_t max_zopfli_len = MaxZopfliLen(params);
StartPosQueue queue;
@@ -637,7 +643,7 @@ static size_t ZopfliIterate(size_t num_bytes, size_t position,
while (skip) {
i++;
if (i + 3 >= num_bytes) break;
- EvaluateNode(position, i, max_backward_limit, gap,
+ EvaluateNode(position + stream_offset, i, max_backward_limit, gap,
dist_cache, model, &queue, nodes);
cur_match_pos += num_matches[i];
skip--;
@@ -650,8 +656,9 @@ static size_t ZopfliIterate(size_t num_bytes, size_t position,
/* REQUIRES: nodes != NULL and len(nodes) >= num_bytes + 1 */
size_t BrotliZopfliComputeShortestPath(MemoryManager* m, size_t num_bytes,
size_t position, const uint8_t* ringbuffer, size_t ringbuffer_mask,
- const BrotliEncoderParams* params,
- const int* dist_cache, HasherHandle hasher, ZopfliNode* nodes) {
+ ContextLut literal_context_lut, const BrotliEncoderParams* params,
+ const int* dist_cache, Hasher* hasher, ZopfliNode* nodes) {
+ const size_t stream_offset = params->stream_offset;
const size_t max_backward_limit = BROTLI_MAX_BACKWARD_LIMIT(params->lgwin);
const size_t max_zopfli_len = MaxZopfliLen(params);
ZopfliCostModel model;
@@ -662,6 +669,7 @@ size_t BrotliZopfliComputeShortestPath(MemoryManager* m, size_t num_bytes,
size_t i;
size_t gap = 0;
size_t lz_matches_offset = 0;
+ BROTLI_UNUSED(literal_context_lut);
nodes[0].length = 0;
nodes[0].u.cost = 0;
InitZopfliCostModel(m, &model, ¶ms->dist, num_bytes);
@@ -672,12 +680,14 @@ size_t BrotliZopfliComputeShortestPath(MemoryManager* m, size_t num_bytes,
for (i = 0; i + HashTypeLengthH10() - 1 < num_bytes; i++) {
const size_t pos = position + i;
const size_t max_distance = BROTLI_MIN(size_t, pos, max_backward_limit);
+ const size_t dictionary_start = BROTLI_MIN(size_t,
+ pos + stream_offset, max_backward_limit);
size_t skip;
size_t num_matches;
- num_matches = FindAllMatchesH10(hasher,
+ num_matches = FindAllMatchesH10(&hasher->privat._H10,
¶ms->dictionary,
ringbuffer, ringbuffer_mask, pos, num_bytes - i, max_distance,
- gap, params, &matches[lz_matches_offset]);
+ dictionary_start + gap, params, &matches[lz_matches_offset]);
if (num_matches > 0 &&
BackwardMatchLength(&matches[num_matches - 1]) > max_zopfli_len) {
matches[0] = matches[num_matches - 1];
@@ -692,13 +702,14 @@ size_t BrotliZopfliComputeShortestPath(MemoryManager* m, size_t num_bytes,
}
if (skip > 1) {
/* Add the tail of the copy to the hasher. */
- StoreRangeH10(hasher, ringbuffer, ringbuffer_mask, pos + 1, BROTLI_MIN(
+ StoreRangeH10(&hasher->privat._H10,
+ ringbuffer, ringbuffer_mask, pos + 1, BROTLI_MIN(
size_t, pos + skip, store_end));
skip--;
while (skip) {
i++;
if (i + HashTypeLengthH10() - 1 >= num_bytes) break;
- EvaluateNode(position, i, max_backward_limit, gap,
+ EvaluateNode(position + stream_offset, i, max_backward_limit, gap,
dist_cache, &model, &queue, nodes);
skip--;
}
@@ -710,15 +721,14 @@ size_t BrotliZopfliComputeShortestPath(MemoryManager* m, size_t num_bytes,
void BrotliCreateZopfliBackwardReferences(MemoryManager* m, size_t num_bytes,
size_t position, const uint8_t* ringbuffer, size_t ringbuffer_mask,
- const BrotliEncoderParams* params,
- HasherHandle hasher, int* dist_cache, size_t* last_insert_len,
+ ContextLut literal_context_lut, const BrotliEncoderParams* params,
+ Hasher* hasher, int* dist_cache, size_t* last_insert_len,
Command* commands, size_t* num_commands, size_t* num_literals) {
- ZopfliNode* nodes;
- nodes = BROTLI_ALLOC(m, ZopfliNode, num_bytes + 1);
- if (BROTLI_IS_OOM(m)) return;
+ ZopfliNode* nodes = BROTLI_ALLOC(m, ZopfliNode, num_bytes + 1);
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(nodes)) return;
BrotliInitZopfliNodes(nodes, num_bytes + 1);
*num_commands += BrotliZopfliComputeShortestPath(m, num_bytes,
- position, ringbuffer, ringbuffer_mask, params,
+ position, ringbuffer, ringbuffer_mask, literal_context_lut, params,
dist_cache, hasher, nodes);
if (BROTLI_IS_OOM(m)) return;
BrotliZopfliCreateCommands(num_bytes, position, nodes, dist_cache,
@@ -728,9 +738,10 @@ void BrotliCreateZopfliBackwardReferences(MemoryManager* m, size_t num_bytes,
void BrotliCreateHqZopfliBackwardReferences(MemoryManager* m, size_t num_bytes,
size_t position, const uint8_t* ringbuffer, size_t ringbuffer_mask,
- const BrotliEncoderParams* params,
- HasherHandle hasher, int* dist_cache, size_t* last_insert_len,
+ ContextLut literal_context_lut, const BrotliEncoderParams* params,
+ Hasher* hasher, int* dist_cache, size_t* last_insert_len,
Command* commands, size_t* num_commands, size_t* num_literals) {
+ const size_t stream_offset = params->stream_offset;
const size_t max_backward_limit = BROTLI_MAX_BACKWARD_LIMIT(params->lgwin);
uint32_t* num_matches = BROTLI_ALLOC(m, uint32_t, num_bytes);
size_t matches_size = 4 * num_bytes;
@@ -747,10 +758,16 @@ void BrotliCreateHqZopfliBackwardReferences(MemoryManager* m, size_t num_bytes,
BackwardMatch* matches = BROTLI_ALLOC(m, BackwardMatch, matches_size);
size_t gap = 0;
size_t shadow_matches = 0;
- if (BROTLI_IS_OOM(m)) return;
+ BROTLI_UNUSED(literal_context_lut);
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(num_matches) ||
+ BROTLI_IS_NULL(matches)) {
+ return;
+ }
for (i = 0; i + HashTypeLengthH10() - 1 < num_bytes; ++i) {
const size_t pos = position + i;
size_t max_distance = BROTLI_MIN(size_t, pos, max_backward_limit);
+ size_t dictionary_start = BROTLI_MIN(size_t,
+ pos + stream_offset, max_backward_limit);
size_t max_length = num_bytes - i;
size_t num_found_matches;
size_t cur_match_end;
@@ -759,10 +776,10 @@ void BrotliCreateHqZopfliBackwardReferences(MemoryManager* m, size_t num_bytes,
BROTLI_ENSURE_CAPACITY(m, BackwardMatch, matches, matches_size,
cur_match_pos + MAX_NUM_MATCHES_H10 + shadow_matches);
if (BROTLI_IS_OOM(m)) return;
- num_found_matches = FindAllMatchesH10(hasher,
+ num_found_matches = FindAllMatchesH10(&hasher->privat._H10,
¶ms->dictionary,
ringbuffer, ringbuffer_mask, pos, max_length,
- max_distance, gap, params,
+ max_distance, dictionary_start + gap, params,
&matches[cur_match_pos + shadow_matches]);
cur_match_end = cur_match_pos + num_found_matches;
for (j = cur_match_pos; j + 1 < cur_match_end; ++j) {
@@ -777,7 +794,8 @@ void BrotliCreateHqZopfliBackwardReferences(MemoryManager* m, size_t num_bytes,
matches[cur_match_pos++] = matches[cur_match_end - 1];
num_matches[i] = 1;
/* Add the tail of the copy to the hasher. */
- StoreRangeH10(hasher, ringbuffer, ringbuffer_mask, pos + 1,
+ StoreRangeH10(&hasher->privat._H10,
+ ringbuffer, ringbuffer_mask, pos + 1,
BROTLI_MIN(size_t, pos + match_len, store_end));
memset(&num_matches[i + 1], 0, skip * sizeof(num_matches[0]));
i += skip;
@@ -791,7 +809,7 @@ void BrotliCreateHqZopfliBackwardReferences(MemoryManager* m, size_t num_bytes,
memcpy(orig_dist_cache, dist_cache, 4 * sizeof(dist_cache[0]));
orig_num_commands = *num_commands;
nodes = BROTLI_ALLOC(m, ZopfliNode, num_bytes + 1);
- if (BROTLI_IS_OOM(m)) return;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(nodes)) return;
InitZopfliCostModel(m, &model, ¶ms->dist, num_bytes);
if (BROTLI_IS_OOM(m)) return;
for (i = 0; i < 2; i++) {
diff --git a/src/libraries/Native/AnyOS/brotli/enc/backward_references_hq.h b/src/libraries/Native/AnyOS/brotli/enc/backward_references_hq.h
index 1e4275d403f9..36b75f250d79 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/backward_references_hq.h
+++ b/src/libraries/Native/AnyOS/brotli/enc/backward_references_hq.h
@@ -10,6 +10,7 @@
#define BROTLI_ENC_BACKWARD_REFERENCES_HQ_H_
#include "../common/constants.h"
+#include "../common/context.h"
#include "../common/dictionary.h"
#include "../common/platform.h"
#include
@@ -23,15 +24,17 @@ extern "C" {
#endif
BROTLI_INTERNAL void BrotliCreateZopfliBackwardReferences(MemoryManager* m,
- size_t num_bytes, size_t position, const uint8_t* ringbuffer,
- size_t ringbuffer_mask, const BrotliEncoderParams* params,
- HasherHandle hasher, int* dist_cache, size_t* last_insert_len,
+ size_t num_bytes,
+ size_t position, const uint8_t* ringbuffer, size_t ringbuffer_mask,
+ ContextLut literal_context_lut, const BrotliEncoderParams* params,
+ Hasher* hasher, int* dist_cache, size_t* last_insert_len,
Command* commands, size_t* num_commands, size_t* num_literals);
BROTLI_INTERNAL void BrotliCreateHqZopfliBackwardReferences(MemoryManager* m,
- size_t num_bytes, size_t position, const uint8_t* ringbuffer,
- size_t ringbuffer_mask, const BrotliEncoderParams* params,
- HasherHandle hasher, int* dist_cache, size_t* last_insert_len,
+ size_t num_bytes,
+ size_t position, const uint8_t* ringbuffer, size_t ringbuffer_mask,
+ ContextLut literal_context_lut, const BrotliEncoderParams* params,
+ Hasher* hasher, int* dist_cache, size_t* last_insert_len,
Command* commands, size_t* num_commands, size_t* num_literals);
typedef struct ZopfliNode {
@@ -77,8 +80,8 @@ BROTLI_INTERNAL void BrotliInitZopfliNodes(ZopfliNode* array, size_t length);
BROTLI_INTERNAL size_t BrotliZopfliComputeShortestPath(
MemoryManager* m, size_t num_bytes,
size_t position, const uint8_t* ringbuffer, size_t ringbuffer_mask,
- const BrotliEncoderParams* params,
- const int* dist_cache, HasherHandle hasher, ZopfliNode* nodes);
+ ContextLut literal_context_lut, const BrotliEncoderParams* params,
+ const int* dist_cache, Hasher* hasher, ZopfliNode* nodes);
BROTLI_INTERNAL void BrotliZopfliCreateCommands(
const size_t num_bytes, const size_t block_start, const ZopfliNode* nodes,
diff --git a/src/libraries/Native/AnyOS/brotli/enc/backward_references_inc.h b/src/libraries/Native/AnyOS/brotli/enc/backward_references_inc.h
index c18cdb00cb9b..766bf91ffd26 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/backward_references_inc.h
+++ b/src/libraries/Native/AnyOS/brotli/enc/backward_references_inc.h
@@ -10,11 +10,13 @@
static BROTLI_NOINLINE void EXPORT_FN(CreateBackwardReferences)(
size_t num_bytes, size_t position,
const uint8_t* ringbuffer, size_t ringbuffer_mask,
- const BrotliEncoderParams* params,
- HasherHandle hasher, int* dist_cache, size_t* last_insert_len,
+ ContextLut literal_context_lut, const BrotliEncoderParams* params,
+ Hasher* hasher, int* dist_cache, size_t* last_insert_len,
Command* commands, size_t* num_commands, size_t* num_literals) {
+ HASHER()* privat = &hasher->privat.FN(_);
/* Set maximum distance, see section 9.1. of the spec. */
const size_t max_backward_limit = BROTLI_MAX_BACKWARD_LIMIT(params->lgwin);
+ const size_t position_offset = params->stream_offset;
const Command* const orig_commands = commands;
size_t insert_length = *last_insert_len;
@@ -31,19 +33,23 @@ static BROTLI_NOINLINE void EXPORT_FN(CreateBackwardReferences)(
/* Minimum score to accept a backward reference. */
const score_t kMinScore = BROTLI_SCORE_BASE + 100;
- FN(PrepareDistanceCache)(hasher, dist_cache);
+ BROTLI_UNUSED(literal_context_lut);
+
+ FN(PrepareDistanceCache)(privat, dist_cache);
while (position + FN(HashTypeLength)() < pos_end) {
size_t max_length = pos_end - position;
size_t max_distance = BROTLI_MIN(size_t, position, max_backward_limit);
+ size_t dictionary_start = BROTLI_MIN(size_t,
+ position + position_offset, max_backward_limit);
HasherSearchResult sr;
sr.len = 0;
sr.len_code_delta = 0;
sr.distance = 0;
sr.score = kMinScore;
- FN(FindLongestMatch)(hasher, ¶ms->dictionary,
+ FN(FindLongestMatch)(privat, ¶ms->dictionary,
ringbuffer, ringbuffer_mask, dist_cache, position, max_length,
- max_distance, gap, params->dist.max_distance, &sr);
+ max_distance, dictionary_start + gap, params->dist.max_distance, &sr);
if (sr.score > kMinScore) {
/* Found a match. Let's look for something even better ahead. */
int delayed_backward_references_in_row = 0;
@@ -57,10 +63,13 @@ static BROTLI_NOINLINE void EXPORT_FN(CreateBackwardReferences)(
sr2.distance = 0;
sr2.score = kMinScore;
max_distance = BROTLI_MIN(size_t, position + 1, max_backward_limit);
- FN(FindLongestMatch)(hasher,
+ dictionary_start = BROTLI_MIN(size_t,
+ position + 1 + position_offset, max_backward_limit);
+ FN(FindLongestMatch)(privat,
¶ms->dictionary,
ringbuffer, ringbuffer_mask, dist_cache, position + 1, max_length,
- max_distance, gap, params->dist.max_distance, &sr2);
+ max_distance, dictionary_start + gap, params->dist.max_distance,
+ &sr2);
if (sr2.score >= sr.score + cost_diff_lazy) {
/* Ok, let's just write one byte for now and start a match from the
next byte. */
@@ -76,18 +85,19 @@ static BROTLI_NOINLINE void EXPORT_FN(CreateBackwardReferences)(
}
apply_random_heuristics =
position + 2 * sr.len + random_heuristics_window_size;
- max_distance = BROTLI_MIN(size_t, position, max_backward_limit);
+ dictionary_start = BROTLI_MIN(size_t,
+ position + position_offset, max_backward_limit);
{
/* The first 16 codes are special short-codes,
and the minimum offset is 1. */
size_t distance_code = ComputeDistanceCode(
- sr.distance, max_distance + gap, dist_cache);
- if ((sr.distance <= (max_distance + gap)) && distance_code > 0) {
+ sr.distance, dictionary_start + gap, dist_cache);
+ if ((sr.distance <= (dictionary_start + gap)) && distance_code > 0) {
dist_cache[3] = dist_cache[2];
dist_cache[2] = dist_cache[1];
dist_cache[1] = dist_cache[0];
dist_cache[0] = (int)sr.distance;
- FN(PrepareDistanceCache)(hasher, dist_cache);
+ FN(PrepareDistanceCache)(privat, dist_cache);
}
InitCommand(commands++, ¶ms->dist, insert_length,
sr.len, sr.len_code_delta, distance_code);
@@ -105,7 +115,7 @@ static BROTLI_NOINLINE void EXPORT_FN(CreateBackwardReferences)(
range_start = BROTLI_MIN(size_t, range_end, BROTLI_MAX(size_t,
range_start, position + sr.len - (sr.distance << 2)));
}
- FN(StoreRange)(hasher, ringbuffer, ringbuffer_mask, range_start,
+ FN(StoreRange)(privat, ringbuffer, ringbuffer_mask, range_start,
range_end);
}
position += sr.len;
@@ -131,7 +141,7 @@ static BROTLI_NOINLINE void EXPORT_FN(CreateBackwardReferences)(
size_t pos_jump =
BROTLI_MIN(size_t, position + 16, pos_end - kMargin);
for (; position < pos_jump; position += 4) {
- FN(Store)(hasher, ringbuffer, ringbuffer_mask, position);
+ FN(Store)(privat, ringbuffer, ringbuffer_mask, position);
insert_length += 4;
}
} else {
@@ -140,7 +150,7 @@ static BROTLI_NOINLINE void EXPORT_FN(CreateBackwardReferences)(
size_t pos_jump =
BROTLI_MIN(size_t, position + 8, pos_end - kMargin);
for (; position < pos_jump; position += 2) {
- FN(Store)(hasher, ringbuffer, ringbuffer_mask, position);
+ FN(Store)(privat, ringbuffer, ringbuffer_mask, position);
insert_length += 2;
}
}
diff --git a/src/libraries/Native/AnyOS/brotli/enc/block_splitter.c b/src/libraries/Native/AnyOS/brotli/enc/block_splitter.c
index d308eca59d30..deb7c2e151ad 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/block_splitter.c
+++ b/src/libraries/Native/AnyOS/brotli/enc/block_splitter.c
@@ -132,7 +132,7 @@ void BrotliSplitBlock(MemoryManager* m,
{
size_t literals_count = CountLiterals(cmds, num_commands);
uint8_t* literals = BROTLI_ALLOC(m, uint8_t, literals_count);
- if (BROTLI_IS_OOM(m)) return;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(literals)) return;
/* Create a continuous array of literals. */
CopyLiteralsToByteArray(cmds, num_commands, data, pos, mask, literals);
/* Create the block split on the array of literals.
@@ -150,7 +150,7 @@ void BrotliSplitBlock(MemoryManager* m,
/* Compute prefix codes for commands. */
uint16_t* insert_and_copy_codes = BROTLI_ALLOC(m, uint16_t, num_commands);
size_t i;
- if (BROTLI_IS_OOM(m)) return;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(insert_and_copy_codes)) return;
for (i = 0; i < num_commands; ++i) {
insert_and_copy_codes[i] = cmds[i].cmd_prefix_;
}
@@ -170,7 +170,7 @@ void BrotliSplitBlock(MemoryManager* m,
uint16_t* distance_prefixes = BROTLI_ALLOC(m, uint16_t, num_commands);
size_t j = 0;
size_t i;
- if (BROTLI_IS_OOM(m)) return;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(distance_prefixes)) return;
for (i = 0; i < num_commands; ++i) {
const Command* cmd = &cmds[i];
if (CommandCopyLen(cmd) && cmd->cmd_prefix_ >= 128) {
diff --git a/src/libraries/Native/AnyOS/brotli/enc/block_splitter_inc.h b/src/libraries/Native/AnyOS/brotli/enc/block_splitter_inc.h
index 023712b84d3e..e612d6a37071 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/block_splitter_inc.h
+++ b/src/libraries/Native/AnyOS/brotli/enc/block_splitter_inc.h
@@ -219,7 +219,12 @@ static void FN(ClusterBlocks)(MemoryManager* m,
uint32_t symbols[HISTOGRAMS_PER_BATCH] = { 0 };
uint32_t remap[HISTOGRAMS_PER_BATCH] = { 0 };
- if (BROTLI_IS_OOM(m)) return;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(histogram_symbols) ||
+ BROTLI_IS_NULL(block_lengths) || BROTLI_IS_NULL(all_histograms) ||
+ BROTLI_IS_NULL(cluster_size) || BROTLI_IS_NULL(histograms) ||
+ BROTLI_IS_NULL(pairs)) {
+ return;
+ }
memset(block_lengths, 0, num_blocks * sizeof(uint32_t));
@@ -278,11 +283,11 @@ static void FN(ClusterBlocks)(MemoryManager* m,
if (pairs_capacity < max_num_pairs + 1) {
BROTLI_FREE(m, pairs);
pairs = BROTLI_ALLOC(m, HistogramPair, max_num_pairs + 1);
- if (BROTLI_IS_OOM(m)) return;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(pairs)) return;
}
clusters = BROTLI_ALLOC(m, uint32_t, num_clusters);
- if (BROTLI_IS_OOM(m)) return;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(clusters)) return;
for (i = 0; i < num_clusters; ++i) {
clusters[i] = (uint32_t)i;
}
@@ -294,7 +299,7 @@ static void FN(ClusterBlocks)(MemoryManager* m,
BROTLI_FREE(m, cluster_size);
new_index = BROTLI_ALLOC(m, uint32_t, num_clusters);
- if (BROTLI_IS_OOM(m)) return;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(new_index)) return;
for (i = 0; i < num_clusters; ++i) new_index[i] = kInvalidIndex;
pos = 0;
{
@@ -386,7 +391,7 @@ static void FN(SplitByteVector)(MemoryManager* m,
return;
}
histograms = BROTLI_ALLOC(m, HistogramType, num_histograms);
- if (BROTLI_IS_OOM(m)) return;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(histograms)) return;
/* Find good entropy codes. */
FN(InitialEntropyCodes)(data, length,
sampling_stride_length,
@@ -405,7 +410,11 @@ static void FN(SplitByteVector)(MemoryManager* m,
uint16_t* new_id = BROTLI_ALLOC(m, uint16_t, num_histograms);
const size_t iters = params->quality < HQ_ZOPFLIFICATION_QUALITY ? 3 : 10;
size_t i;
- if (BROTLI_IS_OOM(m)) return;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(block_ids) ||
+ BROTLI_IS_NULL(insert_cost) || BROTLI_IS_NULL(cost) ||
+ BROTLI_IS_NULL(switch_signal) || BROTLI_IS_NULL(new_id)) {
+ return;
+ }
for (i = 0; i < iters; ++i) {
num_blocks = FN(FindBlocks)(data, length,
block_switch_cost,
diff --git a/src/libraries/Native/AnyOS/brotli/enc/brotli_bit_stream.c b/src/libraries/Native/AnyOS/brotli/enc/brotli_bit_stream.c
index aaf2dad7dbdc..9348a97e1b9b 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/brotli_bit_stream.c
+++ b/src/libraries/Native/AnyOS/brotli/enc/brotli_bit_stream.c
@@ -34,33 +34,18 @@ extern "C" {
BROTLI_DISTANCE_ALPHABET_SIZE(0, 0, BROTLI_LARGE_MAX_DISTANCE_BITS)
/* MAX_SIMPLE_DISTANCE_ALPHABET_SIZE == 140 */
-/* Represents the range of values belonging to a prefix code:
- [offset, offset + 2^nbits) */
-typedef struct PrefixCodeRange {
- uint32_t offset;
- uint32_t nbits;
-} PrefixCodeRange;
-
-static const PrefixCodeRange
- kBlockLengthPrefixCode[BROTLI_NUM_BLOCK_LEN_SYMBOLS] = {
- { 1, 2}, { 5, 2}, { 9, 2}, {13, 2}, {17, 3}, { 25, 3}, { 33, 3},
- {41, 3}, {49, 4}, {65, 4}, {81, 4}, {97, 4}, {113, 5}, {145, 5},
- {177, 5}, { 209, 5}, { 241, 6}, { 305, 6}, { 369, 7}, { 497, 8},
- {753, 9}, {1265, 10}, {2289, 11}, {4337, 12}, {8433, 13}, {16625, 24}
-};
-
static BROTLI_INLINE uint32_t BlockLengthPrefixCode(uint32_t len) {
uint32_t code = (len >= 177) ? (len >= 753 ? 20 : 14) : (len >= 41 ? 7 : 0);
while (code < (BROTLI_NUM_BLOCK_LEN_SYMBOLS - 1) &&
- len >= kBlockLengthPrefixCode[code + 1].offset) ++code;
+ len >= _kBrotliPrefixCodeRanges[code + 1].offset) ++code;
return code;
}
static BROTLI_INLINE void GetBlockLengthPrefixCode(uint32_t len, size_t* code,
uint32_t* n_extra, uint32_t* extra) {
*code = BlockLengthPrefixCode(len);
- *n_extra = kBlockLengthPrefixCode[*code].nbits;
- *extra = len - kBlockLengthPrefixCode[*code].offset;
+ *n_extra = _kBrotliPrefixCodeRanges[*code].nbits;
+ *extra = len - _kBrotliPrefixCodeRanges[*code].offset;
}
typedef struct BlockTypeCodeCalculator {
@@ -450,7 +435,7 @@ void BrotliBuildAndStoreHuffmanTreeFast(MemoryManager* m,
const size_t max_tree_size = 2 * length + 1;
HuffmanTree* tree = BROTLI_ALLOC(m, HuffmanTree, max_tree_size);
uint32_t count_limit;
- if (BROTLI_IS_OOM(m)) return;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(tree)) return;
for (count_limit = 1; ; count_limit *= 2) {
HuffmanTree* node = tree;
size_t l;
@@ -714,7 +699,7 @@ static void EncodeContextMap(MemoryManager* m,
}
rle_symbols = BROTLI_ALLOC(m, uint32_t, context_map_size);
- if (BROTLI_IS_OOM(m)) return;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(rle_symbols)) return;
MoveToFrontTransform(context_map, context_map_size, rle_symbols);
RunLengthCodeZeros(context_map_size, rle_symbols,
&num_rle_symbols, &max_run_length_prefix);
@@ -956,23 +941,21 @@ void BrotliStoreMetaBlock(MemoryManager* m,
size_t pos = start_pos;
size_t i;
- uint32_t num_distance_symbols = params->dist.alphabet_size;
- uint32_t num_effective_distance_symbols = num_distance_symbols;
+ uint32_t num_distance_symbols = params->dist.alphabet_size_max;
+ uint32_t num_effective_distance_symbols = params->dist.alphabet_size_limit;
HuffmanTree* tree;
ContextLut literal_context_lut = BROTLI_CONTEXT_LUT(literal_context_mode);
BlockEncoder literal_enc;
BlockEncoder command_enc;
BlockEncoder distance_enc;
const BrotliDistanceParams* dist = ¶ms->dist;
- if (params->large_window &&
- num_effective_distance_symbols > BROTLI_NUM_HISTOGRAM_DISTANCE_SYMBOLS) {
- num_effective_distance_symbols = BROTLI_NUM_HISTOGRAM_DISTANCE_SYMBOLS;
- }
+ BROTLI_DCHECK(
+ num_effective_distance_symbols <= BROTLI_NUM_HISTOGRAM_DISTANCE_SYMBOLS);
StoreCompressedMetaBlockHeader(is_last, length, storage_ix, storage);
tree = BROTLI_ALLOC(m, HuffmanTree, MAX_HUFFMAN_TREE_SIZE);
- if (BROTLI_IS_OOM(m)) return;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(tree)) return;
InitBlockEncoder(&literal_enc, BROTLI_NUM_LITERAL_SYMBOLS,
mb->literal_split.num_types, mb->literal_split.types,
mb->literal_split.lengths, mb->literal_split.num_blocks);
@@ -1163,7 +1146,7 @@ void BrotliStoreMetaBlockTrivial(MemoryManager* m,
uint8_t dist_depth[MAX_SIMPLE_DISTANCE_ALPHABET_SIZE];
uint16_t dist_bits[MAX_SIMPLE_DISTANCE_ALPHABET_SIZE];
HuffmanTree* tree;
- uint32_t num_distance_symbols = params->dist.alphabet_size;
+ uint32_t num_distance_symbols = params->dist.alphabet_size_max;
StoreCompressedMetaBlockHeader(is_last, length, storage_ix, storage);
@@ -1177,7 +1160,7 @@ void BrotliStoreMetaBlockTrivial(MemoryManager* m,
BrotliWriteBits(13, 0, storage_ix, storage);
tree = BROTLI_ALLOC(m, HuffmanTree, MAX_HUFFMAN_TREE_SIZE);
- if (BROTLI_IS_OOM(m)) return;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(tree)) return;
BuildAndStoreHuffmanTree(lit_histo.data_, BROTLI_NUM_LITERAL_SYMBOLS,
BROTLI_NUM_LITERAL_SYMBOLS, tree,
lit_depth, lit_bits,
@@ -1206,7 +1189,7 @@ void BrotliStoreMetaBlockFast(MemoryManager* m,
BROTLI_BOOL is_last, const BrotliEncoderParams* params,
const Command* commands, size_t n_commands,
size_t* storage_ix, uint8_t* storage) {
- uint32_t num_distance_symbols = params->dist.alphabet_size;
+ uint32_t num_distance_symbols = params->dist.alphabet_size_max;
uint32_t distance_alphabet_bits =
Log2FloorNonZero(num_distance_symbols - 1) + 1;
diff --git a/src/libraries/Native/AnyOS/brotli/enc/cluster_inc.h b/src/libraries/Native/AnyOS/brotli/enc/cluster_inc.h
index 22ecb3cca809..3d4f40e60120 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/cluster_inc.h
+++ b/src/libraries/Native/AnyOS/brotli/enc/cluster_inc.h
@@ -215,7 +215,7 @@ BROTLI_INTERNAL size_t FN(BrotliHistogramReindex)(MemoryManager* m,
uint32_t next_index;
HistogramType* tmp;
size_t i;
- if (BROTLI_IS_OOM(m)) return 0;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(new_index)) return 0;
for (i = 0; i < length; ++i) {
new_index[i] = kInvalidIndex;
}
@@ -229,7 +229,7 @@ BROTLI_INTERNAL size_t FN(BrotliHistogramReindex)(MemoryManager* m,
/* TODO: by using idea of "cycle-sort" we can avoid allocation of
tmp and reduce the number of copying by the factor of 2. */
tmp = BROTLI_ALLOC(m, HistogramType, next_index);
- if (BROTLI_IS_OOM(m)) return 0;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(tmp)) return 0;
next_index = 0;
for (i = 0; i < length; ++i) {
if (new_index[symbols[i]] == next_index) {
@@ -259,7 +259,10 @@ BROTLI_INTERNAL void FN(BrotliClusterHistograms)(
HistogramPair* pairs = BROTLI_ALLOC(m, HistogramPair, pairs_capacity + 1);
size_t i;
- if (BROTLI_IS_OOM(m)) return;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(cluster_size) ||
+ BROTLI_IS_NULL(clusters) || BROTLI_IS_NULL(pairs)) {
+ return;
+ }
for (i = 0; i < in_size; ++i) {
cluster_size[i] = 1;
diff --git a/src/libraries/Native/AnyOS/brotli/enc/command.c b/src/libraries/Native/AnyOS/brotli/enc/command.c
new file mode 100644
index 000000000000..5e6c24919628
--- /dev/null
+++ b/src/libraries/Native/AnyOS/brotli/enc/command.c
@@ -0,0 +1,28 @@
+/* Copyright 2013 Google Inc. All Rights Reserved.
+
+ Distributed under MIT license.
+ See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
+*/
+
+#include "./command.h"
+
+#include
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+const uint32_t kBrotliInsBase[BROTLI_NUM_INS_COPY_CODES] = {
+ 0, 1, 2, 3, 4, 5, 6, 8, 10, 14, 18, 26,
+ 34, 50, 66, 98, 130, 194, 322, 578, 1090, 2114, 6210, 22594};
+const uint32_t kBrotliInsExtra[BROTLI_NUM_INS_COPY_CODES] = {
+ 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 7, 8, 9, 10, 12, 14, 24};
+const uint32_t kBrotliCopyBase[BROTLI_NUM_INS_COPY_CODES] = {
+ 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 18,
+ 22, 30, 38, 54, 70, 102, 134, 198, 326, 582, 1094, 2118};
+const uint32_t kBrotliCopyExtra[BROTLI_NUM_INS_COPY_CODES] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 7, 8, 9, 10, 24};
+
+#if defined(__cplusplus) || defined(c_plusplus)
+} /* extern "C" */
+#endif
diff --git a/src/libraries/Native/AnyOS/brotli/enc/command.h b/src/libraries/Native/AnyOS/brotli/enc/command.h
index 1aac85689be6..d84e373d0031 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/command.h
+++ b/src/libraries/Native/AnyOS/brotli/enc/command.h
@@ -20,14 +20,14 @@
extern "C" {
#endif
-static uint32_t kInsBase[] = { 0, 1, 2, 3, 4, 5, 6, 8, 10, 14, 18, 26, 34, 50,
- 66, 98, 130, 194, 322, 578, 1090, 2114, 6210, 22594 };
-static uint32_t kInsExtra[] = { 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4,
- 5, 5, 6, 7, 8, 9, 10, 12, 14, 24 };
-static uint32_t kCopyBase[] = { 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 18, 22, 30,
- 38, 54, 70, 102, 134, 198, 326, 582, 1094, 2118 };
-static uint32_t kCopyExtra[] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3,
- 4, 4, 5, 5, 6, 7, 8, 9, 10, 24 };
+BROTLI_INTERNAL extern const uint32_t
+ kBrotliInsBase[BROTLI_NUM_INS_COPY_CODES];
+BROTLI_INTERNAL extern const uint32_t
+ kBrotliInsExtra[BROTLI_NUM_INS_COPY_CODES];
+BROTLI_INTERNAL extern const uint32_t
+ kBrotliCopyBase[BROTLI_NUM_INS_COPY_CODES];
+BROTLI_INTERNAL extern const uint32_t
+ kBrotliCopyExtra[BROTLI_NUM_INS_COPY_CODES];
static BROTLI_INLINE uint16_t GetInsertLengthCode(size_t insertlen) {
if (insertlen < 6) {
@@ -89,19 +89,19 @@ static BROTLI_INLINE void GetLengthCode(size_t insertlen, size_t copylen,
}
static BROTLI_INLINE uint32_t GetInsertBase(uint16_t inscode) {
- return kInsBase[inscode];
+ return kBrotliInsBase[inscode];
}
static BROTLI_INLINE uint32_t GetInsertExtra(uint16_t inscode) {
- return kInsExtra[inscode];
+ return kBrotliInsExtra[inscode];
}
static BROTLI_INLINE uint32_t GetCopyBase(uint16_t copycode) {
- return kCopyBase[copycode];
+ return kBrotliCopyBase[copycode];
}
static BROTLI_INLINE uint32_t GetCopyExtra(uint16_t copycode) {
- return kCopyExtra[copycode];
+ return kBrotliCopyExtra[copycode];
}
typedef struct Command {
diff --git a/src/libraries/Native/AnyOS/brotli/enc/compress_fragment_two_pass.c b/src/libraries/Native/AnyOS/brotli/enc/compress_fragment_two_pass.c
index f8a560638439..ca68b38139ff 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/compress_fragment_two_pass.c
+++ b/src/libraries/Native/AnyOS/brotli/enc/compress_fragment_two_pass.c
@@ -524,7 +524,7 @@ static void StoreCommands(MemoryManager* m,
static BROTLI_BOOL ShouldCompress(
const uint8_t* input, size_t input_size, size_t num_literals) {
double corpus_size = (double)input_size;
- if (num_literals < MIN_RATIO * corpus_size) {
+ if ((double)num_literals < MIN_RATIO * corpus_size) {
return BROTLI_TRUE;
} else {
uint32_t literal_histo[256] = { 0 };
diff --git a/src/libraries/Native/AnyOS/brotli/enc/dictionary_hash.c b/src/libraries/Native/AnyOS/brotli/enc/dictionary_hash.c
index 3677d7ddb4ee..16d853fe5aad 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/dictionary_hash.c
+++ b/src/libraries/Native/AnyOS/brotli/enc/dictionary_hash.c
@@ -13,1107 +13,1833 @@
extern "C" {
#endif
-BROTLI_INTERNAL const uint16_t kStaticDictionaryHash[32768] = {
-32072,0,0,0,0,0,0,0,0,21860,0,0,0,0,0,0,0,40486,0,0,0,0,0,45798,0,0,0,0,0,0,1292
-,0,0,0,0,4964,278,23717,0,19972,0,0,0,0,0,0,0,0,0,0,0,0,2126,16102,0,0,0,14437,0
-,0,0,0,0,0,0,26727,2253,0,0,17252,0,0,0,0,0,0,0,0,0,3622,0,0,0,0,22984,0,0,0,0,0
-,0,16647,0,34247,0,0,0,0,0,48486,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2511,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19532,0,0,24004,0,0,0,9828,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30853,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,0,0,0,0,0,31974,0,0,0,0,0,0,0,0,20650,2404,0,20773,1677,9031,0,6404,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51879,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6761,7206
-,0,0,21992,22983,0,0,3529,0,1864,0,0,0,0,0,0,11046,0,0,9641,0,0,0,6507,0,0,36934
-,21576,62375,0,0,0,0,0,0,0,0,0,8294,0,0,0,0,0,0,0,40807,0,0,0,39398,8136,0,0,0,0
-,0,0,0,8875,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7941,0,0,25609,0,0,0,936,
-3716,3213,15687,0,0,0,0,0,52519,0,17381,0,0,0,0,1320,5797,0,21029,0,0,6472,807,0
-,0,0,0,0,0,0,0,0,0,13545,0,0,0,3624,0,0,0,29674,30820,0,31237,0,6596,0,0,0,0,0,0
-,0,0,0,64070,0,0,0,0,0,0,0,0,0,0,0,22278,0,37446,0,0,0,0,7240,423,0,24612,21705,
-17636,0,0,0,0,0,0,1833,0,0,0,328,6021,0,0,0,19974,0,0,0,0,0,0,0,0,0,62119,4178,0
-,0,0,0,12100,8617,0,0,16900,0,36678,0,0,0,35366,0,51718,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,20998,0,62086,0,0,0,0,0,5542,0,0,0,0,0,0,0,0,0,0,0,14629,10952,25927,0,0,0
-,0,19849,0,0,0,0,0,0,0,30952,3046,14314,12998,0,0,0,15268,0,40582,30216,62118,0,
-0,0,20132,0,0,0,0,0,12005,0,0,0,52358,0,0,0,0,24778,0,44,33095,0,0,0,0,0,26372,0
-,0,0,0,0,3781,0,0,17928,9479,0,0,0,0,0,0,0,0,32297,28613,0,0,0,0,0,0,0,0,0,0,0,0
-,0,47174,11723,0,0,0,0,0,0,0,0,0,2536,55143,0,0,6410,0,0,0,0,0,0,0,0,56294,11914
-,0,529,0,30184,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8261,0,0,28808,58854,22633,
-965,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64135,0,0,331,3684,0,1605,0,0,0,0,0,0,
-0,0,0,0,16650,37,0,23622,3144,15429,0,0,0,0,0,0,0,0,0,0,22443,69,0,0,0,0,0,0,0,0
-,17832,0,0,0,0,0,0,0,0,0,11113,0,0,0,0,18309,0,0,0,0,0,0,0,0,0,26630,0,0,25512,
-25895,0,0,0,0,0,0,0,0,0,0,0,16901,0,0,0,27558,0,0,9418,0,0,0,3508,0,0,0,0,0,0,0,
-0,37990,9289,8517,0,0,0,0,1578,1604,23944,0,0,14916,12781,0,0,0,0,0,0,0,12105,0,
-16617,0,0,0,0,0,0,0,0,0,0,0,0,21348,11240,28870,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,5772,0,0,27812,0,0,0,0,0,0,0,8324,0,0,0,0,0,0,0,0,0,0,16748,1157,0,0,18794,
-16324,25898,935,8333,0,0,0,0,0,0,0,0,18246,0,18086,0,46854,0,0,0,0,0,0,339,0,0,
-25188,12780,12166,6409,0,0,0,0,16516,0,27012,28395,0,0,0,0,0,0,0,1420,0,0,0,9768
-,52967,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25163,324,0,0,0,0,0,0,0,0,0,64998,0,0,0,0,0,
-21893,0,0,0,0,0,47366,0,0,0,870,0,0,0,12646,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,26020,16360,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1809,0,0,0,6601,15878,0,0,0,0,0,
-29092,0,28516,0,0,0,0,0,0,0,0,0,21988,0,0,0,42950,0,0,0,0,0,0,0,0,0,0,5133,1318,
-0,0,0,0,0,0,0,0,0,0,0,54982,24904,0,0,0,0,0,0,0,0,0,0,51526,0,0,0,0,0,3685,0,0,0
-,0,10062,9412,0,0,0,31460,5708,6181,0,0,0,0,0,0,0,0,0,5575,0,0,0,0,0,0,0,0,0,0,
-27144,57478,0,0,0,0,0,0,7084,0,21993,53126,0,0,0,0,8397,0,0,5733,0,0,0,0,0,2116,
-0,24742,0,11271,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1133,0,4873,0,0,38310,0,0,0,0,0,
-0,0,0,0,0,0,0,17932,0,0,18053,0,0,0,25510,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17798,0,
-26214,0,0,0,0,0,0,0,0,23016,17415,20392,164,0,0,0,0,0,0,0,0,0,0,0,3239,0,46119,0
-,0,0,28580,0,0,0,0,0,0,0,0,0,7621,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41478,0,0,31016,
-55334,10056,1924,0,0,0,0,0,36614,0,36711,0,0,0,0,0,0,0,0,0,0,13994,59303,0,0,0,0
-,0,0,0,0,0,0,0,0,0,0,0,26501,0,5639,0,0,0,0,0,0,13897,1253,0,0,0,0,0,5095,0,0,0,
-28869,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8646,0,0,0,0,25641,17796,0,0,0,0,0,0,0,
-13316,620,6309,11819,0,0,0,0,0,0,0,0,0,904,1095,0,24229,0,0,28744,49703,0,23077,
-0,0,0,0,32392,0,0,0,0,35271,0,28740,5866,0,0,0,0,0,0,0,4361,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7917,8869,0,0,0,13924,0,0,0,0,
-0,41958,0,0,0,0,0,0,6766,13989,0,0,0,903,0,0,24010,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,64390,0,22468,0,25861,0,0,0,0,23656,5317,0,0,0,0,0,0,23017,5445,16009
-,0,0,0,0,0,0,0,0,48006,10473,0,0,14404,0,0,0,42183,0,0,0,51270,0,0,10602,24132,0
-,0,0,0,0,43782,0,0,17834,0,0,0,25576,27205,0,0,0,0,0,0,0,0,29066,0,0,0,0,0,626,
-1988,14700,0,0,0,0,0,0,0,0,0,0,0,0,57670,0,0,0,0,0,0,0,0,0,44710,0,0,0,0,3848,
-7623,0,0,0,0,0,0,0,0,0,0,0,42374,0,0,0,0,0,0,0,0,19272,6436,0,0,5256,0,0,0,0,0,0
-,0,0,0,0,0,0,0,0,19685,0,0,0,0,0,0,0,0,0,0,0,0,0,39783,0,0,0,0,30984,0,0,0,0,0,0
-,28230,0,0,0,29028,10538,3205,0,0,0,0,0,0,0,0,0,0,0,5636,840,295,0,0,8488,8198,0
-,0,0,0,0,0,0,0,0,20580,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4074,19526,0,0,0,0,
-31144,64038,0,0,0,0,0,0,16716,0,0,0,0,0,0,0,0,0,0,0,17706,0,0,0,0,0,0,50630,0,
-50503,0,0,0,0,0,0,0,0,0,0,0,25446,0,0,0,13831,0,0,0,0,0,0,2696,4039,0,0,0,0,
-25288,0,12076,2054,0,48934,0,0,0,0,16969,59431,17259,35335,0,0,0,0,0,0,0,0,0,0,0
-,0,31275,0,0,0,1097,0,0,0,0,0,0,0,0,0,0,0,776,839,0,0,29386,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,5864,12134,0,0,0,0,0,0,0,25349,0,0,0,0,0,0,0,0,0,61447
-,0,0,0,0,0,0,0,0,0,24678,0,0,0,63335,0,28836,8142,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4494,0,0,0,0,0,14088,1188,0,16260,0,0,0,
-16421,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,276,0,0,17060,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24076,29445,0,33543,0,4901,0
-,0,12522,0,0,62471,0,0,0,0,0,0,0,0,0,0,4046,0,0,0,0,20486,0,15460,2217,51719,0,0
-,0,0,0,23495,0,0,0,0,0,0,15370,0,15849,0,15113,0,0,0,0,0,0,0,0,27972,7337,0,0,0,
-0,30342,0,0,0,0,0,0,0,0,32299,23940,0,17766,0,0,0,0,0,0,6184,0,20904,0,0,0,0,0,0
-,0,0,0,0,31492,0,0,0,5509,0,0,0,0,0,0,0,0,2669,50182,0,0,12299,0,0,0,0,0,0,0,
-5257,28167,0,0,0,0,0,0,0,0,0,0,0,11750,3890,0,0,26500,0,0,0,0,0,0,0,49318,0,0,0,
-0,0,0,0,10981,0,0,0,0,0,0,0,0,17961,1831,0,0,0,0,0,0,0,29638,0,0,0,0,26473,0,
-6216,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,711,0,0,0,0,0,0,0,0,0,0,28683,39975
-,0,0,0,0,0,51654,0,0,0,27527,0,0,0,0,0,0,0,0,30859,3268,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28772,0,18212,0,0,0,0,25448,65446,0,0,0,0,
-0,0,3337,1670,0,0,0,0,0,19332,0,0,0,0,24936,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1043,0
-,0,0,0,15814,0,21670,0,0,0,0,0,0,0,16263,0,0,0,0,0,0,0,0,0,32454,0,30630,0,0,
-20170,9926,0,0,0,18247,0,0,14376,0,2056,17191,0,0,0,0,0,0,0,7812,0,0,0,0,0,0,0,0
-,0,0,0,0,0,0,22474,52806,1588,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10825,0,
-0,0,0,40934,0,0,0,0,0,0,0,28677,0,0,5714,0,0,0,0,0,0,0,0,0,0,0,0,0,25865,22246,0
-,0,0,0,17256,35751,0,0,0,0,0,0,0,0,8236,0,32108,0,0,0,43,14342,0,16517,0,0,30732
-,0,4012,133,0,40583,971,23942,0,0,27275,0,0,0,204,0,0,27140,7564,44327,27592,
-57958,0,0,0,0,22344,25701,0,0,0,0,0,0,0,19524,31755,0,0,28102,0,59111,0,0,0,0,0,
-0,0,12261,0,44934,0,0,0,0,31560,0,11114,0,0,0,0,0,0,0,0,0,0,0,18953,18311,0,
-45159,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2059,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-19399,0,0,0,0,0,0,0,0,0,0,0,0,0,58534,0,0,0,0,0,0,0,0,0,0,0,0,22411,23943,0,0,0,
-0,0,0,11690,0,0,4069,0,0,2668,6342,0,0,0,0,0,0,27658,1766,0,0,0,0,23240,56070,0,
-0,0,0,0,0,0,0,0,0,0,0,0,34119,0,24453,0,0,0,0,21867,0,17610,9894,0,0,27976,38790
-,0,0,0,43654,0,31559,12202,23142,0,0,0,50343,0,0,0,0,0,32806,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,0,0,0,0,49895,0,0,0,0,15786,4263,0,0,0,0,4746,3814,0,0,0,0,0,0,17192,
-453,17323,0,20328,4036,0,0,0,15844,0,0,0,0,27561,31940,32296,0,0,0,0,0,0,0,11499
-,11782,0,0,0,0,9738,50471,0,0,0,0,0,35430,0,0,0,0,0,29734,0,0,0,36551,0,0,0,0,
-9257,5606,0,13829,0,7015,0,0,0,0,0,25127,0,0,19051,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2572,0,0,0,0,0,0,29797,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42342,0,0,0,0,9293,
-0,17896,56038,4077,0,0,0,29899,37351,0,30823,0,8326,0,0,0,18342,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18569,54054,0,0,0,0,0,0,0,0,0,37254,0,0,31433,
-61510,0,2022,0,0,0,0,0,25381,0,0,0,0,0,0,0,0,0,0,0,0,0,2149,25289,0,0,0,0,0,0,0,
-0,0,0,12516,14185,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8676,0,0,0,0,0
-,0,0,0,0,0,0,36486,0,0,0,0,10889,9607,0,28711,0,0,0,0,0,0,0,0,0,0,28490,0,0,0,0,
-26181,10283,1701,0,0,0,0,0,0,0,0,0,14980,0,7783,0,27846,0,0,0,56486,3892,0,0,0,
-5770,16583,0,26309,13422,20292,0,0,0,0,0,0,0,0,0,28742,0,0,0,0,14536,1158,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25801,0,0,0,0,0,0,0,0,0,0,0,0,42438,0,3332,0,0
-,0,0,0,0,0,0,0,8327,0,0,0,0,0,0,0,0,0,0,0,0,17353,1447,0,0,8427,48518,1359,0,0,0
-,0,0,14986,0,32168,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9230,2791,0,0,0,0,0,0,0,0,
-16073,31623,4269,0,0,0,0,0,0,4519,0,0,27912,58950,0,0,0,0,0,0,0,0,8361,19812,0,0
-,0,0,6056,7877,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21701,0,0,0,0,0,0,0,0,0,0,0
-,0,9128,1125,0,16548,0,0,0,0,0,0,0,0,0,0,17292,6854,21352,0,2380,0,0,4007,0,0,0,
-0,0,24357,4202,0,0,0,0,0,0,0,0,0,0,0,0,0,10664,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,42823,3022,0,0,0,0,0,0,0,0,0,0,0,0,14373,0,20677,3304,2759,20522,64903,0,
-0,0,38,0,0,0,0,0,0,0,0,0,0,0,27814,2802,8870,3758,1255,0,0,0,0,0,0,0,0,30027,
-9510,0,0,0,0,17864,14855,0,0,0,0,0,0,0,0,0,0,23404,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-51462,0,0,0,0,0,0,0,45734,0,0,23467,32327,0,0,10826,52999,0,0,0,33222,31336,
-64326,0,0,0,0,0,0,0,32166,0,0,3891,0,0,0,7017,645,0,0,0,0,0,0,27915,46087,0,0,0,
-21863,0,34246,0,0,16715,0,0,0,0,14052,21416,0,0,0,0,0,0,0,0,39846,0,0,0,0,0,
-38982,0,0,17512,7460,0,0,0,0,0,0,0,0,0,15428,0,0,0,0,0,0,0,28356,0,0,0,0,0,0,0,0
-,0,0,0,0,0,0,0,0,0,0,0,25445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11879,0,0,0,0,0,0
-,0,0,0,0,0,0,0,19911,0,20007,0,0,0,10855,943,0,0,10821,0,0,0,0,4170,0,0,0,0,0,0,
-0,0,0,9836,0,0,0,0,0,0,0,0,0,0,65415,0,0,0,0,0,0,0,0,9865,24646,0,0,0,0,0,40519,
-0,0,0,0,0,0,0,0,0,12804,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22091,23655,0,0,0,0,0,0,
-0,31686,0,0,0,58599,0,0,0,0,0,0,0,0,0,0,0,0,0,19620,0,0,0,0,0,0,0,0,0,0,0,0,0,
-24421,0,28100,0,0,0,31268,0,3204,0,0,0,0,0,0,0,0,0,14822,0,0,0,0,19947,10182,0,0
-,9480,14821,4398,0,0,14532,0,0,0,48871,1873,0,0,0,0,0,0,0,589,1541,0,0,0,0,0,
-23333,0,0,0,14149,0,0,0,0,1296,14374,0,27300,0,0,0,0,0,0,7276,0,0,0,0,0,0,47718,
-0,0,0,0,0,0,0,0,0,0,5164,1765,0,14405,0,37574,1994,0,6636,0,0,0,0,0,0,0,0,27815,
-0,0,0,0,2568,6820,0,0,0,0,0,0,0,0,0,0,11336,26247,0,0,23912,0,0,0,30536,0,0,
-34342,0,17799,0,0,0,22149,0,6118,0,25732,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,26600,5190,0,0,1142,0,0,0,0,0,0,0,0,39527,0,0,0,0,0,39494,0,0,0,0,0,0,0
-,0,0,0,3085,0,0,0,0,0,0,0,4786,0,0,0,28873,6532,0,0,26664,0,9193,11719,0,0,0,0,0
-,0,31752,64646,0,0,0,0,0,0,0,0,0,0,0,11397,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25094,0
-,0,18153,20167,0,0,0,17254,0,0,878,0,0,0,0,0,0,0,0,0,0,24166,0,0,0,0,0,0,0,0,0,0
-,0,0,26059,0,0,0,0,0,0,0,0,0,0,0,0,0,31592,0,0,8167,24362,6212,0,34758,0,0,0,0,0
-,0,32520,0,0,44679,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17989,8681,29222,0,0,0,
-0,0,0,0,0,10251,4902,1452,15207,0,0,0,0,0,0,0,22822,0,10469,0,0,0,0,0,0,19337,
-17670,107,11494,0,0,0,0,27305,2565,0,0,0,0,0,0,0,64518,200,28389,0,0,0,0,31208,0
-,30762,0,0,0,0,0,29321,60518,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3209,3237,
-12490,22663,0,0,0,18789,31464,16391,0,0,0,0,0,0,0,0,0,0,0,20646,0,0,0,27238,0,0,
-0,0,0,15940,4488,6951,0,0,0,46342,0,0,0,0,0,0,0,0,0,28965,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,20584,3367,0,25350,0,0,0,0,0,0,0,0,0,0,0,0,1814,0,0,0,0,0,0,0,0,0,0,17125,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55943,0,0,0,0,0,24133,0,0,0,0,0,0,0,0,0,0,0,0,2929
-,0,0,50086,0,2918,25356,30052,115,11846,0,0,0,0,3056,0,0,0,0,17639,239,19815,0,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36806,0,0,0,0,0,0,0,0,0,0,0,0,0,21479,0,0,0,0,0,
-28420,11786,4772,0,0,3368,36295,0,31463,0,0,14665,996,0,20582,0,0,0,9988,0,23685
-,0,0,0,52551,0,0,0,0,0,0,0,7556,0,0,0,0,0,0,0,1895,2186,0,0,0,0,0,27755,25447,0,
-0,0,0,31052,63270,0,0,0,0,0,0,0,36742,0,24804,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,31048,0,0,0,0,0,0,0,0,0,21290,2276,0,0,0,0,26475,0,0,0,0,0,0,0,0,0
-,0,15332,0,0,0,0,0,0,0,0,3176,19431,0,0,0,0,0,0,0,62726,0,0,0,25380,0,0,27883,
-1316,0,0,7724,3015,0,0,0,0,6697,0,0,47910,0,0,0,0,0,0,0,0,0,3141,0,0,0,14820,0,0
-,0,0,9326,0,0,0,0,0,0,0,0,0,0,31493,0,0,0,0,0,6566,0,0,0,0,0,0,6569,1348,0,25638
-,0,0,0,0,0,20324,0,0,17067,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11876,0,41030,0,0,0,26405
-,0,0,0,0,0,0,0,0,0,11431,28137,14950,0,10151,0,0,0,0,0,0,0,29574,0,0,0,0,27176,
-57446,0,0,0,0,28650,57574,1387,0,0,0,0,0,0,0,0,0,0,58247,0,0,0,0,0,0,0,16805,0,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3526,0,15781,0,5572,13352,0,0,0,0,0,18665
-,23463,0,0,0,0,0,0,15405,6885,0,0,0,0,15272,0,0,0,0,0,0,0,0,9861,0,0,0,0,0,0,0,0
-,9512,4037,0,0,11563,49639,0,0,0,0,0,0,27880,57830,0,0,0,0,0,41831,0,21924,0,0,0
-,0,0,0,0,25509,0,27462,0,18085,0,0,0,0,0,0,0,0,0,0,0,0,13898,8068,26441,0,0,0,0,
-0,0,25316,0,0,0,0,16298,7397,5706,19239,0,0,0,0,0,0,0,0,1392,50919,0,0,0,0,0,
-53863,0,0,0,0,1451,0,0,0,0,0,0,0,0,0,0,35847,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,17801,15813,0,12740,0,0,0,32967,0,0,0,0,0,0,5389,0,0,0,0,0,0,0,0,0,0,31143,0,
-20548,0,0,0,0,0,0,0,0,0,51686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-12109,19015,0,34983,0,21732,3600,0,0,0,0,47750,17288,43975,22857,47559,0,0,0,0,
-26408,48358,0,0,0,0,0,0,0,0,0,0,0,0,0,30470,0,0,23560,4581,0,22404,0,49286,0,0,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,49831,0,0,0,27525,31691,7,0,0,25835,0,0,0,0,0,
-4201,16485,0,20676,0,0,0,0,3753,23303,16264,3878,0,0,0,0,0,0,11434,0,0,0,0,0,0,
-7589,0,0,0,0,0,0,0,0,0,57095,0,0,0,0,0,0,0,0,0,0,0,22820,11146,49158,0,23623,0,0
-,0,0,0,0,0,13893,0,0,0,0,0,0,11722,60071,1258,0,0,0,0,0,0,18564,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,27945,0,0,0,0,5479,0,20006,17608,3431,10988,30180,0,0,0,0,0,0,0,
-24581,14,0,0,0,0,0,0,25572,0,0,0,28612,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,53543,0
-,0,0,0,0,0,0,0,0,0,0,33670,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8710,0,14116,0,0,116,
-292,0,0,0,37831,0,43078,0,0,0,0,0,0,0,0,21832,0,0,32134,783,0,0,30982,0,0,0,68,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5932,0,0,0,18505,
-15175,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3630,16965,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,17797,0,0,0,0,0,0,520,42150,0,0,3122,0,0,0,22506,0,0,0,0,0,0,0,0,28550,0,
-0,0,50278,0,0,13641,5958,0,35238,0,0,0,0,0,0,0,0,29993,18724,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,0,20619,9319,0,0,0,0,23977,0,5193,0,0,12196,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,24390,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20105,677,0,0,0,0
-,0,0,0,0,29419,0,0,0,0,0,0,0,0,0,20266,0,0,0,0,10631,0,0,0,0,0,0,0,0,0,47655,0,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26628,12744,0,20648,0,0,0,432,0,0
-,0,0,0,0,0,0,0,0,646,0,25604,0,0,0,0,0,0,0,0,0,0,0,0,0,63782,0,0,0,0,24616,0,0,0
-,21291,0,0,0,0,0,0,0,0,0,0,45638,0,0,0,0,1931,0,0,0,20521,59975,0,20614,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,56231,0,0,0,0,0,29991,0,52871,0,20934,0,0,0,0,0,0,0,16871,
-0,0,0,0,0,0,0,0,0,0,0,0,0,7237,0,0,0,0,0,47558,0,0,0,0,0,0,0,0,0,0,0,10406,0,0,0
-,0,0,0,0,43046,0,0,2930,0,12936,0,0,0,0,0,0,0,0,0,0,0,0,31141,0,0,0,0,0,0,0,
-37639,0,17572,0,0,0,0,0,0,0,0,0,0,31240,0,0,0,0,0,688,0,0,0,0,0,1648,0,0,0,0,
-10055,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,146,0,0,0,0,0,0,0,0,0,6345,199,0,34982,0,0
-,0,0,0,0,0,0,0,0,0,0,0,56839,0,0,0,0,0,48902,0,13412,0,0,0,0,0,0,0,0,2441,4420,0
-,0,0,0,20428,933,0,0,0,0,0,0,0,45383,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,54726,0,0,0,0,0,0,0,0,0,0,0,0,17036,741,0,0,0,0,0,0,0,27589,0,0,30282
-,18950,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2248,0,0,0,0,0,0,0,0,0,25993,0,0,0,
-2443,0,0,31622,0,14150,0,0,0,28679,0,0,0,0,0,0,15464,0,0,0,0,54694,0,0,0,0,0,0,
-3827,0,0,0,3756,0,9897,0,0,0,0,0,19082,31239,0,0,0,0,0,0,0,0,0,0,0,24580,0,0,0,0
-,0,0,0,0,0,16580,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27625,0,0,0,784,4647,32652,0,0,
-63494,0,0,0,0,0,0,0,21062,0,0,0,0,0,0,0,0,0,0,3404,58470,0,32325,0,0,0,0,0,0,0,0
-,0,0,0,0,0,0,0,0,18634,2789,0,0,0,0,0,0,0,8548,0,0,0,22501,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,15881,0,0,0,0,35879,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7978,17956,0,0,0,
-0,0,0,0,24324,0,0,4937,0,0,0,8168,0,13420,10340,0,0,0,0,0,11780,0,0,0,0,0,0,0,0,
-0,0,16712,0,0,0,0,0,0,0,17640,17991,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,2953,0,0,0,0,0,0,0,9100,16806,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30667,0,0,
-19013,0,0,0,0,0,0,205,15334,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1969,0,0,0,0,0,0,0,26248
-,52518,0,49798,0,0,0,0,0,0,0,9668,0,0,0,0,0,4742,0,0,21641,0,0,0,0,0,0,53574,0,0
-,0,0,0,0,5707,0,0,0,0,0,0,0,3018,12454,0,0,0,0,2920,262,0,0,0,0,0,0,0,0,0,0,3593
-,0,0,0,0,0,0,0,0,0,0,23910,0,0,0,0,0,0,0,55879,0,0,0,0,0,775,0,43270,5066,48967,
-0,0,22986,4165,8971,44838,0,0,0,0,0,62279,272,0,0,0,0,51430,0,0,0,0,0,0,28234,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13349,0,0,0,51111,20265,13861,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,585,7494,0,0,0,0,0,0,0,0,21768,62407,0,0,0,0,7979,166,0,
-0,0,0,0,0,0,0,0,38918,0,56742,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16296,5767,0,0,0,0,0,0
-,0,32068,0,0,0,0,0,0,0,0,0,0,0,0,0,29796,0,0,0,0,0,0,0,0,23916,30183,0,58791,0,0
-,0,0,0,0,0,20518,0,0,0,0,8969,0,0,0,183,0,0,0,0,0,2314,17445,0,0,0,0,0,0,0,0,0,
-23748,0,0,8139,4839,27914,0,0,0,0,0,0,0,0,0,0,0,0,29478,0,0,16552,26663,0,53767,
-0,0,13960,8039,18696,0,0,0,0,0,0,0,0,0,0,0,782,16005,0,0,0,0,0,0,0,0,6258,56806,
-16456,12455,0,0,0,0,0,0,0,23780,0,0,0,0,0,0,9355,0,0,0,7273,41063,24780,57766,0,
-0,0,0,0,0,0,0,0,0,3820,2597,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29225,61126,0,0,0,58439,
-15691,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37190,22408,967,0,0,0,
-23078,26858,0,0,0,19753,0,0,0,0,0,0,0,0,0,5416,13702,0,0,0,0,0,52742,20394,38567
-,0,0,0,51079,0,0,136,8516,0,0,0,0,0,0,0,0,0,0,0,27588,0,0,0,0,0,0,0,0,0,0,531,0,
-0,0,0,0,0,0,0,0,8936,5031,12520,19334,0,0,22827,30247,28074,31140,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,27497,18148,20104,59079,0,0,0,0,0,0,0,0,0,24389,0,0,6125,0,0,0,0,
-9541,0,0,24553,29095,0,0,0,0,0,0,0,25444,0,0,9643,0,0,63047,0,0,0,0,0,0,0,0,0,
-39558,0,0,0,0,0,0,20620,11815,499,0,5128,2278,0,0,0,0,0,46310,0,0,0,0,0,0,0,0,
-23530,40166,2440,0,0,0,0,0,0,0,0,0,0,15174,0,0,0,0,0,0,0,0,0,0,26922,0,0,0,0,0,0
-,0,0,0,0,26758,0,0,0,0,0,51911,0,0,23532,0,0,0,0,51238,25737,44486,12622,0,0,0,0
-,0,0,3078,0,9253,0,0,1128,22023,0,0,0,21350,0,16420,0,0,0,0,0,0,0,65094,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22532,0,48774,0,34503,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,9797,0,0,0,0,0,0,0,13797,0,38279,0,0,1738,0,489,46343,0,45382,0,0,0,0,0,0,
-0,0,0,29030,0,0,0,0,0,0,6220,56550,0,0,0,0,0,26885,0,28806,0,0,0,0,0,0,0,0,0,0,0
-,45958,0,0,0,0,20553,49927,0,0,0,0,0,0,3019,12358,0,0,0,0,0,0,0,0,0,0,26571,
-13319,0,0,653,23399,0,0,0,0,0,0,0,0,22316,0,0,21188,0,0,0,0,0,0,0,0,0,27556,0,0,
-0,0,0,0,0,27878,21483,27653,0,29701,237,0,10632,0,0,0,0,33766,0,0,0,0,0,0,31563,
-0,0,0,0,0,1416,2439,0,0,0,0,0,0,0,0,0,0,9611,0,0,0,0,0,0,0,5611,16581,26601,
-35462,0,0,0,26756,0,59271,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26984,57734,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,7882,0,0,0,19528,6469,0,0,1161,0,0,0,7688,20935,425,0,
-0,0,0,0,0,0,0,12519,0,12902,0,0,0,0,0,0,0,0,0,0,2411,0,11725,26086,0,0,20201,0,0
-,0,0,0,0,0,0,11045,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30471,0,0,0,0,0,0,0,0,0,0,0,
-21541,1141,21190,0,9188,0,0,0,0,0,0,0,0,0,0,0,0,0,0,184,1093,0,0,0,0,0,0,0,0,
-4842,0,13672,0,0,12230,0,0,0,10532,0,0,8937,0,0,0,0,0,0,0,0,0,0,28996,0,0,11720,
-26982,0,46182,0,43911,31754,0,1160,3940,0,20772,0,0,0,0,0,24549,0,32582,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,31845,0,0,0,0,0,0,0,2310,11788,0,0,43047,0,0,0,18853,0
-,0,0,0,0,0,0,0,0,63622,0,0,7048,17318,0,0,0,21957,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,1039,6279,0,0,0,0,0,0,0,0,0,0,0,0,0,12197,0,0,0,0,0,0,0,0,0,
-46470,0,0,24,19719,0,0,0,0,0,0,0,0,0,39335,0,0,0,0,0,0,0,0,0,0,21353,3846,0,0,0,
-0,0,0,0,36679,0,0,0,0,0,0,0,0,0,0,0,11268,0,0,0,0,0,9382,0,0,0,0,0,0,0,0,0,0,0,0
-,0,29926,0,33606,0,4708,2828,0,0,29543,0,0,0,0,0,29893,0,0,0,0,0,0,0,0,3663,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10920,7111,0,0,0,0,0,0,0,0,0,0
-,9384,0,0,0,0,0,0,0,0,0,0,0,0,20388,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37094,0,0,0,
-27110,0,0,0,0,0,0,21865,0,27753,30214,0,0,0,0,0,57895,0,0,0,0,0,0,0,0,0,0,12648,
-5446,0,0,0,0,0,0,0,0,0,0,19784,17124,0,52007,0,0,0,0,0,0,0,0,758,0,0,0,0,0,0,0,0
-,0,0,0,0,0,0,0,0,0,0,24900,0,0,0,0,0,1476,0,65031,0,0,1205,46663,0,30023,11625,
-1094,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10058,0,0,0,0,0,0,28455,0,0,0,0,0,0,0,0,0,0,0,
-14788,0,0,0,0,16808,0,0,742,0,0,0,0,0,0,0,0,0,0,0,21636,0,0,0,0,0,0,0,0,0,0,0,0,
-15944,23207,0,0,0,0,247,0,0,0,0,24743,0,0,0,5252,0,0,0,0,0,0,0,0,29961,18660,
-21099,46791,0,7045,0,0,0,0,25707,0,0,17412,3828,0,0,0,0,0,0,0,0,0,0,0,5803,5637,
-0,38151,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60103,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,853,0,0,0,0,0,0,30215,0,0,0,0,0,0,0,8741,0,0,0,0,0,27366,0,0,0,0,171,
-4070,0,0,0,0,0,0,0,0,24073,7366,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2184,5189,0,
-20932,1545,4996,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7684,0,0,0,0,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6313,0,0,0,0,0,0,0,30826,0,0,0,0,0,0,
-0,0,0,0,27463,0,0,0,0,0,0,0,0,0,0,21640,63303,0,0,3275,31111,0,0,0,0,0,0,0,11556
-,0,14756,0,0,0,15108,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23914,28966,0,0,0,4965,0,0,0,0,
-0,0,0,0,0,0,10216,5223,0,0,0,0,0,0,0,0,0,27142,0,0,1173,20198,0,0,0,0,0,56614,0,
-0,0,0,0,4612,0,0,0,0,0,0,0,0,0,0,11822,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17769,7910,
-0,0,31880,0,0,6055,0,0,0,0,0,0,0,0,0,0,8970,0,0,0,0,0,0,0,0,0,0,0,16840,23879,0,
-0,11051,0,0,0,32552,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20842,13701,0,0,0,37191,7373,
-10471,17482,25348,0,0,0,38502,0,0,0,0,0,0,0,0,0,21509,6058,0,0,0,0,0,0,3173,0,0,
-0,9543,0,0,0,0,0,0,17768,12708,0,0,0,0,0,37030,0,0,0,0,0,0,0,0,0,0,12748,48743,0
-,11718,0,0,25194,0,0,0,9033,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5028,0,30118,0,0,0,0,0,
-42759,0,0,3720,0,0,0,0,0,0,25190,0,0,0,0,0,0,0,0,0,0,5450,5125,0,58086,0,0,0,0,0
-,27716,0,0,0,0,0,0,0,0,0,22052,0,0,0,0,26249,0,15947,3460,0,0,0,35814,0,0,0,7813
-,19500,32167,0,18597,0,0,0,0,0,28644,0,0,0,60743,0,0,0,0,0,29636,0,0,0,0,0,0,0,0
-,0,0,0,0,0,17220,15885,9414,9642,0,0,0,593,0,0,24228,0,0,0,0,0,40422,0,26244,0,
-23109,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64902,0,0,0,0,3979,60007,0,0,0,28199
-,0,0,0,43142,0,0,0,0,0,0,0,29158,0,30532,0,0,0,0,13256,0,0,0,0,16549,0,0,0,0,0,
-26116,0,0,0,0,0,0,0,0,22825,0,0,0,0,0,0,0,1065,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,18985,4805,0,0,0,0,0,17702,0,0,0,0,0,0,0,0,0,0,3468,0,0,0,0,13447,0,0,0
-,0,0,0,0,0,0,0,0,56871,0,0,1776,15780,0,0,2603,0,10280,31366,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,11592,3591,0,2372,0,0,0,0,0,0,0,20004,0,0,0,0,0,0,12072,518,0,0,1960,
-8999,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7178,32999,0,0,0,0,0,0,1641,0,0,0,0,0,0,0,6764,
-9893,490,4005,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25258,5541,0,14053,306,20743,0,0,
-9422,0,0,0,0,0,0,0,11977,260,0,35175,0,0,0,0,0,0,0,18405,0,0,0,16582,0,0,0,22470
-,0,0,0,0,0,0,2792,0,0,0,14026,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14858,3909,0,0,0
-,57671,0,0,0,0,0,0,15979,0,0,0,2794,15239,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26884,
-9070,0,0,0,0,51846,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19499,37127,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,0,0,0,0,0,0,0,19205,10350,11910,0,0,0,0,15083,23108,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,0,0,169,0,0,0,0,0,0,0,0,0,0,0,15274,41735,0,56774,0,0,2825,0,14025,
-389,0,0,0,0,0,0,0,0,21482,31910,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20456,710,0,0,25032,
-21797,0,0,0,0,0,0,0,0,0,0,32427,21252,0,30150,0,43174,0,0,0,0,0,0,0,0,0,0,0,0,
-11403,0,0,1029,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6892,9252,0,63206,
-3496,14406,0,0,0,0,0,0,0,0,0,0,22568,0,0,21253,0,0,0,0,0,0,0,39623,0,0,10189,0,0
-,0,0,0,0,0,0,0,0,0,0,0,30729,59910,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3305,0,0,0,0,0,0,
-0,0,0,7660,24871,0,838,0,0,0,0,0,0,0,0,0,0,0,0,12013,13252,0,551,0,0,0,43207,0,
-30567,0,0,0,0,0,0,0,0,28394,30724,0,0,0,0,0,0,0,0,0,0,22665,22725,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,29414,0,0,0,0,16074,8966,245,1445,0,0,0,0,24872,0,0,0,0,
-13124,0,35527,0,0,0,0,0,0,13259,10917,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-25191,0,0,0,13956,0,0,0,0,0,0,0,54631,19625,12070,3083,0,0,0,0,14436,0,0,0,0,0,0
-,0,0,0,0,0,0,0,21766,0,15463,29322,0,0,0,0,0,0,29990,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,23653,0,0,0,0,0,0,0,0,2643,0,0,21223,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,4114,0,0,0,0,0,0,0,0,34790,0,0,0,0,0,0,0,16103,0,0,0,0,0,0,297,3620,3338,
-10372,0,14727,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29924,22473,13895,
-15529,32455,30378,13540,0,28807,0,0,0,0,0,0,0,64582,18380,0,0,0,0,0,0,0,0,0,0,0,
-0,38598,0,0,0,0,0,0,0,0,1236,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32710,0,0,0,0,4590,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64935,0,0,0,0,0,0,0,0,0,0,0,0,16744,0,0,
-0,0,0,0,20005,0,0,13608,1191,0,0,0,62183,0,0,0,0,0,24484,0,0,0,0,0,0,0,0,0,0,
-17643,0,0,0,0,0,0,0,0,0,0,0,0,5380,0,0,32328,0,0,63814,0,0,0,2919,0,0,0,0,17034,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,60295,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,7690,486,0,0,0,39270,0,49094,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12555,0,0,0,0,0,0,0,0
-,0,0,0,0,20967,17993,12647,0,0,0,16036,32616,0,0,0,0,16294,8555,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35174,0,0,0,0,0,0,30346,0,0,0,0,0,0,0,
-14797,3652,0,0,8268,12934,0,54950,0,0,0,0,2632,33959,0,23175,0,0,0,0,0,36262,0,0
-,0,0,0,0,32684,26918,0,32676,0,0,0,0,0,0,0,0,0,0,15625,11943,1206,0,0,0,0,18052,
-0,0,0,0,0,16422,0,0,0,26404,0,0,28777,0,0,24902,0,0,408,45351,0,35719,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,3658,17446,0,165,0,0,0,0,0,0,0,6151,0,0,24424,0,0,0,0,0,0,0,
-24170,24293,0,0,0,0,0,0,0,0,0,11847,0,39591,0,0,0,0,0,0,9549,2788,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1010,0,0,0,0,0,0,26055,31724,0,24233,
-1828,0,0,0,0,0,0,0,0,0,17284,0,0,0,0,19464,0,0,0,0,0,0,0,0,32452,0,0,0,28871,0,0
-,0,0,17704,53383,0,0,0,0,0,0,0,0,0,17892,1938,0,0,0,0,0,16362,0,0,21605,0,0,5003
-,0,0,0,0,0,0,22693,0,22342,0,0,0,55846,0,0,0,0,0,0,0,0,0,22853,0,0,0,0,0,0,0,0,
-6600,263,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24836,0,0,0,0,0,0,0,0,0,
-40711,0,0,0,0,0,33894,0,0,0,0,0,0,13000,0,0,0,0,0,0,0,0,0,0,30308,0,0,0,0,0,0,
-5386,0,0,0,0,0,0,27844,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17740,0,0,0,0
-,25093,29064,0,0,0,0,0,0,0,12680,11462,0,0,0,0,0,0,0,0,84,7303,0,0,0,0,0,0,0,0,0
-,0,0,27044,457,0,22924,58246,19016,0,2606,45703,0,5157,0,25028,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,0,0,0,0,0,0,2065,0,0,0,0,0,31946,0,0,0,0,0,0,0,0,0,0,0,0,33382,0,
-47878,0,0,0,0,0,0,0,0,25004,0,0,0,0,0,0,0,26153,35654,0,58055,30668,0,0,0,0,
-25988,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4456,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,7560,20583,0,0,0,0,0,0,0,0,0,37510,0,0,0,0,0,0,0,0,0,42822,0,0,0,0,0,0,0,0,
-0,0,0,1733,0,0,0,8196,0,0,11241,0,30572,60326,0,15013,0,0,0,40646,0,23812,0,
-10022,0,0,0,0,0,0,0,0,12874,31015,0,0,0,0,0,0,1608,0,0,0,0,18308,0,0,0,0,27114,0
-,0,0,0,0,0,0,7944,1382,0,11813,0,0,0,0,0,0,0,0,0,0,0,0,0,24517,0,11621,0,0,0,0,0
-,0,0,0,0,0,0,21702,0,0,13100,8262,2644,7973,0,0,0,0,0,0,0,0,0,0,0,0,1033,12581,0
-,25221,0,0,0,40998,16301,62983,0,0,0,0,1263,9318,0,0,0,18854,0,0,1741,33895,0,0,
-0,0,0,0,26377,0,0,0,0,0,0,0,0,0,0,32165,0,51143,0,0,0,0,0,29412,0,0,0,0,0,0,0,0,
-1674,4230,0,0,0,0,0,10502,0,0,0,0,5545,0,0,0,0,0,2099,45158,0,0,0,0,0,0,0,0,0,0,
-14157,0,26955,0,0,0,0,0,0,0,0,0,17096,0,0,0,0,0,0,0,0,0,0,0,0,0,27050,6726,0,0,0
-,0,0,0,0,0,28554,0,0,7142,0,0,0,0,16936,0,0,0,25833,0,4399,6980,0,46214,0,0,0,0,
-0,10630,21164,0,0,0,0,0,0,0,2446,48551,0,0,0,0,0,0,0,0,0,0,0,13381,0,0,0,0,0,0,0
-,0,15400,12135,0,0,0,0,0,4774,586,0,0,0,0,0,0,0,0,23751,9736,4548,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25577,29607,6250,1637,0,0,0,0,
-22024,0,0,0,0,22308,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37414,24044,0,0,0,14474,29735,
-0,7077,0,45990,0,0,0,0,30568,40039,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-6150,0,4228,0,0,0,0,0,27687,0,0,0,0,0,0,0,24548,21513,1350,0,0,0,33607,0,0,0,0,0
-,0,0,0,11784,1414,0,0,0,0,0,0,0,18244,940,0,0,0,0,0,0,7270,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,16709,0,0,0,0,0,0,0,48935,0,0,0,0,0,0,23660,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,53350,0,0,0,0,0,0,4236,16358,0,4422,6665,32644,0,0,744,18084,0,11014,0,0,0,0,0,
-29508,0,0,0,0,0,0,0,7686,0,0,13289,5478,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,12872,0,0,24134,1005,22916,0,31429,23400,0,0,0,0,0,0,0,28424,0,0,0,
-25706,27109,0,0,26345,0,0,0,0,0,0,25126,0,0,88,0,0,0,0,0,0,0,17032,0,0,21799,0,0
-,10060,0,12296,21892,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20777,14311,0,58182,
-32232,0,10282,0,2121,11527,0,0,0,12325,0,0,0,0,0,0,0,28804,2344,8133,0,0,0,0,
-21864,62695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2771,0,0,
-23204,0,0,0,0,0,6278,0,0,0,0,0,26597,0,0,0,0,23144,0,0,0,0,0,31816,20070,0,0,0,0
-,0,0,0,0,0,0,24456,2118,0,0,0,0,6570,1156,0,0,0,0,0,0,0,30406,0,0,0,28388,3572,0
-,0,26599,12426,5286,0,0,0,0,0,4967,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24970,24167,0,0,0
-,0,28745,4678,0,0,0,0,0,0,0,1444,236,0,0,0,0,0,0,0,0,19428,0,0,0,0,0,0,2092,0,0,
-0,0,0,0,0,0,0,2827,0,0,0,0,0,19881,19204,0,11749,0,0,0,0,0,0,0,17958,0,17894,0,
-18726,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9190,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,0,0,21510,5033,0,0,0,0,22855,0,0,0,0,0,14598,0,29605,0,0,0,0,0,0,0,0,
-617,0,0,0,0,47142,0,0,0,0,0,0,0,0,0,0,3627,0,0,0,0,0,0,0,0,0,0,0,0,0,2225,14823,
-0,0,2637,6182,78,15078,0,0,0,0,20264,0,0,0,0,0,0,36743,4140,44551,17352,25703,0,
-0,0,0,0,0,0,0,0,0,0,0,14024,0,0,0,0,0,0,28004,0,0,0,0,0,7588,0,0,0,0,0,0,0,2087,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18028,0,0,0,300,14212,0,0,1386,40327,0,0,0,0
-,0,0,31082,0,0,22374,0,0,0,0,0,35718,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26532,7756,0,0,18982,0,0,0,0,0,0,0,0,6440,1159,7180,0,0,0,0,0,0,45766,0,57798,0,
-16740,0,0,6802,60454,0,0,0,26470,0,0,0,0,0,65382,4362,7750,0,0,0,0,0,0,9096,4743
-,334,0,0,0,0,0,0,39974,0,0,0,25828,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3027,0,0,
-0,15816,0,0,0,0,0,0,0,0,48327,0,0,0,0,0,0,0,0,0,0,16168,41799,0,0,24458,8581,0,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12292,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,0,0,54503,0,0,0,0,5097,30852,18664,0,0,0,0,0,0,16484,0,0,27337,0,0,0,
-0,0,0,0,0,0,0,0,0,35942,0,0,0,0,0,0,0,4356,0,0,0,0,0,57030,0,0,1417,41191,0,0,0,
-0,0,23429,0,0,0,0,10024,21735,0,0,10126,0,0,0,0,19046,0,0,0,0,0,0,24105,4710,0,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4394,0,0,0,0,13253,0,56391,0,0,0,0,0,0,0,0,0,0,
-0,19174,0,0,0,0,0,0,0,0,0,55974,0,0,0,52070,0,15620,0,0,0,0,0,2660,0,0,0,0,21644
-,0,0,52455,0,0,0,0,0,0,0,0,0,8902,0,0,0,0,0,0,3116,0,464,34726,0,0,0,0,0,0,25003
-,12423,0,27172,1896,7335,0,0,0,0,0,35686,0,0,0,0,3472,0,0,0,0,22406,0,0,0,0,0,0,
-0,0,0,45254,0,0,0,0,0,0,0,0,0,0,0,0,0,21124,23594,33127,0,0,0,0,0,0,16684,22087,
-0,0,0,0,0,0,0,0,0,0,0,0,8714,0,0,0,0,0,0,0,0,0,0,55814,0,0,0,0,0,0,4109,23460,0,
-0,8874,0,0,0,0,0,0,0,0,0,147,0,0,0,0,0,0,0,0,0,0,0,0,0,29960,63398,1302,0,0,0,0,
-0,0,0,0,24806,0,0,0,0,0,0,0,0,0,9799,0,0,0,0,0,0,0,31333,0,0,0,0,0,19557,0,0,0,0
-,0,5701,0,0,0,63014,0,0,0,0,0,0,0,21254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12484,0,0,
-0,48326,0,0,0,0,0,0,0,0,0,0,0,15783,0,0,1202,0,0,0,0,23174,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,0,0,0,0,0,0,3086,49191,0,0,5387,15141,0,0,0,3365,0,0,0,0,20076,14021,
-0,0,0,0,0,0,0,0,0,0,376,40198,0,0,0,52039,0,24932,0,0,0,0,808,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,9860,0,0,0,0,0,23719,0,21476,0,0,0,0,20776,4807,0,0,3177,16678,0,0,110
-,10853,0,0,0,17382,0,0,0,0,0,0,0,0,0,43462,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,7500,4966,0,0,0,0,0,0,0,52102,0,24516,0,0,0,0,0,0,0,0,0,0,0,0,0,26535,0,0
-,0,46247,0,0,0,15557,0,0,0,0,76,52327,0,0,0,0,17866,0,0,0,0,0,0,0,0,0,0,46758,0,
-0,0,0,0,19173,0,0,0,0,0,0,0,0,0,44038,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2985,0
-,0,0,0,0,0,14310,0,0,2125,45831,0,0,0,0,0,0,9838,0,13227,19492,0,0,0,29764,0,0,0
-,0,686,30053,0,0,0,0,0,30789,139,20837,0,0,0,0,502,18533,0,0,0,0,0,19111,0,0,0,0
-,0,31396,0,0,0,17444,0,0,0,0,0,0,0,49862,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25610,550,0
-,0,561,0,29034,0,0,0,3528,0,0,0,1715,14661,18,63463,0,0,0,0,0,0,0,0,0,0,14186,0,
-0,0,0,0,0,0,0,0,0,0,29578,59014,0,39430,0,0,0,0,2250,16612,0,31780,0,0,0,0,0,0,
-462,16967,0,29029,0,0,0,0,0,23462,0,0,0,0,0,0,0,0,1768,0,6025,16998,1804,0,0,
-54182,0,0,0,0,0,0,0,0,14124,0,6154,29702,0,0,0,0,0,7716,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,48807,0,8292,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16389,5933,0,
-14857,51303,0,0,0,0,0,0,0,0,0,0,0,35623,9097,23047,0,0,23112,0,0,0,0,0,438,0,0,0
-,0,0,0,0,151,9254,1390,0,0,0,0,0,0,54215,0,0,0,0,6187,0,0,0,0,13095,0,0,0,0,0,0,
-0,0,0,0,0,0,9866,0,0,59622,0,0,0,0,0,0,0,0,0,25286,0,0,23848,32069,0,0,0,0,0,0,0
-,0,0,9255,2187,15270,437,0,0,0,0,0,0,0,0,0,0,19493,0,0,0,0,0,0,0,0,0,0,0,11748,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16902,0,0,0,0,0,0,0,0,0,22212,1865,17543,0,
-0,0,0,0,0,21996,0,0,0,0,55975,0,0,0,0,0,0,0,0,32138,21156,0,0,0,0,0,0,14249,0,0,
-0,2388,0,0,0,0,6823,0,0,0,0,0,0,0,0,0,0,0,0,0,26694,0,0,6059,53511,0,0,0,0,0,0,0
-,49542,6159,0,0,0,0,0,0,0,0,0,0,0,0,0,1036,24036,0,2501,0,0,0,0,0,0,17419,51271,
-3377,15142,0,0,0,0,0,0,5007,62374,0,56935,0,0,0,0,0,0,0,0,0,0,0,24422,0,0,0,0,0,
-0,0,0,942,0,0,0,0,0,0,0,0,0,0,28263,0,0,0,0,0,0,0,15622,0,19749,0,0,1611,0,22219
-,48583,25129,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17476,0,0,0,0,0,0,0,0,0,0,
-721,0,0,0,0,32518,0,0,0,18469,0,0,0,0,0,0,5896,29927,3657,23046,0,0,3214,0,0,0,0
-,0,0,0,0,0,112,0,0,0,0,0,3048,455,0,31012,0,0,0,0,0,0,0,23270,0,32677,0,0,0,0,0,
-38086,0,0,0,0,0,0,0,0,0,0,0,0,0,4900,0,0,0,0,0,0,0,0,0,25541,0,18788,0,0,22248,
-1351,0,61734,4524,30629,0,14887,242,29063,0,0,14408,4741,0,0,0,37318,0,0,0,0,0,0
-,0,0,0,0,0,0,8106,0,32107,0,0,0,0,0,0,0,0,0,0,0,1481,0,0,28132,0,25798,0,59783,0
-,0,0,0,0,59078,0,0,0,23366,0,0,0,0,0,0,0,30887,0,0,0,0,16200,0,0,0,335,0,0,0,714
-,0,0,0,0,0,0,0,0,0,0,0,0,0,30730,9478,0,0,0,0,0,0,0,0,0,0,0,18790,0,0,0,0,663,0,
-0,0,1034,31431,0,0,0,0,0,0,0,0,0,0,30120,0,0,0,0,13925,0,0,0,0,0,0,2280,13414,0,
-0,0,0,0,0,22028,23687,3017,11047,0,0,21738,18630,0,0,0,0,0,0,0,30246,0,0,0,0,0,0
-,0,0,0,0,0,0,17257,0,21896,63783,0,0,0,21094,0,18662,0,25700,0,22533,0,0,0,0,0,
-6341,5800,11111,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15399,
-12970,6501,0,0,3179,26438,0,0,0,0,0,0,0,15750,0,13062,0,0,0,0,0,0,0,0,0,0,142,0,
-0,0,0,21284,11177,4391,0,0,0,0,19595,40647,0,0,0,0,0,11877,0,0,0,26439,0,0,0,0,
-695,49126,27467,11972,0,0,0,0,0,0,9961,0,0,0,31722,62982,0,0,0,0,15817,52710,0,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24614,0,0,0,0,0,20550,0,0,5034,3942,0,0,0,
-45927,0,0,0,0,0,0,0,0,0,0,2548,0,0,0,0,0,0,45606,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,0,3405,12582,15563,54087,0,0,0,0,0,0,0,0,0,0,0,0,24202,5893,0,0,0,
-44230,0,0,0,5605,0,47782,0,32230,0,0,0,0,0,0,0,0,0,0,0,7014,0,0,0,0,16488,3175,0
-,27237,0,0,0,0,0,40902,0,0,0,0,0,0,0,32004,31434,0,24392,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,29130,58214,0,0,0,0,0,0,29002,0,0,0,0,0,0,0,0,0,0,55366,0,0,0,0,0,0,0
-,0,0,0,0,37926,0,0,0,0,0,0,0,0,1290,0,0,0,4713,0,0,0,0,0,0,0,0,0,0,0,0,0,20812,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1803,966,0,17700,0,0,654,19109,0,51655,0,0,0,0,0,
-10470,1584,0,0,0,0,0,0,0,2506,0,0,25159,4303,0,0,0,395,15879,0,0,0,0,0,0,0,0,0,0
-,1352,6535,0,19652,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4722,7909,0,0,0,0
-,30152,0,0,64742,0,0,0,0,0,0,2153,9125,0,0,279,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,41894,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,1328,17030,0,0,0,0,0,0,0,54151,0,0,0,0,1775,54535,0,0,0,0,31624,0,0,0,
-7150,0,0,0,0,0,0,0,1840,35943,0,0,0,0,0,56455,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-64486,0,0,0,51174,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4134
-,0,0,0,0,0,0,0,0,0,0,0,17092,0,0,0,0,0,0,0,0,0,0,0,0,12,16134,19883,39943,10281,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44711,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-14125,2407,0,0,0,0,0,0,0,0,0,0,26921,0,0,0,0,0,22188,0,20810,10053,0,0,0,0,0,0,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29220,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28170,0,15208,0,0
-,32517,5736,19271,3562,10534,0,0,0,59655,0,0,0,0,27084,60422,0,0,24969,0,0,0,
-2636,0,0,0,0,26277,0,0,0,0,0,0,0,0,0,0,0,30596,3594,0,0,0,8362,14565,0,0,0,0,0,0
-,10793,12326,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5906,59686,0,0,23081,517,0,15556,0,0,0,
-8486,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19877
-,0,0,0,0,0,0,0,0,7497,0,0,26085,0,0,23784,63591,6568,6310,0,0,0,0,0,0,0,0,0,
-10054,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7018,14470,18858,0,5641,10660,0,0,0,0,0,0,0,
-35526,1515,0,0,0,0,0,0,0,0,0,0,0,27656,0,0,9606,0,39590,0,0,0,0,0,0,0,0,0,0,0,
-53926,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,232,4327,12649,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,0,0,0,0,0,0,0,20199,0,0,0,0,0,0,26730,0,0,0,19400,14695,0,31334,0,0,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19589,0,0,0,0,0,0,0,0,5064,11908,0,27333,0,
-0,0,0,0,0,0,47751,0,0,0,26662,0,0,0,0,0,0,0,55655,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,6245,0,0,0,0,0,0,0,0,23368,63911,0,0,0,0,0,0,0,0,1974,0,0,0,0,0,0,0,
-8520,24037,0,0,0,0,0,0,0,26279,0,0,0,22886,0,0,0,27782,0,30694,0,0,0,0,0,0,0,0,0
-,0,0,33703,0,0,0,30405,0,34598,0,51047,0,0,0,0,1908,0,0,0,0,0,0,0,0,0,0,1511,
-21897,0,0,0,0,0,0,51398,0,24870,0,32647,0,0,0,35015,0,0,0,0,0,0,0,11204,0,0,0,0,
-0,0,7758,57991,0,0,0,30949,0,0,22,15140,9162,0,0,0,0,0,0,25540,20136,7108,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16427,10789,9805,0,0,0,0,0,0,0,0,0,4680,0,0,52679,
-0,0,0,0,0,14884,0,0,0,16804,0,0,0,0,0,0,9578,5287,0,0,0,0,0,0,0,34054,0,0,0,0,0,
-19076,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7627,55719,0,39463,14446,58374,0,0,0,0,23465,
-15845,0,0,0,0,0,38534,0,0,0,17893,10922,0,7176,678,0,0,0,0,0,0,0,0,3113,46279,0,
-0,0,0,0,0,0,23334,0,0,18088,23268,0,62342,0,0,0,16613,0,0,0,0,0,0,0,0,0,38182,0,
-0,0,0,0,0,25292,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10344,71,6446,0,0,1893,0,0,
-1106,0,28680,30756,0,41126,0,0,1492,0,15341,0,0,0,0,17575,0,21220,0,0,0,0,0,
-25060,2088,21828,0,0,0,0,0,358,0,0,0,0,0,16708,0,0,0,1668,0,0,0,0,0,12260,0,0,0,
-0,0,0,0,0,4078,0,0,0,0,0,12713,6215,0,0,20329,0,0,0,0,0,0,0,0,0,0,31204,0,0,0,0,
-0,0,0,0,0,0,3732,0,1646,0,0,27460,0,34406,17128,14341,0,0,0,0,0,19527,0,0,0,0,0,
-0,0,0,0,0,6120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8551,21546,10212,3020,
-2951,0,17638,0,0,6985,44999,2218,8197,0,0,30472,63366,0,26660,0,0,0,0,0,0,0,0,0,
-0,0,0,1265,0,0,0,0,0,0,0,2610,0,0,0,11278,20295,0,0,0,0,0,19780,0,0,0,0,0,0,2353
-,10852,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5421,24292,0,0,0,0,0,0,0,0,0,0,0,0,0,34407,0,
-0,0,0,0,0,15432,20774,0,0,0,0,0,0,0,0,12360,10757,0,0,0,33126,0,0,0,0,0,0,0,0,0,
-0,0,29573,0,2343,0,0,0,0,0,63079,0,0,0,0,0,0,0,0,0,43015,0,16038,0,0,0,0,0,0,0,0
-,1480,25573,0,0,0,0,0,0,0,8839,0,0,0,0,0,0,0,24645,0,0,0,0,0,0,0,0,0,0,0,0,0,
-5063,0,0,0,0,0,45830,0,0,0,0,0,0,0,0,0,0,823,0,0,64039,0,0,0,0,0,0,0,0,0,0,0,0,0
-,15300,0,0,0,0,0,0,2924,46759,6760,19268,0,0,0,0,0,0,0,0,0,34182,0,0,3977,18149,
-0,0,0,32199,0,0,0,0,0,0,0,0,0,23524,25994,0,0,10343,0,0,0,9733,0,0,0,0,0,0,0,0,0
-,4740,0,0,0,0,0,0,0,0,0,16741,0,0,4626,23367,0,0,31400,0,0,3557,0,0,4234,0,0,0,0
-,0,0,28486,0,0,0,0,0,14213,0,57191,0,0,0,0,0,0,0,0,0,0,240,0,0,0,0,65318,29832,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29989,0,31846,0,0,8170,0,0,4421,27626,30884,0
-,0,20204,0,0,0,0,44614,534,20868,0,0,0,0,0,0,0,0,0,0,0,0,0,28710,0,10277,0,0,0,0
-,0,29511,0,19813,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27020,0,0,0,0,0,0,53094
-,0,35207,0,0,0,37542,0,61766,8584,8037,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12488
-,22757,0,0,0,0,0,0,0,0,0,0,0,0,0,23814,0,0,0,0,0,0,0,0,0,19973,0,0,0,63943,0,0,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36006,0,0,0,19012,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,8580,0,0,0,0,0,0,0,18021,0,0,0,0,0,0,0,0,80,1254,0,0,0,42630,0,0,0,0,0,
-0,0,16262,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2124,25479,0,0,0,0,16873,0,0,0,0,3142,
-0,0,18443,0,0,0,0,0,3917,0,8841,1190,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,20645,0,0,0,0,0,0,0,0,0,0,0,9284,0,0,24394,41351,0,0,0,42087,0,62566,0,0,0,0,
-0,0,0,0,0,0,6728,4199,0,0,0,0,25515,0,1231,0,374,15623,0,29956,0,14118,0,0,0,0,0
-,19047,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31718,0,0,0,0,0,0,0,0,0,0,0,20900,0,16743,0
-,0,0,28902,0,0,0,0,0,0,0,0,0,0,0,0,2578,0,0,0,0,0,0,0,0,0,13838,0,0,10052,0,0,0,
-0,7432,43783,17097,0,0,0,0,0,873,0,0,0,398,0,0,0,0,0,0,0,0,0,8459,23559,0,53030,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35750,0,4071,0,0,0,38662,0,41414,0,0,0,0,11656,0,0
-,0,0,0,4011,42695,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25353,0,0,0,0,0,0,0,27177,22372,0,
-0,0,0,0,30980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46278,3976,12711
-,0,0,0,0,0,0,0,0,0,0,0,20517,0,0,0,0,0,0,0,0,0,0,0,0,4072,11078,0,0,16553,2405,0
-,0,0,0,0,0,0,0,2670,0,0,0,0,0,0,32998,0,0,0,0,0,0,0,47046,0,30533,0,0,11050,9734
-,13129,0,0,0,0,23494,0,0,0,0,0,58310,0,0,0,57543,0,0,0,0,0,0,0,0,0,0,0,0,0,454,0
-,0,0,0,0,0,5163,59687,2220,0,0,0,0,0,0,29510,0,0,0,0,0,0,0,0,0,0,0,17316,0,20069
-,0,0,0,0,0,0,0,0,0,5319,0,0,0,0,0,0,0,0,0,27174,0,0,0,0,0,0,0,22949,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,19208,0,0,0,0,0,0,20933,0,0,6026,8742,0,0,0,17380,0,13127,2797,0
-,0,30116,0,0,5963,8004,0,57126,0,0,0,0,0,42854,14792,30759,0,24964,0,0,0,0,0,0,0
-,0,0,0,0,0,0,0,0,0,0,16933,0,0,0,0,0,0,15176,40839,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-788,30341,0,0,0,0,21036,24102,0,0,0,0,30123,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-22597,31531,26789,0,59559,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9352,29863,0,0,0,0,0,0,0,0
-,0,24551,0,0,0,0,0,0,0,20516,0,0,0,39462,3665,0,28265,0,8778,64262,0,57414,9132,
-0,0,18276,0,0,0,0,0,0,0,0,0,0,26344,30725,524,19751,0,13796,0,0,0,0,0,0,0,0,0,0,
-18155,0,12841,0,74,24998,13579,1061,0,64199,0,0,8776,0,0,60231,0,25412,0,0,0,
-59143,0,0,0,0,0,0,14344,1510,0,0,0,38374,0,0,0,0,0,0,0,0,13353,0,0,0,0,0,0,0,0,0
-,0,9446,0,0,0,0,0,0,0,32613,0,0,0,0,0,0,0,0,0,0,0,0,0,19844,0,0,0,0,14859,0,0,0,
-0,6662,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14154,0,29770,0,0,0,0,0,
-16520,2182,0,0,0,0,0,36102,3340,0,0,0,0,0,0,0,0,25189,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,15720,0,0,0,0,0,0,22758,0,0,304,0,3243,14117,0,0,0,0,0,0,0,0,0,0,5130,
-12679,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21733,10441,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,36103,0,0,0,0,0,23590,0,57479,0,0,0,0,0,0,0,0,0,0,0,0,10824,
-18372,0,0,0,0,0,35078,15722,12967,0,0,0,0,0,34599,0,0,0,0,0,0,0,0,0,0,0,0,0,
-53639,0,38630,0,0,0,0,0,0,31017,11333,0,0,0,0,19144,0,9513,0,0,0,0,0,0,0,0,56711
-,24042,0,1197,0,0,58502,0,0,0,0,0,0,0,0,0,8230,6121,18628,0,0,0,0,0,0,25290,0,0,
-0,0,0,1514,0,0,0,0,0,0,0,14378,9798,32363,0,0,0,0,0,9577,0,0,0,0,0,0,26788,0,0,0
-,0,0,0,330,10533,0,0,0,0,0,42246,0,0,0,0,0,0,5074,21028,0,38119,0,0,0,0,0,0,248,
-0,31176,62054,0,53287,0,0,0,0,271,0,0,0,0,0,0,0,0,0,0,0,0,0,9224,2117,0,0,0,0,
-15818,5607,0,52582,0,0,0,0,0,0,0,0,18248,24005,23018,0,0,0,0,0,0,0,0,0,0,0,0,0,
-427,0,0,39910,0,0,7080,11399,0,0,0,0,0,0,0,0,0,0,22220,57894,0,0,0,0,0,0,0,13156
-,0,1413,1007,0,0,0,0,21415,0,21543,0,0,0,0,0,0,0,0,0,41702,22538,9573,0,0,0,8806
-,0,0,6920,56359,0,0,0,0,0,0,0,0,0,0,0,42215,0,0,13708,0,0,0,0,0,0,0,0,0,0,16453,
-0,0,0,0,0,0,1582,1764,3282,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11653,0,0,0,0,12139,0,
-29482,31076,1673,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40262,0,0,0,33862,0
-,0,0,0,0,20996,0,0,0,0,0,4615,0,0,0,0,0,0,0,0,0,0,0,43943,333,19367,0,0,0,0,0,0,
-0,26821,0,32389,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4936,11687,0,0,0,0,0,0,0,0,0,10885,0
-,0,0,0,0,25926,0,0,0,0,0,0,15851,0,0,0,0,0,0,0,0,0,8360,0,17130,7942,0,11460,0,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,18150,14248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-22310,0,0,0,42758,0,0,0,0,0,0,0,0,29354,5574,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,0,0,0,0,0,0,31109,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11236,0,0,0,0,0,0,0,0
-,0,0,0,0,0,9156,0,0,1801,14023,0,0,0,0,0,62406,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-23620,0,0,0,0,0,0,0,0,0,0,31018,65510,0,0,0,0,0,0,0,26182,0,0,0,0,0,0,0,27717,0,
-0,0,0,0,0,0,46950,0,0,0,0,0,0,0,0,0,0,0,0,0,31108,0,11366,0,0,0,3717,0,0,0,0,0,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8552,6054,3339,0,0,0,0,51622,0,
-0,0,0,0,0,0,3718,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28358,0,2756,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,1462,0,0,27622,0,0,0,0,0,0,0,62502,14410,56743,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,12206,0,0,0,0,0,0,0,0,0,0,0,0,36550,0,38054,0,0,0,
-21221,0,0,0,0,0,0,0,27077,0,0,16906,0,12587,12101,0,0,0,0,0,0,10414,28775,21769,
-60167,0,56646,0,0,0,0,0,20740,0,0,0,0,0,0,5931,5351,0,65478,0,0,0,0,0,0,7977,
-52647,0,4868,0,0,0,55463,0,0,0,0,0,32197,0,0,0,0,0,13445,0,0,0,26631,0,0,0,0,0,
-11237,0,0,0,0,209,1285,0,0,1928,0,0,0,0,43334,23849,23172,0,0,0,0,0,0,0,0,24712,
-62439,8811,3463,20457,0,0,0,0,0,0,0,0,0,16008,56263,0,0,0,0,0,0,0,0,0,0,0,60358,
-22761,6565,0,0,30888,27686,0,0,0,17093,0,0,0,0,22121,0,0,0,7593,14182,0,28103,0,
-0,0,0,0,45126,0,0,0,0,0,0,0,0,0,0,0,0,0,31844,0,0,0,0,0,0,0,0,0,0,0,0,0,18500,0,
-0,0,0,28202,0,0,0,0,0,0,0,0,26308,0,29541,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-29572,0,0,0,21285,0,0,0,0,0,60839,0,0,0,0,0,30407,15949,2981,0,0,0,46439,0,0,0,0
-,0,23911,26505,25222,12811,5895,0,6343,0,0,0,0,0,0,0,0,0,0,0,31815,0,0,0,0,0,0,0
-,0,19688,10245,0,0,0,31301,26985,28964,0,0,0,0,0,0,0,0,27208,31172,0,0,0,0,216,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16292,0,0,0,0,0,8743,0,0,0,0,0,0,0,0,
-0,0,0,0,0,6438,0,0,0,33319,0,0,0,33286,0,0,0,0,0,0,0,0,0,22181,7499,24774,0,
-10756,0,44775,724,0,25768,25669,24873,5349,25257,0,0,54566,0,0,0,0,0,0,0,0,0,0,0
-,327,439,357,0,0,6536,8452,0,0,1802,0,0,61350,0,15045,0,0,0,0,0,0,0,0,0,0,0,
-38343,0,0,0,0,0,0,0,0,0,0,32491,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-22885,0,0,32073,0,0,0,9546,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27748,0,0,23176,0,0,0
-,0,0,0,0,0,0,0,0,0,24583,0,0,0,0,0,34118,0,0,0,0,2158,0,5586,30340,0,0,0,0,0,0,0
-,0,0,0,0,0,0,24452,0,0,0,0,2409,4390,0,24196,0,0,0,0,0,0,32264,26948,20587,0,0,0
-,2155,0,0,0,0,0,0,0,0,0,0,0,4328,26276,0,0,0,0,0,0,0,0,23564,0,12458,11367,0,0,
-25162,0,0,0,0,0,0,65414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32966,0,0,0,
-34662,0,0,0,0,0,39238,0,0,0,0,11400,10214,266,12452,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,15173,0,0,0,13668,0,13222,0,23364,0,0,0,0,0,11941,0,0,0,0,0,0,0,0,0,
-25575,0,0,0,57383,0,0,0,10308,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,2865,9287,75,0,0,0,0,0,0,0,0,0,0,21508,22380,59526,0,0,0,23589,0,0,0,51590
-,0,0,0,0,0,0,0,0,0,0,0,4645,3980,28295,0,0,0,0,0,12388,0,0,0,0,0,0,0,0,0,0,0,
-21734,0,17607,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41767,0,0,0,0,0,0,0,18436,0,0,0,0,0,
-0,0,21958,0,19430,0,0,1204,0,0,0,0,0,0,0,0,0,3240,55239,0,0,0,0,0,30660,0,0,0,
-28901,0,0,0,0,4716,0,0,0,0,0,0,0,0,0,0,0,11754,0,0,0,0,22086,0,22564,8749,0,0,
-28391,0,0,0,0,0,0,0,0,0,0,0,2886,0,0,0,0,0,0,0,29062,0,0,0,0,0,0,0,40358,0,0,
-15916,39526,0,13735,0,0,0,0,28938,0,407,4006,0,0,0,26916,0,0,0,0,0,27526,30280,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24586,0,24649,5126,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8684,0,0,0,0,0,0,0,23019,0,22377,18599,0
-,0,0,0,0,0,0,0,0,0,27593,9735,0,20196,0,0,0,0,28168,48423,0,0,0,0,0,31399,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,13892,0,0,0,0,0,17606,0,0,15242,29767,26378,17701,0,0,
-14472,0,4840,0,0,0,0,0,0,24708,0,9349,4330,0,0,0,0,0,0,0,16137,0,0,34854,0,0,0,0
-,0,0,0,0,0,0,0,25063,0,0,0,0,0,0,6603,12583,0,0,0,0,0,0,0,0,7433,29188,0,0,0,0,0
-,31270,0,0,22920,3143,0,0,0,0,0,23461,0,0,0,0,0,0,0,0,618,0,0,0,0,21381,0,11524,
-0,0,0,0,0,0,21004,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,312,23239,0,0,0,0,0,0,0,0,0,0,0,
-0,2313,0,0,40614,0,0,14825,0,0,0,0,0,0,46535,0,41190,7853,0,31656,0,0,0,0,0,0,0,
-0,0,3433,5255,0,0,0,0,0,0,0,33958,0,0,0,0,72,15493,0,0,0,0,0,0,0,36070,0,0,0,0,0
-,0,0,14724,0,0,0,0,0,29828,0,0,0,0,0,0,0,18822,20008,0,0,0,0,2438,2952,0,0,0,0,0
-,0,0,0,0,0,0,0,0,3342,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24420,0,19908,0,0,0,8101,0,
-17479,0,0,3530,0,8202,29319,0,0,1132,6789,0,0,23881,0,0,0,4810,0,0,46918,0,0,0,
-41574,0,0,0,0,0,0,0,0,0,48582,0,0,0,0,0,0,0,0,0,0,0,0,0,39334,0,0,0,26117,0,0,0,
-0,0,0,5100,0,0,0,0,0,23496,27813,4045,54918,0,0,0,0,0,0,6473,7428,0,0,0,0,6792,0
-,0,0,0,0,3560,32103,0,0,0,0,0,0,0,0,0,0,0,54790,0,0,6926,0,0,0,0,16518,0,0,0,0,0
-,20806,0,0,0,0,1841,3174,0,0,0,0,9612,18374,0,0,0,0,32744,0,0,9671,0,59879,0,
-23300,8073,0,0,14758,0,0,0,10342,0,0,0,0,0,0,24808,14759,0,0,0,0,0,0,5515,0,0,
-14852,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2354,23271,0,32740,0,0,0,0,0,0,0,0
-,0,0,18472,0,0,0,0,0,0,0,0,33190,0,0,0,0,0,0,0,0,8972,21669,0,0,0,0,0,0,0,0,0,0,
-0,25574,0,0,0,0,5096,0,14283,55367,0,0,0,0,0,0,0,0,0,12644,0,0,0,0,4651,0,0,0,0,
-0,0,0,661,0,0,13638,19466,0,0,0,0,0,31273,0,8010,0,0,0,0,0,3211,0,0,0,0,63430,0,
-0,0,0,0,15237,0,0,0,0,0,0,19018,2437,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14312,0
-,0,0,0,16836,0,0,471,35975,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,6023,0,0,0,0,0,0,0,0,11593,9639,0,0,0,55783,0,5700,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27908,0,26598,0,0,6667,6470,0,0,0,0,0,0,0,
-62534,0,0,0,0,16522,27911,0,0,10025,7172,0,0,779,0,360,17477,0,0,0,61991,7752,
-7717,1494,0,0,0,26569,40742,0,0,0,0,0,0,0,26406,10474,32196,0,0,0,0,0,50567,
-16521,11716,0,0,0,0,0,55558,0,0,0,0,0,0,0,0,0,0,0,61926,0,26436,0,0,0,0,4459,
-10598,0,0,0,0,0,0,0,0,0,0,0,9223,0,29318,0,0,0,0,0,60423,0,0,0,0,0,0,0,47078,0,
-50246,0,12612,0,0,0,0,0,0,0,61799,0,55015,0,21060,7309,0,0,0,0,0,11976,0,0,0,0,
-23527,0,0,0,0,0,0,10347,15942,0,34023,0,0,0,0,4969,0,0,0,0,0,0,0,0,28997,0,0,0,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36454,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3466,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19716,
-28872,0,0,0,0,0,22152,0,0,0,0,0,0,26342,0,0,0,9764,0,0,0,0,0,0,0,21798,0,0,0,0,
-13,6853,32136,0,0,0,0,0,0,0,750,0,0,54502,0,0,0,0,0,0,0,0,0,46183,0,0,625,22854,
-0,0,0,0,2061,23588,0,0,11049,56262,0,0,18538,1509,0,0,17258,4453,0,0,0,0,12429,0
-,0,0,0,8102,0,0,0,0,0,0,8074,0,23852,0,0,0,0,0,0,0,0,0,0,0,16136,3428,0,27876,0,
-0,0,7332,0,0,0,0,0,28900,0,0,2284,0,0,17573,201,1508,0,0,0,0,0,0,0,0,0,31365,
-27688,22565,0,0,0,5159,0,0,0,0,4584,42599,0,0,0,44422,1068,23173,0,0,0,613,0,0,0
-,12645,0,0,0,0,0,27076,6732,0,0,0,3913,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,0,0,0,0,0,0,22244,29992,15911,0,0,0,0,0,22982,0,0,0,0,0,0,0,50598,0,0
-,0,0,0,0,5161,1574,0,0,0,0,0,0,0,0,0,19108,0,0,0,35014,0,0,0,25956,29067,0,0,0,0
-,0,0,0,0,0,0,47079,0,0,0,0,0,0,0,0,0,0,1356,61927,0,0,0,64455,2122,64231,0,0,
-18763,0,0,0,0,0,0,0,0,0,907,34471,0,0,0,39078,0,0,1995,0,0,0,0,0,0,0,0,0,0,56518
-,0,0,0,0,0,0,0,0,0,0,0,0,822,0,15978,44423,0,0,3112,325,0,0,0,0,0,15397,0,0,0,0,
-0,0,0,0,0,0,1193,4294,4968,15559,0,46150,0,0,0,0,0,18917,0,0,0,0,0,0,9928,37543,
-0,0,0,0,13097,36999,0,0,0,15430,0,0,8424,29639,0,0,0,0,0,0,0,0,0,0,0,0,0,25734,0
-,0,0,0,0,0,0,0,0,0,0,0,0,40487,0,13284,0,11141,0,0,0,32388,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5298,57702,0,0,0,0,0,0,0,13060,0,0,0,0,0,0,
-8233,42278,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,36422,0,0,0,7972,0,0,0,
-18437,0,0,0,0,7406,0,0,0,9225,0,0,0,0,0,0,0,0,0,13865,47591,18220,53703,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2796,0,0,0,0,0,24940,17223,0,0,0
-,13221,0,0,0,0,0,0,0,0,0,0,15848,0,0,0,0,0,6122,1735,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,16968,18151,0,0,0,0,0,47494,0,0,0,0,0,0,26089,19494,0,0,0,0,0,15494,0,0
-,0,0,0,0,0,0,0,0,28809,0,0,0,0,42727,0,55174,0,0,0,0,0,0,0,0,0,0,0,20485,0,0,0,0
-,0,0,0,0,0,0,0,58598,0,0,0,0,0,0,0,0,0,0,0,0,0,15172,0,0,0,0,0,0,0,0,0,35302,0,
-48135,20972,33094,0,0,0,0,0,9765,0,0,0,0,0,0,0,0,0,39559,0,0,13736,6950,0,0,0,0,
-23658,8903,0,0,0,0,0,0,0,22662,0,0,0,0,0,58886,7468,0,0,0,0,0,0,0,0,64550,0,0,0,
-0,0,47622,0,0,0,50886,0,0,0,0,0,57606,912,0,0,0,0,0,0,0,0,0,1449,0,1169,0,718,
-46151,12104,0,0,0,0,0,0,48230,0,0,0,0,0,0,0,0,0,0,1259,0,0,33734,23208,62567,0,
-65158,0,0,0,0,0,0,0,0,0,0,28684,59878,0,0,0,0,0,0,0,0,0,0,25769,0,0,0,0,65479,0,
-0,0,0,555,22789,0,19748,1769,10246,8680,0,0,0,0,0,0,0,0,0,14250,0,5899,3303,0,0,
-0,0,0,0,0,0,21097,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21638,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,10795,0,0,0,16204,0,0,0,0,0,26986,2469,0,14660,0,0,0,0,0,45447,
-12234,3494,4555,10566,0,0,0,0,0,0,0,0,0,0,0,0,2801,0,0,0,15755,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,0,0,0,0,39654,0,0,0,0,0,0,6763,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-33574,0,10279,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63527,0,0,3912,0,0,7492,0,0,0,35142,
-0,0,0,0,0,0,17576,8103,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16713,4198,0,0,4782,0,0,0
-,0,0,0,0,0,0,0,0,0,0,0,16228,0,0,0,0,25961,20166,0,0,0,10980,0,0,0,0,0,14340,
-18922,14567,0,44199,0,0,0,0,0,0,0,18406,0,0,0,0,0,37606,0,0,0,0,0,0,0,0,0,20902,
-0,0,0,56358,0,38342,0,0,0,0,9514,36071,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21700,0,0,
-5266,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1134,0,1453,0,0,0,0,0,3882,0,0,0,
-0,0,0,0,0,4004,0,0,0,51910,0,0,0,0,0,23076,4648,0,0,0,31051,25351,0,0,0,22884,0,
-0,0,0,0,63975,0,0,2376,16997,0,0,2096,0,0,0,3373,7046,0,0,0,0,0,0,0,30726,0,0,0,
-0,20,0,13707,614,0,0,12840,3079,0,0,0,0,0,51046,3729,0,32680,0,0,0,0,0,24008,
-62759,0,0,4745,0,0,0,0,0,0,0,0,0,0,0,0,0,2414,0,0,44262,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,24937,0,0,0,0,0,0,0,0,19140,0,13575,0,0,0,0,0,0,0,39110,0,0,0,28036,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,4261,0,0,0,0,5992,0,264,0,0,0,0,0,0,0,13739,0,21928,0,
-0,0,0,0,0,0,0,0,0,0,4232,15110,0,0,0,0,0,0,0,0,0,30022,0,0,27977,0,0,0,0,0,24776
-,0,0,0,0,0,2962,0,0,0,0,0,0,26564,22441,0,0,0,0,0,13640,11205,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,19305,1894,0,0,0,0,0,0,0,0,0,0,9389,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14119,
-5224,135,0,0,0,0,0,0,0,0,0,25796,0,0,0,0,0,0,7470,0,0,0,0,63815,0,55654,0,0,
-12584,0,1524,33223,0,0,0,9895,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11624,
-0,0,0,5614,0,0,0,0,0,0,0,21320,0,0,53607,0,51206,0,0,0,25863,0,0,0,0,0,0,0,0,0,0
-,0,8964,1740,0,0,0,0,0,0,0,0,13476,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7975,0,
-0,3306,8134,0,8389,48,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25766,0,0,0,0,0,0,0,0,0,
-52166,0,0,0,0,0,0,0,0,0,0,0,0,0,21477,31112,31652,0,0,0,0,0,0,0,28452,0,0,0,
-44231,0,0,0,0,0,0,0,24805,0,0,0,0,0,0,0,0,0,0,12428,6471,0,0,0,0,525,17926,0,0,0
-,26919,0,0,18120,0,0,0,30024,0,0,0,0,0,0,0,0,0,0,29189,0,0,0,43559,0,0,0,0,0,0,
-19787,7557,0,59334,0,0,10184,6085,0,44039,0,0,0,0,0,0,0,11175,0,0,0,0,30440,
-63110,0,0,0,0,0,0,11017,0,0,0,0,0,0,0,0,27204,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,29126,0,0,0,0,0,0,0,0,0,0,0,0,0,0,622,0,5226,2727,0,15588,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4650,0,2675,0,0,32420,0,0,0,61511,0,0,
-5419,17829,2123,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38183,2640,0,11274,14533,1842,0,0,
-42663,12681,3430,0,11845,0,0,0,0,0,0,0,0,0,6533,0,0,0,0,0,54598,0,0,0,0,0,0,0,0,
-0,0,0,0,12616,38535,0,0,0,0,0,32229,0,0,0,54279,0,48614,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,31401,0,0,0,0,34310,0,0,0,22788,0,52134,0,0,0,0,0,0,0,23302,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,40678,0,0,0,51463,535,0,0,0,0,15525,0,0,0,0,0,0,4904,869,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,63718,0,0,0,0,0,0,0,0,1678,0,692,0,0,0,
-0,0,0,0,0,0,26216,0,0,0,0,0,29355,0,0,0,0,25095,0,0,0,0,4335,0,0,0,0,0,14538,0,0
-,0,0,0,0,0,0,0,27273,55014,0,0,0,0,0,27271,0,0,0,0,0,30468,0,0,0,0,18186,0,0,0,0
-,0,14345,0,0,0,2152,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58438,21034,0,23339,21318,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,21412,0,0,0,0,0,0,0,12869,0,0,4875,0,0,0,0,29191,0,0,0,0
-,0,0,1640,10247,0,14244,0,0,0,0,9867,0,0,0,0,0,12363,0,0,7653,0,0,4168,2663,0,
-4580,0,11143,0,0,0,0,0,0,0,30662,0,0,0,0,0,6724,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,13764,0,0,0,0,0,0,0,0,0,0,0,0,234,6821,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,0,0,0,0,25639,0,0,0,0,0,0,0,0,0,29958,0,3461,0,0,0,0,0,0,0,0,0,28324,
-18795,7013,12746,11655,0,37287,0,0,10953,7718,9705,0,0,0,0,0,0,0,0,0,0,46534,0,0
-,0,0,0,0,0,0,0,0,8137,17988,0,25156,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41415,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15784,6918,0,0,0,0,7019,10919,0,0,0,
-0,0,0,0,0,0,0,4171,55495,4940,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22440,19333,0,0,
-28136,0,6249,21317,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,53414,0,0,0,57318,0,0,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39303,0,0,0,0,0,19940,0,0,0,0,0,0,0,25543,0,0,0
-,0,0,0,0,0,0,0,0,0,2698,3911,0,0,0,26790,0,0,0,0,0,0,32424,0,0,18470,0,0,0,14726
-,29834,0,0,0,0,0,0,0,0,0,0,0,1000,4197,0,0,0,19366,0,0,0,39878,0,0,0,0,2185,8901
-,5288,9829,25000,0,0,0,0,0,0,1062,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35622,0,
-0,23048,62503,6506,0,0,0,0,0,0,0,13609,10438,0,0,0,0,0,0,0,0,0,0,7723,42119,0,0,
-0,0,0,13317,0,0,0,41606,0,27111,0,0,21194,11461,0,0,0,0,26856,58342,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,20940,48710,0,0,0,0,0,0,5227,0,0,0,0,0,10061,31300,0,0,0,19236,0
-,0,0,0,0,30277,13896,0,0,0,12876,13159,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,428,
-46951,13134,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15462,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,21668,0,0,0,0,0,0,0,0,0,0,0,0,2249,0,0,0,0,44967,0,0,0,0
-,0,0,3465,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24868,0,0,0,0,0,23909,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,2190,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16164,0,
-10437,0,0,5263,20102,20938,0,0,0,1192,1030,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,21385,4870,0,0,0,0,0,0,0,0,0,0,0,18596,0,0,0,0,1422,4038,2858,0,0,0,0,0,0,0,0
-,48998,0,0,0,0,0,0,0,0,6508,37350,0,0,0,0,0,0,0,0,17001,39431,0,0,0,0,0,30182,0,
-21445,7403,28164,0,51750,0,0,0,62631,0,0,0,0,0,0,0,31206,0,0,0,0,0,0,0,0,0,0,0,
-7751,0,0,0,0,0,0,0,0,0,13477,0,0,456,26693,0,0,0,0,0,0,0,0,0,0,0,0,14890,0,0,0,0
-,0,26697,22022,13225,27364,0,0,0,18884,0,0,0,0,0,0,0,0,3659,0,0,0,0,0,0,0,0,0,0,
-0,1448,5413,0,0,0,0,0,0,0,0,0,0,0,6340,0,0,18091,18725,0,0,0,0,0,0,0,0,0,0,0,0,0
-,22118,0,0,0,18981,0,0,0,0,0,0,0,0,0,29223,3724,0,0,0,0,43526,0,0,0,25668,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21545,9862,0,22692,32201,60646,0,7300,0,0,
-0,58887,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19460,0,0,0,0,0,0,0,0,0,50342,0,
-65255,4360,17286,0,0,0,0,0,0,0,28708,0,0,30025,60102,0,0,0,0,0,0,0,0,0,47014,0,
-31973,0,9572,0,0,0,0,0,0,0,18501,0,0,0,0,0,14597,0,0,0,53735,5228,22183,0,0,0,0,
-0,0,1554,24164,0,0,0,0,0,0,0,0,0,0,0,0,10827,0,0,0,0,34918,0,0,0,0,22252,0,0,
-46855,0,0,0,0,0,31207,0,0,10733,0,0,63334,0,0,0,0,8616,50119,20169,12678,0,0,0,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58087,20298,5,0,0,30920,0,0,0,0,0,0,0,296,13190,0
-,30663,0,0,18536,12228,0,6788,0,0,0,0,30890,21796,0,0,526,0,0,0,0,0,0,0,0,0,0,0,
-0,20965,0,0,0,0,2161,0,0,0,0,0,0,24038,0,0,0,0,13544,7398,0,0,32522,9605,0,0,0,0
-,3208,7590,0,0,0,43846,0,0,0,38663,0,0,0,0,0,39014,4142,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,6373,0,0,13676,0,0,0,0,30374,21288,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22791,0,0,0,0,0,37958,0,0,0,0,0,0,0,0,0,0,9452,
-9990,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4841,0,0,0,0,18820,152,0,0,0,0,0,13260,3334,0,0
-,24234,8422,0,17957,0,0,0,10244,0,0,0,0,0,0,0,0,0,0,0,7204,0,0,0,0,1201,26151,0,
-31173,0,0,0,0,0,0,0,0,0,0,0,0,0,64838,4203,7525,521,0,18888,37031,0,0,0,0,0,0,0,
-0,7082,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4490,12487,0,0,0,0,0,0,0,36615,0,0,
-0,14854,0,0,0,0,0,0,0,0,0,0,0,0,6539,13029,9704,38983,0,0,0,0,168,10405,0,0,0,0,
-394,25607,0,57063,0,0,0,0,0,0,0,0,0,0,16141,19878,0,0,0,0,0,0,0,0,0,29446,0,
-12036,0,0,0,0,0,6982,18572,0,24584,14535,0,0,0,0,0,0,0,0,0,0,16,0,21642,0,0,0,0,
-0,0,5254,0,0,0,0,0,0,0,0,1622,0,0,0,0,0,0,0,0,0,0,0,0,0,3853,9126,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,7241,10982,0,0,0,0,0,0,0,0,0,0,0,0,0,0,950,0,0,57990,0,0,277,0
-,0,0,694,36007,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42470,0,0,0,0,18409,
-51142,0,0,0,0,0,0,0,0,0,28646,0,0,0,30693,0,0,0,0,0,56295,5544,0,0,0,0,8518,8366
-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45670,0,0,
-9608,33062,0,0,0,0,0,0,0,0,0,0,0,18694,0,0,0,0,1672,23493,0,0,6955,7655,0,36134,
-0,0,0,0,0,0,0,0,23432,647,0,0,0,0,0,0,0,0,0,0,0,13382,0,0,0,19621,0,0,0,0,0,0,0,
-0,0,20228,0,0,2728,31495,0,0,0,0,29096,22213,235,35495,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,5348,0,0,0,0,8968,1989,0,0,1066,0,0,11492,5965,31367,0,0,0,0,0,0,0,0,0,0,0,
-18727,0,0,0,6757,0,0,10765,4646,0,36166,0,27943,0,0,26888,8420,0,0,0,0,0,0,0,0,0
-,29316,0,0,0,0,0,0,0,0,0,0,4975,0,0,0,14762,3111,0,0,0,0,0,43399,0,0,0,0,0,0,0,
-18980,0,0,0,0,0,44550,0,0,0,0,4051,0,0,0,0,37734,0,0,0,0,0,5188,0,0,0,0,0,24486,
-0,5989,0,41159,0,0,0,0,0,0,0,0,0,20326,0,0,747,6884,0,0,0,41798,0,0,3117,22919,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21032,0,0,0,0,0,0,0,0,9574,0,0,0,0,0,0,
-4302,0,0,0,0,0,0,0,0,0,0,0,21068,34630,0,0,0,0,0,64071,0,0,0,0,0,0,26667,7943,0,
-0,0,0,0,52934,0,0,17002,0,0,0,0,0,0,20294,0,0,0,0,0,0,0,0,0,27301,18347,7974,0,0
-,0,0,0,0,0,0,16874,0,0,0,0,45414,0,0,0,0,0,0,648,1575,0,0,0,31749,0,0,0,23301,0,
-0,0,0,0,0,0,0,0,0,0,0,15912,50535,0,0,0,0,1993,8582,0,0,0,0,0,0,0,38438,0,0,0,0,
-0,0,0,0,0,0,0,0,15850,6183,0,0,0,0,3402,0,0,27494,0,0,749,0,0,0,0,0,0,0,26025,
-29606,0,0,7144,19622,30504,0,0,0,0,0,0,0,0,21316,0,0,0,0,0,0,0,0,0,21444,0,0,
-1289,6919,0,0,0,0,0,0,8299,0,0,0,14090,35655,0,0,0,0,0,0,0,0,2377,15206,0,0,6028
-,4452,0,25508,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50310,0,0,0,0,1269,0,0,0,0,0,0,0,0,0
-,0,0,0,51014,0,0,0,0,0,0,0,9286,0,7429,0,0,28393,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,16680,452,0,0,0,0,0,23718,0,0,0,31750,0,0,0,0,0,0,0,0,3568,0,0,13604,0,0,
-0,0,0,25255,0,0,0,50982,0,56582,0,0,7467,0,0,0,0,30181,0,0,0,0,0,0,0,30564,7208,
-7845,0,0,0,0,0,0,7726,0,0,0,0,62182,0,0,0,41094,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,22695,0,0,0,0,0,0,17736,0,0,0,0,0,0,0,0,50054,0,0,0,14180,0,0,0,0,
-0,0,8974,0,0,0,0,0,0,0,0,23332,0,0,0,11140,0,0,0,0,0,0,0,24262,27145,9540,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,26537,45510,6062,3879,0,0,20233,25991,0,0,17803,0,0,0,0,0,
-13962,5508,16971,27013,7437,31494,0,0,0,0,0,0,0,0,0,0,4714,0,0,0,0,0,0,0,0,17189
-,0,0,0,0,0,27492,0,0,26953,0,0,0,0,0,0,0,0,0,0,41319,0,0,0,0,0,0,0,0,0,0,0,47430
-,19596,12549,0,0,0,8390,1006,0,0,0,0,0,0,0,0,0,0,24100,17577,4,0,0,0,0,0,22277,0
-,0,0,0,0,0,0,26692,0,0,0,0,0,24676,0,0,0,0,0,0,0,0,0,0,0,0,0,29477,0,0,0,21573,0
-,0,0,0,0,0,0,0,0,0,9864,14214,0,0,0,0,0,0,25771,5766,0,0,8909,8679,0,0,6861,
-16166,0,38887,0,0,0,0,0,0,12392,8678,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-52646,1354,2950,0,14692,0,0,10572,49830,0,0,0,0,0,0,0,0,3626,582,0,0,0,55750,0,0
-,0,30885,0,0,0,0,0,0,0,0,0,0,0,0,0,5830,0,0,2090,0,0,0,0,0,0,0,0,0,0,0,0,31142,0
-,0,0,0,0,10503,0,0,18825,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-57158,0,0,30792,63526,0,0,0,9863,16267,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,0,0,0,0,0,18824,0,0,0,0,0,0,19653,25388,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9292,0,0,0,0,0,0,0,0,0,0,36358,0,0,0,0,0,0,0,0,
-0,0,25480,23015,0,0,10440,6725,0,0,0,22436,24265,15109,0,0,0,62311,8906,34534,0,
-0,0,0,0,0,15913,1319,0,0,20296,1477,30760,0,25928,16772,0,0,1069,0,0,0,0,0,0,0,0
-,0,0,0,0,17029,0,31909,0,0,0,0,0,0,0,0,0,0,0,41638,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,41542,0,21478,0,0,0,9796,0,0,0,0,0,0,0,0,0,0,22187,58343,0,0,0,24295,0,
-0,0,0,0,61831,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2833,5829,0,0,0,62855,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,16676,0,0,0,0,0,0,13577,27431,0,0,0,0,21480,10501,0,16932,
-0,0,0,0,0,22918,0,48294,2574,2150,0,0,0,0,1897,4518,0,0,0,0,0,0,25064,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47942,0,0,0,0,10990,13767,
-25705,37863,21672,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43430,1712,0,0,0,0,
-18886,0,0,0,0,0,0,0,0,0,0,0,0,0,10535,0,0,0,0,0,0,0,15012,0,0,0,0,0,0,0,0,0,0,
-14734,0,0,55782,0,0,30824,10886,0,0,0,0,0,51302,0,0,8012,0,0,0,0,0,20680,6981,0,
-57415,11,0,0,18277,0,14564,0,0,0,32390,0,0,0,0,0,0,0,0,0,0,0,0,19113,5158,0,
-11172,0,16774,0,0,0,0,0,0,0,0,0,0,0,0,10315,13830,0,0,0,0,0,0,10410,7141,0,0,0,0
-,0,18116,0,0,0,44615,15403,13958,0,1540,14632,19525,24201,19781,0,0,0,24165,0,
-38951,0,0,0,0,0,6308,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17416,15749,3438,13255,0,0,0,0,
-0,0,0,0,0,0,0,32228,0,0,0,0,176,0,0,50566,0,0,0,0,0,0,0,0,0,0,0,0,0,21540,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,58982,0,0,0,0,0,0,0,0,0,5284,0,0,0,0,0,0,25897,28326,0,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15945,0,0,0,9804,293,0,0,0,0,0,0,0,13988,23082,4677
-,0,0,0,0,0,0,0,0,0,0,0,5670,0,0,0,0,0,0,0,44070,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,6405,0,30692,0,0,0,61702,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,45926,0,15398,0,0,0,0,0,0,4554,2692,0,0,0,0,0,32485,0,0,0,10084,0,0,0,0,0,0,
-24297,0,0,0,0,0,0,0,0,22790,0,0,0,55110,0,0,0,0,0,0,0,0,0,0,0,0,7112,0,31530,
-45255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40743,17226,22599,0,
-0,0,0,0,0,0,0,3695,0,0,0,0,0,0,0,0,0,0,56999,0,0,0,0,0,13799,3114,21287,1353,
-7591,0,0,0,8455,0,0,6824,0,0,0,0,0,0,0,14569,0,0,0,29000,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,19979,0,18376,0,0,0,0,0,0,0,0,0,0,0,0,11332,0,0,0,49863,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,2191,7527,23148,58022,0,0,0,30631,0,26565,0,0,0,0,0,0,0,0,0,0,0,0,754
-,0,0,15877,0,0,0,0,0,0,0,17510,7657,2821,0,0,0,0,0,0,0,0,0,41927,0,0,0,0,0,0,0,0
-,2569,34439,0,0,3790,0,0,0,15339,8775,0,0,0,0,0,0,0,0,0,0,0,15908,0,0,21419,8359
-,0,0,0,0,424,0,0,0,0,0,0,25318,8008,20551,0,0,0,45735,30058,30372,0,0,0,0,0,0,0,
-0,0,0,0,0,0,26180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31432,10567,0,0,0,0,
-17450,0,0,0,0,0,0,30310,0,38022,0,0,0,0,0,28932,0,0,0,0,0,43910,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,22180,12075,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22247,0,0,22826,
-12359,0,0,0,0,4105,50407,0,0,0,0,0,0,13581,28583,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,28936,0,0,0,0,0,17673,10310,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,905,57862,
-1580,0,0,0,0,58630,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13479,0,0,
-14153,13286,0,0,9259,0,0,0,0,0,6606,3524,0,0,0,0,0,6567,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,631,49255,0,0,0,0,0,42886,0,38215,0,0,0,0,0,0,0,0,17580,
-0,0,0,0,0,0,0,0,55046,0,0,0,0,0,0,0,0,0,10213,0,0,0,0,3604,37767,0,0,0,0,0,0,0,0
-,0,0,0,30950,0,0,0,0,0,0,0,0,0,62087,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23528,0
-,0,0,0,0,0,0,0,0,28715,4229,0,0,0,0,0,0,0,0,0,0,1226,26820,0,0,0,12133,6984,261,
-21130,32548,0,0,0,0,0,0,3565,12390,20713,28071,0,0,1706,25287,0,0,0,0,0,0,0,0,
-14670,0,0,0,0,0,0,30534,0,0,0,12615,0,43750,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28228,
-0,0,0,0,0,0,0,45095,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1224,3975,10954,6375,0,0,0,0
-,0,0,0,0,0,0,23180,20100,0,0,0,0,25736,8519,0,0,0,0,0,6663,0,2534,0,0,0,0,0,0,0,
-0,23720,0,0,0,0,0,0,0,0,0,0,19398,0,47814,26281,49702,0,0,4332,12965,0,0,5704,
-3206,0,0,0,0,0,0,0,0,0,0,0,0,0,15396,0,0,0,44102,0,0,0,0,0,0,0,0,0,0,0,0,0,25317
-,1064,39271,27433,0,14952,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14308,0,0,0,0,0,0,2763
-,4100,0,0,0,0,0,0,18792,0,0,0,22154,32583,0,6244,0,0,0,0,0,0,0,49478,0,0,0,0,0,0
-,0,0,0,0,0,21894,0,0,11048,0,0,0,0,0,0,11685,0,53862,0,0,15114,0,13870,0,0,0,0,0
-,0,0,919,0,0,0,31916,0,22570,101,0,0,0,0,0,0,0,0,0,7333,0,0,0,0,3272,0,0,0,0,
-27718,32712,0,0,0,0,0,0,0,0,0,1782,0,3688,0,0,0,0,29862,0,0,0,0,0,0,0,22469,0,0,
-0,0,0,0,0,55302,850,15492,0,0,0,5927,19786,13350,0,25702,0,0,0,0,0,0,0,0,0,0,0,
-40390,0,0,0,0,0,0,0,0,0,0,0,0,0,20260,0,0,0,0,0,0,0,0,0,0,0,0,0,15335,8394,0,0,0
-,0,0,0,26566,0,0,0,0,843,2245,0,0,0,0,0,0,0,0,6959,0,20488,1638,0,0,11533,50759,
-0,0,0,0,0,20871,0,0,0,0,0,24519,0,0,0,0,9544,23591,0,0,0,0,0,0,0,0,0,0,20969,
-7109,29001,0,0,32422,31720,64294,0,0,0,0,16106,0,0,0,6930,4933,0,0,0,22917,0,
-27015,0,0,0,0,19880,8070,0,0,0,0,23945,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3310,0,87,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18439,0,0,0,20742,0,0,0,10597,0,0,0,0,0,0,
-0,0,0,0,0,0,20236,0,0,0,16584,3429,0,0,0,0,0,0,0,0,27241,0,0,0,0,16132,0,0,0,0,0
-,0,0,0,0,0,0,0,244,28261,0,0,0,0,0,0,0,29509,0,0,0,0,0,0,0,0,2921,31781,0,0,0,0,
-0,0,6408,4196,344,0,0,0,0,0,0,0,0,0,0,0,0,0,11689,45863,0,0,0,0,906,3301,0,0,
-25544,32421,0,0,0,0,0,0,0,0,1260,61607,0,27302,0,0,8682,16614,0,0,0,0,10830,0,0,
-9604,15049,13413,0,0,0,0,0,0,26761,0,0,0,0,0,0,61990,0,0,0,0,0,12580,0,0,11432,0
-,0,0,0,0,22507,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12389,0,0,0,0,0,0,
-2408,22661,14507,43239,0,9700,0,0,24714,0,0,0,0,0,0,0,0,23972,0,0,0,0,0,0,0,0,0,
-0,0,0,0,34086,0,0,22955,7238,0,0,0,0,0,28485,13806,20038,0,0,0,0,22602,0,0,0,
-1645,22340,0,0,0,0,0,0,0,0,0,0,0,26502,0,0,554,0,0,0,0,61735,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,0,0,2694,0,0,0,0,0,0,0,0,0,0,0,0,0,0,883,27879,15948,0,3242,57382,0,0
-,0,0,0,0,13930,0,0,0,0,0,30922,0,4137,52615,0,0,0,0,0,0,0,0,0,0,0,0,0,31911,
-16072,0,0,0,0,0,0,0,0,0,0,0,0,26340,0,61671,0,0,0,0,3145,56199,0,0,0,0,0,0,0,0,0
-,0,0,0,280,0,5131,33479,0,15751,0,0,0,0,0,0,4136,1446,0,0,0,0,0,0,11304,17863,0,
-0,0,0,0,25125,0,0,0,36646,6057,0,0,0,855,11301,0,0,0,0,0,64774,0,0,0,19397,0,0,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,1040,27367,0,0,0,0,0,0,0,0,0,0,0,0,0,64358,0,0,178,
-132,0,0,14763,24455,0,0,0,46374,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46246,0,0,0,37382,
-0,0,0,7462,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8166,0,0,6921,0,0,0,9163,0,0,0,119,
-0,0,0,23146,17156,0,0,0,0,0,9127,0,0,0,17927,0,0,0,0,0,22084,0,0,0,0,0,39879,0,0
-,2035,0,1067,0,0,0,0,0,16652,59591,0,0,0,0,0,0,0,0,0,0,0,0,20171,0,0,0,0,17733,0
-,0,0,0,0,32037,0,0,0,0,0,14277,0,0,0,0,0,0,0,42022,0,0,26793,20358,0,0,0,0,0,0,0
-,0,0,0,0,0,0,0,0,0,8907,0,0,0,0,0,0,0,0,27780,0,0,0,0,32330,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,39399,0,9732,0,16199,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,854,0,2984,45063,25418,26980,22539,0,9133,3653,15528,28743,4649,0,616,
-65127,0,0,0,61863,0,0,0,0,0,0,0,55303,0,0,0,0,0,0,0,0,23880,0,0,0,0,0,0,0,31848,
-62854,0,0,0,0,0,0,0,0,0,0,0,49606,0,27974,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,32580,0,0,0,26052,4043,0,0,40454,0,0,26056,30565,0,0,0,0,0,0,0,31398,0,0,0,0
-,0,0,0,0,29288,1797,0,0,3220,0,0,0,0,0,0,0,0,0,20427,0,0,0,0,23621,0,0,0,0,0,0,0
-,0,0,24261,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35591,0,0,6862,0,0,0,4265,0,6285,
-5383,0,0,0,0,0,36870,0,39847,0,0,17224,5414,27882,58118,0,0,13224,4262,0,0,0,
-31302,0,0,1388,2982,11881,0,0,0,0,0,0,16837,809,0,24140,10724,0,0,0,0,5835,0,0,0
-,0,0,0,0,0,0,0,0,1256,19237,0,0,0,0,0,0,0,5796,11848,0,0,52870,11464,0,0,0,0,0,0
-,0,0,0,5645,9158,0,25223,0,0,0,0,0,39142,24968,8135,32104,28678,0,0,0,46311,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23820,0,0,0,0,0,4050,0,1323,25220,0,0,0,20133,0,
-0,0,0,0,0,0,0,0,0,0,9381,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,0,0,13444,1198,60806,0,0,0,0,17356,50247,30632,0,0,0,0,0,0,0,11944,
-999,0,0,0,0,4010,10404,0,0,0,0,0,0,10346,0,0,49510,0,0,0,0,0,0,0,0,0,0,0,0,0,
-38919,0,0,0,0,0,0,6351,60966,20137,487,0,0,0,0,0,0,655,2406,17387,43303,0,0,0,
-17063,0,0,213,0,0,0,0,0,0,17221,0,0,0,0,0,0,0,0,0,0,0,10820,0,0,0,0,369,6,0,0,
-9098,21093,0,31653,0,0,0,0,0,0,0,0,0,27143,0,0,16234,0,0,0,0,0,0,0,0,6020,31723,
-28293,0,0,0,0,1936,30695,0,0,0,0,0,52902,0,0,29512,10791,0,20420,0,0,16010,0,0,0
-,0,0,0,0,0,0,0,0,5324,0,0,0,0,0,0,0,0,0,0,0,0,13383,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,24328,0,0,0,0,0,0,40870,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,24648,0,0,0,0,0,0,0,7786,2852,0,0,0,0,0,0,0,0,0,44678,0,17925,0,0,105,53062,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18762,0,0,40679,0,0,0,16165,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,20390,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62310,1322,
-14247,0,0,0,0,0,0,0,0,1832,6052,0,0,11882,0,0,0,0,17668,0,28262,0,29542,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28007,0,0,0,57223,
-1585,0,0,0,0,0,0,0,0,0,0,0,21162,0,0,62247,0,0,0,0,0,25414,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,0,0,0,0,0,0,0,36326,0,0,0,23845,0,0,0,0,0,0,0,2693,0,0,0,0,0,0,0,
-13125,0,31236,0,0,0,0,0,22502,0,0,0,0,0,0,5994,10309,0,0,0,7269,0,0,0,0,17929,0,
-1011,44647,0,0,0,0,0,14919,0,0,0,0,20586,5350,0,0,0,45702,0,13189,0,0,0,0,0,0,0,
-0,0,35782,17992,0,0,0,0,0,8203,0,0,0,0,0,0,56678,0,0,0,0,0,38087,4233,0,2127,0,0
-,0,0,0,0,0,0,0,0,10148,0,0,0,2021,0,0,0,0,0,0,0,47206,0,0,0,0,0,0,0,9220,0,0,0,0
-,19465,0,0,0,0,0,0,0,0,39206,0,38055,0,0,0,0,0,0,0,46982,0,0,0,0,0,22054,3850,0,
-0,0,0,0,0,0,55,0,10542,0,0,0,0,7239,0,0,0,0,0,59367,0,0,14761,0,0,0,0,43079,0,0,
-0,0,0,2726,0,0,9582,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37478,0,
-0,0,31364,0,0,0,0,0,0,0,0,20393,8933,0,0,0,0,0,9380,0,0,0,0,16905,549,0,0,0,0,
-182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1558,0,0,0,0,0,0,0,19242,0
-,0,0,0,0,0,24933,0,6276,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42310,23595,
-24068,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13191,6158,2567,0,0,268,47047,0,0,0,0,0,0,0,
-0,0,27940,0,0,0,0,0,26726,0,0,0,0,8200,1222,31562,0,0,0,0,0,0,0,0,0,2922,8231,
-8904,29157,0,0,0,0,0,0,0,0,23976,4836,0,0,0,0,0,0,0,0,0,0,0,0,31658,0,0,31685,0,
-0,2889,6213,0,0,0,0,0,13605,0,0,0,0,0,24772,0,0,0,0,0,0,0,0,0,0,20684,26468,
-24075,0,0,0,21193,0,715,679,0,0,0,0,0,0,3050,7654,0,0,0,13798,0,0,0,0,15,27973,0
-,0,8491,2086,0,0,0,43206,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60391,0,0,0,0,0,0
-,0,25892,0,22276,0,34374,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20165,0,0,25672,0
-,0,0,1811,24839,0,31044,0,0,25513,0,0,0,0,0,12810,0,0,62438,0,0,1325,0,364,3782,
-0,0,0,0,0,0,0,0,8042,19687,0,0,0,33415,0,0,0,0,0,0,0,0,0,0,0,7205,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,11844,0,0,0,0,3341,1543,6698,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,0,0,0,0,0,0,0,29766,0,0,0,0,0,0,0,0,0,0,0,41158,0,24294,0,3844,12329,
-0,0,0,13738,0,0,0,0,0,0,0,0,26245,0,0,0,0,0,0,6378,0,343,4838,0,0,0,24358,11688,
-0,0,0,0,0,0,0,0,0,1489,34759,0,0,0,0,363,51974,1878,11013,0,0,32265,59782,0,0,0,
-28421,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22756,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14089,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,29257,61222,0,30661,0,28327,0,0,0,0,0,0,0,0,0,0,0,0,0,
-27108,8843,0,9673,2084,0,0,0,16327,0,48455,0,0,0,0,0,0,4876,9316,0,0,0,0,0,0,0,0
-,0,0,0,0,9035,18852,0,0,0,0,0,0,0,0,0,0,0,0,0,4164,0,0,14827,1349,0,0,0,0,0,
-11909,0,0,0,0,0,0,0,0,0,21765,0,0,0,0,0,0,0,0,31272,63910,0,0,0,25924,0,0,0,0,0,
-0,0,0,0,44487,0,0,0,20612,0,0,27754,31428,0,0,0,0,0,0,0,17287,0,3943,0,0,0,63302
-,0,0,0,0,25256,19942,0,55142,0,39046,0,0,0,0,0,0,0,15367,0,0,0,0,0,0,0,0,0,0,0,
-28422,0,0,0,0,0,0,0,0,0,0,0,0,9576,63847,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,25226,5734,0,0,0,0,0,0,13801,4997,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,0,43942,1270,2566,6284,0,0,16230,0,0,0,20678,0,0,0,0,0,38855,0,0,0,0,
-29643,0,0,0,41,3655,0,0,0,0,0,14276,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,15686,0,0,0,15718,0,50694,0,0,16232,8007,0,0,0,5060,
-329,11591,51,0,0,0,0,0,0,0,0,0,13065,7302,27530,15366,0,24934,0,0,0,17828,0,0,
-4552,6311,0,0,0,0,0,0,0,0,0,0,0,47686,368,12103,10122,33830,0,0,599,18534,9579,
-49479,0,5668,0,0,0,0,0,0,0,0,0,13157,0,0,0,0,23274,14055,0,0,0,0,0,48903,0,0,0,0
-,0,0,1871,0,15434,0,0,0,16174,62470,0,0,0,0,0,0,0,0,0,0,0,7749,0,0,0,0,0,0,0,
-30501,0,0,0,0,25675,0,0,0,0,0,0,0,0,0,0,9285,0,0,25323,1669,0,0,0,0,0,0,0,0,0,0,
-0,3588,0,0,0,0,0,32902,0,0,4426,0,0,0,0,57959,0,0,0,0,0,0,29898,58278,0,0,0,0,
-11880,1220,0,0,0,41479,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23141,0,0,0,0,0,0,0,0,0,0,0
-,0,0,42566,0,0,0,0,0,0,0,40167,9484,3493,0,0,0,0,0,21126,0,0,0,0,8649,18918,0,0,
-0,0,0,0,0,34886,2601,0,0,0,0,12518,0,0,0,0,7976,10311,0,0,0,0,0,0,0,45190,0,0,0,
-0,0,0,0,0,0,0,16842,20229,0,0,0,0,0,0,7528,4614,0,0,0,0,0,30086,0,0,0,1671,0,0,0
-,0,0,0,0,0,0,0,0,0,0,0,9896,6277,0,0,0,0,0,61191,0,41287,0,21956,0,0,20010,0,0,0
-,0,0,0,0,0,0,0,0,13195,0,0,0,0,1381,0,0,0,0,365,30951,24268,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,7044,0,0,0,0,0,0,0,0,0,0,27944,359,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,28487,0,0,77,0,0,0,0,0,0,0,0,56775,12586,8421,0,0,0,0,0,0,26185,14599,0,0,
-8040,5702,12585,3109,0,0,0,0,0,21574,5388,0,0,0,0,0,0,0,5106,52454,0,0,0,0,0,0,0
-,0,1907,29895,0,6116,0,0,0,0,11081,5285,0,28069,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4104
-,0,0,0,0,0,0,41511,0,0,0,0,0,0,5262,0,0,0,503,4231,7720,34343,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7304,10374,1718,0,0,29127,0,0,0,0,0,0,0,0,23497,
-22567,6952,2340,0,0,0,0,0,0,0,0,20360,12453,0,45094,0,0,0,0,0,28582,0,0,0,0,680,
-0,0,0,0,0,0,0,0,0,0,0,0,0,23084,0,0,0,30696,0,0,0,0,45862,0,0,0,0,0,0,0,0,0,0,0,
-0,5580,6053,0,0,0,0,0,0,0,0,0,0,712,70,0,0,26091,11335,0,0,0,0,13612,0,13160,
-1926,435,51559,0,0,0,0,0,0,0,0,0,0,0,0,0,47302,19083,0,0,12742,0,1607,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,6155,37095,0,0,0,0,0,18948,7146,0,0,0,0,0,0,0,7848,
-2055,0,0,0,0,8910,0,19336,0,0,48070,8490,0,0,0,0,0,0,0,9932,56423,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,4133,0,0,0,0,0,0,0,0,0,43398,0,0,0,0,0,0,0,0,16173,0,0,0,0,0
-,0,0,32011,0,0,30918,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26854,0,0,0,0,0,0,0,0,0,0,0,0
-,0,20389,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18889,0,0,0,0,8965,0,0,0,44358,0,0,0,8997,0
-,34055,0,0,0,0,0,29350,0,0,501,17767,0,0,32457,60262,0,0,0,30886,0,0,3757,1063,0
-,0,0,25637,0,0,0,0,0,28068,0,26374,0,0,0,0,0,0,0,0,0,0,0,11684,0,0,0,0,0,0,24779
-,229,0,13766,0,0,7402,11525,0,0,0,0,0,0,0,0,26313,23686,0,0,29736,47527,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27268,0,0,0,0,553,0,0,0,0,0,0,32038,0,0,0,0,1135,
-26596,0,0,12300,14631,0,0,0,43238,0,871,0,0,31496,0,8457,17669,0,12836,0,0,0,
-22726,0,38758,0,0,375,6564,0,0,0,0,0,0,0,0,0,0,0,0,170,18535,0,22948,0,0,32360,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,25764,0,0,0,0,0,0,0,0,0,0,0,15652,0,0,0,32774,0,0,0,0
-,0,0,0,0,0,28551,0,0,0,0,0,0,0,0,0,0,0,0,15145,0,0,0,21100,27654,0,0,0,0,0,0,
-4874,26215,0,1639,0,0,0,0,0,0,0,0,0,0,4169,0,0,0,0,0,7336,0,0,0,0,21572,0,0,0,0,
-0,0,0,0,0,24644,1675,2533,0,0,0,53318,0,13094,0,0,0,0,0,0,0,6246,0,22020,0,0,0,0
-,0,0,0,0,0,0,0,28453,5576,5124,0,0,0,0,0,0,0,0,0,0,0,0,0,27910,0,29382,18216,
-8583,0,0,0,39174,0,43558,0,0,0,0,0,0,0,0,0,11973,0,0,0,0,0,23397,0,0,0,0,6091,0,
-0,0,0,0,0,0,6474,16197,14217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,26728,0,567,48839,0,0,0,0,0,15271,0,0,31818,43974,2450,0,0,0,0,0,0,0,
-11368,9191,0,44454,0,0,0,0,0,0,14568,12293,0,0,0,8453,0,0,0,0,0,0,0,0,0,0,0,0,
-32040,0,0,0,0,0,0,0,0,0,0,0,0,902,0,0,0,27236,5612,11495,0,0,0,0,0,0,0,0,9194,
-23684,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27430,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-26217,44870,0,0,0,0,0,0,5581,7173,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-52775,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20968,18340,0,0,0,0,0,0,0,0,4107,11239
-,0,0,0,0,0,0,0,0,0,0,0,29381,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21990,0,0,0,0
-,0,0,0,0,0,48806,0,0,0,32292,0,0,0,0,0,0,0,10884,0,0,0,0,0,0,0,0,0,0,27562,0,
-5643,0,0,0,0,0,0,0,0,0,3089,31525,0,19684,0,0,0,0,0,0,0,61415,0,0,0,0,0,36198,0,
-0,0,0,0,0,0,7908,0,0,0,0,872,743,0,0,0,0,0,0,0,0,1229,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,32484,0,0,0,0,0,34822,0,0,0,0,0,50726,0,0,0,0,7274,0,0,0,15304,
-11526,0,0,0,3047,0,0,0,0,0,0,22376,0,0,0,846,0,0,0,0,35815,0,0,0,23652,0,0,0,0,0
-,0,0,0,0,0,0,0,0,0,0,0,23721,2148,0,0,0,0,0,0,14856,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,1358,0,3082,0,0,0,848,10949,0,0,0,0,0,0,6504,0,0,14372,0,0,0,0,0,0
-,0,0,0,0,8201,9958,0,0,0,0,0,0,24266,0,0,0,0,0,0,0,0,26469,0,0,0,0,18604,2053,0,
-33511,0,0,0,0,0,9222,0,0,0,0,0,44006,0,0,0,0,0,0,0,0,0,0,0,41895,0,0,0,0,0,0,0,0
-,12044,390,0,0,0,0,0,4935,0,48646,0,56102,3052,16070,0,0,0,0,0,0,0,8612,9320,
-38311,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,500,0,0,0,0,42918,0,
-32550,0,0,0,0,0,0,0,0,27434,57926,17064,0,0,46502,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,26760,6756,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,624,0,5000,0,0,0,0,32293,0,
-0,0,0,0,0,0,0,0,0,0,0,0,26246,0,0,0,0,0,0,0,0,23,7301,0,0,0,36199,0,40838,0,0,0,
-0,0,0,0,0,0,0,0,0,27178,57350,0,0,12457,9317,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16810,0,0,0,14510,0,0,0,0,21319,0,0,0,13508,17,
-11365,0,0,0,0,5291,0,8329,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27685,0,0,0,0,0,0,0,
-52006,0,0,0,7493,0,44263,0,0,0,0,0,0,0,0,9800,0,0,0,25676,61478,0,0,0,0,0,0,5773
-,0,0,0,0,41991,26057,0,0,0,0,0,0,0,0,0,0,22629,0,0,0,47783,362,1959,23468,0,0,0,
-10921,0,0,0,3150,0,0,0,0,0,0,0,0,0,0,0,32456,0,0,0,0,0,0,0,4559,3270,0,0,983,0,0
-,26343,0,33446,0,0,0,61767,0,48390,0,0,0,0,0,0,0,2790,0,39782,7849,0,0,0,0,0,0,0
-,1544,2183,0,0,0,0,0,0,0,0,4040,2471,20009,30020,0,0,11242,0,0,0,5578,53382,0,
-22631,0,0,0,0,0,0,0,0,0,0,0,12901,0,0,0,0,0,0,0,0,0,0,0,0,215,0,0,9030,0,0,0,0,0
-,0,265,1412,0,0,11626,3687,0,0,0,0,0,0,0,0,0,0,0,0,17449,24359,0,0,26729,40134,0
-,0,0,0,29768,61958,0,0,0,0,0,0,0,0,20908,0,0,0,0,0,11016,0,0,47462,21547,5926,0,
-0,14728,2983,24104,15301,0,0,0,0,0,32645,0,0,0,0,0,0,0,3300,0,0,0,15972,0,0,0,0,
-0,0,6634,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3076,0,30983,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,106,0,0,0,0,12775,0,0,0,0,7177,18022,0,0,0,0,0,22534,0,0,0,0,0,0,0,0,0,0,0,
-49894,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27560,0,0,0,0,30278,10668,23877,0,
-0,0,0,0,0,0,29124,0,0,0,0,0,0,0,0,0,0,0,0,0,20870,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,44582,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48454,0,0,0,0,6442,0,16330,22951,0,0
-,16904,0,0,0,0,644,0,0,0,40038,0,0,0,37222,0,0,0,9830,0,0,0,0,0,34919,0,0,0,0,0,
-0,0,0,0,0,0,13733,0,0,0,28196,0,0,0,0,0,19876,0,0,0,0,0,0,0,23558,0,11142,0,
-27781,0,0,0,0,13864,0,0,0,24682,47847,0,0,0,0,6890,0,0,0,0,0,3981,0,0,0,0,0,0,0,
-0,0,0,0,1772,0,0,0,0,0,0,0,3603,1991,0,27396,8652,0,18312,0,0,0,0,30054,0,0,0,0,
-0,0,0,11270,0,0,0,0,0,0,0,0,0,20708,0,0,0,0,338,0,0,0,0,0,0,0,7050,0,0,0,0,0,0,0
-,0,0,0,0,0,0,14862,0,0,3492,0,0,0,55878,0,0,0,16486,0,0,0,18119,0,0,0,0,0,0,2154
-,1284,0,0,23113,31751,0,0,29547,0,0,0,0,0,0,36647,0,0,0,0,0,0,0,0,0,0,0,18183,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,7913,0,0,0,0,20644,0,0,10508,0,0,0,0,0,0,0,0,0,0,0,0,
-43622,0,0,0,0,0,40966,0,0,0,0,0,0,0,0,0,0,246,901,11529,5191,0,0,0,0,0,0,0,0,0,0
-,0,24454,0,0,26665,27590,0,27397,0,0,0,0,0,0,23562,2949,0,0,30344,62214,0,47334,
-2026,18885,0,0,0,48678,0,0,0,22694,0,0,1972,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,15465,0,0,0,0,38822,0,0,0,0,945,32708,0,54791,0,14918,0,0,0,0,0,0,
-0,0,0,0,0,0,0,23396,0,0,0,0,0,0,5486,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7722,0,0,
-0,0,0,0,0,0,0,0,0,30856,64166,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35206,0,0,0,30535,0,
-0,0,0,0,0,0,0,0,62663,0,0,1096,17574,31820,0,0,14375,4402,27207,0,0,21448,4676,0
-,0,0,0,16585,5094,0,0,0,0,0,0,0,0,4845,0,0,32870,0,0,0,0,0,0,0,0,0,0,31466,0,0,0
-,0,31783,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4522,16039,0,0,0,0,0,0,0,0,
-0,14469,0,0,0,0,0,0,0,0,0,0,7464,4773,0,0,0,0,0,0,0,0,18636,0,0,0,25640,0,0,0,0,
-0,0,2244,0,0,11818,0,1168,0,0,0,0,0,0,0,6540,23079,13770,7719,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58150,528,
-34502,32682,0,0,12997,0,0,0,0,0,2214,0,0,0,0,0,58567,0,0,0,26375,0,0,0,0,0,0,0,0
-,0,26437,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,32005,22952,59047,0,13543,0,0,0,0,0,0,0,0,16328,0,0,33542,0,0,0,19782,0,0,0,
-16644,0,0,0,0,31688,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10276,0,0,0,
-0,0,0,0,36327,0,0,29480,0,0,0,777,12709,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27398,0,0,
-0,4455,9037,31397,0,9221,0,0,0,60487,20840,1796,0,0,0,0,0,0,0,0,8364,0,0,0,0,0,0
-,0,0,0,0,0,19752,44902,0,38566,0,0,18027,0,0,0,0,0,0,0,0,10662,0,0,0,0,0,11812,0
-,0,0,0,0,0,0,0,0,19910,0,0,0,45030,0,0,0,0,0,0,0,0,0,0,0,0,19978,5127,0,11620,0,
+BROTLI_INTERNAL const uint16_t kStaticDictionaryHashWords[32768] = {
+1002,0,0,0,0,0,0,0,0,683,0,0,0,0,0,0,0,1265,0,0,0,0,0,1431,0,0,0,0,0,0,40,0,0,0,
+0,155,8,741,0,624,0,0,0,0,0,0,0,0,0,0,0,0,66,503,0,0,0,451,0,0,0,0,0,0,0,835,70,
+0,0,539,0,0,0,0,0,0,0,0,0,113,0,0,0,0,718,0,0,0,0,0,0,520,0,1070,0,0,0,0,0,1515,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,610,0,0,750,0,0,0,307,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,964,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,999,0,0,0,0,0,0,0,0,
+645,75,0,649,52,282,0,200,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1621,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,211,225,0,0,687,718,0,0,110,0,58,0,0,0,0,0,0,345,0,0,301,0,0,
+0,203,0,0,1154,674,1949,0,0,0,0,0,0,0,0,0,259,0,0,0,0,0,0,0,1275,0,0,0,1231,254,
+0,0,0,0,0,0,0,277,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,248,0,0,800,0,0,0,29,
+116,100,490,0,0,0,0,0,1641,0,543,0,0,0,0,41,181,0,657,0,0,202,25,0,0,0,0,0,0,0,
+0,0,0,423,0,0,0,113,0,0,0,927,963,0,976,0,206,0,0,0,0,0,0,0,0,0,2002,0,0,0,0,0,
+0,0,0,0,0,0,696,0,1170,0,0,0,0,226,13,0,769,678,551,0,0,0,0,0,0,57,0,0,0,10,188,
+0,0,0,624,0,0,0,0,0,0,0,0,0,1941,130,0,0,0,0,378,269,0,0,528,0,1146,0,0,0,1105,
+0,1616,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,656,0,1940,0,0,0,0,0,173,0,0,0,0,0,0,0,0,0,
+0,0,457,342,810,0,0,0,0,620,0,0,0,0,0,0,0,967,95,447,406,0,0,0,477,0,1268,944,
+1941,0,0,0,629,0,0,0,0,0,375,0,0,0,1636,0,0,0,0,774,0,1,1034,0,0,0,0,0,824,0,0,
+0,0,0,118,0,0,560,296,0,0,0,0,0,0,0,0,1009,894,0,0,0,0,0,0,0,0,0,0,0,0,0,1474,
+366,0,0,0,0,0,0,0,0,0,79,1723,0,0,200,0,0,0,0,0,0,0,0,1759,372,0,16,0,943,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,258,0,0,900,1839,707,30,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,2004,0,0,10,115,0,50,0,0,0,0,0,0,0,0,0,0,520,1,0,738,98,482,0,0,0,0,
+0,0,0,0,0,0,701,2,0,0,0,0,0,0,0,0,557,0,0,0,0,0,0,0,0,0,347,0,0,0,0,572,0,0,0,0,
+0,0,0,0,0,832,0,0,797,809,0,0,0,0,0,0,0,0,0,0,0,528,0,0,0,861,0,0,294,0,0,0,109,
+0,0,0,0,0,0,0,0,1187,290,266,0,0,0,0,49,50,748,0,0,466,399,0,0,0,0,0,0,0,378,0,
+519,0,0,0,0,0,0,0,0,0,0,0,0,667,351,902,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,180,
+0,0,869,0,0,0,0,0,0,0,260,0,0,0,0,0,0,0,0,0,0,523,36,0,0,587,510,809,29,260,0,0,
+0,0,0,0,0,0,570,0,565,0,1464,0,0,0,0,0,0,10,0,0,787,399,380,200,0,0,0,0,516,0,
+844,887,0,0,0,0,0,0,0,44,0,0,0,305,1655,0,0,0,0,0,0,0,0,0,0,0,0,0,0,786,10,0,0,
+0,0,0,0,0,0,0,2031,0,0,0,0,0,684,0,0,0,0,0,1480,0,0,0,27,0,0,0,395,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,813,511,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,0,0,0,206,
+496,0,0,0,0,0,909,0,891,0,0,0,0,0,0,0,0,0,687,0,0,0,1342,0,0,0,0,0,0,0,0,0,0,
+160,41,0,0,0,0,0,0,0,0,0,0,0,1718,778,0,0,0,0,0,0,0,0,0,0,1610,0,0,0,0,0,115,0,
+0,0,0,314,294,0,0,0,983,178,193,0,0,0,0,0,0,0,0,0,174,0,0,0,0,0,0,0,0,0,0,848,
+1796,0,0,0,0,0,0,221,0,687,1660,0,0,0,0,262,0,0,179,0,0,0,0,0,66,0,773,0,352,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35,0,152,0,0,1197,0,0,0,0,0,0,0,0,0,0,0,0,560,0,0,
+564,0,0,0,797,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,556,0,819,0,0,0,0,0,0,0,0,719,544,
+637,5,0,0,0,0,0,0,0,0,0,0,0,101,0,1441,0,0,0,893,0,0,0,0,0,0,0,0,0,238,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1296,0,0,969,1729,314,60,0,0,0,0,0,1144,0,1147,0,0,0,0,0,
+0,0,0,0,0,437,1853,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,828,0,176,0,0,0,0,0,0,434,39,0,
+0,0,0,0,159,0,0,0,902,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,270,0,0,0,0,801,556,0,0,
+0,0,0,0,0,416,19,197,369,0,0,0,0,0,0,0,0,0,28,34,0,757,0,0,898,1553,0,721,0,0,0,
+0,1012,0,0,0,0,1102,0,898,183,0,0,0,0,0,0,0,136,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,247,277,0,0,0,435,0,0,0,0,0,1311,0,0,0,0,
+0,0,211,437,0,0,0,28,0,0,750,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2012,0,702,
+0,808,0,0,0,0,739,166,0,0,0,0,0,0,719,170,500,0,0,0,0,0,0,0,0,1500,327,0,0,450,
+0,0,0,1318,0,0,0,1602,0,0,331,754,0,0,0,0,0,1368,0,0,557,0,0,0,799,850,0,0,0,0,
+0,0,0,0,908,0,0,0,0,0,19,62,459,0,0,0,0,0,0,0,0,0,0,0,0,1802,0,0,0,0,0,0,0,0,0,
+1397,0,0,0,0,120,238,0,0,0,0,0,0,0,0,0,0,0,1324,0,0,0,0,0,0,0,0,602,201,0,0,164,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,615,0,0,0,0,0,0,0,0,0,0,0,0,0,1243,0,0,0,0,968,0,0,
+0,0,0,0,882,0,0,0,907,329,100,0,0,0,0,0,0,0,0,0,0,0,176,26,9,0,0,265,256,0,0,0,
+0,0,0,0,0,0,643,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127,610,0,0,0,0,973,2001,0,
+0,0,0,0,0,522,0,0,0,0,0,0,0,0,0,0,0,553,0,0,0,0,0,0,1582,0,1578,0,0,0,0,0,0,0,0,
+0,0,0,795,0,0,0,432,0,0,0,0,0,0,84,126,0,0,0,0,790,0,377,64,0,1529,0,0,0,0,530,
+1857,539,1104,0,0,0,0,0,0,0,0,0,0,0,0,977,0,0,0,34,0,0,0,0,0,0,0,0,0,0,0,24,26,
+0,0,918,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,183,379,0,0,0,0,0,0,0,792,
+0,0,0,0,0,0,0,0,0,1920,0,0,0,0,0,0,0,0,0,771,0,0,0,1979,0,901,254,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,140,0,0,0,0,0,440,37,0,
+508,0,0,0,513,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,533,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,752,920,0,1048,0,153,0,
+0,391,0,0,1952,0,0,0,0,0,0,0,0,0,0,126,0,0,0,0,640,0,483,69,1616,0,0,0,0,0,734,
+0,0,0,0,0,0,480,0,495,0,472,0,0,0,0,0,0,0,0,874,229,0,0,0,0,948,0,0,0,0,0,0,0,0,
+1009,748,0,555,0,0,0,0,0,0,193,0,653,0,0,0,0,0,0,0,0,0,0,984,0,0,0,172,0,0,0,0,
+0,0,0,0,83,1568,0,0,384,0,0,0,0,0,0,0,164,880,0,0,0,0,0,0,0,0,0,0,0,367,121,0,0,
+828,0,0,0,0,0,0,0,1541,0,0,0,0,0,0,0,343,0,0,0,0,0,0,0,0,561,57,0,0,0,0,0,0,0,
+926,0,0,0,0,827,0,194,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,0,0,0,0,0,0,0,
+0,0,0,896,1249,0,0,0,0,0,1614,0,0,0,860,0,0,0,0,0,0,0,0,964,102,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,899,0,569,0,0,0,0,795,2045,0,0,0,
+0,0,0,104,52,0,0,0,0,0,604,0,0,0,0,779,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,0,0,0,0,
+494,0,677,0,0,0,0,0,0,0,508,0,0,0,0,0,0,0,0,0,1014,0,957,0,0,630,310,0,0,0,570,
+0,0,449,0,64,537,0,0,0,0,0,0,0,244,0,0,0,0,0,0,0,0,0,0,0,0,0,0,702,1650,49,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,338,0,0,0,0,1279,0,0,0,0,0,0,0,896,0,0,
+178,0,0,0,0,0,0,0,0,0,0,0,0,0,808,695,0,0,0,0,539,1117,0,0,0,0,0,0,0,0,257,0,
+1003,0,0,0,1,448,0,516,0,0,960,0,125,4,0,1268,30,748,0,0,852,0,0,0,6,0,0,848,
+236,1385,862,1811,0,0,0,0,698,803,0,0,0,0,0,0,0,610,992,0,0,878,0,1847,0,0,0,0,
+0,0,0,383,0,1404,0,0,0,0,986,0,347,0,0,0,0,0,0,0,0,0,0,0,592,572,0,1411,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,606,0,0,0,0,0,0,
+0,0,0,0,0,0,0,1829,0,0,0,0,0,0,0,0,0,0,0,0,700,748,0,0,0,0,0,0,365,0,0,127,0,0,
+83,198,0,0,0,0,0,0,864,55,0,0,0,0,726,1752,0,0,0,0,0,0,0,0,0,0,0,0,0,1066,0,764,
+0,0,0,0,683,0,550,309,0,0,874,1212,0,0,0,1364,0,986,381,723,0,0,0,1573,0,0,0,0,
+0,1025,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1559,0,0,0,0,493,133,0,0,0,0,148,
+119,0,0,0,0,0,0,537,14,541,0,635,126,0,0,0,495,0,0,0,0,861,998,1009,0,0,0,0,0,0,
+0,359,368,0,0,0,0,304,1577,0,0,0,0,0,1107,0,0,0,0,0,929,0,0,0,1142,0,0,0,0,289,
+175,0,432,0,219,0,0,0,0,0,785,0,0,595,0,0,0,0,0,0,0,0,0,0,0,0,0,80,0,0,0,0,0,0,
+931,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1323,0,0,0,0,290,0,559,1751,127,0,0,0,
+934,1167,0,963,0,260,0,0,0,573,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+580,1689,0,0,0,0,0,0,0,0,0,1164,0,0,982,1922,0,63,0,0,0,0,0,793,0,0,0,0,0,0,0,0,
+0,0,0,0,0,67,790,0,0,0,0,0,0,0,0,0,0,391,443,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,271,0,0,0,0,0,0,0,0,0,0,0,1140,0,0,0,0,340,300,0,897,0,0,0,0,0,0,
+0,0,0,0,890,0,0,0,0,818,321,53,0,0,0,0,0,0,0,0,0,468,0,243,0,870,0,0,0,1765,121,
+0,0,0,180,518,0,822,419,634,0,0,0,0,0,0,0,0,0,898,0,0,0,0,454,36,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,806,0,0,0,0,0,0,0,0,0,0,0,0,1326,0,104,0,0,0,0,0,0,0,
+0,0,260,0,0,0,0,0,0,0,0,0,0,0,0,542,45,0,0,263,1516,42,0,0,0,0,0,468,0,1005,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,288,87,0,0,0,0,0,0,0,0,502,988,133,0,0,0,0,0,0,
+141,0,0,872,1842,0,0,0,0,0,0,0,0,261,619,0,0,0,0,189,246,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,678,0,0,0,0,0,0,0,0,0,0,0,0,285,35,0,517,0,0,0,0,0,0,0,0,0,0,
+540,214,667,0,74,0,0,125,0,0,0,0,0,761,131,0,0,0,0,0,0,0,0,0,0,0,0,0,333,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1338,94,0,0,0,0,0,0,0,0,0,0,0,0,449,0,646,103,
+86,641,2028,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,869,87,277,117,39,0,0,0,0,0,0,0,0,938,
+297,0,0,0,0,558,464,0,0,0,0,0,0,0,0,0,0,731,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1608,0,
+0,0,0,0,0,0,1429,0,0,733,1010,0,0,338,1656,0,0,0,1038,979,2010,0,0,0,0,0,0,0,
+1005,0,0,121,0,0,0,219,20,0,0,0,0,0,0,872,1440,0,0,0,683,0,1070,0,0,522,0,0,0,0,
+439,669,0,0,0,0,0,0,0,0,1245,0,0,0,0,0,1218,0,0,547,233,0,0,0,0,0,0,0,0,0,482,0,
+0,0,0,0,0,0,886,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,795,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,371,0,0,0,0,0,0,0,0,0,0,0,0,0,622,0,625,0,0,0,339,29,0,0,338,0,0,0,
+0,130,0,0,0,0,0,0,0,0,0,307,0,0,0,0,0,0,0,0,0,0,2044,0,0,0,0,0,0,0,0,308,770,0,
+0,0,0,0,1266,0,0,0,0,0,0,0,0,0,400,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,690,739,0,0,
+0,0,0,0,0,990,0,0,0,1831,0,0,0,0,0,0,0,0,0,0,0,0,0,613,0,0,0,0,0,0,0,0,0,0,0,0,
+0,763,0,878,0,0,0,977,0,100,0,0,0,0,0,0,0,0,0,463,0,0,0,0,623,318,0,0,296,463,
+137,0,0,454,0,0,0,1527,58,0,0,0,0,0,0,0,18,48,0,0,0,0,0,729,0,0,0,442,0,0,0,0,
+40,449,0,853,0,0,0,0,0,0,227,0,0,0,0,0,0,1491,0,0,0,0,0,0,0,0,0,0,161,55,0,450,
+0,1174,62,0,207,0,0,0,0,0,0,0,0,869,0,0,0,0,80,213,0,0,0,0,0,0,0,0,0,0,354,820,
+0,0,747,0,0,0,954,0,0,1073,0,556,0,0,0,692,0,191,0,804,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,831,162,0,0,35,0,0,0,0,0,0,0,0,1235,0,0,0,0,0,1234,0,0,
+0,0,0,0,0,0,0,0,96,0,0,0,0,0,0,0,149,0,0,0,902,204,0,0,833,0,287,366,0,0,0,0,0,
+0,992,2020,0,0,0,0,0,0,0,0,0,0,0,356,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,784,0,0,567,
+630,0,0,0,539,0,0,27,0,0,0,0,0,0,0,0,0,0,755,0,0,0,0,0,0,0,0,0,0,0,0,814,0,0,0,
+0,0,0,0,0,0,0,0,0,0,987,0,0,255,761,194,0,1086,0,0,0,0,0,0,1016,0,0,1396,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,562,271,913,0,0,0,0,0,0,0,0,320,153,45,475,0,0,
+0,0,0,0,0,713,0,327,0,0,0,0,0,0,604,552,3,359,0,0,0,0,853,80,0,0,0,0,0,0,0,2016,
+6,887,0,0,0,0,975,0,961,0,0,0,0,0,916,1891,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,100,101,390,708,0,0,0,587,983,512,0,0,0,0,0,0,0,0,0,0,0,645,0,0,0,851,0,0,0,
+0,0,498,140,217,0,0,0,1448,0,0,0,0,0,0,0,0,0,905,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+643,105,0,792,0,0,0,0,0,0,0,0,0,0,0,0,56,0,0,0,0,0,0,0,0,0,0,535,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1748,0,0,0,0,0,754,0,0,0,0,0,0,0,0,0,0,0,0,91,0,0,1565,0,91,792,
+939,3,370,0,0,0,0,95,0,0,0,0,551,7,619,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1150,0,
+0,0,0,0,0,0,0,0,0,0,0,0,671,0,0,0,0,0,888,368,149,0,0,105,1134,0,983,0,0,458,31,
+0,643,0,0,0,312,0,740,0,0,0,1642,0,0,0,0,0,0,0,236,0,0,0,0,0,0,0,59,68,0,0,0,0,
+0,867,795,0,0,0,0,970,1977,0,0,0,0,0,0,0,1148,0,775,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,970,0,0,0,0,0,0,0,0,0,665,71,0,0,0,0,827,0,0,0,0,0,0,0,0,0,
+0,479,0,0,0,0,0,0,0,0,99,607,0,0,0,0,0,0,0,1960,0,0,0,793,0,0,871,41,0,0,241,94,
+0,0,0,0,209,0,0,1497,0,0,0,0,0,0,0,0,0,98,0,0,0,463,0,0,0,0,291,0,0,0,0,0,0,0,0,
+0,0,984,0,0,0,0,0,205,0,0,0,0,0,0,205,42,0,801,0,0,0,0,0,635,0,0,533,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,371,0,1282,0,0,0,825,0,0,0,0,0,0,0,0,0,357,879,467,0,317,0,0,
+0,0,0,0,0,924,0,0,0,0,849,1795,0,0,0,0,895,1799,43,0,0,0,0,0,0,0,0,0,0,1820,0,0,
+0,0,0,0,0,525,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,110,0,493,0,174,417,0,0,
+0,0,0,583,733,0,0,0,0,0,0,481,215,0,0,0,0,477,0,0,0,0,0,0,0,0,308,0,0,0,0,0,0,0,
+0,297,126,0,0,361,1551,0,0,0,0,0,0,871,1807,0,0,0,0,0,1307,0,685,0,0,0,0,0,0,0,
+797,0,858,0,565,0,0,0,0,0,0,0,0,0,0,0,0,434,252,826,0,0,0,0,0,0,791,0,0,0,0,509,
+231,178,601,0,0,0,0,0,0,0,0,43,1591,0,0,0,0,0,1683,0,0,0,0,45,0,0,0,0,0,0,0,0,0,
+0,1120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,556,494,0,398,0,0,0,1030,0,0,0,0,0,0,
+168,0,0,0,0,0,0,0,0,0,0,973,0,642,0,0,0,0,0,0,0,0,0,1615,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,378,594,0,1093,0,679,112,0,0,0,0,1492,540,1374,714,
+1486,0,0,0,0,825,1511,0,0,0,0,0,0,0,0,0,0,0,0,0,952,0,0,736,143,0,700,0,1540,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1557,0,0,0,860,990,0,0,0,807,0,0,0,0,0,131,
+515,0,646,0,0,0,0,117,728,508,121,0,0,0,0,0,0,357,0,0,0,0,0,0,237,0,0,0,0,0,0,0,
+0,0,1784,0,0,0,0,0,0,0,0,0,0,0,713,348,1536,0,738,0,0,0,0,0,0,0,434,0,0,0,0,0,0,
+366,1877,39,0,0,0,0,0,0,580,0,0,0,0,0,0,0,0,0,0,0,0,0,0,873,0,0,0,0,171,0,625,
+550,107,343,943,0,0,0,0,0,0,0,768,0,0,0,0,0,0,0,799,0,0,0,894,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1673,0,0,0,0,0,0,0,0,0,0,0,1052,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+272,0,441,0,0,3,9,0,0,0,1182,0,1346,0,0,0,0,0,0,0,0,682,0,0,1004,24,0,0,968,0,0,
+0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,185,0,0,0,578,
+474,0,0,0,0,0,0,0,0,0,0,0,0,0,0,113,530,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,556,0,0,0,0,0,0,16,1317,0,0,97,0,0,0,703,0,0,0,0,0,0,0,0,892,0,0,0,1571,0,0,
+426,186,0,1101,0,0,0,0,0,0,0,0,937,585,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,644,291,
+0,0,0,0,749,0,162,0,0,381,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,762,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,628,21,0,0,0,0,0,0,0,0,919,0,0,0,0,0,0,0,0,0,
+633,0,0,0,0,332,0,0,0,0,0,0,0,0,0,1489,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,832,398,0,645,0,0,0,13,0,0,0,0,0,0,0,0,0,0,20,0,800,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1993,0,0,0,0,769,0,0,0,665,0,0,0,0,0,0,0,0,0,0,1426,0,0,0,0,60,0,0,0,
+641,1874,0,644,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1757,0,0,0,0,0,937,0,1652,0,654,0,
+0,0,0,0,0,0,527,0,0,0,0,0,0,0,0,0,0,0,0,0,226,0,0,0,0,0,1486,0,0,0,0,0,0,0,0,0,
+0,0,325,0,0,0,0,0,0,0,1345,0,0,91,0,404,0,0,0,0,0,0,0,0,0,0,0,0,973,0,0,0,0,0,0,
+0,1176,0,549,0,0,0,0,0,0,0,0,0,0,976,0,0,0,0,0,21,0,0,0,0,0,51,0,0,0,0,314,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,198,6,0,1093,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1776,0,0,0,0,0,1528,0,419,0,0,0,0,0,0,0,0,76,138,0,0,0,0,638,29,0,0,0,0,
+0,0,0,1418,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1710,0,0,0,0,0,
+0,0,0,0,0,0,0,532,23,0,0,0,0,0,0,0,862,0,0,946,592,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,70,0,0,0,0,0,0,0,0,0,812,0,0,0,76,0,0,988,0,442,0,0,0,896,0,0,0,0,0,0,
+483,0,0,0,0,1709,0,0,0,0,0,0,119,0,0,0,117,0,309,0,0,0,0,0,596,976,0,0,0,0,0,0,
+0,0,0,0,0,768,0,0,0,0,0,0,0,0,0,518,0,0,0,0,0,0,0,0,0,0,0,0,0,0,863,0,0,0,24,
+145,1020,0,0,1984,0,0,0,0,0,0,0,658,0,0,0,0,0,0,0,0,0,0,106,1827,0,1010,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,582,87,0,0,0,0,0,0,0,267,0,0,0,703,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,496,0,0,0,0,1121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,561,0,0,0,0,0,
+0,0,760,0,0,154,0,0,0,255,0,419,323,0,0,0,0,0,368,0,0,0,0,0,0,0,0,0,0,522,0,0,0,
+0,0,0,0,551,562,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,92,0,0,0,0,
+0,0,0,284,525,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,958,0,0,594,0,0,0,0,0,0,6,479,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,61,0,0,0,0,0,0,0,820,1641,0,1556,0,0,0,0,0,0,0,302,0,0,
+0,0,0,148,0,0,676,0,0,0,0,0,0,1674,0,0,0,0,0,0,178,0,0,0,0,0,0,0,94,389,0,0,0,0,
+91,8,0,0,0,0,0,0,0,0,0,0,112,0,0,0,0,0,0,0,0,0,0,747,0,0,0,0,0,0,0,1746,0,0,0,0,
+0,24,0,1352,158,1530,0,0,718,130,280,1401,0,0,0,0,0,1946,8,0,0,0,0,1607,0,0,0,0,
+0,0,882,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,417,0,0,0,1597,633,433,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,234,0,0,0,0,0,0,0,0,680,1950,0,0,0,0,249,5,0,0,0,
+0,0,0,0,0,0,1216,0,1773,0,0,0,0,0,0,0,0,0,0,0,0,0,0,509,180,0,0,0,0,0,0,0,1002,
+0,0,0,0,0,0,0,0,0,0,0,0,0,931,0,0,0,0,0,0,0,0,747,943,0,1837,0,0,0,0,0,0,0,641,
+0,0,0,0,280,0,0,0,5,0,0,0,0,0,72,545,0,0,0,0,0,0,0,0,0,742,0,0,254,151,872,0,0,
+0,0,0,0,0,0,0,0,0,0,921,0,0,517,833,0,1680,0,0,436,251,584,0,0,0,0,0,0,0,0,0,0,
+0,24,500,0,0,0,0,0,0,0,0,195,1775,514,389,0,0,0,0,0,0,0,743,0,0,0,0,0,0,292,0,0,
+0,227,1283,774,1805,0,0,0,0,0,0,0,0,0,0,119,81,0,0,0,0,0,0,0,0,0,0,0,0,0,0,913,
+1910,0,0,0,1826,490,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1162,700,30,
+0,0,0,721,839,0,0,0,617,0,0,0,0,0,0,0,0,0,169,428,0,0,0,0,0,1648,637,1205,0,0,0,
+1596,0,0,4,266,0,0,0,0,0,0,0,0,0,0,0,862,0,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,
+0,279,157,391,604,0,0,713,945,877,973,0,0,0,0,0,0,0,0,0,0,0,0,0,0,859,567,628,
+1846,0,0,0,0,0,0,0,0,0,762,0,0,191,0,0,0,0,298,0,0,767,909,0,0,0,0,0,0,0,795,0,
+0,301,0,0,1970,0,0,0,0,0,0,0,0,0,1236,0,0,0,0,0,0,644,369,15,0,160,71,0,0,0,0,0,
+1447,0,0,0,0,0,0,0,0,735,1255,76,0,0,0,0,0,0,0,0,0,0,474,0,0,0,0,0,0,0,0,0,0,
+841,0,0,0,0,0,0,0,0,0,0,836,0,0,0,0,0,1622,0,0,735,0,0,0,0,1601,804,1390,394,0,
+0,0,0,0,0,96,0,289,0,0,35,688,0,0,0,667,0,513,0,0,0,0,0,0,0,2034,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,704,0,1524,0,1078,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,306,
+0,0,0,0,0,0,0,431,0,1196,0,0,54,0,15,1448,0,1418,0,0,0,0,0,0,0,0,0,907,0,0,0,0,
+0,0,194,1767,0,0,0,0,0,840,0,900,0,0,0,0,0,0,0,0,0,0,0,1436,0,0,0,0,642,1560,0,
+0,0,0,0,0,94,386,0,0,0,0,0,0,0,0,0,0,830,416,0,0,20,731,0,0,0,0,0,0,0,0,697,0,0,
+662,0,0,0,0,0,0,0,0,0,861,0,0,0,0,0,0,0,871,671,864,0,928,7,0,332,0,0,0,0,1055,
+0,0,0,0,0,0,986,0,0,0,0,0,44,76,0,0,0,0,0,0,0,0,0,0,300,0,0,0,0,0,0,0,175,518,
+831,1108,0,0,0,836,0,1852,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,843,1804,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,246,0,0,0,610,202,0,0,36,0,0,0,240,654,13,0,0,0,0,0,0,0,
+0,391,0,403,0,0,0,0,0,0,0,0,0,0,75,0,366,815,0,0,631,0,0,0,0,0,0,0,0,345,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,952,0,0,0,0,0,0,0,0,0,0,0,673,35,662,0,287,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,5,34,0,0,0,0,0,0,0,0,151,0,427,0,0,382,0,0,0,329,0,0,279,0,0,0,
+0,0,0,0,0,0,0,906,0,0,366,843,0,1443,0,1372,992,0,36,123,0,649,0,0,0,0,0,767,0,
+1018,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,995,0,0,0,0,0,0,0,72,368,0,0,1345,0,0,0,
+589,0,0,0,0,0,0,0,0,0,1988,0,0,220,541,0,0,0,686,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,32,196,0,0,0,0,0,0,0,0,0,0,0,0,0,381,0,0,0,0,0,0,0,0,0,1452,0,
+0,0,616,0,0,0,0,0,0,0,0,0,1229,0,0,0,0,0,0,0,0,0,0,667,120,0,0,0,0,0,0,0,1146,0,
+0,0,0,0,0,0,0,0,0,0,352,0,0,0,0,0,293,0,0,0,0,0,0,0,0,0,0,0,0,0,935,0,1050,0,
+147,88,0,0,923,0,0,0,0,0,934,0,0,0,0,0,0,0,0,114,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,341,222,0,0,0,0,0,0,0,0,0,0,293,0,0,0,0,0,0,0,0,0,0,0,0,
+637,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1159,0,0,0,847,0,0,0,0,0,0,683,0,867,944,0,0,
+0,0,0,1809,0,0,0,0,0,0,0,0,0,0,395,170,0,0,0,0,0,0,0,0,0,0,618,535,0,1625,0,0,0,
+0,0,0,0,0,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,778,0,0,0,0,0,46,0,2032,0,0,37,
+1458,0,938,363,34,0,0,0,0,0,0,0,0,0,0,0,0,0,0,314,0,0,0,0,0,0,889,0,0,0,0,0,0,0,
+0,0,0,0,462,0,0,0,0,525,0,0,23,0,0,0,0,0,0,0,0,0,0,0,676,0,0,0,0,0,0,0,0,0,0,0,
+0,498,725,0,0,0,0,7,0,0,0,0,773,0,0,0,164,0,0,0,0,0,0,0,0,936,583,659,1462,0,
+220,0,0,0,0,803,0,0,544,119,0,0,0,0,0,0,0,0,0,0,0,181,176,0,1192,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,1878,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26,0,0,0,0,0,0,
+944,0,0,0,0,0,0,0,273,0,0,0,0,0,855,0,0,0,0,5,127,0,0,0,0,0,0,0,0,752,230,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,162,0,654,48,156,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,240,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,197,
+0,0,0,0,0,0,0,963,0,0,0,0,0,0,0,0,0,0,858,0,0,0,0,0,0,0,0,0,0,676,1978,0,0,102,
+972,0,0,0,0,0,0,0,361,0,461,0,0,0,472,0,0,0,0,0,0,0,0,0,0,0,0,0,0,747,905,0,0,0,
+155,0,0,0,0,0,0,0,0,0,0,319,163,0,0,0,0,0,0,0,0,0,848,0,0,36,631,0,0,0,0,0,1769,
+0,0,0,0,0,144,0,0,0,0,0,0,0,0,0,0,369,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,555,247,0,0,
+996,0,0,189,0,0,0,0,0,0,0,0,0,0,280,0,0,0,0,0,0,0,0,0,0,0,526,746,0,0,345,0,0,0,
+1017,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,651,428,0,0,0,1162,230,327,546,792,0,0,0,
+1203,0,0,0,0,0,0,0,0,0,672,189,0,0,0,0,0,0,99,0,0,0,298,0,0,0,0,0,0,555,397,0,0,
+0,0,0,1157,0,0,0,0,0,0,0,0,0,0,398,1523,0,366,0,0,787,0,0,0,282,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,157,0,941,0,0,0,0,0,1336,0,0,116,0,0,0,0,0,0,787,0,0,0,0,0,0,0,0,0,
+0,170,160,0,1815,0,0,0,0,0,866,0,0,0,0,0,0,0,0,0,689,0,0,0,0,820,0,498,108,0,0,
+0,1119,0,0,0,244,609,1005,0,581,0,0,0,0,0,895,0,0,0,1898,0,0,0,0,0,926,0,0,0,0,
+0,0,0,0,0,0,0,0,0,538,496,294,301,0,0,0,18,0,0,757,0,0,0,0,0,1263,0,820,0,722,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2028,0,0,0,0,124,1875,0,0,0,881,0,0,0,1348,
+0,0,0,0,0,0,0,911,0,954,0,0,0,0,414,0,0,0,0,517,0,0,0,0,0,816,0,0,0,0,0,0,0,0,
+713,0,0,0,0,0,0,0,33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,593,150,0,0,0,0,
+0,553,0,0,0,0,0,0,0,0,0,0,108,0,0,0,0,420,0,0,0,0,0,0,0,0,0,0,0,1777,0,0,55,493,
+0,0,81,0,321,980,0,0,0,0,0,0,0,0,0,0,0,0,0,0,362,112,0,74,0,0,0,0,0,0,0,625,0,0,
+0,0,0,0,377,16,0,0,61,281,0,0,0,0,0,0,0,0,0,0,0,0,0,0,224,1031,0,0,0,0,0,0,51,0,
+0,0,0,0,0,0,211,309,15,125,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,789,173,0,439,9,648,
+0,0,294,0,0,0,0,0,0,0,374,8,0,1099,0,0,0,0,0,0,0,575,0,0,0,518,0,0,0,702,0,0,0,
+0,0,0,87,0,0,0,438,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,464,122,0,0,0,1802,0,0,0,0,
+0,0,499,0,0,0,87,476,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,840,283,0,0,0,0,1620,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,609,1160,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,
+323,372,0,0,0,0,471,722,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,
+477,1304,0,1774,0,0,88,0,438,12,0,0,0,0,0,0,0,0,671,997,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,639,22,0,0,782,681,0,0,0,0,0,0,0,0,0,0,1013,664,0,942,0,1349,0,0,0,0,0,0,0,
+0,0,0,0,0,356,0,0,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,289,0,1975,
+109,450,0,0,0,0,0,0,0,0,0,0,705,0,0,664,0,0,0,0,0,0,0,1238,0,0,318,0,0,0,0,0,0,
+0,0,0,0,0,0,0,960,1872,0,0,0,0,0,0,0,0,0,0,0,0,0,0,103,0,0,0,0,0,0,0,0,0,239,
+777,0,26,0,0,0,0,0,0,0,0,0,0,0,0,375,414,0,17,0,0,0,1350,0,955,0,0,0,0,0,0,0,0,
+887,960,0,0,0,0,0,0,0,0,0,0,708,710,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,919,0,0,0,
+0,502,280,7,45,0,0,0,0,777,0,0,0,0,410,0,1110,0,0,0,0,0,0,414,341,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,787,0,0,0,436,0,0,0,0,0,0,0,1707,613,377,96,0,0,0,0,451,
+0,0,0,0,0,0,0,0,0,0,0,0,0,680,0,483,916,0,0,0,0,0,0,937,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,739,0,0,0,0,0,0,0,0,82,0,0,663,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,128,0,0,0,0,0,0,0,0,1087,0,0,0,0,0,0,0,503,0,0,0,0,0,0,9,113,104,324,0,460,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,935,702,434,485,1014,949,423,0,900,
+0,0,0,0,0,0,0,2018,574,0,0,0,0,0,0,0,0,0,0,0,0,1206,0,0,0,0,0,0,0,0,38,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,1022,0,0,0,0,143,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,2029,0,0,0,0,0,0,0,0,0,0,0,0,523,0,0,0,0,0,0,625,0,0,425,37,0,0,0,1943,0,0,0,
+0,0,765,0,0,0,0,0,0,0,0,0,0,551,0,0,0,0,0,0,0,0,0,0,0,0,168,0,0,1010,0,0,1994,0,
+0,0,91,0,0,0,0,532,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1884,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,240,15,0,0,0,1227,0,1534,0,0,0,0,0,0,0,0,0,0,0,0,0,0,392,0,
+0,0,0,0,0,0,0,0,0,0,0,655,562,395,0,0,0,501,1019,0,0,0,0,509,267,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1099,0,0,0,0,0,0,948,0,0,0,0,0,0,0,
+462,114,0,0,258,404,0,1717,0,0,0,0,82,1061,0,724,0,0,0,0,0,1133,0,0,0,0,0,0,
+1021,841,0,1021,0,0,0,0,0,0,0,0,0,0,488,373,37,0,0,0,0,564,0,0,0,0,0,513,0,0,0,
+825,0,0,899,0,0,778,0,0,12,1417,0,1116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,114,545,0,5,
+0,0,0,0,0,0,0,192,0,0,763,0,0,0,0,0,0,0,755,759,0,0,0,0,0,0,0,0,0,370,0,1237,0,
+0,0,0,0,0,298,87,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,31,0,0,
+0,0,0,0,814,991,0,757,57,0,0,0,0,0,0,0,0,0,540,0,0,0,0,608,0,0,0,0,0,0,0,0,1014,
+0,0,0,902,0,0,0,0,553,1668,0,0,0,0,0,0,0,0,0,559,60,0,0,0,0,0,511,0,0,675,0,0,
+156,0,0,0,0,0,0,709,0,698,0,0,0,1745,0,0,0,0,0,0,0,0,0,714,0,0,0,0,0,0,0,0,206,
+8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,776,0,0,0,0,0,0,0,0,0,1272,0,0,
+0,0,0,1059,0,0,0,0,0,0,406,0,0,0,0,0,0,0,0,0,0,947,0,0,0,0,0,0,168,0,0,0,0,0,0,
+870,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,554,0,0,0,0,784,908,0,0,0,0,0,0,
+0,396,358,0,0,0,0,0,0,0,0,2,228,0,0,0,0,0,0,0,0,0,0,0,845,14,0,716,1820,594,0,
+81,1428,0,161,0,782,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,998,0,
+0,0,0,0,0,0,0,0,0,0,0,1043,0,1496,0,0,0,0,0,0,0,0,781,0,0,0,0,0,0,0,817,1114,0,
+1814,958,0,0,0,0,812,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,139,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,236,643,0,0,0,0,0,0,0,0,0,1172,0,0,0,0,0,0,0,0,0,1338,0,0,0,
+0,0,0,0,0,0,0,0,54,0,0,0,256,0,0,351,0,955,1885,0,469,0,0,0,1270,0,744,0,313,0,
+0,0,0,0,0,0,0,402,969,0,0,0,0,0,0,50,0,0,0,0,572,0,0,0,0,847,0,0,0,0,0,0,0,248,
+43,0,369,0,0,0,0,0,0,0,0,0,0,0,0,0,766,0,363,0,0,0,0,0,0,0,0,0,0,0,678,0,0,409,
+258,82,249,0,0,0,0,0,0,0,0,0,0,0,0,32,393,0,788,0,0,0,1281,509,1968,0,0,0,0,39,
+291,0,0,0,589,0,0,54,1059,0,0,0,0,0,0,824,0,0,0,0,0,0,0,0,0,0,1005,0,1598,0,0,0,
+0,0,919,0,0,0,0,0,0,0,0,52,132,0,0,0,0,0,328,0,0,0,0,173,0,0,0,0,0,65,1411,0,0,
+0,0,0,0,0,0,0,0,442,0,842,0,0,0,0,0,0,0,0,0,534,0,0,0,0,0,0,0,0,0,0,0,0,0,845,
+210,0,0,0,0,0,0,0,0,892,0,0,223,0,0,0,0,529,0,0,0,807,0,137,218,0,1444,0,0,0,0,
+0,332,661,0,0,0,0,0,0,0,76,1517,0,0,0,0,0,0,0,0,0,0,0,418,0,0,0,0,0,0,0,0,481,
+379,0,0,0,0,0,149,18,0,0,0,0,0,0,0,0,742,304,142,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,799,925,195,51,0,0,0,0,688,0,0,0,0,697,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,1169,751,0,0,0,452,929,0,221,0,1437,0,0,0,0,955,1251,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,0,132,0,0,0,0,0,865,0,0,0,0,0,0,0,767,
+672,42,0,0,0,1050,0,0,0,0,0,0,0,0,368,44,0,0,0,0,0,0,0,570,29,0,0,0,0,0,0,227,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,522,0,0,0,0,0,0,0,1529,0,0,0,0,0,0,739,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1667,0,0,0,0,0,0,132,511,0,138,208,1020,0,0,23,565,0,344,0,0,0,
+0,0,922,0,0,0,0,0,0,0,240,0,0,415,171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,402,0,0,754,31,716,0,982,731,0,0,0,0,0,0,0,888,0,0,0,803,847,0,0,823,
+0,0,0,0,0,0,785,0,0,2,0,0,0,0,0,0,0,532,0,0,681,0,0,314,0,384,684,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,649,447,0,1818,1007,0,321,0,66,360,0,0,0,385,0,0,0,0,0,0,
+0,900,73,254,0,0,0,0,683,1959,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,86,0,0,725,0,0,0,0,0,196,0,0,0,0,0,831,0,0,0,0,723,0,0,0,0,0,994,627,0,0,
+0,0,0,0,0,0,0,0,764,66,0,0,0,0,205,36,0,0,0,0,0,0,0,950,0,0,0,887,111,0,0,831,
+388,165,0,0,0,0,0,155,0,0,0,0,0,0,0,0,0,0,0,0,0,0,780,755,0,0,0,0,898,146,0,0,0,
+0,0,0,0,45,7,0,0,0,0,0,0,0,0,607,0,0,0,0,0,0,65,0,0,0,0,0,0,0,0,0,88,0,0,0,0,0,
+621,600,0,367,0,0,0,0,0,0,0,561,0,559,0,585,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+287,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,672,157,0,0,0,0,714,0,0,0,
+0,0,456,0,925,0,0,0,0,0,0,0,0,19,0,0,0,0,1473,0,0,0,0,0,0,0,0,0,0,113,0,0,0,0,0,
+0,0,0,0,0,0,0,0,69,463,0,0,82,193,2,471,0,0,0,0,633,0,0,0,0,0,0,1148,129,1392,
+542,803,0,0,0,0,0,0,0,0,0,0,0,0,438,0,0,0,0,0,0,875,0,0,0,0,0,237,0,0,0,0,0,0,0,
+65,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,563,0,0,0,9,444,0,0,43,1260,0,0,0,0,0,0,
+971,0,0,699,0,0,0,0,0,1116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,829,242,0,
+0,593,0,0,0,0,0,0,0,0,201,36,224,0,0,0,0,0,0,1430,0,1806,0,523,0,0,212,1889,0,0,
+0,827,0,0,0,0,0,2043,136,242,0,0,0,0,0,0,284,148,10,0,0,0,0,0,0,1249,0,0,0,807,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,94,0,0,0,494,0,0,0,0,0,0,0,0,1510,0,0,0,0,0,
+0,0,0,0,0,505,1306,0,0,764,268,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,384,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1703,0,0,0,0,159,964,583,0,0,0,
+0,0,0,515,0,0,854,0,0,0,0,0,0,0,0,0,0,0,0,1123,0,0,0,0,0,0,0,136,0,0,0,0,0,1782,
+0,0,44,1287,0,0,0,0,0,732,0,0,0,0,313,679,0,0,316,0,0,0,0,595,0,0,0,0,0,0,753,
+147,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,137,0,0,0,0,414,0,1762,0,0,0,0,0,0,0,0,
+0,0,0,599,0,0,0,0,0,0,0,0,0,1749,0,0,0,1627,0,488,0,0,0,0,0,83,0,0,0,0,676,0,0,
+1639,0,0,0,0,0,0,0,0,0,278,0,0,0,0,0,0,97,0,14,1085,0,0,0,0,0,0,781,388,0,849,
+59,229,0,0,0,0,0,1115,0,0,0,0,108,0,0,0,0,700,0,0,0,0,0,0,0,0,0,1414,0,0,0,0,0,
+0,0,0,0,0,0,0,0,660,737,1035,0,0,0,0,0,0,521,690,0,0,0,0,0,0,0,0,0,0,0,0,272,0,
+0,0,0,0,0,0,0,0,0,1744,0,0,0,0,0,0,128,733,0,0,277,0,0,0,0,0,0,0,0,0,4,0,0,0,0,
+0,0,0,0,0,0,0,0,0,936,1981,40,0,0,0,0,0,0,0,0,775,0,0,0,0,0,0,0,0,0,306,0,0,0,0,
+0,0,0,979,0,0,0,0,0,611,0,0,0,0,0,178,0,0,0,1969,0,0,0,0,0,0,0,664,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,390,0,0,0,1510,0,0,0,0,0,0,0,0,0,0,0,493,0,0,37,0,0,0,0,724,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,1537,0,0,168,473,0,0,0,105,0,0,0,0,
+627,438,0,0,0,0,0,0,0,0,0,0,11,1256,0,0,0,1626,0,779,0,0,0,0,25,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,308,0,0,0,0,0,741,0,671,0,0,0,0,649,150,0,0,99,521,0,0,3,339,0,0,0,
+543,0,0,0,0,0,0,0,0,0,1358,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,234,155,
+0,0,0,0,0,0,0,1628,0,766,0,0,0,0,0,0,0,0,0,0,0,0,0,829,0,0,0,1445,0,0,0,486,0,0,
+0,0,2,1635,0,0,0,0,558,0,0,0,0,0,0,0,0,0,0,1461,0,0,0,0,0,599,0,0,0,0,0,0,0,0,0,
+1376,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,93,0,0,0,0,0,0,447,0,0,66,1432,0,0,0,0,
+0,0,307,0,413,609,0,0,0,930,0,0,0,0,21,939,0,0,0,0,0,962,4,651,0,0,0,0,15,579,0,
+0,0,0,0,597,0,0,0,0,0,981,0,0,0,545,0,0,0,0,0,0,0,1558,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,800,17,0,0,17,0,907,0,0,0,110,0,0,0,53,458,0,1983,0,0,0,0,0,0,0,0,0,0,443,0,
+0,0,0,0,0,0,0,0,0,0,924,1844,0,1232,0,0,0,0,70,519,0,993,0,0,0,0,0,0,14,530,0,
+907,0,0,0,0,0,733,0,0,0,0,0,0,0,0,55,0,188,531,56,0,0,1693,0,0,0,0,0,0,0,0,441,
+0,192,928,0,0,0,0,0,241,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1525,0,259,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,512,185,0,464,1603,0,0,0,0,0,0,0,0,0,0,0,1113,
+284,720,0,0,722,0,0,0,0,0,13,0,0,0,0,0,0,0,4,289,43,0,0,0,0,0,0,1694,0,0,0,0,
+193,0,0,0,0,409,0,0,0,0,0,0,0,0,0,0,0,0,308,0,0,1863,0,0,0,0,0,0,0,0,0,790,0,0,
+745,1002,0,0,0,0,0,0,0,0,0,289,68,477,13,0,0,0,0,0,0,0,0,0,0,609,0,0,0,0,0,0,0,
+0,0,0,0,367,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,528,0,0,0,0,0,0,0,0,0,694,58,
+548,0,0,0,0,0,0,687,0,0,0,0,1749,0,0,0,0,0,0,0,0,1004,661,0,0,0,0,0,0,445,0,0,0,
+74,0,0,0,0,213,0,0,0,0,0,0,0,0,0,0,0,0,0,834,0,0,189,1672,0,0,0,0,0,0,0,1548,
+192,0,0,0,0,0,0,0,0,0,0,0,0,0,32,751,0,78,0,0,0,0,0,0,544,1602,105,473,0,0,0,0,
+0,0,156,1949,0,1779,0,0,0,0,0,0,0,0,0,0,0,763,0,0,0,0,0,0,0,0,29,0,0,0,0,0,0,0,
+0,0,0,883,0,0,0,0,0,0,0,488,0,617,0,0,50,0,694,1518,785,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,546,0,0,0,0,0,0,0,0,0,0,22,0,0,0,0,1016,0,0,0,577,0,0,0,0,0,0,
+184,935,114,720,0,0,100,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,95,14,0,969,0,0,0,0,0,0,0,
+727,0,1021,0,0,0,0,0,1190,0,0,0,0,0,0,0,0,0,0,0,0,0,153,0,0,0,0,0,0,0,0,0,798,0,
+587,0,0,695,42,0,1929,141,957,0,465,7,908,0,0,450,148,0,0,0,1166,0,0,0,0,0,0,0,
+0,0,0,0,0,253,0,1003,0,0,0,0,0,0,0,0,0,0,0,46,0,0,879,0,806,0,1868,0,0,0,0,0,
+1846,0,0,0,730,0,0,0,0,0,0,0,965,0,0,0,0,506,0,0,0,10,0,0,0,22,0,0,0,0,0,0,0,0,
+0,0,0,0,0,960,296,0,0,0,0,0,0,0,0,0,0,0,587,0,0,0,0,20,0,0,0,32,982,0,0,0,0,0,0,
+0,0,0,0,941,0,0,0,0,435,0,0,0,0,0,0,71,419,0,0,0,0,0,0,688,740,94,345,0,0,679,
+582,0,0,0,0,0,0,0,945,0,0,0,0,0,0,0,0,0,0,0,0,539,0,684,1993,0,0,0,659,0,583,0,
+803,0,704,0,0,0,0,0,198,181,347,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,481,405,203,0,0,99,826,0,0,0,0,0,0,0,492,0,408,0,0,0,0,0,0,0,0,0,0,4,0,0,
+0,0,665,349,137,0,0,0,0,612,1270,0,0,0,0,0,371,0,0,0,826,0,0,0,0,21,1535,858,
+374,0,0,0,0,0,0,311,0,0,0,991,1968,0,0,0,0,494,1647,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,769,0,0,0,0,0,642,0,0,157,123,0,0,0,1435,0,0,0,0,0,0,0,0,0,0,79,0,0,0,
+0,0,0,1425,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,106,393,486,1690,0,0,0,0,
+0,0,0,0,0,0,0,0,756,184,0,0,0,1382,0,0,0,175,0,1493,0,1007,0,0,0,0,0,0,0,0,0,0,
+0,219,0,0,0,0,515,99,0,851,0,0,0,0,0,1278,0,0,0,0,0,0,0,1000,982,0,762,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,910,1819,0,0,0,0,0,0,906,0,0,0,0,0,0,0,0,0,0,1730,0,0,
+0,0,0,0,0,0,0,0,0,1185,0,0,0,0,0,0,0,0,40,0,0,0,147,0,0,0,0,0,0,0,0,0,0,0,0,0,
+650,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,30,0,553,0,0,20,597,0,1614,0,0,0,0,0,327,
+49,0,0,0,0,0,0,0,78,0,0,786,134,0,0,0,12,496,0,0,0,0,0,0,0,0,0,0,42,204,0,614,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,147,247,0,0,0,0,942,0,0,2023,0,0,0,0,
+0,0,67,285,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1309,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41,532,0,0,0,0,0,0,0,
+1692,0,0,0,0,55,1704,0,0,0,0,988,0,0,0,223,0,0,0,0,0,0,0,57,1123,0,0,0,0,0,1764,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2015,0,0,0,1599,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,129,0,0,0,0,0,0,0,0,0,0,0,534,0,0,0,0,0,0,0,0,0,0,0,
+0,0,504,621,1248,321,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1397,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,441,75,0,0,0,0,0,0,0,0,0,0,841,0,0,0,0,0,693,0,650,314,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,913,0,0,0,0,0,0,0,0,0,0,0,0,0,0,880,0,475,0,
+0,1016,179,602,111,329,0,0,0,1864,0,0,0,0,846,1888,0,0,780,0,0,0,82,0,0,0,0,821,
+0,0,0,0,0,0,0,0,0,0,0,956,112,0,0,0,261,455,0,0,0,0,0,0,337,385,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,184,1865,0,0,721,16,0,486,0,0,0,265,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,621,0,0,0,0,0,0,0,0,234,0,0,815,0,0,743,
+1987,205,197,0,0,0,0,0,0,0,0,0,314,0,0,0,0,0,0,0,0,0,0,0,0,0,0,219,452,589,0,
+176,333,0,0,0,0,0,0,0,1110,47,0,0,0,0,0,0,0,0,0,0,0,864,0,0,300,0,1237,0,0,0,0,
+0,0,0,0,0,0,0,1685,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,135,395,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,631,0,0,0,0,0,0,835,0,0,0,606,459,0,979,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,0,0,0,0,0,0,0,0,158,372,0,854,0,0,0,0,0,
+0,0,1492,0,0,0,833,0,0,0,0,0,0,0,1739,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+195,0,0,0,0,0,0,0,0,730,1997,0,0,0,0,0,0,0,0,61,0,0,0,0,0,0,0,266,751,0,0,0,0,0,
+0,0,821,0,0,0,715,0,0,0,868,0,959,0,0,0,0,0,0,0,0,0,0,0,1053,0,0,0,950,0,1081,0,
+1595,0,0,0,0,59,0,0,0,0,0,0,0,0,0,0,47,684,0,0,0,0,0,0,1606,0,777,0,1020,0,0,0,
+1094,0,0,0,0,0,0,0,350,0,0,0,0,0,0,242,1812,0,0,0,967,0,0,0,473,286,0,0,0,0,0,0,
+798,629,222,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,513,337,306,0,0,0,0,0,0,0,0,0,
+146,0,0,1646,0,0,0,0,0,465,0,0,0,525,0,0,0,0,0,0,299,165,0,0,0,0,0,0,0,1064,0,0,
+0,0,0,596,0,0,0,0,0,0,0,0,0,0,0,0,0,0,238,1741,0,1233,451,1824,0,0,0,0,733,495,
+0,0,0,0,0,1204,0,0,0,559,341,0,224,21,0,0,0,0,0,0,0,0,97,1446,0,0,0,0,0,0,0,729,
+0,0,565,727,0,1948,0,0,0,519,0,0,0,0,0,0,0,0,0,1193,0,0,0,0,0,0,790,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,323,2,201,0,0,59,0,0,34,0,896,961,0,1285,0,0,46,0,479,0,0,
+0,0,549,0,663,0,0,0,0,0,783,65,682,0,0,0,0,0,11,0,0,0,0,0,522,0,0,0,52,0,0,0,0,
+0,383,0,0,0,0,0,0,0,0,127,0,0,0,0,0,397,194,0,0,635,0,0,0,0,0,0,0,0,0,0,975,0,0,
+0,0,0,0,0,0,0,0,116,0,51,0,0,858,0,1075,535,448,0,0,0,0,0,610,0,0,0,0,0,0,0,0,0,
+0,191,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,267,673,319,94,92,0,551,0,0,218,
+1406,69,256,0,0,952,1980,0,833,0,0,0,0,0,0,0,0,0,0,0,0,39,0,0,0,0,0,0,0,81,0,0,
+0,352,634,0,0,0,0,0,618,0,0,0,0,0,0,73,339,0,0,0,0,0,0,0,0,0,0,0,0,0,0,169,759,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1075,0,0,0,0,0,0,482,649,0,0,0,0,0,0,0,0,386,336,0,0,
+0,1035,0,0,0,0,0,0,0,0,0,0,0,924,0,73,0,0,0,0,0,1971,0,0,0,0,0,0,0,0,0,1344,0,
+501,0,0,0,0,0,0,0,0,46,799,0,0,0,0,0,0,0,276,0,0,0,0,0,0,0,770,0,0,0,0,0,0,0,0,
+0,0,0,0,0,158,0,0,0,0,0,1432,0,0,0,0,0,0,0,0,0,0,25,0,0,2001,0,0,0,0,0,0,0,0,0,
+0,0,0,0,478,0,0,0,0,0,0,91,1461,211,602,0,0,0,0,0,0,0,0,0,1068,0,0,124,567,0,0,
+0,1006,0,0,0,0,0,0,0,0,0,735,812,0,0,323,0,0,0,304,0,0,0,0,0,0,0,0,0,148,0,0,0,
+0,0,0,0,0,0,523,0,0,144,730,0,0,981,0,0,111,0,0,132,0,0,0,0,0,0,890,0,0,0,0,0,
+444,0,1787,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,2041,932,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,937,0,995,0,0,255,0,0,138,863,965,0,0,631,0,0,0,0,1394,16,652,0,0,0,0,0,0,
+0,0,0,0,0,0,0,897,0,321,0,0,0,0,0,922,0,619,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,844,0,0,0,0,0,0,1659,0,1100,0,0,0,1173,0,1930,268,251,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,390,711,0,0,0,0,0,0,0,0,0,0,0,0,0,744,0,0,0,0,0,0,0,0,0,624,0,0,0,
+1998,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1125,0,0,0,594,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,268,0,0,0,0,0,0,0,563,0,0,0,0,0,0,0,0,2,39,0,0,0,1332,0,0,0,0,0,
+0,0,508,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,66,796,0,0,0,0,527,0,0,0,0,98,0,0,576,0,
+0,0,0,0,122,0,276,37,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,645,0,0,0,0,
+0,0,0,0,0,0,0,290,0,0,762,1292,0,0,0,1315,0,1955,0,0,0,0,0,0,0,0,0,0,210,131,0,
+0,0,0,797,0,38,0,11,488,0,936,0,441,0,0,0,0,0,595,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+991,0,0,0,0,0,0,0,0,0,0,0,653,0,523,0,0,0,903,0,0,0,0,0,0,0,0,0,0,0,0,80,0,0,0,
+0,0,0,0,0,0,432,0,0,314,0,0,0,0,232,1368,534,0,0,0,0,0,27,0,0,0,12,0,0,0,0,0,0,
+0,0,0,264,736,0,1657,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1117,0,127,0,0,0,1208,0,1294,
+0,0,0,0,364,0,0,0,0,0,125,1334,0,0,0,0,0,0,0,0,0,0,0,0,0,0,792,0,0,0,0,0,0,0,
+849,699,0,0,0,0,0,968,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1446,
+124,397,0,0,0,0,0,0,0,0,0,0,0,641,0,0,0,0,0,0,0,0,0,0,0,0,127,346,0,0,517,75,0,
+0,0,0,0,0,0,0,83,0,0,0,0,0,0,1031,0,0,0,0,0,0,0,1470,0,954,0,0,345,304,410,0,0,
+0,0,734,0,0,0,0,0,1822,0,0,0,1798,0,0,0,0,0,0,0,0,0,0,0,0,0,14,0,0,0,0,0,0,161,
+1865,69,0,0,0,0,0,0,922,0,0,0,0,0,0,0,0,0,0,0,541,0,627,0,0,0,0,0,0,0,0,0,166,0,
+0,0,0,0,0,0,0,0,849,0,0,0,0,0,0,0,717,0,0,0,0,0,0,0,0,0,0,0,0,0,0,600,0,0,0,0,0,
+0,654,0,0,188,273,0,0,0,543,0,410,87,0,0,941,0,0,186,250,0,1785,0,0,0,0,0,1339,
+462,961,0,780,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,529,0,0,0,0,0,0,474,1276,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,24,948,0,0,0,0,657,753,0,0,0,0,941,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,706,985,837,0,1861,0,0,0,0,0,0,0,0,0,0,0,0,0,0,292,933,0,0,0,0,0,
+0,0,0,0,767,0,0,0,0,0,0,0,641,0,0,0,1233,114,0,883,0,274,2008,0,1794,285,0,0,
+571,0,0,0,0,0,0,0,0,0,0,823,960,16,617,0,431,0,0,0,0,0,0,0,0,0,0,567,0,401,0,2,
+781,424,33,0,2006,0,0,274,0,0,1882,0,794,0,0,0,1848,0,0,0,0,0,0,448,47,0,0,0,
+1199,0,0,0,0,0,0,0,0,417,0,0,0,0,0,0,0,0,0,0,295,0,0,0,0,0,0,0,1019,0,0,0,0,0,0,
+0,0,0,0,0,0,0,620,0,0,0,0,464,0,0,0,0,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,442,0,930,0,0,0,0,0,516,68,0,0,0,0,0,1128,104,0,0,0,0,0,0,0,0,787,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,491,0,0,0,0,0,0,711,0,0,9,0,101,441,0,0,0,0,0,0,0,0,
+0,0,160,396,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,679,326,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,1128,0,0,0,0,0,737,0,1796,0,0,0,0,0,0,0,0,0,0,0,0,338,574,0,0,
+0,0,0,1096,491,405,0,0,0,0,0,1081,0,0,0,0,0,0,0,0,0,0,0,0,0,1676,0,1207,0,0,0,0,
+0,0,969,354,0,0,0,0,598,0,297,0,0,0,0,0,0,0,0,1772,751,0,37,0,0,1828,0,0,0,0,0,
+0,0,0,0,257,191,582,0,0,0,0,0,0,790,0,0,0,0,0,47,0,0,0,0,0,0,0,449,306,1011,0,0,
+0,0,0,299,0,0,0,0,0,0,837,0,0,0,0,0,0,10,329,0,0,0,0,0,1320,0,0,0,0,0,0,158,657,
+0,1191,0,0,0,0,0,0,7,0,974,1939,0,1665,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,288,
+66,0,0,0,0,494,175,0,1643,0,0,0,0,0,0,0,0,570,750,719,0,0,0,0,0,0,0,0,0,0,0,0,0,
+13,0,0,1247,0,0,221,356,0,0,0,0,0,0,0,0,0,0,694,1809,0,0,0,0,0,0,0,411,0,44,31,
+0,0,0,0,669,0,673,0,0,0,0,0,0,0,0,0,1303,704,299,0,0,0,275,0,0,216,1761,0,0,0,0,
+0,0,0,0,0,0,0,1319,0,0,428,0,0,0,0,0,0,0,0,0,0,514,0,0,0,0,0,0,49,55,102,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,364,0,0,0,0,379,0,921,971,52,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1258,0,0,0,1058,0,0,0,0,0,656,0,0,0,0,0,144,0,0,0,0,0,0,0,0,0,0,
+0,1373,10,605,0,0,0,0,0,0,0,838,0,1012,0,0,0,0,0,0,0,0,0,0,0,0,0,0,154,365,0,0,
+0,0,0,0,0,0,0,340,0,0,0,0,0,810,0,0,0,0,0,0,495,0,0,0,0,0,0,0,0,0,261,0,535,248,
+0,358,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,567,445,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,697,0,0,0,1336,0,0,0,0,0,0,0,0,917,174,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,972,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,351,0,0,0,0,0,0,0,0,0,0,
+0,0,0,286,0,0,56,438,0,0,0,0,0,1950,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,738,0,0,0,0,0,
+0,0,0,0,0,969,2047,0,0,0,0,0,0,0,818,0,0,0,0,0,0,0,866,0,0,0,0,0,0,0,1467,0,0,0,
+0,0,0,0,0,0,0,0,0,0,972,0,355,0,0,0,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,267,189,104,0,0,0,0,1613,0,0,0,0,0,0,0,116,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,886,0,86,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,0,0,863,0,0,0,0,0,
+0,0,1953,450,1773,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,381,0,0,0,0,0,0,0,
+0,0,0,0,0,1142,0,1189,0,0,0,663,0,0,0,0,0,0,0,846,0,0,528,0,393,378,0,0,0,0,0,0,
+325,899,680,1880,0,1770,0,0,0,0,0,648,0,0,0,0,0,0,185,167,0,2046,0,0,0,0,0,0,
+249,1645,0,152,0,0,0,1733,0,0,0,0,0,1006,0,0,0,0,0,420,0,0,0,832,0,0,0,0,0,351,
+0,0,0,0,6,40,0,0,60,0,0,0,0,1354,745,724,0,0,0,0,0,0,0,0,772,1951,275,108,639,0,
+0,0,0,0,0,0,0,0,500,1758,0,0,0,0,0,0,0,0,0,0,0,1886,711,205,0,0,965,865,0,0,0,
+534,0,0,0,0,691,0,0,0,237,443,0,878,0,0,0,0,0,1410,0,0,0,0,0,0,0,0,0,0,0,0,0,
+995,0,0,0,0,0,0,0,0,0,0,0,0,0,578,0,0,0,0,881,0,0,0,0,0,0,0,0,822,0,923,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,924,0,0,0,665,0,0,0,0,0,1901,0,0,0,0,0,950,498,93,
+0,0,0,1451,0,0,0,0,0,747,828,788,400,184,0,198,0,0,0,0,0,0,0,0,0,0,0,994,0,0,0,
+0,0,0,0,0,615,320,0,0,0,978,843,905,0,0,0,0,0,0,0,0,850,974,0,0,0,0,6,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,509,0,0,0,0,0,273,0,0,0,0,0,0,0,0,0,0,0,0,0,
+201,0,0,0,1041,0,0,0,1040,0,0,0,0,0,0,0,0,0,693,234,774,0,336,0,1399,22,0,805,
+802,777,167,789,0,0,1705,0,0,0,0,0,0,0,0,0,0,0,10,13,11,0,0,204,264,0,0,56,0,0,
+1917,0,470,0,0,0,0,0,0,0,0,0,0,0,1198,0,0,0,0,0,0,0,0,0,0,1015,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,715,0,0,1002,0,0,0,298,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,867,0,0,724,0,0,0,0,0,0,0,0,0,0,0,0,768,0,0,0,0,0,1066,0,0,0,0,67,0,174,948,
+0,0,0,0,0,0,0,0,0,0,0,0,0,764,0,0,0,0,75,137,0,756,0,0,0,0,0,0,1008,842,643,0,0,
+0,67,0,0,0,0,0,0,0,0,0,0,0,135,821,0,0,0,0,0,0,0,0,736,0,389,355,0,0,786,0,0,0,
+0,0,0,2044,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1030,0,0,0,1083,0,0,0,0,0,
+1226,0,0,0,0,356,319,8,389,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,474,0,0,0,427,
+0,413,0,730,0,0,0,0,0,373,0,0,0,0,0,0,0,0,0,799,0,0,0,1793,0,0,0,322,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,89,290,2,0,0,0,0,0,0,0,0,0,0,672,
+699,1860,0,0,0,737,0,0,0,1612,0,0,0,0,0,0,0,0,0,0,0,145,124,884,0,0,0,0,0,387,0,
+0,0,0,0,0,0,0,0,0,0,679,0,550,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1305,0,0,0,0,0,0,0,
+576,0,0,0,0,0,0,0,686,0,607,0,0,37,0,0,0,0,0,0,0,0,0,101,1726,0,0,0,0,0,958,0,0,
+0,903,0,0,0,0,147,0,0,0,0,0,0,0,0,0,0,0,367,0,0,0,0,690,0,705,273,0,0,887,0,0,0,
+0,0,0,0,0,0,0,0,90,0,0,0,0,0,0,0,908,0,0,0,0,0,0,0,1261,0,0,497,1235,0,429,0,0,
+0,0,904,0,12,125,0,0,0,841,0,0,0,0,0,860,946,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,768,0,770,160,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,271,0,0,0,0,0,0,0,719,0,699,581,0,0,0,0,0,0,0,0,0,0,862,304,0,631,0,0,0,0,880,
+1513,0,0,0,0,0,981,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,434,0,0,0,0,0,550,0,0,476,930,
+824,553,0,0,452,0,151,0,0,0,0,0,0,772,0,292,135,0,0,0,0,0,0,0,504,0,0,1089,0,0,
+0,0,0,0,0,0,0,0,0,783,0,0,0,0,0,0,206,393,0,0,0,0,0,0,0,0,232,912,0,0,0,0,0,977,
+0,0,716,98,0,0,0,0,0,733,0,0,0,0,0,0,0,0,19,0,0,0,0,668,0,360,0,0,0,0,0,0,656,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,726,0,0,0,0,0,0,0,0,0,0,0,0,72,0,0,1269,0,0,463,0,
+0,0,0,0,0,1454,0,1287,245,0,989,0,0,0,0,0,0,0,0,0,107,164,0,0,0,0,0,0,0,1061,0,
+0,0,0,2,484,0,0,0,0,0,0,0,1127,0,0,0,0,0,0,0,460,0,0,0,0,0,932,0,0,0,0,0,0,0,
+588,625,0,0,0,0,76,92,0,0,0,0,0,0,0,0,0,0,0,0,0,104,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+763,0,622,0,0,0,253,0,546,0,0,110,0,256,916,0,0,35,212,0,0,746,0,0,0,150,0,0,
+1466,0,0,0,1299,0,0,0,0,0,0,0,0,0,1518,0,0,0,0,0,0,0,0,0,0,0,0,0,1229,0,0,0,816,
+0,0,0,0,0,0,159,0,0,0,0,0,734,869,126,1716,0,0,0,0,0,0,202,232,0,0,0,0,212,0,0,
+0,0,0,111,1003,0,0,0,0,0,0,0,0,0,0,0,1712,0,0,216,0,0,0,0,516,0,0,0,0,0,650,0,0,
+0,0,57,99,0,0,0,0,300,574,0,0,0,0,1023,0,0,302,0,1871,0,728,252,0,0,461,0,0,0,
+323,0,0,0,0,0,0,775,461,0,0,0,0,0,0,172,0,0,464,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,73,727,0,1023,0,0,0,0,0,0,0,0,0,0,577,0,0,0,0,0,0,0,0,1037,0,0,0,0,0,0,
+0,0,280,677,0,0,0,0,0,0,0,0,0,0,0,799,0,0,0,0,159,0,446,1730,0,0,0,0,0,0,0,0,0,
+395,0,0,0,0,145,0,0,0,0,0,0,0,20,0,0,426,608,0,0,0,0,0,977,0,250,0,0,0,0,0,100,
+0,0,0,0,1982,0,0,0,0,0,476,0,0,0,0,0,0,594,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,447,0,0,0,0,526,0,0,14,1124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,188,0,0,0,0,0,0,0,0,362,301,0,0,0,1743,0,178,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,872,0,831,0,0,208,202,0,0,0,0,0,0,0,1954,0,
+0,0,0,516,872,0,0,313,224,0,0,24,0,11,546,0,0,0,1937,242,241,46,0,0,0,830,1273,
+0,0,0,0,0,0,0,825,327,1006,0,0,0,0,0,1580,516,366,0,0,0,0,0,1736,0,0,0,0,0,0,0,
+0,0,0,0,1935,0,826,0,0,0,0,139,331,0,0,0,0,0,0,0,0,0,0,0,288,0,916,0,0,0,0,0,
+1888,0,0,0,0,0,0,0,1471,0,1570,0,394,0,0,0,0,0,0,0,1931,0,1719,0,658,228,0,0,0,
+0,0,374,0,0,0,0,735,0,0,0,0,0,0,323,498,0,1063,0,0,0,0,155,0,0,0,0,0,0,0,0,906,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1139,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,108,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,616,
+902,0,0,0,0,0,692,0,0,0,0,0,0,823,0,0,0,305,0,0,0,0,0,0,0,681,0,0,0,0,0,214,
+1004,0,0,0,0,0,0,0,23,0,0,1703,0,0,0,0,0,0,0,0,0,1443,0,0,19,714,0,0,0,0,64,737,
+0,0,345,1758,0,0,579,47,0,0,539,139,0,0,0,0,388,0,0,0,0,253,0,0,0,0,0,0,252,0,
+745,0,0,0,0,0,0,0,0,0,0,0,504,107,0,871,0,0,0,229,0,0,0,0,0,903,0,0,71,0,0,549,
+6,47,0,0,0,0,0,0,0,0,0,980,865,705,0,0,0,161,0,0,0,0,143,1331,0,0,0,1388,33,724,
+0,0,0,19,0,0,0,395,0,0,0,0,0,846,210,0,0,0,122,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,937,497,0,0,0,0,0,718,0,0,0,0,0,0,0,1581,0,
+0,0,0,0,0,161,49,0,0,0,0,0,0,0,0,0,597,0,0,0,1094,0,0,0,811,908,0,0,0,0,0,0,0,0,
+0,0,1471,0,0,0,0,0,0,0,0,0,0,42,1935,0,0,0,2014,66,2007,0,0,586,0,0,0,0,0,0,0,0,
+0,28,1077,0,0,0,1221,0,0,62,0,0,0,0,0,0,0,0,0,0,1766,0,0,0,0,0,0,0,0,0,0,0,0,25,
+0,499,1388,0,0,97,10,0,0,0,0,0,481,0,0,0,0,0,0,0,0,0,0,37,134,155,486,0,1442,0,
+0,0,0,0,591,0,0,0,0,0,0,310,1173,0,0,0,0,409,1156,0,0,0,482,0,0,263,926,0,0,0,0,
+0,0,0,0,0,0,0,0,0,804,0,0,0,0,0,0,0,0,0,0,0,0,0,1265,0,415,0,348,0,0,0,1012,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,165,1803,0,0,0,0,0,0,0,408,
+0,0,0,0,0,0,257,1321,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1138,0,0,0,249,0,
+0,0,576,0,0,0,0,231,0,0,0,288,0,0,0,0,0,0,0,0,0,433,1487,569,1678,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,87,0,0,0,0,0,779,538,0,0,0,413,0,0,0,
+0,0,0,0,0,0,0,495,0,0,0,0,0,191,54,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,530,567,
+0,0,0,0,0,1484,0,0,0,0,0,0,815,609,0,0,0,0,0,484,0,0,0,0,0,0,0,0,0,0,900,0,0,0,
+0,1335,0,1724,0,0,0,0,0,0,0,0,0,0,0,640,0,0,0,0,0,0,0,0,0,0,0,1831,0,0,0,0,0,0,
+0,0,0,0,0,0,0,474,0,0,0,0,0,0,0,0,0,1103,0,1504,655,1034,0,0,0,0,0,305,0,0,0,0,
+0,0,0,0,0,1236,0,0,429,217,0,0,0,0,739,278,0,0,0,0,0,0,0,708,0,0,0,0,0,1840,233,
+0,0,0,0,0,0,0,0,2017,0,0,0,0,0,1488,0,0,0,1590,0,0,0,0,0,1800,28,0,0,0,0,0,0,0,
+0,0,45,0,36,0,22,1442,378,0,0,0,0,0,0,1507,0,0,0,0,0,0,0,0,0,0,39,0,0,1054,725,
+1955,0,2036,0,0,0,0,0,0,0,0,0,0,896,1871,0,0,0,0,0,0,0,0,0,0,805,0,0,0,0,2046,0,
+0,0,0,17,712,0,617,55,320,271,0,0,0,0,0,0,0,0,0,445,0,184,103,0,0,0,0,0,0,0,0,
+659,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,676,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+337,0,0,0,506,0,0,0,0,0,843,77,0,458,0,0,0,0,0,1420,382,109,142,330,0,0,0,0,0,0,
+0,0,0,0,0,0,87,0,0,0,492,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1239,0,0,0,0,0,0,
+211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1049,0,321,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,1985,0,0,122,0,0,234,0,0,0,1098,0,0,0,0,0,0,549,253,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,522,131,0,0,149,0,0,0,0,0,0,0,0,0,0,0,0,0,0,507,0,0,0,0,811,630,0,0,0,343,
+0,0,0,0,0,448,591,455,0,1381,0,0,0,0,0,0,0,575,0,0,0,0,0,1175,0,0,0,0,0,0,0,0,0,
+653,0,0,0,1761,0,1198,0,0,0,0,297,1127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,678,0,0,
+164,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35,0,45,0,0,0,0,0,121,0,0,0,0,0,0,
+0,0,125,0,0,0,1622,0,0,0,0,0,721,145,0,0,0,970,792,0,0,0,715,0,0,0,0,0,1999,0,0,
+74,531,0,0,65,0,0,0,105,220,0,0,0,0,0,0,0,960,0,0,0,0,0,0,428,19,0,0,401,96,0,0,
+0,0,0,1595,116,0,1021,0,0,0,0,0,750,1961,0,0,148,0,0,0,0,0,0,0,0,0,0,0,0,0,75,0,
+0,1383,0,0,0,0,0,0,0,0,0,0,0,0,0,0,779,0,0,0,0,0,0,0,0,598,0,424,0,0,0,0,0,0,0,
+1222,0,0,0,876,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,133,0,0,0,0,187,0,8,0,0,0,0,0,
+0,0,429,0,685,0,0,0,0,0,0,0,0,0,0,0,132,472,0,0,0,0,0,0,0,0,0,938,0,0,874,0,0,0,
+0,0,774,0,0,0,0,0,92,0,0,0,0,0,0,830,701,0,0,0,0,0,426,350,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,603,59,0,0,0,0,0,0,0,0,0,0,293,0,0,0,0,0,0,0,0,0,0,0,0,0,0,441,163,4,0,
+0,0,0,0,0,0,0,0,806,0,0,0,0,0,0,233,0,0,0,0,1994,0,1739,0,0,393,0,47,1038,0,0,0,
+309,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,363,0,0,0,175,0,0,0,0,0,0,0,666,
+0,0,1675,0,1600,0,0,0,808,0,0,0,0,0,0,0,0,0,0,0,280,54,0,0,0,0,0,0,0,0,421,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,0,0,103,254,0,262,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,805,0,0,0,0,0,0,0,0,0,1630,0,0,0,0,0,0,0,0,0,0,0,0,0,671,972,989,0,0,
+0,0,0,0,0,889,0,0,0,1382,0,0,0,0,0,0,0,775,0,0,0,0,0,0,0,0,0,0,388,202,0,0,0,0,
+16,560,0,0,0,841,0,0,566,0,0,0,938,0,0,0,0,0,0,0,0,0,0,912,0,0,0,1361,0,0,0,0,0,
+0,618,236,0,1854,0,0,318,190,0,1376,0,0,0,0,0,0,0,349,0,0,0,0,951,1972,0,0,0,0,
+0,0,344,0,0,0,0,0,0,0,0,850,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,910,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,0,163,85,0,487,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,145,0,83,0,0,1013,0,0,0,1922,0,0,169,557,66,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1193,82,0,352,454,57,0,0,1333,396,107,0,370,0,0,0,0,0,0,0,0,0,204,0,0,0,
+0,0,1706,0,0,0,0,0,0,0,0,0,0,0,0,394,1204,0,0,0,0,0,1007,0,0,0,1696,0,1519,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,981,0,0,0,0,1072,0,0,0,712,0,1629,0,0,0,0,0,0,0,728,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1271,0,0,0,1608,16,0,0,0,0,485,0,0,0,0,0,0,
+153,27,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1991,0,0,0,0,0,0,0,0,52,0,21,0,
+0,0,0,0,0,0,0,0,819,0,0,0,0,0,917,0,0,0,0,784,0,0,0,0,135,0,0,0,0,0,454,0,0,0,0,
+0,0,0,0,0,852,1719,0,0,0,0,0,852,0,0,0,0,0,952,0,0,0,0,568,0,0,0,0,0,448,0,0,0,
+67,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1826,657,0,729,666,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+669,0,0,0,0,0,0,0,402,0,0,152,0,0,0,0,912,0,0,0,0,0,0,51,320,0,445,0,0,0,0,308,
+0,0,0,0,0,386,0,0,239,0,0,130,83,0,143,0,348,0,0,0,0,0,0,0,958,0,0,0,0,0,210,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,430,0,0,0,0,0,0,0,0,0,0,0,0,7,213,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,801,0,0,0,0,0,0,0,0,0,936,0,108,0,0,
+0,0,0,0,0,0,0,885,587,219,398,364,0,1165,0,0,342,241,303,0,0,0,0,0,0,0,0,0,0,
+1454,0,0,0,0,0,0,0,0,0,0,254,562,0,786,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1294,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,493,216,0,0,0,0,219,341,0,0,0,0,0,
+0,0,0,0,0,130,1734,154,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,701,604,0,0,879,0,195,
+666,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1669,0,0,0,1791,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1228,0,0,0,0,0,623,0,0,0,0,0,0,0,798,0,0,0,0,0,0,0,0,0,0,0,0,84,
+122,0,0,0,837,0,0,0,0,0,0,1013,0,0,577,0,0,0,460,932,0,0,0,0,0,0,0,0,0,0,0,31,
+131,0,0,0,605,0,0,0,1246,0,0,0,0,68,278,165,307,781,0,0,0,0,0,0,33,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1113,0,0,720,1953,203,0,0,0,0,0,0,0,425,326,0,0,0,0,0,
+0,0,0,0,0,241,1316,0,0,0,0,0,416,0,0,0,1300,0,847,0,0,662,358,0,0,0,0,839,1823,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,654,1522,0,0,0,0,0,0,163,0,0,0,0,0,314,978,0,0,0,
+601,0,0,0,0,0,946,434,0,0,0,402,411,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13,1467,
+410,0,0,0,0,0,0,0,0,0,0,0,0,0,0,483,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,677,0,0,0,0,0,0,0,0,0,0,0,0,70,0,0,0,0,1405,0,0,0,0,0,0,108,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,777,0,0,0,0,0,747,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,505,0,326,0,0,164,628,654,0,0,0,
+37,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,668,152,0,0,0,0,0,0,0,0,0,0,0,581,
+0,0,0,0,44,126,89,0,0,0,0,0,0,0,0,1531,0,0,0,0,0,0,0,0,203,1167,0,0,0,0,0,0,0,0,
+531,1232,0,0,0,0,0,943,0,670,231,880,0,1617,0,0,0,1957,0,0,0,0,0,0,0,975,0,0,0,
+0,0,0,0,0,0,0,0,242,0,0,0,0,0,0,0,0,0,421,0,0,14,834,0,0,0,0,0,0,0,0,0,0,0,0,
+465,0,0,0,0,0,834,688,413,855,0,0,0,590,0,0,0,0,0,0,0,0,114,0,0,0,0,0,0,0,0,0,0,
+0,45,169,0,0,0,0,0,0,0,0,0,0,0,198,0,0,565,585,0,0,0,0,0,0,0,0,0,0,0,0,0,691,0,
+0,0,593,0,0,0,0,0,0,0,0,0,913,116,0,0,0,0,1360,0,0,0,802,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,673,308,0,709,1006,1895,0,228,0,0,0,1840,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,608,0,0,0,0,0,0,0,0,0,1573,0,2039,136,540,0,0,0,0,0,0,0,
+897,0,0,938,1878,0,0,0,0,0,0,0,0,0,1469,0,999,0,299,0,0,0,0,0,0,0,578,0,0,0,0,0,
+456,0,0,0,1679,163,693,0,0,0,0,0,0,48,755,0,0,0,0,0,0,0,0,0,0,0,0,338,0,0,0,0,
+1091,0,0,0,0,695,0,0,1464,0,0,0,0,0,975,0,0,335,0,0,1979,0,0,0,0,269,1566,630,
+396,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1815,634,0,0,0,966,0,0,0,0,0,0,0,9,
+412,0,958,0,0,579,382,0,212,0,0,0,0,965,681,0,0,16,0,0,0,0,0,0,0,0,0,0,0,0,655,
+0,0,0,0,67,0,0,0,0,0,0,751,0,0,0,0,423,231,0,0,1016,300,0,0,0,0,100,237,0,0,0,
+1370,0,0,0,1208,0,0,0,0,0,1219,129,0,0,0,0,0,0,0,0,0,0,0,0,0,0,199,0,0,427,0,0,
+0,0,949,665,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,712,0,0,0,0,0,1186,0,0,0,0,0,0,0,0,0,0,295,312,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+151,0,0,0,0,588,4,0,0,0,0,0,414,104,0,0,757,263,0,561,0,0,0,320,0,0,0,0,0,0,0,0,
+0,0,0,225,0,0,0,0,37,817,0,974,0,0,0,0,0,0,0,0,0,0,0,0,0,2026,131,235,16,0,590,
+1157,0,0,0,0,0,0,0,0,221,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,140,390,0,0,0,0,
+0,0,0,1144,0,0,0,464,0,0,0,0,0,0,0,0,0,0,0,0,204,407,303,1218,0,0,0,0,5,325,0,0,
+0,0,12,800,0,1783,0,0,0,0,0,0,0,0,0,0,504,621,0,0,0,0,0,0,0,0,0,920,0,376,0,0,0,
+0,0,218,580,0,768,454,0,0,0,0,0,0,0,0,0,0,0,0,676,0,0,0,0,0,0,164,0,0,0,0,0,0,0,
+0,50,0,0,0,0,0,0,0,0,0,0,0,0,0,120,285,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,226,343,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,0,0,1812,0,0,8,0,0,0,21,1125,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1327,0,0,0,0,575,1598,0,0,0,0,0,0,0,0,0,895,0,0,0,959,0,0,
+0,0,0,1759,173,0,0,0,0,266,261,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,1427,0,0,300,1033,0,0,0,0,0,0,0,0,0,0,0,584,0,0,0,0,52,734,
+0,0,217,239,0,1129,0,0,0,0,0,0,0,0,732,20,0,0,0,0,0,0,0,0,0,0,0,418,0,0,0,613,0,
+0,0,0,0,0,0,0,0,632,0,0,85,984,0,0,0,0,909,694,7,1109,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,167,0,0,0,0,280,62,0,0,33,0,0,359,186,980,0,0,0,0,0,0,0,0,0,0,0,585,0,0,0,
+211,0,0,336,145,0,1130,0,873,0,0,840,263,0,0,0,0,0,0,0,0,0,916,0,0,0,0,0,0,0,0,
+0,0,155,0,0,0,461,97,0,0,0,0,0,1356,0,0,0,0,0,0,0,593,0,0,0,0,0,1392,0,0,0,0,
+126,0,0,0,0,1179,0,0,0,0,0,162,0,0,0,0,0,765,0,187,0,1286,0,0,0,0,0,0,0,0,0,635,
+0,0,23,215,0,0,0,1306,0,0,97,716,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,657,0,
+0,0,0,0,0,0,0,299,0,0,0,0,0,0,134,0,0,0,0,0,0,0,0,0,0,0,658,1082,0,0,0,0,0,2002,
+0,0,0,0,0,0,833,248,0,0,0,0,0,1654,0,0,531,0,0,0,0,0,0,634,0,0,0,0,0,0,0,0,0,
+853,573,249,0,0,0,0,0,0,0,0,527,0,0,0,0,1419,0,0,0,0,0,0,20,49,0,0,0,992,0,0,0,
+728,0,0,0,0,0,0,0,0,0,0,0,0,497,1579,0,0,0,0,62,268,0,0,0,0,0,0,0,1201,0,0,0,0,
+0,0,0,0,0,0,0,0,495,193,0,0,0,0,106,0,0,859,0,0,23,0,0,0,0,0,0,0,813,925,0,0,
+223,613,953,0,0,0,0,0,0,0,0,666,0,0,0,0,0,0,0,0,0,670,0,0,40,216,0,0,0,0,0,0,
+259,0,0,0,440,1114,0,0,0,0,0,0,0,0,74,475,0,0,188,139,0,797,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1572,0,0,0,0,39,0,0,0,0,0,0,0,0,0,0,0,0,1594,0,0,0,0,0,0,0,290,0,232,
+0,0,887,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,521,14,0,0,0,0,0,741,0,0,0,992,0,
+0,0,0,0,0,0,0,111,0,0,425,0,0,0,0,0,789,0,0,0,1593,0,1768,0,0,233,0,0,0,0,943,0,
+0,0,0,0,0,0,955,225,245,0,0,0,0,0,0,241,0,0,0,0,1943,0,0,0,1284,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,709,0,0,0,0,0,0,554,0,0,0,0,0,0,0,0,1564,0,0,0,
+443,0,0,0,0,0,0,280,0,0,0,0,0,0,0,0,729,0,0,0,348,0,0,0,0,0,0,0,758,848,298,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,829,1422,189,121,0,0,632,812,0,0,556,0,0,0,0,0,436,172,
+530,844,232,984,0,0,0,0,0,0,0,0,0,0,147,0,0,0,0,0,0,0,0,537,0,0,0,0,0,859,0,0,
+842,0,0,0,0,0,0,0,0,0,0,1291,0,0,0,0,0,0,0,0,0,0,0,1482,612,392,0,0,0,262,31,0,
+0,0,0,0,0,0,0,0,0,753,549,0,0,0,0,0,0,696,0,0,0,0,0,0,0,834,0,0,0,0,0,771,0,0,0,
+0,0,0,0,0,0,0,0,0,0,921,0,0,0,674,0,0,0,0,0,0,0,0,0,0,308,444,0,0,0,0,0,0,805,
+180,0,0,278,271,0,0,214,505,0,1215,0,0,0,0,0,0,387,271,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,1645,42,92,0,459,0,0,330,1557,0,0,0,0,0,0,0,0,113,18,0,0,0,
+1742,0,0,0,965,0,0,0,0,0,0,0,0,0,0,0,0,0,182,0,0,65,0,0,0,0,0,0,0,0,0,0,0,0,973,
+0,0,0,0,0,328,0,0,588,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1786,
+0,0,962,1985,0,0,0,308,508,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,588,0,0,0,0,0,0,614,793,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,290,0,0,0,0,0,0,0,0,0,0,1136,0,0,0,0,0,0,0,0,0,0,796,719,0,0,
+326,210,0,0,0,701,758,472,0,0,0,1947,278,1079,0,0,0,0,0,0,497,41,0,0,634,46,961,
+0,810,524,0,0,33,0,0,0,0,0,0,0,0,0,0,0,0,532,0,997,0,0,0,0,0,0,0,0,0,0,0,1301,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1298,0,671,0,0,0,306,0,0,0,0,0,0,0,0,0,0,
+693,1823,0,0,0,759,0,0,0,0,0,1932,0,0,0,0,0,0,0,0,0,0,0,0,0,0,88,182,0,0,0,1964,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,521,0,0,0,0,0,0,424,857,0,0,0,0,671,328,0,
+529,0,0,0,0,0,716,0,1509,80,67,0,0,0,0,59,141,0,0,0,0,0,0,783,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1498,0,0,0,0,343,430,803,1183,677,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,19817,0,5579,9350,0,0,21002,19718,0,0,0,21926,0,0,0,0,0,0,0,0,0,0,0,0,0,20711,
-0,0,0,20197,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,40550,0,0,0,57510,0,0,0,53895,
-0,0,15017,0,17000,39367,2347,0,0,0,0,0,0,0,0,0,8588,0,0,0,0,0,3273,17862,3498,
-2085,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19048,0,0,0,0,0,11978,58631,0,0,0,0
-,0,0,523,0,12969,198,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28197,0,47846,0,0,0,0,0,0
-,0,0,0,4549,0,0,0,0,0,0,0,0,0,0,687,14917,748,8229,0,0,0,0,0,0,2476,12935,0,0,0,
-0,0,0,22792,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27528,59142,0,0,20876,20134,0,0,0,
-0,440,12068,0,58951,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48038,0,0,0,60999,0,0,0,0,
-0,0,0,0,0,0,0,0,0,15716,7498,5476,0,0,0,0,20202,37959,0,0,0,0,0,0,0,0,0,0,0,0,
-29801,0,5451,0,0,0,0,0,0,0,0,0,0,50790,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24485,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13573,0,0,22856,0,0,0,0,21927,0,0,0,0,0
-,0,9130,0,0,0,0,0,0,13732,0,0,0,0,0,0,0,0,0,0,2282,583,0,0,0,0,0,0,0,0,0,0,3726,
-26503,0,0,0,0,0,0,9258,0,0,0,0,0,0,0,0,21604,0,0,0,45574,0,0,0,0,0,20710,0,0,0,
-42694,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1163,6694,0,0,0,0,0,0,0,10948,0,0,0,29700,0,0,
-0,0,0,58823,3796,27399,20939,10180,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-19,29287,28649,14534,0,0,16428,45607,0,0,0,0,0,0,25322,0,4908,0,0,0,0,0,0,25476,
-29097,14246,11053,0,0,0,0,0,0,0,0,18502,0,0,0,44390,0,0,0,17765,0,0,0,0,0,0,
-24520,0,0,0,0,0,0,0,0,0,0,17319,0,0,0,0,0,0,0,0,0,0,0,0,0,28166,0,0,0,0,0,48198,
-0,0,31467,0,24585,0,0,0,0,18692,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23596,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,7236,968,13637,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3763,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14791,0,0,0,12324,0,12741,0,0,0
-,0,0,0,0,0,0,11108,0,0,0,0,4009,40295,20616,4357,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-15015,0,0,0,0,0,43751,0,0,0,0,0,0,0,0,0,0,0,23013,0,0,0,0,0,0,0,0,0,0,0,0,0,
-45542,0,0,0,0,0,0,0,0,0,23974,0,0,0,0,17480,20647,0,0,0,0,0,0,8876,0,0,40806,0,0
-,0,0,0,0,0,14502,17160,17764,0,0,31594,35431,0,0,2890,0,0,0,0,0,0,0,0,27524,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8228,0,56583,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,34278,0,0,0,0,0,0,0,0,0,0,0,0,0,2662,0,26724,0,0,0,0,0,0,0,64198,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22281,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3049,
-54983,0,0,0,0,0,0,0,837,0,17604,0,0,0,0,0,28838,0,0,0,0,0,0,26312,0,0,3910,0,0,0
-,25830,0,0,0,0,0,8391,0,19845,19240,1092,0,0,5449,0,0,0,0,17188,0,0,0,0,0,0,0,0,
-0,10629,0,0,6671,61094,5832,8358,0,0,0,55078,0,0,0,0,0,29860,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,0,0,51494,0,28647,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,25989,0,0,30153,61318
-,0,0,0,0,0,0,0,24903,0,0,0,4388,0,42054,0,0,0,0,0,0,0,53158,0,0,0,0,0,0,0,50918,
-0,0,0,0,0,0,26251,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5929,2853,0,37126,
-7372,197,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2027,934,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,55686,0,0,5672,5447,0,62758,0,0,0,0,0,0,0,0,0,0,0,0,2923,0,556,1415,
-0,0,0,0,0,0,0,0,0,8645,0,9477,0,0,0,0,0,0,0,48742,0,0,0,0,0,0,0,0,0,0,24235,228,
-0,0,0,0,0,0,0,0,0,0,16970,18823,0,0,0,0,0,0,0,0,0,25158,0,0,0,0,0,18567,20072,
-2823,14313,1830,0,0,0,0,0,0,0,0,27048,23526,0,0,0,0,0,997,492,0,14730,16677,396,
-13574,0,0,0,41671,0,0,0,0,0,0,0,19045,0,0,0,421,17545,3110,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,47111,14475,56551,0,0,0,0,0,0,0,0,0,0,3697,0,0,0,0,0,0,49382,0,35559,0,
-0,0,0,40,0,11496,15621,0,8550,0,0,0,63462,0,0,0,0,0,0,0,36966,0,50406,0,46022,
-1001,0,0,12069,3249,0,0,0,0,0,0,0,0,0,0,0,0,0,15241,0,0,0,0,0,0,0,0,64743,0,0,0,
-0,0,58759,0,0,0,0,1136,26981,0,0,0,0,0,0,0,17732,0,0,0,17157,20011,6629,0,43879,
-0,0,0,13572,25128,10759,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28676,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,875,24007,0,0,0,0,7628,0,0,0,0,0,12268,0,0,0,0,0,0,0,0,19300
-,23210,356,0,0,0,0,0,0,0,0,0,15236,0,0,0,0,0,49670,0,0,0,0,0,0,0,21764,0,0,0,0,0
-,0,0,0,0,0,0,0,0,0,0,0,13931,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45799,0,0,436,3589,
-0,0,11402,0,0,0,0,0,0,0,0,0,0,62822,0,0,0,39814,588,0,0,0,0,0,0,27750,0,0,0,0,0,
-0,1609,22660,2346,18951,0,16068,0,0,0,0,0,0,5162,11110,0,0,0,0,15048,1060,0,7879
-,18280,326,0,14886,19656,0,7594,0,0,0,0,0,781,581,0,16198,0,0,0,0,0,0,1078,9892,
-0,0,0,0,0,0,0,0,0,0,4489,0,0,0,0,33798,0,0,0,54534,0,0,0,0,0,0,0,33158,0,0,0,0,0
-,0,0,0,0,42086,13834,2757,8456,16773,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3434,0,0,0,
-0,0,3946,29668,0,0,30634,36775,0,0,0,0,0,24901,0,16069,6280,0,0,0,0,41990,0,0,0,
-0,0,0,0,27365,0,0,0,0,0,0,0,0,0,0,1450,44807,0,0,0,32100,0,0,0,0,0,35110,0,0,0,0
-,0,0,0,0,17448,19591,0,0,0,0,0,0,0,0,0,0,0,0,1739,0,0,0,0,5511,0,0,0,32934,0,0,0
-,0,0,0,0,0,0,18180,0,0,0,23428,19754,0,0,31174,3021,31655,23464,0,0,0,0,0,0,
-57255,0,0,21292,64487,0,0,0,0,0,0,25802,9189,0,0,0,0,0,49254,0,0,0,0,0,0,0,0,0,0
-,5837,50023,0,0,0,0,0,0,0,0,0,15495,0,0,0,0,0,51942,0,0,0,0,0,0,0,0,28104,58662,
-0,50214,0,0,0,0,0,0,0,0,2988,0,22888,31812,0,0,0,0,0,2020,0,18916,0,0,0,0,0,0,0,
-23973,0,0,0,0,17516,11717,0,0,0,55911,0,0,0,0,0,0,0,2855,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,46822,0,24710,28586,0,0,0,1556,0,0,30117,0,0,22090,57127,3403,14087,0
-,0,0,0,0,0,0,0,0,0,1041,0,10633,6916,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27269,0,0,13322,18055,0,29380,0,56454,0,0,120
-,0,0,8773,0,0,0,0,16040,0,0,0,0,0,0,0,27242,23781,0,1572,0,28134,0,0,1512,0,0,0,
-0,0,0,27684,0,38470,0,0,0,0,0,0,1513,8709,0,0,0,0,0,0,0,0,0,0,0,46566,0,0,0,0,
-28521,61159,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24356,0,0,0,0,0,0,0,0,0,13028,0,
-5863,0,0,15693,0,0,0,0,0,0,0,1131,23398,0,0,0,0,0,0,0,26212,0,0,0,0,0,0,0,0,0,0,
-0,0,0,18404,0,0,0,0,1457,26183,0,0,2475,7110,0,0,0,0,27180,60166,0,0,0,20262,0,
-41862,0,0,0,0,0,0,0,0,0,0,2762,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26148,0,0,0,0,0,0,0,0
-,0,28229,0,0,0,29254,0,0,0,0,0,0,0,0,0,0,27690,0,0,13636,12776,1862,0,0,0,0,0,0,
-17225,3271,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28039,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-,0,0,0,0,0,0,0,0,0,4457,18117,0,2023,402,0,0,0,0,0,0,0,0,0,0,0,0,0,104,3654,0,0,
-0,0,0,0,0,0,18440,0,0,0,0,0,0,0,0,29861,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,22150,0,0,0,0,0,0,0,0,0,0,0,0,24074,0,0,0,0,0,0,0,0,12004,0,32358,
-0,0,3081,0,0,0,0,0,0,0,0,0,4749,0,0,0,0,0,0,0,0,0,0,0,10792,1799,21322,0,7880,
-12613,0,0,0,0,0,0,0,0,13993,0,0,0,16202,0,0,0,0,32102,0,37223,0,10500,0,0,0,0,0,
-0,0,0,32008,0,0,0,0,0,23816,3236,0,0,0,0,0,23237,0,0,5642,0,4684,294,0,0,0,0,0,0
-,0,0,0,0,0,0,0,0,0,0,0,0,0,26852,0,0,0,0,0,0,7148,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,7890,61798,939,0,0,56679,0,0,0,0,0,27078,202,5029,0,0,0,0,0,
-0,0,0,0,28005,0,0,15273,24741,5676,20452,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55910,0,0
-,0,0,5069,27942,0,21092,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,12517,0,0,0,0,0,0,
-0,0,0,0,0,0,21384,28260,0,2502,20108,0,0,0,0,0,0,0,0,0,0,0,0,46726,0,30790,0,0,0
-,0,0,14725,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1099,6372,0,0,0,12422,15182,0,8683,0,
-10665,19462,0,0,0,0,0,0,1590,0,31628,0,22632,19750,0,0,0,0,0,0,0,24198,0,0,0,0,0
-,50662,0,0,0,0,0,0,0,0,0,0,9131,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11015,0,0,0,0,0,0,0,
-0,16490,54695,0,0,0,0,0,0,0,0,12937,0,0,0,0,16004,0,0,0,0,0,0,0,0,0,2181,6923,0,
-0,0,0,0,0,0,15624,11302,0,0,5673,7559,0,0,14668,15684,0,0,0,0,0,0,24204,48134,0,
-24230,0,55527,0,0,3464,19141,0,0,0,0};
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1357,53,0,0,0,0,590,0,0,0,0,0,0,0,0,0,0,
+0,0,0,329,0,0,0,0,0,0,0,469,0,0,0,0,0,0,0,0,0,0,460,0,0,1743,0,0,963,340,0,0,0,
+0,0,1603,0,0,250,0,0,0,0,0,646,218,0,1794,0,0,0,571,0,455,0,0,0,1012,0,0,0,0,0,
+0,0,0,0,0,0,0,597,161,0,349,0,524,0,0,0,0,0,0,0,0,0,0,0,0,322,432,0,0,0,0,0,0,
+325,223,0,0,0,0,0,566,0,0,0,1394,481,436,0,48,457,610,756,618,0,0,0,755,0,1217,
+0,0,0,0,0,197,0,0,0,0,0,0,0,0,0,0,0,0,0,0,544,492,107,414,0,0,0,0,0,0,0,0,0,0,0,
+1007,0,0,0,0,5,0,0,1580,0,0,0,0,0,0,0,0,0,0,0,0,0,673,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1843,0,0,0,0,0,0,0,0,0,165,0,0,0,0,0,0,809,885,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,498,0,0,0,306,9,0,0,0,0,0,0,0,437,721,146,0,0,0,0,0,0,0,0,0,0,0,177,0,0,0,0,
+0,0,0,1377,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,200,0,959,0,0,0,1928,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1435,0,481,0,0,0,0,0,0,142,84,0,0,0,0,0,
+1015,0,0,0,315,0,0,0,0,0,0,759,0,0,0,0,0,0,0,0,712,0,0,0,1722,0,0,0,0,0,0,0,0,0,
+0,0,0,222,0,985,1414,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1273,
+538,706,0,0,0,0,0,0,0,0,115,0,0,0,0,0,0,0,0,0,0,1781,0,0,0,0,0,431,97,665,42,
+237,0,0,0,264,0,0,213,0,0,0,0,0,0,0,455,0,0,0,906,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+624,0,574,0,0,0,0,0,0,0,0,0,0,0,0,354,0,0,0,1558,0,0,0,0,0,0,0,0,0,0,0,0,0,0,68,
+235,723,1813,0,0,0,957,0,830,0,0,0,0,0,0,0,0,0,0,0,0,23,0,0,496,0,0,0,0,0,0,0,
+547,239,88,0,0,0,0,0,0,0,0,0,1310,0,0,0,0,0,0,0,0,80,1076,0,0,118,0,0,0,479,274,
+0,0,0,0,0,0,0,0,0,0,0,497,0,0,669,261,0,0,0,0,13,0,0,0,0,0,0,791,250,642,0,0,0,
+1429,939,949,0,0,0,0,0,0,0,0,0,0,0,0,0,818,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,982,330,0,0,0,0,545,0,0,0,0,0,0,947,0,1188,0,0,0,0,0,904,0,0,0,0,0,1372,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,693,377,0,0,0,0,0,0,0,0,0,0,0,0,0,0,695,0,0,
+713,386,0,0,0,0,128,1575,0,0,0,0,0,0,424,893,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,904,0,0,0,0,0,552,322,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,1808,49,0,0,0,0,
+1832,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,421,0,0,442,415,0,0,289,
+0,0,0,0,0,206,110,0,0,0,0,0,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+19,1539,0,0,0,0,0,1340,0,1194,0,0,0,0,0,0,0,0,549,0,0,0,0,0,0,0,0,1720,0,0,0,0,
+0,0,0,0,0,319,0,0,0,0,112,1180,0,0,0,0,0,0,0,0,0,0,0,967,0,0,0,0,0,0,0,0,0,1940,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,735,0,0,0,0,0,0,0,0,0,897,132,0,0,0,0,0,0,0,
+0,0,0,38,838,0,0,0,379,218,8,660,1017,0,0,0,0,0,0,111,387,647,877,0,0,53,790,0,
+0,0,0,0,0,0,0,458,0,0,0,0,0,0,954,0,0,0,394,0,1367,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,882,0,0,0,0,0,0,0,1409,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,124,342,199,0,0,0,0,
+0,0,0,0,0,0,724,628,0,0,0,0,804,266,0,0,0,0,0,208,0,79,0,0,0,0,0,0,0,0,741,0,0,
+0,0,0,0,0,0,0,0,606,0,1494,821,1553,0,0,135,405,0,0,178,100,0,0,0,0,0,0,0,0,0,0,
+0,0,0,481,0,0,0,1378,0,0,0,0,0,0,0,0,0,0,0,0,0,791,33,1227,857,0,467,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,447,0,0,0,0,0,0,86,128,0,0,0,0,0,0,587,0,0,0,692,1018,0,
+195,0,0,0,0,0,0,0,1546,0,0,0,0,0,0,0,0,0,0,0,684,0,0,345,0,0,0,0,0,0,365,0,1683,
+0,0,472,0,433,0,0,0,0,0,0,0,28,0,0,0,997,0,705,3,0,0,0,0,0,0,0,0,0,229,0,0,0,0,
+102,0,0,0,0,866,1022,0,0,0,0,0,0,0,0,0,55,0,115,0,0,0,0,933,0,0,0,0,0,0,0,702,0,
+0,0,0,0,0,0,1728,26,484,0,0,0,185,618,417,0,803,0,0,0,0,0,0,0,0,0,0,0,1262,0,0,
+0,0,0,0,0,0,0,0,0,0,0,633,0,0,0,0,0,0,0,0,0,0,0,0,0,479,262,0,0,0,0,0,0,830,0,0,
+0,0,26,70,0,0,0,0,0,0,0,0,217,0,640,51,0,0,360,1586,0,0,0,0,0,652,0,0,0,0,0,766,
+0,0,0,0,298,737,0,0,0,0,0,0,0,0,0,0,655,222,906,0,0,1013,991,2009,0,0,0,0,503,0,
+0,0,216,154,0,0,0,716,0,844,0,0,0,0,621,252,0,0,0,0,748,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,103,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,576,0,0,0,648,0,0,0,331,0,0,0,
+0,0,0,0,0,0,0,0,0,632,0,0,0,518,107,0,0,0,0,0,0,0,0,851,0,0,0,0,504,0,0,0,0,0,0,
+0,0,0,0,0,0,7,883,0,0,0,0,0,0,0,922,0,0,0,0,0,0,0,0,91,993,0,0,0,0,0,0,200,131,
+10,0,0,0,0,0,0,0,0,0,0,0,0,0,365,1433,0,0,0,0,28,103,0,0,798,1013,0,0,0,0,0,0,0,
+0,39,1925,0,853,0,0,271,519,0,0,0,0,338,0,0,300,470,419,0,0,0,0,0,0,836,0,0,0,0,
+0,0,1937,0,0,0,0,0,393,0,0,357,0,0,0,0,0,703,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,387,0,0,0,0,0,0,75,708,453,1351,0,303,0,0,772,0,0,0,0,0,0,0,0,749,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1065,0,0,717,226,0,0,0,0,0,890,431,626,0,0,0,0,706,0,0,0,
+51,698,0,0,0,0,0,0,0,0,0,0,0,828,0,0,17,0,0,0,0,1929,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,84,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,871,498,0,101,1793,0,0,0,0,0,0,435,0,
+0,0,0,0,966,0,129,1644,0,0,0,0,0,0,0,0,0,0,0,0,0,997,502,0,0,0,0,0,0,0,0,0,0,0,
+0,823,0,1927,0,0,0,0,98,1756,0,0,0,0,0,0,0,0,0,0,0,0,8,0,160,1046,0,492,0,0,0,0,
+0,0,129,45,0,0,0,0,0,0,353,558,0,0,0,0,0,785,0,0,0,1145,189,0,0,0,26,353,0,0,0,
+0,0,2024,0,0,0,606,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32,855,0,0,0,0,0,0,0,0,0,0,0,
+0,0,2011,0,0,5,4,0,0,461,764,0,0,0,1449,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1445,0,0,
+0,1168,0,0,0,233,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,0,0,216,0,0,0,286,0,0,0,
+3,0,0,0,723,536,0,0,0,0,0,285,0,0,0,560,0,0,0,0,0,690,0,0,0,0,0,1246,0,0,63,0,
+33,0,0,0,0,0,520,1862,0,0,0,0,0,0,0,0,0,0,0,0,630,0,0,0,0,554,0,0,0,0,0,1001,0,
+0,0,0,0,446,0,0,0,0,0,0,0,1313,0,0,837,636,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,278,
+0,0,0,0,0,0,0,0,868,0,0,0,0,1010,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1231,0,304,0,506,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26,0,93,1408,794,
+843,704,0,285,114,485,898,145,0,19,2035,0,0,0,1933,0,0,0,0,0,0,0,1728,0,0,0,0,0,
+0,0,0,746,0,0,0,0,0,0,0,995,1964,0,0,0,0,0,0,0,0,0,0,0,1550,0,874,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,1018,0,0,0,814,126,0,0,1264,0,0,814,955,0,0,0,0,0,0,
+0,981,0,0,0,0,0,0,0,0,915,56,0,0,100,0,0,0,0,0,0,0,0,0,638,0,0,0,0,738,0,0,0,0,
+0,0,0,0,0,758,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1112,0,0,214,0,0,0,133,0,196,
+168,0,0,0,0,0,1152,0,1245,0,0,538,169,871,1816,0,0,413,133,0,0,0,978,0,0,43,93,
+371,0,0,0,0,0,0,526,25,0,754,335,0,0,0,0,182,0,0,0,0,0,0,0,0,0,0,0,39,601,0,0,0,
+0,0,0,0,181,370,0,0,1652,358,0,0,0,0,0,0,0,0,0,176,286,0,788,0,0,0,0,0,1223,780,
+254,1003,896,0,0,0,1447,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,744,0,0,0,0,0,126,0,
+41,788,0,0,0,629,0,0,0,0,0,0,0,0,0,0,0,293,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,420,37,1900,0,0,0,0,542,1570,957,0,0,0,0,0,0,
+0,373,31,0,0,0,0,125,325,0,0,0,0,0,0,323,0,0,1547,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1216,0,0,0,0,0,0,198,1905,629,15,0,0,0,0,0,0,20,75,543,1353,0,0,0,533,0,0,6,0,0,
+0,0,0,0,538,0,0,0,0,0,0,0,0,0,0,0,338,0,0,0,0,11,0,0,0,284,659,0,989,0,0,0,0,0,
+0,0,0,0,848,0,0,507,0,0,0,0,0,0,0,0,188,991,884,0,0,0,0,60,959,0,0,0,0,0,1653,0,
+0,922,337,0,638,0,0,500,0,0,0,0,0,0,0,0,0,0,0,166,0,0,0,0,0,0,0,0,0,0,0,0,418,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,760,0,0,0,0,0,0,1277,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,770,0,0,0,0,0,0,0,243,89,0,0,0,0,0,0,0,0,0,1396,0,
+560,0,0,3,1658,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,586,0,0,1271,0,0,0,505,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,637,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1947,
+41,445,0,0,0,0,0,0,0,0,57,189,0,0,371,0,0,0,0,552,0,883,0,923,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,875,0,0,0,1788,49,0,0,0,0,0,
+0,0,0,0,0,0,661,0,0,1945,0,0,0,0,0,794,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1135,0,0,0,745,0,0,0,0,0,0,0,84,0,0,0,0,0,0,0,410,0,976,0,0,0,0,0,703,0,0,
+0,0,0,0,187,322,0,0,0,227,0,0,0,0,560,0,31,1395,0,0,0,0,0,466,0,0,0,0,643,167,0,
+0,0,1428,0,412,0,0,0,0,0,0,0,0,0,1118,562,0,0,0,0,0,256,0,0,0,0,0,0,1771,0,0,0,
+0,0,1190,132,0,66,0,0,0,0,0,0,0,0,0,0,317,0,0,0,63,0,0,0,0,0,0,0,1475,0,0,0,0,0,
+0,0,288,0,0,0,0,608,0,0,0,0,0,0,0,0,1225,0,1189,0,0,0,0,0,0,0,1468,0,0,0,0,0,
+689,120,0,0,0,0,0,0,0,1,0,329,0,0,0,0,226,0,0,0,0,0,1855,0,0,461,0,0,0,0,1346,0,
+0,0,0,0,85,0,0,299,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1171,0,0,
+0,980,0,0,0,0,0,0,0,0,637,279,0,0,0,0,0,293,0,0,0,0,528,17,0,0,0,0,5,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,0,601,0,0,0,0,0,0,779,0,
+196,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1322,737,752,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,412,192,80,0,0,8,1470,0,0,0,0,0,0,0,0,0,873,0,0,0,0,0,835,0,0,0,0,256,
+38,986,0,0,0,0,0,0,0,0,0,91,257,278,911,0,0,0,0,0,0,0,0,749,151,0,0,0,0,0,0,0,0,
+0,0,0,0,989,0,0,990,0,0,90,194,0,0,0,0,0,425,0,0,0,0,0,774,0,0,0,0,0,0,0,0,0,0,
+646,827,752,0,0,0,662,0,22,21,0,0,0,0,0,0,95,239,0,0,0,431,0,0,0,0,0,874,0,0,
+265,65,0,0,0,1350,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1887,0,0,0,0,0,0,0,809,
+0,696,0,1074,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,630,0,0,802,0,0,0,56,776,0,
+970,0,0,797,0,0,0,0,0,400,0,0,1951,0,0,41,0,11,118,0,0,0,0,0,0,0,0,251,615,0,0,
+0,1044,0,0,0,0,0,0,0,0,0,0,0,225,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,370,0,0,0,0,
+104,48,209,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,930,0,0,0,0,
+0,0,0,0,0,0,0,1286,0,759,0,120,385,0,0,0,429,0,0,0,0,0,0,0,0,820,0,0,0,0,0,0,
+199,0,10,151,0,0,0,761,365,0,0,0,0,0,0,0,0,0,46,1086,0,0,0,0,11,1624,58,344,0,0,
+1008,1868,0,0,0,888,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,711,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,440,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,914,1913,0,958,0,885,0,0,0,0,0,0,0,0,0,0,0,
+0,0,847,276,0,302,65,0,0,0,510,0,1514,0,0,0,0,0,0,152,291,0,0,0,0,0,0,0,0,0,0,0,
+0,282,589,0,0,0,0,0,0,0,0,0,0,0,0,0,130,0,0,463,42,0,0,0,0,0,372,0,0,0,0,0,0,0,
+0,0,680,0,0,0,0,0,0,0,0,977,1997,0,0,0,810,0,0,0,0,0,0,0,0,0,1390,0,0,0,644,0,0,
+867,982,0,0,0,0,0,0,0,540,0,123,0,0,0,1978,0,0,0,0,789,623,0,1723,0,1220,0,0,0,
+0,0,0,0,480,0,0,0,0,0,0,0,0,0,0,0,888,0,0,0,0,0,0,0,0,0,0,0,0,299,1995,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,788,179,0,0,0,0,0,0,431,156,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1373,39,80,196,0,0,507,0,0,0,646,0,0,0,0,
+0,1214,0,0,0,0,926,0,0,0,1,114,0,0,0,0,0,446,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,490,0,0,0,491,0,1584,0,0,507,250,0,0,0,158,
+10,362,1,0,0,0,0,0,0,0,0,0,408,228,860,480,0,779,0,0,0,557,0,0,142,197,0,0,0,0,
+0,0,0,0,0,0,0,1490,11,378,316,1057,0,0,18,579,299,1546,0,177,0,0,0,0,0,0,0,0,0,
+411,0,0,0,0,727,439,0,0,0,0,0,1528,0,0,0,0,0,0,58,0,482,0,0,0,505,1952,0,0,0,0,
+0,0,0,0,0,0,0,242,0,0,0,0,0,0,0,953,0,0,0,0,802,0,0,0,0,0,0,0,0,0,0,290,0,0,791,
+52,0,0,0,0,0,0,0,0,0,0,0,112,0,0,0,0,0,1028,0,0,138,0,0,0,0,1811,0,0,0,0,0,0,
+934,1821,0,0,0,0,371,38,0,0,0,1296,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,723,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1330,0,0,0,0,0,0,0,1255,296,109,0,0,0,0,0,660,0,0,0,0,270,591,0,
+0,0,0,0,0,0,1090,81,0,0,0,0,391,0,0,0,0,249,322,0,0,0,0,0,0,0,1412,0,0,0,0,0,0,
+0,0,0,0,526,632,0,0,0,0,0,0,235,144,0,0,0,0,0,940,0,0,0,52,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,309,196,0,0,0,0,0,1912,0,1290,0,686,0,0,625,0,0,0,0,0,0,0,0,0,0,0,412,0,
+0,0,0,43,0,0,0,0,11,967,758,0,0,0,0,0,0,0,0,0,0,0,0,0,0,220,0,0,0,0,0,0,0,0,0,0,
+873,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,890,0,0,2,0,0,0,0,0,0,0,0,1774,
+393,263,0,0,0,0,0,0,818,456,0,0,251,178,393,97,0,0,0,0,0,674,168,0,0,0,0,0,0,0,
+159,1639,0,0,0,0,0,0,0,0,59,934,0,191,0,0,0,0,346,165,0,877,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,128,0,0,0,0,0,0,1297,0,0,0,0,0,0,164,0,0,0,15,132,241,1073,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,228,324,53,0,0,910,0,0,0,0,0,0,0,0,734,705,
+217,73,0,0,0,0,0,0,0,0,636,389,0,1409,0,0,0,0,0,893,0,0,0,0,21,0,0,0,0,0,0,0,0,
+0,0,0,0,0,721,0,0,0,959,0,0,0,0,1433,0,0,0,0,0,0,0,0,0,0,0,0,174,189,0,0,0,0,0,
+0,0,0,0,0,22,2,0,0,815,354,0,0,0,0,425,0,411,60,13,1611,0,0,0,0,0,0,0,0,0,0,0,0,
+0,1478,596,0,0,398,0,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,1159,0,0,0,0,0,
+592,223,0,0,0,0,0,0,0,245,64,0,0,0,0,278,0,604,0,0,1502,265,0,0,0,0,0,0,0,310,
+1763,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,129,0,0,0,0,0,0,0,0,0,1356,0,0,0,0,0,0,0,
+0,505,0,0,0,0,0,0,0,1000,0,0,966,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,839,0,0,0,0,0,0,
+0,0,0,0,0,0,0,637,0,0,0,0,0,0,0,0,0,0,0,0,0,0,590,0,0,0,0,280,0,0,0,1386,0,0,0,
+281,0,1064,0,0,0,0,0,917,0,0,15,555,0,0,1014,1883,0,0,0,965,0,0,117,33,0,0,0,
+801,0,0,0,0,0,877,0,824,0,0,0,0,0,0,0,0,0,0,0,365,0,0,0,0,0,0,774,7,0,430,0,0,
+231,360,0,0,0,0,0,0,0,0,822,740,0,0,929,1485,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,852,0,0,0,0,17,0,0,0,0,0,0,1001,0,0,0,0,35,831,0,0,384,457,0,0,0,1351,0,27,
+0,0,984,0,264,552,0,401,0,0,0,710,0,1211,0,0,11,205,0,0,0,0,0,0,0,0,0,0,0,0,5,
+579,0,717,0,0,1011,0,0,0,0,0,0,0,0,0,0,0,0,0,0,805,0,0,0,0,0,0,0,0,0,0,0,489,0,
+0,0,1024,0,0,0,0,0,0,0,0,0,892,0,0,0,0,0,0,0,0,0,0,0,0,473,0,0,0,659,864,0,0,0,
+0,0,0,152,819,0,51,0,0,0,0,0,0,0,0,0,0,130,0,0,0,0,0,229,0,0,0,0,674,0,0,0,0,0,
+0,0,0,0,770,52,79,0,0,0,1666,0,409,0,0,0,0,0,0,0,195,0,688,0,0,0,0,0,0,0,0,0,0,
+0,889,174,160,0,0,0,0,0,0,0,0,0,0,0,0,0,872,0,918,569,268,0,0,0,1224,0,1361,0,0,
+0,0,0,0,0,0,0,374,0,0,0,0,0,731,0,0,0,0,190,0,0,0,0,0,0,0,202,506,444,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,835,0,17,1526,0,0,0,0,0,477,0,0,
+994,1374,76,0,0,0,0,0,0,0,355,287,0,1389,0,0,0,0,0,0,455,384,0,0,0,264,0,0,0,0,
+0,0,0,0,0,0,0,0,1001,0,0,0,0,0,0,0,0,0,0,0,0,28,0,0,0,851,175,359,0,0,0,0,0,0,0,
+0,287,740,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,857,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+819,1402,0,0,0,0,0,0,174,224,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1649,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,655,573,0,0,0,0,0,0,0,0,128,351,0,0,0,0,0,0,
+0,0,0,0,0,918,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,687,0,0,0,0,0,0,0,0,0,1525,
+0,0,0,1009,0,0,0,0,0,0,0,340,0,0,0,0,0,0,0,0,0,0,861,0,176,0,0,0,0,0,0,0,0,0,96,
+985,0,615,0,0,0,0,0,0,0,1919,0,0,0,0,0,1131,0,0,0,0,0,0,0,247,0,0,0,0,27,23,0,0,
+0,0,0,0,0,0,38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1015,0,0,0,0,0,1088,0,0,
+0,0,0,1585,0,0,0,0,227,0,0,0,478,360,0,0,0,95,0,0,0,0,0,0,699,0,0,0,26,0,0,0,0,
+1119,0,0,0,739,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,741,67,0,0,0,0,0,0,464,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,0,96,0,0,0,26,342,0,0,0,0,0,0,203,0,0,449,0,
+0,0,0,0,0,0,0,0,0,256,311,0,0,0,0,0,0,758,0,0,0,0,0,0,0,0,827,0,0,0,0,581,64,0,
+1047,0,0,0,0,0,288,0,0,0,0,0,1375,0,0,0,0,0,0,0,0,0,0,0,1309,0,0,0,0,0,0,0,0,
+376,12,0,0,0,0,0,154,0,1520,0,1753,95,502,0,0,0,0,0,0,0,269,291,1197,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,0,0,0,0,1341,0,1017,0,0,0,0,0,0,0,
+0,857,1810,533,0,0,1453,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,836,211,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,19,0,156,0,0,0,0,1009,0,0,0,0,0,0,0,0,0,0,0,0,0,820,0,0,
+0,0,0,0,0,0,0,228,0,0,0,1131,0,1276,0,0,0,0,0,0,0,0,0,0,0,0,849,1792,0,0,389,
+291,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,525,0,0,
+0,453,0,0,0,0,666,0,0,0,422,0,355,0,0,0,0,165,0,260,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,865,0,0,0,0,0,0,0,1625,0,0,0,234,0,1383,0,0,0,0,0,0,0,0,306,0,0,0,802,1921,
+0,0,0,0,0,0,180,0,0,0,0,1312,814,0,0,0,0,0,0,0,0,0,0,707,0,0,0,1493,11,61,733,0,
+0,0,341,0,0,0,98,0,0,0,0,0,0,0,0,0,0,0,1014,0,0,0,0,0,0,0,142,102,0,0,30,0,0,
+823,0,1045,0,0,0,1930,0,1512,0,0,0,0,0,0,0,87,0,1243,245,0,0,0,0,0,0,0,48,68,0,
+0,0,0,0,0,0,0,126,77,625,938,0,0,351,0,0,0,174,1668,0,707,0,0,0,0,0,0,0,0,0,0,0,
+403,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,282,0,0,0,0,0,0,8,44,0,0,363,115,0,0,0,0,0,0,
+0,0,0,0,0,0,545,761,0,0,835,1254,0,0,0,0,930,1936,0,0,0,0,0,0,0,0,653,0,0,0,0,0,
+344,0,0,1483,673,185,0,0,460,93,753,478,0,0,0,0,0,1020,0,0,0,0,0,0,0,103,0,0,0,
+499,0,0,0,0,0,0,207,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,0,968,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,3,0,0,0,0,399,0,0,0,0,224,563,0,0,0,0,0,704,0,0,0,0,0,0,0,0,0,0,0,
+1559,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,861,0,0,0,0,946,333,746,0,0,0,0,0,
+0,0,910,0,0,0,0,0,0,0,0,0,0,0,0,0,652,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1393,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1514,0,0,0,0,201,0,510,717,0,0,528,0,0,0,0,
+20,0,0,0,1251,0,0,0,1163,0,0,0,307,0,0,0,0,0,1091,0,0,0,0,0,0,0,0,0,0,0,429,0,0,
+0,881,0,0,0,0,0,621,0,0,0,0,0,0,0,736,0,348,0,868,0,0,0,0,433,0,0,0,771,1495,0,
+0,0,0,215,0,0,0,0,0,124,0,0,0,0,0,0,0,0,0,0,0,55,0,0,0,0,0,0,0,112,62,0,856,270,
+0,572,0,0,0,0,939,0,0,0,0,0,0,0,352,0,0,0,0,0,0,0,0,0,647,0,0,0,0,10,0,0,0,0,0,
+0,0,220,0,0,0,0,0,0,0,0,0,0,0,0,0,464,0,0,109,0,0,0,1746,0,0,0,515,0,0,0,566,0,
+0,0,0,0,0,67,40,0,0,722,992,0,0,923,0,0,0,0,0,0,1145,0,0,0,0,0,0,0,0,0,0,0,568,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,247,0,0,0,0,645,0,0,328,0,0,0,0,0,0,0,0,0,0,0,0,
+1363,0,0,0,0,0,1280,0,0,0,0,0,0,0,0,0,0,7,28,360,162,0,0,0,0,0,0,0,0,0,0,0,764,
+0,0,833,862,0,856,0,0,0,0,0,0,736,92,0,0,948,1944,0,1479,63,590,0,0,0,1521,0,0,
+0,709,0,0,61,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,483,0,0,0,0,1213,
+0,0,0,0,29,1022,0,1712,0,466,0,0,0,0,0,0,0,0,0,0,0,0,0,731,0,0,0,0,0,0,171,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,241,0,0,0,0,0,0,0,0,0,0,0,964,2005,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1100,0,0,0,954,0,0,0,0,0,0,0,0,0,1958,0,0,34,549,994,0,0,449,
+137,850,0,0,670,146,0,0,0,0,518,159,0,0,0,0,0,0,0,0,151,0,0,1027,0,0,0,0,0,0,0,
+0,0,0,983,0,0,0,0,993,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,141,501,0,0,0,
+0,0,0,0,0,0,452,0,0,0,0,0,0,0,0,0,0,233,149,0,0,0,0,0,0,0,0,582,0,0,0,801,0,0,0,
+0,0,0,70,0,0,369,0,36,0,0,0,0,0,0,0,204,721,430,241,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1817,16,1078,1021,0,0,
+406,0,0,0,0,0,69,0,0,0,0,0,1830,0,0,0,824,0,0,0,0,0,0,0,0,0,826,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,816,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1000,717,1845,0,423,0,0,
+0,0,0,0,0,0,510,0,0,1048,0,0,0,618,0,0,0,520,0,0,0,0,990,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,321,0,0,0,0,0,0,0,1135,0,0,921,0,0,0,24,397,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,856,0,0,0,139,282,981,0,288,0,0,0,1890,651,56,0,0,0,0,0,0,0,
+0,261,0,0,0,0,0,0,0,0,0,0,0,617,1403,0,1205,0,0,563,0,0,0,0,0,0,0,0,333,0,0,0,0,
+0,369,0,0,0,0,0,0,0,0,0,622,0,0,0,1407,0,0,0,0,0,0,0,0,0,0,0,0,624,160,0,363,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,619,0,174,292,0,0,656,616,0,0,0,685,0,0,0,0,0,0,0,0,0,0,0,0,0,647,0,0,0,631,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1267,0,0,0,1797,0,0,0,1684,0,0,469,0,531,
+1230,73,0,0,0,0,0,0,0,0,0,268,0,0,0,0,0,102,558,109,65,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,595,0,0,0,0,0,374,1832,0,0,0,0,0,0,16,0,405,6,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,881,0,1495,0,0,0,0,0,0,0,0,0,142,0,0,0,0,0,0,0,0,0,0,21,466,23,
+257,0,0,0,0,0,0,77,404,0,0,0,0,0,0,712,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,860,
+1848,0,0,652,629,0,0,0,0,13,377,0,1842,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1501,0,
+0,0,1906,0,0,0,0,0,0,0,0,0,0,0,0,0,491,234,171,0,0,0,0,631,1186,0,0,0,0,0,0,0,0,
+0,0,0,0,931,0,170,0,0,0,0,0,0,0,0,0,0,1587,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+765,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,424,0,0,714,0,0,0,0,685,0,0,0,0,0,
+0,285,0,0,0,0,0,0,429,0,0,0,0,0,0,0,0,0,0,71,18,0,0,0,0,0,0,0,0,0,0,116,828,0,0,
+0,0,0,0,289,0,0,0,0,0,0,0,0,675,0,0,0,1424,0,0,0,0,0,647,0,0,0,1334,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,36,209,0,0,0,0,0,0,0,342,0,0,0,928,0,0,0,0,0,1838,118,856,654,
+318,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,915,895,454,0,0,513,1425,0,0,
+0,0,0,0,791,0,153,0,0,0,0,0,0,796,909,445,345,0,0,0,0,0,0,0,0,578,0,0,0,1387,0,
+0,0,555,0,0,0,0,0,0,766,0,0,0,0,0,0,0,0,0,0,541,0,0,0,0,0,0,0,0,0,0,0,0,0,880,0,
+0,0,0,0,1506,0,0,983,0,768,0,0,0,0,584,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,737,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,226,30,426,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+117,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,462,0,0,0,385,0,398,0,0,0,0,0,0,
+0,0,0,347,0,0,0,0,125,1259,644,136,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,469,0,0,0,0,0,
+1367,0,0,0,0,0,0,0,0,0,0,0,719,0,0,0,0,0,0,0,0,0,0,0,0,0,1423,0,0,0,0,0,0,0,0,0,
+749,0,0,0,0,546,645,0,0,0,0,0,0,277,0,0,1275,0,0,0,0,0,0,0,453,536,555,0,0,987,
+1107,0,0,90,0,0,0,0,0,0,0,0,860,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+257,0,1768,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1071,0,0,0,0,0,0,0,0,0,0,0,0,0,83,
+0,835,0,0,0,0,0,0,0,2006,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,696,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,95,1718,0,0,0,0,0,0,0,26,0,550,0,0,0,0,0,901,0,0,0,0,0,
+0,822,0,0,122,0,0,0,807,0,0,0,0,0,262,0,620,601,34,0,0,170,0,0,0,0,537,0,0,0,0,
+0,0,0,0,0,332,0,0,208,1909,182,261,0,0,0,1721,0,0,0,0,0,933,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,1609,0,895,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,812,0,0,942,1916,0,0,0,0,
+0,0,0,778,0,0,0,137,0,1314,0,0,0,0,0,0,0,1661,0,0,0,0,0,0,0,1591,0,0,0,0,0,0,
+820,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,185,89,0,1160,230,6,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,63,29,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1740,0,0,177,
+170,0,1961,0,0,0,0,0,0,0,0,0,0,0,0,91,0,17,44,0,0,0,0,0,0,0,0,0,270,0,296,0,0,0,
+0,0,0,0,1523,0,0,0,0,0,0,0,0,0,0,757,7,0,0,0,0,0,0,0,0,0,0,530,588,0,0,0,0,0,0,
+0,0,0,786,0,0,0,0,0,580,627,88,447,57,0,0,0,0,0,0,0,0,845,735,0,0,0,0,0,31,15,0,
+460,521,12,424,0,0,0,1302,0,0,0,0,0,0,0,595,0,0,0,13,548,97,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1472,452,1767,0,0,0,0,0,0,0,0,0,0,115,0,0,0,0,0,0,1543,0,1111,0,0,0,0,
+1,0,359,488,0,267,0,0,0,1983,0,0,0,0,0,0,0,1155,0,1575,0,1438,31,0,0,377,101,0,
+0,0,0,0,0,0,0,0,0,0,0,0,476,0,0,0,0,0,0,0,0,2023,0,0,0,0,0,1836,0,0,0,0,35,843,
+0,0,0,0,0,0,0,554,0,0,0,536,625,207,0,1371,0,0,0,424,785,336,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,896,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,750,0,0,0,0,238,0,0,
+0,0,0,383,0,0,0,0,0,0,0,0,603,725,11,0,0,0,0,0,0,0,0,0,476,0,0,0,0,0,1552,0,0,0,
+0,0,0,0,680,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,435,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1431,0,0,13,112,0,0,356,0,0,0,0,0,0,0,0,0,0,1963,0,0,0,1244,18,0,0,0,0,0,0,867,
+0,0,0,0,0,0,50,708,73,592,0,502,0,0,0,0,0,0,161,347,0,0,0,0,470,33,0,246,571,10,
+0,465,614,0,237,0,0,0,0,0,24,18,0,506,0,0,0,0,0,0,33,309,0,0,0,0,0,0,0,0,0,0,
+140,0,0,0,0,1056,0,0,0,1704,0,0,0,0,0,0,0,1036,0,0,0,0,0,0,0,0,0,1315,432,86,
+264,524,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,107,0,0,0,0,0,123,927,0,0,957,1149,0,0,
+0,0,0,778,0,502,196,0,0,0,0,1312,0,0,0,0,0,0,0,855,0,0,0,0,0,0,0,0,0,0,45,1400,
+0,0,0,1003,0,0,0,0,0,1097,0,0,0,0,0,0,0,0,545,612,0,0,0,0,0,0,0,0,0,0,0,0,54,0,
+0,0,0,172,0,0,0,1029,0,0,0,0,0,0,0,0,0,568,0,0,0,732,617,0,0,974,94,989,733,0,0,
+0,0,0,0,1789,0,0,665,2015,0,0,0,0,0,0,806,287,0,0,0,0,0,1539,0,0,0,0,0,0,0,0,0,
+0,182,1563,0,0,0,0,0,0,0,0,0,484,0,0,0,0,0,1623,0,0,0,0,0,0,0,0,878,1833,0,1569,
+0,0,0,0,0,0,0,0,93,0,715,994,0,0,0,0,0,63,0,591,0,0,0,0,0,0,0,749,0,0,0,0,547,
+366,0,0,0,1747,0,0,0,0,0,0,0,89,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1463,0,772,
+893,0,0,0,48,0,0,941,0,0,690,1785,106,440,0,0,0,0,0,0,0,0,0,0,32,0,332,216,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,852,0,
+0,416,564,0,918,0,1764,0,0,3,0,0,274,0,0,0,0,501,0,0,0,0,0,0,0,851,743,0,49,0,
+879,0,0,47,0,0,0,0,0,0,865,0,1202,0,0,0,0,0,0,47,272,0,0,0,0,0,0,0,0,0,0,0,1455,
+0,0,0,0,891,1911,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,761,0,0,0,0,0,0,0,0,0,407,0,
+183,0,0,490,0,0,0,0,0,0,0,35,731,0,0,0,0,0,0,0,819,0,0,0,0,0,0,0,0,0,0,0,0,0,
+575,0,0,0,0,45,818,0,0,77,222,0,0,0,0,849,1880,0,0,0,633,0,1308,0,0,0,0,0,0,0,0,
+0,0,86,0,0,0,0,0,0,0,0,0,0,0,0,0,0,817,0,0,0,0,0,0,0,0,0,882,0,0,0,914,0,0,0,0,
+0,0,0,0,0,0,865,0,0,426,399,58,0,0,0,0,0,0,538,102,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,876,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,139,566,0,63,12,0,0,0,
+0,0,0,0,0,0,0,0,0,0,3,114,0,0,0,0,0,0,0,0,576,0,0,0,0,0,0,0,0,933,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,692,0,0,0,0,0,0,0,0,0,0,0,0,752,0,0,0,0,
+0,0,0,0,375,0,1011,0,0,96,0,0,0,0,0,0,0,0,0,148,0,0,0,0,0,0,0,0,0,0,0,337,56,
+666,0,246,394,0,0,0,0,0,0,0,0,437,0,0,0,506,0,0,0,0,1003,0,1163,0,328,0,0,0,0,0,
+0,0,0,1000,0,0,0,0,0,744,101,0,0,0,0,0,726,0,0,176,0,146,9,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,839,0,0,0,0,0,0,223,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,246,1931,29,0,0,1771,0,0,0,0,0,846,6,157,0,0,0,0,0,0,0,0,0,875,0,0,477,
+773,177,639,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1747,0,0,0,0,158,873,0,659,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,391,0,0,0,0,0,0,0,0,0,0,0,0,668,883,0,78,628,0,0,0,
+0,0,0,0,0,0,0,0,0,1460,0,962,0,0,0,0,0,460,0,0,0,0,0,0,0,0,0,0,0,0,0,0,34,199,0,
+0,0,388,474,0,271,0,333,608,0,0,0,0,0,0,49,0,988,0,707,617,0,0,0,0,0,0,0,756,0,
+0,0,0,0,1583,0,0,0,0,0,0,0,0,0,0,285,0,0,0,0,0,0,0,0,0,0,0,0,0,0,344,0,0,0,0,0,
+0,0,0,515,1709,0,0,0,0,0,0,0,0,404,0,0,0,0,500,0,0,0,0,0,0,0,0,0,68,216,0,0,0,0,
+0,0,0,488,353,0,0,177,236,0,0,458,490,0,0,0,0,0,0,756,1504,0,757,0,1735,0,0,108,
+598,0,0,0,0};
+BROTLI_INTERNAL const uint8_t kStaticDictionaryHashLengths[32768] = {
+8,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,6,0,0,0,0,0,6,0,0,0,0,0,0,12,0,0,0,0,4,22,5,0,
+4,0,0,0,0,0,0,0,0,0,0,0,0,14,6,0,0,0,5,0,0,0,0,0,0,0,7,13,0,0,4,0,0,0,0,0,0,0,0,
+0,6,0,0,0,0,8,0,0,0,0,0,0,7,0,7,0,0,0,0,0,6,0,0,0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,
+0,6,0,0,0,0,13,6,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,
+0,0,0,8,4,0,6,12,0,0,0,0,0,0,0,0,0,0,0,0,6,0,6,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,11,4,0,0,0,6,14,0,11,0,9,6,0,0,0,0,0,0,22,0,12,0,8,6,0,0,0,0,0,0,0,6,0,
+0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,
+10,7,0,0,0,0,0,0,0,0,9,0,0,0,0,4,0,0,0,0,0,0,0,0,0,5,11,0,0,0,0,0,0,0,8,6,0,0,9,
+7,0,0,12,4,0,0,0,0,0,0,12,6,0,6,0,7,0,0,8,5,0,0,0,0};
#if defined(__cplusplus) || defined(c_plusplus)
} /* extern "C" */
diff --git a/src/libraries/Native/AnyOS/brotli/enc/dictionary_hash.h b/src/libraries/Native/AnyOS/brotli/enc/dictionary_hash.h
index b3bb9599f43b..e553ea5d4efb 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/dictionary_hash.h
+++ b/src/libraries/Native/AnyOS/brotli/enc/dictionary_hash.h
@@ -15,7 +15,8 @@
extern "C" {
#endif
-extern const uint16_t kStaticDictionaryHash[32768];
+extern const uint16_t kStaticDictionaryHashWords[32768];
+extern const uint8_t kStaticDictionaryHashLengths[32768];
#if defined(__cplusplus) || defined(c_plusplus)
} /* extern "C" */
diff --git a/src/libraries/Native/AnyOS/brotli/enc/encode.c b/src/libraries/Native/AnyOS/brotli/enc/encode.c
index 141e70aa2a31..8d90937b4368 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/encode.c
+++ b/src/libraries/Native/AnyOS/brotli/enc/encode.c
@@ -54,12 +54,19 @@ typedef enum BrotliEncoderStreamState {
BROTLI_STREAM_METADATA_BODY = 4
} BrotliEncoderStreamState;
+typedef enum BrotliEncoderFlintState {
+ BROTLI_FLINT_NEEDS_2_BYTES = 2,
+ BROTLI_FLINT_NEEDS_1_BYTE = 1,
+ BROTLI_FLINT_WAITING_FOR_PROCESSING = 0,
+ BROTLI_FLINT_WAITING_FOR_FLUSHING = -1,
+ BROTLI_FLINT_DONE = -2
+} BrotliEncoderFlintState;
+
typedef struct BrotliEncoderStateStruct {
BrotliEncoderParams params;
MemoryManager memory_manager_;
- HasherHandle hasher_;
uint64_t input_pos_;
RingBuffer ringbuffer_;
size_t cmd_alloc_size_;
@@ -73,10 +80,17 @@ typedef struct BrotliEncoderStateStruct {
int saved_dist_cache_[4];
uint16_t last_bytes_;
uint8_t last_bytes_bits_;
+ /* "Flint" is a tiny uncompressed block emitted before the continuation
+ block to unwire literal context from previous data. Despite being int8_t,
+ field is actually BrotliEncoderFlintState enum. */
+ int8_t flint_;
uint8_t prev_byte_;
uint8_t prev_byte2_;
size_t storage_size_;
uint8_t* storage_;
+
+ Hasher hasher_;
+
/* Hash table for FAST_ONE_PASS_COMPRESSION_QUALITY mode. */
int small_table_[1 << 10]; /* 4KiB */
int* large_table_; /* Allocated only when needed */
@@ -114,8 +128,6 @@ typedef struct BrotliEncoderStateStruct {
BROTLI_BOOL is_initialized_;
} BrotliEncoderStateStruct;
-static BROTLI_BOOL EnsureInitialized(BrotliEncoderState* s);
-
static size_t InputBlockSize(BrotliEncoderState* s) {
return (size_t)1 << s->params.lgblock;
}
@@ -174,6 +186,11 @@ BROTLI_BOOL BrotliEncoderSetParameter(
state->params.dist.num_direct_distance_codes = value;
return BROTLI_TRUE;
+ case BROTLI_PARAM_STREAM_OFFSET:
+ if (value > (1u << 30)) return BROTLI_FALSE;
+ state->params.stream_offset = value;
+ return BROTLI_TRUE;
+
default: return BROTLI_FALSE;
}
}
@@ -195,7 +212,7 @@ static uint8_t* GetBrotliStorage(BrotliEncoderState* s, size_t size) {
if (s->storage_size_ < size) {
BROTLI_FREE(m, s->storage_);
s->storage_ = BROTLI_ALLOC(m, uint8_t, size);
- if (BROTLI_IS_OOM(m)) return NULL;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(s->storage_)) return NULL;
s->storage_size_ = size;
}
return s->storage_;
@@ -234,7 +251,7 @@ static int* GetHashTable(BrotliEncoderState* s, int quality,
s->large_table_size_ = htsize;
BROTLI_FREE(m, s->large_table_);
s->large_table_ = BROTLI_ALLOC(m, int, htsize);
- if (BROTLI_IS_OOM(m)) return 0;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(s->large_table_)) return 0;
}
table = s->large_table_;
}
@@ -499,7 +516,7 @@ static BROTLI_BOOL ShouldCompress(
/* TODO: find more precise minimal block overhead. */
if (bytes <= 2) return BROTLI_FALSE;
if (num_commands < (bytes >> 8) + 2) {
- if (num_literals > 0.99 * (double)bytes) {
+ if ((double)num_literals > 0.99 * (double)bytes) {
uint32_t literal_histo[256] = { 0 };
static const uint32_t kSampleRate = 13;
static const double kMinEntropy = 7.92;
@@ -617,11 +634,7 @@ static void WriteMetaBlockInternal(MemoryManager* m,
/* The number of distance symbols effectively used for distance
histograms. It might be less than distance alphabet size
for "Large Window Brotli" (32-bit). */
- uint32_t num_effective_dist_codes = block_params.dist.alphabet_size;
- if (num_effective_dist_codes > BROTLI_NUM_HISTOGRAM_DISTANCE_SYMBOLS) {
- num_effective_dist_codes = BROTLI_NUM_HISTOGRAM_DISTANCE_SYMBOLS;
- }
- BrotliOptimizeHistograms(num_effective_dist_codes, &mb);
+ BrotliOptimizeHistograms(block_params.dist.alphabet_size_limit, &mb);
}
BrotliStoreMetaBlock(m, data, wrapped_last_flush_pos, bytes, mask,
prev_byte, prev_byte2,
@@ -678,12 +691,23 @@ static BROTLI_BOOL EnsureInitialized(BrotliEncoderState* s) {
s->last_bytes_bits_ = 0;
s->last_bytes_ = 0;
+ s->flint_ = BROTLI_FLINT_DONE;
s->remaining_metadata_bytes_ = BROTLI_UINT32_MAX;
SanitizeParams(&s->params);
s->params.lgblock = ComputeLgBlock(&s->params);
ChooseDistanceParams(&s->params);
+ if (s->params.stream_offset != 0) {
+ s->flint_ = BROTLI_FLINT_NEEDS_2_BYTES;
+ /* Poison the distance cache. -16 +- 3 is still less than zero (invalid). */
+ s->dist_cache_[0] = -16;
+ s->dist_cache_[1] = -16;
+ s->dist_cache_[2] = -16;
+ s->dist_cache_[3] = -16;
+ memcpy(s->saved_dist_cache_, s->dist_cache_, sizeof(s->saved_dist_cache_));
+ }
+
RingBufferSetup(&s->params, &s->ringbuffer_);
/* Initialize last byte with stream header. */
@@ -693,8 +717,14 @@ static BROTLI_BOOL EnsureInitialized(BrotliEncoderState* s) {
s->params.quality == FAST_TWO_PASS_COMPRESSION_QUALITY) {
lgwin = BROTLI_MAX(int, lgwin, 18);
}
- EncodeWindowBits(lgwin, s->params.large_window,
- &s->last_bytes_, &s->last_bytes_bits_);
+ if (s->params.stream_offset == 0) {
+ EncodeWindowBits(lgwin, s->params.large_window,
+ &s->last_bytes_, &s->last_bytes_bits_);
+ } else {
+ /* Bigger values have the same effect, but could cause overflows. */
+ s->params.stream_offset = BROTLI_MIN(size_t,
+ s->params.stream_offset, BROTLI_MAX_BACKWARD_LIMIT(lgwin));
+ }
}
if (s->params.quality == FAST_ONE_PASS_COMPRESSION_QUALITY) {
@@ -712,13 +742,15 @@ static void BrotliEncoderInitParams(BrotliEncoderParams* params) {
params->quality = BROTLI_DEFAULT_QUALITY;
params->lgwin = BROTLI_DEFAULT_WINDOW;
params->lgblock = 0;
+ params->stream_offset = 0;
params->size_hint = 0;
params->disable_literal_context_modeling = BROTLI_FALSE;
BrotliInitEncoderDictionary(¶ms->dictionary);
params->dist.distance_postfix_bits = 0;
params->dist.num_direct_distance_codes = 0;
- params->dist.alphabet_size =
+ params->dist.alphabet_size_max =
BROTLI_DISTANCE_ALPHABET_SIZE(0, 0, BROTLI_MAX_DISTANCE_BITS);
+ params->dist.alphabet_size_limit = params->dist.alphabet_size_max;
params->dist.max_distance = BROTLI_MAX_DISTANCE;
}
@@ -734,7 +766,7 @@ static void BrotliEncoderInitState(BrotliEncoderState* s) {
s->prev_byte2_ = 0;
s->storage_size_ = 0;
s->storage_ = 0;
- s->hasher_ = NULL;
+ HasherInit(&s->hasher_);
s->large_table_ = NULL;
s->large_table_size_ = 0;
s->cmd_code_numbits_ = 0;
@@ -902,6 +934,7 @@ static void ExtendLastCommand(BrotliEncoderState* s, uint32_t* bytes,
(*bytes)--;
(*wrapped_last_processed_pos)++;
}
+ } else {
}
/* The copy length is at most the metablock size, and thus expressible. */
GetLengthCode(last_command->insert_len_,
@@ -934,6 +967,7 @@ static BROTLI_BOOL EncodeData(
uint32_t mask;
MemoryManager* m = &s->memory_manager_;
ContextType literal_context_mode;
+ ContextLut literal_context_lut;
data = s->ringbuffer_.buffer_;
mask = s->ringbuffer_.mask_;
@@ -951,7 +985,10 @@ static BROTLI_BOOL EncodeData(
BROTLI_ALLOC(m, uint32_t, kCompressFragmentTwoPassBlockSize);
s->literal_buf_ =
BROTLI_ALLOC(m, uint8_t, kCompressFragmentTwoPassBlockSize);
- if (BROTLI_IS_OOM(m)) return BROTLI_FALSE;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(s->command_buf_) ||
+ BROTLI_IS_NULL(s->literal_buf_)) {
+ return BROTLI_FALSE;
+ }
}
if (s->params.quality == FAST_ONE_PASS_COMPRESSION_QUALITY ||
@@ -1009,7 +1046,7 @@ static BROTLI_BOOL EncodeData(
newsize += (bytes / 4) + 16;
s->cmd_alloc_size_ = newsize;
new_commands = BROTLI_ALLOC(m, Command, newsize);
- if (BROTLI_IS_OOM(m)) return BROTLI_FALSE;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(new_commands)) return BROTLI_FALSE;
if (s->commands_) {
memcpy(new_commands, s->commands_, sizeof(Command) * s->num_commands_);
BROTLI_FREE(m, s->commands_);
@@ -1024,6 +1061,7 @@ static BROTLI_BOOL EncodeData(
literal_context_mode = ChooseContextMode(
&s->params, data, WrapPosition(s->last_flush_pos_),
mask, (size_t)(s->input_pos_ - s->last_flush_pos_));
+ literal_context_lut = BROTLI_CONTEXT_LUT(literal_context_mode);
if (BROTLI_IS_OOM(m)) return BROTLI_FALSE;
@@ -1034,20 +1072,23 @@ static BROTLI_BOOL EncodeData(
if (s->params.quality == ZOPFLIFICATION_QUALITY) {
BROTLI_DCHECK(s->params.hasher.type == 10);
BrotliCreateZopfliBackwardReferences(m, bytes, wrapped_last_processed_pos,
- data, mask, &s->params, s->hasher_, s->dist_cache_,
+ data, mask, literal_context_lut, &s->params,
+ &s->hasher_, s->dist_cache_,
&s->last_insert_len_, &s->commands_[s->num_commands_],
&s->num_commands_, &s->num_literals_);
if (BROTLI_IS_OOM(m)) return BROTLI_FALSE;
} else if (s->params.quality == HQ_ZOPFLIFICATION_QUALITY) {
BROTLI_DCHECK(s->params.hasher.type == 10);
BrotliCreateHqZopfliBackwardReferences(m, bytes, wrapped_last_processed_pos,
- data, mask, &s->params, s->hasher_, s->dist_cache_,
+ data, mask, literal_context_lut, &s->params,
+ &s->hasher_, s->dist_cache_,
&s->last_insert_len_, &s->commands_[s->num_commands_],
&s->num_commands_, &s->num_literals_);
if (BROTLI_IS_OOM(m)) return BROTLI_FALSE;
} else {
BrotliCreateBackwardReferences(bytes, wrapped_last_processed_pos,
- data, mask, &s->params, s->hasher_, s->dist_cache_,
+ data, mask, literal_context_lut, &s->params,
+ &s->hasher_, s->dist_cache_,
&s->last_insert_len_, &s->commands_[s->num_commands_],
&s->num_commands_, &s->num_literals_);
}
@@ -1072,7 +1113,7 @@ static BROTLI_BOOL EncodeData(
s->num_commands_ < max_commands) {
/* Merge with next input block. Everything will happen later. */
if (UpdateLastProcessedPos(s)) {
- HasherReset(s->hasher_);
+ HasherReset(&s->hasher_);
}
*out_size = 0;
return BROTLI_TRUE;
@@ -1113,7 +1154,7 @@ static BROTLI_BOOL EncodeData(
s->last_bytes_bits_ = storage_ix & 7u;
s->last_flush_pos_ = s->input_pos_;
if (UpdateLastProcessedPos(s)) {
- HasherReset(s->hasher_);
+ HasherReset(&s->hasher_);
}
if (s->last_flush_pos_ > 0) {
s->prev_byte_ = data[((uint32_t)s->last_flush_pos_ - 1) & mask];
@@ -1174,7 +1215,6 @@ static BROTLI_BOOL BrotliCompressBufferQuality10(
size_t total_out_size = 0;
uint16_t last_bytes;
uint8_t last_bytes_bits;
- HasherHandle hasher = NULL;
const size_t hasher_eff_size = BROTLI_MIN(size_t,
input_size, BROTLI_MAX_BACKWARD_LIMIT(lgwin) + BROTLI_WINDOW_GAP);
@@ -1190,6 +1230,9 @@ static BROTLI_BOOL BrotliCompressBufferQuality10(
uint8_t prev_byte = 0;
uint8_t prev_byte2 = 0;
+ Hasher hasher;
+ HasherInit(&hasher);
+
BrotliEncoderInitParams(¶ms);
params.quality = 10;
params.lgwin = lgwin;
@@ -1226,6 +1269,7 @@ static BROTLI_BOOL BrotliCompressBufferQuality10(
ContextType literal_context_mode = ChooseContextMode(¶ms,
input_buffer, metablock_start, mask, metablock_end - metablock_start);
+ ContextLut literal_context_lut = BROTLI_CONTEXT_LUT(literal_context_mode);
size_t block_start;
for (block_start = metablock_start; block_start < metablock_end; ) {
@@ -1234,12 +1278,12 @@ static BROTLI_BOOL BrotliCompressBufferQuality10(
ZopfliNode* nodes = BROTLI_ALLOC(m, ZopfliNode, block_size + 1);
size_t path_size;
size_t new_cmd_alloc_size;
- if (BROTLI_IS_OOM(m)) goto oom;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(nodes)) goto oom;
BrotliInitZopfliNodes(nodes, block_size + 1);
- StitchToPreviousBlockH10(hasher, block_size, block_start,
+ StitchToPreviousBlockH10(&hasher.privat._H10, block_size, block_start,
input_buffer, mask);
path_size = BrotliZopfliComputeShortestPath(m, block_size, block_start,
- input_buffer, mask, ¶ms, dist_cache, hasher,
+ input_buffer, mask, literal_context_lut, ¶ms, dist_cache, &hasher,
nodes);
if (BROTLI_IS_OOM(m)) goto oom;
/* We allocate a command buffer in the first iteration of this loop that
@@ -1254,7 +1298,7 @@ static BROTLI_BOOL BrotliCompressBufferQuality10(
num_commands + path_size + 1);
if (cmd_alloc_size != new_cmd_alloc_size) {
Command* new_commands = BROTLI_ALLOC(m, Command, new_cmd_alloc_size);
- if (BROTLI_IS_OOM(m)) goto oom;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(new_commands)) goto oom;
cmd_alloc_size = new_cmd_alloc_size;
if (commands) {
memcpy(new_commands, commands, sizeof(Command) * num_commands);
@@ -1286,7 +1330,7 @@ static BROTLI_BOOL BrotliCompressBufferQuality10(
if (metablock_size == 0) {
/* Write the ISLAST and ISEMPTY bits. */
storage = BROTLI_ALLOC(m, uint8_t, 16);
- if (BROTLI_IS_OOM(m)) goto oom;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(storage)) goto oom;
storage[0] = (uint8_t)last_bytes;
storage[1] = (uint8_t)(last_bytes >> 8);
BrotliWriteBits(2, 3, &storage_ix, storage);
@@ -1297,7 +1341,7 @@ static BROTLI_BOOL BrotliCompressBufferQuality10(
CreateBackwardReferences is now unused. */
memcpy(dist_cache, saved_dist_cache, 4 * sizeof(dist_cache[0]));
storage = BROTLI_ALLOC(m, uint8_t, metablock_size + 16);
- if (BROTLI_IS_OOM(m)) goto oom;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(storage)) goto oom;
storage[0] = (uint8_t)last_bytes;
storage[1] = (uint8_t)(last_bytes >> 8);
BrotliStoreUncompressedMetaBlock(is_last, input_buffer,
@@ -1318,14 +1362,10 @@ static BROTLI_BOOL BrotliCompressBufferQuality10(
/* The number of distance symbols effectively used for distance
histograms. It might be less than distance alphabet size
for "Large Window Brotli" (32-bit). */
- uint32_t num_effective_dist_codes = block_params.dist.alphabet_size;
- if (num_effective_dist_codes > BROTLI_NUM_HISTOGRAM_DISTANCE_SYMBOLS) {
- num_effective_dist_codes = BROTLI_NUM_HISTOGRAM_DISTANCE_SYMBOLS;
- }
- BrotliOptimizeHistograms(num_effective_dist_codes, &mb);
+ BrotliOptimizeHistograms(block_params.dist.alphabet_size_limit, &mb);
}
storage = BROTLI_ALLOC(m, uint8_t, 2 * metablock_size + 503);
- if (BROTLI_IS_OOM(m)) goto oom;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(storage)) goto oom;
storage[0] = (uint8_t)last_bytes;
storage[1] = (uint8_t)(last_bytes >> 8);
BrotliStoreMetaBlock(m, input_buffer, metablock_start, metablock_size,
@@ -1576,7 +1616,10 @@ static BROTLI_BOOL BrotliEncoderCompressStreamFast(
BROTLI_ALLOC(m, uint32_t, kCompressFragmentTwoPassBlockSize);
s->literal_buf_ =
BROTLI_ALLOC(m, uint8_t, kCompressFragmentTwoPassBlockSize);
- if (BROTLI_IS_OOM(m)) return BROTLI_FALSE;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(s->command_buf_) ||
+ BROTLI_IS_NULL(s->literal_buf_)) {
+ return BROTLI_FALSE;
+ }
}
if (s->command_buf_) {
command_buf = s->command_buf_;
@@ -1584,7 +1627,10 @@ static BROTLI_BOOL BrotliEncoderCompressStreamFast(
} else {
tmp_command_buf = BROTLI_ALLOC(m, uint32_t, buf_size);
tmp_literal_buf = BROTLI_ALLOC(m, uint8_t, buf_size);
- if (BROTLI_IS_OOM(m)) return BROTLI_FALSE;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(tmp_command_buf) ||
+ BROTLI_IS_NULL(tmp_literal_buf)) {
+ return BROTLI_FALSE;
+ }
command_buf = tmp_command_buf;
literal_buf = tmp_literal_buf;
}
@@ -1640,8 +1686,10 @@ static BROTLI_BOOL BrotliEncoderCompressStreamFast(
&storage_ix, storage);
if (BROTLI_IS_OOM(m)) return BROTLI_FALSE;
}
- *next_in += block_size;
- *available_in -= block_size;
+ if (block_size != 0) {
+ *next_in += block_size;
+ *available_in -= block_size;
+ }
if (inplace) {
size_t out_bytes = storage_ix >> 3;
BROTLI_DCHECK(out_bytes <= *available_out);
@@ -1786,6 +1834,10 @@ BROTLI_BOOL BrotliEncoderCompressStream(
}
while (BROTLI_TRUE) {
size_t remaining_block_size = RemainingInputBlockSize(s);
+ /* Shorten input to flint size. */
+ if (s->flint_ >= 0 && remaining_block_size > (size_t)s->flint_) {
+ remaining_block_size = (size_t)s->flint_;
+ }
if (remaining_block_size != 0 && *available_in != 0) {
size_t copy_input_size =
@@ -1793,10 +1845,18 @@ BROTLI_BOOL BrotliEncoderCompressStream(
CopyInputToRingBuffer(s, copy_input_size, *next_in);
*next_in += copy_input_size;
*available_in -= copy_input_size;
+ if (s->flint_ > 0) s->flint_ = (int8_t)(s->flint_ - (int)copy_input_size);
continue;
}
if (InjectFlushOrPushOutput(s, available_out, next_out, total_out)) {
+ /* Exit the "emit flint" workflow. */
+ if (s->flint_ == BROTLI_FLINT_WAITING_FOR_FLUSHING) {
+ CheckFlushComplete(s);
+ if (s->stream_state_ == BROTLI_STREAM_PROCESSING) {
+ s->flint_ = BROTLI_FLINT_DONE;
+ }
+ }
continue;
}
@@ -1810,6 +1870,11 @@ BROTLI_BOOL BrotliEncoderCompressStream(
BROTLI_BOOL force_flush = TO_BROTLI_BOOL(
(*available_in == 0) && op == BROTLI_OPERATION_FLUSH);
BROTLI_BOOL result;
+ /* Force emitting (uncompressed) piece containing flint. */
+ if (!is_last && s->flint_ == 0) {
+ s->flint_ = BROTLI_FLINT_WAITING_FOR_FLUSHING;
+ force_flush = BROTLI_TRUE;
+ }
UpdateSizeHint(s, *available_in);
result = EncodeData(s, is_last, force_flush,
&s->available_out_, &s->next_out_);
diff --git a/src/libraries/Native/AnyOS/brotli/enc/encoder_dict.c b/src/libraries/Native/AnyOS/brotli/enc/encoder_dict.c
index 8b2f6ad4a475..c9e963b89d20 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/encoder_dict.c
+++ b/src/libraries/Native/AnyOS/brotli/enc/encoder_dict.c
@@ -17,14 +17,15 @@ extern "C" {
void BrotliInitEncoderDictionary(BrotliEncoderDictionary* dict) {
dict->words = BrotliGetDictionary();
+ dict->num_transforms = (uint32_t)BrotliGetTransforms()->num_transforms;
- dict->hash_table = kStaticDictionaryHash;
+ dict->hash_table_words = kStaticDictionaryHashWords;
+ dict->hash_table_lengths = kStaticDictionaryHashLengths;
dict->buckets = kStaticDictionaryBuckets;
dict->dict_words = kStaticDictionaryWords;
dict->cutoffTransformsCount = kCutoffTransformsCount;
dict->cutoffTransforms = kCutoffTransforms;
-
}
#if defined(__cplusplus) || defined(c_plusplus)
diff --git a/src/libraries/Native/AnyOS/brotli/enc/encoder_dict.h b/src/libraries/Native/AnyOS/brotli/enc/encoder_dict.h
index 3cb6b0ac152b..a1c329fbf498 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/encoder_dict.h
+++ b/src/libraries/Native/AnyOS/brotli/enc/encoder_dict.h
@@ -19,13 +19,15 @@ extern "C" {
/* Dictionary data (words and transforms) for 1 possible context */
typedef struct BrotliEncoderDictionary {
const BrotliDictionary* words;
+ uint32_t num_transforms;
/* cut off for fast encoder */
uint32_t cutoffTransformsCount;
uint64_t cutoffTransforms;
/* from dictionary_hash.h, for fast encoder */
- const uint16_t* hash_table;
+ const uint16_t* hash_table_words;
+ const uint8_t* hash_table_lengths;
/* from static_dict_lut.h, for slow encoder */
const uint16_t* buckets;
diff --git a/src/libraries/Native/AnyOS/brotli/enc/entropy_encode.c b/src/libraries/Native/AnyOS/brotli/enc/entropy_encode.c
index 97f9dfb82aa6..b50ccb5d1f69 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/entropy_encode.c
+++ b/src/libraries/Native/AnyOS/brotli/enc/entropy_encode.c
@@ -18,6 +18,8 @@
extern "C" {
#endif
+const size_t kBrotliShellGaps[] = {132, 57, 23, 10, 4, 1};
+
BROTLI_BOOL BrotliSetDepth(
int p0, HuffmanTree* pool, uint8_t* depth, int max_depth) {
int stack[16];
diff --git a/src/libraries/Native/AnyOS/brotli/enc/entropy_encode.h b/src/libraries/Native/AnyOS/brotli/enc/entropy_encode.h
index f23d9c379d06..9618e1d3592e 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/entropy_encode.h
+++ b/src/libraries/Native/AnyOS/brotli/enc/entropy_encode.h
@@ -76,12 +76,12 @@ BROTLI_INTERNAL void BrotliConvertBitDepthsToSymbols(const uint8_t* depth,
size_t len,
uint16_t* bits);
+BROTLI_INTERNAL extern const size_t kBrotliShellGaps[6];
/* Input size optimized Shell sort. */
typedef BROTLI_BOOL (*HuffmanTreeComparator)(
const HuffmanTree*, const HuffmanTree*);
static BROTLI_INLINE void SortHuffmanTreeItems(HuffmanTree* items,
const size_t n, HuffmanTreeComparator comparator) {
- static const size_t gaps[] = {132, 57, 23, 10, 4, 1};
if (n < 13) {
/* Insertion sort. */
size_t i;
@@ -101,7 +101,7 @@ static BROTLI_INLINE void SortHuffmanTreeItems(HuffmanTree* items,
/* Shell sort. */
int g = n < 57 ? 2 : 0;
for (; g < 6; ++g) {
- size_t gap = gaps[g];
+ size_t gap = kBrotliShellGaps[g];
size_t i;
for (i = gap; i < n; ++i) {
size_t j = i;
diff --git a/src/libraries/Native/AnyOS/brotli/enc/fast_log.c b/src/libraries/Native/AnyOS/brotli/enc/fast_log.c
new file mode 100644
index 000000000000..2319baeb7409
--- /dev/null
+++ b/src/libraries/Native/AnyOS/brotli/enc/fast_log.c
@@ -0,0 +1,105 @@
+/* Copyright 2013 Google Inc. All Rights Reserved.
+
+ Distributed under MIT license.
+ See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
+*/
+
+#include "./fast_log.h"
+
+#if defined(__cplusplus) || defined(c_plusplus)
+extern "C" {
+#endif
+
+/* ", ".join(["%.16ff" % x for x in [0.0]+[log2(x) for x in range(1, 256)]]) */
+const double kBrotliLog2Table[BROTLI_LOG2_TABLE_SIZE] = {
+ 0.0000000000000000f, 0.0000000000000000f, 1.0000000000000000f,
+ 1.5849625007211563f, 2.0000000000000000f, 2.3219280948873622f,
+ 2.5849625007211561f, 2.8073549220576042f, 3.0000000000000000f,
+ 3.1699250014423126f, 3.3219280948873626f, 3.4594316186372978f,
+ 3.5849625007211565f, 3.7004397181410922f, 3.8073549220576037f,
+ 3.9068905956085187f, 4.0000000000000000f, 4.0874628412503400f,
+ 4.1699250014423122f, 4.2479275134435852f, 4.3219280948873626f,
+ 4.3923174227787607f, 4.4594316186372973f, 4.5235619560570131f,
+ 4.5849625007211570f, 4.6438561897747244f, 4.7004397181410926f,
+ 4.7548875021634691f, 4.8073549220576037f, 4.8579809951275728f,
+ 4.9068905956085187f, 4.9541963103868758f, 5.0000000000000000f,
+ 5.0443941193584534f, 5.0874628412503400f, 5.1292830169449664f,
+ 5.1699250014423122f, 5.2094533656289501f, 5.2479275134435852f,
+ 5.2854022188622487f, 5.3219280948873626f, 5.3575520046180838f,
+ 5.3923174227787607f, 5.4262647547020979f, 5.4594316186372973f,
+ 5.4918530963296748f, 5.5235619560570131f, 5.5545888516776376f,
+ 5.5849625007211570f, 5.6147098441152083f, 5.6438561897747244f,
+ 5.6724253419714961f, 5.7004397181410926f, 5.7279204545631996f,
+ 5.7548875021634691f, 5.7813597135246599f, 5.8073549220576046f,
+ 5.8328900141647422f, 5.8579809951275719f, 5.8826430493618416f,
+ 5.9068905956085187f, 5.9307373375628867f, 5.9541963103868758f,
+ 5.9772799234999168f, 6.0000000000000000f, 6.0223678130284544f,
+ 6.0443941193584534f, 6.0660891904577721f, 6.0874628412503400f,
+ 6.1085244567781700f, 6.1292830169449672f, 6.1497471195046822f,
+ 6.1699250014423122f, 6.1898245588800176f, 6.2094533656289510f,
+ 6.2288186904958804f, 6.2479275134435861f, 6.2667865406949019f,
+ 6.2854022188622487f, 6.3037807481771031f, 6.3219280948873617f,
+ 6.3398500028846252f, 6.3575520046180847f, 6.3750394313469254f,
+ 6.3923174227787598f, 6.4093909361377026f, 6.4262647547020979f,
+ 6.4429434958487288f, 6.4594316186372982f, 6.4757334309663976f,
+ 6.4918530963296748f, 6.5077946401986964f, 6.5235619560570131f,
+ 6.5391588111080319f, 6.5545888516776376f, 6.5698556083309478f,
+ 6.5849625007211561f, 6.5999128421871278f, 6.6147098441152092f,
+ 6.6293566200796095f, 6.6438561897747253f, 6.6582114827517955f,
+ 6.6724253419714952f, 6.6865005271832185f, 6.7004397181410917f,
+ 6.7142455176661224f, 6.7279204545631988f, 6.7414669864011465f,
+ 6.7548875021634691f, 6.7681843247769260f, 6.7813597135246599f,
+ 6.7944158663501062f, 6.8073549220576037f, 6.8201789624151887f,
+ 6.8328900141647422f, 6.8454900509443757f, 6.8579809951275719f,
+ 6.8703647195834048f, 6.8826430493618416f, 6.8948177633079437f,
+ 6.9068905956085187f, 6.9188632372745955f, 6.9307373375628867f,
+ 6.9425145053392399f, 6.9541963103868758f, 6.9657842846620879f,
+ 6.9772799234999168f, 6.9886846867721664f, 7.0000000000000000f,
+ 7.0112272554232540f, 7.0223678130284544f, 7.0334230015374501f,
+ 7.0443941193584534f, 7.0552824355011898f, 7.0660891904577721f,
+ 7.0768155970508317f, 7.0874628412503400f, 7.0980320829605272f,
+ 7.1085244567781700f, 7.1189410727235076f, 7.1292830169449664f,
+ 7.1395513523987937f, 7.1497471195046822f, 7.1598713367783891f,
+ 7.1699250014423130f, 7.1799090900149345f, 7.1898245588800176f,
+ 7.1996723448363644f, 7.2094533656289492f, 7.2191685204621621f,
+ 7.2288186904958804f, 7.2384047393250794f, 7.2479275134435861f,
+ 7.2573878426926521f, 7.2667865406949019f, 7.2761244052742384f,
+ 7.2854022188622487f, 7.2946207488916270f, 7.3037807481771031f,
+ 7.3128829552843557f, 7.3219280948873617f, 7.3309168781146177f,
+ 7.3398500028846243f, 7.3487281542310781f, 7.3575520046180847f,
+ 7.3663222142458151f, 7.3750394313469254f, 7.3837042924740528f,
+ 7.3923174227787607f, 7.4008794362821844f, 7.4093909361377026f,
+ 7.4178525148858991f, 7.4262647547020979f, 7.4346282276367255f,
+ 7.4429434958487288f, 7.4512111118323299f, 7.4594316186372973f,
+ 7.4676055500829976f, 7.4757334309663976f, 7.4838157772642564f,
+ 7.4918530963296748f, 7.4998458870832057f, 7.5077946401986964f,
+ 7.5156998382840436f, 7.5235619560570131f, 7.5313814605163119f,
+ 7.5391588111080319f, 7.5468944598876373f, 7.5545888516776376f,
+ 7.5622424242210728f, 7.5698556083309478f, 7.5774288280357487f,
+ 7.5849625007211561f, 7.5924570372680806f, 7.5999128421871278f,
+ 7.6073303137496113f, 7.6147098441152075f, 7.6220518194563764f,
+ 7.6293566200796095f, 7.6366246205436488f, 7.6438561897747244f,
+ 7.6510516911789290f, 7.6582114827517955f, 7.6653359171851765f,
+ 7.6724253419714952f, 7.6794800995054464f, 7.6865005271832185f,
+ 7.6934869574993252f, 7.7004397181410926f, 7.7073591320808825f,
+ 7.7142455176661224f, 7.7210991887071856f, 7.7279204545631996f,
+ 7.7347096202258392f, 7.7414669864011465f, 7.7481928495894596f,
+ 7.7548875021634691f, 7.7615512324444795f, 7.7681843247769260f,
+ 7.7747870596011737f, 7.7813597135246608f, 7.7879025593914317f,
+ 7.7944158663501062f, 7.8008998999203047f, 7.8073549220576037f,
+ 7.8137811912170374f, 7.8201789624151887f, 7.8265484872909159f,
+ 7.8328900141647422f, 7.8392037880969445f, 7.8454900509443757f,
+ 7.8517490414160571f, 7.8579809951275719f, 7.8641861446542798f,
+ 7.8703647195834048f, 7.8765169465650002f, 7.8826430493618425f,
+ 7.8887432488982601f, 7.8948177633079446f, 7.9008668079807496f,
+ 7.9068905956085187f, 7.9128893362299619f, 7.9188632372745955f,
+ 7.9248125036057813f, 7.9307373375628867f, 7.9366379390025719f,
+ 7.9425145053392399f, 7.9483672315846778f, 7.9541963103868758f,
+ 7.9600019320680806f, 7.9657842846620870f, 7.9715435539507720f,
+ 7.9772799234999168f, 7.9829935746943104f, 7.9886846867721664f,
+ 7.9943534368588578f
+};
+
+#if defined(__cplusplus) || defined(c_plusplus)
+} /* extern "C" */
+#endif
diff --git a/src/libraries/Native/AnyOS/brotli/enc/fast_log.h b/src/libraries/Native/AnyOS/brotli/enc/fast_log.h
index cade1235adeb..2094f13e5569 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/fast_log.h
+++ b/src/libraries/Native/AnyOS/brotli/enc/fast_log.h
@@ -19,10 +19,8 @@ extern "C" {
#endif
static BROTLI_INLINE uint32_t Log2FloorNonZero(size_t n) {
- /* TODO: generalize and move to platform.h */
-#if BROTLI_GNUC_HAS_BUILTIN(__builtin_clz, 3, 4, 0) || \
- BROTLI_INTEL_VERSION_CHECK(16, 0, 0)
- return 31u ^ (uint32_t)__builtin_clz((uint32_t)n);
+#if defined(BROTLI_BSR32)
+ return BROTLI_BSR32((uint32_t)n);
#else
uint32_t result = 0;
while (n >>= 1) result++;
@@ -30,110 +28,31 @@ static BROTLI_INLINE uint32_t Log2FloorNonZero(size_t n) {
#endif
}
+#define BROTLI_LOG2_TABLE_SIZE 256
+
/* A lookup table for small values of log2(int) to be used in entropy
- computation.
+ computation. */
+BROTLI_INTERNAL extern const double kBrotliLog2Table[BROTLI_LOG2_TABLE_SIZE];
- ", ".join(["%.16ff" % x for x in [0.0]+[log2(x) for x in range(1, 256)]]) */
-static const float kLog2Table[] = {
- 0.0000000000000000f, 0.0000000000000000f, 1.0000000000000000f,
- 1.5849625007211563f, 2.0000000000000000f, 2.3219280948873622f,
- 2.5849625007211561f, 2.8073549220576042f, 3.0000000000000000f,
- 3.1699250014423126f, 3.3219280948873626f, 3.4594316186372978f,
- 3.5849625007211565f, 3.7004397181410922f, 3.8073549220576037f,
- 3.9068905956085187f, 4.0000000000000000f, 4.0874628412503400f,
- 4.1699250014423122f, 4.2479275134435852f, 4.3219280948873626f,
- 4.3923174227787607f, 4.4594316186372973f, 4.5235619560570131f,
- 4.5849625007211570f, 4.6438561897747244f, 4.7004397181410926f,
- 4.7548875021634691f, 4.8073549220576037f, 4.8579809951275728f,
- 4.9068905956085187f, 4.9541963103868758f, 5.0000000000000000f,
- 5.0443941193584534f, 5.0874628412503400f, 5.1292830169449664f,
- 5.1699250014423122f, 5.2094533656289501f, 5.2479275134435852f,
- 5.2854022188622487f, 5.3219280948873626f, 5.3575520046180838f,
- 5.3923174227787607f, 5.4262647547020979f, 5.4594316186372973f,
- 5.4918530963296748f, 5.5235619560570131f, 5.5545888516776376f,
- 5.5849625007211570f, 5.6147098441152083f, 5.6438561897747244f,
- 5.6724253419714961f, 5.7004397181410926f, 5.7279204545631996f,
- 5.7548875021634691f, 5.7813597135246599f, 5.8073549220576046f,
- 5.8328900141647422f, 5.8579809951275719f, 5.8826430493618416f,
- 5.9068905956085187f, 5.9307373375628867f, 5.9541963103868758f,
- 5.9772799234999168f, 6.0000000000000000f, 6.0223678130284544f,
- 6.0443941193584534f, 6.0660891904577721f, 6.0874628412503400f,
- 6.1085244567781700f, 6.1292830169449672f, 6.1497471195046822f,
- 6.1699250014423122f, 6.1898245588800176f, 6.2094533656289510f,
- 6.2288186904958804f, 6.2479275134435861f, 6.2667865406949019f,
- 6.2854022188622487f, 6.3037807481771031f, 6.3219280948873617f,
- 6.3398500028846252f, 6.3575520046180847f, 6.3750394313469254f,
- 6.3923174227787598f, 6.4093909361377026f, 6.4262647547020979f,
- 6.4429434958487288f, 6.4594316186372982f, 6.4757334309663976f,
- 6.4918530963296748f, 6.5077946401986964f, 6.5235619560570131f,
- 6.5391588111080319f, 6.5545888516776376f, 6.5698556083309478f,
- 6.5849625007211561f, 6.5999128421871278f, 6.6147098441152092f,
- 6.6293566200796095f, 6.6438561897747253f, 6.6582114827517955f,
- 6.6724253419714952f, 6.6865005271832185f, 6.7004397181410917f,
- 6.7142455176661224f, 6.7279204545631988f, 6.7414669864011465f,
- 6.7548875021634691f, 6.7681843247769260f, 6.7813597135246599f,
- 6.7944158663501062f, 6.8073549220576037f, 6.8201789624151887f,
- 6.8328900141647422f, 6.8454900509443757f, 6.8579809951275719f,
- 6.8703647195834048f, 6.8826430493618416f, 6.8948177633079437f,
- 6.9068905956085187f, 6.9188632372745955f, 6.9307373375628867f,
- 6.9425145053392399f, 6.9541963103868758f, 6.9657842846620879f,
- 6.9772799234999168f, 6.9886846867721664f, 7.0000000000000000f,
- 7.0112272554232540f, 7.0223678130284544f, 7.0334230015374501f,
- 7.0443941193584534f, 7.0552824355011898f, 7.0660891904577721f,
- 7.0768155970508317f, 7.0874628412503400f, 7.0980320829605272f,
- 7.1085244567781700f, 7.1189410727235076f, 7.1292830169449664f,
- 7.1395513523987937f, 7.1497471195046822f, 7.1598713367783891f,
- 7.1699250014423130f, 7.1799090900149345f, 7.1898245588800176f,
- 7.1996723448363644f, 7.2094533656289492f, 7.2191685204621621f,
- 7.2288186904958804f, 7.2384047393250794f, 7.2479275134435861f,
- 7.2573878426926521f, 7.2667865406949019f, 7.2761244052742384f,
- 7.2854022188622487f, 7.2946207488916270f, 7.3037807481771031f,
- 7.3128829552843557f, 7.3219280948873617f, 7.3309168781146177f,
- 7.3398500028846243f, 7.3487281542310781f, 7.3575520046180847f,
- 7.3663222142458151f, 7.3750394313469254f, 7.3837042924740528f,
- 7.3923174227787607f, 7.4008794362821844f, 7.4093909361377026f,
- 7.4178525148858991f, 7.4262647547020979f, 7.4346282276367255f,
- 7.4429434958487288f, 7.4512111118323299f, 7.4594316186372973f,
- 7.4676055500829976f, 7.4757334309663976f, 7.4838157772642564f,
- 7.4918530963296748f, 7.4998458870832057f, 7.5077946401986964f,
- 7.5156998382840436f, 7.5235619560570131f, 7.5313814605163119f,
- 7.5391588111080319f, 7.5468944598876373f, 7.5545888516776376f,
- 7.5622424242210728f, 7.5698556083309478f, 7.5774288280357487f,
- 7.5849625007211561f, 7.5924570372680806f, 7.5999128421871278f,
- 7.6073303137496113f, 7.6147098441152075f, 7.6220518194563764f,
- 7.6293566200796095f, 7.6366246205436488f, 7.6438561897747244f,
- 7.6510516911789290f, 7.6582114827517955f, 7.6653359171851765f,
- 7.6724253419714952f, 7.6794800995054464f, 7.6865005271832185f,
- 7.6934869574993252f, 7.7004397181410926f, 7.7073591320808825f,
- 7.7142455176661224f, 7.7210991887071856f, 7.7279204545631996f,
- 7.7347096202258392f, 7.7414669864011465f, 7.7481928495894596f,
- 7.7548875021634691f, 7.7615512324444795f, 7.7681843247769260f,
- 7.7747870596011737f, 7.7813597135246608f, 7.7879025593914317f,
- 7.7944158663501062f, 7.8008998999203047f, 7.8073549220576037f,
- 7.8137811912170374f, 7.8201789624151887f, 7.8265484872909159f,
- 7.8328900141647422f, 7.8392037880969445f, 7.8454900509443757f,
- 7.8517490414160571f, 7.8579809951275719f, 7.8641861446542798f,
- 7.8703647195834048f, 7.8765169465650002f, 7.8826430493618425f,
- 7.8887432488982601f, 7.8948177633079446f, 7.9008668079807496f,
- 7.9068905956085187f, 7.9128893362299619f, 7.9188632372745955f,
- 7.9248125036057813f, 7.9307373375628867f, 7.9366379390025719f,
- 7.9425145053392399f, 7.9483672315846778f, 7.9541963103868758f,
- 7.9600019320680806f, 7.9657842846620870f, 7.9715435539507720f,
- 7.9772799234999168f, 7.9829935746943104f, 7.9886846867721664f,
- 7.9943534368588578f
-};
+/* Visual Studio 2012 and Android API levels < 18 do not have the log2()
+ * function defined, so we use log() and a multiplication instead. */
+#if !defined(BROTLI_HAVE_LOG2)
+#if ((defined(_MSC_VER) && _MSC_VER <= 1700) || \
+ (defined(__ANDROID_API__) && __ANDROID_API__ < 18))
+#define BROTLI_HAVE_LOG2 0
+#else
+#define BROTLI_HAVE_LOG2 1
+#endif
+#endif
#define LOG_2_INV 1.4426950408889634
/* Faster logarithm for small integers, with the property of log2(0) == 0. */
static BROTLI_INLINE double FastLog2(size_t v) {
- if (v < sizeof(kLog2Table) / sizeof(kLog2Table[0])) {
- return kLog2Table[v];
+ if (v < BROTLI_LOG2_TABLE_SIZE) {
+ return kBrotliLog2Table[v];
}
-#if (defined(_MSC_VER) && _MSC_VER <= 1700) || \
- (defined(__ANDROID_API__) && __ANDROID_API__ < 18)
- /* Visual Studio 2012 and Android API levels < 18 do not have the log2()
- * function defined, so we use log() and a multiplication instead. */
+#if !(BROTLI_HAVE_LOG2)
return log((double)v) * LOG_2_INV;
#else
return log2((double)v);
diff --git a/src/libraries/Native/AnyOS/brotli/enc/find_match_length.h b/src/libraries/Native/AnyOS/brotli/enc/find_match_length.h
index bc428cffdaf1..f8853a70fbb8 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/find_match_length.h
+++ b/src/libraries/Native/AnyOS/brotli/enc/find_match_length.h
@@ -17,8 +17,7 @@ extern "C" {
#endif
/* Separate implementation for little-endian 64-bit targets, for speed. */
-#if defined(__GNUC__) && defined(_LP64) && defined(BROTLI_LITTLE_ENDIAN)
-
+#if defined(BROTLI_TZCNT64) && BROTLI_64_BITS && BROTLI_LITTLE_ENDIAN
static BROTLI_INLINE size_t FindMatchLengthWithLimit(const uint8_t* s1,
const uint8_t* s2,
size_t limit) {
@@ -32,7 +31,7 @@ static BROTLI_INLINE size_t FindMatchLengthWithLimit(const uint8_t* s1,
} else {
uint64_t x = BROTLI_UNALIGNED_LOAD64LE(s2) ^
BROTLI_UNALIGNED_LOAD64LE(s1 + matched);
- size_t matching_bits = (size_t)__builtin_ctzll(x);
+ size_t matching_bits = (size_t)BROTLI_TZCNT64(x);
matched += matching_bits >> 3;
return matched;
}
diff --git a/src/libraries/Native/AnyOS/brotli/enc/hash.h b/src/libraries/Native/AnyOS/brotli/enc/hash.h
index 8c5a7bb5ad5d..6362f69b9f5b 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/hash.h
+++ b/src/libraries/Native/AnyOS/brotli/enc/hash.h
@@ -27,34 +27,19 @@
extern "C" {
#endif
-/* Pointer to hasher data.
- *
- * Excluding initialization and destruction, hasher can be passed as
- * HasherHandle by value.
- *
- * Typically hasher data consists of 3 sections:
- * * HasherCommon structure
- * * private structured hasher data, depending on hasher type
- * * private dynamic hasher data, depending on hasher type and parameters
- *
- * Using "define" instead of "typedef", because on MSVC __restrict does not work
- * on typedef pointer types. */
-#define HasherHandle uint8_t*
-
typedef struct {
+ /* Dynamically allocated area; first member for quickest access. */
+ void* extra;
+
+ size_t dict_num_lookups;
+ size_t dict_num_matches;
+
BrotliHasherParams params;
/* False if hasher needs to be "prepared" before use. */
BROTLI_BOOL is_prepared_;
-
- size_t dict_num_lookups;
- size_t dict_num_matches;
} HasherCommon;
-static BROTLI_INLINE HasherCommon* GetHasherCommon(HasherHandle handle) {
- return (HasherCommon*)handle;
-}
-
#define score_t size_t
static const uint32_t kCutoffTransformsCount = 10;
@@ -149,17 +134,13 @@ static BROTLI_INLINE score_t BackwardReferencePenaltyUsingLastDistance(
}
static BROTLI_INLINE BROTLI_BOOL TestStaticDictionaryItem(
- const BrotliEncoderDictionary* dictionary, size_t item,
+ const BrotliEncoderDictionary* dictionary, size_t len, size_t word_idx,
const uint8_t* data, size_t max_length, size_t max_backward,
size_t max_distance, HasherSearchResult* out) {
- size_t len;
- size_t word_idx;
size_t offset;
size_t matchlen;
size_t backward;
score_t score;
- len = item & 0x1F;
- word_idx = item >> 5;
offset = dictionary->words->offsets_by_length[len] + len * word_idx;
if (len > max_length) {
return BROTLI_FALSE;
@@ -193,25 +174,24 @@ static BROTLI_INLINE BROTLI_BOOL TestStaticDictionaryItem(
static BROTLI_INLINE void SearchInStaticDictionary(
const BrotliEncoderDictionary* dictionary,
- HasherHandle handle, const uint8_t* data, size_t max_length,
+ HasherCommon* common, const uint8_t* data, size_t max_length,
size_t max_backward, size_t max_distance,
HasherSearchResult* out, BROTLI_BOOL shallow) {
size_t key;
size_t i;
- HasherCommon* self = GetHasherCommon(handle);
- if (self->dict_num_matches < (self->dict_num_lookups >> 7)) {
+ if (common->dict_num_matches < (common->dict_num_lookups >> 7)) {
return;
}
key = Hash14(data) << 1;
for (i = 0; i < (shallow ? 1u : 2u); ++i, ++key) {
- size_t item = dictionary->hash_table[key];
- self->dict_num_lookups++;
- if (item != 0) {
+ common->dict_num_lookups++;
+ if (dictionary->hash_table_lengths[key] != 0) {
BROTLI_BOOL item_matches = TestStaticDictionaryItem(
- dictionary, item, data,
+ dictionary, dictionary->hash_table_lengths[key],
+ dictionary->hash_table_words[key], data,
max_length, max_backward, max_distance, out);
if (item_matches) {
- self->dict_num_matches++;
+ common->dict_num_matches++;
}
}
}
@@ -260,37 +240,37 @@ static BROTLI_INLINE size_t BackwardMatchLengthCode(const BackwardMatch* self) {
/* MAX_NUM_MATCHES == 64 + MAX_TREE_SEARCH_DEPTH */
#define MAX_NUM_MATCHES_H10 128
-/* For BUCKET_SWEEP == 1, enabling the dictionary lookup makes compression
+/* For BUCKET_SWEEP_BITS == 0, enabling the dictionary lookup makes compression
a little faster (0.5% - 1%) and it compresses 0.15% better on small text
and HTML inputs. */
#define HASHER() H2
#define BUCKET_BITS 16
-#define BUCKET_SWEEP 1
+#define BUCKET_SWEEP_BITS 0
#define HASH_LEN 5
#define USE_DICTIONARY 1
#include "./hash_longest_match_quickly_inc.h" /* NOLINT(build/include) */
-#undef BUCKET_SWEEP
+#undef BUCKET_SWEEP_BITS
#undef USE_DICTIONARY
#undef HASHER
#define HASHER() H3
-#define BUCKET_SWEEP 2
+#define BUCKET_SWEEP_BITS 1
#define USE_DICTIONARY 0
#include "./hash_longest_match_quickly_inc.h" /* NOLINT(build/include) */
#undef USE_DICTIONARY
-#undef BUCKET_SWEEP
+#undef BUCKET_SWEEP_BITS
#undef BUCKET_BITS
#undef HASHER
#define HASHER() H4
#define BUCKET_BITS 17
-#define BUCKET_SWEEP 4
+#define BUCKET_SWEEP_BITS 2
#define USE_DICTIONARY 1
#include "./hash_longest_match_quickly_inc.h" /* NOLINT(build/include) */
#undef USE_DICTIONARY
#undef HASH_LEN
-#undef BUCKET_SWEEP
+#undef BUCKET_SWEEP_BITS
#undef BUCKET_BITS
#undef HASHER
@@ -334,13 +314,13 @@ static BROTLI_INLINE size_t BackwardMatchLengthCode(const BackwardMatch* self) {
#define HASHER() H54
#define BUCKET_BITS 20
-#define BUCKET_SWEEP 4
+#define BUCKET_SWEEP_BITS 2
#define HASH_LEN 7
#define USE_DICTIONARY 0
#include "./hash_longest_match_quickly_inc.h" /* NOLINT(build/include) */
#undef USE_DICTIONARY
#undef HASH_LEN
-#undef BUCKET_SWEEP
+#undef BUCKET_SWEEP_BITS
#undef BUCKET_BITS
#undef HASHER
@@ -393,97 +373,107 @@ static BROTLI_INLINE size_t BackwardMatchLengthCode(const BackwardMatch* self) {
#undef CAT
#undef EXPAND_CAT
-#define FOR_GENERIC_HASHERS(H) H(2) H(3) H(4) H(5) H(6) H(40) H(41) H(42) H(54)\
- H(35) H(55) H(65)
+#define FOR_SIMPLE_HASHERS(H) H(2) H(3) H(4) H(5) H(6) H(40) H(41) H(42) H(54)
+#define FOR_COMPOSITE_HASHERS(H) H(35) H(55) H(65)
+#define FOR_GENERIC_HASHERS(H) FOR_SIMPLE_HASHERS(H) FOR_COMPOSITE_HASHERS(H)
#define FOR_ALL_HASHERS(H) FOR_GENERIC_HASHERS(H) H(10)
-static BROTLI_INLINE void DestroyHasher(
- MemoryManager* m, HasherHandle* handle) {
- if (*handle == NULL) return;
- BROTLI_FREE(m, *handle);
+typedef struct {
+ HasherCommon common;
+
+ union {
+#define MEMBER_(N) \
+ H ## N _H ## N;
+ FOR_ALL_HASHERS(MEMBER_)
+#undef MEMBER_
+ } privat;
+} Hasher;
+
+/* MUST be invoked before any other method. */
+static BROTLI_INLINE void HasherInit(Hasher* hasher) {
+ hasher->common.extra = NULL;
}
-static BROTLI_INLINE void HasherReset(HasherHandle handle) {
- if (handle == NULL) return;
- GetHasherCommon(handle)->is_prepared_ = BROTLI_FALSE;
+static BROTLI_INLINE void DestroyHasher(MemoryManager* m, Hasher* hasher) {
+ if (hasher->common.extra == NULL) return;
+ BROTLI_FREE(m, hasher->common.extra);
+}
+
+static BROTLI_INLINE void HasherReset(Hasher* hasher) {
+ hasher->common.is_prepared_ = BROTLI_FALSE;
}
static BROTLI_INLINE size_t HasherSize(const BrotliEncoderParams* params,
BROTLI_BOOL one_shot, const size_t input_size) {
- size_t result = sizeof(HasherCommon);
switch (params->hasher.type) {
-#define SIZE_(N) \
- case N: \
- result += HashMemAllocInBytesH ## N(params, one_shot, input_size); \
- break;
+#define SIZE_(N) \
+ case N: \
+ return HashMemAllocInBytesH ## N(params, one_shot, input_size);
FOR_ALL_HASHERS(SIZE_)
#undef SIZE_
default:
break;
}
- return result;
+ return 0; /* Default case. */
}
-static BROTLI_INLINE void HasherSetup(MemoryManager* m, HasherHandle* handle,
+static BROTLI_INLINE void HasherSetup(MemoryManager* m, Hasher* hasher,
BrotliEncoderParams* params, const uint8_t* data, size_t position,
size_t input_size, BROTLI_BOOL is_last) {
- HasherHandle self = NULL;
- HasherCommon* common = NULL;
BROTLI_BOOL one_shot = (position == 0 && is_last);
- if (*handle == NULL) {
+ if (hasher->common.extra == NULL) {
size_t alloc_size;
ChooseHasher(params, ¶ms->hasher);
alloc_size = HasherSize(params, one_shot, input_size);
- self = BROTLI_ALLOC(m, uint8_t, alloc_size);
- if (BROTLI_IS_OOM(m)) return;
- *handle = self;
- common = GetHasherCommon(self);
- common->params = params->hasher;
- switch (common->params.type) {
-#define INITIALIZE_(N) \
- case N: \
- InitializeH ## N(*handle, params); \
+ hasher->common.extra = BROTLI_ALLOC(m, uint8_t, alloc_size);
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(hasher->common.extra)) return;
+ hasher->common.params = params->hasher;
+ switch (hasher->common.params.type) {
+#define INITIALIZE_(N) \
+ case N: \
+ InitializeH ## N(&hasher->common, \
+ &hasher->privat._H ## N, params); \
break;
FOR_ALL_HASHERS(INITIALIZE_);
#undef INITIALIZE_
default:
break;
}
- HasherReset(*handle);
+ HasherReset(hasher);
}
- self = *handle;
- common = GetHasherCommon(self);
- if (!common->is_prepared_) {
- switch (common->params.type) {
-#define PREPARE_(N) \
- case N: \
- PrepareH ## N(self, one_shot, input_size, data); \
+ if (!hasher->common.is_prepared_) {
+ switch (hasher->common.params.type) {
+#define PREPARE_(N) \
+ case N: \
+ PrepareH ## N( \
+ &hasher->privat._H ## N, \
+ one_shot, input_size, data); \
break;
FOR_ALL_HASHERS(PREPARE_)
#undef PREPARE_
default: break;
}
if (position == 0) {
- common->dict_num_lookups = 0;
- common->dict_num_matches = 0;
+ hasher->common.dict_num_lookups = 0;
+ hasher->common.dict_num_matches = 0;
}
- common->is_prepared_ = BROTLI_TRUE;
+ hasher->common.is_prepared_ = BROTLI_TRUE;
}
}
static BROTLI_INLINE void InitOrStitchToPreviousBlock(
- MemoryManager* m, HasherHandle* handle, const uint8_t* data, size_t mask,
+ MemoryManager* m, Hasher* hasher, const uint8_t* data, size_t mask,
BrotliEncoderParams* params, size_t position, size_t input_size,
BROTLI_BOOL is_last) {
- HasherHandle self;
- HasherSetup(m, handle, params, data, position, input_size, is_last);
+ HasherSetup(m, hasher, params, data, position, input_size, is_last);
if (BROTLI_IS_OOM(m)) return;
- self = *handle;
- switch (GetHasherCommon(self)->params.type) {
-#define INIT_(N) \
- case N: \
- StitchToPreviousBlockH ## N(self, input_size, position, data, mask); \
+ switch (hasher->common.params.type) {
+#define INIT_(N) \
+ case N: \
+ StitchToPreviousBlockH ## N( \
+ &hasher->privat._H ## N, \
+ input_size, position, data, mask); \
break;
FOR_ALL_HASHERS(INIT_)
#undef INIT_
diff --git a/src/libraries/Native/AnyOS/brotli/enc/hash_composite_inc.h b/src/libraries/Native/AnyOS/brotli/enc/hash_composite_inc.h
index b266aa2f8da4..cba156c0e230 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/hash_composite_inc.h
+++ b/src/libraries/Native/AnyOS/brotli/enc/hash_composite_inc.h
@@ -28,20 +28,25 @@ static BROTLI_INLINE size_t FN(StoreLookahead)(void) {
}
typedef struct HashComposite {
- HasherHandle ha;
- HasherHandle hb;
+ HASHER_A ha;
+ HASHER_B hb;
+ HasherCommon hb_common;
+
+ /* Shortcuts. */
+ void* extra;
+ HasherCommon* common;
+
+ BROTLI_BOOL fresh;
const BrotliEncoderParams* params;
} HashComposite;
-static BROTLI_INLINE HashComposite* FN(Self)(HasherHandle handle) {
- return (HashComposite*)&(GetHasherCommon(handle)[1]);
-}
+static void FN(Initialize)(HasherCommon* common,
+ HashComposite* BROTLI_RESTRICT self, const BrotliEncoderParams* params) {
+ self->common = common;
+ self->extra = common->extra;
-static void FN(Initialize)(
- HasherHandle handle, const BrotliEncoderParams* params) {
- HashComposite* self = FN(Self)(handle);
- self->ha = 0;
- self->hb = 0;
+ self->hb_common = *self->common;
+ self->fresh = BROTLI_TRUE;
self->params = params;
/* TODO: Initialize of the hashers is defered to Prepare (and params
remembered here) because we don't get the one_shot and input_size params
@@ -49,87 +54,71 @@ static void FN(Initialize)(
those params to all hashers FN(Initialize) */
}
-static void FN(Prepare)(HasherHandle handle, BROTLI_BOOL one_shot,
- size_t input_size, const uint8_t* data) {
- HashComposite* self = FN(Self)(handle);
- if (!self->ha) {
- HasherCommon* common_a;
- HasherCommon* common_b;
-
- self->ha = handle + sizeof(HasherCommon) + sizeof(HashComposite);
- common_a = (HasherCommon*)self->ha;
- common_a->params = self->params->hasher;
- common_a->is_prepared_ = BROTLI_FALSE;
- common_a->dict_num_lookups = 0;
- common_a->dict_num_matches = 0;
- FN_A(Initialize)(self->ha, self->params);
-
- self->hb = self->ha + sizeof(HasherCommon) + FN_A(HashMemAllocInBytes)(
- self->params, one_shot, input_size);
- common_b = (HasherCommon*)self->hb;
- common_b->params = self->params->hasher;
- common_b->is_prepared_ = BROTLI_FALSE;
- common_b->dict_num_lookups = 0;
- common_b->dict_num_matches = 0;
- FN_B(Initialize)(self->hb, self->params);
+static void FN(Prepare)(
+ HashComposite* BROTLI_RESTRICT self, BROTLI_BOOL one_shot,
+ size_t input_size, const uint8_t* BROTLI_RESTRICT data) {
+ if (self->fresh) {
+ self->fresh = BROTLI_FALSE;
+ self->hb_common.extra = (uint8_t*)self->extra +
+ FN_A(HashMemAllocInBytes)(self->params, one_shot, input_size);
+
+ FN_A(Initialize)(self->common, &self->ha, self->params);
+ FN_B(Initialize)(&self->hb_common, &self->hb, self->params);
}
- FN_A(Prepare)(self->ha, one_shot, input_size, data);
- FN_B(Prepare)(self->hb, one_shot, input_size, data);
+ FN_A(Prepare)(&self->ha, one_shot, input_size, data);
+ FN_B(Prepare)(&self->hb, one_shot, input_size, data);
}
static BROTLI_INLINE size_t FN(HashMemAllocInBytes)(
const BrotliEncoderParams* params, BROTLI_BOOL one_shot,
size_t input_size) {
- return sizeof(HashComposite) + 2 * sizeof(HasherCommon) +
- FN_A(HashMemAllocInBytes)(params, one_shot, input_size) +
+ return FN_A(HashMemAllocInBytes)(params, one_shot, input_size) +
FN_B(HashMemAllocInBytes)(params, one_shot, input_size);
}
-static BROTLI_INLINE void FN(Store)(HasherHandle BROTLI_RESTRICT handle,
+static BROTLI_INLINE void FN(Store)(HashComposite* BROTLI_RESTRICT self,
const uint8_t* BROTLI_RESTRICT data, const size_t mask, const size_t ix) {
- HashComposite* self = FN(Self)(handle);
- FN_A(Store)(self->ha, data, mask, ix);
- FN_B(Store)(self->hb, data, mask, ix);
+ FN_A(Store)(&self->ha, data, mask, ix);
+ FN_B(Store)(&self->hb, data, mask, ix);
}
-static BROTLI_INLINE void FN(StoreRange)(HasherHandle handle,
- const uint8_t* data, const size_t mask, const size_t ix_start,
+static BROTLI_INLINE void FN(StoreRange)(
+ HashComposite* BROTLI_RESTRICT self, const uint8_t* BROTLI_RESTRICT data,
+ const size_t mask, const size_t ix_start,
const size_t ix_end) {
- HashComposite* self = FN(Self)(handle);
- FN_A(StoreRange)(self->ha, data, mask, ix_start, ix_end);
- FN_B(StoreRange)(self->hb, data, mask, ix_start, ix_end);
+ FN_A(StoreRange)(&self->ha, data, mask, ix_start, ix_end);
+ FN_B(StoreRange)(&self->hb, data, mask, ix_start, ix_end);
}
-static BROTLI_INLINE void FN(StitchToPreviousBlock)(HasherHandle handle,
+static BROTLI_INLINE void FN(StitchToPreviousBlock)(
+ HashComposite* BROTLI_RESTRICT self,
size_t num_bytes, size_t position, const uint8_t* ringbuffer,
size_t ring_buffer_mask) {
- HashComposite* self = FN(Self)(handle);
- FN_A(StitchToPreviousBlock)(self->ha, num_bytes, position, ringbuffer,
- ring_buffer_mask);
- FN_B(StitchToPreviousBlock)(self->hb, num_bytes, position, ringbuffer,
- ring_buffer_mask);
+ FN_A(StitchToPreviousBlock)(&self->ha, num_bytes, position,
+ ringbuffer, ring_buffer_mask);
+ FN_B(StitchToPreviousBlock)(&self->hb, num_bytes, position,
+ ringbuffer, ring_buffer_mask);
}
static BROTLI_INLINE void FN(PrepareDistanceCache)(
- HasherHandle handle, int* BROTLI_RESTRICT distance_cache) {
- HashComposite* self = FN(Self)(handle);
- FN_A(PrepareDistanceCache)(self->ha, distance_cache);
- FN_B(PrepareDistanceCache)(self->hb, distance_cache);
+ HashComposite* BROTLI_RESTRICT self, int* BROTLI_RESTRICT distance_cache) {
+ FN_A(PrepareDistanceCache)(&self->ha, distance_cache);
+ FN_B(PrepareDistanceCache)(&self->hb, distance_cache);
}
-static BROTLI_INLINE void FN(FindLongestMatch)(HasherHandle handle,
+static BROTLI_INLINE void FN(FindLongestMatch)(
+ HashComposite* BROTLI_RESTRICT self,
const BrotliEncoderDictionary* dictionary,
const uint8_t* BROTLI_RESTRICT data, const size_t ring_buffer_mask,
const int* BROTLI_RESTRICT distance_cache, const size_t cur_ix,
const size_t max_length, const size_t max_backward,
- const size_t gap, const size_t max_distance,
+ const size_t dictionary_distance, const size_t max_distance,
HasherSearchResult* BROTLI_RESTRICT out) {
- HashComposite* self = FN(Self)(handle);
- FN_A(FindLongestMatch)(self->ha, dictionary, data, ring_buffer_mask,
- distance_cache, cur_ix, max_length, max_backward, gap,
+ FN_A(FindLongestMatch)(&self->ha, dictionary, data, ring_buffer_mask,
+ distance_cache, cur_ix, max_length, max_backward, dictionary_distance,
max_distance, out);
- FN_B(FindLongestMatch)(self->hb, dictionary, data, ring_buffer_mask,
- distance_cache, cur_ix, max_length, max_backward, gap,
+ FN_B(FindLongestMatch)(&self->hb, dictionary, data, ring_buffer_mask,
+ distance_cache, cur_ix, max_length, max_backward, dictionary_distance,
max_distance, out);
}
diff --git a/src/libraries/Native/AnyOS/brotli/enc/hash_forgetful_chain_inc.h b/src/libraries/Native/AnyOS/brotli/enc/hash_forgetful_chain_inc.h
index 41cb3ff03ac5..bfae6ba6a208 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/hash_forgetful_chain_inc.h
+++ b/src/libraries/Native/AnyOS/brotli/enc/hash_forgetful_chain_inc.h
@@ -28,7 +28,7 @@ static BROTLI_INLINE size_t FN(HashTypeLength)(void) { return 4; }
static BROTLI_INLINE size_t FN(StoreLookahead)(void) { return 4; }
/* HashBytes is the function that chooses the bucket to place the address in.*/
-static BROTLI_INLINE size_t FN(HashBytes)(const uint8_t* data) {
+static BROTLI_INLINE size_t FN(HashBytes)(const uint8_t* BROTLI_RESTRICT data) {
const uint32_t h = BROTLI_UNALIGNED_LOAD32LE(data) * kHashMul32;
/* The higher bits contain more mixture from the multiplication,
so we take our results from there. */
@@ -45,28 +45,56 @@ typedef struct FN(Bank) {
} FN(Bank);
typedef struct HashForgetfulChain {
- uint32_t addr[BUCKET_SIZE];
- uint16_t head[BUCKET_SIZE];
- /* Truncated hash used for quick rejection of "distance cache" candidates. */
- uint8_t tiny_hash[65536];
- FN(Bank) banks[NUM_BANKS];
- uint16_t free_slot_idx[NUM_BANKS];
+ uint16_t free_slot_idx[NUM_BANKS]; /* Up to 1KiB. Move to dynamic? */
size_t max_hops;
+
+ /* Shortcuts. */
+ void* extra;
+ HasherCommon* common;
+
+ /* --- Dynamic size members --- */
+
+ /* uint32_t addr[BUCKET_SIZE]; */
+
+ /* uint16_t head[BUCKET_SIZE]; */
+
+ /* Truncated hash used for quick rejection of "distance cache" candidates. */
+ /* uint8_t tiny_hash[65536];*/
+
+ /* FN(Bank) banks[NUM_BANKS]; */
} HashForgetfulChain;
-static BROTLI_INLINE HashForgetfulChain* FN(Self)(HasherHandle handle) {
- return (HashForgetfulChain*)&(GetHasherCommon(handle)[1]);
+static uint32_t* FN(Addr)(void* extra) {
+ return (uint32_t*)extra;
+}
+
+static uint16_t* FN(Head)(void* extra) {
+ return (uint16_t*)(&FN(Addr)(extra)[BUCKET_SIZE]);
+}
+
+static uint8_t* FN(TinyHash)(void* extra) {
+ return (uint8_t*)(&FN(Head)(extra)[BUCKET_SIZE]);
+}
+
+static FN(Bank)* FN(Banks)(void* extra) {
+ return (FN(Bank)*)(&FN(TinyHash)(extra)[65536]);
}
static void FN(Initialize)(
- HasherHandle handle, const BrotliEncoderParams* params) {
- FN(Self)(handle)->max_hops =
- (params->quality > 6 ? 7u : 8u) << (params->quality - 4);
+ HasherCommon* common, HashForgetfulChain* BROTLI_RESTRICT self,
+ const BrotliEncoderParams* params) {
+ self->common = common;
+ self->extra = common->extra;
+
+ self->max_hops = (params->quality > 6 ? 7u : 8u) << (params->quality - 4);
}
-static void FN(Prepare)(HasherHandle handle, BROTLI_BOOL one_shot,
- size_t input_size, const uint8_t* data) {
- HashForgetfulChain* self = FN(Self)(handle);
+static void FN(Prepare)(
+ HashForgetfulChain* BROTLI_RESTRICT self, BROTLI_BOOL one_shot,
+ size_t input_size, const uint8_t* BROTLI_RESTRICT data) {
+ uint32_t* BROTLI_RESTRICT addr = FN(Addr)(self->extra);
+ uint16_t* BROTLI_RESTRICT head = FN(Head)(self->extra);
+ uint8_t* BROTLI_RESTRICT tiny_hash = FN(TinyHash)(self->extra);
/* Partial preparation is 100 times slower (per socket). */
size_t partial_prepare_threshold = BUCKET_SIZE >> 6;
if (one_shot && input_size <= partial_prepare_threshold) {
@@ -74,17 +102,17 @@ static void FN(Prepare)(HasherHandle handle, BROTLI_BOOL one_shot,
for (i = 0; i < input_size; ++i) {
size_t bucket = FN(HashBytes)(&data[i]);
/* See InitEmpty comment. */
- self->addr[bucket] = 0xCCCCCCCC;
- self->head[bucket] = 0xCCCC;
+ addr[bucket] = 0xCCCCCCCC;
+ head[bucket] = 0xCCCC;
}
} else {
/* Fill |addr| array with 0xCCCCCCCC value. Because of wrapping, position
processed by hasher never reaches 3GB + 64M; this makes all new chains
to be terminated after the first node. */
- memset(self->addr, 0xCC, sizeof(self->addr));
- memset(self->head, 0, sizeof(self->head));
+ memset(addr, 0xCC, sizeof(uint32_t) * BUCKET_SIZE);
+ memset(head, 0, sizeof(uint16_t) * BUCKET_SIZE);
}
- memset(self->tiny_hash, 0, sizeof(self->tiny_hash));
+ memset(tiny_hash, 0, sizeof(uint8_t) * 65536);
memset(self->free_slot_idx, 0, sizeof(self->free_slot_idx));
}
@@ -94,51 +122,58 @@ static BROTLI_INLINE size_t FN(HashMemAllocInBytes)(
BROTLI_UNUSED(params);
BROTLI_UNUSED(one_shot);
BROTLI_UNUSED(input_size);
- return sizeof(HashForgetfulChain);
+ return sizeof(uint32_t) * BUCKET_SIZE + sizeof(uint16_t) * BUCKET_SIZE +
+ sizeof(uint8_t) * 65536 + sizeof(FN(Bank)) * NUM_BANKS;
}
/* Look at 4 bytes at &data[ix & mask]. Compute a hash from these, and prepend
node to corresponding chain; also update tiny_hash for current position. */
-static BROTLI_INLINE void FN(Store)(HasherHandle BROTLI_RESTRICT handle,
+static BROTLI_INLINE void FN(Store)(HashForgetfulChain* BROTLI_RESTRICT self,
const uint8_t* BROTLI_RESTRICT data, const size_t mask, const size_t ix) {
- HashForgetfulChain* self = FN(Self)(handle);
+ uint32_t* BROTLI_RESTRICT addr = FN(Addr)(self->extra);
+ uint16_t* BROTLI_RESTRICT head = FN(Head)(self->extra);
+ uint8_t* BROTLI_RESTRICT tiny_hash = FN(TinyHash)(self->extra);
+ FN(Bank)* BROTLI_RESTRICT banks = FN(Banks)(self->extra);
const size_t key = FN(HashBytes)(&data[ix & mask]);
const size_t bank = key & (NUM_BANKS - 1);
const size_t idx = self->free_slot_idx[bank]++ & (BANK_SIZE - 1);
- size_t delta = ix - self->addr[key];
- self->tiny_hash[(uint16_t)ix] = (uint8_t)key;
+ size_t delta = ix - addr[key];
+ tiny_hash[(uint16_t)ix] = (uint8_t)key;
if (delta > 0xFFFF) delta = CAPPED_CHAINS ? 0 : 0xFFFF;
- self->banks[bank].slots[idx].delta = (uint16_t)delta;
- self->banks[bank].slots[idx].next = self->head[key];
- self->addr[key] = (uint32_t)ix;
- self->head[key] = (uint16_t)idx;
+ banks[bank].slots[idx].delta = (uint16_t)delta;
+ banks[bank].slots[idx].next = head[key];
+ addr[key] = (uint32_t)ix;
+ head[key] = (uint16_t)idx;
}
-static BROTLI_INLINE void FN(StoreRange)(HasherHandle handle,
- const uint8_t* data, const size_t mask, const size_t ix_start,
- const size_t ix_end) {
+static BROTLI_INLINE void FN(StoreRange)(
+ HashForgetfulChain* BROTLI_RESTRICT self,
+ const uint8_t* BROTLI_RESTRICT data, const size_t mask,
+ const size_t ix_start, const size_t ix_end) {
size_t i;
for (i = ix_start; i < ix_end; ++i) {
- FN(Store)(handle, data, mask, i);
+ FN(Store)(self, data, mask, i);
}
}
-static BROTLI_INLINE void FN(StitchToPreviousBlock)(HasherHandle handle,
+static BROTLI_INLINE void FN(StitchToPreviousBlock)(
+ HashForgetfulChain* BROTLI_RESTRICT self,
size_t num_bytes, size_t position, const uint8_t* ringbuffer,
size_t ring_buffer_mask) {
if (num_bytes >= FN(HashTypeLength)() - 1 && position >= 3) {
/* Prepare the hashes for three last bytes of the last write.
These could not be calculated before, since they require knowledge
of both the previous and the current block. */
- FN(Store)(handle, ringbuffer, ring_buffer_mask, position - 3);
- FN(Store)(handle, ringbuffer, ring_buffer_mask, position - 2);
- FN(Store)(handle, ringbuffer, ring_buffer_mask, position - 1);
+ FN(Store)(self, ringbuffer, ring_buffer_mask, position - 3);
+ FN(Store)(self, ringbuffer, ring_buffer_mask, position - 2);
+ FN(Store)(self, ringbuffer, ring_buffer_mask, position - 1);
}
}
static BROTLI_INLINE void FN(PrepareDistanceCache)(
- HasherHandle handle, int* BROTLI_RESTRICT distance_cache) {
- BROTLI_UNUSED(handle);
+ HashForgetfulChain* BROTLI_RESTRICT self,
+ int* BROTLI_RESTRICT distance_cache) {
+ BROTLI_UNUSED(self);
PrepareDistanceCache(distance_cache, NUM_LAST_DISTANCES_TO_CHECK);
}
@@ -153,14 +188,18 @@ static BROTLI_INLINE void FN(PrepareDistanceCache)(
Does not look for matches further away than max_backward.
Writes the best match into |out|.
|out|->score is updated only if a better match is found. */
-static BROTLI_INLINE void FN(FindLongestMatch)(HasherHandle handle,
+static BROTLI_INLINE void FN(FindLongestMatch)(
+ HashForgetfulChain* BROTLI_RESTRICT self,
const BrotliEncoderDictionary* dictionary,
const uint8_t* BROTLI_RESTRICT data, const size_t ring_buffer_mask,
const int* BROTLI_RESTRICT distance_cache,
const size_t cur_ix, const size_t max_length, const size_t max_backward,
- const size_t gap, const size_t max_distance,
+ const size_t dictionary_distance, const size_t max_distance,
HasherSearchResult* BROTLI_RESTRICT out) {
- HashForgetfulChain* self = FN(Self)(handle);
+ uint32_t* BROTLI_RESTRICT addr = FN(Addr)(self->extra);
+ uint16_t* BROTLI_RESTRICT head = FN(Head)(self->extra);
+ uint8_t* BROTLI_RESTRICT tiny_hashes = FN(TinyHash)(self->extra);
+ FN(Bank)* BROTLI_RESTRICT banks = FN(Banks)(self->extra);
const size_t cur_ix_masked = cur_ix & ring_buffer_mask;
/* Don't accept a short copy from far away. */
score_t min_score = out->score;
@@ -176,7 +215,7 @@ static BROTLI_INLINE void FN(FindLongestMatch)(HasherHandle handle,
const size_t backward = (size_t)distance_cache[i];
size_t prev_ix = (cur_ix - backward);
/* For distance code 0 we want to consider 2-byte matches. */
- if (i > 0 && self->tiny_hash[(uint16_t)prev_ix] != tiny_hash) continue;
+ if (i > 0 && tiny_hashes[(uint16_t)prev_ix] != tiny_hash) continue;
if (prev_ix >= cur_ix || backward > max_backward) {
continue;
}
@@ -204,16 +243,16 @@ static BROTLI_INLINE void FN(FindLongestMatch)(HasherHandle handle,
const size_t bank = key & (NUM_BANKS - 1);
size_t backward = 0;
size_t hops = self->max_hops;
- size_t delta = cur_ix - self->addr[key];
- size_t slot = self->head[key];
+ size_t delta = cur_ix - addr[key];
+ size_t slot = head[key];
while (hops--) {
size_t prev_ix;
size_t last = slot;
backward += delta;
if (backward > max_backward || (CAPPED_CHAINS && !delta)) break;
prev_ix = (cur_ix - backward) & ring_buffer_mask;
- slot = self->banks[bank].slots[last].next;
- delta = self->banks[bank].slots[last].delta;
+ slot = banks[bank].slots[last].next;
+ delta = banks[bank].slots[last].delta;
if (cur_ix_masked + best_len > ring_buffer_mask ||
prev_ix + best_len > ring_buffer_mask ||
data[cur_ix_masked + best_len] != data[prev_ix + best_len]) {
@@ -238,11 +277,11 @@ static BROTLI_INLINE void FN(FindLongestMatch)(HasherHandle handle,
}
}
}
- FN(Store)(handle, data, ring_buffer_mask, cur_ix);
+ FN(Store)(self, data, ring_buffer_mask, cur_ix);
}
if (out->score == min_score) {
SearchInStaticDictionary(dictionary,
- handle, &data[cur_ix_masked], max_length, max_backward + gap,
+ self->common, &data[cur_ix_masked], max_length, dictionary_distance,
max_distance, out, BROTLI_FALSE);
}
}
diff --git a/src/libraries/Native/AnyOS/brotli/enc/hash_longest_match64_inc.h b/src/libraries/Native/AnyOS/brotli/enc/hash_longest_match64_inc.h
index cb953a644fca..956fb304b362 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/hash_longest_match64_inc.h
+++ b/src/libraries/Native/AnyOS/brotli/enc/hash_longest_match64_inc.h
@@ -20,7 +20,7 @@ static BROTLI_INLINE size_t FN(HashTypeLength)(void) { return 8; }
static BROTLI_INLINE size_t FN(StoreLookahead)(void) { return 8; }
/* HashBytes is the function that chooses the bucket to place the address in. */
-static BROTLI_INLINE uint32_t FN(HashBytes)(const uint8_t* data,
+static BROTLI_INLINE uint32_t FN(HashBytes)(const uint8_t* BROTLI_RESTRICT data,
const uint64_t mask,
const int shift) {
const uint64_t h = (BROTLI_UNALIGNED_LOAD64LE(data) & mask) * kHashMul64Long;
@@ -42,43 +42,43 @@ typedef struct HashLongestMatch {
/* Mask for accessing entries in a block (in a ring-buffer manner). */
uint32_t block_mask_;
+ int block_bits_;
+ int num_last_distances_to_check_;
+
+ /* Shortcuts. */
+ HasherCommon* common_;
+
/* --- Dynamic size members --- */
/* Number of entries in a particular bucket. */
- /* uint16_t num[bucket_size]; */
+ uint16_t* num_; /* uint16_t[bucket_size]; */
/* Buckets containing block_size_ of backward references. */
- /* uint32_t* buckets[bucket_size * block_size]; */
+ uint32_t* buckets_; /* uint32_t[bucket_size * block_size]; */
} HashLongestMatch;
-static BROTLI_INLINE HashLongestMatch* FN(Self)(HasherHandle handle) {
- return (HashLongestMatch*)&(GetHasherCommon(handle)[1]);
-}
-
-static BROTLI_INLINE uint16_t* FN(Num)(HashLongestMatch* self) {
- return (uint16_t*)(&self[1]);
-}
-
-static BROTLI_INLINE uint32_t* FN(Buckets)(HashLongestMatch* self) {
- return (uint32_t*)(&FN(Num)(self)[self->bucket_size_]);
-}
-
static void FN(Initialize)(
- HasherHandle handle, const BrotliEncoderParams* params) {
- HasherCommon* common = GetHasherCommon(handle);
- HashLongestMatch* self = FN(Self)(handle);
+ HasherCommon* common, HashLongestMatch* BROTLI_RESTRICT self,
+ const BrotliEncoderParams* params) {
+ self->common_ = common;
+
BROTLI_UNUSED(params);
self->hash_shift_ = 64 - common->params.bucket_bits;
self->hash_mask_ = (~((uint64_t)0U)) >> (64 - 8 * common->params.hash_len);
self->bucket_size_ = (size_t)1 << common->params.bucket_bits;
+ self->block_bits_ = common->params.block_bits;
self->block_size_ = (size_t)1 << common->params.block_bits;
self->block_mask_ = (uint32_t)(self->block_size_ - 1);
+ self->num_last_distances_to_check_ =
+ common->params.num_last_distances_to_check;
+ self->num_ = (uint16_t*)common->extra;
+ self->buckets_ = (uint32_t*)&self->num_[self->bucket_size_];
}
-static void FN(Prepare)(HasherHandle handle, BROTLI_BOOL one_shot,
- size_t input_size, const uint8_t* data) {
- HashLongestMatch* self = FN(Self)(handle);
- uint16_t* num = FN(Num)(self);
+static void FN(Prepare)(
+ HashLongestMatch* BROTLI_RESTRICT self, BROTLI_BOOL one_shot,
+ size_t input_size, const uint8_t* BROTLI_RESTRICT data) {
+ uint16_t* BROTLI_RESTRICT num = self->num_;
/* Partial preparation is 100 times slower (per socket). */
size_t partial_prepare_threshold = self->bucket_size_ >> 6;
if (one_shot && input_size <= partial_prepare_threshold) {
@@ -100,50 +100,52 @@ static BROTLI_INLINE size_t FN(HashMemAllocInBytes)(
size_t block_size = (size_t)1 << params->hasher.block_bits;
BROTLI_UNUSED(one_shot);
BROTLI_UNUSED(input_size);
- return sizeof(HashLongestMatch) + bucket_size * (2 + 4 * block_size);
+ return sizeof(uint16_t) * bucket_size +
+ sizeof(uint32_t) * bucket_size * block_size;
}
/* Look at 4 bytes at &data[ix & mask].
Compute a hash from these, and store the value of ix at that position. */
-static BROTLI_INLINE void FN(Store)(HasherHandle handle, const uint8_t* data,
+static BROTLI_INLINE void FN(Store)(
+ HashLongestMatch* BROTLI_RESTRICT self, const uint8_t* BROTLI_RESTRICT data,
const size_t mask, const size_t ix) {
- HashLongestMatch* self = FN(Self)(handle);
- uint16_t* num = FN(Num)(self);
+ uint16_t* BROTLI_RESTRICT num = self->num_;
+ uint32_t* BROTLI_RESTRICT buckets = self->buckets_;
const uint32_t key = FN(HashBytes)(&data[ix & mask], self->hash_mask_,
self->hash_shift_);
const size_t minor_ix = num[key] & self->block_mask_;
- const size_t offset =
- minor_ix + (key << GetHasherCommon(handle)->params.block_bits);
- FN(Buckets)(self)[offset] = (uint32_t)ix;
+ const size_t offset = minor_ix + (key << self->block_bits_);
++num[key];
+ buckets[offset] = (uint32_t)ix;
}
-static BROTLI_INLINE void FN(StoreRange)(HasherHandle handle,
- const uint8_t* data, const size_t mask, const size_t ix_start,
- const size_t ix_end) {
+static BROTLI_INLINE void FN(StoreRange)(HashLongestMatch* BROTLI_RESTRICT self,
+ const uint8_t* BROTLI_RESTRICT data, const size_t mask,
+ const size_t ix_start, const size_t ix_end) {
size_t i;
for (i = ix_start; i < ix_end; ++i) {
- FN(Store)(handle, data, mask, i);
+ FN(Store)(self, data, mask, i);
}
}
-static BROTLI_INLINE void FN(StitchToPreviousBlock)(HasherHandle handle,
+static BROTLI_INLINE void FN(StitchToPreviousBlock)(
+ HashLongestMatch* BROTLI_RESTRICT self,
size_t num_bytes, size_t position, const uint8_t* ringbuffer,
size_t ringbuffer_mask) {
if (num_bytes >= FN(HashTypeLength)() - 1 && position >= 3) {
/* Prepare the hashes for three last bytes of the last write.
These could not be calculated before, since they require knowledge
of both the previous and the current block. */
- FN(Store)(handle, ringbuffer, ringbuffer_mask, position - 3);
- FN(Store)(handle, ringbuffer, ringbuffer_mask, position - 2);
- FN(Store)(handle, ringbuffer, ringbuffer_mask, position - 1);
+ FN(Store)(self, ringbuffer, ringbuffer_mask, position - 3);
+ FN(Store)(self, ringbuffer, ringbuffer_mask, position - 2);
+ FN(Store)(self, ringbuffer, ringbuffer_mask, position - 1);
}
}
static BROTLI_INLINE void FN(PrepareDistanceCache)(
- HasherHandle handle, int* BROTLI_RESTRICT distance_cache) {
- PrepareDistanceCache(distance_cache,
- GetHasherCommon(handle)->params.num_last_distances_to_check);
+ HashLongestMatch* BROTLI_RESTRICT self,
+ int* BROTLI_RESTRICT distance_cache) {
+ PrepareDistanceCache(distance_cache, self->num_last_distances_to_check_);
}
/* Find a longest backward match of &data[cur_ix] up to the length of
@@ -157,17 +159,16 @@ static BROTLI_INLINE void FN(PrepareDistanceCache)(
Does not look for matches further away than max_backward.
Writes the best match into |out|.
|out|->score is updated only if a better match is found. */
-static BROTLI_INLINE void FN(FindLongestMatch)(HasherHandle handle,
+static BROTLI_INLINE void FN(FindLongestMatch)(
+ HashLongestMatch* BROTLI_RESTRICT self,
const BrotliEncoderDictionary* dictionary,
const uint8_t* BROTLI_RESTRICT data, const size_t ring_buffer_mask,
const int* BROTLI_RESTRICT distance_cache, const size_t cur_ix,
const size_t max_length, const size_t max_backward,
- const size_t gap, const size_t max_distance,
+ const size_t dictionary_distance, const size_t max_distance,
HasherSearchResult* BROTLI_RESTRICT out) {
- HasherCommon* common = GetHasherCommon(handle);
- HashLongestMatch* self = FN(Self)(handle);
- uint16_t* num = FN(Num)(self);
- uint32_t* buckets = FN(Buckets)(self);
+ uint16_t* BROTLI_RESTRICT num = self->num_;
+ uint32_t* BROTLI_RESTRICT buckets = self->buckets_;
const size_t cur_ix_masked = cur_ix & ring_buffer_mask;
/* Don't accept a short copy from far away. */
score_t min_score = out->score;
@@ -177,7 +178,7 @@ static BROTLI_INLINE void FN(FindLongestMatch)(HasherHandle handle,
out->len = 0;
out->len_code_delta = 0;
/* Try last distance first. */
- for (i = 0; i < (size_t)common->params.num_last_distances_to_check; ++i) {
+ for (i = 0; i < (size_t)self->num_last_distances_to_check_; ++i) {
const size_t backward = (size_t)distance_cache[i];
size_t prev_ix = (size_t)(cur_ix - backward);
if (prev_ix >= cur_ix) {
@@ -218,8 +219,7 @@ static BROTLI_INLINE void FN(FindLongestMatch)(HasherHandle handle,
{
const uint32_t key = FN(HashBytes)(
&data[cur_ix_masked], self->hash_mask_, self->hash_shift_);
- uint32_t* BROTLI_RESTRICT bucket =
- &buckets[key << common->params.block_bits];
+ uint32_t* BROTLI_RESTRICT bucket = &buckets[key << self->block_bits_];
const size_t down =
(num[key] > self->block_size_) ?
(num[key] - self->block_size_) : 0u;
@@ -259,7 +259,7 @@ static BROTLI_INLINE void FN(FindLongestMatch)(HasherHandle handle,
}
if (min_score == out->score) {
SearchInStaticDictionary(dictionary,
- handle, &data[cur_ix_masked], max_length, max_backward + gap,
+ self->common_, &data[cur_ix_masked], max_length, dictionary_distance,
max_distance, out, BROTLI_FALSE);
}
}
diff --git a/src/libraries/Native/AnyOS/brotli/enc/hash_longest_match_inc.h b/src/libraries/Native/AnyOS/brotli/enc/hash_longest_match_inc.h
index 457f5a9ed2e2..27f4463d7f3a 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/hash_longest_match_inc.h
+++ b/src/libraries/Native/AnyOS/brotli/enc/hash_longest_match_inc.h
@@ -20,7 +20,8 @@ static BROTLI_INLINE size_t FN(HashTypeLength)(void) { return 4; }
static BROTLI_INLINE size_t FN(StoreLookahead)(void) { return 4; }
/* HashBytes is the function that chooses the bucket to place the address in. */
-static uint32_t FN(HashBytes)(const uint8_t* data, const int shift) {
+static uint32_t FN(HashBytes)(
+ const uint8_t* BROTLI_RESTRICT data, const int shift) {
uint32_t h = BROTLI_UNALIGNED_LOAD32LE(data) * kHashMul32;
/* The higher bits contain more mixture from the multiplication,
so we take our results from there. */
@@ -38,42 +39,46 @@ typedef struct HashLongestMatch {
/* Mask for accessing entries in a block (in a ring-buffer manner). */
uint32_t block_mask_;
+ int block_bits_;
+ int num_last_distances_to_check_;
+
+ /* Shortcuts. */
+ HasherCommon* common_;
+
/* --- Dynamic size members --- */
/* Number of entries in a particular bucket. */
- /* uint16_t num[bucket_size]; */
+ uint16_t* num_; /* uint16_t[bucket_size]; */
/* Buckets containing block_size_ of backward references. */
- /* uint32_t* buckets[bucket_size * block_size]; */
+ uint32_t* buckets_; /* uint32_t[bucket_size * block_size]; */
} HashLongestMatch;
-static BROTLI_INLINE HashLongestMatch* FN(Self)(HasherHandle handle) {
- return (HashLongestMatch*)&(GetHasherCommon(handle)[1]);
-}
-
-static BROTLI_INLINE uint16_t* FN(Num)(HashLongestMatch* self) {
- return (uint16_t*)(&self[1]);
-}
-
-static BROTLI_INLINE uint32_t* FN(Buckets)(HashLongestMatch* self) {
- return (uint32_t*)(&FN(Num)(self)[self->bucket_size_]);
+static BROTLI_INLINE uint16_t* FN(Num)(void* extra) {
+ return (uint16_t*)extra;
}
static void FN(Initialize)(
- HasherHandle handle, const BrotliEncoderParams* params) {
- HasherCommon* common = GetHasherCommon(handle);
- HashLongestMatch* self = FN(Self)(handle);
+ HasherCommon* common, HashLongestMatch* BROTLI_RESTRICT self,
+ const BrotliEncoderParams* params) {
+ self->common_ = common;
+
BROTLI_UNUSED(params);
self->hash_shift_ = 32 - common->params.bucket_bits;
self->bucket_size_ = (size_t)1 << common->params.bucket_bits;
self->block_size_ = (size_t)1 << common->params.block_bits;
self->block_mask_ = (uint32_t)(self->block_size_ - 1);
+ self->num_ = (uint16_t*)common->extra;
+ self->buckets_ = (uint32_t*)(&self->num_[self->bucket_size_]);
+ self->block_bits_ = common->params.block_bits;
+ self->num_last_distances_to_check_ =
+ common->params.num_last_distances_to_check;
}
-static void FN(Prepare)(HasherHandle handle, BROTLI_BOOL one_shot,
- size_t input_size, const uint8_t* data) {
- HashLongestMatch* self = FN(Self)(handle);
- uint16_t* num = FN(Num)(self);
+static void FN(Prepare)(
+ HashLongestMatch* BROTLI_RESTRICT self, BROTLI_BOOL one_shot,
+ size_t input_size, const uint8_t* BROTLI_RESTRICT data) {
+ uint16_t* BROTLI_RESTRICT num = self->num_;
/* Partial preparation is 100 times slower (per socket). */
size_t partial_prepare_threshold = self->bucket_size_ >> 6;
if (one_shot && input_size <= partial_prepare_threshold) {
@@ -94,49 +99,49 @@ static BROTLI_INLINE size_t FN(HashMemAllocInBytes)(
size_t block_size = (size_t)1 << params->hasher.block_bits;
BROTLI_UNUSED(one_shot);
BROTLI_UNUSED(input_size);
- return sizeof(HashLongestMatch) + bucket_size * (2 + 4 * block_size);
+ return sizeof(uint16_t) * bucket_size +
+ sizeof(uint32_t) * bucket_size * block_size;
}
/* Look at 4 bytes at &data[ix & mask].
Compute a hash from these, and store the value of ix at that position. */
-static BROTLI_INLINE void FN(Store)(HasherHandle handle, const uint8_t* data,
+static BROTLI_INLINE void FN(Store)(
+ HashLongestMatch* BROTLI_RESTRICT self, const uint8_t* BROTLI_RESTRICT data,
const size_t mask, const size_t ix) {
- HashLongestMatch* self = FN(Self)(handle);
- uint16_t* num = FN(Num)(self);
const uint32_t key = FN(HashBytes)(&data[ix & mask], self->hash_shift_);
- const size_t minor_ix = num[key] & self->block_mask_;
- const size_t offset =
- minor_ix + (key << GetHasherCommon(handle)->params.block_bits);
- FN(Buckets)(self)[offset] = (uint32_t)ix;
- ++num[key];
+ const size_t minor_ix = self->num_[key] & self->block_mask_;
+ const size_t offset = minor_ix + (key << self->block_bits_);
+ self->buckets_[offset] = (uint32_t)ix;
+ ++self->num_[key];
}
-static BROTLI_INLINE void FN(StoreRange)(HasherHandle handle,
- const uint8_t* data, const size_t mask, const size_t ix_start,
- const size_t ix_end) {
+static BROTLI_INLINE void FN(StoreRange)(HashLongestMatch* BROTLI_RESTRICT self,
+ const uint8_t* BROTLI_RESTRICT data, const size_t mask,
+ const size_t ix_start, const size_t ix_end) {
size_t i;
for (i = ix_start; i < ix_end; ++i) {
- FN(Store)(handle, data, mask, i);
+ FN(Store)(self, data, mask, i);
}
}
-static BROTLI_INLINE void FN(StitchToPreviousBlock)(HasherHandle handle,
+static BROTLI_INLINE void FN(StitchToPreviousBlock)(
+ HashLongestMatch* BROTLI_RESTRICT self,
size_t num_bytes, size_t position, const uint8_t* ringbuffer,
size_t ringbuffer_mask) {
if (num_bytes >= FN(HashTypeLength)() - 1 && position >= 3) {
/* Prepare the hashes for three last bytes of the last write.
These could not be calculated before, since they require knowledge
of both the previous and the current block. */
- FN(Store)(handle, ringbuffer, ringbuffer_mask, position - 3);
- FN(Store)(handle, ringbuffer, ringbuffer_mask, position - 2);
- FN(Store)(handle, ringbuffer, ringbuffer_mask, position - 1);
+ FN(Store)(self, ringbuffer, ringbuffer_mask, position - 3);
+ FN(Store)(self, ringbuffer, ringbuffer_mask, position - 2);
+ FN(Store)(self, ringbuffer, ringbuffer_mask, position - 1);
}
}
static BROTLI_INLINE void FN(PrepareDistanceCache)(
- HasherHandle handle, int* BROTLI_RESTRICT distance_cache) {
- PrepareDistanceCache(distance_cache,
- GetHasherCommon(handle)->params.num_last_distances_to_check);
+ HashLongestMatch* BROTLI_RESTRICT self,
+ int* BROTLI_RESTRICT distance_cache) {
+ PrepareDistanceCache(distance_cache, self->num_last_distances_to_check_);
}
/* Find a longest backward match of &data[cur_ix] up to the length of
@@ -150,17 +155,16 @@ static BROTLI_INLINE void FN(PrepareDistanceCache)(
Does not look for matches further away than max_backward.
Writes the best match into |out|.
|out|->score is updated only if a better match is found. */
-static BROTLI_INLINE void FN(FindLongestMatch)(HasherHandle handle,
+static BROTLI_INLINE void FN(FindLongestMatch)(
+ HashLongestMatch* BROTLI_RESTRICT self,
const BrotliEncoderDictionary* dictionary,
const uint8_t* BROTLI_RESTRICT data, const size_t ring_buffer_mask,
const int* BROTLI_RESTRICT distance_cache, const size_t cur_ix,
const size_t max_length, const size_t max_backward,
- const size_t gap, const size_t max_distance,
+ const size_t dictionary_distance, const size_t max_distance,
HasherSearchResult* BROTLI_RESTRICT out) {
- HasherCommon* common = GetHasherCommon(handle);
- HashLongestMatch* self = FN(Self)(handle);
- uint16_t* num = FN(Num)(self);
- uint32_t* buckets = FN(Buckets)(self);
+ uint16_t* BROTLI_RESTRICT num = self->num_;
+ uint32_t* BROTLI_RESTRICT buckets = self->buckets_;
const size_t cur_ix_masked = cur_ix & ring_buffer_mask;
/* Don't accept a short copy from far away. */
score_t min_score = out->score;
@@ -170,7 +174,7 @@ static BROTLI_INLINE void FN(FindLongestMatch)(HasherHandle handle,
out->len = 0;
out->len_code_delta = 0;
/* Try last distance first. */
- for (i = 0; i < (size_t)common->params.num_last_distances_to_check; ++i) {
+ for (i = 0; i < (size_t)self->num_last_distances_to_check_; ++i) {
const size_t backward = (size_t)distance_cache[i];
size_t prev_ix = (size_t)(cur_ix - backward);
if (prev_ix >= cur_ix) {
@@ -211,8 +215,7 @@ static BROTLI_INLINE void FN(FindLongestMatch)(HasherHandle handle,
{
const uint32_t key =
FN(HashBytes)(&data[cur_ix_masked], self->hash_shift_);
- uint32_t* BROTLI_RESTRICT bucket =
- &buckets[key << common->params.block_bits];
+ uint32_t* BROTLI_RESTRICT bucket = &buckets[key << self->block_bits_];
const size_t down =
(num[key] > self->block_size_) ? (num[key] - self->block_size_) : 0u;
for (i = num[key]; i > down;) {
@@ -251,7 +254,7 @@ static BROTLI_INLINE void FN(FindLongestMatch)(HasherHandle handle,
}
if (min_score == out->score) {
SearchInStaticDictionary(dictionary,
- handle, &data[cur_ix_masked], max_length, max_backward + gap,
+ self->common_, &data[cur_ix_masked], max_length, dictionary_distance,
max_distance, out, BROTLI_FALSE);
}
}
diff --git a/src/libraries/Native/AnyOS/brotli/enc/hash_longest_match_quickly_inc.h b/src/libraries/Native/AnyOS/brotli/enc/hash_longest_match_quickly_inc.h
index a7b9639febff..e5ba840ab977 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/hash_longest_match_quickly_inc.h
+++ b/src/libraries/Native/AnyOS/brotli/enc/hash_longest_match_quickly_inc.h
@@ -5,15 +5,16 @@
See file LICENSE for detail or copy at https://opensource.org/licenses/MIT
*/
-/* template parameters: FN, BUCKET_BITS, BUCKET_SWEEP, HASH_LEN,
+/* template parameters: FN, BUCKET_BITS, BUCKET_SWEEP_BITS, HASH_LEN,
USE_DICTIONARY
*/
#define HashLongestMatchQuickly HASHER()
#define BUCKET_SIZE (1 << BUCKET_BITS)
-
-#define HASH_MAP_SIZE (4 << BUCKET_BITS)
+#define BUCKET_MASK (BUCKET_SIZE - 1)
+#define BUCKET_SWEEP (1 << BUCKET_SWEEP_BITS)
+#define BUCKET_SWEEP_MASK ((BUCKET_SWEEP - 1) << 3)
static BROTLI_INLINE size_t FN(HashTypeLength)(void) { return 8; }
static BROTLI_INLINE size_t FN(StoreLookahead)(void) { return 8; }
@@ -32,39 +33,50 @@ static uint32_t FN(HashBytes)(const uint8_t* data) {
/* A (forgetful) hash table to the data seen by the compressor, to
help create backward references to previous data.
- This is a hash map of fixed size (BUCKET_SIZE). Starting from the
- given index, BUCKET_SWEEP buckets are used to store values of a key. */
+ This is a hash map of fixed size (BUCKET_SIZE). */
typedef struct HashLongestMatchQuickly {
- uint32_t buckets_[BUCKET_SIZE + BUCKET_SWEEP];
-} HashLongestMatchQuickly;
+ /* Shortcuts. */
+ HasherCommon* common;
-static BROTLI_INLINE HashLongestMatchQuickly* FN(Self)(HasherHandle handle) {
- return (HashLongestMatchQuickly*)&(GetHasherCommon(handle)[1]);
-}
+ /* --- Dynamic size members --- */
+
+ uint32_t* buckets_; /* uint32_t[BUCKET_SIZE]; */
+} HashLongestMatchQuickly;
static void FN(Initialize)(
- HasherHandle handle, const BrotliEncoderParams* params) {
- BROTLI_UNUSED(handle);
+ HasherCommon* common, HashLongestMatchQuickly* BROTLI_RESTRICT self,
+ const BrotliEncoderParams* params) {
+ self->common = common;
+
BROTLI_UNUSED(params);
+ self->buckets_ = (uint32_t*)common->extra;
}
-static void FN(Prepare)(HasherHandle handle, BROTLI_BOOL one_shot,
- size_t input_size, const uint8_t* data) {
- HashLongestMatchQuickly* self = FN(Self)(handle);
+static void FN(Prepare)(
+ HashLongestMatchQuickly* BROTLI_RESTRICT self, BROTLI_BOOL one_shot,
+ size_t input_size, const uint8_t* BROTLI_RESTRICT data) {
+ uint32_t* BROTLI_RESTRICT buckets = self->buckets_;
/* Partial preparation is 100 times slower (per socket). */
- size_t partial_prepare_threshold = HASH_MAP_SIZE >> 7;
+ size_t partial_prepare_threshold = BUCKET_SIZE >> 5;
if (one_shot && input_size <= partial_prepare_threshold) {
size_t i;
for (i = 0; i < input_size; ++i) {
const uint32_t key = FN(HashBytes)(&data[i]);
- memset(&self->buckets_[key], 0, BUCKET_SWEEP * sizeof(self->buckets_[0]));
+ if (BUCKET_SWEEP == 1) {
+ buckets[key] = 0;
+ } else {
+ uint32_t j;
+ for (j = 0; j < BUCKET_SWEEP; ++j) {
+ buckets[(key + (j << 3)) & BUCKET_MASK] = 0;
+ }
+ }
}
} else {
/* It is not strictly necessary to fill this buffer here, but
not filling will make the results of the compression stochastic
(but correct). This is because random data would cause the
system to find accidentally good backward references here and there. */
- memset(&self->buckets_[0], 0, sizeof(self->buckets_));
+ memset(buckets, 0, sizeof(uint32_t) * BUCKET_SIZE);
}
}
@@ -74,45 +86,53 @@ static BROTLI_INLINE size_t FN(HashMemAllocInBytes)(
BROTLI_UNUSED(params);
BROTLI_UNUSED(one_shot);
BROTLI_UNUSED(input_size);
- return sizeof(HashLongestMatchQuickly);
+ return sizeof(uint32_t) * BUCKET_SIZE;
}
/* Look at 5 bytes at &data[ix & mask].
Compute a hash from these, and store the value somewhere within
[ix .. ix+3]. */
-static BROTLI_INLINE void FN(Store)(HasherHandle handle,
- const uint8_t* data, const size_t mask, const size_t ix) {
+static BROTLI_INLINE void FN(Store)(
+ HashLongestMatchQuickly* BROTLI_RESTRICT self,
+ const uint8_t* BROTLI_RESTRICT data, const size_t mask, const size_t ix) {
const uint32_t key = FN(HashBytes)(&data[ix & mask]);
- /* Wiggle the value with the bucket sweep range. */
- const uint32_t off = (ix >> 3) % BUCKET_SWEEP;
- FN(Self)(handle)->buckets_[key + off] = (uint32_t)ix;
+ if (BUCKET_SWEEP == 1) {
+ self->buckets_[key] = (uint32_t)ix;
+ } else {
+ /* Wiggle the value with the bucket sweep range. */
+ const uint32_t off = ix & BUCKET_SWEEP_MASK;
+ self->buckets_[(key + off) & BUCKET_MASK] = (uint32_t)ix;
+ }
}
-static BROTLI_INLINE void FN(StoreRange)(HasherHandle handle,
- const uint8_t* data, const size_t mask, const size_t ix_start,
- const size_t ix_end) {
+static BROTLI_INLINE void FN(StoreRange)(
+ HashLongestMatchQuickly* BROTLI_RESTRICT self,
+ const uint8_t* BROTLI_RESTRICT data, const size_t mask,
+ const size_t ix_start, const size_t ix_end) {
size_t i;
for (i = ix_start; i < ix_end; ++i) {
- FN(Store)(handle, data, mask, i);
+ FN(Store)(self, data, mask, i);
}
}
static BROTLI_INLINE void FN(StitchToPreviousBlock)(
- HasherHandle handle, size_t num_bytes, size_t position,
+ HashLongestMatchQuickly* BROTLI_RESTRICT self,
+ size_t num_bytes, size_t position,
const uint8_t* ringbuffer, size_t ringbuffer_mask) {
if (num_bytes >= FN(HashTypeLength)() - 1 && position >= 3) {
/* Prepare the hashes for three last bytes of the last write.
These could not be calculated before, since they require knowledge
of both the previous and the current block. */
- FN(Store)(handle, ringbuffer, ringbuffer_mask, position - 3);
- FN(Store)(handle, ringbuffer, ringbuffer_mask, position - 2);
- FN(Store)(handle, ringbuffer, ringbuffer_mask, position - 1);
+ FN(Store)(self, ringbuffer, ringbuffer_mask, position - 3);
+ FN(Store)(self, ringbuffer, ringbuffer_mask, position - 2);
+ FN(Store)(self, ringbuffer, ringbuffer_mask, position - 1);
}
}
static BROTLI_INLINE void FN(PrepareDistanceCache)(
- HasherHandle handle, int* BROTLI_RESTRICT distance_cache) {
- BROTLI_UNUSED(handle);
+ HashLongestMatchQuickly* BROTLI_RESTRICT self,
+ int* BROTLI_RESTRICT distance_cache) {
+ BROTLI_UNUSED(self);
BROTLI_UNUSED(distance_cache);
}
@@ -125,17 +145,19 @@ static BROTLI_INLINE void FN(PrepareDistanceCache)(
Writes the best match into |out|.
|out|->score is updated only if a better match is found. */
static BROTLI_INLINE void FN(FindLongestMatch)(
- HasherHandle handle, const BrotliEncoderDictionary* dictionary,
+ HashLongestMatchQuickly* BROTLI_RESTRICT self,
+ const BrotliEncoderDictionary* dictionary,
const uint8_t* BROTLI_RESTRICT data,
const size_t ring_buffer_mask, const int* BROTLI_RESTRICT distance_cache,
const size_t cur_ix, const size_t max_length, const size_t max_backward,
- const size_t gap, const size_t max_distance,
+ const size_t dictionary_distance, const size_t max_distance,
HasherSearchResult* BROTLI_RESTRICT out) {
- HashLongestMatchQuickly* self = FN(Self)(handle);
+ uint32_t* BROTLI_RESTRICT buckets = self->buckets_;
const size_t best_len_in = out->len;
const size_t cur_ix_masked = cur_ix & ring_buffer_mask;
- const uint32_t key = FN(HashBytes)(&data[cur_ix_masked]);
int compare_char = data[cur_ix_masked + best_len_in];
+ size_t key = FN(HashBytes)(&data[cur_ix_masked]);
+ size_t key_out;
score_t min_score = out->score;
score_t best_score = out->score;
size_t best_len = best_len_in;
@@ -145,21 +167,21 @@ static BROTLI_INLINE void FN(FindLongestMatch)(
if (prev_ix < cur_ix) {
prev_ix &= (uint32_t)ring_buffer_mask;
if (compare_char == data[prev_ix + best_len]) {
- size_t len = FindMatchLengthWithLimit(&data[prev_ix],
- &data[cur_ix_masked],
- max_length);
+ const size_t len = FindMatchLengthWithLimit(
+ &data[prev_ix], &data[cur_ix_masked], max_length);
if (len >= 4) {
const score_t score = BackwardReferenceScoreUsingLastDistance(len);
if (best_score < score) {
- best_score = score;
- best_len = len;
out->len = len;
out->distance = cached_backward;
- out->score = best_score;
- compare_char = data[cur_ix_masked + best_len];
+ out->score = score;
if (BUCKET_SWEEP == 1) {
- self->buckets_[key] = (uint32_t)cur_ix;
+ buckets[key] = (uint32_t)cur_ix;
return;
+ } else {
+ best_len = len;
+ best_score = score;
+ compare_char = data[cur_ix_masked + len];
}
}
}
@@ -169,8 +191,8 @@ static BROTLI_INLINE void FN(FindLongestMatch)(
size_t backward;
size_t len;
/* Only one to look for, don't bother to prepare for a loop. */
- prev_ix = self->buckets_[key];
- self->buckets_[key] = (uint32_t)cur_ix;
+ prev_ix = buckets[key];
+ buckets[key] = (uint32_t)cur_ix;
backward = cur_ix - prev_ix;
prev_ix &= (uint32_t)ring_buffer_mask;
if (compare_char != data[prev_ix + best_len_in]) {
@@ -192,12 +214,17 @@ static BROTLI_INLINE void FN(FindLongestMatch)(
}
}
} else {
- uint32_t* bucket = self->buckets_ + key;
- int i;
- prev_ix = *bucket++;
- for (i = 0; i < BUCKET_SWEEP; ++i, prev_ix = *bucket++) {
- const size_t backward = cur_ix - prev_ix;
+ size_t keys[BUCKET_SWEEP];
+ size_t i;
+ for (i = 0; i < BUCKET_SWEEP; ++i) {
+ keys[i] = (key + (i << 3)) & BUCKET_MASK;
+ }
+ key_out = keys[(cur_ix & BUCKET_SWEEP_MASK) >> 3];
+ for (i = 0; i < BUCKET_SWEEP; ++i) {
size_t len;
+ size_t backward;
+ prev_ix = buckets[keys[i]];
+ backward = cur_ix - prev_ix;
prev_ix &= (uint32_t)ring_buffer_mask;
if (compare_char != data[prev_ix + best_len]) {
continue;
@@ -211,25 +238,29 @@ static BROTLI_INLINE void FN(FindLongestMatch)(
if (len >= 4) {
const score_t score = BackwardReferenceScore(len, backward);
if (best_score < score) {
- best_score = score;
best_len = len;
- out->len = best_len;
- out->distance = backward;
+ out->len = len;
+ compare_char = data[cur_ix_masked + len];
+ best_score = score;
out->score = score;
- compare_char = data[cur_ix_masked + best_len];
+ out->distance = backward;
}
}
}
}
if (USE_DICTIONARY && min_score == out->score) {
SearchInStaticDictionary(dictionary,
- handle, &data[cur_ix_masked], max_length, max_backward + gap,
+ self->common, &data[cur_ix_masked], max_length, dictionary_distance,
max_distance, out, BROTLI_TRUE);
}
- self->buckets_[key + ((cur_ix >> 3) % BUCKET_SWEEP)] = (uint32_t)cur_ix;
+ if (BUCKET_SWEEP != 1) {
+ buckets[key_out] = (uint32_t)cur_ix;
+ }
}
-#undef HASH_MAP_SIZE
+#undef BUCKET_SWEEP_MASK
+#undef BUCKET_SWEEP
+#undef BUCKET_MASK
#undef BUCKET_SIZE
#undef HashLongestMatchQuickly
diff --git a/src/libraries/Native/AnyOS/brotli/enc/hash_rolling_inc.h b/src/libraries/Native/AnyOS/brotli/enc/hash_rolling_inc.h
index 17f8a408e246..586ae738591d 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/hash_rolling_inc.h
+++ b/src/libraries/Native/AnyOS/brotli/enc/hash_rolling_inc.h
@@ -51,13 +51,9 @@ typedef struct HashRolling {
uint32_t factor_remove;
} HashRolling;
-static BROTLI_INLINE HashRolling* FN(Self)(HasherHandle handle) {
- return (HashRolling*)&(GetHasherCommon(handle)[1]);
-}
-
static void FN(Initialize)(
- HasherHandle handle, const BrotliEncoderParams* params) {
- HashRolling* self = FN(Self)(handle);
+ HasherCommon* common, HashRolling* BROTLI_RESTRICT self,
+ const BrotliEncoderParams* params) {
size_t i;
self->state = 0;
self->next_ix = 0;
@@ -71,7 +67,7 @@ static void FN(Initialize)(
self->factor_remove *= self->factor;
}
- self->table = (uint32_t*)((HasherHandle)self + sizeof(HashRolling));
+ self->table = (uint32_t*)common->extra;
for (i = 0; i < NUMBUCKETS; i++) {
self->table[i] = FN(kInvalidPos);
}
@@ -79,9 +75,8 @@ static void FN(Initialize)(
BROTLI_UNUSED(params);
}
-static void FN(Prepare)(HasherHandle handle, BROTLI_BOOL one_shot,
- size_t input_size, const uint8_t* data) {
- HashRolling* self = FN(Self)(handle);
+static void FN(Prepare)(HashRolling* BROTLI_RESTRICT self, BROTLI_BOOL one_shot,
+ size_t input_size, const uint8_t* BROTLI_RESTRICT data) {
size_t i;
/* Too small size, cannot use this hasher. */
if (input_size < CHUNKLEN) return;
@@ -96,36 +91,36 @@ static void FN(Prepare)(HasherHandle handle, BROTLI_BOOL one_shot,
static BROTLI_INLINE size_t FN(HashMemAllocInBytes)(
const BrotliEncoderParams* params, BROTLI_BOOL one_shot,
size_t input_size) {
- return sizeof(HashRolling) + NUMBUCKETS * sizeof(uint32_t);
+ return NUMBUCKETS * sizeof(uint32_t);
BROTLI_UNUSED(params);
BROTLI_UNUSED(one_shot);
BROTLI_UNUSED(input_size);
}
-static BROTLI_INLINE void FN(Store)(HasherHandle BROTLI_RESTRICT handle,
+static BROTLI_INLINE void FN(Store)(HashRolling* BROTLI_RESTRICT self,
const uint8_t* BROTLI_RESTRICT data, const size_t mask, const size_t ix) {
- BROTLI_UNUSED(handle);
+ BROTLI_UNUSED(self);
BROTLI_UNUSED(data);
BROTLI_UNUSED(mask);
BROTLI_UNUSED(ix);
}
-static BROTLI_INLINE void FN(StoreRange)(HasherHandle handle,
- const uint8_t* data, const size_t mask, const size_t ix_start,
- const size_t ix_end) {
- BROTLI_UNUSED(handle);
+static BROTLI_INLINE void FN(StoreRange)(HashRolling* BROTLI_RESTRICT self,
+ const uint8_t* BROTLI_RESTRICT data, const size_t mask,
+ const size_t ix_start, const size_t ix_end) {
+ BROTLI_UNUSED(self);
BROTLI_UNUSED(data);
BROTLI_UNUSED(mask);
BROTLI_UNUSED(ix_start);
BROTLI_UNUSED(ix_end);
}
-static BROTLI_INLINE void FN(StitchToPreviousBlock)(HasherHandle handle,
+static BROTLI_INLINE void FN(StitchToPreviousBlock)(
+ HashRolling* BROTLI_RESTRICT self,
size_t num_bytes, size_t position, const uint8_t* ringbuffer,
size_t ring_buffer_mask) {
/* In this case we must re-initialize the hasher from scratch from the
current position. */
- HashRolling* self = FN(Self)(handle);
size_t position_masked;
size_t available = num_bytes;
if ((position & (JUMP - 1)) != 0) {
@@ -139,28 +134,29 @@ static BROTLI_INLINE void FN(StitchToPreviousBlock)(HasherHandle handle,
available = ring_buffer_mask - position_masked;
}
- FN(Prepare)(handle, BROTLI_FALSE, available,
+ FN(Prepare)(self, BROTLI_FALSE, available,
ringbuffer + (position & ring_buffer_mask));
self->next_ix = position;
BROTLI_UNUSED(num_bytes);
}
static BROTLI_INLINE void FN(PrepareDistanceCache)(
- HasherHandle handle, int* BROTLI_RESTRICT distance_cache) {
- BROTLI_UNUSED(handle);
+ HashRolling* BROTLI_RESTRICT self,
+ int* BROTLI_RESTRICT distance_cache) {
+ BROTLI_UNUSED(self);
BROTLI_UNUSED(distance_cache);
}
-static BROTLI_INLINE void FN(FindLongestMatch)(HasherHandle handle,
+static BROTLI_INLINE void FN(FindLongestMatch)(
+ HashRolling* BROTLI_RESTRICT self,
const BrotliEncoderDictionary* dictionary,
const uint8_t* BROTLI_RESTRICT data, const size_t ring_buffer_mask,
const int* BROTLI_RESTRICT distance_cache, const size_t cur_ix,
const size_t max_length, const size_t max_backward,
- const size_t gap, const size_t max_distance,
+ const size_t dictionary_distance, const size_t max_distance,
HasherSearchResult* BROTLI_RESTRICT out) {
- HashRolling* self = FN(Self)(handle);
const size_t cur_ix_masked = cur_ix & ring_buffer_mask;
- size_t pos = self->next_ix;
+ size_t pos;
if ((cur_ix & (JUMP - 1)) != 0) return;
@@ -209,7 +205,7 @@ static BROTLI_INLINE void FN(FindLongestMatch)(HasherHandle handle,
backup-hasher, the main hasher already searches in it. */
BROTLI_UNUSED(dictionary);
BROTLI_UNUSED(distance_cache);
- BROTLI_UNUSED(gap);
+ BROTLI_UNUSED(dictionary_distance);
BROTLI_UNUSED(max_distance);
}
diff --git a/src/libraries/Native/AnyOS/brotli/enc/hash_to_binary_tree_inc.h b/src/libraries/Native/AnyOS/brotli/enc/hash_to_binary_tree_inc.h
index 7fb0356f5560..9880e0aef684 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/hash_to_binary_tree_inc.h
+++ b/src/libraries/Native/AnyOS/brotli/enc/hash_to_binary_tree_inc.h
@@ -24,7 +24,7 @@ static BROTLI_INLINE size_t FN(StoreLookahead)(void) {
return MAX_TREE_COMP_LENGTH;
}
-static uint32_t FN(HashBytes)(const uint8_t* data) {
+static uint32_t FN(HashBytes)(const uint8_t* BROTLI_RESTRICT data) {
uint32_t h = BROTLI_UNALIGNED_LOAD32LE(data) * kHashMul32;
/* The higher bits contain more mixture from the multiplication,
so we take our results from there. */
@@ -38,7 +38,7 @@ typedef struct HashToBinaryTree {
/* Hash table that maps the 4-byte hashes of the sequence to the last
position where this hash was found, which is the root of the binary
tree of sequences that share this hash bucket. */
- uint32_t buckets_[BUCKET_SIZE];
+ uint32_t* buckets_; /* uint32_t[BUCKET_SIZE]; */
/* A position used to mark a non-existent sequence, i.e. a tree is empty if
its root is at invalid_pos_ and a node is a leaf if both its children
@@ -51,34 +51,30 @@ typedef struct HashToBinaryTree {
corresponding to a hash is a sequence starting at buckets_[hash] and
the left and right children of a sequence starting at pos are
forest_[2 * pos] and forest_[2 * pos + 1]. */
- /* uint32_t forest[2 * num_nodes] */
+ uint32_t* forest_; /* uint32_t[2 * num_nodes] */
} HashToBinaryTree;
-static BROTLI_INLINE HashToBinaryTree* FN(Self)(HasherHandle handle) {
- return (HashToBinaryTree*)&(GetHasherCommon(handle)[1]);
-}
-
-static BROTLI_INLINE uint32_t* FN(Forest)(HashToBinaryTree* self) {
- return (uint32_t*)(&self[1]);
-}
-
static void FN(Initialize)(
- HasherHandle handle, const BrotliEncoderParams* params) {
- HashToBinaryTree* self = FN(Self)(handle);
+ HasherCommon* common, HashToBinaryTree* BROTLI_RESTRICT self,
+ const BrotliEncoderParams* params) {
+ self->buckets_ = (uint32_t*)common->extra;
+ self->forest_ = &self->buckets_[BUCKET_SIZE];
+
self->window_mask_ = (1u << params->lgwin) - 1u;
self->invalid_pos_ = (uint32_t)(0 - self->window_mask_);
}
-static void FN(Prepare)(HasherHandle handle, BROTLI_BOOL one_shot,
- size_t input_size, const uint8_t* data) {
- HashToBinaryTree* self = FN(Self)(handle);
+static void FN(Prepare)
+ (HashToBinaryTree* BROTLI_RESTRICT self, BROTLI_BOOL one_shot,
+ size_t input_size, const uint8_t* BROTLI_RESTRICT data) {
uint32_t invalid_pos = self->invalid_pos_;
uint32_t i;
+ uint32_t* BROTLI_RESTRICT buckets = self->buckets_;
BROTLI_UNUSED(data);
BROTLI_UNUSED(one_shot);
BROTLI_UNUSED(input_size);
for (i = 0; i < BUCKET_SIZE; i++) {
- self->buckets_[i] = invalid_pos;
+ buckets[i] = invalid_pos;
}
}
@@ -89,15 +85,17 @@ static BROTLI_INLINE size_t FN(HashMemAllocInBytes)(
if (one_shot && input_size < num_nodes) {
num_nodes = input_size;
}
- return sizeof(HashToBinaryTree) + 2 * sizeof(uint32_t) * num_nodes;
+ return sizeof(uint32_t) * BUCKET_SIZE + 2 * sizeof(uint32_t) * num_nodes;
}
-static BROTLI_INLINE size_t FN(LeftChildIndex)(HashToBinaryTree* self,
+static BROTLI_INLINE size_t FN(LeftChildIndex)(
+ HashToBinaryTree* BROTLI_RESTRICT self,
const size_t pos) {
return 2 * (pos & self->window_mask_);
}
-static BROTLI_INLINE size_t FN(RightChildIndex)(HashToBinaryTree* self,
+static BROTLI_INLINE size_t FN(RightChildIndex)(
+ HashToBinaryTree* BROTLI_RESTRICT self,
const size_t pos) {
return 2 * (pos & self->window_mask_) + 1;
}
@@ -113,7 +111,7 @@ static BROTLI_INLINE size_t FN(RightChildIndex)(HashToBinaryTree* self,
This function must be called with increasing cur_ix positions. */
static BROTLI_INLINE BackwardMatch* FN(StoreAndFindMatches)(
- HashToBinaryTree* self, const uint8_t* const BROTLI_RESTRICT data,
+ HashToBinaryTree* BROTLI_RESTRICT self, const uint8_t* BROTLI_RESTRICT data,
const size_t cur_ix, const size_t ring_buffer_mask, const size_t max_length,
const size_t max_backward, size_t* const BROTLI_RESTRICT best_len,
BackwardMatch* BROTLI_RESTRICT matches) {
@@ -123,8 +121,9 @@ static BROTLI_INLINE BackwardMatch* FN(StoreAndFindMatches)(
const BROTLI_BOOL should_reroot_tree =
TO_BROTLI_BOOL(max_length >= MAX_TREE_COMP_LENGTH);
const uint32_t key = FN(HashBytes)(&data[cur_ix_masked]);
- uint32_t* forest = FN(Forest)(self);
- size_t prev_ix = self->buckets_[key];
+ uint32_t* BROTLI_RESTRICT buckets = self->buckets_;
+ uint32_t* BROTLI_RESTRICT forest = self->forest_;
+ size_t prev_ix = buckets[key];
/* The forest index of the rightmost node of the left subtree of the new
root, updated as we traverse and re-root the tree of the hash bucket. */
size_t node_left = FN(LeftChildIndex)(self, cur_ix);
@@ -139,7 +138,7 @@ static BROTLI_INLINE BackwardMatch* FN(StoreAndFindMatches)(
size_t best_len_right = 0;
size_t depth_remaining;
if (should_reroot_tree) {
- self->buckets_[key] = (uint32_t)cur_ix;
+ buckets[key] = (uint32_t)cur_ix;
}
for (depth_remaining = MAX_TREE_SEARCH_DEPTH; ; --depth_remaining) {
const size_t backward = cur_ix - prev_ix;
@@ -199,11 +198,13 @@ static BROTLI_INLINE BackwardMatch* FN(StoreAndFindMatches)(
matches in matches[0] to matches[*num_matches - 1]. The matches will be
sorted by strictly increasing length and (non-strictly) increasing
distance. */
-static BROTLI_INLINE size_t FN(FindAllMatches)(HasherHandle handle,
- const BrotliEncoderDictionary* dictionary, const uint8_t* data,
+static BROTLI_INLINE size_t FN(FindAllMatches)(
+ HashToBinaryTree* BROTLI_RESTRICT self,
+ const BrotliEncoderDictionary* dictionary,
+ const uint8_t* BROTLI_RESTRICT data,
const size_t ring_buffer_mask, const size_t cur_ix,
const size_t max_length, const size_t max_backward,
- const size_t gap, const BrotliEncoderParams* params,
+ const size_t dictionary_distance, const BrotliEncoderParams* params,
BackwardMatch* matches) {
BackwardMatch* const orig_matches = matches;
const size_t cur_ix_masked = cur_ix & ring_buffer_mask;
@@ -236,7 +237,7 @@ static BROTLI_INLINE size_t FN(FindAllMatches)(HasherHandle handle,
}
}
if (best_len < max_length) {
- matches = FN(StoreAndFindMatches)(FN(Self)(handle), data, cur_ix,
+ matches = FN(StoreAndFindMatches)(self, data, cur_ix,
ring_buffer_mask, max_length, max_backward, &best_len, matches);
}
for (i = 0; i <= BROTLI_MAX_STATIC_DICTIONARY_MATCH_LEN; ++i) {
@@ -252,7 +253,7 @@ static BROTLI_INLINE size_t FN(FindAllMatches)(HasherHandle handle,
for (l = minlen; l <= maxlen; ++l) {
uint32_t dict_id = dict_matches[l];
if (dict_id < kInvalidMatch) {
- size_t distance = max_backward + gap + (dict_id >> 5) + 1;
+ size_t distance = dictionary_distance + (dict_id >> 5) + 1;
if (distance <= params->dist.max_distance) {
InitDictionaryBackwardMatch(matches++, distance, l, dict_id & 31);
}
@@ -266,18 +267,18 @@ static BROTLI_INLINE size_t FN(FindAllMatches)(HasherHandle handle,
/* Stores the hash of the next 4 bytes and re-roots the binary tree at the
current sequence, without returning any matches.
REQUIRES: ix + MAX_TREE_COMP_LENGTH <= end-of-current-block */
-static BROTLI_INLINE void FN(Store)(HasherHandle handle, const uint8_t* data,
+static BROTLI_INLINE void FN(Store)(HashToBinaryTree* BROTLI_RESTRICT self,
+ const uint8_t* BROTLI_RESTRICT data,
const size_t mask, const size_t ix) {
- HashToBinaryTree* self = FN(Self)(handle);
/* Maximum distance is window size - 16, see section 9.1. of the spec. */
const size_t max_backward = self->window_mask_ - BROTLI_WINDOW_GAP + 1;
FN(StoreAndFindMatches)(self, data, ix, mask, MAX_TREE_COMP_LENGTH,
max_backward, NULL, NULL);
}
-static BROTLI_INLINE void FN(StoreRange)(HasherHandle handle,
- const uint8_t* data, const size_t mask, const size_t ix_start,
- const size_t ix_end) {
+static BROTLI_INLINE void FN(StoreRange)(HashToBinaryTree* BROTLI_RESTRICT self,
+ const uint8_t* BROTLI_RESTRICT data, const size_t mask,
+ const size_t ix_start, const size_t ix_end) {
size_t i = ix_start;
size_t j = ix_start;
if (ix_start + 63 <= ix_end) {
@@ -285,18 +286,18 @@ static BROTLI_INLINE void FN(StoreRange)(HasherHandle handle,
}
if (ix_start + 512 <= i) {
for (; j < i; j += 8) {
- FN(Store)(handle, data, mask, j);
+ FN(Store)(self, data, mask, j);
}
}
for (; i < ix_end; ++i) {
- FN(Store)(handle, data, mask, i);
+ FN(Store)(self, data, mask, i);
}
}
-static BROTLI_INLINE void FN(StitchToPreviousBlock)(HasherHandle handle,
+static BROTLI_INLINE void FN(StitchToPreviousBlock)(
+ HashToBinaryTree* BROTLI_RESTRICT self,
size_t num_bytes, size_t position, const uint8_t* ringbuffer,
size_t ringbuffer_mask) {
- HashToBinaryTree* self = FN(Self)(handle);
if (num_bytes >= FN(HashTypeLength)() - 1 &&
position >= MAX_TREE_COMP_LENGTH) {
/* Store the last `MAX_TREE_COMP_LENGTH - 1` positions in the hasher.
diff --git a/src/libraries/Native/AnyOS/brotli/enc/memory.h b/src/libraries/Native/AnyOS/brotli/enc/memory.h
index ab928d019be8..832e7b2b6e37 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/memory.h
+++ b/src/libraries/Native/AnyOS/brotli/enc/memory.h
@@ -56,6 +56,18 @@ BROTLI_INTERNAL void BrotliFree(MemoryManager* m, void* p);
#define BROTLI_IS_OOM(M) (!!(M)->is_oom)
#endif /* BROTLI_ENCODER_EXIT_ON_OOM */
+/*
+BROTLI_IS_NULL is a fake check, BROTLI_IS_OOM does the heavy lifting.
+The only purpose of it is to explain static analyzers the state of things.
+NB: use ONLY together with BROTLI_IS_OOM
+ AND ONLY for allocations in the current scope.
+ */
+#if defined(__clang_analyzer__) && !defined(BROTLI_ENCODER_EXIT_ON_OOM)
+#define BROTLI_IS_NULL(A) ((A) == nullptr)
+#else /* defined(__clang_analyzer__) */
+#define BROTLI_IS_NULL(A) (!!0)
+#endif /* defined(__clang_analyzer__) */
+
BROTLI_INTERNAL void BrotliWipeOutMemoryManager(MemoryManager* m);
/*
@@ -66,18 +78,18 @@ A: array
C: capacity
R: requested size
*/
-#define BROTLI_ENSURE_CAPACITY(M, T, A, C, R) { \
- if (C < (R)) { \
- size_t _new_size = (C == 0) ? (R) : C; \
- T* new_array; \
- while (_new_size < (R)) _new_size *= 2; \
- new_array = BROTLI_ALLOC((M), T, _new_size); \
- if (!BROTLI_IS_OOM(M) && C != 0) \
- memcpy(new_array, A, C * sizeof(T)); \
- BROTLI_FREE((M), A); \
- A = new_array; \
- C = _new_size; \
- } \
+#define BROTLI_ENSURE_CAPACITY(M, T, A, C, R) { \
+ if (C < (R)) { \
+ size_t _new_size = (C == 0) ? (R) : C; \
+ T* new_array; \
+ while (_new_size < (R)) _new_size *= 2; \
+ new_array = BROTLI_ALLOC((M), T, _new_size); \
+ if (!BROTLI_IS_OOM(M) && !BROTLI_IS_NULL(new_array) && C != 0) \
+ memcpy(new_array, A, C * sizeof(T)); \
+ BROTLI_FREE((M), A); \
+ A = new_array; \
+ C = _new_size; \
+ } \
}
/*
diff --git a/src/libraries/Native/AnyOS/brotli/enc/metablock.c b/src/libraries/Native/AnyOS/brotli/enc/metablock.c
index 4e80044f3186..5aa4d4f17c84 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/metablock.c
+++ b/src/libraries/Native/AnyOS/brotli/enc/metablock.c
@@ -28,34 +28,30 @@ extern "C" {
void BrotliInitDistanceParams(BrotliEncoderParams* params,
uint32_t npostfix, uint32_t ndirect) {
BrotliDistanceParams* dist_params = ¶ms->dist;
- uint32_t alphabet_size, max_distance;
+ uint32_t alphabet_size_max;
+ uint32_t alphabet_size_limit;
+ uint32_t max_distance;
dist_params->distance_postfix_bits = npostfix;
dist_params->num_direct_distance_codes = ndirect;
- alphabet_size = BROTLI_DISTANCE_ALPHABET_SIZE(
+ alphabet_size_max = BROTLI_DISTANCE_ALPHABET_SIZE(
npostfix, ndirect, BROTLI_MAX_DISTANCE_BITS);
+ alphabet_size_limit = alphabet_size_max;
max_distance = ndirect + (1U << (BROTLI_MAX_DISTANCE_BITS + npostfix + 2)) -
(1U << (npostfix + 2));
if (params->large_window) {
- static const uint32_t bound[BROTLI_MAX_NPOSTFIX + 1] = {0, 4, 12, 28};
- uint32_t postfix = 1U << npostfix;
- alphabet_size = BROTLI_DISTANCE_ALPHABET_SIZE(
+ BrotliDistanceCodeLimit limit = BrotliCalculateDistanceCodeLimit(
+ BROTLI_MAX_ALLOWED_DISTANCE, npostfix, ndirect);
+ alphabet_size_max = BROTLI_DISTANCE_ALPHABET_SIZE(
npostfix, ndirect, BROTLI_LARGE_MAX_DISTANCE_BITS);
- /* The maximum distance is set so that no distance symbol used can encode
- a distance larger than BROTLI_MAX_ALLOWED_DISTANCE with all
- its extra bits set. */
- if (ndirect < bound[npostfix]) {
- max_distance = BROTLI_MAX_ALLOWED_DISTANCE - (bound[npostfix] - ndirect);
- } else if (ndirect >= bound[npostfix] + postfix) {
- max_distance = (3U << 29) - 4 + (ndirect - bound[npostfix]);
- } else {
- max_distance = BROTLI_MAX_ALLOWED_DISTANCE;
- }
+ alphabet_size_limit = limit.max_alphabet_size;
+ max_distance = limit.max_distance;
}
- dist_params->alphabet_size = alphabet_size;
+ dist_params->alphabet_size_max = alphabet_size_max;
+ dist_params->alphabet_size_limit = alphabet_size_limit;
dist_params->max_distance = max_distance;
}
@@ -200,7 +196,7 @@ void BrotliBuildMetaBlock(MemoryManager* m,
literal_context_multiplier = 1 << BROTLI_LITERAL_CONTEXT_BITS;
literal_context_modes =
BROTLI_ALLOC(m, ContextType, mb->literal_split.num_types);
- if (BROTLI_IS_OOM(m)) return;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(literal_context_modes)) return;
for (i = 0; i < mb->literal_split.num_types; ++i) {
literal_context_modes[i] = literal_context_mode;
}
@@ -210,21 +206,21 @@ void BrotliBuildMetaBlock(MemoryManager* m,
mb->literal_split.num_types * literal_context_multiplier;
literal_histograms =
BROTLI_ALLOC(m, HistogramLiteral, literal_histograms_size);
- if (BROTLI_IS_OOM(m)) return;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(literal_histograms)) return;
ClearHistogramsLiteral(literal_histograms, literal_histograms_size);
distance_histograms_size =
mb->distance_split.num_types << BROTLI_DISTANCE_CONTEXT_BITS;
distance_histograms =
BROTLI_ALLOC(m, HistogramDistance, distance_histograms_size);
- if (BROTLI_IS_OOM(m)) return;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(distance_histograms)) return;
ClearHistogramsDistance(distance_histograms, distance_histograms_size);
BROTLI_DCHECK(mb->command_histograms == 0);
mb->command_histograms_size = mb->command_split.num_types;
mb->command_histograms =
BROTLI_ALLOC(m, HistogramCommand, mb->command_histograms_size);
- if (BROTLI_IS_OOM(m)) return;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(mb->command_histograms)) return;
ClearHistogramsCommand(mb->command_histograms, mb->command_histograms_size);
BrotliBuildHistogramsWithContext(cmds, num_commands,
@@ -238,13 +234,13 @@ void BrotliBuildMetaBlock(MemoryManager* m,
mb->literal_split.num_types << BROTLI_LITERAL_CONTEXT_BITS;
mb->literal_context_map =
BROTLI_ALLOC(m, uint32_t, mb->literal_context_map_size);
- if (BROTLI_IS_OOM(m)) return;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(mb->literal_context_map)) return;
BROTLI_DCHECK(mb->literal_histograms == 0);
mb->literal_histograms_size = mb->literal_context_map_size;
mb->literal_histograms =
BROTLI_ALLOC(m, HistogramLiteral, mb->literal_histograms_size);
- if (BROTLI_IS_OOM(m)) return;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(mb->literal_histograms)) return;
BrotliClusterHistogramsLiteral(m, literal_histograms, literal_histograms_size,
kMaxNumberOfHistograms, mb->literal_histograms,
@@ -269,13 +265,13 @@ void BrotliBuildMetaBlock(MemoryManager* m,
mb->distance_split.num_types << BROTLI_DISTANCE_CONTEXT_BITS;
mb->distance_context_map =
BROTLI_ALLOC(m, uint32_t, mb->distance_context_map_size);
- if (BROTLI_IS_OOM(m)) return;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(mb->distance_context_map)) return;
BROTLI_DCHECK(mb->distance_histograms == 0);
mb->distance_histograms_size = mb->distance_context_map_size;
mb->distance_histograms =
BROTLI_ALLOC(m, HistogramDistance, mb->distance_histograms_size);
- if (BROTLI_IS_OOM(m)) return;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(mb->distance_histograms)) return;
BrotliClusterHistogramsDistance(m, distance_histograms,
mb->distance_context_map_size,
@@ -373,7 +369,7 @@ static void InitContextBlockSplitter(
*histograms_size = max_num_types * num_contexts;
*histograms = BROTLI_ALLOC(m, HistogramLiteral, *histograms_size);
self->histograms_ = *histograms;
- if (BROTLI_IS_OOM(m)) return;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(*histograms)) return;
/* Clear only current histogram. */
ClearHistogramsLiteral(&self->histograms_[0], num_contexts);
self->last_histogram_ix_[0] = self->last_histogram_ix_[1] = 0;
@@ -423,7 +419,7 @@ static void ContextBlockSplitterFinishBlock(
double combined_entropy[2 * BROTLI_MAX_STATIC_CONTEXTS];
double diff[2] = { 0.0 };
size_t i;
- if (BROTLI_IS_OOM(m)) return;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(combined_histo)) return;
for (i = 0; i < num_contexts; ++i) {
size_t curr_histo_ix = self->curr_histogram_ix_ + i;
size_t j;
@@ -527,7 +523,7 @@ static void MapStaticContexts(MemoryManager* m,
mb->literal_split.num_types << BROTLI_LITERAL_CONTEXT_BITS;
mb->literal_context_map =
BROTLI_ALLOC(m, uint32_t, mb->literal_context_map_size);
- if (BROTLI_IS_OOM(m)) return;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(mb->literal_context_map)) return;
for (i = 0; i < mb->literal_split.num_types; ++i) {
uint32_t offset = (uint32_t)(i * num_contexts);
diff --git a/src/libraries/Native/AnyOS/brotli/enc/metablock_inc.h b/src/libraries/Native/AnyOS/brotli/enc/metablock_inc.h
index dcc9d3c4a642..ed507ef5ef46 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/metablock_inc.h
+++ b/src/libraries/Native/AnyOS/brotli/enc/metablock_inc.h
@@ -71,7 +71,7 @@ static void FN(InitBlockSplitter)(
*histograms_size = max_num_types;
*histograms = BROTLI_ALLOC(m, HistogramType, *histograms_size);
self->histograms_ = *histograms;
- if (BROTLI_IS_OOM(m)) return;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(*histograms)) return;
/* Clear only current histogram. */
FN(HistogramClear)(&self->histograms_[0]);
self->last_histogram_ix_[0] = self->last_histogram_ix_[1] = 0;
diff --git a/src/libraries/Native/AnyOS/brotli/enc/params.h b/src/libraries/Native/AnyOS/brotli/enc/params.h
index 6ecf1d3f995d..54a7f007363f 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/params.h
+++ b/src/libraries/Native/AnyOS/brotli/enc/params.h
@@ -23,7 +23,8 @@ typedef struct BrotliHasherParams {
typedef struct BrotliDistanceParams {
uint32_t distance_postfix_bits;
uint32_t num_direct_distance_codes;
- uint32_t alphabet_size;
+ uint32_t alphabet_size_max;
+ uint32_t alphabet_size_limit;
size_t max_distance;
} BrotliDistanceParams;
@@ -33,6 +34,7 @@ typedef struct BrotliEncoderParams {
int quality;
int lgwin;
int lgblock;
+ size_t stream_offset;
size_t size_hint;
BROTLI_BOOL disable_literal_context_modeling;
BROTLI_BOOL large_window;
diff --git a/src/libraries/Native/AnyOS/brotli/enc/ringbuffer.h b/src/libraries/Native/AnyOS/brotli/enc/ringbuffer.h
index 86079a89d35b..8dce1480399c 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/ringbuffer.h
+++ b/src/libraries/Native/AnyOS/brotli/enc/ringbuffer.h
@@ -75,7 +75,7 @@ static BROTLI_INLINE void RingBufferInitBuffer(
uint8_t* new_data = BROTLI_ALLOC(
m, uint8_t, 2 + buflen + kSlackForEightByteHashingEverywhere);
size_t i;
- if (BROTLI_IS_OOM(m)) return;
+ if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(new_data)) return;
if (rb->data_) {
memcpy(new_data, rb->data_,
2 + rb->cur_size_ + kSlackForEightByteHashingEverywhere);
@@ -125,6 +125,9 @@ static BROTLI_INLINE void RingBufferWrite(
later when we copy the last two bytes to the first two positions. */
rb->buffer_[rb->size_ - 2] = 0;
rb->buffer_[rb->size_ - 1] = 0;
+ /* Initialize tail; might be touched by "best_len++" optimization when
+ ring buffer is "full". */
+ rb->buffer_[rb->size_] = 241;
}
{
const size_t masked_pos = rb->pos_ & rb->mask_;
diff --git a/src/libraries/Native/AnyOS/brotli/enc/utf8_util.c b/src/libraries/Native/AnyOS/brotli/enc/utf8_util.c
index 04a7805161b8..e802b6a75173 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/utf8_util.c
+++ b/src/libraries/Native/AnyOS/brotli/enc/utf8_util.c
@@ -77,7 +77,7 @@ BROTLI_BOOL BrotliIsMostlyUTF8(
i += bytes_read;
if (symbol < 0x110000) size_utf8 += bytes_read;
}
- return TO_BROTLI_BOOL(size_utf8 > min_fraction * (double)length);
+ return TO_BROTLI_BOOL((double)size_utf8 > min_fraction * (double)length);
}
#if defined(__cplusplus) || defined(c_plusplus)
diff --git a/src/libraries/Native/AnyOS/brotli/enc/write_bits.h b/src/libraries/Native/AnyOS/brotli/enc/write_bits.h
index 36515a6893f8..f6f88b45be06 100644
--- a/src/libraries/Native/AnyOS/brotli/enc/write_bits.h
+++ b/src/libraries/Native/AnyOS/brotli/enc/write_bits.h
@@ -16,8 +16,6 @@
extern "C" {
#endif
-/*#define BIT_WRITER_DEBUG */
-
/* This function writes bits into bytes in increasing addresses, and within
a byte least-significant-bit first.
@@ -28,7 +26,7 @@ extern "C" {
0000 0RRR 0000 0000 0000 0000
- Now, we could write 5 or less bits in MSB by just sifting by 3
+ Now, we could write 5 or less bits in MSB by just shifting by 3
and OR'ing to BYTE-0.
For n bits, we take the last 5 bits, OR that with high bits in BYTE-0,
@@ -37,37 +35,41 @@ static BROTLI_INLINE void BrotliWriteBits(size_t n_bits,
uint64_t bits,
size_t* BROTLI_RESTRICT pos,
uint8_t* BROTLI_RESTRICT array) {
+ BROTLI_LOG(("WriteBits %2d 0x%08x%08x %10d\n", (int)n_bits,
+ (uint32_t)(bits >> 32), (uint32_t)(bits & 0xFFFFFFFF),
+ (int)*pos));
+ BROTLI_DCHECK((bits >> n_bits) == 0);
+ BROTLI_DCHECK(n_bits <= 56);
#if defined(BROTLI_LITTLE_ENDIAN)
/* This branch of the code can write up to 56 bits at a time,
7 bits are lost by being perhaps already in *p and at least
1 bit is needed to initialize the bit-stream ahead (i.e. if 7
bits are in *p and we write 57 bits, then the next write will
access a byte that was never initialized). */
- uint8_t* p = &array[*pos >> 3];
- uint64_t v = (uint64_t)(*p); /* Zero-extend 8 to 64 bits. */
- BROTLI_LOG(("WriteBits %2d 0x%08x%08x %10d\n", (int)n_bits,
- (uint32_t)(bits >> 32), (uint32_t)(bits & 0xFFFFFFFF),
- (int)*pos));
- BROTLI_DCHECK((bits >> n_bits) == 0);
- BROTLI_DCHECK(n_bits <= 56);
- v |= bits << (*pos & 7);
- BROTLI_UNALIGNED_STORE64LE(p, v); /* Set some bits. */
- *pos += n_bits;
+ {
+ uint8_t* p = &array[*pos >> 3];
+ uint64_t v = (uint64_t)(*p); /* Zero-extend 8 to 64 bits. */
+ v |= bits << (*pos & 7);
+ BROTLI_UNALIGNED_STORE64LE(p, v); /* Set some bits. */
+ *pos += n_bits;
+ }
#else
/* implicit & 0xFF is assumed for uint8_t arithmetics */
- uint8_t* array_pos = &array[*pos >> 3];
- const size_t bits_reserved_in_first_byte = (*pos & 7);
- size_t bits_left_to_write;
- bits <<= bits_reserved_in_first_byte;
- *array_pos++ |= (uint8_t)bits;
- for (bits_left_to_write = n_bits + bits_reserved_in_first_byte;
- bits_left_to_write >= 9;
- bits_left_to_write -= 8) {
- bits >>= 8;
- *array_pos++ = (uint8_t)bits;
+ {
+ uint8_t* array_pos = &array[*pos >> 3];
+ const size_t bits_reserved_in_first_byte = (*pos & 7);
+ size_t bits_left_to_write;
+ bits <<= bits_reserved_in_first_byte;
+ *array_pos++ |= (uint8_t)bits;
+ for (bits_left_to_write = n_bits + bits_reserved_in_first_byte;
+ bits_left_to_write >= 9;
+ bits_left_to_write -= 8) {
+ bits >>= 8;
+ *array_pos++ = (uint8_t)bits;
+ }
+ *array_pos = 0;
+ *pos += n_bits;
}
- *array_pos = 0;
- *pos += n_bits;
#endif
}
diff --git a/src/libraries/Native/AnyOS/brotli/include/brotli/encode.h b/src/libraries/Native/AnyOS/brotli/include/brotli/encode.h
index 0ced7e55be77..b2774cb63162 100644
--- a/src/libraries/Native/AnyOS/brotli/include/brotli/encode.h
+++ b/src/libraries/Native/AnyOS/brotli/include/brotli/encode.h
@@ -201,7 +201,23 @@ typedef enum BrotliEncoderParameter {
*
* Range is from 0 to (15 << NPOSTFIX) in steps of (1 << NPOSTFIX).
*/
- BROTLI_PARAM_NDIRECT = 8
+ BROTLI_PARAM_NDIRECT = 8,
+ /**
+ * Number of bytes of input stream already processed by a different instance.
+ *
+ * @note It is important to configure all the encoder instances with same
+ * parameters (except this one) in order to allow all the encoded parts
+ * obey the same restrictions implied by header.
+ *
+ * If offset is not 0, then stream header is omitted.
+ * In any case output start is byte aligned, so for proper streams stitching
+ * "predecessor" stream must be flushed.
+ *
+ * Range is not artificially limited, but all the values greater or equal to
+ * maximal window size have the same effect. Values greater than 2**30 are not
+ * allowed.
+ */
+ BROTLI_PARAM_STREAM_OFFSET = 9
} BrotliEncoderParameter;
/**
@@ -274,6 +290,11 @@ BROTLI_ENC_API size_t BrotliEncoderMaxCompressedSize(size_t input_size);
* @note If ::BrotliEncoderMaxCompressedSize(@p input_size) returns non-zero
* value, then output is guaranteed to be no longer than that.
*
+ * @note If @p lgwin is greater than ::BROTLI_MAX_WINDOW_BITS then resulting
+ * stream might be incompatible with RFC 7932; to decode such streams,
+ * decoder should be configured with
+ * ::BROTLI_DECODER_PARAM_LARGE_WINDOW = @c 1
+ *
* @param quality quality parameter value, e.g. ::BROTLI_DEFAULT_QUALITY
* @param lgwin lgwin parameter value, e.g. ::BROTLI_DEFAULT_WINDOW
* @param mode mode parameter value, e.g. ::BROTLI_DEFAULT_MODE
diff --git a/src/libraries/Native/AnyOS/brotli/include/brotli/port.h b/src/libraries/Native/AnyOS/brotli/include/brotli/port.h
index 20dc2314d802..825237a33579 100644
--- a/src/libraries/Native/AnyOS/brotli/include/brotli/port.h
+++ b/src/libraries/Native/AnyOS/brotli/include/brotli/port.h
@@ -218,6 +218,20 @@
BROTLI_GNUC_VERSION_CHECK(major, minor, patch)
#endif
+#if defined(__has_feature)
+#define BROTLI_HAS_FEATURE(feature) __has_feature(feature)
+#else
+#define BROTLI_HAS_FEATURE(feature) (0)
+#endif
+
+#if defined(ADDRESS_SANITIZER) || BROTLI_HAS_FEATURE(address_sanitizer) || \
+ defined(THREAD_SANITIZER) || BROTLI_HAS_FEATURE(thread_sanitizer) || \
+ defined(MEMORY_SANITIZER) || BROTLI_HAS_FEATURE(memory_sanitizer)
+#define BROTLI_SANITIZED 1
+#else
+#define BROTLI_SANITIZED 0
+#endif
+
#if defined(_WIN32) || defined(__CYGWIN__)
#define BROTLI_PUBLIC
#elif BROTLI_GNUC_VERSION_CHECK(3, 3, 0) || \
diff --git a/src/libraries/Native/AnyOS/brotli/tools/brotli.c b/src/libraries/Native/AnyOS/brotli/tools/brotli.c
index ce05b641b2bf..7c678d3d8fa5 100644
--- a/src/libraries/Native/AnyOS/brotli/tools/brotli.c
+++ b/src/libraries/Native/AnyOS/brotli/tools/brotli.c
@@ -6,6 +6,11 @@
/* Command line interface for Brotli library. */
+/* Mute strerror/strcpy warnings. */
+#if !defined(_CRT_SECURE_NO_WARNINGS)
+#define _CRT_SECURE_NO_WARNINGS
+#endif
+
#include
#include
#include
@@ -86,10 +91,10 @@ typedef struct {
/* Parameters */
int quality;
int lgwin;
+ int verbosity;
BROTLI_BOOL force_overwrite;
BROTLI_BOOL junk_source;
BROTLI_BOOL copy_stat;
- BROTLI_BOOL verbose;
BROTLI_BOOL write_to_stdout;
BROTLI_BOOL test_integrity;
BROTLI_BOOL decompress;
@@ -121,6 +126,12 @@ typedef struct {
const uint8_t* next_in;
size_t available_out;
uint8_t* next_out;
+
+ /* Reporting */
+ /* size_t would be large enough,
+ until 4GiB+ files are compressed / decompressed on 32-bit CPUs. */
+ size_t total_in;
+ size_t total_out;
} Context;
/* Parse up to 5 decimal digits. */
@@ -257,7 +268,7 @@ static Command ParseParams(Context* params) {
return COMMAND_HELP;
} else if (c == 'j' || c == 'k') {
if (keep_set) {
- fprintf(stderr, "argument --rm / -j or --keep / -n already set\n");
+ fprintf(stderr, "argument --rm / -j or --keep / -k already set\n");
return COMMAND_INVALID;
}
keep_set = BROTLI_TRUE;
@@ -279,11 +290,11 @@ static Command ParseParams(Context* params) {
command = COMMAND_TEST_INTEGRITY;
continue;
} else if (c == 'v') {
- if (params->verbose) {
+ if (params->verbosity > 0) {
fprintf(stderr, "argument --verbose / -v already set\n");
return COMMAND_INVALID;
}
- params->verbose = BROTLI_TRUE;
+ params->verbosity = 1;
continue;
} else if (c == 'V') {
/* Don't parse further. */
@@ -382,7 +393,7 @@ static Command ParseParams(Context* params) {
return COMMAND_HELP;
} else if (strcmp("keep", arg) == 0) {
if (keep_set) {
- fprintf(stderr, "argument --rm / -j or --keep / -n already set\n");
+ fprintf(stderr, "argument --rm / -j or --keep / -k already set\n");
return COMMAND_INVALID;
}
keep_set = BROTLI_TRUE;
@@ -395,7 +406,7 @@ static Command ParseParams(Context* params) {
params->copy_stat = BROTLI_FALSE;
} else if (strcmp("rm", arg) == 0) {
if (keep_set) {
- fprintf(stderr, "argument --rm / -j or --keep / -n already set\n");
+ fprintf(stderr, "argument --rm / -j or --keep / -k already set\n");
return COMMAND_INVALID;
}
keep_set = BROTLI_TRUE;
@@ -415,11 +426,11 @@ static Command ParseParams(Context* params) {
command_set = BROTLI_TRUE;
command = COMMAND_TEST_INTEGRITY;
} else if (strcmp("verbose", arg) == 0) {
- if (params->verbose) {
+ if (params->verbosity > 0) {
fprintf(stderr, "argument --verbose / -v already set\n");
return COMMAND_INVALID;
}
- params->verbose = BROTLI_TRUE;
+ params->verbosity = 1;
} else if (strcmp("version", arg) == 0) {
/* Don't parse further. */
return COMMAND_VERSION;
@@ -550,11 +561,17 @@ static void PrintHelp(const char* name, BROTLI_BOOL error) {
" -t, --test test compressed file integrity\n"
" -v, --verbose verbose mode\n");
fprintf(media,
-" -w NUM, --lgwin=NUM set LZ77 window size (0, %d-%d)\n",
+" -w NUM, --lgwin=NUM set LZ77 window size (0, %d-%d)\n"
+" window size = 2**NUM - 16\n"
+" 0 lets compressor choose the optimal value\n",
BROTLI_MIN_WINDOW_BITS, BROTLI_MAX_WINDOW_BITS);
fprintf(media,
-" window size = 2**NUM - 16\n"
-" 0 lets compressor choose the optimal value\n");
+" --large_window=NUM use incompatible large-window brotli\n"
+" bitstream with window size (0, %d-%d)\n"
+" WARNING: this format is not compatible\n"
+" with brotli RFC 7932 and may not be\n"
+" decodable with regular brotli decoders\n",
+ BROTLI_MIN_WINDOW_BITS, BROTLI_LARGE_MAX_WINDOW_BITS);
fprintf(media,
" -S SUF, --suffix=SUF output file suffix (default:'%s')\n",
DEFAULT_SUFFIX);
@@ -787,8 +804,12 @@ static void InitializeBuffers(Context* context) {
context->next_in = NULL;
context->available_out = kFileBufferSize;
context->next_out = context->output;
+ context->total_in = 0;
+ context->total_out = 0;
}
+/* This method might give the false-negative result.
+ However, after an empty / incomplete read it should tell the truth. */
static BROTLI_BOOL HasMoreInput(Context* context) {
return feof(context->fin) ? BROTLI_FALSE : BROTLI_TRUE;
}
@@ -796,6 +817,7 @@ static BROTLI_BOOL HasMoreInput(Context* context) {
static BROTLI_BOOL ProvideInput(Context* context) {
context->available_in =
fread(context->input, 1, kFileBufferSize, context->fin);
+ context->total_in += context->available_in;
context->next_in = context->input;
if (ferror(context->fin)) {
fprintf(stderr, "failed to read input [%s]: %s\n",
@@ -808,6 +830,7 @@ static BROTLI_BOOL ProvideInput(Context* context) {
/* Internal: should be used only in Provide-/Flush-Output. */
static BROTLI_BOOL WriteOutput(Context* context) {
size_t out_size = (size_t)(context->next_out - context->output);
+ context->total_out += out_size;
if (out_size == 0) return BROTLI_TRUE;
if (context->test_integrity) return BROTLI_TRUE;
@@ -833,6 +856,25 @@ static BROTLI_BOOL FlushOutput(Context* context) {
return BROTLI_TRUE;
}
+static void PrintBytes(size_t value) {
+ if (value < 1024) {
+ fprintf(stderr, "%d B", (int)value);
+ } else if (value < 1048576) {
+ fprintf(stderr, "%0.3f KiB", (double)value / 1024.0);
+ } else if (value < 1073741824) {
+ fprintf(stderr, "%0.3f MiB", (double)value / 1048576.0);
+ } else {
+ fprintf(stderr, "%0.3f GiB", (double)value / 1073741824.0);
+ }
+}
+
+static void PrintFileProcessingProgress(Context* context) {
+ fprintf(stderr, "[%s]: ", PrintablePath(context->current_input_path));
+ PrintBytes(context->total_in);
+ fprintf(stderr, " -> ");
+ PrintBytes(context->total_out);
+}
+
static BROTLI_BOOL DecompressFile(Context* context, BrotliDecoderState* s) {
BrotliDecoderResult result = BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT;
InitializeBuffers(context);
@@ -848,11 +890,18 @@ static BROTLI_BOOL DecompressFile(Context* context, BrotliDecoderState* s) {
if (!ProvideOutput(context)) return BROTLI_FALSE;
} else if (result == BROTLI_DECODER_RESULT_SUCCESS) {
if (!FlushOutput(context)) return BROTLI_FALSE;
- if (context->available_in != 0 || HasMoreInput(context)) {
+ int has_more_input =
+ (context->available_in != 0) || (fgetc(context->fin) != EOF);
+ if (has_more_input) {
fprintf(stderr, "corrupt input [%s]\n",
PrintablePath(context->current_input_path));
return BROTLI_FALSE;
}
+ if (context->verbosity > 0) {
+ fprintf(stderr, "Decompressed ");
+ PrintFileProcessingProgress(context);
+ fprintf(stderr, "\n");
+ }
return BROTLI_TRUE;
} else {
fprintf(stderr, "corrupt input [%s]\n",
@@ -915,7 +964,13 @@ static BROTLI_BOOL CompressFile(Context* context, BrotliEncoderState* s) {
}
if (BrotliEncoderIsFinished(s)) {
- return FlushOutput(context);
+ if (!FlushOutput(context)) return BROTLI_FALSE;
+ if (context->verbosity > 0) {
+ fprintf(stderr, "Compressed ");
+ PrintFileProcessingProgress(context);
+ fprintf(stderr, "\n");
+ }
+ return BROTLI_TRUE;
}
}
}
@@ -979,11 +1034,11 @@ int main(int argc, char** argv) {
context.quality = 11;
context.lgwin = -1;
+ context.verbosity = 0;
context.force_overwrite = BROTLI_FALSE;
context.junk_source = BROTLI_FALSE;
context.copy_stat = BROTLI_TRUE;
context.test_integrity = BROTLI_FALSE;
- context.verbose = BROTLI_FALSE;
context.write_to_stdout = BROTLI_FALSE;
context.decompress = BROTLI_FALSE;
context.large_window = BROTLI_FALSE;
diff --git a/src/libraries/Native/Unix/System.IO.Compression.Native/CMakeLists.txt b/src/libraries/Native/Unix/System.IO.Compression.Native/CMakeLists.txt
index 5bf46fe6b163..dcd1d87963b7 100644
--- a/src/libraries/Native/Unix/System.IO.Compression.Native/CMakeLists.txt
+++ b/src/libraries/Native/Unix/System.IO.Compression.Native/CMakeLists.txt
@@ -23,7 +23,10 @@ if (NOT CLR_CMAKE_TARGET_BROWSER)
set (NATIVECOMPRESSION_SOURCES
${NATIVECOMPRESSION_SOURCES}
+ ../../AnyOS/brotli/common/constants.c
+ ../../AnyOS/brotli/common/context.c
../../AnyOS/brotli/common/dictionary.c
+ ../../AnyOS/brotli/common/platform.c
../../AnyOS/brotli/common/transform.c
../../AnyOS/brotli/dec/bit_reader.c
../../AnyOS/brotli/dec/decode.c
@@ -35,12 +38,14 @@ if (NOT CLR_CMAKE_TARGET_BROWSER)
../../AnyOS/brotli/enc/block_splitter.c
../../AnyOS/brotli/enc/brotli_bit_stream.c
../../AnyOS/brotli/enc/cluster.c
+ ../../AnyOS/brotli/enc/command.c
../../AnyOS/brotli/enc/compress_fragment.c
../../AnyOS/brotli/enc/compress_fragment_two_pass.c
../../AnyOS/brotli/enc/dictionary_hash.c
../../AnyOS/brotli/enc/encode.c
../../AnyOS/brotli/enc/encoder_dict.c
../../AnyOS/brotli/enc/entropy_encode.c
+ ../../AnyOS/brotli/enc/fast_log.c
../../AnyOS/brotli/enc/histogram.c
../../AnyOS/brotli/enc/literal_cost.c
../../AnyOS/brotli/enc/memory.c
diff --git a/src/libraries/Native/Unix/tryrun.cmake b/src/libraries/Native/Unix/tryrun.cmake
index 84b727f4c2ee..adb186203324 100644
--- a/src/libraries/Native/Unix/tryrun.cmake
+++ b/src/libraries/Native/Unix/tryrun.cmake
@@ -34,6 +34,8 @@ if(TARGET_ARCH_NAME MATCHES "^(armel|arm|arm64|x86)$" OR FREEBSD OR ILLUMOS)
set_cache_value(HAVE_SHM_OPEN_THAT_WORKS_WELL_ENOUGH_WITH_MMAP 1)
set_cache_value(HAVE_CLOCK_MONOTONIC 1)
set_cache_value(HAVE_CLOCK_REALTIME 1)
+ elseif(ILLUMOS)
+ set_cache_value(HAVE_SET_MAX_VARIABLE 1)
endif()
else()
message(FATAL_ERROR "Arch is ${TARGET_ARCH_NAME}. Only armel, arm, arm64 and x86 are supported!")
diff --git a/src/libraries/Native/Windows/clrcompression/CMakeLists.txt b/src/libraries/Native/Windows/clrcompression/CMakeLists.txt
index 7c6e63a221d3..5ac67d5edbe5 100644
--- a/src/libraries/Native/Windows/clrcompression/CMakeLists.txt
+++ b/src/libraries/Native/Windows/clrcompression/CMakeLists.txt
@@ -42,7 +42,10 @@ endif()
set (NATIVECOMPRESSION_SOURCES
${NATIVECOMPRESSION_SOURCES}
../../AnyOS/zlib/pal_zlib.c
+ ../../AnyOS/brotli/common/constants.c
+ ../../AnyOS/brotli/common/context.c
../../AnyOS/brotli/common/dictionary.c
+ ../../AnyOS/brotli/common/platform.c
../../AnyOS/brotli/common/transform.c
../../AnyOS/brotli/dec/bit_reader.c
../../AnyOS/brotli/dec/decode.c
@@ -54,12 +57,14 @@ set (NATIVECOMPRESSION_SOURCES
../../AnyOS/brotli/enc/block_splitter.c
../../AnyOS/brotli/enc/brotli_bit_stream.c
../../AnyOS/brotli/enc/cluster.c
+ ../../AnyOS/brotli/enc/command.c
../../AnyOS/brotli/enc/compress_fragment.c
../../AnyOS/brotli/enc/compress_fragment_two_pass.c
../../AnyOS/brotli/enc/dictionary_hash.c
../../AnyOS/brotli/enc/encode.c
../../AnyOS/brotli/enc/encoder_dict.c
../../AnyOS/brotli/enc/entropy_encode.c
+ ../../AnyOS/brotli/enc/fast_log.c
../../AnyOS/brotli/enc/histogram.c
../../AnyOS/brotli/enc/literal_cost.c
../../AnyOS/brotli/enc/memory.c
diff --git a/src/libraries/Native/build-native.cmd b/src/libraries/Native/build-native.cmd
index 8ada3872c6f3..e96af68eb5a1 100644
--- a/src/libraries/Native/build-native.cmd
+++ b/src/libraries/Native/build-native.cmd
@@ -12,7 +12,7 @@ set __IntermediatesDir=""
set __BuildArch=x64
set __BuildTarget="build"
set __VCBuildArch=x86_amd64
-set __TargetOS=Windows_NT
+set __TargetOS=windows
set CMAKE_BUILD_TYPE=Debug
set "__LinkArgs= "
set "__LinkLibraries= "
diff --git a/src/libraries/Native/build-native.proj b/src/libraries/Native/build-native.proj
index 17ad64168787..900d7f0ad726 100644
--- a/src/libraries/Native/build-native.proj
+++ b/src/libraries/Native/build-native.proj
@@ -1,8 +1,8 @@
- $(ArtifactsObjDir)_version.h
- $(ArtifactsObjDir)_version.c
+ $(ArtifactsObjDir)_version.h
+ $(ArtifactsObjDir)_version.c
$(BuildTargetFramework)
$(NetCoreAppCurrent)
<_BuildNativeArgs>$(TargetArchitecture) $(Configuration) outconfig $(TargetFramework)-$(TargetOS)-$(Configuration)-$(TargetArchitecture) -os $(TargetOS)
diff --git a/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/BlockingCollection.cs b/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/BlockingCollection.cs
index a7a74c66c320..40dc97191207 100644
--- a/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/BlockingCollection.cs
+++ b/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/BlockingCollection.cs
@@ -536,7 +536,7 @@ private bool TryAddWithNoTimeValidation(T item, int millisecondsTimeout, Cancell
/// A call to may block until an item is available to be removed.
public T Take()
{
- T item;
+ T? item;
if (!TryTake(out item, Timeout.Infinite, CancellationToken.None))
{
@@ -560,7 +560,7 @@ public T Take()
/// A call to may block until an item is available to be removed.
public T Take(CancellationToken cancellationToken)
{
- T item;
+ T? item;
if (!TryTake(out item, Timeout.Infinite, cancellationToken))
{
@@ -1089,15 +1089,16 @@ private static List GetHandles(BlockingCollection[] collections,
List tokensList = new List(collections.Length + 1); // + 1 for the external token
tokensList.Add(externalCancellationToken);
- //Read the appropriate WaitHandle based on the operation mode.
+ // Read the appropriate WaitHandle based on the operation mode.
if (isAddOperation)
{
for (int i = 0; i < collections.Length; i++)
{
- if (collections[i]._freeNodes != null)
+ BlockingCollection c = collections[i];
+ if (c._freeNodes != null)
{
- handlesList.Add(collections[i]._freeNodes!.AvailableWaitHandle); // TODO-NULLABLE: Indexer nullability tracked (https://github.com/dotnet/roslyn/issues/34644)
- tokensList.Add(collections[i]._producersCancellationTokenSource.Token);
+ handlesList.Add(c._freeNodes.AvailableWaitHandle);
+ tokensList.Add(c._producersCancellationTokenSource.Token);
}
}
}
@@ -1657,7 +1658,7 @@ public IEnumerable GetConsumingEnumerable(CancellationToken cancellationToken
linkedTokenSource = CancellationTokenSource.CreateLinkedTokenSource(cancellationToken, _consumersCancellationTokenSource.Token);
while (!IsCompleted)
{
- T item;
+ T? item;
if (TryTakeWithNoTimeValidation(out item, Timeout.Infinite, cancellationToken, linkedTokenSource))
{
yield return item;
diff --git a/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/ConcurrentBag.cs b/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/ConcurrentBag.cs
index 2ac047da2584..0328b9f0e526 100644
--- a/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/ConcurrentBag.cs
+++ b/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/ConcurrentBag.cs
@@ -448,7 +448,7 @@ public void Clear()
FreezeBag(ref lockTaken);
for (WorkStealingQueue? queue = _workStealingQueues; queue != null; queue = queue._nextQueue)
{
- T ignored;
+ T? ignored;
while (queue.TrySteal(out ignored, take: true));
}
}
diff --git a/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/ConcurrentDictionary.cs b/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/ConcurrentDictionary.cs
index affa3bfaa30b..aa79092e6406 100644
--- a/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/ConcurrentDictionary.cs
+++ b/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/ConcurrentDictionary.cs
@@ -1022,7 +1022,7 @@ public TValue this[TKey key]
{
get
{
- if (!TryGetValue(key, out TValue value))
+ if (!TryGetValue(key, out TValue? value))
{
ThrowKeyNotFoundException(key);
}
@@ -1132,7 +1132,7 @@ public TValue GetOrAdd(TKey key, Func valueFactory)
IEqualityComparer? comparer = _comparer;
int hashcode = comparer is null ? key.GetHashCode() : comparer.GetHashCode(key);
- if (!TryGetValueInternal(key, hashcode, out TValue resultingValue))
+ if (!TryGetValueInternal(key, hashcode, out TValue? resultingValue))
{
TryAddInternal(key, hashcode, valueFactory(key), updateIfExists: false, acquireLock: true, out resultingValue);
}
@@ -1171,7 +1171,7 @@ public TValue GetOrAdd(TKey key, Func valueFactory, TA
IEqualityComparer? comparer = _comparer;
int hashcode = comparer is null ? key.GetHashCode() : comparer.GetHashCode(key);
- if (!TryGetValueInternal(key, hashcode, out TValue resultingValue))
+ if (!TryGetValueInternal(key, hashcode, out TValue? resultingValue))
{
TryAddInternal(key, hashcode, valueFactory(key, factoryArgument), updateIfExists: false, acquireLock: true, out resultingValue);
}
@@ -1201,7 +1201,7 @@ public TValue GetOrAdd(TKey key, TValue value)
IEqualityComparer? comparer = _comparer;
int hashcode = comparer is null ? key.GetHashCode() : comparer.GetHashCode(key);
- if (!TryGetValueInternal(key, hashcode, out TValue resultingValue))
+ if (!TryGetValueInternal(key, hashcode, out TValue? resultingValue))
{
TryAddInternal(key, hashcode, value, updateIfExists: false, acquireLock: true, out resultingValue);
}
@@ -1252,7 +1252,7 @@ public TValue AddOrUpdate(
while (true)
{
- if (TryGetValueInternal(key, hashcode, out TValue oldValue))
+ if (TryGetValueInternal(key, hashcode, out TValue? oldValue))
{
// key exists, try to update
TValue newValue = updateValueFactory(key, oldValue, factoryArgument);
@@ -1313,7 +1313,7 @@ public TValue AddOrUpdate(TKey key, Func addValueFactory, Func
while (true)
{
- if (TryGetValueInternal(key, hashcode, out TValue oldValue))
+ if (TryGetValueInternal(key, hashcode, out TValue? oldValue))
{
// key exists, try to update
TValue newValue = updateValueFactory(key, oldValue);
@@ -1538,7 +1538,7 @@ void IDictionary.Add(TKey key, TValue value)
/// cref="ICollection{T}"/>; otherwise, false.
bool ICollection>.Contains(KeyValuePair keyValuePair)
{
- if (!TryGetValue(keyValuePair.Key, out TValue value))
+ if (!TryGetValue(keyValuePair.Key, out TValue? value))
{
return false;
}
@@ -1730,7 +1730,7 @@ void IDictionary.Remove(object key)
ThrowHelper.ThrowKeyNullException();
}
- if (key is TKey tkey && TryGetValue(tkey, out TValue value))
+ if (key is TKey tkey && TryGetValue(tkey, out TValue? value))
{
return value;
}
diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.cs
index e734dbba8be0..31d2b34974ec 100644
--- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.cs
+++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableSortedDictionary_2.cs
@@ -196,7 +196,7 @@ public TValue this[TKey key]
{
Requires.NotNullAllowStructs(key, nameof(key));
- TValue value;
+ TValue? value;
if (this.TryGetValue(key, out value))
{
return value;
diff --git a/src/libraries/System.Collections/src/System/Collections/Generic/CollectionExtensions.cs b/src/libraries/System.Collections/src/System/Collections/Generic/CollectionExtensions.cs
index 39158f2e18cd..7a5bce9b0a1d 100644
--- a/src/libraries/System.Collections/src/System/Collections/Generic/CollectionExtensions.cs
+++ b/src/libraries/System.Collections/src/System/Collections/Generic/CollectionExtensions.cs
@@ -19,7 +19,7 @@ public static TValue GetValueOrDefault(this IReadOnlyDictionary collection)
private void RemoveAllElements(IEnumerable collection)
{
- T min = Min;
- T max = Max;
+ T? min = Min;
+ T? max = Max;
foreach (T item in collection)
{
if (!(comparer.Compare(item, min) < 0 || comparer.Compare(item, max) > 0) && Contains(item))
@@ -1031,7 +1031,7 @@ public virtual void IntersectWith(IEnumerable other)
Enumerator mine = this.GetEnumerator();
Enumerator theirs = asSorted.GetEnumerator();
bool mineEnded = !mine.MoveNext(), theirsEnded = !theirs.MoveNext();
- T max = Max;
+ T? max = Max;
while (!mineEnded && !theirsEnded && Comparer.Compare(theirs.Current, max) <= 0)
{
@@ -1109,8 +1109,8 @@ public void ExceptWith(IEnumerable other)
// Outside range, no point in doing anything
if (comparer.Compare(asSorted.Max, Min) >= 0 && comparer.Compare(asSorted.Min, Max) <= 0)
{
- T min = Min;
- T max = Max;
+ T? min = Min;
+ T? max = Max;
foreach (T item in other)
{
if (comparer.Compare(item, min) < 0)
diff --git a/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/CompareAttribute.cs b/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/CompareAttribute.cs
index dab56c6018e6..ec7caa4fce68 100644
--- a/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/CompareAttribute.cs
+++ b/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/CompareAttribute.cs
@@ -60,8 +60,6 @@ public override string FormatErrorMessage(string name) =>
var display = attributes.OfType().FirstOrDefault();
if (display != null)
{
- // TODO-NULLABLE: This will return null if [DisplayName] is specified but no Name has been defined - probably a bug.
- // Should fall back to OtherProperty in this case instead.
return display.GetName();
}
diff --git a/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/ValidationAttribute.cs b/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/ValidationAttribute.cs
index 01ec012f20de..eedd0de4bf1a 100644
--- a/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/ValidationAttribute.cs
+++ b/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/ValidationAttribute.cs
@@ -273,8 +273,6 @@ private void SetResourceAccessorByPropertyLookup()
_errorMessageResourceType.FullName));
}
-
- // TODO-NULLABLE: If the user-provided resource returns null, an ArgumentNullException is thrown - should probably throw a better exception
_errorMessageResourceAccessor = () => (string)property.GetValue(null, null)!;
}
diff --git a/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/Validator.cs b/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/Validator.cs
index b6251f53451f..1363b58d1540 100644
--- a/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/Validator.cs
+++ b/src/libraries/System.ComponentModel.Annotations/src/System/ComponentModel/DataAnnotations/Validator.cs
@@ -137,7 +137,6 @@ public static bool TryValidateObject(object instance, ValidationContext validati
throw new ArgumentNullException(nameof(instance));
}
- // TODO-NULLABLE: null validationContext isn't supported (GetObjectValidationErrors will throw), remove that check
if (validationContext != null && instance != validationContext.ObjectInstance)
{
throw new ArgumentException(SR.Validator_InstanceMustMatchValidationContextInstance, nameof(instance));
diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/AtomicCompositionExtensions.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/AtomicCompositionExtensions.cs
index c3be4d17df16..e0d99e469252 100644
--- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/AtomicCompositionExtensions.cs
+++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/AtomicCompositionExtensions.cs
@@ -18,8 +18,8 @@ internal static T GetValueAllowNull(this AtomicComposition? atomicComposition
internal static T GetValueAllowNull(this AtomicComposition? atomicComposition, object key, T defaultResult)
{
- T result;
- if (atomicComposition != null && atomicComposition.TryGetValue(key, out result))
+ T? result;
+ if (atomicComposition != null && atomicComposition.TryGetValue(key, out result))
{
return result;
}
diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/LazyMemberInfo.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/LazyMemberInfo.cs
index 14124ff46f5c..cbfc3cdda8af 100644
--- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/LazyMemberInfo.cs
+++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/ReflectionModel/LazyMemberInfo.cs
@@ -97,14 +97,13 @@ public override int GetHashCode()
{
return MemberType.GetHashCode() ^ _accessorsCreator.GetHashCode();
}
- else
+
+ if (_accessors != null && _accessors[0] is MemberInfo accessor)
{
- if (_accessors == null || _accessors[0] == null)
- {
- throw new Exception(SR.Diagnostic_InternalExceptionMessage);
- }
- return MemberType.GetHashCode() ^ _accessors[0]!.GetHashCode(); // TODO-NULLABLE: Indexer nullability tracked (https://github.com/dotnet/roslyn/issues/34644)
+ return MemberType.GetHashCode() ^ accessor.GetHashCode();
}
+
+ throw new Exception(SR.Diagnostic_InternalExceptionMessage);
}
public override bool Equals(object? obj)
diff --git a/src/libraries/System.Configuration.ConfigurationManager/tests/System.Configuration.ConfigurationManager.Tests.csproj b/src/libraries/System.Configuration.ConfigurationManager/tests/System.Configuration.ConfigurationManager.Tests.csproj
index 555d37eb2cb3..f6f45fd83fe6 100644
--- a/src/libraries/System.Configuration.ConfigurationManager/tests/System.Configuration.ConfigurationManager.Tests.csproj
+++ b/src/libraries/System.Configuration.ConfigurationManager/tests/System.Configuration.ConfigurationManager.Tests.csproj
@@ -4,7 +4,7 @@
true
true
true
- $(NetCoreAppCurrent)-Windows_NT;net461
+ $(NetCoreAppCurrent)-windows;net461
true
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Android;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-Browser
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Android;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-Browser
enable
diff --git a/src/libraries/System.Console/tests/System.Console.Tests.csproj b/src/libraries/System.Console/tests/System.Console.Tests.csproj
index d8ea79330084..082f61922fe0 100644
--- a/src/libraries/System.Console/tests/System.Console.Tests.csproj
+++ b/src/libraries/System.Console/tests/System.Console.Tests.csproj
@@ -2,7 +2,7 @@
true
true
- $(NetCoreAppCurrent);$(NetCoreAppCurrent)-Windows_NT
+ $(NetCoreAppCurrent);$(NetCoreAppCurrent)-windows
diff --git a/src/libraries/System.Data.Common/src/System/Data/xmlsaver.cs b/src/libraries/System.Data.Common/src/System/Data/xmlsaver.cs
index 7307670eceb5..4f68992c822a 100644
--- a/src/libraries/System.Data.Common/src/System/Data/xmlsaver.cs
+++ b/src/libraries/System.Data.Common/src/System/Data/xmlsaver.cs
@@ -3360,7 +3360,7 @@ public override int Depth
get { return _xmlreader.Depth; }
}
- public override string? BaseURI
+ public override string BaseURI
{
get { return _xmlreader.BaseURI; }
}
diff --git a/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj b/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj
index 9286d2cfebd2..87ad725689c7 100644
--- a/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj
+++ b/src/libraries/System.Data.Odbc/src/System.Data.Odbc.csproj
@@ -1,7 +1,7 @@
true
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-illumos;$(NetCoreAppCurrent)-Solaris;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent);netcoreapp2.0-FreeBSD;netcoreapp2.0-Linux;netcoreapp2.0-OSX;netcoreapp2.0-Windows_NT;netstandard2.0;net461-Windows_NT
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-illumos;$(NetCoreAppCurrent)-Solaris;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent);netcoreapp2.0-FreeBSD;netcoreapp2.0-Linux;netcoreapp2.0-OSX;netcoreapp2.0-windows;netstandard2.0;net461-windows
true
$(NoWarn);CA2249;CA1838
enable
diff --git a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcConnectionOpen.cs b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcConnectionOpen.cs
index 008facb51311..4b5b73bfa642 100644
--- a/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcConnectionOpen.cs
+++ b/src/libraries/System.Data.Odbc/src/System/Data/Odbc/OdbcConnectionOpen.cs
@@ -32,7 +32,7 @@ public override string ServerVersion
{
get
{
- // TODO-NULLABLE: This seems like it returns null if the connection is open, whereas the docs say it should throw
+ // https://github.com/dotnet/runtime/issues/44289: This seems like it returns null if the connection is open, whereas the docs say it should throw
// InvalidOperationException
return OuterConnection.Open_GetServerVersion()!;
}
diff --git a/src/libraries/System.Data.Odbc/tests/System.Data.Odbc.Tests.csproj b/src/libraries/System.Data.Odbc/tests/System.Data.Odbc.Tests.csproj
index 208f6a4ab831..d22d70ea780b 100644
--- a/src/libraries/System.Data.Odbc/tests/System.Data.Odbc.Tests.csproj
+++ b/src/libraries/System.Data.Odbc/tests/System.Data.Odbc.Tests.csproj
@@ -1,7 +1,7 @@
$(DefineConstants);TargetsWindows
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;net461-Windows_NT
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;net461-windows
diff --git a/src/libraries/System.Data.OleDb/src/ColumnBinding.cs b/src/libraries/System.Data.OleDb/src/ColumnBinding.cs
index 34334156e3e1..8eca4d628067 100644
--- a/src/libraries/System.Data.OleDb/src/ColumnBinding.cs
+++ b/src/libraries/System.Data.OleDb/src/ColumnBinding.cs
@@ -948,8 +948,7 @@ internal OleDbDataReader Value_HCHAPTER()
Debug.Assert(NativeDBType.HCHAPTER == DbType, "Value_HCHAPTER");
Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_HCHAPTER");
- // TODO-NULLABLE: This shouldn't return null
- return DataReader().ResetChapter(IndexForAccessor, IndexWithinAccessor, RowBinding, ValueOffset)!;
+ return DataReader().ResetChapter(IndexForAccessor, IndexWithinAccessor, RowBinding, ValueOffset);
}
private sbyte Value_I1()
diff --git a/src/libraries/System.Data.OleDb/src/OleDbCommand.cs b/src/libraries/System.Data.OleDb/src/OleDbCommand.cs
index a47d9cd6fa44..a6b9503e0abf 100644
--- a/src/libraries/System.Data.OleDb/src/OleDbCommand.cs
+++ b/src/libraries/System.Data.OleDb/src/OleDbCommand.cs
@@ -818,7 +818,6 @@ private int ExecuteCommandText(out object executeResult)
RuntimeHelpers.PrepareConstrainedRegions();
try
{
- // TODO-NULLABLE: Code below seems to assume that bindings will always be non-null
if (null != bindings)
{ // parameters may be suppressed
rowbinding = bindings.RowBinding();
diff --git a/src/libraries/System.Data.OleDb/src/OleDbConnectionFactory.cs b/src/libraries/System.Data.OleDb/src/OleDbConnectionFactory.cs
index 9b1a7cd36642..2893c0173ee5 100644
--- a/src/libraries/System.Data.OleDb/src/OleDbConnectionFactory.cs
+++ b/src/libraries/System.Data.OleDb/src/OleDbConnectionFactory.cs
@@ -33,8 +33,7 @@ public override DbProviderFactory ProviderFactory
protected override DbConnectionInternal CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, object poolGroupProviderInfo, DbConnectionPool? pool, DbConnection? owningObject)
{
- // TODO-NULLABLE: owningObject may actually be null (see DbConnectionPool.CreateObject), in which case this will throw...
- DbConnectionInternal result = new OleDbConnectionInternal((OleDbConnectionString)options, (OleDbConnection)owningObject!);
+ DbConnectionInternal result = new OleDbConnectionInternal((OleDbConnectionString)options, (OleDbConnection?)owningObject);
return result;
}
diff --git a/src/libraries/System.Data.OleDb/src/OleDbConnectionInternal.cs b/src/libraries/System.Data.OleDb/src/OleDbConnectionInternal.cs
index 09ab6982105b..f2b98efd4e4c 100644
--- a/src/libraries/System.Data.OleDb/src/OleDbConnectionInternal.cs
+++ b/src/libraries/System.Data.OleDb/src/OleDbConnectionInternal.cs
@@ -385,7 +385,7 @@ internal void EnlistTransactionInternal(SysTx.Transaction? transaction)
using (IDBInfoWrapper wrapper = IDBInfo())
{
UnsafeNativeMethods.IDBInfo dbInfo = wrapper.Value;
- // TODO-NULLABLE: check may not be necessary (and thus method may return non-nullable)
+ // https://github.com/dotnet/runtime/issues/44288: check may not be necessary (and thus method may return non-nullable)
if (null == dbInfo)
{
return null;
diff --git a/src/libraries/System.Data.OleDb/src/OleDbDataReader.cs b/src/libraries/System.Data.OleDb/src/OleDbDataReader.cs
index 98846eab53ae..f3b6a0e01171 100644
--- a/src/libraries/System.Data.OleDb/src/OleDbDataReader.cs
+++ b/src/libraries/System.Data.OleDb/src/OleDbDataReader.cs
@@ -951,12 +951,12 @@ protected override DbDataReader GetDbDataReader(int ordinal)
return GetData(ordinal);
}
- internal OleDbDataReader? ResetChapter(int bindingIndex, int index, RowBinding rowbinding, int valueOffset)
+ internal OleDbDataReader ResetChapter(int bindingIndex, int index, RowBinding rowbinding, int valueOffset)
{
return GetDataForReader(_metadata![bindingIndex + index].ordinal, rowbinding, valueOffset);
}
- private OleDbDataReader? GetDataForReader(IntPtr ordinal, RowBinding rowbinding, int valueOffset)
+ private OleDbDataReader GetDataForReader(IntPtr ordinal, RowBinding rowbinding, int valueOffset)
{
UnsafeNativeMethods.IRowsetInfo rowsetInfo = IRowsetInfo();
UnsafeNativeMethods.IRowset? result;
@@ -964,9 +964,10 @@ protected override DbDataReader GetDbDataReader(int ordinal)
hr = rowsetInfo.GetReferencedRowset((IntPtr)ordinal, ref ODB.IID_IRowset, out result);
ProcessResults(hr);
+ // Per docs result can be null only when hr is DB_E_NOTAREFERENCECOLUMN which in most of the cases will cause the exception in ProcessResult
OleDbDataReader? reader = null;
- // TODO: Not sure if GetReferenceRowset above actually returns null, calling code seems to assume it doesn't
+
if (null != result)
{
// only when the first datareader is closed will the connection close
@@ -983,6 +984,7 @@ protected override DbDataReader GetDbDataReader(int ordinal)
_connection.AddWeakReference(reader, OleDbReferenceCollection.DataReaderTag);
}
}
+
return reader;
}
@@ -1022,8 +1024,9 @@ public override Type GetFieldType(int index)
{
if (null != _metadata)
{
- // TODO-NULLABLE: Should throw if null (empty), though it probably doesn't happen
- return _metadata[index].type.dataType!;
+ Type? fieldType = _metadata[index].type.dataType;
+ Debug.Assert(fieldType != null);
+ return fieldType;
}
throw ADP.DataReaderNoData();
}
@@ -2273,7 +2276,6 @@ internal void DumpToSchemaTable(UnsafeNativeMethods.IRowset? rowset)
using (OleDbDataReader dataReader = new OleDbDataReader(_connection, _command, int.MinValue, 0))
{
dataReader.InitializeIRowset(rowset, ChapterHandle.DB_NULL_HCHAPTER, IntPtr.Zero);
- // TODO-NULLABLE: BuildSchemaTableInfo asserts that rowset isn't null, but doesn't do anything with it
dataReader.BuildSchemaTableInfo(rowset!, true, false);
hiddenColumns = GetPropertyValue(ODB.DBPROP_HIDDENCOLUMNS);
diff --git a/src/libraries/System.Data.OleDb/src/System.Data.OleDb.csproj b/src/libraries/System.Data.OleDb/src/System.Data.OleDb.csproj
index 982531b5b957..16505436d47f 100644
--- a/src/libraries/System.Data.OleDb/src/System.Data.OleDb.csproj
+++ b/src/libraries/System.Data.OleDb/src/System.Data.OleDb.csproj
@@ -1,7 +1,7 @@
true
- netstandard2.0-Windows_NT;netstandard2.0;net461-Windows_NT
+ netstandard2.0-windows;netstandard2.0;net461-windows
true
enable
diff --git a/src/libraries/System.Data.OleDb/src/UnsafeNativeMethods.cs b/src/libraries/System.Data.OleDb/src/UnsafeNativeMethods.cs
index 4f6717007d3e..b7be99491c17 100644
--- a/src/libraries/System.Data.OleDb/src/UnsafeNativeMethods.cs
+++ b/src/libraries/System.Data.OleDb/src/UnsafeNativeMethods.cs
@@ -723,7 +723,7 @@ System.Data.OleDb.OleDbHResult GetProperties(
System.Data.OleDb.OleDbHResult GetReferencedRowset(
[In] IntPtr iOrdinal,
[In] ref Guid riid,
- [Out, MarshalAs(UnmanagedType.Interface)] out IRowset ppRowset);
+ [Out, MarshalAs(UnmanagedType.Interface)] out IRowset? ppRowset);
//[PreserveSig]
//int GetSpecification(/*deleted parameter signature*/);
diff --git a/src/libraries/System.Data.OleDb/tests/System.Data.OleDb.Tests.csproj b/src/libraries/System.Data.OleDb/tests/System.Data.OleDb.Tests.csproj
index d4874a8727ff..35d80cbf9f22 100644
--- a/src/libraries/System.Data.OleDb/tests/System.Data.OleDb.Tests.csproj
+++ b/src/libraries/System.Data.OleDb/tests/System.Data.OleDb.Tests.csproj
@@ -1,6 +1,6 @@
- $(NetCoreAppCurrent)-Windows_NT;net461-Windows_NT
+ $(NetCoreAppCurrent)-windows;net461-windows
diff --git a/src/libraries/System.Diagnostics.Debug/tests/System.Diagnostics.Debug.Tests.csproj b/src/libraries/System.Diagnostics.Debug/tests/System.Diagnostics.Debug.Tests.csproj
index 96893aa3faa2..6e8c0ad320d5 100644
--- a/src/libraries/System.Diagnostics.Debug/tests/System.Diagnostics.Debug.Tests.csproj
+++ b/src/libraries/System.Diagnostics.Debug/tests/System.Diagnostics.Debug.Tests.csproj
@@ -3,7 +3,7 @@
System.Diagnostics.Tests
true
None
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix
true
diff --git a/src/libraries/System.Diagnostics.DiagnosticSource/tests/System.Diagnostics.DiagnosticSource.Tests.csproj b/src/libraries/System.Diagnostics.DiagnosticSource/tests/System.Diagnostics.DiagnosticSource.Tests.csproj
index 8cc016a37866..7132e134d3db 100644
--- a/src/libraries/System.Diagnostics.DiagnosticSource/tests/System.Diagnostics.DiagnosticSource.Tests.csproj
+++ b/src/libraries/System.Diagnostics.DiagnosticSource/tests/System.Diagnostics.DiagnosticSource.Tests.csproj
@@ -1,7 +1,7 @@
true
- $(NetCoreAppCurrent);net48-Windows_NT
+ $(NetCoreAppCurrent);net48-windows
diff --git a/src/libraries/System.Diagnostics.EventLog/src/System.Diagnostics.EventLog.csproj b/src/libraries/System.Diagnostics.EventLog/src/System.Diagnostics.EventLog.csproj
index a22f890d5bd5..f94d7cbdb7b2 100644
--- a/src/libraries/System.Diagnostics.EventLog/src/System.Diagnostics.EventLog.csproj
+++ b/src/libraries/System.Diagnostics.EventLog/src/System.Diagnostics.EventLog.csproj
@@ -1,7 +1,7 @@
true
- $(NetCoreAppCurrent)-Windows_NT;netcoreapp2.0-Windows_NT;net461;netstandard2.0
+ $(NetCoreAppCurrent)-windows;netcoreapp2.0-windows;net461;netstandard2.0
true
$(NoWarn);CA1838
diff --git a/src/libraries/System.Diagnostics.EventLog/tests/System.Diagnostics.EventLog.Tests.csproj b/src/libraries/System.Diagnostics.EventLog/tests/System.Diagnostics.EventLog.Tests.csproj
index 8ebc945c1214..68289a9829ab 100644
--- a/src/libraries/System.Diagnostics.EventLog/tests/System.Diagnostics.EventLog.Tests.csproj
+++ b/src/libraries/System.Diagnostics.EventLog/tests/System.Diagnostics.EventLog.Tests.csproj
@@ -1,6 +1,6 @@
- $(NetCoreAppCurrent)-Windows_NT;net461
+ $(NetCoreAppCurrent)-windows;net461
diff --git a/src/libraries/System.Diagnostics.FileVersionInfo/src/System.Diagnostics.FileVersionInfo.csproj b/src/libraries/System.Diagnostics.FileVersionInfo/src/System.Diagnostics.FileVersionInfo.csproj
index 06ae2e9836a5..564f2f435945 100644
--- a/src/libraries/System.Diagnostics.FileVersionInfo/src/System.Diagnostics.FileVersionInfo.csproj
+++ b/src/libraries/System.Diagnostics.FileVersionInfo/src/System.Diagnostics.FileVersionInfo.csproj
@@ -1,7 +1,7 @@
true
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)
enable
diff --git a/src/libraries/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/System.Diagnostics.FileVersionInfo.Tests.csproj b/src/libraries/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/System.Diagnostics.FileVersionInfo.Tests.csproj
index ad26918fd6ea..7efbc8bc54c8 100644
--- a/src/libraries/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/System.Diagnostics.FileVersionInfo.Tests.csproj
+++ b/src/libraries/System.Diagnostics.FileVersionInfo/tests/System.Diagnostics.FileVersionInfo.Tests/System.Diagnostics.FileVersionInfo.Tests.csproj
@@ -1,6 +1,6 @@
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser
true
true
diff --git a/src/libraries/System.Diagnostics.PerformanceCounter/src/System.Diagnostics.PerformanceCounter.csproj b/src/libraries/System.Diagnostics.PerformanceCounter/src/System.Diagnostics.PerformanceCounter.csproj
index a3963b8307a2..45ca8874696b 100644
--- a/src/libraries/System.Diagnostics.PerformanceCounter/src/System.Diagnostics.PerformanceCounter.csproj
+++ b/src/libraries/System.Diagnostics.PerformanceCounter/src/System.Diagnostics.PerformanceCounter.csproj
@@ -1,7 +1,7 @@
true
- $(NetCoreAppCurrent)-Windows_NT;netcoreapp2.0-Windows_NT;netstandard2.0;net461
+ $(NetCoreAppCurrent)-windows;netcoreapp2.0-windows;netstandard2.0;net461
true
diff --git a/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/SharedPerformanceCounter.cs b/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/SharedPerformanceCounter.cs
index 44d0941394bb..633730d6bb14 100644
--- a/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/SharedPerformanceCounter.cs
+++ b/src/libraries/System.Diagnostics.PerformanceCounter/src/System/Diagnostics/SharedPerformanceCounter.cs
@@ -697,6 +697,7 @@ private unsafe CategoryData GetCategoryData()
}
else
{
+ Debug.Assert(counterNamesObject is string[], $"Expected string[], got '{counterNamesObject}' of type '{counterNamesObject?.GetType()}' with kind '{categoryKey.GetValueKind("Counter Names")}' for category '{_categoryName}'");
string[] counterNames = (string[])counterNamesObject;
for (int i = 0; i < counterNames.Length; i++)
counterNames[i] = counterNames[i].ToLowerInvariant();
diff --git a/src/libraries/System.Diagnostics.PerformanceCounter/tests/System.Diagnostics.PerformanceCounter.Tests.csproj b/src/libraries/System.Diagnostics.PerformanceCounter/tests/System.Diagnostics.PerformanceCounter.Tests.csproj
index 0ddd69a7a648..ec9fd2902462 100644
--- a/src/libraries/System.Diagnostics.PerformanceCounter/tests/System.Diagnostics.PerformanceCounter.Tests.csproj
+++ b/src/libraries/System.Diagnostics.PerformanceCounter/tests/System.Diagnostics.PerformanceCounter.Tests.csproj
@@ -1,7 +1,7 @@
true
- $(NetCoreAppCurrent)-Windows_NT;net461
+ $(NetCoreAppCurrent)-windows;net461
diff --git a/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj b/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj
index 750902104e1c..7799b1fbfe4f 100644
--- a/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj
+++ b/src/libraries/System.Diagnostics.Process/src/System.Diagnostics.Process.csproj
@@ -2,7 +2,7 @@
$(DefineConstants);FEATURE_REGISTRY
true
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent);$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-FreeBSD;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent);$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS
enable
$(NoWarn);0649
diff --git a/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs b/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs
index 9097dd7672a5..99272c05f0c2 100644
--- a/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs
+++ b/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Unix.cs
@@ -162,9 +162,7 @@ public void ProcessNameMatchesScriptName()
string scriptName = GetTestFileName();
string filename = Path.Combine(TestDirectory, scriptName);
File.WriteAllText(filename, $"#!/bin/sh\nsleep 600\n"); // sleep 10 min.
- // set x-bit
- int mode = Convert.ToInt32("744", 8);
- Assert.Equal(0, chmod(filename, mode));
+ ChMod(filename, "744"); // set x-bit
using (var process = Process.Start(new ProcessStartInfo { FileName = filename }))
{
@@ -198,8 +196,7 @@ public void ProcessStart_UseShellExecute_OnUnix_FallsBackWhenNotRealExecutable()
// Create a file that has the x-bit set, but which isn't a valid script.
string filename = WriteScriptFile(TestDirectory, GetTestFileName(), returnValue: 0);
File.WriteAllText(filename, $"not a script");
- int mode = Convert.ToInt32("744", 8);
- Assert.Equal(0, chmod(filename, mode));
+ ChMod(filename, "744"); // set x-bit
RemoteInvokeOptions options = new RemoteInvokeOptions();
options.StartInfo.EnvironmentVariables["PATH"] = path;
@@ -482,9 +479,7 @@ public void TestStartOnUnixWithBadPermissions()
{
string path = GetTestFilePath();
File.Create(path).Dispose();
- int mode = Convert.ToInt32("644", 8);
-
- Assert.Equal(0, chmod(path, mode));
+ ChMod(path, "644");
Win32Exception e = Assert.Throws(() => Process.Start(path));
Assert.NotEqual(0, e.NativeErrorCode);
@@ -495,9 +490,7 @@ public void TestStartOnUnixWithBadFormat()
{
string path = GetTestFilePath();
File.Create(path).Dispose();
- int mode = Convert.ToInt32("744", 8);
-
- Assert.Equal(0, chmod(path, mode)); // execute permissions
+ ChMod(path, "744"); // set x-bit
Win32Exception e = Assert.Throws(() => Process.Start(path));
Assert.NotEqual(0, e.NativeErrorCode);
@@ -899,6 +892,11 @@ private static int GetWaitStateReferenceCount(object waitState)
[DllImport("libc")]
private static extern int chmod(string path, int mode);
+ private static void ChMod(string filename, string mode)
+ {
+ Assert.Equal(0, chmod(filename, Convert.ToInt32(mode, 8)));
+ }
+
[DllImport("libc")]
private static extern uint geteuid();
[DllImport("libc")]
@@ -946,9 +944,7 @@ private string WriteScriptFile(string directory, string name, int returnValue)
{
string filename = Path.Combine(directory, name);
File.WriteAllText(filename, $"#!/bin/sh\nexit {returnValue}\n");
- // set x-bit
- int mode = Convert.ToInt32("744", 8);
- Assert.Equal(0, chmod(filename, mode));
+ ChMod(filename, "744"); // set x-bit
return filename;
}
diff --git a/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Windows.cs b/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Windows.cs
index fe061a046b1a..5a8a0dc448bb 100644
--- a/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Windows.cs
+++ b/src/libraries/System.Diagnostics.Process/tests/ProcessTests.Windows.cs
@@ -1,6 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+using System;
using System.IO;
namespace System.Diagnostics.Tests
@@ -14,5 +15,8 @@ private string WriteScriptFile(string directory, string name, int returnValue)
File.WriteAllText(filename, $"exit {returnValue}");
return filename;
}
+
+ private static void ChMod(string filename, string mode)
+ => throw new PlatformNotSupportedException();
}
}
diff --git a/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs b/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs
index c67df209280d..960eaec81040 100644
--- a/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs
+++ b/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs
@@ -1964,23 +1964,27 @@ public void TestLongProcessIsWorking()
[Fact]
public void LongProcessNamesAreSupported()
{
- // Alpine implements sleep as a symlink to the busybox executable.
- // If we rename it, the program will no longer sleep.
- if (PlatformDetection.IsAlpine)
+ string sleepPath;
+ if (OperatingSystem.IsLinux())
{
- return;
+ // On some distros sleep is implemented using a script/symlink, which causes this test to fail.
+ // Instead of using sleep directly, we wrap it with a script.
+ sleepPath = GetTestFilePath();
+ File.WriteAllText(sleepPath, $"#!/bin/sh\nsleep 600\n"); // sleep 10 min.
+ ChMod(sleepPath, "744");
}
-
- string programPath = GetProgramPath("sleep");
-
- if (programPath == null)
+ else
{
- return;
+ sleepPath = GetProgramPath("sleep");
+ if (sleepPath == null)
+ {
+ return;
+ }
}
const string LongProcessName = "123456789012345678901234567890";
string sleepCommandPathFileName = Path.Combine(TestDirectory, LongProcessName);
- File.Copy(programPath, sleepCommandPathFileName);
+ File.Copy(sleepPath, sleepCommandPathFileName);
using (Process px = Process.Start(sleepCommandPathFileName, "600"))
{
diff --git a/src/libraries/System.Diagnostics.Process/tests/System.Diagnostics.Process.Tests.csproj b/src/libraries/System.Diagnostics.Process/tests/System.Diagnostics.Process.Tests.csproj
index 091c18cdbb75..74794bd94e3a 100644
--- a/src/libraries/System.Diagnostics.Process/tests/System.Diagnostics.Process.Tests.csproj
+++ b/src/libraries/System.Diagnostics.Process/tests/System.Diagnostics.Process.Tests.csproj
@@ -3,7 +3,7 @@
true
$(DefineConstants);TargetsWindows
true
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser
true
diff --git a/src/libraries/System.Diagnostics.Tracing/tests/System.Diagnostics.Tracing.Tests.csproj b/src/libraries/System.Diagnostics.Tracing/tests/System.Diagnostics.Tracing.Tests.csproj
index 19e5b0799bff..270e6f2339d1 100644
--- a/src/libraries/System.Diagnostics.Tracing/tests/System.Diagnostics.Tracing.Tests.csproj
+++ b/src/libraries/System.Diagnostics.Tracing/tests/System.Diagnostics.Tracing.Tests.csproj
@@ -1,7 +1,7 @@
true
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)
true
true
diff --git a/src/libraries/System.DirectoryServices.AccountManagement/src/System.DirectoryServices.AccountManagement.csproj b/src/libraries/System.DirectoryServices.AccountManagement/src/System.DirectoryServices.AccountManagement.csproj
index adbd9aecb521..28f616763a34 100644
--- a/src/libraries/System.DirectoryServices.AccountManagement/src/System.DirectoryServices.AccountManagement.csproj
+++ b/src/libraries/System.DirectoryServices.AccountManagement/src/System.DirectoryServices.AccountManagement.csproj
@@ -3,7 +3,7 @@
true
$(DefineConstants);FLAVOR_WHIDBEY;PAPI_AD;PAPI_REGSAM;USE_CTX_CACHE
true
- $(NetCoreAppCurrent)-Windows_NT;netstandard2.0;netcoreapp2.0-Windows_NT
+ $(NetCoreAppCurrent)-windows;netstandard2.0;netcoreapp2.0-windows
true
$(NoWarn);CA2249
diff --git a/src/libraries/System.DirectoryServices.AccountManagement/tests/System.DirectoryServices.AccountManagement.Tests.csproj b/src/libraries/System.DirectoryServices.AccountManagement/tests/System.DirectoryServices.AccountManagement.Tests.csproj
index ff681406c78e..280737448fad 100644
--- a/src/libraries/System.DirectoryServices.AccountManagement/tests/System.DirectoryServices.AccountManagement.Tests.csproj
+++ b/src/libraries/System.DirectoryServices.AccountManagement/tests/System.DirectoryServices.AccountManagement.Tests.csproj
@@ -1,6 +1,6 @@
- $(NetCoreAppCurrent)-Windows_NT;net48
+ $(NetCoreAppCurrent)-windows;net48
diff --git a/src/libraries/System.DirectoryServices.Protocols/src/System.DirectoryServices.Protocols.csproj b/src/libraries/System.DirectoryServices.Protocols/src/System.DirectoryServices.Protocols.csproj
index c37e4da51fa4..5d448bcccd8b 100644
--- a/src/libraries/System.DirectoryServices.Protocols/src/System.DirectoryServices.Protocols.csproj
+++ b/src/libraries/System.DirectoryServices.Protocols/src/System.DirectoryServices.Protocols.csproj
@@ -2,7 +2,7 @@
true
true
- $(NetCoreAppCurrent)-Windows_NT;netcoreapp2.0-Windows_NT;$(NetCoreAppCurrent)-OSX;netcoreapp2.0-OSX;$(NetCoreAppCurrent)-Linux;netcoreapp2.0-Linux;netstandard2.0
+ $(NetCoreAppCurrent)-windows;netcoreapp2.0-windows;$(NetCoreAppCurrent)-OSX;netcoreapp2.0-OSX;$(NetCoreAppCurrent)-Linux;netcoreapp2.0-Linux;netstandard2.0
true
diff --git a/src/libraries/System.DirectoryServices.Protocols/tests/System.DirectoryServices.Protocols.Tests.csproj b/src/libraries/System.DirectoryServices.Protocols/tests/System.DirectoryServices.Protocols.Tests.csproj
index 1175b1d42159..10c29c9a19e6 100644
--- a/src/libraries/System.DirectoryServices.Protocols/tests/System.DirectoryServices.Protocols.Tests.csproj
+++ b/src/libraries/System.DirectoryServices.Protocols/tests/System.DirectoryServices.Protocols.Tests.csproj
@@ -1,6 +1,6 @@
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;net48
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;net48
diff --git a/src/libraries/System.DirectoryServices/src/System.DirectoryServices.csproj b/src/libraries/System.DirectoryServices/src/System.DirectoryServices.csproj
index 7751f4e3d475..311e3ab3413e 100644
--- a/src/libraries/System.DirectoryServices/src/System.DirectoryServices.csproj
+++ b/src/libraries/System.DirectoryServices/src/System.DirectoryServices.csproj
@@ -1,7 +1,7 @@
true
- $(NetCoreAppCurrent)-Windows_NT;netstandard2.0;netcoreapp2.0-Windows_NT
+ $(NetCoreAppCurrent)-windows;netstandard2.0;netcoreapp2.0-windows
true
true
diff --git a/src/libraries/System.DirectoryServices/tests/System.DirectoryServices.Tests.csproj b/src/libraries/System.DirectoryServices/tests/System.DirectoryServices.Tests.csproj
index f71b684f686b..30ff378f1380 100644
--- a/src/libraries/System.DirectoryServices/tests/System.DirectoryServices.Tests.csproj
+++ b/src/libraries/System.DirectoryServices/tests/System.DirectoryServices.Tests.csproj
@@ -2,7 +2,7 @@
$(NoWarn);SYSLIB0003
- $(NetCoreAppCurrent)-Windows_NT;net48
+ $(NetCoreAppCurrent)-windows;net48
diff --git a/src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj b/src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj
index 88201ea00bd4..7ced0e244b4e 100644
--- a/src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj
+++ b/src/libraries/System.Drawing.Common/src/System.Drawing.Common.csproj
@@ -5,7 +5,7 @@
CS0618
$(DefineConstants);FEATURE_WINDOWS_SYSTEM_COLORS;FEATURE_SYSTEM_EVENTS
true
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent);netcoreapp3.0-Windows_NT;netcoreapp3.0-Unix;netcoreapp3.0
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent);netcoreapp3.0-windows;netcoreapp3.0-Unix;netcoreapp3.0
true
enable
diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/Bitmap.Unix.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/Bitmap.Unix.cs
index 7142f89ae95c..f35f980d220e 100644
--- a/src/libraries/System.Drawing.Common/src/System/Drawing/Bitmap.Unix.cs
+++ b/src/libraries/System.Drawing.Common/src/System/Drawing/Bitmap.Unix.cs
@@ -74,7 +74,7 @@ public Bitmap(Type type, string resource)
if (type == null)
throw new NullReferenceException();
- Stream? s = type.GetTypeInfo().Assembly.GetManifestResourceStream(type, resource);
+ Stream? s = type.Assembly.GetManifestResourceStream(type, resource);
if (s == null)
{
string msg = string.Format("Resource '{0}' was not found.", resource);
diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/ClientUtils.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/ClientUtils.cs
index ca8be31d9ec3..b74cb3d1374f 100644
--- a/src/libraries/System.Drawing.Common/src/System/Drawing/ClientUtils.cs
+++ b/src/libraries/System.Drawing.Common/src/System/Drawing/ClientUtils.cs
@@ -109,9 +109,11 @@ public override bool Equals(object? obj)
for (int i = 0; i < Count; i++)
{
- if (InnerList[i] != other.InnerList[i])
+ object? thisObj = InnerList[i];
+ object? otherObj = other.InnerList[i];
+ if (thisObj != otherObj)
{
- if (InnerList[i] == null || !InnerList[i]!.Equals(other.InnerList[i])) // TODO-NULLABLE: https://github.com/dotnet/roslyn/issues/34644
+ if (thisObj is null || !thisObj.Equals(otherObj))
{
return false;
}
diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/FontConverter.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/FontConverter.cs
index 99a327b2ba50..ec5d71b1da8a 100644
--- a/src/libraries/System.Drawing.Common/src/System/Drawing/FontConverter.cs
+++ b/src/libraries/System.Drawing.Common/src/System/Drawing/FontConverter.cs
@@ -87,7 +87,7 @@ public override object ConvertTo(ITypeDescriptorContext? context, CultureInfo? c
if (destinationType == typeof(InstanceDescriptor))
{
- ConstructorInfo? met = typeof(Font).GetTypeInfo().GetConstructor(new Type[] { typeof(string), typeof(float), typeof(FontStyle), typeof(GraphicsUnit) });
+ ConstructorInfo? met = typeof(Font).GetConstructor(new Type[] { typeof(string), typeof(float), typeof(FontStyle), typeof(GraphicsUnit) });
object[] args = new object[4];
args[0] = font.Name;
args[1] = font.Size;
diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Unix.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Unix.cs
index 4cb66531a2d2..9c4b2ddd921f 100644
--- a/src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Unix.cs
+++ b/src/libraries/System.Drawing.Common/src/System/Drawing/Icon.Unix.cs
@@ -247,7 +247,7 @@ public Icon(Type type, string resource)
if (type == null)
throw new NullReferenceException();
- using (Stream? s = type.GetTypeInfo().Assembly.GetManifestResourceStream(type, resource))
+ using (Stream? s = type.Assembly.GetManifestResourceStream(type, resource))
{
if (s == null)
{
@@ -259,7 +259,7 @@ public Icon(Type type, string resource)
internal Icon(string resourceName, bool undisposable)
{
- using (Stream? s = typeof(Icon).GetTypeInfo().Assembly.GetManifestResourceStream(resourceName))
+ using (Stream? s = typeof(Icon).Assembly.GetManifestResourceStream(resourceName))
{
if (s == null)
{
diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/ImageFormatConverter.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/ImageFormatConverter.cs
index 908477d27beb..5fc55f1f9fe5 100644
--- a/src/libraries/System.Drawing.Common/src/System/Drawing/ImageFormatConverter.cs
+++ b/src/libraries/System.Drawing.Common/src/System/Drawing/ImageFormatConverter.cs
@@ -101,11 +101,11 @@ public override object ConvertTo(ITypeDescriptorContext? context, CultureInfo? c
if (strFormat != null)
{
- return new InstanceDescriptor(typeof(ImageFormat).GetTypeInfo().GetProperty(strFormat), null);
+ return new InstanceDescriptor(typeof(ImageFormat).GetProperty(strFormat), null);
}
else
{
- ConstructorInfo? ctor = typeof(ImageFormat).GetTypeInfo().GetConstructor(new Type[] { typeof(Guid) });
+ ConstructorInfo? ctor = typeof(ImageFormat).GetConstructor(new Type[] { typeof(Guid) });
return new InstanceDescriptor(ctor, new object[] { imgFormat.Guid });
}
}
diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/PrintingServices.Unix.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/PrintingServices.Unix.cs
index 8d688f312bc5..613f1ce2e1aa 100644
--- a/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/PrintingServices.Unix.cs
+++ b/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/PrintingServices.Unix.cs
@@ -664,11 +664,11 @@ internal static void GetPrintDialogInfo(string printer, ref string port, ref str
NameValueCollection options = LoadPrinterOptions(cups_dests.options, cups_dests.num_options);
- if (options["printer-state"] != null)
- state = int.Parse(options["printer-state"]!); // TODO-NULLABLE dotnet/roslyn#34644
+ if (options["printer-state"] is string printerState)
+ state = int.Parse(printerState);
- if (options["printer-comment"] != null)
- comment = options["printer-state"]!; // TODO-NULLABLE dotnet/roslyn#34644
+ if (options["printer-comment"] is string printerComment)
+ comment = printerComment;
switch (state)
{
diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/ToolboxBitmapAttribute.Unix.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/ToolboxBitmapAttribute.Unix.cs
index d3815a01836c..51708e341e01 100644
--- a/src/libraries/System.Drawing.Common/src/System/Drawing/ToolboxBitmapAttribute.Unix.cs
+++ b/src/libraries/System.Drawing.Common/src/System/Drawing/ToolboxBitmapAttribute.Unix.cs
@@ -122,7 +122,7 @@ public override int GetHashCode()
try
{
- using (System.IO.Stream? s = t.GetTypeInfo().Assembly.GetManifestResourceStream(t.Namespace + "." + imageName))
+ using (System.IO.Stream? s = t.Assembly.GetManifestResourceStream(t.Namespace + "." + imageName))
{
if (s == null)
{
diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/macFunctions.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/macFunctions.cs
index 52ce76b9ee2d..16523523fb29 100644
--- a/src/libraries/System.Drawing.Common/src/System/Drawing/macFunctions.cs
+++ b/src/libraries/System.Drawing.Common/src/System/Drawing/macFunctions.cs
@@ -59,7 +59,7 @@ internal static class MacSupport
Type? driver_type = asm.GetType("System.Windows.Forms.XplatUICarbon");
if (driver_type != null)
{
- return (Delegate?)driver_type.GetTypeInfo().GetField("HwndDelegate", BindingFlags.NonPublic | BindingFlags.Static)!.GetValue(null);
+ return (Delegate?)driver_type.GetField("HwndDelegate", BindingFlags.NonPublic | BindingFlags.Static)!.GetValue(null);
}
}
}
diff --git a/src/libraries/System.Drawing.Common/tests/System.Drawing.Common.Tests.csproj b/src/libraries/System.Drawing.Common/tests/System.Drawing.Common.Tests.csproj
index 1371f91e3d1a..e84c4ed3c71b 100644
--- a/src/libraries/System.Drawing.Common/tests/System.Drawing.Common.Tests.csproj
+++ b/src/libraries/System.Drawing.Common/tests/System.Drawing.Common.Tests.csproj
@@ -2,7 +2,7 @@
true
true
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;net48
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;net48
diff --git a/src/libraries/System.Drawing.Primitives/src/System.Drawing.Primitives.csproj b/src/libraries/System.Drawing.Primitives/src/System.Drawing.Primitives.csproj
index fd17cd2352c3..516e21286635 100644
--- a/src/libraries/System.Drawing.Primitives/src/System.Drawing.Primitives.csproj
+++ b/src/libraries/System.Drawing.Primitives/src/System.Drawing.Primitives.csproj
@@ -2,7 +2,7 @@
System.Drawing
$(DefineConstants);FEATURE_WINDOWS_SYSTEM_COLORS
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)
enable
diff --git a/src/libraries/System.Globalization.Extensions/tests/NlsTests/System.Globalization.Extensions.Nls.Tests.csproj b/src/libraries/System.Globalization.Extensions/tests/NlsTests/System.Globalization.Extensions.Nls.Tests.csproj
index 2a7bae9d109b..621d668ad242 100644
--- a/src/libraries/System.Globalization.Extensions/tests/NlsTests/System.Globalization.Extensions.Nls.Tests.csproj
+++ b/src/libraries/System.Globalization.Extensions/tests/NlsTests/System.Globalization.Extensions.Nls.Tests.csproj
@@ -1,6 +1,6 @@

- $(NetCoreAppCurrent)-Windows_NT
+ $(NetCoreAppCurrent)-windows
true
diff --git a/src/libraries/System.Globalization/tests/NlsTests/System.Globalization.Nls.Tests.csproj b/src/libraries/System.Globalization/tests/NlsTests/System.Globalization.Nls.Tests.csproj
index e1c20d97ca76..dbbb13abb479 100644
--- a/src/libraries/System.Globalization/tests/NlsTests/System.Globalization.Nls.Tests.csproj
+++ b/src/libraries/System.Globalization/tests/NlsTests/System.Globalization.Nls.Tests.csproj
@@ -4,7 +4,7 @@
true
true
- $(NetCoreAppCurrent)-Windows_NT
+ $(NetCoreAppCurrent)-windows
13.0
diff --git a/src/libraries/System.IO.Compression.Brotli/src/System.IO.Compression.Brotli.csproj b/src/libraries/System.IO.Compression.Brotli/src/System.IO.Compression.Brotli.csproj
index bdb837e5ef95..3404630ffaf6 100644
--- a/src/libraries/System.IO.Compression.Brotli/src/System.IO.Compression.Brotli.csproj
+++ b/src/libraries/System.IO.Compression.Brotli/src/System.IO.Compression.Brotli.csproj
@@ -2,7 +2,7 @@
true
enable
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)
diff --git a/src/libraries/System.IO.Compression.Brotli/tests/System.IO.Compression.Brotli.Tests.csproj b/src/libraries/System.IO.Compression.Brotli/tests/System.IO.Compression.Brotli.Tests.csproj
index 86112e76c058..03b55d59a86b 100644
--- a/src/libraries/System.IO.Compression.Brotli/tests/System.IO.Compression.Brotli.Tests.csproj
+++ b/src/libraries/System.IO.Compression.Brotli/tests/System.IO.Compression.Brotli.Tests.csproj
@@ -1,6 +1,7 @@
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser
+ true
diff --git a/src/libraries/System.IO.Compression/src/System.IO.Compression.csproj b/src/libraries/System.IO.Compression/src/System.IO.Compression.csproj
index 48daf8eee679..df5985bcfdd8 100644
--- a/src/libraries/System.IO.Compression/src/System.IO.Compression.csproj
+++ b/src/libraries/System.IO.Compression/src/System.IO.Compression.csproj
@@ -1,7 +1,7 @@

true
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser
enable
diff --git a/src/libraries/System.IO.Compression/tests/System.IO.Compression.Tests.csproj b/src/libraries/System.IO.Compression/tests/System.IO.Compression.Tests.csproj
index 63c5661623fc..84bd1803bf1b 100644
--- a/src/libraries/System.IO.Compression/tests/System.IO.Compression.Tests.csproj
+++ b/src/libraries/System.IO.Compression/tests/System.IO.Compression.Tests.csproj
@@ -1,6 +1,7 @@
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser
+ true
diff --git a/src/libraries/System.IO.FileSystem.AccessControl/src/System.IO.FileSystem.AccessControl.csproj b/src/libraries/System.IO.FileSystem.AccessControl/src/System.IO.FileSystem.AccessControl.csproj
index 481ae54f0926..503971f5c7a2 100644
--- a/src/libraries/System.IO.FileSystem.AccessControl/src/System.IO.FileSystem.AccessControl.csproj
+++ b/src/libraries/System.IO.FileSystem.AccessControl/src/System.IO.FileSystem.AccessControl.csproj
@@ -1,6 +1,6 @@
- $(NetCoreAppCurrent)-Windows_NT;netstandard2.0;netstandard2.0-Windows_NT;net461-Windows_NT
+ $(NetCoreAppCurrent)-windows;netstandard2.0;netstandard2.0-windows;net461-windows
true
enable
diff --git a/src/libraries/System.IO.FileSystem.AccessControl/tests/System.IO.FileSystem.AccessControl.Tests.csproj b/src/libraries/System.IO.FileSystem.AccessControl/tests/System.IO.FileSystem.AccessControl.Tests.csproj
index 663ab486f555..c3d83e854413 100644
--- a/src/libraries/System.IO.FileSystem.AccessControl/tests/System.IO.FileSystem.AccessControl.Tests.csproj
+++ b/src/libraries/System.IO.FileSystem.AccessControl/tests/System.IO.FileSystem.AccessControl.Tests.csproj
@@ -1,6 +1,6 @@
- $(NetCoreAppCurrent)-Windows_NT;net461-Windows_NT
+ $(NetCoreAppCurrent)-windows;net461-windows
diff --git a/src/libraries/System.IO.FileSystem.DriveInfo/src/System.IO.FileSystem.DriveInfo.csproj b/src/libraries/System.IO.FileSystem.DriveInfo/src/System.IO.FileSystem.DriveInfo.csproj
index cac7326d0c2c..c516eb543e33 100644
--- a/src/libraries/System.IO.FileSystem.DriveInfo/src/System.IO.FileSystem.DriveInfo.csproj
+++ b/src/libraries/System.IO.FileSystem.DriveInfo/src/System.IO.FileSystem.DriveInfo.csproj
@@ -1,7 +1,7 @@
true
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser
enable
diff --git a/src/libraries/System.IO.FileSystem.DriveInfo/tests/System.IO.FileSystem.DriveInfo.Tests.csproj b/src/libraries/System.IO.FileSystem.DriveInfo/tests/System.IO.FileSystem.DriveInfo.Tests.csproj
index 0ed41b1cbbb4..be6473913848 100644
--- a/src/libraries/System.IO.FileSystem.DriveInfo/tests/System.IO.FileSystem.DriveInfo.Tests.csproj
+++ b/src/libraries/System.IO.FileSystem.DriveInfo/tests/System.IO.FileSystem.DriveInfo.Tests.csproj
@@ -1,6 +1,6 @@
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser
diff --git a/src/libraries/System.IO.FileSystem.Watcher/src/System.IO.FileSystem.Watcher.csproj b/src/libraries/System.IO.FileSystem.Watcher/src/System.IO.FileSystem.Watcher.csproj
index fcab1dcb4e9b..f6f195f6d42c 100644
--- a/src/libraries/System.IO.FileSystem.Watcher/src/System.IO.FileSystem.Watcher.csproj
+++ b/src/libraries/System.IO.FileSystem.Watcher/src/System.IO.FileSystem.Watcher.csproj
@@ -1,7 +1,7 @@
true
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent);$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-FreeBSD
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent);$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-FreeBSD
enable
diff --git a/src/libraries/System.IO.FileSystem.Watcher/tests/System.IO.FileSystem.Watcher.Tests.csproj b/src/libraries/System.IO.FileSystem.Watcher/tests/System.IO.FileSystem.Watcher.Tests.csproj
index f0339a66035b..6198325a2dfb 100644
--- a/src/libraries/System.IO.FileSystem.Watcher/tests/System.IO.FileSystem.Watcher.Tests.csproj
+++ b/src/libraries/System.IO.FileSystem.Watcher/tests/System.IO.FileSystem.Watcher.Tests.csproj
@@ -1,7 +1,7 @@
true
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-FreeBSD
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-tvOS;$(NetCoreAppCurrent)-FreeBSD
diff --git a/src/libraries/System.IO.FileSystem/ref/System.IO.FileSystem.cs b/src/libraries/System.IO.FileSystem/ref/System.IO.FileSystem.cs
index f84978d9b5e1..c1790b0658ce 100644
--- a/src/libraries/System.IO.FileSystem/ref/System.IO.FileSystem.cs
+++ b/src/libraries/System.IO.FileSystem/ref/System.IO.FileSystem.cs
@@ -23,7 +23,7 @@ public static void Delete(string path, bool recursive) { }
public static System.Collections.Generic.IEnumerable EnumerateFileSystemEntries(string path, string searchPattern) { throw null; }
public static System.Collections.Generic.IEnumerable EnumerateFileSystemEntries(string path, string searchPattern, System.IO.EnumerationOptions enumerationOptions) { throw null; }
public static System.Collections.Generic.IEnumerable EnumerateFileSystemEntries(string path, string searchPattern, System.IO.SearchOption searchOption) { throw null; }
- public static bool Exists(string? path) { throw null; }
+ public static bool Exists([System.Diagnostics.CodeAnalysis.NotNullWhen(true)] string? path) { throw null; }
public static System.DateTime GetCreationTime(string path) { throw null; }
public static System.DateTime GetCreationTimeUtc(string path) { throw null; }
public static string GetCurrentDirectory() { throw null; }
diff --git a/src/libraries/System.IO.FileSystem/src/System.IO.FileSystem.csproj b/src/libraries/System.IO.FileSystem/src/System.IO.FileSystem.csproj
index 28dfd4667be0..a8ce9dc08580 100644
--- a/src/libraries/System.IO.FileSystem/src/System.IO.FileSystem.csproj
+++ b/src/libraries/System.IO.FileSystem/src/System.IO.FileSystem.csproj
@@ -2,7 +2,7 @@
true
true
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser
enable
diff --git a/src/libraries/System.IO.FileSystem/src/System/IO/File.cs b/src/libraries/System.IO.FileSystem/src/System/IO/File.cs
index 1b089a91ffc8..9f5975485647 100644
--- a/src/libraries/System.IO.FileSystem/src/System/IO/File.cs
+++ b/src/libraries/System.IO.FileSystem/src/System/IO/File.cs
@@ -5,6 +5,7 @@
using System.Buffers;
using System.Collections.Generic;
using System.Diagnostics;
+using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Runtime.ExceptionServices;
using System.Runtime.Versioning;
@@ -114,7 +115,7 @@ public static void Delete(string path)
// given by the specified path exists; otherwise, the result is
// false. Note that if path describes a directory,
// Exists will return true.
- public static bool Exists(string? path)
+ public static bool Exists([NotNullWhen(true)] string? path)
{
try
{
diff --git a/src/libraries/System.IO.FileSystem/tests/FileStream/Buffering_regression.cs b/src/libraries/System.IO.FileSystem/tests/FileStream/Buffering_regression.cs
deleted file mode 100644
index f7a39e3d2991..000000000000
--- a/src/libraries/System.IO.FileSystem/tests/FileStream/Buffering_regression.cs
+++ /dev/null
@@ -1,49 +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;
-using Xunit;
-
-namespace System.IO.Tests
-{
- public class FileStream_Buffering_regression: FileSystemTest
- {
- [Fact]
- public void FlushSetLengthAtEndOfBuffer()
- {
- // This is a regression test for a bug with FileStream's Flush()
- // and SetLength() methods.
- // The read-buffer was not flushed inside Flush and SetLength when
- // the buffer pointer was at the end. This causes subsequent Seek
- // and Read calls to operate on stale/wrong data.
-
-
- // customer reported repro
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- fs.SetLength(200);
- fs.Flush();
-
- // write 119 bytes starting from Pos = 28
- fs.Seek(28, SeekOrigin.Begin);
- byte[] buffer = new byte[119];
- for (int i = 0; i < buffer.Length; i++)
- buffer[i] = byte.MaxValue;
- fs.Write(buffer, 0, buffer.Length);
- fs.Flush();
-
- // read 317 bytes starting from Pos = 84;
- fs.Seek(84, SeekOrigin.Begin);
- fs.Read(new byte[1024], 0, 317);
-
- fs.SetLength(135);
- fs.Flush();
-
- // read one byte at Pos = 97
- fs.Seek(97, SeekOrigin.Begin);
- Assert.Equal(fs.ReadByte(), (int)byte.MaxValue);
- }
- }
- }
-}
diff --git a/src/libraries/System.IO.FileSystem/tests/FileStream/CanRead.cs b/src/libraries/System.IO.FileSystem/tests/FileStream/CanRead.cs
deleted file mode 100644
index 29a528a2f94d..000000000000
--- a/src/libraries/System.IO.FileSystem/tests/FileStream/CanRead.cs
+++ /dev/null
@@ -1,47 +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;
-using Xunit;
-
-namespace System.IO.Tests
-{
- public class FileStream_CanRead : FileSystemTest
- {
- [Fact]
- public void CanReadTrueForReadableStream()
- {
- string fileName = GetTestFilePath();
- using (FileStream fs = new FileStream(fileName, FileMode.Create, FileAccess.ReadWrite))
- {
- Assert.True(fs.CanRead);
- }
-
- using (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read))
- {
- Assert.True(fs.CanRead);
- }
- }
-
- [Fact]
- public void CanReadFalseForWriteOnlyStream()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create, FileAccess.Write))
- {
- Assert.False(fs.CanRead);
- }
- }
-
- [Fact]
- public void CanReadFalseForDisposedStream()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- Assert.True(fs.CanRead);
- fs.Dispose();
- Assert.False(fs.CanRead);
- }
- }
- }
-}
diff --git a/src/libraries/System.IO.FileSystem/tests/FileStream/CanSeek.cs b/src/libraries/System.IO.FileSystem/tests/FileStream/CanSeek.cs
deleted file mode 100644
index bb1c7836e95e..000000000000
--- a/src/libraries/System.IO.FileSystem/tests/FileStream/CanSeek.cs
+++ /dev/null
@@ -1,60 +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 Microsoft.Win32.SafeHandles;
-using System;
-using System.IO;
-using System.IO.Pipes;
-using Xunit;
-
-namespace System.IO.Tests
-{
- public partial class FileStream_CanSeek : FileSystemTest
- {
- [Fact]
- public void CanSeekTrueForSeekableStream()
- {
- string fileName = GetTestFilePath();
- using (FileStream fs = new FileStream(fileName, FileMode.Create, FileAccess.ReadWrite))
- {
- Assert.True(fs.CanSeek);
- }
-
- using (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read))
- {
- Assert.True(fs.CanSeek);
- }
-
- using (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Write))
- {
- Assert.True(fs.CanSeek);
- }
- }
-
- [Fact]
- public void CanSeekFalseForDisposedStream()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- Assert.True(fs.CanSeek);
- fs.Dispose();
- Assert.False(fs.CanSeek);
- }
- }
-
- [Fact]
- [PlatformSpecific(~TestPlatforms.Browser)] // IO.Pipes not supported
- public void CanSeekReturnsFalseForPipe()
- {
- using (var pipeStream = new AnonymousPipeServerStream())
- using (var clientHandle = pipeStream.ClientSafePipeHandle)
- {
- SafeFileHandle handle = new SafeFileHandle((IntPtr)int.Parse(pipeStream.GetClientHandleAsString()), false);
- using (FileStream fs = new FileStream(handle, FileAccess.Write, 1, false))
- {
- Assert.False(fs.CanSeek);
- }
- }
- }
- }
-}
diff --git a/src/libraries/System.IO.FileSystem/tests/FileStream/CanTimeout.cs b/src/libraries/System.IO.FileSystem/tests/FileStream/CanTimeout.cs
deleted file mode 100644
index 7dbb6ecb252a..000000000000
--- a/src/libraries/System.IO.FileSystem/tests/FileStream/CanTimeout.cs
+++ /dev/null
@@ -1,25 +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;
-using Xunit;
-
-namespace System.IO.Tests
-{
- public class FileStream_CanTimeout : FileSystemTest
- {
- [Fact]
- public void CanTimeoutFalse()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- Assert.False(fs.CanTimeout);
- Assert.Throws(() => fs.ReadTimeout);
- Assert.Throws(() => fs.ReadTimeout = 1);
- Assert.Throws(() => fs.WriteTimeout);
- Assert.Throws(() => fs.WriteTimeout = 1);
- }
- }
- }
-}
diff --git a/src/libraries/System.IO.FileSystem/tests/FileStream/CanWrite.cs b/src/libraries/System.IO.FileSystem/tests/FileStream/CanWrite.cs
deleted file mode 100644
index 7a6b1371d332..000000000000
--- a/src/libraries/System.IO.FileSystem/tests/FileStream/CanWrite.cs
+++ /dev/null
@@ -1,51 +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;
-using Xunit;
-
-namespace System.IO.Tests
-{
- public class FileStream_CanWrite : FileSystemTest
- {
- [Fact]
- public void CanWriteTrueForWriteableStream()
- {
- string fileName = GetTestFilePath();
- using (FileStream fs = new FileStream(fileName, FileMode.Create, FileAccess.ReadWrite))
- {
- Assert.True(fs.CanWrite);
- }
-
- using (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Write))
- {
- Assert.True(fs.CanWrite);
- }
- }
-
- [Fact]
- public void CanWriteFalseForReadOnlyStream()
- {
- string fileName = GetTestFilePath();
- using (FileStream fs = new FileStream(fileName, FileMode.Create, FileAccess.ReadWrite))
- { }
-
- using (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read))
- {
- Assert.False(fs.CanWrite);
- }
- }
-
- [Fact]
- public void CanWriteFalseForDisposedStream()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- Assert.True(fs.CanWrite);
- fs.Dispose();
- Assert.False(fs.CanWrite);
- }
- }
- }
-}
diff --git a/src/libraries/System.IO.FileSystem/tests/FileStream/CopyToAsync.cs b/src/libraries/System.IO.FileSystem/tests/FileStream/CopyToAsync.cs
index 8a86be7e44dc..f059c49ab4ce 100644
--- a/src/libraries/System.IO.FileSystem/tests/FileStream/CopyToAsync.cs
+++ b/src/libraries/System.IO.FileSystem/tests/FileStream/CopyToAsync.cs
@@ -1,10 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using Microsoft.Win32.SafeHandles;
using System.Collections.Generic;
-using System.IO.Pipes;
-using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
using Xunit;
@@ -174,22 +171,5 @@ public override Task ReadAsync(byte[] buffer, int offset, int count, Cancel
return base.ReadAsync(buffer, offset, count, cancellationToken);
}
}
-
- #region Windows P/Invokes
- // We need to P/Invoke to test the named pipe async behavior with FileStream
- // because NamedPipeClientStream internally binds the created handle,
- // and that then prevents FileStream's constructor from working with the handle
- // when trying to set isAsync to true.
-
- [DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- [return: MarshalAs(UnmanagedType.Bool)]
- public static extern bool WaitNamedPipeW(string name, int timeout);
-
- [DllImport("kernel32.dll", CharSet = CharSet.Unicode, SetLastError = true)]
- internal static extern SafeFileHandle CreateFileW(
- string lpFileName, int dwDesiredAccess, FileShare dwShareMode,
- IntPtr securityAttrs, FileMode dwCreationDisposition, int dwFlagsAndAttributes, IntPtr hTemplateFile);
-
- #endregion
}
}
diff --git a/src/libraries/System.IO.FileSystem/tests/FileStream/Dispose.cs b/src/libraries/System.IO.FileSystem/tests/FileStream/Dispose.cs
index c87ac7870583..283cb3e8eddc 100644
--- a/src/libraries/System.IO.FileSystem/tests/FileStream/Dispose.cs
+++ b/src/libraries/System.IO.FileSystem/tests/FileStream/Dispose.cs
@@ -12,12 +12,6 @@ namespace System.IO.Tests
{
public class FileStream_Dispose : FileSystemTest
{
- [Fact]
- public void CanDispose()
- {
- new FileStream(GetTestFilePath(), FileMode.Create).Dispose();
- }
-
[Fact]
public void DisposeClosesHandle()
{
@@ -30,16 +24,6 @@ public void DisposeClosesHandle()
Assert.True(handle.IsClosed);
}
- [Fact]
- public void HandlesMultipleDispose()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- fs.Dispose();
- fs.Dispose();
- } // disposed as we leave using
- }
-
private class MyFileStream : FileStream
{
public MyFileStream(string path, FileMode mode)
diff --git a/src/libraries/System.IO.FileSystem/tests/FileStream/DisposeAsync.cs b/src/libraries/System.IO.FileSystem/tests/FileStream/DisposeAsync.cs
index 50e738b47130..8069173113cf 100644
--- a/src/libraries/System.IO.FileSystem/tests/FileStream/DisposeAsync.cs
+++ b/src/libraries/System.IO.FileSystem/tests/FileStream/DisposeAsync.cs
@@ -9,12 +9,6 @@ namespace System.IO.Tests
{
public class FileStream_DisposeAsync : FileSystemTest
{
- [Fact]
- public void CanDisposeAsync()
- {
- Assert.True(new FileStream(GetTestFilePath(), FileMode.Create).DisposeAsync().IsCompletedSuccessfully);
- }
-
[Fact]
public async Task DisposeAsyncClosesHandle()
{
@@ -25,15 +19,6 @@ public async Task DisposeAsyncClosesHandle()
Assert.True(handle.IsClosed);
}
- [Fact]
- public async Task HandlesMultipleDisposeAsync()
- {
- var fs = new FileStream(GetTestFilePath(), FileMode.Create);
- await fs.DisposeAsync();
- fs.Dispose();
- await fs.DisposeAsync();
- }
-
[Fact]
public async Task DisposeAsyncFlushes()
{
diff --git a/src/libraries/System.IO.FileSystem/tests/FileStream/FileStreamConformanceTests.cs b/src/libraries/System.IO.FileSystem/tests/FileStream/FileStreamConformanceTests.cs
new file mode 100644
index 000000000000..ebf7d91aee7b
--- /dev/null
+++ b/src/libraries/System.IO.FileSystem/tests/FileStream/FileStreamConformanceTests.cs
@@ -0,0 +1,110 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+
+using Microsoft.Win32.SafeHandles;
+using System.IO.Pipes;
+using System.Threading.Tasks;
+using Xunit;
+
+namespace System.IO.Tests
+{
+ public abstract class FileStreamStandaloneConformanceTests : StandaloneStreamConformanceTests
+ {
+ protected abstract FileOptions Options { get; }
+ protected abstract int BufferSize { get; }
+
+ private Task CreateStream(byte[] initialData, FileAccess access)
+ {
+ string path = GetTestFilePath();
+ if (initialData != null)
+ {
+ File.WriteAllBytes(path, initialData);
+ }
+
+ return Task.FromResult(new FileStream(path, FileMode.OpenOrCreate, access, FileShare.None, BufferSize, Options));
+ }
+
+ protected override Task CreateReadOnlyStreamCore(byte[] initialData) => CreateStream(initialData, FileAccess.Read);
+ protected override Task CreateReadWriteStreamCore(byte[] initialData) => CreateStream(initialData, FileAccess.ReadWrite);
+ protected override Task CreateWriteOnlyStreamCore(byte[] initialData) => CreateStream(initialData, FileAccess.Write);
+
+ protected override bool NopFlushCompletesSynchronously => OperatingSystem.IsWindows();
+ }
+
+ public class UnbufferedSyncFileStreamStandaloneConformanceTests : FileStreamStandaloneConformanceTests
+ {
+ protected override FileOptions Options => FileOptions.None;
+ protected override int BufferSize => 1;
+ }
+
+ public class BufferedSyncFileStreamStandaloneConformanceTests : FileStreamStandaloneConformanceTests
+ {
+ protected override FileOptions Options => FileOptions.None;
+ protected override int BufferSize => 10;
+ }
+
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/34583", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
+ [PlatformSpecific(~TestPlatforms.Browser)] // copied from base class due to https://github.com/xunit/xunit/issues/2186
+ public class UnbufferedAsyncFileStreamStandaloneConformanceTests : FileStreamStandaloneConformanceTests
+ {
+ protected override FileOptions Options => FileOptions.Asynchronous;
+ protected override int BufferSize => 1;
+ }
+
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/34583", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
+ [PlatformSpecific(~TestPlatforms.Browser)] // copied from base class due to https://github.com/xunit/xunit/issues/2186
+ public class BufferedAsyncFileStreamStandaloneConformanceTests : FileStreamStandaloneConformanceTests
+ {
+ protected override FileOptions Options => FileOptions.Asynchronous;
+ protected override int BufferSize => 10;
+ }
+
+ public class AnonymousPipeFileStreamConnectedConformanceTests : ConnectedStreamConformanceTests
+ {
+ protected override Task CreateConnectedStreamsAsync()
+ {
+ var server = new AnonymousPipeServerStream(PipeDirection.Out);
+
+ var fs1 = new FileStream(new SafeFileHandle(server.SafePipeHandle.DangerousGetHandle(), true), FileAccess.Write);
+ var fs2 = new FileStream(new SafeFileHandle(server.ClientSafePipeHandle.DangerousGetHandle(), true), FileAccess.Read);
+
+ server.SafePipeHandle.SetHandleAsInvalid();
+ server.ClientSafePipeHandle.SetHandleAsInvalid();
+
+ return Task.FromResult((fs1, fs2));
+ }
+
+ protected override Type UnsupportedConcurrentExceptionType => null;
+ protected override bool UsableAfterCanceledReads => false;
+ protected override bool FullyCancelableOperations => false;
+ protected override bool BlocksOnZeroByteReads => OperatingSystem.IsWindows();
+ protected override bool SupportsConcurrentBidirectionalUse => false;
+ }
+
+ public class NamedPipeFileStreamConnectedConformanceTests : ConnectedStreamConformanceTests
+ {
+ protected override async Task CreateConnectedStreamsAsync()
+ {
+ string name = FileSystemTest.GetNamedPipeServerStreamName();
+
+ var server = new NamedPipeServerStream(name, PipeDirection.In);
+ var client = new NamedPipeClientStream(".", name, PipeDirection.Out);
+
+ await WhenAllOrAnyFailed(server.WaitForConnectionAsync(), client.ConnectAsync());
+
+ var fs1 = new FileStream(new SafeFileHandle(server.SafePipeHandle.DangerousGetHandle(), true), FileAccess.Read);
+ var fs2 = new FileStream(new SafeFileHandle(client.SafePipeHandle.DangerousGetHandle(), true), FileAccess.Write);
+
+ server.SafePipeHandle.SetHandleAsInvalid();
+ client.SafePipeHandle.SetHandleAsInvalid();
+
+ return (fs1, fs2);
+ }
+
+ protected override Type UnsupportedConcurrentExceptionType => null;
+ protected override bool UsableAfterCanceledReads => false;
+ protected override bool FullyCancelableOperations => false;
+ protected override bool BlocksOnZeroByteReads => OperatingSystem.IsWindows();
+ protected override bool SupportsConcurrentBidirectionalUse => false;
+ }
+}
diff --git a/src/libraries/System.IO.FileSystem/tests/FileStream/FlushAsync.cs b/src/libraries/System.IO.FileSystem/tests/FileStream/FlushAsync.cs
index 7d1255be2c4f..327f942a9a7a 100644
--- a/src/libraries/System.IO.FileSystem/tests/FileStream/FlushAsync.cs
+++ b/src/libraries/System.IO.FileSystem/tests/FileStream/FlushAsync.cs
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System.Threading;
using System.Threading.Tasks;
using Xunit;
@@ -9,43 +8,6 @@ namespace System.IO.Tests
{
public partial class FileStream_FlushAsync : FileSystemTest
{
- [Fact]
- public async Task FlushAsyncThrowsForDisposedStream()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- fs.Dispose();
- await Assert.ThrowsAsync(() => fs.FlushAsync());
- }
- }
-
- [Fact]
- public async Task BasicFlushAsyncFunctionality()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- fs.WriteByte(0);
- await fs.FlushAsync();
-
- fs.WriteByte(0xFF);
- await fs.FlushAsync();
- }
- }
-
- [Fact]
- public async Task FlushAsyncWhenNothingToFlush()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- fs.WriteByte(0);
- await fs.FlushAsync();
-
- await fs.FlushAsync();
- await fs.FlushAsync();
- await fs.FlushAsync();
- }
- }
-
[Fact]
public async Task FlushAsyncOnReadOnlyFileDoesNotThrow()
{
@@ -65,18 +27,6 @@ public async Task FlushAsyncOnReadOnlyFileDoesNotThrow()
}
}
- [Fact]
- public async Task FlushAfterReading()
- {
- string fileName = GetTestFilePath();
- File.WriteAllBytes(fileName, TestBuffer);
- using (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite, 2))
- {
- Assert.Equal(TestBuffer[0], fs.ReadByte());
- await fs.FlushAsync();
- }
- }
-
[Fact]
public async Task FlushAsyncWriteWithOtherClient()
{
@@ -101,15 +51,5 @@ public async Task FlushAsyncWriteWithOtherClient()
Assert.Equal(TestBuffer, buffer);
}
}
-
- [Fact]
- public void FlushAsyncWithCanceledToken()
- {
- using (FileStream fs = File.OpenWrite(GetTestFilePath()))
- {
- Assert.True(fs.FlushAsync(new CancellationToken(true)).IsCanceled);
- }
- }
-
}
}
diff --git a/src/libraries/System.IO.FileSystem/tests/FileStream/Length.cs b/src/libraries/System.IO.FileSystem/tests/FileStream/Length.cs
deleted file mode 100644
index 28660d850d55..000000000000
--- a/src/libraries/System.IO.FileSystem/tests/FileStream/Length.cs
+++ /dev/null
@@ -1,68 +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;
-using Xunit;
-
-namespace System.IO.Tests
-{
- public class FileStream_Length : FileSystemTest
- {
- [Fact]
- public void GetLengthDisposedThrows()
- {
- string fileName = GetTestFilePath();
- using (FileStream fs = new FileStream(fileName, FileMode.Create))
- {
- fs.Dispose();
- Assert.Throws(() => fs.Length);
- }
- }
-
- [Fact]
- public void GetLengthUnseekableThrows()
- {
- string fileName = GetTestFilePath();
- using (FileStream fs = new UnseekableFileStream(fileName, FileMode.Create))
- {
- Assert.Throws(() => fs.Length);
- // dispose checking happens first
- fs.Dispose();
- Assert.Throws(() => fs.Length);
- }
- }
-
- [Fact]
- public void EmptyFile()
- {
- string fileName = GetTestFilePath();
- using (FileStream fs = new FileStream(fileName, FileMode.Create))
- {
- Assert.Equal(0, fs.Length);
- }
-
- using (FileStream fs = new FileStream(fileName, FileMode.Open))
- {
- Assert.Equal(0, fs.Length);
- }
- }
-
- [Fact]
- public void NonEmptyFile()
- {
- string fileName = GetTestFilePath();
- using (FileStream fs = new FileStream(fileName, FileMode.Create))
- {
- fs.Write(TestBuffer, 0, TestBuffer.Length);
- Assert.Equal(TestBuffer.Length, fs.Length);
- }
-
- using (FileStream fs = new FileStream(fileName, FileMode.Open))
- {
- Assert.Equal(TestBuffer.Length, fs.Length);
- }
-
- }
- }
-}
diff --git a/src/libraries/System.IO.FileSystem/tests/FileStream/LockUnlock.cs b/src/libraries/System.IO.FileSystem/tests/FileStream/LockUnlock.cs
index cec61a4d5cb9..1da23bf4c082 100644
--- a/src/libraries/System.IO.FileSystem/tests/FileStream/LockUnlock.cs
+++ b/src/libraries/System.IO.FileSystem/tests/FileStream/LockUnlock.cs
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System.Diagnostics;
using Microsoft.DotNet.RemoteExecutor;
using Xunit;
@@ -72,6 +71,22 @@ public void Lock_Unlock_Successful(long fileLength, long position, long length)
}
}
+ [Theory]
+ [InlineData(FileAccess.Read)]
+ [InlineData(FileAccess.Write)]
+ [InlineData(FileAccess.ReadWrite)]
+ [PlatformSpecific(~TestPlatforms.OSX)]
+ public void Lock_Unlock_Successful_AlternateFileAccess(FileAccess fileAccess)
+ {
+ string path = GetTestFilePath();
+ File.WriteAllBytes(path, new byte[100]);
+
+ using FileStream fs = File.Open(path, FileMode.Open, fileAccess);
+
+ fs.Lock(0, 100);
+ fs.Unlock(0, 100);
+ }
+
[Theory]
[InlineData(10, 0, 2, 3, 5)]
[PlatformSpecific(~TestPlatforms.OSX)]
@@ -153,9 +168,7 @@ public void OverlappingRegionsFromSameProcess_AllowedOnUnix(long fileLength, lon
}
}
- private static bool IsNotWindowsSubsystemForLinuxAndRemoteExecutorSupported => PlatformDetection.IsNotWindowsSubsystemForLinux && RemoteExecutor.IsSupported;
-
- [ConditionalTheory(nameof(IsNotWindowsSubsystemForLinuxAndRemoteExecutorSupported))] // https://github.com/dotnet/runtime/issues/28330
+ [ConditionalTheory(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))]
[InlineData(10, 0, 10, 1, 2)]
[InlineData(10, 3, 5, 3, 5)]
[InlineData(10, 3, 5, 3, 4)]
@@ -192,5 +205,57 @@ public void OverlappingRegionsFromOtherProcess_ThrowsException(long fileLength,
}, path, secondPosition.ToString(), secondLength.ToString()).Dispose();
}
}
+
+ [ConditionalFact(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))]
+ [PlatformSpecific(TestPlatforms.Linux)]
+ public void OverlappingRegionsFromOtherProcess_With_ReadLock_AllowedOnLinux()
+ {
+ string path = GetTestFilePath();
+ File.WriteAllBytes(path, new byte[100]);
+
+ using FileStream fs1 = File.Open(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
+ fs1.Lock(0, 100);
+
+ RemoteExecutor.Invoke((path) =>
+ {
+ using FileStream fs2 = File.Open(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
+ fs2.Lock(0, 100);
+ fs2.Unlock(0, 100);
+
+ }, path).Dispose();
+
+ fs1.Unlock(0, 100);
+ }
+
+ [ConditionalTheory(typeof(RemoteExecutor), nameof(RemoteExecutor.IsSupported))]
+ [InlineData(FileAccess.Read)]
+ [InlineData(FileAccess.Write)]
+ [InlineData(FileAccess.ReadWrite)]
+ [PlatformSpecific(~TestPlatforms.OSX)]
+ public void OverlappingRegionsFromOtherProcess_With_WriteLock_ThrowsException(FileAccess fileAccess)
+ {
+ string path = GetTestFilePath();
+ File.WriteAllBytes(path, new byte[100]);
+
+ using FileStream fs1 = File.Open(path, FileMode.Open, fileAccess, FileShare.ReadWrite);
+ fs1.Lock(0, 100);
+
+ RemoteExecutor.Invoke((path) =>
+ {
+ using FileStream fs2 = File.Open(path, FileMode.Open, FileAccess.Write, FileShare.ReadWrite);
+ Assert.Throws(() => fs2.Lock(0, 100));
+
+ }, path).Dispose();
+
+ fs1.Unlock(0, 100);
+
+ RemoteExecutor.Invoke((path) =>
+ {
+ using FileStream fs2 = File.Open(path, FileMode.Open, FileAccess.Write, FileShare.ReadWrite);
+ fs2.Lock(0, 100);
+ fs2.Unlock(0, 100);
+
+ }, path).Dispose();
+ }
}
}
diff --git a/src/libraries/System.IO.FileSystem/tests/FileStream/Pipes.cs b/src/libraries/System.IO.FileSystem/tests/FileStream/Pipes.cs
deleted file mode 100644
index d4312b5055b8..000000000000
--- a/src/libraries/System.IO.FileSystem/tests/FileStream/Pipes.cs
+++ /dev/null
@@ -1,59 +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 Microsoft.Win32.SafeHandles;
-using System.IO.Pipes;
-using System.Threading.Tasks;
-using Xunit;
-
-namespace System.IO.Tests
-{
- public class AnonymousPipeFileStreamConformanceTests : ConnectedStreamConformanceTests
- {
- protected override Task CreateConnectedStreamsAsync()
- {
- var server = new AnonymousPipeServerStream(PipeDirection.Out);
-
- var fs1 = new FileStream(new SafeFileHandle(server.SafePipeHandle.DangerousGetHandle(), true), FileAccess.Write);
- var fs2 = new FileStream(new SafeFileHandle(server.ClientSafePipeHandle.DangerousGetHandle(), true), FileAccess.Read);
-
- server.SafePipeHandle.SetHandleAsInvalid();
- server.ClientSafePipeHandle.SetHandleAsInvalid();
-
- return Task.FromResult((fs1, fs2));
- }
-
- protected override Type UnsupportedConcurrentExceptionType => null;
- protected override bool UsableAfterCanceledReads => false;
- protected override bool FullyCancelableOperations => false;
- protected override bool BlocksOnZeroByteReads => OperatingSystem.IsWindows();
- protected override bool SupportsConcurrentBidirectionalUse => false;
- }
-
- public class NamedPipeFileStreamConformanceTests : ConnectedStreamConformanceTests
- {
- protected override async Task CreateConnectedStreamsAsync()
- {
- string name = FileSystemTest.GetNamedPipeServerStreamName();
-
- var server = new NamedPipeServerStream(name, PipeDirection.In);
- var client = new NamedPipeClientStream(".", name, PipeDirection.Out);
-
- await WhenAllOrAnyFailed(server.WaitForConnectionAsync(), client.ConnectAsync());
-
- var fs1 = new FileStream(new SafeFileHandle(server.SafePipeHandle.DangerousGetHandle(), true), FileAccess.Read);
- var fs2 = new FileStream(new SafeFileHandle(client.SafePipeHandle.DangerousGetHandle(), true), FileAccess.Write);
-
- server.SafePipeHandle.SetHandleAsInvalid();
- client.SafePipeHandle.SetHandleAsInvalid();
-
- return (fs1, fs2);
- }
-
- protected override Type UnsupportedConcurrentExceptionType => null;
- protected override bool UsableAfterCanceledReads => false;
- protected override bool FullyCancelableOperations => false;
- protected override bool BlocksOnZeroByteReads => OperatingSystem.IsWindows();
- protected override bool SupportsConcurrentBidirectionalUse => false;
- }
-}
diff --git a/src/libraries/System.IO.FileSystem/tests/FileStream/Position.cs b/src/libraries/System.IO.FileSystem/tests/FileStream/Position.cs
index 2a9b2437522e..364e3c95b76a 100644
--- a/src/libraries/System.IO.FileSystem/tests/FileStream/Position.cs
+++ b/src/libraries/System.IO.FileSystem/tests/FileStream/Position.cs
@@ -1,76 +1,12 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-using System.IO;
using Xunit;
namespace System.IO.Tests
{
public class FileStream_Position : FileSystemTest
{
- [Fact]
- public void GetPositionDisposedThrows()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- fs.Dispose();
- Assert.Throws(() => fs.Position);
- }
- }
-
- [Fact]
- public void GetPositionUnseekableThrows()
- {
- using (FileStream fs = new UnseekableFileStream(GetTestFilePath(), FileMode.Create))
- {
- Assert.Throws(() => fs.Position);
- // dispose checking happens first
- fs.Dispose();
- Assert.Throws(() => fs.Position);
- }
- }
-
- [Fact]
- public void SetPositionInvalidThrows()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- AssertExtensions.Throws("value", () => fs.Position = -1);
- AssertExtensions.Throws("value", () => fs.Position = long.MinValue);
- }
- }
-
- [Fact]
- public void SetPositionDisposedThrows()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- fs.Dispose();
- Assert.Throws(() => fs.Position = 1);
- // no fast path
- Assert.Throws(() => fs.Position = fs.Position);
- // parameter checking happens first
- AssertExtensions.Throws("value", () => fs.Position = -1);
- }
- }
-
- [Fact]
- public void SetPositionUnseekableThrows()
- {
- using (FileStream fs = new UnseekableFileStream(GetTestFilePath(), FileMode.Create))
- {
- Assert.Throws(() => fs.Position = 1);
- // no fast path
- Assert.Throws(() => fs.Position = fs.Position);
- // parameter checking happens first
- AssertExtensions.Throws("value", () => fs.Position = -1);
- // dispose checking happens first
- fs.Dispose();
- Assert.Throws(() => fs.Position = 1);
- }
- }
-
[Fact]
public void SetPositionAppendModify()
{
@@ -92,79 +28,5 @@ public void SetPositionAppendModify()
Assert.Equal(length + 1, fs.Position);
}
}
-
- [Fact]
- public void ValidPositions()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- fs.Write(TestBuffer, 0, TestBuffer.Length);
-
- fs.Position = 0;
- Assert.Equal(0, fs.Position);
-
- // End
- fs.Position = fs.Length;
- Assert.Equal(fs.Length, fs.Position);
-
- // Middle
- fs.Position = fs.Length / 2;
- Assert.Equal(fs.Length / 2, fs.Position);
-
- // Make sure that a noop change doesn't modify position
- fs.Position = fs.Position;
- Assert.Equal(fs.Length / 2, fs.Position);
-
- // Past the end, making sure the file length doesn't change by doing so
- long length = fs.Length;
- fs.Position = length * 2;
- Assert.Equal(length, fs.Length);
- Assert.Equal(length * 2, fs.Position);
- }
- }
-
- [Fact]
- public void PositionPastEnd()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- fs.Write(TestBuffer, 0, TestBuffer.Length);
-
- // Ensure our test is set up correctly
- Assert.Equal(TestBuffer.Length, fs.Length);
- Assert.Equal(TestBuffer.Length, fs.Position);
-
- // Move past end
- fs.Position = fs.Length + 1;
- Assert.Equal(TestBuffer.Length + 1, fs.Position);
- // Length is not updated until a write
- Assert.Equal(TestBuffer.Length, fs.Length);
-
- // At end of stream
- Assert.Equal(-1, fs.ReadByte());
- // Read should not update position or length
- Assert.Equal(TestBuffer.Length + 1, fs.Position);
- Assert.Equal(TestBuffer.Length, fs.Length);
-
- // Move back one, still at end of stream since length hasn't changed
- fs.Position--;
- Assert.Equal(-1, fs.ReadByte());
- // Read should not update position or length
- Assert.Equal(TestBuffer.Length, fs.Position);
- Assert.Equal(TestBuffer.Length, fs.Length);
-
- // Move past end
- fs.Position = fs.Length + 1;
- fs.WriteByte(0x2A);
- // Writing a single byte should update length by 2 (filling gap with zero).
- Assert.Equal(TestBuffer.Length + 2, fs.Position);
- Assert.Equal(TestBuffer.Length + 2, fs.Length);
- // Validate zero fill
- fs.Position -= 2;
- Assert.Equal(0, fs.ReadByte());
- // Validate written value
- Assert.Equal(0x2A, fs.ReadByte());
- }
- }
}
}
diff --git a/src/libraries/System.IO.FileSystem/tests/FileStream/Read.cs b/src/libraries/System.IO.FileSystem/tests/FileStream/Read.cs
index 74b39ee6d4bc..b6c555920bca 100644
--- a/src/libraries/System.IO.FileSystem/tests/FileStream/Read.cs
+++ b/src/libraries/System.IO.FileSystem/tests/FileStream/Read.cs
@@ -1,8 +1,6 @@
// 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.Linq;
using Xunit;
@@ -16,117 +14,5 @@ public void NegativeReadRootThrows()
Assert.Throws(() =>
new FileStream(Path.GetPathRoot(Directory.GetCurrentDirectory()), FileMode.Open, FileAccess.Read));
}
-
- [Fact]
- public void ReadDisposedThrows()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- fs.Dispose();
- Assert.Throws(() => fs.Read(new byte[1], 0, 1));
- // even for noop read
- Assert.Throws(() => fs.Read(new byte[1], 0, 0));
-
- // out of bounds checking happens first
- Assert.Throws(() => fs.Read(new byte[2], 1, 2));
-
- // count is checked prior
- AssertExtensions.Throws("count", () => fs.Read(new byte[1], 0, -1));
-
- // offset is checked prior
- AssertExtensions.Throws("offset", () => fs.Read(new byte[1], -1, -1));
-
- // array is checked first
- AssertExtensions.Throws("buffer", () => fs.Read(null, -1, -1));
- }
- }
-
- [Fact]
- public void WriteOnlyThrows()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create, FileAccess.Write))
- {
- Assert.Throws(() => fs.Read(new byte[1], 0, 1));
-
- fs.Dispose();
- // Disposed checking happens first
- Assert.Throws(() => fs.Read(new byte[1], 0, 1));
-
- // out of bounds checking happens first
- Assert.Throws(() => fs.Read(new byte[2], 1, 2));
- }
- }
-
- [Fact]
- public void NoopReadsSucceed()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- Assert.Equal(0, fs.Read(new byte[0], 0, 0));
- Assert.Equal(0, fs.Read(new byte[1], 0, 0));
- // even though offset is out of bounds of array, this is still allowed
- // for the last element
- Assert.Equal(0, fs.Read(new byte[1], 1, 0));
- Assert.Equal(0, fs.Read(new byte[2], 1, 0));
- }
- }
-
- [Fact]
- public void EmptyFileReadsSucceed()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- byte[] buffer = new byte[TestBuffer.Length];
-
- // use a recognizable pattern
- TestBuffer.CopyTo(buffer, 0);
-
- Assert.Equal(0, fs.Read(buffer, 0, 1));
- Assert.Equal(TestBuffer, buffer);
-
- Assert.Equal(0, fs.Read(buffer, 0, buffer.Length));
- Assert.Equal(TestBuffer, buffer);
-
- Assert.Equal(0, fs.Read(buffer, buffer.Length - 1, 1));
- Assert.Equal(TestBuffer, buffer);
-
- Assert.Equal(0, fs.Read(buffer, buffer.Length / 2, buffer.Length - buffer.Length / 2));
- Assert.Equal(TestBuffer, buffer);
- }
- }
-
- [Fact]
- public void ReadExistingFile()
- {
- string fileName = GetTestFilePath();
- using (FileStream fs = new FileStream(fileName, FileMode.Create))
- {
- fs.Write(TestBuffer, 0, TestBuffer.Length);
- }
-
- using (FileStream fs = new FileStream(fileName, FileMode.Open))
- {
- byte[] buffer = new byte[TestBuffer.Length];
- Assert.Equal(TestBuffer.Length, fs.Read(buffer, 0, buffer.Length));
- Assert.Equal(TestBuffer, buffer);
-
- // read with too large buffer at front of buffer
- fs.Position = 0;
- buffer = new byte[TestBuffer.Length * 2];
- Assert.Equal(TestBuffer.Length, fs.Read(buffer, 0, buffer.Length));
- Assert.Equal(TestBuffer, buffer.Take(TestBuffer.Length));
- // Remainder of buffer should be untouched.
- Assert.Equal(new byte[buffer.Length - TestBuffer.Length], buffer.Skip(TestBuffer.Length));
-
- // read with too large buffer in middle of buffer
- fs.Position = 0;
- buffer = new byte[TestBuffer.Length * 2];
- Assert.Equal(TestBuffer.Length, fs.Read(buffer, 2, buffer.Length - 2));
- Assert.Equal(TestBuffer, buffer.Skip(2).Take(TestBuffer.Length));
- // Remainder of buffer should be untouched.
- Assert.Equal(new byte[2], buffer.Take(2));
- Assert.Equal(new byte[buffer.Length - TestBuffer.Length - 2], buffer.Skip(2 + TestBuffer.Length));
- }
- }
}
}
diff --git a/src/libraries/System.IO.FileSystem/tests/FileStream/ReadAsync.cs b/src/libraries/System.IO.FileSystem/tests/FileStream/ReadAsync.cs
index 6075cfbfd21d..ceea76e50dd9 100644
--- a/src/libraries/System.IO.FileSystem/tests/FileStream/ReadAsync.cs
+++ b/src/libraries/System.IO.FileSystem/tests/FileStream/ReadAsync.cs
@@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Xunit;
@@ -10,63 +9,7 @@ namespace System.IO.Tests
{
public abstract class FileStream_AsyncReads : FileSystemTest
{
- protected abstract Task ReadAsync(FileStream stream, byte[] buffer, int offset, int count, CancellationToken cancellationToken);
- private Task ReadAsync(FileStream stream, byte[] buffer, int offset, int count) =>
- ReadAsync(stream, buffer, offset, count, CancellationToken.None);
-
- [Fact]
- public void ReadAsyncDisposedThrows()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- fs.Dispose();
- Assert.Throws(() =>
- FSAssert.CompletesSynchronously(ReadAsync(fs, new byte[1], 0, 1)));
-
- // even for noop ReadAsync
- Assert.Throws(() =>
- FSAssert.CompletesSynchronously(ReadAsync(fs, new byte[1], 0, 0)));
-
- // out of bounds checking happens first
- Assert.Throws(() =>
- FSAssert.CompletesSynchronously(ReadAsync(fs, new byte[2], 1, 2)));
- }
- }
-
- [Fact]
- public void WriteOnlyThrows()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create, FileAccess.Write))
- {
- Assert.Throws(() =>
- FSAssert.CompletesSynchronously(ReadAsync(fs, new byte[1], 0, 1)));
-
- fs.Dispose();
- // Disposed checking happens first
- Assert.Throws(() =>
- FSAssert.CompletesSynchronously(ReadAsync(fs, new byte[1], 0, 1)));
-
- // out of bounds checking happens first
- Assert.Throws(() =>
- FSAssert.CompletesSynchronously(ReadAsync(fs, new byte[2], 1, 2)));
- }
- }
-
- [Fact]
- public async Task NoopReadAsyncsSucceed()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- // note that these do not succeed synchronously even though they do nothing.
-
- Assert.Equal(0, await ReadAsync(fs, new byte[0], 0, 0));
- Assert.Equal(0, await ReadAsync(fs, new byte[1], 0, 0));
- // even though offset is out of bounds of buffer, this is still allowed
- // for the last element
- Assert.Equal(0, await ReadAsync(fs, new byte[1], 1, 0));
- Assert.Equal(0, await ReadAsync(fs, new byte[2], 1, 0));
- }
- }
+ protected abstract Task ReadAsync(FileStream stream, byte[] buffer, int offset, int count, CancellationToken cancellationToken = default);
[Fact]
public async Task EmptyFileReadAsyncSucceedSynchronously()
@@ -120,40 +63,6 @@ public async Task ReadAsyncBufferedCompletesSynchronously()
}
}
- [Fact]
- public async Task ReadAsyncExistingFile()
- {
- string fileName = GetTestFilePath();
- using (FileStream fs = new FileStream(fileName, FileMode.Create))
- {
- fs.Write(TestBuffer, 0, TestBuffer.Length);
- }
-
- using (FileStream fs = new FileStream(fileName, FileMode.Open))
- {
- byte[] buffer = new byte[TestBuffer.Length];
- Assert.Equal(TestBuffer.Length, await ReadAsync(fs, buffer, 0, buffer.Length));
- Assert.Equal(TestBuffer, buffer);
-
- // ReadAsync with too large buffer at front of buffer
- fs.Position = 0;
- buffer = new byte[TestBuffer.Length * 2];
- Assert.Equal(TestBuffer.Length, await ReadAsync(fs, buffer, 0, buffer.Length));
- Assert.Equal(TestBuffer, buffer.Take(TestBuffer.Length));
- // Remainder of buffer should be untouched.
- Assert.Equal(new byte[buffer.Length - TestBuffer.Length], buffer.Skip(TestBuffer.Length));
-
- // ReadAsync with too large buffer in middle of buffer
- fs.Position = 0;
- buffer = new byte[TestBuffer.Length * 2];
- Assert.Equal(TestBuffer.Length, await ReadAsync(fs, buffer, 2, buffer.Length - 2));
- Assert.Equal(TestBuffer, buffer.Skip(2).Take(TestBuffer.Length));
- // Remainder of buffer should be untouched.
- Assert.Equal(new byte[2], buffer.Take(2));
- Assert.Equal(new byte[buffer.Length - TestBuffer.Length - 2], buffer.Skip(2 + TestBuffer.Length));
- }
- }
-
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
public async Task ReadAsyncCanceledFile()
{
@@ -183,81 +92,6 @@ public async Task ReadAsyncCanceledFile()
}
}
}
-
- [Fact, OuterLoop]
- public async Task ReadAsyncMiniStress()
- {
- TimeSpan testRunTime = TimeSpan.FromSeconds(10);
- const int MaximumReadSize = 16 * 1024;
- const int NormalReadSize = 4 * 1024;
-
- Random rand = new Random();
- DateTime testStartTime = DateTime.UtcNow;
-
- // Generate file data
- byte[] readableFileContents = new byte[MaximumReadSize * 16];
- rand.NextBytes(readableFileContents);
-
- // Create and fill file
- string readableFilePath = GetTestFilePath();
- using (var stream = new FileStream(readableFilePath, FileMode.CreateNew, FileAccess.Write))
- {
- await stream.WriteAsync(readableFileContents, 0, readableFileContents.Length);
- }
-
- using (var stream = new FileStream(readableFilePath, FileMode.Open, FileAccess.Read))
- {
- // Create a new token that expires between 100-1000ms
- CancellationTokenSource tokenSource = new CancellationTokenSource();
- tokenSource.CancelAfter(rand.Next(100, 1000));
-
- int currentPosition = 0;
- byte[] buffer = new byte[MaximumReadSize];
- do
- {
- try
- {
- // 20%: random read size
- int bytesToRead = (rand.NextDouble() < 0.2 ? rand.Next(16, MaximumReadSize) : NormalReadSize);
-
- int bytesRead;
- if (rand.NextDouble() < 0.1)
- {
- // 10%: Sync read
- bytesRead = stream.Read(buffer, 0, bytesToRead);
- }
- else
- {
- // 90%: Async read
- bytesRead = await ReadAsync(stream, buffer, 0, bytesToRead, tokenSource.Token);
- }
-
- // 10%: Verify data (burns a lot of CPU time)
- if (rand.NextDouble() < 0.1)
- {
- // Validate data read
- Assert.True(bytesRead + currentPosition <= readableFileContents.Length, "Too many bytes read");
- Assert.Equal(readableFileContents.Skip(currentPosition).Take(bytesRead), buffer.Take(bytesRead));
- }
-
- // Advance position and reset if we are at the end
- currentPosition += bytesRead;
- if (currentPosition >= readableFileContents.Length)
- {
- currentPosition = 0;
- stream.Seek(0, SeekOrigin.Begin);
- }
- }
- catch (TaskCanceledException)
- {
- // Once the token has expired, generate a new one
- Assert.True(tokenSource.Token.IsCancellationRequested, "Received cancellation exception before token expired");
- tokenSource = new CancellationTokenSource();
- tokenSource.CancelAfter(rand.Next(100, 1000));
- }
- } while (DateTime.UtcNow - testStartTime <= testRunTime);
- }
- }
}
[ActiveIssue("https://github.com/dotnet/runtime/issues/34583", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
@@ -265,34 +99,6 @@ public class FileStream_ReadAsync_AsyncReads : FileStream_AsyncReads
{
protected override Task ReadAsync(FileStream stream, byte[] buffer, int offset, int count, CancellationToken cancellationToken) =>
stream.ReadAsync(buffer, offset, count, cancellationToken);
-
- [Fact]
- public void CancelledTokenFastPath()
- {
- var cts = new CancellationTokenSource();
- cts.Cancel();
- CancellationToken cancelledToken = cts.Token;
-
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- FSAssert.IsCancelled(ReadAsync(fs, new byte[1], 0, 1, cancelledToken), cancelledToken);
- }
-
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create, FileAccess.Write))
- {
- // before write only check
- FSAssert.IsCancelled(ReadAsync(fs, new byte[1], 0, 1, cancelledToken), cancelledToken);
-
- fs.Dispose();
-
- // before disposed check
- FSAssert.IsCancelled(ReadAsync(fs, new byte[1], 0, 1, cancelledToken), cancelledToken);
-
- // out of bounds checking happens first
- Assert.Throws(() =>
- FSAssert.CompletesSynchronously(ReadAsync(fs, new byte[2], 1, 2, cancelledToken)));
- }
- }
}
[ActiveIssue("https://github.com/dotnet/runtime/issues/34583", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
diff --git a/src/libraries/System.IO.FileSystem/tests/FileStream/ReadByte.cs b/src/libraries/System.IO.FileSystem/tests/FileStream/ReadByte.cs
deleted file mode 100644
index d8e2374e2e2e..000000000000
--- a/src/libraries/System.IO.FileSystem/tests/FileStream/ReadByte.cs
+++ /dev/null
@@ -1,68 +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;
-using System.Linq;
-using Xunit;
-
-namespace System.IO.Tests
-{
- public class FileStream_ReadByte : FileSystemTest
- {
-
- [Fact]
- public void ReadDisposedThrows()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- fs.Dispose();
- Assert.Throws(() => fs.ReadByte());
- }
- }
-
- [Fact]
- public void WriteOnlyThrows()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create, FileAccess.Write))
- {
- Assert.Throws(() => fs.ReadByte());
-
- fs.Dispose();
- // Disposed checking happens first
- Assert.Throws(() => fs.ReadByte());
- }
- }
-
- [Fact]
- public void EmptyFileReads()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- Assert.Equal(-1, fs.ReadByte());
- }
- }
-
-
- [Fact]
- public void ReadEntireFile()
- {
- string fileName = GetTestFilePath();
- using (FileStream fs = new FileStream(fileName, FileMode.Create))
- {
- fs.Write(TestBuffer, 0, TestBuffer.Length);
- }
-
- using (FileStream fs = new FileStream(fileName, FileMode.Open))
- {
- for (int i = 0; i < TestBuffer.Length; i++)
- {
- Assert.Equal(TestBuffer[i], fs.ReadByte());
- }
-
- // end of stream
- Assert.Equal(-1, fs.ReadByte());
- }
- }
- }
-}
diff --git a/src/libraries/System.IO.FileSystem/tests/FileStream/ReadWriteSpan.cs b/src/libraries/System.IO.FileSystem/tests/FileStream/ReadWriteSpan.cs
index 4d66807a3c99..7cebea9b8d50 100644
--- a/src/libraries/System.IO.FileSystem/tests/FileStream/ReadWriteSpan.cs
+++ b/src/libraries/System.IO.FileSystem/tests/FileStream/ReadWriteSpan.cs
@@ -1,307 +1,18 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System.Buffers;
-using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Xunit;
namespace System.IO.Tests
{
- [ActiveIssue("https://github.com/dotnet/runtime/issues/34583", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
- public abstract class FileStream_ReadWrite_Span : FileSystemTest
+ public sealed class Sync_DerivedFileStream_ReadWrite_Span : FileSystemTest
{
- protected abstract FileStream CreateFileStream(string path, FileMode mode, FileAccess access = FileAccess.ReadWrite);
-
- [Fact]
- public void DisposedStream_ReadWrite_Throws()
- {
- var fs = CreateFileStream(GetTestFilePath(), FileMode.Create);
- fs.Dispose();
- Assert.Throws(() => fs.Read(new Span(new byte[1])));
- Assert.Throws(() => fs.Write(new Span(new byte[1])));
- }
-
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] // Browser PNSE: Cannot wait on monitors
- public void EmptyFile_Read_Succeeds()
- {
- using (var fs = CreateFileStream(GetTestFilePath(), FileMode.Create))
- {
- // use a recognizable pattern
- var buffer = (byte[])TestBuffer.Clone();
-
- Assert.Equal(0, fs.Read(Span.Empty));
- Assert.Equal(0, fs.Read(new Span(buffer, 0, 1)));
- Assert.Equal(TestBuffer, buffer);
-
- Assert.Equal(0, fs.Read(new Span(buffer, 0, buffer.Length)));
- Assert.Equal(TestBuffer, buffer);
-
- Assert.Equal(0, fs.Read(new Span(buffer, buffer.Length - 1, 1)));
- Assert.Equal(TestBuffer, buffer);
-
- Assert.Equal(0, fs.Read(new Span(buffer, buffer.Length / 2, buffer.Length - buffer.Length / 2)));
- Assert.Equal(TestBuffer, buffer);
- }
- }
-
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] // Browser PNSE: Cannot wait on monitors
- public void NonEmptyFile_Read_GetsExpectedData()
- {
- string fileName = GetTestFilePath();
- File.WriteAllBytes(fileName, TestBuffer);
-
- using (var fs = CreateFileStream(fileName, FileMode.Open))
- {
- var buffer = new byte[TestBuffer.Length];
- Assert.Equal(TestBuffer.Length, fs.Read(new Span(buffer, 0, buffer.Length)));
- Assert.Equal(TestBuffer, buffer);
-
- // Larger than needed buffer, read into beginning, rest remains untouched
- fs.Position = 0;
- buffer = new byte[TestBuffer.Length * 2];
- Assert.Equal(TestBuffer.Length, fs.Read(new Span(buffer)));
- Assert.Equal(TestBuffer, buffer.Take(TestBuffer.Length));
- Assert.Equal(new byte[buffer.Length - TestBuffer.Length], buffer.Skip(TestBuffer.Length));
-
- // Larger than needed buffer, read into middle, beginning and end remain untouched
- fs.Position = 0;
- buffer = new byte[TestBuffer.Length * 2];
- Assert.Equal(TestBuffer.Length, fs.Read(new Span(buffer, 2, buffer.Length - 2)));
- Assert.Equal(TestBuffer, buffer.Skip(2).Take(TestBuffer.Length));
- Assert.Equal(new byte[2], buffer.Take(2));
- Assert.Equal(new byte[buffer.Length - TestBuffer.Length - 2], buffer.Skip(2 + TestBuffer.Length));
- }
- }
-
- [Fact]
- public void ReadOnly_Write_Throws()
- {
- string fileName = GetTestFilePath();
- File.WriteAllBytes(fileName, TestBuffer);
-
- using (var fs = CreateFileStream(fileName, FileMode.Open, FileAccess.Read))
- {
- Assert.Throws(() => fs.Write(new Span(new byte[1])));
- fs.Dispose();
- Assert.Throws(() => fs.Write(new Span(new byte[1]))); // Disposed checking happens first
- }
- }
-
- [Fact]
- public void WriteOnly_Read_Throws()
- {
- using (var fs = CreateFileStream(GetTestFilePath(), FileMode.Create, FileAccess.Write))
- {
- Assert.Throws(() => fs.Read(new Span(new byte[1])));
- fs.Dispose();
- Assert.Throws(() => fs.Read(new Span(new byte[1]))); // Disposed checking happens first
- }
- }
-
- [Fact]
- public void EmptyWrites_NoDataWritten()
- {
- using (var fs = CreateFileStream(GetTestFilePath(), FileMode.Create))
- {
- fs.Write(Span.Empty);
- Assert.Equal(0, fs.Length);
- Assert.Equal(0, fs.Position);
- }
- }
-
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))] // Browser PNSE: Cannot wait on monitors
- public void NonEmptyWrite_WritesExpectedData()
- {
- using (var fs = CreateFileStream(GetTestFilePath(), FileMode.Create))
- {
- fs.Write(new Span(TestBuffer));
- Assert.Equal(TestBuffer.Length, fs.Length);
- Assert.Equal(TestBuffer.Length, fs.Position);
-
- fs.Position = 0;
- var buffer = new byte[TestBuffer.Length];
- Assert.Equal(TestBuffer.Length, fs.Read(new Span(buffer)));
- Assert.Equal(TestBuffer, buffer);
- }
- }
-
- [Fact]
- public void DisposedStream_ReadWriteAsync_Throws()
- {
- var fs = CreateFileStream(GetTestFilePath(), FileMode.Create);
- fs.Dispose();
- Assert.Throws(() => { fs.ReadAsync(new Memory(new byte[1])); });
- Assert.Throws(() => { fs.WriteAsync(new ReadOnlyMemory(new byte[1])); });
- }
-
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
- public async Task EmptyFile_ReadAsync_Succeeds()
- {
- using (var fs = CreateFileStream(GetTestFilePath(), FileMode.Create))
- {
- // use a recognizable pattern
- var buffer = (byte[])TestBuffer.Clone();
-
- Assert.Equal(0, await fs.ReadAsync(Memory.Empty));
- Assert.Equal(0, await fs.ReadAsync(new Memory(buffer, 0, 1)));
- Assert.Equal(TestBuffer, buffer);
-
- Assert.Equal(0, await fs.ReadAsync(new Memory(buffer, 0, buffer.Length)));
- Assert.Equal(TestBuffer, buffer);
-
- Assert.Equal(0, await fs.ReadAsync(new Memory(buffer, buffer.Length - 1, 1)));
- Assert.Equal(TestBuffer, buffer);
-
- Assert.Equal(0, await fs.ReadAsync(new Memory(buffer, buffer.Length / 2, buffer.Length - buffer.Length / 2)));
- Assert.Equal(TestBuffer, buffer);
- }
- }
-
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
- public async Task NonEmptyFile_ReadAsync_GetsExpectedData()
- {
- string fileName = GetTestFilePath();
- File.WriteAllBytes(fileName, TestBuffer);
-
- using (var fs = CreateFileStream(fileName, FileMode.Open))
- {
- var buffer = new byte[TestBuffer.Length];
- Assert.Equal(TestBuffer.Length, await fs.ReadAsync(new Memory(buffer, 0, buffer.Length)));
- Assert.Equal(TestBuffer, buffer);
-
- // Larger than needed buffer, read into beginning, rest remains untouched
- fs.Position = 0;
- buffer = new byte[TestBuffer.Length * 2];
- Assert.Equal(TestBuffer.Length, await fs.ReadAsync(new Memory(buffer)));
- Assert.Equal(TestBuffer, buffer.Take(TestBuffer.Length));
- Assert.Equal(new byte[buffer.Length - TestBuffer.Length], buffer.Skip(TestBuffer.Length));
-
- // Larger than needed buffer, read into middle, beginning and end remain untouched
- fs.Position = 0;
- buffer = new byte[TestBuffer.Length * 2];
- Assert.Equal(TestBuffer.Length, await fs.ReadAsync(new Memory(buffer, 2, buffer.Length - 2)));
- Assert.Equal(TestBuffer, buffer.Skip(2).Take(TestBuffer.Length));
- Assert.Equal(new byte[2], buffer.Take(2));
- Assert.Equal(new byte[buffer.Length - TestBuffer.Length - 2], buffer.Skip(2 + TestBuffer.Length));
- }
- }
-
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
- public async Task NonEmptyFile_CustomMemoryManager_ReadAsync_GetsExpectedData()
- {
- string fileName = GetTestFilePath();
- File.WriteAllBytes(fileName, TestBuffer);
-
- using (var fs = CreateFileStream(fileName, FileMode.Open))
- using (var buffer = new NativeMemoryManager(TestBuffer.Length))
- {
- Assert.Equal(TestBuffer.Length, await fs.ReadAsync(buffer.Memory));
- Assert.Equal(TestBuffer, buffer.Memory.ToArray());
- }
- }
-
- [Fact]
- public void ReadOnly_WriteAsync_Throws()
- {
- string fileName = GetTestFilePath();
- File.WriteAllBytes(fileName, TestBuffer);
-
- using (var fs = CreateFileStream(fileName, FileMode.Open, FileAccess.Read))
- {
- Assert.Throws(() => { fs.WriteAsync(new ReadOnlyMemory(new byte[1])); });
- fs.Dispose();
- Assert.Throws(() => { fs.WriteAsync(new ReadOnlyMemory(new byte[1])); }); // Disposed checking happens first
- }
- }
-
- [Fact]
- public void WriteOnly_ReadAsync_Throws()
- {
- using (var fs = CreateFileStream(GetTestFilePath(), FileMode.Create, FileAccess.Write))
- {
- Assert.Throws(() => { fs.ReadAsync(new Memory(new byte[1])); });
- fs.Dispose();
- Assert.Throws(() => { fs.ReadAsync(new Memory(new byte[1])); });// Disposed checking happens first
- }
- }
-
- [Fact]
- public async Task EmptyWriteAsync_NoDataWritten()
- {
- using (var fs = CreateFileStream(GetTestFilePath(), FileMode.Create))
- {
- await fs.WriteAsync(Memory.Empty);
- Assert.Equal(0, fs.Length);
- Assert.Equal(0, fs.Position);
- }
- }
-
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
- public async Task NonEmptyWriteAsync_WritesExpectedData()
- {
- using (var fs = CreateFileStream(GetTestFilePath(), FileMode.Create))
- {
- await fs.WriteAsync(new Memory(TestBuffer));
- Assert.Equal(TestBuffer.Length, fs.Length);
- Assert.Equal(TestBuffer.Length, fs.Position);
-
- fs.Position = 0;
- var buffer = new byte[TestBuffer.Length];
- Assert.Equal(TestBuffer.Length, await fs.ReadAsync(new Memory(buffer)));
- Assert.Equal(TestBuffer, buffer);
- }
- }
-
- [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsThreadingSupported))]
- public async Task NonEmptyWriteAsync_CustomMemoryManager_WritesExpectedData()
- {
- using (var mem = new NativeMemoryManager(TestBuffer.Length))
- using (var fs = CreateFileStream(GetTestFilePath(), FileMode.Create))
- {
- new Memory(TestBuffer).CopyTo(mem.Memory);
-
- await fs.WriteAsync(mem.Memory);
- Assert.Equal(TestBuffer.Length, fs.Length);
- Assert.Equal(TestBuffer.Length, fs.Position);
-
- fs.Position = 0;
- var buffer = new byte[TestBuffer.Length];
- Assert.Equal(TestBuffer.Length, await fs.ReadAsync(new Memory(buffer)));
- Assert.Equal(TestBuffer, buffer);
- }
- }
- }
-
- public class Sync_FileStream_ReadWrite_Span : FileStream_ReadWrite_Span
- {
- protected override FileStream CreateFileStream(string path, FileMode mode, FileAccess access) =>
- new FileStream(path, mode, access, FileShare.None, bufferSize: 0x1000, FileOptions.None);
- }
-
- public class Async_FileStream_ReadWrite_Span : FileStream_ReadWrite_Span
- {
- protected override FileStream CreateFileStream(string path, FileMode mode, FileAccess access) =>
- new FileStream(path, mode, access, FileShare.None, bufferSize: 0x1000, FileOptions.Asynchronous);
- }
-
- [ActiveIssue("https://github.com/dotnet/runtime/issues/34583", TestPlatforms.Windows, TargetFrameworkMonikers.Netcoreapp, TestRuntimes.Mono)]
- public class Async_NoBuffer_FileStream_ReadWrite_Span : FileStream_ReadWrite_Span
- {
- protected override FileStream CreateFileStream(string path, FileMode mode, FileAccess access) =>
- new FileStream(path, mode, access, FileShare.None, bufferSize: 1, FileOptions.Asynchronous);
- }
-
- public sealed class Sync_DerivedFileStream_ReadWrite_Span : Sync_FileStream_ReadWrite_Span
- {
- protected override FileStream CreateFileStream(string path, FileMode mode, FileAccess access) =>
- new DerivedFileStream(path, mode, access, FileShare.None, bufferSize: 0x1000, FileOptions.None);
-
[Fact]
public void CallSpanReadWriteOnDerivedFileStream_ArrayMethodsUsed()
{
- using (var fs = (DerivedFileStream)CreateFileStream(GetTestFilePath(), FileMode.Create, FileAccess.ReadWrite))
+ using (var fs = new DerivedFileStream(GetTestFilePath(), FileMode.Create, FileAccess.ReadWrite, FileShare.None, bufferSize: 0x1000, FileOptions.None))
{
Assert.False(fs.WriteArrayInvoked);
Assert.False(fs.ReadArrayInvoked);
@@ -320,7 +31,7 @@ public void CallSpanReadWriteOnDerivedFileStream_ArrayMethodsUsed()
[Fact]
public async Task CallMemoryReadWriteAsyncOnDerivedFileStream_ArrayMethodsUsed()
{
- using (var fs = (DerivedFileStream)CreateFileStream(GetTestFilePath(), FileMode.Create, FileAccess.ReadWrite))
+ using (var fs = new DerivedFileStream(GetTestFilePath(), FileMode.Create, FileAccess.ReadWrite, FileShare.None, bufferSize: 0x1000, FileOptions.None))
{
Assert.False(fs.WriteAsyncArrayInvoked);
Assert.False(fs.ReadAsyncArrayInvoked);
@@ -337,12 +48,6 @@ public async Task CallMemoryReadWriteAsyncOnDerivedFileStream_ArrayMethodsUsed()
}
}
- public sealed class Async_DerivedFileStream_ReadWrite_Span : Async_FileStream_ReadWrite_Span
- {
- protected override FileStream CreateFileStream(string path, FileMode mode, FileAccess access) =>
- new DerivedFileStream(path, mode, access, FileShare.None, bufferSize: 0x1000, FileOptions.Asynchronous);
- }
-
internal sealed class DerivedFileStream : FileStream
{
public bool ReadArrayInvoked = false, WriteArrayInvoked = false;
diff --git a/src/libraries/System.IO.FileSystem/tests/FileStream/Seek.cs b/src/libraries/System.IO.FileSystem/tests/FileStream/Seek.cs
index 92b4fc1c8c9f..6971eb49927e 100644
--- a/src/libraries/System.IO.FileSystem/tests/FileStream/Seek.cs
+++ b/src/libraries/System.IO.FileSystem/tests/FileStream/Seek.cs
@@ -1,72 +1,12 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-using System.IO;
using Xunit;
namespace System.IO.Tests
{
public class FileStream_Seek : FileSystemTest
{
- [Fact]
- public void InvalidSeekOriginThrows()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- AssertExtensions.Throws("origin", null, () => fs.Seek(0, ~SeekOrigin.Begin));
- }
- }
-
- [Fact]
- public void InvalidOffsetThrows()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- // Ensure our test is set up correctly
- Assert.Equal(0, fs.Length);
- Assert.Equal(0, fs.Position);
-
- Assert.Throws(() => fs.Seek(-1, SeekOrigin.Begin));
- Assert.Throws(() => fs.Seek(-1, SeekOrigin.Current));
- Assert.Throws(() => fs.Seek(-1, SeekOrigin.End));
-
- Assert.Throws(() => fs.Seek(int.MinValue, SeekOrigin.Begin));
- Assert.Throws(() => fs.Seek(int.MinValue, SeekOrigin.Current));
- Assert.Throws(() => fs.Seek(int.MinValue, SeekOrigin.End));
- }
- }
-
- [Fact]
- public void SeekDisposedThrows()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- fs.Dispose();
- Assert.Throws(() => fs.Seek(1, SeekOrigin.Begin));
- // no fast path
- Assert.Throws(() => fs.Seek(fs.Position, SeekOrigin.Begin));
- // parameter checking happens first
- AssertExtensions.Throws("origin", null, () => fs.Seek(0, ~SeekOrigin.Begin));
- }
- }
-
- [Fact]
- public void SeekUnseekableThrows()
- {
- using (FileStream fs = new UnseekableFileStream(GetTestFilePath(), FileMode.Create))
- {
- Assert.Throws(() => fs.Seek(1, SeekOrigin.Begin));
- // no fast path
- Assert.Throws(() => fs.Seek(fs.Position, SeekOrigin.Begin));
- // parameter checking happens first
- AssertExtensions.Throws("origin", null, () => fs.Seek(0, ~SeekOrigin.Begin));
- // dispose checking happens first
- fs.Dispose();
- Assert.Throws(() => fs.Seek(fs.Position, SeekOrigin.Begin));
- }
- }
-
[Fact]
public void SeekAppendModifyThrows()
{
@@ -94,219 +34,5 @@ public void SeekAppendModifyThrows()
Assert.Equal(length, fs.Position);
}
}
-
- [Fact]
- public void SeekOriginBegin()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- fs.Write(TestBuffer, 0, TestBuffer.Length);
-
- // Ensure our test is set up correctly
- Assert.Equal(TestBuffer.Length, fs.Length);
- Assert.Equal(TestBuffer.Length, fs.Position);
-
- // Beginning
- Assert.Equal(0, fs.Seek(0, SeekOrigin.Begin));
- Assert.Equal(0, fs.Position);
-
- // End
- Assert.Equal(fs.Length, fs.Seek(fs.Length, SeekOrigin.Begin));
- Assert.Equal(fs.Length, fs.Position);
-
- // Middle
- Assert.Equal(fs.Length / 2, fs.Seek(fs.Length / 2, SeekOrigin.Begin));
- Assert.Equal(fs.Length / 2, fs.Position);
- }
- }
-
- [Fact]
- public void SeekOriginCurrent()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- fs.Write(TestBuffer, 0, TestBuffer.Length);
-
- // Ensure our test is set up correctly
- Assert.Equal(TestBuffer.Length, fs.Length);
- Assert.Equal(TestBuffer.Length, fs.Position);
-
- // Beginning
- Assert.Equal(0, fs.Seek(-fs.Length, SeekOrigin.Current));
- Assert.Equal(0, fs.Position);
-
- // End
- Assert.Equal(fs.Length, fs.Seek(fs.Length, SeekOrigin.Current));
- Assert.Equal(fs.Length, fs.Position);
-
- // Middle
- Assert.Equal(fs.Length / 2, fs.Seek(fs.Length / 2 - fs.Length, SeekOrigin.Current));
- Assert.Equal(fs.Length / 2, fs.Position);
- }
- }
-
-
- [Fact]
- public void SeekOriginEnd()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- fs.Write(TestBuffer, 0, TestBuffer.Length);
-
- // Ensure our test is set up correctly
- Assert.Equal(TestBuffer.Length, fs.Length);
- Assert.Equal(TestBuffer.Length, fs.Position);
-
- // Beginning
- Assert.Equal(0, fs.Seek(-fs.Length, SeekOrigin.End));
- Assert.Equal(0, fs.Position);
-
- // End
- Assert.Equal(fs.Length, fs.Seek(0, SeekOrigin.End));
- Assert.Equal(fs.Length, fs.Position);
-
- // Middle
- Assert.Equal(fs.Length / 2, fs.Seek(fs.Length / 2 - fs.Length, SeekOrigin.End));
- Assert.Equal(fs.Length / 2, fs.Position);
- }
- }
-
- [Fact]
- public void NoopSeeksDoNotChangePosition()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- fs.Write(TestBuffer, 0, TestBuffer.Length);
-
- // Ensure our test is set up correctly
- Assert.Equal(TestBuffer.Length, fs.Length);
- Assert.Equal(TestBuffer.Length, fs.Position);
-
- // end
- ValidateNoopSeeks(fs);
-
- fs.Seek(0, SeekOrigin.Begin);
-
- // beginning
- ValidateNoopSeeks(fs);
-
- fs.Seek(fs.Length / 2, SeekOrigin.Begin);
-
- // middle
- ValidateNoopSeeks(fs);
- }
- }
-
- private void ValidateNoopSeeks(Stream stream)
- {
- // validate seeks that don't change position
- long position = stream.Position;
-
- Assert.Equal(position, stream.Seek(position, SeekOrigin.Begin));
- Assert.Equal(position, stream.Position);
-
- Assert.Equal(position, stream.Seek(0, SeekOrigin.Current));
- Assert.Equal(position, stream.Position);
-
- Assert.Equal(position, stream.Seek(position - stream.Length, SeekOrigin.End));
- Assert.Equal(position, stream.Position);
- }
-
- [Fact]
- public void SeekPastEnd()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- fs.Write(TestBuffer, 0, TestBuffer.Length);
-
- // Ensure our test is set up correctly
- Assert.Equal(TestBuffer.Length, fs.Length);
- Assert.Equal(TestBuffer.Length, fs.Position);
- long originalLength = TestBuffer.Length;
-
- // Move past end
- Assert.Equal(originalLength + 1, fs.Seek(fs.Length + 1, SeekOrigin.Begin));
- Assert.Equal(originalLength + 1, fs.Position);
- // Length is not updated until a write
- Assert.Equal(originalLength, fs.Length);
-
- // At end of stream
- Assert.Equal(-1, fs.ReadByte());
- // Read should not update position or length
- Assert.Equal(originalLength + 1, fs.Position);
- Assert.Equal(originalLength, fs.Length);
-
- // Move back one, still at end of stream since length hasn't changed
- Assert.Equal(originalLength, fs.Seek(-1, SeekOrigin.Current));
- Assert.Equal(-1, fs.ReadByte());
- // Read should not update position or length
- Assert.Equal(originalLength, fs.Position);
- Assert.Equal(originalLength, fs.Length);
-
- // Move past end
- Assert.Equal(originalLength + 1, fs.Seek(fs.Length + 1, SeekOrigin.Begin));
- fs.WriteByte(0x2A);
- // Writing a single byte should update length by 2 (filling gap with zero).
- Assert.Equal(originalLength + 2, fs.Position);
- Assert.Equal(originalLength + 2, fs.Length);
- // Validate zero fill
- Assert.Equal(originalLength, fs.Seek(-2, SeekOrigin.Current));
- Assert.Equal(0, fs.ReadByte());
- // Validate written value
- Assert.Equal(0x2A, fs.ReadByte());
- }
- }
-
- [Fact]
- public void RandomSeekReadConsistency()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- var rand = new Random(1); // fixed seed to enable repeatable runs
- const int Trials = 1000;
- const int FileLength = 0x4000;
- const int MaxBytesToRead = 21;
-
- // Write data to the file
- var buffer = new byte[FileLength];
- for (int i = 0; i < buffer.Length; i++)
- buffer[i] = unchecked((byte)i);
- fs.Write(buffer, 0, buffer.Length);
- fs.Position = 0;
-
- // Repeatedly jump around, reading, and making sure we get the right data back
- for (int trial = 0; trial < Trials; trial++)
- {
- // Pick some number of bytes to read
- int bytesToRead = rand.Next(1, MaxBytesToRead);
-
- // Jump to a random position, seeking either from one of the possible origins
- SeekOrigin origin = (SeekOrigin)rand.Next(3);
- int offset = 0;
- switch (origin)
- {
- case SeekOrigin.Begin:
- offset = rand.Next(0, (int)fs.Length - bytesToRead);
- break;
- case SeekOrigin.Current:
- offset = rand.Next(-(int)fs.Position + bytesToRead, (int)fs.Length - (int)fs.Position - bytesToRead);
- break;
- case SeekOrigin.End:
- offset = -rand.Next(bytesToRead, (int)fs.Length);
- break;
- }
- long pos = fs.Seek(offset, origin);
- Assert.InRange(pos, 0, fs.Length - bytesToRead - 1);
-
- // Read the requested number of bytes, and verify each is correct
- for (int i = 0; i < bytesToRead; i++)
- {
- int byteRead = fs.ReadByte();
- Assert.Equal(buffer[pos + i], byteRead);
- }
- }
- }
- }
-
}
}
diff --git a/src/libraries/System.IO.FileSystem/tests/FileStream/SetLength.cs b/src/libraries/System.IO.FileSystem/tests/FileStream/SetLength.cs
index 8acd68ffd9eb..27a2d42a55a3 100644
--- a/src/libraries/System.IO.FileSystem/tests/FileStream/SetLength.cs
+++ b/src/libraries/System.IO.FileSystem/tests/FileStream/SetLength.cs
@@ -1,76 +1,12 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
-using System;
-using System.IO;
using Xunit;
namespace System.IO.Tests
{
public class FileStream_SetLength : FileSystemTest
{
- [Fact]
- public void InvalidLengths()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- AssertExtensions.Throws("value", () => fs.SetLength(-1));
- AssertExtensions.Throws("value", () => fs.SetLength(long.MinValue));
- }
- }
-
- [Fact]
- public void SetLengthDisposedThrows()
- {
- string fileName = GetTestFilePath();
- using (FileStream fs = new FileStream(fileName, FileMode.Create))
- {
- fs.Dispose();
- Assert.Throws(() => fs.SetLength(0));
- // parameter checking happens first
- AssertExtensions.Throws("value", () => fs.SetLength(-1));
- }
- }
-
- [Fact]
- public void SetLengthAccessNoWriteThrows()
- {
- string fileName = GetTestFilePath();
- using (FileStream fs = new FileStream(fileName, FileMode.Create))
- {
- fs.Write(TestBuffer, 0, TestBuffer.Length);
- }
-
- using (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read))
- {
- Assert.Throws(() => fs.SetLength(1));
- Assert.Throws(() => fs.SetLength(0));
- // no change should still throw
- Assert.Throws(() => fs.SetLength(fs.Length));
- // parameter checking happens first
- AssertExtensions.Throws("value", () => fs.SetLength(-1));
- // disposed check happens first
- fs.Dispose();
- Assert.Throws(() => fs.SetLength(0));
- }
- }
-
- [Fact]
- public void SetLengthUnseekableThrows()
- {
- using (FileStream fs = new UnseekableFileStream(GetTestFilePath(), FileMode.Create))
- {
- Assert.Throws(() => fs.Seek(1, SeekOrigin.Begin));
- // no fast path
- Assert.Throws(() => fs.Seek(fs.Position, SeekOrigin.Begin));
- // parameter checking happens first
- AssertExtensions.Throws("origin", null, () => fs.Seek(0, ~SeekOrigin.Begin));
- // dispose checking happens first
- fs.Dispose();
- Assert.Throws(() => fs.Seek(fs.Position, SeekOrigin.Begin));
- }
- }
-
[Fact]
public void SetLengthAppendModifyThrows()
{
@@ -89,76 +25,5 @@ public void SetLengthAppendModifyThrows()
Assert.Equal(length, fs.Length);
}
}
-
- [Fact]
- public void SetLengthSame()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- fs.Write(TestBuffer, 0, TestBuffer.Length);
-
- long length = fs.Length, position = fs.Position;
- fs.SetLength(length);
- Assert.Equal(length, fs.Length);
- Assert.Equal(position, fs.Position);
- }
- }
-
- [Fact]
- public void SetLengthLonger()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- fs.Write(TestBuffer, 0, TestBuffer.Length);
-
- long length = fs.Length, position = fs.Position;
- fs.SetLength(length * 2);
- Assert.Equal(length * 2, fs.Length);
- Assert.Equal(position, fs.Position); // should not change
- }
- }
-
- [Fact]
- public void SetLengthShorter()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- fs.Write(TestBuffer, 0, TestBuffer.Length);
-
- long length = fs.Length;
- fs.SetLength(length / 2);
- Assert.Equal(length / 2, fs.Length);
- // file pointer should move as well when truncating
- Assert.Equal(length / 2, fs.Position);
-
- fs.SetLength(0);
- Assert.Equal(0, fs.Length);
- // file pointer should move as well when truncating
- Assert.Equal(0, fs.Position);
- }
- }
-
- [Fact]
- public void SetLengthMaxValue()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- // Depending on the file system, this can:
- // - Throw IOException : No space left on device
- // - Throw ArgumentOutOfRangeException : Specified file length was too large for the file system.
- // - Succeed.
- try
- {
- fs.SetLength(long.MaxValue);
- }
- catch (Exception e)
- {
- Assert.True(e is IOException || e is ArgumentOutOfRangeException, $"Unexpected exception {e}");
- return;
- }
-
- Assert.Equal(long.MaxValue, fs.Length);
- }
- }
}
}
diff --git a/src/libraries/System.IO.FileSystem/tests/FileStream/Write.cs b/src/libraries/System.IO.FileSystem/tests/FileStream/Write.cs
deleted file mode 100644
index 475ecfc0d27f..000000000000
--- a/src/libraries/System.IO.FileSystem/tests/FileStream/Write.cs
+++ /dev/null
@@ -1,82 +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;
-using System.Linq;
-using Xunit;
-
-namespace System.IO.Tests
-{
- public class FileStream_Write : FileSystemTest
- {
- [Fact]
- public void WriteDisposedThrows()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- fs.Dispose();
- Assert.Throws(() => fs.Write(new byte[1], 0, 1));
- // even for noop Write
- Assert.Throws(() => fs.Write(new byte[1], 0, 0));
-
- // out of bounds checking happens first
- Assert.Throws(() => fs.Write(new byte[2], 1, 2));
- }
- }
-
- [Fact]
- public void ReadOnlyThrows()
- {
- string fileName = GetTestFilePath();
- using (FileStream fs = new FileStream(fileName, FileMode.Create))
- {
- fs.Write(TestBuffer, 0, TestBuffer.Length);
- }
-
- using (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read))
- {
- Assert.Throws(() => fs.Write(new byte[1], 0, 1));
-
- fs.Dispose();
- // Disposed checking happens first
- Assert.Throws(() => fs.Write(new byte[1], 0, 1));
-
- // out of bounds checking happens first
- Assert.Throws(() => fs.Write(new byte[2], 1, 2));
- }
- }
-
- [Fact]
- public void NoopWritesSucceed()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- fs.Write(new byte[0], 0, 0);
- fs.Write(new byte[1], 0, 0);
- // even though offset is out of bounds of array, this is still allowed
- // for the last element
- fs.Write(new byte[1], 1, 0);
- fs.Write(new byte[2], 1, 0);
- Assert.Equal(0, fs.Length);
- Assert.Equal(0, fs.Position);
- }
- }
-
- [Fact]
- public void SimpleWrite()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- fs.Write(TestBuffer, 0, TestBuffer.Length);
- Assert.Equal(TestBuffer.Length, fs.Length);
- Assert.Equal(TestBuffer.Length, fs.Position);
-
- fs.Position = 0;
- byte[] buffer = new byte[TestBuffer.Length];
- Assert.Equal(TestBuffer.Length, fs.Read(buffer, 0, buffer.Length));
- Assert.Equal(TestBuffer, buffer);
- }
- }
- }
-}
diff --git a/src/libraries/System.IO.FileSystem/tests/FileStream/WriteByte.cs b/src/libraries/System.IO.FileSystem/tests/FileStream/WriteByte.cs
deleted file mode 100644
index 0e70eb997997..000000000000
--- a/src/libraries/System.IO.FileSystem/tests/FileStream/WriteByte.cs
+++ /dev/null
@@ -1,80 +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 Xunit;
-
-namespace System.IO.Tests
-{
- public class FileStream_WriteByte : FileSystemTest
- {
- [Fact]
- public void ReadDisposedThrows()
- {
- using (FileStream fs = new FileStream(GetTestFilePath(), FileMode.Create))
- {
- fs.Dispose();
- Assert.Throws(() => fs.WriteByte(0));
- }
- }
-
- [Fact]
- public void ReadOnlyThrows()
- {
- string fileName = GetTestFilePath();
- using (FileStream fs = new FileStream(fileName, FileMode.Create))
- {
- fs.Write(TestBuffer, 0, TestBuffer.Length);
- }
-
- using (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read))
- {
- Assert.Throws(() => fs.WriteByte(0));
-
- fs.Dispose();
- // Disposed checking happens first
- Assert.Throws(() => fs.WriteByte(0));
- }
- }
-
- [Fact]
- public void WriteFile()
- {
- string fileName = GetTestFilePath();
- using (FileStream fs = new FileStream(fileName, FileMode.Create))
- {
- foreach (byte b in TestBuffer)
- {
- fs.WriteByte(b);
- }
- }
-
- using (FileStream fs = new FileStream(fileName, FileMode.Open))
- {
- byte[] buffer = new byte[TestBuffer.Length];
- Assert.Equal(TestBuffer.Length, fs.Read(buffer, 0, buffer.Length));
- Assert.Equal(TestBuffer, buffer);
- }
- }
-
- [Fact]
- public void WriteFile_PastBufferSize()
- {
- string fileName = GetTestFilePath();
- using (FileStream fs = new FileStream(fileName, FileMode.Create))
- {
- for (int written = 0; written < TestBuffer.Length * 1000; written++)
- {
- fs.WriteByte(TestBuffer[written % TestBuffer.Length]);
- }
- }
- byte[] buffer = File.ReadAllBytes(fileName);
- int offset = 0;
- while (offset < buffer.Length)
- {
- for (int i = 0; i < TestBuffer.Length; i++)
- Assert.Equal(TestBuffer[i], buffer[i + offset]);
- offset += TestBuffer.Length;
- }
- }
- }
-}
diff --git a/src/libraries/System.IO.FileSystem/tests/ManualTests/ManualTests.cs b/src/libraries/System.IO.FileSystem/tests/ManualTests/ManualTests.cs
index 0e8ae5b96804..c363e654e73a 100644
--- a/src/libraries/System.IO.FileSystem/tests/ManualTests/ManualTests.cs
+++ b/src/libraries/System.IO.FileSystem/tests/ManualTests/ManualTests.cs
@@ -75,5 +75,66 @@ public static void Throw_FileStreamDispose_WhenRemoteMountRunsOutOfSpace()
destinationStream.Dispose();
});
}
+
+
+ const long InitialFileSize = 1024;
+
+ [ConditionalFact(nameof(ManualTestsEnabled))]
+ [PlatformSpecific(TestPlatforms.Windows)]
+ public static void SetLength_DoesNotAlterPositionWhenNativeCallFails()
+ {
+ /* This test verifies that Position is not altered when SetLength fails when a "disk out of space" error occurs.
+
+ Setup environment to have a drive with less than 1k available space:
+ - Create an 8mb fixed size VHD.
+ - Open Computer Management -> Storage -> Disk Management
+ - Follow these instructions:
+ https://docs.microsoft.com/en-us/windows-server/storage/disk-management/manage-virtual-hard-disks
+
+ - Restrict the space available in the VHD.
+ - Create a 512 bytes quota in the VHD created above using cmd:
+ fsutil quota modify E: 512 512 SYSTEM
+ fsutil quota modify E: 512 512 YourUser
+
+ - Run the test. If configured correctly, the SetLength operation should fail at least once.
+ */
+
+ using FileStream fs = File.Open("E:/dummy_file.txt", FileMode.OpenOrCreate);
+
+ // Position was less than new Length; should remain the same.
+ fs.Seek(0, SeekOrigin.Begin);
+ VerifySetLength(fs);
+ Assert.Equal(0, fs.Position);
+ Assert.True(fs.Position < fs.Length);
+
+ // Position was larger than new Length; should be adjusted to the Length.
+ fs.Seek(InitialFileSize + 1, SeekOrigin.Begin);
+ VerifySetLength(fs);
+ Assert.Equal(fs.Length, fs.Position);
+ }
+
+ private static void VerifySetLength(FileStream fs)
+ {
+ long originalPosition = fs.Position;
+ bool success = false;
+ long size = InitialFileSize;
+
+ while (!success)
+ {
+ try
+ {
+ Console.WriteLine($"Attempting to write {size} bytes...");
+ fs.SetLength(size);
+ Console.WriteLine("Success!");
+ success = true;
+ }
+ catch (IOException)
+ {
+ Console.WriteLine("Failed.");
+ Assert.Equal(originalPosition, fs.Position);
+ size = (long)(size * 0.9);
+ }
+ }
+ }
}
}
diff --git a/src/libraries/System.IO.FileSystem/tests/System.IO.FileSystem.Tests.csproj b/src/libraries/System.IO.FileSystem/tests/System.IO.FileSystem.Tests.csproj
index 8505c8d80cbe..fe34586e8c32 100644
--- a/src/libraries/System.IO.FileSystem/tests/System.IO.FileSystem.Tests.csproj
+++ b/src/libraries/System.IO.FileSystem/tests/System.IO.FileSystem.Tests.csproj
@@ -2,7 +2,7 @@
true
true
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser
--working-dir=/test-dir
@@ -70,27 +70,18 @@
-
+
-
-
-
-
-
-
-
-
-
diff --git a/src/libraries/System.IO.IsolatedStorage/src/System.IO.IsolatedStorage.csproj b/src/libraries/System.IO.IsolatedStorage/src/System.IO.IsolatedStorage.csproj
index 066018d64f7c..4861416efa90 100644
--- a/src/libraries/System.IO.IsolatedStorage/src/System.IO.IsolatedStorage.csproj
+++ b/src/libraries/System.IO.IsolatedStorage/src/System.IO.IsolatedStorage.csproj
@@ -1,6 +1,6 @@
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)
enable
diff --git a/src/libraries/System.IO.IsolatedStorage/tests/System.IO.IsolatedStorage.Tests.csproj b/src/libraries/System.IO.IsolatedStorage/tests/System.IO.IsolatedStorage.Tests.csproj
index 57f315d88506..b37dff5c1d89 100644
--- a/src/libraries/System.IO.IsolatedStorage/tests/System.IO.IsolatedStorage.Tests.csproj
+++ b/src/libraries/System.IO.IsolatedStorage/tests/System.IO.IsolatedStorage.Tests.csproj
@@ -1,6 +1,6 @@
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser
diff --git a/src/libraries/System.IO.MemoryMappedFiles/src/System.IO.MemoryMappedFiles.csproj b/src/libraries/System.IO.MemoryMappedFiles/src/System.IO.MemoryMappedFiles.csproj
index 875e392be708..e0a5390f9a62 100644
--- a/src/libraries/System.IO.MemoryMappedFiles/src/System.IO.MemoryMappedFiles.csproj
+++ b/src/libraries/System.IO.MemoryMappedFiles/src/System.IO.MemoryMappedFiles.csproj
@@ -2,7 +2,7 @@
true
enable
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser
diff --git a/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedViewStream.cs b/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedViewStream.cs
index 3a8a56d4313c..740db8809d92 100644
--- a/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedViewStream.cs
+++ b/src/libraries/System.IO.MemoryMappedFiles/src/System/IO/MemoryMappedFiles/MemoryMappedViewStream.cs
@@ -18,20 +18,20 @@ internal MemoryMappedViewStream(MemoryMappedView view)
Initialize(_view.ViewHandle, _view.PointerOffset, _view.Size, MemoryMappedFile.GetFileAccess(_view.Access));
}
- public SafeMemoryMappedViewHandle SafeMemoryMappedViewHandle
- {
- get { return _view.ViewHandle; }
- }
+ public SafeMemoryMappedViewHandle SafeMemoryMappedViewHandle => _view.ViewHandle;
+
+ public long PointerOffset => _view.PointerOffset;
public override void SetLength(long value)
{
+ if (value < 0)
+ {
+ throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_NeedNonNegNum);
+ }
+
throw new NotSupportedException(SR.NotSupported_MMViewStreamsFixedLength);
}
- public long PointerOffset
- {
- get { return _view.PointerOffset; }
- }
protected override void Dispose(bool disposing)
{
diff --git a/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFilesTestsBase.cs b/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFilesTestsBase.cs
index 0a25484f2ebb..a96273d498c1 100644
--- a/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFilesTestsBase.cs
+++ b/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedFilesTestsBase.cs
@@ -12,10 +12,10 @@ namespace System.IO.MemoryMappedFiles.Tests
public abstract partial class MemoryMappedFilesTestBase : FileCleanupTestBase
{
/// Gets whether named maps are supported by the current platform.
- protected static bool MapNamesSupported => OperatingSystem.IsWindows();
+ internal static bool MapNamesSupported => OperatingSystem.IsWindows();
/// Creates a map name guaranteed to be unique.
- protected static string CreateUniqueMapName() { return Guid.NewGuid().ToString("N"); }
+ internal static string CreateUniqueMapName() { return Guid.NewGuid().ToString("N"); }
/// Creates a map name guaranteed to be unique and contain only whitespace characters.
protected static string CreateUniqueWhitespaceMapName()
diff --git a/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedViewStream.Tests.cs b/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedViewStream.Tests.cs
index a9cf5dbddaee..e6d40a8808a6 100644
--- a/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedViewStream.Tests.cs
+++ b/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedViewStream.Tests.cs
@@ -134,22 +134,6 @@ public void InvalidAccessLevels_ReadWriteExecute_NonUwp(MemoryMappedFileAccess m
}
}
- ///
- /// Test to verify that setting the length of the stream is unsupported.
- ///
- [Fact]
- public void SettingLengthNotSupported()
- {
- foreach (MemoryMappedFile mmf in CreateSampleMaps())
- {
- using (mmf)
- using (MemoryMappedViewStream s = mmf.CreateViewStream())
- {
- Assert.Throws(() => s.SetLength(4096));
- }
- }
- }
-
///
/// Test to verify the accessor's PointerOffset.
///
@@ -209,52 +193,25 @@ public void AllReadWriteMethods(long offset, long size)
using (mmf)
using (MemoryMappedViewStream s = mmf.CreateViewStream(offset, size))
{
- AssertWritesReads(s);
- }
- }
- }
-
- /// Performs many reads and writes of against the stream.
- private static void AssertWritesReads(MemoryMappedViewStream s)
- {
- // Write and read at the beginning
- s.Position = 0;
- s.WriteByte(42);
- s.Position = 0;
- Assert.Equal(42, s.ReadByte());
-
- // Write and read at the end
- byte[] data = new byte[] { 1, 2, 3 };
- s.Position = s.Length - data.Length;
- s.Write(data, 0, data.Length);
- s.Position = s.Length - data.Length;
- Array.Clear(data, 0, data.Length);
- Assert.Equal(3, s.Read(data, 0, data.Length));
- Assert.Equal(new byte[] { 1, 2, 3 }, data);
-
- // Fail reading/writing past the end
- s.Position = s.Length;
- Assert.Equal(-1, s.ReadByte());
- Assert.Throws(() => s.WriteByte(42));
- }
-
- ///
- /// Test to verify that Flush is supported regardless of the accessor's access level
- ///
- [Theory]
- [InlineData(MemoryMappedFileAccess.Read)]
- [InlineData(MemoryMappedFileAccess.Write)]
- [InlineData(MemoryMappedFileAccess.ReadWrite)]
- [InlineData(MemoryMappedFileAccess.CopyOnWrite)]
- public void FlushSupportedOnBothReadAndWriteAccessors(MemoryMappedFileAccess access)
- {
- const int Capacity = 256;
- foreach (MemoryMappedFile mmf in CreateSampleMaps(Capacity))
- {
- using (mmf)
- using (MemoryMappedViewStream s = mmf.CreateViewStream(0, Capacity, access))
- {
- s.Flush();
+ // Write and read at the beginning
+ s.Position = 0;
+ s.WriteByte(42);
+ s.Position = 0;
+ Assert.Equal(42, s.ReadByte());
+
+ // Write and read at the end
+ byte[] data = new byte[] { 1, 2, 3 };
+ s.Position = s.Length - data.Length;
+ s.Write(data, 0, data.Length);
+ s.Position = s.Length - data.Length;
+ Array.Clear(data, 0, data.Length);
+ Assert.Equal(3, s.Read(data, 0, data.Length));
+ Assert.Equal(new byte[] { 1, 2, 3 }, data);
+
+ // Fail reading/writing past the end
+ s.Position = s.Length;
+ Assert.Equal(-1, s.ReadByte());
+ Assert.Throws(() => s.WriteByte(42));
}
}
}
@@ -350,28 +307,11 @@ public void CopyOnWrite()
}
}
- ///
- /// Test to verify that we can dispose of an accessor multiple times.
- ///
- [Fact]
- public void DisposeMultipleTimes()
- {
- foreach (MemoryMappedFile mmf in CreateSampleMaps())
- {
- using (mmf)
- {
- MemoryMappedViewStream s = mmf.CreateViewStream();
- s.Dispose();
- s.Dispose();
- }
- }
- }
-
///
/// Test to verify that a view becomes unusable after it's been disposed.
///
[Fact]
- public void InvalidAfterDisposal()
+ public void HandleClosedOnDisposal()
{
foreach (MemoryMappedFile mmf in CreateSampleMaps())
{
@@ -383,32 +323,10 @@ public void InvalidAfterDisposal()
Assert.False(handle.IsClosed);
s.Dispose();
Assert.True(handle.IsClosed);
-
- Assert.Throws(() => s.ReadByte());
- Assert.Throws(() => s.Write(new byte[1], 0, 1));
- Assert.Throws(() => s.Flush());
}
}
}
- ///
- /// Test to verify that we can still use a view after the associated map has been disposed.
- ///
- [Fact]
- public void UseAfterMMFDisposal()
- {
- foreach (MemoryMappedFile mmf in CreateSampleMaps(8192))
- {
- // Create the view, then dispose of the map
- MemoryMappedViewStream s;
- using (mmf) s = mmf.CreateViewStream();
-
- // Validate we can still use the view
- ValidateMemoryMappedViewStream(s, 8192, MemoryMappedFileAccess.ReadWrite);
- s.Dispose();
- }
- }
-
///
/// Test to allow a map and view to be finalized, just to ensure we don't crash.
///
diff --git a/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedViewStreamConformanceTests.cs b/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedViewStreamConformanceTests.cs
new file mode 100644
index 000000000000..c190d329a00f
--- /dev/null
+++ b/src/libraries/System.IO.MemoryMappedFiles/tests/MemoryMappedViewStreamConformanceTests.cs
@@ -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.
+
+using System.IO.Tests;
+using System.Threading.Tasks;
+using Xunit;
+
+namespace System.IO.MemoryMappedFiles.Tests
+{
+ public abstract class MemoryMappedViewStreamConformanceTests : StandaloneStreamConformanceTests
+ {
+ protected override bool CanSetLength => false;
+
+ protected override Task CreateReadOnlyStreamCore(byte[] initialData) => CreateStream(initialData, FileAccess.Read);
+ protected override Task CreateReadWriteStreamCore(byte[] initialData) => CreateStream(initialData, FileAccess.ReadWrite);
+ protected override Task CreateWriteOnlyStreamCore(byte[] initialData) => CreateStream(initialData, FileAccess.Write);
+
+ protected abstract MemoryMappedFile CreateFile(int length);
+
+ private Task CreateStream(byte[] initialData, FileAccess access)
+ {
+ Stream stream = null;
+
+ if (initialData is not null)
+ {
+ using MemoryMappedFile mmf = CreateFile(initialData.Length);
+ if (mmf != null)
+ {
+ using (MemoryMappedViewStream s = mmf.CreateViewStream())
+ {
+ s.Write(initialData);
+ }
+
+ stream = mmf.CreateViewStream(0, initialData.Length, access switch
+ {
+ FileAccess.Read => MemoryMappedFileAccess.Read,
+ FileAccess.ReadWrite => MemoryMappedFileAccess.ReadWrite,
+ FileAccess.Write => MemoryMappedFileAccess.Write,
+ _ => throw new Exception($"Unexpected FileAccess: {access}")
+ });
+ }
+ }
+
+ return Task.FromResult(stream);
+ }
+ }
+
+ public class AnonymousMemoryMappedViewStreamConformanceTests : MemoryMappedViewStreamConformanceTests
+ {
+ protected override MemoryMappedFile CreateFile(int length) =>
+ MemoryMappedFile.CreateNew(null, length);
+ }
+
+ public class NamedMemoryMappedViewStreamConformanceTests : MemoryMappedViewStreamConformanceTests
+ {
+ protected override MemoryMappedFile CreateFile(int length) =>
+ MemoryMappedFilesTestBase.MapNamesSupported ? MemoryMappedFile.CreateNew(MemoryMappedFilesTestBase.CreateUniqueMapName(), length) :
+ null;
+ }
+
+ public class FileMemoryMappedViewStreamConformanceTests : MemoryMappedViewStreamConformanceTests
+ {
+ protected override MemoryMappedFile CreateFile(int length) =>
+ MemoryMappedFile.CreateFromFile(Path.Combine(TestDirectory, Guid.NewGuid().ToString("N")), FileMode.CreateNew, null, length, MemoryMappedFileAccess.ReadWrite);
+ }
+
+ public class NamedFileMemoryMappedViewStreamConformanceTests : MemoryMappedViewStreamConformanceTests
+ {
+ protected override MemoryMappedFile CreateFile(int length) =>
+ MemoryMappedFilesTestBase.MapNamesSupported ? MemoryMappedFile.CreateFromFile(Path.Combine(TestDirectory, Guid.NewGuid().ToString("N")), FileMode.CreateNew, MemoryMappedFilesTestBase.CreateUniqueMapName(), length, MemoryMappedFileAccess.ReadWrite) :
+ null;
+ }
+}
diff --git a/src/libraries/System.IO.MemoryMappedFiles/tests/System.IO.MemoryMappedFiles.Tests.csproj b/src/libraries/System.IO.MemoryMappedFiles/tests/System.IO.MemoryMappedFiles.Tests.csproj
index f0c3ca4b2081..d412ecf70b21 100644
--- a/src/libraries/System.IO.MemoryMappedFiles/tests/System.IO.MemoryMappedFiles.Tests.csproj
+++ b/src/libraries/System.IO.MemoryMappedFiles/tests/System.IO.MemoryMappedFiles.Tests.csproj
@@ -2,7 +2,7 @@
true
true
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)-Browser
@@ -10,13 +10,19 @@
+
-
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/libraries/System.IO.Packaging/tests/System.IO.Packaging.Tests.csproj b/src/libraries/System.IO.Packaging/tests/System.IO.Packaging.Tests.csproj
index 41d84a259611..f9a26bb66dc2 100644
--- a/src/libraries/System.IO.Packaging/tests/System.IO.Packaging.Tests.csproj
+++ b/src/libraries/System.IO.Packaging/tests/System.IO.Packaging.Tests.csproj
@@ -1,6 +1,6 @@
- $(NetCoreAppCurrent);net48-Windows_NT
+ $(NetCoreAppCurrent);net48-windows
diff --git a/src/libraries/System.IO.Pipes.AccessControl/src/System.IO.Pipes.AccessControl.csproj b/src/libraries/System.IO.Pipes.AccessControl/src/System.IO.Pipes.AccessControl.csproj
index 81ac8d687ca3..c65729e936dd 100644
--- a/src/libraries/System.IO.Pipes.AccessControl/src/System.IO.Pipes.AccessControl.csproj
+++ b/src/libraries/System.IO.Pipes.AccessControl/src/System.IO.Pipes.AccessControl.csproj
@@ -1,7 +1,7 @@
enable
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)
diff --git a/src/libraries/System.IO.Pipes.AccessControl/tests/System.IO.Pipes.AccessControl.Tests.csproj b/src/libraries/System.IO.Pipes.AccessControl/tests/System.IO.Pipes.AccessControl.Tests.csproj
index 82cd7df4411d..2e0f3fe42c62 100644
--- a/src/libraries/System.IO.Pipes.AccessControl/tests/System.IO.Pipes.AccessControl.Tests.csproj
+++ b/src/libraries/System.IO.Pipes.AccessControl/tests/System.IO.Pipes.AccessControl.Tests.csproj
@@ -1,6 +1,6 @@
- $(NetCoreAppCurrent)-Windows_NT
+ $(NetCoreAppCurrent)-windows
diff --git a/src/libraries/System.IO.Pipes/src/System.IO.Pipes.csproj b/src/libraries/System.IO.Pipes/src/System.IO.Pipes.csproj
index c3744e29ba8e..b322b78d7719 100644
--- a/src/libraries/System.IO.Pipes/src/System.IO.Pipes.csproj
+++ b/src/libraries/System.IO.Pipes/src/System.IO.Pipes.csproj
@@ -2,7 +2,7 @@
true
true
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)
enable
diff --git a/src/libraries/System.IO.Pipes/tests/System.IO.Pipes.Tests.csproj b/src/libraries/System.IO.Pipes/tests/System.IO.Pipes.Tests.csproj
index 90c00efb8d3c..ca262a152b46 100644
--- a/src/libraries/System.IO.Pipes/tests/System.IO.Pipes.Tests.csproj
+++ b/src/libraries/System.IO.Pipes/tests/System.IO.Pipes.Tests.csproj
@@ -2,7 +2,7 @@
true
true
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Unix;$(NetCoreAppCurrent)
true
diff --git a/src/libraries/System.IO.Ports/src/System.IO.Ports.csproj b/src/libraries/System.IO.Ports/src/System.IO.Ports.csproj
index 1efe6c62d465..7deeb2c937d1 100644
--- a/src/libraries/System.IO.Ports/src/System.IO.Ports.csproj
+++ b/src/libraries/System.IO.Ports/src/System.IO.Ports.csproj
@@ -4,7 +4,7 @@
$(DefineConstants);NOSPAN;SERIAL_PORTS
true
annotations
- netstandard2.0-Windows_NT;netstandard2.0-Linux;netstandard2.0-OSX;netstandard2.0;net461-Windows_NT;netstandard2.0-FreeBSD
+ netstandard2.0-windows;netstandard2.0-Linux;netstandard2.0-OSX;netstandard2.0;net461-windows;netstandard2.0-FreeBSD
diff --git a/src/libraries/System.IO.Ports/tests/System.IO.Ports.Tests.csproj b/src/libraries/System.IO.Ports/tests/System.IO.Ports.Tests.csproj
index d0797175561f..4b498002d802 100644
--- a/src/libraries/System.IO.Ports/tests/System.IO.Ports.Tests.csproj
+++ b/src/libraries/System.IO.Ports/tests/System.IO.Ports.Tests.csproj
@@ -1,6 +1,6 @@
- $(NetCoreAppCurrent)-Windows_NT;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-FreeBSD;net461-Windows_NT
+ $(NetCoreAppCurrent)-windows;$(NetCoreAppCurrent)-Linux;$(NetCoreAppCurrent)-OSX;$(NetCoreAppCurrent)-iOS;$(NetCoreAppCurrent)-FreeBSD;net461-windows
diff --git a/src/libraries/System.IO.UnmanagedMemoryStream/tests/System.IO.UnmanagedMemoryStream.Tests.csproj b/src/libraries/System.IO.UnmanagedMemoryStream/tests/System.IO.UnmanagedMemoryStream.Tests.csproj
index 4471d0ba1833..1869c078367a 100644
--- a/src/libraries/System.IO.UnmanagedMemoryStream/tests/System.IO.UnmanagedMemoryStream.Tests.csproj
+++ b/src/libraries/System.IO.UnmanagedMemoryStream/tests/System.IO.UnmanagedMemoryStream.Tests.csproj
@@ -14,13 +14,16 @@
-
-
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/libraries/System.IO.UnmanagedMemoryStream/tests/UmsCtorTests.cs b/src/libraries/System.IO.UnmanagedMemoryStream/tests/UmsCtorTests.cs
index 282faeaa7e9b..54b3d03d412a 100644
--- a/src/libraries/System.IO.UnmanagedMemoryStream/tests/UmsCtorTests.cs
+++ b/src/libraries/System.IO.UnmanagedMemoryStream/tests/UmsCtorTests.cs
@@ -1,6 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
+using System.Runtime.InteropServices;
using Xunit;
namespace System.IO.Tests
@@ -127,22 +128,16 @@ public static unsafe void BufferCtor()
// Derived class used to exercise protected members and to test behaviors before and after initialization
internal sealed unsafe class DerivedUnmanagedMemoryStream : UnmanagedMemoryStream
{
- internal DerivedUnmanagedMemoryStream()
- {
- }
+ internal DerivedUnmanagedMemoryStream() { }
- internal DerivedUnmanagedMemoryStream(FakeSafeBuffer buffer, long length, FileAccess access) : base(buffer, 0, length, access)
- {
- }
+ internal DerivedUnmanagedMemoryStream(SafeBuffer buffer, long length, FileAccess access) : base(buffer, 0, length, access) { }
- internal new void Initialize(byte* pointer, long length, long capacity, FileAccess access)
- {
+ internal DerivedUnmanagedMemoryStream(byte* pointer, long length, long capacity, FileAccess access) : base(pointer, length, capacity, access) { }
+
+ internal new void Initialize(byte* pointer, long length, long capacity, FileAccess access) =>
base.Initialize(pointer, length, capacity, access);
- }
- internal void Initialize(FakeSafeBuffer buffer, long offset, long capacity, FileAccess access)
- {
+ internal void Initialize(FakeSafeBuffer buffer, long offset, long capacity, FileAccess access) =>
base.Initialize(buffer, offset, capacity, access);
- }
}
}
diff --git a/src/libraries/System.IO.UnmanagedMemoryStream/tests/UmsDisposeAsync.cs b/src/libraries/System.IO.UnmanagedMemoryStream/tests/UmsDisposeAsync.cs
deleted file mode 100644
index 89897231f948..000000000000
--- a/src/libraries/System.IO.UnmanagedMemoryStream/tests/UmsDisposeAsync.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 Xunit;
-
-namespace System.IO.Tests
-{
- public sealed class UmsDisposeAsync
- {
- [Fact]
- public void DisposeAsync_ClosesStream()
- {
- using (var manager = new UmsManager(FileAccess.Write, 1000))
- {
- UnmanagedMemoryStream stream = manager.Stream;
- Assert.True(stream.CanWrite);
- Assert.True(stream.DisposeAsync().IsCompletedSuccessfully);
- Assert.False(stream.CanWrite);
- }
- }
- }
-}
diff --git a/src/libraries/System.IO.UnmanagedMemoryStream/tests/UmsFlush.cs b/src/libraries/System.IO.UnmanagedMemoryStream/tests/UmsFlush.cs
deleted file mode 100644
index 03e6d4872ca5..000000000000
--- a/src/libraries/System.IO.UnmanagedMemoryStream/tests/UmsFlush.cs
+++ /dev/null
@@ -1,36 +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.Threading;
-using System.Threading.Tasks;
-using Xunit;
-
-namespace System.IO.Tests
-{
- public class UnmanagedMemoryStreamFlushTests
- {
- [Fact]
- public static void Flush()
- {
- const int length = 1000;
- using (var manager = new UmsManager(FileAccess.Write, length))
- {
- UnmanagedMemoryStream stream = manager.Stream;
-
- stream.Flush();
- Assert.True(stream.FlushAsync(new CancellationToken(true)).IsCanceled);
- Assert.True(stream.FlushAsync().Status == TaskStatus.RanToCompletion);
- }
-
- using (var stream = new DerivedUnmanagedMemoryStream())
- {
- Assert.Throws(() => stream.Flush());
-
- Task t = stream.FlushAsync();
- Assert.True(t.IsFaulted);
- Assert.IsType(t.Exception.InnerException);
- }
- }
-
- }
-}
diff --git a/src/libraries/System.IO.UnmanagedMemoryStream/tests/UmsReadWrite.cs b/src/libraries/System.IO.UnmanagedMemoryStream/tests/UmsReadWrite.cs
deleted file mode 100644
index fe31b2ed2eae..000000000000
--- a/src/libraries/System.IO.UnmanagedMemoryStream/tests/UmsReadWrite.cs
+++ /dev/null
@@ -1,368 +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.Threading;
-using System.Threading.Tasks;
-using Xunit;
-
-namespace System.IO.Tests
-{
- public sealed class ArrayUmsReadWriteTests : UmsReadWriteTests
- {
- protected override int Read(UnmanagedMemoryStream stream, byte[] array, int offset, int count) =>
- stream.Read(array, offset, count);
- protected override void Write(UnmanagedMemoryStream stream, byte[] array, int offset, int count) =>
- stream.Write(array, offset, count);
-
- [Fact]
- public static void InvalidReadWrite()
- {
- const int length = 1000;
- using (var manager = new UmsManager(FileAccess.Read, length))
- {
- UnmanagedMemoryStream stream = manager.Stream;
-
- //case#3: call Read with null, ArgumentNullException should be thrown.
- Assert.Throws(() => stream.Read(null, 0, 3));
- Assert.Throws(() => stream.ReadAsync(null, 0, 3).GetAwaiter().GetResult());
- Assert.Throws(() => stream.Write(null, 0, 7));
- Assert.Throws(() => stream.WriteAsync(null, 0, 7).GetAwaiter().GetResult());
-
- //case#4: call Read with start<0, ArgumentOutOfRangeException should be thrown.
- Assert.Throws(() => stream.Read(new byte[] { }, sbyte.MinValue, 9));
- Assert.Throws(() => stream.ReadAsync(new byte[] { }, SByte.MinValue, 9).GetAwaiter().GetResult());
- Assert.Throws(() => stream.Write(new byte[] { }, -1, 6));
- Assert.Throws(() => stream.WriteAsync(new byte[] { }, -1, 6).GetAwaiter().GetResult());
-
- //case#5: call Read with count<0, ArgumentOutOfRangeException should be thrown.
- Assert.Throws(() => stream.Read(new byte[] { }, 0, -1));
- Assert.Throws(() => stream.ReadAsync(new byte[] { }, 0, -1).GetAwaiter().GetResult());
- Assert.Throws