Mercurial > hg > graal-jvmci-8
comparison src/share/vm/code/nmethod.cpp @ 2375:d673ef06fe96
7028374: race in fix_oop_relocations for scavengeable nmethods
Reviewed-by: kvn
author | never |
---|---|
date | Fri, 18 Mar 2011 15:52:42 -0700 |
parents | fc5ebbb2d1a8 |
children | c7f3d0b4570f |
comparison
equal
deleted
inserted
replaced
2370:048f98400b8e | 2375:d673ef06fe96 |
---|---|
1103 "no active breakpoint"); | 1103 "no active breakpoint"); |
1104 } | 1104 } |
1105 } | 1105 } |
1106 | 1106 |
1107 | 1107 |
1108 void nmethod::verify_oop_relocations() { | |
1109 // Ensure sure that the code matches the current oop values | |
1110 RelocIterator iter(this, NULL, NULL); | |
1111 while (iter.next()) { | |
1112 if (iter.type() == relocInfo::oop_type) { | |
1113 oop_Relocation* reloc = iter.oop_reloc(); | |
1114 if (!reloc->oop_is_immediate()) { | |
1115 reloc->verify_oop_relocation(); | |
1116 } | |
1117 } | |
1118 } | |
1119 } | |
1120 | |
1121 | |
1108 ScopeDesc* nmethod::scope_desc_at(address pc) { | 1122 ScopeDesc* nmethod::scope_desc_at(address pc) { |
1109 PcDesc* pd = pc_desc_at(pc); | 1123 PcDesc* pd = pc_desc_at(pc); |
1110 guarantee(pd != NULL, "scope must be present"); | 1124 guarantee(pd != NULL, "scope must be present"); |
1111 return new ScopeDesc(this, pd->scope_decode_offset(), | 1125 return new ScopeDesc(this, pd->scope_decode_offset(), |
1112 pd->obj_decode_offset(), pd->should_reexecute(), | 1126 pd->obj_decode_offset(), pd->should_reexecute(), |
1821 nmethod* cur = _oops_do_mark_nmethods; | 1835 nmethod* cur = _oops_do_mark_nmethods; |
1822 while (cur != NMETHOD_SENTINEL) { | 1836 while (cur != NMETHOD_SENTINEL) { |
1823 assert(cur != NULL, "not NULL-terminated"); | 1837 assert(cur != NULL, "not NULL-terminated"); |
1824 nmethod* next = cur->_oops_do_mark_link; | 1838 nmethod* next = cur->_oops_do_mark_link; |
1825 cur->_oops_do_mark_link = NULL; | 1839 cur->_oops_do_mark_link = NULL; |
1840 cur->fix_oop_relocations(); | |
1826 NOT_PRODUCT(if (TraceScavenge) cur->print_on(tty, "oops_do, unmark\n")); | 1841 NOT_PRODUCT(if (TraceScavenge) cur->print_on(tty, "oops_do, unmark\n")); |
1827 cur = next; | 1842 cur = next; |
1828 } | 1843 } |
1829 void* required = _oops_do_mark_nmethods; | 1844 void* required = _oops_do_mark_nmethods; |
1830 void* observed = Atomic::cmpxchg_ptr(NULL, &_oops_do_mark_nmethods, required); | 1845 void* observed = Atomic::cmpxchg_ptr(NULL, &_oops_do_mark_nmethods, required); |