org.jikesrvm.classloader
Class NormalMethod

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

public final class NormalMethod
extends RVMMethod
implements BytecodeConstants

A method of a java class that has bytecodes.


Field Summary
static int ALLOCATION_COST
           
static int ARRAY_LOAD_COST
           
static int ARRAY_STORE_COST
           
private  byte[] bytecodes
          bytecodes for this method (null --> none)
static int CALL_COST
           
static int CLASS_CHECK_COST
           
private  ExceptionHandlerMap exceptionHandlerMap
          try/catch/finally blocks for this method (null --> none)
private static char HAS_ALLOCATION
           
private static char HAS_ARRAY_READ
           
private static char HAS_ARRAY_WRITE
           
private static char HAS_BACK_BRANCH
           
private static char HAS_COND_BRANCH
           
private static char HAS_FIELD_READ
           
private static char HAS_FIELD_WRITE
           
private static char HAS_INVOKE
           
private static char HAS_JSR
           
private static char HAS_MAGIC
           
private static char HAS_SWITCH
           
private static char HAS_SYNCH
           
private static char HAS_THROW
           
private static char IS_RS_METHOD
           
static int JSR_COST
           
private  int[] lineNumberMap
          pc to source-line info (null --> none) Each entry contains both the line number (upper 16 bits) and corresponding start PC (lower 16 bits).
private static HashMapRVM<NormalMethod,LocalVariableTable> localVariableTables
          the local variable table
private  short localWords
          words needed for local variables (including parameters)
static int LONG_OPERATION_COST
           
static int MAGIC_COST
           
private  short operandWords
          words needed for operand stack (high water mark) TODO: OSR redesign; add subclass of NormalMethod for OSR method and then make this field final in NormalMethod.
private static HashMapRVM<NormalMethod,byte[]> osrPrologues
          Possible OSR record of osr prologue
private static HashMapRVM<NormalMethod,Integer> savedOperandWords
          Possibly OSR prologue may change the maximum stack height, remember the original stack height
static int SIMPLE_OPERATION_COST
           
static int STORE_CHECK_COST
           
private  char summaryFlags
          storage for bytecode summary flags
private  char summarySize
          storage for bytecode summary size
static int SWITCH_COST
           
static int SYNCH_COST
           
private static HashMapRVM<NormalMethod,byte[]> synthesizedBytecodes
          Possible OSR bytecode array consisting of prologue and original bytecodes
static int THROW_COST
           
 
Fields inherited from class org.jikesrvm.classloader.RVMMethod
currentCompiledMethod
 
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
NormalMethod(TypeReference dc, MemberReference mr, short mo, TypeReference[] et, short lw, short ow, byte[] bc, ExceptionHandlerMap eMap, int[] lm, LocalVariableTable lvt, int[] constantPool, Atom sig, RVMAnnotation[] annotations, RVMAnnotation[][] parameterAnnotations, Object ad)
          Construct a normal Java bytecode method's information
 
Method Summary
private  void computeSummary(int[] constantPool)
          This method computes a summary of interesting method characteristics and stores an encoding of the summary as an int.
 void finalizeOsrSpecialization()
          Restores the original state of the method.
protected  CompiledMethod genCode()
          Generate the code for this method
 int getBytecodeLength()
          Size of bytecodes for this method
 BytecodeStream getBytecodes()
          Get a representation of the bytecodes in the code attribute of this method.
 void getDynamicLink(DynamicLink dynamicLink, int bcIndex)
          Fill in DynamicLink object for the invoke at the given bytecode index
 ExceptionHandlerMap getExceptionHandlerMap()
          Exceptions caught by this method.
 int getLineNumberForBCIndex(int bci)
          Return the line number information for the argument bytecode index.
 LocalVariableTable getLocalVariableTable()
           
 int getLocalWords()
          Space required by this method for its local variables, in words.
 int getOperandWords()
          Space required by this method for its operand stack, in words.
 BytecodeStream getOsrPrologue()
          Returns a bytecode stream of osr prologue
 int getOsrPrologueLength()
          Returns the OSR prologue length for adjusting various tables and maps.
 BytecodeStream getOsrSynthesizedBytecodes()
          Returns the synthesized bytecode stream with osr prologue
 boolean hasAllocation()
           
 boolean hasArrayRead()
           
 boolean hasArrayWrite()
           
 boolean hasBackwardsBranch()
           
 boolean hasCondBranch()
           
 boolean hasFieldRead()
           
 boolean hasFieldWrite()
           
 boolean hasInvoke()
           
 boolean hasJSR()
           
 boolean hasMagic()
           
 boolean hasSwitch()
           
 boolean hasSynch()
           
 boolean hasThrow()
           
 int inlinedSizeEstimate()
           
 boolean isForOsrSpecialization()
          Checks if the method is in state for OSR specialization now
 boolean isRuntimeServiceMethod()
           
 boolean mayWrite(RVMField field)
           
