comparison src/share/vm/opto/graphKit.cpp @ 12169:29aa8936f03c

8023597: Optimize G1 barriers code for unsafe load_store Summary: Avoid loading old values in G1 pre-barriers for inlined unsafe load_store nodes. Reviewed-by: kvn, tonyp Contributed-by: Martin Doerr <martin.doerr@sap.com>
author kvn
date Wed, 28 Aug 2013 11:22:43 +0200
parents b17d8f6d9ed7
children edb5ab0f3fe5
comparison
equal deleted inserted replaced
12168:7181dd13a6c4 12169:29aa8936f03c
1499 ShouldNotReachHere(); 1499 ShouldNotReachHere();
1500 1500
1501 } 1501 }
1502 } 1502 }
1503 1503
1504 bool GraphKit::can_move_pre_barrier() const {
1505 BarrierSet* bs = Universe::heap()->barrier_set();
1506 switch (bs->kind()) {
1507 case BarrierSet::G1SATBCT:
1508 case BarrierSet::G1SATBCTLogging:
1509 return true; // Can move it if no safepoint
1510
1511 case BarrierSet::CardTableModRef:
1512 case BarrierSet::CardTableExtension:
1513 case BarrierSet::ModRef:
1514 return true; // There is no pre-barrier
1515
1516 case BarrierSet::Other:
1517 default :
1518 ShouldNotReachHere();
1519 }
1520 return false;
1521 }
1522
1504 void GraphKit::post_barrier(Node* ctl, 1523 void GraphKit::post_barrier(Node* ctl,
1505 Node* store, 1524 Node* store,
1506 Node* obj, 1525 Node* obj,
1507 Node* adr, 1526 Node* adr,
1508 uint adr_idx, 1527 uint adr_idx,
3549 assert(pre_val == NULL, "loaded already?"); 3568 assert(pre_val == NULL, "loaded already?");
3550 assert(val_type != NULL, "need a type"); 3569 assert(val_type != NULL, "need a type");
3551 } else { 3570 } else {
3552 // In this case both val_type and alias_idx are unused. 3571 // In this case both val_type and alias_idx are unused.
3553 assert(pre_val != NULL, "must be loaded already"); 3572 assert(pre_val != NULL, "must be loaded already");
3573 // Nothing to be done if pre_val is null.
3574 if (pre_val->bottom_type() == TypePtr::NULL_PTR) return;
3554 assert(pre_val->bottom_type()->basic_type() == T_OBJECT, "or we shouldn't be here"); 3575 assert(pre_val->bottom_type()->basic_type() == T_OBJECT, "or we shouldn't be here");
3555 } 3576 }
3556 assert(bt == T_OBJECT, "or we shouldn't be here"); 3577 assert(bt == T_OBJECT, "or we shouldn't be here");
3557 3578
3558 IdealKit ideal(this, true); 3579 IdealKit ideal(this, true);