Add implementation for isValueObject()#23625
Conversation
9dbb98c to
44c2204
Compare
|
|
||
| #if defined(J9VM_OPT_VALHALLA_VALUE_TYPES) | ||
| static jboolean JNICALL | ||
| isValueObject(JNIEnv *env, jobject obj) |
There was a problem hiding this comment.
I see that new methods are also added to runtime/j9vm31/jnicsup.cpp.
44c2204 to
c6274cc
Compare
| ifelse(eval(JAVA_SPEC_VERSION >= 9), 1, ` jobject (JNICALL * GetModule)(JNIEnv *env, jclass clazz);', `dnl') | ||
| ifelse(eval(JAVA_SPEC_VERSION >= 19), 1, ` jboolean (JNICALL * IsVirtualThread)(JNIEnv *env, jobject obj);', `dnl') | ||
| ifelse(eval(JAVA_SPEC_VERSION >= 24), 1, ` jlong (JNICALL *GetStringUTFLengthAsLong)(JNIEnv *env, jstring string);', `dnl') | ||
| #if defined(J9VM_OPT_VALHALLA_VALUE_TYPES) |
There was a problem hiding this comment.
I wonder if these c preprocessor directives will work in an m4 file.
There was a problem hiding this comment.
m4 will ignore this and this line will appear verbatim in the jdk; it's not likely that users will define J9VM_OPT_VALHALLA_VALUE_TYPES and so this will have no effect. It must be rewritten to use JAVA_SPEC_VERSION or a new name which would need to be added to the m4 command line.
There was a problem hiding this comment.
I expect this to be changed to a JAVA_SPEC_VERSION check once Valhalla is released.
There was a problem hiding this comment.
In the meantime, we get the following in jni.h:
jboolean (JNICALL * IsVirtualThread)(JNIEnv *env, jobject obj);
jlong (JNICALL *GetStringUTFLengthAsLong)(JNIEnv *env, jstring string);
#if defined(J9VM_OPT_VALHALLA_VALUE_TYPES)
jboolean (JNICALL *IsValueObject)(JNIEnv *env, jobject obj);
#endif /* defined(J9VM_OPT_VALHALLA_VALUE_TYPES) */
};This will not work for the tests renabled in adoptium/aqa-tests#6995.
There was a problem hiding this comment.
A minor nit: The new function pointer should be indented like other fields.
There was a problem hiding this comment.
@AditiS11 @hangshao0 What is being done about this?
There was a problem hiding this comment.
I thought of adding a new name to the m4 command line. I am still looking into it.
c6274cc to
8897ec4
Compare
Add implementation for isValueObject(). Returns true if the object class is a valuetype. Signed-off-by: Aditi Srinivas M <Aditi.Srini@ibm.com>
8897ec4 to
2994112
Compare
|
Jenkins test sanity.functional,extended alinuxval jdknext |
|
@AditiS11 please also open a pull request to enable TestJNIIsValueObject. |
Add J9VM_OPT_VALHALLA_VALUE_TYPES to m4 command line so that IsValueObject() can be declared for valhalla build. Related: eclipse-openj9#23625 Signed-off-by: Aditi Srinivas M <Aditi.Srini@ibm.com>
Add J9VM_OPT_VALHALLA_VALUE_TYPES to m4 command line so that IsValueObject() can be declared conditionally for valhalla build. Related: eclipse-openj9#23625 Signed-off-by: Aditi Srinivas M <Aditi.Srini@ibm.com>
Add J9VM_OPT_VALHALLA_VALUE_TYPES to m4 command line so that IsValueObject() can be declared conditionally for valhalla build. Related: eclipse-openj9#23625 Signed-off-by: Aditi Srinivas M <Aditi.Srini@ibm.com>
Enable runtime/valhalla/inlinetypes/TestJNIIsValueObject.java Fixed by: eclipse-openj9/openj9#23625
Add J9VM_OPT_VALHALLA_VALUE_TYPES to m4 command line so that IsValueObject() can be declared conditionally for valhalla build. Remove incorrect env parameter from IsVirtualThread() and GetStringUTFLengthAsLong(). Related: eclipse-openj9#23625 Signed-off-by: Aditi Srinivas M <Aditi.Srini@ibm.com>
Add J9VM_OPT_VALHALLA_VALUE_TYPES to m4 command line so that IsValueObject() can be declared conditionally for valhalla build. Remove incorrect env parameter from IsVirtualThread() and GetStringUTFLengthAsLong(). Related: eclipse-openj9#23625 Signed-off-by: Aditi Srinivas M <Aditi.Srini@ibm.com>
Scc uses the wrong class version for migrated value classes. Related: eclipse-openj9/openj9#23625 Signed-off-by: Aditi Srinivas M <Aditi.Srini@ibm.com>
Enable runtime/valhalla/inlinetypes/TestJNIIsValueObject.java Fixed by: eclipse-openj9/openj9#23625 Co-authored-by: Aditi Srinivas M <Aditi.Srini@ibm.com>
Add implementation for isValueObject().
Returns true if the object class is a valuetype.
Required for
runtime/valhalla/inlinetypes/TestJNIIsValueObject.java.