Skip to content

Commit

Permalink
Include JVM_DoPrivileged for Java 8 Windows builds only
Browse files Browse the repository at this point in the history
Signed-off-by: Theresa Mammarella <[email protected]>
  • Loading branch information
theresa-m committed Jan 14, 2025
1 parent 1fbf35b commit ffb6a4f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
7 changes: 6 additions & 1 deletion runtime/j9vm/exports.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ jvm_add_exports(jvm
_JVM_HoldsLock@12
_JVM_InitProperties@8
_JVM_ArrayCopy@28
_JVM_DoPrivileged@20
_JVM_IHashCode@8
_JVM_Clone@8
_JVM_CompileClass@12
Expand Down Expand Up @@ -279,6 +278,12 @@ jvm_add_exports(jvm
JVM_BeforeHalt
)

if((JAVA_SPEC_VERSION LESS 9) AND OMR_OS_WINDOWS)
jvm_add_exports(jvm
_JVM_DoPrivileged@20
)
endif()

if(JAVA_SPEC_VERSION LESS 11)
jvm_add_exports(jvm
_JVM_GetCallerClass@8
Expand Down
4 changes: 2 additions & 2 deletions runtime/j9vm/j7vmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ java_lang_J9VMInternals_doPrivilegedWithException(JNIEnv* env)
return cached;
}

#if (JAVA_SPEC_VERSION == 8) && defined(WIN32)
/* Do not remove: this method is required by Windows IBM Java 8 builds. */
jobject JNICALL
JVM_DoPrivileged(JNIEnv* env, jobject java_security_AccessController, jobject action, jboolean unknown, jboolean isExceptionAction)
Expand All @@ -403,8 +404,7 @@ JVM_DoPrivileged(JNIEnv* env, jobject java_security_AccessController, jobject ac
methodID,
action);
}


#endif /* (JAVA_SPEC_VERSION == 8) && defined(WIN32) */

jobject JNICALL
JVM_EnableCompiler(jint arg0, jint arg1)
Expand Down
5 changes: 4 additions & 1 deletion runtime/j9vm/j9vmnatives.xml
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,10 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-ex
<export name="_JVM_HoldsLock@12"/>
<export name="_JVM_InitProperties@8"/>
<export name="_JVM_ArrayCopy@28"/>
<export name="_JVM_DoPrivileged@20"/>
<export name="_JVM_DoPrivileged@20">
<include-if condition="spec.win_.*"/>
<exclude-if condition="spec.java9"/>
</export>
<export name="_JVM_IHashCode@8"/>
<export name="_JVM_Clone@8"/>
<export name="_JVM_CompileClass@12"/>
Expand Down
3 changes: 2 additions & 1 deletion runtime/redirector/forwarders.m4
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ _X(JVM_CountStackFrames,JNICALL,true,jobject,jint arg0, jint arg1)
_X(JVM_CurrentThread,JNICALL,true,jobject,JNIEnv *env, jclass java_lang_Thread)
_X(JVM_DesiredAssertionStatus,JNICALL,true,jboolean,JNIEnv *env, jobject arg1, jobject arg2)
_X(JVM_DisableCompiler,JNICALL,true,jobject,jint arg0, jint arg1)
_X(JVM_DoPrivileged,JNICALL,true,jobject,JNIEnv *env, jobject java_security_AccessController, jobject action, jboolean unknown, jboolean isExceptionAction)
_IF([(JAVA_SPEC_VERSION == 8) && defined(WIN32)],
[_X(JVM_DoPrivileged,JNICALL,true,jobject,JNIEnv *env, jobject java_security_AccessController, jobject action, jboolean unknown, jboolean isExceptionAction)])
_X(JVM_EnableCompiler,JNICALL,true,jobject,jint arg0, jint arg1)
_X(JVM_FillInStackTrace,JNICALL,true,void,JNIEnv *env, jobject throwable)
_X(JVM_FindClassFromClassLoader,JNICALL,true,jobject,JNIEnv *env, char *className, jboolean init, jobject classLoader, jboolean throwError)
Expand Down

0 comments on commit ffb6a4f

Please sign in to comment.