public final class NormalMethod extends RVMMethod
Modifier and Type | Field and Description |
---|---|
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 |
currentCompiledMethod
declaredAnnotationDatas
Constructor and Description |
---|
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
|
Modifier and Type | Method and Description |
---|---|
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()
Generates the code for this method.
|
int |
getBytecodeLength() |
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() |
int |
getOperandWords() |
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.
|
compile, 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
getDeclaringClass, getDescriptor, getId, getMemberRef, getModifiers, getName, getOffset, getSignature, hashCode, hasOffset, isPrivate, isProtected, isPublic, setOffset, toString
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
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
getAnnotationsByType, getDeclaredAnnotation, getDeclaredAnnotationsByType
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
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 classesprotected 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)
bci
- bytecode indexpublic 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.void recomputeSummary(int[] constantPool)
RVMClass.allBootImageTypesResolved()
only.constantPool
- the constant poolprivate void computeSummary(int[] constantPool)
constantPool
- the constant poolpublic LocalVariableTable getLocalVariableTable()