1689 if (access.is_raw()) {
1690 return _barrier_set->BarrierSetC2::atomic_add_at(access, new_val, value_type);
1691 } else {
1692 return _barrier_set->atomic_add_at(access, new_val, value_type);
1693 }
1694 }
1695
1696 void GraphKit::access_clone(Node* ctl, Node* src, Node* dst, Node* size, bool is_array) {
1697 set_control(ctl);
1698 return _barrier_set->clone(this, src, dst, size, is_array);
1699 }
1700
1701 Node* GraphKit::access_resolve(Node* n, DecoratorSet decorators) {
1702 // Use stronger ACCESS_WRITE|ACCESS_READ by default.
1703 if ((decorators & (ACCESS_READ | ACCESS_WRITE)) == 0) {
1704 decorators |= ACCESS_READ | ACCESS_WRITE;
1705 }
1706 return _barrier_set->resolve(this, n, decorators);
1707 }
1708
1709 //-------------------------array_element_address-------------------------
1710 Node* GraphKit::array_element_address(Node* ary, Node* idx, BasicType elembt,
1711 const TypeInt* sizetype, Node* ctrl) {
1712 uint shift = exact_log2(type2aelembytes(elembt));
1713 uint header = arrayOopDesc::base_offset_in_bytes(elembt);
1714
1715 // short-circuit a common case (saves lots of confusing waste motion)
1716 jint idx_con = find_int_con(idx, -1);
1717 if (idx_con >= 0) {
1718 intptr_t offset = header + ((intptr_t)idx_con << shift);
1719 return basic_plus_adr(ary, offset);
1720 }
1721
1722 // must be correct type for alignment purposes
1723 Node* base = basic_plus_adr(ary, header);
1724 idx = Compile::conv_I2X_index(&_gvn, idx, sizetype, ctrl);
1725 Node* scale = _gvn.transform( new LShiftXNode(idx, intcon(shift)) );
1726 return basic_plus_adr(ary, base, scale);
1727 }
1728
|
1689 if (access.is_raw()) {
1690 return _barrier_set->BarrierSetC2::atomic_add_at(access, new_val, value_type);
1691 } else {
1692 return _barrier_set->atomic_add_at(access, new_val, value_type);
1693 }
1694 }
1695
1696 void GraphKit::access_clone(Node* ctl, Node* src, Node* dst, Node* size, bool is_array) {
1697 set_control(ctl);
1698 return _barrier_set->clone(this, src, dst, size, is_array);
1699 }
1700
1701 Node* GraphKit::access_resolve(Node* n, DecoratorSet decorators) {
1702 // Use stronger ACCESS_WRITE|ACCESS_READ by default.
1703 if ((decorators & (ACCESS_READ | ACCESS_WRITE)) == 0) {
1704 decorators |= ACCESS_READ | ACCESS_WRITE;
1705 }
1706 return _barrier_set->resolve(this, n, decorators);
1707 }
1708
1709 void GraphKit::access_resolve_for_obj_equals(Node*& a, Node*& b) {
1710 return _barrier_set->resolve_for_obj_equals(this, a, b);
1711 }
1712
1713 //-------------------------array_element_address-------------------------
1714 Node* GraphKit::array_element_address(Node* ary, Node* idx, BasicType elembt,
1715 const TypeInt* sizetype, Node* ctrl) {
1716 uint shift = exact_log2(type2aelembytes(elembt));
1717 uint header = arrayOopDesc::base_offset_in_bytes(elembt);
1718
1719 // short-circuit a common case (saves lots of confusing waste motion)
1720 jint idx_con = find_int_con(idx, -1);
1721 if (idx_con >= 0) {
1722 intptr_t offset = header + ((intptr_t)idx_con << shift);
1723 return basic_plus_adr(ary, offset);
1724 }
1725
1726 // must be correct type for alignment purposes
1727 Node* base = basic_plus_adr(ary, header);
1728 idx = Compile::conv_I2X_index(&_gvn, idx, sizetype, ctrl);
1729 Node* scale = _gvn.transform( new LShiftXNode(idx, intcon(shift)) );
1730 return basic_plus_adr(ary, base, scale);
1731 }
1732
|