示例#1
0
 public override void Push(IlBuilder builder)
 {
     if (Index <= 3)
     {
         builder.EmitOpCode(OpCodeUtil.GetOpcode("Ldloc_" + Index));
     }
     else
     {
         builder.EmitOpCode(OpCodeUtil.GetOpcode("Ldloc"), Index);
     }
 }
示例#2
0
 public override void Store(IlBuilder builder, CodeValue val)
 {
     builder.PushValue(val);
     if (Index <= 3)
     {
         builder.EmitOpCode(OpCodeUtil.GetOpcode("Stloc_" + Index));
     }
     else
     {
         builder.EmitOpCode(OpCodeUtil.GetOpcode("Stloc"), Index);
     }
 }
示例#3
0
 public override void Push(IlBuilder builder)
 {
     if (_indexerCall == null)
     {
         builder.PushValue(_array);
         builder.PushValue(_index);
         builder.EmitOpCode(OpCodeUtil.GetOpcode("Ldelem_" + Type.OpName));
     }
     else
     {
         _indexerCall.Emit(builder);
     }
 }
示例#4
0
 public override void Store(IlBuilder builder, CodeValue source)
 {
     if (_indexerCall == null)
     {
         builder.PushValue(_array);
         builder.PushValue(_index);
         builder.PushValue(source);
         builder.EmitOpCode(OpCodeUtil.GetOpcode("Stelem_" + Type.OpName));
     }
     else
     {
         throw new NotImplementedException();
     }
 }
示例#5
0
        public override void Emit(IlBuilder builder)
        {
            base.Emit(builder);

            builder.PushValue(_rank);

            builder.EmitOpCode(OpCodes.Newarr, _typeof.TypeOf.Name);

            if (_entries == null)
            {
                return;
            }

            for (int i = 0; i < _entries.Length; i++)
            {
                builder.EmitOpCode(OpCodes.Dup);

                builder.PushValue(new CodeValue(BasicType.Int32, i));
                builder.PushValue(_entries[i]);
                builder.EmitOpCode(OpCodeUtil.GetOpcode("Stelem_" + _typeof.TypeOf.OpName));
            }
        }
示例#6
0
 public override void Store(IlBuilder builder, CodeValue val)
 {
     builder.PushValue(val);
     builder.EmitOpCode(OpCodeUtil.GetOpcode("Starg"), Index);
 }