For optimizing compiler development, it is sometimes useful to exercise careful control over which classes are compiled, and with which optimization level. In many cases, a prototype-opt image will suit this process using the command line option -X:aos:initial_compiler=opt combined with -X:aos:enable_recompilation=false. This configuration invokes the optimizing compiler on each method run.The org.jikesrvm.tools.oth.OptTestHarness program provides even more control over the optimizing compiler. This driver program allows you to invoke the optimizing compiler as an "application" running on top of the VM.

Command Line Options

-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> [- or <descrip>]

Compile method with default compiler

-methodOpt <class> <method> [- or <descrip>]

Compile method with opt compiler

-methodBase <class> <method> [- or <descrip>]

Compile method with base compiler

-er <class> <method> [- or <descrip>] {args}

Compile with default compiler and execute a method

-performance

Show performance results

-oc

pass an option to the optimizing compiler

Examples

To use the OptTestHarness program:

% rvm org.jikesrvm.tools.oth.OptTestHarness -class Foo

will invoke the optimizing compiler on all methods of class Foo.

% rvm org.jikesrvm.tools.oth.OptTestHarness -method Foo bar -

will invoke the optimizing compiler on the first method bar of class Foo it loads.

% rvm org.jikesrvm.tools.oth.OptTestHarness -method Foo bar '(I)V;'

will invoke the optimizing compiler on method Foo.bar(I)V;.
You can specify any number of -method and -class options on the command line. Any arguments passed to OptTestHarness via -oc will be passed on directly to the optimizing compiler. So:

% rvm org.jikesrvm.tools.oth.OptTestHarness -oc:O1 -oc:print_final_hir=true -method Foo bar -

will compile Foo.bar at optimization level O1 and print the final HIR.