org.jikesrvm.classloader
Class RVMMethod

java.lang.Object
  extended by org.jikesrvm.classloader.AnnotatedElement
      extended by org.jikesrvm.classloader.RVMMember
          extended by org.jikesrvm.classloader.RVMMethod
All Implemented Interfaces:
AnnotatedElement, BytecodeConstants, ClassLoaderConstants, Constants, HeapLayoutConstants, ThinLockConstants, TIBLayoutConstants, SizeConstants
Direct Known Subclasses:
AbstractMethod, NativeMethod, NormalMethod

public abstract class RVMMethod
extends RVMMember
implements BytecodeConstants

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.classloader.BytecodeConstants
JBC_aaload, JBC_aastore, JBC_aconst_null, JBC_aload, JBC_aload_0, JBC_aload_1, JBC_aload_2, JBC_aload_3, JBC_anewarray, JBC_areturn, JBC_arraylength, JBC_astore, JBC_astore_0, JBC_astore_1, JBC_astore_2, JBC_astore_3, JBC_athrow, JBC_baload, JBC_bastore, JBC_bipush, JBC_caload, JBC_castore, JBC_checkcast, JBC_d2f, JBC_d2i, JBC_d2l, JBC_dadd, JBC_daload, JBC_dastore, JBC_dcmpg, JBC_dcmpl, JBC_dconst_0, JBC_dconst_1, JBC_ddiv, JBC_dload, JBC_dload_0, JBC_dload_1, JBC_dload_2, JBC_dload_3, JBC_dmul, JBC_dneg, JBC_drem, JBC_dreturn, JBC_dstore, JBC_dstore_0, JBC_dstore_1, JBC_dstore_2, JBC_dstore_3, JBC_dsub, JBC_dup, JBC_dup_x1, JBC_dup_x2, JBC_dup2, JBC_dup2_x1, JBC_dup2_x2, JBC_f2d, JBC_f2i, JBC_f2l, JBC_fadd, JBC_faload, JBC_fastore, JBC_fcmpg, JBC_fcmpl, JBC_fconst_0, JBC_fconst_1, JBC_fconst_2, JBC_fdiv, JBC_fload, JBC_fload_0, JBC_fload_1, JBC_fload_2, JBC_fload_3, JBC_fmul, JBC_fneg, JBC_frem, JBC_freturn, JBC_fstore, JBC_fstore_0, JBC_fstore_1, JBC_fstore_2, JBC_fstore_3, JBC_fsub, JBC_getfield, JBC_getstatic, JBC_goto, JBC_goto_w, JBC_i2d, JBC_i2f, JBC_i2l, JBC_iadd, JBC_iaload, JBC_iand, JBC_iastore, JBC_iconst_0, JBC_iconst_1, JBC_iconst_2, JBC_iconst_3, JBC_iconst_4, JBC_iconst_5, JBC_iconst_m1, JBC_idiv, JBC_if_acmpeq, JBC_if_acmpne, JBC_if_icmpeq, JBC_if_icmpge, JBC_if_icmpgt, JBC_if_icmple, JBC_if_icmplt, JBC_if_icmpne, JBC_ifeq, JBC_ifge, JBC_ifgt, JBC_ifle, JBC_iflt, JBC_ifne, JBC_ifnonnull, JBC_ifnull, JBC_iinc, JBC_iload, JBC_iload_0, JBC_iload_1, JBC_iload_2, JBC_iload_3, JBC_impdep1, JBC_impdep2, JBC_imul, JBC_ineg, JBC_instanceof, JBC_int2byte, JBC_int2char, JBC_int2short, JBC_invokeinterface, JBC_invokespecial, JBC_invokestatic, JBC_invokevirtual, JBC_ior, JBC_irem, JBC_ireturn, JBC_ishl, JBC_ishr, JBC_istore, JBC_istore_0, JBC_istore_1, JBC_istore_2, JBC_istore_3, JBC_isub, JBC_iushr, JBC_ixor, JBC_jsr, JBC_jsr_w, JBC_l2d, JBC_l2f, JBC_l2i, JBC_ladd, JBC_laload, JBC_land, JBC_lastore, JBC_lcmp, JBC_lconst_0, JBC_lconst_1, JBC_ldc, JBC_ldc_w, JBC_ldc2_w, JBC_ldiv, JBC_length, JBC_lload, JBC_lload_0, JBC_lload_1, JBC_lload_2, JBC_lload_3, JBC_lmul, JBC_lneg, JBC_lookupswitch, JBC_lor, JBC_lrem, JBC_lreturn, JBC_lshl, JBC_lshr, JBC_lstore, JBC_lstore_0, JBC_lstore_1, JBC_lstore_2, JBC_lstore_3, JBC_lsub, JBC_lushr, JBC_lxor, JBC_monitorenter, JBC_monitorexit, JBC_multianewarray, JBC_name, JBC_new, JBC_newarray, JBC_nop, JBC_pop, JBC_pop2, JBC_putfield, JBC_putstatic, JBC_ret, JBC_return, JBC_saload, JBC_sastore, JBC_sipush, JBC_swap, JBC_tableswitch, JBC_wide, JBC_xxxunusedxxx
 
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.SizeConstants
BITS_IN_ADDRESS, BITS_IN_BOOLEAN, BITS_IN_BYTE, BITS_IN_CHAR, BITS_IN_DOUBLE, BITS_IN_EXTENT, BITS_IN_FLOAT, BITS_IN_INT, BITS_IN_LONG, BITS_IN_OFFSET, BITS_IN_PAGE, BITS_IN_SHORT, BITS_IN_WORD, BYTES_IN_ADDRESS, BYTES_IN_BOOLEAN, BYTES_IN_BYTE, BYTES_IN_CHAR, BYTES_IN_DOUBLE, BYTES_IN_EXTENT, BYTES_IN_FLOAT, BYTES_IN_INT, BYTES_IN_LONG, BYTES_IN_OFFSET, BYTES_IN_PAGE, BYTES_IN_SHORT, BYTES_IN_WORD, LOG_BITS_IN_ADDRESS, LOG_BITS_IN_BOOLEAN, LOG_BITS_IN_BYTE, LOG_BITS_IN_CHAR, LOG_BITS_IN_DOUBLE, LOG_BITS_IN_EXTENT, LOG_BITS_IN_FLOAT, LOG_BITS_IN_INT, LOG_BITS_IN_LONG, LOG_BITS_IN_OFFSET, LOG_BITS_IN_PAGE, LOG_BITS_IN_SHORT, LOG_BITS_IN_WORD, LOG_BYTES_IN_ADDRESS, LOG_BYTES_IN_BOOLEAN, LOG_BYTES_IN_BYTE, LOG_BYTES_IN_CHAR, LOG_BYTES_IN_DOUBLE, LOG_BYTES_IN_EXTENT, LOG_BYTES_IN_FLOAT, LOG_BYTES_IN_INT, LOG_BYTES_IN_LONG, LOG_BYTES_IN_OFFSET, LOG_BYTES_IN_PAGE, LOG_BYTES_IN_SHORT, LOG_BYTES_IN_WORD
 
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
 
