This() public method

public This ( ) : ContextualOperand
return ContextualOperand
Exemplo n.º 1
0
 public void RevertContextualsIn(FrameScope fs, CodeGen cg)
 {
     foreach (var varname in MangledContextuals.Values)
     {
         if (fs.AssignedContextuals.Contains(varname))
         {
             if (cg.This().Type.Name != "TopLevelFrame")
             {
                 cg.If(cg.This().Field("_assigned_" + fs.ID + "_" + varname) > 0);
                 {
                     cg.Assign(cg.This().Field("TopLevelFrame").Field("_ctxl_" + varname), cg.This().Field("TopLevelFrame").Field("_stack_" + varname).Invoke("Pop"));
                     cg.Assign(cg.This().Field("_assigned_" + fs.ID + "_" + varname), 0);
                 }
                 cg.End();
             }
             else
             {
                 cg.If(cg.This().Field("_assigned_" + fs.ID + "_" + varname) > 0);
                 {
                     cg.Assign(cg.This().Field("_ctxl_" + varname), cg.This().Field("_stack_" + varname).Invoke("Pop"));
                     cg.Assign(cg.This().Field("_assigned_" + fs.ID + "_" + varname), 0);
                 }
                 cg.End();
             }
         }
     }
 }
Exemplo n.º 2
0
 // generates code that resets the lexical slots in the enclosing frame for re-entering
 //   a block (such as in a loop).  Effectively emulates a parameterless closure.
 public void RevertLexicalsIn(FrameScope fs, CodeGen cg)
 {
     foreach (var varname in fs.OwnKeysList)
     {
         if (fs[varname].Type.IsValueType)
         {
             cg.This().Field(fs[varname].MangledName).ForceEmitAddress(cg);
             cg.IL.Emit(OpCodes.Initobj, fs[varname].Type);
         }
         else
         {
             cg.Assign(cg.This().Field(fs[varname].MangledName), null);
         }
     }
 }