protected BoundStatement CacheThisIfNeeded() { // restore "this" cache, if there is a cache if ((object)this.cachedThis != null) { CapturedSymbolReplacement proxy = proxies[this.OriginalMethod.ThisParameter]; var fetchThis = proxy.Replacement(F.Syntax, frameType => F.This()); return(F.Assignment(F.Local(this.cachedThis), fetchThis)); } // do nothing return(F.StatementList()); }
public override BoundNode VisitBaseReference(BoundBaseReference node) { // TODO: fix up the type of the resulting node to be the base type // if "this" is cached, return it. if ((object)this.cachedThis != null) { return(F.Local(this.cachedThis)); } CapturedSymbolReplacement proxy = proxies[this.OriginalMethod.ThisParameter]; Debug.Assert(proxy != null); return(proxy.Replacement(F.Syntax, frameType => F.This())); }