public final class HotSpotJVMCIRuntime extends Object implements HotSpotJVMCIRuntimeProvider, HotSpotProxified
Modifier and Type | Class and Description |
---|---|
static class |
HotSpotJVMCIRuntime.Options |
Modifier and Type | Field and Description |
---|---|
private Map<Class<? extends Architecture>,JVMCIBackend> |
backends |
protected CompilerToVM |
compilerToVm |
protected HotSpotVMConfig |
config |
private JVMCIBackend |
hostBackend |
private static HotSpotJVMCIRuntime |
instance |
private ClassValue<ResolvedJavaType> |
jvmciMirrors
JVMCI mirrors are stored as a
ClassValue associated with the Class of the
type. |
private Iterable<HotSpotVMEventListener> |
vmEventListeners |
Modifier | Constructor and Description |
---|---|
private |
HotSpotJVMCIRuntime() |
Modifier and Type | Method and Description |
---|---|
private static boolean |
checkFactoryOverriding(HotSpotJVMCIBackendFactory baseFactory,
HotSpotJVMCIBackendFactory overridingFactory)
Checks that a factory overriding is valid.
|
private void |
compileMetaspaceMethod(long metaspaceMethod,
int entryBCI,
long jvmciEnv,
int id)
Called from the VM.
|
private void |
compileTheWorld()
Called from the VM.
|
void |
completeInitialization()
Do deferred initialization.
|
static HotSpotJVMCIBackendFactory |
findFactory(String architecture) |
ResolvedJavaType |
fromClass(Class<?> javaClass)
Gets the JVMCI mirror for a
Class object. |
Map<Class<? extends Architecture>,JVMCIBackend> |
getBackends() |
CompilerToVM |
getCompilerToVM() |
HotSpotVMConfig |
getConfig() |
JVMCIBackend |
getHostJVMCIBackend()
Gets the host JVMCI backend.
|
static Kind |
getHostWordKind()
Gets the kind of a word value on the host backend.
|
<T extends Architecture> |
getJVMCIBackend(Class<T> arch)
Gets the backend for a given architecture.
|
JavaType |
lookupType(String name,
HotSpotResolvedObjectType accessingType,
boolean resolve)
Converts a name to a Java type.
|
(package private) void |
notifyInstall(HotSpotCodeCacheProvider hotSpotCodeCacheProvider,
InstalledCode installedCode,
CompilationResult compResult)
Shuts down the runtime.
|
private JVMCIBackend |
registerBackend(JVMCIBackend backend) |
static HotSpotJVMCIRuntime |
runtime()
Gets the singleton
HotSpotJVMCIRuntime object. |
private void |
shutdown()
Shuts down the runtime.
|
static long |
unsafeReadKlassPointer(Object object)
Reads a klass pointer from a constant object.
|
static long |
unsafeReadWord(Object object,
long offset)
Reads a word value from a given object.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getArrayBaseOffset, getArrayIndexScale
private static final HotSpotJVMCIRuntime instance
protected CompilerToVM compilerToVm
protected final HotSpotVMConfig config
private final JVMCIBackend hostBackend
private final ClassValue<ResolvedJavaType> jvmciMirrors
ClassValue
associated with the Class
of the
type. This data structure stores both HotSpotResolvedObjectType
and
HotSpotResolvedPrimitiveType
types.private final Map<Class<? extends Architecture>,JVMCIBackend> backends
private final Iterable<HotSpotVMEventListener> vmEventListeners
private HotSpotJVMCIRuntime()
public static HotSpotJVMCIRuntime runtime()
HotSpotJVMCIRuntime
object.public void completeInitialization()
public static HotSpotJVMCIBackendFactory findFactory(String architecture)
private static boolean checkFactoryOverriding(HotSpotJVMCIBackendFactory baseFactory, HotSpotJVMCIBackendFactory overridingFactory)
baseFactory
- overridingFactory
- public static Kind getHostWordKind()
public static long unsafeReadKlassPointer(Object object)
public static long unsafeReadWord(Object object, long offset)
private JVMCIBackend registerBackend(JVMCIBackend backend)
public ResolvedJavaType fromClass(Class<?> javaClass)
HotSpotJVMCIRuntimeProvider
Class
object.fromClass
in interface HotSpotJVMCIRuntimeProvider
ResolvedJavaType
corresponding to javaClass
public HotSpotVMConfig getConfig()
getConfig
in interface HotSpotJVMCIRuntimeProvider
public CompilerToVM getCompilerToVM()
getCompilerToVM
in interface HotSpotJVMCIRuntimeProvider
public JavaType lookupType(String name, HotSpotResolvedObjectType accessingType, boolean resolve)
HotSpotJVMCIRuntimeProvider
name
to a
ResolvedJavaType
.lookupType
in interface HotSpotJVMCIRuntimeProvider
name
- a well formed Java type in internal formataccessingType
- the context of resolution which must be non-nullresolve
- specifies whether resolution failure results in an unresolved type being
return or a LinkageError
being thrownname
which is guaranteed to be of type
ResolvedJavaType
if resolve == true
public JVMCIBackend getHostJVMCIBackend()
JVMCIRuntime
getHostJVMCIBackend
in interface JVMCIRuntime
public <T extends Architecture> JVMCIBackend getJVMCIBackend(Class<T> arch)
JVMCIRuntime
getJVMCIBackend
in interface JVMCIRuntime
arch
- a specific architecture classpublic Map<Class<? extends Architecture>,JVMCIBackend> getBackends()
private void compileMetaspaceMethod(long metaspaceMethod, int entryBCI, long jvmciEnv, int id)
private void compileTheWorld() throws Throwable
Throwable
private void shutdown() throws Exception
Exception
void notifyInstall(HotSpotCodeCacheProvider hotSpotCodeCacheProvider, InstalledCode installedCode, CompilationResult compResult)
hotSpotCodeCacheProvider
-