• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..30-Oct-2021-

src/sun/hotspot/tools/ctw/H30-Oct-2021-1,087634

test/H30-Oct-2021-399189

MakefileH A D30-Oct-20212 KiB7436

READMEH A D30-Oct-20213.7 KiB9466

README

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