@@ -698,24 +698,22 @@ void G1BarrierSetC2::eliminate_gc_barrier(PhaseIterGVN* igvn, Node* node) const
698698 // There is no G1 pre barrier if previous stored value is NULL
699699 // (for example, after initialization).
700700 if (this_region->is_Region () && this_region->req () == 3 ) {
701- int ind = 1 ;
702- if (!this_region->in (ind)->is_IfFalse ()) {
703- ind = 2 ;
704- }
705- if (this_region->in (ind)->is_IfFalse () &&
706- this_region->in (ind)->in (0 )->Opcode () == Op_If) {
707- Node* bol = this_region->in (ind)->in (0 )->in (1 );
708- assert (bol->is_Bool (), " " );
709- cmpx = bol->in (1 );
710- if (bol->as_Bool ()->_test ._test == BoolTest::ne &&
711- cmpx->is_Cmp () && cmpx->in (2 ) == igvn->intcon (0 ) &&
712- cmpx->in (1 )->is_Load ()) {
713- Node* adr = cmpx->in (1 )->as_Load ()->in (MemNode::Address);
714- const int marking_offset = in_bytes (G1ThreadLocalData::satb_mark_queue_active_offset ());
715- if (adr->is_AddP () && adr->in (AddPNode::Base) == igvn->C ->top () &&
716- adr->in (AddPNode::Address)->Opcode () == Op_ThreadLocal &&
717- adr->in (AddPNode::Offset) == igvn->MakeConX (marking_offset)) {
718- igvn->replace_node (cmpx, igvn->makecon (TypeInt::CC_EQ));
701+ for (int i = 1 ; i < 3 ; ++i) {
702+ if (this_region->in (i)->is_IfFalse () &&
703+ this_region->in (i)->in (0 )->is_If () &&
704+ this_region->in (i)->in (0 )->in (1 )->is_Bool ()) {
705+ Node* bol = this_region->in (i)->in (0 )->in (1 );
706+ cmpx = bol->in (1 );
707+ if (bol->as_Bool ()->_test ._test == BoolTest::ne &&
708+ cmpx->is_Cmp () && cmpx->in (2 ) == igvn->intcon (0 ) &&
709+ cmpx->in (1 )->is_Load ()) {
710+ Node* adr = cmpx->in (1 )->as_Load ()->in (MemNode::Address);
711+ const int marking_offset = in_bytes (G1ThreadLocalData::satb_mark_queue_active_offset ());
712+ if (adr->is_AddP () && adr->in (AddPNode::Base) == igvn->C ->top () &&
713+ adr->in (AddPNode::Address)->Opcode () == Op_ThreadLocal &&
714+ adr->in (AddPNode::Offset) == igvn->MakeConX (marking_offset)) {
715+ igvn->replace_node (cmpx, igvn->makecon (TypeInt::CC_EQ));
716+ }
719717 }
720718 }
721719 }
0 commit comments