< prev index next >

src/hotspot/share/gc/g1/c2/g1BarrierSetC2.cpp

Print this page
@@ -206,11 +206,11 @@
      assert(pre_val != NULL, "must be loaded already");
      // Nothing to be done if pre_val is null.
      if (pre_val->bottom_type() == TypePtr::NULL_PTR) return;
      assert(pre_val->bottom_type()->basic_type() == T_OBJECT, "or we shouldn't be here");
    }
-   assert(bt == T_OBJECT, "or we shouldn't be here");
+   assert(bt == T_OBJECT || bt == T_INLINE_TYPE, "or we shouldn't be here");
  
    IdealKit ideal(kit, true);
  
    Node* tls = __ thread(); // ThreadLocalStorage
  

@@ -662,11 +662,11 @@
    }
  
    return strcmp(call->_name, "write_ref_field_pre_entry") == 0 || strcmp(call->_name, "write_ref_field_post_entry") == 0;
  }
  
- void G1BarrierSetC2::eliminate_gc_barrier(PhaseMacroExpand* macro, Node* node) const {
+ void G1BarrierSetC2::eliminate_gc_barrier(PhaseIterGVN* igvn, Node* node) const {
    assert(node->Opcode() == Op_CastP2X, "ConvP2XNode required");
    assert(node->outcnt() <= 2, "expects 1 or 2 users: Xor and URShift nodes");
    // It could be only one user, URShift node, in Object.clone() intrinsic
    // but the new allocation is passed to arraycopy stub and it could not
    // be scalar replaced. So we don't check the case.

@@ -690,36 +690,34 @@
      Node* shift = xorx->unique_out();
      Node* cmpx = shift->unique_out();
      assert(cmpx->is_Cmp() && cmpx->unique_out()->is_Bool() &&
      cmpx->unique_out()->as_Bool()->_test._test == BoolTest::ne,
      "missing region check in G1 post barrier");
-     macro->replace_node(cmpx, macro->makecon(TypeInt::CC_EQ));
+     igvn->replace_node(cmpx, igvn->makecon(TypeInt::CC_EQ));
  
      // Remove G1 pre barrier.
  
      // Search "if (marking != 0)" check and set it to "false".
      // There is no G1 pre barrier if previous stored value is NULL
      // (for example, after initialization).
      if (this_region->is_Region() && this_region->req() == 3) {
-       int ind = 1;
-       if (!this_region->in(ind)->is_IfFalse()) {
-         ind = 2;
-       }
-       if (this_region->in(ind)->is_IfFalse() &&
-           this_region->in(ind)->in(0)->Opcode() == Op_If) {
-         Node* bol = this_region->in(ind)->in(0)->in(1);
-         assert(bol->is_Bool(), "");
-         cmpx = bol->in(1);
-         if (bol->as_Bool()->_test._test == BoolTest::ne &&
-             cmpx->is_Cmp() && cmpx->in(2) == macro->intcon(0) &&
-             cmpx->in(1)->is_Load()) {
-           Node* adr = cmpx->in(1)->as_Load()->in(MemNode::Address);
-           const int marking_offset = in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset());
-           if (adr->is_AddP() && adr->in(AddPNode::Base) == macro->top() &&
-               adr->in(AddPNode::Address)->Opcode() == Op_ThreadLocal &&
-               adr->in(AddPNode::Offset) == macro->MakeConX(marking_offset)) {
-             macro->replace_node(cmpx, macro->makecon(TypeInt::CC_EQ));
+       for (int i = 1; i < 3; ++i) {
+         if (this_region->in(i)->is_IfFalse() &&
+             this_region->in(i)->in(0)->is_If() &&
+             this_region->in(i)->in(0)->in(1)->is_Bool()) {
+           Node* bol = this_region->in(i)->in(0)->in(1);
+           cmpx = bol->in(1);
+           if (bol->as_Bool()->_test._test == BoolTest::ne &&
+               cmpx->is_Cmp() && cmpx->in(2) == igvn->intcon(0) &&
+               cmpx->in(1)->is_Load()) {
+             Node* adr = cmpx->in(1)->as_Load()->in(MemNode::Address);
+             const int marking_offset = in_bytes(G1ThreadLocalData::satb_mark_queue_active_offset());
+             if (adr->is_AddP() && adr->in(AddPNode::Base) == igvn->C->top() &&
+                 adr->in(AddPNode::Address)->Opcode() == Op_ThreadLocal &&
+                 adr->in(AddPNode::Offset) == igvn->MakeConX(marking_offset)) {
+               igvn->replace_node(cmpx, igvn->makecon(TypeInt::CC_EQ));
+             }
            }
          }
        }
      }
    } else {

@@ -734,17 +732,17 @@
      assert(load != NULL, "missing G1 post barrier");
      Node* cmpx = load->unique_out();
      assert(cmpx->is_Cmp() && cmpx->unique_out()->is_Bool() &&
             cmpx->unique_out()->as_Bool()->_test._test == BoolTest::ne,
             "missing card value check in G1 post barrier");
-     macro->replace_node(cmpx, macro->makecon(TypeInt::CC_EQ));
+     igvn->replace_node(cmpx, igvn->makecon(TypeInt::CC_EQ));
      // There is no G1 pre barrier in this case
    }
    // Now CastP2X can be removed since it is used only on dead path
    // which currently still alive until igvn optimize it.
    assert(node->outcnt() == 0 || node->unique_out()->Opcode() == Op_URShiftX, "");
-   macro->replace_node(node, macro->top());
+   igvn->replace_node(node, igvn->C->top());
  }
  
  Node* G1BarrierSetC2::step_over_gc_barrier(Node* c) const {
    if (!use_ReduceInitialCardMarks() &&
        c != NULL && c->is_Region() && c->req() == 3) {
< prev index next >