Skip to content

Commit

Permalink
Add Deprecated warning for using Xlp, and Xlp<size> using Java 11+
Browse files Browse the repository at this point in the history
Adding warning for any users using -Xlp, and -Xlp<size> using Java 11+.
Per Docs, these options are slated to be deprecated in all versions above Java 8. Since the functionality needs to be supported for Java 8, this should be a warning until support for Java 8 officially ends.

Signed-off-by: AlenBadel <[email protected]>
  • Loading branch information
AlenBadel authored and AlenBadel committed Apr 8, 2020
1 parent 5ca16a9 commit 12c0bcf
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
9 changes: 8 additions & 1 deletion runtime/nls/j9vm/j9vm.nls
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2000, 2019 IBM Corp. and others
# Copyright (c) 2000, 2020 IBM Corp. and others
#
# This program and the accompanying materials are made available under
# the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -1953,3 +1953,10 @@ J9NLS_VM_CLASS_RELATIONSHIP_INVALID.explanation=The specified child class fails
J9NLS_VM_CLASS_RELATIONSHIP_INVALID.system_action=The JVM will throw a java/lang/VerifyError.
J9NLS_VM_CLASS_RELATIONSHIP_INVALID.user_response=Ensure that all class relationships are valid.
# END NON-TRANSLATABLE

J9NLS_VM_XLP_DEPRECATED=Since Java 9 -Xlp, and -Xlp:<size> were deprecated for removal and may not be accepted options in the future.
# START NON-TRANSLATABLE
J9NLS_VM_XLP_DEPRECATED.explanation=Since Java 9 -Xlp, and -Xlp:<size> were deprecated for removal and may not be accepted options in the future.
J9NLS_VM_XLP_DEPRECATED.system_action=The JVM will show a warning and continue to recognize the options.
J9NLS_VM_XLP_DEPRECATED.user_response=Consider not using these options as they will likely be removed in a future release. Consider replacing with respective -Xlp:codecache, and -Xlp:objectheap options.
# END NON-TRANSLATABLE
1 change: 1 addition & 0 deletions runtime/oti/jvminit.h
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,7 @@ enum INIT_STAGE {
#define VMOPT_XXDECOMP_COLON "-XXdecomp:"

#define VMOPT_XLP_CODECACHE "-Xlp:codecache:"
#define VMOPT_XLP "-Xlp"
#define VMOPT_XTLHPREFETCH "-XtlhPrefetch"

#define VMOPT_XXALLOWNONVIRTUALCALLS "-XX:+AllowNonVirtualCalls"
Expand Down
12 changes: 12 additions & 0 deletions runtime/vm/jvminit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1651,6 +1651,18 @@ IDATA VMInitStages(J9JavaVM *vm, IDATA stage, void* reserved) {
exit(0);
}

/* -Xlp commandline options parsing */
{
IDATA xlpExactIndex, xlpSizeIndex;
xlpSizeIndex = FIND_ARG_IN_VMARGS(EXACT_MEMORY_MATCH, VMOPT_XLP, NULL);
xlpExactIndex = FIND_ARG_IN_VMARGS(EXACT_MATCH, VMOPT_XLP, NULL);

/* -Xlp and -Xlp<size> options are deprecated in JDK11+ */
if (J2SE_VERSION(vm) >= J2SE_V11 && (xlpSizeIndex != -1 || xlpExactIndex != -1)) {
j9nls_printf(PORTLIB, J9NLS_WARNING, J9NLS_VM_XLP_DEPRECATED);
}
}

#if defined(J9VM_OPT_SHARED_CLASSES)
{
IDATA argIndex3, argIndex4, argIndex5, argIndex6, argIndex7, argIndex8;
Expand Down

0 comments on commit 12c0bcf

Please sign in to comment.