@@ -306,6 +306,16 @@ void J9::RecognizedCallTransformer::process_java_lang_StringLatin1_inflate_BIBII
306
306
307
307
TR_ASSERT_FATAL (comp ()->cg ()->getSupportsArrayTranslateTROTNoBreak (), " Support for arraytranslateTROTNoBreak is required" );
308
308
309
+ // Anchor a copy of the call node just before treetop so that all of the
310
+ // children will be commoned across the split point, and all of the temps
311
+ // will be initialized before the first opportunity to go to the fallback
312
+ // path. Otherwise, the fallback path could end up using temps that are
313
+ // sometimes uninitialized. This copy will be removed just after splitting.
314
+ TR::TreeTop *callCopyTT = TR::TreeTop::create (
315
+ comp (), TR::Node::create (node, TR::treetop, 1 , node->duplicateTree (false )));
316
+
317
+ treetop->insertBefore (callCopyTT);
318
+
309
319
bool is64BitTarget = comp ()->target ().is64Bit ();
310
320
311
321
TR::Node *srcObj = node->getChild (0 );
@@ -377,6 +387,8 @@ void J9::RecognizedCallTransformer::process_java_lang_StringLatin1_inflate_BIBII
377
387
TR::Block *fallbackPathBlock = fallThroughPathBlock->split (treetop, cfg, true /* fixUpCommoning */ , true /* copyExceptionSuccessors */ );
378
388
TR::Block *tailBlock = fallbackPathBlock->split (treetop->getNextTreeTop (), cfg, true /* fixUpCommoning */ , true /* copyExceptionSuccessors */ );
379
389
390
+ TR::TransformUtil::removeTree (comp (), callCopyTT);
391
+
380
392
// Go to the tail block from the fall-through block
381
393
TR::Node *gotoNode = TR::Node::create (node, TR::Goto);
382
394
TR::TreeTop *gotoTree = TR::TreeTop::create (comp (), gotoNode, NULL , NULL );
0 commit comments