Mercurial > hg > graal-compiler
comparison src/share/vm/opto/escape.cpp @ 6266:1d7922586cf6
7023639: JSR 292 method handle invocation needs a fast path for compiled code
6984705: JSR 292 method handle creation should not go through JNI
Summary: remove assembly code for JDK 7 chained method handles
Reviewed-by: jrose, twisti, kvn, mhaupt
Contributed-by: John Rose <john.r.rose@oracle.com>, Christian Thalinger <christian.thalinger@oracle.com>, Michael Haupt <michael.haupt@oracle.com>
author | twisti |
---|---|
date | Tue, 24 Jul 2012 10:51:00 -0700 |
parents | ed4c92f54c2d |
children | 6c5b7a6becc8 |
comparison
equal
deleted
inserted
replaced
6241:aba91a731143 | 6266:1d7922586cf6 |
---|---|
1766 PointsToNode* ptadr = _nodes.at(n->_idx); | 1766 PointsToNode* ptadr = _nodes.at(n->_idx); |
1767 if (ptadr != NULL) { | 1767 if (ptadr != NULL) { |
1768 assert(ptadr->is_Field() && ptadr->ideal_node() == n, "sanity"); | 1768 assert(ptadr->is_Field() && ptadr->ideal_node() == n, "sanity"); |
1769 return; | 1769 return; |
1770 } | 1770 } |
1771 bool unsafe = false; | |
1772 bool is_oop = is_oop_field(n, offset, &unsafe); | |
1773 if (unsafe) { | |
1774 es = PointsToNode::GlobalEscape; | |
1775 } | |
1771 Compile* C = _compile; | 1776 Compile* C = _compile; |
1772 bool is_oop = is_oop_field(n, offset); | |
1773 FieldNode* field = new (C->comp_arena()) FieldNode(C, n, es, offset, is_oop); | 1777 FieldNode* field = new (C->comp_arena()) FieldNode(C, n, es, offset, is_oop); |
1774 _nodes.at_put(n->_idx, field); | 1778 _nodes.at_put(n->_idx, field); |
1775 } | 1779 } |
1776 | 1780 |
1777 void ConnectionGraph::add_arraycopy(Node *n, PointsToNode::EscapeState es, | 1781 void ConnectionGraph::add_arraycopy(Node *n, PointsToNode::EscapeState es, |
1792 // Add edge from destination object to arraycopy node. | 1796 // Add edge from destination object to arraycopy node. |
1793 (void)add_edge(dst, ptadr); | 1797 (void)add_edge(dst, ptadr); |
1794 dst->set_arraycopy_dst(); | 1798 dst->set_arraycopy_dst(); |
1795 } | 1799 } |
1796 | 1800 |
1797 bool ConnectionGraph::is_oop_field(Node* n, int offset) { | 1801 bool ConnectionGraph::is_oop_field(Node* n, int offset, bool* unsafe) { |
1798 const Type* adr_type = n->as_AddP()->bottom_type(); | 1802 const Type* adr_type = n->as_AddP()->bottom_type(); |
1799 BasicType bt = T_INT; | 1803 BasicType bt = T_INT; |
1800 if (offset == Type::OffsetBot) { | 1804 if (offset == Type::OffsetBot) { |
1801 // Check only oop fields. | 1805 // Check only oop fields. |
1802 if (!adr_type->isa_aryptr() || | 1806 if (!adr_type->isa_aryptr() || |
1811 if (adr_type->isa_instptr()) { | 1815 if (adr_type->isa_instptr()) { |
1812 ciField* field = _compile->alias_type(adr_type->isa_instptr())->field(); | 1816 ciField* field = _compile->alias_type(adr_type->isa_instptr())->field(); |
1813 if (field != NULL) { | 1817 if (field != NULL) { |
1814 bt = field->layout_type(); | 1818 bt = field->layout_type(); |
1815 } else { | 1819 } else { |
1816 // Ignore non field load (for example, klass load) | 1820 // Check for unsafe oop field access |
1821 for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) { | |
1822 int opcode = n->fast_out(i)->Opcode(); | |
1823 if (opcode == Op_StoreP || opcode == Op_LoadP || | |
1824 opcode == Op_StoreN || opcode == Op_LoadN) { | |
1825 bt = T_OBJECT; | |
1826 (*unsafe) = true; | |
1827 break; | |
1828 } | |
1829 } | |
1817 } | 1830 } |
1818 } else if (adr_type->isa_aryptr()) { | 1831 } else if (adr_type->isa_aryptr()) { |
1819 if (offset == arrayOopDesc::length_offset_in_bytes()) { | 1832 if (offset == arrayOopDesc::length_offset_in_bytes()) { |
1820 // Ignore array length load. | 1833 // Ignore array length load. |
1821 } else if (find_second_addp(n, n->in(AddPNode::Base)) != NULL) { | 1834 } else if (find_second_addp(n, n->in(AddPNode::Base)) != NULL) { |
1829 for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) { | 1842 for (DUIterator_Fast imax, i = n->fast_outs(imax); i < imax; i++) { |
1830 int opcode = n->fast_out(i)->Opcode(); | 1843 int opcode = n->fast_out(i)->Opcode(); |
1831 if (opcode == Op_StoreP || opcode == Op_LoadP || | 1844 if (opcode == Op_StoreP || opcode == Op_LoadP || |
1832 opcode == Op_StoreN || opcode == Op_LoadN) { | 1845 opcode == Op_StoreN || opcode == Op_LoadN) { |
1833 bt = T_OBJECT; | 1846 bt = T_OBJECT; |
1847 break; | |
1834 } | 1848 } |
1835 } | 1849 } |
1836 } | 1850 } |
1837 } | 1851 } |
1838 return (bt == T_OBJECT || bt == T_NARROWOOP || bt == T_ARRAY); | 1852 return (bt == T_OBJECT || bt == T_NARROWOOP || bt == T_ARRAY); |