class OptTestHarness extends Object
The role of this class is to allow the optimizing compiler
to be run as an "application" to enabling selective testing and
debugging of the optimizing compiler.
For example, the following command line:
rvm -X:h=100 org.jikesrvm.tools.oth.OptTestHarness -oc:O2 -oc:phases=true -class hanoi -er hanoi run -
Any command that can be given to the optimizing compiler via -X:irc:<cmd> can be given to the optimizing compiler by org.jikesrvm.tools.oth.OptTestHarness via -oc:<cmd>. In addition, the org.jikesrvm.tools.oth.OptTestHarness supports the following commands:
-useBootOptions Use the same OptOptions as the bootimage compiler. -longcommandline <filename> Read commands (one per line) from a file +baseline Switch default compiler to baseline -baseline Switch default compiler to optimizing -load <class > Load a class -class <class> Load a class and compile all its methods -method <class> <method> [-|<descrip>] Compile method with default compiler -methodOpt <class> <method> [-|<descrip>] Compile method with opt compiler -methodBase <class> <method> [-|<descrip>] Compile method with base compiler -er <class> <method> [-|<descrip>] {args} Compile with default compiler and execute a method -performance Show performance results
Modifier and Type | Class and Description |
---|---|
private static class |
OptTestHarness.Performance |
Modifier and Type | Field and Description |
---|---|
(package private) boolean |
addCallbackForPerformancePrintout |
(package private) Vector<RVMMethod> |
baselineMethodVector |
(package private) ClassLoader |
cl |
(package private) boolean |
disableClassloading |
(package private) boolean |
executeMainMethod |
(package private) boolean |
executeWithReflection |
private FileAccess |
fileAccess |
(package private) String[] |
mainArgs |
(package private) RVMClass |
mainClass |
(package private) OptOptions |
options |
(package private) Vector<RVMMethod> |
optMethodVector |
(package private) Vector<OptOptions> |
optOptionsVector |
private OptTestHarnessOutput |
output |
(package private) OptTestHarness.Performance |
perf
Record and show performance of executed methods, if any
|
(package private) boolean |
printCodeAddress
Should we print the address of compiled methods (useful for
debugging)
|
(package private) Object[] |
reflectMethodArgs |
(package private) Vector<Object[]> |
reflectMethodArgsVector |
(package private) Vector<RVMMethod> |
reflectMethodVector |
(package private) Method |
reflectoid |
(package private) Vector<Method> |
reflectoidVector |
(package private) boolean |
useBaselineCompiler
Default value for for compiling opt/baseline
|
Constructor and Description |
---|
OptTestHarness(OptTestHarnessOutput output,
OptOptions optOptions,
FileAccess fileAccess) |
Modifier and Type | Method and Description |
---|---|
private static String |
addrToString(Address addr) |
private Object |
attemptToInvokeDefaultConstructor(RVMMethod method) |
(package private) static String |
compiledMethodMessage(NormalMethod method) |
private void |
compileMethodsInVector() |
(package private) static String |
convertToClassName(String s) |
private void |
duplicateOptions() |
(package private) static String |
endOfExecutionString(RVMMethod method) |
private void |
executeCommand() |
(package private) RVMMethod |
findDeclaredOrFirstMethod(RVMClass klass,
String methname,
String methdesc)
Finds a method, either one with a given descriptor or the first matching
one in in the given class.
|
(package private) RVMClass |
loadClass(String s) |
static void |
main(String[] args) |
void |
mainMethod(String[] args) |
(package private) int |
parseMethodArgs(TypeReference[] argDesc,
String[] args,
int i,
Object[] methodArgs) |
(package private) void |
printFormatString() |
private void |
processClass(RVMClass klass,
OptOptions opts) |
private void |
processMethod(RVMMethod method,
OptOptions opts) |
private void |
processMethod(RVMMethod method,
OptOptions opts,
boolean isBaseline) |
private void |
processOptionString(String[] args) |
(package private) static String |
resultString(Object result) |
(package private) static String |
startOfExecutionString(RVMMethod method) |
boolean disableClassloading
boolean executeWithReflection
boolean executeMainMethod
boolean useBaselineCompiler
boolean printCodeAddress
boolean addCallbackForPerformancePrintout
OptTestHarness.Performance perf
ClassLoader cl
Vector<RVMMethod> optMethodVector
Vector<OptOptions> optOptionsVector
Vector<RVMMethod> baselineMethodVector
Method reflectoid
Object[] reflectMethodArgs
Vector<Method> reflectoidVector
Vector<RVMMethod> reflectMethodVector
Vector<Object[]> reflectMethodArgsVector
private final OptTestHarnessOutput output
private final FileAccess fileAccess
OptOptions options
OptTestHarness(OptTestHarnessOutput output, OptOptions optOptions, FileAccess fileAccess)
int parseMethodArgs(TypeReference[] argDesc, String[] args, int i, Object[] methodArgs)
RVMMethod findDeclaredOrFirstMethod(RVMClass klass, String methname, String methdesc)
klass
- the class to searchmethname
- the method's namemethdesc
- a descriptor of the method's signature if a specific
method is desired or "-" to find the first method with the given namenull
if no method was foundRVMClass loadClass(String s) throws ClassNotFoundException
ClassNotFoundException
static String convertToClassName(String s)
void printFormatString()
private void processClass(RVMClass klass, OptOptions opts)
private void processMethod(RVMMethod method, OptOptions opts)
private void processMethod(RVMMethod method, OptOptions opts, boolean isBaseline)
private void processOptionString(String[] args)
private void duplicateOptions()
static String compiledMethodMessage(NormalMethod method)
private void compileMethodsInVector()
private void executeCommand() throws InvocationTargetException, IllegalAccessException
private Object attemptToInvokeDefaultConstructor(RVMMethod method)
static String resultString(Object result)
static String endOfExecutionString(RVMMethod method)
static String startOfExecutionString(RVMMethod method)
public static void main(String[] args) throws InvocationTargetException, IllegalAccessException
public void mainMethod(String[] args) throws InvocationTargetException, IllegalAccessException
private static String addrToString(Address addr)