|
|||||||||||
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 org.jikesrvm.classloader.NormalMethod
public final class NormalMethod
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.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 | |
---|---|
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.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 |
---|
public static final int SIMPLE_OPERATION_COST
public static final int LONG_OPERATION_COST
public static final int ARRAY_LOAD_COST
public static final int ARRAY_STORE_COST
public static final int JSR_COST
public static final int CALL_COST
public static final int MAGIC_COST
public static final int ALLOCATION_COST
public static final int CLASS_CHECK_COST
public static final int STORE_CHECK_COST
public static final int THROW_COST
public static final int SYNCH_COST
public static final int SWITCH_COST
private static final char HAS_MAGIC
private static final char HAS_SYNCH
private static final char HAS_ALLOCATION
private static final char HAS_THROW
private static final char HAS_INVOKE
private static final char HAS_FIELD_READ
private static final char HAS_FIELD_WRITE
private static final char HAS_ARRAY_READ
private static final char HAS_ARRAY_WRITE
private static final char HAS_JSR
private static final char HAS_COND_BRANCH
private static final char HAS_SWITCH
private static final char HAS_BACK_BRANCH
private static final char IS_RS_METHOD
private char summaryFlags
private char summarySize
private final short localWords
private short operandWords
private final byte[] bytecodes
null
--> none)
private final ExceptionHandlerMap exceptionHandlerMap
null
--> none)
private final int[] lineNumberMap
null
--> none)
Each entry contains both the line number (upper 16 bits)
and corresponding start PC (lower 16 bits).
private static final HashMapRVM<NormalMethod,LocalVariableTable> localVariableTables
private static final HashMapRVM<NormalMethod,byte[]> synthesizedBytecodes
private static final HashMapRVM<NormalMethod,byte[]> osrPrologues
private static final HashMapRVM<NormalMethod,Integer> savedOperandWords
Constructor Detail |
---|
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)
dc
- the TypeReference object of the class that declared this fieldmr
- 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 methodow
- the number of operand words used by the bytecode of this methodbc
- the bytecodes of this methodeMap
- the exception handler map for this methodlm
- the line number map for this methodlvt
- the local variable table for this methodconstantPool
- the constantPool for this methodsig
- generic type of this method.annotations
- array of runtime visible annotationsparameterAnnotations
- array of runtime visible paramter annotationsad
- annotation default value for that appears in annotation classesMethod Detail |
---|
protected CompiledMethod genCode() throws VerifyError
RVMMethod
genCode
in class RVMMethod
VerifyError
public int getLocalWords()
public int getOperandWords()
public BytecodeStream getBytecodes()
public void getDynamicLink(DynamicLink dynamicLink, int bcIndex)
dynamicLink
- the dynamicLink object to initializebcIndex
- the bcIndex of the invoke instructionpublic int getBytecodeLength()
public ExceptionHandlerMap getExceptionHandlerMap()
public int getLineNumberForBCIndex(int bci)
public boolean isForOsrSpecialization()
true
, if it is (with prologue)public void setForOsrSpecialization(byte[] prologue, short newStackHeight)
getBytecodes()
return the stream of specialized bytecodes.NB: between flag and action, it should not allow GC or threadSwitch happen.
prologue
- The bytecode of prologuenewStackHeight
- The prologue may change the default height of
stackpublic void finalizeOsrSpecialization()
public int getOsrPrologueLength()
public BytecodeStream getOsrPrologue()
public BytecodeStream getOsrSynthesizedBytecodes()
public int inlinedSizeEstimate()
public boolean hasMagic()
true
if the method contains a Magic.xxx or Address.yyypublic boolean hasSynch()
true
if the method contains a monitorenter/exit or is synchronizedpublic boolean hasAllocation()
true
if the method contains an allocationpublic boolean hasThrow()
true
if the method contains an athrowpublic boolean hasInvoke()
true
if the method contains an invokepublic boolean hasFieldRead()
true
if the method contains a getfield or getstaticpublic boolean hasFieldWrite()
true
if the method contains a putfield or putstaticpublic boolean hasArrayRead()
true
if the method contains an array loadpublic boolean hasArrayWrite()
true
if the method contains an array storepublic boolean hasJSR()
true
if the method contains a jsrpublic boolean hasCondBranch()
true
if the method contains a conditional branchpublic boolean hasSwitch()
true
if the method contains a switchpublic boolean hasBackwardsBranch()
true
if the method contains a backwards branchpublic boolean isRuntimeServiceMethod()
isRuntimeServiceMethod
in class RVMMethod
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 void setRuntimeServiceMethod(boolean value)
value
- true
if this is a runtime service method, false it is not.public boolean mayWrite(RVMField field)
mayWrite
in class RVMMethod
true
if the method may write to a given fieldvoid recomputeSummary(int[] constantPool)
RVMClass.allBootImageTypesResolved()
only.
private void computeSummary(int[] constantPool)
public LocalVariableTable getLocalVariableTable()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |