On Wed, Aug 28, 2013 at 11:31 AM, Jonathan S. Shapiro <[email protected]>wrote:
> Delegates cannot be inlined easily, because they are potentially mutable > on-heap structures. The inlining itself is simple. The analysis required to > determine that the inlining doesn't break the semantics is harder. > Why would run-time inlining a delegate be any harder than inlining any polymorphic method call? There is a type (the class or delegate type), there is state (the object instance data or delegate capture data), there is a virtual method call itself. I haven't dug deep enough, but I've always assumed Delegates were just some syntax sugar around a class construction, which in the case of anonymous inline delegates/lambdas can capture local state through the constructor. I admit I'm curious how they can have side-effects on local scope variables. I assumed the local variables are turned into borrowed references into the anonymous delegate, but I have never looked.
_______________________________________________ bitc-dev mailing list [email protected] http://www.coyotos.org/mailman/listinfo/bitc-dev
