Author: martin
Date: 2005-05-10 16:26:02 -0400 (Tue, 10 May 2005)
New Revision: 44347
Modified:
trunk/mcs/gmcs/ChangeLog
trunk/mcs/gmcs/pending.cs
Log:
**** Merged r43920 from MCS ****
Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog 2005-05-10 19:37:52 UTC (rev 44346)
+++ trunk/mcs/gmcs/ChangeLog 2005-05-10 20:26:02 UTC (rev 44347)
@@ -78,6 +78,14 @@
(Foreach.EmitArrayForeach): Removed; this is now in the new
ArrayForeach class.
+2005-05-03 Raja R Harinath <[EMAIL PROTECTED]>
+
+ Fix #74773.
+ * pending.cs (VerifyPendingMethods): If a base type implements the
+ requested interface, don't bother checking individual methods of
+ the base type. As a side-effect, this prevents the creation of
+ unnecessary proxies.
+
2005-05-02 Martin Baulig <[EMAIL PROTECTED]>
Fix #70182.
Modified: trunk/mcs/gmcs/pending.cs
===================================================================
--- trunk/mcs/gmcs/pending.cs 2005-05-10 19:37:52 UTC (rev 44346)
+++ trunk/mcs/gmcs/pending.cs 2005-05-10 20:26:02 UTC (rev 44347)
@@ -533,6 +533,14 @@
return false;
MethodInfo base_method = (MethodInfo) list [0];
+
+ //
+ // FIXME: We shouldn't be creating proxies
unconditionally.
+ // The runtime can handle most cases.
+ //
+ // At worst, if we can't avoid creating the
proxy, we
+ // may need to make the proxy use Callvirt.
+ //
if (!base_method.IsAbstract)
DefineProxy (iface_type, base_method, mi, args);
return true;
@@ -552,6 +560,10 @@
Type type = pending_implementations [i].type;
int j = 0;
+ bool base_implements_type = type.IsInterface &&
+ container.TypeBuilder.BaseType != null
&&
+ TypeManager.ImplementsInterface
(container.TypeBuilder.BaseType, type);
+
foreach (MethodInfo mi in
pending_implementations [i].methods){
if (mi == null)
continue;
@@ -566,7 +578,7 @@
continue;
}
- if (BaseImplements (type, mi))
+ if (base_implements_type ||
BaseImplements (type, mi))
continue;
if (pending_implementations
[i].optional)
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches