8153267: nmethod's exception cache not multi-thread safe

Reviewed-by: aph, jcm, kvn
This commit is contained in:
Martin Doerr 2016-04-07 12:33:58 +02:00
parent cd3197f341
commit 611e659be1
3 changed files with 15 additions and 11 deletions

View file

@ -313,7 +313,8 @@ bool ExceptionCache::match_exception_with_space(Handle exception) {
address ExceptionCache::test_address(address addr) {
for (int i=0; i<count(); i++) {
int limit = count();
for (int i = 0; i < limit; i++) {
if (pc_at(i) == addr) {
return handler_at(i);
}
@ -329,7 +330,6 @@ bool ExceptionCache::add_address_and_handler(address addr, address handler) {
if (index < cache_size) {
set_pc_at(index, addr);
set_handler_at(index, handler);
OrderAccess::storestore();
increment_count();
return true;
}
@ -442,10 +442,11 @@ void nmethod::add_exception_cache_entry(ExceptionCache* new_entry) {
assert(new_entry != NULL,"Must be non null");
assert(new_entry->next() == NULL, "Must be null");
if (exception_cache() != NULL) {
new_entry->set_next(exception_cache());
ExceptionCache *ec = exception_cache();
if (ec != NULL) {
new_entry->set_next(ec);
}
set_exception_cache(new_entry);
release_set_exception_cache(new_entry);
}
void nmethod::clean_exception_cache(BoolObjectClosure* is_alive) {