Skip to content
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
19 changes: 19 additions & 0 deletions runtime/compiler/p/codegen/J9TreeEvaluator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11902,8 +11902,27 @@ J9::Power::CodeGenerator::inlineDirectCall(TR::Node *node, TR::Register *&result
{
bool disableCASInlining = !cg->getSupportsInlineUnsafeCompareAndSet();
bool disableCAEInlining = !cg->getSupportsInlineUnsafeCompareAndExchange();
static bool disableOSW = feGetEnv("TR_noPauseOnSpinWait") != NULL;
switch (methodSymbol->getRecognizedMethod())
{
case TR::java_lang_Thread_onSpinWait:
{
if (!disableOSW)
{
if (comp->getOption(TR_TraceCG))
{
traceMsg(comp, "Inlining Thread.onSpinWait call node %p as yield instruction.\n", node);
}

/*
* onSpinWait() method calls VM_AtomicSupport::yieldCPU() which is a yield instruction encoded as "or r27, r27, r27".
* Check omr/include_core/AtomicSupport.hpp for the JNI implementation.
*/
generateInstruction(cg, TR::InstOpCode::yield, node);
return true;
}
break;
}
case TR::java_util_concurrent_ConcurrentLinkedQueue_tmOffer:
{
if (cg->getSupportsInlineConcurrentLinkedQueue())
Expand Down