Fields inherited from interface org.jikesrvm.classloader.ClassLoaderConstants
ACC_ABSTRACT, ACC_ANNOTATION, ACC_ENUM, ACC_FINAL, ACC_INTERFACE, ACC_NATIVE, ACC_PRIVATE, ACC_PROTECTED, ACC_PUBLIC, ACC_STATIC, ACC_STRICT, ACC_SUPER, ACC_SYNCHRONIZED, ACC_SYNTHETIC, ACC_TRANSIENT, ACC_VOLATILE, APPLICABLE_TO_CLASSES, APPLICABLE_TO_FIELDS, APPLICABLE_TO_METHODS, ArrayTypeCode, BooleanTypeCode, BRIDGE, ByteTypeCode, CharTypeCode, CLASS_INITIALIZED, CLASS_INITIALIZER_FAILED, CLASS_INITIALIZING, CLASS_INSTANTIATED, CLASS_LOADED, CLASS_RESOLVED, CLASS_VACANT, ClassTypeCode, CP_CLASS, CP_DOUBLE, CP_FLOAT, CP_INT, CP_LONG, CP_MEMBER, CP_STRING, CP_UTF, DoubleTypeCode, FloatTypeCode, IntTypeCode, LongTypeCode, ShortTypeCode, TAG_DOUBLE, TAG_FIELDREF, TAG_FLOAT, TAG_INT, TAG_INTERFACE_METHODREF, TAG_LONG, TAG_MEMBERNAME_AND_DESCRIPTOR, TAG_METHODREF, TAG_STRING, TAG_TYPEREF, TAG_UNUSED, TAG_UTF, VARARGS, VoidTypeCode
 
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 org.jikesrvm.classloader.AnnotatedElement
getAnnotation, getAnnotations, getAnnotationsInternal, getDeclaredAnnotations, getDeclaredAnnotationsInternal, hasAnnotations, hasBaselineNoRegistersAnnotation, hasBaselineSaveLSRegistersAnnotation, hasInlineAnnotation, hasInterruptibleAnnotation, hasLogicallyUninterruptibleAnnotation, hasNoBoundsCheckAnnotation, hasNoCheckStoreAnnotation, hasNoEscapesAnnotation, hasNoInlineAnnotation, hasNonMovingAllocationAnnotation, hasNonMovingAnnotation, hasNoNullCheckAnnotation, hasNoOptCompileAnnotation, hasPreemptibleAnnotation, hasPureAnnotation, hasRuntimeFinalAnnotation, hasRuntimePureAnnotation, hasUninterruptibleAnnotation, hasUninterruptibleNoWarnAnnotation, hasUnpreemptibleAnnotation, hasUnpreemptibleNoWarnAnnotation, hasUntracedAnnotation, isAnnotationDeclared, isAnnotationPresent, readAnnotations, toAnnotations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

