Skip to content

Commit 84a0606

Browse files
committed
Completely ignore -Xjcl options
Remove: * J9JavaVM.jclDLLName * addXjcl() * checkJCL() * J9SYSPROP_ERROR_INVALID_JCL * J9VMInternals.j9Config * J9VMInternals.j9Version Signed-off-by: Keith W. Campbell <[email protected]>
1 parent d6f33d7 commit 84a0606

File tree

13 files changed

+21
-233
lines changed

13 files changed

+21
-233
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/oti/j9nonbuilder.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,6 @@ typedef struct J9VMCustomSpinOptions {
10731073
#define J9SYSPROP_ERROR_NOT_FOUND 1
10741074
#define J9SYSPROP_ERROR_READ_ONLY 2
10751075
#define J9SYSPROP_ERROR_OUT_OF_MEMORY 3
1076-
#define J9SYSPROP_ERROR_INVALID_JCL 4
10771076
#define J9SYSPROP_ERROR_UNSUPPORTED_PROP 5
10781077
#define J9SYSPROP_ERROR_ARG_MISSING 6
10791078
#define J9SYSPROP_ERROR_INVALID_VALUE 7
@@ -6078,7 +6077,6 @@ typedef struct J9JavaVM {
60786077
UDATA threadDllHandle;
60796078
struct J9ROMImageHeader* arrayROMClasses;
60806079
struct J9BytecodeVerificationData* bytecodeVerificationData;
6081-
char* jclDLLName;
60826080
UDATA defaultOSStackSize;
60836081
#if defined(J9VM_ENV_SHARED_LIBS_USE_GLOBAL_TABLE) || defined(J9VM_ENV_CALL_VIA_TABLE)
60846082
UDATA magicLinkageValue;

runtime/oti/jclprots.h

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -763,15 +763,12 @@ extern J9_CFUNC j9object_t
763763
getStackTraceForThread (J9VMThread *vmThread, J9VMThread *targetThread, UDATA skipCount, j9object_t threadObject);
764764

765765
/* J9SourceJclStandardInit*/
766-
jint JCL_OnUnload (J9JavaVM* vm, void* reserved);
767-
jint standardPreconfigure ( JavaVM *jvm);
768-
void
769-
internalInitializeJavaLangClassLoader (JNIEnv * env);
770-
IDATA checkJCL (J9VMThread * vmThread, U_8* dllValue, U_8* jclConfig, UDATA j9Version, UDATA jclVersion);
771-
jint
772-
completeInitialization (J9JavaVM * vm);
773-
jint standardInit ( J9JavaVM *vm, char* dllName);
774-
jint JNICALL JVM_OnUnload (JavaVM* jvm, void* reserved);
766+
jint JCL_OnUnload(J9JavaVM *vm, void *reserved);
767+
jint standardPreconfigure(JavaVM *jvm);
768+
void internalInitializeJavaLangClassLoader(JNIEnv *env);
769+
jint completeInitialization(J9JavaVM *vm);
770+
jint standardInit(J9JavaVM *vm, char *dllName);
771+
jint JNICALL JVM_OnUnload(JavaVM *jvm, void *reserved);
775772

776773
/* J9SourceJclBPInit*/
777774
#if (defined(J9VM_OPT_DYNAMIC_LOAD_SUPPORT)) /* priv. proto (autogen) */

runtime/oti/jvminit.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@ enum INIT_STAGE {
221221
#define VMOPT_BP_JXE "_jxe"
222222
#define VMOPT_NEEDS_JCL "_needs_jcl"
223223
#define VMOPT_J2SE_J9 "_j2se_j9"
224-
#define VMOPT_XJCL_COLON "-Xjcl:"
225224
#define VMOPT_XFUTURE "-Xfuture"
226225
#define VMOPT_ALL "all"
227226
#define VMOPT_XSIGQUITTOFILE "-XsigquitToFile"

runtime/oti/vmargs_api.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -119,17 +119,6 @@ dumpVmArgumentsList(J9VMInitArgs *argList);
119119
IDATA
120120
addOptionsDefaultFile(J9PortLibrary * portLib, J9JavaVMArgInfoList *vmArgumentsList, char *optionsDirectory, UDATA verboseFlags);
121121

122-
/*
123-
* Add implied VM argument -Xjcl:
124-
* This allocates memory for the options string and adds the argument to the list.
125-
* @param portLib port library
126-
* @param vmArgumentsList current list of arguments
127-
* @param j2seVersion java version number
128-
* @return 0 on success, negative value on failure
129-
*/
130-
IDATA
131-
addXjcl(J9PortLibrary * portLib, J9JavaVMArgInfoList *vmArgumentsList, UDATA j2seVersion);
132-
133122
/*
134123
* Add argument to set com.ibm.oti.vm.bootstrap.library.path or sun.boot.library.path
135124
* This allocates memory for the options string and contents of the file

runtime/util/vmargs.c

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -681,35 +681,6 @@ addOptionsDefaultFile(J9PortLibrary * portLib, J9JavaVMArgInfoList *vmArgumentsL
681681
return addXOptionsFile(portLib, optionsArgumentBuffer, vmArgumentsList, verboseFlags);
682682
}
683683

684-
IDATA
685-
addXjcl(J9PortLibrary * portLib, J9JavaVMArgInfoList *vmArgumentsList, UDATA j2seVersion)
686-
{
687-
char *dllName = J9_JAVA_SE_DLL_NAME;
688-
size_t dllNameLength = sizeof(J9_JAVA_SE_DLL_NAME);
689-
size_t argumentLength = -1;
690-
char *argString = NULL;
691-
UDATA j2seReleaseValue = j2seVersion & J2SE_RELEASE_MASK;
692-
J9JavaVMArgInfo *optArg = NULL;
693-
694-
PORT_ACCESS_FROM_PORT(portLib);
695-
#ifdef J9VM_IVE_RAW_BUILD /* J9VM_IVE_RAW_BUILD is not enabled by default */
696-
Assert_Util_unreachable();
697-
#endif /* J9VM_IVE_RAW_BUILD */
698-
699-
argumentLength = sizeof(VMOPT_XJCL_COLON) + dllNameLength - 1; /* sizeof called twice, each includes the \0 */
700-
argString = j9mem_allocate_memory(argumentLength, OMRMEM_CATEGORY_VM);
701-
if (NULL == argString) {
702-
return -1;
703-
}
704-
j9str_printf(argString, argumentLength, VMOPT_XJCL_COLON "%s", dllName);
705-
optArg = newJavaVMArgInfo(vmArgumentsList, argString, ARG_MEMORY_ALLOCATION | CONSUMABLE_ARG);
706-
if (NULL == optArg) {
707-
j9mem_free_memory(argString);
708-
return -1;
709-
}
710-
return 0;
711-
}
712-
713684
IDATA
714685
addBootLibraryPath(J9PortLibrary * portLib, J9JavaVMArgInfoList *vmArgumentsList, char *propertyNameEquals, char *j9binPath, char *jrebinPath)
715686
{

runtime/vm/jvminit.c

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2042,20 +2042,19 @@ j9print_internal_version(J9PortLibrary *portLib)
20422042
IDATA
20432043
VMInitStages(J9JavaVM *vm, IDATA stage, void* reserved)
20442044
{
2045-
J9VMDllLoadInfo *loadInfo;
2045+
J9VMDllLoadInfo *loadInfo = NULL;
20462046
IDATA returnVal = J9VMDLLMAIN_OK;
20472047
IDATA argIndex = -1;
20482048
IDATA argIndex2 = -1;
2049-
IDATA optionValueSize = 0;
2050-
char* optionValue, *optionExtra;
2051-
char* parseErrorOption = NULL;
2052-
IDATA parseError;
2049+
char *optionValue = NULL;
2050+
char *parseErrorOption = NULL;
2051+
IDATA parseError = 0;
20532052
BOOLEAN lockwordWhat = FALSE;
20542053
UDATA rc = 0;
20552054
PORT_ACCESS_FROM_JAVAVM(vm);
20562055
OMRPORT_ACCESS_FROM_J9PORT(PORTLIB);
20572056

2058-
switch(stage) {
2057+
switch (stage) {
20592058
case PORT_LIBRARY_GUARANTEED :
20602059
processMemoryInterleaveOptions(vm);
20612060
if (OPTION_OK != (parseError = setMemoryOptionToOptElse(vm, &(vm->classLoadingMaxStack), VMOPT_XMSCL, 0, TRUE))) {
@@ -2588,25 +2587,6 @@ VMInitStages(J9JavaVM *vm, IDATA stage, void* reserved)
25882587
vm->decompileName = optionValue;
25892588
}
25902589

2591-
/* Parse jcl options */
2592-
argIndex = FIND_ARG_IN_VMARGS(STARTSWITH_MATCH, VMOPT_XJCL_COLON, NULL);
2593-
if (argIndex >= 0) {
2594-
loadInfo = FIND_DLL_TABLE_ENTRY(J9_JAVA_SE_DLL_NAME);
2595-
/* we know there is a colon */
2596-
GET_OPTION_VALUE(argIndex, ':', &optionValue);
2597-
GET_OPTION_OPTION(argIndex, ':', ':', &optionExtra); /* Eg. -jcl:cldc:library=foo */
2598-
if (NULL != optionExtra) {
2599-
optionValueSize = optionExtra - optionValue - 1;
2600-
strncpy(loadInfo->dllName, optionValue, optionValueSize);
2601-
loadInfo->dllName[optionValueSize] = '\0';
2602-
} else {
2603-
strncpy(loadInfo->dllName, optionValue, (DLLNAME_LEN-1));
2604-
}
2605-
vm->jclDLLName = (char *)(loadInfo->dllName);
2606-
} else {
2607-
vm->jclDLLName = J9_JAVA_SE_DLL_NAME;
2608-
}
2609-
26102590
/* Warm up the VM Interface */
26112591
if (VMI_ERROR_NONE != J9VMI_Initialize(vm)) {
26122592
goto _error;

0 commit comments

Comments
 (0)