1553 1554 1555 void GraphKit::pre_barrier(bool do_load, 1556 Node* ctl, 1557 Node* obj, 1558 Node* adr, 1559 uint adr_idx, 1560 Node* val, 1561 const TypeOopPtr* val_type, 1562 Node* pre_val, 1563 BasicType bt) { 1564 1565 BarrierSet* bs = BarrierSet::barrier_set(); 1566 set_control(ctl); 1567 switch (bs->kind()) { 1568 case BarrierSet::G1BarrierSet: 1569 g1_write_barrier_pre(do_load, obj, adr, adr_idx, val, val_type, pre_val, bt); 1570 break; 1571 1572 case BarrierSet::CardTableBarrierSet: 1573 break; 1574 1575 default : 1576 ShouldNotReachHere(); 1577 1578 } 1579 } 1580 1581 bool GraphKit::can_move_pre_barrier() const { 1582 BarrierSet* bs = BarrierSet::barrier_set(); 1583 switch (bs->kind()) { 1584 case BarrierSet::G1BarrierSet: 1585 return true; // Can move it if no safepoint 1586 1587 case BarrierSet::CardTableBarrierSet: 1588 return true; // There is no pre-barrier 1589 1590 default : 1591 ShouldNotReachHere(); 1592 } 1593 return false; 1594 } 1595 1596 void GraphKit::post_barrier(Node* ctl, 1597 Node* store, 1598 Node* obj, 1599 Node* adr, 1600 uint adr_idx, 1601 Node* val, 1602 BasicType bt, 1603 bool use_precise) { 1604 BarrierSet* bs = BarrierSet::barrier_set(); 1605 set_control(ctl); 1606 switch (bs->kind()) { 1607 case BarrierSet::G1BarrierSet: 1608 g1_write_barrier_post(store, obj, adr, adr_idx, val, bt, use_precise); 1609 break; 1610 1611 case BarrierSet::CardTableBarrierSet: 1612 write_barrier_post(store, obj, adr, adr_idx, val, use_precise); 1613 break; 1614 1615 default : 1616 ShouldNotReachHere(); 1617 1618 } 1619 } 1620 1621 Node* GraphKit::store_oop(Node* ctl, 1622 Node* obj, 1623 Node* adr, 1624 const TypePtr* adr_type, 1625 Node* val, 1626 const TypeOopPtr* val_type, 1627 BasicType bt, 1628 bool use_precise, 1629 MemNode::MemOrd mo, 1630 bool mismatched) { 1631 // Transformation of a value which could be NULL pointer (CastPP #NULL) 1632 // could be delayed during Parse (for example, in adjust_map_after_if()). | 1553 1554 1555 void GraphKit::pre_barrier(bool do_load, 1556 Node* ctl, 1557 Node* obj, 1558 Node* adr, 1559 uint adr_idx, 1560 Node* val, 1561 const TypeOopPtr* val_type, 1562 Node* pre_val, 1563 BasicType bt) { 1564 1565 BarrierSet* bs = BarrierSet::barrier_set(); 1566 set_control(ctl); 1567 switch (bs->kind()) { 1568 case BarrierSet::G1BarrierSet: 1569 g1_write_barrier_pre(do_load, obj, adr, adr_idx, val, val_type, pre_val, bt); 1570 break; 1571 1572 case BarrierSet::CardTableBarrierSet: 1573 case BarrierSet::Epsilon: 1574 break; 1575 1576 default : 1577 ShouldNotReachHere(); 1578 1579 } 1580 } 1581 1582 bool GraphKit::can_move_pre_barrier() const { 1583 BarrierSet* bs = BarrierSet::barrier_set(); 1584 switch (bs->kind()) { 1585 case BarrierSet::G1BarrierSet: 1586 return true; // Can move it if no safepoint 1587 1588 case BarrierSet::CardTableBarrierSet: 1589 case BarrierSet::Epsilon: 1590 return true; // There is no pre-barrier 1591 1592 default : 1593 ShouldNotReachHere(); 1594 } 1595 return false; 1596 } 1597 1598 void GraphKit::post_barrier(Node* ctl, 1599 Node* store, 1600 Node* obj, 1601 Node* adr, 1602 uint adr_idx, 1603 Node* val, 1604 BasicType bt, 1605 bool use_precise) { 1606 BarrierSet* bs = BarrierSet::barrier_set(); 1607 set_control(ctl); 1608 switch (bs->kind()) { 1609 case BarrierSet::G1BarrierSet: 1610 g1_write_barrier_post(store, obj, adr, adr_idx, val, bt, use_precise); 1611 break; 1612 1613 case BarrierSet::CardTableBarrierSet: 1614 write_barrier_post(store, obj, adr, adr_idx, val, use_precise); 1615 break; 1616 1617 case BarrierSet::Epsilon: 1618 break; 1619 1620 default : 1621 ShouldNotReachHere(); 1622 1623 } 1624 } 1625 1626 Node* GraphKit::store_oop(Node* ctl, 1627 Node* obj, 1628 Node* adr, 1629 const TypePtr* adr_type, 1630 Node* val, 1631 const TypeOopPtr* val_type, 1632 BasicType bt, 1633 bool use_precise, 1634 MemNode::MemOrd mo, 1635 bool mismatched) { 1636 // Transformation of a value which could be NULL pointer (CastPP #NULL) 1637 // could be delayed during Parse (for example, in adjust_map_after_if()). |