[vmkit-commits] [PATCH] NYI-out things not yet in the OpenJDK port

Nicolas Geoffray nicolas.geoffray at gmail.com
Tue Oct 25 10:30:51 PDT 2011


Actually, I'm not really fond of macros spread over the code. What I would
do is create two files, one for the OpenJDK implementation and one for
Classpath. They would contain the implementation specific methods. Ideally:

lib/J3/ClassLib/Classpath/Jni.cpp
lib/J3/ClassLib/OpenJDK/Jni.cpp

Or else:
lib/J3/VMCore/JniOpenJDK.inc
lib/J3/VMCore/JniClasspath.inc

And at the end of Jni.cpp do:
#ifdef USE_OPENJDK
#include "JniOpenJDK.inc"
#else
#include "JniClasspath.inc"
#endif

Would that make sense? You can take the approach that suits you best.

Nicolas

On Tue, Oct 25, 2011 at 12:39 AM, Will Dietz <wdietz2 at illinois.edu> wrote:

> Inlined below.
>
> ~Will
>
> diff --git a/lib/J3/VMCore/Jni.cpp b/lib/J3/VMCore/Jni.cpp
> index 82d2719..48569d8 100644
> --- a/lib/J3/VMCore/Jni.cpp
> +++ b/lib/J3/VMCore/Jni.cpp
> @@ -4036,6 +4036,11 @@ jboolean ExceptionCheck(JNIEnv *env) {
>
>  jobject NewDirectByteBuffer(JNIEnv *env, void *address, jlong capacity) {
>
> +#ifdef USE_OPENJDK
> +  NYI();
> +  abort();
> +  return NULL;
> +#else
>   BEGIN_JNI_EXCEPTION
>
>   JavaObject* res = 0;
> @@ -4065,15 +4070,20 @@ jobject NewDirectByteBuffer(JNIEnv *env, void
> *address, jlong capacity) {
>
>   jobject ret = (jobject)th->pushJNIRef(res);
>   RETURN_FROM_JNI(ret);
> -
>   END_JNI_EXCEPTION
>
>   RETURN_FROM_JNI(0);
> +#endif
>  }
>
>
>  void *GetDirectBufferAddress(JNIEnv *env, jobject _buf) {
>
> +#ifdef USE_OPENJDK
> +  NYI();
> +  abort();
> +  return NULL;
> +#else
>   BEGIN_JNI_EXCEPTION
>
>   // Local object references.
> @@ -4097,6 +4107,7 @@ void *GetDirectBufferAddress(JNIEnv *env, jobject
> _buf) {
>
>   END_JNI_EXCEPTION
>   RETURN_FROM_JNI(0);
> +#endif
>  }
>
>
> --
> 1.7.5.1
> _______________________________________________
> vmkit-commits mailing list
> vmkit-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/vmkit-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/vmkit-commits/attachments/20111025/78e84b50/attachment.html>


More information about the vmkit-commits mailing list