17 static partial class JVM
30 static IEnumerable<Assembly> GetCoreAssemblies()
32 yield
return typeof(
object).Assembly;
33 yield
return typeof(RuntimeCompatibilityAttribute).Assembly;
34 yield
return typeof(Console).Assembly;
35 yield
return typeof(
System.Threading.Interlocked).Assembly;
36 yield
return typeof(EditorBrowsableAttribute).Assembly;
37 yield
return typeof(
System.Collections.IEnumerable).Assembly;
38 yield
return typeof(IEnumerable<>).Assembly;
39 yield
return typeof(Environment).Assembly;
42 readonly
static Assembly[] coreAssemblies = GetCoreAssemblies().Distinct().ToArray();
46 readonly ConcurrentDictionary<string, ITypeSymbol> _typeCache =
new();
53 _coreAssemblies = coreAssemblies.Select(_context.GetOrCreateAssemblySymbol).ToArray();
59 return Assembly.Load(assemblyName) is { } a ? _context.GetOrCreateAssemblySymbol(a) :
null;
65 return _context.GetOrCreateAssemblySymbol(typeof(
java.
lang.Object).Assembly);
71 return _typeCache.GetOrAdd(typeName, ResolveCoreTypeImpl);
77 foreach (var assembly
in _coreAssemblies)
85 public ITypeSymbol ResolveRuntimeType(
string typeName)
87 return typeof(Resolver).
Assembly.
GetType(typeName) is { } t ? _context.GetOrCreateTypeSymbol(t) :
null;
Holds references to symbols derived from System.Reflection.