public override void Push(IlBuilder builder) { if (Index <= 3) { builder.EmitOpCode(OpCodeUtil.GetOpcode("Ldloc_" + Index)); } else { builder.EmitOpCode(OpCodeUtil.GetOpcode("Ldloc"), Index); } }
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); } }
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); } }
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(); } }
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)); } }
public override void Store(IlBuilder builder, CodeValue val) { builder.PushValue(val); builder.EmitOpCode(OpCodeUtil.GetOpcode("Starg"), Index); }