|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.classloader.AnnotatedElement org.jikesrvm.classloader.RVMMember org.jikesrvm.classloader.RVMMethod
public abstract class RVMMethod
A method of a java class corresponding to a method_info structure
in the class file. A method is read from a class file using the
readMethod(org.jikesrvm.classloader.TypeReference, int[], org.jikesrvm.classloader.MemberReference, short, java.io.DataInputStream)
method.
Field Summary | |
---|---|
private static HashMapRVM<RVMMethod,Object> |
annotationDefaults
A table mapping to values present in the method info tables of annotation types. |
protected CompiledMethod |
currentCompiledMethod
current compiled method for this method |
private static ImmutableEntryHashMapRVM<RVMMethod,Annotation[][]> |
declaredParameterAnnotations
Cache of arrays of declared parameter annotations. |
private static ImmutableEntryHashMapRVM<RVMMethod,TypeReference[]> |
exceptionTypes
exceptions this method might throw (null --> none) |
private static ImmutableEntryHashMapRVM<RVMMethod,ReflectionBase> |
invokeMethods
Map from a method to a reflective method capable of invoking it |
private static ImmutableEntryHashMapRVM<RVMMethod,Integer> |
jtocOffsets
The offsets of virtual methods in the JTOC, if it's been placed there by constant propagation. |
private static ImmutableEntryHashMapRVM<RVMMethod,RVMAnnotation[][]> |
parameterAnnotations
Method parameter annotations from the class file that are described as runtime visible. |
Fields inherited from class org.jikesrvm.classloader.RVMMember |
---|
memRef, modifiers, offset |
Fields inherited from class org.jikesrvm.classloader.AnnotatedElement |
---|
declaredAnnotationDatas |
Fields inherited from interface org.jikesrvm.Constants |
---|
NOT_REACHED, REFLECTION_FPRS_BITS, REFLECTION_FPRS_MASK, REFLECTION_GPRS_BITS, REFLECTION_GPRS_MASK |
Fields inherited from interface org.jikesrvm.objectmodel.ThinLockConstants |
---|
TL_DEDICATED_U16_OFFSET, TL_DEDICATED_U16_SHIFT, TL_LOCK_COUNT_MASK, TL_LOCK_COUNT_SHIFT, TL_LOCK_COUNT_UNIT, TL_LOCK_ID_MASK, TL_LOCK_ID_SHIFT, TL_NUM_BITS_RC, TL_NUM_BITS_STAT, TL_NUM_BITS_TID, TL_STAT_BIASABLE, TL_STAT_FAT, TL_STAT_MASK, TL_STAT_SHIFT, TL_STAT_THIN, TL_THREAD_ID_MASK, TL_THREAD_ID_SHIFT, TL_UNLOCK_MASK |
Fields inherited from interface org.jikesrvm.objectmodel.TIBLayoutConstants |
---|
IMT_METHOD_SLOTS, NEEDS_DYNAMIC_LINK, TIB_ARRAY_ELEMENT_TIB_INDEX, TIB_DOES_IMPLEMENT_INDEX, TIB_FIRST_SPECIALIZED_METHOD_INDEX, TIB_FIRST_VIRTUAL_METHOD_INDEX, TIB_INTERFACE_DISPATCH_TABLE_INDEX, TIB_SUPERCLASS_IDS_INDEX, TIB_TYPE_INDEX |
Fields inherited from interface org.jikesrvm.HeapLayoutConstants |
---|
BAD_MAP_COMPRESSION, BOOT_IMAGE_CODE_END, BOOT_IMAGE_CODE_SIZE, BOOT_IMAGE_CODE_START, BOOT_IMAGE_DATA_END, BOOT_IMAGE_DATA_SIZE, BOOT_IMAGE_DATA_START, BOOT_IMAGE_END, BOOT_IMAGE_RMAP_END, BOOT_IMAGE_RMAP_START, MAX_BOOT_IMAGE_RMAP_SIZE, MAXIMUM_MAPPABLE |
Constructor Summary | |
---|---|
protected |
RVMMethod(TypeReference declaringClass,
MemberReference memRef,
short modifiers,
TypeReference[] exceptionTypes,
Atom signature,
RVMAnnotation[] annotations,
RVMAnnotation[][] parameterAnnotations,
Object annotationDefault)
Construct a read method |
Method Summary | |
---|---|
void |
compile()
Generate machine code for this method if valid machine code doesn't already exist. |
(package private) static RVMMethod |
createAnnotationInit(TypeReference aClass,
int[] constantPool,
MemberReference memRef,
int objectInitIndex,
RVMField[] aFields,
RVMMethod[] aMethods,
int[] defaultConstants)
Create a method to initialise the annotation class |
(package private) static RVMMethod |
createAnnotationMethod(TypeReference annotationClass,
int[] constantPool,
MemberReference memRef,
RVMMethod interfaceMethod,
int constantPoolIndex)
Create a copy of the method that occurs in the annotation interface. |
(package private) static RVMMethod |
createDefaultConstructor(TypeReference klass,
MemberReference memRef)
Create a method to act as a default constructor (just return) |
(package private) RVMMethod |
createReflectionMethod(TypeReference reflectionClass,
int[] constantPool,
MethodReference memRef)
Create a method for reflectively invoking this method |
Offset |
findOrCreateJtocOffset()
Find or create a JTOC offset for this method |
protected abstract CompiledMethod |
genCode()
Generate the code for this method |
Object |
getAnnotationDefault()
Get the annotation default value for an annotation method |
CompiledMethod |
getCurrentCompiledMethod()
Get the current compiled method for this method. |
ArchitectureSpecific.CodeArray |
getCurrentEntryCodeArray()
Get the code array that corresponds to the entry point (prologue) for the method. |
Annotation[][] |
getDeclaredParameterAnnotations()
Returns the parameter annotations for this method. |
TypeReference[] |
getExceptionTypes()
Exceptions thrown by this method - something like { "java/lang/IOException", "java/lang/EOFException" } |
ReflectionBase |
getInvoker()
Get an instance of an object capable of reflectively invoking this method |
private Offset |
getJtocOffset()
Get the offset used to hold a JTOC addressable version of the current entry code array |
private RVMAnnotation[][] |
getParameterAnnotations()
Get the parameter annotations for this method |
TypeReference[] |
getParameterTypes()
Type of this method's parameters. |
int |
getParameterWords()
Space required by this method for its parameters, in words. |
TypeReference |
getReturnType()
Type of this method's return value. |
boolean |
hasNoInlinePragma()
Has this method been marked as forbidden to inline? |
void |
invalidateCompiledMethod(CompiledMethod cm)
If CM is the current compiled code for this, then invalidate it. |
boolean |
isAbstract()
Implemented in subclass? |
boolean |
isBridge()
Is this method a bridge method? |
boolean |
isClassInitializer()
Is this method a class initializer? |
boolean |
isCompiled()
Has machine code been generated for this method's bytecodes? |
boolean |
isFinal()
Declared as non-overridable by subclasses? |
boolean |
isInterruptible()
Is this method interruptible? |
boolean |
isNative()
Not implemented in java? |
boolean |
isNonMovingAllocation()
Should all allocation from this method go to a non-moving space? |
boolean |
isObjectInitializer()
Is this method an object initializer? |
boolean |
isObjectInitializerHelper()
Is this method a compiler-generated object initializer helper? |
boolean |
isPure()
Is the method Pure? |
boolean |
isRuntimePure()
Is the method RuntimePure? |
boolean |
isRuntimeServiceMethod()
|
boolean |
isSpecializedInvoke()
Not implemented in Java and use C not JNI calling convention |
boolean |
isStatic()
Declared as statically dispatched? |
boolean |
isStrictFP()
Strict enforcement of IEEE 754 rules? |
boolean |
isSynchronized()
Guarded by monitorenter/monitorexit? |
boolean |
isSynthetic()
Not present in source code file? |
boolean |
isSysCall()
Not implemented in Java and use C not JNI calling convention |
boolean |
isUninterruptible()
Is the method Uninterruptible? |
boolean |
isUnpreemptible()
Is the method Unpreemptible? |
boolean |
isVarArgs()
Is this a varargs method taking a variable number of arguments? |
boolean |
mayWrite(RVMField field)
|
(package private) static RVMMethod |
readMethod(TypeReference declaringClass,
int[] constantPool,
MemberReference memRef,
short modifiers,
DataInputStream input)
Called from ClassFileReader.readClass(TypeReference,DataInputStream) to create an
instance of a RVMMethod by reading the relevant data from the argument bytecode stream. |
void |
replaceCompiledMethod(CompiledMethod compiledMethod)
Change machine code that will be used by future executions of this method (ie. optimized <-> non-optimized) Side effect: updates JTOC or method dispatch tables ("type information blocks") for this class and its subclasses |
private static int |
typeRefToReturnBytecode(TypeReference tr)
What would be the appropriate return bytecode for the given type reference? |
Methods inherited from class org.jikesrvm.classloader.RVMMember |
---|
getDeclaringClass, getDescriptor, getId, getMemberRef, getModifiers, getName, getOffset, getSignature, hashCode, hasOffset, isPrivate, isProtected, isPublic, setOffset, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected CompiledMethod currentCompiledMethod
private static final ImmutableEntryHashMapRVM<RVMMethod,TypeReference[]> exceptionTypes
private static final ImmutableEntryHashMapRVM<RVMMethod,RVMAnnotation[][]> parameterAnnotations
private static final HashMapRVM<RVMMethod,Object> annotationDefaults
private static final ImmutableEntryHashMapRVM<RVMMethod,Integer> jtocOffsets
private static final ImmutableEntryHashMapRVM<RVMMethod,Annotation[][]> declaredParameterAnnotations
private static final ImmutableEntryHashMapRVM<RVMMethod,ReflectionBase> invokeMethods
Constructor Detail |
---|
protected RVMMethod(TypeReference declaringClass, MemberReference memRef, short modifiers, TypeReference[] exceptionTypes, Atom signature, RVMAnnotation[] annotations, RVMAnnotation[][] parameterAnnotations, Object annotationDefault)
declaringClass
- the RVMClass object of the class that declared this fieldmemRef
- the canonical memberReference for this method.modifiers
- modifiers associated with this method.exceptionTypes
- exceptions thrown by this method.signature
- generic type of this method.annotations
- array of runtime visible annotationsparameterAnnotations
- array of runtime visible parameter annotationsannotationDefault
- value for this annotation that appearsMethod Detail |
---|
private RVMAnnotation[][] getParameterAnnotations()
public Object getAnnotationDefault()
static RVMMethod readMethod(TypeReference declaringClass, int[] constantPool, MemberReference memRef, short modifiers, DataInputStream input) throws IOException
ClassFileReader.readClass(TypeReference,DataInputStream)
to create an
instance of a RVMMethod by reading the relevant data from the argument bytecode stream.
declaringClass
- the TypeReference of the class being loadedconstantPool
- the constantPool of the RVMClass object that's being constructedmemRef
- the canonical memberReference for this member.modifiers
- modifiers associated with this member.input
- the DataInputStream to read the method's attributes from
IOException
static RVMMethod createAnnotationMethod(TypeReference annotationClass, int[] constantPool, MemberReference memRef, RVMMethod interfaceMethod, int constantPoolIndex)
annotationClass
- the class this method belongs toconstantPool
- for the classmemRef
- the member reference corresponding to this methodinterfaceMethod
- the interface method that will copied to
produce the annotation methodconstantPoolIndex
- the index of the field that will be
returned by this method
static RVMMethod createAnnotationInit(TypeReference aClass, int[] constantPool, MemberReference memRef, int objectInitIndex, RVMField[] aFields, RVMMethod[] aMethods, int[] defaultConstants)
aClass
- the class this method belongs toconstantPool
- for the classmemRef
- the member reference corresponding to this methodobjectInitIndex
- an index into the constant pool for a
method reference to java.lang.Object.aFields
- aMethods
-
private static int typeRefToReturnBytecode(TypeReference tr)
public final boolean isClassInitializer()
public final boolean isObjectInitializer()
public final boolean isObjectInitializerHelper()
public final TypeReference getReturnType()
public final TypeReference[] getParameterTypes()
public final int getParameterWords()
public final boolean isCompiled()
public final CompiledMethod getCurrentCompiledMethod()
public final boolean isStatic()
public final boolean isFinal()
public final boolean isSynchronized()
public final boolean isNative()
public final boolean isStrictFP()
public final boolean isSysCall()
public final boolean isSpecializedInvoke()
public final boolean isAbstract()
public boolean isSynthetic()
public boolean isBridge()
public boolean isVarArgs()
public final TypeReference[] getExceptionTypes()
public final boolean isInterruptible()
<clinit>
or <init>
method then it is interruptible.
<init>
methods then it is interruptible.
@Interruptible
it is interruptible.
@Preemptible
it is interruptible.
@Uninterruptible
it is not interruptible.
@UninterruptibleNoWarn
it is not interruptible.
@Unpreemptible
it is not interruptible.
@Uninterruptible
or @Unpreemptible
it is not interruptible.
public final boolean isUnpreemptible()
isInterruptible()
public final boolean isUninterruptible()
isInterruptible()
public final boolean isPure()
public final boolean isRuntimePure()
public final boolean hasNoInlinePragma()
NoInline
annotation or
the NoOptCompile
annotation?
public boolean mayWrite(RVMField field)
true
if the method may write to a given fieldpublic boolean isRuntimeServiceMethod()
true
if the method is the implementation of a runtime service
that is called "under the covers" from the generated code and thus is not subject to
inlining via the normal mechanisms.public boolean isNonMovingAllocation()
public final ArchitectureSpecific.CodeArray getCurrentEntryCodeArray()
public final void compile()
protected abstract CompiledMethod genCode()
public final void replaceCompiledMethod(CompiledMethod compiledMethod)
Side effect: updates JTOC or method dispatch tables ("type information blocks") for this class and its subclasses
compiledMethod
- new machine codepublic final void invalidateCompiledMethod(CompiledMethod cm)
private Offset getJtocOffset()
public final Offset findOrCreateJtocOffset()
public final Annotation[][] getDeclaredParameterAnnotations()
public ReflectionBase getInvoker()
static RVMMethod createDefaultConstructor(TypeReference klass, MemberReference memRef)
klass
- class for methodmemRef
- reference for default constructor
RVMMethod createReflectionMethod(TypeReference reflectionClass, int[] constantPool, MethodReference memRef)
reflectionClass
- the class this method will belong toconstantPool
- for the classmemRef
- the member reference corresponding to this method
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |