2using System.Collections.Concurrent;
30 readonly RuntimeContextOptions options;
33 readonly
bool bootstrap;
34 readonly ConcurrentDictionary<Type, object> singletons =
new();
46#if IMPORTER == false && EXPORTER == false
70#if IMPORTER || EXPORTER
75#if IMPORTER || EXPORTER
86 this.options = options ??
throw new ArgumentNullException(nameof(options));
87 this.diagnostics = diagnostics ??
throw new ArgumentNullException(nameof(diagnostics));
88 this.resolver = resolver ??
throw new ArgumentNullException(nameof(resolver));
89 this.bootstrap = bootstrap;
90 this.staticCompiler = staticCompiler;
104 this.options = options ??
throw new ArgumentNullException(nameof(options));
105 this.diagnostics = diagnostics ??
throw new ArgumentNullException(nameof(diagnostics));
106 this.resolver = resolver ??
throw new ArgumentNullException(nameof(resolver));
107 this.bootstrap = bootstrap;
124 T GetOrCreateSingleton<T>(
ref T value, Func<T> create)
139 public T GetOrCreateSingleton<T>(Func<T> create) => (T)singletons.GetOrAdd(typeof(T), _ => create());
144 public RuntimeContextOptions
Options => options;
164 public CoreClasses
JavaBase => GetOrCreateSingleton(
ref javaBase, () =>
new CoreClasses(
this));
240#if IMPORTER == false && EXPORTER == false
269#if IMPORTER || EXPORTER
Provides methods to help in generating IKVM attributes.
Manages instances of Compiler.
Maintains instances of DynamicClassLoader.
Provides instances of MethodAnalyzer.
Maintains instances of RuntimeAssemblyClassLoader.
Manages instances of RuntimeClassLoader.
Maintains services relevant to an instane of the IKVM runtime.
AttributeHelper AttributeHelper
Gets the AttributeHelper associated with this instance of the runtime.
RuntimeManagedByteCodeJavaTypeFactory ManagedByteCodeJavaTypeFactory
Gets the RuntimeManagedJavaTypeFactory associated with this instance of the runtime.
CodeEmitterFactory CodeEmitterFactory
Gets the CodeEmitterFactory associated with this instance of the runtime.
StubGenerator StubGenerator
Gets the StubGenerator associated with this instance of the runtime.
Types Types
Gets the Types associated with this instance of the runtime.
MethodHandleUtil MethodHandleUtil
Gets the MethodHandleUtil associated with this instance of the runtime.
RuntimeManagedJavaTypeFactory ManagedJavaTypeFactory
Gets the RuntimeManagedJavaTypeFactory associated with this instance of the runtime.
bool Bootstrap
Gets whether or not the runtime is running in bootstrap mode; that is, we are compiling the Java base...
MethodAnalyzerFactory MethodAnalyzerFactory
Gets the MethodAnalyzerFactory associated with this instance of the runtime.
DynamicClassLoaderFactory DynamicClassLoaderFactory
Gets the DynamicClassLoaderFactory associated with this instance of the runtime.
RuntimeContextOptions Options
Gets the RuntimeContextOptions associated with this instance of the runtime.
Serialization Serialization
Gets the Serialization associated with this instance of the runtime.
ByteCodeHelperMethods ByteCodeHelperMethods
Gets the ByteCodeHelperMethods associated with this instance of the runtime.
CompilerFactory CompilerFactory
Gets the CompilerFactory associated with this instance of the runtime.
ExceptionHelper ExceptionHelper
Gets the ExceptionHelper associated with this instance of the runtime.
RuntimeContext(RuntimeContextOptions options, IDiagnosticHandler diagnostics, ISymbolResolver resolver, bool bootstrap)
Initializes a new instance.
Boxer Boxer
Gets the Boxer associated with this instance of the runtime.
RuntimeAssemblyClassLoaderFactory AssemblyClassLoaderFactory
Gets the RuntimeAssemblyClassLoaderFactory associated with this instance of the runtime.
RuntimePrimitiveJavaTypeFactory PrimitiveJavaTypeFactory
Gets the RuntimePrimitiveJavaTypeFactory associated with this instance of the runtime.
RuntimeVerifierJavaTypeFactory VerifierJavaTypeFactory
Gets the RuntimeVerifierJavaTypeFactory associated with this instance of the runtime.
InterlockedMethods InterlockedMethods
Gets the InterlockedMethods associated with this instance of the runtime.
ISymbolResolver Resolver
Gets the ISymbolResolver associated with this instance of the runtime.
CoreClasses JavaBase
Gets the CoreClasses associated with this instance of the runtime.
RuntimeClassLoaderFactory ClassLoaderFactory
Gets the RuntimeClassLoaderFactory associated with this instance of the runtime.
Manages instances of RuntimeManagedJavaType.
Provides various cached system types.
Exposes methods to accept diagnostic invocations.
Provides an interface to resolve a maaged type symbols.