public interface SubstrateInstalledCode
InstalledCode, but can be implemented in an existing class hierarchy. Code also
has native structures associated with it, see CodeInfo and CodeInfoAccess.
Assume that methods such as SubstrateInstalledCode.isValid(), SubstrateInstalledCode.isAlive() or SubstrateInstalledCode.getEntryPoint() return
stale values because generally, their internal state can change at any safepoint. Consistent
reads of such values require ensuring the absence of safepoint checks and preventing floating
reads and read elimination.
| Modifier and Type | Interface and Description |
|---|---|
static interface |
SubstrateInstalledCode.Factory
Provides access to a
SubstrateInstalledCode. |
| Modifier and Type | Method and Description |
|---|---|
void |
clearAddress()
This method is called during code uninstallation.
|
long |
getAddress()
The address of this code if alive, or 0 otherwise.
|
long |
getEntryPoint()
The entry point address of this code if valid, or 0 otherwise.
|
jdk.vm.ci.meta.ResolvedJavaMethod |
getMethod()
Returns the last method object passed to
SubstrateInstalledCode.setAddress(long, jdk.vm.ci.meta.ResolvedJavaMethod). |
String |
getName() |
SubstrateSpeculationLog |
getSpeculationLog() |
void |
invalidate()
Invalidates this installed code and deoptimizes all live invocations, after which both
SubstrateInstalledCode.isValid() and SubstrateInstalledCode.isAlive() return false. |
void |
invalidateWithoutDeoptimization()
Make this code non-entrant, but let live invocations continue execution.
|
boolean |
isAlive()
Whether the code represented by this object exists and could have live invocations.
|
boolean |
isValid()
Whether the code represented by this object exists and can be invoked.
|
void |
setAddress(long address,
jdk.vm.ci.meta.ResolvedJavaMethod method)
Called during code installation: initialize this instance with the given address where its
instructions are, and the method it was compiled from.
|
void |
setCompilationId(org.graalvm.compiler.core.common.CompilationIdentifier id)
Sets the identifier of the compilation that resulted in this code, which can be used to
provide additional information in
SubstrateInstalledCode.getName(). |
String getName()
long getEntryPoint()
long getAddress()
jdk.vm.ci.meta.ResolvedJavaMethod getMethod()
SubstrateInstalledCode.setAddress(long, jdk.vm.ci.meta.ResolvedJavaMethod). The return value might be
passed as the argument to future calls to SubstrateInstalledCode.setAddress(long, jdk.vm.ci.meta.ResolvedJavaMethod).
May return null if the subclass does not have a use for the method object (also not
in SubstrateInstalledCode.setAddress(long, jdk.vm.ci.meta.ResolvedJavaMethod)) and therefore no need to retain it. Expected to return null
if SubstrateInstalledCode.setAddress(long, jdk.vm.ci.meta.ResolvedJavaMethod) has never been called, or after SubstrateInstalledCode.clearAddress() has been called.
void setAddress(long address,
jdk.vm.ci.meta.ResolvedJavaMethod method)
SubstrateInstalledCode.getAddress() and
SubstrateInstalledCode.getEntryPoint() return the given address, and SubstrateInstalledCode.isValid() and
SubstrateInstalledCode.isAlive() return true.void clearAddress()
SubstrateInstalledCode.invalidate() instead.
Reset this instance so that SubstrateInstalledCode.getAddress() and SubstrateInstalledCode.getEntryPoint() return 0, and
SubstrateInstalledCode.isValid() and SubstrateInstalledCode.isAlive() return false.
boolean isValid()
void invalidate()
SubstrateInstalledCode.isValid() and SubstrateInstalledCode.isAlive() return false.boolean isAlive()
void invalidateWithoutDeoptimization()
SubstrateInstalledCode.isValid() returns false, SubstrateInstalledCode.isAlive() returns true, and
SubstrateInstalledCode.getEntryPoint() returns 0.SubstrateSpeculationLog getSpeculationLog()
void setCompilationId(org.graalvm.compiler.core.common.CompilationIdentifier id)
SubstrateInstalledCode.getName().