hotspot/test/testlibrary/ctw/README
author pchelko
Mon, 16 Jun 2014 17:13:58 +0400
changeset 25197 533f45be322f
parent 19767 13d8c1ce7ac7
child 31602 5eb5efabf50b
permissions -rw-r--r--
8046221: [TEST_BUG] Cleanup datatransfer tests Reviewed-by: anthony, alexsch
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
19767
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
     1
#
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
     2
# Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
     4
#
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
     7
# published by the Free Software Foundation.
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
     8
#
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
     9
# This code is distributed in the hope that it will be useful, but WITHOUT
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    10
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    11
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    12
# version 2 for more details (a copy is included in the LICENSE file that
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    13
# accompanied this code).
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    14
#
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    15
# You should have received a copy of the GNU General Public License version
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    16
# 2 along with this work; if not, write to the Free Software Foundation,
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    17
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    18
#
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    19
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    20
# or visit www.oracle.com if you need additional information or have any
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    21
# questions.
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    22
#
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    23
#
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    24
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    25
DESCRIPTION
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    26
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    27
This is replacement for CompileTheWorld (CTW) written on java. Its purpose is
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    28
to make possible the use of CTW in product builds.
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    29
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    30
DEPENDENCES
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    31
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    32
The tool depends on Whitebox API. Assumed, that the sources of whitebox are
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    33
located in '../whitebox' directory.
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    34
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    35
BUILDING
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    36
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    37
Simple way to build, just type 'make'.
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    38
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    39
Makefile uses environment variables 'ALT_BOOTDIR', 'BOOTDIR' as root-dir of jdk
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    40
that will be used for compilation and creating jar.
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    41
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    42
On successful building 'ctw.jar' will be created.
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    43
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    44
RUNNING
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    45
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    46
Since the tool uses WhiteBox API, options 'UnlockDiagnosticVMOptions' and
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    47
'WhiteBoxAPI' should be specified, and 'wb.jar' should be added to
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    48
boot-classpath:
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    49
  $ java -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:wb.jar -jar ctw.jar 
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    50
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    51
Arguments can be paths to '.jar, '.zip', '.lst' files or directories with
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    52
classes, that define which classes will be compiled:
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    53
  - '.jar', '.zip' files and directories are interpreted like in classpath
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    54
(including '<dir>/*' syntax)
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    55
  - '.lst' files -- files with class names (in java notation) to compile.
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    56
CTW will try to find these classes with default class loader, so they should
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    57
be located in classpath.
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    58
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    59
Without arguments it would work as old version of CTW: all classes in
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    60
boot-classpath will be compiled, excluding classes in 'rt.jar' if 'rt.jar' isn't
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    61
first in boot-classpath.
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    62
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    63
Due CTW's flags also are not available in product builds, the tool uses
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    64
properties with the same names:
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    65
  - 'CompileTheWorldPreloadClasses' -- type:boolean, default:true, description:
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    66
Preload all classes used by a class before start loading
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    67
  - 'CompileTheWorldStartAt' -- type:long, default:1, description: First class
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    68
to consider
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    69
  - 'CompileTheWorldStopAt' -- type:long, default:Long.MAX_VALUE, description:
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    70
Last class to consider
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    71
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    72
Also it uses additional properties:
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    73
  - 'sun.hotspot.tools.ctw.verbose' -- type:boolean, default:false,
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    74
description: Verbose output, adds additional information about compilation
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    75
  - 'sun.hotspot.tools.ctw.logfile' -- type:string, default:null,
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    76
description: Path to logfile, if it's null, cout will be used.
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    77
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    78
EXAMPLES
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    79
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    80
compile classes from 'rt.jar':
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    81
  $ java -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:wb.jar -jar ctw.jar ${JAVA_HOME}/jre/lib/rt.jar
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    82
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    83
compile classes from all '.jar' in './testjars' directory:
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    84
  $ java -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:wb.jar -jar ctw.jar ./testjars/*
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    85
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    86
compile classes from './build/classes' directory:
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    87
  $ java -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:wb.jar -jar ctw.jar ./build/classes
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    88
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    89
compile only java.lang.String, java.lang.Object classes:
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    90
  $ echo java.lang.String > classes.lst
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    91
  $ echo java.lang.Object >> classes.lst
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    92
  $ java -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:wb.jar -jar ctw.jar classes.lst
13d8c1ce7ac7 8012447: Java CTW implementation
iignatyev
parents:
diff changeset
    93