src/share/vm/opto/graphKit.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/opto

src/share/vm/opto/graphKit.cpp

Print this page


   1 /*
   2  * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


1501   if (mem->req() > MemNode::Address && adr == mem->in(MemNode::Address))
1502     record_for_igvn(st);
1503 
1504   return st;
1505 }
1506 
1507 
1508 void GraphKit::pre_barrier(bool do_load,
1509                            Node* ctl,
1510                            Node* obj,
1511                            Node* adr,
1512                            uint  adr_idx,
1513                            Node* val,
1514                            const TypeOopPtr* val_type,
1515                            Node* pre_val,
1516                            BasicType bt) {
1517 
1518   BarrierSet* bs = Universe::heap()->barrier_set();
1519   set_control(ctl);
1520   switch (bs->kind()) {
1521     case BarrierSet::G1SATBCT:
1522     case BarrierSet::G1SATBCTLogging:
1523       g1_write_barrier_pre(do_load, obj, adr, adr_idx, val, val_type, pre_val, bt);
1524       break;
1525 
1526     case BarrierSet::CardTableModRef:
1527     case BarrierSet::CardTableExtension:
1528     case BarrierSet::ModRef:
1529       break;
1530 
1531     default      :
1532       ShouldNotReachHere();
1533 
1534   }
1535 }
1536 
1537 bool GraphKit::can_move_pre_barrier() const {
1538   BarrierSet* bs = Universe::heap()->barrier_set();
1539   switch (bs->kind()) {
1540     case BarrierSet::G1SATBCT:
1541     case BarrierSet::G1SATBCTLogging:
1542       return true; // Can move it if no safepoint
1543 
1544     case BarrierSet::CardTableModRef:
1545     case BarrierSet::CardTableExtension:
1546     case BarrierSet::ModRef:
1547       return true; // There is no pre-barrier
1548 
1549     default      :
1550       ShouldNotReachHere();
1551   }
1552   return false;
1553 }
1554 
1555 void GraphKit::post_barrier(Node* ctl,
1556                             Node* store,
1557                             Node* obj,
1558                             Node* adr,
1559                             uint  adr_idx,
1560                             Node* val,
1561                             BasicType bt,
1562                             bool use_precise) {
1563   BarrierSet* bs = Universe::heap()->barrier_set();
1564   set_control(ctl);
1565   switch (bs->kind()) {
1566     case BarrierSet::G1SATBCT:
1567     case BarrierSet::G1SATBCTLogging:
1568       g1_write_barrier_post(store, obj, adr, adr_idx, val, bt, use_precise);
1569       break;
1570 
1571     case BarrierSet::CardTableModRef:
1572     case BarrierSet::CardTableExtension:
1573       write_barrier_post(store, obj, adr, adr_idx, val, use_precise);
1574       break;
1575 
1576     case BarrierSet::ModRef:
1577       break;
1578 
1579     default      :
1580       ShouldNotReachHere();
1581 
1582   }
1583 }
1584 
1585 Node* GraphKit::store_oop(Node* ctl,
1586                           Node* obj,


   1 /*
   2  * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


1501   if (mem->req() > MemNode::Address && adr == mem->in(MemNode::Address))
1502     record_for_igvn(st);
1503 
1504   return st;
1505 }
1506 
1507 
1508 void GraphKit::pre_barrier(bool do_load,
1509                            Node* ctl,
1510                            Node* obj,
1511                            Node* adr,
1512                            uint  adr_idx,
1513                            Node* val,
1514                            const TypeOopPtr* val_type,
1515                            Node* pre_val,
1516                            BasicType bt) {
1517 
1518   BarrierSet* bs = Universe::heap()->barrier_set();
1519   set_control(ctl);
1520   switch (bs->kind()) {

1521     case BarrierSet::G1SATBCTLogging:
1522       g1_write_barrier_pre(do_load, obj, adr, adr_idx, val, val_type, pre_val, bt);
1523       break;
1524 
1525     case BarrierSet::CardTableModRef:
1526     case BarrierSet::CardTableExtension:
1527     case BarrierSet::ModRef:
1528       break;
1529 
1530     default      :
1531       ShouldNotReachHere();
1532 
1533   }
1534 }
1535 
1536 bool GraphKit::can_move_pre_barrier() const {
1537   BarrierSet* bs = Universe::heap()->barrier_set();
1538   switch (bs->kind()) {

1539     case BarrierSet::G1SATBCTLogging:
1540       return true; // Can move it if no safepoint
1541 
1542     case BarrierSet::CardTableModRef:
1543     case BarrierSet::CardTableExtension:
1544     case BarrierSet::ModRef:
1545       return true; // There is no pre-barrier
1546 
1547     default      :
1548       ShouldNotReachHere();
1549   }
1550   return false;
1551 }
1552 
1553 void GraphKit::post_barrier(Node* ctl,
1554                             Node* store,
1555                             Node* obj,
1556                             Node* adr,
1557                             uint  adr_idx,
1558                             Node* val,
1559                             BasicType bt,
1560                             bool use_precise) {
1561   BarrierSet* bs = Universe::heap()->barrier_set();
1562   set_control(ctl);
1563   switch (bs->kind()) {

1564     case BarrierSet::G1SATBCTLogging:
1565       g1_write_barrier_post(store, obj, adr, adr_idx, val, bt, use_precise);
1566       break;
1567 
1568     case BarrierSet::CardTableModRef:
1569     case BarrierSet::CardTableExtension:
1570       write_barrier_post(store, obj, adr, adr_idx, val, use_precise);
1571       break;
1572 
1573     case BarrierSet::ModRef:
1574       break;
1575 
1576     default      :
1577       ShouldNotReachHere();
1578 
1579   }
1580 }
1581 
1582 Node* GraphKit::store_oop(Node* ctl,
1583                           Node* obj,


src/share/vm/opto/graphKit.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File