Boo.Lang.Compiler.Steps.EmitAssembly.EmitArray C# (CSharp) Метод

EmitArray() приватный Метод

private EmitArray ( IType type, Boo.Lang.Compiler.Ast.ExpressionCollection items ) : void
type IType
items Boo.Lang.Compiler.Ast.ExpressionCollection
Результат void
        void EmitArray(IType type, ExpressionCollection items)
        {
            EmitLoadLiteral(items.Count);
            _il.Emit(OpCodes.Newarr, GetSystemType(type));

            if (items.Count == 0)
                return;

            var inlineStores = 0;
            if (items.Count > InlineArrayItemCountLimit && TypeSystemServices.IsPrimitiveNumber(type))
            {
                //packed array are only supported for a literal array of
                //an unique primitive type. check that all items are literal
                //and count number of actual stores in order to build/emit
                //a packed array only if is is an advantage
                foreach (Expression item in items)
                {
                    if ((item.NodeType != NodeType.IntegerLiteralExpression
                        && item.NodeType != NodeType.DoubleLiteralExpression)
                        || type != item.ExpressionType)
                    {
                        inlineStores = 0;
                        break;
                    }
                    if (IsZeroEquivalent(item))
                        continue;
                    ++inlineStores;
                }
            }

            if (inlineStores <= InlineArrayItemCountLimit)
                EmitInlineArrayInit(type, items);
            else
                EmitPackedArrayInit(type, items);
        }
EmitAssembly