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. Although this potentially could be one, as the cached method would only be called in a single other method (that was generated)...
2011/7/8 Jb Evain <[email protected]> > On Thu, Jul 7, 2011 at 2:30 PM, Indiefreaks.com > <[email protected]> wrote: > > I may also go down the route of cloning the current method and adding > > it (with a different name) to the current class and then clear the > > current method instructions and surround a call to the cached method > > by my profiling code making sure that I catch the returned value if > > different from "System.Void" to return it back once the original > > method ends... > > This is much easier. > > Jb > > -- > -- > mono-cecil -- -- mono-cecil