currentCompiledMethod

protected CompiledMethod currentCompiledMethod
current compiled method for this method


exceptionTypes

private static final ImmutableEntryHashMapRVM<RVMMethod,TypeReference[]> exceptionTypes
exceptions this method might throw (null --> none)


parameterAnnotations

private static final ImmutableEntryHashMapRVM<RVMMethod,RVMAnnotation[][]> parameterAnnotations
Method parameter annotations from the class file that are described as runtime visible. These annotations are available to the reflection API.


annotationDefaults

private static final HashMapRVM<RVMMethod,Object> annotationDefaults
A table mapping to values present in the method info tables of annotation types. It represents the default result from an annotation method.


jtocOffsets

private static final ImmutableEntryHashMapRVM<RVMMethod,Integer> jtocOffsets
The offsets of virtual methods in the JTOC, if it's been placed there by constant propagation.


declaredParameterAnnotations

private static final ImmutableEntryHashMapRVM<RVMMethod,Annotation[][]> declaredParameterAnnotations
Cache of arrays of declared parameter annotations.


invokeMethods

private static final ImmutableEntryHashMapRVM<RVMMethod,ReflectionBase> invokeMethods
Map from a method to a reflective method capable of invoking it

Constructor Detail

RVMMethod

protected RVMMethod(TypeReference declaringClass,
                    MemberReference memRef,
                    short modifiers,
                    TypeReference[] exceptionTypes,
                    Atom signature,
                    RVMAnnotation[] annotations,
                    RVMAnnotation[][] parameterAnnotations,
                    Object annotationDefault)
Construct a read method

Parameters:
declaringClass - the RVMClass object of the class that declared this field
memRef - 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 annotations
parameterAnnotations - array of runtime visible parameter annotations
annotationDefault - value for this annotation that appears
Method Detail

getParameterAnnotations

private RVMAnnotation[][] getParameterAnnotations()
Get the parameter annotations for this method


getAnnotationDefault

public Object getAnnotationDefault()
Get the annotation default value for an annotation method


readMethod

static RVMMethod readMethod(TypeReference declaringClass,
                            int[] constantPool,
                            MemberReference memRef,
                            short modifiers,
                            DataInputStream input)
                     throws IOException
Called from ClassFileReader.readClass(TypeReference,DataInputStream) to create an instance of a RVMMethod by reading the relevant data from the argument bytecode stream.

Parameters:
declaringClass - the TypeReference of the class being loaded
constantPool - the constantPool of the RVMClass object that's being constructed
memRef - the canonical memberReference for this member.
modifiers - modifiers associated with this member.
input - the DataInputStream to read the method's attributes from
Throws:
IOException

createAnnotationMethod

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. The method body will contain a read of the field at the constant pool index specified.

Parameters:
annotationClass - the class this method belongs to
constantPool - for the class
memRef - the member reference corresponding to this method
interfaceMethod - the interface method that will copied to produce the annotation method
constantPoolIndex - the index of the field that will be returned by this method
Returns:
the created method

createAnnotationInit

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

Parameters:
aClass - the class this method belongs to
constantPool - for the class
memRef - the member reference corresponding to this method
objectInitIndex - an index into the constant pool for a method reference to java.lang.Object.
aFields -
aMethods -
Returns:
the created method

typeRefToReturnBytecode

private static int typeRefToReturnBytecode(TypeReference tr)
What would be the appropriate return bytecode for the given type reference?


isClassInitializer

public final boolean isClassInitializer()
Is this method a class initializer?


isObjectInitializer

public final boolean isObjectInitializer()
Is this method an object initializer?


isObjectInitializerHelper

public final boolean isObjectInitializerHelper()
Is this method a compiler-generated object initializer helper?


getReturnType

public final TypeReference getReturnType()
Type of this method's return value.


getParameterTypes

public final TypeReference[] getParameterTypes()
Type of this method's parameters. Note: does *not* include implicit "this" parameter, if any.


getParameterWords

public final int getParameterWords()
Space required by this method for its parameters, in words. Note: does *not* include implicit "this" parameter, if any.


isCompiled

