Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Copying variables has only superficial values nowadays - the compiler will track variable lifetimes and allocate registers or spill them to stack as appropriate.

For C# specifically, if you want to scratch the itch, there is a way :) If you are using VS, you can install Disasmo extension and disassemble arbitrary methods with SHIFT+ALT+D (keep in mind it's ready-to-run-like codegen which does not have all optimizations).

You can also go further, and use `DOTNET_JitDisasm='methodName'` env variable - in this case you will see how method transitions through all compilation tiers (if it gets promoted past Tier 0). And last but not least, if you build your .NET binary with NativeAOT, you can just use standard disassembler, debugger or profiler you would use for C++ binaries.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: