public final class HotSpotResolvedJavaMethodImpl extends HotSpotMethod implements HotSpotResolvedJavaMethod, HotSpotProxified, MethodIdHolder
JavaMethod
for resolved HotSpot methods.Modifier and Type | Class and Description |
---|---|
static class |
HotSpotResolvedJavaMethodImpl.Options |
MethodIdHolder.MethodIdAllocator
Modifier and Type | Field and Description |
---|---|
private byte[] |
code |
private HotSpotConstantPool |
constantPool |
private HotSpotResolvedObjectTypeImpl |
holder |
private long |
metaspaceMethod
Reference to metaspace Method object.
|
private HotSpotMethodData |
methodData |
private int |
methodId |
private HotSpotSignature |
signature |
private static ClassValue<Map<Long,SpeculationLog>> |
SpeculationLogs
The
SpeculationLog for methods compiled by JVMCI hang off this per-declaring-type
ClassValue . |
private Member |
toJavaCache |
private static String |
TraceMethodDataFilter |
FULLY_QUALIFIED_METHOD_NAME, name
ANNOTATION, BRIDGE, ENUM, MANDATED, SYNTHETIC, VARARGS
Constructor and Description |
---|
HotSpotResolvedJavaMethodImpl(HotSpotResolvedObjectTypeImpl holder,
long metaspaceMethod) |
Modifier and Type | Method and Description |
---|---|
int |
allocateCompileId(int entryBCI)
Allocates a compile id for this method by asking the VM for one.
|
StackTraceElement |
asStackTraceElement(int bci) |
boolean |
canBeInlined() |
boolean |
canBeStaticallyBound() |
boolean |
equals(Object obj) |
static HotSpotResolvedJavaMethod |
fromMetaspace(long metaspaceMethod)
Gets the
ResolvedJavaMethod for a HotSpot metaspace method native object. |
int |
getAllModifiers()
Gets the complete set of modifiers for this method which includes the JVM specification
modifiers as well as the HotSpot internal modifiers.
|
<T extends Annotation> |
getAnnotation(Class<T> annotationClass) |
Annotation[] |
getAnnotations() |
byte[] |
getCode() |
int |
getCodeSize() |
private long |
getCompiledCode()
Gets the value of
Method::_code . |
ConstantPool |
getConstantPool() |
private long |
getConstMethod()
Returns a pointer to this method's constant method data structure (
Method::_constMethod ). |
private int |
getConstMethodFlags()
Returns this method's constant method flags (
ConstMethod::_flags ). |
HotSpotResolvedObjectTypeImpl |
getDeclaringClass() |
JavaConstant |
getEncoding() |
ExceptionHandler[] |
getExceptionHandlers() |
private int |
getFlags()
Returns this method's flags (
Method::_flags ). |
Type[] |
getGenericParameterTypes() |
static HotSpotResolvedObjectTypeImpl |
getHolder(long metaspaceMethod)
Gets the holder of a HotSpot metaspace method native object.
|
LineNumberTable |
getLineNumberTable() |
LocalVariableTable |
getLocalVariableTable() |
int |
getMaxLocals() |
int |
getMaxStackSize() |
long |
getMetaspaceMethod() |
JavaConstant |
getMetaspaceMethodConstant()
Gets the address of the C++ Method object for this method.
|
int |
getMethodId() |
int |
getModifiers() |
Annotation[][] |
getParameterAnnotations() |
ProfilingInfo |
getProfilingInfo(boolean includeNormal,
boolean includeOSR) |
HotSpotSignature |
getSignature() |
SpeculationLog |
getSpeculationLog() |
private int |
getVtableIndex()
Returns this method's virtual table index.
|
private int |
getVtableIndex(HotSpotResolvedObjectTypeImpl resolved) |
private int |
getVtableIndexForInterface(ResolvedJavaType resolved) |
boolean |
hasBalancedMonitors() |
boolean |
hasCodeAtLevel(int entryBCI,
int level) |
boolean |
hasCompiledCode()
Returns whether this method has compiled code.
|
boolean |
hasCompiledCodeAtLevel(int level) |
int |
hashCode() |
boolean |
ignoredBySecurityStackWalk()
Returns true if this method is one of the special methods that is ignored by security stack
walks.
|
int |
intrinsicId() |
JavaConstant |
invoke(JavaConstant receiver,
JavaConstant[] arguments) |
boolean |
isCallerSensitive()
Returns true if this method has a
CallerSensitive annotation. |
boolean |
isClassInitializer() |
boolean |
isConstructor() |
boolean |
isDefault() |
boolean |
isDontInline()
Returns true if this method has a
DontInline annotation. |
boolean |
isForceInline()
Returns true if this method has a
ForceInline annotation. |
boolean |
isInVirtualMethodTable(ResolvedJavaType resolved) |
void |
reprofile() |
void |
setMethodId(int id) |
void |
setNotInlineable()
Manually adds a DontInline annotation to this method.
|
boolean |
shouldBeInlined() |
Class<?>[] |
signatureToTypes() |
private Method |
toJava() |
private Constructor<?> |
toJavaConstructor() |
ResolvedJavaMethod |
uniqueConcreteMethod(HotSpotResolvedObjectType receiver) |
int |
vtableEntryOffset(ResolvedJavaType resolved)
Returns the offset of this method into the v-table.
|
applyFormattingFlagsAndWidth, asJavaMethod, formatTo, getName, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getParameterAnnotation, getParameterAnnotations, getProfilingInfo, hasBytecodes, hasReceiver, isBridge, isFinal, isJavaLangObjectInit, isSignaturePolymorphic, isSynthetic, isVarArgs, toParameterTypes
format, getName
isAbstract, isConcrete, isFinalFlagSet, isInterface, isNative, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isStrict, isSynchronized, isTransient, isVolatile, jvmClassModifiers, jvmFieldModifiers, jvmMethodModifiers
assignIds
private final long metaspaceMethod
private final HotSpotResolvedObjectTypeImpl holder
private final HotSpotConstantPool constantPool
private final HotSpotSignature signature
private HotSpotMethodData methodData
private byte[] code
private Member toJavaCache
private static final String TraceMethodDataFilter
private static final ClassValue<Map<Long,SpeculationLog>> SpeculationLogs
SpeculationLog
for methods compiled by JVMCI hang off this per-declaring-type
ClassValue
. The raw Method* value is safe to use as a key in the map as a) it is
never moves and b) we never read from it.
One implication is that we will preserve SpeculationLog
s for methods that have been
redefined via class redefinition. It's tempting to periodically flush such logs but we cannot
read the JVM_ACC_IS_OBSOLETE bit (or anything else) via the raw pointer as obsoleted methods
are subject to clean up and deletion (see InstanceKlass::purge_previous_versions_internal).
private int methodId
public HotSpotResolvedJavaMethodImpl(HotSpotResolvedObjectTypeImpl holder, long metaspaceMethod)
public static HotSpotResolvedObjectTypeImpl getHolder(long metaspaceMethod)
metaspaceMethod
- a metaspace Method objectResolvedJavaType
corresponding to the holder of the
metaspaceMethod
public static HotSpotResolvedJavaMethod fromMetaspace(long metaspaceMethod)
ResolvedJavaMethod
for a HotSpot metaspace method native object.metaspaceMethod
- a metaspace Method objectResolvedJavaMethod
corresponding to metaspaceMethod
private long getConstMethod()
Method::_constMethod
).private int getFlags()
Method::_flags
).private int getConstMethodFlags()
ConstMethod::_flags
).public HotSpotResolvedObjectTypeImpl getDeclaringClass()
getDeclaringClass
in interface HotSpotResolvedJavaMethod
getDeclaringClass
in interface JavaMethod
getDeclaringClass
in interface ResolvedJavaMethod
public JavaConstant getMetaspaceMethodConstant()
public long getMetaspaceMethod()
public JavaConstant getEncoding()
getEncoding
in interface ResolvedJavaMethod
public int getAllModifiers()
public int getModifiers()
getModifiers
in interface ModifiersProvider
getModifiers
in interface ResolvedJavaMethod
public boolean canBeStaticallyBound()
canBeStaticallyBound
in interface ResolvedJavaMethod
public byte[] getCode()
getCode
in interface ResolvedJavaMethod
public int getCodeSize()
getCodeSize
in interface ResolvedJavaMethod
public ExceptionHandler[] getExceptionHandlers()
getExceptionHandlers
in interface ResolvedJavaMethod
public boolean isCallerSensitive()
CallerSensitive
annotation.isCallerSensitive
in interface HotSpotResolvedJavaMethod
public boolean isForceInline()
ForceInline
annotation.isForceInline
in interface HotSpotResolvedJavaMethod
public boolean isDontInline()
DontInline
annotation.isDontInline
in interface HotSpotResolvedJavaMethod
public void setNotInlineable()
setNotInlineable
in interface HotSpotResolvedJavaMethod
public boolean ignoredBySecurityStackWalk()
ignoredBySecurityStackWalk
in interface HotSpotResolvedJavaMethod
public boolean hasBalancedMonitors()
hasBalancedMonitors
in interface HotSpotResolvedJavaMethod
public boolean isClassInitializer()
isClassInitializer
in interface ResolvedJavaMethod
public boolean isConstructor()
isConstructor
in interface ResolvedJavaMethod
public int getMaxLocals()
getMaxLocals
in interface ResolvedJavaMethod
public int getMaxStackSize()
getMaxStackSize
in interface ResolvedJavaMethod
public StackTraceElement asStackTraceElement(int bci)
asStackTraceElement
in interface ResolvedJavaMethod
public ResolvedJavaMethod uniqueConcreteMethod(HotSpotResolvedObjectType receiver)
uniqueConcreteMethod
in interface HotSpotResolvedJavaMethod
public HotSpotSignature getSignature()
getSignature
in interface JavaMethod
private long getCompiledCode()
Method::_code
.Method::_code
public boolean hasCompiledCode()
hasCompiledCode
in interface HotSpotResolvedJavaMethod
public boolean hasCompiledCodeAtLevel(int level)
hasCompiledCodeAtLevel
in interface HotSpotResolvedJavaMethod
level
- level
.public ProfilingInfo getProfilingInfo(boolean includeNormal, boolean includeOSR)
getProfilingInfo
in interface ResolvedJavaMethod
public void reprofile()
reprofile
in interface ResolvedJavaMethod
public ConstantPool getConstantPool()
getConstantPool
in interface ResolvedJavaMethod
public Annotation[][] getParameterAnnotations()
getParameterAnnotations
in interface ResolvedJavaMethod
public Annotation[] getAnnotations()
getAnnotations
in interface ResolvedJavaMethod
public <T extends Annotation> T getAnnotation(Class<T> annotationClass)
getAnnotation
in interface ResolvedJavaMethod
public boolean isDefault()
isDefault
in interface HotSpotResolvedJavaMethod
isDefault
in interface ResolvedJavaMethod
public Type[] getGenericParameterTypes()
getGenericParameterTypes
in interface ResolvedJavaMethod
public Class<?>[] signatureToTypes()
private Constructor<?> toJavaConstructor()
public boolean canBeInlined()
canBeInlined
in interface ResolvedJavaMethod
public boolean shouldBeInlined()
shouldBeInlined
in interface ResolvedJavaMethod
public LineNumberTable getLineNumberTable()
getLineNumberTable
in interface ResolvedJavaMethod
public LocalVariableTable getLocalVariableTable()
getLocalVariableTable
in interface ResolvedJavaMethod
public int vtableEntryOffset(ResolvedJavaType resolved)
isInVirtualMethodTable(ResolvedJavaType)
, otherwise an exception is
thrown.vtableEntryOffset
in interface HotSpotResolvedJavaMethod
public boolean isInVirtualMethodTable(ResolvedJavaType resolved)
isInVirtualMethodTable
in interface ResolvedJavaMethod
private int getVtableIndex(HotSpotResolvedObjectTypeImpl resolved)
private int getVtableIndex()
private int getVtableIndexForInterface(ResolvedJavaType resolved)
public SpeculationLog getSpeculationLog()
getSpeculationLog
in interface ResolvedJavaMethod
public int intrinsicId()
intrinsicId
in interface HotSpotResolvedJavaMethod
public JavaConstant invoke(JavaConstant receiver, JavaConstant[] arguments)
invoke
in interface ResolvedJavaMethod
public int allocateCompileId(int entryBCI)
allocateCompileId
in interface HotSpotResolvedJavaMethod
entryBCI
- entry bcipublic boolean hasCodeAtLevel(int entryBCI, int level)
hasCodeAtLevel
in interface HotSpotResolvedJavaMethod
public void setMethodId(int id)
setMethodId
in interface MethodIdHolder
public int getMethodId()
getMethodId
in interface MethodIdHolder