-
Notifications
You must be signed in to change notification settings - Fork 729
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
Update RealtimeAccessBarrier to use common apis for copy arrayCritical #20651
Update RealtimeAccessBarrier to use common apis for copy arrayCritical #20651
Conversation
a347839
to
028341a
Compare
bool shouldCopy = false; | ||
if((javaVM->runtimeFlags & J9_RUNTIME_ALWAYS_COPY_JNI_CRITICAL) == J9_RUNTIME_ALWAYS_COPY_JNI_CRITICAL) { | ||
if ((vmThread->javaVM->runtimeFlags & J9_RUNTIME_ALWAYS_COPY_JNI_CRITICAL) == J9_RUNTIME_ALWAYS_COPY_JNI_CRITICAL) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please put constant first
if (J9_RUNTIME_ALWAYS_COPY_JNI_CRITICAL == ((vmThread->javaVM->runtimeFlags & J9_RUNTIME_ALWAYS_COPY_JNI_CRITICAL))
} | ||
} | ||
vmThread->jniCriticalCopyCount += 1; | ||
arrayObject = (J9IndexableObject *)J9_JNI_UNWRAP_REFERENCE(array); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we have this call already in line 452?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in a general case, object might have moved while not having VM access yet, so we have to re-read the address after acquiring VM access
but in RT, object don't move, so this indeed is unnecessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, thank you for clarification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GC could happens between, we need reload the reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please see Aleks comment above - "in RT, object don't move, so this indeed is unnecessary"
VM_VMAccess::inlineExitVMToJNI(vmThread); | ||
} else { | ||
// acquire access and return a direct pointer | ||
MM_JNICriticalRegion::enterCriticalRegion(vmThread, false); | ||
arrayObject = (J9IndexableObject *)J9_JNI_UNWRAP_REFERENCE(array); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the same, see line 452.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GC could happens between, we need reload the reference.
bool shouldCopy = false; | ||
if((javaVM->runtimeFlags & J9_RUNTIME_ALWAYS_COPY_JNI_CRITICAL) == J9_RUNTIME_ALWAYS_COPY_JNI_CRITICAL) { | ||
if ((vmThread->javaVM->runtimeFlags & J9_RUNTIME_ALWAYS_COPY_JNI_CRITICAL) == J9_RUNTIME_ALWAYS_COPY_JNI_CRITICAL) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const part first please
Assert_MM_invalidJNICall(); | ||
} | ||
|
||
arrayObject = (J9IndexableObject *)J9_JNI_UNWRAP_REFERENCE(array); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicate, see line 481
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same above
dd82ae1
to
9fdac8d
Compare
Jenkins test sanity AIX jdk11 |
9fdac8d
to
f162fb8
Compare
- Update RealtimeAccessBarrier to use opyArrayCritical, copyBackArrayCritical, copyStringCritical and freeStringCritical common functions (in ObjectAccessBarrier baseclass) to replace similar code in class RealtimeAccessBarrier. - output warning message if off-heap is enabled in gcpolicy:metronome. Signed-off-by: lhu <[email protected]>
f162fb8
to
7411dc0
Compare
Jenkins test sanity AIX jdk11 |
depends on : #20648