-
Notifications
You must be signed in to change notification settings - Fork 767
Enable inlineIntrinsicIndexOf for off-heap #21796
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
Conversation
0fd1762
to
0ba0739
Compare
Launched a test build (re-run) for final verification. |
cc: @r30shah, @zl-wang, @dchopra001 |
Marking this ready for review since the failure weren't related to these changes. @dchopra001 Since you worked on most of these APIs, can I please get an initial review? |
de4932e
to
afea548
Compare
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.
LGTM!
if (TR::Compiler->om.isOffHeapAllocationEnabled()) | ||
{ | ||
// Load first data element address | ||
generateRXInstruction(cg, |
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.
Similar comment as I had previously, TR::Register array
is not clobberable register.
@@ -1168,6 +1168,30 @@ J9::Z::TreeEvaluator::inlineVectorizedStringIndexOf(TR::Node* node, TR::CodeGene | |||
TR::Register* patternLenReg = cg->gprClobberEvaluate(node->getChild(firstCallArgIdx+3)); | |||
TR::Register* stringIndexReg = cg->gprClobberEvaluate(node->getChild(firstCallArgIdx+4)); | |||
|
|||
// Offset to be added to array object pointer to get to the data elements | |||
int32_t offsetToDataElements = TR::Compiler->om.contiguousArrayHeaderSizeInBytes(); |
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.
int32_t offsetToDataElements = TR::Compiler->om.contiguousArrayHeaderSizeInBytes(); | |
int32_t offsetToDataElements = static_cast<int32_t>(TR::Compiler->om.contiguousArrayHeaderSizeInBytes()); |
@@ -1880,6 +1904,23 @@ J9::Z::TreeEvaluator::inlineIntrinsicIndexOf(TR::Node * node, TR::CodeGenerator | |||
regDeps->addPostCondition(resultVector, TR::RealRegister::AssignAny); | |||
regDeps->addPostCondition(valueVector, TR::RealRegister::AssignAny); | |||
|
|||
// Offset to be added to array object pointer to get to the data elements | |||
int32_t offsetToDataElements = TR::Compiler->om.contiguousArrayHeaderSizeInBytes(); |
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.
int32_t offsetToDataElements = TR::Compiler->om.contiguousArrayHeaderSizeInBytes(); | |
int32_t offsetToDataElements = static_cast<int32_t>(TR::Compiler->om.contiguousArrayHeaderSizeInBytes()); |
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.
Excellent spot-on by @r30shah . I have no further comments.
afea548
to
758c00c
Compare
@r30shah I have updated the PR based on your suggestions. Can I please get another review? |
#ifdef J9VM_GC_SPARSE_HEAP_ALLOCATION | ||
if (TR::Compiler->om.isOffHeapAllocationEnabled()) | ||
{ | ||
srm = cg->generateScratchRegisterManager(11); |
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.
Why can't we simply clobberEvaluate node->getChild(firstCallArgIdx)
and other one ?
54fbe6f
to
fa786e0
Compare
Jenkins test sanity zlinux jdk11,jdk21 |
Jenkins test sanity zlinux jdk11,jdk21 |
fa786e0
to
bf12070
Compare
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.
LGTM
Jenkins test sanity zlinux jdk11,jdk21 |
The acceleration was initially disabled because it added array header size to the array object, which was required to reach the elements. However, this is unnecessary for off-heap mode. As a result, the evaluator has been updated to add the array header size exclusively for non-off-heap mode, while in off-heap mode, it now retrieves the data element address directly from the array header, enabling acceleration in off-heap mode. Signed-off-by: Shubham Verma <[email protected]>
bf12070
to
d77e768
Compare
The build failure was due to a typo. @r30shah can you please relaunch the tests? |
Jenkins test sanity zlinux jdk11,jdk21 |
The acceleration was initially disabled because it added array header size to the array object, which was required to reach the elements. However, this is unnecessary for off-heap mode. Consequently, the evaluator has been updated to add the array header size exclusively for non-off-heap mode, enabling acceleration in off-heap mode.