|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.compilers.common.RuntimeCompiler
public class RuntimeCompiler
Harness to select which compiler to dynamically compile a method in first invocation.
A place to put code common to all runtime compilers. This includes instrumentation code to get equivalent data for each of the runtime compilers.
We collect the following data for each compiler
Field Summary | |
---|---|
static byte |
BASELINE_COMPILER
|
protected static boolean |
compilationInProgress
is opt compiler currently in use? |
protected static boolean |
compilerEnabled
is the opt compiler usable? |
private static String[] |
earlyOptArgs
|
static byte |
JNI_COMPILER
|
private static String[] |
name
|
static byte |
OPT_COMPILER
|
static Object |
optimizationPlan
|
static Object |
options
|
private static int[] |
totalBCLength
|
private static double[] |
totalCompTime
|
private static double[] |
totalLogOfRates
|
private static int[] |
totalLogValueMethods
|
private static int[] |
totalMCLength
|
private static int[] |
totalMethods
|
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 | |
---|---|
RuntimeCompiler()
|
Method Summary | |
---|---|
static CompiledMethod |
baselineCompile(NormalMethod method)
This method will compile the passed method using the baseline compiler. |
static void |
boot()
|
static CompiledMethod |
compile(NativeMethod method)
Compile the stub for a native method when it is first invoked. |
static CompiledMethod |
compile(NormalMethod method)
Compile a Java method when it is first invoked. |
protected static CompiledMethod |
fallback(NormalMethod method)
This method uses the default compiler (baseline) to compile a method It is typically called when a more aggressive compilation fails. |
static double |
getBaselineRate()
Return the current estimate of basline-compiler rate, in bcb/msec |
static String |
getCompilerName(byte compiler)
returns the string version of compiler number, using the naming scheme in this file |
void |
notifyExit(int value)
To be called when the VM is about to exit. |
private static CompiledMethod |
optCompile(NormalMethod method,
CompilationPlan plan)
Attempt to compile the passed method with the Compiler. |
static CompiledMethod |
optCompileWithFallBack(NormalMethod method)
This method tries to compile the passed method with the Compiler, using the default compilation plan. |
static CompiledMethod |
optCompileWithFallBack(NormalMethod method,
CompilationPlan plan)
This method tries to compile the passed method with the Compiler with the passed compilation plan. |
private static CompiledMethod |
optCompileWithFallBackInternal(NormalMethod method,
CompilationPlan plan)
This real method that performs the opt compilation. |
static void |
processCommandLineArg(String prefix,
String arg)
|
static void |
processOptCommandLineArg(String prefix,
String arg)
Process command line argument destined for the opt compiler |
static int |
recompileWithOpt(CompilationPlan plan)
This method tries to compile the passed method with the Compiler. |
static int |
recompileWithOpt(NormalMethod method)
A wrapper method for those callers who don't want to make optimization plans |
static CompiledMethod |
recompileWithOptOnStackSpecialization(CompilationPlan plan)
|
static void |
record(byte compiler,
NativeMethod method,
CompiledMethod compiledMethod)
This method records the time and sizes (bytecode and machine code) for a compilation |
static void |
record(byte compiler,
NormalMethod method,
CompiledMethod compiledMethod)
This method records the time and sizes (bytecode and machine code) for a compilation. |
private static void |
recordCompilation(byte compiler,
int BCLength,
int MCLength,
double compTime)
This method does the actual recording |
static void |
report(boolean explain)
This method produces a summary report of compilation activities |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte JNI_COMPILER
public static final byte BASELINE_COMPILER
public static final byte OPT_COMPILER
private static final String[] name
private static int[] totalMethods
private static double[] totalCompTime
private static int[] totalBCLength
private static int[] totalMCLength
private static double[] totalLogOfRates
private static int[] totalLogValueMethods
private static String[] earlyOptArgs
protected static boolean compilerEnabled
protected static boolean compilationInProgress
NOTE: The associated code can be quite subtle, so please be absolutely sure you know what you're doing before modifying it!!!
public static final Object options
public static Object optimizationPlan
Constructor Detail |
---|
public RuntimeCompiler()
Method Detail |
---|
public void notifyExit(int value)
notifyExit
in interface Callbacks.ExitMonitor
value
- the exit valuepublic static void record(byte compiler, NormalMethod method, CompiledMethod compiledMethod)
compiler
- the compiler usedmethod
- the resulting RVMMethodcompiledMethod
- the resulting compiled methodpublic static void record(byte compiler, NativeMethod method, CompiledMethod compiledMethod)
compiler
- the compiler usedmethod
- the resulting RVMMethodcompiledMethod
- the resulting compiled methodprivate static void recordCompilation(byte compiler, int BCLength, int MCLength, double compTime)
compiler
- the compiler usedBCLength
- the number of bytecodes in method sourceMCLength
- the length of the generated machine codecompTime
- the compilation time in mspublic static void report(boolean explain)
explain
- Explains the metrics used in the reportpublic static double getBaselineRate()
public static CompiledMethod baselineCompile(NormalMethod method)
method
- the method to compilepublic static void processOptCommandLineArg(String prefix, String arg)
private static CompiledMethod optCompile(NormalMethod method, CompilationPlan plan) throws OptimizingCompilerException
Precondition: compilationInProgress "lock" has been acquired
method
- the method to compileplan
- the plan to use for compiling the method
OptimizingCompilerException
public static CompiledMethod optCompileWithFallBack(NormalMethod method)
method
- the method to compilepublic static CompiledMethod optCompileWithFallBack(NormalMethod method, CompilationPlan plan)
method
- the method to compileplan
- the compilation plan to use for the compileprivate static CompiledMethod optCompileWithFallBackInternal(NormalMethod method, CompilationPlan plan)
method
- the method to compileplan
- the compilation plan to usepublic static CompiledMethod recompileWithOptOnStackSpecialization(CompilationPlan plan)
public static int recompileWithOpt(CompilationPlan plan)
NOTE: the recompile method should never be invoked via RuntimeCompiler.compile; it does not have sufficient guards against recursive recompilation.
plan
- the compilation plan to use
public static int recompileWithOpt(NormalMethod method)
method
- the method to recompileprotected static CompiledMethod fallback(NormalMethod method)
public static void boot()
public static void processCommandLineArg(String prefix, String arg)
public static CompiledMethod compile(NormalMethod method)
method
- the method to compile
public static CompiledMethod compile(NativeMethod method)
method
- the method to compile
public static String getCompilerName(byte compiler)
compiler
- the compiler of interest
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |