Produced this while looking at something else; might be interesting
Its ngen'd so caveats apply; Vector paths aren't taken and readonly statics aren't consts etc...
https://aoa.blob.core.windows.net/aspnet/Microsoft.AspNetCore.Server.Kestrel.dasm.txt
But should give flavour for what's inlined what's not, how things expand, what is converted to registers what not and why etc...
/cc @davidfowl @halter73 @cesarbs
Cool. How did you create the ngen dasm?
Twist on https://github.com/dotnet/coreclr/pull/6634#issuecomment-238048694
_Prep_
clrjit.dll from coreclr Checked (coreclr\bin\Product\Windows_NT.x64.Checked) over the one in publish dir_Iterations_
set COMPlus_JitPrintInlinedMethods=1jit-dasm on publish directory (see below)The command:
jit-dasm --platform MyAppbinReleasenetcoreapp1.0win7-x64publish --base MyAppbinReleasenetcoreapp1.0win7-x64publishcrossgen.exe --output M:outputKDNEW MyAppbinReleasenetcoreapp1.0win7-x64publishMicrosoft.AspNetCore.Server.Kestrel.dll
Would create a dasm file for Microsoft.AspNetCore.Server.Kestrel in M:\output\KDNEW\base
New info... so if you do the standalone app + publish, then copy the checked clrjit.dll over (Prep)
Then you can just set the set COMPlus_JitPrintInlinedMethods=1 flag and it will output all the inlines when you run it (won't do the dasm though).
Since its actually running it will take the vectors paths etc...
Also if you set set COMPlus_JitDisasm=* it will dump out all the jitted code when you run normally (using the checked clrjit.dll and everything else from clr Release)
Ok simplest path... Build coreclr checked and release (can keep using these till you want an new update of coreclr)
coreclr> build all x64 Checked Release skiptests
Build test app as win7-x64 standalone and publish
Copy all files from coreclr\bin\Product\Windows_NT.x64.Release and pdb to your standalone publish directory e.g. bin\Release\netcoreapp1.0\win7-x64\publish
Copy clrjit.dll over from checked coreclr\bin\Product\Windows_NT.x64.Checked into the same publish directory.
Set the enviorment vars
set COMPlus_JitPrintInlinedMethods=1
set COMPlus_JitDisasm=*
Run your standalone exe from the publish directory probably piping its output to a file > dasm.txt
You can also get the jit to only output a certain disassembly e.g. set COMPlus_JitDisasm=System.Generic.*
The jit will work in parallel, so wait for start up to complete before you try loading a page or the output will get interleaved.
Most helpful comment
Ok simplest path... Build coreclr checked and release (can keep using these till you want an new update of coreclr)
coreclr>
build all x64 Checked Release skiptestsBuild test app as win7-x64 standalone and publish
Copy all files from
coreclr\bin\Product\Windows_NT.x64.Releaseandpdbto your standalone publish directory e.g.bin\Release\netcoreapp1.0\win7-x64\publishCopy
clrjit.dllover from checkedcoreclr\bin\Product\Windows_NT.x64.Checkedinto the same publish directory.Set the enviorment vars
set COMPlus_JitPrintInlinedMethods=1set COMPlus_JitDisasm=*Run your standalone exe from the publish directory probably piping its output to a file
> dasm.txtYou can also get the jit to only output a certain disassembly e.g.
set COMPlus_JitDisasm=System.Generic.*The jit will work in parallel, so wait for start up to complete before you try loading a page or the output will get interleaved.