Skip to content
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/hotspot/share/compiler/compilerDefinitions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ bool CompilerConfig::check_args_consistency(bool status) {
FLAG_SET_DEFAULT(SegmentedCodeCache, false);
}
#if INCLUDE_JVMCI
if (EnableJVMCI) {
if (EnableJVMCI || UseJVMCICompiler) {
if (!FLAG_IS_DEFAULT(EnableJVMCI) || !FLAG_IS_DEFAULT(UseJVMCICompiler)) {
warning("JVMCI Compiler disabled due to -Xint.");
}
Expand Down
8 changes: 7 additions & 1 deletion src/hotspot/share/jvmci/jvmci_globals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ bool JVMCIGlobals::check_jvmci_flags_are_consistent() {
}

// Convert JVMCI flags from experimental to product
bool JVMCIGlobals::enable_jvmci_product_mode(JVMFlagOrigin origin) {
bool JVMCIGlobals::enable_jvmci_product_mode(JVMFlagOrigin origin, bool use_graal_jit) {
const char *JVMCIFlags[] = {
"EnableJVMCI",
"EnableJVMCIProduct",
Expand Down Expand Up @@ -202,6 +202,12 @@ bool JVMCIGlobals::enable_jvmci_product_mode(JVMFlagOrigin origin) {
if (JVMFlagAccess::set_bool(jvmciEnableFlag, &value, origin) != JVMFlag::SUCCESS) {
return false;
}
if (use_graal_jit) {
JVMFlag *useGraalJITFlag = JVMFlag::find_flag("UseGraalJIT");
if (JVMFlagAccess::set_bool(useGraalJITFlag, &value, origin) != JVMFlag::SUCCESS) {
return false;
}
}

// Effect of EnableJVMCIProduct on changing defaults of EnableJVMCI
// and UseJVMCICompiler is deferred to check_jvmci_flags_are_consistent
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/jvmci/jvmci_globals.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class JVMCIGlobals {
static bool check_jvmci_flags_are_consistent();

// Convert JVMCI experimental flags to product
static bool enable_jvmci_product_mode(JVMFlagOrigin);
static bool enable_jvmci_product_mode(JVMFlagOrigin origin, bool use_graal_jit);

// Returns true iff the GC fully supports JVMCI.
static bool gc_supports_jvmci();
Expand Down
9 changes: 5 additions & 4 deletions src/hotspot/share/runtime/arguments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2834,10 +2834,11 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, bool* patch_m
return JNI_EINVAL;
}
} else if (match_option(option, "-XX:+EnableJVMCIProduct") || match_option(option, "-XX:+UseGraalJIT")) {
if (match_option(option, "-XX:+UseGraalJIT")) {
bool use_graal_jit = match_option(option, "-XX:+UseGraalJIT");
if (use_graal_jit) {
const char* jvmci_compiler = get_property("jvmci.Compiler");
if (jvmci_compiler != nullptr) {
if (strcmp(jvmci_compiler, "graal") != 0) {
if (strncmp(jvmci_compiler, "graal", strlen("graal")) != 0) {
jio_fprintf(defaultStream::error_stream(),
"Value of jvmci.Compiler incompatible with +UseGraalJIT: %s", jvmci_compiler);
return JNI_ERR;
Expand All @@ -2854,14 +2855,14 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, bool* patch_m
JVMFlag *jvmciFlag = JVMFlag::find_flag("EnableJVMCIProduct");
// Allow this flag if it has been unlocked.
if (jvmciFlag != nullptr && jvmciFlag->is_unlocked()) {
if (!JVMCIGlobals::enable_jvmci_product_mode(origin)) {
if (!JVMCIGlobals::enable_jvmci_product_mode(origin, use_graal_jit)) {
jio_fprintf(defaultStream::error_stream(),
"Unable to enable JVMCI in product mode");
return JNI_ERR;
}
}
// The flag was locked so process normally to report that error
else if (!process_argument("EnableJVMCIProduct", args->ignoreUnrecognized, origin)) {
else if (!process_argument(use_graal_jit ? "UseGraalJIT" : "EnableJVMCIProduct", args->ignoreUnrecognized, origin)) {
return JNI_EINVAL;
}
#endif // INCLUDE_JVMCI
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down