All commands are in powershell, should be pretty much the same for bash and non-windows platforms
- build everything we're going to need:
.\build.cmd Clr+Libs -c Release ;; .\build.cmd Clr -c Checked ;; cd .\src\tests\ ;; .\build.cmd Release generatelayoutonly ;; cd ..\..
- Make a copy of the test core_root (will be a baseline):
Copy-Item .\artifacts\tests\coreclr\windows.x64.Release\Tests\Core_Root -Destination .\artifacts\tests\coreclr\windows.x64.Release\Tests\Core_Root_base -Recurse
- Apply your changes to the corelib or any managed library and rebuild them, e.g. change
String.IsNullOrEmpty
impl and do:
.\build.cmd Clr.CoreLib -c Release
- Copy your lib to the "diff" core_root:
Copy-Item .\artifacts\bin\coreclr\windows.x64.Release\IL\System.Private.CoreLib.dll -Destination artifacts\tests\coreclr\windows.x64.Release\Tests\Core_Root
Now we can run some jit-diffs:
New-Item -ItemType Directory -Force -Path C:\prj\jit-diffs
jit-diff diff --output C:\prj\jit-diffs --corelib --core_root C:\prj\runtime\artifacts\tests\coreclr\windows.x64.Release\Tests\Core_Root_base --base C:\prj\runtime\artifacts\bin\coreclr\windows.x64.Checked --crossgen C:\prj\runtime\artifacts\tests\coreclr\windows.x64.Release\Tests\Core_Root_base\crossgen2\crossgen2.exe
jit-diff diff --output C:\prj\jit-diffs --corelib --core_root C:\prj\runtime\artifacts\tests\coreclr\windows.x64.Release\Tests\Core_Root --base C:\prj\runtime\artifacts\bin\coreclr\windows.x64.Checked --crossgen C:\prj\runtime\artifacts\tests\coreclr\windows.x64.Release\Tests\Core_Root\crossgen2\crossgen2.exe
jit-analyze -b C:\prj\jit-diffs\dasmset_1\base -d C:\prj\jit-diffs\dasmset_2\base -r -c 100
NOTE: I'd recommend to clear C:\prj\jit-diffs
content before every run (this script is hardcoded to dasmset_1 and dasmset_2)
NOTE2: replace --corelib
with -f
if you want to run diffs for the whole BCL
๐ comes in very handy (will need it the next days ๐).
Can you move this (helpful) information to
runtime/docs
? It's easier findable there, than here or in jitutils-repo.Or just supplement https://github.com/dotnet/jitutils/blob/main/doc/diffs.md?