8153515: [ctw] CompileTheWorld testlibrary should trigger compilation of <clinit> and <init>

Reviewed-by: thartmann
This commit is contained in:
Tatiana Pivovarova 2016-06-29 14:32:13 +03:00
parent 7c7e22abfd
commit 8caad345fd
2 changed files with 7 additions and 0 deletions
hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw

@ -68,6 +68,11 @@ public class Compiler {
if (Utils.COMPILE_THE_WORLD_PRELOAD_CLASSES) {
preloadClasses(aClass.getName(), id, constantPool);
}
int startLevel = Utils.INITIAL_COMP_LEVEL;
int endLevel = Utils.TIERED_COMPILATION ? Utils.TIERED_STOP_AT_LEVEL : startLevel;
for (int i = startLevel; i <= endLevel; ++i) {
WHITE_BOX.enqueueInitializerForCompilation(aClass, i);
}
long methodCount = 0;
for (Executable e : aClass.getDeclaredConstructors()) {
++methodCount;

@ -40,6 +40,7 @@ import java.util.concurrent.Executor;
* Concrete subclasses should implement method {@link #process()}.
*/
public abstract class PathHandler {
private static final Unsafe UNSAFE = jdk.test.lib.Utils.getUnsafe();
private static final AtomicLong CLASS_COUNT = new AtomicLong(0L);
private static volatile boolean CLASSES_LIMIT_REACHED = false;
private static final Pattern JAR_IN_DIR_PATTERN
@ -151,6 +152,7 @@ public abstract class PathHandler {
if (id >= Utils.COMPILE_THE_WORLD_START_AT) {
try {
Class<?> aClass = loader.loadClass(name);
UNSAFE.ensureClassInitialized(aClass);
CompileTheWorld.OUT.printf("[%d]\t%s%n", id, name);
Compiler.compileClass(aClass, id, executor);
} catch (ClassNotFoundException e) {