Java Code Examples for jdk.test.lib.Platform#isMinimal()

The following examples show how to use jdk.test.lib.Platform#isMinimal() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestJFRIntrinsic.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns available compilation levels
 *
 * @return int array with compilation levels
 */
public static int[] getAvailableCompilationLevels() {
    if (!WhiteBox.getWhiteBox().getBooleanVMFlag("UseCompiler")) {
        return new int[0];
    }
    if (WhiteBox.getWhiteBox().getBooleanVMFlag("TieredCompilation")) {
        Long flagValue = WhiteBox.getWhiteBox()
                .getIntxVMFlag("TieredStopAtLevel");
        int maxLevel = flagValue.intValue();
        return IntStream.rangeClosed(1, maxLevel).toArray();
    } else {
        if (Platform.isServer() && !Platform.isEmulatedClient()) {
            return new int[]{4};
        }
        if (Platform.isClient() || Platform.isMinimal() || Platform.isEmulatedClient()) {
            return new int[]{1};
        }
    }
    return new int[0];
}
 
Example 2
Source File: TestJFRIntrinsic.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns available compilation levels
 *
 * @return int array with compilation levels
 */
public static int[] getAvailableCompilationLevels() {
    if (!WhiteBox.getWhiteBox().getBooleanVMFlag("UseCompiler")) {
        return new int[0];
    }
    if (WhiteBox.getWhiteBox().getBooleanVMFlag("TieredCompilation")) {
        Long flagValue = WhiteBox.getWhiteBox()
                .getIntxVMFlag("TieredStopAtLevel");
        int maxLevel = flagValue.intValue();
        return IntStream.rangeClosed(1, maxLevel).toArray();
    } else {
        if (Platform.isServer() && !Platform.isEmulatedClient()) {
            return new int[]{4};
        }
        if (Platform.isClient() || Platform.isMinimal() || Platform.isEmulatedClient()) {
            return new int[]{1};
        }
    }
    return new int[0];
}
 
Example 3
Source File: CompilerUtils.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns available compilation levels
 *
 * @return int array with compilation levels
 */
public static int[] getAvailableCompilationLevels() {
    if (!WhiteBox.getWhiteBox().getBooleanVMFlag("UseCompiler")) {
        return new int[0];
    }
    if (WhiteBox.getWhiteBox().getBooleanVMFlag("TieredCompilation")) {
        Long flagValue = WhiteBox.getWhiteBox()
                .getIntxVMFlag("TieredStopAtLevel");
        int maxLevel = flagValue.intValue();
        Asserts.assertEQ(new Long(maxLevel), flagValue,
                "TieredStopAtLevel has value out of int capacity");
        return IntStream.rangeClosed(1, maxLevel).toArray();
    } else {
        if (Platform.isServer() && !Platform.isEmulatedClient()) {
            return new int[]{4};
        }
        if (Platform.isClient() || Platform.isMinimal() || Platform.isEmulatedClient()) {
            return new int[]{1};
        }
    }
    return new int[0];
}
 
Example 4
Source File: CommandLineOptionTest.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @return option required to start a new VM with the same type as current.
 * @throws RuntimeException when VM type is unknown.
 */
private static String getVMTypeOption() {
    if (Platform.isServer()) {
        return "-server";
    } else if (Platform.isClient()) {
        return "-client";
    } else if (Platform.isMinimal()) {
        return "-minimal";
    } else if (Platform.isGraal()) {
        return "-graal";
    }
    throw new RuntimeException("Unknown VM mode.");
}
 
Example 5
Source File: CommandLineOptionTest.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @return option required to start a new VM with the same type as current.
 * @throws RuntimeException when VM type is unknown.
 */
private static String getVMTypeOption() {
    if (Platform.isServer()) {
        return "-server";
    } else if (Platform.isClient()) {
        return "-client";
    } else if (Platform.isMinimal()) {
        return "-minimal";
    } else if (Platform.isGraal()) {
        return "-graal";
    }
    throw new RuntimeException("Unknown VM mode.");
}
 
Example 6
Source File: GTestWrapper.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private static String getJVMVariantSubDir() {
    if (Platform.isServer()) {
        return "server";
    } else if (Platform.isClient()) {
        return "client";
    } else if (Platform.isMinimal()) {
        return "minimal";
    } else {
        throw new Error("TESTBUG: unsuppported vm variant");
    }
}
 
Example 7
Source File: CommandLineOptionTest.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @return option required to start a new VM with the same type as current.
 * @throws RuntimeException when VM type is unknown.
 */
private static String getVMTypeOption() {
    if (Platform.isServer()) {
        return "-server";
    } else if (Platform.isClient()) {
        return "-client";
    } else if (Platform.isMinimal()) {
        return "-minimal";
    } else if (Platform.isGraal()) {
        return "-graal";
    }
    throw new RuntimeException("Unknown VM mode.");
}