42 * Boolean supplier that check if any method could be compiled by C2.
43 * Method potentially could be compiled by C2 if Server VM is used and
44 * either tiered compilation is disabled or TIERED_MAX_LEVEL tier is
45 * reachable.
46 *
47 * Please don't place this definition after SHA*_INTRINSICS_AVAILABLE
48 * definitions. Otherwise its value will be {@code null} at the time when
49 * all dependent fields will be initialized.
50 */
51 private static final BooleanSupplier COMPILABLE_BY_C2 = () -> {
52 boolean isTiered = IntrinsicPredicates.WHITE_BOX.getBooleanVMFlag(
53 "TieredCompilation");
54 long tieredMaxLevel = IntrinsicPredicates.WHITE_BOX.getIntxVMFlag(
55 "TieredStopAtLevel");
56 boolean maxLevelIsReachable = (tieredMaxLevel
57 == IntrinsicPredicates.TIERED_MAX_LEVEL);
58 return Platform.isServer() && (!isTiered || maxLevelIsReachable);
59 };
60
61 public static final BooleanSupplier SHA1_INSTRUCTION_AVAILABLE
62 = new CPUSpecificPredicate("sparc.*", new String[] { "sha1" },
63 null);
64
65 public static final BooleanSupplier SHA256_INSTRUCTION_AVAILABLE
66 = new CPUSpecificPredicate("sparc.*", new String[] { "sha256" },
67 null);
68
69 public static final BooleanSupplier SHA512_INSTRUCTION_AVAILABLE
70 = new CPUSpecificPredicate("sparc.*", new String[] { "sha512" },
71 null);
72
73 public static final BooleanSupplier ANY_SHA_INSTRUCTION_AVAILABLE
74 = new OrPredicate(IntrinsicPredicates.SHA1_INSTRUCTION_AVAILABLE,
75 new OrPredicate(
76 IntrinsicPredicates.SHA256_INSTRUCTION_AVAILABLE,
77 IntrinsicPredicates.SHA512_INSTRUCTION_AVAILABLE));
78
79 public static final BooleanSupplier SHA1_INTRINSICS_AVAILABLE
80 = new AndPredicate(new AndPredicate(
81 IntrinsicPredicates.SHA1_INSTRUCTION_AVAILABLE,
82 IntrinsicPredicates.COMPILABLE_BY_C2),
83 IntrinsicPredicates.booleanOptionValue("UseSHA1Intrinsics"));
84
85 public static final BooleanSupplier SHA256_INTRINSICS_AVAILABLE
86 = new AndPredicate(new AndPredicate(
87 IntrinsicPredicates.SHA256_INSTRUCTION_AVAILABLE,
88 IntrinsicPredicates.COMPILABLE_BY_C2),
89 IntrinsicPredicates.booleanOptionValue("UseSHA256Intrinsics"));
90
91 public static final BooleanSupplier SHA512_INTRINSICS_AVAILABLE
|
42 * Boolean supplier that check if any method could be compiled by C2.
43 * Method potentially could be compiled by C2 if Server VM is used and
44 * either tiered compilation is disabled or TIERED_MAX_LEVEL tier is
45 * reachable.
46 *
47 * Please don't place this definition after SHA*_INTRINSICS_AVAILABLE
48 * definitions. Otherwise its value will be {@code null} at the time when
49 * all dependent fields will be initialized.
50 */
51 private static final BooleanSupplier COMPILABLE_BY_C2 = () -> {
52 boolean isTiered = IntrinsicPredicates.WHITE_BOX.getBooleanVMFlag(
53 "TieredCompilation");
54 long tieredMaxLevel = IntrinsicPredicates.WHITE_BOX.getIntxVMFlag(
55 "TieredStopAtLevel");
56 boolean maxLevelIsReachable = (tieredMaxLevel
57 == IntrinsicPredicates.TIERED_MAX_LEVEL);
58 return Platform.isServer() && (!isTiered || maxLevelIsReachable);
59 };
60
61 public static final BooleanSupplier SHA1_INSTRUCTION_AVAILABLE
62 = new OrPredicate(
63 new CPUSpecificPredicate("sparc.*", new String[] { "sha1" },null),
64 new CPUSpecificPredicate("aarch64.*", new String[] { "sha1" },null));
65
66 public static final BooleanSupplier SHA256_INSTRUCTION_AVAILABLE
67 = new OrPredicate(
68 new CPUSpecificPredicate("sparc.*", new String[] { "sha256" },null),
69 new CPUSpecificPredicate("aarch64.*", new String[] { "sha256" },null));
70
71 public static final BooleanSupplier SHA512_INSTRUCTION_AVAILABLE
72 = new OrPredicate(
73 new CPUSpecificPredicate("sparc.*", new String[] { "sha512" },null),
74 new CPUSpecificPredicate("aarch64.*", new String[] { "sha512" },null));
75
76 public static final BooleanSupplier ANY_SHA_INSTRUCTION_AVAILABLE
77 = new OrPredicate(IntrinsicPredicates.SHA1_INSTRUCTION_AVAILABLE,
78 new OrPredicate(
79 IntrinsicPredicates.SHA256_INSTRUCTION_AVAILABLE,
80 IntrinsicPredicates.SHA512_INSTRUCTION_AVAILABLE));
81
82 public static final BooleanSupplier SHA1_INTRINSICS_AVAILABLE
83 = new AndPredicate(new AndPredicate(
84 IntrinsicPredicates.SHA1_INSTRUCTION_AVAILABLE,
85 IntrinsicPredicates.COMPILABLE_BY_C2),
86 IntrinsicPredicates.booleanOptionValue("UseSHA1Intrinsics"));
87
88 public static final BooleanSupplier SHA256_INTRINSICS_AVAILABLE
89 = new AndPredicate(new AndPredicate(
90 IntrinsicPredicates.SHA256_INSTRUCTION_AVAILABLE,
91 IntrinsicPredicates.COMPILABLE_BY_C2),
92 IntrinsicPredicates.booleanOptionValue("UseSHA256Intrinsics"));
93
94 public static final BooleanSupplier SHA512_INTRINSICS_AVAILABLE
|