public final boolean isCompiled()
Has machine code been generated for this method's bytecodes?


getCurrentCompiledMethod

public final CompiledMethod getCurrentCompiledMethod()
Get the current compiled method for this method. Will return null if there is no current compiled method! We make this method Unpreemptible to avoid a race-condition in Reflection.invoke.

Returns:
compiled method

isStatic

public final boolean isStatic()
Declared as statically dispatched?


isFinal

public final boolean isFinal()
Declared as non-overridable by subclasses?


isSynchronized

public final boolean isSynchronized()
Guarded by monitorenter/monitorexit?


isNative

public final boolean isNative()
Not implemented in java?


isStrictFP

public final boolean isStrictFP()
Strict enforcement of IEEE 754 rules?


isSysCall

public final boolean isSysCall()
Not implemented in Java and use C not JNI calling convention


isSpecializedInvoke

public final boolean isSpecializedInvoke()
Not implemented in Java and use C not JNI calling convention


isAbstract

public final boolean isAbstract()
Implemented in subclass?


isSynthetic

public boolean isSynthetic()
Not present in source code file?


isBridge

public boolean isBridge()
Is this method a bridge method? Bridge methods are generated in some cases of generics and inheritance.


isVarArgs

public boolean isVarArgs()
Is this a varargs method taking a variable number of arguments?


getExceptionTypes

public final TypeReference[] getExceptionTypes()
Exceptions thrown by this method - something like { "java/lang/IOException", "java/lang/EOFException" }

Returns:
info (null --> method doesn't throw any exceptions)

isInterruptible

public final boolean isInterruptible()
Is this method interruptible? In other words, should the compiler insert yieldpoints in method prologue, epilogue, and backwards branches. Also, only methods that are Interruptible have stackoverflow checks in the method prologue (since there is no mechanism for handling a stackoverflow that doesn't violate the uninterruptiblity of the method). To determine if a method is interruptible, the following conditions are checked (in order):


isUnpreemptible

public final boolean isUnpreemptible()
Is the method Unpreemptible? See the comment in isInterruptible()


isUninterruptible

public final boolean isUninterruptible()
Is the method Uninterruptible? See the comment in isInterruptible()


isPure

public final boolean isPure()
Is the method Pure? That is would it, without any side effects, return the same value given the same arguments?

Returns:
whether the method has a pure annotation

isRuntimePure

public final boolean isRuntimePure()
Is the method RuntimePure? This is the same as Pure at runtime but has a special return value at boot image writing time

Returns:
whether the method has a pure annotation

hasNoInlinePragma

public final boolean hasNoInlinePragma()
Has this method been marked as forbidden to inline? ie., it is marked with the NoInline annotation or the NoOptCompile annotation?


mayWrite

public boolean mayWrite(RVMField field)
Returns:
true if the method may write to a given field

isRuntimeServiceMethod

public boolean isRuntimeServiceMethod()
Returns:
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.

isNonMovingAllocation

public boolean isNonMovingAllocation()
Should all allocation from this method go to a non-moving space?


getCurrentEntryCodeArray

public final ArchitectureSpecific.CodeArray getCurrentEntryCodeArray()
Get the code array that corresponds to the entry point (prologue) for the method.


compile

public final void compile()
Generate machine code for this method if valid machine code doesn't already exist.


genCode

protected abstract CompiledMethod genCode()
Generate the code for this method


replaceCompiledMethod

public final 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

Parameters:
compiledMethod - new machine code

invalidateCompiledMethod

public final void invalidateCompiledMethod(CompiledMethod cm)
If CM is the current compiled code for this, then invalidate it.


getJtocOffset

private Offset getJtocOffset()
Get the offset used to hold a JTOC addressable version of the current entry code array


findOrCreateJtocOffset

public final Offset findOrCreateJtocOffset()
Find or create a JTOC offset for this method


getDeclaredParameterAnnotations

public final Annotation[][] getDeclaredParameterAnnotations()
Returns the parameter annotations for this method.


getInvoker

public ReflectionBase getInvoker()
Get an instance of an object capable of reflectively invoking this method


createDefaultConstructor

static RVMMethod createDefaultConstructor(TypeReference klass,
                                          MemberReference memRef)
Create a method to act as a default constructor (just return)

Parameters:
klass - class for method
memRef - reference for default constructor
Returns:
method normal (bytecode containing) method that just returns

createReflectionMethod

RVMMethod createReflectionMethod(TypeReference reflectionClass,
                                 int[] constantPool,
                                 MethodReference memRef)
Create a method for reflectively invoking this method

Parameters:
reflectionClass - the class this method will belong to
constantPool - for the class
memRef - the member reference corresponding to this method
Returns:
the created method