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

Guard a call to VMwrtbarWithoutStoreEvaluator #18027

Merged
Merged
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
23 changes: 18 additions & 5 deletions runtime/compiler/x/codegen/J9TreeEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9703,11 +9703,24 @@ static TR::Register* inlineCompareAndSwapObjectNative(TR::Node* node, TR::CodeGe
generateRegInstruction(TR::InstOpCode::SETE1Reg, node, result, cg);
generateRegRegInstruction(TR::InstOpCode::MOVZXReg4Reg1, node, result, result, cg);

// We could insert a runtime test for whether the write actually succeeded or not.
// However, since in practice it will almost always succeed we do not want to
// penalize general runtime performance especially if it is still correct to do
// a write barrier even if the store never actually happened.
TR::TreeEvaluator::VMwrtbarWithoutStoreEvaluator(node, objectNode, newValueNode, NULL, cg->generateScratchRegisterManager(), cg);
// Non-realtime: Generate a write barrier for this kind of object.
//
if (!comp->getOptions()->realTimeGC())
{
// We could insert a runtime test for whether the write actually succeeded or not.
// However, since in practice it will almost always succeed we do not want to
// penalize general runtime performance especially if it is still correct to do
// a write barrier even if the store never actually happened.
TR_X86ScratchRegisterManager *scratchRegisterManager = cg->generateScratchRegisterManager();

TR::TreeEvaluator::VMwrtbarWithoutStoreEvaluator(
node,
objectNode,
newValueNode,
NULL,
scratchRegisterManager,
cg);
}

cg->stopUsingRegister(tmp);
cg->stopUsingRegister(EAX);
Expand Down