public BlockDispatcher0(BlockCallTarget0/*!*/ block, BlockSignatureAttributes attributes) : base(attributes) { Assert.NotNull(block); Debug.Assert(!HasUnsplatParameter); _block = block; }
public BlockDispatcher1(BlockCallTarget1 /*!*/ block, BlockSignatureAttributes attributes) : base(attributes) { Assert.NotNull(block); Debug.Assert(!HasUnsplatParameter); _block = block; }
internal BlockDispatcherUnsplatN(int parameterCount, BlockSignatureAttributes attributesAndArity, string sourcePath, int sourceLine) : base(attributesAndArity, sourcePath, sourceLine) { Debug.Assert(HasUnsplatParameter); _parameterCount = parameterCount; }
internal BlockDispatcherUnsplatN(BlockCallTargetUnsplatN/*!*/ block, int parameterCount, BlockSignatureAttributes attributes) : base(attributes) { Assert.NotNull(block); Debug.Assert(HasUnsplatParameter); _parameterCount = parameterCount; _block = block; }
internal BlockDispatcherN(BlockCallTargetN/*!*/ block, int parameterCount, BlockSignatureAttributes attributesAndArity) : base(attributesAndArity) { Assert.NotNull(block); Debug.Assert(parameterCount > BlockDispatcher.MaxBlockArity); Debug.Assert(!HasUnsplatParameter); _parameterCount = parameterCount; _block = block; }
internal BlockDispatcherN(int parameterCount, BlockSignatureAttributes attributesAndArity, string sourcePath, int sourceLine) : base(attributesAndArity, sourcePath, sourceLine) { Debug.Assert(parameterCount > BlockDispatcher.MaxBlockArity); Debug.Assert(!HasUnsplatParameter); Debug.Assert(!HasSingleCompoundParameter); _parameterCount = parameterCount; }
internal BlockDispatcherN(BlockCallTargetN /*!*/ block, int parameterCount, BlockSignatureAttributes attributes) : base(attributes) { Assert.NotNull(block); Debug.Assert(parameterCount > BlockDispatcher.MaxBlockArity); Debug.Assert(!HasUnsplatParameter); _parameterCount = parameterCount; _block = block; }
internal static Type/*!*/ GetDelegateType(int parameterCount, BlockSignatureAttributes attributes) { if ((attributes & BlockSignatureAttributes.HasUnsplatParameter) == 0) { switch (parameterCount) { case 0: return typeof(BlockCallTarget0); case 1: return typeof(BlockCallTarget1); case 2: return typeof(BlockCallTarget2); case 3: return typeof(BlockCallTarget3); case 4: return typeof(BlockCallTarget4); default: return typeof(BlockCallTargetN); } } return typeof(BlockCallTargetUnsplatN); }
public static Proc/*!*/ Create(RubyContext/*!*/ context, int parameterCount, BlockSignatureAttributes signatureAttributes, Delegate/*!*/ clrMethod) { // scope is used to get to the execution context: return new Proc(ProcKind.Block, null, context.EmptyScope, BlockDispatcher.Create(parameterCount, signatureAttributes, null, 0).SetMethod(clrMethod) ); }
internal BlockDispatcherProcN(int parameterCount, BlockSignatureAttributes attributesAndArity, string sourcePath, int sourceLine) : base(parameterCount, attributesAndArity, sourcePath, sourceLine) { Debug.Assert(!HasUnsplatParameter); Debug.Assert(HasProcParameter); }
public static Proc /*!*/ Create(RubyContext /*!*/ context, int parameterCount, BlockSignatureAttributes signatureAttributes, Delegate /*!*/ clrMethod) { // scope is used to get to the execution context: return(new Proc(ProcKind.Block, null, context.EmptyScope, BlockDispatcher.Create(parameterCount, signatureAttributes, null, 0).SetMethod(clrMethod) )); }
internal static BlockDispatcher/*!*/ Create(Delegate/*!*/ method, int parameterCount, BlockSignatureAttributes attributes) { if ((attributes & BlockSignatureAttributes.HasUnsplatParameter) == 0) { switch (parameterCount) { case 0: return new BlockDispatcher0((BlockCallTarget0)method, attributes); case 1: return new BlockDispatcher1((BlockCallTarget1)method, attributes); case 2: return new BlockDispatcher2((BlockCallTarget2)method, attributes); case 3: return new BlockDispatcher3((BlockCallTarget3)method, attributes); case 4: return new BlockDispatcher4((BlockCallTarget4)method, attributes); default: return new BlockDispatcherN((BlockCallTargetN)method, parameterCount, attributes); } } return new BlockDispatcherUnsplatN((BlockCallTargetUnsplatN)method, parameterCount, attributes); }
internal static BlockSignatureAttributes MakeAttributes(BlockSignatureAttributes attributes, int arity) { return attributes | (BlockSignatureAttributes)(arity << 2); }
internal BlockDispatcher(BlockSignatureAttributes attributesAndArity) { _attributesAndArity = attributesAndArity; }
internal static BlockDispatcher/*!*/ Create(Delegate/*!*/ method, int parameterCount, BlockSignatureAttributes attributesAndArity) { if ((attributesAndArity & BlockSignatureAttributes.HasUnsplatParameter) == 0) { switch (parameterCount) { case 0: return new BlockDispatcher0((BlockCallTarget0)method, attributesAndArity); case 1: return new BlockDispatcher1((BlockCallTarget1)method, attributesAndArity); case 2: return new BlockDispatcher2((BlockCallTarget2)method, attributesAndArity); case 3: return new BlockDispatcher3((BlockCallTarget3)method, attributesAndArity); case 4: return new BlockDispatcher4((BlockCallTarget4)method, attributesAndArity); default: return new BlockDispatcherN((BlockCallTargetN)method, parameterCount, attributesAndArity); } } return new BlockDispatcherUnsplatN((BlockCallTargetUnsplatN)method, parameterCount, attributesAndArity); }
internal static LambdaExpression/*!*/ CreateLambda(Expression body, string name, ReadOnlyCollection<ParameterExpression> parameters, int parameterCount, BlockSignatureAttributes attributes) { if ((attributes & BlockSignatureAttributes.HasUnsplatParameter) == 0) { switch (parameterCount) { case 0: return Ast.Lambda<BlockCallTarget0>(body, name, parameters); case 1: return Ast.Lambda<BlockCallTarget1>(body, name, parameters); case 2: return Ast.Lambda<BlockCallTarget2>(body, name, parameters); case 3: return Ast.Lambda<BlockCallTarget3>(body, name, parameters); case 4: return Ast.Lambda<BlockCallTarget4>(body, name, parameters); default: return Ast.Lambda<BlockCallTargetN>(body, name, parameters); } } return Ast.Lambda<BlockCallTargetUnsplatN>(body, name, parameters); }
public static Proc/*!*/ DefineBlock(RubyScope/*!*/ scope, RuntimeFlowControl/*!*/ runtimeFlowControl, object self, Delegate/*!*/ clrMethod, int parameterCount, BlockSignatureAttributes attributesAndArity, string sourcePath, int startLine) { Assert.NotNull(scope, clrMethod); // closes block over self and context BlockDispatcher dispatcher = BlockDispatcher.Create(clrMethod, parameterCount, attributesAndArity); Proc result = new Proc(ProcKind.Block, self, scope, sourcePath, startLine, dispatcher); result.Owner = runtimeFlowControl; return result; }
public BlockDispatcherN(int parameterCount, BlockSignatureAttributes attributesAndArity, string sourcePath, int sourceLine) : base(attributesAndArity, sourcePath, sourceLine) { _parameterCount = parameterCount; }
internal BlockDispatcher(BlockSignatureAttributes attributes) { _attributesAndArity = attributes; }
public BlockDispatcher(BlockSignatureAttributes attributesAndArity, string sourcePath, int sourceLine) : base(attributesAndArity, sourcePath, sourceLine) { }
public BlockDispatcher4(BlockSignatureAttributes attributesAndArity, string sourcePath, int sourceLine) : base(attributesAndArity, sourcePath, sourceLine) { Debug.Assert(!HasUnsplatParameter); }