public final class CompileTheWorld extends Object
Modifier and Type | Class and Description |
---|---|
static class |
CompileTheWorld.Config
A mechanism for overriding JVMCI options that affect compilation.
|
static class |
CompileTheWorld.Options |
Modifier and Type | Field and Description |
---|---|
private int |
classFileCounter |
private AtomicLong |
compiledMethodsCounter |
private AtomicLong |
compileTime |
private CompileTheWorld.Config |
config |
private MethodFilter[] |
excludeMethodFilters
Exclude methods matching one of the filters in this array if the array is non-null.
|
private String |
files
List of Zip/Jar files to compile (see
CompileTheWorld.Options.CompileTheWorldClasspath ). |
private AtomicLong |
memoryUsed |
private MethodFilter[] |
methodFilters
Only compile methods matching one of the filters in this array if the array is non-null.
|
private boolean |
running
Signal that the threads should start compiling in multithreaded mode.
|
private int |
startAt
Class index to start compilation at (see
CompileTheWorld.Options.CompileTheWorldStartAt ). |
private int |
stopAt
Class index to stop compilation at (see
CompileTheWorld.Options.CompileTheWorldStopAt ). |
static String |
SUN_BOOT_CLASS_PATH
Magic token to trigger reading files from the boot class path.
|
private ThreadPoolExecutor |
threadPool |
private boolean |
verbose |
Constructor and Description |
---|
CompileTheWorld() |
CompileTheWorld(String files,
CompileTheWorld.Config config,
int startAt,
int stopAt,
String methodFilters,
String excludeMethodFilters,
boolean verbose)
Creates a compile-the-world instance.
|
Modifier and Type | Method and Description |
---|---|
private static boolean |
canBeCompiled(HotSpotResolvedJavaMethod javaMethod,
int modifiers)
Determines if a method should be compiled (Cf.
|
void |
compile()
Compiles all methods in all classes in the Zip/Jar archive files in
CompileTheWorld.Options.CompileTheWorldClasspath . |
private void |
compile(String fileList)
Compiles all methods in all classes in the Zip/Jar files passed.
|
private void |
compileMethod(HotSpotResolvedJavaMethod method) |
private void |
compileMethod(HotSpotResolvedJavaMethod method,
int counter)
Compiles a method and gathers some statistics.
|
private static void |
dummy() |
void |
println() |
void |
println(String s) |
void |
println(String format,
Object... args) |
private void |
startThreads() |
private void |
waitToRun() |
public static final String SUN_BOOT_CLASS_PATH
private final String files
CompileTheWorld.Options.CompileTheWorldClasspath
).private final int startAt
CompileTheWorld.Options.CompileTheWorldStartAt
).private final int stopAt
CompileTheWorld.Options.CompileTheWorldStopAt
).private final MethodFilter[] methodFilters
private final MethodFilter[] excludeMethodFilters
private int classFileCounter
private AtomicLong compiledMethodsCounter
private AtomicLong compileTime
private AtomicLong memoryUsed
private boolean verbose
private final CompileTheWorld.Config config
private boolean running
private ThreadPoolExecutor threadPool
public CompileTheWorld(String files, CompileTheWorld.Config config, int startAt, int stopAt, String methodFilters, String excludeMethodFilters, boolean verbose)
files
- File.pathSeparator
separated list of Zip/Jar files to compilestartAt
- index of the class file to start compilation atstopAt
- index of the class file to stop compilation atmethodFilters
- excludeMethodFilters
- public CompileTheWorld()
public void compile() throws Throwable
CompileTheWorld.Options.CompileTheWorldClasspath
. If CompileTheWorld.Options.CompileTheWorldClasspath
contains the magic token SUN_BOOT_CLASS_PATH
passed up from HotSpot we take the
files from the boot class path.Throwable
public void println()
private static void dummy()
private void compile(String fileList) throws IOException
fileList
- File.pathSeparator
separated list of Zip/Jar files to compileIOException
private void startThreads()
private void waitToRun()
private void compileMethod(HotSpotResolvedJavaMethod method) throws InterruptedException, ExecutionException
private void compileMethod(HotSpotResolvedJavaMethod method, int counter)
private static boolean canBeCompiled(HotSpotResolvedJavaMethod javaMethod, int modifiers)