(package private)  void recomputeSummary(int[] constantPool)
          For use by RVMClass.allBootImageTypesResolved() only.
 void setForOsrSpecialization(byte[] prologue, short newStackHeight)
          Sets method in state for OSR specialization, i.e, the subsequent calls of getBytecodes() return the stream of specialized bytecodes.
 void setRuntimeServiceMethod(boolean value)
          Set the value of the 'runtime service method' flag to the argument value.
 
Methods inherited from class org.jikesrvm.classloader.RVMMethod
compile, createAnnotationInit, createAnnotationMethod, createDefaultConstructor, createReflectionMethod, findOrCreateJtocOffset, getAnnotationDefault, getCurrentCompiledMethod, getCurrentEntryCodeArray, getDeclaredParameterAnnotations, getExceptionTypes, getInvoker, getParameterTypes, getParameterWords, getReturnType, hasNoInlinePragma, invalidateCompiledMethod, isAbstract, isBridge, isClassInitializer, isCompiled, isFinal, isInterruptible, isNative, isNonMovingAllocation, isObjectInitializer, isObjectInitializerHelper, isPure, isRuntimePure, isSpecializedInvoke, isStatic, isStrictFP, isSynchronized, isSynthetic, isSysCall, isUninterruptible, isUnpreemptible, isVarArgs, readMethod, replaceCompiledMethod
 
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

SIMPLE_OPERATION_COST

public static final int SIMPLE_OPERATION_COST
See Also:
Constant Field Values

LONG_OPERATION_COST

public static final int LONG_OPERATION_COST
See Also:
Constant Field Values

ARRAY_LOAD_COST

public static final int ARRAY_LOAD_COST
See Also:
Constant Field Values

ARRAY_STORE_COST

public static final int ARRAY_STORE_COST
See Also:
Constant Field Values

JSR_COST

public static final int JSR_COST
See Also:
Constant Field Values

CALL_COST

public static final int CALL_COST
See Also:
Constant Field Values

MAGIC_COST

public static final int MAGIC_COST
See Also:
Constant Field Values

ALLOCATION_COST

public static final int ALLOCATION_COST
See Also:
Constant Field Values

CLASS_CHECK_COST

public static final int CLASS_CHECK_COST
See Also:
Constant Field Values

STORE_CHECK_COST

public static final int STORE_CHECK_COST
See Also:
Constant Field Values

THROW_COST

public static final int THROW_COST
See Also:
Constant Field Values

SYNCH_COST

public static final int SYNCH_COST
See Also:
Constant Field Values

SWITCH_COST

public static final int SWITCH_COST
See Also:
Constant Field Values

HAS_MAGIC

private static final char HAS_MAGIC
See Also:
Constant Field Values

HAS_SYNCH

private static final char HAS_SYNCH
See Also:
Constant Field Values

HAS_ALLOCATION

private static final char HAS_ALLOCATION
See Also:
Constant Field Values

HAS_THROW

private static final char HAS_THROW
See Also:
Constant Field Values

HAS_INVOKE

private static final char HAS_INVOKE
See Also:
Constant Field Values

HAS_FIELD_READ

private static final char HAS_FIELD_READ
See Also:
Constant Field Values

HAS_FIELD_WRITE

