public LazilyBuiltDictionaryLayoutNode(TypeSystemEntity owningMethodOrType) : base(owningMethodOrType) { }
static void ParseTypeSymbol(string id, ref int index, TypeSystemEntity typeParameterContext, List <string> results) { // Note: Roslyn has a special case that deviates from the language spec, which // allows context expressions embedded in a type reference => <context-definition>:<type-parameter> // We do not support this special format. Debug.Assert(results.Count == 0); if (PeekNextChar(id, index) == '`') { ParseTypeParameterSymbol(id, ref index, typeParameterContext, results); } else { ParseNamedTypeSymbol(id, ref index, typeParameterContext, results); } // apply any array or pointer constructions to results var startIndex = index; var endIndex = index; for (int i = 0; i < results.Count; i++) { index = startIndex; var typeReference = results[i]; while (true) { if (PeekNextChar(id, index) == '[') { var boundsStartIndex = index; var bounds = ParseArrayBounds(id, ref index); var boundsEndIndex = index; Debug.Assert(bounds > 0); // Instead of constructing a representation of the array bounds, we // use the original input to represent the bounds, and later match it // against the generated strings for types in signatures. // This ensures that we will only resolve members with supported array bounds. typeReference += id.Substring(boundsStartIndex, boundsEndIndex - boundsStartIndex); continue; } if (PeekNextChar(id, index) == '*') { index++; typeReference += '*'; continue; } break; } if (PeekNextChar(id, index) == '@') { index++; typeReference += '@'; } results[i] = typeReference; endIndex = index; } index = endIndex; }
public ReadyToRunGenericHelperNode(NodeFactory factory, ReadyToRunHelperId helperId, object target, TypeSystemEntity dictionaryOwner) { _id = helperId; _dictionaryOwner = dictionaryOwner; _target = target; _lookupSignature = GetLookupSignature(factory, helperId, target); }
public static void EmitLdToken(this InstructionEncoder code, TypeSystemEntity typeSystemEntity, ManagedBinaryEmitter emitter) { code.OpCode(ILOpCode.Ldtoken); code.Token(emitter.EmitMetadataHandleForTypeSystemEntity(typeSystemEntity)); }
internal DictionaryLayoutNode GenericDictionaryLayout(TypeSystemEntity methodOrType) { return(_genericDictionaryLayouts.GetOrAdd(methodOrType)); }
public void LogWarning(string text, int code, TypeSystemEntity origin, string subcategory = MessageSubCategory.None) => LogWarning(text, code, new MessageOrigin(origin), subcategory);
public override DictionaryLayoutNode GetLayout(TypeSystemEntity methodOrType) { return(new UtcDictionaryLayoutNode(methodOrType)); }
internal abstract DictionaryLayoutNode GetLayout(TypeSystemEntity methodOrType);
internal override DictionaryLayoutNode GetLayout(TypeSystemEntity methodOrType) { return(new LazilyBuiltDictionaryLayoutNode(methodOrType)); }
public GenericContext(TypeSystemEntity context) { Context = context; }
public void DetectGenericCycles(TypeSystemEntity owner, TypeSystemEntity referent) { _genericCycleDetector.DetectCycle(owner, referent); }
public ISymbolNode ReadyToRunHelperFromTypeLookup(ReadyToRunHelperId id, Object target, TypeSystemEntity dictionaryOwner) { throw new NotImplementedException(); }
void CheckAndReportRequires(TypeSystemEntity calledMember, in MessageOrigin origin, string requiresAttributeName)
public EntityPair(TypeSystemEntity owner, TypeSystemEntity referent) => (Owner, Referent) = (owner, referent);
public UtcDictionaryLayoutNode(TypeSystemEntity owningMethodOrType) : base(owningMethodOrType) { }
public NativeLayoutSignatureNode(NativeLayoutSavedVertexNode nativeSignature, TypeSystemEntity identity, Utf8String identityPrefix) { _nativeSignature = nativeSignature; _identity = identity; _identityPrefix = identityPrefix; }
public void LogError(string text, int code, TypeSystemEntity origin, string subcategory = MessageSubCategory.None) => LogError(text, code, subcategory, new MessageOrigin(origin));
public override DictionaryLayoutNode GenericDictionaryLayout(TypeSystemEntity methodOrType) { return(_hostedGenericDictionaryLayouts.GetOrAdd(methodOrType)); }
public void LogWarning(TypeSystemEntity origin, DiagnosticId id, params string[] args) => LogWarning(new MessageOrigin(origin), id, args);
public DictionaryLayoutNode(TypeSystemEntity owningMethodOrType) { _owningMethodOrType = owningMethodOrType; Validate(); }
private MetadataType InitializeArrayOfTType(TypeSystemEntity contextEntity) { _arrayOfTType = contextEntity.Context.SystemModule.GetType("System", "Array`1"); return(_arrayOfTType); }
public NativeLayoutSignatureKey(NativeLayoutSavedVertexNode signatureVertex, Utf8String identityPrefix, TypeSystemEntity identity) { SignatureVertex = signatureVertex; IdentityPrefix = identityPrefix; Identity = identity; }
public ReadyToRunGenericHelperKey(ReadyToRunHelperId helperId, object target, TypeSystemEntity dictionaryOwner) { HelperId = helperId; Target = target; DictionaryOwner = dictionaryOwner; }
public NativeLayoutSignatureNode NativeLayoutSignature(NativeLayoutSavedVertexNode signature, Utf8String identityPrefix, TypeSystemEntity identity) { return(_nativeLayoutSignatureNodes.GetOrAdd(new NativeLayoutSignatureKey(signature, identityPrefix, identity))); }
public ISymbolNode ReadyToRunHelperFromDictionaryLookup(ReadyToRunHelperId id, Object target, TypeSystemEntity dictionaryOwner) { return(_genericReadyToRunHelpersFromDict.GetOrAdd(new Tuple <ReadyToRunHelperId, object, TypeSystemEntity>(id, target, dictionaryOwner))); }
public NativeLayoutDictionarySignatureNode DictionarySignature(TypeSystemEntity owningMethodOrType) { return(_dictionarySignatures.GetOrAdd(owningMethodOrType)); }
public ReadyToRunGenericLookupFromTypeNode(NodeFactory factory, ReadyToRunHelperId helperId, object target, TypeSystemEntity dictionaryOwner) : base(factory, helperId, target, dictionaryOwner) { }
public bool ShouldWarnWhenAccessedForReflection(TypeSystemEntity entity) => entity switch {
public ISymbolNode ReadyToRunHelperFromTypeLookup(ReadyToRunHelperId id, Object target, TypeSystemEntity dictionaryOwner) { return(_genericReadyToRunHelpersFromType.GetOrAdd(new ReadyToRunGenericHelperKey(id, target, dictionaryOwner))); }
private void GetFlowDependenciesForInstantiation(ref DependencyList dependencies, NodeFactory factory, Instantiation instantiation, Instantiation typicalInstantiation, TypeSystemEntity source) { for (int i = 0; i < instantiation.Length; i++) { var genericParameter = (GenericParameterDesc)typicalInstantiation[i]; if (FlowAnnotations.GetGenericParameterAnnotation(genericParameter) != default) { var deps = ILCompiler.Dataflow.ReflectionMethodBodyScanner.ProcessGenericArgumentDataFlow(factory, FlowAnnotations, Logger, genericParameter, instantiation[i], source); if (deps.Count > 0) { if (dependencies == null) { dependencies = deps; } else { dependencies.AddRange(deps); } } } } }