예제 #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));
                });
            }
예제 #2
0
 public NativeLayoutMethodSignatureVertexNode(NodeFactory factory, MethodDesc method)
 {
     _method        = method;
     _returnTypeSig = factory.NativeLayout.TypeSignatureVertex(method.Signature.ReturnType);
     _parametersSig = new NativeLayoutTypeSignatureVertexNode[method.Signature.Length];
     for (int i = 0; i < _parametersSig.Length; i++)
     {
         _parametersSig[i] = factory.NativeLayout.TypeSignatureVertex(method.Signature[i]);
     }
 }
예제 #3
0
            public NativeLayoutInstantiatedTypeSignatureVertexNode(NodeFactory factory, TypeDesc type) : base(type)
            {
                Debug.Assert(type.HasInstantiation && !type.IsGenericDefinition);

                _genericTypeDefSig = factory.NativeLayout.TypeSignatureVertex(type.GetTypeDefinition());
                _instantiationArgs = new NativeLayoutTypeSignatureVertexNode[type.Instantiation.Length];
                for (int i = 0; i < _instantiationArgs.Length; i++)
                {
                    _instantiationArgs[i] = factory.NativeLayout.TypeSignatureVertex(type.Instantiation[i]);
                }
            }
예제 #4
0
 public NativeLayoutMethodLdTokenVertexNode(NodeFactory factory, MethodDesc method)
 {
     _method            = method;
     _containingTypeSig = factory.NativeLayout.TypeSignatureVertex(method.OwningType);
     _methodSig         = factory.NativeLayout.MethodSignatureVertex(method.GetTypicalMethodDefinition());
     if (method.HasInstantiation)
     {
         _instantiationArgsSig = new NativeLayoutTypeSignatureVertexNode[method.Instantiation.Length];
         for (int i = 0; i < _instantiationArgsSig.Length; i++)
         {
             _instantiationArgsSig[i] = factory.NativeLayout.TypeSignatureVertex(method.Instantiation[i]);
         }
     }
 }
예제 #5
0
        public NativeLayoutMethodEntryVertexNode(NodeFactory factory, MethodDesc method, MethodEntryFlags flags)
        {
            _method    = method;
            _flags     = flags;
            _methodSig = factory.NativeLayout.MethodSignatureVertex(method.GetTypicalMethodDefinition());

            if ((_flags & MethodEntryFlags.CreateInstantiatedSignature) == 0)
            {
                _containingTypeSig = factory.NativeLayout.TypeSignatureVertex(method.OwningType);
                if (method.HasInstantiation)
                {
                    _instantiationArgsSig = new NativeLayoutTypeSignatureVertexNode[method.Instantiation.Length];
                    for (int i = 0; i < _instantiationArgsSig.Length; i++)
                    {
                        _instantiationArgsSig[i] = factory.NativeLayout.TypeSignatureVertex(method.Instantiation[i]);
                    }
                }
            }
        }
            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));
                });
            }
예제 #8
0
 public NativeLayoutFieldLdTokenVertexNode(NodeFactory factory, FieldDesc field)
 {
     _field             = field;
     _containingTypeSig = factory.NativeLayout.TypeSignatureVertex(field.OwningType);
 }