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 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


Use the same OptOptions as the bootimage compiler.

-longcommandline <filename>

Read commands (one per line) from a file


Switch default compiler to 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


Show performance results


pass an option to the optimizing compiler


To use the OptTestHarness program:

% rvm -class Foo

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

% rvm -method Foo bar -

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

% rvm -method Foo bar '(I)V;'

will invoke the optimizing compiler on method;.
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 -oc:O1 -oc:print_final_hir=true -method Foo bar -

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