Skip to content

Commit

Permalink
Merge pull request #18055 from keithc-ca/zip
Browse files Browse the repository at this point in the history
Implement JVM_LoadZipLibrary()
  • Loading branch information
tajila authored Sep 1, 2023
2 parents 75701be + 1578cc5 commit e57170e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
23 changes: 21 additions & 2 deletions runtime/j9vm/javanextvmi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,29 @@ JVM_ReportFinalizationComplete(JNIEnv *env, jobject obj)
#endif /* JAVA_SPEC_VERSION >= 18 */

#if JAVA_SPEC_VERSION >= 19
JNIEXPORT void JNICALL
JNIEXPORT void * JNICALL
JVM_LoadZipLibrary(void)
{
Assert_SC_true(!"JVM_LoadZipLibrary unimplemented");
void *zipHandle = NULL;
J9JavaVM *vm = BFUjavaVM;

if (NULL != vm) {
PORT_ACCESS_FROM_JAVAVM(vm);
uintptr_t handle = 0;

if (J9PORT_SL_FOUND == j9sl_open_shared_library(
(char *)"zip",
&handle,
OMRPORT_SLOPEN_DECORATE | OMRPORT_SLOPEN_LAZY)
) {
zipHandle = (void *)handle;
}
}

/* We may as well assert here: we won't make much progress without the library. */
Assert_SC_notNull(zipHandle);

return zipHandle;
}

JNIEXPORT void JNICALL
Expand Down
2 changes: 1 addition & 1 deletion runtime/redirector/forwarders.m4
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ _IF([JAVA_SPEC_VERSION >= 18],
_IF([JAVA_SPEC_VERSION >= 18],
[_X(JVM_ReportFinalizationComplete, JNICALL, false, void, JNIEnv *env, jobject obj)])
_IF([JAVA_SPEC_VERSION >= 19],
[_X(JVM_LoadZipLibrary, JNICALL, false, void, void)])
[_X(JVM_LoadZipLibrary, JNICALL, false, void *, void)])
_IF([JAVA_SPEC_VERSION >= 19],
[_X(JVM_RegisterContinuationMethods, JNICALL, false, void, JNIEnv *env, jclass clz)])
_IF([JAVA_SPEC_VERSION >= 19],
Expand Down

0 comments on commit e57170e

Please sign in to comment.