예제 #1
0
 public override void Emit(IEasyMember member, ILGenerator gen)
 {
     ArgumentsUtil.EmitLoadOwnerAndReference(this._syncLockSource, gen);
     //gen.Emit(OpCodes.Call, typeof(Monitor).GetMethod("Enter"));
     //在2.0中没问题 vs2010 2.0中修改该处
     gen.Emit(OpCodes.Call, typeof(Monitor).GetMethod("Enter", new Type[] { typeof(object) }));
     gen.BeginExceptionBlock();
     foreach (Statement statement in this._stmts)
     {
         statement.Emit(member, gen);
     }
     gen.BeginFinallyBlock();
     ArgumentsUtil.EmitLoadOwnerAndReference(this._syncLockSource, gen);
     gen.Emit(OpCodes.Call, typeof(Monitor).GetMethod("Exit"));
     gen.EndExceptionBlock();
 }
예제 #2
0
 public override void Emit(IEasyMember member, ILGenerator gen)
 {
     if (this._reference != null)
     {
         ArgumentsUtil.EmitLoadOwnerAndReference(this._reference, gen);
     }
     else if (this._expression != null)
     {
         this._expression.Emit(member, gen);
     }
     else if (member.ReturnType != typeof(void))
     {
         OpCodeUtil.EmitLoadOpCodeForDefaultValueOfType(gen, member.ReturnType);
     }
     gen.Emit(OpCodes.Ret);
 }
예제 #3
0
 public override void Emit(IEasyMember member, ILGenerator gen)
 {
     ArgumentsUtil.EmitLoadOwnerAndReference(this._arrayReference, gen);
     ArgumentsUtil.EmitLoadOwnerAndReference(this._index, gen);
     gen.Emit(OpCodes.Ldelem_Ref);
 }
예제 #4
0
 public override void Emit(IEasyMember member, ILGenerator gen)
 {
     ArgumentsUtil.EmitLoadOwnerAndReference(this._reference, gen);
 }
예제 #5
0
 public override void Emit(IEasyMember member, ILGenerator gen)
 {
     ArgumentsUtil.EmitLoadOwnerAndReference(this._target.OwnerReference, gen);
     this._expression.Emit(member, gen);
     this._target.StoreReference(gen);
 }