public ModuleData(string netModuleName, ImmutableArray<byte> image, ImmutableArray<byte> pdb, bool inMemoryModule) { this.Id = new ModuleDataId(netModuleName, netModuleName, GetMvid(image)); this.Kind = OutputKind.NetModule; this.Image = image; this.Pdb = pdb; this.InMemoryModule = inMemoryModule; }
public ModuleData(AssemblyIdentity identity, OutputKind kind, ImmutableArray<byte> image, ImmutableArray<byte> pdb, bool inMemoryModule) { this.Id = new ModuleDataId(identity.Name, identity.GetDisplayName(), GetMvid(image)); this.Kind = kind; this.Image = image; this.Pdb = pdb; this.InMemoryModule = inMemoryModule; }
public ModuleData(ModuleDataId id, OutputKind kind, ImmutableArray <byte> image, ImmutableArray <byte> pdb, bool inMemoryModule) { this.Id = id; this.Kind = kind; this.Image = image; this.Pdb = pdb; this.InMemoryModule = inMemoryModule; }
public ModuleData(AssemblyIdentity identity, OutputKind kind, ImmutableArray <byte> image, ImmutableArray <byte> pdb, bool inMemoryModule) { this.Id = new ModuleDataId(identity.Name, identity.GetDisplayName(), GetMvid(image)); this.Kind = kind; this.Image = image; this.Pdb = pdb; this.InMemoryModule = inMemoryModule; }
public ModuleData(string netModuleName, ImmutableArray <byte> image, ImmutableArray <byte> pdb, bool inMemoryModule) { this.Id = new ModuleDataId(netModuleName, netModuleName, GetMvid(image)); this.Kind = OutputKind.NetModule; this.Image = image; this.Pdb = pdb; this.InMemoryModule = inMemoryModule; }
private bool TryGetMatchingByFullName(ModuleDataId id, out AssemblyData assemblyData, out bool fullMatch) { if (_fullNameToAssemblyDataMap.TryGetValue(id.FullName, out assemblyData)) { fullMatch = _preloadedSet.Contains(id.SimpleName) || id.Mvid == assemblyData.Id.Mvid; return(true); } assemblyData = default(AssemblyData); fullMatch = false; return(false); }
internal Assembly GetOrDefault(ModuleDataId id, bool reflectionOnly) { var cache = reflectionOnly ? _reflectionOnlyAssemblyCache : _assemblyCache; lock (s_guard) { Assembly assembly; if (cache.TryGetValue(id.Mvid, out assembly)) { return assembly; } return null; } }
internal Assembly GetOrDefault(ModuleDataId id, bool reflectionOnly) { var cache = reflectionOnly ? _reflectionOnlyAssemblyCache : _assemblyCache; lock (s_guard) { Assembly assembly; if (cache.TryGetValue(id.Mvid, out assembly)) { return(assembly); } return(null); } }
private RuntimeData CreateAndInitializeRuntimeData(IEnumerable <ModuleData> compilationDependencies, ModuleDataId mainModuleId) { var allModules = compilationDependencies; if (_additionalDependencies != null) { allModules = allModules.Concat(_additionalDependencies); } allModules = allModules.ToArray(); var runtimeData = GetOrCreateRuntimeData(allModules); // Many prominent assemblys like mscorlib are already in the RuntimeAssemblyManager. Only // add in the delta values to reduce serialization overhead going across AppDomains. var manager = runtimeData.Manager; var missingList = manager.GetMissing(allModules.Select(x => x.Id).ToList()); var deltaList = allModules.Where(x => missingList.Contains(x.Id)).ToList(); manager.AddModuleData(deltaList); manager.AddMainModuleMvid(mainModuleId.Mvid); return(runtimeData); }
private RuntimeData CreateAndInitializeRuntimeData(IEnumerable<ModuleData> compilationDependencies, ModuleDataId mainModuleId) { var allModules = compilationDependencies; if (_additionalDependencies != null) { allModules = allModules.Concat(_additionalDependencies); } allModules = allModules.ToArray(); var runtimeData = GetOrCreateRuntimeData(allModules); // Many prominent assemblys like mscorlib are already in the RuntimeAssemblyManager. Only // add in the delta values to reduce serialization overhead going across AppDomains. var manager = runtimeData.Manager; var missingList = manager.GetMissing(allModules.Select(x => x.Id).ToList()); var deltaList = allModules.Where(x => missingList.Contains(x.Id)).ToList(); manager.AddModuleData(deltaList); manager.AddMainModuleMvid(mainModuleId.Mvid); return runtimeData; }
private bool TryGetMatchingByFullName(ModuleDataId id, out AssemblyData assemblyData, out bool fullMatch) { if (_fullNameToAssemblyDataMap.TryGetValue(id.FullName, out assemblyData)) { fullMatch = _preloadedSet.Contains(id.SimpleName) || id.Mvid == assemblyData.Id.Mvid; return true; } assemblyData = default(AssemblyData); fullMatch = false; return false; }
private ModuleData(SerializationInfo info, StreamingContext context) { this.Id = (ModuleDataId)info.GetValue(nameof(Id), typeof(ModuleDataId)); this.Kind = (OutputKind)info.GetInt32(nameof(Kind)); this.Image = info.GetByteArray(nameof(Image)); this.Pdb = info.GetByteArray(nameof(Pdb)); this.InMemoryModule = info.GetBoolean(nameof(InMemoryModule)); }