Mercurial > hg > truffle
comparison src/share/vm/opto/parse2.cpp @ 14429:2113136690bc
8024921: PPC64 (part 113): Extend Load and Store nodes to know about memory ordering
Summary: Add a field to C2 LoadNode and StoreNode classes which indicates whether the load/store should do an acquire/release on platforms which support it.
Reviewed-by: kvn
author | goetz |
---|---|
date | Fri, 15 Nov 2013 11:05:32 -0800 |
parents | b2ee5dc63353 |
children | abec000618bf |
comparison
equal
deleted
inserted
replaced
14427:eb178e97560c | 14429:2113136690bc |
---|---|
48 const Type* elem = Type::TOP; | 48 const Type* elem = Type::TOP; |
49 Node* adr = array_addressing(elem_type, 0, &elem); | 49 Node* adr = array_addressing(elem_type, 0, &elem); |
50 if (stopped()) return; // guaranteed null or range check | 50 if (stopped()) return; // guaranteed null or range check |
51 dec_sp(2); // Pop array and index | 51 dec_sp(2); // Pop array and index |
52 const TypeAryPtr* adr_type = TypeAryPtr::get_array_body_type(elem_type); | 52 const TypeAryPtr* adr_type = TypeAryPtr::get_array_body_type(elem_type); |
53 Node* ld = make_load(control(), adr, elem, elem_type, adr_type); | 53 Node* ld = make_load(control(), adr, elem, elem_type, adr_type, MemNode::unordered); |
54 push(ld); | 54 push(ld); |
55 } | 55 } |
56 | 56 |
57 | 57 |
58 //--------------------------------array_store---------------------------------- | 58 //--------------------------------array_store---------------------------------- |
60 Node* adr = array_addressing(elem_type, 1); | 60 Node* adr = array_addressing(elem_type, 1); |
61 if (stopped()) return; // guaranteed null or range check | 61 if (stopped()) return; // guaranteed null or range check |
62 Node* val = pop(); | 62 Node* val = pop(); |
63 dec_sp(2); // Pop array and index | 63 dec_sp(2); // Pop array and index |
64 const TypeAryPtr* adr_type = TypeAryPtr::get_array_body_type(elem_type); | 64 const TypeAryPtr* adr_type = TypeAryPtr::get_array_body_type(elem_type); |
65 store_to_memory(control(), adr, val, elem_type, adr_type); | 65 store_to_memory(control(), adr, val, elem_type, adr_type, StoreNode::release_if_reference(elem_type)); |
66 } | 66 } |
67 | 67 |
68 | 68 |
69 //------------------------------array_addressing------------------------------- | 69 //------------------------------array_addressing------------------------------- |
70 // Pull array and index from the stack. Compute pointer-to-element. | 70 // Pull array and index from the stack. Compute pointer-to-element. |
1718 case Bytecodes::_aaload: array_load(T_OBJECT); break; | 1718 case Bytecodes::_aaload: array_load(T_OBJECT); break; |
1719 case Bytecodes::_laload: { | 1719 case Bytecodes::_laload: { |
1720 a = array_addressing(T_LONG, 0); | 1720 a = array_addressing(T_LONG, 0); |
1721 if (stopped()) return; // guaranteed null or range check | 1721 if (stopped()) return; // guaranteed null or range check |
1722 dec_sp(2); // Pop array and index | 1722 dec_sp(2); // Pop array and index |
1723 push_pair(make_load(control(), a, TypeLong::LONG, T_LONG, TypeAryPtr::LONGS)); | 1723 push_pair(make_load(control(), a, TypeLong::LONG, T_LONG, TypeAryPtr::LONGS, MemNode::unordered)); |
1724 break; | 1724 break; |
1725 } | 1725 } |
1726 case Bytecodes::_daload: { | 1726 case Bytecodes::_daload: { |
1727 a = array_addressing(T_DOUBLE, 0); | 1727 a = array_addressing(T_DOUBLE, 0); |
1728 if (stopped()) return; // guaranteed null or range check | 1728 if (stopped()) return; // guaranteed null or range check |
1729 dec_sp(2); // Pop array and index | 1729 dec_sp(2); // Pop array and index |
1730 push_pair(make_load(control(), a, Type::DOUBLE, T_DOUBLE, TypeAryPtr::DOUBLES)); | 1730 push_pair(make_load(control(), a, Type::DOUBLE, T_DOUBLE, TypeAryPtr::DOUBLES, MemNode::unordered)); |
1731 break; | 1731 break; |
1732 } | 1732 } |
1733 case Bytecodes::_bastore: array_store(T_BYTE); break; | 1733 case Bytecodes::_bastore: array_store(T_BYTE); break; |
1734 case Bytecodes::_castore: array_store(T_CHAR); break; | 1734 case Bytecodes::_castore: array_store(T_CHAR); break; |
1735 case Bytecodes::_iastore: array_store(T_INT); break; | 1735 case Bytecodes::_iastore: array_store(T_INT); break; |
1742 c = pop(); // Oop to store | 1742 c = pop(); // Oop to store |
1743 b = pop(); // index (already used) | 1743 b = pop(); // index (already used) |
1744 a = pop(); // the array itself | 1744 a = pop(); // the array itself |
1745 const TypeOopPtr* elemtype = _gvn.type(a)->is_aryptr()->elem()->make_oopptr(); | 1745 const TypeOopPtr* elemtype = _gvn.type(a)->is_aryptr()->elem()->make_oopptr(); |
1746 const TypeAryPtr* adr_type = TypeAryPtr::OOPS; | 1746 const TypeAryPtr* adr_type = TypeAryPtr::OOPS; |
1747 Node* store = store_oop_to_array(control(), a, d, adr_type, c, elemtype, T_OBJECT); | 1747 Node* store = store_oop_to_array(control(), a, d, adr_type, c, elemtype, T_OBJECT, MemNode::release); |
1748 break; | 1748 break; |
1749 } | 1749 } |
1750 case Bytecodes::_lastore: { | 1750 case Bytecodes::_lastore: { |
1751 a = array_addressing(T_LONG, 2); | 1751 a = array_addressing(T_LONG, 2); |
1752 if (stopped()) return; // guaranteed null or range check | 1752 if (stopped()) return; // guaranteed null or range check |
1753 c = pop_pair(); | 1753 c = pop_pair(); |
1754 dec_sp(2); // Pop array and index | 1754 dec_sp(2); // Pop array and index |
1755 store_to_memory(control(), a, c, T_LONG, TypeAryPtr::LONGS); | 1755 store_to_memory(control(), a, c, T_LONG, TypeAryPtr::LONGS, MemNode::unordered); |
1756 break; | 1756 break; |
1757 } | 1757 } |
1758 case Bytecodes::_dastore: { | 1758 case Bytecodes::_dastore: { |
1759 a = array_addressing(T_DOUBLE, 2); | 1759 a = array_addressing(T_DOUBLE, 2); |
1760 if (stopped()) return; // guaranteed null or range check | 1760 if (stopped()) return; // guaranteed null or range check |
1761 c = pop_pair(); | 1761 c = pop_pair(); |
1762 dec_sp(2); // Pop array and index | 1762 dec_sp(2); // Pop array and index |
1763 c = dstore_rounding(c); | 1763 c = dstore_rounding(c); |
1764 store_to_memory(control(), a, c, T_DOUBLE, TypeAryPtr::DOUBLES); | 1764 store_to_memory(control(), a, c, T_DOUBLE, TypeAryPtr::DOUBLES, MemNode::unordered); |
1765 break; | 1765 break; |
1766 } | 1766 } |
1767 case Bytecodes::_getfield: | 1767 case Bytecodes::_getfield: |
1768 do_getfield(); | 1768 do_getfield(); |
1769 break; | 1769 break; |