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

Extract copy/free arrayCritical code from StandardAccessBarrier #20648

Merged
merged 1 commit into from
Nov 21, 2024

Conversation

LinHu2016
Copy link
Contributor

-Extract copyArrayCritical copyBackArrayCritical, copyStringCritical
and freeStringCritical code from StandardAccessBarrier to
ObjectAccessBarrier(baseclass).

@LinHu2016
Copy link
Contributor Author

@amicic Could you please review the changes? Thanks

J9InternalVMFunctions *functions, void *elems, J9IndexableObject **arrayObject, jint mode)
{
if (JNI_ABORT != mode) {
I_32 sizeInElements = (I_32)indexableObjectModel->getSizeInElements(*arrayObject);
Copy link
Contributor

@amicic amicic Nov 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use int32_t to match the style with other sizeInElements definitions/casts

@@ -109,6 +109,95 @@ MM_ObjectAccessBarrier::tearDown(MM_EnvironmentBase *env)
{
}

void
MM_ObjectAccessBarrier::copyArrayCritical(J9VMThread *vmThread, GC_ArrayObjectModel *indexableObjectModel,
J9InternalVMFunctions *functions, void **data, J9IndexableObject *arrayObject, jboolean *isCopy)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor, i'd probably prefer not passing indexableObjectModel, but rather fetch it from _ext again
@dmitripivkine, opinion?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, let's get it from _ext


void
MM_ObjectAccessBarrier::copyStringCritical(J9VMThread *vmThread, GC_ArrayObjectModel *indexableObjectModel,
J9InternalVMFunctions *functions, jchar **data, J9JavaVM *javaVM,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

like with indexableObjectModel, probably cleaner not to pass javaVM

@@ -408,43 +397,27 @@ MM_StandardAccessBarrier::jniReleasePrimitiveArrayCritical(J9VMThread* vmThread,
{
J9JavaVM *javaVM = vmThread->javaVM;
J9InternalVMFunctions *functions = javaVM->internalVMFunctions;
Copy link
Contributor

@amicic amicic Nov 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this is not used any more here (but only in new helper methods) or in any other get/release method. If so, we should not have it here and then not to pass it, but let the helpers fetch it.

void
MM_ObjectAccessBarrier::copyStringCritical(J9VMThread *vmThread, GC_ArrayObjectModel *indexableObjectModel,
J9InternalVMFunctions *functions, jchar **data, J9JavaVM *javaVM,
J9IndexableObject *valueObject, J9Object *stringObject, jboolean *isCopy, bool isCompressed)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like isCompressed can be removed from parameters and calculated inside this method. I believe it is not used on caller side, so there is no need to get it there. Is it correct?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Standard does not, but seems like VLHGC will

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so, i'd just leave it for now, and when we review VLHGC, we'll decide if we should pass or not

@LinHu2016 LinHu2016 force-pushed the off-heap-incremental7 branch from 9203378 to f106683 Compare November 20, 2024 21:26
@amicic
Copy link
Contributor

amicic commented Nov 20, 2024

jenkins test sanity xLinux,aix jdk11

* @param isCopy[out] if it true, the array is successfully copied.
* @param isCompressed[in] if it is compressed.
*/
void copyStringCritical(J9VMThread *vmThread, jchar **data
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing comma after data

 -Extract copyArrayCritical copyBackArrayCritical, copyStringCritical
  and freeStringCritical code from StandardAccessBarrier to
  ObjectAccessBarrier(baseclass).

Signed-off-by: lhu <[email protected]>
@LinHu2016 LinHu2016 force-pushed the off-heap-incremental7 branch from f106683 to f8423df Compare November 20, 2024 22:50
@amicic
Copy link
Contributor

amicic commented Nov 20, 2024

jenkins test sanity xLinux,aix jdk11

@amicic amicic added the comp:gc label Nov 21, 2024
@amicic
Copy link
Contributor

amicic commented Nov 21, 2024

@keithc-ca @pshipton

sanity.functional fails

22:21:14      [javac] /home/jenkins/workspace/Test_openjdk11_j9_sanity.functional_ppc64_aix_Personal_testList_1/aqa-tests/functional/JLM_Tests/src/org/openj9/test/java/lang/management/TestOpenJ9DiagnosticsMXBean.java:510: error: cannot find symbol
22:21:14      [javac] 		String newDumpOptions = diagBean.getDumpOptions();

I see it recently changed
#20604

@amicic
Copy link
Contributor

amicic commented Nov 21, 2024

Internal Axxon build 82030 passed. Ignoring sanity.functional failure and merging...

@amicic amicic merged commit c4da6bc into eclipse-openj9:master Nov 21, 2024
6 of 9 checks passed
@pshipton
Copy link
Member

I think it's a timing thing. New test material with older JVM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants