I believe it would be expensive too as far as I understand how IL is
then transformed to native code: each method found within IL will be
transformed in a native method call and if a program uses say, for
instance, a simple for loop on hundreds of classes' methods, adding a
"nested" method call would increase cpu usage.

On another hand, I managed to inject the code before every ret making
sure that the stack stays correct when a value is returned.

However, I have some PEVerify errors in assemblies that use Generics
stating that fields inside generic classes should be referenced using
MemberRefs even on the same module than the class. How can I solve
that?

Thanks

On 8 juil, 11:16, Gábor Kozár <[email protected]> wrote:
> I mean that method calls are expensive operations, unless, of course, the
> JIT decides to inline them.
>
> 2011/7/8 Jb Evain <[email protected]>
>
>
>
> > On Fri, Jul 8, 2011 at 11:08 AM, Gábor Kozár <[email protected]> wrote:
> > > But wouldn't that hurt performance? I realize that the JIT can inline
> > > methods when it feels like it, but I don't know under what circumstances.
>
> > Not more than injecting code at every ret point.
>
> > Jb
>
> > --
> > --
> > mono-cecil- Masquer le texte des messages précédents -
>
> - Afficher le texte des messages précédents -

-- 
--
mono-cecil

Reply via email to