diff --git a/docs/xxmergecompileroptions.md b/docs/xxmergecompileroptions.md index 51e1e69f7..d543960a8 100644 --- a/docs/xxmergecompileroptions.md +++ b/docs/xxmergecompileroptions.md @@ -36,11 +36,19 @@ This option enables or disables the merging of multiple `-Xjit` or `-Xaot` optio ## Explanation - By default, if you specify `-Xjit` option (or `-Xaot` option) multiple times, only the last option takes effect. Therefore, on adding an `-Xjit` option, the resultant behavior might not be as expected, if any instance of this option already exists. It is time-consuming to find the existing instances and try combining them manually so that the system behaves as required. +By default, if you specify `-Xjit` option (or `-Xaot` option) multiple times, only the last option takes effect. Therefore, on adding an `-Xjit` option, the resultant behavior might not be as expected, if any instance of this option already exists. It is time-consuming to find the existing instances and try combining them manually so that the system behaves as required. - You can use the `-XX:+MergeCompilerOptions` option to merge all the existing instances of the `-Xjit` options logically. To retain the default behavior, whereby only the last option takes effect, you can use the `-XX:-MergeCompilerOptions` option. +You can use the `-XX:+MergeCompilerOptions` option to merge all the existing instances of the `-Xjit` options (or `-Xaot` options) logically. To retain the default behavior, whereby only the last option takes effect, you can use the `-XX:-MergeCompilerOptions` option. - If both `-Xjit` and `-Xaot` options exist and you use the `-XX:+MergeCompilerOptions` option, then multiple `-Xjit` options are merged into a single `-Xjit` option and multiple `-Xaot` options are merged into a single `-Xaot` option. +If both `-Xjit` and `-Xaot` options exist and you use the `-XX:+MergeCompilerOptions` option, then multiple `-Xjit` options are merged into a single `-Xjit` option and multiple `-Xaot` options are merged into a single `-Xaot` option. + +Typically, `-Xjit` and `-Xaot` options are ignored if these options are followed by `-Xint` or `-Xnojit` or `-Xnoaot` options: + +- `-Xint` option overrides any `-Xjit` and `-Xaot` options +- `-Xnojit` option overrides `-Xjit` options +- `-Xnoaot` option overrides `-Xaot` options + +However, with `-XX:+MergeCompilerOptions` all `-Xjit` and `-Xaot` options are merged, even if those options are followed by `-Xint`, `-Xnojit`, or `-Xnoaot` options. At least one `-Xjit` or `-Xaot` option must be specified after these options. ## Examples @@ -90,7 +98,24 @@ java -XX:+MergeCompilerOptions -XX:-MergeCompilerOptions -Xshareclasses:none '-X ``` java -XX:-MergeCompilerOptions -XX:+MergeCompilerOptions -Xshareclasses:none '-Xjit:verbose={compilePerformance},vlog=vlog' -Xjit:version -version ``` -`-Xjit` options that are applied - `{compilePerformance}`,`vlog=vlog`,`version` +`-Xjit` options that are applied - `verbose={compilePerformance}`,`vlog=vlog`,`version` + +### `-Xnojit`, `-Xnoaot`, or `-Xint` options with and without `-XX:+MergeCompilerOptions` + +``` +java -Xshareclasses:none -Xjit:version -Xnojit -version +``` +No `-Xjit` option is applied + +``` +java -XX:+MergeCompilerOptions -Xshareclasses:none -Xjit:verbose={compilePerformance} -Xjit:vlog=vlog -Xint -Xjit:version -version +``` +`-Xjit` options that are applied - `verbose={compilePerformance}`,`vlog=vlog`,`version` + +``` +java -XX:+MergeCompilerOptions -Xshareclasses:none -Xjit:version -Xnojit -version +``` +No `-Xjit` option is applied because no `-Xjit` option is specified after the `-Xnojit` option ## See also