Author: martin
Date: 2006-11-16 11:57:22 -0500 (Thu, 16 Nov 2006)
New Revision: 68010
Modified:
branches/martin/anonymous-methods2/mcs/anonymous.cs
Log:
We don't need 'Host'; just use 'RootScope' instead.
Modified: branches/martin/anonymous-methods2/mcs/anonymous.cs
===================================================================
--- branches/martin/anonymous-methods2/mcs/anonymous.cs 2006-11-16 16:29:04 UTC
(rev 68009)
+++ branches/martin/anonymous-methods2/mcs/anonymous.cs 2006-11-16 16:57:22 UTC
(rev 68010)
@@ -192,10 +192,6 @@
Hashtable locals = new Hashtable ();
- protected virtual AnonymousMethodHost Host {
- get { return RootScope; }
- }
-
public Variable ScopeInstance {
get { return scope_instance; }
}
@@ -258,7 +254,7 @@
AnonymousMethodHost root_scope = (AnonymousMethodHost)
toplevel.AnonymousMethodHost;
root_scope.EmitScopeInstance (ec);
- while (root_scope != scope.Host) {
+ while (root_scope != scope.RootScope) {
ec.ig.Emit (OpCodes.Ldfld,
root_scope.ParentLink.FieldBuilder);
root_scope = root_scope.ParentHost;
@@ -268,7 +264,7 @@
scope, ec.CurrentBlock.ID);
}
- if (scope != (ScopeInfo) scope.Host)
+ if (scope != (ScopeInfo) scope.RootScope)
scope.ScopeInstance.Emit (ec);
}
@@ -298,8 +294,8 @@
Report.Debug (64, "SCOPE INFO RESOLVE MEMBERS", this,
GetType (), IsGeneric,
Parent.IsGeneric, GenericMethod);
- if ((ScopeInfo) Host != this)
- scope_instance = new CapturedScope ((ScopeInfo)
Host, this);
+ if (RootScope != this)
+ scope_instance = new CapturedScope (RootScope,
this);
return base.DoResolveMembers ();
}
@@ -502,7 +498,7 @@
if (Scope.ScopeInstance == null)
scope_instance = ec.ig.DeclareLocal
(type);
else {
- Type root = Scope.Host.GetScopeType
(ec);
+ Type root =
Scope.RootScope.GetScopeType (ec);
FieldExpr fe = (FieldExpr)
Expression.MemberLookup (
type, root,
Scope.scope_instance.Field.Name, loc);
if (fe == null)
@@ -584,8 +580,8 @@
ec.ig.Emit (OpCodes.Pop);
ec.ig.Emit (OpCodes.Nop);
- if (Scope != Scope.Host)
- Scope.Host.EmitScopeInstance (ec);
+ if (Scope != Scope.RootScope)
+ Scope.RootScope.EmitScopeInstance (ec);
else if (Scope.ScopeInstance != null)
ec.ig.Emit (OpCodes.Ldarg_0);
EmitScopeConstructor (ec);
@@ -631,10 +627,6 @@
CapturedThis this_variable;
Hashtable captured_params;
- protected override AnonymousMethodHost Host {
- get { return this; }
- }
-
public virtual bool IsIterator {
get { return false; }
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches