Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FFI/Jtreg_JDK22] Change the value of the heap address identifier #19002

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public class InternalDowncallHandler {
/* The identifier denotes the passed-in argument is a heap segment which helps
* extract the address from the heap argument's base object in native.
*/
private static final long DOWNCALL_HEAP_ARGUMENT_ID = 0x1;
private static final long DOWNCALL_HEAP_ARGUMENT_ID = 0xFFFFFFFFFFFFFFFFL;

/* The ThreadLocal holds the information of the heap argument which includes
* the base object array, the offset array plus the current heap argument index
Expand Down
2 changes: 1 addition & 1 deletion runtime/oti/j9nonbuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -6064,7 +6064,7 @@ typedef struct J9JavaVM {

#if JAVA_SPEC_VERSION >= 16
#if JAVA_SPEC_VERSION >= 22
#define J9_FFI_DOWNCALL_HEAP_ARGUMENT_ID 0x1
#define J9_FFI_DOWNCALL_HEAP_ARGUMENT_ID J9CONST_U64(0xFFFFFFFFFFFFFFFF)
#endif /* JAVA_SPEC_VERSION >= 22 */

/* The mask for the signature type identifier */
Expand Down
2 changes: 1 addition & 1 deletion runtime/vm/BytecodeInterpreter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5288,7 +5288,7 @@ class INTERPRETER_CLASS
/* ffi_call expects the address of the pointer is the address of the stackslot. */
pointerValues[i] = (U_64)ffiArgs[i];
#if JAVA_SPEC_VERSION >= 22
if ((U_64)J9_FFI_DOWNCALL_HEAP_ARGUMENT_ID == pointerValues[i]) {
if (J9_FFI_DOWNCALL_HEAP_ARGUMENT_ID == pointerValues[i]) {
j9object_t heapBase = (j9object_t)J9JAVAARRAYOFOBJECT_LOAD(
_currentThread,
J9_JNI_UNWRAP_REFERENCE(_sp + 11), /* The heap base array. */
Expand Down