Skip to content

Commit c6a5459

Browse files
authored
Merge pull request #22066 from keithc-ca/checkJCL
Ignore -Xjcl options
2 parents 762d4ac + 3756938 commit c6a5459

32 files changed

+477
-1069
lines changed

debugtools/DDR_VM/data/superset-constants.dat

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3474,7 +3474,6 @@ C|BCU_UNUSED_40
34743474
C|BCU_VERBOSE
34753475
S|J9VMCustomSpinOptions|J9VMCustomSpinOptionsPointer|
34763476
C|J9SYSPROP_ERROR_ARG_MISSING
3477-
C|J9SYSPROP_ERROR_INVALID_JCL
34783477
C|J9SYSPROP_ERROR_NONE
34793478
C|J9SYSPROP_ERROR_NOT_FOUND
34803479
C|J9SYSPROP_ERROR_OUT_OF_MEMORY

jcl/src/java.base/share/classes/java/lang/J9VMInternals.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -56,22 +56,6 @@
5656

5757
@J9UnmodifiableClass
5858
final class J9VMInternals {
59-
/*[PR VMDESIGN 1891] Move j9Version and j9Config from Class to J9VMInternals */
60-
/*[IF]*/
61-
/**
62-
* It is important that these remain static final
63-
* because the VM peeks for them before running the <clinit>
64-
*/
65-
/*[ENDIF]*/
66-
/*[IF]*/
67-
// j9Version - 0xAABBCCCC
68-
// AA - vm version, BB - jcl version, CCCC - master version
69-
// Up the JCL version (BB) when adding functionality
70-
/*[ENDIF]*/
71-
72-
private static final int j9Version = 0x06040270;
73-
74-
private static final long j9Config = 0x7363617237306200L; // 'scar70b\0'
7559

7660
/*[REM] this field will be folded into methods compiled by the JIT and is needed for the fastIdentityHashCode optimization below */
7761
/*[REM] the real value of this field is set in the System.afterClinitInitialization since this class starts too early */

runtime/j9vm/jvm.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2328,7 +2328,6 @@ JNI_CreateJavaVM_impl(JavaVM **pvm, void **penv, void *vm_args, BOOLEAN isJITSer
23282328
if (
23292329
/* Add the default options file */
23302330
(0 != addOptionsDefaultFile(&j9portLibrary, &vmArgumentsList, optionsDefaultFileLocation, localVerboseLevel))
2331-
|| (0 != addXjcl(&j9portLibrary, &vmArgumentsList, J2SE_CURRENT_VERSION))
23322331
|| (0 != addBootLibraryPath(&j9portLibrary, &vmArgumentsList, "-Dcom.ibm.oti.vm.bootstrap.library.path=",
23332332
jvmBufferData(j9binBuffer), jvmBufferData(jrebinBuffer)))
23342333
|| (0 != addBootLibraryPath(&j9portLibrary, &vmArgumentsList, "-Dsun.boot.library.path=",

runtime/jcl/common/jclcinit.c

Lines changed: 6 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -44,28 +44,13 @@
4444
#include "omr.h"
4545
#include "vendor_version.h"
4646

47-
/* The vm version which must match the JCL.
48-
* It has the format 0xAABBCCCC
49-
* AA - vm version, BB - jcl version, CCCC - main version
50-
* CCCC must match exactly with the JCL
51-
* Up the vm version (AA) when adding natives
52-
* BB is the required level of JCL to run the vm
53-
*/
54-
#define JCL_VERSION 0x06040270
55-
56-
extern void *jclConfig;
57-
58-
static UDATA
59-
doJCLCheck(J9JavaVM *vm, J9Class *j9VMInternalsClass);
60-
61-
6247
/*
63-
Calculate the value for java.vm.info (and java.fullversion) system/vm properties.
64-
Currently allocates into a fixed-size buffer. This really should be fixed.
65-
*/
66-
jint computeFullVersionString(J9JavaVM* vm)
48+
* Calculate the value for java.vm.info (and java.fullversion) system/vm properties.
49+
* Currently allocates into a fixed-size buffer. This really should be fixed.
50+
*/
51+
jint computeFullVersionString(J9JavaVM *vm)
6752
{
68-
VMI_ACCESS_FROM_JAVAVM((JavaVM*)vm);
53+
VMI_ACCESS_FROM_JAVAVM((JavaVM *)vm);
6954
PORT_ACCESS_FROM_JAVAVM(vm);
7055
const char *osarch = NULL;
7156
const char *osname = NULL;
@@ -114,7 +99,7 @@ jint computeFullVersionString(J9JavaVM* vm)
11499
osarch = j9sysinfo_get_CPU_architecture();
115100

116101
#ifdef J9VM_ENV_DATA64
117-
memInfo = J9JAVAVM_COMPRESS_OBJECT_REFERENCES(vm) ? "64-Bit Compressed References": "64-Bit";
102+
memInfo = J9JAVAVM_COMPRESS_OBJECT_REFERENCES(vm) ? "64-Bit Compressed References" : "64-Bit";
118103
#else
119104
#if defined(J9ZOS390) || defined(S390)
120105
memInfo = "31-Bit";
@@ -357,35 +342,6 @@ jint initializeKnownClasses(J9JavaVM* vm, U_32 runtimeFlags)
357342
return JNI_OK;
358343
}
359344

360-
361-
static UDATA
362-
doJCLCheck(J9JavaVM *vm, J9Class *j9VMInternalsClass)
363-
{
364-
J9VMThread *vmThread = vm->mainThread;
365-
J9InternalVMFunctions *vmFuncs = vm->internalVMFunctions;
366-
J9ROMStaticFieldShape *jclField;
367-
U_8 *cConfigPtr;
368-
U_8 *jclConfigPtr = NULL;
369-
UDATA jclVersion = -1;
370-
371-
/* get the jcl specified by the class library (i.e. java.lang.J9VMInternals) */
372-
vmFuncs->staticFieldAddress(vmThread, j9VMInternalsClass, (U_8*)"j9Config", sizeof("j9Config") - 1, (U_8*)"J", 1, NULL, (UDATA *)&jclField, J9_RESOLVE_FLAG_NO_THROW_ON_FAIL, NULL);
373-
if (jclField != NULL) {
374-
jclConfigPtr = (U_8 *)&jclField->initialValue;
375-
/* get the jcl version from the class library (i.e. java.lang.J9VMInternals) */
376-
vmFuncs->staticFieldAddress(vmThread, j9VMInternalsClass, (U_8*)"j9Version", sizeof("j9Version") - 1, (U_8*)"I", 1, NULL, (UDATA *)&jclField, J9_RESOLVE_FLAG_NO_THROW_ON_FAIL, NULL);
377-
if (jclField != NULL) {
378-
jclVersion = jclField->initialValue;
379-
}
380-
}
381-
382-
/* get the jcl specified by the DLL */
383-
cConfigPtr = (U_8 *)&jclConfig;
384-
385-
/* check the values and report any errors */
386-
return checkJCL(vmThread, cConfigPtr, jclConfigPtr, JCL_VERSION, jclVersion);
387-
}
388-
389345
/**
390346
* Initialize a static int field in a Class.
391347
*
@@ -676,10 +632,6 @@ initializeRequiredClasses(J9VMThread *vmThread, char* dllName)
676632
return 1;
677633
}
678634

679-
if (doJCLCheck(vm, vmInternalsClass) != 0) {
680-
return 1;
681-
}
682-
683635
/* Load ClassInitializationLock as early as possible */
684636

685637
lockClass = vmFuncs->internalFindKnownClass(vmThread, J9VMCONSTANTPOOL_JAVALANGJ9VMINTERNALSCLASSINITIALIZATIONLOCK, J9_FINDKNOWNCLASS_FLAG_NON_FATAL);

runtime/jcl/common/stdinit.c

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -546,70 +546,6 @@ JCL_OnUnload(J9JavaVM *vm, void *reserved)
546546
return 0;
547547
}
548548

549-
IDATA
550-
checkJCL(J9VMThread *vmThread, U_8 *dllValue, U_8 *jclConfig, UDATA j9Version, UDATA jclVersion)
551-
{
552-
J9JavaVM * vm = vmThread->javaVM;
553-
PORT_ACCESS_FROM_JAVAVM(vm);
554-
char jclName[9];
555-
UDATA j9V, jclV;
556-
557-
/* If jclConfig is NULL or jclVersion is -1, then we didn't find the fields in java.lang.Class. Make sure the dllValue and jclConfig match. */
558-
if ((jclConfig == NULL) || (jclVersion == (UDATA)-1) || (memcmp(jclConfig, dllValue, 8))) {
559-
/* Incompatible class library */
560-
j9nls_printf(PORTLIB, J9NLS_ERROR | J9NLS_BEGIN_MULTI_LINE, J9NLS_JCL_INCOMPATIBLE_CL);
561-
if (jclConfig != NULL) {
562-
#ifdef J9VM_ENV_LITTLE_ENDIAN
563-
jclName [0] = jclConfig[7];
564-
jclName [1] = jclConfig[6];
565-
jclName [2] = jclConfig[5];
566-
jclName [3] = jclConfig[4];
567-
jclName [4] = jclConfig[3];
568-
jclName [5] = jclConfig[2];
569-
jclName [6] = jclConfig[1];
570-
jclName [7] = jclConfig[0];
571-
#else
572-
jclName [0] = jclConfig[0];
573-
jclName [1] = jclConfig[1];
574-
jclName [2] = jclConfig[2];
575-
jclName [3] = jclConfig[3];
576-
jclName [4] = jclConfig[4];
577-
jclName [5] = jclConfig[5];
578-
jclName [6] = jclConfig[6];
579-
jclName [7] = jclConfig[7];
580-
#endif
581-
jclName [8] = '\0';
582-
/* Try running with -jcl:%s */
583-
j9nls_printf(PORTLIB, J9NLS_INFO | J9NLS_END_MULTI_LINE, J9NLS_JCL_TRY_JCL, jclName);
584-
return 2;
585-
} else {
586-
/* Try running with -jcl:%s */
587-
j9nls_printf(PORTLIB, J9NLS_INFO | J9NLS_END_MULTI_LINE, J9NLS_JCL_NOTJ9);
588-
return 1;
589-
}
590-
}
591-
592-
/* Last, compare the versions */
593-
if((jclV = jclVersion & 0xffff) != (j9V = j9Version & 0xffff)) {
594-
/* Incompatible class library version: JCL %x, VM %x */
595-
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_JCL_INCOMPATIBLE_CL_VERSION, jclV, j9V);
596-
return 3;
597-
}
598-
if((jclV = jclVersion & 0xff0000) < (j9V = j9Version & 0xff0000)) {
599-
/* Incompatible class library version: expected JCL v%i, found v%i */
600-
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_JCL_INCOMPATIBLE_CL_VERSION_JCL, j9V >> 16, jclV >> 16);
601-
return 4;
602-
}
603-
if((jclV = jclVersion & 0xff000000) > (j9V = j9Version & 0xff000000)) {
604-
/* Incompatible class library version: requires VM v%i, found v%i */
605-
j9nls_printf(PORTLIB, J9NLS_ERROR, J9NLS_JCL_INCOMPATIBLE_CL_VERSION_VM, jclV >> 24, j9V >> 24);
606-
return 5;
607-
}
608-
609-
/* Good to go! */
610-
return 0;
611-
}
612-
613549
#ifdef J9VM_OPT_DYNAMIC_LOAD_SUPPORT
614550

615551
static IDATA

runtime/jcl/common/vm_scar.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,6 @@ char *iniBootpath = NULL;
8383

8484
#endif
8585

86-
const U_64 jclConfig = J9CONST64(0x7363617237306200); /* 'scar70b' */
87-
8886
#if defined(WIN32)
8987
#define J9_AWTPRINTERJOB_VALUE "sun.awt.windows.WPrinterJob"
9088
#define J9_AWTTOOLKIT_VALUE "sun.awt.windows.WToolkit"
@@ -325,12 +323,12 @@ J9VMDllMain(J9JavaVM *vm, IDATA stage, void *reserved)
325323
PORT_ACCESS_FROM_JAVAVM(vm);
326324
IDATA returnVal = J9VMDLLMAIN_OK;
327325
IDATA result = 0;
328-
IDATA* returnPointer = &result;
326+
IDATA *returnPointer = &result;
329327
I_32 hookReturnValue = JNI_OK;
330-
I_32* returnValuePointer = &hookReturnValue;
328+
I_32 *returnValuePointer = &hookReturnValue;
331329
J9InternalVMFunctions *vmFuncs = vm->internalVMFunctions;
332330

333-
switch(stage) {
331+
switch (stage) {
334332
case ALL_LIBRARIES_LOADED:
335333
returnVal = initializeUnsafeMemoryTracking(vm);
336334
if (returnVal != JNI_OK) {
@@ -364,7 +362,7 @@ J9VMDllMain(J9JavaVM *vm, IDATA stage, void *reserved)
364362
break;
365363

366364
case ALL_VM_ARGS_CONSUMED :
367-
FIND_AND_CONSUME_VMARG(STARTSWITH_MATCH, VMOPT_XJCL_COLON, NULL);
365+
FIND_AND_CONSUME_VMARG(STARTSWITH_MATCH, "-Xjcl:", NULL);
368366
break;
369367

370368
case JCL_INITIALIZED :

runtime/nls/j9cl/j9jcl.nls

Lines changed: 24 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -54,66 +54,46 @@
5454
J9NLS.MODULE=J9CL
5555
J9NLS.HEADER=j9jclnls.h
5656

57-
J9NLS_JCL_INCOMPATIBLE_CL=Incompatible class library
57+
J9NLS_JCL_INCOMPATIBLE_CL=
5858
# START NON-TRANSLATABLE
59-
J9NLS_JCL_INCOMPATIBLE_CL.explanation=The class library jar is incompatible with the class library natives.
60-
J9NLS_JCL_INCOMPATIBLE_CL.system_action=The JVM will fail to start.
61-
J9NLS_JCL_INCOMPATIBLE_CL.user_response=Ensure that the vm.jar is of the same version as the JVM.
62-
59+
J9NLS_JCL_INCOMPATIBLE_CL.explanation=NOTAG
60+
J9NLS_JCL_INCOMPATIBLE_CL.system_action=
61+
J9NLS_JCL_INCOMPATIBLE_CL.user_response=
6362
# END NON-TRANSLATABLE
6463

65-
# This error occurs if the default jcl, or the jcl specified with the -jcl: option
66-
# is not the same as the class library found in the bootpath
67-
# The message indicates the correct input to use with the -jcl option. e.g midp20, foun11, etc..
68-
J9NLS_JCL_TRY_JCL=Try running with -jcl:%s
64+
J9NLS_JCL_TRY_JCL=
6965
# START NON-TRANSLATABLE
70-
J9NLS_JCL_TRY_JCL.sample_input_1=midp20
71-
J9NLS_JCL_TRY_JCL.explanation=The class library jar is incompatible with the class library natives and the JVM.
72-
J9NLS_JCL_TRY_JCL.system_action=The JVM will fail to start.
73-
J9NLS_JCL_TRY_JCL.user_response=Ensure that the class library natives and the JVM are compatible with the specified class library jar.
74-
66+
J9NLS_JCL_TRY_JCL.explanation=NOTAG
67+
J9NLS_JCL_TRY_JCL.system_action=
68+
J9NLS_JCL_TRY_JCL.user_response=
7569
# END NON-TRANSLATABLE
7670

77-
J9NLS_JCL_NOTJ9=Classes are from a non-J9 library, or an incorrectly reduced JXE
71+
J9NLS_JCL_NOTJ9=
7872
# START NON-TRANSLATABLE
79-
J9NLS_JCL_NOTJ9.explanation=The class library jar is incompatible with this VM.
80-
J9NLS_JCL_NOTJ9.system_action=The JVM will fail to start.
81-
J9NLS_JCL_NOTJ9.user_response=Ensure that the class library is compatible with the JVM.
82-
73+
J9NLS_JCL_NOTJ9.explanation=NOTAG
74+
J9NLS_JCL_NOTJ9.system_action=
75+
J9NLS_JCL_NOTJ9.user_response=
8376
# END NON-TRANSLATABLE
8477

85-
# This error occurs if the JCL and VM doesn't have the same branch version
86-
# (i.e. JCL and VM come from different development streams)
87-
J9NLS_JCL_INCOMPATIBLE_CL_VERSION=Incompatible class library version: JCL %1$x, VM %2$x
78+
J9NLS_JCL_INCOMPATIBLE_CL_VERSION=
8879
# START NON-TRANSLATABLE
89-
J9NLS_JCL_INCOMPATIBLE_CL_VERSION.sample_input_1=24a
90-
J9NLS_JCL_INCOMPATIBLE_CL_VERSION.sample_input_2=231
91-
J9NLS_JCL_INCOMPATIBLE_CL_VERSION.explanation=The class library is not from the same release as the JVM.
92-
J9NLS_JCL_INCOMPATIBLE_CL_VERSION.system_action=The JVM will fail to start.
93-
J9NLS_JCL_INCOMPATIBLE_CL_VERSION.user_response=Ensure the JVM and the class libraries are from the same release.
94-
80+
J9NLS_JCL_INCOMPATIBLE_CL_VERSION.explanation=NOTAG
81+
J9NLS_JCL_INCOMPATIBLE_CL_VERSION.system_action=
82+
J9NLS_JCL_INCOMPATIBLE_CL_VERSION.user_response=
9583
# END NON-TRANSLATABLE
9684

97-
# This error occurs if the JCL is older than what VM requires
98-
J9NLS_JCL_INCOMPATIBLE_CL_VERSION_JCL=Incompatible class library version: expected JCL v%1$i, found v%2$i
85+
J9NLS_JCL_INCOMPATIBLE_CL_VERSION_JCL=
9986
# START NON-TRANSLATABLE
100-
J9NLS_JCL_INCOMPATIBLE_CL_VERSION_JCL.sample_input_1=12
101-
J9NLS_JCL_INCOMPATIBLE_CL_VERSION_JCL.sample_input_2=7
102-
J9NLS_JCL_INCOMPATIBLE_CL_VERSION_JCL.explanation=The class library is not from the same release as the JVM.
103-
J9NLS_JCL_INCOMPATIBLE_CL_VERSION_JCL.system_action=The JVM will fail to start.
104-
J9NLS_JCL_INCOMPATIBLE_CL_VERSION_JCL.user_response=Ensure the JVM and the class libraries are from the same release.
105-
87+
J9NLS_JCL_INCOMPATIBLE_CL_VERSION_JCL.explanation=NOTAG
88+
J9NLS_JCL_INCOMPATIBLE_CL_VERSION_JCL.system_action=
89+
J9NLS_JCL_INCOMPATIBLE_CL_VERSION_JCL.user_response=
10690
# END NON-TRANSLATABLE
10791

108-
# This error occurs if the VM is older than what JCL requires
109-
J9NLS_JCL_INCOMPATIBLE_CL_VERSION_VM=Incompatible class library version: requires VM v%1$i, found v%2$i
92+
J9NLS_JCL_INCOMPATIBLE_CL_VERSION_VM=
11093
# START NON-TRANSLATABLE
111-
J9NLS_JCL_INCOMPATIBLE_CL_VERSION_VM.sample_input_1=28
112-
J9NLS_JCL_INCOMPATIBLE_CL_VERSION_VM.sample_input_2=26
113-
J9NLS_JCL_INCOMPATIBLE_CL_VERSION_VM.explanation=The class library is not from the same release as the JVM.
114-
J9NLS_JCL_INCOMPATIBLE_CL_VERSION_VM.system_action=The JVM will fail to start.
115-
J9NLS_JCL_INCOMPATIBLE_CL_VERSION_VM.user_response=Ensure the JVM and the class libraries are from the same release.
116-
94+
J9NLS_JCL_INCOMPATIBLE_CL_VERSION_VM.explanation=NOTAG
95+
J9NLS_JCL_INCOMPATIBLE_CL_VERSION_VM.system_action=
96+
J9NLS_JCL_INCOMPATIBLE_CL_VERSION_VM.user_response=
11797
# END NON-TRANSLATABLE
11898

11999
# This fatal error can only occur if -verify:all is used with a JXE which provides no preverify

0 commit comments

Comments
 (0)