[Mono-bugs] [Bug 593628] Attempting to JIT compile method Cols.Where(c => !c.Hidden).Sum(c => c.Width)

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Apr 4 14:32:27 EDT 2010


http://bugzilla.novell.com/show_bug.cgi?id=593628

http://bugzilla.novell.com/show_bug.cgi?id=593628#c1


Miguel de Icaza <miguel at novell.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |miguel at novell.com

--- Comment #1 from Miguel de Icaza <miguel at novell.com> 2010-04-04 18:32:26 UTC ---
A few thoughts, this is happening because we call this:

public static float Sum<TSource> (this IEnumerable<TSource> source,
Func<TSource, float> selector)

And our implementation is trying to share as much code as possible with other
implementations, but in the process we introduce a new Func`3 that the AOT
engine has no visibility on (a topic for a separate discussion, and something
worth researching) but we end up calling:

return Sum<TSource, float> (source, (a, b) => checked (a + selector (b)));

And this is where we fail, the code for this is:

public static float Sum<TSource> (this IEnumerable<TSource> source,
Func<TSource, float> selector)
{
Check.SourceAndSelector (source, selector);
return Sum<TSource, float> (source, (a, b) => checked (a + selector (b)));
}

Since this not only adds another layer of indirection, and a helper function
that needs to be JITed in any case, perhaps we should just inline all of these
cases

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list