[Mono-bugs] [Bug 643377] EqualityComparer<T> Attempts to JIT compile when deployed to the device

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Oct 4 15:27:05 EDT 2010


https://bugzilla.novell.com/show_bug.cgi?id=643377

https://bugzilla.novell.com/show_bug.cgi?id=643377#c5


--- Comment #5 from Jonathan Pryor <jpryor at novell.com> 2010-10-04 19:27:04 UTC ---
I haven't tested, but I'm reasonably sure that Type.GetType() is supported, as
is Type.MakeGenericType(), as both do not require runtime code gen/JIT.

What's problemetic is Activator.CreateInstance(Type), as _that_ may require the
execution of the static constructor for the specified type, which _may_ require
runtime code generation and execution.

For example, EqualityComparer<SomeReferenceType>.Default is fine, as (due to
generics sharing) no new code needs to be generated.  It's only
EqualityComparer<SomeValueType>.Default which fails, as that requires executing
the EqualityComparer<T> static constructor, which require generating and
executing new code (as we can't share the representation of value type
instantiations in the same way we can reference type instantiations).

Where Type.GetType() can fail is if it needs to JIT code in order to operate. 
Offhand I can't think of any scenario that would require this, but I can't rule
it out.

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


More information about the mono-bugs mailing list