Mercurial > hg > graal-compiler
comparison src/share/vm/code/nmethod.cpp @ 20277:882004b9e7e1
8047362: Add a version of CompiledIC_at that doesn't create a new RelocIterator
Reviewed-by: iveresov, mgerdin
author | stefank |
---|---|
date | Tue, 01 Jul 2014 09:03:55 +0200 |
parents | 9717199cb8de |
children | 2c6ef90f030a |
comparison
equal
deleted
inserted
replaced
20276:1526a938e670 | 20277:882004b9e7e1 |
---|---|
1164 RelocIterator iter(this, low_boundary); | 1164 RelocIterator iter(this, low_boundary); |
1165 while(iter.next()) { | 1165 while(iter.next()) { |
1166 switch(iter.type()) { | 1166 switch(iter.type()) { |
1167 case relocInfo::virtual_call_type: | 1167 case relocInfo::virtual_call_type: |
1168 case relocInfo::opt_virtual_call_type: { | 1168 case relocInfo::opt_virtual_call_type: { |
1169 CompiledIC *ic = CompiledIC_at(iter.reloc()); | 1169 CompiledIC *ic = CompiledIC_at(&iter); |
1170 // Ok, to lookup references to zombies here | 1170 // Ok, to lookup references to zombies here |
1171 CodeBlob *cb = CodeCache::find_blob_unsafe(ic->ic_destination()); | 1171 CodeBlob *cb = CodeCache::find_blob_unsafe(ic->ic_destination()); |
1172 if( cb != NULL && cb->is_nmethod() ) { | 1172 if( cb != NULL && cb->is_nmethod() ) { |
1173 nmethod* nm = (nmethod*)cb; | 1173 nmethod* nm = (nmethod*)cb; |
1174 // Clean inline caches pointing to both zombie and not_entrant methods | 1174 // Clean inline caches pointing to both zombie and not_entrant methods |
1661 // iteration below. | 1661 // iteration below. |
1662 if (unloading_occurred) { | 1662 if (unloading_occurred) { |
1663 RelocIterator iter(this, low_boundary); | 1663 RelocIterator iter(this, low_boundary); |
1664 while(iter.next()) { | 1664 while(iter.next()) { |
1665 if (iter.type() == relocInfo::virtual_call_type) { | 1665 if (iter.type() == relocInfo::virtual_call_type) { |
1666 CompiledIC *ic = CompiledIC_at(iter.reloc()); | 1666 CompiledIC *ic = CompiledIC_at(&iter); |
1667 if (ic->is_icholder_call()) { | 1667 if (ic->is_icholder_call()) { |
1668 // The only exception is compiledICHolder oops which may | 1668 // The only exception is compiledICHolder oops which may |
1669 // yet be marked below. (We check this further below). | 1669 // yet be marked below. (We check this further below). |
1670 CompiledICHolder* cichk_oop = ic->cached_icholder(); | 1670 CompiledICHolder* cichk_oop = ic->cached_icholder(); |
1671 if (cichk_oop->holder_method()->method_holder()->is_loader_alive(is_alive) && | 1671 if (cichk_oop->holder_method()->method_holder()->is_loader_alive(is_alive) && |
1770 // static_stub_Relocations may have dangling references to | 1770 // static_stub_Relocations may have dangling references to |
1771 // Method*s so trim them out here. Otherwise it looks like | 1771 // Method*s so trim them out here. Otherwise it looks like |
1772 // compiled code is maintaining a link to dead metadata. | 1772 // compiled code is maintaining a link to dead metadata. |
1773 address static_call_addr = NULL; | 1773 address static_call_addr = NULL; |
1774 if (iter.type() == relocInfo::opt_virtual_call_type) { | 1774 if (iter.type() == relocInfo::opt_virtual_call_type) { |
1775 CompiledIC* cic = CompiledIC_at(iter.reloc()); | 1775 CompiledIC* cic = CompiledIC_at(&iter); |
1776 if (!cic->is_call_to_interpreted()) { | 1776 if (!cic->is_call_to_interpreted()) { |
1777 static_call_addr = iter.addr(); | 1777 static_call_addr = iter.addr(); |
1778 } | 1778 } |
1779 } else if (iter.type() == relocInfo::static_call_type) { | 1779 } else if (iter.type() == relocInfo::static_call_type) { |
1780 CompiledStaticCall* csc = compiledStaticCall_at(iter.reloc()); | 1780 CompiledStaticCall* csc = compiledStaticCall_at(iter.reloc()); |
1822 Metadata* md = r->metadata_value(); | 1822 Metadata* md = r->metadata_value(); |
1823 f(md); | 1823 f(md); |
1824 } | 1824 } |
1825 } else if (iter.type() == relocInfo::virtual_call_type) { | 1825 } else if (iter.type() == relocInfo::virtual_call_type) { |
1826 // Check compiledIC holders associated with this nmethod | 1826 // Check compiledIC holders associated with this nmethod |
1827 CompiledIC *ic = CompiledIC_at(iter.reloc()); | 1827 CompiledIC *ic = CompiledIC_at(&iter); |
1828 if (ic->is_icholder_call()) { | 1828 if (ic->is_icholder_call()) { |
1829 CompiledICHolder* cichk = ic->cached_icholder(); | 1829 CompiledICHolder* cichk = ic->cached_icholder(); |
1830 f(cichk->holder_method()); | 1830 f(cichk->holder_method()); |
1831 f(cichk->holder_klass()); | 1831 f(cichk->holder_klass()); |
1832 } else { | 1832 } else { |
2925 while (iter.next()) { | 2925 while (iter.next()) { |
2926 switch (iter.type()) { | 2926 switch (iter.type()) { |
2927 case relocInfo::virtual_call_type: | 2927 case relocInfo::virtual_call_type: |
2928 case relocInfo::opt_virtual_call_type: { | 2928 case relocInfo::opt_virtual_call_type: { |
2929 VerifyMutexLocker mc(CompiledIC_lock); | 2929 VerifyMutexLocker mc(CompiledIC_lock); |
2930 CompiledIC_at(iter.reloc())->print(); | 2930 CompiledIC_at(&iter)->print(); |
2931 break; | 2931 break; |
2932 } | 2932 } |
2933 case relocInfo::static_call_type: | 2933 case relocInfo::static_call_type: |
2934 st->print_cr("Static call at " INTPTR_FORMAT, iter.reloc()->addr()); | 2934 st->print_cr("Static call at " INTPTR_FORMAT, iter.reloc()->addr()); |
2935 compiledStaticCall_at(iter.reloc())->print(); | 2935 compiledStaticCall_at(iter.reloc())->print(); |