Пример #1
0
            private void CreateNodeCaches()
            {
                _typeSignatures = new NodeCache <TypeDesc, NativeLayoutTypeSignatureVertexNode>(type =>
                {
                    return(NativeLayoutTypeSignatureVertexNode.NewTypeSignatureVertexNode(_factory, type));
                });

                _methodSignatures = new NodeCache <MethodDesc, NativeLayoutMethodSignatureVertexNode>(method =>
                {
                    return(new NativeLayoutMethodSignatureVertexNode(_factory, method));
                });

                _methodNameAndSignatures = new NodeCache <MethodDesc, NativeLayoutMethodNameAndSignatureVertexNode>(method =>
                {
                    return(new NativeLayoutMethodNameAndSignatureVertexNode(_factory, method));
                });

                _placedSignatures = new NodeCache <NativeLayoutVertexNode, NativeLayoutPlacedSignatureVertexNode>(vertexNode =>
                {
                    return(new NativeLayoutPlacedSignatureVertexNode(vertexNode));
                });

                _methodLdTokenSignatures = new NodeCache <MethodDesc, NativeLayoutMethodLdTokenVertexNode>(method =>
                {
                    return(new NativeLayoutMethodLdTokenVertexNode(_factory, method));
                });

                _nativeLayoutSignatureNodes = new NodeCache <NativeLayoutSavedVertexNode, NativeLayoutSignatureNode>(signature =>
                {
                    return(new NativeLayoutSignatureNode(signature));
                });
            }
            private void CreateNodeCaches()
            {
                _typeSignatures = new NodeCache <TypeDesc, NativeLayoutTypeSignatureVertexNode>(type =>
                {
                    return(NativeLayoutTypeSignatureVertexNode.NewTypeSignatureVertexNode(_factory, type));
                });

                _methodSignatures = new NodeCache <MethodSignature, NativeLayoutMethodSignatureVertexNode>(signature =>
                {
                    return(new NativeLayoutMethodSignatureVertexNode(_factory, signature));
                });

                _callingConventionSlots = new NodeCache <CallingConventionConverterKey, NativeLayoutCallingConventionConverterGenericDictionarySlotNode>(key =>
                {
                    return(new NativeLayoutCallingConventionConverterGenericDictionarySlotNode(key.Signature, key.ConverterKind));
                });

                _methodNameAndSignatures = new NodeCache <MethodDesc, NativeLayoutMethodNameAndSignatureVertexNode>(method =>
                {
                    return(new NativeLayoutMethodNameAndSignatureVertexNode(_factory, method));
                });

                _placedSignatures = new NodeCache <NativeLayoutVertexNode, NativeLayoutPlacedSignatureVertexNode>(vertexNode =>
                {
                    return(new NativeLayoutPlacedSignatureVertexNode(vertexNode));
                });

                _placedVertexSequence = new NodeCache <VertexSequenceKey, NativeLayoutPlacedVertexSequenceVertexNode>(vertices =>
                {
                    return(new NativeLayoutPlacedVertexSequenceVertexNode(vertices.Vertices));
                });

                _placedUIntVertexSequence = new NodeCache <List <uint>, NativeLayoutPlacedVertexSequenceOfUIntVertexNode>(uints =>
                {
                    return(new NativeLayoutPlacedVertexSequenceOfUIntVertexNode(uints));
                }, new UIntSequenceComparer());

                _methodLdTokenSignatures = new NodeCache <MethodDesc, NativeLayoutMethodLdTokenVertexNode>(method =>
                {
                    return(new NativeLayoutMethodLdTokenVertexNode(_factory, method));
                });

                _fieldLdTokenSignatures = new NodeCache <FieldDesc, NativeLayoutFieldLdTokenVertexNode>(field =>
                {
                    return(new NativeLayoutFieldLdTokenVertexNode(_factory, field));
                });

                _nativeLayoutSignatureNodes = new NodeCache <NativeLayoutSignatureKey, NativeLayoutSignatureNode>(key =>
                {
                    return(new NativeLayoutSignatureNode(key.SignatureVertex, key.Identity, key.IdentityPrefix));
                });

                _templateMethodEntries = new NodeCache <MethodDesc, NativeLayoutTemplateMethodSignatureVertexNode>(method =>
                {
                    return(new NativeLayoutTemplateMethodSignatureVertexNode(_factory, method));
                });

                _templateMethodLayouts = new NodeCache <MethodDesc, NativeLayoutTemplateMethodLayoutVertexNode>(method =>
                {
                    return(new NativeLayoutTemplateMethodLayoutVertexNode(_factory, method));
                });

                _templateTypeLayouts = new NodeCache <TypeDesc, NativeLayoutTemplateTypeLayoutVertexNode>(type =>
                {
                    return(new NativeLayoutTemplateTypeLayoutVertexNode(_factory, type));
                });

                _typeHandle_GenericDictionarySlots = new NodeCache <TypeDesc, NativeLayoutTypeHandleGenericDictionarySlotNode>(type =>
                {
                    return(new NativeLayoutTypeHandleGenericDictionarySlotNode(_factory, type));
                });

                _gcStatic_GenericDictionarySlots = new NodeCache <TypeDesc, NativeLayoutGcStaticsGenericDictionarySlotNode>(type =>
                {
                    return(new NativeLayoutGcStaticsGenericDictionarySlotNode(_factory, type));
                });

                _nonGcStatic_GenericDictionarySlots = new NodeCache <TypeDesc, NativeLayoutNonGcStaticsGenericDictionarySlotNode>(type =>
                {
                    return(new NativeLayoutNonGcStaticsGenericDictionarySlotNode(_factory, type));
                });

                _unwrapNullable_GenericDictionarySlots = new NodeCache <TypeDesc, NativeLayoutUnwrapNullableGenericDictionarySlotNode>(type =>
                {
                    return(new NativeLayoutUnwrapNullableGenericDictionarySlotNode(_factory, type));
                });

                _typeSize_GenericDictionarySlots = new NodeCache <TypeDesc, NativeLayoutTypeSizeGenericDictionarySlotNode>(type =>
                {
                    return(new NativeLayoutTypeSizeGenericDictionarySlotNode(_factory, type));
                });

                _allocateObject_GenericDictionarySlots = new NodeCache <TypeDesc, NativeLayoutAllocateObjectGenericDictionarySlotNode>(type =>
                {
                    return(new NativeLayoutAllocateObjectGenericDictionarySlotNode(_factory, type));
                });

                _tlsIndex_GenericDictionarySlots = new NodeCache <TypeDesc, NativeLayoutTlsIndexGenericDictionarySlotNode>(type =>
                {
                    return(new NativeLayoutTlsIndexGenericDictionarySlotNode(_factory, type));
                });

                _tlsOffset_GenericDictionarySlots = new NodeCache <TypeDesc, NativeLayoutTlsOffsetGenericDictionarySlotNode>(type =>
                {
                    return(new NativeLayoutTlsOffsetGenericDictionarySlotNode(_factory, type));
                });

                _defaultConstructor_GenericDictionarySlots = new NodeCache <TypeDesc, NativeLayoutDefaultConstructorGenericDictionarySlotNode>(type =>
                {
                    return(new NativeLayoutDefaultConstructorGenericDictionarySlotNode(_factory, type));
                });

                _allocateArray_GenericDictionarySlots = new NodeCache <TypeDesc, NativeLayoutAllocateArrayGenericDictionarySlotNode>(type =>
                {
                    return(new NativeLayoutAllocateArrayGenericDictionarySlotNode(_factory, type));
                });

                _interfaceCell_GenericDictionarySlots = new NodeCache <MethodDesc, NativeLayoutInterfaceDispatchGenericDictionarySlotNode>(method =>
                {
                    return(new NativeLayoutInterfaceDispatchGenericDictionarySlotNode(_factory, method));
                });

                _methodDictionary_GenericDictionarySlots = new NodeCache <MethodDesc, NativeLayoutMethodDictionaryGenericDictionarySlotNode>(method =>
                {
                    return(new NativeLayoutMethodDictionaryGenericDictionarySlotNode(_factory, method));
                });

                _methodEntrypoint_GenericDictionarySlots = new NodeCache <MethodEntrypointSlotKey, NativeLayoutMethodEntrypointGenericDictionarySlotNode>(key =>
                {
                    return(new NativeLayoutMethodEntrypointGenericDictionarySlotNode(_factory, key.Method, key.FunctionPointerTarget, key.Unboxing));
                });

                _fieldLdToken_GenericDictionarySlots = new NodeCache <FieldDesc, NativeLayoutFieldLdTokenGenericDictionarySlotNode>(field =>
                {
                    return(new NativeLayoutFieldLdTokenGenericDictionarySlotNode(field));
                });

                _methodLdToken_GenericDictionarySlots = new NodeCache <MethodDesc, NativeLayoutMethodLdTokenGenericDictionarySlotNode>(method =>
                {
                    return(new NativeLayoutMethodLdTokenGenericDictionarySlotNode(method));
                });

                _fieldOffset_GenericDictionaryslots = new NodeCache <FieldDesc, NativeLayoutFieldOffsetGenericDictionarySlotNode>(field =>
                {
                    return(new NativeLayoutFieldOffsetGenericDictionarySlotNode(field));
                });

                _vtableOffset_GenericDictionaryslots = new NodeCache <MethodDesc, NativeLayoutVTableOffsetGenericDictionarySlotNode>(method =>
                {
                    return(new NativeLayoutVTableOffsetGenericDictionarySlotNode(method));
                });

                _dictionarySignatures = new NodeCache <TypeSystemEntity, NativeLayoutDictionarySignatureNode>(owningMethodOrType =>
                {
                    return(new NativeLayoutDictionarySignatureNode(owningMethodOrType));
                });

                _integerSlots = new NodeCache <int, NativeLayoutIntegerDictionarySlotNode>(value =>
                {
                    return(new NativeLayoutIntegerDictionarySlotNode(value));
                });

                _otherSlotPointerSlots = new NodeCache <int, NativeLayoutPointerToOtherSlotDictionarySlotNode>(otherSlotIndex =>
                {
                    return(new NativeLayoutPointerToOtherSlotDictionarySlotNode(otherSlotIndex));
                });

                _constrainedMethodUseSlots = new NodeCache <ConstrainedMethodUseKey, NativeLayoutConstrainedMethodDictionarySlotNode>(constrainedMethodUse =>
                {
                    return(new NativeLayoutConstrainedMethodDictionarySlotNode(constrainedMethodUse.ConstrainedMethod, constrainedMethodUse.ConstraintType, constrainedMethodUse.DirectCall));
                });
            }
            private void CreateNodeCaches()
            {
                _typeSignatures = new NodeCache <TypeDesc, NativeLayoutTypeSignatureVertexNode>(type =>
                {
                    return(NativeLayoutTypeSignatureVertexNode.NewTypeSignatureVertexNode(_factory, type));
                });

                _methodSignatures = new NodeCache <MethodDesc, NativeLayoutMethodSignatureVertexNode>(method =>
                {
                    return(new NativeLayoutMethodSignatureVertexNode(_factory, method));
                });

                _methodNameAndSignatures = new NodeCache <MethodDesc, NativeLayoutMethodNameAndSignatureVertexNode>(method =>
                {
                    return(new NativeLayoutMethodNameAndSignatureVertexNode(_factory, method));
                });

                _placedSignatures = new NodeCache <NativeLayoutVertexNode, NativeLayoutPlacedSignatureVertexNode>(vertexNode =>
                {
                    return(new NativeLayoutPlacedSignatureVertexNode(vertexNode));
                });

                _placedVertexSequence = new NodeCache <VertexSequenceKey, NativeLayoutPlacedVertexSequenceVertexNode>(vertices =>
                {
                    return(new NativeLayoutPlacedVertexSequenceVertexNode(vertices.Vertices));
                });

                _methodLdTokenSignatures = new NodeCache <MethodDesc, NativeLayoutMethodLdTokenVertexNode>(method =>
                {
                    return(new NativeLayoutMethodLdTokenVertexNode(_factory, method));
                });

                _fieldLdTokenSignatures = new NodeCache <FieldDesc, NativeLayoutFieldLdTokenVertexNode>(field =>
                {
                    return(new NativeLayoutFieldLdTokenVertexNode(_factory, field));
                });

                _nativeLayoutSignatureNodes = new NodeCache <NativeLayoutSavedVertexNode, NativeLayoutSignatureNode>(signature =>
                {
                    return(new NativeLayoutSignatureNode(signature));
                });

                _templateMethodEntries = new NodeCache <MethodDesc, NativeLayoutTemplateMethodSignatureVertexNode>(method =>
                {
                    return(new NativeLayoutTemplateMethodSignatureVertexNode(_factory, method));
                });

                _templateMethodLayouts = new NodeCache <MethodDesc, NativeLayoutTemplateMethodLayoutVertexNode>(method =>
                {
                    return(new NativeLayoutTemplateMethodLayoutVertexNode(_factory, method));
                });

                _templateTypeLayouts = new NodeCache <DefType, NativeLayoutTemplateTypeLayoutVertexNode>(type =>
                {
                    return(new NativeLayoutTemplateTypeLayoutVertexNode(_factory, type));
                });

                _typeHandle_GenericDictionarySlots = new NodeCache <TypeDesc, NativeLayoutTypeHandleGenericDictionarySlotNode>(type =>
                {
                    return(new NativeLayoutTypeHandleGenericDictionarySlotNode(_factory, type));
                });

                _gcStatic_GenericDictionarySlots = new NodeCache <TypeDesc, NativeLayoutGcStaticsGenericDictionarySlotNode>(type =>
                {
                    return(new NativeLayoutGcStaticsGenericDictionarySlotNode(_factory, type));
                });

                _nonGcStatic_GenericDictionarySlots = new NodeCache <TypeDesc, NativeLayoutNonGcStaticsGenericDictionarySlotNode>(type =>
                {
                    return(new NativeLayoutNonGcStaticsGenericDictionarySlotNode(_factory, type));
                });

                _unwrapNullable_GenericDictionarySlots = new NodeCache <TypeDesc, NativeLayoutUnwrapNullableGenericDictionarySlotNode>(type =>
                {
                    return(new NativeLayoutUnwrapNullableGenericDictionarySlotNode(_factory, type));
                });

                _typeSize_GenericDictionarySlots = new NodeCache <TypeDesc, NativeLayoutTypeSizeGenericDictionarySlotNode>(type =>
                {
                    return(new NativeLayoutTypeSizeGenericDictionarySlotNode(_factory, type));
                });

                _allocateObject_GenericDictionarySlots = new NodeCache <TypeDesc, NativeLayoutAllocateObjectGenericDictionarySlotNode>(type =>
                {
                    return(new NativeLayoutAllocateObjectGenericDictionarySlotNode(_factory, type));
                });

                _tlsIndex_GenericDictionarySlots = new NodeCache <TypeDesc, NativeLayoutTlsIndexGenericDictionarySlotNode>(type =>
                {
                    return(new NativeLayoutTlsIndexGenericDictionarySlotNode(_factory, type));
                });

                _tlsOffset_GenericDictionarySlots = new NodeCache <TypeDesc, NativeLayoutTlsOffsetGenericDictionarySlotNode>(type =>
                {
                    return(new NativeLayoutTlsOffsetGenericDictionarySlotNode(_factory, type));
                });

                _defaultConstructor_GenericDictionarySlots = new NodeCache <TypeDesc, NativeLayoutDefaultConstructorGenericDictionarySlotNode>(type =>
                {
                    return(new NativeLayoutDefaultConstructorGenericDictionarySlotNode(_factory, type));
                });

                _allocateArray_GenericDictionarySlots = new NodeCache <TypeDesc, NativeLayoutAllocateArrayGenericDictionarySlotNode>(type =>
                {
                    return(new NativeLayoutAllocateArrayGenericDictionarySlotNode(_factory, type));
                });

                _interfaceCell_GenericDictionarySlots = new NodeCache <MethodDesc, NativeLayoutInterfaceDispatchGenericDictionarySlotNode>(method =>
                {
                    return(new NativeLayoutInterfaceDispatchGenericDictionarySlotNode(_factory, method));
                });

                _methodDictionary_GenericDictionarySlots = new NodeCache <MethodDesc, NativeLayoutMethodDictionaryGenericDictionarySlotNode>(method =>
                {
                    return(new NativeLayoutMethodDictionaryGenericDictionarySlotNode(_factory, method));
                });

                _methodEntrypoint_GenericDictionarySlots = new NodeCache <MethodEntrypointSlotKey, NativeLayoutMethodEntrypointGenericDictionarySlotNode>(key =>
                {
                    return(new NativeLayoutMethodEntrypointGenericDictionarySlotNode(_factory, key.Method, key.FunctionPointerTarget, key.Unboxing));
                });

                _fieldLdToken_GenericDictionarySlots = new NodeCache <FieldDesc, NativeLayoutFieldLdTokenGenericDictionarySlotNode>(field =>
                {
                    return(new NativeLayoutFieldLdTokenGenericDictionarySlotNode(field));
                });

                _methodLdToken_GenericDictionarySlots = new NodeCache <MethodDesc, NativeLayoutMethodLdTokenGenericDictionarySlotNode>(method =>
                {
                    return(new NativeLayoutMethodLdTokenGenericDictionarySlotNode(method));
                });
            }