From dc7e68708f288d8ef0ad8d1385570074c2dbff6a Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Thu, 12 Mar 2015 10:50:47 -0600 Subject: [PATCH] add JVM_GetResourceLookupCacheURLs This improves support for building with openjdk=$jdk8. Note, however, that the Processes test does not pass, since JDK 8's java.lang.UNIXProcess uses invokedynamic, which Avian does not yet support. --- openjdk.ld | 4 ++-- src/classpath-openjdk.cpp | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/openjdk.ld b/openjdk.ld index 3c17a160b2..915cdde6e2 100644 --- a/openjdk.ld +++ b/openjdk.ld @@ -23,7 +23,7 @@ # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, # CA 95054 USA or visit www.sun.com if you need additional information or # have any questions. -# +# # # Define public interface. @@ -159,6 +159,7 @@ SUNWprivate_1.1 { JVM_GetMethodParameterAnnotations; JVM_GetPrimitiveArrayElement; JVM_GetProtectionDomain; + JVM_GetResourceLookupCacheURLs; JVM_GetSockName; JVM_GetSockOpt; JVM_GetStackAccessControlContext; @@ -291,4 +292,3 @@ SUNWprivate_1.1 { # This is for Forte Analyzer profiling support. AsyncGetCallTrace; }; - diff --git a/src/classpath-openjdk.cpp b/src/classpath-openjdk.cpp index 3a37a74d1c..af48d9f91b 100644 --- a/src/classpath-openjdk.cpp +++ b/src/classpath-openjdk.cpp @@ -441,6 +441,11 @@ class MyClasspath : public Classpath { setObjectClass(t, c, type(t, GcJclass::Type)); c->setName(t, name); c->setVmClass(t, class_); +#ifdef HAVE_JclassClassLoader + if (class_->loader() != roots(t)->bootLoader()) { + c->setClassLoader(t, class_->loader()); + } +#endif return c; } @@ -4564,6 +4569,12 @@ extern "C" AVIAN_EXPORT jobject JNICALL return reinterpret_cast(run(t, jvmGetProtectionDomain, arguments)); } +extern "C" AVIAN_EXPORT jobject JNICALL + EXPORT(JVM_GetResourceLookupCacheURLs)(Thread*, jobject) +{ + return 0; +} + extern "C" AVIAN_EXPORT void JNICALL EXPORT(JVM_SetProtectionDomain)(Thread*, jclass, jobject) {