Tag Archives: cil

Mono.Cecil – Simplify and Optimize macros

You may have seen it, but what does it actually do? Do I need to add them? When we write IL macros, we emit instruction after instruction to the method body. Instruction, is operation to do (e.g. math operations, load\store, … Continue reading

Posted in .NET, c# | Tagged , , , , , | Leave a comment

Mono.Cecil – IAssemblyResolver

One of the important thing you need to know when you start to do real work with Cecil is the IAssemblyResolver The role of this interface, is to handle module resolving.

Posted in .NET, c# | Tagged , , , | Leave a comment

Value type methods – call, callvirt, constrained and hidden boxing

Long time ago I wrote a post here on  call vs callvirt and the needed of the this null check. Here I want to wrote about this topic but on value types. Look on these three ToString() calls:

Posted in .NET, c#, Roslyn | Tagged , , , , , , , | Leave a comment

IL Call Vs. Callvirt Instruction Part Two

In the first part I wrote about what is call and callvirt, what the differences and why should I care. We saw that even non-virtual methods called via callvirt instruction because the null check reason. But with this sense when this is … Continue reading

Posted in .NET | Tagged , , , , , , | Leave a comment

IL Call Vs. Callvirt Instruction

.NET languages compiles to IL code (aka msil or cil) The IL code contains instructions that in run time the jit compiler translate it to machine code. In this post I want to talk about method call instructions. When we writing … Continue reading

Posted in .NET | Tagged , , , , , , | 4 Comments