예제 #1
0
 public override void Emit(IlCompilerContext ctx)
 {
     _expression.Emit(ctx);
     ctx.StackDepth--;
     ctx.Il.Emit(OpCodes.Castclass, _type);
     ctx.StackDepth++;
 }
예제 #2
0
 public override void Emit(IlCompilerContext ctx)
 {
     _target.Emit(ctx);
     _value.Emit(ctx);
     ctx.Il.Emit(OpCodes.Stfld, _field);
     ctx.StackDepth -= 2;
 }
예제 #3
0
 public override void Emit(IlCompilerContext ctx)
 {
     _target.Emit(ctx);
     ctx.StackDepth--;
     foreach (var arg in _args)
     {
         arg.Emit(ctx);
         ctx.StackDepth--;
     }
     if (_method.IsVirtual)
     {
         ctx.Il.EmitCall(OpCodes.Callvirt, _method, null);
     }
     else
     {
         ctx.Il.EmitCall(OpCodes.Call, _method, null);
     }
     if (_method.ReturnType != typeof(void))
     {
         ctx.StackDepth++;
     }
 }
예제 #4
0
 public override void Emit(IlCompilerContext ctx)
 {
     _value.Emit(ctx);
     ctx.Il.Emit(OpCodes.Stloc, _variable.VariableIndex);
     ctx.StackDepth--;
 }
예제 #5
0
 public override void Emit(IlCompilerContext ctx)
 {
     _target.Emit(ctx);
     ctx.Il.Emit(OpCodes.Ldfld, _field);
     //we are still at the same stack size as we consumed the target
 }
예제 #6
0
 public override void Emit(IlCompilerContext ctx)
 {
     _expression.Emit(ctx);
     ctx.Il.Emit(OpCodes.Unbox_Any, _type);
 }