diff --git a/runtime/compiler/module.xml b/runtime/compiler/module.xml
index 96d528f7ef8..dca4345329e 100644
--- a/runtime/compiler/module.xml
+++ b/runtime/compiler/module.xml
@@ -50,7 +50,7 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-excepti
-
+
diff --git a/runtime/hyvm/module.xml b/runtime/hyvm/module.xml
index f73dd49f6e1..d8bdf0712e9 100644
--- a/runtime/hyvm/module.xml
+++ b/runtime/hyvm/module.xml
@@ -1,27 +1,25 @@
-
-
@@ -55,9 +53,9 @@
-
-
-
+
+
+
@@ -79,7 +77,7 @@
-
+
diff --git a/runtime/j9vm/CMakeLists.txt b/runtime/j9vm/CMakeLists.txt
index f8cea6e30dc..200097d3001 100644
--- a/runtime/j9vm/CMakeLists.txt
+++ b/runtime/j9vm/CMakeLists.txt
@@ -64,28 +64,28 @@ target_link_libraries(jvm_common
target_include_directories(jvm_common
INTERFACE
${CMAKE_CURRENT_BINARY_DIR}
- #TODO we have to repeat ../include because of duplication of vmi.h
+ # TODO we have to repeat ../include because of duplication of vmi.h
../include
../hyvm
../harmony/include
../jcl/
)
-add_library(jvm SHARED ${CMAKE_CURRENT_BINARY_DIR}/ut_j9scar.c)
-target_link_libraries(jvm
+add_library(j9jvm SHARED ${CMAKE_CURRENT_BINARY_DIR}/ut_j9scar.c)
+target_link_libraries(j9jvm
PRIVATE
jvm_common
j9util
)
if(OMR_OS_WINDOWS)
- target_link_libraries(jvm PRIVATE ws2_32)
+ target_link_libraries(j9jvm PRIVATE ws2_32)
endif()
-add_dependencies(jvm omrgc_hookgen)
+add_dependencies(j9jvm omrgc_hookgen)
include(exports.cmake)
install(
- TARGETS jvm
+ TARGETS j9jvm
LIBRARY DESTINATION ${j9vm_SOURCE_DIR}
RUNTIME DESTINATION ${j9vm_SOURCE_DIR}
)
diff --git a/runtime/j9vm/exports.cmake b/runtime/j9vm/exports.cmake
index 313405ec062..89a792581b7 100644
--- a/runtime/j9vm/exports.cmake
+++ b/runtime/j9vm/exports.cmake
@@ -20,11 +20,11 @@
# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
################################################################################
-# Wrapper areround omr_add_exports which strips windows name mangling (except on 32bit windows)
+# Wrapper areround omr_add_exports which strips windows name mangling (except on 32-bit windows).
function(jvm_add_exports tgt)
set(filtered_exports)
if(OMR_OS_WINDOWS AND OMR_ENV_DATA32)
- # we keep mangled names on 32 bit windows
+ # we keep mangled names on 32-bit windows
set(filtered_exports ${ARGN})
else()
# for each symbol name of the form '_foo@1234' replace with 'foo'
@@ -36,7 +36,7 @@ function(jvm_add_exports tgt)
omr_add_exports(${tgt} ${filtered_exports})
endfunction()
-jvm_add_exports(jvm
+jvm_add_exports(j9jvm
JNI_CreateJavaVM
JNI_GetCreatedJavaVMs
JNI_GetDefaultJavaVMInitArgs
@@ -149,7 +149,7 @@ jvm_add_exports(jvm
jio_vsnprintf
post_block
pre_block
- # Additions for Java 7
+ # Additions for Java 7.
_JVM_GetStackAccessControlContext@8
_JVM_GetInheritedAccessControlContext@8
_JVM_GetArrayLength@8
@@ -243,16 +243,16 @@ jvm_add_exports(jvm
_JVM_SetPrimitiveField@24
_JVM_SetNativeThreadName@12
- # Additions used on linux-x86
+ # Additions used on linux-x86.
_JVM_SetSockOpt@20
_JVM_SocketShutdown@8
_JVM_GetSockName@12
_JVM_GetHostName@8
- # Additions to support the JDWP agent
+ # Additions to support the JDWP agent.
JVM_InitAgentProperties
- # Additions to support Java 7 verification
+ # Additions to support Java 7 verification.
_JVM_GetMethodIxLocalsCount@12
_JVM_GetCPMethodNameUTF@12
_JVM_GetMethodIxExceptionTableEntry@20
@@ -284,7 +284,7 @@ jvm_add_exports(jvm
_JVM_GetMethodIxExceptionsCount@12
_JVM_ReleaseUTF@4
- # Additions for Java 8
+ # Additions for Java 8.
_JVM_GetClassTypeAnnotations@8
_JVM_GetFieldTypeAnnotations@8
_JVM_GetMethodParameters@8
@@ -295,10 +295,9 @@ jvm_add_exports(jvm
)
if(JAVA_SPEC_VERSION LESS 11)
- # i.e. JAVA_SPEC_VERSION < 11
- jvm_add_exports(jvm _JVM_GetCallerClass@4)
+ jvm_add_exports(j9jvm _JVM_GetCallerClass@4)
else()
- jvm_add_exports(jvm
+ jvm_add_exports(j9jvm
_JVM_GetCallerClass@8
# Additions for Java 9 (Modularity)
JVM_DefineModule
@@ -345,8 +344,8 @@ else()
endif()
if(NOT JAVA_SPEC_VERSION LESS 14)
- jvm_add_exports(jvm
- # Additions for Java 14 (General)
+ jvm_add_exports(j9jvm
+ # Additions for Java 14 (General).
JVM_GetExtendedNPEMessage
)
endif()
diff --git a/runtime/j9vm/module.xml b/runtime/j9vm/module.xml
index 919d7b9fe2d..96890e8439a 100644
--- a/runtime/j9vm/module.xml
+++ b/runtime/j9vm/module.xml
@@ -42,7 +42,7 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-excepti
-
+
@@ -107,10 +107,9 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-excepti
@@ -121,7 +120,7 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-excepti
-
+
diff --git a/runtime/jcl/module.xml b/runtime/jcl/module.xml
index a0beafd1552..046677deeb3 100644
--- a/runtime/jcl/module.xml
+++ b/runtime/jcl/module.xml
@@ -105,7 +105,7 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-excepti
-
+
diff --git a/runtime/redirector/CMakeLists.txt b/runtime/redirector/CMakeLists.txt
index 07c0c48890d..2f2f795e30e 100644
--- a/runtime/redirector/CMakeLists.txt
+++ b/runtime/redirector/CMakeLists.txt
@@ -55,8 +55,8 @@ set_target_properties(jvm_redirect PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
)
-# The redirector should have the same exports as the jvm
-get_target_property(jvm_exports jvm EXPORTED_SYMBOLS)
+# The redirector should have the same exports as j9jvm.
+get_target_property(jvm_exports j9jvm EXPORTED_SYMBOLS)
omr_add_exports(jvm_redirect ${jvm_exports})
install(
diff --git a/runtime/redirector/module.xml b/runtime/redirector/module.xml
index f1b5be5fc6d..e878627016a 100644
--- a/runtime/redirector/module.xml
+++ b/runtime/redirector/module.xml
@@ -66,7 +66,7 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-excepti
-
+
diff --git a/runtime/redirector/redirector.c b/runtime/redirector/redirector.c
index afbc14a4be1..e393c36cc20 100644
--- a/runtime/redirector/redirector.c
+++ b/runtime/redirector/redirector.c
@@ -58,15 +58,15 @@ typedef jint (JNICALL *DestroyVM)(JavaVM *);
static JavaVMInitArgs *args = NULL;
-static CreateVM globalCreateVM=NULL;
-static InitArgs globalInitArgs=NULL;
-static GetVMs globalGetVMs=NULL;
-static DestroyVM globalDestroyVM=NULL;
+static CreateVM globalCreateVM = NULL;
+static InitArgs globalInitArgs = NULL;
+static GetVMs globalGetVMs = NULL;
+static DestroyVM globalDestroyVM = NULL;
static JavaVM * globalVM = NULL;
#if defined(AIXPPC)
-/* Used to keep track of whether or not opening of the "master redirector" has been attempted.
+/* Used to keep track of whether or not opening of the "master redirector" has been attempted.
* Avoiding an infinite loop when libjvm.a is soft linked to libjvm.so
*/
static int attempted_to_open_master = 0;
@@ -187,7 +187,7 @@ static BOOLEAN parseGCPolicy(char *buffer, int *value);
#define COMPRESSEDREFS_DIR "compressedrefs"
#define DEFAULT_DIR "default"
-#define XMX "-Xmx"
+#define XMX "-Xmx"
/* We use forward slashes here because J9VM_LIB_ARCH_DIR is not used on Windows. */
#if (JAVA_SPEC_VERSION >= 9) || defined(OSX)
@@ -262,7 +262,7 @@ addToLibpath(const char *dir)
oldPath = getenv("LIBPATH");
DBG_MSG(("\nLIBPATH before = %s\n", oldPath ? oldPath : ""));
- newSize = (oldPath ? strlen(oldPath) : 0) + strlen(dir) + 2; /* 1 for :, 1 for \0 terminator */
+ newSize = (oldPath ? strlen(oldPath) : 0) + strlen(dir) + 2; /* 1 for :, 1 for \0 terminator */
newPath = malloc(newSize);
if(!newPath) {
@@ -331,7 +331,7 @@ showVMChoices(void)
if (isPackagedWithCompressedRefs()) {
fprintf(stdout, "\nThe following options control global VM configuration:\n\n");
fprintf(stdout, " -Xcompressedrefs use compressed heap references\n");
- }
+ }
}
static int xcompressed = -1;
@@ -429,7 +429,7 @@ scan_u64(char **scan_start, U_64* result)
total += digitValue;
- rc = 0; /* we found at least one digit */
+ rc = 0; /* we found at least one digit */
c++;
}
@@ -498,7 +498,7 @@ parseMemorySizeValue(char *option)
* @param retBuffer The buffer which will be populated with the directory name (must be big enough to contain the name and the NULL byte)
* @param bufferLength The side of the retBuffer
*
- * Returns the name of the directory containing the libjvm.so VM library in the caller-provided retBuffer (with a terminating NULL byte)
+ * Returns the name of the directory containing the libjvm.so VM library in the caller-provided retBuffer (with a terminating NULL byte)
*
* Exits and prints an error message on error. Returns on success.
*/
@@ -564,7 +564,7 @@ chooseJVM(JavaVMInitArgs *args, char *retBuffer, size_t bufferLength)
xnocompressed = i;
xnocompressedstr = "-XX:-UseCompressedOops";
}
-
+
xjvmstr = strstr(envOptions, "-Xjvm:");
if (NULL != xjvmstr) {
char *space = NULL;
@@ -590,7 +590,7 @@ chooseJVM(JavaVMInitArgs *args, char *retBuffer, size_t bufferLength)
if ( 0 == strcmp(args->options[i].optionString, "-Xcompressedrefs") || 0 == strcmp(args->options[i].optionString, "-XX:+UseCompressedOops") ) {
xcompressed = i+1;
xcompressedstr = args->options[i].optionString;
- } else if( 0 == strcmp(args->options[i].optionString, "-Xnocompressedrefs") || 0 == strcmp(args->options[i].optionString, "-XX:-UseCompressedOops") ) {
+ } else if( 0 == strcmp(args->options[i].optionString, "-Xnocompressedrefs") || 0 == strcmp(args->options[i].optionString, "-XX:-UseCompressedOops") ) {
xnocompressed = i+1;
xnocompressedstr = args->options[i].optionString;
} else if( 0 == strncmp(args->options[i].optionString, "-Xjvm:", 6) ) {
@@ -734,17 +734,17 @@ chooseJVM(JavaVMInitArgs *args, char *retBuffer, size_t bufferLength)
/**
* jint JNICALL JNI_CreateJavaVM(JavaVM **pvm, void **penv, void *vm_args)
* Load and initialize a virtual machine instance.
- * This provides an invocation API that runs the J9 VM in BFU/sidecar mode
+ * This provides an invocation API that runs the J9 VM in BFU/sidecar mode
*
* @param pvm pointer to the location where the JavaVM interface
- * pointer will be placed
+ * pointer will be placed
* @param penv pointer to the location where the JNIEnv interface
- * pointer for the main thread will be placed
+ * pointer for the main thread will be placed
* @param vm_args java virtual machine initialization arguments
*
* @returns zero on success; otherwise, return a negative number
*
- * DLL: jvm
+ * DLL: jvm
*/
jint JNICALL
JNI_CreateJavaVM(JavaVM **pvm, void **penv, void *vm_args)
@@ -791,7 +791,7 @@ JNI_CreateJavaVM(JavaVM **pvm, void **penv, void *vm_args)
}
}
- openedLibraries = openLibraries(namedVM);
+ openedLibraries = openLibraries(namedVM);
if(openedLibraries == JNI_ERR) {
fprintf(stdout, "Failed to find VM - aborting\n");
@@ -837,19 +837,19 @@ JNI_CreateJavaVM(JavaVM **pvm, void **penv, void *vm_args)
}
/**
- * jint JNICALL JNI_GetCreatedJavaVMs(JavaVM **vmBuf, jsize bufLen, jsize *nVMs)
+ * jint JNICALL JNI_GetCreatedJavaVMs(JavaVM **vmBuf, jsize bufLen, jsize *nVMs)
* Return pointers to all the virtual machine instances that have been
* created.
- * This provides an invocation API that runs the J9 VM in BFU/sidecar mode
+ * This provides an invocation API that runs the J9 VM in BFU/sidecar mode
*
* @param vmBuf pointer to the buffer where the pointer to virtual
- * machine instances will be placed
+ * machine instances will be placed
* @param bufLen the length of the buffer
* @param nVMs a pointer to an integer
*
* @returns zero on success; otherwise, return a negative number
*
- * DLL: jvm
+ * DLL: jvm
*/
jint JNICALL
JNI_GetCreatedJavaVMs(JavaVM **vmBuf, jsize bufLen, jsize *nVMs)
@@ -889,17 +889,17 @@ JNI_GetCreatedJavaVMs(JavaVM **vmBuf, jsize bufLen, jsize *nVMs)
}
/**
- * jint JNICALL JNI_GetDefaultJavaVMInitArgs(void *vm_args)
+ * jint JNICALL JNI_GetDefaultJavaVMInitArgs(void *vm_args)
* Return a default configuration for the java virtual machine
* implementation.
- * This provides an invocation API that runs the J9 VM in BFU/sidecar mode
+ * This provides an invocation API that runs the J9 VM in BFU/sidecar mode
*
* @param vm_args pointer to a vm-specific initialization structure
- * into which the default arguments are filled.
+ * into which the default arguments are filled.
*
* @returns zero on success; otherwise, return a negative number
*
- * DLL: jvm
+ * DLL: jvm
*/
jint JNICALL
JNI_GetDefaultJavaVMInitArgs(void *vm_args)
@@ -1100,13 +1100,14 @@ findDir(const char *libraryDir) {
return buffer;
}
+#define OPENJ9_VM_NAME "j9jvm"
/*
* opens the jvm.dll in directory named "libraryDir" at the same depth
* as this directory. Sets the global function pointers up for
* passthrough.
- *
- * on AIX this function is used in the generated.c functions to find the 'master'
+ *
+ * on AIX this function is used in the generated.c functions to find the 'master'
* redirector (see details in findDir()).
*/
#if defined(AIXPPC)
@@ -1130,8 +1131,7 @@ openLibraries(const char *libraryDir)
/* add the DLL name */
#ifdef WIN32
- buffer = jvmBufferCat(buffer, "\\");
- buffer = jvmBufferCat(buffer, "jvm.dll");
+ buffer = jvmBufferCat(buffer, "\\" OPENJ9_VM_NAME J9PORT_LIBRARY_SUFFIX);
/* open the DLL and look up the symbols */
DBG_MSG(("trying %s\n", jvmBufferData(buffer)));
MultiByteToWideChar(OS_ENCODING_CODE_PAGE, OS_ENCODING_MB_FLAGS, jvmBufferData(buffer), -1, unicodePath, (int)strlen(jvmBufferData(buffer)) + 1);
@@ -1149,7 +1149,7 @@ openLibraries(const char *libraryDir)
return JNI_ERR;
}
#else /* WIN32 */
- buffer = jvmBufferCat(buffer, "/libjvm" J9PORT_LIBRARY_SUFFIX);
+ buffer = jvmBufferCat(buffer, "/lib" OPENJ9_VM_NAME J9PORT_LIBRARY_SUFFIX);
/* open the DLL and look up the symbols */
#if defined(AIXPPC)
/* CMVC 137341:
@@ -1200,6 +1200,7 @@ getjvmBin(BOOLEAN removeSubdir)
DWORD unicodeDLLNameLength = 0;
char result[J9_MAX_PATH];
+ /* "jvm" here refers to the redirector (containing this code) */
unicodeDLLNameLength = GetModuleFileNameW(GetModuleHandle("jvm"), unicodeDLLName, (J9_MAX_PATH + 1));
/* Don't use truncated path */
if (unicodeDLLNameLength > (DWORD)J9_MAX_PATH) {
@@ -1332,7 +1333,7 @@ getjvmBin(BOOLEAN removeSubdir)
filename = linfop->ldinfo_filename;
membername = filename+strlen(filename)+1;
#ifdef DEBUG
- printf("[%p]ldinfo: filename is %s. membername is %s\n", myAddress, filename, membername);
+ printf("[%p]ldinfo: filename is %s. membername is %s\n", myAddress, filename, membername);
#endif
buffer = jvmBufferCat(buffer, filename);
if (removeSubdir) {
@@ -1401,7 +1402,7 @@ findDirContainingFile(J9StringBuffer *buffer, char *paths, char pathSeparator, c
startOfDir = endOfDir = paths;
for (isEndOfPaths=FALSE, foundIt=FALSE; !foundIt && !isEndOfPaths; endOfDir++) {
isEndOfPaths = endOfDir[0] == '\0';
- if (isEndOfPaths || (endOfDir[0] == pathSeparator)) {
+ if (isEndOfPaths || (endOfDir[0] == pathSeparator)) {
endOfDir[0] = '\0';
if (strlen(startOfDir) && isFileInDir(startOfDir, fileToFind)) {
foundIt = TRUE;
@@ -1487,7 +1488,7 @@ static J9StringBuffer* jvmBufferCat(J9StringBuffer* buffer, const char* string)
static J9StringBuffer* jvmBufferEnsure(J9StringBuffer* buffer, UDATA len) {
if (buffer == NULL) {
UDATA newSize = len > MIN_GROWTH ? len : MIN_GROWTH;
- buffer = (J9StringBuffer*) malloc( newSize + 1 + sizeof(UDATA)); /* 1 for null terminator */
+ buffer = (J9StringBuffer*) malloc( newSize + 1 + sizeof(UDATA)); /* 1 for null terminator */
if (buffer != NULL) {
buffer->remaining = newSize;
buffer->data[0] = '\0';
diff --git a/runtime/sunvmi/module.xml b/runtime/sunvmi/module.xml
index b712f4eab13..dedd315f85e 100644
--- a/runtime/sunvmi/module.xml
+++ b/runtime/sunvmi/module.xml
@@ -1,30 +1,28 @@
-
-
-
@@ -36,13 +34,13 @@
-
+
-
-
+
+
diff --git a/runtime/tests/j9vm/CMakeLists.txt b/runtime/tests/j9vm/CMakeLists.txt
index 5e6efcc7cf1..478ef16e408 100644
--- a/runtime/tests/j9vm/CMakeLists.txt
+++ b/runtime/tests/j9vm/CMakeLists.txt
@@ -28,7 +28,7 @@ target_link_libraries(j9vmtest
PRIVATE
j9vm_interface
- jvm
+ j9jvm
)
target_include_directories(j9vmtest
@@ -69,7 +69,6 @@ if(NOT JAVA_SPEC_VERSION LESS 11)
omr_add_exports(j9vmtest Java_com_ibm_oti_jvmtests_SupportJVM_GetNanoTimeAdjustment)
endif()
-
install(
TARGETS j9vmtest
LIBRARY DESTINATION ${j9vm_SOURCE_DIR}
diff --git a/runtime/tests/j9vm/module.xml b/runtime/tests/j9vm/module.xml
index e3212f8495d..5b8a6b9122c 100644
--- a/runtime/tests/j9vm/module.xml
+++ b/runtime/tests/j9vm/module.xml
@@ -75,7 +75,7 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-excepti
-
+
diff --git a/runtime/tests/jni/CMakeLists.txt b/runtime/tests/jni/CMakeLists.txt
index edcdd1e674a..cda0028e8c7 100644
--- a/runtime/tests/jni/CMakeLists.txt
+++ b/runtime/tests/jni/CMakeLists.txt
@@ -39,7 +39,7 @@ target_link_libraries(j9ben
PRIVATE
j9vm_interface
j9thr
- jvm
+ j9jvm
)
target_include_directories(j9ben
PRIVATE
diff --git a/runtime/tests/jni/module.xml b/runtime/tests/jni/module.xml
index fe40785ccc7..ccaf132c7d6 100644
--- a/runtime/tests/jni/module.xml
+++ b/runtime/tests/jni/module.xml
@@ -1,29 +1,27 @@
-
-
-
+
@@ -191,7 +189,7 @@
-
+
@@ -386,7 +384,7 @@
-
+
diff --git a/runtime/tests/lazyclassload/CMakeLists.txt b/runtime/tests/lazyclassload/CMakeLists.txt
index 2c5d3116efc..a5548948883 100644
--- a/runtime/tests/lazyclassload/CMakeLists.txt
+++ b/runtime/tests/lazyclassload/CMakeLists.txt
@@ -26,7 +26,7 @@ add_library(j9lazyClassLoad SHARED
target_link_libraries(j9lazyClassLoad
PRIVATE
j9vm_interface
- jvm
+ j9jvm
)
omr_add_exports(j9lazyClassLoad
diff --git a/runtime/tests/lazyclassload/module.xml b/runtime/tests/lazyclassload/module.xml
index f5b0c235bf6..63ff1a4e4f9 100644
--- a/runtime/tests/lazyclassload/module.xml
+++ b/runtime/tests/lazyclassload/module.xml
@@ -1,29 +1,28 @@
-
-
+
@@ -38,13 +37,13 @@
-
+
-
+