本文整理汇总了C#中System.Linq.Expressions.Interpreter.Instruction类的典型用法代码示例。如果您正苦于以下问题:C# Instruction类的具体用法?C# Instruction怎么用?C# Instruction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Instruction类属于System.Linq.Expressions.Interpreter命名空间,在下文中一共展示了Instruction类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: InstructionArray
internal InstructionArray(int maxStackDepth, int maxContinuationDepth, Instruction[] instructions,
object[] objects, RuntimeLabel[] labels, List<KeyValuePair<int, object>> debugCookies)
{
MaxStackDepth = maxStackDepth;
MaxContinuationDepth = maxContinuationDepth;
Instructions = instructions;
DebugCookies = debugCookies;
Objects = objects;
Labels = labels;
}
开发者ID:jsalvadorp,项目名称:corefx,代码行数:10,代码来源:InstructionList.cs
示例2: Create
public static Instruction Create(Type type)
{
Debug.Assert(!type.GetTypeInfo().IsEnum);
switch (type.GetNonNullableType().GetTypeCode())
{
case TypeCode.Int16: return s_int16 ?? (s_int16 = new NegateCheckedInt16());
case TypeCode.Int32: return s_int32 ?? (s_int32 = new NegateCheckedInt32());
case TypeCode.Int64: return s_int64 ?? (s_int64 = new NegateCheckedInt64());
case TypeCode.Single: return s_single ?? (s_single = new NegateCheckedSingle());
case TypeCode.Double: return s_double ?? (s_double = new NegateCheckedDouble());
default:
throw Error.ExpressionNotSupportedForType("NegateChecked", type);
}
}
开发者ID:wangyanjun,项目名称:corefx,代码行数:14,代码来源:NegateInstruction.cs
示例3: Create
public static Instruction Create(Type type)
{
// Boxed enums can be unboxed as their underlying types:
Type underlyingType = type.GetTypeInfo().IsEnum ? Enum.GetUnderlyingType(type) : TypeUtils.GetNonNullableType(type);
switch (underlyingType.GetTypeCode())
{
case TypeCode.SByte: return s_SByte ?? (s_SByte = new LeftShiftSByte());
case TypeCode.Byte: return s_byte ?? (s_byte = new LeftShiftByte());
case TypeCode.Int16: return s_int16 ?? (s_int16 = new LeftShiftInt16());
case TypeCode.Int32: return s_int32 ?? (s_int32 = new LeftShiftInt32());
case TypeCode.Int64: return s_int64 ?? (s_int64 = new LeftShiftInt64());
case TypeCode.UInt16: return s_UInt16 ?? (s_UInt16 = new LeftShiftUInt16());
case TypeCode.UInt32: return s_UInt32 ?? (s_UInt32 = new LeftShiftUInt32());
case TypeCode.UInt64: return s_UInt64 ?? (s_UInt64 = new LeftShiftUInt64());
default:
throw Error.ExpressionNotSupportedForType("LeftShift", type);
}
}
开发者ID:alessandromontividiu03,项目名称:corefx,代码行数:21,代码来源:LeftShiftInstruction.cs
示例4: Create
public static Instruction Create(Type type)
{
Debug.Assert(type.IsArithmetic());
switch (type.GetNonNullableType().GetTypeCode())
{
case TypeCode.Int16: return s_int16 ?? (s_int16 = new SubOvfInt16());
case TypeCode.Int32: return s_int32 ?? (s_int32 = new SubOvfInt32());
case TypeCode.Int64: return s_int64 ?? (s_int64 = new SubOvfInt64());
case TypeCode.UInt16: return s_UInt16 ?? (s_UInt16 = new SubOvfUInt16());
case TypeCode.UInt32: return s_UInt32 ?? (s_UInt32 = new SubOvfUInt32());
case TypeCode.UInt64: return s_UInt64 ?? (s_UInt64 = new SubOvfUInt64());
default:
return SubInstruction.Create(type);
}
}
开发者ID:rajansingh10,项目名称:corefx,代码行数:15,代码来源:SubInstruction.cs
示例5: Create
public static Instruction Create(Type t)
{
switch (System.Dynamic.Utils.TypeExtensions.GetTypeCode(TypeUtils.GetNonNullableType(t)))
{
case TypeCode.Boolean: return _Bool ?? (_Bool = new BoolNot());
case TypeCode.Int64: return _Int64 ?? (_Int64 = new Int64Not());
case TypeCode.Int32: return _Int32 ?? (_Int32 = new Int32Not());
case TypeCode.Int16: return _Int16 ?? (_Int16 = new Int16Not());
case TypeCode.UInt64: return _UInt64 ?? (_UInt64 = new UInt64Not());
case TypeCode.UInt32: return _UInt32 ?? (_UInt32 = new UInt32Not());
case TypeCode.UInt16: return _UInt16 ?? (_UInt16 = new UInt16Not());
case TypeCode.Byte: return _Byte ?? (_Byte = new ByteNot());
case TypeCode.SByte: return _SByte ?? (_SByte = new SByteNot());
default:
throw new InvalidOperationException("Not for " + t.ToString());
}
}
开发者ID:nnyamhon,项目名称:corefx,代码行数:17,代码来源:Instruction.cs
示例6: Create
public static Instruction Create(Type type)
{
// Boxed enums can be unboxed as their underlying types:
switch (System.Dynamic.Utils.TypeExtensions.GetTypeCode(type.GetTypeInfo().IsEnum ? Enum.GetUnderlyingType(type) : TypeUtils.GetNonNullableType(type)))
{
case TypeCode.SByte: return s_SByte ?? (s_SByte = new OrSByte());
case TypeCode.Byte: return s_byte ?? (s_byte = new OrByte());
case TypeCode.Int16: return s_int16 ?? (s_int16 = new OrInt16());
case TypeCode.Int32: return s_int32 ?? (s_int32 = new OrInt32());
case TypeCode.Int64: return s_int64 ?? (s_int64 = new OrInt64());
case TypeCode.UInt16: return s_UInt16 ?? (s_UInt16 = new OrUInt16());
case TypeCode.UInt32: return s_UInt32 ?? (s_UInt32 = new OrUInt32());
case TypeCode.UInt64: return s_UInt64 ?? (s_UInt64 = new OrUInt64());
case TypeCode.Boolean: return s_bool ?? (s_bool = new OrBool());
default:
throw Error.ExpressionNotSupportedForType("Or", type);
}
}
开发者ID:geoffkizer,项目名称:corefx,代码行数:20,代码来源:OrInstruction.cs
示例7: Create
public static Instruction Create(Type type, bool liftedToNull = false)
{
Debug.Assert(!type.GetTypeInfo().IsEnum);
if (liftedToNull)
{
switch (type.GetNonNullableType().GetTypeCode())
{
case TypeCode.SByte: return s_liftedToNullSByte ?? (s_liftedToNullSByte = new LessThanOrEqualSByte(null));
case TypeCode.Byte: return s_liftedToNullByte ?? (s_liftedToNullByte = new LessThanOrEqualByte(null));
case TypeCode.Char: return s_liftedToNullChar ?? (s_liftedToNullChar = new LessThanOrEqualChar(null));
case TypeCode.Int16: return s_liftedToNullInt16 ?? (s_liftedToNullInt16 = new LessThanOrEqualInt16(null));
case TypeCode.Int32: return s_liftedToNullInt32 ?? (s_liftedToNullInt32 = new LessThanOrEqualInt32(null));
case TypeCode.Int64: return s_liftedToNullInt64 ?? (s_liftedToNullInt64 = new LessThanOrEqualInt64(null));
case TypeCode.UInt16: return s_liftedToNullUInt16 ?? (s_liftedToNullUInt16 = new LessThanOrEqualUInt16(null));
case TypeCode.UInt32: return s_liftedToNullUInt32 ?? (s_liftedToNullUInt32 = new LessThanOrEqualUInt32(null));
case TypeCode.UInt64: return s_liftedToNullUInt64 ?? (s_liftedToNullUInt64 = new LessThanOrEqualUInt64(null));
case TypeCode.Single: return s_liftedToNullSingle ?? (s_liftedToNullSingle = new LessThanOrEqualSingle(null));
case TypeCode.Double: return s_liftedToNullDouble ?? (s_liftedToNullDouble = new LessThanOrEqualDouble(null));
default:
throw Error.ExpressionNotSupportedForType("LessThanOrEqual", type);
}
}
else
{
switch (type.GetNonNullableType().GetTypeCode())
{
case TypeCode.SByte: return s_SByte ?? (s_SByte = new LessThanOrEqualSByte(Utils.BoxedFalse));
case TypeCode.Byte: return s_byte ?? (s_byte = new LessThanOrEqualByte(Utils.BoxedFalse));
case TypeCode.Char: return s_char ?? (s_char = new LessThanOrEqualChar(Utils.BoxedFalse));
case TypeCode.Int16: return s_int16 ?? (s_int16 = new LessThanOrEqualInt16(Utils.BoxedFalse));
case TypeCode.Int32: return s_int32 ?? (s_int32 = new LessThanOrEqualInt32(Utils.BoxedFalse));
case TypeCode.Int64: return s_int64 ?? (s_int64 = new LessThanOrEqualInt64(Utils.BoxedFalse));
case TypeCode.UInt16: return s_UInt16 ?? (s_UInt16 = new LessThanOrEqualUInt16(Utils.BoxedFalse));
case TypeCode.UInt32: return s_UInt32 ?? (s_UInt32 = new LessThanOrEqualUInt32(Utils.BoxedFalse));
case TypeCode.UInt64: return s_UInt64 ?? (s_UInt64 = new LessThanOrEqualUInt64(Utils.BoxedFalse));
case TypeCode.Single: return s_single ?? (s_single = new LessThanOrEqualSingle(Utils.BoxedFalse));
case TypeCode.Double: return s_double ?? (s_double = new LessThanOrEqualDouble(Utils.BoxedFalse));
default:
throw Error.ExpressionNotSupportedForType("LessThanOrEqual", type);
}
}
}
开发者ID:wangyanjun,项目名称:corefx,代码行数:44,代码来源:LessThanOrEqualInstruction.cs
示例8: Create
public static Instruction Create(Type type)
{
// Boxed enums can be unboxed as their underlying types:
Type underlyingType = type.GetTypeInfo().IsEnum ? Enum.GetUnderlyingType(type) : type.GetNonNullableType();
switch (underlyingType.GetTypeCode())
{
case TypeCode.SByte: return s_SByte ?? (s_SByte = new AndSByte());
case TypeCode.Int16: return s_Int16 ?? (s_Int16 = new AndInt16());
case TypeCode.Int32: return s_Int32 ?? (s_Int32 = new AndInt32());
case TypeCode.Int64: return s_Int64 ?? (s_Int64 = new AndInt64());
case TypeCode.Byte: return s_Byte ?? (s_Byte = new AndByte());
case TypeCode.UInt16: return s_UInt16 ?? (s_UInt16 = new AndUInt16());
case TypeCode.UInt32: return s_UInt32 ?? (s_UInt32 = new AndUInt32());
case TypeCode.UInt64: return s_UInt64 ?? (s_UInt64 = new AndUInt64());
case TypeCode.Boolean: return s_Boolean ?? (s_Boolean = new AndBoolean());
default:
throw Error.ExpressionNotSupportedForType("And", type);
}
}
开发者ID:chcosta,项目名称:corefx,代码行数:20,代码来源:AndInstruction.cs
示例9: Emit
public void Emit(Instruction instruction)
{
_instructions.Add(instruction);
UpdateStackDepth(instruction);
}
开发者ID:jsalvadorp,项目名称:corefx,代码行数:5,代码来源:InstructionList.cs
示例10: InstructionView
public InstructionView(Instruction instruction, string name, int index, int stackDepth, int continuationsDepth)
{
_instruction = instruction;
_name = name;
_index = index;
_stackDepth = stackDepth;
_continuationsDepth = continuationsDepth;
}
开发者ID:jsalvadorp,项目名称:corefx,代码行数:8,代码来源:InstructionList.cs
示例11: Create
public static Instruction Create(Type type)
{
Debug.Assert(!type.GetTypeInfo().IsEnum);
switch (TypeUtils.GetNonNullableType(type).GetTypeCode())
{
case TypeCode.Int16: return s_int16 ?? (s_int16 = new IncrementInt16());
case TypeCode.Int32: return s_int32 ?? (s_int32 = new IncrementInt32());
case TypeCode.Int64: return s_int64 ?? (s_int64 = new IncrementInt64());
case TypeCode.UInt16: return s_UInt16 ?? (s_UInt16 = new IncrementUInt16());
case TypeCode.UInt32: return s_UInt32 ?? (s_UInt32 = new IncrementUInt32());
case TypeCode.UInt64: return s_UInt64 ?? (s_UInt64 = new IncrementUInt64());
case TypeCode.Single: return s_single ?? (s_single = new IncrementSingle());
case TypeCode.Double: return s_double ?? (s_double = new IncrementDouble());
default:
throw Error.ExpressionNotSupportedForType("Increment", type);
}
}
开发者ID:alessandromontividiu03,项目名称:corefx,代码行数:18,代码来源:IncrementInstruction.cs
示例12: Create
public static Instruction Create(Type type, bool liftedToNull)
{
// Boxed enums can be unboxed as their underlying types:
Type underlyingType = type.GetTypeInfo().IsEnum ? Enum.GetUnderlyingType(type) : type.GetNonNullableType();
if (liftedToNull)
{
switch (underlyingType.GetTypeCode())
{
case TypeCode.Boolean: return s_booleanLiftedToNull ?? (s_booleanLiftedToNull = new EqualBooleanLiftedToNull());
case TypeCode.SByte: return s_SByteLiftedToNull ?? (s_SByteLiftedToNull = new EqualSByteLiftedToNull());
case TypeCode.Byte: return s_byteLiftedToNull ?? (s_byteLiftedToNull = new EqualByteLiftedToNull());
case TypeCode.Char: return s_charLiftedToNull ?? (s_charLiftedToNull = new EqualCharLiftedToNull());
case TypeCode.Int16: return s_int16LiftedToNull ?? (s_int16LiftedToNull = new EqualInt16LiftedToNull());
case TypeCode.Int32: return s_int32LiftedToNull ?? (s_int32LiftedToNull = new EqualInt32LiftedToNull());
case TypeCode.Int64: return s_int64LiftedToNull ?? (s_int64LiftedToNull = new EqualInt64LiftedToNull());
case TypeCode.UInt16: return s_UInt16LiftedToNull ?? (s_UInt16LiftedToNull = new EqualUInt16LiftedToNull());
case TypeCode.UInt32: return s_UInt32LiftedToNull ?? (s_UInt32LiftedToNull = new EqualUInt32LiftedToNull());
case TypeCode.UInt64: return s_UInt64LiftedToNull ?? (s_UInt64LiftedToNull = new EqualUInt64LiftedToNull());
case TypeCode.Single: return s_singleLiftedToNull ?? (s_singleLiftedToNull = new EqualSingleLiftedToNull());
default:
Debug.Assert(underlyingType.GetTypeCode() == TypeCode.Double);
return s_doubleLiftedToNull ?? (s_doubleLiftedToNull = new EqualDoubleLiftedToNull());
}
}
else
{
switch (underlyingType.GetTypeCode())
{
case TypeCode.Boolean: return s_boolean ?? (s_boolean = new EqualBoolean());
case TypeCode.SByte: return s_SByte ?? (s_SByte = new EqualSByte());
case TypeCode.Byte: return s_byte ?? (s_byte = new EqualByte());
case TypeCode.Char: return s_char ?? (s_char = new EqualChar());
case TypeCode.Int16: return s_int16 ?? (s_int16 = new EqualInt16());
case TypeCode.Int32: return s_int32 ?? (s_int32 = new EqualInt32());
case TypeCode.Int64: return s_int64 ?? (s_int64 = new EqualInt64());
case TypeCode.UInt16: return s_UInt16 ?? (s_UInt16 = new EqualUInt16());
case TypeCode.UInt32: return s_UInt32 ?? (s_UInt32 = new EqualUInt32());
case TypeCode.UInt64: return s_UInt64 ?? (s_UInt64 = new EqualUInt64());
case TypeCode.Single: return s_single ?? (s_single = new EqualSingle());
case TypeCode.Double: return s_double ?? (s_double = new EqualDouble());
default:
// Nullable only valid if one operand is constant null, so this assert is slightly too broad.
Debug.Assert(type.IsNullableOrReferenceType());
return s_reference ?? (s_reference = new EqualReference());
}
}
}
开发者ID:nayato,项目名称:corefx,代码行数:54,代码来源:EqualInstruction.cs
示例13: Create
public static Instruction Create(Type type)
{
Debug.Assert(TypeUtils.IsArithmetic(type));
switch (System.Dynamic.Utils.TypeExtensions.GetTypeCode(TypeUtils.GetNonNullableType(type)))
{
case TypeCode.Int16: return s_int16 ?? (s_int16 = new AddOvfInt16());
case TypeCode.Int32: return s_int32 ?? (s_int32 = new AddOvfInt32());
case TypeCode.Int64: return s_int64 ?? (s_int64 = new AddOvfInt64());
case TypeCode.UInt16: return s_UInt16 ?? (s_UInt16 = new AddOvfUInt16());
case TypeCode.UInt32: return s_UInt32 ?? (s_UInt32 = new AddOvfUInt32());
case TypeCode.UInt64: return s_UInt64 ?? (s_UInt64 = new AddOvfUInt64());
default:
return AddInstruction.Create(type);
}
}
开发者ID:ChuangYang,项目名称:corefx,代码行数:16,代码来源:AddInstruction.cs
示例14: Create
public static Instruction Create(Type type)
{
switch (TypeUtils.GetNonNullableType(type).GetTypeCode())
{
case TypeCode.Boolean: return _Bool ?? (_Bool = new BoolNot());
case TypeCode.Int64: return _Int64 ?? (_Int64 = new Int64Not());
case TypeCode.Int32: return _Int32 ?? (_Int32 = new Int32Not());
case TypeCode.Int16: return _Int16 ?? (_Int16 = new Int16Not());
case TypeCode.UInt64: return _UInt64 ?? (_UInt64 = new UInt64Not());
case TypeCode.UInt32: return _UInt32 ?? (_UInt32 = new UInt32Not());
case TypeCode.UInt16: return _UInt16 ?? (_UInt16 = new UInt16Not());
case TypeCode.Byte: return _Byte ?? (_Byte = new ByteNot());
case TypeCode.SByte: return _SByte ?? (_SByte = new SByteNot());
default:
throw Error.ExpressionNotSupportedForType("Not", type);
}
}
开发者ID:alessandromontividiu03,项目名称:corefx,代码行数:18,代码来源:NotInstruction.cs
示例15: Create
public static Instruction Create(Type type)
{
Debug.Assert(!type.IsEnum);
switch (TypeHelper.GetTypeCode(TypeHelper.GetNonNullableType(type)))
{
case TypeCode.Int16: return s_int16 ?? (s_int16 = new MulOvfInt16());
case TypeCode.Int32: return s_int32 ?? (s_int32 = new MulOvfInt32());
case TypeCode.Int64: return s_int64 ?? (s_int64 = new MulOvfInt64());
case TypeCode.UInt16: return s_UInt16 ?? (s_UInt16 = new MulOvfUInt16());
case TypeCode.UInt32: return s_UInt32 ?? (s_UInt32 = new MulOvfUInt32());
case TypeCode.UInt64: return s_UInt64 ?? (s_UInt64 = new MulOvfUInt64());
case TypeCode.Single: return s_single ?? (s_single = new MulOvfSingle());
case TypeCode.Double: return s_double ?? (s_double = new MulOvfDouble());
default:
throw Error.ExpressionNotSupportedForType("MulOvf", type);
}
}
开发者ID:mesheets,项目名称:Theraot-CF,代码行数:18,代码来源:MulInstruction.net30.cs
示例16: Create
public static Instruction Create(Type type, bool liftedToNull = false)
{
Debug.Assert(!type.GetTypeInfo().IsEnum);
if (liftedToNull)
{
switch (System.Dynamic.Utils.TypeExtensions.GetTypeCode(TypeUtils.GetNonNullableType(type)))
{
case TypeCode.SByte: return s_liftedToNullSByte ?? (s_liftedToNullSByte = new GreaterThanOrEqualSByte(null));
case TypeCode.Byte: return s_liftedToNullByte ?? (s_liftedToNullByte = new GreaterThanOrEqualByte(null));
case TypeCode.Char: return s_liftedToNullChar ?? (s_liftedToNullChar = new GreaterThanOrEqualChar(null));
case TypeCode.Int16: return s_liftedToNullInt16 ?? (s_liftedToNullInt16 = new GreaterThanOrEqualInt16(null));
case TypeCode.Int32: return s_liftedToNullInt32 ?? (s_liftedToNullInt32 = new GreaterThanOrEqualInt32(null));
case TypeCode.Int64: return s_liftedToNullInt64 ?? (s_liftedToNullInt64 = new GreaterThanOrEqualInt64(null));
case TypeCode.UInt16: return s_liftedToNullUInt16 ?? (s_liftedToNullUInt16 = new GreaterThanOrEqualUInt16(null));
case TypeCode.UInt32: return s_liftedToNullUInt32 ?? (s_liftedToNullUInt32 = new GreaterThanOrEqualUInt32(null));
case TypeCode.UInt64: return s_liftedToNullUInt64 ?? (s_liftedToNullUInt64 = new GreaterThanOrEqualUInt64(null));
case TypeCode.Single: return s_liftedToNullSingle ?? (s_liftedToNullSingle = new GreaterThanOrEqualSingle(null));
case TypeCode.Double: return s_liftedToNullDouble ?? (s_liftedToNullDouble = new GreaterThanOrEqualDouble(null));
default:
throw Error.ExpressionNotSupportedForType("GreaterThanOrEqual", type);
}
}
else
{
switch (System.Dynamic.Utils.TypeExtensions.GetTypeCode(TypeUtils.GetNonNullableType(type)))
{
case TypeCode.SByte: return s_SByte ?? (s_SByte = new GreaterThanOrEqualSByte(ScriptingRuntimeHelpers.False));
case TypeCode.Byte: return s_byte ?? (s_byte = new GreaterThanOrEqualByte(ScriptingRuntimeHelpers.False));
case TypeCode.Char: return s_char ?? (s_char = new GreaterThanOrEqualChar(ScriptingRuntimeHelpers.False));
case TypeCode.Int16: return s_int16 ?? (s_int16 = new GreaterThanOrEqualInt16(ScriptingRuntimeHelpers.False));
case TypeCode.Int32: return s_int32 ?? (s_int32 = new GreaterThanOrEqualInt32(ScriptingRuntimeHelpers.False));
case TypeCode.Int64: return s_int64 ?? (s_int64 = new GreaterThanOrEqualInt64(ScriptingRuntimeHelpers.False));
case TypeCode.UInt16: return s_UInt16 ?? (s_UInt16 = new GreaterThanOrEqualUInt16(ScriptingRuntimeHelpers.False));
case TypeCode.UInt32: return s_UInt32 ?? (s_UInt32 = new GreaterThanOrEqualUInt32(ScriptingRuntimeHelpers.False));
case TypeCode.UInt64: return s_UInt64 ?? (s_UInt64 = new GreaterThanOrEqualUInt64(ScriptingRuntimeHelpers.False));
case TypeCode.Single: return s_single ?? (s_single = new GreaterThanOrEqualSingle(ScriptingRuntimeHelpers.False));
case TypeCode.Double: return s_double ?? (s_double = new GreaterThanOrEqualDouble(ScriptingRuntimeHelpers.False));
default:
throw Error.ExpressionNotSupportedForType("GreaterThanOrEqual", type);
}
}
}
开发者ID:geoffkizer,项目名称:corefx,代码行数:44,代码来源:GreaterThanInstruction.cs
示例17: UpdateStackDepth
private void UpdateStackDepth(Instruction instruction)
{
Debug.Assert(instruction.ConsumedStack >= 0 && instruction.ProducedStack >= 0 &&
instruction.ConsumedContinuations >= 0 && instruction.ProducedContinuations >= 0, "bad instruction " + instruction.ToString());
_currentStackDepth -= instruction.ConsumedStack;
Debug.Assert(_currentStackDepth >= 0, "negative stack depth " + instruction.ToString());
_currentStackDepth += instruction.ProducedStack;
if (_currentStackDepth > _maxStackDepth)
{
_maxStackDepth = _currentStackDepth;
}
_currentContinuationsDepth -= instruction.ConsumedContinuations;
Debug.Assert(_currentContinuationsDepth >= 0, "negative continuations " + instruction.ToString());
_currentContinuationsDepth += instruction.ProducedContinuations;
if (_currentContinuationsDepth > _maxContinuationDepth)
{
_maxContinuationDepth = _currentContinuationsDepth;
}
}
开发者ID:jsalvadorp,项目名称:corefx,代码行数:21,代码来源:InstructionList.cs
示例18: Create
public static Instruction Create(Type type)
{
Debug.Assert(!type.GetTypeInfo().IsEnum);
switch (type.GetNonNullableType().GetTypeCode())
{
case TypeCode.SByte: return s_SByte ?? (s_SByte = new OnesComplementSByte());
case TypeCode.Int16: return s_Int16 ?? (s_Int16 = new OnesComplementInt16());
case TypeCode.Int32: return s_Int32 ?? (s_Int32 = new OnesComplementInt32());
case TypeCode.Int64: return s_Int64 ?? (s_Int64 = new OnesComplementInt64());
case TypeCode.Byte: return s_Byte ?? (s_Byte = new OnesComplementByte());
case TypeCode.UInt16: return s_UInt16 ?? (s_UInt16 = new OnesComplementUInt16());
case TypeCode.UInt32: return s_UInt32 ?? (s_UInt32 = new OnesComplementUInt32());
case TypeCode.UInt64: return s_UInt64 ?? (s_UInt64 = new OnesComplementUInt64());
default:
throw Error.ExpressionNotSupportedForType("OnesComplement", type);
}
}
开发者ID:chcosta,项目名称:corefx,代码行数:17,代码来源:OnesComplementInstruction.cs
示例19: EmitLoad
public void EmitLoad(bool value)
{
if ((bool)value)
{
Emit(s_true ?? (s_true = new LoadObjectInstruction(value)));
}
else
{
Emit(s_false ?? (s_false = new LoadObjectInstruction(value)));
}
}
开发者ID:jsalvadorp,项目名称:corefx,代码行数:11,代码来源:InstructionList.cs
示例20: Create
public static Instruction Create(Type type)
{
// Boxed enums can be unboxed as their underlying types:
switch (GetTypeCode(type))
{
case TypeCode.SByte: return s_SByte ?? (s_SByte = new ExclusiveOrSByte());
case TypeCode.Byte: return s_byte ?? (s_byte = new ExclusiveOrByte());
case TypeCode.Int16: return s_int16 ?? (s_int16 = new ExclusiveOrInt16());
case TypeCode.Int32: return s_int32 ?? (s_int32 = new ExclusiveOrInt32());
case TypeCode.Int64: return s_int64 ?? (s_int64 = new ExclusiveOrInt64());
case TypeCode.UInt16: return s_UInt16 ?? (s_UInt16 = new ExclusiveOrUInt16());
case TypeCode.UInt32: return s_UInt32 ?? (s_UInt32 = new ExclusiveOrUInt32());
case TypeCode.UInt64: return s_UInt64 ?? (s_UInt64 = new ExclusiveOrUInt64());
case TypeCode.Boolean: return s_bool ?? (s_bool = new ExclusiveOrBool());
default:
throw Error.ExpressionNotSupportedForType("ExclusiveOr", type);
}
}
开发者ID:geoffkizer,项目名称:corefx,代码行数:20,代码来源:ExclusiveOrInstruction.cs
注:本文中的System.Linq.Expressions.Interpreter.Instruction类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论