Skip to content

Commit b8f0a66

Browse files
committed
8041676: remove the java.compiler system property
Reviewed-by: dholmes, alanb, rriggs, iris
1 parent 781d6d7 commit b8f0a66

File tree

3 files changed

+8
-29
lines changed

3 files changed

+8
-29
lines changed

src/hotspot/share/runtime/arguments.cpp

+8-23
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ char* Arguments::_java_command = nullptr;
8585
SystemProperty* Arguments::_system_properties = nullptr;
8686
size_t Arguments::_conservative_max_heap_alignment = 0;
8787
Arguments::Mode Arguments::_mode = _mixed;
88-
bool Arguments::_java_compiler = false;
8988
bool Arguments::_xdebug_mode = false;
9089
const char* Arguments::_java_vendor_url_bug = nullptr;
9190
const char* Arguments::_sun_java_launcher = DEFAULT_JAVA_LAUNCHER;
@@ -1266,8 +1265,14 @@ bool Arguments::add_property(const char* prop, PropertyWriteable writeable, Prop
12661265
#endif
12671266

12681267
if (strcmp(key, "java.compiler") == 0) {
1269-
process_java_compiler_argument(value);
1270-
// Record value in Arguments, but let it get passed to Java.
1268+
// we no longer support java.compiler system property, log a warning and let it get
1269+
// passed to Java, like any other system property
1270+
if (strlen(value) == 0 || strcasecmp(value, "NONE") == 0) {
1271+
// for applications using NONE or empty value, log a more informative message
1272+
warning("The java.compiler system property is obsolete and no longer supported, use -Xint");
1273+
} else {
1274+
warning("The java.compiler system property is obsolete and no longer supported.");
1275+
}
12711276
} else if (strcmp(key, "sun.java.launcher.is_altjvm") == 0) {
12721277
// sun.java.launcher.is_altjvm property is
12731278
// private and is processed in process_sun_java_launcher_properties();
@@ -1372,7 +1377,6 @@ void Arguments::set_mode_flags(Mode mode) {
13721377
// Set up default values for all flags.
13731378
// If you add a flag to any of the branches below,
13741379
// add a default value for it here.
1375-
set_java_compiler(false);
13761380
_mode = mode;
13771381

13781382
// Ensure Agent_OnLoad has the correct initial values.
@@ -1862,16 +1866,6 @@ jint Arguments::set_aggressive_opts_flags() {
18621866
}
18631867

18641868
//===========================================================================================================
1865-
// Parsing of java.compiler property
1866-
1867-
void Arguments::process_java_compiler_argument(const char* arg) {
1868-
// For backwards compatibility, Djava.compiler=NONE or ""
1869-
// causes us to switch to -Xint mode UNLESS -Xdebug
1870-
// is also specified.
1871-
if (strlen(arg) == 0 || strcasecmp(arg, "NONE") == 0) {
1872-
set_java_compiler(true); // "-Djava.compiler[=...]" most recently seen.
1873-
}
1874-
}
18751869

18761870
void Arguments::process_java_launcher_argument(const char* launcher, void* extra_info) {
18771871
if (_sun_java_launcher != _default_java_launcher) {
@@ -3004,15 +2998,6 @@ jint Arguments::finalize_vm_init_args(bool patch_mod_javabase) {
30042998
}
30052999
}
30063000

3007-
// This must be done after all arguments have been processed.
3008-
// java_compiler() true means set to "NONE" or empty.
3009-
if (java_compiler() && !xdebug_mode()) {
3010-
// For backwards compatibility, we switch to interpreted mode if
3011-
// -Djava.compiler="NONE" or "" is specified AND "-Xdebug" was
3012-
// not specified.
3013-
set_mode_flags(_int);
3014-
}
3015-
30163001
// CompileThresholdScaling == 0.0 is same as -Xint: Disable compilation (enable interpreter-only mode),
30173002
// but like -Xint, leave compilation thresholds unaffected.
30183003
// With tiered compilation disabled, setting CompileThreshold to 0 disables compilation as well.

src/hotspot/share/runtime/arguments.hpp

-4
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,6 @@ class Arguments : AllStatic {
242242
// Operation modi
243243
static Mode _mode;
244244
static void set_mode_flags(Mode mode);
245-
static bool _java_compiler;
246-
static void set_java_compiler(bool arg) { _java_compiler = arg; }
247-
static bool java_compiler() { return _java_compiler; }
248245

249246
// -Xdebug flag
250247
static bool _xdebug_mode;
@@ -302,7 +299,6 @@ class Arguments : AllStatic {
302299
static bool parse_argument(const char* arg, JVMFlagOrigin origin);
303300
static bool process_argument(const char* arg, jboolean ignore_unrecognized, JVMFlagOrigin origin);
304301
static void process_java_launcher_argument(const char*, void*);
305-
static void process_java_compiler_argument(const char* arg);
306302
static jint parse_options_environment_variable(const char* name, ScopedVMInitArgs* vm_args);
307303
static jint parse_java_tool_options_environment_variable(ScopedVMInitArgs* vm_args);
308304
static jint parse_java_options_environment_variable(ScopedVMInitArgs* vm_args);

src/java.base/share/classes/java/lang/System.java

-2
Original file line numberDiff line numberDiff line change
@@ -760,8 +760,6 @@ public static native void arraycopy(Object src, int srcPos,
760760
* <td>List of paths to search when loading libraries</td></tr>
761761
* <tr><th scope="row">{@systemProperty java.io.tmpdir}</th>
762762
* <td>Default temp file path</td></tr>
763-
* <tr><th scope="row">{@systemProperty java.compiler}</th>
764-
* <td>Name of JIT compiler to use</td></tr>
765763
* <tr><th scope="row">{@systemProperty os.name}</th>
766764
* <td>Operating system name</td></tr>
767765
* <tr><th scope="row">{@systemProperty os.arch}</th>

0 commit comments

Comments
 (0)