private static final char HAS_FIELD_WRITE
See Also:
Constant Field Values

HAS_ARRAY_READ

private static final char HAS_ARRAY_READ
See Also:
Constant Field Values

HAS_ARRAY_WRITE

private static final char HAS_ARRAY_WRITE
See Also:
Constant Field Values

HAS_JSR

private static final char HAS_JSR
See Also:
Constant Field Values

HAS_COND_BRANCH

private static final char HAS_COND_BRANCH
See Also:
Constant Field Values

HAS_SWITCH

private static final char HAS_SWITCH
See Also:
Constant Field Values

HAS_BACK_BRANCH

private static final char HAS_BACK_BRANCH
See Also:
Constant Field Values

IS_RS_METHOD

private static final char IS_RS_METHOD
See Also:
Constant Field Values

summaryFlags

private char summaryFlags
storage for bytecode summary flags


summarySize

private char summarySize
storage for bytecode summary size


localWords

private final short localWords
words needed for local variables (including parameters)


operandWords

private short operandWords
words needed for operand stack (high water mark) TODO: OSR redesign; add subclass of NormalMethod for OSR method and then make this field final in NormalMethod.


bytecodes

private final byte[] bytecodes
bytecodes for this method (null --> none)


exceptionHandlerMap

private final ExceptionHandlerMap exceptionHandlerMap
try/catch/finally blocks for this method (null --> none)


lineNumberMap

private final int[] lineNumberMap
pc to source-line info (null --> none) Each entry contains both the line number (upper 16 bits) and corresponding start PC (lower 16 bits).


localVariableTables

private static final HashMapRVM<NormalMethod,LocalVariableTable> localVariableTables
the local variable table


synthesizedBytecodes

private static final HashMapRVM<NormalMethod,byte[]> synthesizedBytecodes
Possible OSR bytecode array consisting of prologue and original bytecodes


osrPrologues

private static final HashMapRVM<NormalMethod,byte[]> osrPrologues
Possible OSR record of osr prologue


savedOperandWords

private static final HashMapRVM<NormalMethod,Integer> savedOperandWords
Possibly OSR prologue may change the maximum stack height, remember the original stack height

Constructor Detail

NormalMethod

NormalMethod(TypeReference dc,
             MemberReference mr,
             short mo,
             TypeReference[] et,
             short lw,
             short ow,
             byte[] bc,
             ExceptionHandlerMap eMap,
             int[] lm,
             LocalVariableTable lvt,
             int[] constantPool,
             Atom sig,
             RVMAnnotation[] annotations,
             RVMAnnotation[][] parameterAnnotations,
             Object ad)
Construct a normal Java bytecode method's information

Parameters:
dc - the TypeReference object of the class that declared this field
mr - the canonical memberReference for this member.
mo - modifiers associated with this member.
et - exceptions thrown by this method.
lw - the number of local words used by the bytecode of this method
ow - the number of operand words used by the bytecode of this method
bc - the bytecodes of this method
eMap - the exception handler map for this method
lm - the line number map for this method
lvt - the local variable table for this method
constantPool - the constantPool for this method
sig - generic type of this method.
annotations - array of runtime visible annotations
parameterAnnotations - array of runtime visible paramter annotations
ad - annotation default value for that appears in annotation classes
Method Detail

genCode

protected CompiledMethod genCode()
                          throws VerifyError
Description copied from class: RVMMethod
Generate the code for this method

Specified by:
genCode in class RVMMethod
Throws:
VerifyError

getLocalWords

public int getLocalWords()
Space required by this method for its local variables, in words. Note: local variables include parameters


getOperandWords

public int getOperandWords()
Space required by this method for its operand stack, in words.


getBytecodes

public BytecodeStream getBytecodes()
Get a representation of the bytecodes in the code attribute of this method.

Returns:
object representing the bytecodes

getDynamicLink

public void getDynamicLink(DynamicLink dynamicLink,
                           int bcIndex)
Fill in DynamicLink object for the invoke at the given bytecode index

Parameters:
dynamicLink - the dynamicLink object to initialize
bcIndex - the bcIndex of the invoke instruction

