@@ -13056,28 +13056,29 @@ J9::Z::TreeEvaluator::inlineConcurrentLinkedQueueTMOffer(TR::Node *node, TR::Cod
13056
13056
13057
13057
bool usesCompressedrefs = comp->useCompressedPointers();
13058
13058
int32_t shiftAmount = TR::Compiler->om.compressedReferenceShift();
13059
- static char * disableTMOfferenv = feGetEnv("TR_DisableTMOffer");
13060
- bool disableTMOffer = (disableTMOfferenv != NULL);
13061
-
13059
+ static bool disableTMOffer = feGetEnv("TR_DisableTMOffer") != NULL;
13060
+
13062
13061
classBlock1 = fej9->getClassFromSignature("Ljava/util/concurrent/ConcurrentLinkedQueue$Node;", 49, comp->getCurrentMethod(), true);
13063
13062
classBlock2 = fej9->getClassFromSignature("Ljava/util/concurrent/ConcurrentLinkedQueue;", 44, comp->getCurrentMethod(), true);
13064
13063
13065
-
13066
- if (classBlock1 && classBlock2)
13064
+ bool canInlineTMOffer = !disableTMOffer;
13065
+ if (classBlock1 != NULL && classBlock2 != NULL )
13067
13066
{
13068
13067
offsetNext = fej9->getObjectHeaderSizeInBytes() + fej9->getInstanceFieldOffset(classBlock1, "next", 4, "Ljava/util/concurrent/ConcurrentLinkedQueue$Node;", 49);
13069
13068
offsetTail = fej9->getObjectHeaderSizeInBytes() + fej9->getInstanceFieldOffset(classBlock2, "tail", 4, "Ljava/util/concurrent/ConcurrentLinkedQueue$Node;", 49);
13070
13069
}
13071
13070
else
13072
- disableTMOffer = true;
13071
+ {
13072
+ canInlineTMOffer = false;
13073
+ }
13073
13074
13074
13075
cursor = generateRIInstruction(cg, TR::InstOpCode::LHI, node, rReturn, 1);
13075
13076
13076
- static char * debugTM= feGetEnv("TR_DebugTM");
13077
+ static bool debugTM= feGetEnv("TR_DebugTM") != NULL ;
13077
13078
13078
13079
if (debugTM)
13079
13080
{
13080
- if (disableTMOffer )
13081
+ if (!canInlineTMOffer )
13081
13082
{
13082
13083
printf ("\nTM: disabling TM CLQ.Offer in %s (%s)", comp->signature(), comp->getHotnessName(comp->getMethodHotness()));
13083
13084
fflush(stdout);
@@ -13088,14 +13089,16 @@ J9::Z::TreeEvaluator::inlineConcurrentLinkedQueueTMOffer(TR::Node *node, TR::Cod
13088
13089
fflush(stdout);
13089
13090
}
13090
13091
}
13092
+ static bool generateNonConstrainedTMEnvSeq = feGetEnv("TR_UseNonConstrainedTM") != NULL;
13093
+
13094
+ bool useNonConstrainedTM = generateNonConstrainedTMEnvSeq && comp->target().cpu.supportsFeature(OMR_FEATURE_S390_TRANSACTIONAL_EXECUTION_FACILITY);
13091
13095
13092
- static char * useNonConstrainedTM = feGetEnv("TR_UseNonConstrainedTM");
13093
- static char * disableNIAI = feGetEnv("TR_DisableNIAI");
13096
+ static bool disableNIAI = feGetEnv("TR_DisableNIAI") != NULL;
13094
13097
13095
13098
// the Transaction Diagnostic Block (TDB) is a memory location for the OS to write state info in the event of an abort
13096
13099
TR::MemoryReference* TDBmemRef = generateS390MemoryReference(cg->getMethodMetaDataRealRegister(), fej9->thisThreadGetTDBOffset(), cg);
13097
13100
13098
- if (!disableTMOffer )
13101
+ if (canInlineTMOffer )
13099
13102
{
13100
13103
if (useNonConstrainedTM)
13101
13104
{
@@ -13197,7 +13200,7 @@ J9::Z::TreeEvaluator::inlineConcurrentLinkedQueueTMOffer(TR::Node *node, TR::Cod
13197
13200
cursor = generateSInstruction(cg, TR::InstOpCode::TEND, node, generateS390MemoryReference(cg->machine()->getRealRegister(TR::RealRegister::GPR0),0,cg));
13198
13201
}
13199
13202
13200
- if (useNonConstrainedTM || disableTMOffer )
13203
+ if (useNonConstrainedTM || !canInlineTMOffer )
13201
13204
cursor = generateS390LabelInstruction(cg, TR::InstOpCode::label, node, failLabel, deps);
13202
13205
13203
13206
genWrtBarForTM(node, cg, rP, rN, rReturn, true);
@@ -13248,28 +13251,33 @@ J9::Z::TreeEvaluator::inlineConcurrentLinkedQueueTMPoll(TR::Node *node, TR::Code
13248
13251
deps->addPostCondition(rTmp, TR::RealRegister::AssignAny);
13249
13252
}
13250
13253
13251
- static char * disableTMPollenv = feGetEnv("TR_DisableTMPoll");
13252
- bool disableTMPoll = disableTMPollenv;
13254
+ static bool disableTMPoll = feGetEnv("TR_DisableTMPoll") != NULL;
13253
13255
13254
13256
classBlock1 = fej9->getClassFromSignature("Ljava/util/concurrent/ConcurrentLinkedQueue;", 44, comp->getCurrentMethod(), true);
13255
13257
classBlock2 = fej9->getClassFromSignature("Ljava/util/concurrent/ConcurrentLinkedQueue$Node;", 49, comp->getCurrentMethod(), true);
13256
13258
13257
- if (classBlock1 && classBlock2)
13259
+ bool canInlineTMPoll = !disableTMPoll;
13260
+ if (classBlock1 != NULL && classBlock2 != NULL)
13258
13261
{
13259
13262
offsetHead = fej9->getObjectHeaderSizeInBytes() + fej9->getInstanceFieldOffset(classBlock1, "head", 4, "Ljava/util/concurrent/ConcurrentLinkedQueue$Node;", 49);
13260
13263
offsetNext = fej9->getObjectHeaderSizeInBytes() + fej9->getInstanceFieldOffset(classBlock2, "next", 4, "Ljava/util/concurrent/ConcurrentLinkedQueue$Node;", 49);
13261
13264
offsetItem = fej9->getObjectHeaderSizeInBytes() + fej9->getInstanceFieldOffset(classBlock2, "item", 4, "Ljava/lang/Object;", 18);
13262
13265
}
13263
13266
else
13264
- disableTMPoll = true;
13267
+ {
13268
+ // If we can not get Class object fo ConcurrentLinkedQueue /
13269
+ // ConcurrentLinkedQueue$Node, then we can not inline the intrinsic
13270
+ // operation.
13271
+ canInlineTMPoll = false;
13272
+ }
13265
13273
13266
13274
cursor = generateRRInstruction(cg, TR::InstOpCode::getXORRegOpCode(), node, rE, rE);
13267
13275
13268
- static char * debugTM= feGetEnv("TR_DebugTM");
13276
+ static bool debugTM= feGetEnv("TR_DebugTM") != NULL ;
13269
13277
13270
13278
if (debugTM)
13271
13279
{
13272
- if (disableTMPoll )
13280
+ if (!canInlineTMPoll )
13273
13281
{
13274
13282
printf ("\nTM: disabling TM CLQ.Poll in %s (%s)", comp->signature(), comp->getHotnessName(comp->getMethodHotness()));
13275
13283
fflush(stdout);
@@ -13281,13 +13289,16 @@ J9::Z::TreeEvaluator::inlineConcurrentLinkedQueueTMPoll(TR::Node *node, TR::Code
13281
13289
}
13282
13290
}
13283
13291
13284
- static char * useNonConstrainedTM = feGetEnv("TR_UseNonConstrainedTM");
13285
- static char * disableNIAI = feGetEnv("TR_DisableNIAI");
13292
+ static bool generateNonConstrainedTMEnvSeq = feGetEnv("TR_UseNonConstrainedTM") != NULL;
13293
+
13294
+ bool useNonConstrainedTM = generateNonConstrainedTMEnvSeq && comp->target().cpu.supportsFeature(OMR_FEATURE_S390_TRANSACTIONAL_EXECUTION_FACILITY);
13295
+
13296
+ static bool disableNIAI = feGetEnv("TR_DisableNIAI") != NULL;
13286
13297
13287
13298
// the Transaction Diagnostic Block (TDB) is a memory location for the OS to write state info in the event of an abort
13288
13299
TR::MemoryReference* TDBmemRef = generateS390MemoryReference(cg->getMethodMetaDataRealRegister(), fej9->thisThreadGetTDBOffset(), cg);
13289
13300
13290
- if (!disableTMPoll )
13301
+ if (canInlineTMPoll )
13291
13302
{
13292
13303
if (useNonConstrainedTM)
13293
13304
{
@@ -13379,7 +13390,7 @@ J9::Z::TreeEvaluator::inlineConcurrentLinkedQueueTMPoll(TR::Node *node, TR::Code
13379
13390
cursor = generateSInstruction(cg, TR::InstOpCode::TEND, node, generateS390MemoryReference(cg->machine()->getRealRegister(TR::RealRegister::GPR0),0,cg));
13380
13391
}
13381
13392
13382
- if (useNonConstrainedTM || disableTMPoll )
13393
+ if (useNonConstrainedTM || !canInlineTMPoll )
13383
13394
cursor = generateS390LabelInstruction(cg, TR::InstOpCode::label, node, failLabel, deps);
13384
13395
13385
13396
if (usesCompressedrefs)
0 commit comments