-
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
Generate inline class equality test for Class.isAssignableFrom on Z #20801
Generate inline class equality test for Class.isAssignableFrom on Z #20801
Conversation
389b284
to
0e85cb3
Compare
@r30shah please review |
0e85cb3
to
2969a8a
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.
Overall looks good, some minor comments
@@ -4486,6 +4486,12 @@ genInstanceOfOrCheckCastNullTest(TR::Node* node, TR::CodeGenerator* cg, TR::Regi | |||
} | |||
} | |||
|
|||
static void genInlineClassEqualityTest(TR::Node * node, TR::CodeGenerator * cg, TR::Compilation * comp, TR::Register * toClassReg, TR::Register * fromClassReg, TR::LabelSymbol * successLabel) { | |||
cg->generateDebugCounter(TR::DebugCounter::debugCounterName(comp, "checkCastStats/(%s)/Equal", comp->signature()),1,TR::DebugCounter::Undetermined); |
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.
This debug counter name is not suitable for Class.isAssignableFrom. For the equality test, I feel we do not need separate function as it is only generating one instruction.
deps->addPostConditionIfNotAlreadyInserted(toClassReg, TR::RealRegister::AssignAny); | ||
deps->addPostCondition(resultReg, TR::RealRegister::AssignAny); | ||
|
||
generateS390LabelInstruction(cg, TR::InstOpCode::label, node, successLabel, deps); |
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.
Your internal control flow ends at doneLabel, successLabel does not need register dependency condition.
deps->addPostCondition(thisClassReg, TR::RealRegister::AssignAny); | ||
deps->addPostConditionIfNotAlreadyInserted(checkClassReg, TR::RealRegister::AssignAny); | ||
deps->addPostCondition(resultReg, TR::RealRegister::AssignAny); | ||
genInlineClassEqualityTest(node, cg, cg->comp(), toClassReg, fromClassReg, successLabel); |
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.
First instruction from which internal control flow starts is the instruction generated for class equality - make sure that you generate a label instruction before that and mark it as start internal control flow,.
|
||
generateS390LabelInstruction(cg, TR::InstOpCode::label, node, successLabel, deps); | ||
generateRIInstruction(cg, TR::InstOpCode::getLoadHalfWordImmOpCode(), node, resultReg, 1); | ||
|
||
generateS390LabelInstruction(cg, TR::InstOpCode::label, node, doneLabel, deps); |
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.
Your internal control flow ends here. Mark this to end ICF
2969a8a
to
81d885e
Compare
@@ -11818,9 +11817,17 @@ TR::Register *J9::Z::TreeEvaluator::inlineCheckAssignableFromEvaluator(TR::Node | |||
generateS390BranchInstruction(cg, TR::InstOpCode::BRC, TR::InstOpCode::COND_BRC, node, doneLabel); // exit OOL section | |||
outlinedSlowPath->swapInstructionListsWithCompilation(); | |||
|
|||
generateS390LabelInstruction(cg, TR::InstOpCode::label, node, successLabel, deps); |
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.
Register dependency should be attached to the end of internal control flow label. We do not need it here.
adds class equality check as first check; calls C Helper in OOL section on fail Signed-off-by: Matthew Hall <[email protected]>
81d885e
to
cba0a22
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.
Looks good to me, Please share the snippet from Instruction selection log
jenkins test sanity zlinux jdk11,jdk21 |
I am merging this change based on the testing done by @matthewhall2 . |
here you go
|
Adds class equality check as first check; calls C Helper in OOL section on fail.
This change is not yet enabled, but will be enabled once remaining inlined tests are added.
vm-farm this branch (mz,xz), sanity aft comments
https://hyc-runtimes-jenkins.swg-devops.com/view/OpenJ9%20-%20Personal/job/Pipeline-Build-Test-Personal/25470/
The following are tests run on a branch with this change enabled:
vm-farm test branch (mz, xz), sanity aft comments
https://hyc-runtimes-jenkins.swg-devops.com/view/OpenJ9%20-%20Personal/job/Pipeline-Build-Test-Personal/25464/