getBytecodeLength

public int getBytecodeLength()
Size of bytecodes for this method


getExceptionHandlerMap

public ExceptionHandlerMap getExceptionHandlerMap()
Exceptions caught by this method.

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

getLineNumberForBCIndex

public int getLineNumberForBCIndex(int bci)
Return the line number information for the argument bytecode index.

Returns:
The line number, a positive integer. Zero means unable to find.

isForOsrSpecialization

public boolean isForOsrSpecialization()
Checks if the method is in state for OSR specialization now

Returns:
true, if it is (with prologue)

setForOsrSpecialization

public void setForOsrSpecialization(byte[] prologue,
                                    short newStackHeight)
Sets method in state for OSR specialization, i.e, the subsequent calls of getBytecodes() return the stream of specialized bytecodes.

NB: between flag and action, it should not allow GC or threadSwitch happen.

Parameters:
prologue - The bytecode of prologue
newStackHeight - The prologue may change the default height of stack

finalizeOsrSpecialization

public void finalizeOsrSpecialization()
Restores the original state of the method.


getOsrPrologueLength

public int getOsrPrologueLength()
Returns the OSR prologue length for adjusting various tables and maps.

Returns:
the length of prologue if the method is in state for OSR, 0 otherwise.

getOsrPrologue

public BytecodeStream getOsrPrologue()
Returns a bytecode stream of osr prologue

Returns:
osr prologue bytecode stream

getOsrSynthesizedBytecodes

public BytecodeStream getOsrSynthesizedBytecodes()
Returns the synthesized bytecode stream with osr prologue

Returns:
bytecode stream

inlinedSizeEstimate

public int inlinedSizeEstimate()
Returns:
An estimate of the expected size of the machine code instructions that will be generated by the opt compiler if the method is inlined.

hasMagic

public boolean hasMagic()
Returns:
true if the method contains a Magic.xxx or Address.yyy

hasSynch

public boolean hasSynch()
Returns:
true if the method contains a monitorenter/exit or is synchronized

hasAllocation

public boolean hasAllocation()
Returns:
true if the method contains an allocation

hasThrow

public boolean hasThrow()
Returns:
true if the method contains an athrow

hasInvoke

public boolean hasInvoke()
Returns:
true if the method contains an invoke

hasFieldRead

public boolean hasFieldRead()
Returns:
true if the method contains a getfield or getstatic

hasFieldWrite

public boolean hasFieldWrite()
Returns:
true if the method contains a putfield or putstatic

hasArrayRead

public boolean hasArrayRead()
Returns:
true if the method contains an array load

hasArrayWrite

public boolean hasArrayWrite()
Returns:
true if the method contains an array store

hasJSR

public boolean hasJSR()
Returns:
true if the method contains a jsr

hasCondBranch

public boolean hasCondBranch()
Returns:
true if the method contains a conditional branch

hasSwitch

public boolean hasSwitch()
Returns:
true if the method contains a switch

hasBackwardsBranch

public boolean hasBackwardsBranch()
Returns:
true if the method contains a backwards branch

isRuntimeServiceMethod

public boolean isRuntimeServiceMethod()
Overrides:
isRuntimeServiceMethod in class RVMMethod
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.

setRuntimeServiceMethod

public void setRuntimeServiceMethod(boolean value)
Set the value of the 'runtime service method' flag to the argument value. A method is considered to be a runtime service method if it is only/primarily invoked "under the covers" from the generated code and thus is not subject to inlining via the normal mechanisms. For example, the implementations of bytecodes such as new or checkcast or the implementation of yieldpoints.

Parameters:
value - true if this is a runtime service method, false it is not.

mayWrite

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

recomputeSummary

void recomputeSummary(int[] constantPool)
For use by RVMClass.allBootImageTypesResolved() only.


computeSummary

private void computeSummary(int[] constantPool)
This method computes a summary of interesting method characteristics and stores an encoding of the summary as an int.


getLocalVariableTable

public LocalVariableTable getLocalVariableTable()
Returns:
LocalVariableTable associated with this method