public class HotSpotNmethod extends HotSpotInstalledCode
InstalledCode for code installed as an nmethod. The nmethod stores a
weak reference to an instance of this class. This is necessary to keep the nmethod from being
unloaded while the associated HotSpotNmethod instance is alive.
Note that there is no (current) way for the reference from an nmethod to a HotSpotNmethod
instance to be anything but weak. This is due to the fact that HotSpot does not treat nmethods as
strong GC roots.
| Modifier and Type | Field and Description |
|---|---|
private boolean |
isDefault |
private boolean |
isExternal |
private HotSpotResolvedJavaMethod |
method
This (indirect) Method* reference is safe since class redefinition preserves all methods
associated with nmethods in the code cache.
|
name| Constructor and Description |
|---|
HotSpotNmethod(HotSpotResolvedJavaMethod method,
String name,
boolean isDefault) |
HotSpotNmethod(HotSpotResolvedJavaMethod method,
String name,
boolean isDefault,
boolean isExternal) |
| Modifier and Type | Method and Description |
|---|---|
private boolean |
checkArgs(Object... args) |
protected boolean |
checkThreeObjectArgs() |
Object |
executeVarargs(Object... args)
Executes the installed code with a variable number of arguments.
|
ResolvedJavaMethod |
getMethod() |
long |
getStart()
Returns the start address of this installed code if it is valid, 0
otherwise.
|
void |
invalidate()
Invalidates this installed code such that any subsequent invocation will throw an
InvalidInstalledCodeException. |
boolean |
isDefault() |
boolean |
isExternal() |
String |
toString() |
getBlob, getCode, getCodeSize, getSizegetAddress, getName, getVersion, isValid, setAddressprivate final HotSpotResolvedJavaMethod method
private final boolean isDefault
private final boolean isExternal
public HotSpotNmethod(HotSpotResolvedJavaMethod method, String name, boolean isDefault)
public HotSpotNmethod(HotSpotResolvedJavaMethod method, String name, boolean isDefault, boolean isExternal)
public boolean isDefault()
public boolean isExternal()
public ResolvedJavaMethod getMethod()
public void invalidate()
InstalledCodeInvalidInstalledCodeException.invalidate in class InstalledCodepublic String toString()
toString in class HotSpotInstalledCodeprotected boolean checkThreeObjectArgs()
public Object executeVarargs(Object... args) throws InvalidInstalledCodeException
InstalledCodeexecuteVarargs in class InstalledCodeargs - the array of object argumentsInvalidInstalledCodeExceptionpublic long getStart()
InstalledCodegetStart in class HotSpotInstalledCode