< prev index next >

src/hotspot/share/opto/graphKit.cpp

Print this page




1554 void GraphKit::pre_barrier(bool do_load,
1555                            Node* ctl,
1556                            Node* obj,
1557                            Node* adr,
1558                            uint  adr_idx,
1559                            Node* val,
1560                            const TypeOopPtr* val_type,
1561                            Node* pre_val,
1562                            BasicType bt) {
1563 
1564   BarrierSet* bs = BarrierSet::barrier_set();
1565   set_control(ctl);
1566   switch (bs->kind()) {
1567 
1568 #if INCLUDE_G1GC
1569     case BarrierSet::G1BarrierSet:
1570       g1_write_barrier_pre(do_load, obj, adr, adr_idx, val, val_type, pre_val, bt);
1571       break;
1572 #endif
1573 





1574     case BarrierSet::CardTableBarrierSet:
1575       break;
1576 
1577     default      :
1578       ShouldNotReachHere();
1579 
1580   }
1581 }
1582 
1583 bool GraphKit::can_move_pre_barrier() const {
1584   BarrierSet* bs = BarrierSet::barrier_set();
1585   switch (bs->kind()) {
1586 
1587 #if INCLUDE_G1GC
1588     case BarrierSet::G1BarrierSet:
1589       return true; // Can move it if no safepoint
1590 #endif
1591 





1592     case BarrierSet::CardTableBarrierSet:
1593       return true; // There is no pre-barrier
1594 
1595     default      :
1596       ShouldNotReachHere();
1597   }
1598   return false;
1599 }
1600 
1601 void GraphKit::post_barrier(Node* ctl,
1602                             Node* store,
1603                             Node* obj,
1604                             Node* adr,
1605                             uint  adr_idx,
1606                             Node* val,
1607                             BasicType bt,
1608                             bool use_precise) {
1609   BarrierSet* bs = BarrierSet::barrier_set();
1610   set_control(ctl);
1611   switch (bs->kind()) {
1612 #if INCLUDE_G1GC
1613     case BarrierSet::G1BarrierSet:
1614       g1_write_barrier_post(store, obj, adr, adr_idx, val, bt, use_precise);





1615       break;
1616 #endif
1617 
1618     case BarrierSet::CardTableBarrierSet:
1619       write_barrier_post(store, obj, adr, adr_idx, val, use_precise);
1620       break;
1621 
1622     default      :
1623       ShouldNotReachHere();
1624 
1625   }
1626 }
1627 
1628 Node* GraphKit::store_oop(Node* ctl,
1629                           Node* obj,
1630                           Node* adr,
1631                           const TypePtr* adr_type,
1632                           Node* val,
1633                           const TypeOopPtr* val_type,
1634                           BasicType bt,




1554 void GraphKit::pre_barrier(bool do_load,
1555                            Node* ctl,
1556                            Node* obj,
1557                            Node* adr,
1558                            uint  adr_idx,
1559                            Node* val,
1560                            const TypeOopPtr* val_type,
1561                            Node* pre_val,
1562                            BasicType bt) {
1563 
1564   BarrierSet* bs = BarrierSet::barrier_set();
1565   set_control(ctl);
1566   switch (bs->kind()) {
1567 
1568 #if INCLUDE_G1GC
1569     case BarrierSet::G1BarrierSet:
1570       g1_write_barrier_pre(do_load, obj, adr, adr_idx, val, val_type, pre_val, bt);
1571       break;
1572 #endif
1573 
1574 #if INCLUDE_EPSILONGC
1575     case BarrierSet::EpsilonBarrierSet:
1576       break;
1577 #endif
1578 
1579     case BarrierSet::CardTableBarrierSet:
1580       break;
1581 
1582     default      :
1583       ShouldNotReachHere();
1584 
1585   }
1586 }
1587 
1588 bool GraphKit::can_move_pre_barrier() const {
1589   BarrierSet* bs = BarrierSet::barrier_set();
1590   switch (bs->kind()) {
1591 
1592 #if INCLUDE_G1GC
1593     case BarrierSet::G1BarrierSet:
1594       return true; // Can move it if no safepoint
1595 #endif
1596 
1597 #if INCLUDE_EPSILONGC
1598     case BarrierSet::EpsilonBarrierSet:
1599       return true; // There is no pre-barrier
1600 #endif
1601 
1602     case BarrierSet::CardTableBarrierSet:
1603       return true; // There is no pre-barrier
1604 
1605     default      :
1606       ShouldNotReachHere();
1607   }
1608   return false;
1609 }
1610 
1611 void GraphKit::post_barrier(Node* ctl,
1612                             Node* store,
1613                             Node* obj,
1614                             Node* adr,
1615                             uint  adr_idx,
1616                             Node* val,
1617                             BasicType bt,
1618                             bool use_precise) {
1619   BarrierSet* bs = BarrierSet::barrier_set();
1620   set_control(ctl);
1621   switch (bs->kind()) {
1622 #if INCLUDE_G1GC
1623     case BarrierSet::G1BarrierSet:
1624       g1_write_barrier_post(store, obj, adr, adr_idx, val, bt, use_precise);
1625       break;
1626 #endif
1627 
1628 #if INCLUDE_EPSILONGC
1629     case BarrierSet::EpsilonBarrierSet:
1630       break;
1631 #endif
1632 
1633     case BarrierSet::CardTableBarrierSet:
1634       write_barrier_post(store, obj, adr, adr_idx, val, use_precise);
1635       break;
1636 
1637     default      :
1638       ShouldNotReachHere();
1639 
1640   }
1641 }
1642 
1643 Node* GraphKit::store_oop(Node* ctl,
1644                           Node* obj,
1645                           Node* adr,
1646                           const TypePtr* adr_type,
1647                           Node* val,
1648                           const TypeOopPtr* val_type,
1649                           BasicType bt,


< prev index next >