1 DESCRIPTION
   2 
   3 This is replacement for CompileTheWorld (CTW) written on java. Its purpose is
   4 to make possible the use of CTW in product builds.
   5 
   6 DEPENDENCES
   7 
   8 The tool depends on Whitebox API. Assumed, that the sources of whitebox are
   9 located in '../whitebox' directory.
  10 
  11 BUILDING
  12 
  13 Simple way to build, just type 'make'.
  14 
  15 Makefile uses environment variables 'ALT_BOOTDIR', 'BOOTDIR' as root-dir of jdk
  16 that will be used for compilation and creating jar.
  17 
  18 On successful building 'ctw.jar' will be created.
  19 
  20 RUNNING
  21 
  22 Since the tool uses WhiteBox API, options 'UnlockDiagnosticVMOptions' and
  23 'WhiteBoxAPI' should be specified, and 'wb.jar' should be added to
  24 boot-classpath:
  25   $ java -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:wb.jar -jar ctw.jar 
  26 
  27 Arguments can be paths to '.jar, '.zip', '.lst' files or directories with
  28 classes, that define which classes will be compiled:
  29   - '.jar', '.zip' files and directories are interpreted like in classpath
  30 (including '<dir>/*' syntax)
  31   - '.lst' files -- files with class names (in java notation) to compile
  32 
  33 Without arguments it would work as old version of CTW: all classes in
  34 boot-classpath will be compiled, excluding classes in 'rt.jar' if 'rt.jar' isn't
  35 first in boot-classpath.
  36 
  37 Due CTW's flags also are not available in product builds, the tool uses
  38 properties with the same names:
  39   - 'CompileTheWorldPreloadClasses' -- type:boolean, default:true, description:
  40 Preload all classes used by a class before start loading
  41   - 'CompileTheWorldStartAt' -- type:long, default:1, description: First class
  42 to consider
  43   - 'CompileTheWorldStopAt' -- type:long, default:Long.MAX_VALUE, description:
  44 Last class to consider
  45 
  46 Also it uses additional properties:
  47   - 'sun.hotspot.tools.ctw.verbose' -- type:boolean, default:false,
  48 description: Verbose output, adds additional information about compilation
  49   - 'sun.hotspot.tools.ctw.logfile' -- type:string, default:null,
  50 description: Path to logfile, if it's null, cout will be used.
  51 
  52 EXAMPLES
  53 
  54 compile classes from 'rt.jar':
  55   $ java -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:wb.jar -jar ctw.jar ${JAVA_HOME}/jre/lib/rt.jar
  56 
  57 compile classes from all '.jar' in './testjars' directory:
  58   $ java -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:wb.jar -jar ctw.jar ./testjars/*
  59 
  60 compile classes from './build/classes' directory:
  61   $ java -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:wb.jar -jar ctw.jar ./build/classes
  62 
  63 compile only java.lang.String, java.lang.Object classes:
  64   $ echo java.lang.String > classes.lst
  65   $ echo java.lang.Object >> classes.lst
  66   $ java -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:wb.jar -jar ctw.jar classes.lst